@linimin/pi-letscook 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/README.md +4 -0
- package/.agent/verify_completion_control_plane.sh +34 -0
- package/CHANGELOG.md +17 -0
- package/README.md +26 -21
- package/agents/completion-bootstrapper.md +2 -1
- package/agents/completion-regrounder.md +16 -10
- package/extensions/completion/driver.ts +66 -17
- package/extensions/completion/index.ts +99 -21
- package/extensions/completion/policy-guards.ts +6 -1
- package/extensions/completion/prompt-surfaces.ts +157 -15
- package/extensions/completion/proposal.ts +21 -21
- package/extensions/completion/role-runner.ts +11 -10
- package/extensions/completion/state-store.ts +87 -2
- package/extensions/completion/types.ts +3 -0
- package/package.json +1 -1
- package/scripts/active-slice-contract-test.sh +1 -1
- package/scripts/canonical-evidence-artifact-test.sh +49 -4
- package/scripts/context-proposal-test.sh +57 -58
- package/scripts/refocus-test.sh +17 -17
- package/scripts/release-check.sh +24 -11
- package/scripts/smoke-test.sh +70 -9
- package/skills/completion-protocol/SKILL.md +13 -5
- package/skills/completion-protocol/references/completion.md +37 -2
- package/skills/cook-handoff-boundary/SKILL.md +20 -16
package/scripts/release-check.sh
CHANGED
|
@@ -5,32 +5,45 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
5
5
|
cd "$ROOT"
|
|
6
6
|
export PI_COMPLETION_RUNNING_RELEASE_CHECK=1
|
|
7
7
|
|
|
8
|
-
echo "[release-check] running control-plane validation, tracked .agent contract coverage, slice-surface parity,
|
|
8
|
+
echo "[release-check] running control-plane validation, tracked .agent contract coverage, slice-surface parity, /cook startup-plan parity, startup/refocus/context regressions, canonical evidence artifact, active-slice contract, observability, legacy cleanup, evaluator calibration, and rubric contract coverage"
|
|
9
9
|
bash .agent/verify_completion_control_plane.sh
|
|
10
10
|
git ls-files --error-unmatch .agent/README.md .agent/mission.md .agent/profile.json .agent/verify_completion_stop.sh .agent/verify_completion_control_plane.sh >/dev/null
|
|
11
11
|
|
|
12
|
-
echo "[release-check] verifying public /cook parity and
|
|
12
|
+
echo "[release-check] verifying public /cook parity and startup-plan docs/help"
|
|
13
13
|
python3 - <<'PY'
|
|
14
14
|
from pathlib import Path
|
|
15
15
|
|
|
16
16
|
checks = {
|
|
17
17
|
"README.md": [
|
|
18
18
|
"You can still implement directly in ordinary chat when you do not need workflow state.",
|
|
19
|
-
"When you explicitly run `/cook`, it first checks for a fresh explicit primary-agent
|
|
20
|
-
"
|
|
21
|
-
"Explicit `/cook` capsules are still valid startup intake, but they are no longer the only path because `/cook` can synthesize the primary-agent
|
|
19
|
+
"When you explicitly run `/cook`, it first checks for a fresh explicit primary-agent startup-plan preview.",
|
|
20
|
+
"After **Start**, the approved startup plan is written into `.agent/startup-plan.json` / `.agent/startup-plan.md`, and `completion-regrounder` uses it to derive canonical slices from current repo truth.",
|
|
21
|
+
"Explicit `/cook` capsules are still valid startup intake, but they are no longer the only path because `/cook` can synthesize the primary-agent startup plan in the same entry when needed.",
|
|
22
22
|
],
|
|
23
23
|
"CHANGELOG.md": [
|
|
24
|
-
"
|
|
25
|
-
"kept `/cook`
|
|
24
|
+
"rewrote `/cook` startup around an approved startup plan that is captured under `.agent/startup-plan.json` / `.agent/startup-plan.md` after Start instead of leaving startup intent only as advisory intake in `state.json`",
|
|
25
|
+
"kept `/cook` confirm-first while handing the approved startup plan to `completion-regrounder`, which now derives canonical slices from repo truth instead of treating startup intake like an implementation-ready first-slice contract",
|
|
26
26
|
],
|
|
27
27
|
"extensions/completion/prompt-surfaces.ts": [
|
|
28
|
-
'"If the user explicitly runs /cook, the extension should call a primary-agent
|
|
29
|
-
'"
|
|
28
|
+
'"If the user explicitly runs /cook, the extension should call a primary-agent startup-plan synthesis step from the current task context, show Start/Cancel confirmation in the same /cook entry, and only write the approved plan into .agent after Start."',
|
|
29
|
+
'"When /cook starts, the approved startup plan should be written into .agent and then handed to completion-regrounder so canonical slices can be derived from repo truth."',
|
|
30
|
+
'"In ordinary chat, do not load or follow completion-protocol, and do not call completion_role."',
|
|
30
31
|
],
|
|
31
32
|
"extensions/completion/index.ts": [
|
|
32
|
-
'"/cook failed closed because the
|
|
33
|
-
'description: "/cook workflow:
|
|
33
|
+
'"/cook failed closed because the startup-plan step could not prepare a concrete workflow startup plan from the current task context. Clarify the mission, scope, acceptance, or verification intent in the main chat, then rerun /cook."',
|
|
34
|
+
'description: "/cook workflow: capture the approved startup plan into .agent, let completion-regrounder split canonical slices, or resume the current workflow from canonical state"',
|
|
35
|
+
'"Do not call completion_role from ordinary chat; it is reserved for explicit /cook workflow driver turns."',
|
|
36
|
+
],
|
|
37
|
+
"extensions/completion/policy-guards.ts": [
|
|
38
|
+
'return "completion_role may only be used from an explicit /cook workflow driver turn.";',
|
|
39
|
+
],
|
|
40
|
+
"skills/cook-handoff-boundary/SKILL.md": [
|
|
41
|
+
'- load or follow `completion-protocol` while still in ordinary chat',
|
|
42
|
+
'- call `completion_role` before the user has explicitly entered `/cook`',
|
|
43
|
+
],
|
|
44
|
+
"skills/completion-protocol/SKILL.md": [
|
|
45
|
+
'Load this skill only after the user explicitly enters `/cook` and you are operating inside the `completion` workflow as the workflow driver or a completion role.',
|
|
46
|
+
'Do not load or follow this skill from ordinary chat.',
|
|
34
47
|
],
|
|
35
48
|
}
|
|
36
49
|
|
package/scripts/smoke-test.sh
CHANGED
|
@@ -123,10 +123,10 @@ capsule = {
|
|
|
123
123
|
"Keep scripts/smoke-test.sh and kickoff-prompt coverage truthful for packaged bootstrap."
|
|
124
124
|
],
|
|
125
125
|
"risks": [
|
|
126
|
-
"Smoke-test bootstrap should stay anchored to the fresh explicit
|
|
126
|
+
"Smoke-test bootstrap should stay anchored to the fresh explicit startup-plan preview."
|
|
127
127
|
],
|
|
128
128
|
"notes": [
|
|
129
|
-
"Keep the smoke fixture aligned with the shipped
|
|
129
|
+
"Keep the smoke fixture aligned with the shipped startup-plan-driven startup contract."
|
|
130
130
|
],
|
|
131
131
|
"handoff_kind": "implementation_workflow_handoff",
|
|
132
132
|
"first_slice_goal": "Scaffold canonical completion files and verify the packaged startup contract.",
|
|
@@ -140,14 +140,14 @@ capsule = {
|
|
|
140
140
|
"verification_commands": [
|
|
141
141
|
"npm run smoke-test"
|
|
142
142
|
],
|
|
143
|
-
"why_this_slice_first": "The packaged
|
|
143
|
+
"why_this_slice_first": "The packaged startup-plan entry path must work before later workflow verification can run.",
|
|
144
144
|
"task_type": "completion-workflow",
|
|
145
145
|
"evaluation_profile": "completion-rubric-v1",
|
|
146
|
-
"why_cook_now": "The startup
|
|
146
|
+
"why_cook_now": "The startup plan is concrete enough to bootstrap canonical workflow files."
|
|
147
147
|
}
|
|
148
148
|
messages = [
|
|
149
149
|
{"role": "user", "content": "Please prepare the packaged smoke-test bootstrap path and tell me when it is ready for /cook."},
|
|
150
|
-
{"role": "assistant", "content": "This bootstrap path is ready for /cook. Run /cook to confirm the startup
|
|
150
|
+
{"role": "assistant", "content": "This bootstrap path is ready for /cook. Run /cook to confirm the startup plan.\n\n```cook_handoff\n" + json.dumps(capsule, ensure_ascii=False, indent=2) + "\n```"},
|
|
151
151
|
]
|
|
152
152
|
print(json.dumps(messages, ensure_ascii=False))
|
|
153
153
|
PY
|
|
@@ -175,7 +175,7 @@ chooser = Path(sys.argv[5])
|
|
|
175
175
|
|
|
176
176
|
assert not Path('.agent').exists(), 'startup /cook inline-args rejection should leave canonical state untouched'
|
|
177
177
|
assert not routing.exists(), 'startup /cook inline-args rejection should not open active-workflow routing before a workflow exists'
|
|
178
|
-
assert not proposal.exists(), 'startup /cook inline-args rejection should not emit a startup-
|
|
178
|
+
assert not proposal.exists(), 'startup /cook inline-args rejection should not emit a startup-plan proposal snapshot'
|
|
179
179
|
assert not chooser.exists(), 'startup /cook inline-args rejection should not open the existing-workflow chooser before a workflow exists'
|
|
180
180
|
assert '/cook no longer accepts inline arguments.' in output, 'startup /cook inline-args rejection should explain the bare-only entry contract'
|
|
181
181
|
PY
|
|
@@ -189,7 +189,7 @@ PI_COMPLETION_TEST_DRIVER_PROMPT_PATH="$KICKOFF_PROMPT" \
|
|
|
189
189
|
pi --session "$BOOTSTRAP_SESSION" -e "$PKG_ROOT" -p "/cook" \
|
|
190
190
|
>"$TMPDIR/pi-completion-smoke-bootstrap.out" 2>"$TMPDIR/pi-completion-smoke-bootstrap.err"
|
|
191
191
|
|
|
192
|
-
for file in .agent/profile.json .agent/state.json .agent/plan.json .agent/active-slice.json .agent/verification-evidence.json; do
|
|
192
|
+
for file in .agent/profile.json .agent/state.json .agent/startup-plan.json .agent/startup-plan.md .agent/plan.json .agent/active-slice.json .agent/verification-evidence.json; do
|
|
193
193
|
[[ -f "$file" ]] || { echo "missing canonical bootstrap file: $file" >&2; exit 1; }
|
|
194
194
|
done
|
|
195
195
|
|
|
@@ -209,6 +209,8 @@ profile = json.loads(Path('.agent/profile.json').read_text())
|
|
|
209
209
|
state = json.loads(Path('.agent/state.json').read_text())
|
|
210
210
|
plan = json.loads(Path('.agent/plan.json').read_text())
|
|
211
211
|
active = json.loads(Path('.agent/active-slice.json').read_text())
|
|
212
|
+
startup_plan = json.loads(Path('.agent/startup-plan.json').read_text())
|
|
213
|
+
startup_plan_md = Path('.agent/startup-plan.md').read_text()
|
|
212
214
|
evidence = json.loads(Path('.agent/verification-evidence.json').read_text())
|
|
213
215
|
kickoff = Path(sys.argv[1]).read_text()
|
|
214
216
|
|
|
@@ -228,11 +230,20 @@ assert brief['source'] == 'primary_agent_handoff', 'smoke bootstrap should recor
|
|
|
228
230
|
assert brief['mission'] == state['mission_anchor'], 'advisory startup brief mission should match the canonical mission anchor after bootstrap'
|
|
229
231
|
assert brief['scope'] == ['Materialize the canonical completion control-plane files.', 'Keep the smoke test on supported /cook startup behavior.'], 'advisory startup brief should preserve scope items'
|
|
230
232
|
assert brief['constraints'] == ['Keep startup proposal confirmation approval-only.'], 'advisory startup brief should preserve constraints'
|
|
233
|
+
assert startup_plan['artifact_type'] == 'completion-startup-plan', 'startup-plan.json should persist the approved startup plan canonically'
|
|
234
|
+
assert startup_plan['mission_anchor'] == state['mission_anchor'], 'startup-plan.json mission anchor should match canonical workflow state'
|
|
235
|
+
assert startup_plan['source'] == 'primary_agent_handoff', 'startup-plan.json should preserve the primary-agent startup source'
|
|
236
|
+
assert startup_plan['scope'] == brief['scope'], 'startup-plan.json should preserve approved scope items'
|
|
237
|
+
assert startup_plan['constraints'] == brief['constraints'], 'startup-plan.json should preserve approved constraints'
|
|
238
|
+
assert startup_plan['planned_surfaces'] == ['.agent/README.md', 'scripts/smoke-test.sh'], 'startup-plan.json should preserve planned surfaces derived from startup hints'
|
|
239
|
+
assert startup_plan['verification_intent'] == ['npm run smoke-test'], 'startup-plan.json should preserve verification intent derived from startup hints'
|
|
240
|
+
assert '## Planned surfaces' in startup_plan_md, 'startup-plan.md should render planned surfaces as a readable section'
|
|
241
|
+
assert '.agent/README.md' in startup_plan_md and 'scripts/smoke-test.sh' in startup_plan_md, 'startup-plan.md should mirror planned surfaces'
|
|
231
242
|
assert brief['acceptance'] == [
|
|
232
243
|
'Scaffold .agent/profile.json, .agent/state.json, .agent/plan.json, .agent/active-slice.json, and .agent/verification-evidence.json for the smoke fixture.',
|
|
233
244
|
'Keep scripts/smoke-test.sh and kickoff-prompt coverage truthful for packaged bootstrap.'
|
|
234
245
|
], 'advisory startup brief should preserve acceptance'
|
|
235
|
-
assert brief['risks'] == ['Smoke-test bootstrap should stay anchored to the fresh explicit
|
|
246
|
+
assert brief['risks'] == ['Smoke-test bootstrap should stay anchored to the fresh explicit startup-plan preview.'], 'advisory startup brief should preserve startup-plan risks'
|
|
236
247
|
assert 'First slice goal: Scaffold canonical completion files and verify the packaged startup contract.' in brief['notes'], 'advisory startup brief should preserve the first_slice_goal in notes'
|
|
237
248
|
assert 'Verification commands: npm run smoke-test' in brief['notes'], 'advisory startup brief should preserve verification_commands in notes'
|
|
238
249
|
assert evidence['artifact_type'] == 'completion-verification-evidence', 'verification-evidence.json artifact_type mismatch after bootstrap'
|
|
@@ -269,9 +280,11 @@ assert 'ordinary main chat unless the user explicitly runs /cook' in handoff_tex
|
|
|
269
280
|
assert 'directly implement requested repo changes, including multi-file work' in handoff_text, 'ordinary handoff reminder should allow direct ordinary-chat implementation'
|
|
270
281
|
assert 'Do not proactively tell the user to run /cook' in handoff_text, 'ordinary handoff reminder should keep ordinary chat neutral until explicit /cook entry'
|
|
271
282
|
assert '/cook is optional workflow mode' in handoff_text, 'ordinary handoff reminder should position /cook as optional workflow mode'
|
|
283
|
+
assert 'In ordinary chat, do not load or follow completion-protocol, and do not call completion_role.' in handoff_text, 'ordinary handoff reminder should forbid workflow-role routing before explicit /cook'
|
|
272
284
|
assert 'If the user wants direct implementation now, stay in ordinary chat and help directly instead of blocking on /cook.' in handoff_text, 'ordinary handoff reminder should avoid blocking implementation on /cook'
|
|
273
|
-
assert 'the extension should call a primary-agent
|
|
285
|
+
assert 'the extension should call a primary-agent startup-plan synthesis step from the current task context' in handoff_text, 'ordinary handoff reminder should describe same-entry primary-agent startup-plan synthesis for /cook'
|
|
274
286
|
assert 'Do not expect /cook to infer or guess startup intent from recent discussion alone' in handoff_text, 'ordinary handoff reminder should forbid /cook-side guessing'
|
|
287
|
+
assert 'the approved startup plan should be written into .agent and then handed to completion-regrounder' in handoff_text, 'ordinary handoff reminder should mention startup-plan persistence and regrounder slice derivation'
|
|
275
288
|
assert 'do not silently rewrite discussion into canonical workflow state' in handoff_text, 'ordinary handoff reminder should preserve non-canonical ordinary-chat behavior'
|
|
276
289
|
assert not auto_resume.exists(), 'ordinary non-/cook turn should not queue auto-resume before /cook activation'
|
|
277
290
|
assert 'Skipped completion workflow auto-resume prompt (test mode)' not in output, 'ordinary non-/cook turn should not attempt auto-resume'
|
|
@@ -375,6 +388,54 @@ active['evaluation_profile'] = profile['evaluation_profile']
|
|
|
375
388
|
active_path.write_text(json.dumps(active, indent=2) + '\n')
|
|
376
389
|
PY
|
|
377
390
|
|
|
391
|
+
python3 - <<'PY'
|
|
392
|
+
import json
|
|
393
|
+
from pathlib import Path
|
|
394
|
+
path = Path('.agent/startup-plan.json')
|
|
395
|
+
startup = json.loads(path.read_text())
|
|
396
|
+
startup.pop('task_type', None)
|
|
397
|
+
path.write_text(json.dumps(startup, indent=2) + '\n')
|
|
398
|
+
PY
|
|
399
|
+
|
|
400
|
+
if bash .agent/verify_completion_control_plane.sh >/dev/null 2>&1; then
|
|
401
|
+
echo "expected control-plane verification to fail when startup-plan.json omits task_type" >&2
|
|
402
|
+
exit 1
|
|
403
|
+
fi
|
|
404
|
+
|
|
405
|
+
python3 - <<'PY'
|
|
406
|
+
import json
|
|
407
|
+
from pathlib import Path
|
|
408
|
+
profile = json.loads(Path('.agent/profile.json').read_text())
|
|
409
|
+
startup_path = Path('.agent/startup-plan.json')
|
|
410
|
+
startup = json.loads(startup_path.read_text())
|
|
411
|
+
startup['task_type'] = profile['task_type']
|
|
412
|
+
startup_path.write_text(json.dumps(startup, indent=2) + '\n')
|
|
413
|
+
PY
|
|
414
|
+
|
|
415
|
+
python3 - <<'PY'
|
|
416
|
+
import json
|
|
417
|
+
from pathlib import Path
|
|
418
|
+
path = Path('.agent/startup-plan.json')
|
|
419
|
+
startup = json.loads(path.read_text())
|
|
420
|
+
startup['mission_anchor'] = 'drifted-startup-plan-mission'
|
|
421
|
+
path.write_text(json.dumps(startup, indent=2) + '\n')
|
|
422
|
+
PY
|
|
423
|
+
|
|
424
|
+
if bash .agent/verify_completion_control_plane.sh >/dev/null 2>&1; then
|
|
425
|
+
echo "expected control-plane verification to fail when startup-plan.json mission_anchor drifts from canonical workflow state" >&2
|
|
426
|
+
exit 1
|
|
427
|
+
fi
|
|
428
|
+
|
|
429
|
+
python3 - <<'PY'
|
|
430
|
+
import json
|
|
431
|
+
from pathlib import Path
|
|
432
|
+
state = json.loads(Path('.agent/state.json').read_text())
|
|
433
|
+
startup_path = Path('.agent/startup-plan.json')
|
|
434
|
+
startup = json.loads(startup_path.read_text())
|
|
435
|
+
startup['mission_anchor'] = state['mission_anchor']
|
|
436
|
+
startup_path.write_text(json.dumps(startup, indent=2) + '\n')
|
|
437
|
+
PY
|
|
438
|
+
|
|
378
439
|
python3 - <<'PY'
|
|
379
440
|
import json
|
|
380
441
|
from pathlib import Path
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: completion-protocol
|
|
3
|
-
description: Shared completion workflow protocol for long-running coding tasks with canonical .agent state, one-slice execution, mandatory role dispatch, recovery, and final stop criteria. Use
|
|
3
|
+
description: Shared completion workflow protocol for long-running coding tasks with canonical .agent state, one-slice execution, mandatory role dispatch, recovery, and final stop criteria. Use only after the user explicitly enters `/cook` and the main session becomes the completion workflow driver.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Completion Protocol
|
|
7
7
|
|
|
8
|
-
Load this skill
|
|
8
|
+
Load this skill only after the user explicitly enters `/cook` and you are operating inside the `completion` workflow as the workflow driver or a completion role.
|
|
9
|
+
|
|
10
|
+
Do not load or follow this skill from ordinary chat.
|
|
9
11
|
|
|
10
12
|
This skill defines shared protocol facts only. Role-specific behavior belongs in the dedicated completion agents:
|
|
11
13
|
|
|
@@ -19,7 +21,9 @@ This skill defines shared protocol facts only. Role-specific behavior belongs in
|
|
|
19
21
|
## Shared Rules
|
|
20
22
|
|
|
21
23
|
- Current repo truth beats stale notes, stale summaries, and conversation memory.
|
|
22
|
-
- `plan.json` is the
|
|
24
|
+
- `startup-plan.json` is the approved workflow startup plan captured at `/cook`. Treat it as planning input only: `completion-regrounder` must reconcile it against current repo truth and derive canonical slices instead of copying it blindly into `plan.json`.
|
|
25
|
+
- `startup-plan.md` is the human-readable rendering of that same approved startup plan and must remain in parity with `startup-plan.json`.
|
|
26
|
+
- `plan.json` is the persistent machine-readable slice backlog. Rebuild it during every re-grounding wave from repo truth plus the approved startup plan, and keep it truthful after every committed slice.
|
|
23
27
|
- `state.json` is the persistent machine-readable workflow controller. Keep `current_phase`, `continuation_policy`, `continuation_reason`, `next_mandatory_role`, and `next_mandatory_action` truthful after every transition.
|
|
24
28
|
- Every slice in `plan.json` must have non-empty `acceptance_criteria` — concrete, verifiable conditions that define done. A slice without acceptance criteria is invalid and must not be selected.
|
|
25
29
|
- Acceptance criteria are immutable after lock except for removing a criterion already satisfied with evidence or adding a missing criterion discovered during implementation.
|
|
@@ -74,7 +78,7 @@ If the workflow driver detects that the next mandatory action belongs to a compl
|
|
|
74
78
|
|
|
75
79
|
1. If tracked protocol contract files are missing or first-time onboarding is required, invoke `completion-bootstrapper`.
|
|
76
80
|
2. If canonical `.agent` execution state is missing, invalid, contradictory, stale, or ambiguous after compaction or recovery, invoke `completion-regrounder`.
|
|
77
|
-
3. If no slice is selected, invoke `completion-regrounder` to reconcile `.agent/plan.json` and return the next exact handoff payload.
|
|
81
|
+
3. If no slice is selected, invoke `completion-regrounder` to read `.agent/startup-plan.json`, reconcile `.agent/plan.json` against current repo truth, and return the next exact handoff payload.
|
|
78
82
|
4. If a slice is `selected` or `in_progress` and no new slice commit exists yet, invoke `completion-implementer`.
|
|
79
83
|
5. If the latest committed slice lacks a review result, invoke `completion-reviewer`.
|
|
80
84
|
6. If the latest committed slice lacks an audit result, invoke `completion-auditor`.
|
|
@@ -97,6 +101,8 @@ Tracked repo-contract files:
|
|
|
97
101
|
Ignored canonical execution-state files:
|
|
98
102
|
|
|
99
103
|
- `.agent/state.json`
|
|
104
|
+
- `.agent/startup-plan.json`
|
|
105
|
+
- `.agent/startup-plan.md`
|
|
100
106
|
- `.agent/plan.json`
|
|
101
107
|
- `.agent/active-slice.json`
|
|
102
108
|
- `.agent/slice-history.jsonl`
|
|
@@ -112,6 +118,7 @@ Read these when making completion decisions:
|
|
|
112
118
|
- `.agent/README.md`
|
|
113
119
|
- `.agent/profile.json`
|
|
114
120
|
- `.agent/state.json`
|
|
121
|
+
- `.agent/startup-plan.json`
|
|
115
122
|
- `.agent/plan.json`
|
|
116
123
|
- `.agent/active-slice.json`
|
|
117
124
|
- `.agent/slice-history.jsonl`
|
|
@@ -138,6 +145,7 @@ Canonical truth remains in `.agent/**`.
|
|
|
138
145
|
After context compaction, suspected memory loss, stalled-role recovery, or any ambiguous completion state, the workflow driver must re-read:
|
|
139
146
|
|
|
140
147
|
- `.agent/state.json`
|
|
148
|
+
- `.agent/startup-plan.json`
|
|
141
149
|
- `.agent/plan.json`
|
|
142
150
|
- `.agent/active-slice.json`
|
|
143
151
|
- `.agent/verification-evidence.json`
|
|
@@ -155,7 +163,7 @@ The exact implementer handoff now includes implementation-scope surfaces and exp
|
|
|
155
163
|
|
|
156
164
|
The workflow driver must not continue implementation, review, audit, or stop evaluation from compacted conversation memory alone.
|
|
157
165
|
|
|
158
|
-
After compaction or recovery, `completion-implementer` must also re-read canonical `.agent/state.json`, `.agent/plan.json`, `.agent/active-slice.json`, and `.agent/verification-evidence.json` before resuming work. If `.agent/active-slice.json` still contains a truthful exact handoff snapshot, continue from canonical state rather than asking the user to resend the original caller payload.
|
|
166
|
+
After compaction or recovery, `completion-implementer` must also re-read canonical `.agent/state.json`, `.agent/startup-plan.json`, `.agent/plan.json`, `.agent/active-slice.json`, and `.agent/verification-evidence.json` before resuming work. If `.agent/active-slice.json` still contains a truthful exact handoff snapshot, continue from canonical state rather than asking the user to resend the original caller payload.
|
|
159
167
|
|
|
160
168
|
## Shared Report Header
|
|
161
169
|
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
## Ignored Canonical Execution State
|
|
14
14
|
|
|
15
15
|
- `.agent/state.json`
|
|
16
|
+
- `.agent/startup-plan.json`
|
|
17
|
+
- `.agent/startup-plan.md`
|
|
16
18
|
- `.agent/plan.json`
|
|
17
19
|
- `.agent/active-slice.json`
|
|
18
20
|
- `.agent/slice-history.jsonl`
|
|
@@ -28,6 +30,7 @@ Read these when making completion decisions:
|
|
|
28
30
|
- `.agent/README.md`
|
|
29
31
|
- `.agent/profile.json`
|
|
30
32
|
- `.agent/state.json`
|
|
33
|
+
- `.agent/startup-plan.json`
|
|
31
34
|
- `.agent/plan.json`
|
|
32
35
|
- `.agent/active-slice.json`
|
|
33
36
|
- `.agent/slice-history.jsonl`
|
|
@@ -130,6 +133,37 @@ Rules:
|
|
|
130
133
|
4. `continuation_policy == paused` means the user explicitly paused the workflow.
|
|
131
134
|
5. `continuation_policy == done` means canonical final stop reconciliation is complete and the workflow may stop.
|
|
132
135
|
|
|
136
|
+
## Fixed Startup Plan Model
|
|
137
|
+
|
|
138
|
+
`startup-plan.json` carries the approved workflow startup plan captured at `/cook`.
|
|
139
|
+
|
|
140
|
+
Required fields:
|
|
141
|
+
|
|
142
|
+
- `schema_version`
|
|
143
|
+
- `artifact_type` where the value is `completion-startup-plan`
|
|
144
|
+
- `status` where the value is `approved`
|
|
145
|
+
- `source`
|
|
146
|
+
- `captured_at`
|
|
147
|
+
- `mission_anchor`
|
|
148
|
+
- `goal_text`
|
|
149
|
+
- `task_type`
|
|
150
|
+
- `evaluation_profile`
|
|
151
|
+
- `scope`
|
|
152
|
+
- `constraints`
|
|
153
|
+
- `acceptance`
|
|
154
|
+
- `risks`
|
|
155
|
+
- `notes`
|
|
156
|
+
- `planned_surfaces`
|
|
157
|
+
- `verification_intent`
|
|
158
|
+
- `sequencing_hints`
|
|
159
|
+
|
|
160
|
+
Rules:
|
|
161
|
+
|
|
162
|
+
1. `startup-plan.json` is canonical startup intake, not canonical slice selection.
|
|
163
|
+
2. `completion-regrounder` must treat `startup-plan.json` as planning input, reconcile it against current repo truth, and derive canonical slices in `plan.json`.
|
|
164
|
+
3. `startup-plan.json` must stay aligned with the current canonical mission anchor in `.agent/state.json`, `.agent/plan.json`, and `.agent/active-slice.json` until a later `/cook` refocus or next-round startup rewrites it.
|
|
165
|
+
4. `startup-plan.md` is the human-readable rendering of the same approved startup plan and must remain in parity with `startup-plan.json`.
|
|
166
|
+
|
|
133
167
|
`plan.json` carries the ordered persistent slice backlog.
|
|
134
168
|
|
|
135
169
|
Required fields:
|
|
@@ -338,7 +372,7 @@ It must not, while a slice is selected or in progress:
|
|
|
338
372
|
|
|
339
373
|
1. If tracked protocol contract files are missing or first-time onboarding is required, invoke `completion-bootstrapper`.
|
|
340
374
|
2. If canonical `.agent` execution state is missing, stale, invalid, contradictory, or ambiguous after compaction or recovery, invoke `completion-regrounder` first.
|
|
341
|
-
3. If no slice is selected, invoke `completion-regrounder` to reconcile `.agent/plan.json` and return the next exact handoff payload.
|
|
375
|
+
3. If no slice is selected, invoke `completion-regrounder` to read `.agent/startup-plan.json`, reconcile `.agent/plan.json` against current repo truth, and return the next exact handoff payload.
|
|
342
376
|
4. If a slice is `selected` or `in_progress` and no new commit exists for it yet, invoke `completion-implementer`.
|
|
343
377
|
5. If the latest committed slice lacks review, invoke `completion-reviewer`.
|
|
344
378
|
6. If the latest committed slice lacks audit, invoke `completion-auditor`.
|
|
@@ -351,6 +385,7 @@ It must not, while a slice is selected or in progress:
|
|
|
351
385
|
After context compaction, suspected memory loss, stalled-role recovery, or any ambiguous completion state, the workflow root must re-read:
|
|
352
386
|
|
|
353
387
|
- `.agent/state.json`
|
|
388
|
+
- `.agent/startup-plan.json`
|
|
354
389
|
- `.agent/plan.json`
|
|
355
390
|
- `.agent/active-slice.json`
|
|
356
391
|
- `.agent/verification-evidence.json`
|
|
@@ -366,7 +401,7 @@ The workflow root must invoke `completion-regrounder` before continuing whenever
|
|
|
366
401
|
|
|
367
402
|
The workflow root must not continue implementation, review, audit, or stop evaluation from compacted conversation memory alone.
|
|
368
403
|
|
|
369
|
-
After compaction or recovery, `completion-implementer` must also re-read canonical `.agent/state.json`, `.agent/plan.json`, `.agent/active-slice.json`, and `.agent/verification-evidence.json` before resuming work. If `.agent/active-slice.json` still contains a truthful exact handoff snapshot, continue from canonical state rather than asking the user to resend the original caller payload.
|
|
404
|
+
After compaction or recovery, `completion-implementer` must also re-read canonical `.agent/state.json`, `.agent/startup-plan.json`, `.agent/plan.json`, `.agent/active-slice.json`, and `.agent/verification-evidence.json` before resuming work. If `.agent/active-slice.json` still contains a truthful exact handoff snapshot, continue from canonical state rather than asking the user to resend the original caller payload.
|
|
370
405
|
|
|
371
406
|
## Default Priority Policy
|
|
372
407
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cook-handoff-boundary
|
|
3
|
-
description: Ordinary-chat contract for treating `/cook` as an optional workflow mode while requiring `/cook` to
|
|
3
|
+
description: Ordinary-chat contract for treating `/cook` as an optional workflow mode while requiring `/cook` to capture a primary-agent-authored startup plan instead of guessing from recent discussion.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /cook Handoff Boundary
|
|
@@ -34,6 +34,8 @@ The primary agent should not:
|
|
|
34
34
|
|
|
35
35
|
- proactively tell the user to run `/cook` just because the task looks workflow-worthy
|
|
36
36
|
- proactively emit a `cook_handoff` capsule by default
|
|
37
|
+
- load or follow `completion-protocol` while still in ordinary chat
|
|
38
|
+
- call `completion_role` before the user has explicitly entered `/cook`
|
|
37
39
|
- act as though workflow has already started when it has not
|
|
38
40
|
- silently rewrite ordinary-chat discussion into canonical workflow state
|
|
39
41
|
|
|
@@ -56,20 +58,20 @@ But even in those cases:
|
|
|
56
58
|
|
|
57
59
|
If the user explicitly runs or clearly chooses `/cook` workflow mode, the system behavior should be:
|
|
58
60
|
|
|
59
|
-
1. check for a fresh explicit primary-agent `cook_handoff`
|
|
60
|
-
2. if none exists, call a primary-agent
|
|
61
|
-
3. use that
|
|
62
|
-
4. write canonical
|
|
61
|
+
1. check for a fresh explicit primary-agent `cook_handoff` preview when one already exists
|
|
62
|
+
2. if none exists, call a primary-agent startup-plan synthesis step immediately from the current task context
|
|
63
|
+
3. use that startup plan to show Start / Cancel confirmation in the same `/cook` entry
|
|
64
|
+
4. after Start, write the approved startup plan into `.agent/startup-plan.json` / `.agent/startup-plan.md`, then let `completion-regrounder` derive canonical slices from repo truth
|
|
63
65
|
|
|
64
66
|
That means:
|
|
65
67
|
|
|
66
|
-
- `/cook` must not infer or guess
|
|
67
|
-
- `/cook` should use primary-agent-authored
|
|
68
|
-
- `/cook` should not require a manual rerun just to consume a
|
|
68
|
+
- `/cook` must not infer or guess canonical slices from recent discussion alone
|
|
69
|
+
- `/cook` should use primary-agent-authored startup-plan data
|
|
70
|
+
- `/cook` should not require a manual rerun just to consume a startup plan it can synthesize immediately from the primary-agent view
|
|
69
71
|
|
|
70
72
|
## Optional Preview Behavior
|
|
71
73
|
|
|
72
|
-
Only if the user explicitly asks for a preview startup
|
|
74
|
+
Only if the user explicitly asks for a preview startup plan or handoff capsule in ordinary chat may the primary agent provide one.
|
|
73
75
|
|
|
74
76
|
Optional preview capsule format:
|
|
75
77
|
|
|
@@ -80,7 +82,7 @@ Optional preview capsule format:
|
|
|
80
82
|
"source": "primary_agent",
|
|
81
83
|
"captured_at": "<ISO-8601 timestamp>",
|
|
82
84
|
"source_turn_id": "<current assistant turn id>",
|
|
83
|
-
"mission": "<
|
|
85
|
+
"mission": "<approved workflow mission>",
|
|
84
86
|
"scope": ["..."],
|
|
85
87
|
"constraints": ["..."],
|
|
86
88
|
"non_goals": ["..."],
|
|
@@ -103,31 +105,33 @@ Optional preview capsule format:
|
|
|
103
105
|
Notes:
|
|
104
106
|
|
|
105
107
|
- `constraints` may be replaced or supplemented by `non_goals` when clearer.
|
|
106
|
-
- `first_slice_goal`, `first_slice_non_goals`, `implementation_surfaces`, `verification_commands`, and `why_this_slice_first` are
|
|
108
|
+
- `first_slice_goal`, `first_slice_non_goals`, `implementation_surfaces`, `verification_commands`, and `why_this_slice_first` are optional sequencing hints. They help `completion-regrounder` split slices later when they are already obvious, but the approved startup plan may still be startable without them.
|
|
107
109
|
- Any capsule is startup intake for `/cook` only. It is not canonical `.agent/**` state, not active-slice state, and not a second repo contract source.
|
|
108
110
|
|
|
109
111
|
Suggested wording:
|
|
110
112
|
|
|
111
|
-
> We can continue directly in ordinary chat if you want. If you prefer workflow mode, run `/cook` and it should
|
|
113
|
+
> We can continue directly in ordinary chat if you want. If you prefer workflow mode, run `/cook` and it should capture an approved startup plan for Start / Cancel confirmation, then hand that plan to `completion-regrounder` for slice derivation.
|
|
112
114
|
|
|
113
115
|
## Forbidden Behaviors
|
|
114
116
|
|
|
115
117
|
Before the user explicitly runs `/cook`, the primary agent must not:
|
|
116
118
|
|
|
117
119
|
- pretend `/cook` has already been invoked
|
|
120
|
+
- load or follow `completion-protocol`
|
|
121
|
+
- call `completion_role` or any completion subagent
|
|
118
122
|
- silently rewrite ordinary-chat discussion into active workflow state
|
|
119
123
|
- claim canonical `.agent/**` startup state exists when it does not
|
|
120
124
|
- refuse ordinary-chat implementation solely because `/cook` would also be possible
|
|
121
125
|
|
|
122
126
|
When the user does explicitly choose `/cook`, the system must not:
|
|
123
127
|
|
|
124
|
-
- let `/cook` invent
|
|
125
|
-
- let `/cook` replace missing
|
|
126
|
-
- require a second `/cook` invocation when same-entry primary-agent
|
|
128
|
+
- let `/cook` invent canonical slices from recent discussion alone
|
|
129
|
+
- let `/cook` replace missing startup-plan data with generic transcript guessing
|
|
130
|
+
- require a second `/cook` invocation when same-entry primary-agent startup-plan synthesis is possible
|
|
127
131
|
|
|
128
132
|
## Relationship To `completion-protocol`
|
|
129
133
|
|
|
130
|
-
This skill is only about pre-`/cook` ordinary-chat behavior and `/cook`
|
|
134
|
+
This skill is only about pre-`/cook` ordinary-chat behavior and `/cook` startup-plan expectations.
|
|
131
135
|
|
|
132
136
|
After the user explicitly enters `/cook`, the separate `completion-protocol` skill governs:
|
|
133
137
|
|