feat(gitea-plan,implement-slice,gitea-pr): standardize 5-column Kanban reconciliation and card transitions

- gt-usage: add verified gt api recipes for --template none board creation,
  column listing, POST creation, in-place PATCH reconciliation (title, hex
  color, sorting), default column assignment, and card moving.
- gitea-plan: standardize the 5-column pipeline (Backlog #475569, Ready
  #1d76db, Work in Progress #d97706, Review #6d28d9, Completed #15803d),
  non-destructive in-place column reconciliation by semantic role aliases,
  and pinning the resolved column_id map in AGENTS.md.
- implement-slice: own Backlog -> Ready during Step 1 preflight readiness
  reconciliation (when not --dry-run), Ready -> Work in Progress at Step 4
  worker delegation, and Work in Progress -> Review at Step 7 final-HEAD
  gate (plus Review -> Completed when direct merge applies).
- gitea-pr: ensure linked issue card sits in Review on PR creation/review
  and move Review -> Completed once the human owner authorizes gt pr merge.
- code-review: keep strictly read-only, delegating board mutations to
  implement-slice and gitea-pr.
- tests: add test_project_board_reconciliation_and_card_transitions.
This commit is contained in:
kiskaadee committed 2026-11-15 15:36:35 -05:00
1 parent c14fecc8f7
commit 6bddfd9737
10 files changed
+131 -39

No files matched your search

@@ -96,7 +96,7 @@ systemctl reload app-daemon.service && systemctl is-active --quiet app-daemon.se
## 4. PR Comment Block (Drafted Here, Published by `gitea-pr`) ## 4. PR Comment Block (Drafted Here, Published by `gitea-pr`)
When the review target is an open pull request, `code-review` also drafts a PR comment block so the findings stay attached to the change they describe. `code-review` never posts it: it hands the block to `gitea-pr`, which publishes it after the human owner approves. When the review target is an open pull request, `code-review` also drafts a PR comment block so the findings stay attached to the change they describe. `code-review` never posts it and never mutates Gitea project boards: it hands the block to `gitea-pr` (or `implement-slice`), which publishes the review and ensures the issue card sits in `Review` when the verdict is `Ready`.
### What goes in ### What goes in
- Every finding except `Rejected` ones (those stay in the local ledger only). - Every finding except `Rejected` ones (those stay in the local ledger only).
+9 -6
View File
@@ -34,19 +34,22 @@ description: >-
audit disposition. Stop for approval before mutating Gitea entities or `AGENTS.md`. audit disposition. Stop for approval before mutating Gitea entities or `AGENTS.md`.
6. **Execute Gitea operations via `gt` CLI.** Use verified commands from `gt-usage`: 6. **Execute Gitea operations via `gt` CLI.** Use verified commands from `gt-usage`:
- Milestones: `gt milestone create "<title>" -d "<desc>" --json id,url`. - Milestones: `gt milestone create "<title>" -d "<desc>" --json id,url`.
- Projects: `gt project create "<title>" --template basic_kanban --json id,url` - Projects: create with `gt project create "<title>" --template none --json id,url` if
(for multi-repo orgs, root at org level with `--org <org>`). missing (with `--org <org>` for multi-repo orgs), or reconcile an existing board in
- Issues: `gt issue create -t "<title>" -F <file> -m <id> -p <id> --json number,url` place (`PATCH` matched role aliases, `POST` missing columns, set `Backlog` default,
and apply the Deep Signal hex colors per [decomposition-tiers](references/decomposition-tiers.md)).
- Issues: `gt issue create -t "<title>" -F <file> -m <id> -p <id> --json id,number,url`
(or attach to org board: `gt issue edit <number> -R <repo> --add-project <id>`). (or attach to org board: `gt issue edit <number> -R <repo> --add-project <id>`).
Extract server IDs directly; never guess sequence numbers or construct `/milestone/1`. Extract server IDs directly; never guess sequence numbers or construct `/milestone/1`.
7. **Verify created state.** Inspect `gt issue list` and `gt milestone list` to 7. **Verify created state.** Inspect `gt issue list`, `gt milestone list`, and board
confirm server IDs, board cards, and non-hallucinated canonical URLs. columns to confirm server IDs, column colors/order, and non-hallucinated canonical URLs.
8. **Formalize repo planning contract in `AGENTS.md`.** When establishing or changing 8. **Formalize repo planning contract in `AGENTS.md`.** When establishing or changing
`Medium`/`Large` planning structure, record or reconcile a concise sync rule in the `Medium`/`Large` planning structure, record or reconcile a concise sync rule in the
repository's `AGENTS.md` so day-to-day coding agents keep trackers updated without repository's `AGENTS.md` so day-to-day coding agents keep trackers updated without
reloading `gitea-plan`: reloading `gitea-plan`:
- Pin **stable structural coordinates only**: canonical roadmap/checklist paths - Pin **stable structural coordinates only**: canonical roadmap/checklist paths
(e.g., `docs/roadmap.md`, `todo.txt`), authoritative Gitea repo + Project Board ID, (e.g., `docs/roadmap.md`, `todo.txt`), authoritative Gitea repo + Project Board ID
+ `{Backlog, Ready, Work in Progress, Review, Completed -> column_id}` map,
remote mirror policy (e.g., GitHub code-only), and the escalation trigger to remote mirror policy (e.g., GitHub code-only), and the escalation trigger to
re-run `gitea-plan` on scope shifts or epic Readiness Gates. re-run `gitea-plan` on scope shifts or epic Readiness Gates.
- **Never** hardcode rotating sprint state (active milestone numbers or open issue - **Never** hardcode rotating sprint state (active milestone numbers or open issue
@@ -14,13 +14,28 @@ Reference for `gitea-plan`. Guidelines for scaling planning ceremony to risk and
Each Gitea planning primitive tracks a distinct dimension of engineering reality: Each Gitea planning primitive tracks a distinct dimension of engineering reality:
- **Issue State (`Open` vs. `Closed`)**: Deliverable completion on `main`. - **Issue State (`Open` vs. `Closed`)**: Deliverable completion on `main`.
- **Board State (Columns: *Backlog*, *Ready*, *In Progress*, *Review*, *Done*)**: Spatial workflow stage in the active pipeline. - **Board State (Columns: *Backlog*, *Ready*, *Work in Progress*, *Review*, *Completed*)**: Spatial workflow stage in the active pipeline.
- **Milestone**: Strategic delivery horizon (capacity-driven or time-bounded release boundary). - **Milestone**: Strategic delivery horizon (capacity-driven or time-bounded release boundary).
### Canonical 5-Column Pipeline & Semantic Colors (Deep Signal Palette)
| Sorting | Canonical Title | Role Aliases (Matched Case-Insensitively) | Hex Color | Default | Transition Owner |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `0` | **Backlog** | `backlog`, `to-do`, `todo`, `icebox`, `triage` | `#475569` (Slate Gray) | `true` | `gitea-plan` (default placement for dependent issues) |
| `1` | **Ready** | `ready`, `next`, `up next`, `queued`, `groomed` | `#1d76db` (Signal Blue) | `false` | `implement-slice` (Step 1 preflight readiness check) |
| `2` | **Work in Progress** | `work in progress`, `in progress`, `wip`, `doing`, `active` | `#d97706` (Warm Amber) | `false` | `implement-slice` (Step 4 worker start) |
| `3` | **Review** | `review`, `in review`, `qa`, `testing`, `verification` | `#6d28d9` (Royal Purple) | `false` | `implement-slice` (Step 7 final-HEAD pass) / `gitea-pr` |
| `4` | **Completed** | `completed`, `done`, `closed`, `shipped` | `#15803d` (Forest Green) | `false` | `gitea-pr` (on owner-authorized merge) / `implement-slice` |
### Board Provisioning & Non-Destructive Reconciliation (`gitea-plan`)
1. **Create if missing**: When `Project Board Policy` is `Recommended` or `Required` and no open board exists, create one with `gt project create "<title>" --template none -d "<desc>" --json id,title,url`, then `POST` the 5 canonical columns (`sorting: 0..4`) with their Deep Signal hex colors and set `Backlog` as `default: true` (using the recipes in `gt-usage`).
2. **Reconcile in place if existing**: Never assume an existing board already adheres to the convention, and never delete columns that hold cards. Query `/projects/<id>/columns`, match existing columns to the 5 roles by their case-insensitive aliases, and `PATCH` matched columns in place (`title`, `color`, `sorting`) so attached cards stay intact. Create only the missing canonical columns via `POST`, and ensure `Backlog` is marked `default: true`.
3. **Pin column IDs in `AGENTS.md`**: Record the resolved Project Board ID and `{Backlog, Ready, Work in Progress, Review, Completed -> column_id}` map in the repository's `AGENTS.md` planning contract so `implement-slice` and `gitea-pr` move cards without guessing names.
### Meaningful Conflict Reconciliation ### Meaningful Conflict Reconciliation
Never mechanically mirror or silently mutate state. Instead, detect and report semantic conflicts: Never mechanically mirror or silently mutate state. Instead, detect and report semantic conflicts:
- **Zombie In-Progress**: Issue is closed on Gitea, but its card still sits in *Backlog*, *Ready*, or *In Progress* on the board. - **Zombie In-Progress**: Issue or PR is closed on Gitea, but its card still sits in *Backlog*, *Ready*, *Work in Progress*, or *Review* on the board.
- **Premature Done**: Card is moved to *Done*, but the issue remains open or lacks a merged PR / commit on `main`. - **Premature Completed**: Card is moved to *Completed*, but the issue remains open or lacks a merged PR / commit on `main`.
- **Review Orphan**: Card sits in *Review*, but no active PR or static review packet exists. - **Review Orphan**: Card sits in *Review*, but no active PR or static review packet exists.
- **Horizon Divergence**: Open issue is assigned to a milestone that is closed or diverges from the active milestone in `ROADMAP.md`. - **Horizon Divergence**: Open issue is assigned to a milestone that is closed or diverges from the active milestone in `ROADMAP.md`.
@@ -31,7 +46,7 @@ Never mechanically mirror or silently mutate state. Instead, detect and report s
| Tier | Typical Work | Gitea Primitives | Project Board Policy | Decomposition Rule | | Tier | Typical Work | Gitea Primitives | Project Board Policy | Decomposition Rule |
| :--- | :--- | :--- | :--- | :--- | | :--- | :--- | :--- | :--- | :--- |
| **Small** | Single-step bugfix, documentation tweak, dependency bump, routine chore | 1 Issue linked directly to 1 PR / Commit | **Omitted by Policy** (issue tracker suffices) | Zero milestones. Zero project boards. Keep description concise (Context, Solution, Acceptance Criteria). | | **Small** | Single-step bugfix, documentation tweak, dependency bump, routine chore | 1 Issue linked directly to 1 PR / Commit | **Omitted by Policy** (issue tracker suffices) | Zero milestones. Zero project boards. Keep description concise (Context, Solution, Acceptance Criteria). |
| **Medium** | Vertical feature slice, multi-step refactor, performance spike (2 to 5 issues) | 1 Milestone + 2 to 5 Issues | **Recommended** (Basic Kanban: *Backlog*, *Ready*, *In Progress*, *Review*, *Done*) | Each issue has its own branch and PR. All issues include explicit numbered acceptance criteria and test seams. | | **Medium** | Vertical feature slice, multi-step refactor, performance spike (2 to 5 issues) | 1 Milestone + 2 to 5 Issues | **Recommended** (5-column Kanban: *Backlog*, *Ready*, *Work in Progress*, *Review*, *Completed*) | Each issue has its own branch and PR. All issues include explicit numbered acceptance criteria and test seams. |
| **Large** | Architectural epic, platform cutover, multi-service evolution | Roadmap Doc + Rolling Milestones + Deliverable Issues | **Required** (Board coordinates rolling horizons) | Source of truth remains in repo docs (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs). Gitea coordinates rolling execution. | | **Large** | Architectural epic, platform cutover, multi-service evolution | Roadmap Doc + Rolling Milestones + Deliverable Issues | **Required** (Board coordinates rolling horizons) | Source of truth remains in repo docs (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs). Gitea coordinates rolling execution. |
**Deterministic Output Header**: Every planning proposal must explicitly state: **Deterministic Output Header**: Every planning proposal must explicitly state:
@@ -77,6 +92,6 @@ When planning large epics, avoid waterfall decomposition where every future task
## 6. Multi-Repository Organizations and Shared Boards ## 6. Multi-Repository Organizations and Shared Boards
When planning across multi-repository architectures (where an organization hub coordinates multiple deliverable repositories or services): When planning across multi-repository architectures (where an organization hub coordinates multiple deliverable repositories or services):
- **Root Kanban at Organization Level**: Create the shared board at the organization level (`gt project create "<title>" --org <org> --template basic_kanban`). Do not isolate tracking into separate child repository boards. - **Root Kanban at Organization Level**: Create the shared board at the organization level (`gt project create "<title>" --org <org> --template none`) and reconcile the 5 canonical columns. Do not isolate tracking into separate child repository boards.
- **Attach Child Issues to Org Board**: Deliverable issues and pull requests created in child repositories attach to the organization board via `gt issue create ... -p <project-id>` or `gt issue edit <number> -R <owner/repo> --add-project <project-id>`. - **Attach Child Issues to Org Board**: Deliverable issues and pull requests created in child repositories attach to the organization board via `gt issue create ... -p <project-id>` or `gt issue edit <number> -R <owner/repo> --add-project <project-id>`.
- **Hub Documentation Alignment**: Architectural strategy, shared documentation, and roadmaps remain centralized in the hub repository, while the organization-level Kanban board coordinates unified cross-repo delivery status. - **Hub Documentation Alignment**: Architectural strategy, shared documentation, and roadmaps remain centralized in the hub repository, while the organization-level Kanban board coordinates unified cross-repo delivery status.
+9 -7
View File
@@ -38,21 +38,23 @@ description: >-
4. **Present for human approval.** Present proposed title, target base branch, milestone, 4. **Present for human approval.** Present proposed title, target base branch, milestone,
and description body to the user per `profile/AGENTS.md`. Stop for confirmation before and description body to the user per `profile/AGENTS.md`. Stop for confirmation before
creating or editing the pull request. creating or editing the pull request.
5. **Create or update pull request via `gt pr`.** Run verified commands from 5. **Create or update pull request via `gt pr` and move card to `Review`.** Run verified
[references/gt-pulls.md](references/gt-pulls.md): commands from [references/gt-pulls.md](references/gt-pulls.md):
`gt pr create -t "<title>" -B "<base>" -H "<branch>" -F <body-file> --json number,url`. `gt pr create -t "<title>" -B "<base>" -H "<branch>" -F <body-file> --json number,url`.
Pass `--draft` if work remains in progress. Extract verified PR number and URL. Pass `--draft` if work remains in progress. Extract verified PR number and URL, and ensure
the linked issue card is in `Review` (`Work in Progress -> Review`) on the project board.
6. **Publish review findings (when a `code-review` comment block exists).** Follow 6. **Publish review findings (when a `code-review` comment block exists).** Follow
[references/gt-pulls.md](references/gt-pulls.md) section 3: confirm the remote PR head equals [references/gt-pulls.md](references/gt-pulls.md) section 3: confirm the remote PR head equals
the reviewed head SHA (else stop and re-run `code-review`), confirm no pending review and no the reviewed head SHA (else stop and re-run `code-review`), confirm no pending review and no
prior review for that SHA exists, show the body and inline list for approval, then post one prior review for that SHA exists, show the body and inline list for approval, then post one
`--comment` review pinned with `--commit`. Never `--approve` or `--request-changes`. Findings `--comment` review pinned with `--commit`. Never `--approve` or `--request-changes`. Findings
routed `issue` get their issue (via `gitea-plan`) before posting so the comment links to it. routed `issue` get their issue (via `gitea-plan`) before posting so the comment links to it.
7. **Track review feedback and merge readiness.** Inspect status checks (`gt pr checks <number>`), 7. **Track review feedback, merge on owner approval, and move card `Review -> Completed`.**
mergeability (`gt pr view <number> --json mergeable,review_decision`), and review comments Inspect status checks (`gt pr checks <number>`), mergeability
(`gt pr view <number> --json mergeable,review_decision`), and review comments
(`gt pr review comments <number>`). When all checks pass and review feedback is resolved, (`gt pr review comments <number>`). When all checks pass and review feedback is resolved,
report `Ready for Merge`. report `Ready for Merge`. Never merge automatically: once the human owner explicitly
Release and merge authority belongs exclusively to the human owner: never merge automatically. authorizes merge, run `gt pr merge <number>` and move the linked issue card `Review -> Completed`.
## Your call ## Your call
- **PR title and description approval**: review and approve the draft PR content and issue linkage. - **PR title and description approval**: review and approve the draft PR content and issue linkage.
+7 -5
View File
@@ -119,12 +119,14 @@ gt pr close <number>
gt pr reopen <number> gt pr reopen <number>
``` ```
### Merge Pull Request (Requires Explicit Human Authorization) ### Merge Pull Request and Move Card `Review -> Completed` (Requires Explicit Human Authorization)
Release and merge authority belongs exclusively to the human owner. Release and merge authority belongs exclusively to the human owner. Once the owner explicitly approves merging:
```bash ```bash
# Fast-forward / merge commit # 1. Merge pull request (fast-forward / merge commit, or --squash --delete-branch)
gt pr merge <number> gt pr merge <number>
# Squash and merge # 2. Extract global issue ID of the linked issue and move its project board card to Completed
gt pr merge <number> --squash --delete-branch issue_global_id=$(gt issue view <issue-number> --json id -q .id)
gt api -X POST /repos/{owner}/{repo}/projects/<project-id>/issues/${issue_global_id}/move -F column_id=<completed-col-id>
``` ```
Do not attach the PR itself (`-p <project-id>`) as a duplicate board card when the linked issue is already on the board; if a PR card was attached separately, move it to `Completed` as well.
+2 -2
View File
@@ -13,8 +13,8 @@ Draft (WIP) -> Review -> Changes Requested -> Ready for Merge -> Merged
1. **Draft (WIP)**: PR opened early for visibility. In Gitea, prefixed with `WIP:` or flagged `--draft`. CI may run; reviews are informal. 1. **Draft (WIP)**: PR opened early for visibility. In Gitea, prefixed with `WIP:` or flagged `--draft`. CI may run; reviews are informal.
2. **Review**: Feature complete, working tree clean, static `code-review` and runtime `verify-slice` evidence packets attached. Ready for formal audit. 2. **Review**: Feature complete, working tree clean, static `code-review` and runtime `verify-slice` evidence packets attached. Ready for formal audit.
3. **Changes Requested**: Reviewer identified defects, missing tests, or security concerns. Agent addresses feedback, commits fixes via `git-manager`, and refreshes evidence. 3. **Changes Requested**: Reviewer identified defects, missing tests, or security concerns. Agent addresses feedback, commits fixes via `git-manager`, and refreshes evidence.
4. **Ready for Merge**: All review threads resolved, static review confirms `Ready`, runtime checks pass, and mergeability is green. 4. **Ready for Merge**: All review threads resolved, static review confirms `Ready`, runtime checks pass, and mergeability is green. Linked issue card sits in `Review`.
5. **Merged**: Merged into target base branch by the human owner. Associated issues are closed automatically by Gitea. 5. **Completed (Merged)**: After explicit authorization by the human owner, `gitea-pr` merges the PR into the target base branch (`gt pr merge <number>`), verifies Gitea auto-closed the linked issue (`Closes #<id>`), and moves the issue card `Review -> Completed` on the project board.
--- ---
+25 -10
View File
@@ -32,27 +32,42 @@ gt milestone view <id>
## 3. Project Boards ## 3. Project Boards
Projects provide spatial Kanban workflow stages. Projects provide spatial Kanban workflow stages (`Backlog`, `Ready`, `Work in Progress`, `Review`, `Completed`).
```bash ```bash
# Create repository project board with basic kanban columns # Create repository project board without default template columns (to provision canonical 5-column pipeline)
gt project create "<title>" --template basic_kanban -d "<description>" --json id,title,url gt project create "<title>" --template none -d "<description>" --json id,title,url
# Create organization-level project board # Create organization-level project board
gt project create "<title>" --org <org> --template basic_kanban -d "<description>" --json id,title,url gt project create "<title>" --org <org> --template none -d "<description>" --json id,title,url
# List open projects (repository or organization) # List open projects (repository or organization)
gt project list --json id,title,state,url gt project list --json id,title,state,url
gt project list --org <org> --json id,title,state,url gt project list --org <org> --json id,title,state,url
# View project cards and columns # View project details
gt project view <id> gt project view <id> --json id,title,state,url
gt project view <id> --org <org> gt project view <id> --org <org> --json id,title,state,url
# List board columns with IDs # List board columns with IDs, titles, sorting order, default flag, and hex colors
gt api /repos/{owner}/{repo}/projects/<project-id>/columns --jq '.[].id, .[].title' # (For org boards, replace /repos/{owner}/{repo} with /orgs/<org>)
gt api /repos/{owner}/{repo}/projects/<project-id>/columns --jq '.[] | {id, title, sorting, default, color}'
# Move issue card between columns (requires global issue ID, e.g. from `gt issue list --json id,number`) # Create a column with title and 6-digit hex color
gt api -X POST /repos/{owner}/{repo}/projects/<project-id>/columns \
-f title="<title>" -f color="#<RRGGBB>" --jq '{id, title, color, sorting}'
# Update an existing column in place (preserving attached cards)
gt api -X PATCH /repos/{owner}/{repo}/projects/<project-id>/columns/<column-id> \
-f title="<title>" -f color="#<RRGGBB>" -F sorting=<0..4> --jq '{id, title, color, sorting}'
# Mark a column as the default column for newly attached issues
gt api -X POST /repos/{owner}/{repo}/projects/<project-id>/columns/<column-id>/default
# List cards (issues/PRs) currently in a column
gt api /repos/{owner}/{repo}/projects/<project-id>/columns/<column-id>/issues --jq '.[] | {id, number, title, state}'
# Move issue card between columns (requires global issue ID from `gt issue view <number> --json id,number`)
gt api -X POST /repos/{owner}/{repo}/projects/<project-id>/issues/<global-issue-id>/move -F column_id=<target-col-id> gt api -X POST /repos/{owner}/{repo}/projects/<project-id>/issues/<global-issue-id>/move -F column_id=<target-col-id>
``` ```
+3 -3
View File
@@ -17,13 +17,13 @@ description: >-
- Not inside an already-delegated implementation worker task: follow the assigned worker contract (`tdd`, `git-manager`) without re-invoking `implement-slice`. - Not inside an already-delegated implementation worker task: follow the assigned worker contract (`tdd`, `git-manager`) without re-invoking `implement-slice`.
## Steps ## Steps
1. **Preflight branch check and read slice context.** Check session mode per `profile/AGENTS.md`. Classify working tree per [handoff-contracts](references/handoff-contracts.md) (`CLEAN_BASE`, `ADOPTABLE_DIFF`, `CONFLICTING_STATE`, `WRONG_BASE`). Stop on conflicts. Read target Gitea issue/milestone state via `gt issue`, `gt milestone`, direction docs (`ARCHITECTURE.md`, `ROADMAP.md`), and `git status --short`. Clarify ambiguous intent; hand off to `gitea-plan` if tracking issues must be created first. 1. **Preflight branch check, readiness audit, and `Backlog -> Ready`.** Check session mode per `profile/AGENTS.md`. Classify working tree per [handoff-contracts](references/handoff-contracts.md) (`CLEAN_BASE`, `ADOPTABLE_DIFF`, `CONFLICTING_STATE`, `WRONG_BASE`). Stop on conflicts. Read target Gitea issue/milestone/board state via `gt issue`, `gt milestone`, direction docs (`ARCHITECTURE.md`, `ROADMAP.md`, `AGENTS.md`), and `git status --short`. Reconcile issue acceptance criteria against current `HEAD` (updating the Gitea issue after owner approval if earlier slices shifted contracts) and, when `--dry-run` is not active, move the issue card `Backlog -> Ready` on the project board. Hand off to `gitea-plan` if tracking issues must be created first.
2. **Select orchestration topology (`complexity x risk`).** Combine planning size with assurance risk per [orchestration-tiers](references/orchestration-tiers.md). Keep pure-orchestrator invariants: retain plan, status, commit SHAs, QA dispositions, blockers; never edit implementation files, repair Git via code edits, self-certify QA, or ingest full test logs unless resolving a failure. 2. **Select orchestration topology (`complexity x risk`).** Combine planning size with assurance risk per [orchestration-tiers](references/orchestration-tiers.md). Keep pure-orchestrator invariants: retain plan, status, commit SHAs, QA dispositions, blockers; never edit implementation files, repair Git via code edits, self-certify QA, or ingest full test logs unless resolving a failure.
3. **Lock Planned Workflow and pre-committed rubrics.** Formulate the Planned Workflow using the Canonical Node Schema (5-tuples: `node_id`, `claim`, `method`, `executor`, `pass_condition`). Project a dynamic Mermaid diagram deriving directly from node IDs with visible rework edges. If `--dry-run` is active, halt after displaying the plan (enforce 0 file changes, 0 commits, 0 remote calls). Hard gate: pause for human approval. 3. **Lock Planned Workflow and pre-committed rubrics.** Formulate the Planned Workflow using the Canonical Node Schema (5-tuples: `node_id`, `claim`, `method`, `executor`, `pass_condition`). Project a dynamic Mermaid diagram deriving directly from node IDs with visible rework edges. If `--dry-run` is active, halt after displaying the plan (enforce 0 file changes, 0 commits, 0 remote calls). Hard gate: pause for human approval.
4. **Assign workspaces and delegate implementation.** Govern branch/worktree lifecycle through `git-manager` per [orchestration-tiers](references/orchestration-tiers.md). Dispatch worker subagent(s) with the Implementation Assignment in [handoff-contracts](references/handoff-contracts.md). Never run concurrent workers in the same working tree. Update the runtime Execution Record table as nodes change state. 4. **Move card `Ready -> Work in Progress`, assign workspaces, and delegate.** Once the human approves Step 3, move the issue card `Ready -> Work in Progress` on the project board per [handoff-contracts](references/handoff-contracts.md). Govern branch/worktree lifecycle through `git-manager` per [orchestration-tiers](references/orchestration-tiers.md). Dispatch worker subagent(s) with the Implementation Assignment in [handoff-contracts](references/handoff-contracts.md). Never run concurrent workers in the same working tree. Update the runtime Execution Record table as nodes change state.
5. **Audit worker reports and run rubric QA.** Verify worker reports via read-only Git checks. Spawn read-only QA subagents running `verify-slice` against pre-committed rubrics. Update Execution Record with concrete evidence (SHA, exit codes). 5. **Audit worker reports and run rubric QA.** Verify worker reports via read-only Git checks. Spawn read-only QA subagents running `verify-slice` against pre-committed rubrics. Update Execution Record with concrete evidence (SHA, exit codes).
6. **Triage outcomes and route rework.** Classify failures using [handoff-contracts](references/handoff-contracts.md): route code defects to existing worker via `send_message`; record justified rubric amendments if criteria change. Loop Steps 4-6 until all nodes pass. 6. **Triage outcomes and route rework.** Classify failures using [handoff-contracts](references/handoff-contracts.md): route code defects to existing worker via `send_message`; record justified rubric amendments if criteria change. Loop Steps 4-6 until all nodes pass.
7. **Enforce final-HEAD evidence, deviation report, and integrate.** Confirm `code-review` (`Ready`) and `verify-slice` match the exact final `HEAD` and base. Present the Execution Deviation Report (skipped/added checks, rework iterations, scope drift). Integrate per [orchestration-tiers](references/orchestration-tiers.md) Policy Matrix: fast-forward merge if repo `AGENTS.md` permits and user approves, else hand off to `gitea-pr`. 7. **Enforce final-HEAD evidence, move card `Work in Progress -> Review`, and integrate.** Confirm `code-review` (`Ready`) and `verify-slice` match the exact final `HEAD` and base, then move the issue card `Work in Progress -> Review` on the project board. Present the Execution Deviation Report (skipped/added checks, rework iterations, scope drift). Integrate per [orchestration-tiers](references/orchestration-tiers.md) Policy Matrix: fast-forward merge (and move card `Review -> Completed`) if repo `AGENTS.md` permits and user approves, else hand off to `gitea-pr`.
## Your call ## Your call
- **Session mode**: decide whether to switch from `learning` to `delivery` before autonomous delegation. - **Session mode**: decide whether to switch from `learning` to `delivery` before autonomous delegation.
@@ -131,3 +131,17 @@ Never relay "QA failed" blindly. Classify each non-passing outcome and route to
- **PR applies**: Once `code-review` (`Ready`) and `verify-slice` (zero unhandled `FAIL`) match final `HEAD`, hand off both packets to `gitea-pr` to draft the PR description, pause for human PR approval, create/update the PR, and report merge readiness. - **PR applies**: Once `code-review` (`Ready`) and `verify-slice` (zero unhandled `FAIL`) match final `HEAD`, hand off both packets to `gitea-pr` to draft the PR description, pause for human PR approval, create/update the PR, and report merge readiness.
- **No PR applies** (local repo, approved solo-branch workflow, or bounded spike): Enforce the identical final-`HEAD` evidence invariant, then present the commit range (`<base>..HEAD`), static review disposition, runtime verification ledger, and any open residual-risk decisions directly to the user. - **No PR applies** (local repo, approved solo-branch workflow, or bounded spike): Enforce the identical final-`HEAD` evidence invariant, then present the commit range (`<base>..HEAD`), static review disposition, runtime verification ledger, and any open residual-risk decisions directly to the user.
---
## 9. Project Board Card Transitions Owned by `implement-slice`
When the repository tracks a Gitea Project Board (resolved from the `AGENTS.md` planning contract or `gt project list`), `implement-slice` owns moving the target issue's card across the pipeline using the `gt-usage` move recipe (`POST /repos/{owner}/{repo}/projects/<project-id>/issues/<global-issue-id>/move -F column_id=<target-col-id>`):
| Step | Transition | Condition |
| :--- | :--- | :--- |
| **Step 1 (Preflight & Readiness)** | `Backlog -> Ready` | Blocking issues are closed, issue acceptance criteria are reconciled against current `HEAD` and `AGENTS.md`, and `--dry-run` is **not** active. |
| **Step 4 (Worker Delegation)** | `Ready -> Work in Progress` | Human owner approved the Step 3 Planned Workflow and implementation branch/worker starts. |
| **Step 7 (Final-HEAD Gate)** | `Work in Progress -> Review` | Final-`HEAD` `code-review` (`Ready`) and `verify-slice` pass with zero unhandled `FAIL` outcomes. |
| **Step 7 (Direct Merge Only)** | `Review -> Completed` | Only when repository policy permits direct fast-forward merge to `main`, human owner approves, and the issue is closed. Otherwise `gitea-pr` owns `Review -> Completed`. |
+41
View File
@@ -14,6 +14,7 @@ Verifies:
8. Strict dry-run zero-mutation invariants 8. Strict dry-run zero-mutation invariants
9. Skill inventory, line count (<= 80), em-dash absence, and path portability 9. Skill inventory, line count (<= 80), em-dash absence, and path portability
10. Review comment publishing ownership (code-review drafts, gitea-pr posts with guards) 10. Review comment publishing ownership (code-review drafts, gitea-pr posts with guards)
11. Project board 5-column reconciliation, semantic hex colors, and transition ownership
""" """
import os import os
@@ -387,6 +388,46 @@ class TestSkillsBehavioralContracts(unittest.TestCase):
self.assertLess(publish.index("head_sha"), publish.index(post_cmd)) self.assertLess(publish.index("head_sha"), publish.index(post_cmd))
self.assertLess(publish.index("gt pr review list"), publish.index(post_cmd)) self.assertLess(publish.index("gt pr review list"), publish.index(post_cmd))
def test_project_board_reconciliation_and_card_transitions(self):
"""Proves 5-column board reconciliation, Deep Signal colors, and card transition ownership."""
tiers_text = (REPO_ROOT / "skills" / "gitea-plan" / "references" / "decomposition-tiers.md").read_text()
gt_cmds = (REPO_ROOT / "skills" / "gt-usage" / "references" / "commands.md").read_text()
impl_skill = (REPO_ROOT / "skills" / "implement-slice" / "SKILL.md").read_text()
impl_handoff = (REPO_ROOT / "skills" / "implement-slice" / "references" / "handoff-contracts.md").read_text()
pr_skill = (REPO_ROOT / "skills" / "gitea-pr" / "SKILL.md").read_text()
pr_pulls = (REPO_ROOT / "skills" / "gitea-pr" / "references" / "gt-pulls.md").read_text()
cr_dir = REPO_ROOT / "skills" / "code-review"
cr_text = "\n".join(p.read_text() for p in cr_dir.rglob("*.md"))
# 1. Canonical 5 columns and Deep Signal hex colors in gitea-plan
expected_columns = {
"Backlog": "#475569",
"Ready": "#1d76db",
"Work in Progress": "#d97706",
"Review": "#6d28d9",
"Completed": "#15803d",
}
for col_title, hex_color in expected_columns.items():
self.assertIn(col_title, tiers_text)
self.assertIn(hex_color, tiers_text)
self.assertIn("PATCH", tiers_text)
self.assertIn("PATCH /repos/{owner}/{repo}/projects/<project-id>/columns/<column-id>", gt_cmds)
# 2. Card transition ownership across implement-slice and gitea-pr
self.assertIn("Backlog -> Ready", impl_skill)
self.assertIn("Ready -> Work in Progress", impl_skill)
self.assertIn("Work in Progress -> Review", impl_skill)
self.assertIn("Backlog -> Ready", impl_handoff)
self.assertIn("Work in Progress -> Review", pr_skill)
self.assertIn("Review -> Completed", pr_skill)
self.assertIn("/issues/${issue_global_id}/move -F column_id=<completed-col-id>", pr_pulls)
# 3. code-review never mutates project boards
self.assertIsNone(
re.search(r"/projects/[^\n]*/move", cr_text),
"code-review must remain read-only and never execute project board card moves",
)
def test_skill_inventory_and_skeletons(self): def test_skill_inventory_and_skeletons(self):
"""Proves all 17 active skills meet line count (<= 80), em-dash, and path portability rules.""" """Proves all 17 active skills meet line count (<= 80), em-dash, and path portability rules."""
for skill_name in EXPECTED_SKILLS: for skill_name in EXPECTED_SKILLS: