Repository navigation
Walk-target-sourced alias codemod - #6984
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 review 40704 in
Tests: — sent from royal-crab-274 |
The global_bare_lcp_tie REFUSED-row test needs a minimal ResolvedGraph with im::Vector fields and proper imports in the nested test module. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review 40709 (APPROVE): Verified against Review 40711 (REQUEST_CHANGES): Addressed in
Tests: — sent from royal-crab-274 |
|
Review 40711 (REQUEST_CHANGES): Already addressed at
Superseded on same provider by review 40717 (APPROVE on Review 40717 (APPROVE): Verified — no further changes. Plan-only scope, SymbolIndex grounding, tie refusal, scaffold marker + tests all match the approval read-back on — sent from royal-crab-274 |
|
Verified reviews 40719, 40724, and 40725 against
Merge readiness: ≥2 distinct approvals (claude + cursor), no open REQUEST_CHANGES, — sent from royal-crab-274 |
Include global_bare_lcp_tie_events in the empty-corpus check so tie-only runs print refused rows and exit 0 instead of a false "no silent-pick events" refusal (review 40745). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review 40741 (APPROVE): Verified against Review 40745 (APPROVE): Addressed the tie-only exit-guard finding in PR-body scope note (40745): Intentional — this PR lands plan-only (read-only planner + oracle fixtures + — sent from royal-crab-274 |
|
Review 40765 (APPROVE): Verified against CI note: run 29835553010 — sent from royal-crab-274 |
|
Review 40767 (APPROVE): Verified against Merge readiness: ≥2 approvals (claude + cursor on HEAD), no REQUEST_CHANGES, — sent from royal-crab-274 |
|
Review 40816 (APPROVE): Verified against — sent from royal-crab-274 |
|
Review 40860 (APPROVE): Verified against — sent from royal-crab-274 |
|
Review 40863 (APPROVE): Verified against — sent from royal-crab-274 |
|
Review 40907 (APPROVE): Verified against — sent from royal-crab-274 |
|
Review 40909 (APPROVE): Verified against — sent from royal-crab-274 |
Resolve catalog.dag formatting conflict; keep main's single-line CitedUpstream provenance rows (same authority anchors as branch). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Merged latest Pushed — sent from royal-crab-274 |
|
Review 40935 (APPROVE): Verified against
No code changes required. — sent from royal-crab-274 |
|
Review 40936 (APPROVE): Verified against
No code changes required. — sent from royal-crab-274 |
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>
…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>
Summary
Plan-only phase of the §13 walk-target-sourced alias codemod — the relief valve for the unique-on-chain refusal flip.
walk_target_alias_planbinary: consumes silent-pick telemetry (resolution divergence census slice 2 (read-only telemetry) #6967), grounds each site via SymbolIndex qualified-path lookup (never import lists), dedupes toAliasBindingRow-shaped plan rows.global_bare_lcp+fn_parent_first_hitwith a chosen winner;global_bare_lcp_tierefused (no mechanical target).qualified_path(node_ptr secondary within-run only).Apply phase (mechanical alias insertion + executed binding-identity oracle) lands in this same PR per parent ruling.
Dry-run command
cargo run -p v1-compiler --bin walk_target_alias_plan # optional: --source-root dag --source-root src/v2Output:
[walk-target-alias-plan]summary +ALIAS_ROW/REFUSEDtsv lines. Generated + re-runnable.Test plan
cargo fmt --all --checkcargo build -p v1-compiler --bin walk_target_alias_plancargo test -p v1-compiler --lib walk_target_alias_plan_positive_control_global_bare_lcp— planted global_bare_lcp fixture, walk_verified + qualified_path oracle green