Lower target and action deps (3.14.3)#315
Conversation
Draft an execution plan for lowering target and action `deps` into a new implicit-dependency class on the IR `BuildEdge` and emitting them as Ninja `|` implicit dependencies between explicit inputs and `||` order-only deps. The plan records the cycle-participation decision (explicit inputs and implicit deps participate; order-only deps do not), defers rule-level `Rule.deps` rejection to roadmap item 3.14.6, and keeps action hashing unchanged because `implicit_deps` lives on `BuildEdge` rather than `Action`. Validation runs through `make check-fmt`, `make lint`, `make test`, `make markdownlint`, `make nixie`, and `coderabbit review --agent`. The plan is DRAFT and must be approved before implementation begins. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 22 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughImplement lowering of manifest ChangesImplicit dependencies implementation and lowering
Sequence Diagram(s)sequenceDiagram
participant UserManifest
participant BuildGraph
participant BuildEdge
participant CycleDetector
participant NinjaGenerator
UserManifest->>BuildGraph: provide `sources`, `deps`, `order_only_deps`
BuildGraph->>BuildEdge: set `inputs` from `sources`, `implicit_deps` from `deps`
CycleDetector->>BuildEdge: traverse `inputs` and `implicit_deps` (not `order_only_deps`)
BuildEdge->>NinjaGenerator: render `inputs`, emit `| implicit_deps` if non-empty, append `|| order_only_deps`
Suggested labelsRoadmap Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 18 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (18 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Introduce the `BuildEdge.implicit_deps` field and initialise it as empty at every existing construction site. Keep behaviour unchanged for this step so the later manifest lowering, cycle detection, and Ninja rendering changes can be reviewed separately.
Populate `BuildEdge.implicit_deps` from manifest `deps` while keeping
`sources` as the only explicit recipe input class.
Preserve documented `{{ ins }}` and `{{ outs }}` recipe placeholders
through manifest rendering so IR interpolation can substitute them from
explicit inputs and outputs before action hashing.
Traverse `BuildEdge.implicit_deps` alongside explicit inputs during IR cycle analysis while continuing to ignore order-only dependencies. Add regression coverage for implicit-only cycles, mixed cycles, missing implicit dependencies, and bounded small cycles without adding a new test dependency.
Emit `BuildEdge.implicit_deps` with Ninja's single-pipe separator between explicit inputs and order-only dependencies. Cover explicit, implicit-only, order-only, and phony action edge shapes so the separator ordering remains stable.
Add an end-to-end manifest fixture that lowers target and action `deps`
into IR implicit deps and renders them as Ninja single-pipe dependencies.
Assert that recipe interpolation still receives only explicit `sources`,
including the documented `{{ ins }}` placeholder path.
Record that manifest `sources` become explicit recipe inputs, `deps` become implicit dependencies, and order-only dependencies remain outside cycle detection. Align the user, developer, design, and formal-verification notes with the implemented IR and Ninja dependency classes.
Record the final deterministic validation state before CodeRabbit review and note the existing Markdown formatting exception that prevents using `make fmt` as an all-or-nothing gate for this branch.
Mark the implicit dependency lowering roadmap item complete after the implementation, deterministic gates, and CodeRabbit review all passed. Update the ExecPlan with the final review and validation state.
Mark the ExecPlan complete after pushing the branch and refreshing the draft pull request with the final validation and reviewer context.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Code Duplicationsrc/ir/cycle.rs: What lead to degradation?The module contains 2 functions with similar structure: tests.cycle_detector_records_missing_dependencies,tests.cycle_detector_records_missing_implicit_dependencies Why does this problem occur?Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health. How to fix it?A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More |
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. Code Duplicationsrc/ir/cycle.rs: What lead to degradation?The module contains 2 functions with similar structure: tests.cycle_detector_records_missing_dependencies,tests.cycle_detector_records_missing_implicit_dependencies Why does this problem occur?Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health. How to fix it?A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More |
This comment was marked as resolved.
This comment was marked as resolved.
Remove duplicated `CycleDetector` setup from the missing dependency tests by sharing the assertion skeleton inside the cycle test module.
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph. If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced. Code Duplicationsrc/ir/cycle.rs: What lead to degradation?The module contains 2 functions with similar structure: tests.cycle_detector_records_missing_dependencies,tests.cycle_detector_records_missing_implicit_dependencies Why does this problem occur?Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health. How to fix it?A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More |
This comment was marked as resolved.
This comment was marked as resolved.
|
@coderabbitai Please investigate the cause of the following issue using codegraph exploration and research, identify a fix and provide an AI coding agent prompt for the fix: |
This comment was marked as resolved.
This comment was marked as resolved.
Pass the test target map by reference so Clippy does not flag the helper for taking ownership of data it only inspects.
Reviewer's GuideImplements roadmap task 3.14.3 by introducing an explicit implicit-dependency class ( File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Make compare token characters without allocating a\n, and use bounds-safe indexing via to satisfy\n.\n\nAlso expand on first use in the roadmap\nplan and reconcile the later wording so the acronym expansion is\nintroduced once without conflicting style language.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/execplans/3-14-3-lower-target-and-action-deps.md (1)
12-20:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix MD013 line-length violations in
docs/execplans/3-14-3-lower-target-and-action-deps.mdand correct the lint-passed claimMarkdownlint (
markdownlint-cli2, rule MD013,line_length: 80) flags this file with over-limit lines at 13 (98 chars), 95 (104 chars), and 284 (91 chars); rewrap those lines to <=80 characters.Update the “make markdownlint … passed” statement in the Progress/QA text to match the current lint result for this file.
Triage:
[type:docstyle]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/execplans/3-14-3-lower-target-and-action-deps.md` around lines 12 - 20, Reflow any over-long sentences in the docs section for Roadmap item `3.14.3` so no line exceeds 80 characters (specifically shorten the long sentences that currently render at ~98, 104, and 91 chars), and update the Progress/QA "make markdownlint … passed" claim to reflect the actual lint result for this file; edit the markdown under the Roadmap item `3.14.3` header and the Progress/QA paragraph to wrap text to <=80 cols and correct the lint status text accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/execplans/3-14-3-lower-target-and-action-deps.md`:
- Around line 12-20: Reflow any over-long sentences in the docs section for
Roadmap item `3.14.3` so no line exceeds 80 characters (specifically shorten the
long sentences that currently render at ~98, 104, and 91 chars), and update the
Progress/QA "make markdownlint … passed" claim to reflect the actual lint result
for this file; edit the markdown under the Roadmap item `3.14.3` header and the
Progress/QA paragraph to wrap text to <=80 cols and correct the lint status text
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5257f0e4-ef7a-4b92-b999-46189bb0812d
📒 Files selected for processing (2)
docs/execplans/3-14-3-lower-target-and-action-deps.mdsrc/ir/cmd_interpolate.rs
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
… dependencies
The previous wording described `deps` as "explicit dependencies", but in
Netsuke's build model they are implicit -- they trigger rebuilds but are not
passed to `$in`/`{{ ins }}`. This matches Ninja's `|` (order-only) semantics.
Loads `tests/data/implicit_deps.yml`, generates Ninja output, and asserts the result with `insta::assert_snapshot!`. The snapshot confirms that `deps` on targets and actions produce Ninja `|` (order-only) prerequisites.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "=== README.md (deps-related lines) ==="
grep -n -i "deps\|implicit\|explicit\|sources" README.md | head -60
echo ""
echo "=== tests/ninja_snapshot_tests.rs ==="
cat tests/ninja_snapshot_tests.rs
echo ""
echo "=== snapshot files present ==="
fd "\.snap$" tests/Length of output: 6051
No further work is required for either item. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/ninja_snapshot_tests.rs`:
- Around line 133-152: Add an explicit assertion that the generated Ninja output
contains implicit deps using the `|` syntax: after the `let ninja_content =
ninja_gen::generate(&ir)?;` line in the `implicit_deps_manifest_ninja_snapshot`
test, call `ensure!(ninja_content.contains(" | "), "expected implicit deps
(Ninja `|` syntax) in output:\n{ninja_content}");` and import `ensure!` from
`anyhow` if not already present; reference `ninja_content` and the test function
name to locate where to insert this check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e6c4e8b2-5b7f-4f49-bd4a-cf1d90fc5236
⛔ Files ignored due to path filters (1)
tests/snapshots/ninja/ninja_snapshot_tests__implicit_deps_manifest_ninja.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
README.mddocs/execplans/3-14-3-lower-target-and-action-deps.mdtests/ninja_snapshot_tests.rs
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. ❌ Failed checks (3 errors, 1 warning)
|
This comment was marked as resolved.
This comment was marked as resolved.
Replace single-line docstrings with multi-line descriptions covering module purpose, integration points, and owned data structures or semantics for all eight files in the review scope.
|
@coderabbitai Please suggest a fix for the following concern and provide an AI coding agent prompt for the fix: Observability |
Example 1: `deps` comment changed from "Explicit" to "Implicit". Example 2: `sources` comment changed from "Implicit" to "Explicit recipe inputs".
This comment was marked as resolved.
This comment was marked as resolved.
Upgrade `CycleDetector::record_missing_dependency` from `debug!` to `info!` with clearer messaging. Add a loop in `detect_cycles` that emits structured `info!` events for every unresolved dependency regardless of whether a cycle is found, so that external files referenced via `deps` are surfaced before the graph reaches Ninja generation.
Summary
This branch implements roadmap task (3.14.3) by lowering target and action
depsinto a dedicated implicit-dependency class in the IR and generated Ninja output. It keepssourcesas the explicit recipe-input class used by$inand{{ ins }}, whiledepsnow affect dependency ordering, rebuild decisions, and cycle detection without appearing in recipe arguments.Roadmap task: (3.14.3)
Execplan: docs/execplans/3-14-3-lower-target-and-action-deps.md
Review walkthrough
BuildEdge.implicit_depsfield and manifest lowering fromtarget.deps.| <implicit_deps>rendering.{{ ins }}/{{ outs }}placeholder preservation needed by the documented recipe contract.Validation
cargo test --workspace: passed after the IR field addition.cargo test --test ir_from_manifest_tests: passed with 15 tests after manifest lowering.cargo test -p netsuke ir::cycle: passed after implicit-dependency cycle traversal.cargo test --test ninja_gen_tests: passed after Ninja emission updates.cargo test --test bdd_tests implicit: passed after behavioural coverage was added.make check-fmt: passed in the final gate.make lint: passed in the final gate.make test: passed in the final gate.make markdownlint: passed in the final gate.make nixie: passed in the final gate.coderabbit review --agent: completed with zero findings.Notes
make fmtstill triggers a pre-existing repository-wide Markdown formatting backlog and rewrites unrelated documentation before failing. This branch restored that unrelated churn and used the non-mutating gates above as the applicable completion checks.No new external crate dependencies were added. The planned
proptestcoverage was replaced with deterministic bounded cycle coverage becauseproptestis not currently in the dependency graph and the execplan requires explicit approval before adding dependencies.Summary by Sourcery
Lower manifest target and action
depsinto a dedicated implicit-dependency class in the IR and generated Ninja output, aligning cycle detection, recipe interpolation, tests, and documentation with the intended dependency semantics.New Features:
implicit_depson IR build edges to represent manifestdepsseparately from explicitsourcesinputs.depsfor both targets and actions as implicit dependencies that appear in generated Ninja files using Ninja's|syntax.Enhancements:
{{ ins }}and{{ outs }}placeholders through manifest rendering so recipe interpolation can expand only explicit sources and outputs.Tests:
depspopulate implicit dependencies and do not affect explicit recipe inputs.