feat(code-review,gitea-plan,implement-slice): require subagent provenance slots for High-Assurance review and reproducibility audit

- skills/code-review/SKILL.md & references/finding-schema.md: require High-Assurance Execution Mode to record both isolated subagent IDs (Axes 1/2/4 and Dedicated Axis 3 Tests)

- skills/implement-slice/references/orchestration-tiers.md: specify dedicated Axis 3 subagent + Axes 1/2/4 subagent in High-Assurance Final Slice Gate

- skills/gitea-plan/SKILL.md & references/decomposition-tiers.md: make Step 4 reproducibility audit mandatory for Medium/Large tiers and require ### Reproducibility Audit: header with subagent ID in Step 5 proposal

- tests/fixtures/test_skills_behavioral_contracts.py: add test_subagent_provenance_output_slot_guards
This commit is contained in:
kiskaadee committed 2026-11-18 17:11:09 -05:00
1 parent b2146510af
commit 3bca64c258
6 files changed
+28 -12

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ description: >-
## Steps
1. **Pin the fixed point and scope.** Resolve the base ref and record exact base and head commit SHAs (`git rev-parse <base> HEAD`). Inspect working-tree state (`git status --short`, unstaged `git diff`, staged `git diff --cached`, and relevant untracked files) alongside committed history (`git diff <base>...HEAD` and `git log <base>..HEAD --oneline`). Record the covered revisions and working-tree diff state (for example, clean tree or diff fingerprint) so downstream tools can verify whether the reviewed diff remained unchanged, and distinguish findings across committed, staged, and unstaged changes.
2. **Select execution tier.** Match the change to the risk tiers from [axes](references/axes.md) (`Lightweight`, `Standard`, or `High-Assurance`). Single-agent sequential pass for Lightweight; independent review passes for Standard; isolated subagents per axis for High-Assurance.
2. **Select execution tier.** Match the change to the risk tiers from [axes](references/axes.md) (`Lightweight`, `Standard`, or `High-Assurance`). Single-agent sequential pass for `Lightweight`; independent review passes for `Standard`; for `High-Assurance`, never run `Sequential` or a single combined subagent: spawn a dedicated isolated Axis 3 (`Seam & Test Integrity`) subagent separate from Axes 1/2/4 and record both subagent IDs in `Execution Mode`.
3. **Inspect the four axes.** Evaluate the diff against each axis independently using [axes](references/axes.md):
- **Spec & Scope**: originating requirements satisfied, aligned with canonical project direction (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs, active milestone) when present, minimal shared-file footprint, zero scope creep.
- **Standards & Smells**: repository rules and Fowler smell diagnostics from [smell-heuristics](references/smell-heuristics.md) (evaluated as confirmed violations, potential smells, or contextual trade-offs).
@@ -39,7 +39,7 @@ The final review summary presented to the user must follow this structure:
- **Base Commit**: `<base-ref>` (`<base-commit-sha>`) -> `<HEAD>` (`<head-commit-sha>`)
- **Covered Working-Tree State**: `Clean` | Staged, unstaged, and relevant untracked summary plus content fingerprint (covering staged changes, unstaged changes, and relevant untracked file contents so downstream tools can verify zero state drift)
- **Assigned Risk Tier**: `Lightweight` | `Standard` | `High-Assurance`
- **Execution Mode**: `Sequential` | `Independent Passes` | `Subagent Reviewers`
- **Execution Mode**: `Sequential` (`Lightweight` only) | `Independent Passes` (`Standard`) | `Subagent Reviewers` (`High-Assurance` mandatory: Axes 1/2/4 subagent `<id>`, Dedicated Axis 3 Tests subagent `<id>`)
## Findings Ledger
+6 -6
View File
@@ -30,12 +30,12 @@ description: >-
with test seams and falsifiable acceptance criteria (Context, Solution, Criteria),
grouping TDD test seams vertically by submodule or capability rather than a single
monolithic upfront test block across all modules.
4. **Run independent reproducibility audit.** Spawn clean-room subagent with raw
input manifest (commit SHA, specs, proposed issue markdown). Review 5-section
evaluation to resolve material ambiguities before human gate.
5. **Present decomposition for approval.** Present proposed milestone, board,
issues, and any proposed repository `AGENTS.md` planning-contract diff with
audit disposition. Stop for approval before mutating Gitea entities or `AGENTS.md`.
4. **Run independent reproducibility audit (`Medium`/`Large` mandatory).** For `Medium`
and `Large` plans, spawn a clean-room subagent with raw input manifest (commit SHA,
specs, proposed issue markdown) to resolve material ambiguities before the human gate.
5. **Present decomposition for approval.** Emit `### Reproducibility Audit: <Passed|Remediated> (Subagent: <id> | Omitted: Small tier)`
alongside proposed milestone, board, issues, and any `AGENTS.md` contract diff. 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: create with `gt project create "<title>" --template none --json id,url` if
@@ -50,16 +50,17 @@ Never mechanically mirror or silently mutate state. Instead, detect and report s
| **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:
**Deterministic Output Headers**: Every planning proposal must explicitly state both headers before asking for approval:
```markdown
### Project Board Policy: <Omitted|Recommended|Required> (Rationale)
### Reproducibility Audit: <Passed | Remediated> (Subagent: `<conversation-id>` | `Omitted: Small tier`)
```
---
## 4. Independent Zero-Context Reproducibility Audit
## 4. Independent Zero-Context Reproducibility Audit (`Medium` and `Large` Mandatory)
Before finalizing decomposition for approval, run a clean-room audit subagent to verify plan reproducibility without conversational context:
Before presenting a `Medium` or `Large` decomposition for approval (Step 5), spawn a clean-room audit subagent to verify plan reproducibility without conversational context and record its `<conversation-id>` in the `### Reproducibility Audit:` header:
### Input Manifest (Strict Clean-Room)
The auditor receives strictly raw artifacts and pinned repository state:
@@ -26,7 +26,7 @@ These boundaries hold across every slice size and risk tier:
| :--- | :--- | :--- | :--- |
| **`Small` x `Lightweight`** | 1 implementation worker subagent on slice branch (`tdd` where applicable + `git-manager` checkpoint commit + self-audit). | Skip separate mid-slice QA subagent if deterministic worker evidence satisfies the pre-committed rubric; run final-`HEAD` `verify-slice` Lightweight checks. | Single-pass `code-review` (`Lightweight`) + final-`HEAD` `verify-slice` confirmation. |
| **`Small`/`Medium` x `Standard`** | Sequential worker subagent(s) per task/chunk on slice branch (or isolated worktrees only if tasks are genuinely independent). | Spawn independent rubric QA subagent (`verify-slice` `Standard`) at chunk boundary or slice completion when stateful/UI/API behavior warrants separation. | Independent `code-review` (`Standard`, including strategic alignment) + final-`HEAD` `verify-slice` packet. |
| **Any Size x `High-Assurance`** (or `Large` multi-chunk slice) | Sequential tasks on slice branch or isolated per-task worktrees for independent tracks; strict checkpoint boundaries. | Spawn clean black-box QA subagent (`verify-slice` `High-Assurance`), withholding diff narrative and worker self-audit per `verify-slice` Step 3. | Isolated multi-axis `code-review` (`High-Assurance`) + final-`HEAD` `verify-slice` packet (including any emitted `RV-*` checks). |
| **Any Size x `High-Assurance`** (or `Large` multi-chunk slice) | Sequential tasks on slice branch or isolated per-task worktrees for independent tracks; strict checkpoint boundaries. | Spawn clean black-box QA subagent (`verify-slice` `High-Assurance`), withholding diff narrative and worker self-audit per `verify-slice` Step 3. | Spawn isolated `code-review` subagents (`High-Assurance`: dedicated Axis 3 `Seam & Test Integrity` subagent + Axes 1/2/4 subagent) + final-`HEAD` `verify-slice` packet (including any emitted `RV-*` checks). |
---
+15
View File
@@ -17,6 +17,7 @@ Verifies:
11. Project board 5-column reconciliation, semantic hex colors, and transition ownership
12. reconcile-docs read-only Gitea ingestion and bidirectional hooks with gitea-plan / implement-slice
13. Polyglot TDD hardening (Mode A/B, 5 languages, 5 empirical invariants), code-review Axis 3 binding, and Suggested Next Step soft-chaining
14. Subagent provenance output-slot guards for High-Assurance code-review and gitea-plan reproducibility audit
"""
import os
@@ -547,6 +548,20 @@ class TestSkillsBehavioralContracts(unittest.TestCase):
resolved = (skill_path.parent / rel_link).resolve()
self.assertTrue(resolved.exists(), f"{skill_name} has broken relative link: {rel_link} -> {resolved}")
def test_subagent_provenance_output_slot_guards(self):
"""Proves High-Assurance code-review and Medium/Large gitea-plan require subagent provenance slots in output templates."""
cr_skill = (REPO_ROOT / "skills" / "code-review" / "SKILL.md").read_text()
cr_schema = (REPO_ROOT / "skills" / "code-review" / "references" / "finding-schema.md").read_text()
impl_tiers = (REPO_ROOT / "skills" / "implement-slice" / "references" / "orchestration-tiers.md").read_text()
plan_skill = (REPO_ROOT / "skills" / "gitea-plan" / "SKILL.md").read_text()
plan_tiers = (REPO_ROOT / "skills" / "gitea-plan" / "references" / "decomposition-tiers.md").read_text()
self.assertIn("record both subagent IDs in `Execution Mode`", cr_skill)
self.assertIn("Dedicated Axis 3 Tests subagent `<id>`", cr_schema)
self.assertIn("dedicated Axis 3 `Seam & Test Integrity` subagent + Axes 1/2/4 subagent", impl_tiers)
self.assertIn("### Reproducibility Audit:", plan_skill)
self.assertIn("### Reproducibility Audit:", plan_tiers)
def test_skill_inventory_and_skeletons(self):
"""Proves all 16 active skills meet line count (<= 80), em-dash, and path portability rules."""
for skill_name in EXPECTED_SKILLS: