Skip to content

Commit 4cbc90a

Browse files
committed
tests: Extend generated-config contract coverage for OpenCode
Keep the generation contract and its shell-backed fixture checks aligned across all generated targets, including OpenCode. Add negative fixtures for decision-gate ownership and workflow-language drift, and register them in the flake and test harness.
1 parent 7fd57d7 commit 4cbc90a

66 files changed

Lines changed: 1558 additions & 914 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/sce-change-to-plan/SKILL.md‎

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@ description: >
66

77
# SCE Change to Plan
88

9-
## Execution contract
10-
11-
Own this workflow from input through its terminal user-visible response.
12-
Follow its steps, gates, and stops in order; do not add, skip, reorder, or merge them.
13-
Keep internal phase results private and continue immediately until a defined wait or stop.
14-
Resume user waits in this same skill and session.
15-
Render user-visible output only from the named workflow layouts or phase reports.
16-
Do not expose raw internal state or add text around a rendered layout or report.
17-
Non-SCE helpers may assist, but must return to the active step without changing
18-
phase order, gates, waits, writes, validation, stops, or terminal output.
19-
Do not invoke another SCE skill, package, or workflow command.
9+
## Purpose
10+
11+
Own this workflow from input parsing through its terminal user-visible response.
12+
Execute the phases below directly and in order. Phase statuses are internal state,
13+
not inter-SCE workflow handoffs. Do not invoke another SCE skill, sibling SCE
14+
package, or SCE workflow command. Follow the canonical workflow's steps, gates,
15+
and stops exactly as written: never invent, skip, reorder, or merge a step.
2016

2117
## Phase references
2218

@@ -37,6 +33,26 @@ Read a step's reference before taking any action for that step, not after. Read
3733
only the reference for the step you have reached: a run that stops at the
3834
bootstrap gate never authors a plan, which is why they are separate files.
3935

36+
## User-visible output
37+
38+
Use `references/output.md` for every gate and terminal response. Render no raw
39+
internal state. The reference contains only human-visible Markdown layouts.
40+
User-visible output is limited to those layouts: never invent a layout, and never
41+
wrap one in an added preamble, commentary, summary, or extra section.
42+
43+
## Composite control flow
44+
45+
Keep phase results as internal state and continue immediately whenever the
46+
canonical workflow says to continue. Stop only at a user wait or terminal branch.
47+
Any workflow-defined user wait resumes this same skill in the same session.
48+
Never expose an internal phase result
49+
as the workflow's final response.
50+
51+
Relevant non-SCE skills may be used as helper capabilities during the active step.
52+
They are not workflow handoffs: when a helper returns, control returns to the active
53+
step. Helper use must preserve the canonical phase order, gates, waits, writes,
54+
validation, stops, and terminal user-visible output.
55+
4056
## Input
4157

4258
`invocation input` is the change request, in free-form prose.

‎.agents/skills/sce-change-to-plan/references/context-load.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ sentence.
6161

6262
## 1.5 Return the brief
6363

64-
Return one internal result with one of these statuses:
64+
Set exactly one internal state:
6565

6666
- `loaded`
6767
- `bootstrap_required`
6868

6969
Report facts the workflow can act on. A brief that only lists file paths has
7070
moved no knowledge.
7171

72-
Return only the internal result. Do not add explanatory prose before or after it.
72+
Record only the internal state. Do not add explanatory prose before or after it.
7373

7474
Step 2 consumes a `loaded` brief verbatim and treats its `key_facts` as recorded
7575
current state, its `gaps` as areas with no durable context, and its `drift` as

‎.agents/skills/sce-change-to-plan/references/output.md‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ candidate plan paths and explain that naming one candidate resolves it.
4848

4949
This plan is a draft. State a correction and it will be updated.
5050

51-
Next step:
51+
Next up:
5252

5353
{next-task-id} — {next-task-title}
5454

@@ -66,22 +66,22 @@ This is chat output, not a file. Nothing here is written to the plan.
6666

6767
## Layout
6868

69-
```markdown
69+
```
7070
# Plan: {plan.name}
7171
7272
Path: {plan.path}
7373
74-
## Summary
74+
## Summary:
7575
{plan summary}
7676
77-
## Tasks
77+
## Tasks:
7878
1. {task.id} — {task.title}
7979
2. {task.id} — {task.title}
8080
81-
## Assumptions
81+
## Assumptions:
8282
- {assumption}
8383
84-
## Open questions
84+
## Open questions:
8585
- {open question}
8686
```
8787

@@ -93,13 +93,13 @@ not carry.
9393
- `Plan:` — `plan.name`. Append ` (updated)` when `plan.action` is `updated`.
9494
Render nothing extra when it is `created`.
9595
- `Path:` — `plan.path`, exactly as returned, so it stays runnable.
96-
- `Summary` — `summary`, as prose. This is the only place the reader learns
96+
- `Summary:` — `summary`, as prose. This is the only place the reader learns
9797
what the plan actually does, so never omit it and never replace it with a
9898
restatement of the task titles.
99-
- `Tasks` — one numbered line per entry in `tasks`, in plan order. Append
99+
- `Tasks:` — one numbered line per entry in `tasks`, in plan order. Append
100100
` (done)` to any task whose `status` is `done`.
101-
- `Assumptions` — one line per entry in `assumptions`.
102-
- `Open questions` — one line per entry in `open_questions`.
101+
- `Assumptions:` — one line per entry in `assumptions`.
102+
- `Open questions:` — one line per entry in `open_questions`.
103103

104104
## Empty sections
105105

@@ -108,15 +108,15 @@ explicit `None.` confirms nothing is pending.
108108

109109
When `assumptions` is empty:
110110

111-
```markdown
112-
## Assumptions
111+
```
112+
## Assumptions:
113113
- None.
114114
```
115115

116116
When `open_questions` is absent:
117117

118-
```markdown
119-
## Open questions
118+
```
119+
## Open questions:
120120
- None.
121121
```
122122

@@ -132,21 +132,21 @@ When `open_questions` is absent:
132132

133133
## Example
134134

135-
```markdown
135+
```
136136
# Plan: red-sce-banner
137137
138138
Path: context/plans/red-sce-banner.md
139139
140-
## Summary
141-
Renders the ASCII-art SCE banner at the top of `sce` help in red instead of the current gradient. Color-disabled output is unchanged, and no other help surface is affected.
140+
## Summary:
141+
Renders the ASCII-art SCE banner at the top of `sce` help in red instead of the current gradient. Colour-disabled output is unchanged, and no other help surface is affected.
142142
143-
## Tasks
143+
## Tasks:
144144
1. T01 — Render the SCE banner in red
145145
146-
## Assumptions
146+
## Assumptions:
147147
- "SCE letters" refers to the ASCII-art banner in top-level help.
148148
- Red is uniform terminal red when colors are enabled; plain ASCII remains unchanged otherwise.
149149
150-
## Open questions
150+
## Open questions:
151151
- None.
152152
```

‎.agents/skills/sce-change-to-plan/references/plan-authoring.md‎

Lines changed: 68 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ Run this phase for step 2 of the workflow, and again for each revision in step 4
55
Input: the change request, and the complete `loaded` brief from the context load
66
phase. Pass the brief verbatim; do not restate, summarize, or reinterpret it.
77

8-
This phase owns the planning process:
8+
This phase exclusively owns:
99

10-
- Resolve whether the request targets a new or an existing plan.
11-
- Challenge the change and run the clarification gate.
12-
- Derive plan-specific content from the request and loaded context.
13-
- Decide task boundaries, dependencies, and ordering.
14-
- Write or revise exactly one `context/plans/{plan_name}.md`.
10+
- Resolving whether the request targets a new or an existing plan.
11+
- The clarification gate.
12+
- Normalizing the change summary, acceptance criteria, constraints, and non-goals.
13+
- Slicing the task stack into one-task/one-atomic-commit units.
14+
- Writing `context/plans/{plan_name}.md`.
1515

16-
`references/plan-template.md` is the sole owner of the persisted plan schema.
17-
Read its `Acceptance criteria rules`, `Task rules` and `No validation task` rules,
18-
and `Updating an existing plan` rules before authoring or revising. Apply those
19-
rules rather than restating them here.
16+
Do not duplicate any of it elsewhere in the workflow.
17+
18+
Use the document format in `references/plan-template.md`. Read it before writing
19+
the plan file.
2020

2121
The workflow renders this phase's result as the summary defined in
2222
`references/output.md`.
@@ -27,7 +27,7 @@ responsibility.
2727

2828
The context brief is the durable memory this plan starts from. Treat its
2929
`key_facts` as recorded current state, its `gaps` as areas with no durable
30-
context, and its `drift` as recorded context that no longer matches the code.
30+
context, and its `drift` as context the code has already outrun.
3131

3232
When no brief is supplied, load the context named by the change request before
3333
authoring, and follow the selection discipline in *Inspect relevant context*.
@@ -48,9 +48,8 @@ undecidable.
4848
Determine whether the request targets a new plan or an existing plan in
4949
`context/plans/`.
5050

51-
When it targets an existing plan, read that plan before authoring. Apply the
52-
`Updating an existing plan` rules in `references/plan-template.md` when writing;
53-
this step only resolves which plan is being revised.
51+
When it targets an existing plan, read that plan before authoring. Preserve its
52+
completed tasks, their recorded evidence, its structure, and its terminology.
5453

5554
When multiple existing plans match and none can be selected safely, return
5655
`blocked` with the matching candidates.
@@ -152,16 +151,33 @@ Do not explore the entire repository by default.
152151

153152
## 2.5 Author the acceptance criteria
154153

155-
Derive the plan-specific success outcomes and checks before slicing tasks, then
156-
apply the `Acceptance criteria rules` and exact section shape in
157-
`references/plan-template.md`. The template owns their generic validation
158-
semantics and placement.
154+
State how the finished plan is proven, before slicing tasks.
155+
156+
Each criterion describes observable behavior of the finished system and names the
157+
check that proves it. Record repository-wide checks once under `Full validation`,
158+
and the durable context the change must be reflected in under `Context sync`.
159+
160+
`/validate` runs this section after the last task completes. It is the only place
161+
a plan says how it is validated.
159162

160163
## 2.6 Author the task stack
161164

162-
Slice and order the plan-specific work after the acceptance criteria, applying the
163-
`Task rules` and `No validation task` rules in `references/plan-template.md`.
164-
Do not restate those generic task rules here.
165+
Slice the work into sequential tasks `T01..T0N` using the task format and the
166+
atomic slicing contract in `references/plan-template.md`.
167+
168+
Every executable task must be completable and landable as one coherent commit.
169+
Split any task that would require multiple independent commits. Convert broad
170+
wrappers such as `polish` or `finalize` into specific outcomes with concrete
171+
acceptance checks.
172+
173+
Order tasks so each one's declared dependencies precede it.
174+
175+
The last task is an ordinary implementation task. Do not author a trailing
176+
validation-and-cleanup task, or any task whose only purpose is running the full
177+
check suite, verifying durable context, or removing scaffolding.
178+
179+
Confirm every acceptance criterion is satisfied by at least one task. When one is
180+
not, the task stack is incomplete.
165181

166182
A finished stack always leaves at least one incomplete task, so the workflow can
167183
always hand off to `/next-task`. When the request resolves to a plan but produces
@@ -171,32 +187,50 @@ by completed tasks, set internal status `blocked` with category
171187

172188
## 2.7 Write the plan
173189

174-
Write `context/plans/{plan_name}.md` by applying `references/plan-template.md`
175-
exactly. For revisions, apply its `Updating an existing plan` rules.
190+
Write `context/plans/{plan_name}.md` using `references/plan-template.md`.
191+
192+
When updating an existing plan, keep completed tasks and their evidence intact,
193+
and append or renumber new tasks without disturbing recorded history.
176194

177195
## 2.8 Return the result
178196

179-
Return one internal result with one of these statuses:
197+
Set exactly one internal state:
180198

181199
- `plan_ready`
182200
- `needs_clarification`
183201
- `blocked`
184202

185-
Return only the internal result. Do not add explanatory prose before or after it.
203+
Record only the internal state. Do not add explanatory prose before or after it.
186204

187205
A `plan_ready` result always names the next task in `next_task`, and carries the
188206
`total_tasks` count and any open questions the summary needs. Step 3 renders those
189207
without recomputing them.
190208

191209
## Plan authoring tone
192210

193-
Write user-facing questions and open questions directly and specifically.
194-
195-
- Ask only about material concerns that can change scope, success criteria, or task ordering.
196-
- State the concern and the concrete evidence for it.
197-
- Name a smaller or safer alternative when one is known.
198-
- Do not invent concerns, add praise or reassurance, or repeat the same concern in several forms.
199-
- When the user overrules a concern, record the decision and continue. Do not reintroduce it as a constraint, non-goal, or task.
211+
Every question and open question this phase writes is read by the user. Write
212+
them the way a senior engineer talks in review: direct, specific, and unbothered
213+
by the possibility of being unwelcome.
214+
215+
- Ask about the thing that actually worries you, not a safer neighbouring thing.
216+
A question you would not bother asking a colleague is not worth the user's
217+
attention either.
218+
- State a doubt as a doubt. "I do not think this is worth the two tasks it
219+
costs, because X" is useful. "It may be worth considering whether this aligns
220+
with broader goals" is noise.
221+
- Name the alternative you have in mind. A challenge with no proposal behind it
222+
is just friction.
223+
- Do not open with praise, do not close with reassurance, and do not apologize
224+
for asking. Do not pad a doubt with hedges to make it land more gently.
225+
- Be persistent, not repetitive. Ask once, plainly, and let it stand; do not
226+
restate the same doubt in three shapes to give it more weight.
227+
- Being disagreeable is not the goal. Being easy to agree with is the failure
228+
mode. A plan the user waves through without reading has cost them nothing and
229+
bought them nothing.
230+
231+
When the user overrules a doubt, record it and move on. Do not relitigate a
232+
decision the user has made, and do not smuggle the objection back in as a
233+
constraint, a non-goal, or a task.
200234

201235
## Plan authoring boundaries
202236

@@ -215,7 +249,8 @@ Do not:
215249
- Run task execution.
216250
- Synchronize context.
217251
- Run final validation.
218-
- Write a plan that violates `references/plan-template.md`.
252+
- Author a validation, cleanup, or context-verification task. `/validate` owns
253+
that phase.
219254
- Set internal status `plan_ready` for a plan with no incomplete task.
220255
- Create a Git commit.
221256
- Author more than one plan.

‎.agents/skills/sce-change-to-plan/references/plan-template.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ invent one: `None.` is the expected answer for a well-specified change.}
129129

130130
## Task rules
131131

132-
- Number tasks sequentially as `T01..T0N`.
133132
- Every task is a checkbox line so progress stays machine-readable:
134133
`- [ ] T01: {title} (status:todo)`.
135134
- Author each executable task as one atomic commit unit by default.
@@ -146,9 +145,9 @@ invent one: `None.` is the expected answer for a well-specified change.}
146145

147146
- The last task in the stack is an ordinary implementation task. Do not author a
148147
trailing "validation and cleanup" task.
149-
- Final validation and success-criteria verification are run by `/validate`
150-
from the `Acceptance criteria` section after the last task completes. Validation
151-
reports cleanup or repair work that is still required; it does not perform that work.
148+
- Final validation, cleanup, and success-criteria verification are run by
149+
`/validate` from the `Acceptance criteria` section after the last task
150+
completes.
152151
- Do not author a task whose only purpose is running the full check suite,
153152
verifying durable context, or removing scaffolding.
154153
- A task may still create or update durable context when that context is part of

0 commit comments

Comments
 (0)