Documentation
Projection outcomes and diagnostics
Every canonical entity and every opaque block receives exactly one outcome per target. A missing or duplicated outcome is an internal invariant failure, not silent output.
The five outcomes#
exact - The target represents the canonical intent faithfully, with no information left behind.
adapted - The same intent, delivered through a different native mechanism — a procedure exported as a skill, for example.
lossy - Some canonical meaning cannot be represented. A lossy mapping must carry at least one diagnostic explaining what was lost.
blocked - The projection would be unsafe or invalid, so nothing is written for that entity.
skipped - Deliberately excluded: documentation-only, a human audience, disabled, excluded by a profile, or removed as a duplicate.
Explaining one entity#
stemma explain shows a single entity's projection for one target: its activation, where it was imported from, whether a profile touched it, the outcome, the destination and the reason.
Get an entity ID from stemma plan --target codex --explain, then replace the example ID below with one from your own project.
stemma explain context.api-layer-conventions --target codexcontext.api-layer-conventions (context) title: API layer conventions target: codex activation: paths src/api/**, src/handlers/** imported from: .github/instructions/api.instructions.md (github-copilot, parsed) lines 1-11 profile: no override outcome: lossy destination: AGENTS.md reason: No single directory could be derived from src/api/**, src/handlers/**, so the content stays in the root AGENTS.md and is no longer scoped. est. tokens: ~24 (approximate)Capability decisions for codex always-on instructions: yes path-scoped instructions: yes include glob patterns: no exclude glob patterns: no multiple include patterns: no directory-scoped delivery: yes native skills: yes native specialist agents: no native procedures/prompts: no The same entity compiled for Claude Code is exact, because paths: front matter can carry both patterns. That difference between targets, made visible per entity, is the point of the command.
What a diagnostic carries#
A code, a severity of info, warning or error, a one-line summary, and optionally a detailed explanation, a source path, a line and column, a canonical entity id, a target and a suggested resolution. It also carries blocking and a stable fingerprint.
The fingerprint is derived from code, severity, path, entity id and target — deliberately not from prose — so improving a message never invalidates an acceptance recorded in a profile. Diagnostics are sorted deterministically and de-duplicated in both human and JSON output.
Accepting a reviewed diagnostic#
Once you have reviewed a mapping and decided the loss is acceptable, list its fingerprint in the target profile. Accepted diagnostics are downgraded to info and stop blocking apply — but they stay visible. Acceptance is not suppression.
{ "schemaVersion": 1, "target": "codex", "overrides": {}, "acceptedDiagnostics": ["dg_184cf4cbcf883cfa"]} Fingerprints come from stemma plan --target <target> --json. Replace the example fingerprint with the one you reviewed, and merge it into the existing profile without discarding overrides or earlier acceptances. Re-run the plan and check --warnings-as-errors for that target after generating its reviewed output.
Ownership diagnostics#
STEMMA4302 is reported at import, when the canonical project cannot be compiled back into a source file byte-for-byte. It is a warning: the import is still saved, but that file is left unowned, so a later attempt to overwrite it is a STEMMA4301 conflict.
STEMMA4303 is a warning during import when replacing the canonical project revokes a destination's ownership and the new import does not re-establish it. It names the path and target; the provider file stays untouched. An identical re-import preserves ownership, and normal edits to .stemma/ followed by apply also preserve it.
STEMMA4301 reports a later write conflict. A destination Stemma has neither written nor verified is foreign, as is one whose ownership was revoked by a project replacement; --adopt-untracked authorizes replacing those files after review. The flag does not bypass an external edit to a tracked file or a source that failed STEMMA4302. Preserve those edits or reconcile the unverified source first. Adopting a file Stemma does not own covers exactly which states the flag changes.
Accepting a fingerprint does not change any of this. Acceptance downgrades a projection diagnostic you have reviewed; it is not a way to authorize a write over a file whose ownership was never established.
Code families#
Diagnostic codes are part of Stemma's public contract: human wording may improve, codes do not change after release, and numbers are never reused.
Discovery and parsing
Something about a source file could not be read or interpreted safely.
STEMMA1101_INVALID_FRONT_MATTERwarning/errorFront matter could not be parsed, or a recognized field has the wrong type — the diagnostic names the key, the expected type and the type foundSTEMMA1103_UNSAFE_YAML_CONSTRUCTerrorA tag, anchor, alias or merge key was refusedSTEMMA1203_OPAQUE_BLOCK_PRESERVEDinfoContent preserved verbatim without interpretationSTEMMA1301_MULTIPLE_SOURCESerrorSeveral providers detected; Stemma will not merge silently
Canonical validation
The canonical project, its ids, activations, globs or profiles are invalid.
STEMMA2003_MISSING_REQUIRED_FIELDerrorA required field is empty, holds an unknown enum value, or a canonical entity file has no front matter blockSTEMMA2005_INVALID_ACTIVATIONerrorThe activation union invariants were violatedSTEMMA2101_INVALID_GLOBerror/warningA pattern is invalid or escapes the repositorySTEMMA2102_GLOB_EXPANSION_LIMITerrorBrace expansion exceeds 1000 alternatives or 32 nested groups; import is rejected rather than partially expandedSTEMMA2302_PROFILE_OVERRIDES_UNKNOWN_ENTITYwarningA profile overrides an entity that does not exist
Projection
A canonical concept met the limits of a provider format.
STEMMA3001_TARGET_UNAVAILABLEerrorThe target is declared but not implemented (exit code 3)STEMMA3101_EXCLUDE_NOT_REPRESENTABLEwarningThe provider has no negative pattern syntaxSTEMMA3102_PATTERN_NOT_REPRESENTABLEwarningA pattern contains a comma, which a comma-separated pattern list cannot expressSTEMMA3201_DIRECTORY_SCOPE_AMBIGUOUSwarningPatterns do not resolve to one directory; Stemma will not invent oneSTEMMA3302_AGENT_NOT_NATIVELY_SUPPORTEDwarningThe target has no specialist-agent formatSTEMMA3601_TARGET_CONTENT_OVERRIDDENwarningA profile replaced the canonical wording for this target
Filesystem and transactions
A path, a symlink, a stale plan or a rolled-back write stopped the operation.
STEMMA4001_PATH_ESCAPEerrorA path would leave the workspaceSTEMMA4002_SYMLINK_REJECTEDerrorA destination is a symbolic link; Stemma never writes through oneSTEMMA4101_STALE_PLANerrorThe repository changed after the plan was built (exit code 4)STEMMA4301_UNTRACKED_DESTINATIONerrorAn attempted write conflicts with an unowned destination or an external edit; unowned destinations include files whose ownership was revoked by project replacementSTEMMA4302_IMPORT_ROUND_TRIP_UNVERIFIEDwarningImport could not reproduce a source byte-identically at the same path, so no ownership was recorded for itSTEMMA4303_IMPORT_OWNERSHIP_REVOKEDwarningImport replaced the canonical project; this destination lost ownership, was not re-verified by the new import, and was left untouchedSTEMMA4501_OUTPUT_STALEerrorcheck found generated output that is out of date
Budgets
Approximate context estimates against the budgets you configured.
STEMMA5001_TOKEN_BUDGET_EXCEEDEDwarningAn approximate estimate exceeds a configured budgetSTEMMA5002_ALWAYS_ON_CONTEXT_LARGEinfoAlways-on context is large and no budget is set
Internal
A compiler invariant failed. Usually a bug in Stemma — with one exception you can act on: two entities resolving to the same generated destination.
STEMMA6001_INTERNAL_INVARIANTerrorA compiler invariant failed, or two mappings collided on one destination. Every affected mapping is blocked, exit code 6, and no files are written
The complete list
These are the codes you are most likely to meet. Every code, with its exact severity and meaning, is documented in the repository. docs/diagnostics.md ↗
How exit codes map onto these families is covered in workflow and CI.