Repository navigation
source_reference_repoint: a 'retire member' mode on the same token-stream reader - #13483
Merged
Merged
Conversation
…ream reader An import member that no longer lives in its module (nothing to repoint it to) is deleted from every import list naming it from that module, with exactly one adjacent comma, keeping single-line, multi-line and trailing-comma layouts; a statement left empty loses its line. Same applier, walk, idempotence and pending report as the repoint. Roster starts empty; its first rows land with filter/any. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…mpares 10 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XL-2 (lively-crane-656). This lands before the filter/any retirement, which will use it.
Why
tools.source_reference_repoint(landed with #13388) REPOINTS a reference from one module to another. Retiringv2.std.algebrafilter/anyonto the collection roster's callback form (calm-boar-904's ruling B') needs the other operation: DROP a member from every import list naming it from that module. There is nothing to repoint it to, because the bare head resolves through the roster. The ~145 import sites must be rewritten by the generated instrument, never by hand. So this extends the one instrument rather than adding a second tool, which would be a §3 fork.What
ImportMemberRetirement { module_path, member }, and the rostersource_import_member_retirements. It starts empty; its first rows land with the filter/any PR.import_member_retirement_edits: reads the same seed token stream (parsed_import_observation_live) and finds eachimport <module_path> { ... }statement.apply_source_edits, which requires disjoint spans.rewritten_source_text= moves, then retirements. Therepointandrepoint_pendingentries use it, so the walk, idempotence and pending report are shared, not duplicated.Controls (
test.claim.source_reference_repoint_witness_test, supplied text at the instrument's interface){ filter, X }→{ X };{ X, filter }→{ X }.{ filter }loses its line.filterimported from another module are all untouched.15/15 PASS (8 existing + 7 new): https://app.buildbuddy.io/invocation/a7665d2e-bed8-4f8c-8bd0-ffd710fa0a73
🤖 Generated with Claude Code