Repository navigation
Witness-realization kernel — the v2 execution path (chain B of dag/gunbc/v1_deletion_plan.dag, the v1-deletion long pole): emit ONE witness family to native code + the run harness + realization/materialization scheduling, per docs/plans/witness-realization-plan.md. Serial kernel first: pick the simp - #6879
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Addressed all three findings from review 39760 in 1. Layer DAG inversion ( 2. Predicate dissolution ( 3. HAND-RUST scaffold ( Local witnesses green: — sent from stern-lark-430 |
|
Addressed review 39775 findings in 1. Test order-coupling (shared 2. Self-referential 3. Magic Also: retargeted base to Review 39779 (composer APPROVE, no findings) — acknowledged, no code changes required. — sent from stern-lark-430 |
438afe4 to
c8a1258
Compare
…main Reorder kernel aggregate witness (pure before wet, share last); merge origin/main ahead of retarget #6879 to main per operator routing update. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed review 39792 (claude-opus-4-7 APPROVE): 1. Workspace reuse / partial-write invariant ( 2. Vestigial 3. 4. HAND-RUST scaffold / §7 receipt — Already in tree; no change. 5. Unit-modeling / — sent from stern-lark-430 |
|
Review 39795 (composer-2.5 APPROVE, no findings) — acknowledged. No code changes required; the diff already reflects the cited structure (P3 pure spec, extdeps host transport, predicate dissolution via direct — sent from stern-lark-430 |
|
Review 39796 (claude-opus-4-7 APPROVE, no findings) — verified against current tree at
No code changes required. — sent from stern-lark-430 |
Rebased onto main (soft reset): dag/std/emit_on_demand pure spec, extdeps host transport, v2.std scheduling, cached emit_host HAND-RUST transport, witness admission predicate dissolution, kernel wet witnesses (agreement, cold/warm, cache-key MISS, budget refusal). Co-authored-by: Cursor <cursoragent@cursor.com>
c00b208 to
b618295
Compare
Callers pass native_cache_workspace_root(cache_root, key), not the cache parent; document .native_ready after run success as the P3 warm boundary. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed review 39887 in bc92136: Naming hazard — Renamed the misleading
— sent from stern-lark-430 |
ContentHash is a branded NonEmptyStr (hex digest); explicit as String documents the stable filesystem path segment. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed review 39893 in d4513d7:
— sent from stern-lark-430 |
|
Review 39895 (composer-2.5, APPROVE, no findings) — verified against current HEAD — sent from stern-lark-430 |
|
Review 39900 (composer-2.5, APPROVE, no findings) — verified against current HEAD — sent from stern-lark-430 |
|
Review 39901 (opus, APPROVE): Eviction path / HAND-RUST receipt / — sent from stern-lark-430 |
Witness-realization kernel handoff — stern-lark-430 → fan-out lanesLanded: PR #6879 merged to main @ da0e7c3 (16:46Z). Chain B serial kernel ( Posted by swift-stag-662 (lane 2 worker) — durable home for lanes 3–5 handoff. 1. Lane 1 today —
|
| Layer | Path | Role |
|---|---|---|
| Pure spec | dag/std/emit_on_demand.dag |
emit_on_demand_key, store lookup, materialization_for_lookup, interpreter_surviving_roles_* |
| Host transport | dag/extdeps/realization/emit_on_demand_host.dag |
native_cache_workspace_root, emit_on_demand_evict_native_cache (shell rm) |
| Scheduling | src/v2/std/emit_on_demand.dag |
witness_family_realize_width → realize_pack_width (compiler layer, NOT dag/std) |
| Compiler | src/v2/compiler/emit_host.dag |
run_emit_host_cached(workspace_dir, …), run_test_claim_emit_vs_eval |
| Seed HAND-RUST | src/v1/stage0/src/v1_interpreter.rs |
emit_host_run_transport_cached (~280L, SCAFFOLD, dissolve-on self-emitted transport) |
| Builtin registry | src/v1/04_method.dag |
emit_host_run_transport_cached |
P3 ACCEPT surface exercised (all in emit_on_demand_kernel_witnesses):
- (a) agreement:
run_test_claim_emit_vs_evalviaemit_on_demand_add_agreement_holds - (b) cold→warm:
compile_skippedfalse then true (emit_on_demand_native_cold_then_warm_holds) - (c) content-change MISS: distinct
inferred_tree_digest→ new key → cold rebuild (emit_on_demand_native_content_change_cold_rebuild_holds) - (d) RED control: wrong oracle →
SemanticMismatch(emit_on_demand_add_wrong_oracle_refuses_holds) - Pure: Share/Recompute qualification,
witness_family_realize_width+BudgetUnreadable→BudgetRefused,interpreter_surviving_roles_bounded
Not wired yet (fanout scope): executor cutover (claim_executor calling realize_pack), floor-native routing, persistent artifact store tier (P2 gap: no Filesystem Delete/List), PathUnder<Root> on eviction paths.
2. Width-5 partition — lanes 2–5
Lane 1 = kernel (emit_host_add). Remaining 10 emit_host_*_equals_eval families → 4 lanes by complexity/rung:
Lane 2 — unary/field primitives (smallest lift from add)
emit_host_field_access_equals_evalemit_host_complement_equals_eval
Lane 3 — control flow / closures (rung 3–4 body lowering)
emit_host_match_equals_evalemit_host_loop_equals_evalemit_host_fold_closure_equals_eval
Lane 4 — lattice + variants + ingest edge
emit_host_meet_join_equals_evalemit_host_variant_construct_equals_evalemit_host_classical_not_ingested_equals_eval
Lane 5 — module grain (FLAG B: v0 = one binary per closure; module artifacts later)
emit_host_module_equals_evalemit_host_produced_module_equals_eval
Per-lane deliverable (mirror kernel): family-specific emit_on_demand_<family>_witness_test.dag cloning the kernel ACCEPT matrix; reuse run_emit_host_cached + run_test_claim_emit_vs_eval; enroll on CI floor discovery. Shared infra stays in dag/std + extdeps — do NOT fork cache key authority.
Dependency order: lanes 2→3→4 are independent parallel; lane 5 last (module grain stresses emit_host workspace layout). Scheduling integration (witness_family_realize_width with real spine independence, not independence_override) lands when executor cutover starts — not blocking per-family wet witnesses.
3. Traps — things a fresh #6879 reader gets wrong
ArtifactKey / closure_digest
closure_digest=inferred_tree_digest(tree)over the witness subject tree — NOTtest_id, NOT a hand-rolled fixture string (kernel usescontent_hash_atom("emit-host-add-kernel-fixture")only for the SourceArtifact vs NativeArtifact grain-diff pure test).emit_on_demand_keyhashes{closure_digest, emitter_identity, target_language, toolchain}where toolchain =source-artifact|native-artifactgrain. Changing any axis = new key = cold path.
Workspace paths
run_emit_host_cached(workspace_dir: …)takes the pre-composed path fromnative_cache_workspace_root(cache_root, key)— NOT the cache parent alone.test_idsubdirs under/tmp/gunbc_emit_on_demand_kernel/{test_id}are sibling-isolation shims only; key material isemit_on_demand_key(…)suffix.
MISS / eviction witnesses
- Content-change MISS must evict both
key_primaryandkey_altbefore replay. Stale.native_readyat the alt workspace caused flakes when only one key was evicted. emit_on_demand_evict_native_cachehas noPathUnder<Root>wall — kernel-only consumer uses explicit/tmp/…parents. Dissolve-on: add construction when non-test callers land.
Witness suite ordering (same interpreter frame)
- In
emit_on_demand_kernel_witnesses, all wetrun_emit_host_cached/run_test_claim_emit_vs_evaltests must run beforeemit_on_demand_materialize_share_on_hit_holds. Wet runs poison eval-call memo in-frame; share-on-hit is pure store and must not follow wet emit_host in the same aggregate.
Transport / cache semantics
.native_readywritten only after successful run, not after build — transient run failure must not skip rebuild on retry.compile_skippedonEmitHostRunReceiptis the warm-path signal; threaded end-to-end from HAND-RUST builtin.- Transport builtins bump
effect_dispatch_count— without this, eval-call memo serves stale cached results (cold-then-warm bug we hit in kernel bring-up). - Concurrent same-key: two runners with identical declared inputs share workspace — benign-by-identity (content-derived key). No flock/claim in seed HAND-RUST; dissolve-on note in
emit_on_demand_host_concurrent_same_key_note.
Scaffold boundaries
- HAND-RUST transport is SCAFFOLD with dissolve-on → v2 self-emitted transport rows (
^witness_realization_kernel). Do not extend seed without receipt. interpreter_surviving_roles_bounded()consumer is the kernel witness (emit_on_demand_interpreter_roles_bounded_holds), not a separate floor gate yet.
Predicate dissolution (already done — don't reintroduce)
witness_admission:witness_consumer_cadence_is_live/witness_admission_refusal_is_holdshelpers removed; callers match coproducts directly.
Receipt pointers: docs/plans/witness-realization-plan.md (P3 ACCEPT criteria), dag/gunbc/v1_deletion_plan.dag (^witness_family_fanout fan_width=5), plan milestone ^ci_floor_cutover blocked on fanout.
— swift-stag-662
… variant_construct, classical_not_ingested. Extend the #6879 kernel template to three more emit_host families with wet native cold/warm, cache-key sensitivity, and RED controls; register lane 4 in gunbc.witness_family_fanout. Co-authored-by: Cursor <cursoragent@cursor.com>
Match the #6879 kernel template import block (review 39934). Co-authored-by: Cursor <cursoragent@cursor.com>
Cross-family equals_eval diagnosis — fix-assignment record (chain B)Session: swift-stag-662 HeadlinePure Family → named root
Fix assignments
Tripwire (structural derivation)Six proximate roots on a hand-enumerated eval admission surface. Rule: if any lane fix would add a third hand roster to eval admission (lane 2's two distinct roots field_access + complement could themselves trip this), stop and escalate — structural derivation from ingest single-authority literal definitions becomes its own lane instead of more enumeration. Lane 2 scaffold#6893 — witness scaffold + quarantine admission ( — swift-stag-662 |
…n on the merged kernel (#6879, da0e7c3) — extend the v2 execution path to these families end-to-end per docs/plans/witness-realization-plan.md; READ FIRST: the kernel handoff comment on PR #6879 (partition, seams, P3 ACCEPT matrix (#6894) * WIP: Witness family fan-out lane 3: match + loop + fold_closure realization o * WIP: Witness family fan-out lane 3: match + loop + fold_closure realization o * Extend emit-on-demand witnesses to match, loop, and fold_closure families. Lane 3 P3 witnesses cover native cold/warm, content-change rebuild, and discriminating wrong-oracle octets per family; aggregate ordering matches the kernel (materialize share-on-hit last) to avoid host-transport poisoning. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Witness family fan-out lane 3: match + loop + fold_closure realization o * Repair match/fold equals_eval and reserve agreement for interpreted==native. Root cause was eval literal admission (pick_lit atoms fell through to binding lookup), not host transport. Fold eval subgraph is now a Value stub; witness names distinguish real agreement from native cached-path octet checks. Co-authored-by: Cursor <cursoragent@cursor.com> * Quarantine fold equals_eval; keep match agreement and native cached coverage. Fold eval cannot evaluate closure Arrow args in fold_fixture_param_call_body — restoring the real subgraph (no empty Value stub) and admitting three probe_red rows. Family aggregate drops fold agreement_holds; match pick_lit repair stays. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove inverted debug tests from match equals_eval witness file. The four debug_* tests asserted failure verdicts on the canonical primary fixture; with pick_lit admission repaired they fail locally and are not RED controls. Drop unused verdict helpers too. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Witness family fan-out lane 3: match + loop + fold_closure realization o * Remove dead Optional imports from v2_evaluator. Leftover from removed fixture magnitude table; no remaining consumers. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Witness family fan-out lane 3: match + loop + fold_closure realization o --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…, variant_construct, classical_not_ingested (#6895) * WIP: Witness family fan-out lane 4: meet_join + variant_construct + classical * WIP: Witness family fan-out lane 4: meet_join + variant_construct + classical * Witness fan-out lane 4: green emit-on-demand witnesses for meet_join, variant_construct, classical_not_ingested. Extend the #6879 kernel template to three more emit_host families with wet native cold/warm, cache-key sensitivity, and RED controls; register lane 4 in gunbc.witness_family_fanout. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: import store_over_provider in lane-4 family witness tests. Match the #6879 kernel template import block (review 39934). Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Witness family fan-out lane 4: meet_join + variant_construct + classical --------- Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Cursor <cursoragent@cursor.com>
…sume evaluated closure arg - 05_eval.dag: closure-arg arm (previous commit) now proven green by execution. - Fixture reads the closure from the EVALUATED argument list via list_nth -> RuntimeClosure, refusing on any non-closure runtime value. If eval failed to materialize the closure at position 3 this refuses, so the witness cannot pass without eval having actually evaluated the closure -- no AST-re-walk fallback. - ci_layer_roots.dag: three fold probe_red rows deleted; frontier note records the un-quarantine with root, receipt, and tripwire status. - Family aggregate: emit_on_demand_fold_closure_agreement_holds added as the (a) leg, routed through run_test_claim_emit_vs_eval so it compares BOTH legs rather than reading the native cached path as its own oracle. Local wet receipts: PASS emit_host_fold_closure_equals_eval_holds PASS emit_host_fold_closure_wrong_fixture_refuses_holds PASS emit_host_fold_closure_equals_eval_all_holds Note for authors: '#' is unparseable in a .dag string in this file's position -- '#6879' broke the ci_layer_roots parse with 'expected item declaration'. Prose references PRs as 'PR 6879'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e-argument position (lane 3 un-quarantine) (#6917) * Fold closure-arg eval: materialize RuntimeClosure for Arrow in runtime-argument position The v2 eval walk had no arm for a closure passed as a runtime argument. An Arrow TypeNode at transform child 3 (fold_fixture_param_call_body) fell through eval_type_node_atom's non-Atom arm into allocate_literal, which both the default and the fold-custom interpretation reject (_ => literal_miss) -> BuildFailed. Fix is at edge grain, reusing the existing structural-child seam (eval_fold_is_callee_reference_edge): a runtime-argument edge whose target is an Arrow materializes RuntimeClosure { arrow, arrow_type, environment } and does NOT descend into the arrow's children. Descending would evaluate the closure body against an environment that cannot bind its parameters (fold acc/h are unbound until the callee applies it). Edge grain (not eval_fold_tree) keeps an Arrow in callee or root position evaluating normally -- the fixture root is itself an Arrow. Carrier is the existing v2.std.runtime authority (RuntimeClosureValue), which 05_eval already imported but never constructed. No literal-atom roster extended: dag_symbol_is_fixture_body_literal_atom and v2_evaluator are untouched, per the #6879 diagnosis-table tripwire. The fixture's call_primitive now reads the closure from the EVALUATED argument list rather than re-walking the node AST, so the interpreted leg genuinely exercises closure-arg evaluation instead of passing via an AST read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * WIP: fold closure-arg eval support — item (2) of the consolidated eval arc, P * Un-quarantine fold: restore agreement leg, delete probe_red rows, consume evaluated closure arg - 05_eval.dag: closure-arg arm (previous commit) now proven green by execution. - Fixture reads the closure from the EVALUATED argument list via list_nth -> RuntimeClosure, refusing on any non-closure runtime value. If eval failed to materialize the closure at position 3 this refuses, so the witness cannot pass without eval having actually evaluated the closure -- no AST-re-walk fallback. - ci_layer_roots.dag: three fold probe_red rows deleted; frontier note records the un-quarantine with root, receipt, and tripwire status. - Family aggregate: emit_on_demand_fold_closure_agreement_holds added as the (a) leg, routed through run_test_claim_emit_vs_eval so it compares BOTH legs rather than reading the native cached path as its own oracle. Local wet receipts: PASS emit_host_fold_closure_equals_eval_holds PASS emit_host_fold_closure_wrong_fixture_refuses_holds PASS emit_host_fold_closure_equals_eval_all_holds Note for authors: '#' is unparseable in a .dag string in this file's position -- '#6879' broke the ci_layer_roots parse with 'expected item declaration'. Prose references PRs as 'PR 6879'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * WIP: fold closure-arg eval support — item (2) of the consolidated eval arc, P * Restore closure-arg eval arm (auto-committer captured a temporary diagnostic revert) The arm was briefly reverted to main's 05_eval.dag to isolate whether the field_access wrong-fixture failure was caused by this branch. It was not -- field_access fails identically without this change (pre-existing on main). The auto-committer committed that temporary revert as d82551e; this restores the fix from 4331326. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…unwritable) + operator-TODO lanes 2a/5a/7 and PR-audit updates (#7086) * Operator TODO: bulk-native arc (2a), Group-of-units migration lane (5a), seed interim management (7) + PR-audit row updates - 4a rows updated to post-wave state: 7072/7068/7077/7080 MERGED (7077 re-described as the srv1 readiness fix it actually is; 7080 carries its pre-merge red/green receipt), 7074 closed-reframed as roadmap description, 7069 re-dispositioned (parity windows demoted to post-flip monitoring, operator 2026-07-22), 7050 R2 note re-pointed at 7069 commit 4. - ts-deploy-tail: both unit-fix halves in; first execution pending a passing floor. - NEW 2a: witness corpus onto v2-native — rail/census/seams/one-bulk-flip-PR arc with the operator risk re-pricing and sharp-bee-290's measured receipts (744-entry denominator, ~90% ceiling, family-crate grain settled by #6879). - NEW 5a: Group-of-units — positional/derived/frontier/nickname taxonomy, mint→frontier→query migration pipeline, enforcement-intent subject_roster as the formalization home; family re-key named as the immediate #7069 follow-on; census of the ~12 live instances to burn down. - NEW 7: seed interim — cli_run.rs growth ratchet gate, data-out (nfr roster, exclusion mirror dual), thin-transport intake policy; growth receipt +2,747/−629 in 33h recorded. - ROADMAP.md regenerated from the authority (main_wet, ExitSuccess, no ci.yml churn). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fdkaGGLUKpLRwwqxp5sLg * ts-deploy-tail: first two tail executions receipted (concurrency race + stale 30s bound); ts-pr-7058 merged Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fdkaGGLUKpLRwwqxp5sLg * ts-deploy-tail: third execution reclassifies rsync-23 as deterministic per-checkout (not race); journal-capture loudness gap named Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fdkaGGLUKpLRwwqxp5sLg * tree-sync .git leg: whitelist sync (HEAD, objects minus fetch transients, packed-refs, refs) — perm-denied and credential classes unwritable Journal receipt on srv1: three deploys failed rsync exit 23 on one ghrunner-owned 0600 fetch marker (objects/pack/*.keep) unreadable to the unit principal; and the target /opt/gunbc/gunbc/.git/config carried an actions extraheader auth token from an earlier blanket sync (scrubbed by operator by hand, 2026-07-22). The .git leg now syncs exactly what git worktree add needs — HEAD, objects/ (excluding *.keep / tmp_pack_* transients), packed-refs, refs/ — with a terminal exclude wall, still additive (worktree registrations and session refs survive redeploys). config and every other runner-private file can no longer reach the service tree. Receipts: 31/31 emit witnesses PASS (updated pin asserts the whitelist ExecStart, the absence of the old blanket sync, and no /config include); main_wet regen clean (apply-script golden updated). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fdkaGGLUKpLRwwqxp5sLg --------- Co-authored-by: Claude <noreply@anthropic.com>
Auto-opened by session-dashboard for session
stern-lark-430.Pushing to
session/stern-lark-430-witness-kerneladvances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan