129 · T114 — wire the existing precedence into the run path - #139
Merged
Merged
Conversation
… the run path Ten red, one guard green: * DAGR_GRACE / --grace / DAGR_TEARDOWN_DEADLINE reach a real `dagr run`'s shutdown-budget banner, flag beating env (subprocess over the one_dag example, env set per-command). * Loud failures with the documented exit-code split: DAGR_GRACE=nonsense → InvalidUsage naming the variable and value (and no run directory left behind); DAGR_HEADROOM=1.5 → BootstrapFailure; DAGR_GRACE=0 / DAGR_TEARDOWN_DEADLINE=0 → BootstrapFailure naming the >= 1 ms / >= 1 s bounds (the settled duration-bound decision: implement, not strike). * DAGR_STORE relocates the run store; --store still wins and the env directory stays untouched. * dagr run --dagr.metastore-store ./x.db etl selects etl (the flag_takes_value regression). * DAGR_FAILURE_MODE=stop-on-first-failure + DAGR_POOL_MEMORY through a real registry run: the pinned pool holds the sibling pending and the stop settles it cancelled — terminal states read from the on-disk stream. * run_to_store resolves the env tier too (a bad DAGR_GRACE fails loudly). * Guard (green before and after): with nothing set, the wired path's stream is byte-identical to the historical minimal RunConfig construction (wall stamps scrubbed — they vary between any two runs). Also extends the env-name constants unit test to cover every shipped knob including DAGR_METASTORE, which it omitted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The shipped run path now resolves every documented knob flag > env > default before the store is opened, through the helpers that previously had zero non-test callers: * config.rs grows the reserved-flag scanners (--grace, --teardown-deadline, --failure-mode, the three --dagr.pool.* pins, --dagr.headroom-fraction, --store) over the shared parse_valued_flag body, the DAGR_STORE constant and resolve_store_base (flag > DAGR_STORE > the unchanged default), the documented duration bounds (GRACE_MIN 1 ms, TEARDOWN_DEADLINE_MIN 1 s) with their OutOfRange→BootstrapFailure validator, and resolve_pool_sizing + PoolSizing: the probe is engaged iff a pin or an explicit headroom was supplied — pins verbatim, un-pinned pools detected (the tri-state), and the no-knob run keeps its historical unconstrained capacities. * registry.rs run_selected_flow resolves the knobs before minting the run id or opening the sink (a bad value leaves no run directory behind), maps scanner errors to InvalidUsage and resolver errors through their own parse/out-of-range exit-code split, and feeds grace/teardown/failure-mode through the RunConfig env-fallback builders. RunConfig::new stays infallible and env-free. * run_to_store resolves the same env tier (no argv, so the flag tier is empty) and gains a RunToStoreError::Config variant naming the offending variable. * grace_from_env / teardown_deadline_from_env enforce the >= 1 ms / >= 1 s bounds the tables always documented, naming whichever source supplied the value. * flag_takes_value learns dagr.metastore-store, so its path value is never mistaken for the flow name. The byte-identical guard fixture is a single source: the admission interleaving of two independent ready nodes is timing-dependent (identically so on both paths) and is not what the guard measures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ecord the resolutions * arch.md's run-store sentence again says the base is supplied by flag or environment variable, naming --store and its new DAGR_STORE fallback — the claim the M10 truth pass had to delete is true now, so it returns. * The C26 knob table gains the --store / DAGR_STORE row and carries the >= 1 ms / >= 1 s duration bounds, matching ADR 089's table and the code (the bounds are implemented, not struck). * C26's precedence paragraph states that the shipped run path resolves the table at bootstrap (the claim stops describing an unused library surface), that the builders remain opt-in for hand-wired callers, and that admission pools stay unconstrained until a pool knob engages the probe. * The ticket file records every open-question resolution: the scanner location, the pool-pin wiring with its supplied-knob probe gate, the implemented duration bounds, and the absence of tasks.md Q items. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… under the line budget The knob resolution and RunConfig construction move into one helper returning (base, config); run_selected_flow keeps only its dispatch shape. Behaviour and diagnostics unchanged; clippy::too_many_lines stays denied rather than excepted. Co-Authored-By: Claude Fable 5 <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.
Ticket: T114 — docs/implementation/129-T114-wire-precedence-into-the-run-path.md
Summary
Wires the existing flag > env > default runtime-knob precedence into the run path. Per-flag scanners in
crates/cli/src/config.rsshare oneparse_valued_flagbody and are sequenced by a newresolve_run_configinregistry.rs(parse_cliuntouched); the resolver pool probe engages only when a pin or explicit headroom is supplied, preserving the tri-state and the no-knob defaults byte-for-byte. AddsDAGR_STORE(arch.md store sentence restored plus its C26 table row), ADR 089 duration bounds enforced at the boundary (grace ≥ 1 ms, teardown ≥ 1 s, out-of-range →BootstrapFailurenaming the source), andRunToStoreError::Config. The ADR 128file(profile)tier is deliberately left to T115 — this ticket only wires what already exists.Tests-first
Confirmed — failing tests committed first in cc03ff7.
Definition of done
Open questions resolved
parse_valued_flagbody, sequenced byresolve_run_config;parse_cliuntouched — recorded in the ticket file's Open questions.Deviations
None.