|
| 1 | +# Handover Capstone — AST-as-(part_of:is_a) / OGAR-ERP-stdlib arc → next session |
| 2 | + |
| 3 | +> **From:** session on `claude/medcare-bridge-lance-graph-wmx76z` (2026-06-26) |
| 4 | +> **To:** next session picking up the OGAR-ERP / V3 AST-address arc |
| 5 | +> **Status of the arc:** CONJECTURE captured + carrier verified; ONE empirical |
| 6 | +> probe converts it to FINDING. No V3 *migration* was performed this session. |
| 7 | +
|
| 8 | +--- |
| 9 | + |
| 10 | +## 0. TL;DR (read this, then the mandatory reads) |
| 11 | + |
| 12 | +This session **did not write product code**. It (a) verified another session's |
| 13 | +V3 alignment of a design doc, (b) consolidated a multi-layer architectural |
| 14 | +thesis into one knowledge doc, and (c) scaffolded a C# harvester. The thesis: |
| 15 | +**a transcode source's structural AST is stored AS the `(part_of:is_a)` GUID |
| 16 | +address (shipped `FacetCascade`), making ERP construction in any consumer as |
| 17 | +cheap as importing pre-minted OGIT class primitives + classaction pointers.** |
| 18 | +The whole arc is CONJECTURE; the gate to FINDING is the **MedCare brick-3 probe** |
| 19 | +(§6). Everything else is wiring, not research. |
| 20 | + |
| 21 | +**Single most important correction to inherit:** the carrier and minter are |
| 22 | +already SHIPPED/built. Do not re-design them. The remaining work is *wiring* |
| 23 | +(mint imported OGIT → codebook; merge the minter branch; run the probe). |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 1. Mandatory reads to get up to speed (in order) |
| 28 | + |
| 29 | +1. **`.claude/knowledge/ast-as-partof-isa-address.md`** — THE doc this arc |
| 30 | + produced (merged via #616, extended via #617). The full thesis + the three |
| 31 | + honest boundaries. Start here. |
| 32 | +2. **`.claude/knowledge/guid-canon-and-prefix-routing.md`** — the V3 GUID canon. |
| 33 | +3. **`crates/lance-graph-contract/src/facet.rs`** — the SHIPPED carrier |
| 34 | + (`FacetCascade` = `facet_classid(4) | 6×(8:8) = 16 B`, content-blind, |
| 35 | + `(part_of:is_a)` is one consumer projection). Four SIMD lanes. |
| 36 | +4. **`crates/lance-graph-contract/src/canonical_node.rs`** — `TailVariant::V3`, |
| 37 | + `mint_for`, `CLASSID_OSINT_V3 = 0x1000_0700` (the one wired V3 exemplar). |
| 38 | +5. **`crates/lance-graph-contract/src/class_view.rs`** — the static-shape → |
| 39 | + dynamic-ClassView → askama ladder (XML/XSD/XSLT analogy), C2/N3 invariants. |
| 40 | +6. **`crates/lance-graph-contract/src/ogar_codebook.rs`** — the import surface |
| 41 | + (`canonical_concept_id`, `render_classid_for_concept`). |
| 42 | +7. **`.claude/knowledge/ogar-consumer-preflight.md`** + **`core-first-transcode-doctrine.md`** |
| 43 | + — the pull-don't-reconstruct iron rule + the Core-first doctrine. |
| 44 | +8. **OGAR repo:** `docs/OGAR-AST-CONTRACT.md` (the THINK arm `Class` / DO arm |
| 45 | + `ActionDef`+`ActionInvocation`+`KausalSpec` IR) and |
| 46 | + `vocab/imports/ogit/` (complete OGIT, ~1,940 TTL, IMPORTED). |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## 2. What I shipped this session (all PRs) |
| 51 | + |
| 52 | +| PR | Repo | State | Content | |
| 53 | +|---|---|---|---| |
| 54 | +| **#616** | lance-graph | **MERGED** | `ast-as-partof-isa-address.md` (the *what*) + I aligned another session's V3 correction onto it. Now on `main`. | |
| 55 | +| **#617** | lance-graph | **OPEN** | The *why*: three-layer thesis + laws-as-patterns + OGIT-imported + DO-as-classaction-pointer + the 2 MB headline. Branch `claude/medcare-bridge-lance-graph-wmx76z`, HEAD `e34a7fa`. **Docs only**, safe to merge independently. | |
| 56 | +| **#29** | ruff | **OPEN** | `ruff_csharp_spo` — Roslyn (.NET) C#→SPO harvester (brick-3 input). **CI-gated, not locally verified** (no .NET SDK here; proxy blocks workspace `cargo check`). | |
| 57 | + |
| 58 | +**No code/contract surface was changed in lance-graph.** `#617`'s diff is one |
| 59 | +knowledge file, +186 lines. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## 3. The thesis in one screen (so you don't re-derive it) |
| 64 | + |
| 65 | +- **Layer 1 — rails-shaped semantic AST at *assembler* cost.** `facet.rs`'s four |
| 66 | + SIMD lanes ARE the LSP ops (`definition`=`vpcmpeqd`+`vmovmskps`, |
| 67 | + `typeHierarchy`=`lo_chain` `vpxor`+`tzcnt`, `documentSymbol`=`hi_chain`, |
| 68 | + ancestry=GFNI Morton). Only the *declarative* (rails) class body flattens to |
| 69 | + fixed-width tiles; an imperative syntax tree does not. |
| 70 | +- **Layer 2 — static OGAR / dynamic ClassView / askama.** One ClassView projects |
| 71 | + the `N × 6×(part_of:is_a)` SoA two ways: row→typed **view** (THINK→askama) AND |
| 72 | + row→conditional **classaction** (DO→`ActionDef` under `KausalSpec` guard). |
| 73 | + C2 (presence≠semantics) + N3 (append-only positions) = a row view that evolves |
| 74 | + 17 years (Redmine) without breaking persisted rows. |
| 75 | +- **Layer 3 — OGAR as importable ERP-LAW primitives + lance as compiler.** The |
| 76 | + primitives are *laws/regulations* (universal, reusable), not CRUD: |
| 77 | + `ObjectView`=required fields, `ActionDef`/`KausalSpec`=rules. Content stays |
| 78 | + with the consumer; only the pattern is shared. `ogar_codebook` is the import |
| 79 | + surface. **DO in the consumer = a classaction POINTER** (`classid → ActionDef` |
| 80 | + via `ActionInvocation` DTO) — exactly the OGAR consumer doctrine ("classid is |
| 81 | + pure address; magic at the resolution target"). |
| 82 | +- **Headline (CONJECTURE):** OpenProject + Odoo as ~2 MB of GUID-encoded |
| 83 | + `(part_of:is_a)` vs ~20 MB / ~250K LOC (~10×). Dimensional check: 16 B/node ⇒ |
| 84 | + 2 MB ≈ 131K nodes — credible for both ERPs' structural skeleton. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## 4. V3 state — what EXISTS vs what I did (IMPORTANT, do not misattribute) |
| 89 | + |
| 90 | +**I performed NO V3 migration this session.** I only *read/verified* the shipped |
| 91 | +V3 surfaces to ground the docs. The V3 mints shipped in OTHER sessions |
| 92 | +(#613/#614/#615, then **#618** which landed AFTER my #617 merged): |
| 93 | + |
| 94 | +| domain | classid | status (as of #618, 2026-06-26) | |
| 95 | +|---|---|---| |
| 96 | +| **OSINT-V3** | `0x1000_0700` | wired (first exemplar, #613-615) | |
| 97 | +| **FMA-V3** | `0x1000_0A01` | **wired** (#618 — `ReadMode::FMA_V3`) | |
| 98 | +| **CPIC-V3** | `0x1000_0E00` | **wired** (#618 — Genetics domain `0x0E` operator-allocated; `ReadMode::CPIC_V3`) | |
| 99 | + |
| 100 | +**#618 "Phase 1 V3 set complete"** — OSINT + FMA + CPIC all minted, Genetics |
| 101 | +domain `0x0E` allocated. So CPIC/FMA/OSINT are ALL wired now (none by me). |
| 102 | + |
| 103 | +The V3 marker lives in the **HIGH (custom) u16**; canon/domain in the **LOW u16** |
| 104 | +(`classid_concept_domain` routes on the low half — a deliberate Codex-P1 fix; the |
| 105 | +low-half `0x1007` alternative was rejected as domain `0x10`=Unassigned). **Open |
| 106 | +operator decision: "Canon:Custom"** — whether to flip canon to the high half |
| 107 | +(would require re-pointing `classid_concept_domain`). Not settled; flagged in the |
| 108 | +doc, not hardened. |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## 5. The minter (brick 2) — BUILT and verified, on an unmerged branch |
| 113 | + |
| 114 | +- **`lance_graph_contract::facet_mint`** — `mint_facets(&[NodeDecl], facet_classid) |
| 115 | + -> Result<Vec<FacetCascade>, MintError>`. Deterministic sibling ranking, |
| 116 | + roundtrip-lossless, `MintError::{DuplicateId, UnknownParent, DepthOverflow(>6), |
| 117 | + FanoutOverflow(>256), Cycle}`. `NodeDecl{id, part_of_parent, is_a_parent}` is |
| 118 | + producer-agnostic (C++/C#/Ruby/Python harvests all fill it). |
| 119 | +- **Branch `claude/serene-mayer-1a09he`, commit `360fc720`. NOT merged to main.** |
| 120 | +- **I ran its 8 tests myself: 8 passed**, in the zero-dep `lance-graph-contract` |
| 121 | + crate (no ndarray/burn needed). |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## 6. THE critical path — brick 3 (the probe that converts CONJECTURE→FINDING) |
| 126 | + |
| 127 | +`ruff_csharp_spo` harvest (MedCare C#) → `facet_mint` → lance SoA → `typeHierarchy` |
| 128 | +/`definition` LSP query, **with `AdaWorldAPI/MedCareV2` as the parity oracle**. |
| 129 | +It produces the first real numbers for: (a) bytes-of-(part_of:is_a) vs source LOC |
| 130 | +(the 10× claim), (b) lossless round-trip of the class graph, (c) query-as-asm-op. |
| 131 | + |
| 132 | +**Its gates are wiring, not research — in order:** |
| 133 | +1. **Merge `serene-mayer` (`facet_mint`)** into main (verified green). |
| 134 | +2. **Mint imported OGIT → `ogar_codebook`** — the source is ALREADY in OGAR at |
| 135 | + `vocab/imports/ogit/` (~1,940 TTL incl. `NTO/{Audit,Compliance,Legal,Security}` |
| 136 | + + `SDF/Automation` = HIRO DO-arm source). The remaining step is the |
| 137 | + **source→codebook wire** (`facet_mint` → publish), NOT harvesting. |
| 138 | +3. **Reserve one `facet_classid`** in the value-tenant migration's codec selector |
| 139 | + for the AST `6×(8:8 part_of:is_a)` reading (a ClassView reading, NOT a new |
| 140 | + `ValueSchema` variant — see `soa-value-tenant-migration-v1-harvest.md §5.1`). |
| 141 | +4. Then run the MedCare probe; needs a .NET 8 SDK to run the Roslyn harvester. |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## 7. Honest caveats / corrections I made (inherit these — don't repeat them) |
| 146 | + |
| 147 | +- **`burn` is NOT a build blocker.** An earlier claim ("workspace compile blocked |
| 148 | + by proxy 403 on ndarray's `burn` submodule") was **wrong** — `burn` is an |
| 149 | + *excluded* workspace member (`ndarray/Cargo.toml:375`) with zero code coupling. |
| 150 | + The minter's crate (`lance-graph-contract`) is zero-dep and builds standalone. |
| 151 | +- **The local `owl` repo is NOT W3C OWL.** It's camel-ai's "Optimized Workforce |
| 152 | + Learning" multi-agent framework (arXiv:2505.23885). The operator's "OWL↔OGIT |
| 153 | + bijective-lossless" result refers to W3C OWL (the ontology standard); I cited it |
| 154 | + **attributed, not re-verified** (the converter is plausibly OGIT's |
| 155 | + `bin/ogit-tools-jar-with-dependencies.jar`, unread). |
| 156 | +- **Everything in the doc is CONJECTURE.** The carrier is shipped, but no |
| 157 | + end-to-end measurement exists. Keep the label until the probe runs. |
| 158 | +- **Sync-first discipline:** every PR this session verified `HEAD..origin/main` |
| 159 | + empty + `diff --stat origin/main..HEAD` showing only intended files BEFORE |
| 160 | + pushing (a prior arc orphaned commits by not doing this). Keep doing it. |
| 161 | +- **Workspace iron rules in play:** OGAR — no model identifier in artifacts, no |
| 162 | + German PII labels, no Bash grep/sed/tail/head/awk (use Grep/Read tools). |
| 163 | + Consumer side — pull via `*Port::class_id` / `canonical_concept_id`, NEVER |
| 164 | + construct a `*Bridge` or copy the codebook. |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +## 8. Concrete next actions (pick up here) |
| 169 | + |
| 170 | +1. **Decide:** merge #617 (docs, safe) — or leave for review. |
| 171 | +2. **Brick-3 wiring step 1:** merge `claude/serene-mayer-1a09he` (`facet_mint`). |
| 172 | +3. **Brick-3 wiring step 2 (highest leverage):** write the OGIT-source→`ogar_codebook` |
| 173 | + mint — the input (`vocab/imports/ogit/`) is already in OGAR; this is the step |
| 174 | + that first produces real byte-size numbers for the 10× claim. |
| 175 | +4. **Decide the open gate:** the "Canon:Custom" classid half-order (operator call; |
| 176 | + the importable-stdlib reuse-clustering argues canon-high, but it collides with |
| 177 | + the shipped low-half domain routing — not free). |
| 178 | +5. **Optional:** verify ruff #29 in CI (needs network + .NET SDK). |
| 179 | + |
| 180 | +--- |
| 181 | + |
| 182 | +## 9. Coordinates |
| 183 | + |
| 184 | +- lance-graph branch: `claude/medcare-bridge-lance-graph-wmx76z` (HEAD `e34a7fa`, |
| 185 | + synced FF to `main` which includes #616 at `b7eb02c`). |
| 186 | +- minter: `claude/serene-mayer-1a09he` @ `360fc720` (unmerged). |
| 187 | +- ruff branch: `claude/medcare-bridge-lance-graph-wmx76z` (PR #29, scaffold @ `0f463f2`). |
| 188 | +- OGIT-in-OGAR: `OGAR/vocab/imports/ogit/` (~1,940 TTL). |
| 189 | +- Operator note (not code): MedCare Railway deploy still binds `:3000` because a |
| 190 | + Railway **PORT service variable** overrides `$PORT` — the operator must remove |
| 191 | + it; the app correctly prefers `$PORT`. |
0 commit comments