gnomonlearn
Docs/RFC-0017/Design Q&A

RFC-0017 · Design Q&A

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.

← Read the authored RFC

Q: Should the LSP support multi-root workspaces (multiple project.gnm roots in a single editor session)?

A: Yes. Multi-root workspaces are supported. Each project.gnm root is an independent LSP session within the same server process. Declaration resolution and cross-references that span roots MUST be handled by launching independent per-root compiler sessions and sharing the cross-root import resolution table. A compile error in one root MUST NOT prevent diagnostics from being returned for the other root.

Where normative: §3 (workspace model) of RFC-0017

Q: Should the rule compiler feedback loop support batch pre-compilation (gnomon lsp --precompile-rules) to warm the cache before editing?

A: Yes. gnomon lsp --precompile-rules pre-compiles all rule "..." strings found in the workspace at LSP startup, populating the rule compilation cache before any editing begins. The flag is optional and off by default; it adds startup latency proportional to the number of rules. Recommended for workspaces with >50 rule declarations.

Where normative: §7 (rule compilation) of RFC-0017

Q: Should the //compiled: cache comment format be standardized as part of gnomon fmt’s canonical form?

A: Yes. gnomon fmt MUST preserve //compiled: and //compiled-by: comments when they are present and MUST NOT reformat their content. It MUST NOT add these comments where they are absent. This ensures that rule compilation cache state is not destroyed by routine formatting passes. See RFC-0012 §4.6 for the comment format specification.

Where normative: §7 (rule compilation cache) of RFC-0017; RFC-0012 §4.6

Q: Should the LSP expose a custom gnomon/ruleCompiled notification so editors can show richer rule compilation UI?

A: Yes. The LSP MUST send an gnomon/ruleCompiled notification after each successful rule compilation. The notification payload includes the rule’s source range, the compiled rule ID, the compilation duration, and the cache key. Editors that handle this notification MAY display a “rule compiled” indicator. It is a progressive-enhancement notification, not a required protocol extension.

Where normative: §8 (LSP extensions) of RFC-0017

Q: What is the right debounce window for triggering rule compilation after a rule "..." edit?

A: 1500ms. This is longer than the standard diagnostic debounce (typically 300–500ms) to avoid triggering model inference on every keystroke inside a rule "..." string. The LSP MUST use a 1500ms debounce window after the last edit to a rule "..." token before dispatching a compile request. The window MUST be per-rule.

Where normative: §7 (rule compilation) of RFC-0017

Q: Should model declarations support a localOnly: true flag to prevent the LSP from sending rule text to remote providers?

A: Yes. A model declaration MAY carry localOnly: true. When set, the LSP MUST NOT dispatch rule compilation requests for rules associated with this model to any remote provider. Rule compilation for localOnly models MUST use a local inference engine only. If no local engine is available, rule compilation is skipped and the LSP emits a warning in the rule’s InlayHint rather than an error.

Where normative: §9 (model declarations) of RFC-0017