Skip to content

Commit d0806bd

Browse files
committed
docs(OGAR): consumer best-practices guide + classid-is-address precision
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
1 parent 273fa78 commit d0806bd

4 files changed

Lines changed: 458 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,15 @@ alignment costs. Until measured: 3×4 stands.
189189
Operational pre-flight: `docs/SURREAL-AST-TRAP-PREFLIGHT.md` (the
190190
spellbook — five questions, 90 seconds, MANDATORY before any
191191
producer→IR / transcode / codegen / `.surql` authoring session).
192+
8. `docs/OGAR-CONSUMER-BEST-PRACTICES.md` — the muscle-memory guide
193+
for every consumer-side session (medcare-rs, woa-rs, smb-office-rs,
194+
odoo-rs, openproject-nexgen-rs, q2). One-line invariant: **the
195+
classid is pure address; the magic is what it resolves to.** Drilled
196+
with worked examples across every PortSpec, the four canonical
197+
patterns (pull classid · compose render · authorize · migrate), and
198+
an anti-pattern catalogue paired with the right shapes. MANDATORY
199+
before authoring any consumer call site that mentions `class_id`,
200+
`APP_PREFIX`, `PortSpec`, `ClassView`, or any `*Bridge`/`UnifiedBridge`.
192201
8. `docs/ARCHITECTURAL-DECISIONS-2026-06-04.md` — ADR-001..025
193202
(ADR-026 pending).
194203
9. `.claude/agents/` — the 5+3 hardening pattern (5 research savants +
@@ -207,6 +216,15 @@ alignment costs. Until measured: 3×4 stands.
207216
… THEN …` carrying lifecycle is the "negative-beauty hijack"
208217
`SURREAL-AST-AS-ADAPTER.md` §0 rejects. Behavior flows producer →
209218
OGAR `Class`+`ActionDef` → adapter; never producer → DDL.
219+
- **Consumer call sites: classid is address, magic is at the
220+
resolution target:** before authoring consumer code that pulls a
221+
classid, composes a render address, authorizes, or migrates off a
222+
bridge, read `docs/OGAR-CONSUMER-BEST-PRACTICES.md` (the muscle-
223+
memory guide). The hi u16 chooses **render** skin (per-app
224+
ClassView/template), the lo u16 names the **shared concept** (RBAC +
225+
ontology); **neither half carries behavior** — class-magic
226+
(`ActionDef`+`KausalSpec`) is a property of the Core node the
227+
address resolves to, never of the address.
210228
- **PII:** never emit German PII labels (medcare-rs leaf-rename at the
211229
adapter is the guarantee). Word-boundary abort-guard before commit.
212230
- **No model identifier** in any committed artifact (chat only).

docs/APP-CLASS-CODEBOOK-LAYOUT.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
> prefix** and pins the rule that keeps "classid is shared currency"
1010
> intact.
1111
>
12+
> **Read together with** `docs/OGAR-CONSUMER-BEST-PRACTICES.md` — the
13+
> muscle-memory guide with worked examples across every consumer. **The
14+
> classid is pure address (both halves)**; behavior lives at the
15+
> resolution target (ClassView for the skin / `Class`+`ActionDef` for
16+
> the canonical shape and magic). Hi u16 selects **render** magic, NOT
17+
> class magic; class magic is the Core's, never the address's.
18+
>
1219
> **The goal it serves (§3.5–3.7):** every renderable thing — strings,
1320
> text, media, online sources — is rendered by **key-value resolution**
1421
> against typed content stores, so **no serialization exists in the hot

0 commit comments

Comments
 (0)