1 +#
Mise Task Architecture Phase 1 Implementation Plan 3 +> **For agentic workers:** REQUIRED SUB-SKILL: Use /skill:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
5 +**Goal:** Establish mise monorepo task ownership, move all existing benchmarks into extension-local tasks, add a sequential root benchmark aggregate, and remove `goal-expect`.
7 +**Architecture:** Root mise keeps shared tools and repository-wide workflows while explicit extension config roots provide qualified local tasks. Each benchmark-owning extension receives one `bench` task, and the root aggregate dispatches those tasks with one mise job so measurements never overlap.
9 +**Tech Stack:** mise 2026.6+, TOML, Node.js 26 native TypeScript stripping, Vitest benchmark runner, npm workspaces.
11 +**Roadmap:** [`docs/super/roadmaps/2026-07-12-mise-task-architecture-roadmap.md`](../roadmaps/2026-07-12-mise-task-architecture-roadmap.md)
13 +**Phase:** Phase 1: Monorepo Foundation And Benchmarks
21 +- `extensions/goal/mise.toml`: goal replay benchmark command.
22 +- `extensions/llmiterate/mise.toml`: parser/path-filter and gitignore benchmark commands.
23 +- `extensions/prompt-autopsy/mise.toml`: prompt grouping benchmark command.
24 +- `extensions/q/mise.toml`: heuristic extraction benchmark command.
25 +- `extensions/terse/mise.toml`: terse prompt injection benchmark command.
26 +- `extensions/web/mise.toml`: HTML processing benchmark command.
30 +- `.miserc.toml`: retain the already-created portable parent-config ceiling.
31 +- `mise.toml`: enable monorepo discovery, add aggregate `bench`, remove `bench-q` and `goal-expect`.
32 +- `extensions/llmiterate/__bench__/bench.ts`: use explicit `.ts` imports supported by Node 26.
33 +- `extensions/goal/package.json`: remove the stale, broken package-level benchmark script.
34 +- `AGENTS.md`: document the Phase 1 benchmark task surface and qualified task syntax while retaining legacy E2E commands until Phase 2.
35 +- Benchmark-owning extension READMEs: document local and root-qualified benchmark commands.
39 +- `scripts/test_goal_expect.mjs`: nondeterministic external-model Expect smoke workflow.
43 +- `vitest.config.ts`: unit and integration test aggregation remains root-owned.
44 +- Playwright files and E2E tasks: deferred to Phase 2.
45 +- Root `ci`: retains lint, test, and check until E2E coverage is complete in Phase 4.
47 +###
Task 1: Establish Portable Mise Monorepo Discovery 51 +- Modify: `.miserc.toml`
52 +- Modify: `mise.toml:1-7`
54 +- [ ] **Step 1: Record the unrelated root config diff before editing**
59 +git diff
-- mise.toml
63 +Expected: `mise.toml` already shows unrelated removal of the Nushell tool and inline-shell settings, and `.miserc.toml` is untracked.
64 +Do not restore, rewrite, stage, or commit those pre-existing root changes.
66 +- [ ] **Step 2: Run the failing monorepo discovery check**
71 +mise tasks --all --name-only
74 +Expected: no task name begins with `//extensions/` because monorepo mode and extension configs do not exist yet.
76 +- [ ] **Step 3: Keep the portable parent ceiling exact**
78 +Ensure `.miserc.toml` contains exactly:
81 +ceiling_paths = ["{{ config_root | dirname }}"]
84 +This file is early-init configuration and must not move into `mise.toml`.
86 +- [ ] **Step 4: Enable explicit monorepo roots**
88 +Add these root-level keys before `[tools]` in `mise.toml`:
94 +config_roots = ["extensions/*"]
97 +Keep the existing `[tools]` table and every task unchanged in this step.
98 +Preserve the pre-existing Nushell/settings removals exactly.
100 +- [ ] **Step 5: Verify config isolation and monorepo parsing**
106 +mise tasks --all --name-only
109 +Expected from `mise config ls`: only `~/Workspace/dotfiles/pi-ext/mise.toml` is listed as project config, plus no parent `dotfiles/mise.toml`.
110 +Expected from task listing: root tasks still parse successfully; no extension tasks exist until Task 2.
112 +- [ ] **Step 6: Commit only the isolated ceiling file**
117 +git add .miserc.toml
118 +git diff --cached --check
119 +git commit -m
"build: isolate pi-ext mise config" 122 +Expected: the commit contains `.miserc.toml` only.
123 +Leave `mise.toml` unstaged because it contains pre-existing unrelated work that cannot safely be staged as a whole.
125 +###
Task 2: Add Extension-Local Benchmark Tasks 129 +- Create: `extensions/goal/mise.toml`
130 +- Create: `extensions/llmiterate/mise.toml`
131 +- Create: `extensions/prompt-autopsy/mise.toml`
132 +- Create: `extensions/q/mise.toml`
133 +- Create: `extensions/terse/mise.toml`
134 +- Create: `extensions/web/mise.toml`
135 +- Modify: `extensions/llmiterate/__bench__/bench.ts:1-4`
137 +- [ ] **Step 1: Confirm qualified benchmark tasks are missing**
142 +mise tasks --all --name-only
145 +Expected: none of these names exists:
148 +//extensions/goal:bench
149 +//extensions/llmiterate:bench
150 +//extensions/prompt-autopsy:bench
151 +//extensions/q:bench
152 +//extensions/terse:bench
153 +//extensions/web:bench
156 +- [ ] **Step 2: Add the goal benchmark task**
158 +Create `extensions/goal/mise.toml`:
162 +description = "Benchmark goal state replay"
163 +depends = ["//:install"]
164 +run = "node --no-warnings --experimental-strip-types __benches__/goal-state.bench.ts"
167 +- [ ] **Step 3: Make llmiterate’s standalone benchmark Node-resolvable**
169 +Change the imports at the top of `extensions/llmiterate/__bench__/bench.ts` to:
172 +import { performance }
from "node:perf_hooks";
173 +import { defaultConfig }
from "../config.ts";
174 +import { parseMarkerPrompts }
from "../parser.ts";
177 + shouldIncludeCompiledPath,
178 +}
from "../path-filter.ts";
181 +Do not alter benchmark inputs, iteration controls, or output.
183 +- [ ] **Step 4: Add both llmiterate benchmarks to one local task**
185 +Create `extensions/llmiterate/mise.toml`:
189 +description = "Benchmark marker parsing and gitignore scans"
190 +depends = ["//:install"]
192 + "node --no-warnings --experimental-strip-types __bench__/bench.ts",
193 + "npm exec -- vitest bench __benches__/gitignore.bench.ts --run --project fast --reporter=default",
197 +The explicit `fast` project prevents the root Vitest multi-project config from running the same benchmark twice.
198 +The default reporter avoids Vitest benchmark mode misreading the root test reporter as a custom reporter module.
200 +- [ ] **Step 5: Add the prompt-autopsy benchmark task**
202 +Create `extensions/prompt-autopsy/mise.toml`:
206 +description = "Benchmark system prompt grouping"
207 +depends = ["//:install"]
208 +run = "node --no-warnings --experimental-strip-types __bench__/bench.ts"
211 +- [ ] **Step 6: Add the q benchmark task**
213 +Create `extensions/q/mise.toml`:
217 +description = "Benchmark heuristic question extraction"
218 +depends = ["//:install"]
219 +run = "node --no-warnings --experimental-strip-types --experimental-loader ../../scripts/ts-js-loader.mjs __benches__/extract.bench.ts"
222 +- [ ] **Step 7: Add the terse benchmark task**
224 +Create `extensions/terse/mise.toml`:
228 +description = "Benchmark terse prompt injection"
229 +depends = ["//:install"]
230 +run = "node --no-warnings --experimental-strip-types __bench__/bench.ts"
233 +- [ ] **Step 8: Add the web benchmark task**
235 +Create `extensions/web/mise.toml`:
239 +description = "Benchmark web processing hot paths"
240 +depends = ["//:install"]
241 +run = "node --no-warnings --experimental-strip-types --experimental-loader ../../scripts/ts-js-loader.mjs __bench__/bench.ts"
244 +- [ ] **Step 9: Verify discovery and each command shape**
249 +mise tasks --all --name-only
250 +mise run --dry-run //extensions/goal:bench
251 +mise run --dry-run //extensions/llmiterate:bench
252 +mise run --dry-run //extensions/prompt-autopsy:bench
253 +mise run --dry-run //extensions/q:bench
254 +mise run --dry-run //extensions/terse:bench
255 +mise run --dry-run //extensions/web:bench
258 +Expected: all six qualified task names exist, each dry run resolves from its extension config root, and each depends on root `install`.
260 +- [ ] **Step 10: Run the two commands that previously needed resolution fixes**
265 +mise run //extensions/llmiterate:bench
266 +mise run //extensions/q:bench
269 +Expected: both commands exit 0 and print benchmark results.
270 +The llmiterate output contains both standalone `Benchmark...` lines and the Vitest `gitignore scan performance` table.
272 +- [ ] **Step 11: Commit extension benchmark ownership**
277 +git add extensions/goal/mise.toml extensions/llmiterate/mise.toml extensions/llmiterate/__bench__/bench.ts extensions/prompt-autopsy/mise.toml extensions/q/mise.toml extensions/terse/mise.toml extensions/web/mise.toml
278 +git diff --cached --check
279 +git commit -m
"build: localize extension benchmarks" 282 +Expected: the commit contains six local mise configs and the llmiterate import correction only.
284 +###
Task 3: Add Root Benchmark Aggregation And Remove Obsolete Workflows 288 +- Modify: `mise.toml:48-51,163-end`
289 +- Modify: `extensions/goal/package.json`
290 +- Delete: `scripts/test_goal_expect.mjs`
292 +- [ ] **Step 1: Confirm the old root surface still exists**
297 +mise tasks --name-only
300 +Expected: `bench-q` and `goal-expect` exist, while a root `bench` task does not.
302 +- [ ] **Step 2: Replace root `bench-q` with the sequential aggregate**
304 +Replace the complete `[tasks.bench-q]` block in `mise.toml` with:
308 +description = "Run all extension benchmarks sequentially"
309 +depends = ["install"]
310 +run = "mise run --jobs 1 //extensions/...:bench"
313 +The extension-qualified wildcard excludes the root aggregate itself.
314 +`--jobs 1` is mandatory because concurrent benchmark processes contaminate measurements.
316 +- [ ] **Step 3: Remove the root goal Expect task**
318 +Delete the complete `[tasks.goal-expect]` block from `mise.toml`, including its usage specification and multiline command.
319 +Do not change `tasks.ci` or any E2E task in this phase.
321 +- [ ] **Step 4: Delete the nondeterministic smoke script**
323 +Delete `scripts/test_goal_expect.mjs`.
324 +No replacement script is required because goal’s deterministic unit and integration tests remain under Vitest.
326 +- [ ] **Step 5: Remove goal’s stale package script**
328 +In `extensions/goal/package.json`, remove:
332 + "bench":
"node bench/goal-state.bench.ts" 336 +The path is stale (`bench/` versus `__benches__/`), and local mise now owns the benchmark command.
337 +Keep every dependency and package metadata field unchanged.
339 +- [ ] **Step 6: Verify the clean root task surface**
344 +mise tasks --name-only
345 +mise tasks --all --name-only
346 +mise run --dry-run bench
349 +Expected root names: `bench` exists; `bench-q` and `goal-expect` do not.
350 +Expected all-task names: all six qualified extension benchmarks still exist.
351 +Expected dry-run behavior: root `install` precedes one nested `mise run --jobs 1 //extensions/...:bench` command.
353 +- [ ] **Step 7: Run the aggregate benchmark**
361 +Expected: goal, llmiterate, prompt-autopsy, q, terse, and web benchmarks run one after another and the task exits 0.
362 +No two `[//extensions/...:bench]` task headers overlap in time.
364 +- [ ] **Step 8: Commit only safely isolated files**
369 +git add extensions/goal/package.json scripts/test_goal_expect.mjs
370 +git diff --cached --check
371 +git commit -m
"build: remove goal expect smoke" 374 +Expected: the commit removes the Expect script and stale goal package script.
375 +Keep `mise.toml` unstaged unless its pre-existing unrelated hunk can be isolated without staging it.
376 +Never commit the existing Nushell/settings removal as part of this work.
378 +###
Task 4: Document Root And Local Commands 382 +- Modify: `AGENTS.md:8-31`
383 +- Modify: `extensions/goal/README.md`
384 +- Modify: `extensions/llmiterate/README.md`
385 +- Modify: `extensions/prompt-autopsy/README.md`
386 +- Modify: `extensions/q/README.md:36-39`
387 +- Modify: `extensions/terse/README.md`
388 +- Modify: `extensions/web/README.md`
390 +- [ ] **Step 1: Update the root task table**
392 +In `AGENTS.md`, remove the `Goal expect` row.
393 +Keep the existing `E2E browsers` and `E2E review` rows until Phase 2 replaces those tasks.
394 +Add this row after `Test`:
397 +| Bench | `mise run bench` | Run extension benchmarks sequentially |
400 +Defer all E2E documentation changes until Phase 2 introduces the aggregate.
401 +Keep the CI description as `Release gate (lint + test + check)` in this phase.
403 +- [ ] **Step 2: Document qualified local task syntax**
405 +After the root task table in `AGENTS.md`, add:
408 +Extension-specific tasks live in extension-local `mise.toml` files.
409 +Run one from the root with `mise //extensions/<name>:<task>`.
410 +Use `mise tasks --all` to list root and extension-local tasks.
413 +- [ ] **Step 3: Replace q’s obsolete benchmark command**
415 +In `extensions/q/README.md`, replace:
418 +- `mise run bench-q` — benchmark the local heuristic extractor.
424 +- `mise run bench` from this extension, or `mise //extensions/q:bench` from the repository root, benchmarks the local heuristic extractor.
427 +- [ ] **Step 4: Add one benchmark sentence to each remaining owner README**
429 +Add a `## Bench` section near the command or development documentation in each README.
430 +Use these exact sentences:
432 +`extensions/goal/README.md`:
437 +Run `mise run bench` here, or `mise //extensions/goal:bench` from the repository root, to benchmark goal state replay.
440 +`extensions/llmiterate/README.md`:
445 +Run `mise run bench` here, or `mise //extensions/llmiterate:bench` from the repository root, to benchmark marker parsing, path filtering, and gitignore scans.
448 +`extensions/prompt-autopsy/README.md`:
453 +Run `mise run bench` here, or `mise //extensions/prompt-autopsy:bench` from the repository root, to benchmark system prompt grouping.
456 +`extensions/terse/README.md`:
461 +Run `mise run bench` here, or `mise //extensions/terse:bench` from the repository root, to benchmark terse prompt injection.
464 +`extensions/web/README.md`:
469 +Run `mise run bench` here, or `mise //extensions/web:bench` from the repository root, to benchmark web processing hot paths.
472 +Preserve each README’s existing semantic line breaks.
474 +- [ ] **Step 5: Verify obsolete documentation is gone**
479 +node -e
"const fs=require('node:fs'); for(const p of ['AGENTS.md','extensions/q/README.md']) { const s=fs.readFileSync(p,'utf8'); for(const old of ['bench-q','goal-expect']) if(s.includes(old)) throw new Error(p+': '+old); }" 482 +Expected: exit 0 with no output.
483 +The existing E2E task names remain documented until Phase 2.
485 +- [ ] **Step 6: Verify formatting without mutating the dirty worktree**
487 +Do not run `mise run fmt` in this phase because it writes across the repository and unrelated dirty files must remain byte-for-byte untouched.
488 +The final `mise run ci` step runs the non-mutating lint checks and reports any formatting failures.
493 +git diff --check
-- AGENTS.md extensions/goal/README.md extensions/llmiterate/README.md extensions/prompt-autopsy/README.md extensions/q/README.md extensions/terse/README.md extensions/web/README.md
496 +Expected: exit 0 with no output.
498 +- [ ] **Step 7: Commit documentation only**
503 +git add AGENTS.md extensions/goal/README.md extensions/llmiterate/README.md extensions/prompt-autopsy/README.md extensions/q/README.md extensions/terse/README.md extensions/web/README.md
504 +git diff --cached --check
505 +git commit -m
"docs: explain extension benchmark tasks" 508 +Expected: only command documentation is committed.
509 +Do not stage unrelated formatting changes.
511 +###
Task 5: Verify Phase Boundary And Reconcile Root Config Staging 515 +- Verify: `.miserc.toml`
516 +- Verify: `mise.toml`
517 +- Verify: all six extension `mise.toml` files
518 +- Verify: repository test and static-check paths
520 +- [ ] **Step 1: Validate mise task definitions**
526 +mise tasks --name-only
527 +mise tasks --all --name-only
530 +Expected: validation exits 0.
531 +The root list contains `bench` but not `bench-q` or `goal-expect`.
532 +The all-task list contains exactly six `//extensions/<name>:bench` entries for goal, llmiterate, prompt-autopsy, q, terse, and web.
534 +- [ ] **Step 2: Verify benchmark execution and sequencing**
542 +Expected: all six extension benchmark groups exit 0 and execute sequentially.
544 +- [ ] **Step 3: Run the unchanged Phase 1 release gate**
552 +Expected: lint, Vitest, and static checks all pass.
553 +E2E does not run in Phase 1.
555 +- [ ] **Step 4: Inspect all work and preserve unrelated changes**
562 +git diff
-- mise.toml
563 +git diff --cached --stat
566 +Expected: unrelated pre-existing changes remain present and unstaged.
567 +The `mise.toml` diff contains both the owner’s pre-existing Nushell/settings removal and this phase’s monorepo/task changes.
568 +Do not claim or commit the former.
570 +- [ ] **Step 5: Commit the root config only if the relevant patch can be isolated**
572 +Use interactive patch staging for `mise.toml` and select only:
574 +- `monorepo_root = true`.
575 +- `[monorepo]` and `config_roots = ["extensions/*"]`.
576 +- Replacement of `bench-q` with `bench`.
577 +- Removal of `[tasks.goal-expect]`.
582 +git add -p mise.toml
583 +git diff --cached
-- mise.toml
584 +git diff --cached --check
585 +git commit -m
"build: organize mise monorepo tasks" 588 +Expected staged diff: no Nushell tool or inline-shell setting changes.
589 +If Git cannot split the top hunk safely, leave `mise.toml` uncommitted and report the exact blocker instead of staging unrelated work.
591 +- [ ] **Step 6: Confirm the phase boundary**
597 +mise run --dry-run bench
598 +mise run --dry-run ci
603 +- Parent dotfiles project config is absent.
604 +- Benchmark aggregation resolves all local tasks with one job.
605 +- CI still resolves lint, test, and check only.
606 +- No E2E task migration or browser configuration changed.
608 +- [ ] **Step 7: Report completion evidence**
612 +- Root and qualified task-list results.
613 +- `mise run bench` result.
614 +- `mise run ci` result.
616 +- Any intentionally unstaged `mise.toml` implementation hunk caused by the pre-existing dirty file.
617 +- Confirmation that Phase 2 remains unimplemented.