specpi 0.10.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 (57) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/LICENSE +21 -0
  3. package/NPM_RELEASE.md +110 -0
  4. package/README.md +155 -0
  5. package/SECURITY.md +85 -0
  6. package/SECURITY_MODEL.md +107 -0
  7. package/THIRD_PARTY.md +61 -0
  8. package/browser-runtime/package-lock.json +86 -0
  9. package/browser-runtime/package.json +15 -0
  10. package/extensions/browser/core.mjs +306 -0
  11. package/extensions/browser/index.ts +723 -0
  12. package/extensions/browser/smoke.mjs +47 -0
  13. package/extensions/command-guard/bash.mjs +1426 -0
  14. package/extensions/command-guard/cmd.mjs +369 -0
  15. package/extensions/command-guard/core.mjs +506 -0
  16. package/extensions/command-guard/index.ts +634 -0
  17. package/extensions/command-guard/managed-files.mjs +22 -0
  18. package/extensions/command-guard/paths.mjs +398 -0
  19. package/extensions/command-guard/powershell-parser.ps1 +47 -0
  20. package/extensions/command-guard/powershell.mjs +655 -0
  21. package/extensions/command-guard/redact.mjs +65 -0
  22. package/extensions/command-guard/rules.mjs +2557 -0
  23. package/extensions/command-guard/smoke.mjs +422 -0
  24. package/extensions/files/core.mjs +422 -0
  25. package/extensions/files/index.ts +678 -0
  26. package/extensions/spec/core.mjs +47 -0
  27. package/extensions/spec.ts +457 -0
  28. package/extensions/tool-wishlist/capabilities.json +114 -0
  29. package/extensions/tool-wishlist/core.mjs +1525 -0
  30. package/extensions/tool-wishlist/index.ts +804 -0
  31. package/extensions/tool-wishlist/registry.mjs +99 -0
  32. package/extensions/tool-wishlist/validators.mjs +345 -0
  33. package/extensions/ui-refresh/index.ts +54 -0
  34. package/extensions/workflow-controls/challenge.mjs +196 -0
  35. package/extensions/workflow-controls/experiments.mjs +628 -0
  36. package/extensions/workflow-controls/index.ts +1144 -0
  37. package/extensions/workflow-controls/scope.mjs +272 -0
  38. package/extensions/workflow-controls/smoke.mjs +201 -0
  39. package/package.json +98 -0
  40. package/scripts/check-package.mjs +483 -0
  41. package/scripts/check-pi-package.mjs +223 -0
  42. package/scripts/check-release-order.mjs +97 -0
  43. package/scripts/lib.mjs +182 -0
  44. package/scripts/lock.mjs +122 -0
  45. package/scripts/specpi.mjs +2037 -0
  46. package/scripts/verify-artifact.mjs +21 -0
  47. package/shell/pi-profiles.sh +14 -0
  48. package/site/logo.svg +9 -0
  49. package/site/self-improvement-loop-v2.svg +108 -0
  50. package/skills/donsetch/SKILL.md +76 -0
  51. package/skills/specpi-improve/SKILL.md +54 -0
  52. package/specpi +4 -0
  53. package/specpi.cmd +4 -0
  54. package/templates/AGENTS.md +23 -0
  55. package/templates/settings.json +10 -0
  56. package/themes/specpi-spec.json +96 -0
  57. package/themes/tea-house.json +89 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,150 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.10.0 - 2026-09-02
6
+
7
+ - Add the public npm distribution contract for the `specpi` installer CLI, including global install, explicit managed install/update/uninstall steps, source-audited alternatives, and the limited resource-only boundary of direct `pi install npm:specpi` usage.
8
+ - Validate the exact npm tarball in isolated state: enforce its public file allow-list and metadata, install it offline into a temporary global prefix without auto-installing Pi host peers, and run packed `plan`, `install`, `doctor`, `update`, and `uninstall` lifecycle checks while proving private evidence survives.
9
+ - Declare every imported Pi core module as an optional host peer, ship the README logo, preserve an executable package bin, and add public/provenance publishing metadata without npm installation lifecycle scripts.
10
+ - Add a release-only npm workflow that checks immutable tag/version/changelog alignment, rejects existing versions, preserves and checksums one validated tarball, separates protected publication from validation, publishes through GitHub OIDC with npm provenance, and verifies registry integrity, dist-tag, and attestation state.
11
+
12
+ ## 0.9.0 - 2026-09-01
13
+
14
+ - Adopt the SpecPi identity across the package, executables, installer and private state, environment variables, managed markers, extensions and events, `/spec` mode, improvement skill, theme, tests, documentation, security policy, and GitHub Pages URLs.
15
+ - Add the immersive `specpi-spec` Pi theme based on SpecPi’s clean GitHub Pages specification design, with layered technical surfaces and complete palettes for Markdown, tools, diffs, syntax, search, statuses, and thinking levels. Make it the default while retaining Tea House as an installed option.
16
+ - Rebuild `/spec` as an immersive specification console: replace normal header and footer chrome, show indexed execution phases and scope state, seal reasoning traces, hold live response prose until completion, keep tool output collapsed, and suppress routine model narration while preserving the full transcript and restoring normal rendering when the mode exits.
17
+
18
+ ## 0.8.4 - 2026-09-01
19
+
20
+ - Add opt-in workflow controls: `/scope` declares project-relative change boundaries and surfaces direct or observed drift without silently expanding scope; `/experiment` creates detached, private-state Git worktrees with complete patch export and explicitly confirmed discard; `/challenge` produces a structured adversarial readiness card whose deterministic gate rejects unresolved evidence.
21
+ - Keep the new controls human-led and local: no child process or agent launch, automatic commit/merge/apply, remote operation, raw command log, unrelated session scan, or mandatory completion interception. Add branch-local scope/challenge state, a private recoverable experiment registry, direct closed validators, installer lifecycle coverage, and security-boundary documentation.
22
+ - Separate `/scope accept` from `/scope add`: accepting acknowledges one observed finding and leaves the declared contract untouched, so a later change to the same path is reported again. Add `/scope recheck` to re-baseline the worktree and deliberately clear snapshot uncertainty, and report removals and no-op verbs explicitly.
23
+ - Export experiment patches as the exact bytes Git produces. A text file that is not valid UTF-8 previously lost its original bytes on export and produced a patch that no longer applied.
24
+ - Disclose ignored files in `/experiment status` and `/experiment close`. Ignored work is invisible to Git status and cannot travel in a patch, so a worktree holding only ignored work no longer looks empty at discard time.
25
+ - Expire a completion challenge that the agent turn ends without answering, instead of leaving its "do not implement" instruction attached to every later turn.
26
+ - Offer a working recovery action for an experiment directory Git no longer tracks: the record can be released while the files are left in place for the human.
27
+ - Snapshot the worktree once per tool instead of twice, skip snapshots for read-only calls, and copy scope entries both when appending and when restoring them so a branch record cannot be rewritten by later mutation.
28
+ - Record an expired challenge distinctly from a cleared one, so a challenge that goes unanswered no longer discards the last completed readiness card after a restart.
29
+ - Report ignored paths from `/experiment status` with no ID, the form used from inside an experiment worktree.
30
+ - Re-derive worktree presence inside the registry lock during `/experiment recover`, so a Git operation performed while a recovery prompt is open cannot drop a live record or adopt a replaced directory.
31
+ - Measure experiment status and patch export from the recorded base commit instead of the worktree's current HEAD. Work committed inside an experiment previously reported as clean, exported to an empty patch, and could be discarded without the dirty-work confirmation.
32
+ - Keep Git-reported paths canonical in workflow state and percent-escape controls only at presentation boundaries, so filenames containing `%`, newlines, Unicode separators, or directionality controls remain matchable without forging system guidance or UI text.
33
+ - Resolve relative direct write and edit paths from the active session directory before comparing them with project-relative scope, so sessions opened below the Git root neither allow outside-scope mutations nor reject matching nested paths.
34
+ - Claim a patch output exclusively instead of checking then renaming, so a destination created in the gap is never replaced without explicit overwrite approval.
35
+ - Require a ready completion verdict to disclose residual risk when the change snapshot was indeterminate, instead of ignoring that signal.
36
+
37
+ ## 0.8.3 - 2026-09-01
38
+
39
+ - Remove the `pi-subagents` package and SpecPi's native-subagent configuration, runtime integration, and installation defaults.
40
+ - Make the workflow rationale explicit: automated parent/child handoffs can silently omit decisive context, while parallel writers fragment assumptions and ownership. Prefer deliberate context gathering, reviewable artifacts, explicit second-opinion sessions, and one writer per working directory or isolated worktree.
41
+ - Split the public security policy from the technical security model. Document latest-release support, private vulnerability reporting, best-effort response expectations, reporting scope, secure operation, and supply-chain assumptions while keeping implementation boundaries in a shipped `SECURITY_MODEL.md`.
42
+
43
+ ## 0.8.2 - 2026-09-01
44
+
45
+ - Keep command-guard denials fail-closed without making every uncertain or wrong-shell cleanup attempt strand the session: only structurally proven lock-worthy critical mutations latch `locked`, while parser fallback, shell-syntax mismatches, and refused reads remain non-latching denials.
46
+ - Protect installed command-guard files as managed enforcement nodes rather than treating the whole command-guard directory as protected, allowing unrelated temporary descendants while preserving ancestor and canonical-path protection. Share the managed-file inventory with installer resources and checksums.
47
+ - Classify cmd-style `rd`/`rmdir /s /q` sent directly to the Windows Bash tool as a corrective non-latching denial, and keep parser-fallback protected-path matching local to the destructive statement so unrelated scratch cleanup cannot inherit a critical result.
48
+
49
+ ## 0.8.1 - 2026-08-30
50
+
51
+ - Ask for Guard approval before Git destroys work. Force pushes (`--force`, `-f`, `--force-with-lease`, `--force-if-includes`) and the wider destructive Git family — remote ref deletion, hard resets, cleans, branch and tag deletion, stash drops, discarding checkouts and restores, rebases, and history rewrites — now surface an approval in Guard instead of running silently, because they discard or rewrite work no local undo restores. Ordinary pushes, pulls, and fetches stay quiet in Guard; all of it still asks in Strict.
52
+
53
+ ## 0.8.0 - 2026-08-31
54
+
55
+ - Parse Bash and cmd at the statement level instead of treating every word in command position as a program. Shell reserved words (`if`/`then`/`while`/`until`/`for`/`do`), the `!` negation prefix, and the `builtin`/`command`/`coproc`/`time` prefixes were taken as leaf executables, so in `if true; then rm -rf /; fi` the real command survived only as an argument list on a leaf named `then` and matched no rule at all. `trap 'rm -rf /' EXIT` now analyzes its handler string, and cmd `if` conditionals are unwrapped the way `for` already was.
56
+ - Resolve the heredoc consumer instead of assuming `-c` makes the body inert. `bash -c 'sh' <<EOF … EOF` runs the body through the `sh` that `-c` launches, and `su root <<EOF` runs it as root, so both are code rather than data.
57
+ - Thread the working directory through a command sequence. Relative targets always resolved against the session cwd regardless of what ran before them, so `cd / && rm -rf usr`, `Set-Location C:\ ; Remove-Item -Recurse -Force Windows`, `cd /d C:\ && rmdir /s /q Windows` and `env --chdir=/ rm -rf usr` were each reported as a determinate, clean delete inside the workspace. A directory change the analyzer cannot resolve now makes later targets uncertain instead of clean.
58
+ - Protect the ancestors that contain enforcement state, not only the subtree itself. Deleting `<agent-dir>/extensions/command-guard` was denied while deleting `<agent-dir>/extensions` or the whole agent directory — a superset of the same tampering — was allowed. Destructive Git operations run inside protected or enforcement trees are classified with them.
59
+ - Canonicalize the path spellings that reach the same target: Win32 trailing dots and spaces (`C:\Windows.`), `~` under PowerShell as well as Bash, the macOS firmlinked `/private/etc` and `/private/var` trees, and the Windows `EFI`/`Recovery` boot partitions.
60
+ - Complete the decode-to-interpreter set (`base32`, `basenc`, `xxd`, `hexdump`, `od`) and the critical-process list (`svchost`, `services`, `smss`, `winlogon`, `launchd`), which previously closed only the base64 and `lsass`/`csrss` spellings of the same operation.
61
+ - Stop an unavailable parser from downgrading a catastrophe into an approvable prompt. A helper timeout, a missing interpreter or a blown limit produced `ask`, so the case where the guard knows least was the case where it yielded most. The raw command text is now scanned for confirmed catastrophic operations before any approval is offered, including the payload of an inline-code flag such as `-Command` or `-c`, which is program text rather than data. The scan reads only what the shell would execute as syntax — quoted arguments stay inert and backslash is treated as an escape only where the shell treats it as one — so a command that merely prints a destructive-looking string is not mistaken for one.
62
+ - Give the PowerShell parser helper the environment it needs to start. Spawned with only `SystemRoot`, `PATH` and `TEMP`, Windows PowerShell 5.1 hung indefinitely on a current Windows Server 2025 image — measured at five of five spawns killed at a 20-second bound with no output and no error — while the same spawn with `PSModulePath`, `APPDATA`, `LOCALAPPDATA` and `USERPROFILE` present completed in about 380 ms. PowerShell 7 was unaffected. Every 5.1 analysis in a session therefore waited out its full bound before falling back. The helper still runs on an allowlist that withholds tokens, keys and other credential-bearing variables.
63
+ - Match endpoint-protection services as complete tokens rather than substrings. `security`, `firewall` and `sentinel` matched anywhere in the arguments, so ordinary units — `redis-sentinel`, `security-scanner.service`, an in-house `firewall-ui` — were critical denials that locked the session.
64
+ - Identify credential paths by shape rather than by bare words that ordinary source trees use as directories. `credentials`, `token`, `secret` and `passwd` matched as standalone path segments, so every file under a monorepo's `packages/token/`, `src/secret/` or `app/credentials/` was a critical read denial.
65
+ - Resolve the agent directory with the analyzed platform's path semantics rather than the host's, so cross-platform classification is deterministic instead of depending on how the host resolves a foreign path spelling.
66
+ - Reformat all tracked JavaScript and TypeScript for readability with four-space indentation, explicit braced control flow, one statement per line, and consistent spacing around blocks and returns. Add pinned project-local Prettier and ESLint checks so future changes preserve the style.
67
+ - Guide agents to prefer simple, explicit commands while Command Guard is active, reducing avoidable parser-uncertainty approvals without weakening or bypassing protection.
68
+ - Add a first-party, session-scoped command guard with Guard, Strict, Off, and Locked states. Guard is a narrow catastrophe backstop: confirmed host-wide destruction and enforcement tampering are immutable denials, analysis uncertainty asks with UI and denies headlessly, and determinate non-catastrophic work runs without routine prompts. Strict retains broad approval behavior.
69
+ - Add bounded shell-specific analyzers, native PowerShell AST parsing without evaluation, protected-path canonicalization, display redaction, deterministic policy smoke validation, and Linux/Windows regression coverage across PowerShell 5.1, PowerShell 7, cmd, and inert adversarial corpora.
70
+ - Propagate protected modes to supported native subagents through the pinned public preflight contract, a managed child extension, and a reserved binding; preserve unrelated child extensions, block unverifiable launch forms, and exercise a real inert native-child process in CI.
71
+ - Parse PowerShell with whichever installed host accepts the command text: PowerShell 7 grammar (`&&`, `??`, `?:`) is no longer denied as malformed when only Windows PowerShell 5.1 parses it, and either host alone is now sufficient. A rejection is authoritative only when every installed host rejects it, and a spawn failure can never escalate a syntax error into a critical denial.
72
+ - Classify argv-prefix runners (`setsid`, `stdbuf`, `ionice`, `taskset`, `flock`, `systemd-run`, `unbuffer`, `runuser`, `setarch`, `xvfb-run`, `proxychains`), command-string runners (`su`, `runuser`, `script`, `watch`), awk shell escapes, and `osascript`/`tclsh`/`expect` inline code, so a critical payload cannot be laundered through an unlisted wrapper.
73
+ - Treat a whitespace-bearing command token as unresolved rather than reducing it to its trailing path segment, and propagate an unresolved nested child up to the whole analysis so wrapped command strings cannot be reported as a clean parse.
74
+ - Match every PowerShell parameter prefix, not only full spellings: `-enc` runs the same code as `-EncodedCommand`, so an abbreviated flag used to carry a base64 payload past the guard with no approval when the invocation arrived through the Bash or cmd parser. Bash- and cmd-hosted `powershell`/`pwsh` invocations now decode and classify their `-Command`/`-EncodedCommand` payload instead of seeing one opaque argument, including recursive `cmd /c powershell.exe` dispatch, and an absent PowerShell parser downgrades to an approval rather than locking the session over an interpreter the command could not have used.
75
+ - Remove routine Guard approvals for determinate non-catastrophic work, including project or user-data deletion, force push, publication, installation, network transfer, process termination, service and registry changes, and out-of-workspace targets. Keep those broader prompts in Strict. Narrow Guard's protected mutation boundary to host-root/key system targets and, inside the installed agent, command-guard enforcement sources, `settings.json`, and `specpi/manifest.json`.
76
+ - Identify Pi and SpecPi private state by location rather than by name. `specpi/manifest.json`, `specpi/backups`, `specpi/wishlist` and `extensions/command-guard` were matched as bare relative segments, so reviewing SpecPi's own repository denied a file read critically and locked the session, and `guard.self-tamper` fired on any mutation whose arguments merely contained "specpi" or "command-guard" — `mkdir specpi-experiment` was a critical denial. On POSIX the rule was an unanchored `/(?:specpi|pi).*(?:auth|session|…)/`, so everyday files such as `src/api/session.ts` and `lib/api/auth.py` ("pi" inside "api") were denied critically too. These now key on the resolved `PI_CODING_AGENT_DIR`; Guard protects only enforcement-critical installed state while Strict retains the wider private-path policy.
77
+ - Stop latching the session lock when a *read* is refused. Blocking the read is the protection; locking additionally refused every later call — including read-only ones — until `/guard unlock`, so one blocked file ended the session. Critical mutation attempts still lock.
78
+ - Stop treating a plain `find` as a deletion. `find` sits in the delete family for `-delete`/`-exec`, but `hasRecursiveFlag` matches any predicate containing an "r", so `find src -type f -print` was reported as "Recursive deletion needs approval", `find /etc -name '*.conf'` denied critically, and `find . -name specpi` tripped guard self-tamper. Mutating `find` now reaches `filesystem.find-mutation`, which was unreachable behind the delete-family branch, and `clearlyReadOnly` shares the same predicate list.
79
+ - Classify complete environment enumeration however it is spelled (`printenv`, `declare -x`, `export -p`, `compgen -v`, bare `declare`) and recognize `/proc/<pid>/environ` and `/proc/<pid>/mem` shell reads. Strict asks about those findings; Guard does not claim comprehensive credential-read protection.
80
+ - Protect macOS system roots (`/System`, `/Library`, `/Applications`, `/Users/<name>`, `/Volumes/<name>`, `/private/etc`, `/cores`) and `.bash_profile`/`.zshenv`/`.zlogin`, without capturing the firmlinked `/System/Volumes/Data` user tree.
81
+ - Give approval prompts a human-scale bound and add **Allow exact call for session**. Reuse is limited to 128 in-memory SHA-256 fingerprints over complete tool input, cwd, mode, and policy version; calls are always reanalyzed first, critical denials cannot be overridden, and `/guard clear-approvals` clears the set.
82
+ - Fail doctor on installed command-guard checksum drift, on a `pi-subagents` version that no longer matches the pinned native-child contract, and when no PowerShell parser host is available; add byte-for-byte installer/update rollback injection coverage.
83
+ - Document the defense-in-depth boundary, including direct user commands, custom tools, approved scripts, trusted extensions/configuration, TOCTOU behavior, and the need for OS-level isolation with hostile code.
84
+
85
+ ## 0.7.0 - 2026-08-29
86
+
87
+ - Make retirement durable: every capability now ships a closed validator from a reviewed catalog, `finish_harness_improvement` dispatches all linked validators generically and fails closed on unknown names, and `npm run check` plus `specpi doctor` continuously re-prove retired capabilities in temporary state.
88
+ - Add the improvement journal: retirements persist bounded sanitized proof (acceptance evidence, gates, repo-relative changed files, SpecPi version) in the local decision log, `/wishlist history [id]` renders the harness's own changelog with rollback context, and the report's retired list shows verification dates and gates.
89
+ - Add loop health metrics: deterministic retirements, reopen rate, open reviews, median time-to-retire, and qualification rate rendered in the report footer and summarized by `/wishlist status`.
90
+ - Make reopens context-rich: reopen decisions link to the retirement they review, carry up to five sanitized post-retirement signals, and the `/harness-improvement` prompt includes the original proof and what changed since.
91
+ - Extend repository checks to the wishlist extension and validator sources, ship the validator module through install/update/uninstall, and run completion validators from the source checkout under review; document the new local-only journal data classes in SECURITY.md and the `SpecPi-Gap:` commit trailer convention in the improvement skill.
92
+
93
+ ## 0.6.1 - 2026-08-29
94
+
95
+ - Flush a prompt frame when extension dialogs mount so chained menus such as `/spec-subagents` do not remain invisible until the next keypress in regular TUI sessions, notably through Windows SSH terminals; require and bootstrap the reviewed Pi 0.84.4 baseline that provides prompt lifecycle events.
96
+ - Fix provider-profile activation on model changes by prompting the user to run the documented `/reload` flow instead of calling command-only `ctx.reload()` from a lifecycle event context.
97
+ - Redesign the README self-improvement diagram as a compact Tea House graphic and version its asset URL so GitHub and browser caches cannot retain the previous rendering.
98
+
99
+ ## 0.6.0 - 2026-08-29
100
+
101
+ - Add exact-provider subagent profiles that restore automatically with a single bounded runtime reload, while keeping capacity global and unavailable saved models stale without replacement.
102
+ - Add ephemeral provider leases so simultaneous different-provider Pi processes fail closed instead of racing the shared active settings mirror.
103
+ - Preserve private provider profiles across update and uninstall; store no credentials, authentication data, prompts, sessions, history, or complete settings snapshots.
104
+ - Replace the README's text loop with an accessible static Tea House SVG and update the showcase to explain saved provider restoration.
105
+
106
+ ## 0.5.0 - 2026-08-29
107
+
108
+ - Automatically install pinned `@earendil-works/pi-coding-agent@0.84.3` through npm after confirmation when `pi` is absent; preserve the external installation on rollback and uninstall, with `--skip-package-install` as the opt-out.
109
+ - Add `/spec-subagents` with confirmed capacity, builtin-role model, and thinking configuration using only the documented `pi-subagents` config surface.
110
+ - Synchronize strict native subagent scope to the parent's exact Pi provider, filter model choices accordingly, flag stale role models after provider changes, and block unsafe project-scope tool launches.
111
+ - Preserve user-tunable role and capacity leaves across update/uninstall while continuing to enforce security-owned settings; add bounded leaf backups, shared locking, atomic writes, rollback, doctor validation, and legacy whole-file config migration.
112
+ - Add provider-safe delegation guidance to the working agreement, README, security documentation, and static showcase.
113
+
114
+ ## 0.4.0 - 2026-08-29
115
+
116
+ - Replace the abstract cycle charts with an accessible interactive walkthrough that shows one gap moving through evidence, human choice, proof, retirement, and later review.
117
+ - Replace `@tmustier/pi-files-widget` with an in-house, Tea House-native `/files` browser using Pi's built-in syntax and Markdown renderers; remove the bat, git-delta, and glow prerequisites and retire their legacy managed binaries on update.
118
+
119
+ ## 0.3.0 - 2026-08-29
120
+
121
+ - Complete the local improvement loop with explicit collection consent, deterministic evidence ranking, lifecycle decisions, and regression-aware retirement.
122
+ - Replace hard-coded implemented capability keys with a reviewed registry linked to closed `specpi doctor` validators; the browser smoke now verifies both exact and changed pixel comparisons.
123
+ - Add reversible exact alias decisions, local sanitized issue drafts, and recoverable checksummed archive/reset operations.
124
+ - Add the one-command `/harness-improvement` menu and `specpi-improve` workflow, with session-bound implementation authorization, repository and capability verification gates, and automatic retirement only after success.
125
+ - Refresh the minimal README and showcase with explicit retired/review semantics plus accessible cycle and verification-outcome charts.
126
+
127
+ ## 0.2.0 - 2026-08-29
128
+
129
+ - Add a native Windows command launcher and Windows-safe executable discovery for `pi.cmd`, `npm.cmd`, and access-restricted Windows App Execution Aliases such as `winget.exe`.
130
+ - Invoke `.cmd`/`.bat` shims as a single quoted `ComSpec` command, avoiding Node's deprecated shell-plus-arguments path.
131
+ - Make the npm binary entry invoke Node directly instead of requiring a POSIX shell.
132
+ - Document platform-specific install commands and automatic dependency installation, and preflight the Pi 0.80.0 package API baseline.
133
+ - Add Windows installation smoke coverage.
134
+ - Offer missing bat, git-delta, glow, and DonSeTch tools individually during interactive installs; `--yes` attempts all and `--skip-tool-install` opts out.
135
+ - Pin bat 0.26.1, git-delta 0.19.2 (0.18.2 on Intel macOS), glow 3.0.0, and DonSeTch 3.4.0; use exact Winget installs on Windows and checksum-verified managed archives on Linux/macOS.
136
+ - Roll managed optional binaries back with failed installs and remove them on uninstall while documenting that Winget/global npm changes remain external.
137
+
138
+ ## 0.1.0 - 2026-08-28
139
+
140
+ - Add explicit plan/install/update/doctor/uninstall workflow.
141
+ - Add managed AGENTS and shell blocks with backups and checksums.
142
+ - Add provider-safe strict native-subagent inheritance.
143
+ - Disable external Codex subscription runners.
144
+ - Bundle the Spec extension, Tea House theme, and DonSeTch skill.
145
+ - Make `/spec` a focused execution mode with persistent activity UI, collapsed tool output, per-turn guidance, session persistence, and full toggle restoration.
146
+ - Add a privacy-minimized, task-deduplicated capability-gap collector and generated tool wishlist, with `/wishlist` rendering the refreshed Markdown report directly in the conversation and retiring capabilities implemented by SpecPi.
147
+ - Add managed isolated browser QA on hosts satisfying Playwright Chromium system requirements, with a pinned runtime, responsive viewport tools, bounded inline screenshots, explicit baselines, and pixel-diff artifacts.
148
+ - Add browser runtime staging, rollback, doctor smoke validation, and uninstall cleanup while preserving browser artifacts.
149
+ - Add a zero-dependency SpecPi showcase site with GitHub Pages publishing.
150
+ - Pin the reviewed Pi package baseline.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SpecPi contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NPM_RELEASE.md ADDED
@@ -0,0 +1,110 @@
1
+ # npm Release Runbook
2
+
3
+ This runbook is for SpecPi maintainers. Publishing, changing dist-tags, deprecating versions, and changing package ownership are remote operations and require an explicit human decision.
4
+
5
+ ## One-time npm setup
6
+
7
+ 1. Sign in to the intended npm owner account and enable two-factor authentication and recovery access.
8
+ 2. Confirm that the unscoped `specpi` name is available immediately before the first release.
9
+ 3. Create a protected GitHub environment named `npm` with required reviewer approval.
10
+ 4. Configure npm trusted publishing for `TannerMidd/SpecPi` and `.github/workflows/npm-publish.yml`.
11
+ 5. Do not configure a long-lived `NPM_TOKEN` when trusted publishing is available.
12
+
13
+ If npm requires an initial interactive publication before a trusted publisher can be attached, validate the release artifact through every gate below. A local interactive npm session cannot issue GitHub's OIDC provenance, while this package requests provenance by default. For this one bootstrap exception only, publish the exact reviewed tarball with 2FA and an explicit override:
14
+
15
+ ```bash
16
+ npm publish --ignore-scripts --access public --provenance=false ./specpi-<version>.tgz
17
+ ```
18
+
19
+ Verify the registry bytes and metadata immediately, then configure trusted publishing before any later release. Do not publish a GitHub Release for that same bootstrap version: the release workflow deliberately rejects versions that already exist. Keep the reviewed source tag as its immutable source reference. All later versions use the protected OIDC workflow and provenance.
20
+
21
+ ## Prepare a release
22
+
23
+ 1. Select a version that has never appeared on npm. npm versions are immutable.
24
+ 2. Update `package.json`, `CHANGELOG.md`, `README.md`, `site/index.html`, and `site/wiki/index.html` to the same version.
25
+ 3. For a stable release, add a dated changelog heading. Use a prerelease version when the package should not receive the `latest` dist-tag.
26
+ 4. Install the pinned development tools without lifecycle scripts or peers:
27
+
28
+ ```bash
29
+ npm install --ignore-scripts --omit=peer --no-package-lock
30
+ ```
31
+
32
+ 5. Run the complete repository and package gates:
33
+
34
+ ```bash
35
+ npm run check
36
+ npm run check:pi-package
37
+ npm publish --dry-run --ignore-scripts --provenance=false
38
+ git diff --check
39
+ ```
40
+
41
+ Dry runs explicitly disable provenance because local and validation contexts do not have GitHub OIDC; the protected publish job still requires provenance.
42
+
43
+ 6. Inspect the final diff and the JSON file manifest emitted by `npm pack --dry-run --json`.
44
+ 7. Obtain fresh read-only review of package metadata, installer behavior, workflow permissions, and the packed artifact.
45
+ 8. Commit the reviewed release, create the matching `v<version>` tag, and create a GitHub Release only after explicit approval.
46
+
47
+ ## Documentation and publication order
48
+
49
+ Publication is a post-merge operation. npm versions are immutable, and the protected workflow must run from a reviewed release tag on `main`, so never publish from an unmerged commit: that would leave permanent public bytes whose source might never land.
50
+
51
+ `README.md`, `site/index.html`, and `site/wiki/index.html` document both the canonical `npm install --global specpi@latest` route and a version-pinned example, while `.github/workflows/pages.yml` deploys the site on any push to `main` that touches `site/**`. The release merge therefore deploys install instructions for a version that is not yet on the registry, and the site advertises a command that resolves to `E404` until publication completes.
52
+
53
+ Keep that window short and bounded:
54
+
55
+ 1. Merge the reviewed release to `main`.
56
+ 2. Create the `v<version>` tag and GitHub Release immediately, and approve the `npm` environment without delay. For the one bootstrap version described above, publish the reviewed tarball interactively instead and create no GitHub Release.
57
+ 3. Wait for the publish job to verify registry version, integrity, dist-tag, and attestation state.
58
+ 4. Complete the registry smoke check below, then confirm the deployed site and announce the release.
59
+
60
+ If publication cannot complete, revert the release merge on `main` so the site stops advertising an unavailable version, and restart from a new version rather than reusing the failed one.
61
+
62
+ ## Automated publication
63
+
64
+ Publishing the GitHub Release starts `.github/workflows/npm-publish.yml`.
65
+
66
+ All three jobs pin npm 11.19.1, above npm's 11.5.1 trusted-publishing minimum, on Node.js 22.19.0 and GitHub-hosted runners.
67
+
68
+ The build job checks tag, package version, changelog entry, and registry immutability, then creates and checksums one tarball before installing repository development tools. It stores that immutable candidate for seven days.
69
+
70
+ The validation job runs as an Ubuntu, Windows, and macOS matrix. Every runner downloads and verifies the same candidate, exercises that exact tarball through the npm and native Pi package lifecycles, and runs an npm publish dry-run; Ubuntu also runs the full repository checks.
71
+
72
+ The publish job requires approval in the `npm` environment. Publication runs are serialized, and every candidate must advance its existing dist-tag. The job downloads and verifies the same immutable candidate, publishes through GitHub OIDC with npm provenance, uses `next` for prereleases and `latest` for stable versions, and reads the registry back until version, integrity, dist-tag, and attestation state match.
73
+
74
+ ## Registry smoke check
75
+
76
+ After publication, install from the registry into disposable state rather than reusing the local tarball:
77
+
78
+ ```bash
79
+ npm install --global specpi@<version>
80
+ specpi plan
81
+ ```
82
+
83
+ Then complete one isolated install, doctor, and uninstall lifecycle before announcing the release. Verify the npm package page, README images, license, repository links, provenance, and dist-tag.
84
+
85
+ ## Update and uninstall contract
86
+
87
+ Updating the npm CLI and managed SpecPi state are separate operations:
88
+
89
+ ```bash
90
+ npm install --global specpi@latest
91
+ specpi update
92
+ specpi doctor
93
+ ```
94
+
95
+ Remove managed resources before removing the CLI:
96
+
97
+ ```bash
98
+ specpi uninstall
99
+ npm uninstall --global specpi
100
+ ```
101
+
102
+ Private wishlist, journal, experiment, and patch state survives managed uninstall unless explicitly removed.
103
+
104
+ ## Failure policy
105
+
106
+ Before publication, stop and fix any failed gate without changing npm.
107
+
108
+ After publication, never attempt to replace a version with different bytes. Verify the defect from the registry artifact, deprecate the affected version when warranted, publish a corrected patch after all gates pass, and change a dist-tag only through an explicit reviewed operation. Use unpublish only when npm policy, legal requirements, or credential exposure makes it necessary.
109
+
110
+ If a publishing credential is exposed, revoke it, stop active workflows, inspect npm ownership and dist-tag history, follow the private security-reporting process, and rotate related credentials before resuming.
package/README.md ADDED
@@ -0,0 +1,155 @@
1
+ <p align="center">
2
+ <img src="site/logo.svg" width="104" alt="SpecPi logo">
3
+ </p>
4
+
5
+ <h1 align="center">SpecPi</h1>
6
+
7
+ <p align="center">
8
+ A local, human-directed improvement harness for the
9
+ <a href="https://pi.dev/">Pi coding agent</a>.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://tannermidd.github.io/SpecPi/"><strong>Overview</strong></a>
14
+ · <a href="https://tannermidd.github.io/SpecPi/wiki/">Wiki</a>
15
+ · <a href="#install">Install</a>
16
+ · <a href="SECURITY.md">Security</a>
17
+ </p>
18
+
19
+ ## Purpose
20
+
21
+ SpecPi records recurring capability gaps in local state and presents qualified items for review. Selecting an item with `/harness-improvement` authorizes one bounded change. Repository checks and capability-specific validators must pass before the item can retire.
22
+
23
+ Collection is disabled until explicitly enabled. Reports are sanitized, bounded, deduplicated by task, and never uploaded.
24
+
25
+ <p align="center">
26
+ <img src="site/self-improvement-loop-v2.svg" width="760" alt="SpecPi improvement loop: local friction becomes qualified evidence; a person chooses one change; verification failure keeps it selected; later evidence returns it to human review.">
27
+ </p>
28
+
29
+ ## Improvement loop
30
+
31
+ 1. **Record:** A reusable capability gap is stored as a sanitized local report.
32
+ 2. **Qualify:** Recurrence, project reach, impact, and recency determine whether the item enters the review menu.
33
+ 3. **Select:** `/harness-improvement` authorizes one exact item.
34
+ 4. **Implement:** The `specpi-improve` skill makes the narrowest sufficient change and adds direct checks.
35
+ 5. **Verify:** The completion gate checks registry integration, runs `npm run check`, and runs the item's closed validator.
36
+ 6. **Retire:** A passing item leaves the queue. Its evidence, gates, changed files, and version remain in the local journal.
37
+ 7. **Review again:** Later evidence returns the item as `review-needed`. Implementation does not restart automatically.
38
+
39
+ Use `/wishlist status` for queue and loop-health totals. Use `/wishlist history [gap-id]` for retirement evidence, validators, changed files, reopen signals, and rollback context. `/wishlist` also supports duplicate cleanup, local issue drafts, archive, and reset operations.
40
+
41
+ ## Included capabilities
42
+
43
+ | Capability | Interface | Behavior |
44
+ | --- | --- | --- |
45
+ | Spec execution | `/spec` | Replaces normal chrome with a technical run panel, seals live reasoning, holds streaming prose until complete, and keeps tools collapsed. |
46
+ | File review | `/files` | Browses source, rendered Markdown, Git diffs, and bounded review comments. |
47
+ | Scope monitoring | `/scope` | Declares expected paths and reports unacknowledged drift. |
48
+ | Worktree experiments | `/experiment` | Creates detached worktrees with keep, binary patch export, and confirmed discard outcomes. |
49
+ | Completion review | `/challenge` | Produces a structured readiness review with evidence, gaps, contradictions, and residual risk. |
50
+ | Capability wishlist | `/wishlist` | Stores and curates privacy-minimized local gap reports. |
51
+ | Improvement selection | `/harness-improvement` | Authorizes one qualified or review-needed item. |
52
+ | Command guard | `/guard` | Denies confirmed host-wide destructive calls and requests approval for bounded risk classes. |
53
+ | Browser QA | Browser tools | Opens an isolated Chromium context for rendered inspection and screenshots. |
54
+ | Specification theme | `specpi-spec` | Applies the GitHub Pages design’s blueprint blue, technical greys, layered surfaces, and restrained semantic states across Pi. |
55
+ | Installer lifecycle | `specpi` | Plans, installs, updates, verifies, and uninstalls managed state with backups and rollback. |
56
+
57
+ `specpi-spec` is the default Pi theme. It carries the site’s clean specification direction through message surfaces, tools, Markdown, diffs, syntax highlighting, search, and the full thinking-level scale. The original `tea-house` theme remains bundled and selectable from `/settings`.
58
+
59
+ Capability registry entries include closed offline validators. Completion, `npm run check`, and `specpi doctor` run those validators.
60
+
61
+ ## Install
62
+
63
+ Requirements:
64
+
65
+ - Node.js 22.19 or newer
66
+ - npm
67
+ - Git
68
+ - Pi 0.84.4 or newer. If Pi is absent, the confirmed install adds the reviewed pinned package.
69
+
70
+ Install the CLI, inspect its non-mutating plan, and then confirm the managed installation:
71
+
72
+ ```bash
73
+ npm install --global specpi@latest
74
+ specpi plan
75
+ specpi install
76
+ specpi doctor
77
+ ```
78
+
79
+ Pin the reusable CLI when installing a reviewed release, or inspect its plan without retaining a global CLI installation:
80
+
81
+ ```bash
82
+ npm install --global specpi@0.10.0
83
+ npx --package specpi@0.10.0 specpi plan
84
+ ```
85
+
86
+ For a source-audited installation, clone the exact release instead:
87
+
88
+ ```bash
89
+ git clone --branch v0.10.0 --depth 1 https://github.com/TannerMidd/SpecPi.git
90
+ cd SpecPi
91
+ ./specpi plan
92
+ ./specpi install
93
+ ./specpi doctor
94
+ ```
95
+
96
+ On Windows source checkouts, use `.\specpi.cmd` in place of `./specpi`. The npm installation provides the `specpi` command on every supported platform.
97
+
98
+ `plan` does not mutate the system. Install, update, and uninstall require confirmation unless `--yes` is supplied. After installation, run `/reload` in Pi.
99
+
100
+ Update the npm CLI and its managed installation as two explicit steps:
101
+
102
+ ```bash
103
+ npm install --global specpi@latest
104
+ specpi update
105
+ specpi doctor
106
+ ```
107
+
108
+ Uninstall managed SpecPi resources before removing the CLI. Private wishlist, journal, experiment, and patch state remains local unless explicitly removed:
109
+
110
+ ```bash
111
+ specpi uninstall
112
+ npm uninstall --global specpi
113
+ ```
114
+
115
+ Direct `pi install npm:specpi` loads the package's extensions, skills, and themes only. It does not run the full installer or provide managed instructions, browser runtime dependencies, supporting Pi packages, optional tools, shell integration, backups, or ownership records.
116
+
117
+ ## Command guard
118
+
119
+ Every supported model-initiated Pi tool call is classified before execution. Select one mode at session start:
120
+
121
+ - **Guard:** Denies confirmed host-wide catastrophe and guard tampering, asks before Git destroys work, and otherwise remains quiet.
122
+ - **Strict:** Adds approval requests for mutation, execution, sensitive reads, and network activity.
123
+ - **Off:** Requires confirmation and applies only to the current session.
124
+
125
+ Approvals apply to one exact call and one session. Only a structurally proven critical mutation locks the session. Parser uncertainty and invalid cleanup syntax are denied without locking later work.
126
+
127
+ The guard covers the documented `bash`, `powershell`, `read`, `write`, and `edit` seams. Direct shell escapes, malicious extensions, unclassified custom tools, approved scripts, TOCTOU changes, and external processes remain outside its scope.
128
+
129
+ ## Work ownership
130
+
131
+ SpecPi does not install subagent orchestration. Keep one writer per working directory. A parent agent determines what context a child receives and summarizes what returns, so either handoff can omit a material constraint. Parallel writers also introduce conflicting assumptions and increase review work.
132
+
133
+ Use `/experiment start` when an independent review or trial justifies a separate worktree. Open the reported path in another Pi session. SpecPi does not launch an agent, copy dirty base changes, commit, merge, or touch remotes.
134
+
135
+ `/scope set` declares expected paths. `/scope accept <path>` acknowledges one finding without widening the contract. `/scope add <path>` widens it. `/scope recheck` replaces an uncertain baseline.
136
+
137
+ `/challenge` requires structured requirement evidence and checks for contradictions, false-positive validation, scope drift, missing runtime or visual checks, and residual risk. Its result supports human review and does not replace direct proof.
138
+
139
+ ## Data and security boundaries
140
+
141
+ SpecPi does not persist command text or read Pi credentials, unrelated sessions, or history. Scope and challenge records are bounded entries in the current Pi session. Wishlist reports, improvement journals, experiment metadata, and exported patches remain in private local SpecPi state and can survive uninstall. Review local artifacts before sharing.
142
+
143
+ Pi extensions run with the current user's permissions. Use OS permissions, a least-privilege account, a container, or a VM for hostile code or data. See [SECURITY_MODEL.md](SECURITY_MODEL.md) for the complete trust model and [SECURITY.md](SECURITY.md) for vulnerability reporting.
144
+
145
+ ## Development
146
+
147
+ ```bash
148
+ npm install --ignore-scripts --omit=peer --no-package-lock
149
+ npm run format
150
+ npm run check
151
+ ```
152
+
153
+ JavaScript and TypeScript use four-space indentation, explicit braced control flow, and one statement per line. The repository check enforces formatting, validates syntax, runs the Node test suite, executes registry-linked validators, and installs the exact npm tarball through an isolated lifecycle. Maintainers should follow [NPM_RELEASE.md](NPM_RELEASE.md) for release preparation and protected publication.
154
+
155
+ MIT licensed.
package/SECURITY.md ADDED
@@ -0,0 +1,85 @@
1
+ # Security Policy
2
+
3
+ This policy explains which SpecPi releases receive security fixes, how to report a vulnerability, and the security responsibilities shared by SpecPi and its users. For architecture, trust boundaries, and component limitations, see [SECURITY_MODEL.md](SECURITY_MODEL.md). Exact third-party versions and licenses are listed in [THIRD_PARTY.md](THIRD_PARTY.md).
4
+
5
+ ## Supported versions
6
+
7
+ SpecPi provides security fixes for the latest tagged release only. Older releases are unsupported unless a published security advisory says otherwise. Before reporting, check whether the latest release already corrects the behavior; reports affecting the supported release remain welcome.
8
+
9
+ | Release | Security support |
10
+ | --- | --- |
11
+ | Latest tagged release | Supported |
12
+ | Older releases | Unsupported |
13
+
14
+ ## Report a vulnerability
15
+
16
+ Report suspected vulnerabilities through [GitHub private vulnerability reporting](https://github.com/TannerMidd/SpecPi/security/advisories/new). SpecPi currently accepts private reports only through GitHub.
17
+
18
+ Do not open a public issue, pull request, discussion, or other public report containing vulnerability or exploit details. A GitHub account is required. If private reporting is unexpectedly unavailable, open a public issue containing no vulnerability details and ask the maintainer to restore the private reporting channel before sharing the report.
19
+
20
+ Include as much of the following as is safe and practical:
21
+
22
+ - the affected SpecPi release or commit;
23
+ - the affected installer command, extension, tool, workflow, or website component;
24
+ - operating system and relevant configuration;
25
+ - expected and observed behavior;
26
+ - security impact and plausible attack scenario;
27
+ - minimal reproduction steps or proof of concept;
28
+ - known mitigations or workarounds;
29
+ - whether the issue is already public or actively exploited;
30
+ - preferred credit or anonymity.
31
+
32
+ Do not include real credentials, personal data, production secrets, or destructive payloads when a minimized demonstration is sufficient.
33
+
34
+ SpecPi handles reports on a best-effort basis. Maintainers will acknowledge, assess, and communicate as capacity permits, but the project does not promise fixed response or remediation times. Fix timing depends on impact, exploitability, complexity, upstream coordination, and release safety.
35
+
36
+ Please keep the report private while impact, mitigations, a fix, and an advisory are coordinated. Disclosure timing will be discussed with the reporter and may be accelerated when details are already public or exploitation is active. SpecPi does not currently operate a bug bounty program.
37
+
38
+ ## Scope
39
+
40
+ Reports are in scope when they concern SpecPi-owned behavior, including:
41
+
42
+ - the plan, install, update, doctor, and uninstall lifecycle;
43
+ - managed configuration, backups, checksums, rollback, and shell integration;
44
+ - bundled extensions, skills, themes, browser integration, and local state;
45
+ - Command Guard classification, enforcement, approval, or bypass behavior;
46
+ - the GitHub Pages site and repository release or deployment workflows;
47
+ - an upstream dependency when SpecPi's integration, configuration, or selected version creates or exposes the vulnerability.
48
+
49
+ Pi, npm, Chromium, Playwright, DonSeTch, GitHub, and other third-party projects maintain their own security boundaries. Upstream-only vulnerabilities may be redirected to the responsible project. Reports remain relevant to SpecPi when its use of an upstream component creates a distinct risk or requires a SpecPi mitigation.
50
+
51
+ A disagreement with an intentional, documented limitation is not by itself a vulnerability. Reports that show the implementation violating its stated boundary, silently weakening a protection, exposing protected data, or enabling a practical bypass are welcome.
52
+
53
+ ## Security updates
54
+
55
+ When appropriate, SpecPi publishes security information through [GitHub Security Advisories](https://github.com/TannerMidd/SpecPi/security/advisories), tagged releases, and [CHANGELOG.md](CHANGELOG.md). An advisory should identify affected and fixed releases, impact, mitigations or workarounds, and upgrade guidance. A CVE may be requested when appropriate.
56
+
57
+ ## Secure installation and operation
58
+
59
+ - Install a version-pinned npm release or clone and review the matching source tag. Verify npm provenance when relying on the registry artifact. Do not pipe remote installer content directly into a shell.
60
+ - Installing the npm package adds the CLI only. Review `specpi plan` before installation or update, and use `--yes` only when every planned external installation is intended.
61
+ - Treat `pi install npm:specpi` as limited resource-only mode, not as the managed installer with browser runtime, supporting packages, instructions, backups, and rollback ownership.
62
+ - Run `specpi doctor` after installation and updates.
63
+ - Run Pi and SpecPi with the least operating-system privilege practical. Use a container or VM for hostile repositories, code, or web content.
64
+ - Protect Pi configuration and credentials with operating-system permissions. SpecPi is not a credential or process sandbox.
65
+ - Use dedicated test accounts rather than personal authenticated browser sessions.
66
+ - Inspect wishlist reports, issue drafts, screenshots, page text, downloads, console output, and visual baselines before sharing them.
67
+ - Review optional and global package installations. Some external state and package caches survive rollback or uninstall.
68
+
69
+ ## Security boundaries at a glance
70
+
71
+ | Area | SpecPi provides | SpecPi does not provide |
72
+ | --- | --- | --- |
73
+ | npm distribution | Reviewed file allow-list, no install lifecycle script, protected publishing, and requested provenance | Automatic execution of the managed SpecPi installer or proof that packaged code is safe |
74
+ | Installer | Explicit plans and confirmation, bounded managed changes, backups, checksums, atomic promotion, and rollback | Rollback of every external package-manager side effect or cache |
75
+ | Command Guard | Pre-execution defense in depth for documented model-tool seams | A general sandbox for direct user commands, arbitrary tools, scripts, extensions, or running processes |
76
+ | Local improvement state | Explicit collection choice, bounded local records, sanitization, and no SpecPi upload | Guaranteed removal of every plain-language identity or automatic deletion on uninstall |
77
+ | Browser | A fresh Chromium context without the personal browser profile | Operating-system or network isolation from hostile web content |
78
+
79
+ The authoritative assumptions, enforcement seams, residual risks, and component details are in [SECURITY_MODEL.md](SECURITY_MODEL.md).
80
+
81
+ ## Dependencies and supply chain
82
+
83
+ SpecPi pins reviewed executable dependencies and uses a reviewed lockfile for its managed browser runtime. The npm release workflow validates one tarball, publishes those same bytes from a protected environment with GitHub OIDC, and requests npm provenance. Provenance links an artifact to its build workflow but does not prove the source or dependencies are safe. Pinning, lockfiles, and provenance improve accountability but are not complete reproducible-build guarantees. Installation still trusts the configured package registries, upstream publishers, downloaded browser distribution, GitHub Actions, and the invoking host.
84
+
85
+ Some optional or bootstrap packages are installed globally and remain external system state. SpecPi uninstall does not remove them. See [THIRD_PARTY.md](THIRD_PARTY.md) for the canonical component and version inventory and [SECURITY_MODEL.md](SECURITY_MODEL.md) for acquisition and rollback boundaries.