@linimin/pi-letscook 0.1.68 → 0.1.70
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 +2 -3
- package/.agent/verify_completion_control_plane.sh +21 -34
- package/CHANGELOG.md +16 -0
- package/README.md +23 -26
- package/agents/completion-bootstrapper.md +1 -2
- package/agents/completion-regrounder.md +10 -16
- package/extensions/completion/driver.ts +69 -136
- package/extensions/completion/index.ts +94 -81
- package/extensions/completion/policy-guards.ts +1 -1
- package/extensions/completion/prompt-surfaces.ts +63 -161
- package/extensions/completion/proposal.ts +26 -61
- package/extensions/completion/role-runner.ts +161 -57
- package/extensions/completion/state-store.ts +43 -85
- package/extensions/completion/types.ts +2 -3
- package/package.json +1 -1
- package/scripts/active-slice-contract-test.sh +21 -0
- package/scripts/canonical-evidence-artifact-test.sh +57 -65
- package/scripts/context-proposal-test.sh +1430 -310
- package/scripts/legacy-cleanup-test.sh +1 -1
- package/scripts/refocus-test.sh +459 -185
- package/scripts/release-check.sh +14 -15
- package/scripts/role-runner-contract-test.sh +4 -2
- package/scripts/smoke-test.sh +36 -78
- package/skills/completion-protocol/SKILL.md +8 -9
- package/skills/completion-protocol/references/completion.md +2 -37
- package/skills/cook-handoff-boundary/SKILL.md +19 -18
|
@@ -134,11 +134,11 @@ assertIncludes('.agent/README.md', 'durable canonical record of deterministic ve
|
|
|
134
134
|
assertSectionIncludes('skills/completion-protocol/SKILL.md', '## Canonical Files', '- `.agent/verification-evidence.json`');
|
|
135
135
|
assertSectionIncludes('skills/completion-protocol/SKILL.md', '## Canonical Inputs', '- `.agent/verification-evidence.json`');
|
|
136
136
|
assertSectionIncludes('skills/completion-protocol/SKILL.md', '## Compaction And Recovery', '- `.agent/verification-evidence.json`');
|
|
137
|
-
assertSectionIncludes('skills/completion-protocol/SKILL.md', '## Compaction And Recovery', '`completion-implementer` must also re-read canonical `.agent/state.json`, `.agent/
|
|
137
|
+
assertSectionIncludes('skills/completion-protocol/SKILL.md', '## Compaction And 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.');
|
|
138
138
|
assertSectionIncludes('skills/completion-protocol/references/completion.md', '## Ignored Canonical Execution State', '- `.agent/verification-evidence.json`');
|
|
139
139
|
assertSectionIncludes('skills/completion-protocol/references/completion.md', '## Canonical Inputs', '- `.agent/verification-evidence.json`');
|
|
140
140
|
assertSectionIncludes('skills/completion-protocol/references/completion.md', '## Compaction And Recovery', '- `.agent/verification-evidence.json`');
|
|
141
|
-
assertSectionIncludes('skills/completion-protocol/references/completion.md', '## Compaction And Recovery', '`completion-implementer` must also re-read canonical `.agent/state.json`, `.agent/
|
|
141
|
+
assertSectionIncludes('skills/completion-protocol/references/completion.md', '## Compaction And 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.');
|
|
142
142
|
assertIncludes('extensions/completion/prompt-surfaces.ts', 'Verification evidence artifact: ${args.evidence.path} (${args.evidence.status})');
|
|
143
143
|
assertIncludes('extensions/completion/prompt-surfaces.ts', 'Verification evidence summary: ${args.evidence.summary}');
|
|
144
144
|
assertIncludes('extensions/completion/index.ts', 'Canonical verification evidence artifact is currently: ${evidence.path} (${evidence.status})');
|
|
@@ -157,6 +157,13 @@ bash .agent/verify_completion_control_plane.sh >/dev/null
|
|
|
157
157
|
CURRENT_EVIDENCE_BACKUP="$TMPDIR/current-verification-evidence.json"
|
|
158
158
|
cp .agent/verification-evidence.json "$CURRENT_EVIDENCE_BACKUP"
|
|
159
159
|
|
|
160
|
+
CURRENT_EVIDENCE_SUBJECT_TYPE="$(python3 - <<'PY'
|
|
161
|
+
import json
|
|
162
|
+
from pathlib import Path
|
|
163
|
+
print(json.loads(Path('.agent/verification-evidence.json').read_text()).get('subject_type', ''))
|
|
164
|
+
PY
|
|
165
|
+
)"
|
|
166
|
+
|
|
160
167
|
python3 - <<'PY'
|
|
161
168
|
import json
|
|
162
169
|
from pathlib import Path
|
|
@@ -166,14 +173,16 @@ evidence['head_sha'] = 'stale-head'
|
|
|
166
173
|
path.write_text(json.dumps(evidence, indent=2) + '\n')
|
|
167
174
|
PY
|
|
168
175
|
|
|
169
|
-
if
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
if [[ "$CURRENT_EVIDENCE_SUBJECT_TYPE" == "selected_slice" ]]; then
|
|
177
|
+
if bash ./scripts/release-check.sh >/dev/null 2>&1; then
|
|
178
|
+
echo "expected release-check to fail when current repo verification-evidence.json is stale" >&2
|
|
179
|
+
exit 1
|
|
180
|
+
fi
|
|
173
181
|
|
|
174
|
-
if bash .agent/verify_completion_stop.sh >/dev/null 2>&1; then
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
if bash .agent/verify_completion_stop.sh >/dev/null 2>&1; then
|
|
183
|
+
echo "expected verify_completion_stop.sh to fail when current repo verification-evidence.json is stale" >&2
|
|
184
|
+
exit 1
|
|
185
|
+
fi
|
|
177
186
|
fi
|
|
178
187
|
|
|
179
188
|
cp "$CURRENT_EVIDENCE_BACKUP" .agent/verification-evidence.json
|
|
@@ -182,26 +191,27 @@ bash .agent/verify_completion_control_plane.sh >/dev/null
|
|
|
182
191
|
ROOT="$TMPDIR/repo"
|
|
183
192
|
SYSTEM_REMINDER="$TMPDIR/system-reminder.txt"
|
|
184
193
|
BOOTSTRAP_SESSION="$TMPDIR/session-canonical-evidence-bootstrap.jsonl"
|
|
185
|
-
|
|
186
|
-
GENERATED_HANDOFF="$(python3 - <<'PY'
|
|
194
|
+
BOOTSTRAP_MESSAGES="$(python3 - <<'PY'
|
|
187
195
|
import json
|
|
188
196
|
capsule = {
|
|
189
197
|
"kind": "cook_handoff",
|
|
190
198
|
"source": "primary_agent",
|
|
199
|
+
"captured_at": "2026-01-01T00:00:02.000Z",
|
|
200
|
+
"source_turn_id": "m0002",
|
|
191
201
|
"mission": "Exercise canonical evidence fixture bootstrap.",
|
|
192
202
|
"scope": [
|
|
193
203
|
"Materialize canonical completion files for the evidence artifact fixture.",
|
|
194
|
-
"Keep the verification-evidence bootstrap on the supported
|
|
204
|
+
"Keep the verification-evidence bootstrap on the supported explicit-handoff startup path."
|
|
195
205
|
],
|
|
196
206
|
"constraints": [
|
|
197
207
|
"Use supported bare /cook startup only."
|
|
198
208
|
],
|
|
199
209
|
"acceptance": [
|
|
200
|
-
"
|
|
210
|
+
"Write the workflow control-plane files under .agent, including profile.json, state.json, active-slice.json, verification-evidence.json, and the slice backlog file, before the fixture rewrites them.",
|
|
201
211
|
"Keep scripts/canonical-evidence-artifact-test.sh aligned with packaged bootstrap behavior."
|
|
202
212
|
],
|
|
203
213
|
"risks": [
|
|
204
|
-
"Evidence-artifact bootstrap must stay anchored to
|
|
214
|
+
"Evidence-artifact bootstrap must stay anchored to the fresh explicit handoff."
|
|
205
215
|
],
|
|
206
216
|
"notes": [
|
|
207
217
|
"This fixture exists only to scaffold canonical files before rewriting them for evidence parity coverage."
|
|
@@ -223,26 +233,30 @@ capsule = {
|
|
|
223
233
|
"evaluation_profile": "completion-rubric-v1",
|
|
224
234
|
"why_cook_now": "The fixture bootstrap is concrete enough to create canonical control-plane files."
|
|
225
235
|
}
|
|
226
|
-
|
|
236
|
+
messages = [
|
|
237
|
+
{"role": "user", "content": "Prepare the canonical evidence bootstrap fixture and tell me when it is ready for /cook."},
|
|
238
|
+
{"role": "assistant", "content": "The canonical evidence bootstrap fixture is ready for /cook. Run /cook to confirm it.\n\n```cook_handoff\n" + json.dumps(capsule, ensure_ascii=False, indent=2) + "\n```"},
|
|
239
|
+
]
|
|
240
|
+
print(json.dumps(messages, ensure_ascii=False))
|
|
227
241
|
PY
|
|
228
242
|
)"
|
|
229
243
|
mkdir -p "$ROOT"
|
|
230
244
|
cd "$ROOT"
|
|
231
245
|
git init -q
|
|
232
|
-
|
|
246
|
+
write_session_messages "$BOOTSTRAP_SESSION" "$ROOT" "$BOOTSTRAP_MESSAGES"
|
|
233
247
|
|
|
234
248
|
PI_COMPLETION_CONTEXT_PROPOSAL_ACTION=accept \
|
|
235
|
-
|
|
249
|
+
PI_COMPLETION_DISABLE_CONTEXT_PROPOSAL_ANALYST=1 \
|
|
236
250
|
PI_COMPLETION_SKIP_DRIVER_KICKOFF=1 \
|
|
237
251
|
pi --session "$BOOTSTRAP_SESSION" -e "$PKG_ROOT" -p "/cook" \
|
|
238
252
|
>"$TMPDIR/pi-canonical-evidence-bootstrap.out" 2>"$TMPDIR/pi-canonical-evidence-bootstrap.err"
|
|
239
253
|
|
|
240
|
-
for file in .agent/profile.json .agent/state.json .agent/
|
|
254
|
+
for file in .agent/profile.json .agent/state.json .agent/plan.json .agent/active-slice.json .agent/verification-evidence.json; do
|
|
241
255
|
[[ -f "$file" ]] || { echo "missing canonical bootstrap file: $file" >&2; exit 1; }
|
|
242
256
|
done
|
|
243
257
|
|
|
244
258
|
bash .agent/verify_completion_control_plane.sh >/dev/null
|
|
245
|
-
bash .agent/verify_completion_stop.sh >/dev/null
|
|
259
|
+
PI_COMPLETION_RUNNING_RELEASE_CHECK=1 bash .agent/verify_completion_stop.sh >/dev/null
|
|
246
260
|
|
|
247
261
|
python3 - <<'PY'
|
|
248
262
|
import json
|
|
@@ -283,39 +297,14 @@ acceptance = [
|
|
|
283
297
|
'Canonical verification evidence is recorded for the selected slice.',
|
|
284
298
|
'Fail-closed verification rejects missing or stale evidence.',
|
|
285
299
|
]
|
|
286
|
-
startup_plan = {
|
|
287
|
-
'schema_version': 1,
|
|
288
|
-
'artifact_type': 'completion-startup-plan',
|
|
289
|
-
'status': 'approved',
|
|
290
|
-
'source': 'deferred_primary_agent_handoff',
|
|
291
|
-
'captured_at': '2026-05-03T00:00:00Z',
|
|
292
|
-
'mission_anchor': mission,
|
|
293
|
-
'goal_text': 'Mission: Exercise canonical verification evidence parity.\n\nScope:\n- Persist canonical verification evidence for the selected slice.\n- Keep the verifier fail-closed on stale or missing evidence.\n\nAcceptance:\n- Canonical verification evidence is recorded for the selected slice.\n- Fail-closed verification rejects missing or stale evidence.',
|
|
294
|
-
'task_type': task_type,
|
|
295
|
-
'evaluation_profile': evaluation_profile,
|
|
296
|
-
'scope': [
|
|
297
|
-
'Persist canonical verification evidence for the selected slice.',
|
|
298
|
-
'Keep the verifier fail-closed on stale or missing evidence.',
|
|
299
|
-
],
|
|
300
|
-
'constraints': [
|
|
301
|
-
'Keep the fixture scoped to canonical verification evidence parity.',
|
|
302
|
-
],
|
|
303
|
-
'acceptance': acceptance,
|
|
304
|
-
'risks': [
|
|
305
|
-
'Stale startup-plan parity could mask canonical evidence regressions.',
|
|
306
|
-
],
|
|
307
|
-
'notes': [
|
|
308
|
-
'Use startup-plan parity to prove the verifier reads the approved startup plan alongside other canonical state.',
|
|
309
|
-
],
|
|
310
|
-
'planned_surfaces': implementation_surfaces,
|
|
311
|
-
'verification_intent': verification_commands,
|
|
312
|
-
'sequencing_hints': [
|
|
313
|
-
'First slice goal: Persist canonical verification evidence for the selected slice.',
|
|
314
|
-
],
|
|
315
|
-
}
|
|
316
300
|
state = {
|
|
317
301
|
'schema_version': 1,
|
|
318
302
|
'mission_anchor': mission,
|
|
303
|
+
'workflow_entry_status': 'active',
|
|
304
|
+
'workflow_entry_source': '/cook',
|
|
305
|
+
'workflow_entry_confirmed_at': '2026-05-03T00:00:00Z',
|
|
306
|
+
'workflow_session_id': 'evidence-fixture-session',
|
|
307
|
+
'startup_brief_path': '.agent/startup-brief.json',
|
|
319
308
|
'current_phase': 'implement',
|
|
320
309
|
'continuation_policy': 'continue',
|
|
321
310
|
'continuation_reason': 'Fixture for canonical evidence artifact regression coverage.',
|
|
@@ -389,22 +378,25 @@ active = {
|
|
|
389
378
|
'why_now': 'Exercise fail-closed evidence parity.',
|
|
390
379
|
}
|
|
391
380
|
|
|
381
|
+
startup_brief = {
|
|
382
|
+
'schema_version': 1,
|
|
383
|
+
'artifact_type': 'completion-startup-brief',
|
|
384
|
+
'source': 'primary_agent',
|
|
385
|
+
'confirmed': True,
|
|
386
|
+
'confirmed_at': '2026-05-03T00:00:00Z',
|
|
387
|
+
'mission': mission,
|
|
388
|
+
'goal_text': f'Mission: {mission}',
|
|
389
|
+
'scope': ['Exercise canonical verification evidence artifact parity.'],
|
|
390
|
+
'constraints': ['Keep the fixture scoped to verification evidence coverage.'],
|
|
391
|
+
'acceptance': acceptance,
|
|
392
|
+
'risks': ['Fixture drift can hide evidence-parity regressions.'],
|
|
393
|
+
'notes': ['Fixture startup brief for canonical evidence artifact regression coverage.'],
|
|
394
|
+
'task_type': task_type,
|
|
395
|
+
'evaluation_profile': evaluation_profile,
|
|
396
|
+
}
|
|
397
|
+
|
|
392
398
|
Path('.agent/state.json').write_text(json.dumps(state, indent=2) + '\n')
|
|
393
|
-
Path('.agent/startup-
|
|
394
|
-
Path('.agent/startup-plan.md').write_text(
|
|
395
|
-
'# Approved Startup Plan\n\n'
|
|
396
|
-
f'Mission anchor: {mission}\n'
|
|
397
|
-
'Source: deferred_primary_agent_handoff\n'
|
|
398
|
-
'Captured at: 2026-05-03T00:00:00Z\n'
|
|
399
|
-
f'Task type: {task_type}\n'
|
|
400
|
-
f'Evaluation profile: {evaluation_profile}\n\n'
|
|
401
|
-
'## Goal\n\n'
|
|
402
|
-
f"{startup_plan['goal_text']}\n\n"
|
|
403
|
-
'## Planned surfaces\n\n'
|
|
404
|
-
+ ''.join(f'- {item}\n' for item in startup_plan['planned_surfaces'])
|
|
405
|
-
+ '\n## Verification intent\n\n'
|
|
406
|
-
+ ''.join(f'- {item}\n' for item in startup_plan['verification_intent'])
|
|
407
|
-
)
|
|
399
|
+
Path('.agent/startup-brief.json').write_text(json.dumps(startup_brief, indent=2) + '\n')
|
|
408
400
|
Path('.agent/plan.json').write_text(json.dumps(plan, indent=2) + '\n')
|
|
409
401
|
Path('.agent/active-slice.json').write_text(json.dumps(active, indent=2) + '\n')
|
|
410
402
|
PY
|
|
@@ -506,7 +498,7 @@ Path('.agent/verification-evidence.json').write_text(json.dumps(valid, indent=2)
|
|
|
506
498
|
PY
|
|
507
499
|
|
|
508
500
|
bash .agent/verify_completion_control_plane.sh >/dev/null
|
|
509
|
-
bash .agent/verify_completion_stop.sh >/dev/null
|
|
501
|
+
PI_COMPLETION_RUNNING_RELEASE_CHECK=1 bash .agent/verify_completion_stop.sh >/dev/null
|
|
510
502
|
|
|
511
503
|
rm -f "$SYSTEM_REMINDER"
|
|
512
504
|
PI_COMPLETION_TEST_SYSTEM_REMINDER_PATH="$SYSTEM_REMINDER" \
|