Phase 1/2 orchestration groundwork: guard hook, worker roster, corrections ledger, docs manifest - #136
Merged
Merged
Conversation
… worker roster
Adds a committed .claude/settings.json wiring two hooks: guard_master.py
(PreToolUse) blocks gh pr merge / git merge into master unconditionally,
and git push to master only from worker worktree checkouts, leaving the
interactive main-checkout push-to-master convention untouched; and
session_context.sh (SessionStart) injects live branch/CI/PR state,
using the correct fork-vs-upstream repo slug and the Checks API (not
the legacy Status API, which silently hides Actions failures).
Adds four scrubbed, public worker agent definitions
(.claude/agents/worker-{backend,frontend,docs,upstream}.md) and a
tiered report schema mirror (docs/reports/schema.json) for the
six-field standing report format.
Carves committed exceptions into .gitignore's blanket /.claude/
ignore so these files are actually trackable. Documents the
branch-protection trade-off (real backstop vs. workflow cost) in
docs/infrastructure.md without applying it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
…ocs manifest, lessons triage ritual guard_master.py fixes: exempt git merge --ff-only from the unconditional git-merge-into-master block (a fast-forward sync isn't an authorization decision); fix log_stub() resolving repo root from the script's own on-disk path instead of cwd, which was writing real ledger entries from test-fixture invocations. Adds corrections/ (blameless CORR-NNNN ledger, seeded with 7 verified incidents from this week's real history), docs/MANIFEST.md (routing table: path/purpose/governs-what/authority), and a lessons-to-gates triage ritual documented in docs/lessons.md. Broadens CLAUDE.md's gh-CLI upstream-parent-resolution note to cover list/view, not just create/merge. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
…dger rule Establishes that a corrections entry may cite a report instead of a commit SHA when no discrete commit exists for the fix (owner decision). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
…E_API_KEY rotation didn't clear the CI skip CORR-0009: a directive claimed PR #136/#137 were merged via UI when they weren't (conflated with two unrelated credential rotations) -- caught by gh api verification before any branch deletion or downstream claim, zero actual damage. docs/lessons.md: rotating GOOGLE_DRIVE_API_KEY alone didn't clear the 4-skipped baseline on a fresh re-run -- likely still blocked on pyOpenSSL not being installed in the CI runner (per #135's own commit note), not conclusively fixed by the rotation alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
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.
Description
Phase 1/2 of the repo-orchestration commission: committed hooks + a scrubbed public worker roster + a corrections ledger + a docs routing manifest.
.claude/settings.json: wires two hooks.guard_master.py(PreToolUse):gh pr merge/git mergeinto master blocked unconditionally, everywhere (owner-only actions, no legitimate solo-workflow exception —git merge --ff-onlyis exempted as a sync, not a merge decision).git pushto master blocked only from worker worktree checkouts (.claude/worktrees/) — the main checkout's interactive push-to-master convention is untouched. Every deny appends a stub tocorrections/.pending-stubs.jsonl.session_context.sh(SessionStart): injects live branch/commit/CI/open-PR state. Usesgit remote get-url origin(notgh repo view/gh pr list's default, which resolve to the upstream parent repo) and the Checks API (not the legacy Status API, which silently hides Actions failures)..claude/agents/worker-{backend,frontend,docs,upstream}.md: four scrubbed, public specialist agent definitions (tight tool allowlist,isolation: worktree,model: sonnet).docs/reports/schema.json: tiered (summary/detail) structured mirror of the six-field standing report format.corrections/: blameless CORR-NNNN incident ledger, seeded with 7 entries from this week's real history (2 pre-existing repo incidents researched and verified against git history, 5 caught live while building this branch — including a real false-positive bug inguard_master.py's own regex, found and fixed with regression tests).docs/MANIFEST.md: a routing table (path/purpose/governs-what-surface/authority) overdocs/..gitignore: carved explicit exceptions into the blanket/.claude/ignore so any of the above could be tracked at all.docs/infrastructure.md: documents the branch-protection trade-off (a real backstop requires no admin-bypass, which removes push-straight-to-master for the owner too) — described, not applied.Not included: branch protection itself (owner's to click), the constitution document (routed to a private repo, not yet created), and the GitHub-issues task-ledger migration (explicitly sequenced for later).
Checklist
pre-commitand installed the hooks withpre-commit installbefore creating any commits..claude/hooks/test_guard_master.py, 17 fault-injection cases, all passing.).claude/hooks/test_guard_master.pydirectly (17/17 pass) after every change, including two regression cases added after a real bug (git merge-basefalse-positive) was caught mid-session.session_context.shdirectly against this repo's live state and confirmed it correctly reports the actual PR list and actual CI state (catching two bugs in the process — seecorrections/CORR-0005andCORR-0006).worker-backend.md's conventions on a real task, confirming worktree isolation and report format work end-to-end (full native-registry + harness-level-allowlist-enforcement proof still needs a fresh session — not yet done).