plan: lance-graph-ontology v5 — post-merge follow-on (15 deliverables, 4 ratifications)#352
Conversation
Phase 1 recon verifies the "already shipped" list: MUL wiring at driver.rs:271-320, SchemaExpander trait, polyglot strategy parsers (with PARSER-1 stub gap noted), SPO + ARiGraph stores, CausalEdge64, smb-ontology declarative pattern. Confirms lance-graph-ontology does not yet exist and OGIT references are absent. Phase 2 decision adopts Option B (federated, two-layer cache) for SPO-1: the ontology crate produces Ontology values; consumers route them through SchemaExpander into either store. Doesn't close SPO-1; unblocks ontology crate to proceed. Mandated by the "no code before recon and SPO-1 decision are committed" rule of the v4 plan. AGENT_LOG.md is also created locally (per-session, gitignored).
…gy session Adds Edit/Write/MultiEdit rules for **/*.ttl (OGIT TTL emission) and **/*.json, plus the github MCP tools required for the OGIT fork PR (create_or_update_file, push_files, get_file_contents, list_branches, create_branch, update_pull_request, pull_request_read, list_commits, ...). Also adds common read-only Bash helpers (mkdir, cat, diff, rg, head, tail) so the lance-graph-ontology session can scaffold + commit without per-call permission prompts.
Adds new workspace member crates/lance-graph-ontology/ implementing
phases 3-5 of the v4 plan:
Phase 3 (scaffold):
- Cargo.toml with feature-gated lance-cache (so the crate compiles
without protoc, which lance-encoding's build-script requires)
- src/lib.rs public surface; src/{error,namespace,proposal,
semantic_types,ttl_parse,foundry_map,registry,bridge,
schema_source}.rs modules; src/bridges/{mod,woa,medcare,ogit}.rs
- src/semantic_types.toml: declarative OGIT-attribute -> SemanticType
map (the only TOML in the crate; ontology data is TTL)
- src/lance_cache.rs feature-gated Lance dataset persistence
Phase 4 (TTL hydration):
- TtlSource walks an OGIT TTL file via oxttl, groups triples by
subject, classifies entity / verb / attribute, walks rdf:first /
rdf:rest lists for ogit:mandatory-attributes /
ogit:optional-attributes, emits MappingProposal per subject.
- ttl_root_checksum() drives idempotent re-hydration.
- OntologyRegistry::hydrate_once_sync() short-circuits when the
TTL root checksum matches the last hydration; otherwise it parses,
appends rows, and updates the in-memory dictionary.
- export_ttl() round-trips registry rows back to OGIT-shaped TTL.
Phase 5 (bridges):
- NamespaceBridge trait with default impls; tenant bridges are
~20 LOC each (lock to one G partition + bridge_id constant).
- WoaBridge ("WorkOrder"), MedcareBridge ("Healthcare"),
OgitBridge::for_namespace.
- BridgeError::CrossNamespaceLeak fires when resolution lands in a
different namespace than the lock; tests demonstrate it.
Tests passing (28 total, no protoc required):
- 16 inline unit tests (namespace, semantic_types, ttl_parse, registry)
- 6 bridge_scope_lock integration tests (WoaBridge, MedcareBridge,
OgitBridge, including a public-name-alias test)
- 2 hydrate_real_ogit integration tests against /home/user/OGIT/NTO
- 4 round_trip_ttl integration tests (hydrate, idempotent
re-hydration, export, OGIT bridge per-namespace lock)
SPO-1 disposition (Option B / federated, see DECISION_SPO_ARIGRAPH.md)
holds: this crate produces Ontology values that consumers route via
the existing SchemaExpander trait into either SPO or ARiGraph; no
new SPO machinery shipped here.
…rker outputs Twelve specialist agents (workspace ensemble) executed in parallel against the lance-graph-ontology integration session and an integration-lead meta agent reviewed their combined output via the Layer-2 A2A blackboard (`.claude/board/AGENT_LOG.md`, gitignored). This commit lands the worker outputs that touch lance-graph + the meta-fix list. Phase 6 (cross-repo, OGIT fork): - 27 TTL files at AdaWorldAPI/OGIT/NTO/WorkOrder/ on branch `claude/create-graph-ontology-crate-gkuJG` commit `3871d37` (15 entities + 12 distinct verbs, anti-flattening preserved). PR is separate from this commit; the OGIT fork PR opens against the upstream fork branch. Phase 7 (this repo): - crates/cognitive-shader-driver depends on lance-graph-ontology with default-features = false. BindSpace gains an optional Arc<OntologyRegistry> handle (`set_ontology` / `ontology` accessors); MUL gate at driver.rs:271-320 is UNTOUCHED per the v4 plan invariant. Ontology-aware MUL trust thresholds (Compliance→Plateau-only, Healthcare→stricter) are flagged FUTURE WORK in bindspace.rs:184-197. palette-engineer (semantic_types): - Expanded `crates/lance-graph-ontology/src/semantic_types.toml` with ~85 WorkOrder predicate mappings (Customer.iban=Iban, Customer.taxId=TaxId, Order.orderId=InvoiceNumber, Picture.dateiname=Image, etc.). Added the `workorder_namespace_lookups` test asserting 18 canonical entries round-trip. lib tests: 18 passing. truth-architect (parser hardening): - 5 probe tests in `tests/round_trip_ttl.rs` (TTL-PROBE-1..5): malformed TTL → HydrationFailure (no panic); empty `()` mandatory list registers; multi-entity single file emits one proposal per subject; `@base` declaration parses correctly; `dcterms:source` is currently dropped (TECH_DEBT row TTL-PROBE-5 owns the future fix). - round_trip_ttl tests: 9 passing. integration-lead meta fixes (this turn): - New `hydrate_workorder_namespace_from_real_ogit` test in `tests/hydrate_real_ogit.rs` exercises all 15 WorkOrder entities through WoaBridge scope-lock against the real OGIT fork — closes the "no executed proof" gap surfaced by the meta review. - Silenced two dead-code warnings: `RdfValue::Literal(String)` retains its payload for the future TTL-PROBE-5 fix (annotated `#[allow(dead_code)]` with TECH_DEBT pointer); `registry::absorb_row` is gated on the `lance-cache` feature. Documentation (perspective-weaver): - New `.claude/knowledge/ontology-registry.md` — READ BY header for `workspace-primer` / `host-glove-designer` / `bus-compiler` / `tenant-bridge-author`; producer→consumer map; tenant-bridge recipe; ontology-extension recipe; SPO-1 disposition (Option B / federated); explicit non-goals. Board governance (workspace-primer + this commit, append-only): - `EPIPHANIES.md`: SPO-1 Option B disposition entry. - `INTEGRATION_PLANS.md`: dated annotation on `sql-spo-ontology-bridge-v1` (partially superseded). - `LATEST_STATE.md`: contract inventory rows for OntologyRegistry, WoaBridge, MedcareBridge, OgitBridge, HydrationReport, OgitUri, NamespaceBridge. - `PR_ARC_INVENTORY.md`: PR entry for the lance-graph-ontology scaffold. - `TECH_DEBT.md`: TTL-PROBE-5 row (dcterms:source dropped at parse). Test results (cargo test -p lance-graph-ontology --no-default-features): - 36 tests passing, 0 failing (18 lib + 6 bridge_scope_lock + 3 hydrate_real_ogit + 9 round_trip_ttl). Out-of-scope (carry-overs, intentional): - PARSER-1 entropy row: 4–6 parsers across the workspace are by design (cold-path lance-graph::parser with full nom + great error messages vs hot-path planner::strategy::* polyglot vs cypher_bridge etc.). Consolidation is deferred work post-migration, not a stub to fix. - TTL-PROBE-5: `dcterms:source` literal is captured at parse but not threaded through to MappingProposal::source_uri. TECH_DEBT row owns it. - SPO-1 ledger row: Option B unblocks the ontology crate without closing the row; `arigraph::SpoBridge::promote_to_spo` remains the deliverable. Branch: claude/create-graph-ontology-crate-gkuJG. https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Authored by integration-lead meta-agent after the v4 OGIT#1 merge. The plan picks up where v4 left off with 15 ranked deliverables; main thread ratified the four open questions (smb-ontology export-only, D-9 above D-2 ordering, MulThresholdProfile in lance-graph-contract, OGIT-fork upstream non-PR rule). Next-3 deliverables locked: D-ONTO-V5-1 (dcterms:source provenance, ~80 LOC, closes TTL-PROBE-5), D-ONTO-V5-9 (ontology-aware MUL trust thresholds, ~150 LOC, closes the deferred Phase-7 follow-up), D-ONTO-V5-2 (arigraph::SpoBridge::promote_to_spo, ~150 LOC, closes SPO-1 ledger row). Files: - .claude/plans/lance-graph-ontology-v5.md (new, 177 lines) - .claude/board/INTEGRATION_PLANS.md (prepended v5 entry, +18 lines) Append-only governance honored. Layer-2 AGENT_LOG.md (gitignored) carries the meta-agent draft entry + main-thread ratifications. https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f808502b0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let bridge_id = state.rows.last().map(|r| r.bridge_id.clone()).unwrap_or_default(); | ||
| let public_name = state.rows.last().map(|r| r.public_name.clone()).unwrap_or_default(); | ||
| let key = (bridge_id, public_name); |
There was a problem hiding this comment.
Return the idempotent mapping, not the last row
When the idempotent proposal is not the most recently inserted row, this branch builds the lookup key from state.rows.last() instead of the proposal that just collided. Re-appending mapping A after appending mapping B therefore returns B's SchemaPtr/row index even though A was the idempotent match, so callers that cache the returned MappingHandle can bind entities to the wrong schema/namespace.
Useful? React with 👍 / 👎.
| let rows: Vec<MappingRow> = self.inner.read().unwrap().rows.clone(); | ||
| writer.flush(&rows).await?; |
There was a problem hiding this comment.
Persist only new rows to the Lance cache
With lance-cache enabled, every non-cache hydration clones the entire in-memory dictionary and passes it to flush, whose writer uses append mode. If the registry was opened from an existing dataset, or if a TTL change adds just one new mapping, all previously persisted rows are appended again; the next open() replays duplicates and inflates the dictionary/history. This path needs to flush only rows inserted by this hydration run, or otherwise overwrite/deduplicate.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
| } | ||
| state.last_root_checksum = Some(root_checksum); |
There was a problem hiding this comment.
Do not mark failed hydrations as cached
When a TTL root contains at least one valid proposal and at least one parse failure, the report records the failure but this still stores last_root_checksum. A second call with the same broken root immediately returns from_cache: true with a default clean report, so the failed files are no longer retried or reported until the root changes.
Useful? React with 👍 / 👎.
…+ BioPortal arsenal
Pillar 0 (the holy-grail click): OntologyRegistry IS the SoA; per-domain
schema IS the DTO + name→row index. Codec cascade per row: identity
Vsa16kF32 → CAM-PQ 6 B → Base17 34 B → palette key 4 B → Scent 1 B +
qualia 18×f32 + meta 8 B + edge 8 B. Every step O(1). Content-addressable
memory through every encoding tier — answers main-thread question.
Pillar 1: OGIT as universal SPO-G lingua franca; ontology_context_id: u32
per named graph (consistent with lance-graph-rdf-fma-snomed-v1 §Core).
Pillar 2: Zone 1 (BindSpace, no Serialize) / Zone 2 (Arrow scalar membrane,
BBB invariant) / Zone 3 (Supabase RPC, REST, transcode — only emission
point). cert-officer static check denies serde::Serialize on Zone 1/2.
Pillar 3: smb-bridge + medcare-bridge collapse to 2-line projections over
OntologyRegistry::enumerate(ns) — net negative LOC.
Pillar 4: BioPortal arsenal — 10 namespace stubs under OGIT/NTO/Medical/
{ICD10CM, RxNorm, LOINC, FMA, RadLex, SNOMED, MONDO, HPO, DRON, CHEBI}/
carrying provenance + license + size; full ingestion gated on
lance-graph-rdf-fma-snomed-v1.
15 deliverables ranked. Top-3 (no upstream blockers): D-CASCADE-V1-1
(cert-officer Serialize-deny), D-CASCADE-V1-2 (SchemaPtr.context_id),
D-CASCADE-V1-3 (bridge factory collapse). Cross-plan deps: v5 D-9,
lance-graph-rdf-fma-snomed-v1, supabase-subscriber-v1, callcenter-
membrane-v1.
Out of v1 scope (deferred, not punted): full SNOMED (license-gated +
BioPortal release ships 666 KB partial), DRON/CHEBI imports, bgz-tensor
attention integration.
Files:
- .claude/plans/ogit-cascade-supabase-callcenter-v1.md (new, 209 lines)
- .claude/board/INTEGRATION_PLANS.md (prepended, +18 lines)
Append-only governance honored. Layer-2 AGENT_LOG.md (gitignored)
carries the main-thread draft entry.
https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Three artifacts in one commit: 1. Post-merge governance for #352 (lance-graph-ontology v5 + ogit-cascade v1 plans, merged 2026-05-07 as 8e2f088): - PR_ARC_INVENTORY.md prepended with full Added/Locked/Deferred/Docs entry; Confidence line updatable. - LATEST_STATE.md table prepended; "Last updated" refreshed to 2026-05-07. 2. New plan: .claude/plans/palantir-parity-cascade-v2.md (262 lines). Integration capstone over 4 prior Foundry parity docs and v1 cascade. Pillar 0 carry-forward: Foundry parity IS SoA-as-canon parity. Column H (PR #272 SHIPPED) is already the Foundry Object Type bridge; v2 makes the SoA carry the Foundry-equivalent shape. 15 deliverables, top-3 ship with this plan (V2-1 ledger, V2-2 triangle, V2-3 BusDto bridge). Business Logic ↔ Thinking-style ↔ OGIT triangle introduced as routing knowledge artifact. 3. New knowledge doc: .claude/knowledge/soa-dto-dependency-ledger.md (210 lines). Append-only entropy table of 22 DTOs across 4 tiers (sensor → engine → contract → callcenter). Three classifications: bare-metal (9), SoA-glue (7), bridge-projection (6, with 3 OPEN re-classifications). Internal vs external O(1) mapping diagrams. Codec cascade column status: all 8 cascade columns OPEN, current registry uses (bridge_id, public_name) tuples + ogit_uri hashing per 2026-05-07 audit. Probe queue with pass criteria for D-CASCADE- V1-1/7/11 + D-PARITY-V2-3/10. Maintenance protocol attached. Findings driving the artifacts: - StreamDto, ResonanceDto, BusDto all live in thinking-engine::dto.rs (Tier 0/1/2), upstream of contract. - ResonanceDto IS the SoA (4096 ripple energies), not a glue layer. - OntologyRegistry has NO codec cascade columns today; D-CASCADE-V1-7 is the wiring deliverable. - Foundry parity has 5+ prior docs; v2 integrates, does not duplicate. Append-only governance honored on PR_ARC, LATEST_STATE, INTEGRATION_PLANS (prepend only; no past entries edited). Layer-2 AGENT_LOG.md (gitignored) will carry the entry post-push. https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
…-crate-gkuJG plan(palantir-parity-cascade-v2)+ledger(soa-dto-deps)+post-merge(#352)
…nding noted Post-merge governance for PR #353 (palantir-parity-cascade-v2 + SoA DTO ledger + #352 post-merge governance, merged 2026-05-07 as 4d0c2d9). PR_ARC_INVENTORY.md prepended with full Added/Locked/Deferred/Docs entry + adjacent-consumer-landings section documenting: - MedCare-rs PR #109 (merged 2026-05-07): ?source=lance toggle on GET /api/patient/{id} exercises per-request RlsRewriter + ColumnMaskRewriter attachment from lance-graph-callcenter. Validates the Zone 2 → Zone 3 path. Pinned the discovery that ColumnMaskRewriter has no ::new() method (struct-literal construction at policy.rs:111-114, 464, 565, 672) — feeds the SoA DTO ledger when V2-10 CI gate lands. - OGIT fork branch (claude/create-graph-ontology-crate-gkuJG): pushed but not yet PR'd. Adds 24 predicate fills to NTO/WorkOrder/ {Order,Customer,Article}.ttl (191 lines) + bootstraps NTO/Healthcare/ with 7 entities + 7 enums (846 lines). Closes the per-attribute gaps the woa-bridge and medcare-bridge needed for O(1) migration. v5 D-1 (dcterms:source) extended from entity-level to per-attribute level. medcare-bridge previously failed at hydrate with UnknownNamespace ("Healthcare") — now resolvable. LATEST_STATE.md table prepended with #353 row; "Last updated" advanced. Append-only governance honored: no past entries edited; only Confidence lines on prior entries are mutable per policy. https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Closes the governance loop for the #352 → #353 → #354 sequence on the lance-graph side, plus the 5-PR cross-repo coordinated landing of 2026-05-07 (lance-graph #352/#353/#354, OGIT #2, woa-rs #2, MedCare-rs #109). PR_ARC_INVENTORY.md prepended with minimal #354 entry; lock notes: - Append-only board hygiene survived 4 sequential prepends (incl. prior splat-osint) without any past-entry mutation. Confidence-line-only mutability policy is durable. - Cross-repo coordinated landing pattern documented as a recipe: lance-graph plans → OGIT TTL → consumer integration → governance close-out. LATEST_STATE.md table prepended with #354 row; "Last updated" advanced. No new types, plans, or knowledge docs in this commit — pure governance. Not opening a new PR for THIS commit (would be recursive governance-on-governance unless explicitly requested). https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Summary
.claude/plans/lance-graph-ontology-v5.md(177 lines): 15 deliverables ranked by leverage / cost, picking up where v4 (OGIT#1 merged) left off..claude/board/INTEGRATION_PLANS.mdwith the four main-thread ratifications inline.Top-3 Deliverables Locked
dcterms:sourceprovenance threading inttl_parse.rsMulThresholdProfilein lance-graph-contract)arigraph::SpoBridge::promote_to_spowriterRatifications (main thread, 2026-05-07)
MulThresholdProfileinlance-graph-contract— RATIFIED (zero-dep canonical home, co-located withMulAssessment).Out of Scope
TRUST-1 / FLOW-1 / COMPASS-1 / PARSER-1 — explicit deferrals; the ontology crate has no leverage on enum consolidation or the cypher cold/hot split.
Test plan
https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Generated by Claude Code