Skip to content

ci(next): a stale action export fails a change only when the change left it stale - #26803

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
leo/action-exports-base-drift
Oct 28, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
leo/action-exports-base-drift

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

The action catalog freshness check failed every pull request whose base had stale action exports (plans/cmux-next/action-surfaces.json, actions.md). That drift is the base's: direct pushes to feat-cmux-next change the catalog without regenerating, and the base autofix regenerates it afterwards (for example 573430f, c73892b). Until then, cmux-next generated files and cmux-next generated files (shared build) (#26687) went red on PRs that hadn't caused it. The settings export check already called this the base's; the action check didn't.

What changes

The actions step in swift-test, daemon-test and generated-files now runs scripts/cmux-next/judge-action-exports.sh, which wraps check-action-surfaces.sh:

  1. The checks pass: done.
  2. Otherwise it regenerates the exports and runs the checks again. If they're still red, that's a real catalog failure (a missing surface, a duplicate CLI name) and it fails as before.
  3. If the checks were red only because of stale files, each stale export is judged against the base parent (HEAD^1):
    • It takes the base's drift (base committed to base fresh) and applies it to this commit's committed file (git merge-file).
    • If the result equals this commit's fresh export, only the base is stale. The step gives a base drift warning and puts the committed file back so nothing collects the base's repair.
    • Any other difference belongs to this change. The step fails naming the file, and the fresh export stays in the checkout for the existing "Regenerate stale files" step and patch artifact.

Where the base's fresh export comes from:

  • If the change touched no generator input (Packages, plans/cmux-next, the regenerate script), it is this commit's own fresh export. No rebuild.
  • Otherwise the changed inputs are checked out from HEAD^1 in place, rebuilt and exported. Then HEAD's inputs go back and are rebuilt. If that rebuild fails, .build is removed so later --skip-build suites can't test base binaries. This is the same restore discipline as check-settings-exports.sh.
  • The rebuild runs only on a run that has stale exports and touched the inputs.

Step outcomes are unchanged: the step still fails exactly when the change's own exports are stale or the catalog is broken, so the regenerate, upload and verdict steps behave as before.

Tests

scripts/cmux-next/tests/judge-action-exports.test.sh is wired into the checks job. It uses a fake package whose generator reads the built product, so the base export really comes from a base rebuild. Each case is a merge commit, like a PR checkout:

case result
(a) stale base, change touches no action input passes with a base drift warning; checkout and products are HEAD's
(b) fresh base, catalog changed without regenerating fails, naming the export
(c) base drift plus the change's own stale export fails on the change's part
(d) base drift, change regenerated its own part passes with a warning
(e) catalog failure that regenerating doesn't fix fails
(f) fresh merge passes silently
(g) base parent that doesn't build counts as the change's; HEAD's products restored
(i) base regenerate rewrites an export that is fresh at HEAD HEAD's bytes put back

Run on Linux CI: the bash test passes, shellcheck is clean, and test_cmux_next_generated_fold, test_cmux_next_checks_workflow, test_job_input_fingerprint, test_cmux_next_route, test_ci_workflow_guards_are_wired and test_check_paths pass (260 tests).

Why the drift keeps coming back

Direct pushes to feat-cmux-next get no PR checks. The base autofix is the self-heal for that, and branch protection on direct pushes is left as it is. This PR stops that drift from turning other PRs red.

Risk

The risk is a false pass, where a change's own stale export is called base drift. The 3-way comparison passes only when HEAD's fresh export is exactly the base's drift applied to HEAD's committed file. A merge conflict or any leftover difference fails. If the base doesn't build, the stale export counts as the change's.

Agent session: agent session

🤖 Generated with Claude Code

…eft it stale

The action catalog checks failed every pull request on a base whose action
exports were stale, for drift the base autofix regenerates after the next push.
scripts/cmux-next/judge-action-exports.sh wraps check-action-surfaces.sh with the
settings export check's rule: when the checks fail only for stale exports, each
one is judged against the base parent. The base's drift (its fresh export over
its committed file) is applied to this commit's committed file; if that gives
this commit's fresh export, the staleness is the base's (a warning). Anything
else is the change's own and fails, with the fresh export left for the
regenerate step. A catalog failure that regeneration does not fix still fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 009f6c9: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr26803 -f ref=leo/action-exports-base-drift -f platform=macos -f backend_mode=local

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 28, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build/
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build
View Logs
nightly.yml must derive the embedded key and sign every appcast through the helper/
nightly.yml must derive the embedded key and sign every appcast through the helper
View Logs
test_the_nightly_is_covered (main.NightlyStepCoverageTests.test_the_nightly_is_cove
red)/
test_the_nightly_is_covered (main.NightlyStepCoverageTests.test_the_nightly_is_cove
red)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-vg0efr created for this PR by the cmux coordinator.

…judge only the generated files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 009f6c9

No blocking findings.

The bundled judge-action-exports test passes all cases.

@teamleaderleo
teamleaderleo merged commit 953bd3b into feat-cmux-next Oct 28, 2026
175 of 185 checks passed
@teamleaderleo
teamleaderleo deleted the leo/action-exports-base-drift branch October 28, 2026 10:45
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40675011262 at c0d504c failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at 853538a. This pull request is one of 2 merged since: #26803, #26536.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 009f6c90 Deployed Oct 28, 2026 by teamleaderleo via wait for same-key tree publisher #71031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant