Skip to content

Project Tom Hagen: add typed incremental route expansion - #22

Merged
cowboyd merged 11 commits into
mainfrom
project-tom-hagen-dynamic
Sep 23, 2026
Merged

cowboyd merged 11 commits into
mainfrom
project-tom-hagen-dynamic

Conversation

@cowboyd

@cowboyd cowboyd commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/configliere@22

commit: 2af8a67

@cowboyd
cowboyd marked this pull request as ready for review September 4, 2026 02:15
@cowboyd
cowboyd force-pushed the project-tom-hagen-dynamic branch 2 times, most recently from e9481e2 to 554719b Compare September 9, 2026 03:23
Base automatically changed from project-tom-hagen to main September 23, 2026 00:48
@cowboyd
cowboyd force-pushed the project-tom-hagen-dynamic branch from 554719b to 2af8a67 Compare September 23, 2026 00:48
@cowboyd
cowboyd merged commit 0329b23 into main Sep 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant