cmux-next guards: a stale settings export fails only the change that made it stale (defaults-snapshot base red)
Summary
cmux-next guards / defaults-snapshot is red on base and on every pull request into feat-cmux-next. #22877 (merged 04:02Z) did not fix it.
What drifted. On base 6143f81a755, check-stamp reports four settings sources as stale:
Localizable.xcstringsNotificationModes.swiftNotificationPreferences.swiftSettingsSchema+Appearance.swift
Three merges landed those source changes without their exports:
- d986b175b38: a direct push that changed the Quiet help text.
- #22678: notification modes.
- #23028: shortened translations.
No default changed. defaults_guard.py check --base C^ --head C lists nothing for any of the three commits. They changed help text and translations only, so nothing needs a call.
Why it stays red. The exports are meant to come from the base autofix after each merge. With merges minutes apart, those runs get cancelled or lag. Meanwhile check-stamp judges the whole tree, so every pull request inherits the base's stale stamp. Its message also pointed at a "REPAIR.md row" that this repository doesn't have.
What this changes.
-
check-stamp --base REFfails only for sources whose bytes changed since REF. Sources that were already stale on the base print as a::warningsaying the base autofix regenerates them. -
The defaults-snapshot job checks out with depth 2 and passes
HEAD^1. That is the base tip for a pull request's merge commit, or the parent commit for a push. A push that lands a settings source without its exports is still red on that one commit, so the drift points at the commit that caused it. -
The stale message now says how to regenerate:
- the PR autofix (
cmux-next-pr-autofix.yml) for a pull request; - the base autofix after a merge;
scripts/cmux-next/regenerate-settings-exports.shon a fleet Mac to do it yourself.
- the PR autofix (
-
The generated-files job in
cmux-next.ymlruns the samecheck-stamp --base HEAD^1, so it also only warns about exports that were already stale on the base. -
A source counts as the base's only when both its bytes and its stamp entry match the base's. That split happens before the list is cut to 20 lines, so a head that edits the stamp itself still fails, and a base with more than 20 stale sources still passes.
-
#22275 follow-ups:
- the comments in
autofix-areas.shandregenerate-settings-exports.shnow namecheck-stampinstead of the oldcheck-fresh; - the fork hint in the PR autofix uses
git apply --indexso it stages new files too.
- the comments in
This complements #22004, which makes the base autofix itself keep up.
Separate base red. This job's next step, check-menu-actions.py, also fails on base: ChiefPaneTools.swift has an inline menu row from #22852. It is hidden behind the stamp failure today. I'm reporting it separately rather than fixing it here.
Changelog
none
Testing
python3 tests/test_defaults_guard.py:
- Base: the new tests fail (319a7a8a831 and b388714a876, both committed before their fixes).
- Head: 36/36 pass.
bash scripts/cmux-next/tests/pr-autofix.test.sh passes.
On this PR's own CI at b61b21663d4, the stamp step passes and warns about the four inherited sources. The only red is the next step, check-menu-actions.py, which is the separate base red.
python3 scripts/ci/defaults_guard.py check-stamp --base HEAD on base 6143f81a755 exits 0 and warns about the four inherited sources. Without --base it exits 1.
Observed / Not run
- Ran both commands above on Linux (huge-blue).
- Saw this PR's defaults-snapshot run warn about the four inherited sources and pass the stamp step.
- An independent review subagent passed b61b21663d4. Its non-blocking note: on a plain workflow_dispatch, such as a next-batch stack,
HEAD^1is only the previous commit, so a stale source from earlier in the stack passes as inherited. Each PR's own pull_request run still judges it. - Not run: the base autofix after merge.
Agent session: huge-blue
๐ค Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes the defaults-snapshot guard so a stale settings export fails only the change that made it stale, and applies the same fix to the generated-files job.
check-stamp --base REFfails only for sources whose bytes changed since REF; sources already stale on the base print as a::warning.- A source counts as the base's only when both its bytes and its stamp entry match the base, and that split runs before the 20-line list is cut, so a head's own stamp edit fails and over 20 inherited sources still pass.
- Both guards check out depth 2 and pass
HEAD^1โ the base tip for a PR's merge commit, or a push's parent. - The stale message names the PR autofix and
scripts/cmux-next/regenerate-settings-exports.shinstead of a REPAIR.md row this repository doesn't have. - The three merges that left the stamp stale changed only help text and translations, so no default changed.
autofix-areas.shandregenerate-settings-exports.shnow namecheck-stampinstead ofcheck-fresh; the fork hint usesgit apply --indexso new files get staged.- A separate base failure in
check-menu-actions.py(ChiefPaneTools.swiftfrom #22852) remains hidden behind the stamp failure and is tracked separately.