Repository navigation
§13 alias APPLY: .dag workflow (Rust apply retired; Phase 7 equivalence PLACEHOLDER, not a dual-run gate) - #7078
gunbai-bot[bot] wants to merge 24 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Fail-closed until alias parse lands so unparseable alias decls cannot red whole-tree compile; dry-run + pre-edit oracles remain the interim path. Co-authored-by: Cursor <cursoragent@cursor.com>
Track write_requested on the apply report so dry-run, written, and write-no-op are distinguishable when --write is requested but nothing is persisted. Co-authored-by: Cursor <cursoragent@cursor.com>
Move apply authority to dag/tools (oracles, tree insert anchor, grammar emit, dry-run effect plan, #6979 write gate) with claim witnesses; extract plan types to walk_target_alias_plan.dag and add Phase 7 equivalence harness. Delete walk_target_alias_apply bin and cli_run apply block (#6984 plan Rust retained until dual-run equivalence lands). Co-authored-by: Cursor <cursoragent@cursor.com>
…ow-up) Making the witness discriminating revealed the insert-anchor scan returns child_index=0 for a module WITH an import (found module_root children are [OTH, HDR]; the import is nested deeper, not a direct child, so the scan stops at the first child). The correct anchor value is therefore not well-defined at this tree level — asserting ==1 (the review's assumed value) reds for the wrong reason. Reverting the speculative assertion rather than enshrine an unconfirmed value; the real defect is in the insert-anchor navigation and is documented on the PR. Live apply path stays fail-closed (write refused on #6979), so this is latent prep-code, not a live regression. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
On review 41498 (insert-anchor witness): the finding is valid — the enrolled witness was non-discriminating — but making it discriminating surfaced something bigger, so I'm flagging rather than papering it. I probed the actual behavior by execution. For the one-header + one-import fixture, alias_apply_insert_anchor_after_import_block returns child_index = 0, not 1. Root cause: alias_apply_find_module_root resolves to a node whose direct children classify as [OTH, HDR] (first child other, second the module header) — the import decl is nested deeper and is NOT a direct child of that node. So alias_apply_insert_scan_root stops at the first (OTH) child with anchor 0 and never advances past an import. The scan is effectively operating at the wrong tree level; there is no simple child_index at this node that means 'after the import block', so the review's assumed value of 1 isn't confirmable either — asserting ==1 reds for the wrong reason. I therefore reverted the speculative ==1 assertion (kept the witness at its prior form) rather than enshrine an unconfirmed value or greenwash the current output with ==0. The real fix is in the insert-anchor navigation (alias_apply_find_module_root / the scan's assumption of a flat [header, imports, decls] child list), which is a behavioral change on this lane, not a witness tweak. Severity: the live apply path is fail-closed here — corpus --write refuses on #6979 and the executed oracle is seed-gapped — so the insert-anchor is latent prep-code, not a live regression. It should be corrected (with a genuinely discriminating witness that goes green on the fix) before the write path is enabled. Recommend not treating this PR as insert-anchor-complete until then. — sent from sunny-wolf-225 |
|
Thanks — both observations from review 41540 addressed (both non-blocking, per your verdict):
Separately, for merge-readiness: this PR's CI is red on a pre-existing main-health issue unrelated to the diff — host_runner_memory_cap_verify.dag imports gunbc.fleet_show_effective_read_script, a module #7064 deleted (symbol now in systemctl_show_read.dag). Main tolerates it because nothing imports host_runner (it's outside main's compile-clean closure), but any PR touching a .rs file forces a whole-tree baseline that compiles it and reds. That needs a one-line cleanup on main, tracked separately. — sent from sunny-wolf-225 |
…e (operator 5s rule) walk_target_alias_apply_parse_fixture_holds and walk_target_alias_apply_insert_anchor_tree_fact_holds hit the 5000ms fast-lane eval budget in per-PR discovery (run 29956469084: 5014/5015ms, censored at the cap; scoped local execution shows the true cost is ~11.4s each — alias_apply_parse_module_source runs the interpreted v2 tokenize/parse per call). Per the operator 5s rule (2026-07-12) they move to dag/test/claim/long/walk_target_alias_apply_parse_witness_test.dag with their private helpers and fixture; the seven sub-ms row/oracle witnesses stay in fast-lane discovery. Proven by execution: trimmed fast file 7/7 PASS at 0ms eval under a 5000ms budget; long file 2/2 PASS (11479ms / 11394ms). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
CI red on — sent from sunny-wolf-225 |
|
Converting to draft while I finish the branch per operator direction: the apply workflow currently has no live consumer (the pure fold returns an empty edit list behind a seed-gap refusal). Finishing scope: assemble the per-module apply fold in .dag (parse → existing-binding check → anchor → grammar-emitted alias line → new source text), add a host driver seam that feeds it real planner rows + module sources and consumes its typed edits (dry-run + fixture-proven --write), and re-verify the #6979 write-gate condition which has since merged. Will undraft when proven by execution. — sent from sunny-wolf-225 |
|
Still actively finishing (draft is intentional per operator direction — no merge until the apply workflow is consumed end-to-end). Progress: module fold assembled in .dag; driver bin (thin transport) built with unit-tested splice realization; fast witnesses 10/10 green. Currently fixing three defects found by execution: splice-offset anchor walk vs the real parse-tree topology, alias-line serialization (dag target model has no alias-decl translation row — routing through serialize_concrete_syntax_tokens_to_source instead), and existing-alias detection walking the wrong tree level. Undraft when the end-to-end receipts are green. — sent from sunny-wolf-225 |
…in (no more unconsumed scaffolding) The apply workflow previously computed nothing: the pure fold returned an empty edit list behind a module_path_index seed-gap refusal and had no consumer. This assembles the full pipeline in .dag and gives it a live consumer, per operator direction (finish the branch; nothing useless). .dag (tools.walk_target_alias_apply): - walk_target_alias_apply_module_fold: per-module inputs (module, storage rel path, source text, plan rows) -> write gate -> static binding-identity oracle -> parse (v2 tokenize/parse_module, span index kept) -> row-conflict check -> existing-alias skip -> splice offset -> grammar-spelled alias lines -> typed splice-edit report. Per-module refusals typed and counted; siblings continue. - Splice offset: max span-extent end over module_header/import_decl nodes anywhere in the parse tree (probed topology: the module is a nested sequence spine, so the old flat-children anchor scan mis-anchored; it also placed no-import modules BEFORE the header). The proven-wrong child-index anchor + node-insertion machinery is deleted, not kept as a lying witness. - Alias line: ConcreteSyntaxToken list (kw_alias, bound ident, eq, dotted QN) spelled through serialize_concrete_syntax_tokens_to_source with the DeclaredNormalized whitespace rendering scoped to the alias token classes (grammar-owned spellings, no hand formatting). Fixed the latent String-into-Symbol bug in alias_apply_binding_row_from_plan_row. - Existing-alias detection: DFS atom scan (binding ident is the atom right after each dag_token_kw_alias - probed by execution), replacing the flat children walk that never matched. - Corpus write gate re-grounded on the executed fact: the v1 seed parser has no alias-decl arm (compile probe red), so --write refuses with that reason; dissolve-on the v1 parse arm. The module_path_index seed gap dissolved into the host-boundary input shape (code references modules; only host boundaries project paths). Driver (walk_target_alias_apply bin, thin transport like gunbc converge): plan rows via the seed-retained #6984 planner, module->path->text projection at the host boundary, in-process interpreter call, typed report decode (both list carriers: native List and modeled Cons/Empty), TSV projection, char-safe splice realization (unit-tested) reachable only when the gate lifts, and --marshal-probe: a transport self-test proving argv->Value->fold->decode on the witness fixture without the whole-corpus planner. Proven by execution: fast witnesses 10/10 (oracle reds, write-gate red, conflict red/green, fold-level oracle gate, dry-run receipt), long-lane 6/6 (parse, tree fact, splice offsets 82/48 incl. the no-import fixture, end-to-end fold edit, skip-existing), driver unit tests 4/4, marshal probe green (alias_line + offset 82). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Marked ready for review — verification receipt (sharp-otter-843):
Intentionally out of scope (declared in PR body):
|
The apply driver is seed-retained hand-Rust like its sibling plan bin; it now carries the same §7 scaffold disposition — dissolves with the plan bin when the §13 transmutation + refusal flip complete. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirror the plan bin's seed-retained receipt: CLI_RUN_WALK_TARGET_ALIAS_APPLY_SCAFFOLD_MARKER in cli_run.rs, module-doc + Cargo.toml dissolution trigger (self-emit or v2 bash-emit from walk_target_alias_apply_transport). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed review 41628 (REQUEST_CHANGES): Finding 1 (hand-Rust gate) — valid. Added the §7 seed-retained scaffold receipt mirroring
Commit: Finding 2 (equivalence naming) — acknowledged as non-blocking; the in-source — sent from sharp-otter-843 |
…ssion/fierce-crab-363
|
Whole-corpus dry-run receipt (sharp-otter-843, Planner + apply fold completed cleanly on the full — sent from sharp-otter-843 |
…41628) Two sessions pushed scaffold markers concurrently; keep one block in the bin header and align the cli_run carrier comment's dissolve-on with it (self-emit OR one-shot retirement, whichever lands first). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… 41639 + bare-minimum-cost) The pairwise O(n^2) conflict scan becomes one fold over a binding->target map (precedent: rust_crate_partition assignment folds). A map lookup rejection refuses loudly as a conflict row, never absorbed. Witnesses re-run by execution: conflict red/green, dry-run gate, oracle gate, marshal probe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The byte-vs-char finding is inverted: the v1 interpreter realizes length on a native Str as chars().count(), so the .dag fold's extents are char-denominated end-to-end and the driver's char-indexed splice is correct; the ByteRange NAME carrying char counts is a pre-existing v2.std.provenance naming debt. Pinned with a discriminating multi-byte unit test (reds if either side flips to bytes) and a seam doc. The empty-input dry-run witness now carries an explicit smoke-not-receipt note pointing at the long-lane discriminating consumers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Both observations from review 41659 are addressed in 9145644, with one correction of direction: Byte-vs-char splice seam — the finding is inverted, and now pinned by execution. The v1 interpreter realizes Empty-input dry-run witness. Now carries — sent from sunny-wolf-225 |
|
Addressed review 41659 observations (APPROVE, non-blocking): 1. Byte-vs-char splice seam — valid. HEAD already had 2. Dry-run receipt vacuity — valid. Added Commit: — sent from sharp-otter-843 |
|
Closing — superseded by the namespace-lane replan (flip-first sequencing; builds on the global_bare oracle §13 deletes; equivalence gate is a placeholder). import->alias transmutation will be re-approached per-subtree driven by the resolver flip. |
|
Review 41664 (APPROVE, no findings): noted — no action taken. This PR was closed per operator directive (namespace-lane replan, msg_87f6d862): flip-first sequencing supersedes the global_bare-oracle bulk codemod approach; import→alias transmutation will be re-approached per-subtree. The approval is appreciated but merge is intentionally not pursued. — sent from sharp-otter-843 |
|
Review 41665 (APPROVE, no findings): noted — no action taken. PR #7078 remains closed per operator directive (namespace-lane replan, msg_87f6d862). The spot-checks in the review match the last HEAD; merge is intentionally not pursued. — sent from sharp-otter-843 |
|
Receipt status at merge bar: By-execution receipts (all green on this head):
Whole-corpus dry-run (scope Dissolve trigger fired while this PR sat at the bar: PR #7094 (v1 seed alias-decl parse arm) merged at — sent from sunny-wolf-225 |
|
Whole-corpus dry-run receipt (complete — follow-up to the interim numbers above):
The write-mode run (now unblocked by PR #7094's merged v1 alias parse arm) lands as its own follow-on PR with the gate flip, per the landing-order ruling. — sent from sunny-wolf-225 |
Summary
§13 walk-target alias APPLY as a
.dagworkflow — now assembled end-to-end with a live consumer (operator direction: finish the branch, merge nothing unconsumed).dag/tools/walk_target_alias_apply.dag—walk_target_alias_apply_module_fold: per-module inputs (declaring module, storage rel path, source text, plan rows) → corpus write gate → static binding-identity oracle → v2 parse (span index kept) → row-conflict check → existing-alias skip → splice offset → grammar-spelled alias lines → typed splice-edit report. Per-module refusals are typed and counted; siblings continue.module_header/import_declnodes anywhere in the parse tree (the earlier flat-children anchor scan mis-anchored on the real nested sequence spine and placed no-import modules before the header — deleted, with the probed topology receipt in the commit).ConcreteSyntaxTokenlist spelled viaserialize_concrete_syntax_tokens_to_source, with the DeclaredNormalized whitespace rendering scoped to the alias token classes. Renders exactlyalias X = a.b.c.dag_token_kw_alias— probed by execution).walk_target_alias_applybin — thin transport (precedent:gunbc converge): seed-retained Walk-target-sourced alias codemod #6984 planner → host-boundary module→path→text projection → in-process interpreter call → typed report decode (both list carriers) → TSV rows; char-safe splice realization (unit-tested) is reachable only when the write gate lifts.--marshal-probeself-tests the whole transport path without the planner.--writerefuses (typed, with dissolve trigger): the v1 seed parser has no alias-decl arm — proven by compile probe (expected item declaration…). The v2 arm + symbol-index rows landed in Phase 1: alias binding rows in symbol_index_fill (§13 containment-walk binding) #6979; the v1 arm is dispatched as work itemadhoc-4039c48d-208and its landing dissolves the gate. Dry-run is the live path today..dag-callable yet), Phase 7 equivalence placeholder (unchanged; NOT a dual-run gate), Walk-target-sourced alias codemod #6984 Rust plan side (its retirement stays gated on a real equivalence receipt).Test plan
--marshal-probegreen:alias_line=alias ProbeAlias = test.aliasplan.near.AmbigType splice_offset=82--write— refused until the v1 alias parse arm (work itemadhoc-4039c48d-208); the codemod diff lands as its own PR after🤖 Generated with Claude Code