docs(OGAR): consumer best-practices guide + classid-is-address precision#100
Merged
Merged
Conversation
Two coupled sharpenings of the consumer-side doctrine, born from cross-
session corroboration on the GUID layout question:
1) New OGAR-CONSUMER-BEST-PRACTICES.md — the muscle-memory guide.
Pattern-centric, example-heavy. Drilled with worked classid values
across every consumer (medcare 0x0005_0901, woa 0x0003_0103, smb
0x0004_0204, odoo 0x0002_0103, openproject 0x0001_0102, redmine
0x0007_0102, the 5-way BILLABLE_WORK_ENTRY convergence pin):
§0 the one-line invariant + three drilled corollaries
§1 address anatomy with concrete hi/lo examples + APP allocation
table + domain byte table
§2 the four canonical patterns:
Pattern 1 — pull classid (Port::class_id)
Pattern 2 — compose render classid (APP_PREFIX | concept)
Pattern 3 — authorize by classid (interim until keystone)
Pattern 4 — distill/migrate from legacy bridge (4a one-line
import repoint; 4b full structural drop)
Each pattern shown with ✅ canonical + ❌ anti shapes.
§3 anti-pattern catalogue paired with right-shape references
§4 worked migration narrative — Medcare patient end-to-end
§5 activation triggers + agents that load Tier-1
§6 cross-refs (incl. lance-graph #591 parallel-session sibling)
2) SURREAL-AST-TRAP-PREFLIGHT.md §0 — sharpens the spellbook with the
precision from lance-graph #591: "the classid is pure address; the
magic is what it resolves to." Explains why the trap is structurally
impossible to fix from inside DDL — SurrealQL has the address but
not the Core types behavior resolves to, so encoding lifecycle in
DEFINE EVENT is putting the value into the key. Cross-link to best-
practices guide added to §Cross-refs.
3) CLAUDE.md — registered best-practices guide as doc-family #8; added
matching non-negotiable ("Consumer call sites: classid is address,
magic is at the resolution target") under the existing SurrealQL
non-negotiable.
4) APP-CLASS-CODEBOOK-LAYOUT.md — top-of-doc cross-ref to the new
muscle-memory guide; reinforces hi-u16 = render magic ≠ class magic
distinction.
Companions to lance-graph #591 (parallel session's
`.claude/knowledge/ogar-consumer-preflight.md` + ISS-CONTRACT-APP-
PREFIX-MIRROR Core-gap entry) — same spellbook pattern, cast in two
domains. Two independent sessions converging on the address-vs-magic
precision is the muscle the two docs together drill across every
future consumer-side session.
Doc-only PR; no code touched.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
AdaWorldAPI
pushed a commit
that referenced
this pull request
Jun 22, 2026
…aph #592 coordination loop PR #592 (parallel session) closed `ISS-CONTRACT-APP-PREFIX-MIRROR` by mirroring OGAR #97's `PortSpec::APP_PREFIX` / `render_classid_for` into `lance_graph_contract::ogar_codebook` as `AppPrefix` + `render_classid_for_concept` (wire-compat, parity-pinned, no `ogar-vocab` dep). Its coordination note left the OGAR-side companion — the spine-vs-membrane import-path distinction in OGAR #100 §2 — to this session. This commit closes that loop. Changes to docs/OGAR-CONSUMER-BEST-PRACTICES.md: §2 — new preface block: pins the BBB-barrier rule (spine-internal crates freely depend on `ogar-vocab`; membrane crates restricted to `lance-graph-contract` only), with the allowed-deps × canonical-path table. Both paths return identical classids — the choice is dep-tree posture, not concept identity. Pattern 1 split — Pattern 1a (spine, `ogar_vocab::ports::*Port::class_id`) + Pattern 1b (membrane, `lance_graph_contract::ogar_codebook::canonical_concept_id`). Pattern 2 split — Pattern 2a (spine, `*Port::APP_PREFIX | concept`) + Pattern 2b (membrane, `AppPrefix::*.render(cid)` or `render_classid_for_concept(AppPrefix::*, name)` — the one-call helper). Cites lance-graph #592, names the parity test `app_prefixes_match_ogar_allocation_table` as the drift fuse. §5 trigger phrases — extended with `BBB-barrier` · `contract::ogar_codebook` · `canonical_concept_id` · `AppPrefix` · `render_classid_for_concept` · `lance_graph_contract::ogar_codebook` · `membrane consumer` · `spine vs membrane`. §6 cross-refs — sharpened lance-graph #591 entry (surfaced the gap) and added lance-graph #592 entry (closed it with the membrane mirror). Patterns 3 + 4, §3 anti-pattern catalogue, §4 worked Medcare migration narrative — unchanged (they're correct as-is; the membrane variant inherits from the new 1b/2b without further branching). Docs-only. Closes the consumer/membrane half of the ISS-CONTRACT-APP-PREFIX-MIRROR coordinated fix. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
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
Two coupled sharpenings, born from cross-session corroboration on the GUID layout question (parallel session shipped lance-graph #591 with the same address-vs-magic precision — two independent sessions converging on the framing is the muscle these docs together drill).
Four files
1.
docs/OGAR-CONSUMER-BEST-PRACTICES.md(new) — the muscle-memory guidePattern-centric, example-heavy. Every claim shown with a real classid value and a real consumer. Designed for cross-session muscle memory, per operator request.
0x0000_0901(canonical patient) ·0x0005_0901(Medcare's render) ·0x0001_0102/0x0007_0102(WorkPackage/Issue, same concept different render) · the five-wayBILLABLE_WORK_ENTRYconvergence pin (0x0003_0103/0x0004_0103/0x0001_0103/0x0007_0103/0x0002_0103). APP allocation table + domain byte table.Port::class_id(name)) — example calls across every consumer's PortSpecAPP_PREFIX | concept) using OGAR feat(ogar-vocab): APP‖class machinery — typed PortSpec::APP_PREFIX + app render-classid composition #97's typed helperlance-graph-rbackeystone lands)2.
docs/SURREAL-AST-TRAP-PREFLIGHT.md— §0 prefix addedSharpens the spellbook with the precision from #591: "the classid is pure address; the magic is what it resolves to." Explains why the trap is structurally impossible to fix from inside DDL — SurrealQL has the address but not the Core types behavior resolves to, so encoding lifecycle in
DEFINE EVENTis putting the value into the key.3.
CLAUDE.md— registered4.
docs/APP-CLASS-CODEBOOK-LAYOUT.md— cross-ref addedTop-of-doc pointer to the muscle-memory guide; reinforces the hi-u16 = render magic ≠ class magic distinction (the precision I missed in my first pass).
The address-vs-magic precision (the sharpening)
The classid carries no magic. Class-magic (rails ActiveRecord-style callbacks, lifecycle, validations) is a property of the Core node the address resolves to — never of the address itself. The hi u16 picks render magic (which app's template), never class magic.
This is why the trap spellbook (#99) forbids smuggling behavior into DDL: DDL has the address but not the Core types it resolves to.
Cross-session convergence — same shape, two domains
docs/SURREAL-AST-TRAP-PREFLIGHT.mddocs/OGAR-CONSUMER-BEST-PRACTICES.md.claude/knowledge/ogar-consumer-preflight.md+ISS-CONTRACT-APP-PREFIX-MIRRORCore-gap entryDoc-only PR. Nothing code-side touched.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
Generated by Claude Code