@akagilnc/pi-workflow-roles 0.1.2207 → 0.1.2212

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.2207",
3
+ "version": "0.1.2212",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,41 @@
1
+ # Engine labor dispatch (shared across all engines)
2
+
3
+ This note is the single source for **how labor is dispatched** to any optional
4
+ engine. Every per-engine note under `resources/engines/<name>.md` covers only
5
+ that engine's CLI technical parameters (executable, flags, output formats,
6
+ host-measured constraints); it must not restate or contradict the dispatch
7
+ rules here.
8
+
9
+ Material is data for the model, not a code contract. Do not invent package flags.
10
+
11
+ ## What goes into the prompt
12
+
13
+ The labor prompt carries **task + paths only**:
14
+
15
+ - the task itself: goal, constraints, required output shape;
16
+ - paths the engine reads itself: worktree root, ticket/issue number, frozen
17
+ attachment paths, run/dossier directory pointers (e.g. `AK_ROLE_RUN_DIR`).
18
+
19
+ **Never paste material bodies into argv or the prompt** — no review bundles,
20
+ no distilled-evidence dumps, no receipt JSON, no full briefs copied out of the
21
+ ticket. Material lives in the worktree and on the ticket; both the seat and
22
+ the outsourced process run from the project root and read those bytes
23
+ themselves. Stuffing large bodies into argv/prompt is the verified cause of
24
+ `spawn ENAMETOOLONG` failures (ming #1234 reviewer r1, 2026-08-17).
25
+
26
+ ## Process shape
27
+
28
+ - When the package detour tool is available, start exactly one subprocess per
29
+ labor invocation through it, with argv assembled from the engine note plus
30
+ these dispatch rules; return the stdout labor content to the same role
31
+ session for the existing typed submission path.
32
+ - One labor turn = one process (not one process for the whole role run).
33
+
34
+ ## Failure handling
35
+
36
+ Once an engine is selected, the detour is mandatory: you MUST actually invoke
37
+ that engine CLI. On any spawn, auth, quota, model-id, stream-stall,
38
+ connection-drop, or other engine-process failure, return the typed failure and
39
+ STOP — the run fails. In-seat labor after a detour failure is FORBIDDEN, and so
40
+ is skipping the detour to work in-seat. Zero invocations is a violation, not a
41
+ fallback. Do not silently swap to another engine id.
@@ -1,12 +1,11 @@
1
1
  # agy engine method material
2
2
 
3
- This file is packaged method material for the optional `agy` labor engine
4
- (Gemini-family CLI on the host). When a role run selects this engine, read
5
- these bytes and follow the local CLI's actual interface for the labor detour.
6
- Return the labor result to the same role session so typed submission stays on
7
- the existing in-session path.
3
+ This file is packaged technical material for the optional `agy` labor engine
4
+ (Gemini-family CLI on the host).
8
5
 
9
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
10
9
 
11
10
  ## Invocation examples (local agy CLI)
12
11
 
@@ -18,13 +17,3 @@ log file for diagnostics:
18
17
  ```bash
19
18
  agy --sandbox --print 'YOUR_LABOR_PROMPT' --log-file /tmp/agy-labor.log
20
19
  ```
21
-
22
- - Treat a quota/auth error like any other engine failure (do not retry-loop).
23
-
24
- ## Failure handling
25
-
26
- The detour is mandatory: you MUST actually invoke the CLI. On any spawn,
27
- quota, or model failure, return the typed failure and STOP — the run fails.
28
- In-seat labor after a detour failure is FORBIDDEN, and so is skipping the
29
- detour to work in-seat. Zero invocations is a violation, not a fallback.
30
- Do not silently swap to another engine id.
@@ -1,12 +1,11 @@
1
1
  # codex engine method material
2
2
 
3
- This file is packaged method material for the optional `codex` labor engine
4
- (Codex CLI on the host). When a role run selects this engine, read these
5
- bytes and follow the local CLI's actual interface for the labor detour. Return
6
- the labor result to the same role session so typed submission stays on the
7
- existing in-session path.
3
+ This file is packaged technical material for the optional `codex` labor engine
4
+ (Codex CLI on the host).
8
5
 
9
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
10
9
 
11
10
  ## Invocation examples (local Codex CLI)
12
11
 
@@ -43,12 +42,4 @@ codex exec --skip-git-repo-check --ephemeral --json "YOUR_LABOR_PROMPT"
43
42
  ```
44
43
 
45
44
  Prefer `codex exec --help` on the host over any remembered flag set. Do not wrap
46
- this engine behind `ak-role` flags. Later host quota/auth failures are separate
47
- from argv acceptance — re-check the local CLI if a turn fails after session start.
48
-
49
- When the package detour tool is available, start exactly one subprocess per
50
- labor invocation through it with argv assembled from this material and the
51
- local CLI; return the stdout labor content to the same session for the existing
52
- typed submission path. One labor turn = one process (not one process for the
53
- whole role run). If the detour fails, continue labor in-session on the seat main
54
- road and still submit via the existing typed path.
45
+ this engine behind `ak-role` flags.
@@ -1,11 +1,11 @@
1
1
  # cursor engine method material
2
2
 
3
- This file is packaged method material for the optional `cursor` labor engine.
4
- When a role run selects this engine, read these bytes and follow the local CLI's
5
- actual interface for the labor detour. Return the labor result to the same role
6
- session so typed submission stays on the existing in-session path.
3
+ This file is packaged technical material for the optional `cursor` labor
4
+ engine.
7
5
 
8
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
9
9
 
10
10
  ## Invocation examples (local Cursor Agent CLI)
11
11
 
@@ -30,10 +30,3 @@ agent -p --force --output-format stream-json "YOUR_LABOR_PROMPT"
30
30
 
31
31
  Prefer `agent --help` on the host over any remembered flag set. Do not wrap this
32
32
  engine behind `ak-role` flags.
33
-
34
- When the package detour tool is available, start exactly one subprocess per
35
- labor invocation through it with argv assembled from this material and the
36
- local CLI; return the stdout labor content to the same session for the existing
37
- typed submission path. One labor turn = one process (not one process for the
38
- whole role run). If the detour fails, continue labor in-session on the seat main
39
- road and still submit via the existing typed path.
@@ -1,12 +1,11 @@
1
1
  # grok-4.6 engine method material
2
2
 
3
- This file is packaged method material for the optional `grok-4.6` labor engine
4
- (Grok CLI on the host). When a role run selects this engine, read these bytes
5
- and follow the local CLI's actual interface for the labor detour. Return the
6
- labor result to the same role session so typed submission stays on the
7
- existing in-session path.
3
+ This file is packaged technical material for the optional `grok-4.6` labor
4
+ engine (Grok CLI on the host).
8
5
 
9
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
10
9
 
11
10
  ## Invocation examples (local Grok CLI)
12
11
 
@@ -37,16 +36,6 @@ grok --prompt-file /path/to/labor-prompt.md -m grok-4.6 --always-approve --outpu
37
36
  alias `--effort`; a low-tier run completed correctly). If the mandate names
38
37
  no tier, use the seat's ordered thinking tier; never omit the flag — the
39
38
  CLI default is not guaranteed to match the ordered tier.
40
- - **Labor prompt must be seat-authored**: write the complete task brief into a
41
- temp file and pass it via `--prompt-file`. Attachments/receipt JSON are
42
- evidence material, not the prompt body — feeding them directly is rejected
43
- by the CLI as non-ACP JSON (`JSON object must have a type field`;
44
- live-verified 2026-08-21).
45
-
46
- ## Failure handling
47
-
48
- The detour is mandatory: you MUST actually invoke the CLI. On any spawn,
49
- quota, or model failure, return the typed failure and STOP — the run fails.
50
- In-seat labor after a detour failure is FORBIDDEN, and so is skipping the
51
- detour to work in-seat. Zero invocations is a violation, not a fallback.
52
- Do not silently swap to another engine id.
39
+ - Feeding raw JSON directly through `--prompt-file` is rejected by the CLI as
40
+ non-ACP JSON (`JSON object must have a type field`; live-verified
41
+ 2026-08-21).
@@ -1,12 +1,11 @@
1
1
  # kimi engine method material
2
2
 
3
- This file is packaged method material for the optional `kimi` labor engine
4
- (Kimi Code CLI on the host). When a role run selects this engine, read these
5
- bytes and follow the local CLI's actual interface for the labor detour. Return
6
- the labor result to the same role session so typed submission stays on the
7
- existing in-session path.
3
+ This file is packaged technical material for the optional `kimi` labor engine
4
+ (Kimi Code CLI on the host).
8
5
 
9
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
10
9
 
11
10
  ## Invocation examples (local Kimi Code CLI)
12
11
 
@@ -52,10 +51,3 @@ kimi -p "YOUR_LABOR_PROMPT" --output-format text
52
51
 
53
52
  Prefer `kimi --help` on the host over any remembered flag set. Do not wrap this
54
53
  engine behind `ak-role` flags.
55
-
56
- When the package detour tool is available, start exactly one subprocess per
57
- labor invocation through it with argv assembled from this material and the
58
- local CLI; return the stdout labor content to the same session for the existing
59
- typed submission path. One labor turn = one process (not one process for the
60
- whole role run). If the detour fails, continue labor in-session on the seat main
61
- road and still submit via the existing typed path.
@@ -1,12 +1,11 @@
1
1
  # opencode engine method material
2
2
 
3
- This file is packaged method material for the optional `opencode` labor engine
4
- (OpenCode CLI on the host; the GLM cheap-pool leg runs through it). When a role
5
- run selects this engine, read these bytes and follow the local CLI's actual
6
- interface for the labor detour. Return the labor result to the same role session
7
- so typed submission stays on the existing in-session path.
3
+ This file is packaged technical material for the optional `opencode` labor
4
+ engine (OpenCode CLI on the host; the GLM cheap-pool leg runs through it).
8
5
 
9
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
10
9
 
11
10
  ## Invocation examples (local OpenCode CLI)
12
11
 
@@ -25,11 +24,3 @@ opencode run -m opencode-go/glm-5.2 "YOUR_LABOR_PROMPT"
25
24
  permissions for unattended runs (both per official docs).
26
25
  - Output goes to stdout; long prompts may be passed via shell heredoc or a
27
26
  file read into the argument — follow the installed CLI's actual interface.
28
-
29
- ## Failure handling
30
-
31
- The detour is mandatory: you MUST actually invoke the CLI. On any spawn,
32
- quota, or model failure, return the typed failure and STOP — the run fails.
33
- In-seat labor after a detour failure is FORBIDDEN, and so is skipping the
34
- detour to work in-seat. Zero invocations is a violation, not a fallback.
35
- Do not silently swap to another engine id.
@@ -1,12 +1,11 @@
1
1
  # opus engine method material
2
2
 
3
- This file is packaged method material for the optional `opus` labor engine
4
- (Claude Code CLI on the host). When a role run selects this engine, read these
5
- bytes and follow the local CLI's actual interface for the labor detour. Return
6
- the labor result to the same role session so typed submission stays on the
7
- existing in-session path.
3
+ This file is packaged technical material for the optional `opus` labor engine
4
+ (Claude Code CLI on the host).
8
5
 
9
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
10
9
 
11
10
  ## Invocation examples (local Claude Code CLI)
12
11
 
@@ -39,10 +38,3 @@ not from intermediate stream rows.
39
38
 
40
39
  Prefer `claude --help` on the host over any remembered flag set. Do not wrap this
41
40
  engine behind `ak-role` flags.
42
-
43
- When the package detour tool is available, start exactly one subprocess per
44
- labor invocation through it with argv assembled from this material and the
45
- local CLI; return the stdout labor content to the same session for the existing
46
- typed submission path. One labor turn = one process (not one process for the
47
- whole role run). If the detour fails, continue labor in-session on the seat main
48
- road and still submit via the existing typed path.
@@ -1,13 +1,11 @@
1
1
  # ox-alpha engine method material
2
2
 
3
- This file is packaged method material for the optional `ox-alpha` labor engine
4
- (OpenRouter stealth preview model, reached via OpenCode CLI or the OpenRouter
5
- chat-completions API). When a role run selects this engine, read these bytes
6
- and follow the local CLI / API's actual interface for the labor detour. Return
7
- the labor result to the same role session so typed submission stays on the
8
- existing in-session path.
3
+ This file is packaged technical material for the optional `ox-alpha` labor
4
+ engine (OpenRouter stealth preview model, reached via OpenCode CLI).
9
5
 
10
- Material is data for the model, not a code contract. Do not invent package flags.
6
+ Before invoking the engine, read `../engine-dispatch.md`, resolving that path
7
+ relative to this note. This note only covers this engine's CLI technical
8
+ parameters.
11
9
 
12
10
  ## Identity and warnings
13
11
 
@@ -39,40 +37,8 @@ Smoke: prompt `只回两个字:收到` → `收到` (agentic leg usable).
39
37
 
40
38
  - `-m openrouter/stealth/ox-alpha` selects the model; confirm the current id
41
39
  with `opencode models` before long labor — stealth ids can vanish.
42
- - **Labor prompt must be seat-authored**: write the complete task brief
43
- (goal, constraints, required output shape, and any evidence the seat has
44
- already distilled) into the prompt argument or a temp file the seat reads
45
- in. Attachments/receipt JSON are evidence material, not the prompt body —
46
- feed a self-contained brief the way the grok-4.6 note requires a
47
- seat-authored `--prompt-file`.
48
40
  - Effort tier: align with the labor mandate's ordered tier (`low` / `medium` /
49
41
  `high`). Live wall-times on the same 148KB grading payload:
50
42
  low 73s / medium 59s / high 228s — all produced correct three-state verdicts.
51
43
  Prefer the ordered tier; when the mandate is silent, medium was the
52
44
  fastest correct run on that payload.
53
-
54
- ### Bare OpenRouter API (fallback only)
55
-
56
- Endpoint `https://openrouter.ai/api/v1/chat/completions`, model
57
- `stealth/ox-alpha`. Live lessons from long grading jobs — do not invent
58
- extra flags beyond these verified constraints:
59
-
60
- - **Must** send `"stream": true`. Buffered (non-stream) responses keep the
61
- connection alive with empty fill bytes and stall out (live: 540s, no body).
62
- - **Must** send explicit `"reasoning": {"effort": "low|medium|high"}` matching
63
- the ordered tier. Default effort burns `max_tokens` on thinking and finishes
64
- with `finish=length` and 0 content characters.
65
- - Reconstruct the answer by concatenating SSE `delta.content` chunks in order.
66
- `delta.reasoning` is the thinking stream, not the answer — do not treat it
67
- as the labor result.
68
- - Large payloads (>140KB) are connection-unstable (three consecutive drops
69
- recorded). On drop: shrink the brief or retry; do not keep hammering the
70
- same oversized body.
71
-
72
- ## Failure handling
73
-
74
- On any spawn, auth, model-id, stream-stall, or connection-drop failure, return
75
- the typed failure and STOP — the run fails. In-seat labor after a detour
76
- failure is FORBIDDEN, and so is skipping the detour to work in-seat. Zero
77
- invocations is a violation, not a fallback. Do not silently swap to another
78
- engine id.