[verified] feat: add delivery readiness state
Validate skill / validate (push) Successful in 10s
Validate skill / validate (pull_request) Successful in 5s

This commit is contained in:
2026-09-03 09:13:59 +00:00
parent 801f3847fa
commit a55f5ea7b0
3 changed files with 79 additions and 4 deletions
+44 -1
View File
@@ -11,6 +11,11 @@ def task_section(skill: str) -> str:
return operative.split("## Task and Dependency Breakdown", 1)[1].split("## Version Allocation", 1)[0]
def readiness_section(skill: str) -> str:
operative = COMMENT.sub("", skill)
return operative.split("## Delivery Readiness State", 1)[1].split("## Kanban Handoff", 1)[0]
def policy_failures(section: str, approval_rule: str) -> list[str]:
section = COMMENT.sub("", section)
patterns = {
@@ -28,6 +33,22 @@ def policy_failures(section: str, approval_rule: str) -> list[str]:
return [name for name, pattern in patterns.items() if re.search(pattern, section) is None]
def readiness_failures(section: str) -> list[str]:
patterns = {
"sequence": r"`IN_DESIGN → READY_FOR_DELIVERY → IN_PROGRESS`",
"implementation-approval": r"exact item-specific `Approved for Implementation`",
"complete-inputs": r"complete task inputs",
"entry-dependencies": r"all entry dependencies are satisfied",
"ui-ux-evidence": r"approved UI/UX implementation-handoff evidence",
"ui-ux-not-applicable": r"explicitly records UI/UX as not applicable",
"not-execution": r"does not mean Focus admission, assignment, claim, implementation start, `delivery_started`, or `IN_PROGRESS`",
"kanban-admission": r"handoff to Kanban for a separate exact-task Focus-admission decision",
"scope-schema": r"must not silently mutate or outrun Scope-owned canonical lifecycle schema",
"scope-fallback": r"return the handoff to Scope for canonicalization and keep the Task in its prior state",
}
return [name for name, pattern in patterns.items() if re.search(pattern, section) is None]
class TaskBreakdownPolicyTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
@@ -38,7 +59,7 @@ class TaskBreakdownPolicyTest(unittest.TestCase):
)
def test_operational_policy_is_complete_and_structured(self):
self.assertIn("version: 1.7.0", self.skill)
self.assertIn("version: 1.8.0", self.skill)
self.assertEqual(policy_failures(self.task_section, self.approval_rule), [])
def test_comments_and_weakened_rules_cannot_satisfy_policy(self):
@@ -57,6 +78,28 @@ class TaskBreakdownPolicyTest(unittest.TestCase):
with self.subTest(name=name):
self.assertTrue(policy_failures(self.task_section.replace(old, new), self.approval_rule))
def test_ready_for_delivery_is_a_fail_closed_pre_execution_state(self):
section = readiness_section(self.skill)
self.assertEqual(readiness_failures(section), [])
def test_ready_for_delivery_gate_cannot_be_weakened(self):
section = readiness_section(self.skill)
mutations = [
("exact item-specific `Approved for Implementation`", "implementation is expected"),
("complete task inputs", "partial task inputs"),
("all entry dependencies are satisfied", "entry dependencies are expected to be satisfied"),
("approved UI/UX implementation-handoff evidence", "a UI/UX discussion"),
("explicitly records UI/UX as not applicable with a rationale", "assumes UI/UX is not applicable"),
("separate exact-task Focus-admission decision", "automatic Focus admission"),
("does not mean Focus admission", "means Focus admission"),
("return the handoff to Scope for canonicalization and keep the Task in its prior state", "continue with a local readiness state"),
]
for old, new in mutations:
with self.subTest(old=old):
changed = section.replace(old, new)
self.assertNotEqual(changed, section)
self.assertTrue(readiness_failures(changed))
if __name__ == "__main__":
unittest.main()