From 6473a17de47998b235bdcc67700695215e29f9f9 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 9 Nov 2026 04:44:43 -0800 Subject: [PATCH] Say one open pull request per agent thread and never archive a thread that owns work, on the factory page (GST-2077) (#4213) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- capy/skill/gstack/factory.md | 4 ++-- changelog.d/keep-work-owned-in-factory-page-gst-2077.md | 1 + test/capy-skill-wrapper.test.ts | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelog.d/keep-work-owned-in-factory-page-gst-2077.md diff --git a/capy/skill/gstack/factory.md b/capy/skill/gstack/factory.md index 8e30e1d9f..b94da3a1d 100644 --- a/capy/skill/gstack/factory.md +++ b/capy/skill/gstack/factory.md @@ -3,7 +3,7 @@ Your crew's CREW.md and recorded approvals decide who may merge, update a base, spend or touch production; urgency changes priority, never permissions or gates. With no Captain, ask the person; never merge without their word. Story: capy/README.md; examples: org Drive software-factory/README.md. 1. **Plan, then a yes.** New functionality starts with /autoplan sized to the work; the build waits for "do it". [SKILL.md: Plan, approve, ship] -2. **Someone else merges.** Run /ship to a receipt on your final pushed head, send one READY quoting gstack's verify output verbatim, and stop. The merge owner merges on green and assigns versions; docs-only PRs run only docs checks. [crew/docs/captain.md: The READY contract] +2. **Someone else merges.** Run /ship to a receipt on your final pushed head, send one READY quoting gstack's verify output verbatim, and stop. One open PR per lane; follow-ups ride it. The merge owner merges on green and assigns versions; docs-only PRs run only docs checks. [crew/docs/captain.md: The READY contract] 3. **Block only on the floor.** A finding blocks if it would fail a test, break production, or lose data or secrets; deferred findings stay on the PR and never become issues. [docs/review-policy.md] 4. **Fix waves.** When main goes red, hold /ship while one owner finds the root cause; bring main in once, as your rules allow. Follow-ups get one issue with an owner and one PR. [docs/triage.md] 5. **Severe first, same gates.** A severe user-facing bug jumps the queue with a short plan; receipt, checks and merge owner stay. @@ -13,5 +13,5 @@ Your crew's CREW.md and recorded approvals decide who may merge, update a base, 9. **Flakes: one rerun, a ledger, a daily fix.** Only the policy's rerun, never for a harness or infra red; a second red is real; never loosen a test. [crew/docs/captain.md: The daily flaky pass] 10. **Quiet.** Messages wake the Captain cold: send READY, a blocker, done or a Captain or owner call, else end_turn; no acks or progress notes. Broadcasts go in its notes. 11. **Ask once, plainly.** One ask per decision, explained like the owner is five: your Captain's name, then a lettered line each: "A: hit problem p, which happens when h. We could do 1) x, 2) y or 3) z. Recommendation x because why. A1 to take recommendation." "do it" takes every recommendation; "A2" takes option 2. Owner tasks: the exact link (in Capy: path and field), numbered steps, the reply word. Never re-ask a standing rule; check what you can yourself. [crew/docs/captain.md: The ask format] -12. **Fresh threads, closed out.** One thread per unit of work; past 500M tokens, rotate [/runaway-stopper]. Crew threads never create threads: ask your Captain (Captain to Captain across projects), or report one you made by code for crew.add. Its Captain archives only its crew's threads; threads outside every crew are the owner's, even its automation's. Size reviews to the diff. [docs/ship-budget.md; crew/docs/captain.md: New threads join the crew] +12. **Fresh threads, closed out.** One thread per unit of work; past 500M tokens, rotate [/runaway-stopper]. Crew threads never create threads: ask your Captain (Captain to Captain across projects), or report one you made by code for crew.add. Its Captain archives only its crew's threads, never one with an open PR or issue until a live successor holds it; a PR closes only as landed, superseded or dropped. Threads outside every crew are the owner's, even its automation's. Size reviews to the diff. [docs/ship-budget.md; crew/docs/captain.md: New threads join the crew] 13. **The owner's model preference.** `gstack-models resolve --role agent` picks agent models, except cross-family voices and eval subjects. [docs/model-policy.md: Your model preference] diff --git a/changelog.d/keep-work-owned-in-factory-page-gst-2077.md b/changelog.d/keep-work-owned-in-factory-page-gst-2077.md new file mode 100644 index 000000000..d7c892199 --- /dev/null +++ b/changelog.d/keep-work-owned-in-factory-page-gst-2077.md @@ -0,0 +1 @@ +- **The factory page says one open PR per lane and never archive a thread that still owns work.** Point 2 of capy/skill/gstack/factory.md, the page every Capy session reads, now says each lane keeps one open PR and follow-ups ride it. Point 12 says a Captain never archives a thread with an open PR or issue until a live successor holds it, and a PR closes only as landed, superseded or dropped. Both are lessons from gbrain's merge queue, which reached 220 open PRs in November 2026. The page's byte budget moves from 3,475 to 3,650 for these two rules. Docs only (GST-2077). diff --git a/test/capy-skill-wrapper.test.ts b/test/capy-skill-wrapper.test.ts index ad56aecb7..ca9c331fa 100644 --- a/test/capy-skill-wrapper.test.ts +++ b/test/capy-skill-wrapper.test.ts @@ -680,12 +680,13 @@ describe('capy skill: factory.md, the auto-loaded "how we work" page', () => { return [...new Set(problems)]; } - test('it fits the 3,475-byte budget, and every citation, heading and skill it names resolves', () => { + test('it fits the 3,650-byte budget, and every citation, heading and skill it names resolves', () => { const text = fs.readFileSync(FACTORY, 'utf8'); // 3,300 since #3634; raised to 3,450 (the page's new size, rounded up to the next 25 bytes) for point 12's // R68 clause (Garry, 2026-11-03: crew threads ask their Captain for new threads). Raise it only by what a rule needs. // 3,475 for the crew/ prefix on its four Captain-manual citations (GST-1833 moved docs/captain.md to crew/docs/; no rule text changed). - expect(Buffer.byteLength(text)).toBeLessThanOrEqual(3475); + // 3,650 for point 2's one-open-PR-per-lane rule and point 12's no-orphan and close-reason rule (GST-2077, Garry's "do it" 2026-11-09: lessons from gbrain's merge queue). + expect(Buffer.byteLength(text)).toBeLessThanOrEqual(3650); expect(text).toMatch(/^# How we work/); expect(citationProblems(text)).toEqual([]); });