RFC-0018 · Reference catalog
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.
Generated reference catalog. This page renders structured Lean data for RFC-0018: defined terms, diagnostics, dependencies, and invariants. It does not establish proof coverage or runtime conformance. The authored narrative lives in
RFC-0018.This page is generated from the
lean/Gnomon/Spec/module for RFC-0018. Edit that source and regenerate this catalog.
Title: Gnomon Compiler Services
Status: draft
Owners: Compiler, DX
Proof citations in source: 8 / 8. Standalone proof verification is pending.
Definitions
(none defined)
Diagnostics
(none introduced)
Invariants
- Rule cache entries with userEdited true are never evicted; manual user edits take permanent precedence over LLM output. (enforced by: runtime)
- Rule compilation invokes the configured model with temperature 0 regardless of the model’s parameters, for determinism. (enforced by: runtime)
- Scope queries must answer on partially-parsed files and return best-effort results rather than failing on incomplete input. (enforced by: runtime)
- The .gnomon-cache directory must have filesystem permissions restricted to the current user; cache files must not be world-readable. (enforced by: runtime)
- The LSP must not implement symbol resolution, scope analysis, or type checking independently and must delegate all such queries to the compiler session. (enforced by: compile-time)
- The compiler daemon must bind only to 127.0.0.1; any attempt to bind to 0.0.0.0 must be rejected. (enforced by: runtime)
- The compiler must log a warning on first invocation per session when the configured model provider is non-local. (enforced by: runtime)
- The compiler must treat a committed //compiled: comment as authoritative when rule-hash, model digest, and template version match. (enforced by: compile-time)
- The compiler session must not execute any .gnm source code; it is a static analysis tool only. (enforced by: compile-time)
- The compiler session must produce diagnostics identical to the CLI compiler for the same input; any divergence is a defect. (enforced by: compile-time)
- The property registry must be derived mechanically from the RFC-0008 grammar and must not be hand-edited. (enforced by: compile-time)
- The rule compiler service must be invokable from both the LSP session and the CLI build using the same cache and model invocation protocol. (enforced by: compile-time)
- The rule compiler service must not be invoked with a model that is not declared in the project’s symbol table and visible to the session. (enforced by: compile-time)
- gnomon fmt must preserve //compiled: and //compiled-by: structured comments immediately following a rule statement. (enforced by: compile-time)
Normative Statements
Statements are structured source data. Proof citations, where present, have not passed a standalone Gnomon proof gate.
Compiler Daemon (Debug Interface)
- MUST_NOT — The debug RPC interface MUST NOT be exposed on a public network interface.
- MUST_NOT — The debug RPC interface MUST NOT be used by the LSP transport layer.
- MUST — The debug RPC interface MUST bind to 127.0.0.1 only.
Diagnostic Contract
- MAY — The CLI compiler MAY apply quick-fixes with gnomon build —fix.
- MUST — The LSP MUST expose Diagnostic.fix entries as textDocument/codeAction quick-fixes.
Invariants
- MUST — Scope queries MUST be answerable on partially-parsed files and return best-effort results.
- MUST_NOT — The LSP MUST NOT implement symbol resolution, scope analysis, or type checking independently. (proof citation:
rfc0018_b2_grounded; verification pending) - MUST — The LSP MUST delegate all symbol/scope/type queries to the compiler session.
- MUST — The compiler session MUST produce identical diagnostics to the CLI compiler for the same input. (proof citation:
rfc0018_b0_grounded; verification pending) - MUST_NOT — The property registry MUST NOT be maintained as a separate hand-edited document. (proof citation:
rfc0018_b23_grounded; verification pending) - MUST — The property registry MUST be derived mechanically from the grammar. (proof citation:
rfc0018_b10_grounded; verification pending) - MUST — The rule compiler service MUST be invokable from both LSP and CLI using the same cache and model invocation protocol.
Parse Context
- MUST — The parser MUST produce a best-effort ParseContext even for files with syntax errors.
Property Registry
- MUST — The LSP MUST use snippet generation from the property registry rather than hardcoded snippet strings. (proof citation:
rfc0018_b7_grounded; verification pending)
Rule Compiler Service
- MUST — Custom rule-compiler provider binaries MUST write a JSON response to stdout.
- MUST — Exactly one of digest or version MUST be present on a ModelRef; digest takes precedence.
- MUST — The compiler MUST treat a committed //compiled: comment as authoritative when rule-hash, model digest, and template version match. (proof citation:
rfc0018_b19_grounded; verification pending) - MUST — gnomon fmt MUST preserve //compiled: and //compiled-by: comments immediately following a rule statement. (proof citation:
rfc0018_b21_grounded; verification pending)
Security
- MUST — The .gnomon-cache/ directory MUST have filesystem permissions restricted to the current user.
- MUST_NOT — The compiler MUST NOT write cache files that are world-readable.
- MUST — The compiler MUST log a warning on first per-session invocation when the rule-compiler model provider is non-local.
- MUST — The compiler daemon MUST bind only to 127.0.0.1; binding to 0.0.0.0 MUST be rejected.
- MUST_NOT — The compiler session MUST NOT execute any .gnm source code.
- MUST_NOT — The rule compiler service MUST NOT be invoked with a model not declared in the project symbol table. (proof citation:
rfc0018_b26_grounded; verification pending)
Linked References
(no cross-RFC dependencies)