Spec-20-Lint-Semantics
What this spec defines
The read-only lint sweep contract, finding shape, severity mapping,
filters, and async job behavior. HTTP route shape is owned by
Spec-03-HTTP-API; this spec owns what a lint request means and
how findings are interpreted.
Extraction status
This component spec extracts the lint semantics that previously
lived in the monolithic stigmem-spec-v0.9.0a1.md lineage.
Purpose
Lint is a read-only diagnostic sweep over facts in one scope.
A lint run MUST NOT assert facts, retract facts, resolve conflicts, create or delete entities, or mutate storage state other than implementation-local job bookkeeping for asynchronous execution. Lint results are advisory.
Checks
Nodes MUST support these check names:
contradictionstaleorphanbroken_refnamespacingIf a lint request omits checks or supplies an empty list, the node
MUST run all supported checks.
Scope and filters
Every lint run is confined to exactly one requested scope. Implementations MUST apply the caller's read authorization for that scope before inspecting facts.
scopechecksentityrelationstale_lookahead_sUnknown scopes or check names MUST fail validation. A caller without read access to the requested scope MUST receive an authorization failure.
Finding shape
Each lint finding MUST include:
checkseverityerror, warning, or info.entityrelationfact_idsdetailFindings SHOULD be deterministic for a stable input store so repeated lint runs are useful in tests and operator diffs.
Severity mapping
Nodes MUST use this baseline severity mapping:
stale_lookahead_sintent:handoff_to/intent:context_refImplementations MAY add detail text, but MUST NOT downgrade the severities above.
Result shape
A completed lint run MUST return:
findingschecked_atscopechecks_runfact_countHTTP and async execution
The stable HTTP lint surface includes:
POST /v1/lint
GET /v1/lint/jobs/{job_id}
Small lint runs SHOULD complete synchronously with a completed
result body. Large lint runs MAY return 202 Accepted with:
job_idstatuspending.estimated_sThe reference node uses the configured async_job_threshold to
choose the async path; its default threshold is 100,000 facts. Other
conforming nodes MAY choose a different documented threshold.
Polling GET /v1/lint/jobs/{job_id} MUST eventually return either
the completed lint result or a terminal failure status for known
jobs. Unknown job ids MUST be reported as not found.
MCP and tooling
MCP wrappers and operator tools MUST preserve this spec's scope, check, filter, and finding semantics.
Tooling MAY present findings in a more ergonomic format, but MUST
NOT hide error severity findings by default.
Out of scope
This spec does not define:
Conflict resolution
Or fact retraction workflows.
Decay/synthesis/confidence-repair
Adapter-specific context repair
Storage query plans
Or indexing strategy.