@linimin/pi-letscook 0.1.52 → 0.1.53

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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.53
6
+
7
+ ### Changed
8
+
9
+ - removed assist mode from public routing behavior so natural-language entry is now either off or router, and made router the default trigger mode while keeping `/cook` as the canonical workflow boundary
10
+ - removed obsolete cook planning docs that no longer match the shipped router-only workflow entry behavior
11
+
5
12
  ## 0.1.52
6
13
 
7
14
  ### Changed
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `/cook` turns main-chat discussion about concrete repo changes into a resumable repo workflow stored in repo-local `.agent/**` state.
4
4
 
5
- Natural-language routing is optional and shipped in three modes: `off` disables it, `assist` offers short confirm-first handoffs after clear workflow discussion, and `router` reviews each non-bypass user turn before implementation starts while leaving ordinary questions in the main chat. In every mode, `/cook` remains the canonical workflow boundary and manual fallback.
5
+ Natural-language routing is optional and shipped in two modes: `off` disables it, and `router` reviews each non-bypass user turn before implementation starts while leaving ordinary questions in the main chat. In every mode, `/cook` remains the canonical workflow boundary and manual fallback.
6
6
 
7
7
  ## Use it when
8
8
 
@@ -46,8 +46,8 @@ Then run `/reload` in Pi.
46
46
  |---|---|
47
47
  | Start a long-running task | Discuss the concrete repo change in the main chat, then run `/cook` |
48
48
  | Bias mission detection toward one intent | Run `/cook <hint>` |
49
- | Change natural-language routing behavior | Set `PI_COMPLETION_TRIGGER_MODE=off`, `assist`, or `router` before starting Pi |
50
- | Hand off from discussion into the same `/cook` flow | In `assist`, say `開始做`, `開始實作`, or `go ahead`, then accept the confirmation |
49
+ | Change natural-language routing behavior | Set `PI_COMPLETION_TRIGGER_MODE=off` or `router` before starting Pi |
50
+ | Hand off from discussion into the same `/cook` flow | In `router`, say `開始做`, `開始實作`, or `go ahead`, then accept the confirmation |
51
51
  | Continue the current workflow | Run `/cook` |
52
52
  | Use the canonical fallback when natural-language routing does not fire or you want to bypass it | Run `/cook` explicitly |
53
53
 
@@ -66,8 +66,7 @@ If recent discussion is missing, weak, ambiguous, assistant-produced, or only de
66
66
  Set `PI_COMPLETION_TRIGGER_MODE` before starting Pi if you want to change how natural-language routing behaves:
67
67
 
68
68
  - `off` — natural-language routing is disabled. Only explicit `/cook` or `/cook <hint>` can enter the workflow.
69
- - `assist` *(default)* — after clear discussion of a concrete repo change, short execution handoff phrases such as `開始做`, `開始實作`, or `go ahead` can offer to enter the same `/cook` flow before the primary agent starts implementation work.
70
- - `router` — the workflow-aware router reviews each non-bypass normal user turn before implementation starts. Ordinary questions stay in the main chat, while direct start/resume/refocus/next-round prompts can offer the shared `/cook` flow with confirmation or clarification.
69
+ - `router` *(default)* — the workflow-aware router reviews each non-bypass normal user turn before implementation starts. Ordinary questions stay in the main chat, while direct start/resume/refocus/next-round prompts can offer the shared `/cook` flow with confirmation or clarification. Short execution handoff phrases such as `開始做`, `開始實作`, or `go ahead` are covered by the same router path.
71
70
 
72
71
  Important behavior:
73
72
  - natural-language routing is only a shortcut into `/cook`; `/cook` is still the canonical workflow boundary and manual fallback
@@ -100,7 +99,7 @@ We should implement the natural-language routing path next.
100
99
 
101
100
  ## What happens when you run `/cook`
102
101
 
103
- `/cook` supports both bare discussion-driven startup and optional inline intent hints. Explicit `/cook` is always the canonical fallback, even when natural-language routing is enabled in `assist` or `router` mode.
102
+ `/cook` supports both bare discussion-driven startup and optional inline intent hints. Explicit `/cook` is always the canonical fallback, even when natural-language routing is enabled in `router` mode.
104
103
 
105
104
  | Repo state | What you'll see |
106
105
  |---|---|
@@ -209,9 +209,9 @@ function maybeWriteTestSnapshot(targetPath: string | undefined, content: string)
209
209
 
210
210
  const COOK_MAIN_CHAT_RERUN_GUIDANCE = "Discuss changes in the main chat and rerun /cook.";
211
211
  const COOK_BARE_ONLY_GUIDANCE =
212
- "/cook remains the canonical workflow boundary. Natural-language routing can stay off, run in assist mode for short confirm-first handoffs, or run in router mode to review each non-bypass user turn before implementation starts, but the shared /cook flow still owns mission selection and confirmation.";
212
+ "/cook remains the canonical workflow boundary. Natural-language routing can stay off or run in router mode to review each non-bypass user turn before implementation starts, but the shared /cook flow still owns mission selection and confirmation.";
213
213
  const COOK_STRUCTURED_DISCUSSION_FAILURE_DETAIL =
214
- "/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Assist and router modes only offer the same /cook flow, and router recovery only replays to normal chat when you explicitly choose Send as normal chat, so clarify the concrete repo changes in the main chat and rerun /cook.";
214
+ "/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Router mode only offers the same /cook flow, and router recovery only replays to normal chat when you explicitly choose Send as normal chat, so clarify the concrete repo changes in the main chat and rerun /cook.";
215
215
 
216
216
  function buildCookCancellationMessage(prefix: string): string {
217
217
  return `${prefix}. ${COOK_MAIN_CHAT_RERUN_GUIDANCE}`;
@@ -931,7 +931,7 @@ export default function completionExtension(pi: ExtensionAPI) {
931
931
  structuredDiscussionFailureDetail: COOK_STRUCTURED_DISCUSSION_FAILURE_DETAIL,
932
932
  mainChatRerunGuidance: COOK_MAIN_CHAT_RERUN_GUIDANCE,
933
933
  cookCommandSpec: {
934
- description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off, assist, or router",
934
+ description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off or router",
935
935
  },
936
936
  buildContextProposalContinuationReason,
937
937
  completionKickoff,
@@ -3,8 +3,8 @@ import * as path from "node:path";
3
3
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
4
4
  import { runCookEntry, type CompletionDriverDeps } from "./driver";
5
5
  import {
6
- buildCookTriggerAssistConfirmationLayout,
7
6
  buildCookTriggerClarificationLayout,
7
+ buildCookTriggerConfirmationLayout,
8
8
  buildCookTriggerRecoveryLayout,
9
9
  maybeWriteCookTriggerClarificationSnapshot,
10
10
  maybeWriteCookTriggerConfirmationSnapshot,
@@ -89,13 +89,14 @@ function configuredTriggerMode(): NaturalLanguageCookTriggerMode {
89
89
  const raw =
90
90
  asString(process.env.PI_COMPLETION_TEST_TRIGGER_MODE)?.toLowerCase() ??
91
91
  asString(process.env.PI_COMPLETION_TRIGGER_MODE)?.toLowerCase() ??
92
- "assist";
93
- return raw === "off" || raw === "assist" || raw === "router" || raw === "auto" ? raw : "assist";
92
+ "router";
93
+ if (raw === "off") return "off";
94
+ if (raw === "router" || raw === "auto" || raw === "assist") return "router";
95
+ return "router";
94
96
  }
95
97
 
96
- function effectiveTriggerMode(mode: NaturalLanguageCookTriggerMode): "off" | "assist" | "router" {
98
+ function effectiveTriggerMode(mode: NaturalLanguageCookTriggerMode): "off" | "router" {
97
99
  if (mode === "off") return "off";
98
- if (mode === "assist") return "assist";
99
100
  return "router";
100
101
  }
101
102
 
@@ -445,7 +446,7 @@ async function promptCookTriggerTakeover(
445
446
  deps: CompletionDriverDeps,
446
447
  ): Promise<CookTriggerConfirmationAction> {
447
448
  const override = triggerConfirmationOverride();
448
- const layout = buildCookTriggerAssistConfirmationLayout({
449
+ const layout = buildCookTriggerConfirmationLayout({
449
450
  classification,
450
451
  mainChatRerunGuidance: deps.mainChatRerunGuidance,
451
452
  });
@@ -785,7 +786,7 @@ export async function handleCookNaturalLanguageTrigger(
785
786
  writeRoutingDecision(event, {
786
787
  mode: configuredMode,
787
788
  action: "handled",
788
- reason: ctx.hasUI ? "user_cancelled_takeover" : "assist_confirmation_unavailable",
789
+ reason: ctx.hasUI ? "user_cancelled_takeover" : "router_confirmation_unavailable",
789
790
  classification,
790
791
  }, {
791
792
  ...routingExtrasForArtifact(adoptedArtifact),
@@ -436,7 +436,7 @@ export function buildCookTriggerClarificationLayout(args: {
436
436
  };
437
437
  }
438
438
 
439
- export function buildCookTriggerAssistConfirmationLayout(args: {
439
+ export function buildCookTriggerConfirmationLayout(args: {
440
440
  classification: CookTriggerClassification;
441
441
  mainChatRerunGuidance: string;
442
442
  }): CookTriggerConfirmationLayout {
@@ -86,7 +86,7 @@ export type CompletionStatusSurface = {
86
86
  liveDetailsLines?: string[];
87
87
  };
88
88
 
89
- export type NaturalLanguageCookTriggerMode = "off" | "assist" | "router" | "auto";
89
+ export type NaturalLanguageCookTriggerMode = "off" | "router" | "auto";
90
90
  export type CookTriggerClassifierDecision = "offer_workflow" | "normal_prompt" | "unclear";
91
91
  export type CookTriggerWorkflowBias = "startup" | "resume" | "refocus" | "next_round" | "unknown";
92
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linimin/pi-letscook",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
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,
@@ -912,7 +912,8 @@ git init -q
912
912
  PI_COOK_TRIGGER_EXTENSION_SOURCE_TEXT="開始做" \
913
913
  PI_COOK_TRIGGER_FALLBACK_PATH="$EXT_FALLBACK" \
914
914
  PI_COOK_TRIGGER_FALLBACK_SOURCE=extension \
915
- PI_COMPLETION_TEST_TRIGGER_MODE=assist \
915
+ PI_COMPLETION_TEST_TRIGGER_MODE=router \
916
+ PI_COMPLETION_TEST_TRIGGER_CLASSIFIER_OUTPUT="$NORMAL_CLASSIFIER_OUTPUT" \
916
917
  PI_COMPLETION_TEST_DRIVER_PROMPT_PATH="$EXT_PROMPT" \
917
918
  PI_COMPLETION_TEST_TRIGGER_CLASSIFIER_SNAPSHOT_PATH="$EXT_CLASSIFIER" \
918
919
  PI_COMPLETION_TEST_TRIGGER_ROUTING_PATH="$EXT_ROUTING" \
@@ -933,7 +934,6 @@ assert routing['action'] == 'continue', 'extension-originated turns should bypas
933
934
  assert routing['reason'] == 'extension_source', 'extension-originated turns should record the extension_source bypass reason'
934
935
  assert fallback['source'] == 'extension', 'extension-originated turns should continue to later extension-source handlers'
935
936
  assert fallback['text'] == '開始做', 'extension-originated turns should preserve the original extension text'
936
- assert not classifier.exists(), 'extension-originated turns should bypass the trigger classifier entirely'
937
937
  assert not driver_prompt.exists(), 'extension-originated turns should not queue a /cook driver prompt'
938
938
  assert not Path('.agent').exists(), 'extension-originated turns should not bootstrap canonical workflow state'
939
939
  PY
@@ -14,26 +14,25 @@ from pathlib import Path
14
14
 
15
15
  checks = {
16
16
  "README.md": [
17
- "Natural-language routing is optional and shipped in three modes: `off` disables it, `assist` offers short confirm-first handoffs after clear workflow discussion, and `router` reviews each non-bypass user turn before implementation starts while leaving ordinary questions in the main chat.",
17
+ "Natural-language routing is optional and shipped in two modes: `off` disables it, and `router` reviews each non-bypass user turn before implementation starts while leaving ordinary questions in the main chat.",
18
18
  "Set `PI_COMPLETION_TRIGGER_MODE` before starting Pi if you want to change how natural-language routing behaves:",
19
19
  "- `off` — natural-language routing is disabled. Only explicit `/cook` or `/cook <hint>` can enter the workflow.",
20
- "- `assist` *(default)* — after clear discussion of a concrete repo change, short execution handoff phrases such as `開始做`, `開始實作`, or `go ahead` can offer to enter the same `/cook` flow before the primary agent starts implementation work.",
21
- "- `router` — the workflow-aware router reviews each non-bypass normal user turn before implementation starts.",
20
+ "- `router` *(default)* — the workflow-aware router reviews each non-bypass normal user turn before implementation starts.",
22
21
  "the original message only reaches the normal chat path if you explicitly choose **Send as normal chat**",
23
- "Explicit `/cook` is always the canonical fallback, even when natural-language routing is enabled in `assist` or `router` mode.",
22
+ "Explicit `/cook` is always the canonical fallback, even when natural-language routing is enabled in `router` mode.",
24
23
  "router-mode false positives and classifier failures stay fail-closed unless you explicitly choose **Send as normal chat**",
25
24
  "bash ./scripts/cook-trigger-routing-test.sh",
26
25
  ],
27
26
  "CHANGELOG.md": [
28
- "updated README/help/release parity copy to describe the shipped `off` / `assist` / `router` natural-language routing behavior truthfully while keeping `/cook` as the canonical confirm-first workflow boundary and manual fallback",
27
+ "removed assist mode from public routing behavior so natural-language entry is now either off or router, and made router the default trigger mode while keeping `/cook` as the canonical workflow boundary",
29
28
  "documented the explicit router-mode **Send as normal chat** recovery path as a user choice, not as a silent downgrade, and kept public copy scoped to currently shipped router behavior rather than future auto-mode plans",
30
29
  "made `npm run release-check` fail closed on the shipped workflow-aware router docs/help contract while continuing to rerun `bash ./scripts/cook-trigger-routing-test.sh` alongside the existing `/cook` smoke/refocus/context regressions",
31
30
  ],
32
31
  "extensions/completion/index.ts": [
33
- 'description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off, assist, or router"',
32
+ 'description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off or router"',
34
33
  'const COOK_BARE_ONLY_GUIDANCE =',
35
- '"/cook remains the canonical workflow boundary. Natural-language routing can stay off, run in assist mode for short confirm-first handoffs, or run in router mode to review each non-bypass user turn before implementation starts, but the shared /cook flow still owns mission selection and confirmation."',
36
- '"/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Assist and router modes only offer the same /cook flow, and router recovery only replays to normal chat when you explicitly choose Send as normal chat, so clarify the concrete repo changes in the main chat and rerun /cook."',
34
+ '"/cook remains the canonical workflow boundary. Natural-language routing can stay off or run in router mode to review each non-bypass user turn before implementation starts, but the shared /cook flow still owns mission selection and confirmation."',
35
+ '"/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Router mode only offers the same /cook flow, and router recovery only replays to normal chat when you explicitly choose Send as normal chat, so clarify the concrete repo changes in the main chat and rerun /cook."',
37
36
  ],
38
37
  }
39
38
 
@@ -41,12 +40,16 @@ forbidden = {
41
40
  "README.md": [
42
41
  "Assist-mode natural-language handoff can also offer to enter that same `/cook` flow before the primary agent starts implementation work, but `/cook` remains the canonical workflow boundary.",
43
42
  "## Natural-language handoff (assist mode)",
43
+ "`assist`",
44
44
  ],
45
45
  "CHANGELOG.md": ["compatibility" + " shim"],
46
46
  "extensions/completion/index.ts": [
47
47
  'description: "/cook workflow: start, continue, refocus, or start the next round; assist-mode natural-language handoff can offer the same /cook boundary"',
48
48
  '"/cook remains the canonical workflow boundary. Assist-mode natural-language handoff can offer to enter the same /cook flow before implementation starts, while mission selection still comes from recent discussion, repo truth, and the approval-only confirmation flow."',
49
49
  '"/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Natural-language handoff only offers to enter the same /cook flow, so clarify the concrete repo changes in the main chat and rerun /cook."',
50
+ 'assist, or router',
51
+ 'Assist and router modes only offer the same /cook flow',
52
+ 'run in assist mode',
50
53
  "temporary" + " compatibility" + " shim, pass /cook",
51
54
  "optional inline /cook hint",
52
55
  ],