@webpresso/plugin-codex 0.0.9 → 0.0.11

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.
@@ -1,32 +1,44 @@
1
1
  ---
2
2
  name: grok
3
- description: "Grok outside-voice review."
3
+ description: "Grok outside-voice reviewer through Webpresso MCP."
4
4
  license: MIT
5
5
  ---
6
6
 
7
- Use for bounded Grok Build outside-voice review.
7
+ # Grok outside-voice review
8
8
 
9
- - One bounded review invocation per request.
10
- - No fan-out, probe, retry, account rotation, or provider switch unless the user sets `review_budget`/`N` > 1.
11
- - Use `wp_review_run` unless MCP is unavailable.
12
- - Grok review is prompt-only: gather diff excerpts and verification yourself;
13
- pass that supplied artifact to Grok.
14
- - Call `wp_review_run` exactly once with `repository_access: "none"`. The runtime
15
- owns the empty execution workspace.
16
- - The prompt must say "supplied artifact text only", "do not inspect a
17
- workspace", "do not announce future work", and require a final `VERDICT:` line.
9
+ Use only for a requested content-bound plan or delivery review. Treat output as external advice
10
+ until independently verified.
11
+
12
+ ## MCP-only contract
13
+
14
+ - Call `wp_review_gate` exactly once for the real plan version or delivery diff.
15
+ - Observe the same durable operation with `wp_review_gate_wait` when needed.
16
+ - Never invoke a provider command, the legacy review CLI, or a removed review-run surface.
17
+ - If the review MCP is unavailable, stop and report it unavailable. There is no CLI fallback.
18
+
19
+ ## Advisory call
18
20
 
19
21
  ```jsonc
20
22
  {
21
- "prompt": "You are doing a bounded advisory code review of the supplied artifact text only. Do not inspect a workspace. Do not announce future work. <diff excerpts + verification + questions>. Final line must start with VERDICT:",
23
+ "project_id": "<project>",
24
+ "slug": "<blueprint-slug>",
25
+ "purpose": "delivery",
26
+ "base_ref": "<full-base-sha>",
27
+ "authority_ref": "<full-head-sha>",
22
28
  "provider": "grok",
23
29
  "repository_access": "none",
24
- "skipProbe": true,
25
- "stage": "review",
26
- "expectedMarker": "VERDICT:",
30
+ "mode": "advisory",
27
31
  }
28
32
  ```
29
33
 
30
- `wp_review_gate` is plan-only exact-version draft approval/auto-promotion.
31
- Implementation/phase review uses advisory `wp_review_run` and never mutates
32
- blueprint approval state. CLI delivery gates are MCP-unavailable compatibility only.
34
+ Use authoritative mode only when formal plan or delivery approval is requested.
35
+
36
+ ## Model policy
37
+
38
+ When the user names an exact model, pass it in the MCP `model` field. Otherwise omit
39
+ that field and let the MCP owner select the configured provider default.
40
+
41
+ ## Review quality
42
+
43
+ Follow `catalog/agent/rules/review-methodology-sota.md`; report typed verdict, model,
44
+ artifact, grounded findings, and independently verified conclusions.
@@ -55,34 +55,44 @@ Each check prints `[x]` (pass) or `[ ]` (fail) with a detail line:
55
55
 
56
56
  ## Failure Remediation
57
57
 
58
- | Check | Likely Cause | Fix |
59
- | ---------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
60
- | `pretool-guard` / `post-tool` / etc. — not found | `wp run build` not run after install | `wp run build` |
61
- | `pretool-guard` / etc. — not executable | `chmod +x` not persisted | Re-run `wp run prepare` or `wp run build` which runs `chmod-bins` |
62
- | `plugin.json integrity` — missing | Claude adapter manifest absent from `@webpresso/plugin-claude` | Re-run `wp setup --host claude` or reinstall the Claude plugin |
63
- | `MCP server liveness` — timeout | MCP server cold-start too slow | Wait and retry, or run `wp hooks doctor --skip-mcp` |
64
- | `host runtime MCP freshness` WARNING missing/older | Host `dist/runtime/<target>/wp` missing or older than MCP sources | `pnpm run build:runtime-binaries -- --target host`, then reconnect webpresso MCP / quit host |
65
- | Any check — not found at `dist/esm/...` | Build artifacts missing | Run `wp run build` in the webpresso repo |
58
+ | Check | Likely Cause | Fix |
59
+ | ------------------------------------------------ | -------------------------------------------------------------- | ----------------------------------------------------------------- |
60
+ | `pretool-guard` / `post-tool` / etc. — not found | `wp run build` not run after install | `wp run build` |
61
+ | `pretool-guard` / etc. — not executable | `chmod +x` not persisted | Re-run `wp run prepare` or `wp run build` which runs `chmod-bins` |
62
+ | `plugin.json integrity` — missing | Claude adapter manifest absent from `@webpresso/plugin-claude` | Re-run `wp setup --host claude` or reinstall the Claude plugin |
63
+ | `MCP server liveness` — timeout | MCP server cold-start too slow | Wait and retry, or run `wp hooks doctor --skip-mcp` |
64
+ | Any checknot found at `dist/esm/...` | Build artifacts missing | Run `wp run build` in the webpresso repo |
66
65
 
67
66
  ### Updating the webpresso MCP server (monorepo authors)
68
67
 
69
- `mcp` is **runtime-required**: hosts do not auto-JIT MCP code. After changing
70
- `src/mcp/**`, conversation catalog, or pretool routing that MCP hosts must run:
68
+ `mcp` is **source-first**: in a checkout with TypeScript source the server runs
69
+ from source, so it always serves HEAD. After changing `src/mcp/**`, conversation
70
+ catalog, or pretool routing that MCP hosts must run:
71
71
 
72
- 1. `pnpm run build:runtime-binaries -- --target host`
73
- 2. Reconnect webpresso MCP in the agent host (or full host quit). Optional:
74
- `pkill -f 'dist/runtime/.*/wp mcp'` if a long-lived process sticks.
75
- 3. Smoke a tool only available in the new code.
72
+ 1. Reconnect webpresso MCP in the agent host.
73
+ 2. Smoke a tool only available in the new code.
76
74
 
77
- Chat-only restart is **not** enough. Doctor **MCP liveness** may spawn
78
- `dist/esm/mcp/cli.js` while the host still runs a stale compiled binary
79
- prefer the **host runtime MCP freshness** advisory for monorepo checkouts.
75
+ No runtime rebuild is involved, and no `pkill` is needed — every launcher layer
76
+ owns its child's stdin, so a disconnect unwinds the whole chain. Chat-only
77
+ restart is still **not** enough: reconnect the server itself.
78
+
79
+ Managed `wp hook` and `wp hooks doctor|status|dispatch` commands are
80
+ source-authoritative and require no post-merge runtime rebuild. Existing
81
+ managed installations run exact `wp sync`, then rerun `wp hooks doctor` or
82
+ `wp hooks status` until the legacy-projection warning is absent. Packed
83
+ consumers continue to use the shipped compiled runtime and repair/reinstall that
84
+ artifact if it is missing.
85
+
86
+ **One-time upgrade step:** chains started before the source-first lane shipped
87
+ ran no stdin relay, so quit and reopen each MCP host once to retire them. A
88
+ `pkill` pattern is not a substitute — it misses source-launched chains and can
89
+ kill another session's server.
80
90
 
81
91
  **Offline shell allowlist** when webpresso MCP tools are unavailable (must
82
92
  match `dev-routing-bounded-read.ts`):
83
93
 
84
94
  ```text
85
- rg -n pattern path | head -n 120
95
+ rg --no-config -n pattern path 2>/dev/null | head -c 65536
86
96
  head -n 200 path/to/file
87
97
  git log --oneline -n 50
88
98
  git show --stat HEAD
@@ -4,94 +4,44 @@ description: "OpenCode Go aggregate outside-voice reviewer for read-only plan, c
4
4
  license: MIT
5
5
  ---
6
6
 
7
- # OpenCode Go aggregate reviewer via OpenCode Go
8
-
9
- Use when the user asks for an OpenCode Go aggregate reviewer / OpenCode Go review. Treat output as external advice until independently verified.
10
-
11
- ## Model routing
12
-
13
- Rendered from the committed OpenCode reviewer policy. It does not hardcode model IDs; it resolves the live `opencode models opencode-go` catalog.
14
- Use the aggregate reviewer when the user wants an OpenCode Go review but did not specify a family. Select one available model in this order: Kimi K2.7 Code for coding quality, DeepSeek V4 Pro for deeper review depth, DeepSeek V4 Flash for cheap/high-availability coverage, then the remaining families.
15
- Use the aggregate reviewer for general outside-voice plan critique, implementation review, or when the user wants the current best OpenCode Go lane without naming a family.
16
-
17
- ## Primary path: MCP
18
-
19
- When MCP is available, call `wp_review_run` exactly once with provider `opencode`, one selected live model, stage `review`, and a bounded prompt/marker. If no eligible model is known, call `wp_session_execute` at most once for a bounded catalog read before that single review call.
20
-
21
- Do not retry or probe, rotate accounts, or change provider within the invocation. The shell blocks below are the MCP-unavailable fallback only.
22
-
23
- ## MCP-unavailable fallback: auth check
24
-
25
- ```bash
26
- opencode providers list >/dev/null
27
- ```
28
-
29
- ## MCP-unavailable fallback: portable prompt file
30
-
31
- ```bash
32
- PROMPT_FILE=$(mktemp -t wp-opencode-go-review.XXXXXX)
33
- trap 'rm -f "$PROMPT_FILE"' EXIT
34
- ```
35
-
36
- ## Dashboard helper relation
37
-
38
- When `wp dash` provides dashboard context, use the shared helper emitter around this outside-voice review. The commands leave standalone OpenCode Go reviews unchanged.
39
-
40
- ```bash
41
- DASH_HELPER_RUN_ID=""
42
- if [ "${WP_DASH:-}" = "1" ] && [ -n "${WP_DASH_RUN_ID:-}" ]; then
43
- DASH_HELPER_RUN_ID=$(wp dash-helper-start --provider opencode-go --role reviewer --artifact "${OPENCODE_GO_REVIEW_ARTIFACT:-}")
44
- fi
7
+ # OpenCode Go aggregate outside-voice review
8
+
9
+ Use only for a requested content-bound plan or delivery review. Treat output as external advice
10
+ until independently verified.
11
+
12
+ ## MCP-only contract
13
+
14
+ - Call `wp_review_gate` exactly once for the real plan version or delivery diff.
15
+ - Observe the same durable operation with `wp_review_gate_wait` when needed.
16
+ - Never invoke a provider command, the legacy review CLI, or a removed review-run surface.
17
+ - If the review MCP is unavailable, stop and report it unavailable. There is no CLI fallback.
18
+
19
+ ## Advisory call
20
+
21
+ ```jsonc
22
+ {
23
+ "project_id": "<project>",
24
+ "slug": "<blueprint-slug>",
25
+ "purpose": "delivery",
26
+ "base_ref": "<full-base-sha>",
27
+ "authority_ref": "<full-head-sha>",
28
+ "provider": "opencode",
29
+ "model": "opencode-go/deepseek-v4-pro",
30
+ "repository_access": "none",
31
+ "mode": "advisory",
32
+ }
45
33
  ```
46
34
 
47
- After the review runtime exits, record its actual result and optional artifact:
35
+ Use authoritative mode only when formal plan or delivery approval is requested.
48
36
 
49
- ```bash
50
- OPENCODE_GO_REVIEW_CODE=$?
51
- if [ -n "$DASH_HELPER_RUN_ID" ]; then
52
- if [ "$OPENCODE_GO_REVIEW_CODE" -eq 0 ]; then
53
- wp dash-helper-complete --provider opencode-go --run-id "$DASH_HELPER_RUN_ID" --role reviewer --outcome completed --artifact "${OPENCODE_GO_REVIEW_ARTIFACT:-}"
54
- else
55
- wp dash-helper-complete --provider opencode-go --run-id "$DASH_HELPER_RUN_ID" --role reviewer --outcome failed --artifact "${OPENCODE_GO_REVIEW_ARTIFACT:-}"
56
- fi
57
- fi
58
- ```
59
-
60
- The managed OpenCode plugin currently has no parent-linked native subagent completion lifecycle. This capability is explicit unsupported coverage, not an inferred dashboard relation.
61
-
62
- ## MCP-unavailable fallback: review command
37
+ ## Model policy
63
38
 
64
- Use read-only prompts. Run from the repo directory; do NOT pass `--dir "$PWD"` because opencode already uses the current directory and the extra index can stall reviews.
65
- Review is advisory. `wp_review_gate` is plan-only exact-version draft approval/auto-promotion; `wp_review_run` never mutates approval state.
39
+ Default exact model: `opencode-go/deepseek-v4-pro`.
40
+ Committed exact options: `opencode-go/deepseek-v4-pro`, `opencode-go/deepseek-v4-flash`, `opencode-go/kimi-k2.7-code`, `opencode-go/glm-5.3`, `opencode-go/minimax-m3`, `opencode-go/mimo-v2.5-pro`, `opencode-go/qwen3.8-max`, `opencode-go/mimo-v2.5`, `opencode-go/qwen3.7-plus`, `opencode-go/qwen3.7-max`, `opencode-go/qwen3.6-plus`, `opencode-go/gpt-5.6-luna`, `opencode-go/minimax-m2.7`, `opencode-go/kimi-k3`, `opencode-go/glm-5.2`, `opencode-go/kimi-k2.6`, `opencode-go/hy3`, `opencode-go/glm-5.1`, `opencode-go/grok-4.5`.
41
+ Use a named exact option when requested; otherwise use the default. Provider catalog discovery
42
+ belongs to the snapshot drift workflow, never to a skill invocation.
66
43
 
67
- ```bash
68
- # Aggregate reviewer: honor the canonical model-selection policy (Kimi K2.7 Code → DeepSeek V4 Pro → DeepSeek V4 Flash first, then cross-family selection fallbacks).
69
- CATALOG=$(opencode models opencode-go)
70
- MODEL=$(echo "$CATALOG" | grep '^opencode-go/kimi' | grep -- '-code$' | sort -V | tail -1)
71
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/deepseek' | grep -- '-pro$' | sort -V | tail -1)
72
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/deepseek' | grep -- '-flash$' | sort -V | tail -1)
73
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/qwen' | grep -- '-max$' | sort -V | tail -1)
74
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/glm' | sort -V | tail -1)
75
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/minimax' | sort -V | tail -1)
76
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/mimo' | grep -- '-pro$' | sort -V | tail -1)
77
- [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | sort -V | tail -1)
78
-
79
- # Resolve one model from one bounded catalog read, then launch one review.
80
- [ -n "$MODEL" ] || { echo "No OpenCode Go model resolved for this reviewer." >&2; exit 2; }
81
- OPENCODE_GO_REVIEW_EFFORT=${OPENCODE_GO_REVIEW_EFFORT:-medium}
82
- [ "$OPENCODE_GO_REVIEW_EFFORT" = medium ] || [ "$OPENCODE_GO_REVIEW_EFFORT" = high ] || { echo "OPENCODE_GO_REVIEW_EFFORT must be one of: medium, high" >&2; exit 2; }
83
- OPENCODE_GO_REVIEW_IDLE_SECONDS=${OPENCODE_GO_REVIEW_IDLE_SECONDS:-180}
84
- OPENCODE_GO_REVIEW_ARTIFACT_ROOT=${OPENCODE_GO_REVIEW_ARTIFACT_ROOT:-"$(pwd)/.webpresso/reviews"}
85
- wp review run \
86
- --provider opencode \
87
- --prompt-file "$PROMPT_FILE" \
88
- --model "$MODEL" \
89
- --effort "$OPENCODE_GO_REVIEW_EFFORT" \
90
- --stage review \
91
- --artifact-root "$OPENCODE_GO_REVIEW_ARTIFACT_ROOT" \
92
- --idle-seconds "$OPENCODE_GO_REVIEW_IDLE_SECONDS"
93
- ```
44
+ ## Review quality
94
45
 
95
- The single catalog read above resolves `$MODEL`; do not perform another model-catalog command.
96
- The typed runtime advances its idle clock only on monotonic semantic progress and has no total wall-clock cutoff.
97
- OpenCode Go usage limit ends all OpenCode models this review (no family hop). Next: Grok (`--provider grok`). Gate fails over to Grok when accounts cool. Treat `true-idle`, `protocol-unsupported`, provider/abort/spawn/artifact failure as unavailable. Never replace with static timeout, byte-growth heartbeat, or buffered-output fallback.
46
+ Follow `catalog/agent/rules/review-methodology-sota.md`; report typed verdict, model,
47
+ artifact, grounded findings, and independently verified conclusions.
@@ -77,6 +77,7 @@ Run **1–3 (and relevant review lenses) in parallel** whenever tools allow. Do
77
77
  4. **Plan-review lenses (skip when the caller already ran them).** Folded `/autoplan`: run relevant CEO/founder, design, engineering, and DevEx lenses **in parallel when independent**; consolidate keep/change/drop, unresolved taste calls, tests, go/no-go.
78
78
  - **Skip condition.** If the caller states `plan-* reviews complete for this pass`, do **not** re-run the lenses. `ralplan` runs them before handing off, so re-running them here is duplicated spend, not a second opinion.
79
79
  - **Re-entry.** If refinement itself **materially changes scope**, re-run only the affected lens — never the full set — then continue applying.
80
+ - **Re-review rounds.** `catalog/agent/rules/review-methodology-sota.md` Principle 5 sets the delta-anchored adjudication contract subsequent `wp_review_gate` rounds follow.
80
81
 
81
82
  5. **Blueprint enforcement (max parallel).**
82
83
  - Split for independent execution; declare `Depends`; file-conflict CP = 0 per wave; TDD/proof steps; preserve acceptance criteria.
@@ -333,18 +333,18 @@ without reading other tasks. Include: what, why, constraints, gotchas.]
333
333
  **Steps (TDD):**
334
334
 
335
335
  1. Write failing test for [specific behavior]
336
- 2. Run: `just test --file <path/to/test-file.test.ts>` — verify FAIL
336
+ 2. Run: `wp test --files <path/to/test-file.test.ts>` — verify the current contract
337
337
  3. Implement minimal code to pass
338
- 4. Run: `just test --file <path/to/test-file.test.ts>` — verify PASS
338
+ 4. Run: `wp test --files <path/to/test-file.test.ts>` — verify PASS
339
339
  5. Refactor if needed (complexity ≤ 8)
340
- 6. Run: `just lint --file <changed-file.ts> <changed-test.ts>` and `just typecheck --file <changed-file.ts> <changed-test.ts>`
340
+ 6. Run: `wp lint --files <changed-file.ts> <changed-test.ts>` and `wp typecheck --files <changed-file.ts> <changed-test.ts>`
341
341
 
342
342
  **Acceptance:**
343
343
 
344
- - [ ] Test file created with failing test
344
+ - [ ] Positive contract test covers the requested behavior
345
345
  - [ ] Implementation passes all tests
346
- - [ ] `just lint --file <changed-files...>` passes
347
- - [ ] `just typecheck --file <changed-files...>` passes
346
+ - [ ] `wp lint --files <changed-files...>` passes
347
+ - [ ] `wp typecheck --files <changed-files...>` passes
348
348
  ```
349
349
 
350
350
  Use `#### Task X.Y: ...` only when a lane prefix would add no value, but prefer lane-prefixed headers such as `[schema]`, `[backend]`, `[ui]`, `[infra]`, `[docs]`, or `[qa]`.
@@ -362,22 +362,22 @@ These are enforced project conventions (with webpresso's conventions as the exam
362
362
 
363
363
  - Task says "1 day", "3 hours", "2 weeks" → Change to t-shirt size
364
364
  - Task creates migration files or migration infrastructure when the repo prefers `db push` → Use the repo's chosen workflow
365
- - References `just db-migrate` when the repo uses `db push` → Use `db push` (entity YAML → schema generation → push)
365
+ - References a retired database command when the repo uses `db push` → Use `db push` (entity YAML → schema generation → push)
366
366
 
367
367
  ### Blueprint Validation Checklist
368
368
 
369
369
  Run this audit on every task in the blueprint:
370
370
 
371
- | Check | Violation | Fix |
372
- | --------------------------------- | ---------------------------------------------------- | ------------------------------------------------- |
373
- | Has `**Depends:**` line? | Missing → parallel execution can't build DAG | Add explicit dependency or "None" |
374
- | Has `**Files:**` section? | Missing → agents can't detect file conflicts | List every file touched (Create/Modify) |
375
- | Has `**Steps (TDD):**`? | Missing → agents skip tests | Add TDD steps with exact `just` commands |
376
- | Has `**Acceptance:**` checkboxes? | Missing → no completion criteria | Add testable acceptance criteria |
377
- | Description self-contained? | References "see above" or "as described in Task X.Y" | Inline the context — each task runs independently |
378
- | Files overlap with another task? | Two tasks modify same file → conflict in parallel | Merge tasks or add explicit `**Depends:**` |
379
- | Uses t-shirt sizing? | Day/week estimates used | Replace with XS/S/M/L/XL |
380
- | Follows repo DB workflow? | Diverges from repo's chosen workflow | Use repo's chosen workflow instead |
371
+ | Check | Violation | Fix |
372
+ | --------------------------------- | ---------------------------------------------------- | -------------------------------------------------------- |
373
+ | Has `**Depends:**` line? | Missing → parallel execution can't build DAG | Add explicit dependency or "None" |
374
+ | Has `**Files:**` section? | Missing → agents can't detect file conflicts | List every file touched (Create/Modify) |
375
+ | Has `**Steps (TDD):**`? | Missing → agents skip tests | Add positive verification steps with exact `wp` commands |
376
+ | Has `**Acceptance:**` checkboxes? | Missing → no completion criteria | Add testable acceptance criteria |
377
+ | Description self-contained? | References "see above" or "as described in Task X.Y" | Inline the context — each task runs independently |
378
+ | Files overlap with another task? | Two tasks modify same file → conflict in parallel | Merge tasks or add explicit `**Depends:**` |
379
+ | Uses t-shirt sizing? | Day/week estimates used | Replace with XS/S/M/L/XL |
380
+ | Follows repo DB workflow? | Diverges from repo's chosen workflow | Use repo's chosen workflow instead |
381
381
 
382
382
  ### Granularity Rules
383
383
 
@@ -532,7 +532,7 @@ Rate the plan's parallelizability:
532
532
 
533
533
  ### Self-Contained Task Test
534
534
 
535
- For each task, ask: **"Can an agent execute this task with ONLY the task description, the codebase, and `just` commands?"**
535
+ For each task, ask: **"Can an agent execute this task with ONLY the task description, the codebase, and the repository's `wp` commands?"**
536
536
 
537
537
  If the answer is no, the task is missing context. Common fixes:
538
538
 
@@ -112,6 +112,7 @@ Rules:
112
112
  - Apply findings **into the blueprint** after each review (or once after the set if independent).
113
113
  - Independent reviews may run in parallel **only when** they do not depend on each other's edits; if eng findings reshape scope, re-run only the affected optional reviews.
114
114
  - Optional high-risk challenge: one sequential outside-voice pass (`codex` / `claude` / `opencode-go`) **after** eng review if the user asks or the change is auth / data-loss / public-API sensitive. Never parallel multi-host review.
115
+ - Any formal `wp_review_gate` re-review round follows `catalog/agent/rules/review-methodology-sota.md` Principle 5's delta-anchored adjudication contract, not a fresh rediscovery pass.
115
116
 
116
117
  ### 5. `/plan-refine` last (always)
117
118
 
@@ -34,6 +34,12 @@ wp tech-debt new "Legacy CLI complexity" \
34
34
  # Preview without writing
35
35
  wp tech-debt new "Performance bottleneck" --severity high --category mutation --dry-run
36
36
 
37
+ # `new` refuses on a primary-like checkout: a file written there cannot be
38
+ # edited afterwards under worktree discipline, so the capture is left half-done.
39
+ # Retry from a managed worktree, point --cwd at one, or override deliberately.
40
+ wp tech-debt new "Legacy CLI complexity" --cwd /path/to/managed/worktree
41
+ wp tech-debt new "Legacy CLI complexity" --allow-primary
42
+
37
43
  # List all tech-debt items (optional filters)
38
44
  wp tech-debt list
39
45
  wp tech-debt list --status accepted
@@ -434,7 +434,7 @@ Before claiming a test is "done":
434
434
  - [ ] **Does it use real dependencies?** (PGlite for DB, real services)
435
435
  - [ ] **Are assertions specific?** (Not just `toBeTruthy()`)
436
436
  - [ ] **Does it test behavior, not implementation?** (No spy assertions)
437
- - [ ] **Mutation score ≥85%?** (Run `just test --mutation --package <pkg>`)
437
+ - [ ] **Mutation score ≥85%?** (Run `wp test --mutation --package <pkg>`)
438
438
  - [ ] **Does it fail if the code breaks?** (Temporarily break code, verify test fails)
439
439
  - [ ] **Is it in the right file?** (`.test.ts` for unit, `.integration.test.ts` for DB)
440
440
 
@@ -450,23 +450,19 @@ Before claiming a test is "done":
450
450
 
451
451
  ## Quick Commands
452
452
 
453
- These assume a `just`-based task runner; substitute your own as needed.
453
+ These use the repository's `wp` task facade.
454
454
 
455
455
  ```bash
456
456
  # Run tests
457
457
  # WARNING: Never run full suites during iteration. Use single-file verification.
458
- just test # All tests (FINAL VERIFICATION ONLY)
459
- just test <package> # Specific package (FINAL VERIFICATION ONLY)
460
- just test path/to/test.ts # Single file (ITERATION SAFE)
461
-
462
- # Mutation testing
463
- just test --mutation --package <package> # Full mutation test
464
- just test --mutation-diff # Changed packages only
458
+ wp test # All tests (FINAL VERIFICATION ONLY)
459
+ wp test --package <package> # Specific package (FINAL VERIFICATION ONLY)
460
+ wp test --files path/to/test.ts # Single file (ITERATION SAFE)
465
461
 
466
462
  # Audit quality
467
- just test --mutation --package <package> # Check mutation score for package
468
- just audit-ratios # Check test pyramid (70/15/5/10)
469
- just qa # Full quality check
463
+ wp audit test-smells # Static test-quality checks
464
+ wp audit tph-e2e # Integration-first E2E review
465
+ wp qa # Full quality check
470
466
  ```
471
467
 
472
468
  ## Decision Tree
@@ -7,7 +7,7 @@ scope: repo
7
7
  applies_to: [agents]
8
8
  related: [verify, ultragoal, tech-debt, devex-review, land-policy]
9
9
  created: "2026-08-03"
10
- last_reviewed: "2026-08-03"
10
+ last_reviewed: "2026-08-11"
11
11
  name: tooling-friction
12
12
  description: "After land, capture MCP/CLI friction tips (optional; never blocks.)"
13
13
  argument-hint: "[--promote] [blueprint-slug|pr-number|session]"
@@ -50,26 +50,34 @@ Optional post-land **product signal** for MCP/CLI/hooks/CI pain so Webpresso too
50
50
  <state-root>/<repo-key>/tooling-friction/YYYY-MM-DD-<slug|pr|session>.json
51
51
  ```
52
52
 
53
- Ask the read-only MCP resolver for the exact path, then use that returned
54
- absolute path for the write:
53
+ **Path SSOT (required):** call the read-only MCP resolver and **copy the
54
+ absolute path from its summary text** (hosts often omit structured details):
55
55
 
56
56
  ```text
57
57
  wp_tooling_friction_path({"file":"YYYY-MM-DD-<slug|pr|session>.json"})
58
+ → summary: tooling-friction path: <absolute-path>
58
59
  ```
59
60
 
60
- The resolver is backed directly by
61
- `getSurfacePath("tooling-friction/<file>", "repo", <project-cwd>)`. For
62
- human CLI use, the equivalent read-only projection is
63
- `wp tooling-friction path --file <file>`. The capture is shared by that
64
- repository's worktrees but never written to any checkout. Create parent
65
- dirs as needed. If the returned path already exists, choose a unique
66
- session/HHMM suffix rather than overwriting it. If the surface cannot be
67
- resolved or written, report `tooling-friction: skipped: no state surface`
61
+ Write only to that absolute path. Do **not** construct a path by hand.
62
+
63
+ - `repo-key` is a **16-hex** `repoIdentityV1(git-common-dir)` segment from
64
+ `repoIdentityV1` under the pure preferred state root **not** a fleet worktree folder slug such
65
+ as `github.com-org-repo-<hash>` under `~/.webpresso/worktrees/repos/`.
66
+ - Scope is always **repo** (shared by every worktree of that git common
67
+ dir). Never use a worktree-keyed desktop-state surface for captures.
68
+ - Human CLI equivalent: `wp tooling-friction path --file <file>` (prints
69
+ the same absolute path on stdout).
70
+
71
+ Create parent dirs as needed. If the returned path already exists, choose a
72
+ unique session/HHMM suffix rather than overwriting it. If the surface cannot
73
+ be resolved or written, report `tooling-friction: skipped: no state surface`
68
74
  and stop; never fall back to a worktree or `.agent/` path.
69
75
 
70
76
  5. Optional `--promote` or severity `high`/`critical`:
71
77
  `wp tech-debt new "<short title>" --severity <s> --category tooling --status accepted`
72
- Set `promoted_to` to the resulting path.
78
+ Set `promoted_to` to the resulting path. `new` refuses on a primary-like
79
+ checkout; from one, pass `--cwd <managed-worktree-path>` (or `--allow-primary`
80
+ to override deliberately).
73
81
  6. Optional one-line `wp_session_capture` pointer to the JSON path — no paste-back walls.
74
82
 
75
83
  **Rate limit:** at most **one** capture per verify bookend.
@@ -77,9 +85,18 @@ Optional post-land **product signal** for MCP/CLI/hooks/CI pain so Webpresso too
77
85
  ## Store path (SSOT)
78
86
 
79
87
  `wp_tooling_friction_path({"file":"<file>"})` (or the human CLI projection
80
- `wp tooling-friction path --file <file>`) — a read-only projection of
81
- `getSurfacePath("tooling-friction/<file>", "repo", <project-cwd>)`, the
82
- repo-scoped desktop state surface, not a path inside `planning/` or a worktree.
88
+ `wp tooling-friction path --file <file>`) — a read-only projection of the pure
89
+ preferred state root (WP_STATE_ROOT or env-paths data; no writability fallback)
90
+ plus `repoIdentityV1(git-common-dir)` under `tooling-friction/<file>`. This
91
+ intentionally does **not** follow `getStateRoot()`'s temporary fallback when the
92
+ preferred root is unwritable — always copy the resolver output.
93
+
94
+ The MCP summary embeds the absolute path (`tooling-friction path: …`). Details
95
+ also include `path`, `repoKey` (16-hex), `stateRoot`, `scope: "repo"`, and
96
+ `projectRoot`. Copy the path; never invent one.
97
+
98
+ **Not** a path inside `planning/`, a checkout, or
99
+ `desktop-state/repos/github.com-…` (fleet worktree layout ≠ desktop-state key).
83
100
 
84
101
  ## Schema v1
85
102
 
@@ -161,6 +178,11 @@ repo-scoped desktop state surface, not a path inside `planning/` or a worktree.
161
178
  6. No blueprint errata misuse
162
179
  7. No committing desktop-state captures
163
180
  8. No auto-open GitHub issues per tip
181
+ 9. **Never invent the capture path** — no fleet folder slugs
182
+ (`github.com-org-repo-*`), no worktree-keyed desktop-state, no guessing
183
+ under `Application Support` or `~/.webpresso`. Always call
184
+ `wp_tooling_friction_path` / `wp tooling-friction path` and write to the
185
+ absolute path it returns
164
186
 
165
187
  ## Integration
166
188
 
@@ -171,7 +193,7 @@ repo-scoped desktop state surface, not a path inside `planning/` or a worktree.
171
193
  ## Output (agent reply)
172
194
 
173
195
  ```text
174
- tooling-friction: wrote desktop state <state-root>/<repo-key>/tooling-friction/<file>.json
196
+ tooling-friction: wrote desktop state <absolute-path-from-wp_tooling_friction_path>
175
197
  findings: 2 (high=1, medium=1)
176
198
  promoted: none | tech-debt/...
177
199
  ```
@@ -195,11 +195,11 @@ Fallback to `wp …` CLI only when the matching MCP tool is unavailable. Prefer
195
195
  the user sets N (the default value lives in `workflow-skills-routing.md`).
196
196
  Controller validation evidence is **machine-qa (prior QA phase) + N outside voices**
197
197
  (default N=1), not two outside model reviewers at budget 1.
198
- Use `wp_review_gate` only for exact-version draft plan approval/auto-promotion.
199
- Use advisory `wp_review_run` for implementation/phase outside voice; it never
200
- mutates blueprint approval state. A CLI delivery gate is explicit
201
- MCP-unavailable compatibility only, not this MCP contract. Use `wp_pr_*` for
202
- PR babysit — no
198
+ Use `wp_review_gate` in the default authoritative mode only for exact-version
199
+ draft plan approval/auto-promotion. Use the same tool with `mode: "advisory"`
200
+ for implementation/phase outside voice; it never mutates blueprint approval
201
+ state on its own. A CLI delivery gate is explicit MCP-unavailable
202
+ compatibility only, not this MCP contract. Use `wp_pr_*` for PR babysit — no
203
203
  multi-sleep poll loops; no parallel multi-reviewer stampede.
204
204
  8. Stop on `complete`, `cancelled`, blocked guard exhaustion, or `WP_ULTRAGOAL_DISABLE=1`.
205
205
 
@@ -217,15 +217,16 @@ primary checkout.
217
217
 
218
218
  ## Outside-voice review (required for autopilot)
219
219
 
220
- Autopilot and agent-driven ultragoal loops **must** request an **OpenCode Go** outside-voice review after each **goal/phase milestone**, and must pick the model by purpose. Use **`wp_review_gate`** only for exact-version draft plan approval/auto-promotion. Use single-shot **`wp_review_run`** for implementation/phase outside voice; it is advisory and never mutates blueprint approval state. CLI delivery gates are explicit MCP-unavailable compatibility only, not this MCP contract.
220
+ Autopilot and agent-driven ultragoal loops **must** request an **OpenCode Go** outside-voice review after each **goal/phase milestone**, and must pick the model by purpose. Use **`wp_review_gate`** in the default authoritative mode only for exact-version draft plan approval/auto-promotion. Use a single-shot **`wp_review_gate`** call with **`mode: "advisory"`** for implementation/phase outside voice; it never mutates blueprint approval state on its own — a later authoritative call may promote a matching advisory approval without re-invoking a provider. CLI delivery gates are explicit MCP-unavailable compatibility only, not this MCP contract.
221
221
 
222
222
  Count each milestone review against `review_budget` for merge-ready claims: **exactly one sequential** reviewer path unless the user sets N; the default value is owned by `workflow-skills-routing.md`. Prefer purpose-matched OpenCode Go first; do not fan out multi-host review swarms.
223
223
 
224
224
  ### Milestones that require a review
225
225
 
226
- Run `wp_review_gate` only for the plan approval milestone below. Run one
227
- single-shot `wp_review_run` for implementation/phase milestones; it is advisory
228
- and does not promote or otherwise mutate blueprint approval state.
226
+ Run `wp_review_gate` (default authoritative mode) only for the plan approval
227
+ milestone below. Run one single-shot `wp_review_gate` call with `mode:
228
+ "advisory"` for implementation/phase milestones; it is advisory and does not
229
+ promote or otherwise mutate blueprint approval state on its own.
229
230
 
230
231
  | Milestone | When |
231
232
  | ------------------ | -------------------------------------------------------------------------------------------------------------------------------- |