Skip to content

Commit 34c0547

Browse files
authored
Merge pull request #84 from dmoliveira/my_opencode-e15-compliance-model
Define E15-T1 todo compliance model
2 parents 0b99496 + fb408bd commit 34c0547

File tree

4 files changed

+113
-6
lines changed

4 files changed

+113
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ All notable changes to this project are documented in this file.
4848
- Added `/start-work`, `/start-work-status`, and `/start-work-deviations` aliases in `opencode.json`.
4949
- Added `/start-work-bg` and `/start-work-doctor-json` aliases for background-safe queueing and execution health diagnostics.
5050
- Added `instructions/plan_execution_workflows.md` with sample plans and direct/background/recovery workflows for `/start-work`.
51+
- Added `instructions/todo_compliance_model.md` defining todo states, transition enforcement, bypass metadata, and compliance audit event format for Epic 15 Task 15.1.
5152

5253
### Changes
5354
- Documented extension evaluation outcomes and when each tool is the better fit.

IMPLEMENTATION_ROADMAP.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Use this map to avoid overlapping implementations.
5151
| E12 | Provider/Model Fallback Visibility | done | Medium | E5 | bd-1jq, bd-298, bd-194, bd-2gq | Explain why model routing decisions happen |
5252
| E13 | Browser Automation Profile Switching | done | Medium | E1 | bd-3rs, bd-2qy, bd-f6g, bd-393 | Toggle Playwright/agent-browser with checks |
5353
| E14 | Plan-to-Execution Bridge Command | done | Medium | E2, E3 | bd-1z6, bd-2te, bd-3sg, bd-2bv | Execute validated plans with progress tracking |
54-
| E15 | Todo Enforcer and Plan Compliance | planned | High | E14 | TBD | Keep execution aligned with approved checklists |
54+
| E15 | Todo Enforcer and Plan Compliance | in_progress | High | E14 | bd-l9c | Keep execution aligned with approved checklists |
5555
| E16 | Comment and Output Quality Checker Loop | merged | Medium | E23 | TBD | Merged into E23 (PR Review Copilot) |
5656
| E17 | Auto-Resume and Recovery Loop | planned | High | E11, E14 | TBD | Resume interrupted work from checkpoints safely |
5757
| E18 | LSP/AST-Assisted Safe Edit Mode | planned | High | E3 | TBD | Prefer semantic edits over plain text replacements |
@@ -595,15 +595,16 @@ Every command-oriented epic must ship all of the following:
595595

596596
## Epic 15 - Todo Enforcer and Plan Compliance
597597

598-
**Status:** `planned`
598+
**Status:** `in_progress`
599599
**Priority:** High
600600
**Goal:** Enforce explicit checklist progress during execution so outcomes stay aligned with approved plans.
601601
**Depends on:** Epic 14
602602

603-
- [ ] Task 15.1: Define compliance model
604-
- [ ] Subtask 15.1.1: Define required todo states (`pending`, `in_progress`, `done`, `skipped`)
605-
- [ ] Subtask 15.1.2: Define rules for one-active-item-at-a-time enforcement
606-
- [ ] Subtask 15.1.3: Define acceptable bypass annotations and audit format
603+
- [x] Task 15.1: Define compliance model
604+
- [x] Subtask 15.1.1: Define required todo states (`pending`, `in_progress`, `done`, `skipped`)
605+
- [x] Subtask 15.1.2: Define rules for one-active-item-at-a-time enforcement
606+
- [x] Subtask 15.1.3: Define acceptable bypass annotations and audit format
607+
- [x] Notes: Added `instructions/todo_compliance_model.md` with state model, transition constraints, bypass metadata requirements, and audit event contract.
607608
- [ ] Task 15.2: Implement enforcement engine
608609
- [ ] Subtask 15.2.1: Validate state transitions before major actions
609610
- [ ] Subtask 15.2.2: Block completion when required tasks remain unchecked

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,15 @@ Integration notes:
605605
- `/digest run` now includes a `plan_execution` recap block (status, plan id, step counts, deviation count)
606606
- `/doctor run` includes `start-work` health diagnostics for execution-state visibility
607607

608+
## Todo compliance model
609+
610+
Epic 15 Task 15.1 defines the baseline compliance contract for enforced todo execution:
611+
612+
- compliance spec: `instructions/todo_compliance_model.md`
613+
- required states: `pending`, `in_progress`, `done`, `skipped`
614+
- enforcement: one active item at a time with deterministic transition validation
615+
- bypass path: explicit metadata + audit event requirements for controlled exceptions
616+
608617
## Context resilience policy
609618

610619
Epic 11 Task 11.1 defines the baseline policy schema for context-window resilience:
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Todo Compliance Model
2+
3+
Epic 15 Task 15.1 defines the compliance contract that keeps execution aligned with approved plans.
4+
5+
## Goals
6+
7+
- enforce explicit, auditable todo state progression during plan execution
8+
- prevent silent task skipping by allowing only explicit, reasoned bypass paths
9+
- keep compliance checks deterministic and machine-readable for automation
10+
11+
## Required todo state model
12+
13+
Every tracked todo item must be in exactly one state:
14+
15+
- `pending`: planned but not started
16+
- `in_progress`: actively being executed
17+
- `done`: completed and verified
18+
- `skipped`: intentionally not executed with explicit rationale
19+
20+
Unknown states must fail compliance checks.
21+
22+
## Core enforcement rules
23+
24+
1. Exactly one item may be `in_progress` at a time.
25+
2. Transition order must follow:
26+
- `pending -> in_progress`
27+
- `in_progress -> done`
28+
- `in_progress -> skipped`
29+
3. Direct transitions like `pending -> done` are invalid unless a bypass annotation exists.
30+
4. Plan completion is valid only when all items are `done` or `skipped`.
31+
32+
## Bypass annotations
33+
34+
Bypass is allowed only through explicit metadata attached to the affected item:
35+
36+
- `bypass_reason`: concise justification
37+
- `bypass_actor`: who authorized it
38+
- `bypass_at`: RFC3339 timestamp
39+
- `bypass_type`: one of `risk_acceptance`, `scope_change`, `emergency_hotfix`
40+
41+
Missing any required bypass field must invalidate the bypass.
42+
43+
## Audit event format
44+
45+
Compliance-relevant state transitions should emit append-only events:
46+
47+
```json
48+
{
49+
"event": "todo_transition",
50+
"todo_id": "todo-3",
51+
"from": "pending",
52+
"to": "in_progress",
53+
"at": "2026-02-13T12:00:00Z",
54+
"actor": "diego",
55+
"compliance": "enforced"
56+
}
57+
```
58+
59+
Bypass usage should emit:
60+
61+
```json
62+
{
63+
"event": "todo_bypass",
64+
"todo_id": "todo-5",
65+
"from": "pending",
66+
"to": "done",
67+
"at": "2026-02-13T12:05:00Z",
68+
"actor": "diego",
69+
"bypass": {
70+
"type": "scope_change",
71+
"reason": "task absorbed into prior step",
72+
"authorized_by": "owner"
73+
}
74+
}
75+
```
76+
77+
## Validation outcomes
78+
79+
Compliance checks should return deterministic results:
80+
81+
- `PASS`: all todo states and transitions satisfy rules
82+
- `FAIL`: violations detected; include violation code(s), affected todo id(s), and remediation hints
83+
84+
Reference violation codes:
85+
86+
- `unknown_todo_state`
87+
- `multiple_in_progress_items`
88+
- `invalid_transition`
89+
- `missing_bypass_metadata`
90+
- `incomplete_todo_set`
91+
92+
## Integration targets
93+
94+
- Task 15.2 should implement enforcement engine checks for this model
95+
- Task 15.3 should expose `/todo status` and `/todo enforce` diagnostics with machine-readable outputs
96+
- Task 15.4 should validate normal, bypass, and failure paths with docs/examples

0 commit comments

Comments
 (0)