docs(framing): OGAR as IR — the compiler framing as a one-pager#104
Merged
Conversation
New docs/OGAR-AS-IR.md names the architectural lens: lance-graph is a
multi-phase compiler whose IR is OGAR. The doc is a lens, not a new
abstraction layer — it labels the layer already shipped, in standard
compiler vocabulary.
Five sections:
§1. The mapping — compiler phase → OGAR / lance-graph piece (front-end
readers / IR / symbol table / linker / public ABI / semantic
analysis / optimization passes / codegen back-ends / native codegen
via jitson / runtime via lance-graph-callcenter).
§2. Existing decisions restated in compiler vocabulary — ten doctrine
statements paired with their standard compiler primitives ("classid
is pure address" = SSA value-id with a symbol table; "never
producer → DDL" = no eval at codegen time; "BBB-barrier" = internal
IR types vs public ABI; …).
§3. Six tests for new IR design — checklist a proposal must pass before
adding to Class / ActionDef / KausalSpec / any IR surface:
(1) SSA / dataflow-explicit
(2) effect annotations are first-class
(3) typed signature, not field bag
(4) lowering passes are named, not implicit
(5) optimization passes declare a semantic-preservation guarantee
(6) the IR is the canonical artifact
§4. Cross-references — eight existing docs labeled as already-compiler-
shaped: THE-FIREWALL.md, OGAR-AST-CONTRACT.md, SURREAL-AST-AS-
ADAPTER.md, APP-CLASS-CODEBOOK-LAYOUT.md, CLASSID-RBAC-KEYSTONE-
SPEC.md, OGAR-CONSUMER-BEST-PRACTICES.md, CONSUMER-MIGRATION-
HOWTO.md, SURREAL-AST-TRAP-PREFLIGHT.md — each paired with its
compiler equivalent.
§5. Why this framing — vocabulary (fifty years of compiler engineering)
+ discipline (compiler IRs are designed to be optimized, lowered,
analyzed; ontologies are designed to be queried).
Registration:
- Added as a new top row in the Design Guards table in both README.md
and README.de.md.
- Added as doc-family entry #9 in CLAUDE.md with a READ-BEFORE rule for
any IR-surface addition.
All 9 cross-referenced docs verified to resolve. Docs-only. The framing
changes no existing decision; it changes every future one.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new
docs/OGAR-AS-IR.mdthat names the architectural lens already in use: lance-graph is a multi-phase compiler whose IR is OGAR. The doc is a lens, not a new abstraction layer — it labels the layer already shipped, in vocabulary that has been field-tested for fifty years of compiler engineering.Five sections
jitson, runtime vialance-graph-callcenter)evalat codegen time; "BBB-barrier" = internal IR types vs public ABITHE-FIREWALL.md,OGAR-AST-CONTRACT.md,SURREAL-AST-AS-ADAPTER.md,APP-CLASS-CODEBOOK-LAYOUT.md,CLASSID-RBAC-KEYSTONE-SPEC.md,OGAR-CONSUMER-BEST-PRACTICES.md,CONSUMER-MIGRATION-HOWTO.md,SURREAL-AST-TRAP-PREFLIGHT.md), each paired with its compiler equivalentRegistration
README.mdandREADME.de.mdCLAUDE.mdwith a READ-BEFORE rule for any IR-surface additionVerification
All 9 cross-referenced docs verified to resolve. Zero emoji / zero AI-pattern phrasing / zero named individuals. Docs-only.
What it does and does not do
The framing changes no existing decision — every doctrine and every shipped doc remains exactly as it was. It changes every future decision by giving contributors a vocabulary that has fifty years of design experience encoded in it. Saying "OGAR is a graph ontology" loses the SSA / lowering / optimization / linker shapes. Saying "OGAR is the IR of a compiler" recovers them.
Generated by Claude Code