@akagilnc/pi-workflow-roles 0.1.3520 → 0.1.3527

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.3520",
3
+ "version": "0.1.3527",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -25,6 +25,12 @@ themselves. Stuffing large bodies into argv/prompt is the verified cause of
25
25
 
26
26
  ## Process shape
27
27
 
28
+ - The returned labor body is the final answer text only. Never return an
29
+ event stream, verbose log, or NDJSON deltas: the body is fed back into the
30
+ seat's context, and one 12-minute Opus labor returned as `stream-json` was
31
+ 957k chars and killed the seat (712k-token request, #675, 2026-09-06).
32
+ Progress observability is the runner's job (process watch), not the body's.
33
+
28
34
  - Once an engine is selected, start exactly one subprocess per labor
29
35
  invocation by calling that engine's local CLI, with argv assembled from the
30
36
  engine note plus these dispatch rules; return the stdout labor content to
@@ -30,7 +30,8 @@ cursor-agent -p -f --output-format text --model <MODEL_ID> "YOUR_LABOR_PROMPT"
30
30
  bracket override form (`'claude-opus-4-8[context=1m,effort=high]'` — see
31
31
  `cursor-agent --help`).
32
32
  - Owner pool directive 2026-08-28: default labor model = `cursor-grok-4.6-low`.
33
- - Stream JSON events for long labor: `--output-format stream-json`.
33
+ - Always `--output-format text`; never `stream-json` (the event stream goes back
34
+ into the seat's context as noise — see `opus.md`).
34
35
 
35
36
  Prefer `cursor-agent --help` on the host over any remembered flag set. Do not
36
37
  wrap this engine behind `ak-role` flags.
@@ -27,14 +27,11 @@ grok --prompt-file /path/to/labor-prompt.md -m grok-4.6 --always-approve --outpu
27
27
  - Official docs list `-p/--single` as the canonical headless prompt input;
28
28
  `--prompt-file` exists in the installed CLI (`--help`) and is smoke-verified
29
29
  on this host — prefer it for long prompts, fall back to `-p` if absent.
30
- - `--output-format plain` keeps stdout clean for capture — but it stays
31
- silent until the run finishes. **For labor longer than ~2 minutes use
32
- `--output-format streaming-json` instead**: it emits NDJSON events
33
- (thought/text deltas) continuously from the first second, so long runs stay
34
- observable instead of appearing hung. Reconstruct the final answer by
35
- concatenating each NDJSON object's `data` where `type == "text"`, in stream
36
- order; `type == "end"` (stopReason end_turn) marks completion. Do not treat
37
- `thought` events as the answer (live-verified stream shape 2026-08-21).
30
+ - `--output-format plain` keeps stdout clean for capture and is the only
31
+ format to use for labor. Do not use `streaming-json`: its NDJSON deltas go
32
+ back into the seat's context as noise (see `opus.md` for the measured ratio);
33
+ progress observability belongs to the runner's process watch, not to the
34
+ returned body.
38
35
  - **Always pass `--reasoning-effort <low|medium|high>`** matching the effort
39
36
  tier ordered in the labor mandate (verified live 2026-08-21: flag exists,
40
37
  alias `--effort`; a low-tier run completed correctly). If the mandate names
@@ -29,16 +29,10 @@ known Kimi model id (example alias shape measured: `kimi-code/k3-256k`):
29
29
  kimi -m <model-alias> -p "YOUR_LABOR_PROMPT"
30
30
  ```
31
31
 
32
- Use `--output-format stream-json` (choices measured on this host: `text`,
33
- `stream-json`; default is `text`) when long labor needs progressive observability
34
- while the engine works. Take the labor body from
35
- `{"role":"assistant","content":...}` rows, not from `role:meta` rows:
36
-
37
- ```bash
38
- kimi -p "YOUR_LABOR_PROMPT" --output-format stream-json
39
- ```
40
-
41
- Text / default mode when stream events are not needed. Measured on this host
32
+ Use `--output-format text` (the default). Do not use `stream-json` for labor:
33
+ the returned body goes back into the seat's context and the event stream is
34
+ noise (see `opus.md` for the measured ratio). Progress observability belongs to
35
+ the runner's process watch, not to the returned body. Measured on this host
42
36
  with separate fd redirects (`1>` / `2>`): stdout is the labor answer body;
43
37
  stderr carries the version line, thinking bullets, and the trailing
44
38
  `To resume this session:` hint. Collect the labor body from stdout only — do
@@ -12,34 +12,27 @@ parameters.
12
12
  The machine entrypoint is `claude`. Run from the role project root. Non-interactive
13
13
  print mode (`-p` / `--print`) is verified available on this host.
14
14
 
15
- On this host (Claude Code 2.1.233), `--print` with `--output-format=stream-json`
16
- requires `--verbose` — without it the CLI exits immediately with
17
- `Error: When using --print, --output-format=stream-json requires --verbose`.
18
- Include `--verbose` in stream-json argv. Measured with separate fd redirects
19
- (`1>` / `2>`): NDJSON event rows land on stdout (including intermediate
20
- `system` / `assistant` activity and a final `type:"result"` row); stderr is
21
- empty on the success path — except when stdin is an open stream supplying no
22
- data (e.g. a shell test without redirection): then a benign
23
- `Warning: no stdin data received in 3s, proceeding without it` lands on stderr
24
- after a 3-second wait (host-verified 2026-08-28); redirect `< /dev/null` in
25
- shell tests. The packaged detour tool spawns engines with stdin ignored
26
- (`/dev/null`), which avoids this path:
15
+ Print mode (`-p`) with `--output-format text` returns the labor body on stdout;
16
+ stderr carries banners only. Measured with separate fd redirects (`1>` / `2>`).
27
17
 
28
18
  ```bash
29
- claude -p --verbose --output-format=stream-json "YOUR_LABOR_PROMPT"
19
+ claude -p --output-format text "YOUR_LABOR_PROMPT"
30
20
  ```
31
21
 
32
22
  Pin the Opus model explicitly (`--model opus` verified accepted on this host;
33
23
  init event reports `claude-opus-5`):
34
24
 
35
25
  ```bash
36
- claude -p --model opus --verbose --output-format=stream-json "YOUR_LABOR_PROMPT"
26
+ claude -p --model opus --output-format text "YOUR_LABOR_PROMPT"
37
27
  ```
38
28
 
39
- Use `--output-format=stream-json` (choices measured on this host: `text`, `json`,
40
- `stream-json`) when long labor needs progressive observability while the engine
41
- works; take the labor body from the final `result` event's `result` field,
42
- not from intermediate stream rows.
29
+ Use `--output-format text` (the default): stdout is the labor body and nothing
30
+ else. Never use `--output-format=stream-json` / `--verbose` for labor — the
31
+ returned body goes back into the seat's context, and the event stream is noise:
32
+ measured 2026-09-06 on this host, the same one-sentence task returned 382 bytes
33
+ as `text` and 45,028 bytes as `stream-json --verbose` (118×); a 12-minute labor
34
+ returned 957k chars and killed the seat with a 712k-token request (#675). Progress observability belongs to the runner's
35
+ process watch, not to the returned body.
43
36
 
44
37
  ## Headless permissions
45
38
 
@@ -10,18 +10,17 @@ parameters.
10
10
  ## Invocation
11
11
 
12
12
  Same host CLI as the `opus` engine: the machine entrypoint is `claude`, and all
13
- CLI mechanics (print mode, `--output-format=stream-json` requiring `--verbose`,
14
- fd layout, result-row extraction) are documented in `../opus.md` — read that
13
+ CLI mechanics (print mode, `--output-format text`, fd layout) are documented in `../opus.md` — read that
15
14
  note for them; they are not duplicated here.
16
15
 
17
16
  The only difference is the model pin:
18
17
 
19
18
  ```bash
20
- claude -p --model sonnet --verbose --output-format=stream-json "YOUR_LABOR_PROMPT"
19
+ claude -p --model sonnet --output-format text "YOUR_LABOR_PROMPT"
21
20
  ```
22
21
 
23
22
  `--model sonnet` is verified accepted on this host (Claude Code 2.1.233); the
24
- stream-json init event reports `claude-sonnet-5` (host-verified 2026-08-28).
23
+ `json` init metadata reports `claude-sonnet-5` (host-verified 2026-08-28).
25
24
 
26
25
  Prefer `claude --help` on the host over any remembered flag set. Do not wrap
27
26
  this engine behind `ak-role` flags.