Skip to content

130 · T115 — the TOML loader, profile layering, and the file precedence tier - #140

Merged
athvin merged 6 commits into
mainfrom
feat/t115-toml-loader-and-file-tier
Aug 11, 2026
Merged

athvin merged 6 commits into
mainfrom
feat/t115-toml-loader-and-file-tier

Conversation

@athvin

@athvin athvin commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Ticket: T115 — docs/implementation/130-T115-toml-loader-and-file-tier.md

Summary

Adds the dagr.toml loader and named-profile layering in dagr-cli, and inserts the file precedence tier beneath env in resolve/resolve_opt (flag > env > file > default; tri-state and flag-wins semantics preserved). The run path and run_to_store are wired through the file tier; dagr.profile/dagr.config are reserved. A first-cut 13-key set is supported, with blob/pod-launch keys deferred to T117 surfacing as loud unknown-key diagnostics; file values parse with each knob's env grammar. check-feature-matrix.sh now forbids toml in dagr-core and proves the assertion non-vacuous via the cli leg.

Tests-first

Confirmed — failing tests committed first in ac01b88.

Definition of done

  • TOML loader with named-profile layering in dagr-cli (config_file.rs)
  • file tier inserted beneath env in resolve/resolve_opt; flag > env > file > default; tri-state and flag-wins preserved
  • Run path (driver, registry, run_flow, metastore_tee) wired through the file tier; dagr.profile/dagr.config reserved
  • File values parsed with each knob's env grammar; unknown keys and selected-profile-with-no-file are loud
  • Core purity preserved: dagr.toml in cwd leaves artifact and both fingerprints byte-identical (core test)
  • toml dependency confined to dagr-cli; feature-matrix script asserts core unreachability non-vacuously
  • Test suite: crates/cli/tests/config_file_and_profiles.rs (28 tests) + updated env-fallback/placement suites
  • Local gate green: fmt, clippy -D warnings, workspace tests, rustdoc, audit, deny, criteria matrix, all check scripts

Open questions resolved

All recorded in docs/implementation/130-T115-toml-loader-and-file-tier.md §Open questions: no user-level path; no parent-dir walk; toml v1 (parse/serde/std, no serde derive, MIT-resolved, no deny.toml change); 13-key first-cut key set (blob/pod-launch keys deferred to T117 as loud unknown-keys); file values use each knob's env grammar; selected-profile-with-no-file is loud; shadowed tiers not parsed; no pod-side load; tasks.md has no T115 Q: items.

Deviations

None.

athvin and others added 6 commits August 10, 2026 10:19
…the file tier

The new cli suite (config_file_and_profiles.rs) drives the ticket's Test plan
end to end — four-tier precedence, profile layering and loud unknown-profile
failure, discovery (explicit > ./dagr.toml > none, missing explicit path a
hard error), the pool-pin tri-state through the file tier, loud failures
naming file/profile/key with the EnvParseError exit-code split, reserved
dagr.profile/dagr.config flags, and byte-identity with an empty [default].
It references the not-yet-existing dagr_cli::config_file API and the grown
resolver signatures, so the target fails to compile — the suite's red state.

The core purity addition (assembly_is_unaffected_by_a_config_file_in_the_cwd)
is a GREEN guard by design, like T114's byte-identity guard: it pins that a
dagr.toml present in the assembly cwd leaves the artifact and both
fingerprints byte-identical, and must stay green once the loader lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…edence tier

Implements ADR 128: a new dagr-cli module (config_file) owns discovery
(--dagr.config explicit path, missing => hard error > ./dagr.toml > none —
no user-level path, no parent walk), profile selection (--dagr.profile >
DAGR_PROFILE > the default table, flag-wins-without-reading-env), key-by-key
layering over [default], and a closed 13-key set mirroring the run
bootstrap's knobs — no file-only knob, no graph-describing key. The whole
file is validated at load; malformed TOML, an unknown key, a wrong-shaped
value, an unknown profile, and a selected-profile-with-no-file each fail
loudly naming the file, profile, and key through EnvParseError's existing
exit-code split (file/profile/key ride in the detail until T116's source
discriminator).

The file tier is inserted beneath the environment in resolve/resolve_opt
(and every knob resolver over them), preserving flag-wins-without-reading
-env and the pool pins' tri-state: a file that mentions no pool leaves it
detected, and a file with no pool keys leaves sizing disengaged. The run
path (registry run_selected_flow) loads the file once at bootstrap — the
assembly verbs never reach the loader — and run_to_store honours the same
tiers with an empty flag tier. dagr.profile / dagr.config are reserved
flags and in flag_takes_value; DAGR_PROFILE joins the env-name constant
test. The parser is toml v1 (parse/serde/std only, no serde derive), the
same version trybuild already locked; every licence resolves to MIT under
the existing deny.toml allow-list.

Also corrects the tests-first commit's headroom arithmetic in one
expectation (headroom is subtracted slack: 8 cores at 0.25 keep 6).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…n resolutions

check-feature-matrix.sh now forbids toml in every dagr-core resolution (the
resolution-level form of ADR 128 §6's 'dagr-core never reads the file') and
asserts the cli's default leg DOES reach toml, so the prohibition stays
non-vacuous. The ticket file records the resolved open questions: no
user-level path, no parent-directory walk, toml v1 parse-only with the
licence audit, the 13-key first-cut key set (blob/pod-launch keys deferred
to T117's canonical table as loud unknown-keys), same-value-grammar-as-env,
loud selected-profile-with-no-file, shadowed-tiers-not-parsed, no pod-side
load, and the absence of tasks.md Q items for T115.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…fixes

load_file_tier_from delegates to select_profile / discover / parse_profiles
(too_many_lines, single-pattern-match); test doc comments gain backticks and
the registry helper's binding is renamed away from similar_names. Behaviour
unchanged: both suites stay green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ll called the 3-arg build_run_sink; pass an empty FileTier

The default-features local gate never compiles crates/cli/tests/metastore_live_tee.rs
(gated behind the off-by-default metastore feature), so the T115 signature change to
build_run_sink — the new fourth &FileTier parameter — broke its four call sites only
in the CI feature jobs (E0061 on macos/ubuntu test + feature-matrix). The tests
predate the file tier and exercise the no-file path, so &FileTier::empty() preserves
their semantics exactly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@athvin
athvin merged commit d82610c into main Aug 11, 2026
16 checks passed
@athvin
athvin deleted the feat/t115-toml-loader-and-file-tier branch August 11, 2026 10:27
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