Skip to content

perf: run only affected Go packages with a safe full-suite fallback (#185) - #215

Merged
DanielNetzer merged 1 commit into
mainfrom
perf/issue-185-affected-packages
Oct 24, 2026
Merged

DanielNetzer merged 1 commit into
mainfrom
perf/issue-185-affected-packages

Conversation

@DanielNetzer

Copy link
Copy Markdown
Owner

Closes #185.

What it does.

  • Opt-in selection. A Formula baseline check, or an evaluation-plan check, can declare select: affected-packages. Verification then runs go test only for packages whose reverse-dependency closure, including test-only and external-test imports, contains a changed package.
  • Full-suite fallback on any uncertainty. The full suite runs instead when any of these apply:
    • the change includes non-Go files or module files (go.mod/go.sum/go.work);
    • the repo has nested modules, vendored code, or excluded directories;
    • go list or git returns an error, or the call times out;
    • a changed path matches the Formula's fullSuiteTriggers (default lab/cmd/**);
    • more than 2,000 packages would be selected, or the argv would exceed 128 KiB.
  • Safety.
    • Selection is refused when argv carries flags that change the package graph: -tags, -mod, -modfile, -overlay, -C, or any unknown flag.
    • The analysis can never set select.
    • Approval requires the plan's triggers to match the Formula, and refuses select on checks the Formula didn't declare.
    • Hidden acceptance and setup never select. The evaluation's independent verification always runs the full plan argv, so Correct keeps its meaning.
  • Ledger. It records the selected packages and why, or why it fell back.

Verification.

  • Built by: Forgecell Molecule mol-185-61e1d66f250ce58b35eb20cc.

  • Review: one adversarial round and one verification pass. Both blocking correctness findings were fixed:

    • a false pass under -tags, reproduced in a scratch module;
    • an amended plan able to drop the Formula's triggers or add select.

    One hardening item is tracked in Hardening: plan limits enforced too late (stranded Molecules) and the learn recurrence scan's 40 MB cap #209.

  • The cohort test: its fixture now imports calc so the flaky package stays selected. That keeps the test's meaning.

  • Onboarding regression: the full-suite baseline also caught a regression where onboarding's bootstrap Formula failed the new validation. It's fixed.

  • Hand-delivered. The protected run fails only the base cohort flake test whose fixture this slice intentionally changes.

  • Clean suite: passes in a clean shell on current main, 20 of 20 packages.

🤖 Generated with Claude Code

…185)

A Formula baseline check or an evaluation-plan check may declare
select: affected-packages. Verification then runs go test only for the
packages whose reverse-dependency closure (incl. test-only imports)
contains a changed package, and falls back to the full suite on any
uncertainty: non-Go or module files, nested modules, go list or git
errors, Formula fullSuiteTriggers (default lab/cmd/**), too many packages
or an argv over 128 KiB. Selection is refused when argv carries
graph-affecting flags (-tags, -mod, -modfile, -overlay, -C, unknown), the
analysis can never set it, approval requires the plan's triggers to match
the Formula, and the independent evaluation verification always runs the
full plan argv. The ledger records what was selected and why.

Built by Forgecell Molecule mol-185-61e1d66f250ce58b35eb20cc (v3 Lab) with
one review round and a verification pass. Hand-delivered: the protected
run fails only the base cohort flake test whose fixture this slice
intentionally changes; the full suite passes in a clean shell on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DanielNetzer
DanielNetzer merged commit 514ef73 into main Oct 24, 2026
2 checks passed
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.

Checks: run only affected Go packages (reverse-dependency selection) with safe full-suite fallback

1 participant