Merge pull request 'feat: govern Architecture task decomposition' (#3)
Immutable automated review PASS; local policy tests and diff checks passed. Repository has no Actions workflow.
This commit was merged in pull request #3.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: corp-v1-channel-architecture
|
||||
description: "Use when operating or synchronizing a Corp v1 project's architecture channel. Maintains C4-based architecture documentation, Draw.io diagrams, architecture decisions, and requirements while correlating verified activity across the project's seven channels."
|
||||
version: 1.6.2
|
||||
version: 1.7.0
|
||||
author: Hermes Agent
|
||||
license: MIT
|
||||
metadata:
|
||||
@@ -202,6 +202,23 @@ Use stable IDs such as `FR-0001` and `NFR-0001`. Requirements must be unambiguou
|
||||
|
||||
Architecture derives and maintains implementation-task semantics, dependencies, sequencing, and readiness from the FR/NFR solution. Scope hosts the canonical task records and reader pages under their owning Feature; Architecture must not create a competing task registry page or task navigation.
|
||||
|
||||
Architecture owns complete Task decomposition for every Feature allocated to the release.
|
||||
|
||||
Before reporting a release planning-ready, Architecture must:
|
||||
|
||||
1. Architecture creates missing Tasks, reviews existing Tasks, and retains, revises, supersedes, or removes them according to the current Feature outcomes and Architecture boundaries. Architecture may freely revise or remove only draft Tasks with no implementation approval, Kanban admission, execution, or completion evidence;
|
||||
2. define between two and six independently executable Tasks per Feature; permit one Task only when a recorded Architecture rationale proves it is the smallest atomic, independently verifiable boundary;
|
||||
3. map the Feature's Tasks collectively, exactly, and reciprocally to every acceptance-outcome ID and every applicable active `FR-*` and `NFR-*` record;
|
||||
4. encode acyclic within-Feature sequencing and require every entry Task to depend on all terminal Tasks of every prerequisite Feature;
|
||||
5. give each Task one specific outcome, repository/component owner, canonical/display identity, task-specific implementation artifacts, concrete inputs and outputs, failure boundaries, exclusions, verification steps, and future acceptance-evidence requirements;
|
||||
6. keep draft Tasks separate from implementation approval and Kanban Focus admission.
|
||||
|
||||
Architecture must not report planning readiness while any Feature allocated to the release lacks this complete Task breakdown. A Feature-shaped placeholder Task, a generated empty Task group, or requirement coverage without executable Tasks does not satisfy the gate.
|
||||
|
||||
Approved, Kanban-admitted, in-progress, or completed Tasks must not be deleted or silently rewritten. Retain an obsolete Task with a terminal Superseded or Cancelled status, its prior evidence and history, and explicit replacement links.
|
||||
|
||||
A material change to Task scope, outcome, dependency, repository, or component invalidates the Task's existing implementation approval, returns the Task to its pre-approval state, and always requires renewed human `Approved for Implementation` before implementation can resume. After renewed approval, execution still requires a separate exact-task Kanban Focus admission.
|
||||
|
||||
```text
|
||||
canonical_id | display_id | feature | outcome | scope | dependencies | owner | status | acceptance evidence | affected repository/component
|
||||
```
|
||||
@@ -291,6 +308,7 @@ Requires team approval for:
|
||||
- [ ] ADR, FR, and NFR entries have stable IDs and traceability.
|
||||
- [ ] Every solution Feature has explicit human `Approved for Solution` evidence.
|
||||
- [ ] Eligible Features have dependency-aware task derivation and version proposals, with canonical task reader pages under their Scope Feature.
|
||||
- [ ] Every Feature allocated to the planned release has a reviewed, non-placeholder Task breakdown covering every acceptance outcome and applicable requirement, with acyclic within-Feature and cross-Feature dependencies.
|
||||
- [ ] Task display IDs use `<UPPERCASE_PROJECT_CODE>-TS-<NUMBER>` without rewriting historic canonical identities, evidence, or append-only hashes.
|
||||
- [ ] Only a human team member moved a Feature to `Approved for Implementation` or finalized its version.
|
||||
- [ ] Tasks were proposed to Kanban with readiness/dependency evidence; Architecture did not self-admit them to Focus `InBacklog`.
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
from pathlib import Path
|
||||
import re
|
||||
import unittest
|
||||
|
||||
|
||||
COMMENT = re.compile(r"<!--.*?-->", re.DOTALL)
|
||||
|
||||
|
||||
def task_section(skill: str) -> str:
|
||||
operative = COMMENT.sub("", skill)
|
||||
return operative.split("## Task and Dependency Breakdown", 1)[1].split("## Version Allocation", 1)[0]
|
||||
|
||||
|
||||
def policy_failures(section: str, approval_rule: str) -> list[str]:
|
||||
section = COMMENT.sub("", section)
|
||||
patterns = {
|
||||
"ownership": r"(?m)^Architecture owns complete Task decomposition for every Feature allocated to the release\.$",
|
||||
"lifecycle": r"(?m)^1\. Architecture creates missing Tasks, reviews existing Tasks, and retains, revises, supersedes, or removes them according to the current Feature outcomes and Architecture boundaries\. Architecture may freely revise or remove only draft Tasks with no implementation approval, Kanban admission, execution, or completion evidence;$",
|
||||
"cardinality": r"(?m)^2\. define between two and six independently executable Tasks per Feature; permit one Task only when a recorded Architecture rationale proves it is the smallest atomic, independently verifiable boundary;$",
|
||||
"mapping": r"(?m)^3\. map the Feature's Tasks collectively, exactly, and reciprocally to every acceptance-outcome ID and every applicable active `FR-\*` and `NFR-\*` record;$",
|
||||
"dependencies": r"(?m)^4\. encode acyclic within-Feature sequencing and require every entry Task to depend on all terminal Tasks of every prerequisite Feature;$",
|
||||
"contract": r"(?m)^5\. give each Task one specific outcome, repository/component owner, canonical/display identity, task-specific implementation artifacts, concrete inputs and outputs, failure boundaries, exclusions, verification steps, and future acceptance-evidence requirements;$",
|
||||
"separate-gates": r"(?m)^6\. keep draft Tasks separate from implementation approval and Kanban Focus admission\.$",
|
||||
"planning-readiness": r"(?m)^Architecture must not report planning readiness while any Feature allocated to the release lacks this complete Task breakdown\. A Feature-shaped placeholder Task, a generated empty Task group, or requirement coverage without executable Tasks does not satisfy the gate\.$",
|
||||
"protected-history": r"(?m)^Approved, Kanban-admitted, in-progress, or completed Tasks must not be deleted or silently rewritten\. Retain an obsolete Task with a terminal Superseded or Cancelled status, its prior evidence and history, and explicit replacement links\.$",
|
||||
"approval-invalidation": approval_rule,
|
||||
}
|
||||
return [name for name, pattern in patterns.items() if re.search(pattern, section) is None]
|
||||
|
||||
|
||||
class TaskBreakdownPolicyTest(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.skill = Path(__file__).parents[1].joinpath("SKILL.md").read_text()
|
||||
cls.task_section = task_section(cls.skill)
|
||||
cls.approval_rule = (
|
||||
r"(?m)^A material change to Task scope, outcome, dependency, repository, or component invalidates the Task's existing implementation approval, returns the Task to its pre-approval state, and always requires renewed human `Approved for Implementation` before implementation can resume\. After renewed approval, execution still requires a separate exact-task Kanban Focus admission\.$"
|
||||
)
|
||||
|
||||
def test_operational_policy_is_complete_and_structured(self):
|
||||
self.assertIn("version: 1.7.0", self.skill)
|
||||
self.assertEqual(policy_failures(self.task_section, self.approval_rule), [])
|
||||
|
||||
def test_comments_and_weakened_rules_cannot_satisfy_policy(self):
|
||||
self.assertTrue(policy_failures(f"<!--{self.task_section}-->", self.approval_rule))
|
||||
mutations = {
|
||||
"draft-protection": ("with no implementation approval, Kanban admission, execution, or completion evidence", "even with implementation approval, Kanban admission, execution, or completion evidence"),
|
||||
"planning-readiness": ("must not report planning readiness", "may report planning readiness"),
|
||||
"placeholder-rejection": ("A Feature-shaped placeholder Task, a generated empty Task group, or requirement coverage without executable Tasks does not satisfy the gate.", ""),
|
||||
"cardinality": ("between two and six", "at least two"),
|
||||
"mapping": ("exactly, and reciprocally", "loosely"),
|
||||
"dependencies": ("all terminal Tasks", "some Tasks"),
|
||||
"approval": ("invalidates the Task's existing implementation approval", "invalidates prior readiness evidence"),
|
||||
"renewal": ("always requires renewed human", "may require renewed human"),
|
||||
}
|
||||
for name, (old, new) in mutations.items():
|
||||
with self.subTest(name=name):
|
||||
self.assertTrue(policy_failures(self.task_section.replace(old, new), self.approval_rule))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user