Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7f5f239
feat(pr-pipeline): route red-main's failed-guard revert to a lane
kyle-sexton Nov 2, 2026
ca19a5f
feat(source-control): file post-merge records and quarantines for lanes
kyle-sexton Nov 2, 2026
901664f
feat(pr-pipeline): send post-merge records and quarantines to intake …
kyle-sexton Nov 2, 2026
19fcfc1
docs(pr-pipeline): state that post-merge records route to lanes
kyle-sexton Nov 2, 2026
267619f
docs(autonomy): keep re-earned promotion and name the demotion exception
kyle-sexton Nov 2, 2026
513c57a
fix(pr-pipeline): keep person-close records labeled and records out o…
kyle-sexton Nov 2, 2026
6f70496
fix(pr-pipeline): treat post-merge records as cleared state markers
kyle-sexton Nov 2, 2026
956a251
fix(pr-pipeline): close cleared records from a job that actually runs
kyle-sexton Nov 2, 2026
d9c0e5e
fix(pr-pipeline): keep reopened fix issues' labels and pin the identi…
kyle-sexton Nov 2, 2026
137cfa2
test(pr-pipeline): allowlist the checkout-free close-cleared job in a…
kyle-sexton Nov 2, 2026
2d71310
Merge remote-tracking branch 'origin/main' into feat/post-merge-recor…
kyle-sexton Nov 2, 2026
c1faf16
Merge remote-tracking branch 'origin/main' into feat/post-merge-recor…
kyle-sexton Nov 2, 2026
40db0ee
fix(pr-pipeline): label a full-run record needs-human when a failing …
kyle-sexton Nov 2, 2026
a707765
docs(pr-pipeline): state the needs-human exception for full-run recor…
kyle-sexton Nov 2, 2026
474818a
Merge remote-tracking branch 'origin/main' into feat/post-merge-recor…
kyle-sexton Nov 2, 2026
7dcda03
fix(pr-pipeline): leave red-main's failed-guard revert as on main and…
kyle-sexton Nov 2, 2026
3a6568d
Merge remote-tracking branch 'origin/main' into feat/post-merge-recor…
kyle-sexton Nov 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Changed

- The work-class guardrails say a person re-ratifies a cell's promotion after a demotion, and that only a demotion record's label and routing depend on whether its evidence clears without a person: a record that clears once main is green at a later commit carries no human-gated label, unless its filer needs one to keep intake admission off it (the lanes App's `--remediate` record) or a failing check got no fix issue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
bump: minor
---

### Changed

- `post-merge-demotion-alert.yml` treats a record as a state marker, never lane work: no record is sent to intake triage, and its text names each newly failing check by job name only and carries no revert command. A schedule or dispatch record, demotion or post-merge-failure, is filed with no `needs-human` label unless a failing check got no fix issue (over the cap or outside the name charset), since it clears itself once main is green at a later commit. Canary and revert records keep the label, since only a person's close clears one.
- A new `close-cleared` job runs on a green attempt 1 of a scheduled full run on main and closes as completed each open schedule or dispatch record, from `github-actions[bot]` or `merge.agent-identity`, created before that run, at a commit behind its head, and never edited.
- Each quarantine issue the suite judge files is locked and sent to intake triage. A quarantine or fix issue not delivered gets `needs-human`, the record does when a failing check got no fix issue, whether over the cap, outside the charset, or not filed, and the job fails on an undelivered issue; a fix issue reopened on a repeat failure keeps its labels, so one labeled `needs-human` stays with a person.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
bump: minor
---

### Changed

- **babysit-prs**: a demotion record `babysit_postmerge.py --remediate` files keeps the human-gated label, which holds intake admission off the lanes App's issue, and its text keeps the fix-issue rule: the detail names each newly failing check by job name only, never a gate's annotation title, and the record carries no `git revert` command. The record says how it clears: a schedule or dispatch record once a full run passes on main at a later commit, any other only on a person's direct close. A suite quarantine issue is filed with no label and no assignee, so intake triage hands it to a lane, and no longer goes to the suite's CODEOWNERS user.

### Fixed

- **babysit-prs**: the merge gate reads the green full runs that clear a red-main record one week at a time from the record, oldest first, and stops at the first week that clears it. A record that cleared long ago no longer overflows the 500-run listing and demotes again while main is green.
4 changes: 4 additions & 0 deletions .github/actions/resolve-config/api-budget-coverage.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const ALLOWED = new Map([
"intake-triage.yml:triage-split-children",
`${NO_LOG}; step "Triage each sub-issue" calls gh without api_budget_wrap_gh`,
],
[
"post-merge-demotion-alert.yml:close-cleared",
`${NO_LOG}; step "Close the records main cleared" calls gh without api_budget_wrap_gh`,
],
[
"pr-review-main.yml:record",
`${NO_LOG}; step "Record the stops" calls gh without api_budget_wrap_gh; step "Record the counts" calls gh without api_budget_wrap_gh`,
Expand Down
51 changes: 50 additions & 1 deletion .github/scripts/post-merge-demotion-alert/workflow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import process from "node:process";
import { test } from "node:test";

const text = readFileSync(new URL("../../workflows/post-merge-demotion-alert.yml", import.meta.url), "utf8");
const job = text.slice(text.indexOf("\n report-red-main:\n"));
const job = text.slice(text.indexOf("\n report-red-main:\n"), text.indexOf("\n close-cleared:\n"));

test("the report job runs only after the alert, for a failed full run on main", () => {
assert.match(job, /\n {4}needs: \[alert\]\n/);
Expand Down Expand Up @@ -252,3 +252,52 @@ test("the alert's job if admits exactly the workflow_run events the file step ac
assert.ok(acted.includes("acts") && acted.includes("exits"), "the cases cover both outcomes");
assert.equal(admits({ event_name: "workflow_dispatch", repository: "o/r", wr: {} }, C, F), true, "a dispatch always runs");
});

// The close-cleared job runs only on a green attempt 1 of a scheduled full
// run on this repository's main, an event the alert job never acts on, and
// holds only contents: read and issues: write.
test("close-cleared runs only on a green scheduled attempt 1 on main, with a narrow token", () => {
const closer = text.slice(text.indexOf("\n close-cleared:\n"));
const folded = /\n {4}if: >-\n((?: {6}.*\n)+)/.exec(closer);
assert.ok(folded, "close-cleared has a folded if:");
const js = folded[1]
.split("\n")
.map((line) => line.trim())
.filter(Boolean)
.join(" ")
.replace(/github\.event\.workflow_run\./g, "ctx.wr.")
.replace(/github\./g, "ctx.")
.replace(/([!=])=/g, "$1==");
const admits = new Function("ctx", `return (${js});`);
const base = { name: "pr-require-checks", event: "schedule", conclusion: "success", run_attempt: 1, head_branch: "main", head_repository: { full_name: "o/r" } };
const ctx = (wr, event_name = "workflow_run") => ({ event_name, repository: "o/r", wr: { ...base, ...wr } });
assert.equal(admits(ctx({})), true);
for (const [field, value] of [
["name", "post-merge-detect-silent-revert"],
["event", "workflow_dispatch"],
["conclusion", "failure"],
["run_attempt", 2],
["head_branch", "feature"],
["head_repository", { full_name: "fork/r" }],
]) {
assert.equal(admits(ctx({ [field]: value })), false, `${field}=${JSON.stringify(value)} is not admitted`);
}
assert.equal(admits(ctx({}, "workflow_dispatch")), false, "a dispatch never runs it");
const block = /\n {4}permissions:\n((?: {6}[a-z-]+: [a-z]+.*\n)+)/.exec(closer)[1];
assert.deepEqual(Object.fromEntries([...block.matchAll(/ {6}([a-z-]+): ([a-z]+)/g)].map((m) => [m[1], m[2]])), {
contents: "read",
issues: "write",
});
});

// The file step's load_records and close-cleared read merge.agent-identity the
// same way, so the filer one closes is the filer the other matches.
test("load_records and close-cleared extract merge.agent-identity identically", () => {
const lines = (pattern) => text.split("\n").filter((line) => line.includes(pattern)).map((line) => line.trim());
const seds = lines("sed -n '/^merge:/,/^[^[:space:]#]/ s/^ agent-identity: ");
assert.equal(seds.length, 2, "one extraction in each place");
assert.equal(seds[0].replace(/configured_identity/, "identity"), seds[1]);
const checks = lines("=~ ^[A-Za-z0-9]+(-[A-Za-z0-9]+)*\\[bot\\]$ ]]");
assert.equal(checks.length, 2, "one login check in each place");
assert.equal(checks[0].replace(/lane_filer/, "identity"), checks[1]);
});
Loading
Loading