From d1a2a864c6ea2433569a6c68891f416336bda948 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:11:28 +0200 Subject: [PATCH 01/14] docs: plan classview-quack-postgres-semantic-parity-v1.md --- ...sview-quack-postgres-semantic-parity-v1.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .claude/plans/classview-quack-postgres-semantic-parity-v1.md diff --git a/.claude/plans/classview-quack-postgres-semantic-parity-v1.md b/.claude/plans/classview-quack-postgres-semantic-parity-v1.md new file mode 100644 index 000000000..337a1279c --- /dev/null +++ b/.claude/plans/classview-quack-postgres-semantic-parity-v1.md @@ -0,0 +1,55 @@ +# ClassView × Quack: PostgreSQL semantics, shape-polymorphic execution and DuckDB benchmark (v1) + +**Status:** PROPOSAL / DOCS ONLY, 2026-10-21. No runtime API, SQL parser, code, benchmark result, storage migration, or implementation ownership is granted by this document. + +**Priority order:** (1) lance-graph-relalg semantic depth, (2) lance-graph-thought-git replay/frontier, (3) ClassView method binding and SQL parity, (4) parallel, *bounded* lance-graph-flow assimilation census/probe. Odoo deferred. This plan supersedes no established law and does not change #1666's owner. + +**Purpose:** Treat PostgreSQL SQL behavior as an independently checkable set of class/method laws executable by Quack over multiple admitted physical shapes. PostgreSQL is the **correctness oracle**, DuckDB the **analytical performance comparator**. Do not fork PostgreSQL, implement an FDW, adopt an ORM, or build a second SQL evaluator as the goal. A SQL-shaped front end may be a test harness only. + +## Existing evidence / boundaries + +- 'crates/lance-graph-quack/src/lib.rs' already describes scan/filter/project/group/aggregate and COUNT, EXISTS, ALL, SUM, MIN, MAX, grouped key operations including GroupSumI32 and GroupSumViaI32. It **lowers** programs. Execution stays in 'lance-graph-mask-risc'; not a new interpreter. +- 'crates/lance-graph-relalg' currently centers on single-population set expressions, normalization and R2IL lowering. Its 'join_body' only diagnoses alpha-acyclic query hypergraphs; it is not a general join executor or proven PostgreSQL semantics. +- 'crates/lance-graph-contract/src/set_rules.rs' carries guarded semantics: Arith, Truth, SumFamily, Population, universe. 'set_algebra.rs' complement normalization must be tested with three-valued Kleene NULL inputs BEFORE semantic equivalence can be claimed. +- #1659 shared-domain lanes; #1666 DR256 nested IAM group closure and lazy per-256-user pages/population chains are **lab evidence only**. #1666 reports ~124 microseconds for 16 license counts at 65k users, with ~3 microseconds spent on AND/count *after population construction*. Earlier CSR prepare still has a millisecond gate. Not a general SQL/PG or DuckDB win. +- SAP CATS already uses direct field/BAPI ordinals; KEEP_DIRECT remains a legal route, not forced into DR64/DR256. +- Existing plans: '.claude/plans/relalg-v1.md', '.claude/plans/thought-git-basics-v1.md', '.claude/plans/thought-git-api-v1.md', '.claude/plans/d-cmr-concept-chain-normalization-v1.md'. Coordinate with EXO-83, EXO-86, EXO-98, EXO-101, EXO-102, EXO-121 and EXO-50. + +## Contract, not a new engine + +Conceptual call: ClassView resolves (ClassId, MethodOrdinal, declared operation law); Quack Binding resolves snapshot/version, typed variable domains, stable codebook, focus, validity and owned/borrowed lanes; optional DR maps numeric coordinates to a physical route. 'relalg/R2IL' composes and lowers only lawful rewrites into the ONE mask-RISC evaluator. Do not put a behavior choice into the binding store or use strings as hot-path identity. 'ClassView::actions' remains a desired *defaulted accessor over existing action metadata*, never a new behavior owner, action registry or commit executor. + +The declaration fixes semantic laws **per method/operation**, not one 'Semantics(ClassId)' for all methods. Source universe size and focus/source generation are BIND-time values; method semantics are not cost-selected. Existing 'set_rules::Semantics' applies where its vector is sufficient. Do not conflate 'hotplug::register_law_for' byte-register laws with this semantic vector. + +Choice among routes is allowed only if an equivalence fixture and law witness admit it; e.g. direct SAP ordinals, ordered runs, sparse positions, DR64/DR256, dense masked populations. Neither 32×128 nor 64×64 is universal or a persisted ABI decision. A 32×128 Boolean tile is 512 bytes (32 subject rows, 128 target slots); a 64×64 tile is also 512 bytes (64-bit rows). A tile does NOT represent bag multiplicities, NULL validity, Wikidata qualifiers, or evidence without additional lawful carriers. Tiles are shared per focus; count cold binding, per-tile witness, auxiliary metadata and scratch. + +## Staged PostgreSQL parity, always with counterexamples + +| Gate | Fixture | Oracle and refusal | +| --- | --- | --- | +| S0 semantic normalization | three-valued Kleene rows including NULL; predicate complement, absorption, NOT IN | compare both as-written and normalized against PostgreSQL and independent row oracle. Refuse unsound rewrite selectively, not all nullable algebra | +| S1 single-table | WHERE, CASE, GROUP BY, COUNT(*), COUNT(expr), COUNT DISTINCT, SUM empty/all-NULL, MIN/MAX, HAVING | PostgreSQL exact result plus error/type behavior; do not replace empty SUM NULL with zero or lose validity | +| S2 cross-table | INNER, LEFT, SEMI/EXISTS, anti/NOT EXISTS, duplicates, key fan-out, absent FK, NULL join key | every output checked with bags/multiplicity, NULL extension and SQL K3; 'Boolean membership' ≠ general SQL JOIN | +| S3 scalar laws | integer overflow/casts, numeric scale/rounding, float association, comparison, collation/order | declare what is supported exactly; typed refusal outside admitted scope; no false PG parity claim | +| S4 recursion/updates | recursive reachability with cycles, negative dependency stratification, evolving snapshot | datafrog oracle; snapshot invalidation, multi-support deletion, independent references; no implicit MVCC parity | +| S5 broader conformance | sqllogictest-style differential cases, randomized counterexamples, representative TPC-H analytical subset | both exact PostgreSQL-parity and fair performance vs DuckDB; scope exclusions published | + +A1 from the ClassView discussion is P0. SetAlgebra's unconditional two-valued rules must not slip into a SQL K3 path. PostgreSQL correctness is per *declared scope*; transaction isolation/MVCC, DDL, time zones, collation, error behavior and client protocol are separate future strata, never silently covered. + +## Fair physical performance gate + +Run an identical query and same data/correctness against PostgreSQL, DuckDB and Quack; explicitly separate: ingest, source prepare, codebook bind, tile/run building, first-touch page, steady-state fold, and result export. Compare cold and warm caches, repeated questions per focus, key skew, varying density, 1/8/32/64/256 selected tiles, changing relation edges, and output-size dominance. No per-user nanosecond headline may hide millisecond preparation. The win condition is a stated query corpus with median and tails and preserved equality; speed on IAM alone is not maturity. + +For one source/focus, contrast: +- KEEP_DIRECT projected ordinals (especially SAP). +- DR32×128 Boolean membership (first low-commitment fixture, 512 B/tile), DR64×64 (512 B), DR256×256 (8 KiB). +- Borrowed ordered runs and sparse positions with lazy tile pointer tables, against full mask rebuild. +- Whole-focus versus OU/team focus. A physical proxy chain stays inside its Dn128 OU locality; typed membership may cross OUs with witnessed hop. Proxy metadata does not steal slot 255 or stand in for closure. + +Preserve ADMISSION B: no value-directed gather across foreign tables during PREPARE. Zero-copy means buffers can be borrowed or shared, **not** that PostgreSQL heap tuples magically become Lance buffers. Frozen codebook witness needs a contract owner and version-attested round-trip, Eq semantics and order preservation proof separately for Lt. Exhaustive 256-local-slot validity, 257th explicit escape/refusal. + +## Admission milestones + +**P0**: K3 soundness test + law-specific refuses and PostgreSQL row oracle. **P1**: one ClassView method over IAM membership/SAP direct projection with route-conformance matrix, 32×128 vs 64×64 vs sparse counted end-to-end. **P2**: independently correct S1/S2 SQL corpus, including bag/NULL; internal relalg lowering, *no ORM conversion*. **P3**: recursive datafrog parity, thought-git frontier/replay and performance with source mutation. **P4**: DuckDB/TPC-H subsets and broader SQL conformance. + +Every milestone is an independent verdict: semantic correctness; binding legality/provenance; performance; memory; cost of mutation. A PASS in one does not waive a FAIL in another. No production write path, new ABI, PostgreSQL compatibility or 'faster than DuckDB' claim is authorized by this plan. From bef3c934d4683198462132087eb4b290d59ce199 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:11:30 +0200 Subject: [PATCH 02/14] docs: plan relalg-thought-git-frontier-polyfill-v1.md --- ...relalg-thought-git-frontier-polyfill-v1.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .claude/plans/relalg-thought-git-frontier-polyfill-v1.md diff --git a/.claude/plans/relalg-thought-git-frontier-polyfill-v1.md b/.claude/plans/relalg-thought-git-frontier-polyfill-v1.md new file mode 100644 index 000000000..52d4fe884 --- /dev/null +++ b/.claude/plans/relalg-thought-git-frontier-polyfill-v1.md @@ -0,0 +1,52 @@ +# relalg × thought-git: algebraic method behavior and amortized frontier (v1) + +**Status:** PROPOSAL / DOCS ONLY, 2026-10-21. +**Highest implementation priorities:** 'lance-graph-relalg' and reusable 'lance-graph-thought-git'. Keep the existing D-TGB oracle and D-RA/D-CMR owners. No independent rule interpreter, evaluator, graph store, object model, scheduler or hidden write side effect. + +## Thesis + +One method-bearing class surface should admit 'think', 'counterfactual' and 'do' (names **conceptual**, not proposed hot ABI). Each route binds a declared ClassId + numeric MethodOrdinal + algebraic law to a witnessed focus. Evaluation returns either a relation/result, a replayable Thought delta, or an authorized-action proposal. The SAME relalg/R2IL/mask-RISC lowerer executes admissible set operations. A thought's execution is **not** itself a commit; Rubicon/MUL/ActionDef authorization and explicit Rust LanceCycleWriter write remain separate. + +A method is defined by semantics (e.g. Boolean existence, bag relational algebra, exact integer, K3), operands, guards and a result contract. Physical realisations are routes, not alternative laws or alternative truth engines. Prefer existing 'ClassView::compute_dag' and metadata/action accessor over new descriptor hierarchies; compile topological declaration once per class/schema version; data/codebook/focus witnesses must be separately invalidated. + +## Why relalg first + +Existing relalg is a single-table experimental algebra with 'Rel', 'normalize', 'symbolic', R2IL lowering. Its 'join_body::is_alpha_acyclic' tests the shape of a join, not its execution. The 'set_rules' guarded catalogue belongs to the contract; relalg owns lawful composition/lowering, not a duplicate semantic registry. Existing Quack already has masks, COUNT, EXISTS, ALL, SUM, MIN/MAX, grouped terminals and constrained FK-keyed 'GroupSumViaI32'; confirm rather than rebuilding it. + +1. **R0 correctness before expansion.** A Kleene three-valued oracle on NULL lanes for 'set_algebra::normalize' and the catalogue. Check complement, NOT, negated membership, absorb and SUM empty/null. Red implies selective refusal/guard, no blanket 'correct under SQL' claim. +2. **R1 relationship algebra.** Extend/probe typed shared-domain relation composition without value-directed foreign-table gather (ADMISSION B). Distinct/Bag, K3, external references, supports, key/cardinality witnesses, and cyclic join bodies are separate acceptance strata. Use existing #1659 shared-coordinate/side and #1666 DR256 lab results where admitted. Test INNER/SEMI/ANTI/LEFT, fan-out and duplicates. +3. **R2 law-licensed rule catalogue.** 'set_rules::Semantics' identifies admitted rewrites where expressible. If an equality rule needs more conditions, keep explicit per-rule refusals rather than inventing a universal semiring. egglog, if introduced, is an **offline/compile-time rewrite candidate/proof oracle** with admitted equalities; it never changes the method's declared law, and never becomes an unbounded production query-time planner. +4. **R3 recursion.** datafrog is an independent reference for closure/replay; first match its results in a bounded monotone rule fixture. Recursive driver can apply mask/frontier folds where legal; prevent cycles through negation without strata. NARS truth revision is not presumed a semiring; keep its established finisher and revision/provenance semantics separate. +5. **R4 class method reuse.** One behavior method runs correctly on direct ordinals, sparse runs, DR64 and DR256 when lawful. Prove same result including duplicate semantics and the 257th-slot condition. Do not introduce generic planner types or OGAR as a mandatory layer. + +## Thought-git as the FIRST real non-SQL consumer + +Reuse '.claude/plans/thought-git-basics-v1.md' and 'thought-git-api-v1.md'. The lab 'crates/thought-git-probe' already has fixed anomaly fixtures, from-scratch next-version oracle, sparse slot experiments, with no production branch/land/rebase pipeline. EXO-98 defines the reusable git verbs and driver independence. + +- **Thought 0** is immutable sealed givens for the current version; 1..63 are bounded temporary thought slots. An attention delta *is* the branch overlay; replay receipts and derived fact relations live in a **separate metadata table**, not duplicated node objects. +- Input is a (snapshot, focus, class method ordinal, numeric operands, source/relationship witness). Output is derived cells, provenance, read/write masks, anomaly readings and a deterministic replay receipt. +- In-memory branch, diff, squash, discard and replay execute only admitted folds. Commit/land is one authorized, explicit, coalesced sparse writer-cycle operation. 'Plan' and 'Prune' do not write Lance; error/contradiction preserves evidence rather than fabricating confirmation. +- Thought frontier: changing an input invalidates the affected method outputs only; a typed dependency mask propagates the change, not the whole 64-thought stack. A full recompute remains the oracle. Retracting a support path from a diamond MUST preserve the surviving support; naive Boolean subtraction is unsound. +- **EpistemicState5** (CausalEdge64 bits 59..63) is Topology2 × Certification3, NOT a scratch dirty mask, no implied independent supporting root for duplicate/replayed derivations. 'pearl::hydrate' and 'pearl::revise' have distinct monotone writers. A counterfactual never elevates production evidence. +- Snapshot generation and 'thought_address' witness prevent the ABA problem when a freed slot is reused. Rebase/replay is refused on stale codebooks or proof generations without a legal recompute. + +### First falsifier: substitution / Sudoku frontier + +Fixture: x = 2y, y = 2z, w = 2x. Two independent substitution routes produce the same result; then mutate one source relation, remove one support path, and reuse a thought slot at a new generation. Derive w = 8z when premises hold. Compare full from-scratch derivation and incremental frontier for each affected class/method, including provenance roots and non-commutative/NULL/Bag counterexamples. No duplicate proof becomes 'new evidence'. + +Use an IAM nested group diamond as a second fixture: U ∘ G* ∘ P (Boolean). Verify not only result parity but touched tiles/pages, amortized common bindings, and correct deletion of one among two support paths. Use a source-lane direct read; reveal old millisecond CSR preparation explicitly rather than hiding it in a fold time. + +## Phases and gates + +| Phase | Owner/where to extend | Deliverable | Falsifier | +| --- | --- | --- | --- | +| T0 | relalg + contract rule tests | SQL/K3 truth safety | normalized = original = row/PG oracle for every tested truth-stratum | +| T1 | relalg, Quack existing execution | typed relation/JoinDomain fold | SQL Bag/Distinct + nullable join parity; no gather | +| T2 | thought-git-probe, existing D-TGB API plan | substitution and group-frontier replay | full recompute parity for add, delete, cycle, diamond, ABA | +| T3 | datafrog oracle + relalg frontiers | bounded recursion and stable fixpoint | closure results and exact termination match datafrog | +| T4 | optional egglog proof path | admitted equalities/optimization | each rewrite law licensed; no adverse K3/Bag rewrite | +| T5 | one ClassView method consumed via flow | think vs counterfactual vs proposal | exact replay and unchanged sealed snapshot until authorized commit | + +**Performance:** report all costs: codebook/domain bind, prefetch/tile build, first touch, steady fold, output materialization, invalidation. Measure 32×128 vs 64×64 for membership (both 512 bytes), DR256 and sparse; interpret shape selection as a route under fixed laws. No hard-coded shape in API. + +**Explicit exclusions:** Odoo deferred; no persisted Node32/SoA layout decision, no new graph interpreter/ORM, no direct action side effects inside folds, no claim of autonomous learning, no shared cache without version-provenance and invalidation tests. From 6ab0821cd83da41c1064981ad4a17c4fdeb71ccd Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:11:32 +0200 Subject: [PATCH 03/14] docs: plan lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md --- ...ow-rs-graph-llm-rubicon-assimilation-v1.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md diff --git a/.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md b/.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md new file mode 100644 index 000000000..9128e642d --- /dev/null +++ b/.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md @@ -0,0 +1,53 @@ +# lance-graph-flow: bounded rs-graph-llm assimilation as a ClassView method driver (v1) + +**Status:** PARALLEL DOCS-FIRST INVESTIGATION / PROPOSAL, 2026-10-21. 'lance-graph-flow' does not yet exist in lance-graph. Do not copy the entire framework, open a runtime fork, create a new session database, or take ownership of #1666, relalg, thought-git or the supervisor. + +**Decision proposal:** YES to parallel **interface census + small contract probe** while relalg and thought-git remain the implementation priority. Runtime assimilation waits until a validated replay/semantics seam exists. This updates the question already recognized in 'thought-git-basics-v1.md' / EXO-98, without replacing that plan or introducing a second executor. + +## Verified source capabilities + +- 'AdaWorldAPI/rs-graph-llm/graph-flow/src/task.rs' has Task, TaskResult, NextAction (Continue, ContinueAndExecute, WaitForInput, GoTo, End, GoBack). 'graph-flow/src/graph.rs' has Graph, conditional edges and GraphBuilder. These are orchestration primitives, not relational execution. +- 'AdaWorldAPI/rs-graph-llm/crates/graph-flow-lance/src/lib.rs' already specifies a **lance-abi handle with source generation** between tasks, a z8run-lance registry/envelope shared by the graph and z8run, and explicit materialize-only data export. +- Its 'tasks.rs' rewrites immutable plans under handles; 'z8run.rs' registers graph-flow nodes, pause/session handles and resume, never passes row/mask data between layers. This is the smallest assimilable API seam. +- 'lance-graph-report' already lowers ReportPlan through Quack and one mask-RISC evaluator and includes a z8run-shaped connection; reuse it, never another runtime evaluator. +- 'lance-graph-contract/src/kanban.rs' already declares KanbanColumn/next_phases, phase transitions and MUL gate handling. 'lance-graph-supervisor' sealed cycle_driver owns state progression, WAL and versioned sparse apply. 'kanban_actor.rs' is read-only. No graph-flow task may autonomously move a mailbox state or commit a Lance version. +- 'lance-graph-act-r/src/lib.rs' has deterministic witnessed proposal arbitration; neither persistent cognitive buffers nor learning. The ACT-R caller evaluates eligibility elsewhere; action selection is not authority to commit. + +## Desired user surface (ergonomics, NOT executor) + +The LangGraph-ish appearance can be GraphBuilder -> Task -> NextAction / Pause -> Resume, with a **bound method handle** (ClassId, MethodOrdinal, law identifier, source generation, focus and thought version), not ORM objects. 'think', 'counterfactual' and 'do' are capabilities exposed as *method routes*, not three engines. ClassView declares legal method and action metadata; Quack Binding resolves operands; optional DR maps physical shape; relalg/R2IL/mask-RISC evaluates. + +- THINK task: returns immutable derived result/Thought delta, not a new sealed version. +- COUNTERFACTUAL task: executes same method law over a witnessed overlay/focus; records delta/provenance; prevents hypothetical evidence becoming certified production state. +- DO task: evaluates method and guards, produces a witnessed ActionDef proposal; separate MUL/Heckhausen Rubicon phase and caller authorization determine whether to stage the effect. Actual write only through existing supervisor/cycle_driver + explicit Rust LanceCycleWriter terminal. +- A task's Context/session may contain IDs, generation-bound handles, small control state and external human reply; NEVER resident SoA row/plane, cached fold buffers or reconstructed node object graph. +- Live LangGraph-style pause/resume must fail closed on generation or codebook change; a stale session may deterministically rebind/replay but cannot reuse invalid effects or silently auto-commit. +- Do not equate psychological Heckhausen Rubicon (predecisional -> preactional -> actional -> postactional) with storage transaction commit or with Kanban columns by identity. Document a *declared mapping* to existing Planning, CognitiveWork, Evaluation, Commit/Plan/Prune and test every permitted transition. + +## What to assimilate / what not to assimilate + +| Adopt as thin behavior surface | Keep out of the execution/storage core | +| --- | --- | +| Task/GraphBuilder/NextAction ergonomic API, conditional branch, interrupt/resume | full graph-flow executor rewrite or independent ORM | +| Generation-bound lance-abi handle and z8run-lance envelope interop | PostgreSQL/in-memory session storage as cognitive truth source | +| Explicit terminal, operator-visible proposal/approval | side-effectful Task::run bypassing ActionDef/MUL/revision | +| Rig completion trait only at explicit LLM boundary if requested | LLM as default source of truth, learned epistemic cert from text | +| Graph flow as optional caller of thought-git verbs | duplicate scheduler/state-machine to replace supervisor's sealed cycle | + +The z8run adapter is a **host** of flow graphs; Quack remains the evaluator. No requirement to install or fork LangGraph Python or instantiate graph-flow's original session backends in production. Names/labels resolve to numeric IDs on cold construction only. + +## Staged parallel work and independent falsifiers + +**F0 (parallel now, documentation only):** census which Task/NextAction/context/session/registry interfaces can be carried intact versus need a version witness or a typed refusal; attach concrete source paths. Identify and count forbidden stateful copies, duplicate evaluators, second write owners, default string dispatch, and all coercions between Rubicon and Kanban. + +**F1 (after relalg T0 / thought-git T2 seam):** *one* representative graph with two method calls, a counterfactual branch, and WaitForInput. On pause, the saved session contains ONLY handle/control metadata. Simulated source update makes resume refuse. No node data materialization except terminal. + +**F2:** independent phase-1 OGAR ActionDef driver and graph-flow driver run exactly the same scripted verb sequence against thought-git's from-scratch oracle. Verify byte-identical thought cells, receipts, mask outcomes and metadata; no action without explicit authorization. ACT-R selects a proposal in separate test with stale candidate refusal. + +**F3 (optional after verified fences):** scaffold 'lance-graph-flow' crate as a small consumer-side surface; use existing code and dependencies only if legally/technically compatible. Preserve 'rs-graph-llm' as oracle/reference until equivalence proven; refuse dependencies/copying that violate the one-engine, one-truth-store contract. + +**Stop conditions:** new execution loop or SQL evaluator, checkpointer becoming authoritative storage, conflicting Kanban transition owner, workflow graph identity becoming row identity, missing generation refusal, non-equivalent replay, or requiring pre-existing data materialization in Context. Halt runtime assimilation rather than papering over with adapters. + +## Coordination + +Main PR: [ClassView/Quack PostgreSQL parity plan](classview-quack-postgres-semantic-parity-v1.md). Priority companion: [relalg × thought-git frontier](relalg-thought-git-frontier-polyfill-v1.md). Existing source: '.claude/plans/thought-git-basics-v1.md' and EXO-98; '.claude/plans/relalg-v1.md' and EXO-86; EXO-50 messages. Any code handoff needs an explicit owner/claim and separate implementation PR. This PR changes plans only. From ba5fe95a2e08231261587459fd77b84c919d8408 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:11:35 +0200 Subject: [PATCH 04/14] docs: plan 2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md --- ...assview-sql-thoughtgit-relalg-flow-plan.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md diff --git a/.claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md b/.claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md new file mode 100644 index 000000000..1e8ff438e --- /dev/null +++ b/.claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md @@ -0,0 +1,28 @@ +# 2026-10-21: Quack class-method substrate, relalg + thought-git priority, flow assimilation + +**Status:** PLANNED ONLY (docs-only). No runtime, tests, measured speedups, SQL parity, admission, ABI or new crate. +**Operator intent:** Make SQL/PostgreSQL semantic operations and SAP/graph/cognitive methods class-bound laws over the same Quack Binding Store. Different storage shapes (KEEP_DIRECT, ordered runs, 32×128/64×64, DR256) are physical choices. PostgreSQL is parity oracle; DuckDB analytical comparator, not a promise of speed. + +## Plans (this branch) +- '.claude/plans/classview-quack-postgres-semantic-parity-v1.md' (master semantic + shape contract; NULL K3 / Bags / joins / performance gates). +- '.claude/plans/relalg-thought-git-frontier-polyfill-v1.md' (PRIORITY: relational depth, datafrog oracle, optional egglog law checker, replay/frontier, same method surface). +- '.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md' (parallel bounded API assimilation; LangGraph-ish Task/NextAction, Rubicon/Kanban, z8run handle; no new scheduler/storage/evaluator). + +## Provenance/adjacency + +#1659 shared-domain zero-copy lanes and ClassView/DR lab; #1666 draft IAM nested-group DR256 + lazy pages/populations (do not take over owner). Existing relalg and set_rules not full SQL parity. Thought-git has only probe + oracle, no production landing. rs-graph-llm graph-flow-lance already carries generation-witnessed handles and z8run integration; lance-graph-flow not built. + +Linear: EXO-50 agent bus (handoff), EXO-86 relalg, EXO-83 SQL() polyfill, EXO-98 thought-git driver, EXO-101 datafrog, EXO-102 RU algebra, EXO-121 ClassView capstone, EXO-79 PathMap/MORK (oracle only, licensing remains gated). + +## Gate sequence (independent verdicts) + +1. P0: Kleene K3 rewrite safety against PostgreSQL/row oracle (do not rewrite nullable complements blindly). +2. P1: one method across at least two physical shapes; 32×128 Boolean membership is first low-commitment tile probe (512 bytes), not global ABI. No ORM. +3. P2: relalg cross-relation composition with SQL DISTINCT/Bag/NULL semantics and exact oracles; direct SAP ordinals stay direct. +4. P3: thought-git substitution/branch/replay/frontier parity and multi-support deletion, including snapshot ABA and independent evidential roots. +5. P4: datafrog recursion; egglog only as optional law-licensed rewrite oracle; eventual fair DuckDB benchmark, full bind/prepare/materialization included. +6. F0 parallel: rs-graph-llm flow API census, generation-bound handles, pause/resume, ClassView method/ActionDef proposal/Rubicon mapping. Runtime port F1+ waits for semantic/replay seam. + +**Invariants:** ClassView declares laws per operation, Quack binds, optional DR routes, mask-RISC executes. No string hot path, no new evaluator/planner, no value-directed foreign gather (ADMISSION B), no automatic effects, no undocumented claims of parity. Law preserves K3, Bag, count/sum rounding, provenance and versioned codebook witnesses. + +**Coordination:** docs-only PR must be linked on EXO-50 as a new message. Do not silently assign new owners, change other PRs, merge, or implement. From ce3cfbdd5b2c6ffaee0add022a53c5dc0be10425 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:27 +0200 Subject: [PATCH 05/14] docs: adopt D-QSP plan nomenclature --- ...sp-classview-quack-postgresql-parity-v1.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md diff --git a/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md b/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md new file mode 100644 index 000000000..9f0fa58e9 --- /dev/null +++ b/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md @@ -0,0 +1,55 @@ +# D-QSP — ClassView × Quack: PostgreSQL semantics, shape-polymorphic execution and DuckDB benchmark (v1) + +**Plan ID:** D-QSP (Quack SQL/PostgreSQL semantic parity). Dependencies: D-RFT (relalg × thought-git), D-LFA (optional flow driver); existing D-SQLP, D-RA, D-CMR retained. No duplicate ownership.\n\n**Status:** PROPOSAL / DOCS ONLY, 2026-10-21. No runtime API, SQL parser, code, benchmark result, storage migration, or implementation ownership is granted by this document. + +**Priority order:** (1) lance-graph-relalg semantic depth, (2) lance-graph-thought-git replay/frontier, (3) ClassView method binding and SQL parity, (4) parallel, *bounded* lance-graph-flow assimilation census/probe. Odoo deferred. This plan supersedes no established law and does not change #1666's owner. + +**Purpose:** Treat PostgreSQL SQL behavior as an independently checkable set of class/method laws executable by Quack over multiple admitted physical shapes. PostgreSQL is the **correctness oracle**, DuckDB the **analytical performance comparator**. Do not fork PostgreSQL, implement an FDW, adopt an ORM, or build a second SQL evaluator as the goal. A SQL-shaped front end may be a test harness only. + +## Existing evidence / boundaries + +- 'crates/lance-graph-quack/src/lib.rs' already describes scan/filter/project/group/aggregate and COUNT, EXISTS, ALL, SUM, MIN, MAX, grouped key operations including GroupSumI32 and GroupSumViaI32. It **lowers** programs. Execution stays in 'lance-graph-mask-risc'; not a new interpreter. +- 'crates/lance-graph-relalg' currently centers on single-population set expressions, normalization and R2IL lowering. Its 'join_body' only diagnoses alpha-acyclic query hypergraphs; it is not a general join executor or proven PostgreSQL semantics. +- 'crates/lance-graph-contract/src/set_rules.rs' carries guarded semantics: Arith, Truth, SumFamily, Population, universe. 'set_algebra.rs' complement normalization must be tested with three-valued Kleene NULL inputs BEFORE semantic equivalence can be claimed. +- #1659 shared-domain lanes; #1666 DR256 nested IAM group closure and lazy per-256-user pages/population chains are **lab evidence only**. #1666 reports ~124 microseconds for 16 license counts at 65k users, with ~3 microseconds spent on AND/count *after population construction*. Earlier CSR prepare still has a millisecond gate. Not a general SQL/PG or DuckDB win. +- SAP CATS already uses direct field/BAPI ordinals; KEEP_DIRECT remains a legal route, not forced into DR64/DR256. +- Existing plans: '.claude/plans/relalg-v1.md', '.claude/plans/thought-git-basics-v1.md', '.claude/plans/thought-git-api-v1.md', '.claude/plans/d-cmr-concept-chain-normalization-v1.md'. Coordinate with EXO-83, EXO-86, EXO-98, EXO-101, EXO-102, EXO-121 and EXO-50. + +## Contract, not a new engine + +Conceptual call: ClassView resolves (ClassId, MethodOrdinal, declared operation law); Quack Binding resolves snapshot/version, typed variable domains, stable codebook, focus, validity and owned/borrowed lanes; optional DR maps numeric coordinates to a physical route. 'relalg/R2IL' composes and lowers only lawful rewrites into the ONE mask-RISC evaluator. Do not put a behavior choice into the binding store or use strings as hot-path identity. 'ClassView::actions' remains a desired *defaulted accessor over existing action metadata*, never a new behavior owner, action registry or commit executor. + +The declaration fixes semantic laws **per method/operation**, not one 'Semantics(ClassId)' for all methods. Source universe size and focus/source generation are BIND-time values; method semantics are not cost-selected. Existing 'set_rules::Semantics' applies where its vector is sufficient. Do not conflate 'hotplug::register_law_for' byte-register laws with this semantic vector. + +Choice among routes is allowed only if an equivalence fixture and law witness admit it; e.g. direct SAP ordinals, ordered runs, sparse positions, DR64/DR256, dense masked populations. Neither 32×128 nor 64×64 is universal or a persisted ABI decision. A 32×128 Boolean tile is 512 bytes (32 subject rows, 128 target slots); a 64×64 tile is also 512 bytes (64-bit rows). A tile does NOT represent bag multiplicities, NULL validity, Wikidata qualifiers, or evidence without additional lawful carriers. Tiles are shared per focus; count cold binding, per-tile witness, auxiliary metadata and scratch. + +## D-QSP work items: staged PostgreSQL parity, always with counterexamples + +| Gate | Fixture | Oracle and refusal | +| --- | --- | --- | +| D-QSP-0 semantic normalization | three-valued Kleene rows including NULL; predicate complement, absorption, NOT IN | compare both as-written and normalized against PostgreSQL and independent row oracle. Refuse unsound rewrite selectively, not all nullable algebra | +| D-QSP-1 single-table | WHERE, CASE, GROUP BY, COUNT(*), COUNT(expr), COUNT DISTINCT, SUM empty/all-NULL, MIN/MAX, HAVING | PostgreSQL exact result plus error/type behavior; do not replace empty SUM NULL with zero or lose validity | +| D-QSP-2 cross-table | INNER, LEFT, SEMI/EXISTS, anti/NOT EXISTS, duplicates, key fan-out, absent FK, NULL join key | every output checked with bags/multiplicity, NULL extension and SQL K3; 'Boolean membership' ≠ general SQL JOIN | +| D-QSP-3 scalar laws | integer overflow/casts, numeric scale/rounding, float association, comparison, collation/order | declare what is supported exactly; typed refusal outside admitted scope; no false PG parity claim | +| D-QSP-4 recursion/updates | recursive reachability with cycles, negative dependency stratification, evolving snapshot | datafrog oracle; snapshot invalidation, multi-support deletion, independent references; no implicit MVCC parity | +| D-QSP-5 broader conformance | sqllogictest-style differential cases, randomized counterexamples, representative TPC-H analytical subset | both exact PostgreSQL-parity and fair performance vs DuckDB; scope exclusions published | + +A1 from the ClassView discussion maps to D-QSP-0. SetAlgebra's unconditional two-valued rules must not slip into a SQL K3 path. PostgreSQL correctness is per *declared scope*; transaction isolation/MVCC, DDL, time zones, collation, error behavior and client protocol are separate future strata, never silently covered. + +## Fair physical performance gate + +Run an identical query and same data/correctness against PostgreSQL, DuckDB and Quack; explicitly separate: ingest, source prepare, codebook bind, tile/run building, first-touch page, steady-state fold, and result export. Compare cold and warm caches, repeated questions per focus, key skew, varying density, 1/8/32/64/256 selected tiles, changing relation edges, and output-size dominance. No per-user nanosecond headline may hide millisecond preparation. The win condition is a stated query corpus with median and tails and preserved equality; speed on IAM alone is not maturity. + +For one source/focus, contrast: +- KEEP_DIRECT projected ordinals (especially SAP). +- DR32×128 Boolean membership (first low-commitment fixture, 512 B/tile), DR64×64 (512 B), DR256×256 (8 KiB). +- Borrowed ordered runs and sparse positions with lazy tile pointer tables, against full mask rebuild. +- Whole-focus versus OU/team focus. A physical proxy chain stays inside its Dn128 OU locality; typed membership may cross OUs with witnessed hop. Proxy metadata does not steal slot 255 or stand in for closure. + +Preserve ADMISSION B: no value-directed gather across foreign tables during PREPARE. Zero-copy means buffers can be borrowed or shared, **not** that PostgreSQL heap tuples magically become Lance buffers. Frozen codebook witness needs a contract owner and version-attested round-trip, Eq semantics and order preservation proof separately for Lt. Exhaustive 256-local-slot validity, 257th explicit escape/refusal. + +## Admission milestones + +**D-QSP-0**: K3 soundness test + law-specific refuses and PostgreSQL row oracle. **D-QSP-1**: one ClassView method over IAM membership/SAP direct projection with route-conformance matrix, 32×128 vs 64×64 vs sparse counted end-to-end. **D-QSP-2**: independently correct S1/S2 SQL corpus, including bag/NULL; internal relalg lowering, *no ORM conversion*. **D-QSP-3**: recursive datafrog parity, thought-git frontier/replay and performance with source mutation. **D-QSP-4/5**: DuckDB/TPC-H subsets and broader SQL conformance. + +Every milestone is an independent verdict: semantic correctness; binding legality/provenance; performance; memory; cost of mutation. A PASS in one does not waive a FAIL in another. No production write path, new ABI, PostgreSQL compatibility or 'faster than DuckDB' claim is authorized by this plan. From 7df7c1e0c02adfbca5d92b9e9a2c18f8e8bd085f Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:30 +0200 Subject: [PATCH 06/14] docs: retire non-D-prefixed path classview-quack-postgres-semantic-parity-v1.md --- ...sview-quack-postgres-semantic-parity-v1.md | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 .claude/plans/classview-quack-postgres-semantic-parity-v1.md diff --git a/.claude/plans/classview-quack-postgres-semantic-parity-v1.md b/.claude/plans/classview-quack-postgres-semantic-parity-v1.md deleted file mode 100644 index 337a1279c..000000000 --- a/.claude/plans/classview-quack-postgres-semantic-parity-v1.md +++ /dev/null @@ -1,55 +0,0 @@ -# ClassView × Quack: PostgreSQL semantics, shape-polymorphic execution and DuckDB benchmark (v1) - -**Status:** PROPOSAL / DOCS ONLY, 2026-10-21. No runtime API, SQL parser, code, benchmark result, storage migration, or implementation ownership is granted by this document. - -**Priority order:** (1) lance-graph-relalg semantic depth, (2) lance-graph-thought-git replay/frontier, (3) ClassView method binding and SQL parity, (4) parallel, *bounded* lance-graph-flow assimilation census/probe. Odoo deferred. This plan supersedes no established law and does not change #1666's owner. - -**Purpose:** Treat PostgreSQL SQL behavior as an independently checkable set of class/method laws executable by Quack over multiple admitted physical shapes. PostgreSQL is the **correctness oracle**, DuckDB the **analytical performance comparator**. Do not fork PostgreSQL, implement an FDW, adopt an ORM, or build a second SQL evaluator as the goal. A SQL-shaped front end may be a test harness only. - -## Existing evidence / boundaries - -- 'crates/lance-graph-quack/src/lib.rs' already describes scan/filter/project/group/aggregate and COUNT, EXISTS, ALL, SUM, MIN, MAX, grouped key operations including GroupSumI32 and GroupSumViaI32. It **lowers** programs. Execution stays in 'lance-graph-mask-risc'; not a new interpreter. -- 'crates/lance-graph-relalg' currently centers on single-population set expressions, normalization and R2IL lowering. Its 'join_body' only diagnoses alpha-acyclic query hypergraphs; it is not a general join executor or proven PostgreSQL semantics. -- 'crates/lance-graph-contract/src/set_rules.rs' carries guarded semantics: Arith, Truth, SumFamily, Population, universe. 'set_algebra.rs' complement normalization must be tested with three-valued Kleene NULL inputs BEFORE semantic equivalence can be claimed. -- #1659 shared-domain lanes; #1666 DR256 nested IAM group closure and lazy per-256-user pages/population chains are **lab evidence only**. #1666 reports ~124 microseconds for 16 license counts at 65k users, with ~3 microseconds spent on AND/count *after population construction*. Earlier CSR prepare still has a millisecond gate. Not a general SQL/PG or DuckDB win. -- SAP CATS already uses direct field/BAPI ordinals; KEEP_DIRECT remains a legal route, not forced into DR64/DR256. -- Existing plans: '.claude/plans/relalg-v1.md', '.claude/plans/thought-git-basics-v1.md', '.claude/plans/thought-git-api-v1.md', '.claude/plans/d-cmr-concept-chain-normalization-v1.md'. Coordinate with EXO-83, EXO-86, EXO-98, EXO-101, EXO-102, EXO-121 and EXO-50. - -## Contract, not a new engine - -Conceptual call: ClassView resolves (ClassId, MethodOrdinal, declared operation law); Quack Binding resolves snapshot/version, typed variable domains, stable codebook, focus, validity and owned/borrowed lanes; optional DR maps numeric coordinates to a physical route. 'relalg/R2IL' composes and lowers only lawful rewrites into the ONE mask-RISC evaluator. Do not put a behavior choice into the binding store or use strings as hot-path identity. 'ClassView::actions' remains a desired *defaulted accessor over existing action metadata*, never a new behavior owner, action registry or commit executor. - -The declaration fixes semantic laws **per method/operation**, not one 'Semantics(ClassId)' for all methods. Source universe size and focus/source generation are BIND-time values; method semantics are not cost-selected. Existing 'set_rules::Semantics' applies where its vector is sufficient. Do not conflate 'hotplug::register_law_for' byte-register laws with this semantic vector. - -Choice among routes is allowed only if an equivalence fixture and law witness admit it; e.g. direct SAP ordinals, ordered runs, sparse positions, DR64/DR256, dense masked populations. Neither 32×128 nor 64×64 is universal or a persisted ABI decision. A 32×128 Boolean tile is 512 bytes (32 subject rows, 128 target slots); a 64×64 tile is also 512 bytes (64-bit rows). A tile does NOT represent bag multiplicities, NULL validity, Wikidata qualifiers, or evidence without additional lawful carriers. Tiles are shared per focus; count cold binding, per-tile witness, auxiliary metadata and scratch. - -## Staged PostgreSQL parity, always with counterexamples - -| Gate | Fixture | Oracle and refusal | -| --- | --- | --- | -| S0 semantic normalization | three-valued Kleene rows including NULL; predicate complement, absorption, NOT IN | compare both as-written and normalized against PostgreSQL and independent row oracle. Refuse unsound rewrite selectively, not all nullable algebra | -| S1 single-table | WHERE, CASE, GROUP BY, COUNT(*), COUNT(expr), COUNT DISTINCT, SUM empty/all-NULL, MIN/MAX, HAVING | PostgreSQL exact result plus error/type behavior; do not replace empty SUM NULL with zero or lose validity | -| S2 cross-table | INNER, LEFT, SEMI/EXISTS, anti/NOT EXISTS, duplicates, key fan-out, absent FK, NULL join key | every output checked with bags/multiplicity, NULL extension and SQL K3; 'Boolean membership' ≠ general SQL JOIN | -| S3 scalar laws | integer overflow/casts, numeric scale/rounding, float association, comparison, collation/order | declare what is supported exactly; typed refusal outside admitted scope; no false PG parity claim | -| S4 recursion/updates | recursive reachability with cycles, negative dependency stratification, evolving snapshot | datafrog oracle; snapshot invalidation, multi-support deletion, independent references; no implicit MVCC parity | -| S5 broader conformance | sqllogictest-style differential cases, randomized counterexamples, representative TPC-H analytical subset | both exact PostgreSQL-parity and fair performance vs DuckDB; scope exclusions published | - -A1 from the ClassView discussion is P0. SetAlgebra's unconditional two-valued rules must not slip into a SQL K3 path. PostgreSQL correctness is per *declared scope*; transaction isolation/MVCC, DDL, time zones, collation, error behavior and client protocol are separate future strata, never silently covered. - -## Fair physical performance gate - -Run an identical query and same data/correctness against PostgreSQL, DuckDB and Quack; explicitly separate: ingest, source prepare, codebook bind, tile/run building, first-touch page, steady-state fold, and result export. Compare cold and warm caches, repeated questions per focus, key skew, varying density, 1/8/32/64/256 selected tiles, changing relation edges, and output-size dominance. No per-user nanosecond headline may hide millisecond preparation. The win condition is a stated query corpus with median and tails and preserved equality; speed on IAM alone is not maturity. - -For one source/focus, contrast: -- KEEP_DIRECT projected ordinals (especially SAP). -- DR32×128 Boolean membership (first low-commitment fixture, 512 B/tile), DR64×64 (512 B), DR256×256 (8 KiB). -- Borrowed ordered runs and sparse positions with lazy tile pointer tables, against full mask rebuild. -- Whole-focus versus OU/team focus. A physical proxy chain stays inside its Dn128 OU locality; typed membership may cross OUs with witnessed hop. Proxy metadata does not steal slot 255 or stand in for closure. - -Preserve ADMISSION B: no value-directed gather across foreign tables during PREPARE. Zero-copy means buffers can be borrowed or shared, **not** that PostgreSQL heap tuples magically become Lance buffers. Frozen codebook witness needs a contract owner and version-attested round-trip, Eq semantics and order preservation proof separately for Lt. Exhaustive 256-local-slot validity, 257th explicit escape/refusal. - -## Admission milestones - -**P0**: K3 soundness test + law-specific refuses and PostgreSQL row oracle. **P1**: one ClassView method over IAM membership/SAP direct projection with route-conformance matrix, 32×128 vs 64×64 vs sparse counted end-to-end. **P2**: independently correct S1/S2 SQL corpus, including bag/NULL; internal relalg lowering, *no ORM conversion*. **P3**: recursive datafrog parity, thought-git frontier/replay and performance with source mutation. **P4**: DuckDB/TPC-H subsets and broader SQL conformance. - -Every milestone is an independent verdict: semantic correctness; binding legality/provenance; performance; memory; cost of mutation. A PASS in one does not waive a FAIL in another. No production write path, new ABI, PostgreSQL compatibility or 'faster than DuckDB' claim is authorized by this plan. From e28845679b7de9a1b47f742940f95ba5c035409d Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:33 +0200 Subject: [PATCH 07/14] docs: adopt D-RFT plan nomenclature --- .../d-rft-relalg-thought-git-frontier-v1.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .claude/plans/d-rft-relalg-thought-git-frontier-v1.md diff --git a/.claude/plans/d-rft-relalg-thought-git-frontier-v1.md b/.claude/plans/d-rft-relalg-thought-git-frontier-v1.md new file mode 100644 index 000000000..c76e21ee2 --- /dev/null +++ b/.claude/plans/d-rft-relalg-thought-git-frontier-v1.md @@ -0,0 +1,52 @@ +# D-RFT — relalg × thought-git: algebraic method behavior and amortized frontier (v1) + +**Plan ID:** D-RFT (relalg-frontier thought-git method substrate). Existing D-RA, D-CMR, D-TGB identifiers retain their owners; D-RFT only coordinates additional conformance gates.\n\n**Status:** PROPOSAL / DOCS ONLY, 2026-10-21. +**Highest implementation priorities:** 'lance-graph-relalg' and reusable 'lance-graph-thought-git'. Keep the existing D-TGB oracle and D-RA/D-CMR owners. No independent rule interpreter, evaluator, graph store, object model, scheduler or hidden write side effect. + +## Thesis + +One method-bearing class surface should admit 'think', 'counterfactual' and 'do' (names **conceptual**, not proposed hot ABI). Each route binds a declared ClassId + numeric MethodOrdinal + algebraic law to a witnessed focus. Evaluation returns either a relation/result, a replayable Thought delta, or an authorized-action proposal. The SAME relalg/R2IL/mask-RISC lowerer executes admissible set operations. A thought's execution is **not** itself a commit; Rubicon/MUL/ActionDef authorization and explicit Rust LanceCycleWriter write remain separate. + +A method is defined by semantics (e.g. Boolean existence, bag relational algebra, exact integer, K3), operands, guards and a result contract. Physical realisations are routes, not alternative laws or alternative truth engines. Prefer existing 'ClassView::compute_dag' and metadata/action accessor over new descriptor hierarchies; compile topological declaration once per class/schema version; data/codebook/focus witnesses must be separately invalidated. + +## Why relalg first + +Existing relalg is a single-table experimental algebra with 'Rel', 'normalize', 'symbolic', R2IL lowering. Its 'join_body::is_alpha_acyclic' tests the shape of a join, not its execution. The 'set_rules' guarded catalogue belongs to the contract; relalg owns lawful composition/lowering, not a duplicate semantic registry. Existing Quack already has masks, COUNT, EXISTS, ALL, SUM, MIN/MAX, grouped terminals and constrained FK-keyed 'GroupSumViaI32'; confirm rather than rebuilding it. + +1. **D-RFT-0 correctness before expansion.** A Kleene three-valued oracle on NULL lanes for 'set_algebra::normalize' and the catalogue. Check complement, NOT, negated membership, absorb and SUM empty/null. Red implies selective refusal/guard, no blanket 'correct under SQL' claim. +2. **D-RFT-1 relationship algebra.** Extend/probe typed shared-domain relation composition without value-directed foreign-table gather (ADMISSION B). Distinct/Bag, K3, external references, supports, key/cardinality witnesses, and cyclic join bodies are separate acceptance strata. Use existing #1659 shared-coordinate/side and #1666 DR256 lab results where admitted. Test INNER/SEMI/ANTI/LEFT, fan-out and duplicates. +3. **D-RFT-2 law-licensed rule catalogue.** 'set_rules::Semantics' identifies admitted rewrites where expressible. If an equality rule needs more conditions, keep explicit per-rule refusals rather than inventing a universal semiring. egglog, if introduced, is an **offline/compile-time rewrite candidate/proof oracle** with admitted equalities; it never changes the method's declared law, and never becomes an unbounded production query-time planner. +4. **D-RFT-3 recursion.** datafrog is an independent reference for closure/replay; first match its results in a bounded monotone rule fixture. Recursive driver can apply mask/frontier folds where legal; prevent cycles through negation without strata. NARS truth revision is not presumed a semiring; keep its established finisher and revision/provenance semantics separate. +5. **D-RFT-4 class method reuse.** One behavior method runs correctly on direct ordinals, sparse runs, DR64 and DR256 when lawful. Prove same result including duplicate semantics and the 257th-slot condition. Do not introduce generic planner types or OGAR as a mandatory layer. + +## Thought-git as the FIRST real non-SQL consumer + +Reuse '.claude/plans/thought-git-basics-v1.md' and 'thought-git-api-v1.md'. The lab 'crates/thought-git-probe' already has fixed anomaly fixtures, from-scratch next-version oracle, sparse slot experiments, with no production branch/land/rebase pipeline. EXO-98 defines the reusable git verbs and driver independence. + +- **Thought 0** is immutable sealed givens for the current version; 1..63 are bounded temporary thought slots. An attention delta *is* the branch overlay; replay receipts and derived fact relations live in a **separate metadata table**, not duplicated node objects. +- Input is a (snapshot, focus, class method ordinal, numeric operands, source/relationship witness). Output is derived cells, provenance, read/write masks, anomaly readings and a deterministic replay receipt. +- In-memory branch, diff, squash, discard and replay execute only admitted folds. Commit/land is one authorized, explicit, coalesced sparse writer-cycle operation. 'Plan' and 'Prune' do not write Lance; error/contradiction preserves evidence rather than fabricating confirmation. +- Thought frontier: changing an input invalidates the affected method outputs only; a typed dependency mask propagates the change, not the whole 64-thought stack. A full recompute remains the oracle. Retracting a support path from a diamond MUST preserve the surviving support; naive Boolean subtraction is unsound. +- **EpistemicState5** (CausalEdge64 bits 59..63) is Topology2 × Certification3, NOT a scratch dirty mask, no implied independent supporting root for duplicate/replayed derivations. 'pearl::hydrate' and 'pearl::revise' have distinct monotone writers. A counterfactual never elevates production evidence. +- Snapshot generation and 'thought_address' witness prevent the ABA problem when a freed slot is reused. Rebase/replay is refused on stale codebooks or proof generations without a legal recompute. + +### D-RFT-5 first falsifier: substitution / Sudoku frontier + +Fixture: x = 2y, y = 2z, w = 2x. Two independent substitution routes produce the same result; then mutate one source relation, remove one support path, and reuse a thought slot at a new generation. Derive w = 8z when premises hold. Compare full from-scratch derivation and incremental frontier for each affected class/method, including provenance roots and non-commutative/NULL/Bag counterexamples. No duplicate proof becomes 'new evidence'. + +Use an IAM nested group diamond as a second fixture: U ∘ G* ∘ P (Boolean). Verify not only result parity but touched tiles/pages, amortized common bindings, and correct deletion of one among two support paths. Use a source-lane direct read; reveal old millisecond CSR preparation explicitly rather than hiding it in a fold time. + +## Phases and gates + +| Phase | Owner/where to extend | Deliverable | Falsifier | +| --- | --- | --- | --- | +| D-RFT-0 | relalg + contract rule tests | SQL/K3 truth safety | normalized = original = row/PG oracle for every tested truth-stratum | +| D-RFT-1 | relalg, Quack existing execution | typed relation/JoinDomain fold | SQL Bag/Distinct + nullable join parity; no gather | +| D-RFT-5 | thought-git-probe, existing D-TGB API plan | substitution and group-frontier replay | full recompute parity for add, delete, cycle, diamond, ABA | +| D-RFT-3 | datafrog oracle + relalg frontiers | bounded recursion and stable fixpoint | closure results and exact termination match datafrog | +| D-RFT-2 | optional egglog proof path | admitted equalities/optimization | each rewrite law licensed; no adverse K3/Bag rewrite | +| D-RFT-4 | one ClassView method consumed via flow | think vs counterfactual vs proposal | exact replay and unchanged sealed snapshot until authorized commit | + +**Performance:** report all costs: codebook/domain bind, prefetch/tile build, first touch, steady fold, output materialization, invalidation. Measure 32×128 vs 64×64 for membership (both 512 bytes), DR256 and sparse; interpret shape selection as a route under fixed laws. No hard-coded shape in API. + +**Explicit exclusions:** Odoo deferred; no persisted Node32/SoA layout decision, no new graph interpreter/ORM, no direct action side effects inside folds, no claim of autonomous learning, no shared cache without version-provenance and invalidation tests. From 740b5f428044d8a9f29a59d46402104b915c9fea Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:35 +0200 Subject: [PATCH 08/14] docs: retire non-D-prefixed path relalg-thought-git-frontier-polyfill-v1.md --- ...relalg-thought-git-frontier-polyfill-v1.md | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 .claude/plans/relalg-thought-git-frontier-polyfill-v1.md diff --git a/.claude/plans/relalg-thought-git-frontier-polyfill-v1.md b/.claude/plans/relalg-thought-git-frontier-polyfill-v1.md deleted file mode 100644 index 52d4fe884..000000000 --- a/.claude/plans/relalg-thought-git-frontier-polyfill-v1.md +++ /dev/null @@ -1,52 +0,0 @@ -# relalg × thought-git: algebraic method behavior and amortized frontier (v1) - -**Status:** PROPOSAL / DOCS ONLY, 2026-10-21. -**Highest implementation priorities:** 'lance-graph-relalg' and reusable 'lance-graph-thought-git'. Keep the existing D-TGB oracle and D-RA/D-CMR owners. No independent rule interpreter, evaluator, graph store, object model, scheduler or hidden write side effect. - -## Thesis - -One method-bearing class surface should admit 'think', 'counterfactual' and 'do' (names **conceptual**, not proposed hot ABI). Each route binds a declared ClassId + numeric MethodOrdinal + algebraic law to a witnessed focus. Evaluation returns either a relation/result, a replayable Thought delta, or an authorized-action proposal. The SAME relalg/R2IL/mask-RISC lowerer executes admissible set operations. A thought's execution is **not** itself a commit; Rubicon/MUL/ActionDef authorization and explicit Rust LanceCycleWriter write remain separate. - -A method is defined by semantics (e.g. Boolean existence, bag relational algebra, exact integer, K3), operands, guards and a result contract. Physical realisations are routes, not alternative laws or alternative truth engines. Prefer existing 'ClassView::compute_dag' and metadata/action accessor over new descriptor hierarchies; compile topological declaration once per class/schema version; data/codebook/focus witnesses must be separately invalidated. - -## Why relalg first - -Existing relalg is a single-table experimental algebra with 'Rel', 'normalize', 'symbolic', R2IL lowering. Its 'join_body::is_alpha_acyclic' tests the shape of a join, not its execution. The 'set_rules' guarded catalogue belongs to the contract; relalg owns lawful composition/lowering, not a duplicate semantic registry. Existing Quack already has masks, COUNT, EXISTS, ALL, SUM, MIN/MAX, grouped terminals and constrained FK-keyed 'GroupSumViaI32'; confirm rather than rebuilding it. - -1. **R0 correctness before expansion.** A Kleene three-valued oracle on NULL lanes for 'set_algebra::normalize' and the catalogue. Check complement, NOT, negated membership, absorb and SUM empty/null. Red implies selective refusal/guard, no blanket 'correct under SQL' claim. -2. **R1 relationship algebra.** Extend/probe typed shared-domain relation composition without value-directed foreign-table gather (ADMISSION B). Distinct/Bag, K3, external references, supports, key/cardinality witnesses, and cyclic join bodies are separate acceptance strata. Use existing #1659 shared-coordinate/side and #1666 DR256 lab results where admitted. Test INNER/SEMI/ANTI/LEFT, fan-out and duplicates. -3. **R2 law-licensed rule catalogue.** 'set_rules::Semantics' identifies admitted rewrites where expressible. If an equality rule needs more conditions, keep explicit per-rule refusals rather than inventing a universal semiring. egglog, if introduced, is an **offline/compile-time rewrite candidate/proof oracle** with admitted equalities; it never changes the method's declared law, and never becomes an unbounded production query-time planner. -4. **R3 recursion.** datafrog is an independent reference for closure/replay; first match its results in a bounded monotone rule fixture. Recursive driver can apply mask/frontier folds where legal; prevent cycles through negation without strata. NARS truth revision is not presumed a semiring; keep its established finisher and revision/provenance semantics separate. -5. **R4 class method reuse.** One behavior method runs correctly on direct ordinals, sparse runs, DR64 and DR256 when lawful. Prove same result including duplicate semantics and the 257th-slot condition. Do not introduce generic planner types or OGAR as a mandatory layer. - -## Thought-git as the FIRST real non-SQL consumer - -Reuse '.claude/plans/thought-git-basics-v1.md' and 'thought-git-api-v1.md'. The lab 'crates/thought-git-probe' already has fixed anomaly fixtures, from-scratch next-version oracle, sparse slot experiments, with no production branch/land/rebase pipeline. EXO-98 defines the reusable git verbs and driver independence. - -- **Thought 0** is immutable sealed givens for the current version; 1..63 are bounded temporary thought slots. An attention delta *is* the branch overlay; replay receipts and derived fact relations live in a **separate metadata table**, not duplicated node objects. -- Input is a (snapshot, focus, class method ordinal, numeric operands, source/relationship witness). Output is derived cells, provenance, read/write masks, anomaly readings and a deterministic replay receipt. -- In-memory branch, diff, squash, discard and replay execute only admitted folds. Commit/land is one authorized, explicit, coalesced sparse writer-cycle operation. 'Plan' and 'Prune' do not write Lance; error/contradiction preserves evidence rather than fabricating confirmation. -- Thought frontier: changing an input invalidates the affected method outputs only; a typed dependency mask propagates the change, not the whole 64-thought stack. A full recompute remains the oracle. Retracting a support path from a diamond MUST preserve the surviving support; naive Boolean subtraction is unsound. -- **EpistemicState5** (CausalEdge64 bits 59..63) is Topology2 × Certification3, NOT a scratch dirty mask, no implied independent supporting root for duplicate/replayed derivations. 'pearl::hydrate' and 'pearl::revise' have distinct monotone writers. A counterfactual never elevates production evidence. -- Snapshot generation and 'thought_address' witness prevent the ABA problem when a freed slot is reused. Rebase/replay is refused on stale codebooks or proof generations without a legal recompute. - -### First falsifier: substitution / Sudoku frontier - -Fixture: x = 2y, y = 2z, w = 2x. Two independent substitution routes produce the same result; then mutate one source relation, remove one support path, and reuse a thought slot at a new generation. Derive w = 8z when premises hold. Compare full from-scratch derivation and incremental frontier for each affected class/method, including provenance roots and non-commutative/NULL/Bag counterexamples. No duplicate proof becomes 'new evidence'. - -Use an IAM nested group diamond as a second fixture: U ∘ G* ∘ P (Boolean). Verify not only result parity but touched tiles/pages, amortized common bindings, and correct deletion of one among two support paths. Use a source-lane direct read; reveal old millisecond CSR preparation explicitly rather than hiding it in a fold time. - -## Phases and gates - -| Phase | Owner/where to extend | Deliverable | Falsifier | -| --- | --- | --- | --- | -| T0 | relalg + contract rule tests | SQL/K3 truth safety | normalized = original = row/PG oracle for every tested truth-stratum | -| T1 | relalg, Quack existing execution | typed relation/JoinDomain fold | SQL Bag/Distinct + nullable join parity; no gather | -| T2 | thought-git-probe, existing D-TGB API plan | substitution and group-frontier replay | full recompute parity for add, delete, cycle, diamond, ABA | -| T3 | datafrog oracle + relalg frontiers | bounded recursion and stable fixpoint | closure results and exact termination match datafrog | -| T4 | optional egglog proof path | admitted equalities/optimization | each rewrite law licensed; no adverse K3/Bag rewrite | -| T5 | one ClassView method consumed via flow | think vs counterfactual vs proposal | exact replay and unchanged sealed snapshot until authorized commit | - -**Performance:** report all costs: codebook/domain bind, prefetch/tile build, first touch, steady fold, output materialization, invalidation. Measure 32×128 vs 64×64 for membership (both 512 bytes), DR256 and sparse; interpret shape selection as a route under fixed laws. No hard-coded shape in API. - -**Explicit exclusions:** Odoo deferred; no persisted Node32/SoA layout decision, no new graph interpreter/ORM, no direct action side effects inside folds, no claim of autonomous learning, no shared cache without version-provenance and invalidation tests. From eee6cbd2d2e2cf7690b7bc07eaf25019328e5747 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:38 +0200 Subject: [PATCH 09/14] docs: adopt D-LFA plan nomenclature --- ...ance-graph-flow-rubicon-assimilation-v1.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .claude/plans/d-lfa-lance-graph-flow-rubicon-assimilation-v1.md diff --git a/.claude/plans/d-lfa-lance-graph-flow-rubicon-assimilation-v1.md b/.claude/plans/d-lfa-lance-graph-flow-rubicon-assimilation-v1.md new file mode 100644 index 000000000..580a6df5d --- /dev/null +++ b/.claude/plans/d-lfa-lance-graph-flow-rubicon-assimilation-v1.md @@ -0,0 +1,53 @@ +# D-LFA — lance-graph-flow: bounded rs-graph-llm assimilation as a ClassView method driver (v1) + +**Plan ID:** D-LFA (lance-graph-flow assimilation), linked to D-RFT semantic/replay gates, D-QSP shape-parity and existing D-TGB driver plan. No competing executor.\n\n**Status:** PARALLEL DOCS-FIRST INVESTIGATION / PROPOSAL, 2026-10-21. 'lance-graph-flow' does not yet exist in lance-graph. Do not copy the entire framework, open a runtime fork, create a new session database, or take ownership of #1666, relalg, thought-git or the supervisor. + +**Decision proposal:** YES to parallel **interface census + small contract probe** while relalg and thought-git remain the implementation priority. Runtime assimilation waits until a validated replay/semantics seam exists. This updates the question already recognized in 'thought-git-basics-v1.md' / EXO-98, without replacing that plan or introducing a second executor. + +## Verified source capabilities + +- 'AdaWorldAPI/rs-graph-llm/graph-flow/src/task.rs' has Task, TaskResult, NextAction (Continue, ContinueAndExecute, WaitForInput, GoTo, End, GoBack). 'graph-flow/src/graph.rs' has Graph, conditional edges and GraphBuilder. These are orchestration primitives, not relational execution. +- 'AdaWorldAPI/rs-graph-llm/crates/graph-flow-lance/src/lib.rs' already specifies a **lance-abi handle with source generation** between tasks, a z8run-lance registry/envelope shared by the graph and z8run, and explicit materialize-only data export. +- Its 'tasks.rs' rewrites immutable plans under handles; 'z8run.rs' registers graph-flow nodes, pause/session handles and resume, never passes row/mask data between layers. This is the smallest assimilable API seam. +- 'lance-graph-report' already lowers ReportPlan through Quack and one mask-RISC evaluator and includes a z8run-shaped connection; reuse it, never another runtime evaluator. +- 'lance-graph-contract/src/kanban.rs' already declares KanbanColumn/next_phases, phase transitions and MUL gate handling. 'lance-graph-supervisor' sealed cycle_driver owns state progression, WAL and versioned sparse apply. 'kanban_actor.rs' is read-only. No graph-flow task may autonomously move a mailbox state or commit a Lance version. +- 'lance-graph-act-r/src/lib.rs' has deterministic witnessed proposal arbitration; neither persistent cognitive buffers nor learning. The ACT-R caller evaluates eligibility elsewhere; action selection is not authority to commit. + +## Desired user surface (ergonomics, NOT executor) + +The LangGraph-ish appearance can be GraphBuilder -> Task -> NextAction / Pause -> Resume, with a **bound method handle** (ClassId, MethodOrdinal, law identifier, source generation, focus and thought version), not ORM objects. 'think', 'counterfactual' and 'do' are capabilities exposed as *method routes*, not three engines. ClassView declares legal method and action metadata; Quack Binding resolves operands; optional DR maps physical shape; relalg/R2IL/mask-RISC evaluates. + +- THINK task: returns immutable derived result/Thought delta, not a new sealed version. +- COUNTERFACTUAL task: executes same method law over a witnessed overlay/focus; records delta/provenance; prevents hypothetical evidence becoming certified production state. +- DO task: evaluates method and guards, produces a witnessed ActionDef proposal; separate MUL/Heckhausen Rubicon phase and caller authorization determine whether to stage the effect. Actual write only through existing supervisor/cycle_driver + explicit Rust LanceCycleWriter terminal. +- A task's Context/session may contain IDs, generation-bound handles, small control state and external human reply; NEVER resident SoA row/plane, cached fold buffers or reconstructed node object graph. +- Live LangGraph-style pause/resume must fail closed on generation or codebook change; a stale session may deterministically rebind/replay but cannot reuse invalid effects or silently auto-commit. +- Do not equate psychological Heckhausen Rubicon (predecisional -> preactional -> actional -> postactional) with storage transaction commit or with Kanban columns by identity. Document a *declared mapping* to existing Planning, CognitiveWork, Evaluation, Commit/Plan/Prune and test every permitted transition. + +## What to assimilate / what not to assimilate + +| Adopt as thin behavior surface | Keep out of the execution/storage core | +| --- | --- | +| Task/GraphBuilder/NextAction ergonomic API, conditional branch, interrupt/resume | full graph-flow executor rewrite or independent ORM | +| Generation-bound lance-abi handle and z8run-lance envelope interop | PostgreSQL/in-memory session storage as cognitive truth source | +| Explicit terminal, operator-visible proposal/approval | side-effectful Task::run bypassing ActionDef/MUL/revision | +| Rig completion trait only at explicit LLM boundary if requested | LLM as default source of truth, learned epistemic cert from text | +| Graph flow as optional caller of thought-git verbs | duplicate scheduler/state-machine to replace supervisor's sealed cycle | + +The z8run adapter is a **host** of flow graphs; Quack remains the evaluator. No requirement to install or fork LangGraph Python or instantiate graph-flow's original session backends in production. Names/labels resolve to numeric IDs on cold construction only. + +## Staged parallel work and independent falsifiers + +**D-LFA-0 (parallel now, documentation only):** census which Task/NextAction/context/session/registry interfaces can be carried intact versus need a version witness or a typed refusal; attach concrete source paths. Identify and count forbidden stateful copies, duplicate evaluators, second write owners, default string dispatch, and all coercions between Rubicon and Kanban. + +**D-LFA-1 (after relalg T0 / thought-git T2 seam):** *one* representative graph with two method calls, a counterfactual branch, and WaitForInput. On pause, the saved session contains ONLY handle/control metadata. Simulated source update makes resume refuse. No node data materialization except terminal. + +**D-LFA-2:** independent phase-1 OGAR ActionDef driver and graph-flow driver run exactly the same scripted verb sequence against thought-git's from-scratch oracle. Verify byte-identical thought cells, receipts, mask outcomes and metadata; no action without explicit authorization. ACT-R selects a proposal in separate test with stale candidate refusal. + +**D-LFA-3 (optional after verified fences):** scaffold 'lance-graph-flow' crate as a small consumer-side surface; use existing code and dependencies only if legally/technically compatible. Preserve 'rs-graph-llm' as oracle/reference until equivalence proven; refuse dependencies/copying that violate the one-engine, one-truth-store contract. + +**Stop conditions:** new execution loop or SQL evaluator, checkpointer becoming authoritative storage, conflicting Kanban transition owner, workflow graph identity becoming row identity, missing generation refusal, non-equivalent replay, or requiring pre-existing data materialization in Context. Halt runtime assimilation rather than papering over with adapters. + +## Coordination + +Main PR: [ClassView/Quack PostgreSQL parity plan](d-qsp-classview-quack-postgresql-parity-v1.md). Priority companion: [relalg × thought-git frontier](d-rft-relalg-thought-git-frontier-v1.md). Existing source: '.claude/plans/thought-git-basics-v1.md' and EXO-98; '.claude/plans/relalg-v1.md' and EXO-86; EXO-50 messages. Any code handoff needs an explicit owner/claim and separate implementation PR. This PR changes plans only. From b56291823b593feb1c2357895f04c37fc29d7592 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:41 +0200 Subject: [PATCH 10/14] docs: retire non-D-prefixed path lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md --- ...ow-rs-graph-llm-rubicon-assimilation-v1.md | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 .claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md diff --git a/.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md b/.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md deleted file mode 100644 index 9128e642d..000000000 --- a/.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md +++ /dev/null @@ -1,53 +0,0 @@ -# lance-graph-flow: bounded rs-graph-llm assimilation as a ClassView method driver (v1) - -**Status:** PARALLEL DOCS-FIRST INVESTIGATION / PROPOSAL, 2026-10-21. 'lance-graph-flow' does not yet exist in lance-graph. Do not copy the entire framework, open a runtime fork, create a new session database, or take ownership of #1666, relalg, thought-git or the supervisor. - -**Decision proposal:** YES to parallel **interface census + small contract probe** while relalg and thought-git remain the implementation priority. Runtime assimilation waits until a validated replay/semantics seam exists. This updates the question already recognized in 'thought-git-basics-v1.md' / EXO-98, without replacing that plan or introducing a second executor. - -## Verified source capabilities - -- 'AdaWorldAPI/rs-graph-llm/graph-flow/src/task.rs' has Task, TaskResult, NextAction (Continue, ContinueAndExecute, WaitForInput, GoTo, End, GoBack). 'graph-flow/src/graph.rs' has Graph, conditional edges and GraphBuilder. These are orchestration primitives, not relational execution. -- 'AdaWorldAPI/rs-graph-llm/crates/graph-flow-lance/src/lib.rs' already specifies a **lance-abi handle with source generation** between tasks, a z8run-lance registry/envelope shared by the graph and z8run, and explicit materialize-only data export. -- Its 'tasks.rs' rewrites immutable plans under handles; 'z8run.rs' registers graph-flow nodes, pause/session handles and resume, never passes row/mask data between layers. This is the smallest assimilable API seam. -- 'lance-graph-report' already lowers ReportPlan through Quack and one mask-RISC evaluator and includes a z8run-shaped connection; reuse it, never another runtime evaluator. -- 'lance-graph-contract/src/kanban.rs' already declares KanbanColumn/next_phases, phase transitions and MUL gate handling. 'lance-graph-supervisor' sealed cycle_driver owns state progression, WAL and versioned sparse apply. 'kanban_actor.rs' is read-only. No graph-flow task may autonomously move a mailbox state or commit a Lance version. -- 'lance-graph-act-r/src/lib.rs' has deterministic witnessed proposal arbitration; neither persistent cognitive buffers nor learning. The ACT-R caller evaluates eligibility elsewhere; action selection is not authority to commit. - -## Desired user surface (ergonomics, NOT executor) - -The LangGraph-ish appearance can be GraphBuilder -> Task -> NextAction / Pause -> Resume, with a **bound method handle** (ClassId, MethodOrdinal, law identifier, source generation, focus and thought version), not ORM objects. 'think', 'counterfactual' and 'do' are capabilities exposed as *method routes*, not three engines. ClassView declares legal method and action metadata; Quack Binding resolves operands; optional DR maps physical shape; relalg/R2IL/mask-RISC evaluates. - -- THINK task: returns immutable derived result/Thought delta, not a new sealed version. -- COUNTERFACTUAL task: executes same method law over a witnessed overlay/focus; records delta/provenance; prevents hypothetical evidence becoming certified production state. -- DO task: evaluates method and guards, produces a witnessed ActionDef proposal; separate MUL/Heckhausen Rubicon phase and caller authorization determine whether to stage the effect. Actual write only through existing supervisor/cycle_driver + explicit Rust LanceCycleWriter terminal. -- A task's Context/session may contain IDs, generation-bound handles, small control state and external human reply; NEVER resident SoA row/plane, cached fold buffers or reconstructed node object graph. -- Live LangGraph-style pause/resume must fail closed on generation or codebook change; a stale session may deterministically rebind/replay but cannot reuse invalid effects or silently auto-commit. -- Do not equate psychological Heckhausen Rubicon (predecisional -> preactional -> actional -> postactional) with storage transaction commit or with Kanban columns by identity. Document a *declared mapping* to existing Planning, CognitiveWork, Evaluation, Commit/Plan/Prune and test every permitted transition. - -## What to assimilate / what not to assimilate - -| Adopt as thin behavior surface | Keep out of the execution/storage core | -| --- | --- | -| Task/GraphBuilder/NextAction ergonomic API, conditional branch, interrupt/resume | full graph-flow executor rewrite or independent ORM | -| Generation-bound lance-abi handle and z8run-lance envelope interop | PostgreSQL/in-memory session storage as cognitive truth source | -| Explicit terminal, operator-visible proposal/approval | side-effectful Task::run bypassing ActionDef/MUL/revision | -| Rig completion trait only at explicit LLM boundary if requested | LLM as default source of truth, learned epistemic cert from text | -| Graph flow as optional caller of thought-git verbs | duplicate scheduler/state-machine to replace supervisor's sealed cycle | - -The z8run adapter is a **host** of flow graphs; Quack remains the evaluator. No requirement to install or fork LangGraph Python or instantiate graph-flow's original session backends in production. Names/labels resolve to numeric IDs on cold construction only. - -## Staged parallel work and independent falsifiers - -**F0 (parallel now, documentation only):** census which Task/NextAction/context/session/registry interfaces can be carried intact versus need a version witness or a typed refusal; attach concrete source paths. Identify and count forbidden stateful copies, duplicate evaluators, second write owners, default string dispatch, and all coercions between Rubicon and Kanban. - -**F1 (after relalg T0 / thought-git T2 seam):** *one* representative graph with two method calls, a counterfactual branch, and WaitForInput. On pause, the saved session contains ONLY handle/control metadata. Simulated source update makes resume refuse. No node data materialization except terminal. - -**F2:** independent phase-1 OGAR ActionDef driver and graph-flow driver run exactly the same scripted verb sequence against thought-git's from-scratch oracle. Verify byte-identical thought cells, receipts, mask outcomes and metadata; no action without explicit authorization. ACT-R selects a proposal in separate test with stale candidate refusal. - -**F3 (optional after verified fences):** scaffold 'lance-graph-flow' crate as a small consumer-side surface; use existing code and dependencies only if legally/technically compatible. Preserve 'rs-graph-llm' as oracle/reference until equivalence proven; refuse dependencies/copying that violate the one-engine, one-truth-store contract. - -**Stop conditions:** new execution loop or SQL evaluator, checkpointer becoming authoritative storage, conflicting Kanban transition owner, workflow graph identity becoming row identity, missing generation refusal, non-equivalent replay, or requiring pre-existing data materialization in Context. Halt runtime assimilation rather than papering over with adapters. - -## Coordination - -Main PR: [ClassView/Quack PostgreSQL parity plan](classview-quack-postgres-semantic-parity-v1.md). Priority companion: [relalg × thought-git frontier](relalg-thought-git-frontier-polyfill-v1.md). Existing source: '.claude/plans/thought-git-basics-v1.md' and EXO-98; '.claude/plans/relalg-v1.md' and EXO-86; EXO-50 messages. Any code handoff needs an explicit owner/claim and separate implementation PR. This PR changes plans only. From d43c295a344ec06d60066c9277e082ba269d033f Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:44 +0200 Subject: [PATCH 11/14] docs: adopt D-QSP-RFT-LFA-CAP plan nomenclature --- ...-d-qsp-d-rft-d-lfa-classview-quack-plan.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .claude/board/entries/2026-10-21-d-qsp-d-rft-d-lfa-classview-quack-plan.md diff --git a/.claude/board/entries/2026-10-21-d-qsp-d-rft-d-lfa-classview-quack-plan.md b/.claude/board/entries/2026-10-21-d-qsp-d-rft-d-lfa-classview-quack-plan.md new file mode 100644 index 000000000..6ef0fc5fc --- /dev/null +++ b/.claude/board/entries/2026-10-21-d-qsp-d-rft-d-lfa-classview-quack-plan.md @@ -0,0 +1,28 @@ +# 2026-10-21 — D-QSP / D-RFT / D-LFA: Quack class-method substrate, relalg + thought-git priority, flow assimilation + +**Entry ID:** D-QSP-RFT-LFA-CAP (cross-plan board mapping; not an implementation deliverable).\n**Plan IDs:** D-QSP = PostgreSQL SQL semantic parity and shape selection; D-RFT = relalg/thought-git frontier and substitution; D-LFA = graph-flow/kanban/Rubicon API assimilation. Existing D-RA, D-CMR, D-TGB and D-SQLP remain authoritative on owned slices.\n\n**Status:** PLANNED ONLY (docs-only). No runtime, tests, measured speedups, SQL parity, admission, ABI or new crate. +**Operator intent:** Make SQL/PostgreSQL semantic operations and SAP/graph/cognitive methods class-bound laws over the same Quack Binding Store. Different storage shapes (KEEP_DIRECT, ordered runs, 32×128/64×64, DR256) are physical choices. PostgreSQL is parity oracle; DuckDB analytical comparator, not a promise of speed. + +## Plans (this branch) +- '.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md' (master semantic + shape contract; NULL K3 / Bags / joins / performance gates). +- '.claude/plans/d-rft-relalg-thought-git-frontier-v1.md' (PRIORITY: relational depth, datafrog oracle, optional egglog law checker, replay/frontier, same method surface). +- '.claude/plans/d-lfa-lance-graph-flow-rubicon-assimilation-v1.md' (parallel bounded API assimilation; LangGraph-ish Task/NextAction, Rubicon/Kanban, z8run handle; no new scheduler/storage/evaluator). + +## Provenance/adjacency + +#1659 shared-domain zero-copy lanes and ClassView/DR lab; #1666 draft IAM nested-group DR256 + lazy pages/populations (do not take over owner). Existing relalg and set_rules not full SQL parity. Thought-git has only probe + oracle, no production landing. rs-graph-llm graph-flow-lance already carries generation-witnessed handles and z8run integration; lance-graph-flow not built. + +Linear: EXO-50 agent bus (handoff), EXO-86 relalg, EXO-83 SQL() polyfill, EXO-98 thought-git driver, EXO-101 datafrog, EXO-102 RU algebra, EXO-121 ClassView capstone, EXO-79 PathMap/MORK (oracle only, licensing remains gated). + +## D-* Gate sequence (independent verdicts) + +1. D-QSP-0 / D-RFT-0: Kleene K3 rewrite safety against PostgreSQL/row oracle (do not rewrite nullable complements blindly). +2. D-QSP-1 / D-RFT-4: one method across at least two physical shapes; 32×128 Boolean membership is first low-commitment tile probe (512 bytes), not global ABI. No ORM. +3. D-QSP-2 / D-RFT-1: relalg cross-relation composition with SQL DISTINCT/Bag/NULL semantics and exact oracles; direct SAP ordinals stay direct. +4. D-RFT-5: thought-git substitution/branch/replay/frontier parity and multi-support deletion, including snapshot ABA and independent evidential roots. +5. D-RFT-3 / D-RFT-2 / D-QSP-4/5: datafrog recursion; egglog only as optional law-licensed rewrite oracle; eventual fair DuckDB benchmark, full bind/prepare/materialization included. +6. D-LFA-0 parallel: rs-graph-llm flow API census, generation-bound handles, pause/resume, ClassView method/ActionDef proposal/Rubicon mapping. Runtime port D-LFA-1+ waits for semantic/replay seam. + +**Invariants:** ClassView declares laws per operation, Quack binds, optional DR routes, mask-RISC executes. No string hot path, no new evaluator/planner, no value-directed foreign gather (ADMISSION B), no automatic effects, no undocumented claims of parity. Law preserves K3, Bag, count/sum rounding, provenance and versioned codebook witnesses. + +**Coordination:** docs-only PR must be linked on EXO-50 as a new message. Do not silently assign new owners, change other PRs, merge, or implement. From 2d5a0cde3971b599330091f7594932dbb87e851f Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:16:46 +0200 Subject: [PATCH 12/14] docs: retire non-D-prefixed path 2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md --- ...assview-sql-thoughtgit-relalg-flow-plan.md | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 .claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md diff --git a/.claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md b/.claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md deleted file mode 100644 index 1e8ff438e..000000000 --- a/.claude/board/entries/2026-10-21-quack-classview-sql-thoughtgit-relalg-flow-plan.md +++ /dev/null @@ -1,28 +0,0 @@ -# 2026-10-21: Quack class-method substrate, relalg + thought-git priority, flow assimilation - -**Status:** PLANNED ONLY (docs-only). No runtime, tests, measured speedups, SQL parity, admission, ABI or new crate. -**Operator intent:** Make SQL/PostgreSQL semantic operations and SAP/graph/cognitive methods class-bound laws over the same Quack Binding Store. Different storage shapes (KEEP_DIRECT, ordered runs, 32×128/64×64, DR256) are physical choices. PostgreSQL is parity oracle; DuckDB analytical comparator, not a promise of speed. - -## Plans (this branch) -- '.claude/plans/classview-quack-postgres-semantic-parity-v1.md' (master semantic + shape contract; NULL K3 / Bags / joins / performance gates). -- '.claude/plans/relalg-thought-git-frontier-polyfill-v1.md' (PRIORITY: relational depth, datafrog oracle, optional egglog law checker, replay/frontier, same method surface). -- '.claude/plans/lance-graph-flow-rs-graph-llm-rubicon-assimilation-v1.md' (parallel bounded API assimilation; LangGraph-ish Task/NextAction, Rubicon/Kanban, z8run handle; no new scheduler/storage/evaluator). - -## Provenance/adjacency - -#1659 shared-domain zero-copy lanes and ClassView/DR lab; #1666 draft IAM nested-group DR256 + lazy pages/populations (do not take over owner). Existing relalg and set_rules not full SQL parity. Thought-git has only probe + oracle, no production landing. rs-graph-llm graph-flow-lance already carries generation-witnessed handles and z8run integration; lance-graph-flow not built. - -Linear: EXO-50 agent bus (handoff), EXO-86 relalg, EXO-83 SQL() polyfill, EXO-98 thought-git driver, EXO-101 datafrog, EXO-102 RU algebra, EXO-121 ClassView capstone, EXO-79 PathMap/MORK (oracle only, licensing remains gated). - -## Gate sequence (independent verdicts) - -1. P0: Kleene K3 rewrite safety against PostgreSQL/row oracle (do not rewrite nullable complements blindly). -2. P1: one method across at least two physical shapes; 32×128 Boolean membership is first low-commitment tile probe (512 bytes), not global ABI. No ORM. -3. P2: relalg cross-relation composition with SQL DISTINCT/Bag/NULL semantics and exact oracles; direct SAP ordinals stay direct. -4. P3: thought-git substitution/branch/replay/frontier parity and multi-support deletion, including snapshot ABA and independent evidential roots. -5. P4: datafrog recursion; egglog only as optional law-licensed rewrite oracle; eventual fair DuckDB benchmark, full bind/prepare/materialization included. -6. F0 parallel: rs-graph-llm flow API census, generation-bound handles, pause/resume, ClassView method/ActionDef proposal/Rubicon mapping. Runtime port F1+ waits for semantic/replay seam. - -**Invariants:** ClassView declares laws per operation, Quack binds, optional DR routes, mask-RISC executes. No string hot path, no new evaluator/planner, no value-directed foreign gather (ADMISSION B), no automatic effects, no undocumented claims of parity. Law preserves K3, Bag, count/sum rounding, provenance and versioned codebook witnesses. - -**Coordination:** docs-only PR must be linked on EXO-50 as a new message. Do not silently assign new owners, change other PRs, merge, or implement. From 1e19ce21d10971c77a86253b224883e76beb243c Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Wed, 21 Oct 2026 20:17:22 +0200 Subject: [PATCH 13/14] docs(D-QSP): align milestone IDs with staged parity gates --- .../plans/d-qsp-classview-quack-postgresql-parity-v1.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md b/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md index 9f0fa58e9..b4885eee0 100644 --- a/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md +++ b/.claude/plans/d-qsp-classview-quack-postgresql-parity-v1.md @@ -48,8 +48,10 @@ For one source/focus, contrast: Preserve ADMISSION B: no value-directed gather across foreign tables during PREPARE. Zero-copy means buffers can be borrowed or shared, **not** that PostgreSQL heap tuples magically become Lance buffers. Frozen codebook witness needs a contract owner and version-attested round-trip, Eq semantics and order preservation proof separately for Lt. Exhaustive 256-local-slot validity, 257th explicit escape/refusal. -## Admission milestones +## Admission milestones (canonical D-QSP-* IDs) -**D-QSP-0**: K3 soundness test + law-specific refuses and PostgreSQL row oracle. **D-QSP-1**: one ClassView method over IAM membership/SAP direct projection with route-conformance matrix, 32×128 vs 64×64 vs sparse counted end-to-end. **D-QSP-2**: independently correct S1/S2 SQL corpus, including bag/NULL; internal relalg lowering, *no ORM conversion*. **D-QSP-3**: recursive datafrog parity, thought-git frontier/replay and performance with source mutation. **D-QSP-4/5**: DuckDB/TPC-H subsets and broader SQL conformance. +The **D-QSP-0..5 rows in the staged parity table above** are the canonical milestone IDs: D-QSP-0 K3 normalization safety; D-QSP-1 single-table semantic parity; D-QSP-2 cross-table join/bag/NULL semantics; D-QSP-3 scalar types and overflow/collation; D-QSP-4 bounded recursive/mutation semantics; D-QSP-5 broader SQL conformance and fair DuckDB performance. -Every milestone is an independent verdict: semantic correctness; binding legality/provenance; performance; memory; cost of mutation. A PASS in one does not waive a FAIL in another. No production write path, new ABI, PostgreSQL compatibility or 'faster than DuckDB' claim is authorized by this plan. +Shape conformance across direct, sparse, DR32×128 and DR64/256 is a **separate binding/cost stratum** within D-QSP-1/2, never an alternative semantic law. The replay and frontier dependency is D-RFT-5 (with existing D-TGB work), not an untracked additional D-QSP milestone. The datafrog recursion proof remains D-RFT-3 and a prerequisite to D-QSP-4. Avoid duplicate D-* IDs for related checks. + +Every milestone has independent verdicts for semantic correctness, binding legality/provenance, performance, memory and cost of mutation. A PASS in one does not waive a FAIL in another. No production write path, new ABI, PostgreSQL compatibility or 'faster than DuckDB' claim is authorized by this plan. From 5d8351e1f03bdabf4e301634206eabfcf6f6f5d1 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 21 Oct 2026 18:47:24 +0000 Subject: [PATCH 14/14] board: regenerate entries index for the D-QSP/D-RFT/D-LFA entry entries_index.py --check failed: the new entry had no index row. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg --- .claude/board/entries/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index 53acbe1a2..5f3689c9c 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,7 +25,7 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -413 entries, 2026-08-06 .. 2026-10-21. +414 entries, 2026-08-06 .. 2026-10-21. | date | entry id | finding | file | |---|---|---|---| @@ -38,6 +38,7 @@ exactly one of them, never both. | 2026-10-21 | `D-RU-6-LAB-2` | | [2026-10-21-d-ru-6-sparse-compute.md](2026-10-21-d-ru-6-sparse-compute.md) | | 2026-10-21 | `D-RU-6-LAB-3` | | [2026-10-21-d-ru-6-dirty-frontier.md](2026-10-21-d-ru-6-dirty-frontier.md) | | 2026-10-21 | `D-RA-2` | | [2026-10-21-d-ra-2-relalg-symbolic-repoint.md](2026-10-21-d-ra-2-relalg-symbolic-repoint.md) | +| 2026-10-21 | `D-QSP` | | [2026-10-21-d-qsp-d-rft-d-lfa-classview-quack-plan.md](2026-10-21-d-qsp-d-rft-d-lfa-classview-quack-plan.md) | | 2026-10-21 | `D-CMR-6` | | [2026-10-21-d-cmr-6-rule-catalogue.md](2026-10-21-d-cmr-6-rule-catalogue.md) | | 2026-10-21 | `D-CMR-5` | | [2026-10-21-d-cmr-5-rescope.md](2026-10-21-d-cmr-5-rescope.md) | | 2026-10-21 | `D-CMR-2b` | | [2026-10-21-d-cmr-2b-scratch-probe.md](2026-10-21-d-cmr-2b-scratch-probe.md) |