1 +#
Extension Settings-Only Implementation Plan 3 +> **For agentic workers:** REQUIRED SUB-SKILL: Use /skill:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking.
5 +**Goal:** Move extension configuration to Pi settings only: global `~/.pi/agent/settings.json` and project `.pi/settings.json`; remove custom config files and workspace-root `settings.json` fallbacks.
7 +**Architecture:** Use Pi's merged settings (`pi.settingsManager.getSettings()` or `SettingsManager`) for extension config. Keep non-config state/artifacts such as tune session JSONL, locks, hooks, dashboards, workflow specs, and logs. Add a static regression guard so future extensions cannot reintroduce custom config files.
9 +**Tech Stack:** TypeScript Pi extensions, Vitest, Node stdlib, `mise` tasks.
13 +**Phase:** Single-plan implementation
19 +- In scope: extension config only.
20 +- Out of scope: `ultra` workflow specs under `.pi/workflows` and `~/.pi/agent/workflows`; these are resources, not config.
21 +- Out of scope: tune state/artifacts under `.pi/tune/` except `.pi/tune/config.json` reads.
22 +- No legacy fallback: old `settings.json` at workspace root, `.pi/tune/config.json`, and `~/.pi/agent/extensions/tune.json` stop being read.
23 +- Do not delete user files. Ignore old config files.
24 +- Preserve unrelated dirty work. Stage only files touched by this plan.
28 +- Modify: `scripts/extensions.mjs` — add static config-file guard.
29 +- Modify: `scripts/test_extensions_static_check.mjs` — red tests for forbidden config patterns.
30 +- Modify: `extensions/angel/index.ts` — use runtime settings only.
31 +- Create: `extensions/angel/__tests__/settings.test.ts` — settings regression tests.
32 +- Modify: `extensions/lazy/src/config.ts` — use runtime settings only; remove file reads and `cwd/settings.json` fallback.
33 +- Modify: `extensions/lazy/__tests__/unit.test.ts` — update config tests.
34 +- Modify: `extensions/ultra/settings.ts` — use runtime settings only; remove file reads.
35 +- Modify: `extensions/ultra/index.ts` — stop passing settings files.
36 +- Modify: `extensions/ultra/__tests__/settings.test.ts` — update settings tests.
37 +- Modify: `extensions/leaks/src/pi.ts` — read merged `leaks` settings from Pi runtime settings.
38 +- Modify: `extensions/leaks/__tests__/pi-direct.test.ts` — add runtime settings to fake Pi.
39 +- Modify: `extensions/neko/index.ts` — read merged `neko.enabled` and `editorPaddingX` from Pi runtime settings.
40 +- Modify: `extensions/neko/__tests__/lifecycle.test.ts` — cover merged settings behavior.
41 +- Modify: `extensions/tune/index.ts` — replace `.pi/tune/config.json` reads with `settings.tune` reads.
42 +- Modify: `extensions/tune/shortcuts.ts` — replace `~/.pi/agent/extensions/tune.json` with `settings.tune.shortcuts` parser.
43 +- Modify: `extensions/tune/__tests__/unit.test.ts` — update auto-resume/max-iteration tests.
44 +- Modify: `extensions/tune/__tests__/remaining.test.ts` — update shortcut tests.
45 +- Modify: READMEs/CHANGELOGs for touched extensions only when they document old config paths.
49 +###
Task 1: Static guard against custom extension config files 53 +- Modify: `scripts/test_extensions_static_check.mjs`
54 +- Modify: `scripts/extensions.mjs`
56 +- [x] **Step 1: Write failing static-check tests**
58 +Add this block near the existing `withTemp` static-check tests in `scripts/test_extensions_static_check.mjs`:
62 + const ext
= writeExtension(
65 + { devDependencies: { [HARNESS]:
"^0.6.1" } },
67 + "import path from \"node:path\";",
68 + "const a = path.join(process.cwd(), \"settings.json\");",
69 + "const b = path.join(process.cwd(), \".pi\", \"tune\", \"config.json\");",
70 + "const c = \"tune.json\";",
74 + const errors
= staticCheck(ext, { root });
75 + assert(errors.some((e)
=> e.includes(
"workspace-root settings.json")));
76 + assert(errors.some((e)
=> e.includes(
"custom tune config file")));
77 + assert(errors.some((e)
=> e.includes(
"agent extension config file")));
81 +- [x] **Step 2: Run test to verify it fails**
86 +cd pi-ext
&& mise run check
89 +Expected: `scripts/test_extensions_static_check.mjs` fails because `staticCheck()` does not yet report the three config errors.
91 +- [x] **Step 3: Implement minimal static guard**
93 +In `scripts/extensions.mjs`, before `export function staticCheck`, add:
96 +const FORBIDDEN_EXTENSION_CONFIG_PATTERNS
= [
99 + /(?:path\.)?join\(\s*(?:process\.cwd\(\)|\bcwd\b)\s*,\s*["']settings\.json["']\s*\)/,
101 + "workspace-root settings.json is not a Pi settings file; use merged Pi settings",
104 + re:
/(?:\.pi["'][^\n]{0,80}tune[^\n]{0,80}config\.json|tuneConfigPath)/,
106 + "custom tune config file is forbidden; use settings.tune in Pi settings",
109 + re:
/["']tune\.json["']/,
111 + "agent extension config file is forbidden; use settings.tune in Pi settings",
116 +Inside the existing `for (const file of tsFiles(ext))` loop, after `const text = readFileSync(file, "utf8");`, add:
119 +for (
const pattern
of FORBIDDEN_EXTENSION_CONFIG_PATTERNS) {
120 + if (pattern.re.test(text)) {
121 + err(errors, ext,
`${pattern.message}
in ${rel(file, ext)}
`);
126 +- [x] **Step 4: Run static-check tests**
131 +cd pi-ext
&& node scripts/test_extensions_static_check.mjs
134 +Expected: prints `OK static-check tests`.
138 +###
Task 2: Angel uses runtime Pi settings only 142 +- Modify: `extensions/angel/index.ts`
143 +- Create: `extensions/angel/__tests__/settings.test.ts`
145 +- [x] **Step 1: Write failing Angel settings test**
147 +Create `extensions/angel/__tests__/settings.test.ts`:
150 +import { describe, expect, it }
from "vitest";
151 +import { __test }
from "../index.ts";
153 +describe(
"angel settings", ()
=> {
154 + it(
"loads only the merged Pi settings angel block", ()
=> {
156 + __test.
loadSettings({
158 + getSettings: ()
=> ({
159 + angel: { enabled:
false, maxCallsPerTask:
4 },
163 + ).
toMatchObject({ enabled:
false, maxCallsPerTask:
4 });
166 + it(
"defaults when runtime settings are missing", ()
=> {
167 + expect(__test.
loadSettings({}
as never)).
toEqual({});
172 +- [x] **Step 2: Run test to verify it fails**
177 +cd pi-ext
&& npm run test
-- extensions/angel/__tests__/settings.test.ts
180 +Expected: FAIL because `__test` is not exported.
182 +- [x] **Step 3: Remove file-based settings from Angel**
184 +In `extensions/angel/index.ts`:
186 +- Change the imports from:
189 +import { existsSync, readFileSync }
from "node:fs";
190 +import * as fs
from "node:fs/promises";
191 +import * as path
from "node:path";
197 +import * as fs
from "node:fs/promises";
198 +import * as path
from "node:path";
201 +- Change the Pi import from:
207 + serializeConversation,
208 +}
from "@earendil-works/pi-coding-agent";
216 + serializeConversation,
217 +}
from "@earendil-works/pi-coding-agent";
220 +- Delete `readSettings(file: string)`.
221 +- Replace `loadSettings` with:
224 +function loadSettings(pi
: ExtensionAPI)
: Settings {
225 + const allSettings
= (pi
as SettingsAPI).settingsManager?.
getSettings();
226 + return isPlainObject(allSettings?.angel)
227 + ? (allSettings.angel
as Settings)
232 +- Add at the end of the file:
235 +export const __test
= { loadSettings };
238 +- [x] **Step 4: Run Angel tests**
243 +cd pi-ext
&& npm run test
-- extensions/angel/__tests__/settings.test.ts extensions/angel/__tests__/harness.test.ts
250 +###
Task 3: Lazy and Ultra remove workspace-root `settings.json` fallback 254 +- Modify: `extensions/lazy/src/config.ts`
255 +- Modify: `extensions/lazy/__tests__/unit.test.ts`
256 +- Modify: `extensions/ultra/settings.ts`
257 +- Modify: `extensions/ultra/index.ts`
258 +- Modify: `extensions/ultra/__tests__/settings.test.ts`
260 +- [x] **Step 1: Write failing Lazy regression test**
262 +In `extensions/lazy/__tests__/unit.test.ts`, replace the current `it("loads files before runtime"...)` test with:
265 +it(
"loads runtime Pi settings and ignores workspace-root settings.json",
async ()
=> {
266 + const dir
= await tempDir();
268 + path.
join(dir,
"settings.json"),
269 + JSON.
stringify({ lazy: { defaultMode:
"lite" } }),
273 + loadLazySettingsForCwd(dir, {
275 + getSettings: ()
=> ({ lazy: { defaultMode:
"ultra" } }),
281 + loadLazySettingsForCwd(dir, {
282 + settingsManager: {
getSettings: ()
=> ({}) },
288 +- [x] **Step 2: Write failing Ultra regression test**
290 +In `extensions/ultra/__tests__/settings.test.ts`:
292 +- Delete `describe("readUltraSettings", ...)`.
293 +- Replace the `loadUltraSettings` precedence test with:
296 +it(
"uses runtime Pi settings over defaults", ()
=> {
297 + const merged
= loadUltraSettings({
298 + runtime: { ultra: { concurrency:
10, maxRetries:
9 } },
301 + expect(merged).
toEqual({
305 + defaultTimeoutMs:
180000,
306 + subagentExtensions:
"all",
311 +- [x] **Step 3: Run tests to verify they fail**
316 +cd pi-ext
&& npm run test
-- extensions/lazy/__tests__/unit.test.ts extensions/ultra/__tests__/settings.test.ts
319 +Expected: Lazy fails because workspace-root `settings.json` still affects config; Ultra fails until the old file-based API is removed from the test/imports.
321 +- [x] **Step 4: Implement Lazy runtime-only settings**
323 +In `extensions/lazy/src/config.ts`:
325 +- Remove imports from `node:fs`, `node:path`, and `getAgentDir`.
326 +- Delete `SettingsSource`, `readLazySettings`, and file merging.
327 +- Replace `loadLazySettings` and `loadLazySettingsForCwd` with:
330 +export function loadLazySettings(runtime
?: unknown)
: LazySettings {
331 + return mergeLazySettings(
pickLazy(runtime));
334 +export function loadLazySettingsForCwd(
338 + return loadLazySettings(pi.settingsManager?.
getSettings());
342 +- [x] **Step 5: Implement Ultra runtime-only settings**
344 +In `extensions/ultra/settings.ts`:
346 +- Remove `existsSync/readFileSync` import.
347 +- Delete `readUltraSettings`.
348 +- Change `SettingsSources` to:
351 +export interface SettingsSources {
356 +- Change `loadUltraSettings` to:
359 +export function loadUltraSettings(sources
: SettingsSources)
: UltraSettings {
360 + return mergeUltraSettings(
pickUltra(sources.runtime));
364 +In `extensions/ultra/index.ts`:
366 +- Remove `getAgentDir` and `path` imports if unused after this change.
367 +- Replace the settings loader with:
370 +const settings = ()
: UltraSettings => 371 + loadUltraSettings({
373 + pi
as { settingsManager
?: {
getSettings()
: unknown } }
374 + ).settingsManager?.
getSettings(),
378 +- [x] **Step 6: Run Lazy and Ultra tests**
383 +cd pi-ext
&& npm run test
-- extensions/lazy/__tests__/unit.test.ts extensions/ultra/__tests__/settings.test.ts extensions/ultra/__tests__/harness.test.ts
390 +###
Task 4: Leaks and Neko read merged Pi settings 394 +- Modify: `extensions/leaks/src/pi.ts`
395 +- Modify: `extensions/leaks/__tests__/pi-direct.test.ts`
396 +- Modify: `extensions/neko/index.ts`
397 +- Modify: `extensions/neko/__tests__/lifecycle.test.ts`
399 +- [x] **Step 1: Write failing Leaks runtime-settings test**
401 +In `extensions/leaks/__tests__/pi-direct.test.ts`, update `fakePi()` so `pi` includes runtime settings:
406 + getSettings: ()
=> ({
407 + leaks: { regex: [{ pattern:
"TOKEN_[0-9]+", label:
"TOKEN" }] },
410 + on(name: string, handler: Handler) {
413 +Then add an assertion after `session_start` and before provider redaction checks:
416 +const custom
= await runtime.handlers.
get(
"before_provider_request")?.(
417 + { payload: { text:
"TOKEN_123" } },
420 +expect(
JSON.
stringify(custom)).not.
toContain(
"TOKEN_123");
423 +- [x] **Step 2: Write failing Neko merged-settings test**
425 +In `extensions/neko/__tests__/lifecycle.test.ts`, change `createHarness()` to accept runtime settings:
428 +function createHarness(
429 + runtimeSettings
: Record<
string,
unknown>
= {
430 + neko: { enabled:
true },
436 +Add this field to the fake `pi` object:
440 + getSettings: ()
=> runtimeSettings,
444 +Change the disabled-session test to runtime settings:
447 +it(
"disabled runtime setting restores working row and default editor",
async ()
=> {
448 + const h
= createHarness({ neko: { enabled:
false }, editorPaddingX:
2 });
450 + await h.
emit(
"session_start");
452 + expect(h.
last(
"setWorkingVisible")?.args).
toEqual([
true]);
453 + expect(h.
last(
"setEditorComponent")?.args).
toEqual([
undefined]);
457 +- [x] **Step 3: Run tests to verify they fail**
462 +cd pi-ext
&& npm run test
-- extensions/leaks/__tests__/pi-direct.test.ts extensions/neko/__tests__/lifecycle.test.ts
465 +Expected: Leaks fails because it ignores runtime settings; Neko may fail or require harness adjustment because it reads files directly.
467 +- [x] **Step 4: Implement Leaks runtime settings**
469 +In `extensions/leaks/src/pi.ts`:
471 +- Remove `existsSync`, `readFileSync`, and `path` imports if no longer used.
475 +type SettingsAPI = ExtensionAPI & {
476 + settingsManager
?: {
getSettings?()
: Record<
string,
unknown>
| undefined };
479 +function readSettings(pi
: ExtensionAPI) {
480 + return loadLeaksSettings((pi
as SettingsAPI).settingsManager?.
getSettings?.())
485 +- Change both call sites:
488 +engine.
reload(ctx.cwd,
readSettings(pi),
process.
env);
491 +- [x] **Step 5: Implement Neko merged settings reads**
493 +In `extensions/neko/index.ts`:
495 +- Add a local settings API type:
498 +type SettingsAPI = ExtensionAPI & {
499 + settingsManager
?: {
getSettings?()
: Record<
string,
unknown>
| undefined };
503 +- Replace direct read helpers with runtime readers:
506 +function mergedSettings(pi
: ExtensionAPI)
: Record<
string,
unknown> {
507 + return (pi
as SettingsAPI).settingsManager?.
getSettings?.()
?? {};
510 +function resolveEditorPaddingX(pi
: ExtensionAPI)
: number {
511 + const value
= mergedSettings(pi).editorPaddingX;
512 + return typeof value
=== "number" && value
> 0 ? value
: 0;
515 +function isNekoEnabled(pi
: ExtensionAPI)
: boolean {
516 + const raw
= mergedSettings(pi).neko;
519 + && typeof raw
=== "object" 520 + && !Array.
isArray(raw)
521 + && (raw
as Record<
string,
unknown>).enabled
=== false 526 +- Update call sites:
529 +if (
!isNekoEnabled(pi)) {
533 +const paddingX
= resolveEditorPaddingX(pi);
536 +- Keep `updateNekoSettings()` writing global `settings.json`; it is a command convenience that writes Pi's global settings file, not a custom config file.
538 +- [x] **Step 6: Run Leaks and Neko tests**
543 +cd pi-ext
&& npm run test
-- extensions/leaks/__tests__/pi-direct.test.ts extensions/neko/__tests__/lifecycle.test.ts
550 +###
Task 5: Tune moves config knobs to `settings.tune` 554 +- Modify: `extensions/tune/index.ts`
555 +- Modify: `extensions/tune/shortcuts.ts`
556 +- Modify: `extensions/tune/__tests__/unit.test.ts`
557 +- Modify: `extensions/tune/__tests__/remaining.test.ts`
559 +- [x] **Step 1: Define target Tune settings shape**
561 +Use this shape in Pi settings:
566 + "maxIterations":
12,
567 + "autoResumeLimit":
20,
569 + "toggleDashboard":
"ctrl+shift+t",
570 + "fullscreenDashboard":
"ctrl+shift+f" 578 +- Missing `maxIterations` or `autoResumeLimit` means unlimited (`null`).
579 +- Non-finite, zero, negative, and non-number limits mean unlimited (`null`).
580 +- Limit numbers are floored.
581 +- Shortcut values may be non-empty strings or `null`; `null` disables that shortcut.
582 +- Missing shortcuts use existing defaults.
584 +- [x] **Step 2: Write failing Tune settings tests**
586 +In `extensions/tune/__tests__/unit.test.ts`, replace the current `.pi/tune/config.json`-based `readAutoResumeLimit` tests with pure settings tests:
589 +describe(
"tune settings", ()
=> {
590 + it(
"reads positive numeric limits from settings.tune", ()
=> {
592 + __test.
readTuneSettings({
594 + getSettings: ()
=> ({
595 + tune: { maxIterations:
9.8, autoResumeLimit:
12.9 },
599 + ).
toMatchObject({ maxIterations:
9, autoResumeLimit:
12 });
602 + it(
"treats invalid limits as unlimited", ()
=> {
606 + { maxIterations:
0, autoResumeLimit:
0 },
607 + { maxIterations:
-1, autoResumeLimit:
-1 },
608 + { maxIterations:
"20", autoResumeLimit:
"20" },
612 + __test.
readTuneSettings({
613 + settingsManager: {
getSettings: ()
=> ({ tune }) },
615 + ).
toMatchObject({ maxIterations:
null, autoResumeLimit:
null });
621 +In `extensions/tune/__tests__/remaining.test.ts`, replace the shortcuts test with:
624 +describe(
"shortcuts", ()
=> {
625 + it(
"returns defaults when settings are missing", ()
=> {
626 + const s
= resolveTuneShortcuts();
627 + expect(s.toggleDashboard).
toBe(
"ctrl+shift+t");
628 + expect(s.fullscreenDashboard).
toBe(
"ctrl+shift+f");
631 + it(
"reads shortcut overrides and null disables from settings.tune.shortcuts", ()
=> {
632 + const s
= resolveTuneShortcuts({
635 + toggleDashboard:
null,
636 + fullscreenDashboard:
"ctrl+alt+f",
640 + expect(s.toggleDashboard).
toBeNull();
641 + expect(s.fullscreenDashboard).
toBe(
"ctrl+alt+f");
646 +- [x] **Step 3: Run tests to verify they fail**
651 +cd pi-ext
&& npm run test
-- extensions/tune/__tests__/unit.test.ts extensions/tune/__tests__/remaining.test.ts
654 +Expected: FAIL because `readTuneSettings` does not exist and `resolveTuneShortcuts` still expects a file path.
656 +- [x] **Step 4: Replace shortcut file config parser**
658 +Rewrite `extensions/tune/shortcuts.ts` to remove all fs/path/getAgentDir usage:
663 +export const DEFAULT_TOGGLE_DASHBOARD_SHORTCUT
= "ctrl+shift+t";
664 +export const DEFAULT_FULLSCREEN_DASHBOARD_SHORTCUT
= "ctrl+shift+f";
666 +export interface TuneShortcuts {
667 + toggleDashboard
: string | null;
668 + fullscreenDashboard
: string | null;
671 +function isRecord(value
: unknown)
: value
is Record<
string,
unknown> {
672 + return typeof value
=== "object" && value
!== null && !Array.
isArray(value);
675 +function shortcutFromConfig(
676 + configured
: unknown,
679 + if (configured
=== null)
return null;
680 + return typeof configured
=== "string" && configured
!== "" 685 +export function resolveTuneShortcuts(settings
?: unknown)
: TuneShortcuts {
686 + const tune
= isRecord(settings)
&& isRecord(settings.tune)
689 + const shortcuts
= isRecord(tune.shortcuts)
? tune.shortcuts
: {};
691 + toggleDashboard:
shortcutFromConfig(
692 + shortcuts.toggleDashboard,
693 + DEFAULT_TOGGLE_DASHBOARD_SHORTCUT,
695 + fullscreenDashboard:
shortcutFromConfig(
696 + shortcuts.fullscreenDashboard,
697 + DEFAULT_FULLSCREEN_DASHBOARD_SHORTCUT,
703 +- [x] **Step 5: Add Tune runtime settings helper**
705 +In `extensions/tune/index.ts`, import `TuneShortcuts` with `resolveTuneShortcuts`:
708 +import { resolveTuneShortcuts, type TuneShortcuts }
from "./shortcuts.ts";
711 +Then add near the settings helpers:
714 +type SettingsAPI = ExtensionAPI & {
715 + settingsManager
?: {
getSettings?()
: Record<
string,
unknown>
| undefined };
718 +interface TuneSettings {
719 + maxIterations
: number | null;
720 + autoResumeLimit
: number | null;
721 + shortcuts
: TuneShortcuts;
724 +function positiveIntOrNull(value
: unknown)
: number | null {
725 + return typeof value
=== "number" && Number.
isFinite(value)
&& value
> 0 726 + ? Math.
floor(value)
730 +function readTuneSettings(pi
: ExtensionAPI)
: TuneSettings {
731 + const settings
= (pi
as SettingsAPI).settingsManager?.
getSettings?.()
?? {};
732 + const tune
= settings.tune
&& typeof settings.tune
=== "object" 733 + && !Array.
isArray(settings.tune)
734 + ? (settings.tune
as Record<
string,
unknown>)
737 + maxIterations:
positiveIntOrNull(tune.maxIterations),
738 + autoResumeLimit:
positiveIntOrNull(tune.autoResumeLimit),
739 + shortcuts:
resolveTuneShortcuts(settings),
744 +- [x] **Step 6: Remove `.pi/tune/config.json` reads**
746 +In `extensions/tune/index.ts`:
748 +- Delete `tuneConfigPath`.
749 +- Delete `readMaxExperiments(cwd)` and `readAutoResumeLimit(cwd)`.
750 +- Replace extension-level shortcut constant with dynamic settings:
753 +const tuneSettings = ()
: TuneSettings => readTuneSettings(pi);
756 +- In `dashboardHintVariants`, read shortcuts inside the function:
759 +const shortcuts
= tuneSettings().shortcuts;
762 +- Replace auto-resume limit lookup:
765 +const limit
= tuneSettings().autoResumeLimit;
768 +- Replace max-iteration lookups:
771 +state.maxExperiments
= tuneSettings().maxIterations;
774 +- Replace user-visible text:
777 +? `\nMax iterations: ${state.maxExperiments} (from settings.tune.maxIterations)` 781 +- Keep `.pi/tune/session.jsonl`, `.pi/tune/lock.json`, hooks, benchmark, ideas, checks, and dashboard export paths unchanged.
783 +- Export helper for tests:
791 +- [x] **Step 7: Run Tune tests**
796 +cd pi-ext
&& npm run test
-- extensions/tune/__tests__/unit.test.ts extensions/tune/__tests__/remaining.test.ts
803 +###
Task 6: Docs and final verification 807 +- Modify touched extension READMEs only if they mention removed config files.
808 +- Modify `CHANGELOG.md` if repo convention requires release notes for behavior changes.
810 +- [x] **Step 1: Search for stale config docs**
815 +cd pi-ext
&& /usr/bin/rg -n
'cwd/settings\.json|workspace.*settings\.json|\.pi/tune/config\.json|extensions/tune\.json|tune\.json|settings\.tune|maxIterations|autoResumeLimit' extensions docs README.md CHANGELOG.md
818 +Expected: old custom config docs appear only in changelog history or tests deliberately describing removed behavior.
820 +- [x] **Step 2: Update active docs**
822 +For any active README/help text found in Step 1:
824 +- Replace `.pi/tune/config.json` with `settings.tune.maxIterations` and `settings.tune.autoResumeLimit`.
825 +- Replace `~/.pi/agent/extensions/tune.json` with `settings.tune.shortcuts`.
826 +- Remove workspace-root `settings.json` examples.
827 +- Keep `.pi/workflows` docs unchanged.
829 +- [x] **Step 3: Run targeted tests**
834 +cd pi-ext
&& npm run test
-- \
835 + extensions/angel/__tests__/settings.test.ts \
836 + extensions/angel/__tests__/harness.test.ts \
837 + extensions/lazy/__tests__/unit.test.ts \
838 + extensions/ultra/__tests__/settings.test.ts \
839 + extensions/ultra/__tests__/harness.test.ts \
840 + extensions/leaks/__tests__/pi-direct.test.ts \
841 + extensions/neko/__tests__/lifecycle.test.ts \
842 + extensions/tune/__tests__/unit.test.ts \
843 + extensions/tune/__tests__/remaining.test.ts
848 +- [x] **Step 4: Run static guard**
853 +cd pi-ext
&& mise run check
856 +Expected: PASS. If unrelated existing static failures appear, record exact failures and do not claim full static health.
858 +- [x] **Step 5: Run formatter on touched files**
863 +cd pi-ext
&& mise run fmt
866 +Expected: formats touched files. Re-check `git diff` for unrelated formatting; revert unrelated formatting before continuing.
868 +- [x] **Step 6: Final audit grep**
873 +cd pi-ext
&& /usr/bin/rg -n --glob
'!**/__tests__/**' --glob
'!**/__fixtures__/**' --glob
'!**/README.md' --glob
'!**/CHANGELOG.md' --glob
'!**/package.json' 'join\([^\n]*(process\.cwd\(\)|\bcwd\b)[^\n]*,\s*"settings\.json"|\.pi/tune/config\.json|tuneConfigPath|extensions/tune\.json|"tune\.json"' extensions scripts
876 +Expected: no matches, except intentional static-check test patterns in `scripts/test_extensions_static_check.mjs` if included by the glob.
878 +- [x] **Step 7: Dirty-work safety check**
883 +git status --short
&& git -C pi-ext status --short
886 +Expected: only planned files plus pre-existing unrelated dirty files. Do not stage unrelated files.
888 +- [x] **Step 8: Commit only if requested**
890 +If the human asks for a commit, stage only files touched by this plan:
893 +cd pi-ext
&& git add \
894 + scripts/extensions.mjs \
895 + scripts/test_extensions_static_check.mjs \
896 + extensions/angel/index.ts \
897 + extensions/angel/__tests__/settings.test.ts \
898 + extensions/lazy/src/config.ts \
899 + extensions/lazy/__tests__/unit.test.ts \
900 + extensions/ultra/settings.ts \
901 + extensions/ultra/index.ts \
902 + extensions/ultra/__tests__/settings.test.ts \
903 + extensions/leaks/src/pi.ts \
904 + extensions/leaks/__tests__/pi-direct.test.ts \
905 + extensions/neko/index.ts \
906 + extensions/neko/__tests__/lifecycle.test.ts \
907 + extensions/tune/index.ts \
908 + extensions/tune/shortcuts.ts \
909 + extensions/tune/__tests__/unit.test.ts \
910 + extensions/tune/__tests__/remaining.test.ts \
914 +Then inspect staged diff:
917 +cd pi-ext
&& git diff --cached --stat
&& git diff --cached --check
923 +cd pi-ext
&& git commit -m
"refactor: use pi settings for extension config"