specpi 0.20.1 → 0.21.0

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/NPM_RELEASE.md +7 -6
  3. package/README.md +77 -48
  4. package/SECURITY.md +1 -1
  5. package/SECURITY_MODEL.md +21 -226
  6. package/THIRD_PARTY.md +21 -77
  7. package/extensions/tool-wishlist/capabilities.json +0 -56
  8. package/extensions/tool-wishlist/index.ts +3 -12
  9. package/extensions/tool-wishlist/validators.mjs +4 -68
  10. package/extensions/tool-wishlist/verification.mjs +0 -5
  11. package/extensions/workflow-controls/index.ts +8 -1180
  12. package/extensions/workflow-controls/smoke.mjs +9 -142
  13. package/package.json +9 -26
  14. package/scripts/packages.mjs +119 -0
  15. package/scripts/specpi.mjs +362 -1857
  16. package/skills/specpi-improve/SKILL.md +2 -2
  17. package/templates/AGENTS.md +7 -30
  18. package/templates/settings.json +8 -6
  19. package/browser-runtime/package-lock.json +0 -109
  20. package/browser-runtime/package.json +0 -17
  21. package/docs/browser-testing.md +0 -80
  22. package/docs/delegation/README.md +0 -79
  23. package/docs/delegation/protocol.md +0 -328
  24. package/docs/structural-search.md +0 -40
  25. package/extensions/background-tasks/core.d.mts +0 -90
  26. package/extensions/background-tasks/core.mjs +0 -413
  27. package/extensions/background-tasks/index.ts +0 -262
  28. package/extensions/background-tasks/smoke.mjs +0 -33
  29. package/extensions/background-tasks/supervisor.mjs +0 -33
  30. package/extensions/browser/accessibility.ts +0 -155
  31. package/extensions/browser/core.d.mts +0 -64
  32. package/extensions/browser/core.mjs +0 -306
  33. package/extensions/browser/diagnostics.ts +0 -275
  34. package/extensions/browser/index.ts +0 -1051
  35. package/extensions/browser/interactions.ts +0 -118
  36. package/extensions/browser/lifecycle.ts +0 -28
  37. package/extensions/browser/smoke.mjs +0 -75
  38. package/extensions/command-guard/bash.mjs +0 -1426
  39. package/extensions/command-guard/cmd.mjs +0 -369
  40. package/extensions/command-guard/core.d.mts +0 -12
  41. package/extensions/command-guard/core.mjs +0 -506
  42. package/extensions/command-guard/index.ts +0 -828
  43. package/extensions/command-guard/managed-files.mjs +0 -22
  44. package/extensions/command-guard/paths.mjs +0 -398
  45. package/extensions/command-guard/powershell-parser.ps1 +0 -47
  46. package/extensions/command-guard/powershell.mjs +0 -655
  47. package/extensions/command-guard/redact.mjs +0 -65
  48. package/extensions/command-guard/rules.mjs +0 -2557
  49. package/extensions/command-guard/smoke.mjs +0 -422
  50. package/extensions/delegation/core.mjs +0 -837
  51. package/extensions/delegation/errors.mjs +0 -72
  52. package/extensions/delegation/extension.mjs +0 -649
  53. package/extensions/delegation/index.ts +0 -9
  54. package/extensions/delegation/managed-files.mjs +0 -14
  55. package/extensions/delegation/native.mjs +0 -161
  56. package/extensions/delegation/presentation.mjs +0 -398
  57. package/extensions/delegation/protocol.mjs +0 -320
  58. package/extensions/delegation/provider.mjs +0 -743
  59. package/extensions/delegation/settings.mjs +0 -170
  60. package/extensions/delegation/snapshot.mjs +0 -630
  61. package/extensions/delegation/worker.mjs +0 -300
  62. package/extensions/files/core.mjs +0 -422
  63. package/extensions/files/index.ts +0 -678
  64. package/extensions/spec/core.mjs +0 -47
  65. package/extensions/spec.ts +0 -692
  66. package/extensions/structural-search/config.d.mts +0 -7
  67. package/extensions/structural-search/config.mjs +0 -64
  68. package/extensions/structural-search/core.d.mts +0 -18
  69. package/extensions/structural-search/core.mjs +0 -383
  70. package/extensions/structural-search/index.ts +0 -228
  71. package/extensions/structural-search/smoke.mjs +0 -23
  72. package/extensions/ui-refresh/index.ts +0 -54
  73. package/extensions/workflow-controls/challenge.mjs +0 -322
  74. package/extensions/workflow-controls/experiments.mjs +0 -628
  75. package/scripts/structural-runtime.mjs +0 -211
  76. package/shell/pi-profiles.sh +0 -14
  77. package/site/logo.svg +0 -1
  78. package/skills/donsetch/SKILL.md +0 -76
  79. package/structural-runtime/package-lock.json +0 -172
  80. package/structural-runtime/package.json +0 -9
  81. package/themes/specpi-spec.json +0 -96
  82. package/themes/tea-house.json +0 -89
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.0 - 2026-09-14
4
+
5
+ This release resets SpecPi's base and removes previously shipped harness features. Both retained Pi extensions ship as part of SpecPi 0.21.0. SpecPi Chat 0.7.1 remains the separately packaged VS Code frontend and is aligned with the new base.
6
+
7
+ - Reduce SpecPi to `/scope` and the human-selected harness improvement loop, including its local evidence, contracts, verification, retirement, and reopen behavior.
8
+ - Remove SpecPi's custom delegation, Command Guard, background tasks, browser and structural tools, extra workflow commands, file review UI, themes, and shell profiles.
9
+ - Replace the old showcase site with a short installation and package guide. Keep existing documentation URLs working and provide a direct download for Chat 0.7.1.
10
+ - Update the VS Code frontend for the upstream package base: pi-subagents activity and result cards, visible package messages, Permission System settings and approval dialogs, and existing usage/status reporting. Preserve the chat UI, attachments, history, and separate VSIX packaging.
11
+ - Establish the new default base through eight pinned upstream Pi packages: pi-web-access 0.29.0, betterwright 2.8.1, pi-subagents 0.67.0, pi-lens 4.1.6, pi-background-tasks 2.5.0, pi-goal-x 0.31.2, @sreetej510/pi-usage 0.10.0, and @gotgenes/pi-permission-system 32.0.2. Keep the first-party surface limited to scope and the improvement loop.
12
+ - Install and update the base with Pi's package installer, preserve unrelated settings and resource filters, and restore unchanged owned package entries on uninstall. Document upstream script/download rollback limits, BetterWright's separate browser setup, and Pi 0.84.4 compatibility. Keep an explicit core-only skip option and isolated real-package validation.
13
+ - Save exact npm dependency versions during package acquisition and verify installed versions before completing the transaction, preventing later package installs from advancing an earlier pin.
14
+ - Keep explicit, backed-up installation and removal. Updates retire old managed resources, restore owned settings, remove shell marker blocks, and preserve retired runtime bytes and modified resources in local backups. Restart Pi after updating to unload retired extensions.
15
+
3
16
  ## 0.20.1 - 2026-09-10
4
17
 
5
18
  - Enable `structural_search` by default on fresh installs and updates without a saved choice. Persist enablement transactionally and preserve explicit opt-outs; disable with `specpi update --structural-search=off`, then restart Pi.
package/NPM_RELEASE.md CHANGED
@@ -4,22 +4,23 @@ Publishing, tags, deprecation, ownership changes and GitHub Releases require exp
4
4
 
5
5
  ## Prepare
6
6
 
7
- 1. Choose an unused version; update `package.json`, dated `CHANGELOG.md` entry, README and site. Preserve historical changelog entries.
8
- 2. Chat has an independent version: if changed, align `vscode/package.json`, its changelog, guides and VSIX filenames. Run its check, render, isolated VSIX and package scripts. The VSIX is not in the npm tarball; building does not authorize Marketplace publication.
9
- 3. Validate:
7
+ 1. Choose an unused version; update `package.json`, the dated `CHANGELOG.md` entry, README, and the website. Check Chat's version and VSIX download links. Preserve historical changelog entries.
8
+ 2. Validate:
10
9
 
11
10
  ```sh
12
11
  npm install --ignore-scripts --omit=peer --no-package-lock
13
12
  npm run check
14
13
  npm run check:pi-package
14
+ npm run check:base
15
+ npm run check:site
15
16
  npm publish --dry-run --ignore-scripts --provenance=false
16
17
  npm pack --dry-run --json
17
18
  git diff --check
18
19
  ```
19
20
 
20
- Browser changes also require their opt-in browser gates. Installer/Pi lifecycle tests must use disposable state, never a live profile. Local dry runs disable provenance because they lack GitHub OIDC.
21
- 4. Review the diff, exact package manifest and artifact; obtain fresh read-only review for lifecycle, permissions and packaging changes.
22
- 5. After approval, merge to `main`, then create the matching `v<version>` tag and GitHub Release. Approve the protected `npm` environment promptly: Pages may already advertise the version. If publication cannot complete, revert the release merge and use a new version for the next attempt.
21
+ Installer/Pi lifecycle tests must use disposable state, never a live profile. `check:base` requires network access and verifies the real eight-package base with isolated home/configuration paths. Review all default version changes, upstream lifecycle scripts, compatibility, and notices in `THIRD_PARTY.md`. Local dry runs disable provenance because they lack GitHub OIDC.
22
+ 3. Review the diff, exact package manifest and artifact; obtain fresh read-only review for lifecycle, permissions and packaging changes.
23
+ 4. After approval and passing PR checks, merge to `main`, then create the matching `v<version>` tag at the merge commit. Build Chat's VSIX with `npm --prefix vscode run package` and attach it to the GitHub Release. Publish the release to start the npm workflow and approve the protected `npm` environment if it requests review. Verify the website deployment and download links. If publication cannot complete, revert the release merge and use a new version for the next attempt.
23
24
 
24
25
  ## Protected publication
25
26
 
package/README.md CHANGED
@@ -1,74 +1,103 @@
1
- <p align="center">
2
- <img src="site/logo.svg" width="104" alt="SpecPi logo">
3
- </p>
1
+ # SpecPi
4
2
 
5
- <h1 align="center">SpecPi</h1>
3
+ A small base for the [Pi coding agent](https://pi.dev/). Set the scope of a task, notice recurring problems, and choose what to improve. Eight upstream packages provide the supporting tools.
6
4
 
7
- <p align="center">
8
- A small toolkit for the <a href="https://pi.dev/">Pi coding agent</a>.
9
- </p>
5
+ **0.21.0 resets the base.** SpecPi's own Pi extensions now provide only `/scope` and the harness improvement loop. Custom tools, extra workflow commands, themes, and shell profiles have been removed. **SpecPi Chat 0.7.1** remains the VS Code frontend. Read [the release notes](CHANGELOG.md) and the migration instructions below before updating.
10
6
 
11
- <p align="center">
12
- <a href="#install">Install</a>
13
- · <a href="https://tannermidd.github.io/SpecPi/">Website</a>
14
- · <a href="https://tannermidd.github.io/SpecPi/wiki/">Documentation</a>
15
- </p>
7
+ [Website](https://tannermidd.github.io/SpecPi/) · [Download Chat](https://github.com/TannerMidd/SpecPi/releases/download/v0.21.0/specpi-chat-0.7.1.vsix) · [Releases](https://github.com/TannerMidd/SpecPi/releases)
16
8
 
17
- SpecPi extends Pi with chat, review tools, and focused delegation. Its principles are simple: you choose the improvements, changes stay small and reversible, improvement records stay local, and checks matter more than an agent's claims.
9
+ ## Install
10
+
11
+ Requires Node.js 22.19+, Git, npm, and an existing Pi installation on PATH. The complete base is tested with Pi **0.84.4**; `pi-goal-x` currently declares Pi `>=0.83.0 <0.85.0` compatibility.
12
+
13
+ ```sh
14
+ npm install --global specpi@latest
15
+ specpi plan
16
+ specpi install
17
+ specpi doctor
18
+ ```
18
19
 
19
- <details>
20
- <summary>Watch the showcase · 51 seconds</summary>
20
+ Inspect the plan, confirm the install, then restart Pi. SpecPi installs two first-party extensions, the improvement skill, a marked working agreement, and the packages below using `pi install`. Provider and model settings are preserved. There are no additional SpecPi extensions, themes, shell profiles, tool wrappers, or browser bootstrap scripts.
21
21
 
22
- <p>
23
- <a href="https://tannermidd.github.io/SpecPi/#showcase">
24
- <img src="https://tannermidd.github.io/SpecPi/media/showcase-poster.jpg" width="560" alt="Play the SpecPi showcase">
25
- </a>
26
- </p>
22
+ For this checkout, run `node scripts/specpi.mjs` in place of `specpi`. `PI_CODING_AGENT_DIR` selects an alternate destination; `SPECPI_PI` selects a Pi CLI path. `specpi install --skip-package-install` installs only the first-party core for offline use and testing. A plain `pi install npm:specpi` loads only the packaged first-party resources; use the SpecPi installer above for the complete base, and avoid installing the same first-party resources both ways.
27
23
 
28
- </details>
24
+ ## Default packages
29
25
 
30
- ## What it adds
26
+ These are installed on every normal install and update. Exact versions live in [`templates/settings.json`](templates/settings.json); SpecPi merges only the package entries, preserving unrelated configuration and existing resource filters.
31
27
 
32
- - **Focused delegation.** One agent makes changes. Up to two read-only subagents help investigate and review. [Research and design](https://tannermidd.github.io/SpecPi/single-agent/)
33
- - **Background tasks.** Start an approved dev server, test suite, or watch build, inspect bounded output, and stop it without blocking other work.
34
- - **Review as you work.** Track changed files, inspect diffs, check pages in a browser, and review risky commands.
35
- - **Structural search.** Bounded ast-grep patterns over selected code are enabled by default. Disable with `specpi update --structural-search=off`; on unsupported native hosts, pass `--structural-search=off` during installation too. [Usage and limits](docs/structural-search.md)
36
- - **Accessibility checks.** Scan the current browser state for automated WCAG and optional best-practice findings. [Browser verification](docs/browser-testing.md)
37
- - **Improvements you choose.** Record recurring problems, select one with `/harness-improvement`, and test the change before calling it done.
28
+ | Package | Pinned version | Purpose |
29
+ | --- | --- | --- |
30
+ | [pi-web-access](https://github.com/nicobailon/pi-web-access) | 0.29.0 | Web search and page retrieval |
31
+ | [betterwright](https://github.com/BetterWright/betterwright) | 2.8.1 | Browser automation |
32
+ | [pi-subagents](https://github.com/nicobailon/pi-subagents) | 0.67.0 | Subagents and delegation |
33
+ | [pi-lens](https://github.com/apmantza/pi-lens) | 4.1.6 | Language diagnostics, navigation, and structural tools |
34
+ | [pi-background-tasks](https://github.com/ismailsaleekh/pi-background-tasks) | 2.5.0 | Durable background tasks |
35
+ | [pi-goal-x](https://github.com/tmonk/pi-goal-x) | 0.31.2 | Persistent goals and progress |
36
+ | [@sreetej510/pi-usage](https://github.com/Sreetej510/pi-extensions/tree/main/extensions/pi-usage) | 0.10.0 | Provider usage reporting |
37
+ | [@gotgenes/pi-permission-system](https://github.com/gotgenes/pi-packages/tree/main/packages/pi-permission-system) | 32.0.2 | Tool permission policies |
38
38
 
39
- Problem collection is off by default. Its records stay on your machine. Pi connects to your chosen model provider.
39
+ The effective commands are `pi install npm:<package>@<version>` for each row, including the scoped names. These packages supply their own extensions, tools, skills, and prompts according to their upstream defaults. SpecPi does not add a second implementation or configure their policies.
40
40
 
41
- ## Install
41
+ SpecPi requests exact npm dependency saves for these installs and verifies installed versions before completing the transaction. This keeps later package installs from advancing an earlier pin through npm's default version ranges.
42
+
43
+ BetterWright's browser is a separate upstream setup step: install Bun 1.4+ and run `bunx betterwright@2.8.1 setup` before using browser tools. See [BetterWright setup](https://github.com/BetterWright/betterwright/blob/main/SETUP.md). The default package installation does not install Bun or download its browser. Provider credentials, web-service configuration, language servers, and permission rules remain governed by each package's documentation. Package installation and extension loading do not prove that every external service or tool is ready.
44
+
45
+ ## VS Code
46
+
47
+ [SpecPi Chat](https://github.com/TannerMidd/SpecPi/blob/main/vscode/README.md) provides the chat sidebar, file and image attachments, conversation history, tool output, package commands, and approval dialogs. Version **0.7.1** adds the new package base's visible messages, a Permission System settings button, and pi-subagents activity and result cards. The VSIX remains separate from the npm harness package.
48
+
49
+ Download the [0.7.1 VSIX](https://github.com/TannerMidd/SpecPi/releases/download/v0.21.0/specpi-chat-0.7.1.vsix), then run **Extensions: Install from VSIX…** in VS Code. To build from source, run `npm --prefix vscode run package`; the file is written to `.specpi-test/vscode/specpi-chat-0.7.1.vsix`. See the [Chat guide](https://github.com/TannerMidd/SpecPi/blob/main/vscode/GUIDE.md) for package support and terminal-only controls. Install/update SpecPi separately, then restart Pi in Chat to reload its extensions.
42
50
 
43
- Requires **Node.js 22.19+**, **npm**, and **Git**. SpecPi needs **Pi 0.84.4+**; the installer can add it if missing.
51
+ ## Scope
52
+
53
+ - `/scope set`: declare project-relative files or directories, one per line.
54
+ - `/scope status`: review declared paths, pending drift, and snapshot uncertainty.
55
+ - `/scope add <path>` or `/scope remove <path>`: change the declared scope.
56
+ - `/scope accept <path>`: acknowledge a finding without adding that path to scope.
57
+ - `/scope recheck`: deliberately refresh the baseline after an uncertain snapshot.
58
+ - `/scope clear`: turn monitoring off.
59
+ - `/scope task`: import the active improvement contract's paths explicitly.
60
+
61
+ Interactive writes and edits outside scope ask before proceeding. In headless mode they are recorded as pending. Other tools are checked afterward against bounded Git snapshots. Scope is a drift monitor, not a sandbox: shell commands and custom tools can already have changed files when drift is reported. State follows the current Pi session branch.
62
+
63
+ ## Harness improvement loop
64
+
65
+ 1. Enable local observations with `/wishlist on`; collection is off by default. `/wishlist off` stops it.
66
+ 2. Review recurring gaps with `/wishlist` and select one through `/harness-improvement` in a complete SpecPi source checkout.
67
+ 3. Follow the `specpi-improve` skill: record a bounded contract, implement the smallest sufficient change, and gather direct acceptance evidence.
68
+ 4. `finish_harness_improvement` verifies the selected contract, source changes, repository checks, and registered capability validators before retirement.
69
+ 5. Review the journal with `/wishlist history <gap-id>`. A regression returns the item for human selection; it never authorizes an automatic fix.
70
+
71
+ Observations are leads, not permission. Records stay local, use sanitized summaries and salted identifiers, and are never uploaded automatically. Pi still sends model requests to your selected provider. `/wishlist outcome <gap-id>` records the human's assessment of a local retirement.
72
+
73
+ ## Update and remove
44
74
 
45
75
  ```sh
46
76
  npm install --global specpi@latest
47
77
  specpi plan
48
- specpi install
78
+ specpi update
49
79
  specpi doctor
80
+ specpi uninstall
50
81
  ```
51
82
 
52
- Preview the changes, confirm the install, then check the setup. Restart Pi when finished.
83
+ Install, update, and uninstall require confirmation; `--yes` supplies it for automation. Modified retained resources require `update --force`. Managed configuration and resources are backed up and checksum-tracked. `update --skip-package-install` preserves an existing base without invoking Pi's package installer. Normal updates reapply the reviewed pins.
53
84
 
54
- To pin this release, use `npm install --global specpi@0.20.1`.
85
+ Updating from the larger harness retires its recorded extra resources, restores legacy settings that still match ownership records, removes its shell marker block, and installs the new package base. Modified retired files and old runtime directories are preserved under `<agent-dir>/specpi/backups/`. Restart Pi to unload the old extensions. Unrelated configuration and local improvement evidence remain intact.
55
86
 
56
- Delegation is enabled at startup. Use `/delegate off` to turn it off.
87
+ Uninstall restores package entries that still match SpecPi's recorded changes and preserves subsequent user edits. Downloaded packages, npm caches, upstream configuration, and private evidence remain on disk. A failed install rolls back SpecPi-managed files and configuration; package downloads and upstream install-script effects cannot be rolled back. `doctor` checks the core, package settings, and installed top-level package versions without activating upstream tools.
57
88
 
58
- [Setup, updates & removal](https://tannermidd.github.io/SpecPi/wiki/#getting-started) · [Delegation settings](docs/delegation/README.md)
89
+ ## Development
59
90
 
60
- ## SpecPi Chat for VS Code
61
-
62
- Chat beside your code, attach files, and switch conversations.
63
-
64
- [**Install from Marketplace**](https://marketplace.visualstudio.com/items?itemName=tannermidd.specpi-chat) · Requires VS Code 1.96+, Node.js 22.19+, and Pi 0.84.4+. SpecPi is optional.
65
-
66
- In VS Code, find **SpecPi Chat** by **tannermidd** in Extensions and install it. Open **SpecPi** in the Activity Bar, then **Connect Pi**.
67
-
68
- Chat 0.4.4 shows a compact delegation strip only while workers run or settle, and opens workspace image links in the image viewer. SpecPi 0.19.1 fixes delegation when switching GitHub Copilot models in the same chat, including Luna → Opus → Luna. Update the harness and use **Restart Pi** to load the fix; this patch does not require a Chat update. Later model switches do not require a restart. New Chat sessions start with Guard off; use `/guard guard` or `/guard strict` to enable it.
91
+ ```sh
92
+ npm install --ignore-scripts --omit=peer --no-package-lock
93
+ node --test tests/workflow-controls.test.mjs tests/workflow-controls-extension.test.mjs
94
+ npm run check
95
+ npm run check:pi-package
96
+ npm run check:base
97
+ ```
69
98
 
70
- ## Go further
99
+ Installer tests use disposable Pi directories. `check:base` requires network access, installs the real eight packages in isolated state, loads them together through Pi 0.84.4, verifies Chat RPC startup and explicit permission replies, and checks removal. It does not send model requests or run browser tasks. Never test against a live Pi installation. Publication remains explicit and uses the [release procedure](NPM_RELEASE.md).
71
100
 
72
- [Commands](https://tannermidd.github.io/SpecPi/wiki/#reference) · [Chat help](https://github.com/TannerMidd/SpecPi/blob/main/vscode/README.md) · [Development](https://tannermidd.github.io/SpecPi/wiki/#development) · [Security](SECURITY_MODEL.md) · [Release notes](CHANGELOG.md)
101
+ The website is static HTML and CSS in `site/`. After installing the pinned Playwright browser with `npx --no-install playwright install chromium`, run `npm run check:site` to check versions, links, and desktop, tablet, and mobile layouts. GitHub Pages deploys it from `main` after those checks pass.
73
102
 
74
- [MIT License](LICENSE)
103
+ [Security model](SECURITY_MODEL.md) · [Third-party components](THIRD_PARTY.md) · [Release notes](CHANGELOG.md) · [MIT License](LICENSE)
package/SECURITY.md CHANGED
@@ -6,6 +6,6 @@ Report vulnerabilities privately through [GitHub Security Advisories](https://gi
6
6
 
7
7
  Responses and fixes are best-effort, without a guaranteed timeline or bug bounty. Coordinate disclosure with the maintainer. Updates appear in [advisories](https://github.com/TannerMidd/SpecPi/security/advisories) and [release notes](CHANGELOG.md).
8
8
 
9
- Reports covering SpecPi's installer, extensions, Chat, website, automation, or dependency integration are welcome. Upstream-only problems may be redirected to the responsible project.
9
+ Reports covering SpecPi's installer, scope monitor, improvement loop, or dependency integration are welcome. Upstream-only problems may be redirected to the responsible project.
10
10
 
11
11
  See [SECURITY_MODEL.md](SECURITY_MODEL.md) for trust boundaries and [THIRD_PARTY.md](THIRD_PARTY.md) for dependencies and licenses. SpecPi is not an OS sandbox; use least privilege and containers or VMs for hostile code.