@linimin/pi-letscook 0.1.65 → 0.1.66
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/CHANGELOG.md +8 -0
- package/extensions/completion/index.ts +3 -0
- package/extensions/completion/policy-guards.ts +6 -1
- package/extensions/completion/prompt-surfaces.ts +1 -0
- package/package.json +1 -1
- package/scripts/release-check.sh +13 -0
- package/scripts/smoke-test.sh +1 -0
- package/skills/completion-protocol/SKILL.md +4 -2
- package/skills/cook-handoff-boundary/SKILL.md +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.66
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- blocked `completion_role` outside explicit `/cook` workflow-driver turns so ordinary chat can no longer silently dispatch completion subagents on its own
|
|
8
|
+
- tightened ordinary-chat reminders and skill contracts to forbid loading `completion-protocol` before explicit `/cook`
|
|
9
|
+
- expanded smoke and release-parity checks to keep the ordinary-chat vs `/cook` boundary enforced in shipped behavior
|
|
10
|
+
|
|
3
11
|
## 0.1.62
|
|
4
12
|
|
|
5
13
|
### Changed
|
|
@@ -1055,11 +1055,13 @@ export default function completionExtension(pi: ExtensionAPI) {
|
|
|
1055
1055
|
const snapshot = await loadCompletionSnapshot(cwd);
|
|
1056
1056
|
const completionActive = Boolean(snapshot) && asString(snapshot?.state?.continuation_policy) !== "done";
|
|
1057
1057
|
const root = snapshot?.files.root ?? findRepoRoot(cwd) ?? cwd;
|
|
1058
|
+
const completionRoleDispatchAllowed = Boolean(role) || (hasCompletionRoutingActivation(snapshot) && isCompletionDriverPromptTurn(ctx));
|
|
1058
1059
|
const reason = toolCallBlockReason({
|
|
1059
1060
|
toolName: event.toolName,
|
|
1060
1061
|
input: isRecord(event.input) ? event.input : undefined,
|
|
1061
1062
|
role,
|
|
1062
1063
|
completionActive,
|
|
1064
|
+
completionRoleDispatchAllowed,
|
|
1063
1065
|
root,
|
|
1064
1066
|
});
|
|
1065
1067
|
if (reason) return { block: true, reason };
|
|
@@ -1074,6 +1076,7 @@ export default function completionExtension(pi: ExtensionAPI) {
|
|
|
1074
1076
|
"Use completion_role when driving the completion workflow and a mandatory completion role must act next.",
|
|
1075
1077
|
"Use completion_role only for completion-bootstrapper, completion-regrounder, completion-implementer, completion-reviewer, completion-auditor, or completion-stop-judge.",
|
|
1076
1078
|
"Do not use completion_role from inside a completion role; only the workflow driver may dispatch roles.",
|
|
1079
|
+
"Do not call completion_role from ordinary chat; it is reserved for explicit /cook workflow driver turns.",
|
|
1077
1080
|
],
|
|
1078
1081
|
parameters: Type.Object({
|
|
1079
1082
|
role: StringEnum(ROLE_NAMES, { description: "The completion role to invoke." }),
|
|
@@ -62,14 +62,19 @@ export function toolCallBlockReason(args: {
|
|
|
62
62
|
input?: JsonRecord;
|
|
63
63
|
role?: string;
|
|
64
64
|
completionActive: boolean;
|
|
65
|
+
completionRoleDispatchAllowed: boolean;
|
|
65
66
|
root: string;
|
|
66
67
|
}): string | undefined {
|
|
67
|
-
const { toolName, input, role, completionActive, root } = args;
|
|
68
|
+
const { toolName, input, role, completionActive, completionRoleDispatchAllowed, root } = args;
|
|
68
69
|
|
|
69
70
|
if (toolName === "completion_role" && role) {
|
|
70
71
|
return `Nested completion role dispatch is forbidden for ${role}.`;
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
if (toolName === "completion_role" && !completionRoleDispatchAllowed) {
|
|
75
|
+
return "completion_role may only be used from an explicit /cook workflow driver turn.";
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
if (toolName === "edit" || toolName === "write") {
|
|
74
79
|
const rawPath = asString(input?.path);
|
|
75
80
|
if (!rawPath) return undefined;
|
|
@@ -30,6 +30,7 @@ export function buildCookHandoffBoundaryReminder(): string {
|
|
|
30
30
|
"Ordinary chat may clarify requirements, discuss tradeoffs, refine scope, and directly implement requested repo changes, including multi-file work, when that is the most helpful response.",
|
|
31
31
|
"Do not proactively tell the user to run /cook just because a task looks workflow-worthy, and do not emit a ```cook_handoff``` capsule by default in ordinary chat.",
|
|
32
32
|
"/cook is optional workflow mode for resumability, review, audit, canonical .agent state, or deliberate multi-session control; it is not required just to edit repo files in ordinary chat.",
|
|
33
|
+
"In ordinary chat, do not load or follow completion-protocol, and do not call completion_role.",
|
|
33
34
|
"If the user wants direct implementation now, stay in ordinary chat and help directly instead of blocking on /cook.",
|
|
34
35
|
"If the user asks follow-up questions or wants to keep refining scope, continue helping naturally in ordinary chat.",
|
|
35
36
|
"If the user explicitly runs /cook, the extension should call a primary-agent handoff synthesis step from the current task context, then show Start/Cancel confirmation without making the user rerun /cook.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linimin/pi-letscook",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.66",
|
|
4
4
|
"description": "Pi package for long-running completion workflows with canonical .agent state, role-based subagents, continuity, and verification helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
package/scripts/release-check.sh
CHANGED
|
@@ -27,10 +27,23 @@ checks = {
|
|
|
27
27
|
"extensions/completion/prompt-surfaces.ts": [
|
|
28
28
|
'"If the user explicitly runs /cook, the extension should call a primary-agent handoff synthesis step from the current task context, then show Start/Cancel confirmation without making the user rerun /cook."',
|
|
29
29
|
'"Do not expect /cook to infer or guess startup intent from recent discussion alone; /cook should use explicit primary-agent handoff data, whether it already exists or is synthesized in the same /cook entry."',
|
|
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
33
|
'"/cook failed closed because the primary-agent handoff step could not prepare a concrete startup handoff from the current task context. Clarify the mission, first slice, or verification intent in the main chat, then rerun /cook."',
|
|
33
34
|
'description: "/cook workflow: start or replace workflow only from an explicit primary-agent handoff, 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
|
@@ -269,6 +269,7 @@ assert 'ordinary main chat unless the user explicitly runs /cook' in handoff_tex
|
|
|
269
269
|
assert 'directly implement requested repo changes, including multi-file work' in handoff_text, 'ordinary handoff reminder should allow direct ordinary-chat implementation'
|
|
270
270
|
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
271
|
assert '/cook is optional workflow mode' in handoff_text, 'ordinary handoff reminder should position /cook as optional workflow mode'
|
|
272
|
+
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
273
|
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
274
|
assert 'the extension should call a primary-agent handoff synthesis step from the current task context' in handoff_text, 'ordinary handoff reminder should describe same-entry primary-agent handoff synthesis for /cook'
|
|
274
275
|
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'
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -115,6 +117,8 @@ Suggested wording:
|
|
|
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
|