Skip to content

Phase 1/2 orchestration groundwork: guard hook, worker roster, corrections ledger, docs manifest - #136

Merged
WilfordGrimley merged 6 commits into
masterfrom
orchestration-hooks-phase1-2
Jul 19, 2026
Merged

Phase 1/2 orchestration groundwork: guard hook, worker roster, corrections ledger, docs manifest#136
WilfordGrimley merged 6 commits into
masterfrom
orchestration-hooks-phase1-2

Conversation

@WilfordGrimley

Copy link
Copy Markdown

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 merge into master blocked unconditionally, everywhere (owner-only actions, no legitimate solo-workflow exception — git merge --ff-only is exempted as a sync, not a merge decision). git push to 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 to corrections/.pending-stubs.jsonl.
    • session_context.sh (SessionStart): injects live branch/commit/CI/open-PR state. Uses git remote get-url origin (not gh 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 in guard_master.py's own regex, found and fixed with regression tests).
  • docs/MANIFEST.md: a routing table (path/purpose/governs-what-surface/authority) over docs/.
  • .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

  • I have installed pre-commit and installed the hooks with pre-commit install before creating any commits.
  • I have updated any related tests for code I modified or added new tests where appropriate. (.claude/hooks/test_guard_master.py, 17 fault-injection cases, all passing.)
  • I have manually tested my changes as follows:
    • Ran .claude/hooks/test_guard_master.py directly (17/17 pass) after every change, including two regression cases added after a real bug (git merge-base false-positive) was caught mid-session.
    • Ran session_context.sh directly 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 — see corrections/CORR-0005 and CORR-0006).
    • Spawned a real subagent (worktree-isolated) instructed to follow 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).
  • I have updated any relevant documentation or created new documentation where appropriate.

WilfordGrimley and others added 3 commits July 19, 2026 16:47
… 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
WilfordGrimley and others added 3 commits July 19, 2026 17:54
…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
@WilfordGrimley
WilfordGrimley merged commit 150cc38 into master Jul 19, 2026
5 checks passed
@WilfordGrimley
WilfordGrimley deleted the orchestration-hooks-phase1-2 branch July 19, 2026 18:32
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