Cut runParse over to resolve-then-convert - #579
Merged
Conversation
Smaug123
force-pushed
the
argparser-resolver
branch
from
July 25, 2026 10:26
e6f154f to
9bdb4ab
Compare
Smaug123
force-pushed
the
argparser-resolve-before-convert
branch
from
July 25, 2026 10:26
c5fe1dd to
4dc9677
Compare
Smaug123
force-pushed
the
argparser-resolver
branch
from
July 25, 2026 10:33
9bdb4ab to
7695eba
Compare
Smaug123
force-pushed
the
argparser-resolve-before-convert
branch
from
July 25, 2026 10:33
4dc9677 to
26e61b4
Compare
Smaug123
force-pushed
the
argparser-resolver
branch
from
July 25, 2026 10:52
7695eba to
36f624b
Compare
Smaug123
force-pushed
the
argparser-resolve-before-convert
branch
from
July 25, 2026 10:52
26e61b4 to
23f5c42
Compare
Structural resolution (case selection and positional routing) now happens before any conversion, making the phase-separation guarantee literal: by the time a converter runs, every union case is chosen and the positional stream routed, so a conversion failure can never change either. When resolution fails, positional converters are not tried at all — bare tokens that select nothing report only the selection error. The conversion pass still replays the event log in argv order with the same stored-slot bookkeeping, so conversion, duplicate and trailing-key diagnostics keep their historical interleaving; help and fatal scan errors still abort first, in argv order. StorePositional gains the routed sink's id (dispatched in generated code like storeOccurrence's leaf id), and the new routing errors are rendered: unroutable positionals name the offending token, ambiguous routing names the competing sinks' forms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Smaug123
force-pushed
the
argparser-resolve-before-convert
branch
from
July 25, 2026 11:21
23f5c42 to
3273cdf
Compare
Smaug123
enabled auto-merge (squash)
July 25, 2026 11:31
auto-merge was automatically disabled
July 25, 2026 12:16
Pull request was closed
Smaug123
enabled auto-merge (squash)
July 25, 2026 12:20
auto-merge was automatically disabled
July 25, 2026 12:32
Pull request was closed
Smaug123
enabled auto-merge (squash)
July 25, 2026 13:20
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.
Stage 5b of the positional-args-with-unions stack (6/8). Stacked on #578.
Rewires
runParsearound the Stage 5a resolver, making the phase separation literal in the control flow: scan → resolve (structural) → convert in argv order → validate → defaults.resolvefixes the case selection and the active positional sink; only then does the conversion pass replay events in argv order, so error messages still cite arguments in the order the user typed them.TypedCallbacks.StorePositionalgains the sink id, so generated code dispatches to the right per-sink accumulator.No generated-code changes yet (the generator still emits one sink); the oracle is that the entire existing test suite — including the pinned error-message-ordering tests — passes unchanged, plus new pipeline tests covering resolution failure short-circuiting conversion.
🤖 Generated with Claude Code