BE-834: Correct source attribution in hash-config diagnostics - #9567
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR SummaryLow Risk Overview Missing required fields (e.g. The defaults Figment provider is labeled programmatic defaults (was Reviewed by Cursor Bugbot for commit fb9da5b. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the stated provenance contract and covers the relevant merge scenarios.
Pull request overview
Corrects hash-config diagnostics so merged values retain accurate provenance while missing fields remain unattributed.
Changes:
- Preserve file/default sources for surviving invalid values.
- Remove misleading source metadata from missing-field errors.
- Add comprehensive provenance tests and snapshots.
File summaries
| File | Description |
|---|---|
src/defaults.rs |
Names programmatic-default provenance. |
src/error.rs |
Corrects source selection and rendering. |
src/lib.rs |
Documents missing-field attribution behavior. |
tests/files.rs |
Tests scalar, array, default, and missing-field provenance. |
files__file_invalid_value.snap |
Updates filename rendering. |
files__file_missing_required_value.snap |
Verifies omitted source. |
files__provenance_scalar_base.snap |
Captures base scalar provenance. |
files__provenance_scalar_override.snap |
Captures override scalar provenance. |
files__provenance_array_base.snap |
Captures base array provenance. |
files__provenance_array_override.snap |
Captures override array provenance. |
files__provenance_defaults_source.snap |
Captures default call-site provenance. |
files__provenance_missing_field.snap |
Captures unattributed missing field. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## t/codex/h-4170-load-optional-toml-files-in-hash-config #9567 +/- ##
=======================================================================================
Coverage 65.93% 65.94%
=======================================================================================
Files 1885 1885
Lines 198188 198192 +4
Branches 8232 8233 +1
=======================================================================================
+ Hits 130685 130692 +7
+ Misses 65972 65969 -3
Partials 1531 1531
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🌟 What is the purpose of this PR?
Make source attribution in
hash-configcontent diagnostics reliable after merging layers. Ifstore.portis missing from every layer, the error now reports the missing key without blaming the file that suppliedstore.host. Invalid surviving values retain their supplying file or programmatic-default call site.🔗 Related links
🚫 Blocked by
main.🔍 What does this change?
from programmatic defaultswith their Rust call site.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
Content errors identify the key and supplying source but do not include TOML line/column spans. Missing fields cannot identify a supplying source because no layer supplied the value.
🐾 Next steps
Retarget this PR to
mainafter #9566 merges. Further provenance capabilities remain a separate slice.🛡 What tests cover this?
41 unit, integration, and example tests, including the report snapshots, and 3 executable Rustdoc tests pass via
test:unit. Existing tests also verify that later valid values can replace earlier invalid ones. Clippy with warnings denied, Rustdoc, andgit diff --checkpass.❓ How to test this?
📹 Demo