Skip to content

Live-read classification P1: G2 call-reachability over fn-arrow skeletons - #6582

Merged
briansrls merged 4 commits into
mainfrom
session/fierce-otter-305
Jul 14, 2026
Merged

briansrls merged 4 commits into
mainfrom
session/fierce-otter-305

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements live-read witness classification P1 (G2) per docs/plans/live-read-witness-classification-design.md: runtime-read carriers are derived from call-reachable fn bodies over fn_arrow_decl_facts_live() DependencyView facts, not module import closure alone.

  • Extend v2.std.live_read with PathPattern, LiveReadCarrier (FilesystemReadPath, …), and callee-symbol registry.
  • Enhance fn-arrow skeleton marshaling to emit callee atoms and hoist string-literal path atoms at call sites.
  • Add G2 lens (live_read_classification_g2_from_facts): BFS call reachability, skeleton carrier scan, path-precision runtime_read_touched_by_path_g2.
  • G2 roster_gate integration tests import accumulator_copy_roster_gate so entry-module decls are visible in the entry resolve closure.

Test plan

  • target-local/debug/claim_batch --source-root dag --source-root src/v2 --entry src/v2/test/claim/live_read_classification_test.dag --functions <all 16 test fns> --claim-run — 16/16 PASS

…tons.

Feed fn_arrow_decl_facts_live DependencyView into call-reachable carrier scan so runtime reads are located at executing call sites with LiteralPath/ParamRef/UnknownPath patterns, not import closure alone.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/fierce-otter-305 branch from 4a50099 to 7b7019e Compare July 14, 2026 06:29
@gunbai-bot gunbai-bot Bot changed the title Live-read classification P1 — G2 call-reachability upgrade (docs/plans/live-read-witness-classification-design.md §P1, P0 landed 32079e21eb): feed fn-arrow DependencyView (fn_arrow_decl_facts_live) to resolve WHICH carrier call sites execute (not just module imports); derive FilesystemReadPath patte Live-read classification P1: G2 call-reachability over fn-arrow skeletons Jul 14, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 14, 2026 06:29
…eipt.

Rename reserved `module` params, merge import-closure carriers with call-reachable
G2 carriers (not replace), prefer literal path patterns for touched-path g2, and
declare fn_arrow skeleton marshal as a checkable §7 scaffold with witness + design anchor.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Addressed blocking review findings in 7b7019e follow-up:

  1. G1+G2 carrier union — merge_g1_and_g2_carriers now unions import-closure carriers with call-reachable G2 carriers (no longer discards G1 when G2 is non-empty). Witness: g2_union_retains_g1_import_carriers_with_g2_literal_paths.

  2. Hand-Rust scaffold receipt — v2.std.fn_index::fn_arrow_skeleton_g2_marshal_host_scaffold_dissolution_trigger + design doc §14 + g2_fn_arrow_marshal_host_scaffold_receipt_is_checkable; coproduct_reflection.rs SCAFFOLD comment cites the authority.

  3. CI parse fix — renamed reserved module parameter bindings to mod_path in live_read_classification.dag (was expected RParen, found keyword 'module').

  4. Path-precision — runtime_read_touched_by_path_g2 prefers literal filesystem patterns when present; G1 UnknownPath fail-closed only applies when no literals are statable.

The TailAbsent arm returned List<Node> where List<FnArrowDecl> was required.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Verified — finding is correct. tail_decls TailAbsent arm returned empty_node_list (List<Node>) where List<FnArrowDecl> is required; fixed to empty_decl_list in the follow-up commit.

Drop the literal-pattern branch that silently discarded imprecise filesystem
carriers; single fail-closed arm handles all path patterns. Witnesses updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Verified — finding is correct. The carriers_have_filesystem_literal_pattern two-branch split dropped UnknownPath/ParamRef carriers whenever any sibling literal existed (_ => false), breaking fail-closed monotonicity.

Fixed by removing the branch and routing all carriers through live_read_carrier_touched_by_path → filesystem_path_carrier_touched (where UnknownPath/ParamRef always widen to true). Updated g2_roster_gate_literal_path_touched_selects to assert two distinct literal roster paths match; added g2_unknown_filesystem_path_widens_alongside_literal_paths to pin the fail-closed widen behavior when G1 UnknownPath coexists with G2 literals.

@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Verified against ae1c05349d — this APPROVE finding matches the current tree:

  • G2 call-reachability via fold_node + merge_g1_and_g2_carriers (import-closure ∪ call-reachable)
  • runtime_read_touched_by_path_g2 routes all carriers through filesystem_path_carrier_touched (UnknownPath/ParamRef widen; literals match precisely)
  • Hand-Rust marshal scaffold: fn_arrow_skeleton_g2_marshal_host_scaffold_dissolution_trigger + design doc §14 + g2_fn_arrow_marshal_host_scaffold_receipt_is_checkable

No additional changes required for this review artifact; awaiting CI on the latest push.

@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Verified claude-opus-4-7 APPROVE (37807) against ae1c05349d:

  • Scaffold receipt: fn_arrow_skeleton_g2_marshal_host_scaffold_dissolution_trigger in v2.std.fn_index + §14 design anchor + g2_fn_arrow_marshal_host_scaffold_receipt_is_checkable — all present and green locally.
  • Fail-closed touched-path: filesystem_path_carrier_touched widens UnknownPath/ParamRef to true; single arm in runtime_read_touched_by_path_g2 (no literal-branch narrowing).
  • Field rename: RuntimeRead { carriers } consistent; remaining carrier_homes hits are function-parameter names only.
  • Minor alias (live_read_classification → _g1): confirmed thin wrapper at :599-604; left in place per reviewer's "harmless, migrate later" — out of P1 scope.

No code changes required for this artifact.

— sent from fierce-otter-305

@briansrls
briansrls merged commit 8ae8386 into main Jul 14, 2026
3 checks passed
@briansrls
briansrls deleted the session/fierce-otter-305 branch July 14, 2026 14:56
gunbai-bot Bot pushed a commit that referenced this pull request Jul 14, 2026
The nightly affected-set-falsifier's whole-corpus cold sweep (gunbc_falsifier_batches,
SelectionPredictOnly) surfaced 4 red live-tree witnesses = 2 real drift debts of the
documented masking class (PRs landed changes the per-PR affected-set selection did not
run these live-tree witnesses for, so the red surfaced on the next cold sweep, not the
landing PR — 4th instance, siblings to #6530/#6533):

1. doc_graph_has_no_orphan_docs (x2): docs/plans/live-read-witness-classification-design.md
   (added #6560/#6582) was referenced only in prose data:String notes, never a doc-graph
   edge. Fix: add a `bind:` provenance row in the owning lens file (the established
   convention, cf. commit_workflow_plan_doc_provenance) -> doc-graph root, orphans 1->0.

2. non_fold_residue_clean_holds (x2): resolved report = 3 unrostered, 0 stale.
   Backfill NON_FOLD_RESIDUE_ROSTER with the 3 sites (dated comment + per-site dissolution
   triggers): orch_emit_let_step (#6573; dissolves with the backward grammar-row emit fold),
   live_read_carrier_eq / path_pattern_eq (#6582; structural-equality nests, dissolve with
   derived == from inhabitance) — all matching existing roster precedent.

Verified green-by-execution: all 4 previously-red witnesses (+6 siblings) PASS via
claim_batch on a fresh v1-compiler build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jul 14, 2026
…pattern_eq — coordination: silent-eagle-662's resolved audit, supersedes #6614) + dedupe the replace-all's second roster insertion

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jul 14, 2026
…, compile-clean non-exhaustive match — and locate the compile-clean refusal (#6604)

* Fix the two nightly reds: roster orch_emit_let_step (nfr, masking receipt #9) + re-land the live-read design doc link lost to the #6564 merge race

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix the third nightly red (compile-clean) + locate the refusal: converge_cli_applied_knob_count one-special-variant dispatch (#6598 x #6586 stale-base interaction made main compile-red); floor compile-clean refusal now prints located hard diagnostics (it previously printed ok=false with zero located errors — this patch is what found the non-exhaustive match); nfr lens-precision note (field-scrutinee matches are lens-invisible, no roster row)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Roster the two #6582 structural-eq sites (live_read_carrier_eq, path_pattern_eq — coordination: silent-eagle-662's resolved audit, supersedes #6614) + dedupe the replace-all's second roster insertion

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jul 14, 2026
* WIP: affected sest falsifier

* Affected-set falsifier burn-down: link orphan doc + backfill 3 nfr sites

The nightly affected-set-falsifier's whole-corpus cold sweep (gunbc_falsifier_batches,
SelectionPredictOnly) surfaced 4 red live-tree witnesses = 2 real drift debts of the
documented masking class (PRs landed changes the per-PR affected-set selection did not
run these live-tree witnesses for, so the red surfaced on the next cold sweep, not the
landing PR — 4th instance, siblings to #6530/#6533):

1. doc_graph_has_no_orphan_docs (x2): docs/plans/live-read-witness-classification-design.md
   (added #6560/#6582) was referenced only in prose data:String notes, never a doc-graph
   edge. Fix: add a `bind:` provenance row in the owning lens file (the established
   convention, cf. commit_workflow_plan_doc_provenance) -> doc-graph root, orphans 1->0.

2. non_fold_residue_clean_holds (x2): resolved report = 3 unrostered, 0 stale.
   Backfill NON_FOLD_RESIDUE_ROSTER with the 3 sites (dated comment + per-site dissolution
   triggers): orch_emit_let_step (#6573; dissolves with the backward grammar-row emit fold),
   live_read_carrier_eq / path_pattern_eq (#6582; structural-equality nests, dissolve with
   derived == from inhabitance) — all matching existing roster precedent.

Verified green-by-execution: all 4 previously-red witnesses (+6 siblings) PASS via
claim_batch on a fresh v1-compiler build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant