8000 test(graph): pin what a first build takes from a replace_on_cycle spec's runtime_deps by bryan-minimal · Pull Request #3921 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

test(graph): pin what a first build takes from a replace_on_cycle spec's runtime_deps - #3921

Merged
bryan-minimal merged 1 commit into
mainfrom
test-planner-breaker-runtime-deps
Dec 3, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
test-planner-breaker-runtime-deps

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Dec 1, 2026 •
Copy link
Copy Markdown
Member

Summary

gominimal/arch#206 asks: "Do runtime_deps in a replace_on_cycle spec work in the tool of today?" This PR adds five tests to crates/graph/src/planner.rs that pin what the planner of today does with such a list. It changes no production code.

The fixture is one small graph, written in Nickel as a package tree writes it: packages a and b in a cycle, a package c that needs a to build, and a plain package d. a and c each have an inline prebuilt replace_on_cycle spec. The runtime_deps of package a name d and never c. Each test chooses what the two inline specs name.

The answer for the tool of today

Question Answer Test
Is the list accepted? Yes. The BuildSpec contract, the decoder and the loader accept runtime_deps on an inline prebuilt spec and keep it apart from the list of the package. breaker_runtime_deps_are_accepted_and_kept_apart_from_the_package
Does the graph plan? Yes, to the end. A loop of inline specs through runtime_deps also plans, in both ways of writing it (each names the package of the other; each names the inline spec of the other). A prebuilt is ready at once and its box is empty. loop_of_prebuilt_breakers_through_runtime_deps_plans_to_the_end
Does the list decide the box of a first build? No. The first build of b gets a (prebuilt) in the place of a, and d from the list of the PACKAGE a. It never gets c or c (prebuilt), whether the inline spec of a names nothing, the package c, or c (prebuilt) itself. first_build_box_takes_the_package_runtime_deps_not_the_breaker_runtime_deps
Is the list used for anything in the plan? Only to find what to build. With the list, the plan builds c two times and fetches c (prebuilt), and no box of a or b holds either. Without the list the plan has no c, and each box of a and b is the same. breaker_runtime_deps_add_builds_to_the_plan_but_nothing_to_a_build_box
Is the list in the spec hash? Yes. A change to the list of an inline spec changes the hash of the inline spec, of its package and of a dependent, also one step further away. The hash of d stays. breaker_runtime_deps_are_in_the_spec_hash_of_a_dependent

So the list "works" in that nothing refuses it and it is hashed, and it does not work in the sense of arch D-29 / OQ-63 (owner ruling, 2026-11-28): the box of a first build is that of the package lists, with each replace_on_cycle spec put in one for one. The doc comment of each test says which assertions an implementation of D-29 is expected to flip. None is #[ignore].

Testing

Nothing was compiled or run on a workstation; CI is the only run of these tests.

All five ran and passed in CI on the first push (d08fd84a0), with no re-run and no change to an assertion:

  • CI (Linux native) / tests, step "Run core workspace tests" (nextest): PASS for each of the five graph planner::tests::… names of the table; summary "6921 tests run: 6921 passed".
  • CI / clippy and CI / fmt passed.
  • The macOS unit job does not run the tests of the graph crate (its scope is the darwin crates), so the run above is the only one, on Linux.

The expected plans were written from a reading of planner.rs, transitives.rs and spec_hasher.rs before any run, and the run agreed with each.

What this does not show

  • No real build. The tests stop at the plan (Build::with_deps). That the orchestrator makes the box from exactly that list is from reading crates/orchestrator/src/state.rs and local_backend.rs (override_deps), and no test here runs it. The builders of gominimal/build-servers were not read for this.
  • The Nickel in the tests is the fixture, checked by the BuildSpec contract of minimal.ncl. No spec of gominimal/pkgs was evaluated.
  • Nothing is in a cache in these plans. With a cached package the planner takes other paths (Dep::Cached), which the tests do not cover.
  • Session boxes, check (the dependency-list check of an output) and mip pkg upload-cache use Transitives in their own ways and are not covered.

Refs: gominimal/arch#206, #1305

Checklist

  • Docs updated if behavior changed (no behaviour changes)
  • BREAKING CHANGE: footer present if this is a breaking change (none)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage documenting how runtime dependencies on inline prebuilt replacements affect build planning, dependency tracking, planning loops, and spec hashes.

…c's runtime_deps

gominimal/arch#206 asks whether runtime_deps in a replace_on_cycle spec
work in the tool of today. Five planner tests pin the answer, through
the Nickel contract, the decoder, the loader, the planner and the spec
hasher:

- an inline prebuilt replace_on_cycle spec may declare runtime_deps;
- the build box of a first build comes from the lists of the packages,
  with each replace_on_cycle spec put in one for one, so the list of
  the inline spec brings nothing into the box;
- the planner reads the list only to find what to build;
- a loop of inline prebuilt specs through runtime_deps plans to the end;
- the list is in the spec hash of each dependent.

The doc comment of each test says which assertions the rule of arch
D-29 / OQ-63 is expected to flip. No production code changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai
coderabbitai Bot commented Dec 1, 2026 •
Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The planner implementation is unchanged. New tests and helper functions document how runtime dependencies on inline prebuilt cycle breakers relate to package dependencies, planned builds, and spec hashes.

Changes: Inline Breaker Runtime Dependencies

Layer / File(s) Summary
Planner test graph and output helpers
crates/graph/src/planner.rs
Adds a test graph with inline breaker runtime dependency lists, plus helpers to plan package b and render builds and dependency boxes.
Plan contents and spec hash assertions
crates/graph/src/planner.rs
Adds assertions about dependency separation, planned builds, loops, and spec hash changes. Comments identify assertions expected to change under D-29.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: norrietaylor, mitodrummer

Merge Risk: Minimal · up to d08fd

This change only adds planner tests that record current behavior for runtime dependencies on inline prebuilt cycle breakers. It does not change production behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses Conventional Commit form (type(scope): summary), is lower-case, imperative, and has no trailing period. It names the main change: pinning, via tests, what a first build takes from a rep…
Description check Passed The description follows the template's main sections: Summary, Testing, and Checklist. The Summary states what changes and why, and links related issues (gominimal/arch#206, #1305). The Testing sectio…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses Conventional Commit form (type(scope): summary), is lower-case, imperative, and has no trailing period. It names the main change: pinning, via tests, what a first build takes from a replace_on_cycle spec's runtime_deps. The PR adds five planner tests and changes no production code, so the title matches the changeset. The title is 85 characters, which is long but acceptable.

Full details: Description check

Explanation

The description follows the template's main sections: Summary, Testing, and Checklist. The Summary states what changes and why, and links related issues (gominimal/arch#206, #1305). The Testing section gives the CI runs, step names, and pass counts. The checklist is filled in. The template's HTML comment prompts are gone, and the description does not use the template's 'Refs:' or 'Closes:' phrasing exactly, but it does reference issues. The description is thorough and mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the planner’s trail,
Where breaker lists leave clear detail.
Builds appear, and hashes shift,
Tests record each careful drift.
Then hops away beneath the moon.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 6101a50c-7d74-44de-9229-12769a8ad33f
Commits

Reviewing files that changed from the base of the PR and between 3cd1ab1 and d08fd84.

Files selected for processing: 1

  • crates/graph/src/planner.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 1 remain after this review.

@bryan-minimal
bryan-minimal marked this pull request as ready for review December 2, 2026 00:17
@bryan-minimal
bryan-minimal requested a review from a team as a code owner December 2, 2026 00:17
@minimal-foundry
minimal-foundry Bot commented Dec 2, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at d08fd84a0dbe.

Nothing to do.

Clobber: none: the diff only appends to the test module.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Dec 2, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read at d08fd84. The change is tests only in crates/graph/src/planner.rs, and the new cases pin what the title says. No findings.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 0afa3dd Dec 3, 2026
46 checks passed
@bryan-minimal
bryan-minimal deleted the test-planner-breaker-runtime-deps branch December 3, 2026 01:35
bryan-minimal added a commit that referenced this pull request Dec 3, 2026
… fix

Experiment, not for merge; a separate commit so it can be dropped. With
the fix, two tests of #3921 failed in CI (and only those two in the
workspace): breaker_runtime_deps_add_builds_to_the_plan_but_nothing_to_a_build_box
and loop_of_prebuilt_breakers_through_runtime_deps_plans_to_the_end.

Every build box in those plans stays the same. What moves: the
replace_on_cycle spec of "a" now comes from the lazy path in next() one
phase later (the walk from "b" closes the cycle at "b", which has none),
and "c (prebuilt)", which no box used, is no longer fetched. The
assertions that the first failure hid (without_list, by_breaker) are
expectations derived by hand, to be checked by this run. With the fix the
by_package half of the loop test no longer plans the loop of prebuilts;
the comment says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0