Repository navigation
feat!: unify the source model across flags and args with a real stdin contract - #114
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
dreamcli | a8fbc35 | Commit Preview URL Branch Preview URL |
Aug 04 2026, 11:16 AM |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
🚫 Excluded labels (none allowed) (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthroughfeat!: unify flag and argument source resolution
WalkthroughThe change introduces a shared Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant RuntimeAdapter
participant Resolver
participant Command
CLI->>Resolver: parse flags and arguments
Resolver->>RuntimeAdapter: read stdin when invocation selects it
RuntimeAdapter-->>Resolver: return stdinData
Resolver->>Resolver: apply env, config, prompt, or default stages
Resolver-->>Command: return values and provenance
Possibly related issues
Possibly related PRs
Suggested labels: Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
✅ Passed checks (7 passed)
Comment |
commit: |
a8fbc35 to
e0dd52e
Compare
e0dd52e to
da27804
Compare
da27804 to
fc9fa33
Compare
fc9fa33 to
6f940c0
Compare
6f940c0 to
1bafc94
Compare
1bafc94 to
382ef14
Compare
… contract
Both surfaces now resolve through one ordered chain: CLI, stdin
fallback, env, config, prompt, default. Args gain .config() and
.prompt(). Flags gain .stdin(); both surfaces share one StdinBinding
({ when: dash | missing | dash-or-missing, consume: exclusive |
broadcast }), an explicit '-' is a CLI-precedence value whose bytes
come from stdin, and implicit fallback is its own stage that beats
env. One exclusive stdin consumer per command is enforced at build
time on both construction paths (DUPLICATE_STDIN_ARG generalized to
DUPLICATE_STDIN_INPUT, naming the input that already consumes);
broadcast is opt-in and reads once. readStdin runs only when
resolution will select a stdin source, pinned by adapter call counts.
ValueInput gains a first-class stdin input with env strictness: one
trailing line terminator is stripped for every codec except string, so
piped booleans, enums, durations, and dates decode while string and
path keep bytes exactly per Decision 5. The resolver walks the
SourceBinding projection itself, so the projection cannot drift from
behavior; resolution records internal provenance per input in the
Decision 8 shape for L18. readFlags and the testkit mirror all of it.
The arg stdinMode boolean fragment is redesigned to the stdin config
shape (schemaVersion stays 1, format unshipped). Args also render
their config and prompt annotations in help. A parity probe against
the L14 tip is byte-identical for schemas using none of the new
capability.
382ef14 to
dd2ca09
Compare
Targets v4. Stacked on #113. L15 of the input-model unification.
One resolution chain for both surfaces: CLI, stdin fallback, env, config, prompt, default. Args gain
.config()and.prompt(); flags gain.stdin(); both shareStdinBinding({ when: dash | missing | dash-or-missing, consume: exclusive | broadcast }). An explicit-is a CLI-precedence value whose bytes come from stdin; implicit fallback is its own stage that beats env. One exclusive stdin consumer per command is enforced at build time on both construction paths (DUPLICATE_STDIN_INPUT, naming the input that already consumes);readStdinruns only when resolution will select a stdin source, pinned by adapter call counts.ValueInputgains a first-class stdin input with env strictness: one trailing terminator stripped for every codec except string, so piped booleans, enums, durations, and dates decode while string and path keep bytes exactly (Decision 5). The resolver walks theSourceBindingprojection itself, so projection and behavior cannot drift. Resolution records internal per-input provenance in the Decision 8 shape for L18.readFlagsand the testkit mirror everything. The argstdinModeboolean fragment is redesigned to the stdin config shape (schemaVersionstays 1 per Decision 2). Args also render[config:]/[prompt]help annotations.Review catches included the projection being production-dead while disagreeing with the resolver on defaults (fixed by making the resolver walk the bindings), and the exclusivity error naming the wrong input. A parity probe against the L14 tip is byte-identical for schemas using none of the new capability.