Skip to content

Commit 4417a6f

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/medcare-bridge-lance-graph-wmx76z
# Conflicts: # Cargo.lock
2 parents 8b35dc0 + 96c1249 commit 4417a6f

33 files changed

Lines changed: 14046 additions & 29 deletions

.claude/board/AGENT_LOG.md

Lines changed: 73 additions & 0 deletions
Large diffs are not rendered by default.

.claude/board/EPIPHANIES.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1+
## 2026-06-21 — E-EQUIVALENCE-IS-THE-CRUX — template-equivalence is the load-bearing verifier of the whole loop; it MUST fail closed, and it rides on transparent Lance versioning (surrealdb #50)
2+
3+
**Status:** FINDING (cross-session feedback, 2026-06-21). Reframing that
4+
re-grades the comparison gate from footnote to crux. The Cognitive Compilation
5+
loop's "take the training wheels off" decision — let a deterministic Elixir
6+
template REPLACE the LLM run — is exactly the output of `template-equivalence`:
7+
*does the template reproduce the recorded LLM run's results?* Therefore:
8+
9+
1. **The verifier is load-bearing, not incidental.** If the comparison can pass
10+
when it shouldn't, the loop **self-certifies on a lie** — the LLM is removed
11+
from the hot path on a false equivalence. A codex P2 on this crate (a stable
12+
top item passing `RankOrder` despite dropped provenance) is really the crux,
13+
not a minor note.
14+
2. **Fail closed.** A pass must be an affirmative PROOF of reproduction, never
15+
"no difference detected". Hardened accordingly (commit `…`): claims compared
16+
as a SET both ways (no additions AND no omissions), source spans compared
17+
exactly, ranked-item SET preserved for `RankOrder` (only order may perturb,
18+
within tolerance), and every unevaluable dimension (incl. the deferred
19+
Semantic class) → `Failure`. 8 tests.
20+
3. **It rides on transparent versioning (surrealdb #50).** The loop records each
21+
orchestration step as a versioned Lance commit and verifies by **AS-OF replay
22+
+ compare**. That requires the corrected version→snapshot mapping landed in
23+
surrealdb #50; under the old broken `checkout_version(versionstamp)` the
24+
verifier would replay the WRONG step and compare garbage. #50 is the substrate
25+
this loop records and replays on — load-bearing for the verifier, not
26+
incidental.
27+
28+
Architecture note (cross-session): rig + rs-graph-llm (a Rust LangGraph) run the
29+
LLM-angle orchestration onto surrealdb-on-kv-lance; each step is a Lance commit;
30+
the run is transcribed into an Elixir template and verified by replay-and-compare
31+
against the recorded run. The reflex binary (`crates/cognitive-stack`) stays
32+
LLM-free; the LLM lives in the learning loop only.
33+
34+
Cross-ref: `crates/template-equivalence/src/lib.rs` (fail-closed `compare`);
35+
PR #571; surrealdb #50 (transparent versioning); E-ELIXIR-TEMPLATE-IS-THE-GAP.
36+
37+
## 2026-06-21 — E-ELIXIR-TEMPLATE-IS-THE-GAP — the compiled-cognition loop already has every organ EXCEPT the Elixir-shaped template; that template is the only new build
38+
39+
**Status:** FINDING (operator scope correction, 2026-06-21). The "Cognitive
40+
Compilation" idea (LLM = teacher/compiler/critic, Lance-Graph = reflex runtime)
41+
maps onto organs the workspace already grew: **ractor** (control-plane ownership
42+
fence), **surrealdb-as-kv-lance** (provenance/timeline view), **Rubicon /
43+
kanbanview** (phase choreography), **thinking styles + JITson + i4-32D
44+
thinking-style vectors** (style dispatch + compiled kernels). The one missing
45+
organ is the **Elixir-shaped template** — the declarative `pipeline do step :x end`
46+
a proven LLM run compiles down to, whose steps bind to OGAR actions and run
47+
deterministically. Consequence: the additive build is small and surgical
48+
(`elixir-template` representation + parser + the `source_ranking_v1` first slice,
49+
plus the runtime/equivalence/compiler surfaces around it), NOT a from-scratch
50+
stack. Anything that proposes re-building Rubicon, a new orchestration crate, a
51+
surrealdb engine change, or a thinking-style system is drift — those exist.
52+
Cross-ref: plan `.claude/plans/cognitive-compilation-v1.md`; OGAR `ogar-from-elixir`
53+
(the eventual richer Elixir→OGAR front-end); §18 gates (no trace→no template,
54+
no replay→no promotion, no LLM in hot path once a template passes).
55+
156
## 2026-06-21 — E-S6-SOA-IS-ONE-FIXEDSIZEBINARY-NO-SECOND-COPY — operator override CORRECTS `E-S6-SCAN-SOA-NOT-ON-SHARED-VAL`: the SoA is stored ONCE as `FixedSizeBinary(512)` (single source, zero-copy) in lance-graph's own dataset; surrealdb is the Rubicon VIEW; NO second copy/column, NO time-series drop via tombstone+purge, lance 7.0.0 MANDATORY (not "unverified")
257

358
**Status:** FINDING (operator directive, 2026-06-21 — three explicit NOs that supersede the prior council's suggestions). CORRECTS the same-day `E-S6-SCAN-SOA-NOT-ON-SHARED-VAL` (whose "separate `soa_val` column / per-cell copy-fallback floor / deferred behind an unverified lance baseline" framing is RETRACTED).

.claude/board/INTEGRATION_PLANS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
## 2026-06-21 — capstone-out-leg-wiring-v1 (PLAN)
2+
3+
Plan: `.claude/plans/capstone-out-leg-wiring-v1.md`. The file-level execution
4+
spec for the four OUT-leg seams the Wave-0 census (codex-corrected to 1/7 wired)
5+
found unconsumed: **S2** (owner-side MUL→phase via a new `MailboxSoaView::qualia()`
6+
+ shader-driver loop), **S3** (callcenter `LanceVersionScheduler` over
7+
`Dataset::versions()` replacing the synthetic tick), **S4** (a `Kanban` arm in a
8+
consumer-crate `OrchestrationBridge` impl — Decision B preserved, no `UnifiedStep`
9+
field), **run-NaN** (instrument `symbiont::kanban_loop::run_to_absorbing`). Cross-
10+
cutting blockers named: the disk ceiling (consumer crates pull lance+datafusion
11+
≈14–18 GB) and `symbiont` ownership (cognitive-compilation session active). Each
12+
seam is independently shippable; the gate is resources/coordination, not design.
13+
14+
## 2026-06-21 — cognitive-compilation-v1 (PROPOSED; scaffold landed)
15+
16+
Plan: `.claude/plans/cognitive-compilation-v1.md`. "LLM = teacher/compiler/critic;
17+
Lance-Graph = reflex runtime." The LLM solves a task once, the run is traced,
18+
the trace is **compiled into an Elixir-shaped template**, replayed for
19+
equivalence, reviewed, and promoted — after which matching tasks run
20+
deterministically with **no LLM in the hot path** (§18). **Operator scope
21+
correction (2026-06-21):** the ONLY new idea is the Elixir-shaped template;
22+
ractor / surrealdb-kv-lance / Rubicon-kanbanview / thinking-styles / JITson /
23+
i4-32D all already exist and are untouched. This PR lands four standalone
24+
zero-dep excluded crates in lance-graph — `elixir-template` (the gap: parser +
25+
representation + `source_ranking_v1` slice), `template-runtime` (deterministic
26+
OGAR-action dispatch), `template-equivalence` (Exact/RankOrder real, Semantic
27+
deferred), `cognitive-compiler` (trace→template surface) — plus, additively in
28+
siblings: rig (`rig-surrealdb` pointed at our kv-lance fork) and rs-graph-llm
29+
(one isolated, cherry-pickable graph-flow Task). 17 tests green, clippy clean.
30+
index/review/promoter/ledger/rubicon/rig-adapter/fence = existing homes or DEFERRED.
31+
32+
---
33+
134
## 2026-06-20 — capstone-cognitive-loop-wiring-nan-census-v1 (PROPOSED)
235

336
The measurement companion to the kanban×Rubicon tenant arc. **A measurement plan,

.claude/board/LATEST_STATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120

121121
## Current Contract Inventory (lance-graph-contract)
122122

123+
> **2026-06-21 — ADDED (content-store for the AriGraph/OSINT episodic arc)**: `lance_graph_contract::content_store::{ContentId, SourceSpan, ContentError, ContentStore, ContentSink}` — the content-addressed **cold text/blob store** contract. `ContentId(u64)` = `hash::fnv1a` of the bytes (stable across versions — the correct content address; `DefaultHasher` must never key one; `0` = sentinel). `SourceSpan{ContentId,u32,u32}` = the fixed-size, `Copy` typed form of `template-equivalence`'s `(source_id,start,end)` provenance; `is_cited()` = "no source span → no claim" (non-sentinel content + non-empty span). `ContentStore` (cold read: `resolve(id) -> Option<&[u8]>` zero-copy slice into the mmap/backing store; `resolve_span`/`contains` defaulted) + `ContentSink` (idempotent `put -> ContentId`, dedup by content-address: many episodes → one source row). **Hot/cold firewall (ADR-022)**: the hot path (SIMD sweep, AriGraph edge traversal) touches only the fixed-size `ContentId`/`SourceSpan`; bytes hydrate cold at the membrane (the fingerprint is the hot-path stand-in for text). Nothing variable-length enters the 512 B node. Additive, zero-dep; +6 tests (stable/dedup, idempotent put, resolve_span slice, OOB/missing errors, uncited-rejected); clippy clean. Consumers: `rs-graph-llm/episodic-arc-task` (replaces its local fnv1a), `template-equivalence` (typed provenance). Plan: `.claude/plans/arigraph-osint-episodic-v1.md` (D-CC-ARI-3). Branch `claude/content-store-contract-draft`.
124+
123125
> **2026-06-18 — ADDED (probe-excel-compute-dag-v1 Inc 0, the `compute_dag` Core gap)**: `lance_graph_contract::class_view::{ComputeEdge, compute_dag_is_acyclic}` + `ClassView::compute_dag(class) -> &[ComputeEdge]` (default `&[]`, zero-fallback). `ComputeEdge {target: u8, inputs: &'static [u8]}` is the harvest-sourced recompute edge (`emitted_by` target ← `depends_on` inputs; field positions index the class `FieldMask`), `const`-constructible like `MethodSig`/`ActionDef` (the harvest IS the manifest). `compute_dag_is_acyclic` is the **registry-build gate** — a cyclic recompute DAG (formula loop / `@api.depends` cycle / self-loop) is rejected at build (Kahn over ≤64 positions, allocation-free; out-of-range positions ignored, no panic, mirrors `FieldMask::from_positions`). This is the Core home for computed-field recompute *dispatch* that EVERY computed-field AR consumer needs (Odoo `@api.depends`, Excel formulas, medcare lab-trends, woa calc, q2 cells — they reduce to a sheet; `E-EXCEL-SHADER-PROJECTION`) and the NNUE-incremental existence-proof shape (`E-CHESS-TENSOR-PROVEN`). **Layout-preserving**: a default trait method + a free fn, resolution metadata ABOVE the SoA, stores nothing on the row, zero `NODE_ROW_STRIDE`/`ENVELOPE_LAYOUT_VERSION` impact (core-gap-auditor's EXTEND-CORE, never an adapter-state hack). The instance recompute that consumes it is gated per-cell by the cycle-aware `write_row` (`E-SOA-CYCLE-OWNERSHIP`). Additive, zero-dep; +4 tests (default-empty, acyclic-chain, cycle/self-loop/3-cycle rejected, out-of-range ignored); 10/10 class_view, clippy/fmt clean. Sibling `ClassView::constraints` (`validation_kind`-sourced) deferred to Inc-follow-up. Plan: `.claude/plans/probe-excel-compute-dag-v1.md`. Branch `claude/particle-wave-click-epiphany`.
124126

125127
> **2026-06-18 — ADDED (D-DO-ARM-1, the OGAR DO arm)**: `lance_graph_contract::action::{ActionState, StateGuard, ActionDef, ClassActions, actions_for, effective_actions, ActionInvocation}` — the Perdurant DO arm completing the OGAR IR (the action-axis sibling of `codegen_manifest`'s `MethodSig`/THINK). Both the 4-agent `sale_order` AR→DO probe (runtime-archaeologist) AND the merged cross-repo PR survey (ruff/OGAR/lance-graph/openproject/tesseract) agreed this was the ONE missing wire: the THINK arm (`classid → ClassView`, `has_function → MethodSig`) is converged + merged; the DO-arm `ActionInvocation`/`ActionDef` type was ABSENT. **`ActionDef`** (static, `const`-constructible, all `&'static`/`Copy`): `predicate` (= harvested `has_function` method), `object_class` (classid), `exec` (`ExecTarget` incl `SurrealQl`), `guard` (`StateGuard` = KausalSpec field==value), `required_role` (RBAC), `overrides` (OGAR `classid→ClassView` inheritance). **`ClassActions`+`actions_for`** (zero-fallback) mirror `ClassMethods`/`methods_for`. **`effective_actions(parent, child)`** = OGAR inheritance on the action axis (child overrides parent by predicate). **`ActionInvocation`** (dynamic, `Copy`): lifecycle `ActionState{Pending→Committed|Failed|Cancelled}` (sticky terminals), S2.5 `cycle` stamp, idempotency/trace keys, HLC `emitted_at_millis`. **`ActionInvocation::commit(def, actor, impact, now)`** is the gated egress — RBAC FIRST (`auth::ActorContext` must hold `required_role` or be admin → else `Failed`), THEN MUL impact (`mul::GateDecision`: `Flow→Committed`+stamped, `Hold→`Pending/escalate, `Block→Cancelled`). This IS "commit to the external consumer (odoo/openproject/woa/tesseract) after the cycle decides sound." Dispatched via `UnifiedStep`/`ExecTarget`, NOT a per-crate endpoint. Additive, zero-dep. +5 tests green. Consumer reference: `docs/OGAR_CONSUMER_API.md`. Branch `claude/soa-write-deinterlace-inc2`.

.claude/board/STATUS_BOARD.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## cognitive-compilation-v1 — Elixir-template stack (LLM teaches, Lance-Graph runs)
2+
3+
Plan: `.claude/plans/cognitive-compilation-v1.md`. The new idea is the
4+
Elixir-shaped template; the rest of the loop reuses existing organs.
5+
6+
| D-id | Title | Crate(s) | Status | Evidence |
7+
|---|---|---|---|---|
8+
| D-CC-RUNTIME-1 | elixir-template: representation + parser + `source_ranking_v1` slice | elixir-template | **Scaffolded** | 6 tests green (parse, version split, custom atom, round-trip, 7-step slice + guardrail); clippy clean |
9+
| D-CC-RUNTIME-2 | template-runtime: deterministic OGAR-action dispatch (reflex executor) | template-runtime | **Scaffolded** | 4 tests green (threaded dispatch, unknown-action, empty, unimplemented-bubbles); action bodies deferred |
10+
| D-CC-EQUIV-1 | template-equivalence: replay grading | template-equivalence | **Scaffolded** | 4 tests green (Exact, RankOrder-within-tolerance, new-claim-fail, confidence-drift-fail); Semantic deferred |
11+
| D-CC-COMPILER-1 | cognitive-compiler: trace→template synthesis surface | cognitive-compiler | **Scaffolded** | 3 tests green (NotImplemented contract, non-Execution reject, unsourced-claim reject); synthesis = first probe |
12+
| D-CC-RIG-1 | rig-surrealdb pointed at AdaWorldAPI kv-lance fork | rig (sibling) | Queued | additive Cargo wiring |
13+
| D-CC-RUBICON-1 | graph-flow Task for templates (isolated, cherry-pickable) | rs-graph-llm (sibling) | Queued | local copy + branch push as recovery paths |
14+
| D-CC-OGAR-1 | OGAR canonical classes for the loop | OGAR ogar-ontology/ogar-from-elixir | **Exists** | reused, not rebuilt |
15+
| D-CC-INDEX/REVIEW/PROMOTE/LEDGER/FENCE | basin match / reviewers / PR automation / provenance / ownership fence | planner / agents / surreal kv-lance / ractor | **Exists or DEFERRED** | not this PR |
16+
17+
---
18+
119
## symbiont-golden-image-harness — the living all-in-one substrate binary + the first runtime edges
220

321
The golden image (`crates/symbiont`, workspace-`exclude`d): the full Ada stack in ONE binary, then real cross-crate edges onto the canonical SoA. Plan: `crates/symbiont/INTEGRATION_PLAN.md` (PR #555, merged `37cc21b2`).

0 commit comments

Comments
 (0)