Repository navigation
feat(ci): flag a pull request whose files return to an older main version (#1307) - #1315
Merged
Merged
Conversation
…sion #1286 was one commit whose parent was a fresh main but whose tree came from an old worktree. It undid seven merged pull requests, and every gate was green: the squash was CLEAN and the old code was self-consistent. #1310 nearly did the same that day. The diff reads as a feature that also deletes things. What gives it away is that each file's new content is a version main already had and moved past. `stale tree guard` (stale-tree-guard.yml) walks each changed file's history on main and names the commits a return would undo. A file brought back with the content it had before main deleted it is the same finding. Deletions alone are not findings. It is graded on main's own history: - three or more source files returning fails; - fewer warn (#1302 deliberately took back two lines of #877); - screenshot baselines are reported and never counted (#1298's CTA baseline landed on old bytes). Replayed against #1286's commit and main's last 40 merges, each on its true parent: - #1286 fails, on 33 source files; - so does #1300, the restore, its mirror image, a revert that would carry `revert-ok`; - three merges warn; - the other 35 are silent. The self-test runs first in the job. It covers the #1286 shape, a partial revert, a baseline on old bytes, a genuine change, both exemptions (a `Revert…` title and the `revert-ok` label) and a shallow clone, which is refused rather than passed. The check is not required yet, by the order the ci-and-supply-chain skill gives. Closes #1307 Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
force-pushed
the
issue/1307-stale-tree-guard
branch
from
November 27, 2026 06:14
4c366a9 to
bd9014e
Compare
athvin
marked this pull request as ready for review
November 27, 2026 06:36
athvin
temporarily deployed
to
marketing-preview
November 27, 2026 06:37 — with
GitHub Actions
Inactive
This was referenced Nov 27, 2026
Closed
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1307
What
A new check,
stale tree guard, flags a pull request whose files return to versions main already had and moved past, and names the commits merging it would undo. It is not required yet.Why
On 2026-11-27, #1286 committed a tree from an old worktree on a fresh main and undid seven merged pull requests with every gate green: most of the cinematic marketing epic and #1279's export. #1310 nearly did the same, the same day. The owner asked that every static-site change be kept; this is the check that would have caught both.
Proof
STALE_TREE_ALLOW_SHALLOW=1on the deepened local clone):d245d4adfails, on 33 source files, and so does its squash248e2966;revert-ok;stale tree guardpassed with "none of 5 changed file(s) returns to an older main version".workflow-shell-checkandactionlint(S9 pins) pass, as doscripts-home-checkandmake skills-check. The generatedrequired-checks.mdwas regenerated for the new workflow.Risk & rollback
Risk: false positives on deliberate reverts. Fewer than three source files only warns, and a
Revert…title or therevert-oklabel exempts. The check is not required, so a red one cannot block a merge. Rollback:git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:30a1182e-8c7e-47e3-92ac-cda64c13fcfconbrians-MacBook-Pro· 2026-11-27T06:48:39Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
7b34485d— rust 45953033290 ✓, frontend 45953033211 ✓, infra 45953033218 ✓, devcontainer 45953033231 ✓.imagesbuilt, or correctly never ran because nothing that goes intoan image changed: n/a — a CI-only change (a workflow,
scripts/ci, a skill), soimages.ymlcorrectly never ran.deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: n/a — no image was built, so nothing deployed. The guard runs on pull requests, not in a pod.
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: nothing here reaches
deploy.driftandkindare nightly and were already red before this change (kind probe red since 2026-11-10: KeyError 'token_hash' after the credential-omission fix #1106), so knowingly red and not this change.Donethrough the automation rather than byhand, and the issue closed: CI: flag a pull request whose files revert to an older main version (the #1286 stale-tree class) #1307 closed by the pull request (closer
PullRequest); cardDoneon board 2 through the automation.stale tree guardto a required check once it has reported on real pull requests #1318 (promotestale tree guardto required once it has reported on real pull requests).(a skill, a reference, memory) — or nothing new was learned: ci-and-supply-chain skill: a section on the guard (thresholds, exemptions, not required yet, how to run it locally). Memory
stale-tree-commit-reverts-main: guard shipped.Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files