Skip to content

backlog(B-0191): orchestrator branch-verify mechanization design#1571

Merged
AceHack merged 6 commits intomainfrom
backlog/B-0191-orchestrator-branch-verify-mechanization-design-aaron-2026-05-04
May 5, 2026
Merged

backlog(B-0191): orchestrator branch-verify mechanization design#1571
AceHack merged 6 commits intomainfrom
backlog/B-0191-orchestrator-branch-verify-mechanization-design-aaron-2026-05-04

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 5, 2026

Aaron 2026-05-04: oh-my-zsh-equivalent for orchestrator branch verification. Pre-commit hook + branch-name display + worktree-aware checks. 3rd-time recurrence today including the very commit landing this row — manual verify-rule outputs warning but doesn't auto-abort on chained shell commands; mechanization (pre-commit hook with hard-fail) is the substrate-level fix.

Copilot AI review requested due to automatic review settings May 5, 2026 03:01
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 686e1e3444

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/research/2026-05-04-ts-quality-sweep-tools-directory.md
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new documentation artifacts: (1) a P1 backlog row proposing mechanized “branch verification” for orchestrator commits (pre-commit hook / prompt UX / worktree-aware checks), and (2) a research-grade audit report summarizing TypeScript lint/typecheck findings under tools/**/*.ts.

Changes:

  • Added B-0191 backlog row documenting the orchestrator wrong-branch commit hazard and candidate mechanizations.
  • Added a TS tooling quality sweep research write-up with per-file ESLint finding counts and suggested cleanup order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
docs/research/2026-05-04-ts-quality-sweep-tools-directory.md New research doc capturing TS lint/typecheck audit results and consolidation observations.
docs/backlog/P1/B-0191-orchestrator-branch-verify-mechanization-design-aaron-2026-05-04.md New backlog row proposing a mechanized branch-verification approach (hook/prompt/status script).

Comment thread docs/research/2026-05-04-ts-quality-sweep-tools-directory.md
Comment thread docs/research/2026-05-04-ts-quality-sweep-tools-directory.md
@AceHack AceHack force-pushed the backlog/B-0191-orchestrator-branch-verify-mechanization-design-aaron-2026-05-04 branch from 686e1e3 to 615a2e1 Compare May 5, 2026 03:29
AceHack added a commit that referenced this pull request May 5, 2026
Threads addressed:
1. (P2) TS file-count baseline — TS doc removed via rebase (was
   accidental cross-branch contamination from concurrency hazard)
2. Absolute local path in TS doc — TS doc removed via rebase
3. Regenerate docs/BACKLOG.md to include B-0191 entry
4. Pre-commit hook example — generalized branch-pattern from
   "*-aaron-2026-*" to "*-yyyy-mm-dd" so it doesn't embed any
   specific contributor name (repo tooling, not personal)
5. Pre-commit hook location — committed under tools/git-hooks/
   (version-controlled, reviewable) and installed via
   tools/setup/, NOT directly in .git/hooks/ which is not
   version-controlled
6. PR scope — TS doc removed via rebase; this PR is now scoped
   to B-0191 alone

Verified branch before commit per PR #1568 rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 5, 2026 03:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread docs/BACKLOG.md
AceHack and others added 3 commits May 5, 2026 00:33
Aaron 2026-05-04: "for humans this is why oh my zsh reminds us
of many things like this it has branch name in the ui" + "maybe
a deliberate design/redesign on the backlog?"

Substrate-encoding rule (PR #1551 + PR #1568) hasn't prevented
recurrence — hazard hit twice in succession 2026-05-04, including
in the rule-encoding commit itself. Mechanization is the
substrate-level fix.

Five mechanization candidates ranked: pre-commit hook (HIGH),
branch-name in prompt (MED), worktree-aware status check
(LOW-MED), bash git wrapper (LOW), ZETA_EXPECTED_BRANCH env-var
convention (cross-cutting).

Composes with PR #1568 (manual discipline) + PR #1551 (parent
substrate) + B-0006 (memory work pattern) + B-0162 (similar
pre-commit hook precedent).

Pre-commit verified branch before commit per PR #1568 rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Threads addressed:
1. (P2) TS file-count baseline — TS doc removed via rebase (was
   accidental cross-branch contamination from concurrency hazard)
2. Absolute local path in TS doc — TS doc removed via rebase
3. Regenerate docs/BACKLOG.md to include B-0191 entry
4. Pre-commit hook example — generalized branch-pattern from
   "*-aaron-2026-*" to "*-yyyy-mm-dd" so it doesn't embed any
   specific contributor name (repo tooling, not personal)
5. Pre-commit hook location — committed under tools/git-hooks/
   (version-controlled, reviewable) and installed via
   tools/setup/, NOT directly in .git/hooks/ which is not
   version-controlled
6. PR scope — TS doc removed via rebase; this PR is now scoped
   to B-0191 alone

Verified branch before commit per PR #1568 rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nstall path; regen BACKLOG.md (#1571 reviewer + Aaron 2026-05-05 substrate-consistency catch)

Aaron 2026-05-05 caught the substrate-consistency tension: B-0191 as
originally written proposed git hooks under tools/git-hooks/ installed
via symlink, but `memory/feedback_dst_justifies_ts_quality_over_bash_
and_harness_hooks_suffice_no_git_hooks_aaron_2026_05_03.md` (indexed
in #1580 earlier this session) explicitly says git hooks are
unnecessary because vibe-coders always have a harness and harness
hooks suffice. Plus Aaron 2026-05-05: "i love symlinks but just an
FYI nothing works right with them it always goes wrong."

Revised design:
- Harness hook (Claude Code PreToolUse on git-commit Bash invocations)
- Implementation in TypeScript at tools/orchestrator-checks/verify-branch.ts
  (TS over bash per Otto-272 DST + harness-always-provides-bun)
- No tools/git-hooks/ directory required
- No tools/setup/ symlink install step
- Per-harness wiring documented (Claude Code, Codex, Cursor, etc.)

Also addresses #1571 reviewer findings:
- BACKLOG.md regenerated via `BACKLOG_WRITE_FORCE=1 bun tools/backlog/generate-index.ts` (was hand-edited; now matches generator)
- Cross-reference to memory/feedback_orchestrator_pre_commit_verify_branch_rule_*.md resolves cleanly after rebase on main (file was merged via #1568)
- tools/git-hooks/ reference removed (no longer the design)

Composes_with extended to include the harness-hooks-suffice rule and
B-0017 bulk-alignment UI (Aaron's note that the original
inconsistency would have been caught by the planned bulk-review
mechanism).

Aaron 2026-05-05 verbatim: "it fine it's something we would have
caught in the bulk alignment UI on the backlog" -- so the manual
fix here is bonus, not required; the systematic answer is B-0017.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@AceHack AceHack force-pushed the backlog/B-0191-orchestrator-branch-verify-mechanization-design-aaron-2026-05-04 branch from 94e4caf to c360d4c Compare May 5, 2026 04:38
@AceHack AceHack enabled auto-merge (squash) May 5, 2026 04:38
Per markdownlint MD032/blanks-around-lists. CI ran on #1571's
revised commit; flagged a missing blank line between
"Implementation: a ..." paragraph and the list item that follows.
Trivial fix.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c360d4c1f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings May 5, 2026 04:41
Reviewer flagged that the row's last_updated stays at 2026-05-04
even though the latest revision (harness-hooks switch + symlink
removal) was committed 2026-05-05. tools/backlog/README.md schema
says last_updated should reflect the most recent content edit.

created: 2026-05-04 unchanged (first-landing date per schema).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

…#1571 reviewer feedback)

Two reviewer findings:

1. "harnesses always provide the bun runtime" was wrong -- only
   Claude Code does; Codex / Cursor / Aider commonly have Node
   or Deno. Softened to: harness-runtime-may-vary; the script
   should use a runner-agnostic shebang or be invoked via the
   harness's available TS runtime; per-harness runtime audit
   is part of the implementation when this row ships.

2. Why-P1 said "pre-commit hook is ~50 lines of shell" but the
   revised section 1 design is TS, not shell. Updated to
   "harness pre-tool-use hook is ~30 lines of TypeScript."

The third reviewer thread (last_updated stale at 2026-05-04) was
based on a pre-rebase snapshot; the file already shows
last_updated: 2026-05-05 from commit 6186503.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@AceHack AceHack merged commit 113151d into main May 5, 2026
22 checks passed
@AceHack AceHack deleted the backlog/B-0191-orchestrator-branch-verify-mechanization-design-aaron-2026-05-04 branch May 5, 2026 04:48
AceHack added a commit that referenced this pull request May 5, 2026
…tion cleanup (#1584)

Five PRs landed in the 45min window since 04:00Z:
  #1571 B-0191 revised (harness-hooks not git-hooks)
  #1580 3 May 2026 orphan feedback files indexed
  #1581 CLAUDE.md razor-cadence wake-time pointer
  #1582 falsifiability-catch + BP EP kernel + MDL two-part code
  #1583 B-0006 tier-49 (36 entries compressed)

Load-bearing item is Aaron's forwarded Claude.ai diagnosis catching
the Pascal's-wager-inverted-into-engineering unfalsifiable bundling
pattern in PR #1574. The architectural answer (BP EP kernel + MDL
two-part code) and the recalibration sequence (memory unfiltered,
audit at promotion boundary) preserved verbatim in PR #1582.

The dialectical-unfalsifiability razor extension (PR #1577) gets its
first worked-example validation here -- Test 2 was filed in
anticipation of the failure mode, the failure mode fired hours later,
the diagnosis landed.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 5, 2026
…ementation) (#1585)

Implements the verify-branch harness pre-tool-use hook designed in
B-0191 (PR #1571 merged). Single TypeScript file under
tools/orchestrator-checks/ with unit tests.

Behavior:
- If ZETA_EXPECTED_BRANCH is set and doesn't match `git branch
  --show-current`: print error to stderr, exit 1 (blocks commit
  when wired as a pre-tool-use hook on `git commit` Bash invocations)
- If ZETA_EXPECTED_BRANCH is unset and current branch matches the
  worktree-suffix pattern: print INFO warning to stderr, exit 0
  (informational only -- doesn't block, just nudges)
- Otherwise: silent exit 0

Composes with:
- memory/feedback_orchestrator_pre_commit_verify_branch_rule_aaron_2026_05_04.md
  (the manual discipline this mechanizes)
- memory/feedback_dst_justifies_ts_quality_over_bash_and_harness_hooks_suffice_no_git_hooks_aaron_2026_05_03.md
  (TS-over-bash + harness-hooks-suffice; runs under bun, no git
  hooks needed)
- memory/feedback_parallel_subagent_concurrency_lessons_cluster_aaron_2026_05_04.md
  (the orchestrator-CWD-bleed-over hazard this catches)

Test plan covers all four behavior branches (no expectation, match,
mismatch, worktree-warning). All 4 tests pass; 9 expect() calls.

This closes B-0191 acceptance criterion #1 (harness pre-tool-use
hook script exists) and #4 (test exists). Remaining acceptance
criteria #2 (.claude/settings.json wiring) and #3 (CLAUDE.md
documentation pointer) are separate follow-up PRs since they touch
different files / surfaces.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.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.

2 participants