gnomonlearn
Docs/RFC-0017 LSP diagnostic and domain proposal

RFC-0017 LSP diagnostic and domain proposal

Versioned draft snapshot

RFCs, reference catalogs, and evidence reflect Spec 3b2e3e7a114fb826b1445d39a48756b8fff629cd. Counts and pending/status notes belong to that snapshot. Read the dated project update for later progress.

Source repositories are private during staging. Links marked “repository access required” need access to the linked repository.

This is a trace and gap record from the pinned draft specification. It does not establish proof or implementation conformance.

Evidence

RFC-0017 §3 says LSP diagnostics use compiler M/F codes and forbids custom LSP-only error codes. Section 5.5 also requires L-codes from RFC-0017 for LSP state (for example L0020 model unavailable and L0022 stale rule cache). Its Lean diagnostic catalog defines six L-codes, while the Lean invariant says M-, F-, and L-codes are the same as compiler codes. The categories and ownership are therefore unclear.

RFC-0017 §11 says .gnomon-cache/ may contain nothing other than rule compilation cache entries. RFC-0018 §17 stores rule entries under .gnomon-cache/rules/; RFC-0044 §5.4 stores transform entries under .gnomon-cache/transforms/. The broad RFC-0017 restriction would forbid a required build cache.

The domain projection types gnomon.lsp as a Gnomon Module, but RFC-0017 §4 says the language server is distributed in the gnomon CLI toolchain and invoked as gnomon lsp. It defines no importable Gnomon module named gnomon.lsp. Six LSP invariants use that unsupported module IRI as invariantOf. The projection also types “authoring-time” as a DiagnosticPhase without an authored phase declaration.

Eleven LSP method nodes are typed with ontology Operation, whose current definition is an algebra operation kind (Source, Refinement, Composition, Aggregation, Materialization). LSP protocol methods such as textDocument/completion are not algebra operation kinds. They need a protocol-method class or a deliberately broadened ontology definition.

The RFC-0017 §3–§4 claim review now binds eleven nodes to the authored RFC and Lean source: four match and seven mismatch. The mismatches include the unsupported gnomon.lsp module subject and the unresolved L-code scope. Two claim texts were corrected directly from the authored wording: use the configured rule-compiler model when available, and load the full project symbol table when project.gnm is found, with single-file fallback. Regeneration changed two claimText literals and no claim IRIs. An in-memory before/after comparison of all 16 checked-in claim-query result lists found no changed list (550 rows on each side). Projection drift, source-bound review, RDF-link, and claim-query gates pass; external RDF clients that read either literal have not been verified. The remaining class and diagnostic scope mismatches still need an owner decision before RDF correction.

  • Compiler diagnostics retain their M/F codes and exact severity/anchor when published through LSP. The LSP cannot suppress, remap, or invent compiler errors.
  • L-codes are a separate, RFC-0017-owned namespace for editor service state and user-facing status. They do not alter compiler validity and are not emitted in compiler CLI or bundle diagnostics. Keep the six authored L-codes, with one structured catalog and severity definitions.
  • Credential and token material is forbidden anywhere under .gnomon-cache/. Restrict rule-only content to .gnomon-cache/rules/; reserve .gnomon-cache/transforms/ for RFC-0044 build artifacts. Both follow the current-user permission rule in RFC-0018. A cache reader must reject entries from the wrong namespace.
  • Model the language server as a toolchain/runtime component rather than an importable module, and retarget its invariant links. Keep “authoring time” as descriptive scope unless a shared diagnostic phase taxonomy is authored.
  • Give LSP methods a protocol-method class with their existing method names. Preserve the algebra-operation meaning of the current Operation class.

Acceptance

  • LSP diagnostics mirror compiler M/F output for the same unsaved document and add only allowed L status diagnostics.
  • CLI/compiler output never contains L codes; a stale rule cache produces L0022 in the editor without changing compilation validity.
  • Rules and transforms write to separate cache subdirectories, and neither accepts credentials or tokens.
  • RFC-0017, RFC-0018, RFC-0044, Lean catalogs, generated references, RDF claims, and diagnostic inventories express the same scope.
  • Domain RDF, claim queries, and local framework KG consumers agree on the language server identity after the IRI change.

Nothing is deployed, so no cache migration is needed for the first release.