Skip to content

Commit eab52de

Browse files
chore(w21-mzof): create epic + implementation tasks for cross-component contract detection (merge worktree-20260319-180957)
2 parents 1e852ce + 84871f0 commit eab52de

3 files changed

Lines changed: 121 additions & 0 deletions

File tree

.tickets/w21-kp0l.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
id: w21-kp0l
3+
status: open
4+
deps: [w21-mzof, w21-tcti]
5+
links: []
6+
created: 2026-03-20T02:38:59Z
7+
type: task
8+
priority: 2
9+
assignee: Joe Oakhart
10+
parent: w21-mzof
11+
---
12+
# GREEN: Add contract detection pass to implementation-plan SKILL.md
13+
14+
## Description
15+
Edit plugins/dso/skills/implementation-plan/SKILL.md. Insert a '### Contract Detection Pass' subsection in Step 3, after the 'Documentation Updates' subsection and before the '---' separator for Step 4. Contents:
16+
17+
1. When to run: After file impact analysis in Step 3, before finalizing the task list
18+
2. V1 detection heuristic — two patterns:
19+
(a) Signal emit/parse pairs: file impact includes a component producing structured output (STATUS:, RESULT:, REPORT: markers) AND another parsing it
20+
(b) Orchestrator/sub-agent report schemas: file impact includes a skill dispatching sub-agents AND defining expected return format
21+
3. Contract artifact: Create under plugins/dso/docs/contracts/<interface-name>.md with sections: Signal Name, Emitter, Parser, Fields, Example
22+
4. Cross-story deduplication: Before creating contract task, run tk dep tree <parent-epic-id>, check if existing task title contains 'Contract:' and same interface name. If found, wire as dependent. If not, create.
23+
5. Contract task as first dependency: blocks all implementation tasks touching either side of the interface
24+
25+
TDD: Task w21-tcti RED tests turn GREEN after this implementation.
26+
27+
## File Impact
28+
- plugins/dso/skills/implementation-plan/SKILL.md (modify — add Contract Detection Pass section)
29+
30+
## ACCEPTANCE CRITERIA
31+
- [ ] bash tests/run-all.sh passes (exit 0)
32+
Verify: bash tests/run-all.sh
33+
- [ ] SKILL.md contains contract detection heading
34+
Verify: grep -q '### Contract Detection Pass' plugins/dso/skills/implementation-plan/SKILL.md
35+
- [ ] Contains emit/parse pattern description
36+
Verify: grep -q 'emit' plugins/dso/skills/implementation-plan/SKILL.md && grep -q 'parse' plugins/dso/skills/implementation-plan/SKILL.md
37+
- [ ] Contains orchestrator/sub-agent pattern
38+
Verify: grep -qE '(orchestrator.*sub-agent|sub-agent.*orchestrator)' plugins/dso/skills/implementation-plan/SKILL.md
39+
- [ ] Contains deduplication via tk dep tree
40+
Verify: grep -q 'tk dep tree' plugins/dso/skills/implementation-plan/SKILL.md && grep -qE '(existing contract|Contract:)' plugins/dso/skills/implementation-plan/SKILL.md
41+
- [ ] Contains artifact path
42+
Verify: grep -q 'plugins/dso/docs/contracts/' plugins/dso/skills/implementation-plan/SKILL.md
43+
- [ ] All 5 RED tests pass (GREEN)
44+
Verify: bash tests/scripts/test-implementation-plan-contracts.sh 2>&1 | grep -q 'RESULT: PASS'
45+
- [ ] All 5 individually pass
46+
Verify: test $(bash tests/scripts/test-implementation-plan-contracts.sh 2>&1 | grep -c 'PASS:') -ge 5
47+

.tickets/w21-mzof.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
id: w21-mzof
3+
status: open
4+
deps: []
5+
links: []
6+
created: 2026-03-20T02:31:49Z
7+
type: epic
8+
priority: 2
9+
assignee: Joe Oakhart
10+
---
11+
# Cross-component contract detection in /dso:implementation-plan
12+
13+
14+
## Notes
15+
16+
**2026-03-20T02:31:58Z**
17+
18+
19+
## Context
20+
When a DSO developer runs /dso:sprint on an epic that touches multiple components needing a shared interface (signal formats, prompt schemas, report structures), the current planning flow doesn't surface these contracts explicitly. They get discovered during code review when the two sides don't match — as happened with the fix-bug/debug-everything ESCALATION_REPORT contract in epic w21-25vk, where fix-bug emitted a signal format that debug-everything couldn't parse, requiring 3 review resolution cycles to align. By detecting cross-component contracts during /dso:implementation-plan and creating a contract definition task that other tasks depend on, developers avoid wasting review cycles on interface alignment that should have been resolved at planning time.
21+
22+
## Success Criteria
23+
1. When /dso:implementation-plan detects that a story's file impact spans two or more components that exchange structured data (one emits, the other parses), it creates a contract definition task as the first task in the dependency chain — the contract task produces a concrete artifact (schema definition in a markdown or JSON file under plugins/dso/docs/contracts/ or plugins/dso/skills/shared/) that downstream implementation tasks reference in their acceptance criteria
24+
2. The detection heuristic covers two v1 contract patterns: (a) signal emit/parse pairs — where one skill/script produces a structured output format (e.g., STATUS:, ESCALATION_REPORT:) that another skill/script parses, and (b) orchestrator/sub-agent report schemas — where a sub-agent returns structured data the orchestrator must interpret. Additional patterns (shared prompt placeholders, cross-skill dispatch formats) are deferred to follow-on work
25+
3. Cross-story contract deduplication: when /dso:implementation-plan runs on a story, it checks existing tasks under the parent epic (tk dep tree <epic-id>) for a contract task covering the same interface before creating a new one — if found, it wires the new story's tasks as dependents of the existing contract task via tk dep
26+
4. After delivery, run /dso:sprint on the next 3 epics that involve cross-component changes and track whether review resolution cycles for contract-related findings decrease — target: 0 contract-mismatch findings requiring review fix/defend cycles (baseline: 3 cycles on w21-25vk)
27+
28+
## Dependencies
29+
None (file-impact analysis already exists in /dso:implementation-plan)
30+
31+
## Approach
32+
Enhance /dso:implementation-plan's task generation step to include a contract detection pass after file impact analysis. When the file impact list contains components on both sides of an interface boundary, generate a contract definition task whose deliverable is the shared artifact. Use tk dep tree to check for existing contract tasks before creating duplicates.
33+

.tickets/w21-tcti.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
id: w21-tcti
3+
status: open
4+
deps: [w21-mzof]
5+
links: []
6+
created: 2026-03-20T02:38:54Z
7+
type: task
8+
priority: 2
9+
assignee: Joe Oakhart
10+
parent: w21-mzof
11+
---
12+
# RED: Tests for contract detection in implementation-plan SKILL.md
13+
14+
## Description
15+
Create tests/scripts/test-implementation-plan-contracts.sh with 5 test functions following project conventions (set -uo pipefail, PASS/FAIL counters, summary block):
16+
17+
1. test_contract_detection_section_exists — grep SKILL.md for '### Contract Detection Pass' heading
18+
2. test_contract_emit_parse_pattern — grep for emit/parse signal pair detection (both 'emit' and 'parse' in contract detection section)
19+
3. test_contract_orchestrator_subagent_pattern — grep for orchestrator/sub-agent report schema pattern
20+
4. test_contract_deduplication — grep for 'tk dep tree' AND 'existing contract' or 'Contract:' in contract detection section
21+
5. test_contract_task_template — grep for contract task template with 'plugins/dso/docs/contracts/' artifact path
22+
23+
All 5 FAIL (RED). Test harness uses project-standard FAIL: prefix, PASS: prefix, RESULT: PASS/FAIL summary.
24+
25+
TDD: These ARE the RED tests.
26+
27+
## File Impact
28+
- tests/scripts/test-implementation-plan-contracts.sh (create)
29+
30+
## ACCEPTANCE CRITERIA
31+
- [ ] bash tests/run-all.sh passes (exit 0)
32+
Verify: bash tests/run-all.sh
33+
- [ ] Test file exists
34+
Verify: test -f tests/scripts/test-implementation-plan-contracts.sh
35+
- [ ] Valid bash syntax
36+
Verify: bash -n tests/scripts/test-implementation-plan-contracts.sh
37+
- [ ] Contains 5 test functions
38+
Verify: test $(grep -c 'test_contract_' tests/scripts/test-implementation-plan-contracts.sh) -ge 5
39+
- [ ] All 5 FAIL (RED)
40+
Verify: bash tests/scripts/test-implementation-plan-contracts.sh 2>&1 | grep -c 'FAIL:' | { read c; test "$c" -ge 5; }
41+

0 commit comments

Comments
 (0)