chore: activate worktree PR review flow [t_7c5ff17b] #1

Merged
hermes merged 3 commits from kanban/t_7c5ff17b-worktree-pr-cutover into main 2026-09-09 09:04:50 +00:00
Owner

Kanban-Board: multi-alt
Kanban-Task: t_7c5ff17b

Goal and scope

Activate the mandatory per-task worktree → Forgejo PR → independent review/merge lifecycle for unfinished multi-alt cards. Preserve the audited pre-worktree baseline and operational state on migration reruns.

Changed files

  • docs/WORKFLOW.md — mandatory worktree, PR, independent review and squash-merge policy.
  • kanban/migrate_worktree_pr.py — one-time idempotent unfinished-card migration and durable migration boundary.
  • kanban/tests/test_worktree_pr_workflow.py — copied-board blocked/review/running preservation and exact marker regressions, including split-line rejection.
  • kanban/webhooks/multi-alt-review-dispatch.py — allowlisted PR event filter with exact same-line Board and Task markers.
  • kanban/webhooks/multi-alt-review-nudge.py — duplicate-safe review dispatcher nudge.

Verification at exact head

Head: 35c96fa0c1bf7158ee4f4df9270061f6d91dec5d

  • python3 -m unittest discover -s kanban/tests -v — 2/2 passed.
  • python3 -m py_compile kanban/migrate_worktree_pr.py kanban/webhooks/multi-alt-review-dispatch.py kanban/webhooks/multi-alt-review-nudge.py — passed.
  • /tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig fmt --check build.zig src tests profiles — passed with Zig 0.16.0.
  • /tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig build test --summary all — 17/17 steps, 59/59 tests passed.
  • /tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig build test -Doptimize=ReleaseSafe --summary all — 17/17 steps, 59/59 tests passed.
  • /tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig build -Doptimize=ReleaseSafe --summary all — 19/19 steps passed.
  • git diff --check — passed.
  • Versioned and deployed multi-alt-review-dispatch.py SHA-256 are both 401ac0e0fdad029dbc8d7061a392fb0cf161206365b236e488cb7b13b6f7cc19.
  • Exact-head Forgejo statuses: none; Actions runs: 0.

Compatibility and provenance

This is orchestration glue only; it does not change package-origin, RPM/APT, artifact, installer, or stable-promotion semantics. Every migrated card retains repository, branch, worktree and review provenance through its durable migration event.

Residual risk and rollback

Forgejo does not permit the PR owner to submit a formal REQUEST_CHANGES review, so the independent reviewer records a clearly labelled COMMENT verdict before the Kanban transition. The gateway dispatcher remains paused during cutover. Rollback is to revert this PR and restore the preserved Kanban DB/profile configuration from the pre-cutover backup/ZFS snapshot; no stable artifacts are published by this change.

Kanban-Board: multi-alt Kanban-Task: t_7c5ff17b ## Goal and scope Activate the mandatory per-task worktree → Forgejo PR → independent review/merge lifecycle for unfinished multi-alt cards. Preserve the audited pre-worktree baseline and operational state on migration reruns. ## Changed files - `docs/WORKFLOW.md` — mandatory worktree, PR, independent review and squash-merge policy. - `kanban/migrate_worktree_pr.py` — one-time idempotent unfinished-card migration and durable migration boundary. - `kanban/tests/test_worktree_pr_workflow.py` — copied-board blocked/review/running preservation and exact marker regressions, including split-line rejection. - `kanban/webhooks/multi-alt-review-dispatch.py` — allowlisted PR event filter with exact same-line Board and Task markers. - `kanban/webhooks/multi-alt-review-nudge.py` — duplicate-safe review dispatcher nudge. ## Verification at exact head Head: `35c96fa0c1bf7158ee4f4df9270061f6d91dec5d` - `python3 -m unittest discover -s kanban/tests -v` — 2/2 passed. - `python3 -m py_compile kanban/migrate_worktree_pr.py kanban/webhooks/multi-alt-review-dispatch.py kanban/webhooks/multi-alt-review-nudge.py` — passed. - `/tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig fmt --check build.zig src tests profiles` — passed with Zig 0.16.0. - `/tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig build test --summary all` — 17/17 steps, 59/59 tests passed. - `/tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig build test -Doptimize=ReleaseSafe --summary all` — 17/17 steps, 59/59 tests passed. - `/tmp/zig-toolchain/zig-x86_64-linux-0.16.0/zig build -Doptimize=ReleaseSafe --summary all` — 19/19 steps passed. - `git diff --check` — passed. - Versioned and deployed `multi-alt-review-dispatch.py` SHA-256 are both `401ac0e0fdad029dbc8d7061a392fb0cf161206365b236e488cb7b13b6f7cc19`. - Exact-head Forgejo statuses: none; Actions runs: 0. ## Compatibility and provenance This is orchestration glue only; it does not change package-origin, RPM/APT, artifact, installer, or stable-promotion semantics. Every migrated card retains repository, branch, worktree and review provenance through its durable migration event. ## Residual risk and rollback Forgejo does not permit the PR owner to submit a formal `REQUEST_CHANGES` review, so the independent reviewer records a clearly labelled COMMENT verdict before the Kanban transition. The gateway dispatcher remains paused during cutover. Rollback is to revert this PR and restore the preserved Kanban DB/profile configuration from the pre-cutover backup/ZFS snapshot; no stable artifacts are published by this change.
hermes left a comment

Review verdict: REQUEST CHANGES

Reviewed exact head 2fbc58942fb5b23c689122caac2ffc567d24a747 against main (613b33213047782414669c2d45447a5213a62f7c). Two blocking correctness/contract defects remain.

1. Migration is not safe to rerun

kanban/migrate_worktree_pr.py:59-64,95-121 selects every non-done card on every invocation and unconditionally rewrites operational state to todo, clears claim/run/session/block/failure fields, and recomputes the worker assignment from the current unfinished-card ordering. In an isolated copy of the real board, changing t_023b0788 to blocked / needs_input and rerunning the advertised idempotent migration changed it to todo and erased the blocker and diagnostic. A later accidental rerun can therefore silently unblock gated work, terminate review/rework provenance, or change ownership.

Required: make already-migrated cards a true no-op (for example, use the migration event/cutover state as a guard), preserve post-cutover blocked/running/review state, and add an isolated regression test proving reruns do not mutate already-migrated cards.

2. Webhook accepts PRs without the mandatory board marker

The deployed filter /root/.hermes/profiles/webhook/scripts/multi-alt-review-dispatch.py:19,40-49 validates only Kanban-Task. A synthetic allowed-repo/main/kanban payload containing Kanban-Task: t_023b0788 but no Kanban-Board: multi-alt still invoked both the Kanban comment and review-nudge paths. This contradicts the mandatory two-marker contract and the PR claim that exact handoff metadata is enforced.

Required: require an anchored exact Kanban-Board: multi-alt line, reject missing/wrong/duplicate board markers, and add a regression test for these cases. Keep the deployed filter and its reviewable source in sync.

Checks that passed

  • PR repo/base/branch/task markers and exact head match.
  • Full 2-file diff reviewed; primary checkout and author worktree are clean.
  • Live board read-back: 57 cards, 57 cutover links/events, 57 unique branches, split worker-a 29 / worker-b 28, repository split multi-alt 51 / crucible 6.
  • Copy-based immediate rerun produced identical output/state before simulated post-cutover changes.
  • python3 -m py_compile, git diff --check, and Zig 0.16.0 fmt --check passed.
  • Zig 0.16.0 zig build test --summary all: 17/17 steps, 59/59 tests.
  • ReleaseSafe build: 19/19 steps.
  • Profiles, baseline tag, hooks, and main protection were read back.
  • Forgejo reports no commit statuses or Actions runs for this exact head; no stale CI result was accepted.
## Review verdict: REQUEST CHANGES Reviewed exact head `2fbc58942fb5b23c689122caac2ffc567d24a747` against `main` (`613b33213047782414669c2d45447a5213a62f7c`). Two blocking correctness/contract defects remain. ### 1. Migration is not safe to rerun `kanban/migrate_worktree_pr.py:59-64,95-121` selects every non-done card on every invocation and unconditionally rewrites operational state to `todo`, clears claim/run/session/block/failure fields, and recomputes the worker assignment from the current unfinished-card ordering. In an isolated copy of the real board, changing `t_023b0788` to `blocked` / `needs_input` and rerunning the advertised idempotent migration changed it to `todo` and erased the blocker and diagnostic. A later accidental rerun can therefore silently unblock gated work, terminate review/rework provenance, or change ownership. Required: make already-migrated cards a true no-op (for example, use the migration event/cutover state as a guard), preserve post-cutover `blocked`/`running`/`review` state, and add an isolated regression test proving reruns do not mutate already-migrated cards. ### 2. Webhook accepts PRs without the mandatory board marker The deployed filter `/root/.hermes/profiles/webhook/scripts/multi-alt-review-dispatch.py:19,40-49` validates only `Kanban-Task`. A synthetic allowed-repo/main/kanban payload containing `Kanban-Task: t_023b0788` but no `Kanban-Board: multi-alt` still invoked both the Kanban comment and review-nudge paths. This contradicts the mandatory two-marker contract and the PR claim that exact handoff metadata is enforced. Required: require an anchored exact `Kanban-Board: multi-alt` line, reject missing/wrong/duplicate board markers, and add a regression test for these cases. Keep the deployed filter and its reviewable source in sync. ### Checks that passed - PR repo/base/branch/task markers and exact head match. - Full 2-file diff reviewed; primary checkout and author worktree are clean. - Live board read-back: 57 cards, 57 cutover links/events, 57 unique branches, split worker-a 29 / worker-b 28, repository split multi-alt 51 / crucible 6. - Copy-based immediate rerun produced identical output/state before simulated post-cutover changes. - `python3 -m py_compile`, `git diff --check`, and Zig 0.16.0 `fmt --check` passed. - Zig 0.16.0 `zig build test --summary all`: 17/17 steps, 59/59 tests. - ReleaseSafe build: 19/19 steps. - Profiles, baseline tag, hooks, and main protection were read back. - Forgejo reports no commit statuses or Actions runs for this exact head; no stale CI result was accepted.
hermes left a comment

REQUEST CHANGES — review round 2 at exact head a60e1534884ff124d8ebfc5c9d4a3c9fee1da81e

Blocking findings:

  1. kanban/webhooks/multi-alt-review-dispatch.py:19-20 does not enforce exact single-line PR markers. Both regexes use \s*, which includes newlines. Independent execution showed that Kanban-Board:\nmulti-alt and Kanban-Task:\nt_023b0788 each still invoke both the comment and nudge subprocesses. These are not the exact anchored markers required by the workflow and by the prior change request. Restrict whitespace to horizontal whitespace on the same line (or parse lines exactly) and add regression cases for split-line markers. Keep deployed and versioned copies byte-identical.

  2. kanban/tests/test_worktree_pr_workflow.py:30-76 only persists one blocked card. The prior requested regression explicitly required copied-DB coverage for blocked, review, and running operational state. Independent copied-DB execution confirms the implementation currently preserves all three, but that contract is not encoded in the submitted regression. Add distinct review/running cases so future changes cannot regress them silently.

Verified passing at this head: exact PR/base/branch/body markers; full 5-file diff; Python 2/2 tests and py_compile; migration preservation in an independent copied DB for blocked/review/running; Zig 0.16.0 fmt, 59/59 tests, ReleaseSafe 19/19; 57/57 board mappings and unique branches; profile configuration; deployed webhook SHA-256 equality; protected main plus active PR hooks in all five repositories. Forgejo reports no commit statuses or Actions runs for this exact head.

REQUEST CHANGES — review round 2 at exact head `a60e1534884ff124d8ebfc5c9d4a3c9fee1da81e` Blocking findings: 1. `kanban/webhooks/multi-alt-review-dispatch.py:19-20` does not enforce exact single-line PR markers. Both regexes use `\s*`, which includes newlines. Independent execution showed that `Kanban-Board:\nmulti-alt` and `Kanban-Task:\nt_023b0788` each still invoke both the comment and nudge subprocesses. These are not the exact anchored markers required by the workflow and by the prior change request. Restrict whitespace to horizontal whitespace on the same line (or parse lines exactly) and add regression cases for split-line markers. Keep deployed and versioned copies byte-identical. 2. `kanban/tests/test_worktree_pr_workflow.py:30-76` only persists one `blocked` card. The prior requested regression explicitly required copied-DB coverage for `blocked`, `review`, and `running` operational state. Independent copied-DB execution confirms the implementation currently preserves all three, but that contract is not encoded in the submitted regression. Add distinct review/running cases so future changes cannot regress them silently. Verified passing at this head: exact PR/base/branch/body markers; full 5-file diff; Python 2/2 tests and py_compile; migration preservation in an independent copied DB for blocked/review/running; Zig 0.16.0 fmt, 59/59 tests, ReleaseSafe 19/19; 57/57 board mappings and unique branches; profile configuration; deployed webhook SHA-256 equality; protected `main` plus active PR hooks in all five repositories. Forgejo reports no commit statuses or Actions runs for this exact head.
hermes left a comment

APPROVED — independent review of exact head 35c96fa0c1bf7158ee4f4df9270061f6d91dec5d

Contract audit completed after two change-request rounds. The migration is a no-op for already migrated cards and copied-DB regressions preserve blocked, review, and running operational state. PR webhook markers are exact, unique, same-line Kanban-Board: multi-alt and Kanban-Task: t_<8 hex> values; missing, wrong, duplicate, and split-line markers are rejected. Versioned/deployed dispatch and nudge scripts are byte-identical.

Independent verification:

  • complete Forgejo diff matches local origin/main...HEAD; 5 changed files, no whitespace errors;
  • Python unit tests 2/2 and py_compile passed;
  • Zig 0.16.0 format, 59/59 Debug tests, 59/59 ReleaseSafe tests, and 19/19 ReleaseSafe build steps passed;
  • all 57 migrated child cards were inspected with durable repository/worktree/branch/reviewer provenance;
  • backup manifest SHA256SUMS verifies all repository bundles/patches and the pre-cutover Kanban DB;
  • main protection and active review webhook are present in all five allowed repositories;
  • exact-head Forgejo status and Actions APIs are available and report no statuses/runs (no stale CI success was used).

Residual risk: Forgejo uses the same hermes identity for PR ownership and review, so it may reject formal self-approval; in that case this COMMENT is the clearly labelled approval evidence. Stable artifact promotion remains excluded and requires the separate human gate.

APPROVED — independent review of exact head `35c96fa0c1bf7158ee4f4df9270061f6d91dec5d` Contract audit completed after two change-request rounds. The migration is a no-op for already migrated cards and copied-DB regressions preserve blocked, review, and running operational state. PR webhook markers are exact, unique, same-line `Kanban-Board: multi-alt` and `Kanban-Task: t_<8 hex>` values; missing, wrong, duplicate, and split-line markers are rejected. Versioned/deployed dispatch and nudge scripts are byte-identical. Independent verification: - complete Forgejo diff matches local `origin/main...HEAD`; 5 changed files, no whitespace errors; - Python unit tests 2/2 and `py_compile` passed; - Zig 0.16.0 format, 59/59 Debug tests, 59/59 ReleaseSafe tests, and 19/19 ReleaseSafe build steps passed; - all 57 migrated child cards were inspected with durable repository/worktree/branch/reviewer provenance; - backup manifest `SHA256SUMS` verifies all repository bundles/patches and the pre-cutover Kanban DB; - `main` protection and active review webhook are present in all five allowed repositories; - exact-head Forgejo status and Actions APIs are available and report no statuses/runs (no stale CI success was used). Residual risk: Forgejo uses the same `hermes` identity for PR ownership and review, so it may reject formal self-approval; in that case this COMMENT is the clearly labelled approval evidence. Stable artifact promotion remains excluded and requires the separate human gate.
hermes merged commit 0ef62010c5 into main 2026-09-09 09:04:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hermes/multi-alt!1
No description provided.