@linimin/pi-letscook 0.1.53 → 0.1.54

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,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### Changed
6
+
7
+ - removed workflow-aware prompt interception so only explicit `/cook` or `/cook <hint>` enters the workflow; ordinary prompts now always stay on the main chat path
8
+ - updated docs and release checks to describe explicit `/cook` entry instead of router-managed natural-language takeover
9
+
10
+ ## 0.1.54
11
+
12
+ ### Changed
13
+
14
+ - removed workflow-aware prompt interception so only explicit `/cook` or `/cook <hint>` enters the workflow; ordinary prompts now always stay on the main chat path
15
+ - updated docs and release checks to describe explicit `/cook` entry instead of router-managed natural-language takeover
16
+
5
17
  ## 0.1.53
6
18
 
7
19
  ### 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 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.
5
+ `/cook` is the explicit workflow boundary for starting, continuing, refocusing, or beginning the next round of long-running repo work.
6
6
 
7
7
  ## Use it when
8
8
 
@@ -46,10 +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` 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
49
  | Continue the current workflow | Run `/cook` |
52
- | Use the canonical fallback when natural-language routing does not fire or you want to bypass it | Run `/cook` explicitly |
50
+ | Refocus or start the next round | Discuss the new concrete repo change in the main chat, then run `/cook` |
53
51
 
54
52
  ## What `/cook` expects
55
53
 
@@ -61,19 +59,14 @@ Then run `/reload` in Pi.
61
59
 
62
60
  If recent discussion is missing, weak, ambiguous, assistant-produced, or only describes planning artifacts instead of concrete repo changes, `/cook` fails closed, leaves canonical `.agent/**` state unchanged, and tells you to clarify the mission in the main chat before rerunning `/cook`.
63
61
 
64
- ## Natural-language routing modes
62
+ ## Workflow entry
65
63
 
66
- Set `PI_COMPLETION_TRIGGER_MODE` before starting Pi if you want to change how natural-language routing behaves:
67
-
68
- - `off` — natural-language routing is disabled. Only explicit `/cook` or `/cook <hint>` can enter the workflow.
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.
64
+ Only explicit `/cook` or `/cook <hint>` enters the workflow. Ordinary prompts stay in the main chat and go straight to the primary agent.
70
65
 
71
66
  Important behavior:
72
- - natural-language routing is only a shortcut into `/cook`; `/cook` is still the canonical workflow boundary and manual fallback
67
+ - `/cook` is the canonical workflow boundary and manual entry point
73
68
  - startup, refocus, and next-round routing stay confirm-first; nothing silently starts a workflow
74
- - unclear router offers and classifier recovery stay fail-closed
75
- - in router mode, the original message only reaches the normal chat path if you explicitly choose **Send as normal chat**
76
- - explicit slash commands and ordinary main-chat questions continue normally unless you choose the workflow boundary
69
+ - explicit slash commands other than `/cook` continue normally in the main chat
77
70
 
78
71
  ## Typical examples
79
72
 
@@ -90,16 +83,9 @@ Bias proposal derivation toward a specific intent:
90
83
  /cook login redirect
91
84
  ```
92
85
 
93
- Hand off from discussion into the same `/cook` flow:
94
-
95
- ```text
96
- We should implement the natural-language routing path next.
97
- 開始做
98
- ```
99
-
100
86
  ## What happens when you run `/cook`
101
87
 
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.
88
+ `/cook` supports both bare discussion-driven startup and optional inline intent hints.
103
89
 
104
90
  | Repo state | What you'll see |
105
91
  |---|---|
@@ -115,7 +101,6 @@ We should implement the natural-language routing path next.
115
101
  - actions are **Start** and **Cancel**
116
102
  - **Cancel** is side-effect free: discuss changes in the main chat and rerun `/cook`
117
103
  - weak, ambiguous, assistant-produced, or planning-only discussion does not start a workflow
118
- - router-mode false positives and classifier failures stay fail-closed unless you explicitly choose **Send as normal chat**
119
104
  - when recent discussion suggests a different workflow, `/cook` shows a chooser before any canonical state rewrite
120
105
 
121
106
  When you accept startup or refocus, `/cook` persists the chosen workflow state in canonical `.agent/**` files before the re-ground round begins.
@@ -258,7 +243,6 @@ Run validation from the package root:
258
243
  npm run smoke-test
259
244
  npm run refocus-test
260
245
  npm run context-proposal-test
261
- bash ./scripts/cook-trigger-routing-test.sh
262
246
  bash scripts/canonical-evidence-artifact-test.sh
263
247
  npm run observability-status-test
264
248
  npm run evaluator-calibration-test
@@ -266,7 +250,7 @@ npm run rubric-contract-test
266
250
  npm run release-check
267
251
  ```
268
252
 
269
- `npm run release-check` is the broad packaged-release verifier. It begins with `bash .agent/verify_completion_control_plane.sh`, so missing or stale `.agent/verification-evidence.json` parity fails closed before the broader suite runs, then asserts the shipped `/cook` public parity surfaces in `README.md`, `CHANGELOG.md`, and the `/cook` help/fail-closed copy in `extensions/completion/index.ts`, reruns `bash ./scripts/cook-trigger-routing-test.sh` for workflow-aware router coverage including explicit **Send as normal chat** recovery, reruns the startup/refocus/context checks — including the critique-aware `/cook` confirmation regression and the smoke auto-resume prompt path — includes deterministic canonical evidence artifact coverage and includes deterministic active-slice contract coverage plus observability coverage, evaluator calibration, and the rubric-contract regression, and finishes with `npm pack --dry-run`.
253
+ `npm run release-check` is the broad packaged-release verifier. It begins with `bash .agent/verify_completion_control_plane.sh`, so missing or stale `.agent/verification-evidence.json` parity fails closed before the broader suite runs, then asserts the shipped `/cook` public parity surfaces in `README.md`, `CHANGELOG.md`, and the `/cook` help/fail-closed copy in `extensions/completion/index.ts`, reruns the startup/refocus/context checks — including the critique-aware `/cook` confirmation regression and the smoke auto-resume prompt path — includes deterministic canonical evidence artifact coverage and includes deterministic active-slice contract coverage plus observability coverage, evaluator calibration, and the rubric-contract regression, and finishes with `npm pack --dry-run`.
270
254
 
271
255
  The direct package-root verifier commands above intentionally self-isolate the repo-local extension when they shell back into `pi`, so you should not need to wrap them with `pi --no-extensions` even if `@linimin/pi-letscook` is also installed globally on the same machine.
272
256
 
@@ -14,7 +14,6 @@ import {
14
14
  markQueuedDriverPromptInFlight,
15
15
  registerCookCommand,
16
16
  } from "./driver";
17
- import { handleCookNaturalLanguageTrigger } from "./input-routing";
18
17
  import {
19
18
  assessMissionAnchor,
20
19
  collectRecentDiscussionEntries,
@@ -209,9 +208,9 @@ function maybeWriteTestSnapshot(targetPath: string | undefined, content: string)
209
208
 
210
209
  const COOK_MAIN_CHAT_RERUN_GUIDANCE = "Discuss changes in the main chat and rerun /cook.";
211
210
  const COOK_BARE_ONLY_GUIDANCE =
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.";
211
+ "/cook is the canonical workflow boundary. Discuss the concrete repo changes in the main chat, then run /cook when you want to start, continue, refocus, or begin the next workflow round.";
213
212
  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. 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.";
213
+ "/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Clarify the concrete repo changes in the main chat and rerun /cook.";
215
214
 
216
215
  function buildCookCancellationMessage(prefix: string): string {
217
216
  return `${prefix}. ${COOK_MAIN_CHAT_RERUN_GUIDANCE}`;
@@ -931,7 +930,7 @@ export default function completionExtension(pi: ExtensionAPI) {
931
930
  structuredDiscussionFailureDetail: COOK_STRUCTURED_DISCUSSION_FAILURE_DETAIL,
932
931
  mainChatRerunGuidance: COOK_MAIN_CHAT_RERUN_GUIDANCE,
933
932
  cookCommandSpec: {
934
- description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off or router",
933
+ description: "/cook workflow: start, continue, refocus, or start the next round from an explicit /cook command",
935
934
  },
936
935
  buildContextProposalContinuationReason,
937
936
  completionKickoff,
@@ -961,9 +960,6 @@ export default function completionExtension(pi: ExtensionAPI) {
961
960
  shouldTreatBareActiveWorkflowProposalAsClearRefocus,
962
961
  };
963
962
 
964
- pi.on("input", async (event, ctx) => {
965
- return await handleCookNaturalLanguageTrigger(pi, event, ctx, driverDeps);
966
- });
967
963
 
968
964
  pi.on("session_start", async (_event, ctx) => {
969
965
  await refreshCompletionStatus({ ctx, ...statusSurfaceArgs });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linimin/pi-letscook",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
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,
@@ -4,54 +4,47 @@ set -euo pipefail
4
4
  ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
5
  cd "$ROOT"
6
6
 
7
- echo "[release-check] running control-plane validation, /cook public parity, workflow-aware router coverage, role-runner extraction, startup/refocus/context regressions, canonical evidence artifact, active-slice contract, observability, legacy cleanup, evaluator calibration, and rubric contract coverage"
7
+ echo "[release-check] running control-plane validation, explicit-/cook parity, startup/refocus/context regressions, canonical evidence artifact, active-slice contract, observability, legacy cleanup, evaluator calibration, and rubric contract coverage"
8
8
  bash .agent/verify_completion_control_plane.sh
9
9
 
10
- echo "[release-check] verifying public /cook parity and workflow-aware router docs/help"
10
+ echo "[release-check] verifying public /cook parity and explicit-entry docs/help"
11
11
  python3 - <<'PY'
12
12
  import re
13
13
  from pathlib import Path
14
14
 
15
15
  checks = {
16
16
  "README.md": [
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
- "Set `PI_COMPLETION_TRIGGER_MODE` before starting Pi if you want to change how natural-language routing behaves:",
19
- "- `off` — natural-language routing is disabled. Only explicit `/cook` or `/cook <hint>` can enter the workflow.",
20
- "- `router` *(default)* — the workflow-aware router reviews each non-bypass normal user turn before implementation starts.",
21
- "the original message only reaches the normal chat path if you explicitly choose **Send as normal chat**",
22
- "Explicit `/cook` is always the canonical fallback, even when natural-language routing is enabled in `router` mode.",
23
- "router-mode false positives and classifier failures stay fail-closed unless you explicitly choose **Send as normal chat**",
24
- "bash ./scripts/cook-trigger-routing-test.sh",
17
+ "`/cook` is the explicit workflow boundary for starting, continuing, refocusing, or beginning the next round of long-running repo work.",
18
+ "Only explicit `/cook` or `/cook <hint>` enters the workflow. Ordinary prompts stay in the main chat and go straight to the primary agent.",
19
+ "`/cook` is the canonical workflow boundary and manual entry point",
20
+ "Discuss the concrete repo change in the main chat, then run `/cook`",
25
21
  ],
26
22
  "CHANGELOG.md": [
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",
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",
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",
23
+ "removed workflow-aware prompt interception so only explicit `/cook` or `/cook <hint>` enters the workflow; ordinary prompts now always stay on the main chat path",
24
+ "updated docs and release checks to describe explicit `/cook` entry instead of router-managed natural-language takeover",
30
25
  ],
31
26
  "extensions/completion/index.ts": [
32
- 'description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off or router"',
27
+ 'description: "/cook workflow: start, continue, refocus, or start the next round from an explicit /cook command"',
33
28
  'const COOK_BARE_ONLY_GUIDANCE =',
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."',
29
+ '"/cook is the canonical workflow boundary. Discuss the concrete repo changes in the main chat, then run /cook when you want to start, continue, refocus, or begin the next workflow round."',
30
+ '"/cook failed closed because recent discussion did not produce a clear execution-ready Mission/Scope/Constraints/Acceptance proposal for concrete repo changes. Clarify the concrete repo changes in the main chat and rerun /cook."',
36
31
  ],
37
32
  }
38
33
 
39
34
  forbidden = {
40
35
  "README.md": [
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.",
42
- "## Natural-language handoff (assist mode)",
43
- "`assist`",
36
+ "Natural-language routing is optional and shipped in two modes",
37
+ "PI_COMPLETION_TRIGGER_MODE",
38
+ "workflow-aware router",
39
+ "Send as normal chat",
40
+ "bash ./scripts/cook-trigger-routing-test.sh",
44
41
  ],
45
42
  "CHANGELOG.md": ["compatibility" + " shim"],
46
43
  "extensions/completion/index.ts": [
47
- 'description: "/cook workflow: start, continue, refocus, or start the next round; assist-mode natural-language handoff can offer the same /cook boundary"',
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
- '"/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',
53
- "temporary" + " compatibility" + " shim, pass /cook",
54
- "optional inline /cook hint",
44
+ 'description: "/cook workflow: start, continue, refocus, or start the next round; /cook stays canonical while natural-language routing can be off or router"',
45
+ '"/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."',
46
+ '"/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."',
47
+ 'handleCookNaturalLanguageTrigger',
55
48
  ],
56
49
  }
57
50
 
@@ -68,7 +61,6 @@ for path, needles in forbidden.items():
68
61
  raise SystemExit(f"[release-check] found stale compatibility wording in {path}: {needle}")
69
62
  PY
70
63
 
71
- bash ./scripts/cook-trigger-routing-test.sh
72
64
  npm run smoke-test
73
65
  npm run refocus-test
74
66
  npm run context-proposal-test