Compare commits

...
3 Commits
Author SHA1 Message Date
kiskaadee 6bddfd9737 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.
2026-11-15 15:36:35 -05:00
kiskaadee c14fecc8f7 chore: ignore python bytecode and cache directories 2026-11-15 14:22:08 -05:00
kiskaadee a11d942554 feat(code-review): draft PR comment blocks for gitea-pr to publish
- code-review: new step 8 drafts review-body.md and inline-comments.json
  when the target is an open PR; finding-schema section 4 defines contents
  (all non-rejected findings), inline/body placement, record/issue
  follow-up routing, and SHA-scoped finding identity across re-reviews.
  code-review never posts, keeping it a read-only inspector.
- gitea-pr: new step 6 publishes the block as one comment-only review
  pinned with --commit, after owner approval; gt-pulls recipe adds
  head_sha staleness, pending-review, and duplicate-SHA guards and forbids
  --approve, --request-changes, and --yes. Findings routed to an issue get
  one via gitea-plan first so the comment links to tracked work.
- pr-lifecycle: triage keeps the published ID, disposition, and route labels.
- tests: contract test asserting code-review has no posting commands and
  the gitea-pr publish recipe keeps its guards ahead of the post command.

Motivated by lg-smtv-mcp PR #6, where nits were posted manually as a
top-level comment on request.
2026-11-15 14:11:59 -05:00
12 changed files with 242 additions and 38 deletions

No files matched your search

+3
View File
@@ -1 +1,4 @@
.obsidian
__pycache__/
*.py[cod]
+3
View File
@@ -27,9 +27,11 @@ description: >-
5. **Aggregate without silent resolution.** When multiple reviewers or passes disagree, keep the disagreement visible under `Unresolved` until evidence settles it.
6. **Emit executable runtime checks.** For stateful or high-risk paths that static inspection cannot prove, emit runnable fenced shell commands for `verify-slice` following the Step 6 contract in [finding-schema](references/finding-schema.md) (stating purpose, `local` vs. `live-infra` scope classification, explicit pass condition, and explicit failure signal).
7. **Present the review summary.** Group findings by axis and apply the decision matrix from [axes](references/axes.md): `Needs Rework` (confirmed defects require changes), `Blocked` (unresolved Critical/High risks or unestablished scope), or `Ready` (all four axes completed, no confirmed or unresolved blocking findings remain, and exact covered revisions plus working-tree state are recorded). Static review establishes static provenance for that diff only; never authorize release.
8. **Draft the PR comment block.** When the target is an open pull request, draft `review-body.md` and `inline-comments.json` per section 4 of [finding-schema](references/finding-schema.md), proposing `inline`/`body` placement and `record`/`issue` follow-up for each non-rejected finding. Never post to Gitea yourself: hand the block to `gitea-pr`.
## Your call
- **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues.
- **Publishing findings**: decide whether the PR comment block is posted, and confirm each finding's placement and follow-up route.
- **Adjudicating unresolved disagreements**: resolve conflicting reviewer perspectives or accepted architectural trade-offs.
- **Authorizing release**: verification and review evidence inform decisions, but the human owner remains the sole release authority.
@@ -40,3 +42,4 @@ description: >-
- `diagnose`: when a finding exposes a root cause that requires deeper troubleshooting.
- `verify-slice`: to execute behavioral and runtime verification scenarios.
- `git-manager`: when branching, committing review fixes, or rebasing.
- `gitea-pr`: to publish the drafted PR comment block on the pull request after owner approval.
@@ -93,3 +93,50 @@ systemctl reload app-daemon.service && systemctl is-active --quiet app-daemon.se
- **Status**: `Ready` | `Needs Rework` | `Blocked`
- **Next Action**: State whether to hand off to `verify-slice` for runtime verification, `diagnose` for root-cause fixes, or present to human owner for adjudication. Static provenance and runtime verification remain distinct inputs; neither authorizes release on its own.
```
## 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 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
- Every finding except `Rejected` ones (those stay in the local ledger only).
- Zero eligible findings: draft nothing. A clean review is not posted unless the owner asks.
### Per-finding routing (proposed here, decided by the owner)
| Field | Values | Rule |
| :--- | :--- | :--- |
| **Placement** | `inline` or `body` | `inline` only when the location is a committed line inside a diff hunk at the reviewed head SHA. Unstaged, staged, file-level, or cross-cutting findings go in `body`. |
| **Follow-up** | `record` or `issue` | `record`: the comment is the whole record (accepted nit, trade-off). `issue`: the owner intends to fix it later, so it needs a tracked issue (created via `gitea-plan`) and the comment links to it. A PR comment is a record, not a task tracker. |
### Identity across re-reviews
Finding IDs (`CR-01`) are only unique within one review. The block header names the reviewed head SHA, and any cross-review reference uses `<short-sha>/CR-01`. `gitea-pr` uses the header SHA to avoid posting the same review twice.
### Files
Write both files to an untracked scratch location (never inside the repository tree):
`review-body.md`:
```markdown
**Code review @ `<short-head-sha>`** (`<base-ref>`..`<head-ref>`): `<Ready | Needs Rework | Blocked>`
Covered state: `<Clean | fingerprint>`. Tier: `<tier>`. Static provenance only; merge authority stays with the owner.
| ID | Axis | Severity | Disposition | Placement | Follow-up |
| :--- | :--- | :--- | :--- | :--- | :--- |
| CR-01 | Standards & Smells | Low | Accepted Trade-off | inline | record |
### Body-placed findings
- **CR-02** (`<location>`): <invariant, impact, and suggested change>.
```
`inline-comments.json` (the `gt pr review --comments-file` format; `new_position` is the line number in the new version of the file and must fall inside a diff hunk):
```json
[
{
"path": "src/pkg/config.py",
"new_position": 40,
"body": "**CR-01** (Low, Accepted Trade-off, record): <invariant and impact>. <Suggested change>."
}
]
```
Every inline entry also appears in the body table, so the record stays complete if inline placement is rejected and the entry moves to the body.
+9 -6
View File
@@ -34,19 +34,22 @@ description: >-
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`:
- Milestones: `gt milestone create "<title>" -d "<desc>" --json id,url`.
- Projects: `gt project create "<title>" --template basic_kanban --json id,url`
(for multi-repo orgs, root at org level with `--org <org>`).
- Issues: `gt issue create -t "<title>" -F <file> -m <id> -p <id> --json number,url`
- Projects: create with `gt project create "<title>" --template none --json id,url` if
missing (with `--org <org>` for multi-repo orgs), or reconcile an existing board in
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>`).
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
confirm server IDs, board cards, and non-hallucinated canonical URLs.
7. **Verify created state.** Inspect `gt issue list`, `gt milestone list`, and board
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
`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
reloading `gitea-plan`:
- 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
re-run `gitea-plan` on scope shifts or epic Readiness Gates.
- **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:
- **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).
### 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
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.
- **Premature Done**: Card is moved to *Done*, but the issue remains open or lacks a merged PR / commit on `main`.
- **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 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.
- **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 |
| :--- | :--- | :--- | :--- | :--- |
| **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. |
**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
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>`.
- **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.
+18 -7
View File
@@ -13,6 +13,7 @@ description: >-
- Opening or updating a pull request on Gitea after implementing an issue or feature.
- Synthesizing static code review and runtime verification evidence into a reviewable PR.
- Tracking review comments, requested changes, and CI checks toward merge readiness.
- Publishing a `code-review` PR comment block (findings and nits) onto an open pull request.
- Not for static code inspection: use `code-review`.
- Not for runtime behavioral verification: use `verify-slice`.
- Not for branch creation, committing, rebasing, or local history integration: use `git-manager`.
@@ -37,18 +38,27 @@ description: >-
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
creating or editing the pull request.
5. **Create or update pull request via `gt pr`.** Run verified commands from
[references/gt-pulls.md](references/gt-pulls.md):
5. **Create or update pull request via `gt pr` and move card to `Review`.** Run verified
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`.
Pass `--draft` if work remains in progress. Extract verified PR number and URL.
6. **Track review feedback and merge readiness.** Inspect status checks (`gt pr checks <number>`),
mergeability (`gt pr view <number> --json mergeable,review_decision`), and review comments
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
[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
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
routed `issue` get their issue (via `gitea-plan`) before posting so the comment links to it.
7. **Track review feedback, merge on owner approval, and move card `Review -> Completed`.**
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,
report `Ready for Merge`.
Release and merge authority belongs exclusively to the human owner: never merge automatically.
report `Ready for Merge`. Never merge automatically: once the human owner explicitly
authorizes merge, run `gt pr merge <number>` and move the linked issue card `Review -> Completed`.
## Your call
- **PR title and description approval**: review and approve the draft PR content and issue linkage.
- **Publishing review findings**: approve the comment block and each finding's placement and follow-up route before it is posted.
- **Review feedback triage**: decide how to address review comments (rework, clarification, deferral).
- **Merge and release authorization**: decide when to merge the PR into the target base branch.
@@ -60,3 +70,4 @@ description: >-
- `code-review`: if the diff changes and needs renewed static inspection.
- `verify-slice`: if new code requires runtime verification.
- `git-manager`: to commit review fixes, rebase, or update the branch against upstream base.
- `gitea-plan`: to create the follow-up issue for a finding routed `issue` before publishing.
+30 -5
View File
@@ -86,6 +86,29 @@ gt pr review resolve <comment-id>
gt pr review unresolve <comment-id>
```
### Publish a `code-review` Comment Block
Input: `review-body.md` and `inline-comments.json` drafted by `code-review` (section 4 of its `finding-schema.md`), plus the reviewed head SHA from the block header.
```bash
# 1. Staleness: the PR head must equal the reviewed head SHA. Mismatch: stop, re-run code-review.
gt pr view <number> --json head_sha -q .head_sha
# 2. Duplicates and pending state: stop if any review is PENDING (posting would publish its
# inline comments too) or if a review already exists for the reviewed SHA from this block.
gt pr review list <number> --json id,state,commit,body
# 3. After owner approval: one comment-only review, pinned to the reviewed commit.
gt pr review <number> --comment --commit <reviewed-head-sha> \
-F review-body.md --comments-file inline-comments.json --json id,url
# Body-only block (no inline entries): omit --comments-file.
```
- Never pass `--approve` or `--request-changes`: the verdict in the body is informational, and merge authority stays with the owner (Gitea also refuses approval on your own PR).
- Never pass `--yes`: it exists to publish a pending review, which step 2 already rules out.
- If Gitea rejects an inline entry (line outside a diff hunk), confirm with step 2 that no review was created, move that entry into the body, and retry once.
- Record the returned review `id` and `url`. Later fixes use `gt pr review reply` with `Fixed in <sha>` and `gt pr review resolve`, per the triage workflow in `pr-lifecycle.md`.
---
## 4. Closing and Merging Pull Requests
@@ -96,12 +119,14 @@ gt pr close <number>
gt pr reopen <number>
```
### Merge Pull Request (Requires Explicit Human Authorization)
Release and merge authority belongs exclusively to the human owner.
### Merge Pull Request and Move Card `Review -> Completed` (Requires Explicit Human Authorization)
Release and merge authority belongs exclusively to the human owner. Once the owner explicitly approves merging:
```bash
# Fast-forward / merge commit
# 1. Merge pull request (fast-forward / merge commit, or --squash --delete-branch)
gt pr merge <number>
# Squash and merge
gt pr merge <number> --squash --delete-branch
# 2. Extract global issue ID of the linked issue and move its project board card to Completed
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.
+3 -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.
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.
4. **Ready for Merge**: All review threads resolved, static review confirms `Ready`, runtime checks pass, and mergeability is green.
5. **Merged**: Merged into target base branch by the human owner. Associated issues are closed automatically by Gitea.
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. **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.
---
@@ -68,6 +68,7 @@ When comments or change requests arrive on a PR:
- *Defects & Invariants*: Logic errors, broken tests, edge-case crashes (require code fix).
- *Spec & Scope Clarifications*: Questions about intent or architectural fit (require response or doc update).
- *Nits / Polish*: Minor style preferences that do not violate repo standards (human owner decides priority).
Findings published from a `code-review` comment block arrive pre-labelled with their ID, disposition, and follow-up route (`record` or `issue`); keep those labels instead of re-categorizing.
3. **Implement fixes on the feature branch**:
- Use `tdd` or direct edits.
- Commit fixes incrementally following `git-manager` conventions (e.g. `fix(gitea-pr): address review feedback`).
+25 -10
View File
@@ -32,27 +32,42 @@ gt milestone view <id>
## 3. Project Boards
Projects provide spatial Kanban workflow stages.
Projects provide spatial Kanban workflow stages (`Backlog`, `Ready`, `Work in Progress`, `Review`, `Completed`).
```bash
# Create repository project board with basic kanban columns
gt project create "<title>" --template basic_kanban -d "<description>" --json id,title,url
# Create repository project board without default template columns (to provision canonical 5-column pipeline)
gt project create "<title>" --template none -d "<description>" --json id,title,url
# 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)
gt project list --json id,title,state,url
gt project list --org <org> --json id,title,state,url
# View project cards and columns
gt project view <id>
gt project view <id> --org <org>
# View project details
gt project view <id> --json id,title,state,url
gt project view <id> --org <org> --json id,title,state,url
# List board columns with IDs
gt api /repos/{owner}/{repo}/projects/<project-id>/columns --jq '.[].id, .[].title'
# List board columns with IDs, titles, sorting order, default flag, and hex colors
# (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>
```
+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`.
## 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.
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).
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
- **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.
- **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`. |
+67
View File
@@ -13,6 +13,8 @@ Verifies:
7. Deviation reporting on skipped checks
8. Strict dry-run zero-mutation invariants
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)
11. Project board 5-column reconciliation, semantic hex colors, and transition ownership
"""
import os
@@ -361,6 +363,71 @@ class TestSkillsBehavioralContracts(unittest.TestCase):
# But during execution, zero new commits and zero external branch creation
self.assertEqual(initial_commit, current_commit)
def test_review_comment_publishing_ownership(self):
"""Proves code-review only drafts the PR comment block and gitea-pr alone posts it, guarded."""
cr_dir = REPO_ROOT / "skills" / "code-review"
cr_text = "\n".join(p.read_text() for p in cr_dir.rglob("*.md"))
# code-review drafts the block but never contains a posting command
self.assertIn("review-body.md", cr_text)
self.assertIn("inline-comments.json", cr_text)
self.assertIsNone(
re.search(r"gt pr (comment|review)\s+<", cr_text),
"code-review must not contain gt posting commands; gitea-pr owns publishing",
)
pr_skill = (REPO_ROOT / "skills" / "gitea-pr" / "SKILL.md").read_text()
recipes = (REPO_ROOT / "skills" / "gitea-pr" / "references" / "gt-pulls.md").read_text()
self.assertIn("Publish review findings", pr_skill)
publish = recipes.split("### Publish a `code-review` Comment Block", 1)[1].split("\n## ", 1)[0]
post_cmd = re.search(r"gt pr review <number> --comment[^\n]*\n[^\n]*", publish).group(0)
# pinned to the reviewed commit, comment-only, no blanket confirmation
self.assertIn("--commit <reviewed-head-sha>", post_cmd)
for forbidden in ("--approve", "--request-changes", "--yes"):
self.assertNotIn(forbidden, post_cmd)
# staleness and duplicate guards precede posting
self.assertLess(publish.index("head_sha"), 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):
"""Proves all 17 active skills meet line count (<= 80), em-dash, and path portability rules."""
for skill_name in EXPECTED_SKILLS: