@@ -248,8 +248,21 @@ Return **ONLY** valid JSON in this exact structure:
248248** subtasks[ ] .complexity_rationale** : MUST reference factors: "Score N: factor (+X), factor (+Y)..."
249249** subtasks[ ] .validation_criteria** : Array of ** testable conditions** that prove completion
250250 - REQUIRED: 2-4 specific, verifiable outcomes
251- - Good: "Returns 401 for expired token", "Creates audit log entry with user_id"
252- - Bad: "Works correctly", "Handles errors"
251+ - Format (recommended): Prefix each item with ` VC1: ` , ` VC2: ` , ... for stable cross-agent reference.
252+ - Each criterion MUST be both:
253+ - ** Behavior-/artifact-verifiable** (can be checked by reading code), and
254+ - ** Test-verifiable** (has at least one concrete test case planned in ` test_strategy ` ).
255+ - Each criterion SHOULD include a concrete anchor:
256+ - endpoint/handler + route, OR
257+ - function/class name + file path
258+ - Good:
259+ - "VC1: POST /users returns 201 and persists normalized email (users/routes.py: create_user )"
260+ - "VC2: Returns 401 for expired token (auth/middleware.py: validate_token )"
261+ - "VC3: Creates audit log entry with user_id (audit/logger.py: log_event )"
262+ - Bad:
263+ - "Works correctly"
264+ - "Handles errors"
265+ - "Tests pass"
253266** subtasks[ ] .contracts** : Array of ** executable assertion patterns** (optional but recommended for complexity_score ≥ 5)
254267 - ` type ` : "precondition" | "postcondition" | "invariant"
255268 - ` assertion ` : Executable pattern (e.g., "response.status == 401 WHEN token.expired")
@@ -260,15 +273,26 @@ Return **ONLY** valid JSON in this exact structure:
260273 - This is the primary handoff artifact to the Actor agent
261274 - Actor "compiles" this contract into code; Monitor verifies against it
262275 - Format: ` "<Actor> -> <Action>(params) -> <Goal with success criteria>" `
276+ - ** Integration is part of the contract** :
277+ - Prefer describing the * entrypoint + call chain* that makes the behavior real (especially for validation, policy checks, auth, migrations).
278+ - Avoid leaf-only contracts that are easy to satisfy in isolation but not wired into production code paths.
263279 - Examples:
264280 - ` "AuthService -> validate(token) -> returns 401|200 with user_id" `
265281 - ` "ProjectModel -> add_field(archived_at: DateTime?) -> migration passes" `
266282 - ` "RateLimiter -> decorate(endpoint, 100/min) -> returns 429 when exceeded" `
283+ - ` "ConfigLoader -> load_policy(path) -> calls validate_risk_policy(); raises ConfigValidationError on contradictions" `
267284** subtasks[ ] .implementation_hint** : Optional guidance for non-obvious implementations
268285 - RECOMMENDED when: complexity_score >= 5 OR security_critical OR dependencies.length >= 2
269286 - OMIT when: standard pattern with obvious implementation
270287 - Example: "Use existing RateLimiter middleware, configure for /api/* routes"
271288** subtasks[ ] .test_strategy** : Required object with unit/integration/e2e keys. Use "N/A" for levels not applicable.
289+ - MUST map ` validation_criteria ` → tests:
290+ - For each ` VCn: ` criterion, include at least one planned test name that covers it.
291+ - Recommended naming: include ` vc<n> ` in the test name (e.g., ` test_vc1_* ` , ` TestVC1* ` ) for deterministic grep-ability.
292+ - Recommended format: ` path/to/test_file.ext::test_name_or_symbol `
293+ - "N/A" is acceptable ONLY when:
294+ - The repository has no automated test harness, and adding one is out-of-scope for this subtask.
295+ - In that case: either add a FOUNDATION subtask to introduce a minimal test harness, or document the gap explicitly in risks/assumptions.
272296** subtasks[ ] .affected_files** : Precise file paths (NOT "backend", "frontend"); use [ ] if paths unknown
273297
274298### Subtask Ordering
@@ -484,16 +508,18 @@ When invoked with `mode: "re_decomposition"` from the orchestrator, you receive
484508- [ ] Each subtask is atomic (independently implementable + testable)
485509- [ ] Each subtask has an aag_contract in ` Actor -> Action(params) -> Goal ` format
486510- [ ] AAG contracts are specific (not "does stuff" — name classes, methods, return types)
511+ - [ ] AAG contracts include wiring/integration when relevant (entrypoint + validator/policy checks, not leaf-only helpers)
487512- [ ] All dependencies are explicit and accurate
488513- [ ] Subtasks ordered by dependency (foundations first)
489514- [ ] 5-8 subtasks (not too granular or too coarse)
490515- [ ] Titles are action-oriented (start with verb)
491516- [ ] Descriptions explain HOW, not just WHAT
492517
493518** Acceptance Criteria** :
494- - [ ] Each subtask has 3-5 specific criteria
519+ - [ ] Each subtask has 2-4 specific criteria
495520- [ ] Criteria are testable and measurable
496- - [ ] Criteria cover: functionality + edge cases + testing
521+ - [ ] Criteria cover: functionality + edge cases (as applicable)
522+ - [ ] Each VC has a concrete verification hook in test_strategy (at least one planned test per VC)
497523- [ ] No vague criteria ("works", "is good", "done")
498524
499525** File Paths** :
@@ -510,7 +536,7 @@ When invoked with `mode: "re_decomposition"` from the orchestrator, you receive
510536
511537** Test Strategy** :
512538- [ ] test_strategy object included for each subtask
513- - [ ] Unit tests specified (REQUIRED for all subtasks)
539+ - [ ] Unit tests specified (default). If repo has no test harness: add a FOUNDATION subtask to introduce minimal tests or explicitly justify "N/A".
514540- [ ] Integration tests specified when subtask integrates multiple components
515541- [ ] E2e tests specified when subtask impacts user-facing functionality
516542- [ ] "N/A" used appropriately when test layer not applicable
0 commit comments