Skip to content

Teach crews to keep work owned and treat outside PRs as bug reports (GST-2077) - #4204

Merged
capy-ai[bot] merged 5 commits into
mainfrom
factory-lessons-from-gbrain-queue-gst-2077
Nov 9, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
factory-lessons-from-gbrain-queue-gst-2077

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Crew docs now say how a factory keeps work from being orphaned and how an outside PR lands. This serves the README goal of a crew that ships without losing work: nothing a crew owns goes stale because its thread was archived.

What changed

New: crew/docs/captain.md's No orphaned work section, so a Captain never archives a thread that still owns open PRs or issues

New: crew/docs/captain.md's No orphaned work section, so a Captain never archives a thread that still owns open PRs or issues.

Before/after as text: the No orphaned work section

The section is new on this branch (not present at a7968dc). It says a Captain archives or rotates a thread only once a live successor owns its open PRs and issues, puts successor triggers on an issue rather than in notes, sweeps for orphaned PRs and issues on every wake, and closes a crew PR only as landed, superseded or dropped.

  • No orphaned work is a new section in crew/docs/captain.md, and the daily issue sweep now re-owns issues whose assignee is archived instead of closing or backlogging them.
  • Waves: one open queue PR per lane, follow-ups ride that PR or the area's next wave, and the section says when to move from direct landing to waves.
  • Outside PRs are bug reports. Each gets a recommendation within 7 days, posted under the bot identity, and "not a bug" or "out of scope" needs the maintainer's word. A real bug is rewritten from main with credit, so no contributor commit enters the tree. CONTRIBUTING.md ("How a contributor's PR lands"), captain/templates/CREW.md rule 18, crew/docs/captain.md, docs/review-policy.md and the Contributor PRs row in crew/docs/recommended-harness.md say the same.
  • Credit check: the credit recipe fetches the contributor's PR head with a + refspec, lists the authors first, and drops any author whose lines the commit does not carry before gstack-coauthor-trailers --message adds trailers.
  • The report and brief templates carry an Open work line.

Why

Garry, 2026-11-09: "we want to help future software factories NOT do this and that means gstack." gbrain's merge queue reached 220 open PRs partly because finished work lost its owner when a thread was archived. These rules make the next crew re-own that work instead of letting it rot.

Blast radius

Prose and templates only: 9 Markdown files and one changelog fragment, with no tool, prompt, policy key or test changed. The tests that read these docs by path (captain-brief, captain-skill, prose-voice-floor, census-red-docs, archaeology-lint and 14 more) pass on this tree, and the docs audit found every new link and anchor resolves.

Summary

Crews kept losing finished PRs when the thread that owned them was archived, and outside PRs had no clear path. This PR writes down the rules. A Captain hands work to a live owner before archiving, sweeps for orphans, and lands outside fixes as rewrites with credit. This /ship pass, after the rebase onto a7968dc, tightened the credit recipe (a + refspec, and authors checked before any trailer is added) and brought the harness options table in line with the rewrite rule.

Test Coverage

No new code paths: the change is Markdown prose and templates. The Step 7 audit ran audit-only and found 0 gaps (coverage not applicable).
Tests ran: free count carried from CI at the pushed head (see Test plan).

Pre-Landing Review

Pre-Landing Review: 1 issue — 1 auto-fixed, 0 asked, 0 deferred, 0 noted (pass 1); the fix-check and targeted read found nothing; Step 11 deferred 1 and noted 6.
Gate edits: none detected (0 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review (openai/gpt-6.1-sol): FINDINGS, one CRITICAL in the unchanged wave section of CONTRIBUTING.md; deferred below.

Deferred findings

Blocking findings in code this PR did not change (review scope: frozen). They stay on this PR and are not filed as issues.

  • Deferred: CRITICAL CONTRIBUTING.md:925 The unchanged 'Community PR triage (wave process)' section still has maintainers merge contributor PRs into a wave branch and run their tests and build, contradicting the new text-only rule for outside PRs (confirmed by adversarial-native#1)

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL CONTRIBUTING.md:925 Same stale wave section (and docs/triage.md:97's pointer to it) still says to merge contributor commits
  • INFORMATIONAL captain/SKILL.md.tmpl:360 the Captain skill still says "Credit every contributor (Co-authored-by)", the retired port model (the same finding's crew/docs/recommended-harness.md:356 row was rewritten in 45c49d6 under the Captain's A1)
  • INFORMATIONAL crew/docs/captain.md:255 The daily sweep can close or backlog a trigger issue kept on an idle live thread for more than 2 days unless it is in Waiting
  • INFORMATIONAL CONTRIBUTING.md:965 Fork commit author fields are fork-controlled, so the identity on their commits can still name a third party; credit only the PR opener's login or noreply email
  • INFORMATIONAL CONTRIBUTING.md:955 The 7-day verdict deadline depends on the maintainer's word and the clock marks the existing backlog overdue at once
  • INFORMATIONAL CONTRIBUTING.md:964 Fetched refs/contrib/ refs are never deleted after the trailers run

Exploratory QA

Smoke for a docs change: 6 doc-reading test files (captain-brief, captain-skill, prose-voice-floor, archaeology-lint, census-red-docs, crew ship-queue-wave) passed 63/63 on the fixed tree; the fix-check reader ran 19 files that read the changed docs, 642 pass, 0 fail. No browser surface.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN. Intent: the approved GST-2077 plan items P1.1–P1.3 (crew docs from the gbrain queue). Delivered: those docs, one review fix in the same files, and the harness options row the docs audit flagged (Captain's A1, inside the approved plan).

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The approved plan is record r-fc2045beacde.

TODOS

No TODO items completed in this PR.

Documentation

Status: current: a ship-owned audit of a docs-only change; no corrections were needed.

Scope: base a7968dc to head 45c49d6, 5 commits and 9 files, all authored docs (CONTRIBUTING.md, captain/templates/CREW.md, brief.md, report.md, the changelog.d fragment, crew/README.md, crew/docs/captain.md, crew/docs/recommended-harness.md, docs/review-policy.md). There were no staged, unstaged or untracked files.

Documentation health:

  • CONTRIBUTING.md: current. The new 'How a contributor's PR lands' section matches crew/docs/captain.md.
  • crew/docs/captain.md: current. The No orphaned work anchors resolve, and the successor-brief link exists.
  • docs/review-policy.md: current. The coauthor-trailers range and flags match the tool's usage text.
  • captain/templates/CREW.md, brief.md, report.md: current. Rule 18 and the Open work line agree with captain.md.
  • crew/README.md, crew/docs/recommended-harness.md: current.
  • changelog.d fragment: reviewed, not edited.

Coverage debt: none critical. This is docs-only process guidance with no new public surface. The header comment in crew/bin/gstack-coauthor-trailers still says 'ported branch', which is a small source-comment follow-up.

Diagram drift: none found.

Test plan

  • bun run test (lane free): carried from CI run 42614069609/1 at tree b745e010fbbc (head 45c49d6), green, tests_ran=1652 files; pregate pass on the final tree.
  • Doc-reading tests on the fixed tree: 6 files, 63 pass, 0 fail.

Approvals

Plan: approved (record r-fc2045beacde; autoplan run-20261109085029, gate_rev 1, the owner's words "do it").

Agent notes

Approvals

Approved: yes (record r-b59e254e7b75). The full approval record stays private.
Plan: approved (record r-fc2045beacde)
Plan check: approved (record r-fc2045beacde)
Docs audit block on crew/docs/recommended-harness.md:356: the Captain answered A1 (rewrite the row) under Garry's approved D1-A (approval a-9b1af2001d02).

REVIEW_LOOP: passes=1 blocking_found=1 deferred=1 noted=0 fixed=1 scope=frozen ledgers_read=5 fix_checks=1 dispatches=2
Gate edits: none detected (0 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Refs GST-2077

{
  "schema_version": 1,
  "pr": 4204,
  "head": "45c49d6ba7b572aec8d877b0d4b445233387f6e9",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1652,
      "fail": 0,
      "skip": 6
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42614069609,
      "attempt": 1,
      "tree": "b745e010fbbceeef8d9d147001e577def43540cc"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "b745e010fbbceeef8d9d147001e577def43540cc",
  "product_patch_id": "ee1f8c5bdb557ee37c02db61be099fcdbc17f01b",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 105,
    "rules": "66e5174161eecc2c",
    "base": "a7968dc77d0559a8395937166c57557094116cb7",
    "registry": "a7968dc77d0559a8395937166c57557094116cb7",
    "gate_scan": {
      "tagged": 0,
      "head": "45c49d6ba7b572aec8d877b0d4b445233387f6e9"
    },
    "reasons": [
      "risk:money",
      "runtime=105"
    ],
    "risk": [
      "money"
    ],
    "mode": "panel"
  },
  "pregate": "pass @b745e010fbbc (8 checks, current for 45c49d6ba7b5)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "CONTRIBUTING.md, crew/docs, docs, captain/templates, crew/README.md, README.md (9 changed files audited)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 1,
    "noted": 0,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "ledgers_read": 5,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "ee1f8c5bdb557ee37c02db61be099fcdbc17f01b",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 9, 2026 11:28
…GST-2077)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…(GST-2077)

Review-Finding: p1/red-team#2 reader=red-team
Review-Finding: p1/red-team#3 reader=red-team
Review-Finding: p1/red-team#4 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ange (GST-2077)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@garrytan
garrytan force-pushed the factory-lessons-from-gbrain-queue-gst-2077 branch from 97769b0 to 685fbe8 Compare November 9, 2026 11:30
garrytan and others added 2 commits November 9, 2026 11:39
Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ble (GST-2077)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant