Fix module check nested validity - #2913
Conversation
|
Automated review by Claude. No issues found. This is the largest of the module-validation PRs and it holds up on close reading:
Tests are meaningful and cover each new rejection path. One minor, non-blocking observation: 🤖 This is a fully automated review by Claude (Claude Code). No human has vetted these findings — please verify before acting on them. Generated by Claude Code Generated by Claude Code |
|
🤖 Automated review by Claude — this comment is fully automated and has not been vetted by a human. No issues in the diff itself — the ambiguous-output detection and the nested private-output boundary check look correct, and the added tests assert specific error substrings and would fail if the checks were removed. One cross-PR hazard worth flagging, since this overlaps several sibling PRs editing the same function: this PR moves the body of More broadly, this and the other module PRs in the #2901–#2913 range all edit Generated by Claude Code |
|
docs/modules.md still documents the old rule. Its wiring checks duplicate #2903's, which are better — drop them. Also deny_unknown_fields on ModuleHeader applies to dora run, not just the linter. |
|
🤖 Automated review by Claude — fully automated, no human reviewed this; please verify before acting. The commits since my last review (docs alignment in
No new issues in the diff. Generated by Claude Code |
|
🤖 This is a fully automated review by Claude. No human has verified these findings. Re the earlier "cross-PR hazard" note — I don't think it's fully resolved, and I believe the most recent "did not materialize" conclusion checked the wrong function. #2912 (merged to Consequences:
The prior "did not materialize" conclusion appears to have verified Suggest rebasing on current Separately: the recursion/cycle/depth logic and the new ambiguity + private-output-boundary checks look correct and are well-tested. Generated by Claude Code |
a6094ff to
1c6da3b
Compare
|
🤖 Automated review by Claude — fully automated, no human in the loop; treat the findings as suggestions to verify rather than as authority. Re-reviewed after the rewrite (6 commits, +354/-35). This is a clear improvement on the previous single-commit version, and the earlier concern that it duplicated #2903 no longer applies — the rewrite dropped the wiring checks entirely, so #2903's I checked each commit against what is already on Nothing below is a correctness objection. 1. The ambiguity rule is undocumented, and has no escape hatch
Worth documenting the consequence as well as the rule: No in-tree descriptor regresses: 2. The
|
# Conflicts: # libraries/core/src/descriptor/expand.rs
phil-opp
left a comment
There was a problem hiding this comment.
🤖 Automated review by Claude (fully automated — not yet checked by a human maintainer)
Re-checked after the 2026-08-18 merge from main, which resolved the conflict in libraries/core/src/descriptor/expand.rs. The merge is clean: check_module_file_inner now sits alongside #2903's collect_module_source_outputs / check_internal_wiring (called at expand.rs:213-218), and still invokes validate_module_header (190) and check_nested_module_required_inputs (269) before recursing — so the earlier cross-PR concern about dropped nested-required-input validation did not materialize. The ambiguity detection, nested-module private-output boundary enforcement (direct_output_targets), depth/cycle handling with seen.remove on the success path, and the added tests are all intact.
No new findings.
Generated by Claude Code
|
Automated review (Claude) · This is a fully automated review; it has not been vetted by a human. Following up after the merge from The remaining items from the prior review are non-blocking: the first-wins ambiguity rule has no documented Generated by Claude Code |
… rule, mirror the guide - `docs/modules.md` dropped "No duplicate node IDs" and "Internal wiring is consistent". Those were inaccurate when the commit was written, but dora-rs#2903 landed in the meantime and `check_module_file_inner` now calls both `collect_module_source_outputs` and `check_internal_wiring`. Restored. - The exactly-one-producer rule is a breaking change on the `dora run` path (a two-stage pipeline where both stages emit `image` used to expand first-wins) and was undocumented. `module.outputs` has no mapping syntax, so the remedy is a rename — say so. - `guide/src/concepts/modules.md` is a near-verbatim copy and had drifted across four hunks, all from this PR. Re-mirrored. - Nested check failures had no breadcrumb: a failure three levels down surfaced as a bare header name with no file path or include chain. Wrap the recursive call in context naming the module and the referencing node. - Pin the cycle and diamond behaviour. `seen.remove` on the success path is a one-line invariant nothing tested: drop it and every shared nested module fails as a false circular reference. - Check-path cycle error now carries the same hint as its expand-path twin; stale "fully-expanded flat nodes" comment corrected (that is what this PR stopped doing); one `return Err(eyre!)` aligned with the neighbouring bail!.
|
Merged Pushed fixes for the items still open from the 2026-08-17 review:
Left for you:
|
Summary
Tighten module validation so
dora expand --moduleand real dataflowexpansion handle nested modules consistently.
Changes
Recursively validate nested module files in
check_module_file.dora expand --module outer.ymlcould report an outer moduleas valid even when a nested module was invalid.
Reject unknown fields inside the
module:header.inputzwere silently ignored instead of producinga parse error.
Reject ambiguous module outputs.
output, expansion silently picked the first producer.
Apply the existing module nesting depth limit to standalone module
checks.
dora expand --moduleaccepted them.Preserve nested module output boundaries during real expansion.
module even if that nested module did not declare the output publicly.