Repository navigation
Project Tom Hagen: add typed incremental route expansion - #22
Merged
Merged
Conversation
commit: |
This was referenced Sep 3, 2026
cowboyd
marked this pull request as ready for review
September 4, 2026 02:15
This was referenced Sep 5, 2026
cowboyd
force-pushed
the
project-tom-hagen-dynamic
branch
2 times, most recently
from
September 9, 2026 03:23
e9481e2 to
554719b
Compare
Dogfood extend() across route, command, option, and param composition. Also expose Result and allow successful results to omit an empty issues array.
cowboyd
force-pushed
the
project-tom-hagen-dynamic
branch
from
September 23, 2026 00:48
554719b to
2af8a67
Compare
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.
Motivation
Some route graphs cannot be known when parsing begins. A program may need the caller to load configuration or plugins before additional options and routes can be defined.
Configliere should support those requirements without performing I/O, introducing asynchrony, or sacrificing exact route and model types. Parsing must be able to pause, hand a typed requirement to the caller, and resume the same invocation after the caller supplies a result.
Approach
Represent a route as an ordered, non-empty sequence of phases. A phase owns the parameters and child routes available at that point; once it has completed, neither can retroactively consume input. A dynamic boundary attaches a typed requirement to the current phase and begins a fresh continuation phase.
Reaching that boundary yields a successful parse increment rather than an incomplete intent. The caller performs whatever external work is required and resumes with
Result<Requirement>. Success applies a route extension and continues the same parse; failure enters the ordinary unprocessable-content path. Configliere therefore coordinates incremental parsing without owning I/O or introducing asynchrony.Dynamic extensions use the same composition algebra as static definitions. They operate from an isolated continuation seed that preserves aggregate route identity and model information while recording only newly introduced phases. This makes phase chains composable without duplicating their history.
Because later phases may reveal new routes, route discovery and phase binding proceed incrementally over the original token stream. Unknown input is not rejected until the relevant route is final, but completed phases remain immutable and selected child routes establish hard ownership boundaries. Help and version obey the same process: they become intents only after every phase needed to identify their target route has resolved.