warning

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package warning defines Plasmid's framework-free non-fatal warning contract.

Index

Constants

View Source
const (
	WarnContextReadError              = "context.read.error"
	WarnContextDiscoveryTruncated     = "context.discovery.truncated"
	WarnContextFileTruncated          = "context.file.truncated"
	WarnContextDedupDropped           = "context.dedup.dropped"
	WarnContextBudgetDropped          = "context.budget.dropped"
	WarnContextImportMissing          = "context.import.missing"
	WarnContextImportCycle            = "context.import.cycle"
	WarnContextImportDepth            = "context.import.depth"
	WarnContextImportEscape           = "context.import.escape"
	WarnContextImportNotClaude        = "context.import.notclaude"
	WarnContextFrontmatterUnsupported = "context.frontmatter.unsupported"
	WarnContextGlobInvalid            = "context.glob.invalid"
	WarnContextGlobUnsupported        = "context.glob.unsupported"
	WarnContextTouchOverflow          = "context.touch.overflow"
	WarnCodingtoolsBashOmitted        = "codingtools.bash.omitted"

	WarnForeignIndexMissing            = "foreign.index.missing"
	WarnForeignIndexUnreadable         = "foreign.index.unreadable"
	WarnForeignIndexUnsupportedVersion = "foreign.index.unsupported_version"
	WarnForeignEntryShapeUnknown       = "foreign.entry.shape_unknown"
	WarnForeignInstallPathMissing      = "foreign.install_path.missing"
	WarnForeignInstallPathRelative     = "foreign.install_path.relative"
	WarnForeignManifestMissing         = "foreign.manifest.missing"
	WarnForeignManifestInvalid         = "foreign.manifest.invalid"
	WarnForeignPathEscape              = "foreign.path.escape"
	WarnForeignSkillMissingMarkdown    = "foreign.skill.missing_markdown"
	WarnForeignDuplicateSkill          = "foreign.duplicate.skill"
	WarnForeignDuplicateTemplate       = "foreign.duplicate.template"
	WarnForeignDuplicateMCPServer      = "foreign.duplicate.mcp_server"
	WarnForeignMCPShapeUnknown         = "foreign.mcp.shape_unknown"
	WarnForeignMCPInert                = "foreign.mcp.inert"
	WarnForeignTOMLUnsupported         = "foreign.toml.unsupported"
	WarnForeignScanPanic               = "foreign.scan.panic"
	WarnForeignScanTruncated           = "foreign.scan.truncated"
	WarnForeignEcosystemDisabled       = "foreign.ecosystem.disabled"
	WarnForeignPermissionInert         = "foreign.permission.inert"
	WarnForeignAmbiguousName           = "foreign.name.ambiguous"
	WarnForeignProjectUntrusted        = "foreign.project.untrusted"

	WarnSyntaxUnsupportedField     = "syntax.unsupported-field"
	WarnSyntaxUnknownField         = "syntax.unknown-field"
	WarnSyntaxInvalidField         = "syntax.invalid-field"
	WarnSyntaxDuplicateField       = "syntax.duplicate-field"
	WarnSyntaxInvalidFrontmatter   = "syntax.invalid-frontmatter"
	WarnSyntaxDuplicateArgument    = "syntax.duplicate-argument"
	WarnSyntaxShellUnsupported     = "syntax.shell-unsupported"
	WarnSyntaxDocumentNotInvocable = "syntax.document-not-invocable"
	WarnSyntaxInvalidGlob          = "syntax.invalid-glob"
	WarnSyntaxUnresolvedVariable   = "syntax.unresolved-variable"
	WarnSyntaxMissingArgument      = "syntax.missing-argument"
	WarnSyntaxExecDisabled         = "syntax.exec-disabled"
	WarnSyntaxExecBudgetExhausted  = "syntax.exec-budget-exhausted"
	WarnSyntaxExecFailed           = "syntax.exec-failed"
	WarnSyntaxExecTimeout          = "syntax.exec-timeout"
	WarnSyntaxInvalidToolPattern   = "syntax.invalid-tool-pattern"

	WarnLSPConfigUnknownKey      = "lsp.config.unknown_key"
	WarnLSPConfigInvalidServer   = "lsp.config.invalid_server"
	WarnLSPConfigDuplicateServer = "lsp.config.duplicate_server"
	WarnLSPUnavailable           = "lsp.server.unavailable"
	WarnLSPStartFailed           = "lsp.server.start_failed"
	WarnLSPInitializeFailed      = "lsp.server.initialize_failed"
	WarnLSPRequestFailed         = "lsp.request.failed"
	WarnLSPDiagnosticsUnsettled  = "lsp.diagnostics.unsettled"

	WarnConfigUnknownKey         = "config.unknown_key"
	WarnConfigPathMissing        = "config.path_missing"
	WarnConfigBadEnum            = "config.bad_enum"
	WarnConfigInvalidValue       = "config.invalid_value"
	WarnConfigMCPIncomplete      = "config.mcp_incomplete"
	WarnConfigAllowlistUnmatched = "config.allowlist_unmatched"
	WarnConfigVersionDefaulted   = "config.version_defaulted"

	WarnMCPConnectFailed    = "mcp.connect.failed"
	WarnMCPToolInvalid      = "mcp.tool.invalid"
	WarnMCPToolCollision    = "mcp.tool.collision"
	WarnPluginCallbackPanic = "plugin.callback.panic"

	WarnSessionIDEmpty                  = "session.id.empty"
	WarnSessionIDTooLong                = "session.id.too_long"
	WarnSessionLogCorrupt               = "session.log.corrupt"
	WarnSessionLogTornTail              = "session.log.torn_tail"
	WarnSessionLogCorruptMiddle         = "session.log.corrupt_middle"
	WarnSessionRecordUnsupportedVersion = "session.record.unsupported_version"
	WarnSessionRecordUnknown            = "session.record.unknown"
	WarnSessionSnapshotRefresh          = "session.snapshot.refresh"
	WarnSessionDurabilityRetry          = "session.durability.retry"
	WarnSessionLegacyStateLoss          = "session.state.legacy_incomplete"
	WarnSessionOrderDuplicate           = "session.order.duplicate"

	WarnCompactionBudgetExhausted = "compaction.budget.exhausted"
	WarnCompactionEstimateFailed  = "compaction.estimate.failed"
	WarnCompactionSidecarLoad     = "compaction.sidecar.load"
	WarnCompactionSidecarSave     = "compaction.sidecar.save"

	WarnADKEventMalformed   = "adk.event.malformed"
	WarnADKEventUnknownPart = "adk.event.unknown_part"

	WarnWalkInvalidIgnorePattern = "walk.invalid_ignore_pattern"
	WarnWalkUnreadableIgnore     = "walk.unreadable_ignore"
)

Warning codes are stable, producer-namespaced fixture identities. Messages remain human-readable detail and are not a compatibility surface.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscardSink

type DiscardSink struct{}

DiscardSink ignores warnings.

func (DiscardSink) Warn

func (DiscardSink) Warn(Warning)

Warn implements Warner.

type Sink

type Sink = Warner

Sink preserves source compatibility for existing hosts.

type SliceSink

type SliceSink struct {
	// contains filtered or unexported fields
}

SliceSink collects warnings safely in append order.

func (*SliceSink) Warn

func (s *SliceSink) Warn(value Warning)

Warn appends a warning to the sink.

func (*SliceSink) Warnings

func (s *SliceSink) Warnings() []Warning

Warnings returns a defensive copy in append order.

type SlogSink

type SlogSink struct {
	Logger *slog.Logger
}

SlogSink writes warnings as structured slog records.

func (SlogSink) Warn

func (s SlogSink) Warn(value Warning)

Warn implements Warner.

type Warner

type Warner interface {
	Warn(Warning)
}

Warner receives non-fatal degradation notices.

type Warning

type Warning struct {
	Code    string `json:"code"`
	Source  string `json:"source"`
	Path    string `json:"path"`
	Line    int    `json:"line"`
	Message string `json:"message"`
}

Warning is the single warning shape emitted by every subsystem.

func (Warning) String

func (w Warning) String() string

String renders the stable warning line.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL