docks-kit 0.22.23 → 0.22.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,38 @@
1
1
  // Generated by cli/scripts/generate-sot-payload.ts. DO NOT EDIT.
2
2
  // Edit SoT/, notification.mp3, or package.json, then run: bun cli/scripts/generate-sot-payload.ts
3
3
 
4
- export const GENERATED_PACKAGE_VERSION = "0.22.23"
4
+ export const GENERATED_PACKAGE_VERSION = "0.22.28"
5
5
 
6
6
  export const GENERATED_PAYLOAD_TEXT = {
7
7
  "SoT/.agents/skills.txt": "# Universal AI-agent skill manifest intentionally empty.\n# Global skill discovery is opt-in: add one slug per installed skill: <owner>/<repo>@<skill-name> (or a path to one skill directory).\n# EngineNative ignores comments and blank lines.\n",
8
- "SoT/models.json": "{\n \"$comment\": \"Curated overlay for docks-kit model listings: aliases (kind alias) and notes always apply; the id rows are the fallback when the harness's live list is unavailable (harness not enabled, no login or cache, offline). Live sources: Claude via the Claude Code login against the Anthropic models API (cached 6 h in ~/.docks-kit/kit.db), Codex via ~/.codex/models_cache.json, omp via omp models --json.\",\n \"claude\": {\n \"verified\": \"2026-09-22\",\n \"models\": [\n { \"id\": \"best\", \"kind\": \"alias\", \"note\": \"Fable 5.1 where the org has access, latest Opus otherwise (Claude Code >=2.1.257; Claude apps gateway sessions still resolve Fable 5)\" },\n { \"id\": \"opus\", \"kind\": \"alias\", \"note\": \"latest Opus — the kit SoT default (Opus 5.5 from Claude Code >=2.1.280)\" },\n { \"id\": \"fable\", \"kind\": \"alias\", \"note\": \"Fable 5.1 — needs org access + Claude Code >=2.1.257 (Claude apps gateway sessions still resolve Fable 5)\" },\n { \"id\": \"sonnet\", \"kind\": \"alias\", \"note\": \"latest Sonnet (currently Sonnet 5)\" },\n { \"id\": \"haiku\", \"kind\": \"alias\", \"note\": \"latest Haiku (currently Haiku 4.5)\" },\n { \"id\": \"default\", \"kind\": \"alias\", \"note\": \"engine pseudo-value: deletes the deployed model key so the account default applies\" },\n { \"id\": \"claude-opus-5-5\", \"kind\": \"id\", \"note\": \"Opus 5.5 — needs Claude Code >=2.1.280\" },\n { \"id\": \"claude-fable-5-1\", \"kind\": \"id\", \"note\": \"Fable 5.1 — needs Claude Code >=2.1.257\" },\n { \"id\": \"claude-fable-5\", \"kind\": \"id\", \"note\": \"Fable 5 (legacy)\" },\n { \"id\": \"claude-opus-5\", \"kind\": \"id\", \"note\": \"Opus 5 (legacy)\" },\n { \"id\": \"claude-opus-4-8\", \"kind\": \"id\", \"note\": \"Opus 4.8 (legacy)\" },\n { \"id\": \"claude-sonnet-5\", \"kind\": \"id\", \"note\": \"Sonnet 5\" },\n { \"id\": \"claude-haiku-4-5-20251001\", \"kind\": \"id\", \"note\": \"Haiku 4.5\" }\n ]\n },\n \"codex\": {\n \"verified\": \"2026-09-29\",\n \"models\": [\n { \"id\": \"gpt-6.1-sol\", \"kind\": \"id\", \"note\": \"GPT-6.1 Sol — complex coding and agentic work, recommended default; the kit SoT pin\" },\n { \"id\": \"gpt-6-sol\", \"kind\": \"id\", \"note\": \"GPT-6 Sol — previous Sol release\" },\n { \"id\": \"gpt-6-luna\", \"kind\": \"id\", \"note\": \"GPT-6 Luna — fast/light tier\" },\n { \"id\": \"gpt-6-astra\", \"kind\": \"id\", \"note\": \"GPT-6 Astra — most capable, highest cost\" },\n { \"id\": \"gpt-5.6-sol\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5.6-terra\", \"kind\": \"id\", \"note\": \"previous generation, balanced tier\" },\n { \"id\": \"gpt-5.6-luna\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5.5\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5.5-codex\", \"kind\": \"id\", \"note\": \"codex-tuned gpt-5.5\" },\n { \"id\": \"gpt-5.1\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5-codex\", \"kind\": \"id\", \"note\": \"codex-tuned gpt-5\" }\n ]\n }\n}\n",
9
- "SoT/toolchain.json": "{\n \"$comment\": \"Kit toolchain manifest - DATA only (versions, floors, policy); version probing and the doctor report live in cli/src/engine-native/toolchain.ts, and the one managed install lives in cli/src/engine-native/bun.ts bunBootstrap. kind: check (doctor visibility only) | managed (kit installs it when missing) | pin (no binary probe - a version pin for a package the kit installs through another tool, such as npx or `omp install`; `via` names that tool in the doctor table, default npx). policy (managed only): present (install when missing, never upgrade). `verified` = last kit-tested version; `pinnable` marks a tool whose `verified` release the bootstrap can install by exact tag. Supply-chain stance: every kit-driven package install from npm, npx, GitHub releases, or `omp install` is pinned to `verified` - never floating @latest (npm-worm/Shai-Hulud surface). rust-analyzer (rustup) and bwrap (distro package manager) follow the host toolchain and have no pin; the existing Claude Code, Codex, and omp marketplace plugins follow their marketplace and have no pin. Any new install surface, a new marketplace or plugin source included, needs a pin first. Update `verified` after testing a new release. upstream (optional) names where `docks-kit toolchain outdated` reads the newest release: npm package (optional major line) or GitHub repo releases with a tag prefix; results cache 24 h in ~/.docks-kit/kit.db; the report never installs or edits pins.\",\n \"tools\": {\n \"jq\": { \"kind\": \"check\", \"note\": \"optional operator CLI; EngineNative JSON and Claude runtime do not invoke it\" },\n \"curl\": { \"kind\": \"check\", \"note\": \"installer transport for the Bun bootstrap on every host (install.sh on POSIX, install.ps1 on Windows); probed only when Bun is missing\" },\n \"git\": { \"kind\": \"check\", \"note\": \"plugin marketplaces (claude/codex clone them) + kit checkout updates\" },\n \"node\": { \"kind\": \"check\", \"floor\": \"22.22.2\",\n \"note\": \"hosts the npm globals installed for the Claude LSP plugins; the floor is typescript-language-server 6's engines requirement, so an older Node reports `below-floor` in `docks-kit toolchain` instead of silently installing an LSP server that cannot start\" },\n \"npm\": { \"kind\": \"check\", \"note\": \"npm-global installer; also backs the intelephense version probe (`npm ls -g`)\" },\n \"claude\": { \"kind\": \"check\", \"floor\": \"2.1.280\", \"note\": \"kit floor — lets the `opus` alias resolve to Opus 5.5, the default Opus from Claude Code 2.1.280, and subsumes the older Fable 5.1 (>=2.1.257) and Opus 5 (>=2.1.219) requirements (mirrors settings minimumVersion)\" },\n \"codex\": { \"kind\": \"check\", \"floor\": \"0.159.0\", \"note\": \"upstream-owned; standalone installer prints when missing. The floor is the Codex release installed on the owner machine on 2026-09-29, by owner decision; no older release was checked against the keys in SoT/.codex/config.toml\" },\n \"omp\": { \"kind\": \"check\", \"floor\": \"18.4.4\", \"verified\": \"18.4.4\",\n \"upstream\": { \"github\": \"can1357/oh-my-pi\", \"tagPrefix\": \"v\" },\n \"note\": \"Oh My Pi harness (https://github.com/can1357/oh-my-pi); upstream-owned. It updates through `omp update` or through the external manager that owns the install (for example Tern), and sync never installs or upgrades it. The floor is the oldest release the kit tested: 18.4.4 lists and serves gpt-6.1-sol. `sync omp` needs the CLI only for the marketplace and plugin passes; the file deploys proceed without it\" },\n \"ffplay\": { \"kind\": \"check\", \"note\": \"Notification hook sound; distro-installed, so no kit floor applies\" },\n \"bwrap\": { \"kind\": \"check\", \"os\": \"linux\", \"floor\": \"0.9.0\",\n \"note\": \"Codex Linux sandbox runtime; sync installs it via the distro package manager, so the floor is the kit-tested baseline (Ubuntu 24.04 LTS) and no verified pin applies\" },\n \"intelephense\": { \"kind\": \"check\", \"floor\": \"1.18.5\", \"verified\": \"1.18.5\",\n \"upstream\": { \"npm\": \"intelephense\" },\n \"note\": \"php-lsp server; `verified` pins claudeLsp.ts syncLspServers' npm install. Version comes from `npm ls -g` — its own --version prints minified source\" },\n \"typescript-language-server\": { \"kind\": \"check\", \"floor\": \"6.0.0\", \"verified\": \"6.0.1\",\n \"upstream\": { \"npm\": \"typescript-language-server\" },\n \"note\": \"typescript-lsp server binary; `verified` pins claudeLsp.ts syncLspServers' npm install. Version 6 requires Node >=22.22.2 (see the `node` floor)\" },\n \"rust-analyzer\": { \"kind\": \"check\",\n \"note\": \"rust-analyzer-lsp server binary; claudeLsp.ts syncLspServers installs it with `rustup component add rust-analyzer` when rustup is present, so the version follows the host Rust toolchain and no verified pin applies (the bubblewrap stance for a tool the kit does not publish). A host without rustup is skipped in silence\" },\n \"tsc\": { \"kind\": \"check\", \"floor\": \"6.0.3\", \"verified\": \"6.0.3\",\n \"upstream\": { \"npm\": \"typescript\", \"line\": \"6\" }, \"note\": \"typescript-lsp dependency (npm package `typescript`); `verified` pins claudeLsp.ts syncLspServers' npm install. Deliberately on the 6.x line: typescript-language-server embeds TypeScript's programmatic API, which TS7 (native) doesn't yet expose — the repo's own devDependency stays on TS7 for editors, and `bun check` runs the type check with the same errors\" },\n \"bun\": { \"kind\": \"managed\", \"policy\": \"present\", \"floor\": \"1.4.4\", \"verified\": \"1.4.4\", \"pinnable\": true,\n \"upstream\": { \"github\": \"oven-sh/bun\", \"tagPrefix\": \"bun-v\" },\n \"note\": \"runtime for the docks-kit CLI and the Claude statusline/hook programs; bootstrap installs the verified release (installer takes bun-vX.Y.Z); self-updates via `bun upgrade` when wanted. By owner decision (2026-09-25), the floor equals the verified pin and the CI Bun, and the checkout launchers refuse an older Bun. All three moved to 1.4.4 on 2026-10-22 for `bun check`\" },\n \"skills-cli\": { \"kind\": \"pin\", \"verified\": \"1.7.0\",\n \"upstream\": { \"npm\": \"skills\" },\n \"note\": \"the `skills` npm package the kit runs via `npx skills@<verified>` when SoT/.agents/skills.txt names a slug (it is empty by default) — pinned, never @latest\" },\n \"pi-intercom\": { \"kind\": \"pin\", \"via\": \"omp install\", \"verified\": \"0.14.0\",\n \"upstream\": { \"npm\": \"pi-intercom\" },\n \"note\": \"the cross-session messaging plugin ompSync installs with `omp install pi-intercom@<verified>` - pinned, never floating. Its broker runs under Bun because omp's flat plugin store cannot resolve the default `npx --no-install tsx` launcher\" }\n }\n}\n",
10
- "SoT/.claude/CLAUDE.md": "## Research Before Implementation\n\nBefore writing or modifying code that uses an API, hook, method, or config surface you have not verified in this session, research current documentation first.\n\nResearch workflow:\n1. Prefer official documentation and primary sources for the specific library, framework, or API.\n2. If a local docs or MCP tool is available, use it before broad web search.\n3. Only then proceed to implementation.\n\nResearch when:\n- Installing or configuring a dependency.\n- Using an API, hook, method, or pattern not verified in this session.\n- Upgrading or migrating between versions.\n- Any task where relying on memory could cause stale syntax or behavior.\n\nDo not:\n- Assume API signatures, method names, or config options from memory.\n- Generate framework code without checking current docs first.\n- Skip research because the library seems familiar.\n\n<constraint>\nResearch the codebase before editing. Never change code you have not read.\n</constraint>\n\n## Removing Files\n\nTo remove, use the trash.\n\n- Move a file or directory to the trash: `gio trash -- <path>` on Linux, `trash <path>` on macOS. Only these forms run without approval. `gio trash` can refuse a path in `/tmp` (a system mount); leave temporary files there.\n- To remove a path from the git index, use `git rm -- <path>`; to remove a worktree, use `git worktree remove -- <path>`. Both ask for approval.\n- Use plain `rm <file>`, without flags, only for a single file you created.\n- Never delete recursively or in bulk (`rm -r`, `rm` with a glob, `find -delete`, `git clean`, `git reset --hard`) without the user's approval. If you cannot ask, list the paths in your final report instead.\n- Never pass `--force`, `-f`, or an abbreviation of it to `git rm`, `git worktree remove`, or `git push`; it discards changes or history.\n- Write literal absolute paths in commands; never `~` or `$HOME`. Never set or export `HOME`.\n\n## Agentic Harness Heuristics\n\n**1. Persistence.** Keep going until the user's query is completely resolved. Only yield when sure the problem is solved. Before ending a turn, check the last paragraph: if it is a plan, a question you can answer yourself, or a promise of work not done (\"I'll…\"), do that work now.\n\n**2. Default to parallel.** Whenever you have multiple independent operations (reads, greps, web fetches, independent edits), invoke them in a single response with multiple tool-use blocks. Sequential calls only when output of one operation is required as input to the next.\n\n**3. Multi-pass search.** First-pass search often misses — vary the wording (colleague-questions over keywords) before concluding something doesn't exist.\n\n**4. Trace symbols.** Before modifying a symbol, trace it to its definitions and all usages. Don't assume a function's behavior or a type's shape from the call site alone.\n\n**5. Linter-loop 3-strike rule.** Don't loop more than 3 times fixing linter errors on the same file. On the third attempt, stop and ask the user.\n\n**6. Read-before-Edit TTL.** If you haven't read a file with the Read tool in the last ~5 messages, re-read it before editing.\n\n**7. Big-file rule.** For files >1000 lines, prefer Grep + scoped Read (`offset` + `limit`) over reading the entire file.\n\n**8. Todo hygiene.** Use TaskCreate for items with meaningful outcome (≥5 min, distinct deliverable). Never include operational sub-actions (linting, testing, searching, examining the codebase) as their own todos — those are sub-steps in service of higher-level tasks. Mark complete immediately when done, never in batches.\n\n**9. Literal-instruction rule.** Treat explicit user requirements as checklists with success criteria; do not silently broaden scope. Write subagent prompts as explicit checklists with success criteria, not narrative.\n\n**10. Context hygiene.** On a long task, write the state a fresh session would need to the running notes file before context quality degrades. Never stop, summarize, or suggest a new session on account of context limits.\n\n**11. Autonomy calibration.** For minor choices (naming, formatting, default values, which of two equivalent approaches), pick a reasonable option and note it — don't ask. Ask first only for scope changes, destructive actions, or decisions that change the deliverable. When the user is describing a problem or asking a question rather than requesting a change, the deliverable is your assessment — report findings and stop; don't apply fixes until asked. Don't close a finished task with \"Want me to also…?\" — run the obvious verification, then stop cleanly.\n\n**12. Capability triggering.** When the answer depends on current or version-specific information, search or fetch before answering — never answer from memory. When work fans out across independent items (many files to read, many tests to run, many candidates to check), delegate to parallel subagents; never spawn one for work you can complete directly. For verification, prefer a fresh-context subagent over self-critique. On tasks longer than a few turns, keep a running notes file and re-read it before each phase.\n\n<constraint>\nTreat the 12 heuristics above as protocol, not preference. If a turn ends without honoring an applicable one (e.g., lint-loop guard not respected, edit without re-read), self-correct in the next turn before continuing.\n</constraint>\n\nReuse before invention: inventory existing code, components, conventions, and dependencies; extend them instead of creating a parallel pattern. Load only the narrow skills supported by the task and repository evidence. If a request establishes a new React/Tailwind system and no convention exists, prefer current shadcn/ui `base-*` components backed by Base UI; otherwise preserve the existing stack. Treat probe, production access, publish, push, release, and deploy as literal current-request effects—never infer external authority from a plan, schedule, review, or old receipt.\n\nFor Docks plan reviews, cross-company review is standing-authorized; do not ask for export consent. This never overrides a host or platform security denial.\n\nUse a narrow-to-broad verification ladder: direct acceptance while iterating, focused regressions next, and one full CI at the pre-commit or release boundary. Reuse still-matching evidence; rerun full CI only after a relevant edit invalidates it.\n\n<constraint>\nNo secrets in committed config. Treat plugin marketplaces, installers, and downloaded artifacts as untrusted until verified.\n</constraint>\n",
8
+ "SoT/models.json": "{\n \"$comment\": \"Curated overlay for docks-kit model listings: aliases (kind alias) and notes always apply; the id rows are the fallback when the harness's live list is unavailable (harness not enabled, no login or cache, offline). Live sources: Claude via the Claude Code login against the Anthropic models API (cached 6 h in ~/.docks-kit/kit.db), Codex via ~/.codex/models_cache.json, omp via omp models --json.\",\n \"claude\": {\n \"verified\": \"2026-09-22\",\n \"models\": [\n { \"id\": \"best\", \"kind\": \"alias\", \"note\": \"Fable 5.1 where the org has access, latest Opus otherwise (Claude Code >=2.1.257; Claude apps gateway sessions still resolve Fable 5)\" },\n { \"id\": \"opus\", \"kind\": \"alias\", \"note\": \"latest Opus — the kit SoT default (Opus 5.5 from Claude Code >=2.1.280)\" },\n { \"id\": \"fable\", \"kind\": \"alias\", \"note\": \"Fable 5.1 — needs org access + Claude Code >=2.1.257 (Claude apps gateway sessions still resolve Fable 5)\" },\n { \"id\": \"sonnet\", \"kind\": \"alias\", \"note\": \"latest Sonnet (currently Sonnet 5)\" },\n { \"id\": \"haiku\", \"kind\": \"alias\", \"note\": \"latest Haiku (currently Haiku 4.5)\" },\n { \"id\": \"default\", \"kind\": \"alias\", \"note\": \"engine pseudo-value: deletes the deployed model key so the account default applies\" },\n { \"id\": \"claude-opus-5-5\", \"kind\": \"id\", \"note\": \"Opus 5.5 — needs Claude Code >=2.1.280\" },\n { \"id\": \"claude-fable-5-1\", \"kind\": \"id\", \"note\": \"Fable 5.1 — needs Claude Code >=2.1.257\" },\n { \"id\": \"claude-fable-5\", \"kind\": \"id\", \"note\": \"Fable 5 (legacy)\" },\n { \"id\": \"claude-opus-5\", \"kind\": \"id\", \"note\": \"Opus 5 (legacy)\" },\n { \"id\": \"claude-opus-4-8\", \"kind\": \"id\", \"note\": \"Opus 4.8 (legacy)\" },\n { \"id\": \"claude-sonnet-5\", \"kind\": \"id\", \"note\": \"Sonnet 5\" },\n { \"id\": \"claude-haiku-4-5-20251001\", \"kind\": \"id\", \"note\": \"Haiku 4.5\" }\n ]\n },\n \"codex\": {\n \"verified\": \"2026-11-18\",\n \"models\": [\n { \"id\": \"gpt-6.2-sol\", \"kind\": \"id\", \"note\": \"GPT-6.2 Sol — complex coding and agentic work, recommended default; the kit SoT pin\" },\n { \"id\": \"gpt-6.2-astra\", \"kind\": \"id\", \"note\": \"GPT-6.2 Astra — most capable, highest cost\" },\n { \"id\": \"gpt-6.1-sol\", \"kind\": \"id\", \"note\": \"GPT-6.1 Sol — previous Sol release\" },\n { \"id\": \"gpt-6-sol\", \"kind\": \"id\", \"note\": \"GPT-6 Sol — previous Sol release\" },\n { \"id\": \"gpt-6-luna\", \"kind\": \"id\", \"note\": \"GPT-6 Luna — fast/light tier\" },\n { \"id\": \"gpt-6-astra\", \"kind\": \"id\", \"note\": \"GPT-6 Astra — previous Astra release\" },\n { \"id\": \"gpt-5.6-sol\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5.6-terra\", \"kind\": \"id\", \"note\": \"previous generation, balanced tier\" },\n { \"id\": \"gpt-5.6-luna\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5.5\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5.5-codex\", \"kind\": \"id\", \"note\": \"codex-tuned gpt-5.5\" },\n { \"id\": \"gpt-5.1\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5\", \"kind\": \"id\", \"note\": \"previous generation\" },\n { \"id\": \"gpt-5-codex\", \"kind\": \"id\", \"note\": \"codex-tuned gpt-5\" }\n ]\n }\n}\n",
9
+ "SoT/toolchain.json": "{\n \"$comment\": \"Kit toolchain manifest - DATA only (versions, floors, policy); version probing and the doctor report live in cli/src/engine-native/toolchain.ts, and the one managed install lives in cli/src/engine-native/bun.ts bunBootstrap. kind: check (doctor visibility only) | managed (kit installs it when missing) | pin (no binary probe - a version pin for a package the kit installs through another tool, such as npx or `omp install`; `via` names that tool in the doctor table, default npx). policy (managed only): present (install when missing, never upgrade). `verified` = last kit-tested version; `pinnable` marks a tool whose `verified` release the bootstrap can install by exact tag. Supply-chain stance: every kit-driven package install from npm, npx, GitHub releases, or `omp install` is pinned to `verified` - never floating @latest (npm-worm/Shai-Hulud surface). rust-analyzer (rustup) and bwrap (distro package manager) follow the host toolchain and have no pin; the existing Claude Code, Codex, and omp marketplace plugins follow their marketplace and have no pin. Any new install surface, a new marketplace or plugin source included, needs a pin first. Update `verified` after testing a new release. upstream (optional) names where `docks-kit toolchain outdated` reads the newest release: npm package (optional major line) or GitHub repo releases with a tag prefix; results cache 24 h in ~/.docks-kit/kit.db; the report never installs or edits pins.\",\n \"tools\": {\n \"jq\": { \"kind\": \"check\", \"note\": \"optional operator CLI; EngineNative JSON and Claude runtime do not invoke it\" },\n \"curl\": { \"kind\": \"check\", \"note\": \"installer transport for the Bun bootstrap on every host (install.sh on POSIX, install.ps1 on Windows); probed only when Bun is missing\" },\n \"git\": { \"kind\": \"check\", \"note\": \"plugin marketplaces (claude/codex clone them) + kit checkout updates\" },\n \"node\": { \"kind\": \"check\", \"floor\": \"22.22.2\",\n \"note\": \"hosts the npm globals installed for the Claude LSP plugins; the floor is typescript-language-server 6's engines requirement, so an older Node reports `below-floor` in `docks-kit toolchain` instead of silently installing an LSP server that cannot start\" },\n \"npm\": { \"kind\": \"check\", \"note\": \"npm-global installer; also backs the intelephense version probe (`npm ls -g`)\" },\n \"claude\": { \"kind\": \"check\", \"floor\": \"2.1.280\", \"note\": \"kit floor — lets the `opus` alias resolve to Opus 5.5, the default Opus from Claude Code 2.1.280, and subsumes the older Fable 5.1 (>=2.1.257) and Opus 5 (>=2.1.219) requirements (mirrors settings minimumVersion)\" },\n \"codex\": { \"kind\": \"check\", \"floor\": \"0.159.0\", \"note\": \"upstream-owned; standalone installer prints when missing. The floor is the Codex release installed on the owner machine on 2026-09-29, by owner decision; no older release was checked against the keys in SoT/.codex/config.toml\" },\n \"omp\": { \"kind\": \"check\", \"floor\": \"18.22.2\", \"verified\": \"18.22.2\",\n \"upstream\": { \"github\": \"can1357/oh-my-pi\", \"tagPrefix\": \"v\" },\n \"note\": \"Oh My Pi harness (https://github.com/can1357/oh-my-pi); upstream-owned. It updates through `omp update` or through the external manager that owns the install (for example Tern), and sync never installs or upgrades it. The floor is the oldest release the kit tested: 18.22.2 lists and serves gpt-6.2-sol and gpt-6.2-astra. `sync omp` needs the CLI only for the marketplace and plugin passes; the file deploys proceed without it\" },\n \"ffplay\": { \"kind\": \"check\", \"note\": \"Notification hook sound; distro-installed, so no kit floor applies\" },\n \"bwrap\": { \"kind\": \"check\", \"os\": \"linux\", \"floor\": \"0.9.0\",\n \"note\": \"Codex Linux sandbox runtime; sync installs it via the distro package manager, so the floor is the kit-tested baseline (Ubuntu 24.04 LTS) and no verified pin applies\" },\n \"intelephense\": { \"kind\": \"check\", \"floor\": \"1.18.5\", \"verified\": \"1.18.5\",\n \"upstream\": { \"npm\": \"intelephense\" },\n \"note\": \"php-lsp server; `verified` pins claudeLsp.ts syncLspServers' npm install. Version comes from `npm ls -g` — its own --version prints minified source\" },\n \"typescript-language-server\": { \"kind\": \"check\", \"floor\": \"6.0.0\", \"verified\": \"6.0.1\",\n \"upstream\": { \"npm\": \"typescript-language-server\" },\n \"note\": \"typescript-lsp server binary; `verified` pins claudeLsp.ts syncLspServers' npm install. Version 6 requires Node >=22.22.2 (see the `node` floor)\" },\n \"rust-analyzer\": { \"kind\": \"check\",\n \"note\": \"rust-analyzer-lsp server binary; claudeLsp.ts syncLspServers installs it with `rustup component add rust-analyzer` when rustup is present, so the version follows the host Rust toolchain and no verified pin applies (the bubblewrap stance for a tool the kit does not publish). A host without rustup is skipped in silence\" },\n \"tsc\": { \"kind\": \"check\", \"floor\": \"6.0.3\", \"verified\": \"6.0.3\",\n \"upstream\": { \"npm\": \"typescript\", \"line\": \"6\" }, \"note\": \"typescript-lsp dependency (npm package `typescript`); `verified` pins claudeLsp.ts syncLspServers' npm install. Deliberately on the 6.x line: typescript-language-server embeds TypeScript's programmatic API, which TS7 (native) doesn't yet expose — the repo's own devDependency stays on TS7 for editors, and `bun check` runs the type check with the same errors\" },\n \"bun\": { \"kind\": \"managed\", \"policy\": \"present\", \"floor\": \"1.4.4\", \"verified\": \"1.4.4\", \"pinnable\": true,\n \"upstream\": { \"github\": \"oven-sh/bun\", \"tagPrefix\": \"bun-v\" },\n \"note\": \"runtime for the docks-kit CLI and the Claude statusline/hook programs; bootstrap installs the verified release (installer takes bun-vX.Y.Z); self-updates via `bun upgrade` when wanted. By owner decision (2026-09-25), the floor equals the verified pin and the CI Bun, and the checkout launchers refuse an older Bun. All three moved to 1.4.4 on 2026-10-22 for `bun check`\" },\n \"skills-cli\": { \"kind\": \"pin\", \"verified\": \"1.7.0\",\n \"upstream\": { \"npm\": \"skills\" },\n \"note\": \"the `skills` npm package the kit runs via `npx skills@<verified>` when SoT/.agents/skills.txt names a slug (it is empty by default) — pinned, never @latest\" },\n \"pi-intercom\": { \"kind\": \"pin\", \"via\": \"omp install\", \"verified\": \"0.14.0\",\n \"upstream\": { \"npm\": \"pi-intercom\" },\n \"note\": \"the cross-session messaging plugin ompSync installs with `omp install pi-intercom@<verified>` - pinned, never floating. Its broker runs under Bun because omp's flat plugin store cannot resolve the default `npx --no-install tsx` launcher\" }\n }\n}\n",
10
+ "SoT/.claude/CLAUDE.md": "## Research Before Implementation\n\nBefore writing or modifying code that uses an API, hook, method, or config surface you have not verified in this session, research current documentation first.\n\nResearch workflow:\n1. Prefer official documentation and primary sources for the specific library, framework, or API.\n2. If a local docs or MCP tool is available, use it before broad web search.\n3. Only then proceed to implementation.\n\nResearch when:\n- Installing or configuring a dependency.\n- Using an API, hook, method, or pattern not verified in this session.\n- Upgrading or migrating between versions.\n- Any task where relying on memory could cause stale syntax or behavior.\n\nDo not:\n- Assume API signatures, method names, or config options from memory.\n- Generate framework code without checking current docs first.\n- Skip research because the library seems familiar.\n\n<constraint>\nResearch the codebase before editing. Never change code you have not read.\n</constraint>\n\n## Removing Files\n\nTo remove, use the trash.\n\n- Move a file or directory to the trash: `gio trash -- <path>` on Linux, `trash <path>` on macOS. Only these forms run without approval. `gio trash` can refuse a path in `/tmp` (a system mount); leave temporary files there.\n- To remove a path from the git index, use `git rm -- <path>`; to remove a worktree, use `git worktree remove -- <path>`. Both ask for approval.\n- Use plain `rm <file>`, without flags, only for a single file you created.\n- Never delete recursively or in bulk (`rm -r`, `rm` with a glob, `find -delete`, `git clean`, `git reset --hard`) without the user's approval. If you cannot ask, list the paths in your final report instead.\n- Never pass `--force`, `-f`, or an abbreviation of it to `git rm`, `git worktree remove`, or `git push`; it discards changes or history.\n- Write literal absolute paths in commands; never `~` or `$HOME`. Never set or export `HOME`.\n\n## Agentic Harness Heuristics\n\n**1. Persistence.** Keep going until the user's query is completely resolved. Only yield when sure the problem is solved. Before ending a turn, check the last paragraph: if it is a plan, a question you can answer yourself, or a promise of work not done (\"I'll…\"), do that work now.\n\n**2. Default to parallel.** Whenever you have multiple independent operations (reads, greps, web fetches, independent edits), invoke them in a single response with multiple tool-use blocks. Sequential calls only when output of one operation is required as input to the next.\n\n**3. Multi-pass search.** First-pass search often misses — vary the wording (colleague-questions over keywords) before concluding something doesn't exist.\n\n**4. Trace symbols.** Before modifying a symbol, trace it to its definitions and all usages. Don't assume a function's behavior or a type's shape from the call site alone.\n\n**5. Linter-loop 3-strike rule.** Don't loop more than 3 times fixing linter errors on the same file. On the third attempt, stop and ask the user.\n\n**6. Read-before-Edit TTL.** If you haven't read a file with the Read tool in the last ~5 messages, re-read it before editing.\n\n**7. Big-file rule.** For files >1000 lines, prefer Grep + scoped Read (`offset` + `limit`) over reading the entire file.\n\n**8. Todo hygiene.** Use TaskCreate for items with meaningful outcome (≥5 min, distinct deliverable). Never include operational sub-actions (linting, testing, searching, examining the codebase) as their own todos — those are sub-steps in service of higher-level tasks. Mark complete immediately when done, never in batches.\n\n**9. Literal-instruction rule.** Treat explicit user requirements as checklists with success criteria; do not silently broaden scope. Write subagent prompts as explicit checklists with success criteria, not narrative.\n\n**10. Context hygiene.** On a long task, write the state a fresh session would need to the running notes file before context quality degrades. Never stop, summarize, or suggest a new session on account of context limits.\n\n**11. Autonomy calibration.** For minor choices (naming, formatting, default values, which of two equivalent approaches), pick a reasonable option and note it — don't ask. Ask first only for scope changes, destructive actions, or decisions that change the deliverable. When the user is describing a problem or asking a question rather than requesting a change, the deliverable is your assessment — report findings and stop; don't apply fixes until asked. Don't close a finished task with \"Want me to also…?\" — run the obvious verification, then stop cleanly.\n\n**12. Capability triggering.** When the answer depends on current or version-specific information, search or fetch before answering — never answer from memory. When work fans out across independent items (many files to read, many tests to run, many candidates to check), delegate to parallel subagents; never spawn one for work you can complete directly. For verification, prefer a fresh-context subagent over self-critique. On tasks longer than a few turns, keep a running notes file and re-read it before each phase.\n\n<constraint>\nTreat the 12 heuristics above as protocol, not preference. If a turn ends without honoring an applicable one (e.g., lint-loop guard not respected, edit without re-read), self-correct in the next turn before continuing.\n</constraint>\n\nReuse before invention: inventory existing code, components, conventions, and dependencies; extend them instead of creating a parallel pattern. Load only the narrow skills supported by the task and repository evidence. If a request establishes a new React/Tailwind system and no convention exists, prefer current shadcn/ui `base-*` components backed by Base UI; otherwise preserve the existing stack. Treat probe, production access, publish, push, release, and deploy as literal current-request effects—never infer external authority from a plan, schedule, review, or old receipt.\n\nFor Docks plan reviews, cross-company review is standing-authorized; do not ask for export consent. This never overrides a host or platform security denial.\n\nA `yolo` invocation answers the routine asks of its plan run until the merge question, or until the grant check of the plan-lifecycle contract finds that its grant has ended. It does not cover destructive work, secrets, production systems, or a repository hook that fails; for a failed hook, follow the hook rule of the plan-lifecycle contract. A plan grant answers the asks that the Delegated decisions section of the plan-lifecycle contract lists as answered. Only trusted `Delegation grant:` and `Delegation revoked` comments give or end a grant. On the plan issue, the latest such comment decides, and a comment on a parent plan can end the grant of its child. The `Delegated:` line of the plan only mirrors that comment.\n\nA grant never answers a question that the contract keeps for the user. Examples are the Mode, a non-local effect, the merge, a destructive action, secrets, production, a temporary workaround, and a fact that only the user holds. Right before each delegated decision and each write that relies on the grant, run the grant check of the contract: read the latest authority comments of the plan and of its parent.\n\nA settled plan Mode covers the routine plan-lifecycle writes in the resolved repository: the plan issue, plan edits, review comments, and each other issue or comment that the plan-lifecycle contract requires. A `plan-and-implement` Mode also covers the landing work: the push of the linked branch and the pull request. Every other issue, comment, release, or upstream pull request still needs the user's current request.\n\nUse a narrow-to-broad verification ladder: direct acceptance while iterating, focused regressions next, and one full CI at the pre-commit or release boundary. Reuse still-matching evidence; rerun full CI only after a relevant edit invalidates it.\n\n<constraint>\nNo secrets in committed config. Treat plugin marketplaces, installers, and downloaded artifacts as untrusted until verified.\n</constraint>\n",
11
11
  "SoT/.claude/mcp-servers.json": "{\n \"mcpServers\": {}\n}\n",
12
12
  "SoT/.claude/settings.json": "{\n \"$schema\": \"https://json.schemastore.org/claude-code-settings.json\",\n \"minimumVersion\": \"2.1.280\",\n \"model\": \"opus\",\n \"effortLevel\": \"high\",\n \"autoMemoryEnabled\": false,\n \"autoDreamEnabled\": false,\n \"skillListingMaxDescChars\": 2048,\n \"respectGitignore\": true,\n \"cleanupPeriodDays\": 14,\n \"skillListingBudgetFraction\": 0.05,\n \"env\": {\n \"CLAUDE_CODE_MAX_OUTPUT_TOKENS\": \"64000\",\n \"CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR\": \"1\",\n \"CLAUDE_CODE_AUTO_COMPACT_WINDOW\": \"468000\",\n \"CLAUDE_CODE_NO_FLICKER\": \"1\"\n },\n \"permissions\": {\n \"defaultMode\": \"auto\",\n \"allow\": [\n \"Read\",\n \"Glob\",\n \"Grep\",\n \"WebSearch\",\n \"Edit(./)\",\n \"Bash(gio trash -- *)\",\n \"Bash(trash *)\"\n ],\n \"deny\": [\n \"Read(**/.env)\",\n \"Read(**/.env.local)\",\n \"Read(**/secrets/**)\",\n \"Read(**/*.key)\",\n \"Read(**/*.pem)\",\n \"Read(**/*.p12)\",\n \"Read(**/.credentials*)\",\n \"Edit(**/.env)\",\n \"Edit(**/.env.local)\",\n \"Edit(**/secrets/**)\",\n \"Bash(sudo *)\",\n \"Bash(rm -rf /)\",\n \"Bash(rm -rf / *)\",\n \"Bash(rm -rf ~)\",\n \"Bash(rm -rf ~ *)\",\n \"Bash(rm -rf $HOME)\",\n \"Bash(rm -rf $HOME *)\",\n \"Bash(> /dev *)\",\n \"Bash(dd if= *)\",\n \"Bash(mkfs *)\",\n \"Bash(eval *)\",\n \"Bash(chmod 777 *)\",\n \"Bash(chmod -R 777 *)\",\n \"Bash(git push --force origin main *)\",\n \"Bash(git push --force origin master *)\",\n \"Bash(git push -f origin main *)\",\n \"Bash(git push -f origin master *)\",\n \"Bash(rm /)\",\n \"Bash(rm / *)\",\n \"Bash(rm * /)\",\n \"Bash(rm * / *)\",\n \"Bash(rm \\\"/\\\")\",\n \"Bash(rm \\\"/\\\" *)\",\n \"Bash(rm * \\\"/\\\")\",\n \"Bash(rm * \\\"/\\\" *)\",\n \"Bash(rm /\\\\*)\",\n \"Bash(rm /\\\\* *)\",\n \"Bash(rm * /\\\\*)\",\n \"Bash(rm * /\\\\* *)\",\n \"Bash(rm ~)\",\n \"Bash(rm ~ *)\",\n \"Bash(rm * ~)\",\n \"Bash(rm * ~ *)\",\n \"Bash(rm ~/)\",\n \"Bash(rm ~/ *)\",\n \"Bash(rm * ~/)\",\n \"Bash(rm * ~/ *)\",\n \"Bash(rm $HOME)\",\n \"Bash(rm $HOME *)\",\n \"Bash(rm * $HOME)\",\n \"Bash(rm * $HOME *)\",\n \"Bash(rm $HOME/)\",\n \"Bash(rm $HOME/ *)\",\n \"Bash(rm * $HOME/)\",\n \"Bash(rm * $HOME/ *)\",\n \"Bash(rm \\\"$HOME\\\")\",\n \"Bash(rm \\\"$HOME\\\" *)\",\n \"Bash(rm * \\\"$HOME\\\")\",\n \"Bash(rm * \\\"$HOME\\\" *)\",\n \"Bash(rm \\\"$HOME/\\\")\",\n \"Bash(rm \\\"$HOME/\\\" *)\",\n \"Bash(rm * \\\"$HOME/\\\")\",\n \"Bash(rm * \\\"$HOME/\\\" *)\",\n \"Bash(rm \\\"$HOME\\\"/)\",\n \"Bash(rm \\\"$HOME\\\"/ *)\",\n \"Bash(rm * \\\"$HOME\\\"/)\",\n \"Bash(rm * \\\"$HOME\\\"/ *)\",\n \"Bash(rm ${HOME})\",\n \"Bash(rm ${HOME} *)\",\n \"Bash(rm * ${HOME})\",\n \"Bash(rm * ${HOME} *)\",\n \"Bash(rm ${HOME}/)\",\n \"Bash(rm ${HOME}/ *)\",\n \"Bash(rm * ${HOME}/)\",\n \"Bash(rm * ${HOME}/ *)\",\n \"Bash(rm \\\"${HOME}\\\")\",\n \"Bash(rm \\\"${HOME}\\\" *)\",\n \"Bash(rm * \\\"${HOME}\\\")\",\n \"Bash(rm * \\\"${HOME}\\\" *)\",\n \"Bash(rm \\\"${HOME}/\\\")\",\n \"Bash(rm \\\"${HOME}/\\\" *)\",\n \"Bash(rm * \\\"${HOME}/\\\")\",\n \"Bash(rm * \\\"${HOME}/\\\" *)\",\n \"Bash(rm \\\"${HOME}\\\"/)\",\n \"Bash(rm \\\"${HOME}\\\"/ *)\",\n \"Bash(rm * \\\"${HOME}\\\"/)\",\n \"Bash(rm * \\\"${HOME}\\\"/ *)\",\n \"Bash(*/rm /)\",\n \"Bash(*/rm / *)\",\n \"Bash(*/rm * /)\",\n \"Bash(*/rm * / *)\",\n \"Bash(*/rm \\\"/\\\")\",\n \"Bash(*/rm \\\"/\\\" *)\",\n \"Bash(*/rm * \\\"/\\\")\",\n \"Bash(*/rm * \\\"/\\\" *)\",\n \"Bash(*/rm /\\\\*)\",\n \"Bash(*/rm /\\\\* *)\",\n \"Bash(*/rm * /\\\\*)\",\n \"Bash(*/rm * /\\\\* *)\",\n \"Bash(*/rm ~)\",\n \"Bash(*/rm ~ *)\",\n \"Bash(*/rm * ~)\",\n \"Bash(*/rm * ~ *)\",\n \"Bash(*/rm ~/)\",\n \"Bash(*/rm ~/ *)\",\n \"Bash(*/rm * ~/)\",\n \"Bash(*/rm * ~/ *)\",\n \"Bash(*/rm $HOME)\",\n \"Bash(*/rm $HOME *)\",\n \"Bash(*/rm * $HOME)\",\n \"Bash(*/rm * $HOME *)\",\n \"Bash(*/rm $HOME/)\",\n \"Bash(*/rm $HOME/ *)\",\n \"Bash(*/rm * $HOME/)\",\n \"Bash(*/rm * $HOME/ *)\",\n \"Bash(*/rm \\\"$HOME\\\")\",\n \"Bash(*/rm \\\"$HOME\\\" *)\",\n \"Bash(*/rm * \\\"$HOME\\\")\",\n \"Bash(*/rm * \\\"$HOME\\\" *)\",\n \"Bash(*/rm \\\"$HOME/\\\")\",\n \"Bash(*/rm \\\"$HOME/\\\" *)\",\n \"Bash(*/rm * \\\"$HOME/\\\")\",\n \"Bash(*/rm * \\\"$HOME/\\\" *)\",\n \"Bash(*/rm \\\"$HOME\\\"/)\",\n \"Bash(*/rm \\\"$HOME\\\"/ *)\",\n \"Bash(*/rm * \\\"$HOME\\\"/)\",\n \"Bash(*/rm * \\\"$HOME\\\"/ *)\",\n \"Bash(*/rm ${HOME})\",\n \"Bash(*/rm ${HOME} *)\",\n \"Bash(*/rm * ${HOME})\",\n \"Bash(*/rm * ${HOME} *)\",\n \"Bash(*/rm ${HOME}/)\",\n \"Bash(*/rm ${HOME}/ *)\",\n \"Bash(*/rm * ${HOME}/)\",\n \"Bash(*/rm * ${HOME}/ *)\",\n \"Bash(*/rm \\\"${HOME}\\\")\",\n \"Bash(*/rm \\\"${HOME}\\\" *)\",\n \"Bash(*/rm * \\\"${HOME}\\\")\",\n \"Bash(*/rm * \\\"${HOME}\\\" *)\",\n \"Bash(*/rm \\\"${HOME}/\\\")\",\n \"Bash(*/rm \\\"${HOME}/\\\" *)\",\n \"Bash(*/rm * \\\"${HOME}/\\\")\",\n \"Bash(*/rm * \\\"${HOME}/\\\" *)\",\n \"Bash(*/rm \\\"${HOME}\\\"/)\",\n \"Bash(*/rm \\\"${HOME}\\\"/ *)\",\n \"Bash(*/rm * \\\"${HOME}\\\"/)\",\n \"Bash(*/rm * \\\"${HOME}\\\"/ *)\",\n \"Bash(*/sudo *)\",\n \"Bash(HOME=*)\",\n \"Bash(export HOME=*)\",\n \"Bash(env HOME=*)\",\n \"Bash(env * HOME=*)\",\n \"PowerShell(sudo *)\",\n \"PowerShell(rm -rf /)\",\n \"PowerShell(rm -rf / *)\",\n \"PowerShell(rm -rf ~)\",\n \"PowerShell(rm -rf ~ *)\",\n \"PowerShell(rm -rf $HOME)\",\n \"PowerShell(rm -rf $HOME *)\",\n \"PowerShell(> /dev *)\",\n \"PowerShell(dd if= *)\",\n \"PowerShell(mkfs *)\",\n \"PowerShell(eval *)\",\n \"PowerShell(chmod 777 *)\",\n \"PowerShell(chmod -R 777 *)\",\n \"PowerShell(git push --force origin main *)\",\n \"PowerShell(git push --force origin master *)\",\n \"PowerShell(git push -f origin main *)\",\n \"PowerShell(git push -f origin master *)\",\n \"PowerShell(rm /)\",\n \"PowerShell(rm / *)\",\n \"PowerShell(rm * /)\",\n \"PowerShell(rm * / *)\",\n \"PowerShell(rm \\\"/\\\")\",\n \"PowerShell(rm \\\"/\\\" *)\",\n \"PowerShell(rm * \\\"/\\\")\",\n \"PowerShell(rm * \\\"/\\\" *)\",\n \"PowerShell(rm /\\\\*)\",\n \"PowerShell(rm /\\\\* *)\",\n \"PowerShell(rm * /\\\\*)\",\n \"PowerShell(rm * /\\\\* *)\",\n \"PowerShell(rm ~)\",\n \"PowerShell(rm ~ *)\",\n \"PowerShell(rm * ~)\",\n \"PowerShell(rm * ~ *)\",\n \"PowerShell(rm ~/)\",\n \"PowerShell(rm ~/ *)\",\n \"PowerShell(rm * ~/)\",\n \"PowerShell(rm * ~/ *)\",\n \"PowerShell(rm $HOME)\",\n \"PowerShell(rm $HOME *)\",\n \"PowerShell(rm * $HOME)\",\n \"PowerShell(rm * $HOME *)\",\n \"PowerShell(rm $HOME/)\",\n \"PowerShell(rm $HOME/ *)\",\n \"PowerShell(rm * $HOME/)\",\n \"PowerShell(rm * $HOME/ *)\",\n \"PowerShell(rm \\\"$HOME\\\")\",\n \"PowerShell(rm \\\"$HOME\\\" *)\",\n \"PowerShell(rm * \\\"$HOME\\\")\",\n \"PowerShell(rm * \\\"$HOME\\\" *)\",\n \"PowerShell(rm \\\"$HOME/\\\")\",\n \"PowerShell(rm \\\"$HOME/\\\" *)\",\n \"PowerShell(rm * \\\"$HOME/\\\")\",\n \"PowerShell(rm * \\\"$HOME/\\\" *)\",\n \"PowerShell(rm \\\"$HOME\\\"/)\",\n \"PowerShell(rm \\\"$HOME\\\"/ *)\",\n \"PowerShell(rm * \\\"$HOME\\\"/)\",\n \"PowerShell(rm * \\\"$HOME\\\"/ *)\",\n \"PowerShell(rm ${HOME})\",\n \"PowerShell(rm ${HOME} *)\",\n \"PowerShell(rm * ${HOME})\",\n \"PowerShell(rm * ${HOME} *)\",\n \"PowerShell(rm ${HOME}/)\",\n \"PowerShell(rm ${HOME}/ *)\",\n \"PowerShell(rm * ${HOME}/)\",\n \"PowerShell(rm * ${HOME}/ *)\",\n \"PowerShell(rm \\\"${HOME}\\\")\",\n \"PowerShell(rm \\\"${HOME}\\\" *)\",\n \"PowerShell(rm * \\\"${HOME}\\\")\",\n \"PowerShell(rm * \\\"${HOME}\\\" *)\",\n \"PowerShell(rm \\\"${HOME}/\\\")\",\n \"PowerShell(rm \\\"${HOME}/\\\" *)\",\n \"PowerShell(rm * \\\"${HOME}/\\\")\",\n \"PowerShell(rm * \\\"${HOME}/\\\" *)\",\n \"PowerShell(rm \\\"${HOME}\\\"/)\",\n \"PowerShell(rm \\\"${HOME}\\\"/ *)\",\n \"PowerShell(rm * \\\"${HOME}\\\"/)\",\n \"PowerShell(rm * \\\"${HOME}\\\"/ *)\",\n \"PowerShell(*/rm /)\",\n \"PowerShell(*/rm / *)\",\n \"PowerShell(*/rm * /)\",\n \"PowerShell(*/rm * / *)\",\n \"PowerShell(*/rm \\\"/\\\")\",\n \"PowerShell(*/rm \\\"/\\\" *)\",\n \"PowerShell(*/rm * \\\"/\\\")\",\n \"PowerShell(*/rm * \\\"/\\\" *)\",\n \"PowerShell(*/rm /\\\\*)\",\n \"PowerShell(*/rm /\\\\* *)\",\n \"PowerShell(*/rm * /\\\\*)\",\n \"PowerShell(*/rm * /\\\\* *)\",\n \"PowerShell(*/rm ~)\",\n \"PowerShell(*/rm ~ *)\",\n \"PowerShell(*/rm * ~)\",\n \"PowerShell(*/rm * ~ *)\",\n \"PowerShell(*/rm ~/)\",\n \"PowerShell(*/rm ~/ *)\",\n \"PowerShell(*/rm * ~/)\",\n \"PowerShell(*/rm * ~/ *)\",\n \"PowerShell(*/rm $HOME)\",\n \"PowerShell(*/rm $HOME *)\",\n \"PowerShell(*/rm * $HOME)\",\n \"PowerShell(*/rm * $HOME *)\",\n \"PowerShell(*/rm $HOME/)\",\n \"PowerShell(*/rm $HOME/ *)\",\n \"PowerShell(*/rm * $HOME/)\",\n \"PowerShell(*/rm * $HOME/ *)\",\n \"PowerShell(*/rm \\\"$HOME\\\")\",\n \"PowerShell(*/rm \\\"$HOME\\\" *)\",\n \"PowerShell(*/rm * \\\"$HOME\\\")\",\n \"PowerShell(*/rm * \\\"$HOME\\\" *)\",\n \"PowerShell(*/rm \\\"$HOME/\\\")\",\n \"PowerShell(*/rm \\\"$HOME/\\\" *)\",\n \"PowerShell(*/rm * \\\"$HOME/\\\")\",\n \"PowerShell(*/rm * \\\"$HOME/\\\" *)\",\n \"PowerShell(*/rm \\\"$HOME\\\"/)\",\n \"PowerShell(*/rm \\\"$HOME\\\"/ *)\",\n \"PowerShell(*/rm * \\\"$HOME\\\"/)\",\n \"PowerShell(*/rm * \\\"$HOME\\\"/ *)\",\n \"PowerShell(*/rm ${HOME})\",\n \"PowerShell(*/rm ${HOME} *)\",\n \"PowerShell(*/rm * ${HOME})\",\n \"PowerShell(*/rm * ${HOME} *)\",\n \"PowerShell(*/rm ${HOME}/)\",\n \"PowerShell(*/rm ${HOME}/ *)\",\n \"PowerShell(*/rm * ${HOME}/)\",\n \"PowerShell(*/rm * ${HOME}/ *)\",\n \"PowerShell(*/rm \\\"${HOME}\\\")\",\n \"PowerShell(*/rm \\\"${HOME}\\\" *)\",\n \"PowerShell(*/rm * \\\"${HOME}\\\")\",\n \"PowerShell(*/rm * \\\"${HOME}\\\" *)\",\n \"PowerShell(*/rm \\\"${HOME}/\\\")\",\n \"PowerShell(*/rm \\\"${HOME}/\\\" *)\",\n \"PowerShell(*/rm * \\\"${HOME}/\\\")\",\n \"PowerShell(*/rm * \\\"${HOME}/\\\" *)\",\n \"PowerShell(*/rm \\\"${HOME}\\\"/)\",\n \"PowerShell(*/rm \\\"${HOME}\\\"/ *)\",\n \"PowerShell(*/rm * \\\"${HOME}\\\"/)\",\n \"PowerShell(*/rm * \\\"${HOME}\\\"/ *)\",\n \"PowerShell(*/sudo *)\",\n \"PowerShell(HOME=*)\",\n \"PowerShell(export HOME=*)\",\n \"PowerShell(env HOME=*)\",\n \"PowerShell(env * HOME=*)\",\n \"PowerShell(Remove-Item *-Recurse* /)\",\n \"PowerShell(Remove-Item *-Recurse* / *)\",\n \"PowerShell(Remove-Item / *-Recurse*)\",\n \"PowerShell(Remove-Item -Path / *-Recurse*)\",\n \"PowerShell(Remove-Item -LiteralPath / *-Recurse*)\",\n \"PowerShell(Remove-Item *-Recurse* ~)\",\n \"PowerShell(Remove-Item *-Recurse* ~ *)\",\n \"PowerShell(Remove-Item ~ *-Recurse*)\",\n \"PowerShell(Remove-Item -Path ~ *-Recurse*)\",\n \"PowerShell(Remove-Item -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(Remove-Item *-Recurse* $HOME)\",\n \"PowerShell(Remove-Item *-Recurse* $HOME *)\",\n \"PowerShell(Remove-Item $HOME *-Recurse*)\",\n \"PowerShell(Remove-Item -Path $HOME *-Recurse*)\",\n \"PowerShell(Remove-Item -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(Remove-Item *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(Remove-Item *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(Remove-Item $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(Remove-Item -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(Remove-Item -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(Remove-Item *-Recurse* \\\\\\\\)\",\n \"PowerShell(Remove-Item *-Recurse* \\\\ *)\",\n \"PowerShell(Remove-Item \\\\ *-Recurse*)\",\n \"PowerShell(Remove-Item -Path \\\\ *-Recurse*)\",\n \"PowerShell(Remove-Item -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(Remove-Item *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(Remove-Item *-Recurse* *:\\\\ *)\",\n \"PowerShell(Remove-Item *:\\\\ *-Recurse*)\",\n \"PowerShell(Remove-Item -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(Remove-Item -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(del *-Recurse* /)\",\n \"PowerShell(del *-Recurse* / *)\",\n \"PowerShell(del / *-Recurse*)\",\n \"PowerShell(del -Path / *-Recurse*)\",\n \"PowerShell(del -LiteralPath / *-Recurse*)\",\n \"PowerShell(del *-Recurse* ~)\",\n \"PowerShell(del *-Recurse* ~ *)\",\n \"PowerShell(del ~ *-Recurse*)\",\n \"PowerShell(del -Path ~ *-Recurse*)\",\n \"PowerShell(del -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(del *-Recurse* $HOME)\",\n \"PowerShell(del *-Recurse* $HOME *)\",\n \"PowerShell(del $HOME *-Recurse*)\",\n \"PowerShell(del -Path $HOME *-Recurse*)\",\n \"PowerShell(del -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(del *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(del *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(del $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(del -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(del -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(del *-Recurse* \\\\\\\\)\",\n \"PowerShell(del *-Recurse* \\\\ *)\",\n \"PowerShell(del \\\\ *-Recurse*)\",\n \"PowerShell(del -Path \\\\ *-Recurse*)\",\n \"PowerShell(del -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(del *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(del *-Recurse* *:\\\\ *)\",\n \"PowerShell(del *:\\\\ *-Recurse*)\",\n \"PowerShell(del -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(del -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(erase *-Recurse* /)\",\n \"PowerShell(erase *-Recurse* / *)\",\n \"PowerShell(erase / *-Recurse*)\",\n \"PowerShell(erase -Path / *-Recurse*)\",\n \"PowerShell(erase -LiteralPath / *-Recurse*)\",\n \"PowerShell(erase *-Recurse* ~)\",\n \"PowerShell(erase *-Recurse* ~ *)\",\n \"PowerShell(erase ~ *-Recurse*)\",\n \"PowerShell(erase -Path ~ *-Recurse*)\",\n \"PowerShell(erase -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(erase *-Recurse* $HOME)\",\n \"PowerShell(erase *-Recurse* $HOME *)\",\n \"PowerShell(erase $HOME *-Recurse*)\",\n \"PowerShell(erase -Path $HOME *-Recurse*)\",\n \"PowerShell(erase -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(erase *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(erase *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(erase $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(erase -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(erase -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(erase *-Recurse* \\\\\\\\)\",\n \"PowerShell(erase *-Recurse* \\\\ *)\",\n \"PowerShell(erase \\\\ *-Recurse*)\",\n \"PowerShell(erase -Path \\\\ *-Recurse*)\",\n \"PowerShell(erase -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(erase *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(erase *-Recurse* *:\\\\ *)\",\n \"PowerShell(erase *:\\\\ *-Recurse*)\",\n \"PowerShell(erase -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(erase -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(rd *-Recurse* /)\",\n \"PowerShell(rd *-Recurse* / *)\",\n \"PowerShell(rd / *-Recurse*)\",\n \"PowerShell(rd -Path / *-Recurse*)\",\n \"PowerShell(rd -LiteralPath / *-Recurse*)\",\n \"PowerShell(rd *-Recurse* ~)\",\n \"PowerShell(rd *-Recurse* ~ *)\",\n \"PowerShell(rd ~ *-Recurse*)\",\n \"PowerShell(rd -Path ~ *-Recurse*)\",\n \"PowerShell(rd -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(rd *-Recurse* $HOME)\",\n \"PowerShell(rd *-Recurse* $HOME *)\",\n \"PowerShell(rd $HOME *-Recurse*)\",\n \"PowerShell(rd -Path $HOME *-Recurse*)\",\n \"PowerShell(rd -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(rd *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(rd *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(rd $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rd -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rd -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rd *-Recurse* \\\\\\\\)\",\n \"PowerShell(rd *-Recurse* \\\\ *)\",\n \"PowerShell(rd \\\\ *-Recurse*)\",\n \"PowerShell(rd -Path \\\\ *-Recurse*)\",\n \"PowerShell(rd -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(rd *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(rd *-Recurse* *:\\\\ *)\",\n \"PowerShell(rd *:\\\\ *-Recurse*)\",\n \"PowerShell(rd -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(rd -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(ri *-Recurse* /)\",\n \"PowerShell(ri *-Recurse* / *)\",\n \"PowerShell(ri / *-Recurse*)\",\n \"PowerShell(ri -Path / *-Recurse*)\",\n \"PowerShell(ri -LiteralPath / *-Recurse*)\",\n \"PowerShell(ri *-Recurse* ~)\",\n \"PowerShell(ri *-Recurse* ~ *)\",\n \"PowerShell(ri ~ *-Recurse*)\",\n \"PowerShell(ri -Path ~ *-Recurse*)\",\n \"PowerShell(ri -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(ri *-Recurse* $HOME)\",\n \"PowerShell(ri *-Recurse* $HOME *)\",\n \"PowerShell(ri $HOME *-Recurse*)\",\n \"PowerShell(ri -Path $HOME *-Recurse*)\",\n \"PowerShell(ri -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(ri *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(ri *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(ri $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(ri -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(ri -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(ri *-Recurse* \\\\\\\\)\",\n \"PowerShell(ri *-Recurse* \\\\ *)\",\n \"PowerShell(ri \\\\ *-Recurse*)\",\n \"PowerShell(ri -Path \\\\ *-Recurse*)\",\n \"PowerShell(ri -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(ri *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(ri *-Recurse* *:\\\\ *)\",\n \"PowerShell(ri *:\\\\ *-Recurse*)\",\n \"PowerShell(ri -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(ri -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(rm *-Recurse* /)\",\n \"PowerShell(rm *-Recurse* / *)\",\n \"PowerShell(rm / *-Recurse*)\",\n \"PowerShell(rm -Path / *-Recurse*)\",\n \"PowerShell(rm -LiteralPath / *-Recurse*)\",\n \"PowerShell(rm *-Recurse* ~)\",\n \"PowerShell(rm *-Recurse* ~ *)\",\n \"PowerShell(rm ~ *-Recurse*)\",\n \"PowerShell(rm -Path ~ *-Recurse*)\",\n \"PowerShell(rm -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(rm *-Recurse* $HOME)\",\n \"PowerShell(rm *-Recurse* $HOME *)\",\n \"PowerShell(rm $HOME *-Recurse*)\",\n \"PowerShell(rm -Path $HOME *-Recurse*)\",\n \"PowerShell(rm -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(rm *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(rm *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(rm $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rm -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rm -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rm *-Recurse* \\\\\\\\)\",\n \"PowerShell(rm *-Recurse* \\\\ *)\",\n \"PowerShell(rm \\\\ *-Recurse*)\",\n \"PowerShell(rm -Path \\\\ *-Recurse*)\",\n \"PowerShell(rm -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(rm *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(rm *-Recurse* *:\\\\ *)\",\n \"PowerShell(rm *:\\\\ *-Recurse*)\",\n \"PowerShell(rm -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(rm -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(rmdir *-Recurse* /)\",\n \"PowerShell(rmdir *-Recurse* / *)\",\n \"PowerShell(rmdir / *-Recurse*)\",\n \"PowerShell(rmdir -Path / *-Recurse*)\",\n \"PowerShell(rmdir -LiteralPath / *-Recurse*)\",\n \"PowerShell(rmdir *-Recurse* ~)\",\n \"PowerShell(rmdir *-Recurse* ~ *)\",\n \"PowerShell(rmdir ~ *-Recurse*)\",\n \"PowerShell(rmdir -Path ~ *-Recurse*)\",\n \"PowerShell(rmdir -LiteralPath ~ *-Recurse*)\",\n \"PowerShell(rmdir *-Recurse* $HOME)\",\n \"PowerShell(rmdir *-Recurse* $HOME *)\",\n \"PowerShell(rmdir $HOME *-Recurse*)\",\n \"PowerShell(rmdir -Path $HOME *-Recurse*)\",\n \"PowerShell(rmdir -LiteralPath $HOME *-Recurse*)\",\n \"PowerShell(rmdir *-Recurse* $env:USERPROFILE)\",\n \"PowerShell(rmdir *-Recurse* $env:USERPROFILE *)\",\n \"PowerShell(rmdir $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rmdir -Path $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rmdir -LiteralPath $env:USERPROFILE *-Recurse*)\",\n \"PowerShell(rmdir *-Recurse* \\\\\\\\)\",\n \"PowerShell(rmdir *-Recurse* \\\\ *)\",\n \"PowerShell(rmdir \\\\ *-Recurse*)\",\n \"PowerShell(rmdir -Path \\\\ *-Recurse*)\",\n \"PowerShell(rmdir -LiteralPath \\\\ *-Recurse*)\",\n \"PowerShell(rmdir *-Recurse* *:\\\\\\\\)\",\n \"PowerShell(rmdir *-Recurse* *:\\\\ *)\",\n \"PowerShell(rmdir *:\\\\ *-Recurse*)\",\n \"PowerShell(rmdir -Path *:\\\\ *-Recurse*)\",\n \"PowerShell(rmdir -LiteralPath *:\\\\ *-Recurse*)\",\n \"PowerShell(Start-Process *-Verb RunAs*)\",\n \"PowerShell(Invoke-Expression *)\",\n \"PowerShell(iex *)\",\n \"PowerShell(Format-Volume *)\",\n \"PowerShell(icacls */grant*Everyone:F*)\",\n \"PowerShell(icacls */grant*Everyone:(F)*)\"\n ],\n \"ask\": [\n \"Bash(git clean *)\",\n \"Bash(docker volume rm *)\",\n \"Bash(docker system prune *)\",\n \"Bash(rm *-r *)\",\n \"Bash(rm *-r)\",\n \"Bash(rm *-rf *)\",\n \"Bash(rm *-rf)\",\n \"Bash(rm *-fr *)\",\n \"Bash(rm *-fr)\",\n \"Bash(rm *-rv *)\",\n \"Bash(rm *-rv)\",\n \"Bash(rm *-vr *)\",\n \"Bash(rm *-vr)\",\n \"Bash(rm *-rfv *)\",\n \"Bash(rm *-rfv)\",\n \"Bash(rm *-rvf *)\",\n \"Bash(rm *-rvf)\",\n \"Bash(rm *-frv *)\",\n \"Bash(rm *-frv)\",\n \"Bash(rm *-fvr *)\",\n \"Bash(rm *-fvr)\",\n \"Bash(rm *-vrf *)\",\n \"Bash(rm *-vrf)\",\n \"Bash(rm *-vfr *)\",\n \"Bash(rm *-vfr)\",\n \"Bash(rm *-R *)\",\n \"Bash(rm *-R)\",\n \"Bash(rm *-Rf *)\",\n \"Bash(rm *-Rf)\",\n \"Bash(rm *-fR *)\",\n \"Bash(rm *-fR)\",\n \"Bash(rm *-Rv *)\",\n \"Bash(rm *-Rv)\",\n \"Bash(rm *-vR *)\",\n \"Bash(rm *-vR)\",\n \"Bash(rm *-Rfv *)\",\n \"Bash(rm *-Rfv)\",\n \"Bash(rm *-Rvf *)\",\n \"Bash(rm *-Rvf)\",\n \"Bash(rm *-fRv *)\",\n \"Bash(rm *-fRv)\",\n \"Bash(rm *-fvR *)\",\n \"Bash(rm *-fvR)\",\n \"Bash(rm *-vRf *)\",\n \"Bash(rm *-vRf)\",\n \"Bash(rm *-vfR *)\",\n \"Bash(rm *-vfR)\",\n \"Bash(rm *--recursive *)\",\n \"Bash(rm *--recursive)\",\n \"Bash(rm *\\\\**)\",\n \"Bash(*/rm *-r *)\",\n \"Bash(*/rm *-r)\",\n \"Bash(*/rm *-rf *)\",\n \"Bash(*/rm *-rf)\",\n \"Bash(*/rm *-fr *)\",\n \"Bash(*/rm *-fr)\",\n \"Bash(*/rm *-rv *)\",\n \"Bash(*/rm *-rv)\",\n \"Bash(*/rm *-vr *)\",\n \"Bash(*/rm *-vr)\",\n \"Bash(*/rm *-rfv *)\",\n \"Bash(*/rm *-rfv)\",\n \"Bash(*/rm *-rvf *)\",\n \"Bash(*/rm *-rvf)\",\n \"Bash(*/rm *-frv *)\",\n \"Bash(*/rm *-frv)\",\n \"Bash(*/rm *-fvr *)\",\n \"Bash(*/rm *-fvr)\",\n \"Bash(*/rm *-vrf *)\",\n \"Bash(*/rm *-vrf)\",\n \"Bash(*/rm *-vfr *)\",\n \"Bash(*/rm *-vfr)\",\n \"Bash(*/rm *-R *)\",\n \"Bash(*/rm *-R)\",\n \"Bash(*/rm *-Rf *)\",\n \"Bash(*/rm *-Rf)\",\n \"Bash(*/rm *-fR *)\",\n \"Bash(*/rm *-fR)\",\n \"Bash(*/rm *-Rv *)\",\n \"Bash(*/rm *-Rv)\",\n \"Bash(*/rm *-vR *)\",\n \"Bash(*/rm *-vR)\",\n \"Bash(*/rm *-Rfv *)\",\n \"Bash(*/rm *-Rfv)\",\n \"Bash(*/rm *-Rvf *)\",\n \"Bash(*/rm *-Rvf)\",\n \"Bash(*/rm *-fRv *)\",\n \"Bash(*/rm *-fRv)\",\n \"Bash(*/rm *-fvR *)\",\n \"Bash(*/rm *-fvR)\",\n \"Bash(*/rm *-vRf *)\",\n \"Bash(*/rm *-vRf)\",\n \"Bash(*/rm *-vfR *)\",\n \"Bash(*/rm *-vfR)\",\n \"Bash(*/rm *--recursive *)\",\n \"Bash(*/rm *--recursive)\",\n \"Bash(*/rm *\\\\**)\",\n \"Bash(find -delete*)\",\n \"Bash(find * -delete*)\",\n \"Bash(find -exec*rm *)\",\n \"Bash(find * -exec*rm *)\",\n \"Bash(git reset *--hard*)\",\n \"Bash(git push -f*)\",\n \"Bash(git push * -f*)\",\n \"Bash(git push -vv*)\",\n \"Bash(git push * -vv*)\",\n \"Bash(git push -vq*)\",\n \"Bash(git push * -vq*)\",\n \"Bash(git push -vd*)\",\n \"Bash(git push * -vd*)\",\n \"Bash(git push -vn*)\",\n \"Bash(git push * -vn*)\",\n \"Bash(git push -vu*)\",\n \"Bash(git push * -vu*)\",\n \"Bash(git push -v4*)\",\n \"Bash(git push * -v4*)\",\n \"Bash(git push -v6*)\",\n \"Bash(git push * -v6*)\",\n \"Bash(git push -vf*)\",\n \"Bash(git push * -vf*)\",\n \"Bash(git push -qv*)\",\n \"Bash(git push * -qv*)\",\n \"Bash(git push -qq*)\",\n \"Bash(git push * -qq*)\",\n \"Bash(git push -qd*)\",\n \"Bash(git push * -qd*)\",\n \"Bash(git push -qn*)\",\n \"Bash(git push * -qn*)\",\n \"Bash(git push -qu*)\",\n \"Bash(git push * -qu*)\",\n \"Bash(git push -q4*)\",\n \"Bash(git push * -q4*)\",\n \"Bash(git push -q6*)\",\n \"Bash(git push * -q6*)\",\n \"Bash(git push -qf*)\",\n \"Bash(git push * -qf*)\",\n \"Bash(git push -dv*)\",\n \"Bash(git push * -dv*)\",\n \"Bash(git push -dq*)\",\n \"Bash(git push * -dq*)\",\n \"Bash(git push -dd*)\",\n \"Bash(git push * -dd*)\",\n \"Bash(git push -dn*)\",\n \"Bash(git push * -dn*)\",\n \"Bash(git push -du*)\",\n \"Bash(git push * -du*)\",\n \"Bash(git push -d4*)\",\n \"Bash(git push * -d4*)\",\n \"Bash(git push -d6*)\",\n \"Bash(git push * -d6*)\",\n \"Bash(git push -df*)\",\n \"Bash(git push * -df*)\",\n \"Bash(git push -nv*)\",\n \"Bash(git push * -nv*)\",\n \"Bash(git push -nq*)\",\n \"Bash(git push * -nq*)\",\n \"Bash(git push -nd*)\",\n \"Bash(git push * -nd*)\",\n \"Bash(git push -nn*)\",\n \"Bash(git push * -nn*)\",\n \"Bash(git push -nu*)\",\n \"Bash(git push * -nu*)\",\n \"Bash(git push -n4*)\",\n \"Bash(git push * -n4*)\",\n \"Bash(git push -n6*)\",\n \"Bash(git push * -n6*)\",\n \"Bash(git push -nf*)\",\n \"Bash(git push * -nf*)\",\n \"Bash(git push -uv*)\",\n \"Bash(git push * -uv*)\",\n \"Bash(git push -uq*)\",\n \"Bash(git push * -uq*)\",\n \"Bash(git push -ud*)\",\n \"Bash(git push * -ud*)\",\n \"Bash(git push -un*)\",\n \"Bash(git push * -un*)\",\n \"Bash(git push -uu*)\",\n \"Bash(git push * -uu*)\",\n \"Bash(git push -u4*)\",\n \"Bash(git push * -u4*)\",\n \"Bash(git push -u6*)\",\n \"Bash(git push * -u6*)\",\n \"Bash(git push -uf*)\",\n \"Bash(git push * -uf*)\",\n \"Bash(git push -4v*)\",\n \"Bash(git push * -4v*)\",\n \"Bash(git push -4q*)\",\n \"Bash(git push * -4q*)\",\n \"Bash(git push -4d*)\",\n \"Bash(git push * -4d*)\",\n \"Bash(git push -4n*)\",\n \"Bash(git push * -4n*)\",\n \"Bash(git push -4u*)\",\n \"Bash(git push * -4u*)\",\n \"Bash(git push -44*)\",\n \"Bash(git push * -44*)\",\n \"Bash(git push -46*)\",\n \"Bash(git push * -46*)\",\n \"Bash(git push -4f*)\",\n \"Bash(git push * -4f*)\",\n \"Bash(git push -6v*)\",\n \"Bash(git push * -6v*)\",\n \"Bash(git push -6q*)\",\n \"Bash(git push * -6q*)\",\n \"Bash(git push -6d*)\",\n \"Bash(git push * -6d*)\",\n \"Bash(git push -6n*)\",\n \"Bash(git push * -6n*)\",\n \"Bash(git push -6u*)\",\n \"Bash(git push * -6u*)\",\n \"Bash(git push -64*)\",\n \"Bash(git push * -64*)\",\n \"Bash(git push -66*)\",\n \"Bash(git push * -66*)\",\n \"Bash(git push -6f*)\",\n \"Bash(git push * -6f*)\",\n \"Bash(git push --f*)\",\n \"Bash(git push * --f*)\",\n \"Bash(git push --mi*)\",\n \"Bash(git push * --mi*)\",\n \"Bash(git push +*)\",\n \"Bash(git push * +*)\",\n \"Bash(git push \\\"*)\",\n \"Bash(git push * \\\"*)\",\n \"Bash(git push '*)\",\n \"Bash(git push * '*)\",\n \"Bash(git push \\\\\\\\*)\",\n \"Bash(git push * \\\\\\\\*)\",\n \"Bash(git push $*)\",\n \"Bash(git push * $*)\",\n \"Bash(git push `*)\",\n \"Bash(git push * `*)\",\n \"Bash(git rm *)\",\n \"Bash(git worktree remove *)\",\n \"Bash(gio trash *--empty*)\",\n \"Bash(gio trash *--restore*)\",\n \"PowerShell(git clean *)\",\n \"PowerShell(docker volume rm *)\",\n \"PowerShell(docker system prune *)\",\n \"PowerShell(git reset *--hard*)\",\n \"PowerShell(git push -f*)\",\n \"PowerShell(git push * -f*)\",\n \"PowerShell(git push -vv*)\",\n \"PowerShell(git push * -vv*)\",\n \"PowerShell(git push -vq*)\",\n \"PowerShell(git push * -vq*)\",\n \"PowerShell(git push -vd*)\",\n \"PowerShell(git push * -vd*)\",\n \"PowerShell(git push -vn*)\",\n \"PowerShell(git push * -vn*)\",\n \"PowerShell(git push -vu*)\",\n \"PowerShell(git push * -vu*)\",\n \"PowerShell(git push -v4*)\",\n \"PowerShell(git push * -v4*)\",\n \"PowerShell(git push -v6*)\",\n \"PowerShell(git push * -v6*)\",\n \"PowerShell(git push -vf*)\",\n \"PowerShell(git push * -vf*)\",\n \"PowerShell(git push -qv*)\",\n \"PowerShell(git push * -qv*)\",\n \"PowerShell(git push -qq*)\",\n \"PowerShell(git push * -qq*)\",\n \"PowerShell(git push -qd*)\",\n \"PowerShell(git push * -qd*)\",\n \"PowerShell(git push -qn*)\",\n \"PowerShell(git push * -qn*)\",\n \"PowerShell(git push -qu*)\",\n \"PowerShell(git push * -qu*)\",\n \"PowerShell(git push -q4*)\",\n \"PowerShell(git push * -q4*)\",\n \"PowerShell(git push -q6*)\",\n \"PowerShell(git push * -q6*)\",\n \"PowerShell(git push -qf*)\",\n \"PowerShell(git push * -qf*)\",\n \"PowerShell(git push -dv*)\",\n \"PowerShell(git push * -dv*)\",\n \"PowerShell(git push -dq*)\",\n \"PowerShell(git push * -dq*)\",\n \"PowerShell(git push -dd*)\",\n \"PowerShell(git push * -dd*)\",\n \"PowerShell(git push -dn*)\",\n \"PowerShell(git push * -dn*)\",\n \"PowerShell(git push -du*)\",\n \"PowerShell(git push * -du*)\",\n \"PowerShell(git push -d4*)\",\n \"PowerShell(git push * -d4*)\",\n \"PowerShell(git push -d6*)\",\n \"PowerShell(git push * -d6*)\",\n \"PowerShell(git push -df*)\",\n \"PowerShell(git push * -df*)\",\n \"PowerShell(git push -nv*)\",\n \"PowerShell(git push * -nv*)\",\n \"PowerShell(git push -nq*)\",\n \"PowerShell(git push * -nq*)\",\n \"PowerShell(git push -nd*)\",\n \"PowerShell(git push * -nd*)\",\n \"PowerShell(git push -nn*)\",\n \"PowerShell(git push * -nn*)\",\n \"PowerShell(git push -nu*)\",\n \"PowerShell(git push * -nu*)\",\n \"PowerShell(git push -n4*)\",\n \"PowerShell(git push * -n4*)\",\n \"PowerShell(git push -n6*)\",\n \"PowerShell(git push * -n6*)\",\n \"PowerShell(git push -nf*)\",\n \"PowerShell(git push * -nf*)\",\n \"PowerShell(git push -uv*)\",\n \"PowerShell(git push * -uv*)\",\n \"PowerShell(git push -uq*)\",\n \"PowerShell(git push * -uq*)\",\n \"PowerShell(git push -ud*)\",\n \"PowerShell(git push * -ud*)\",\n \"PowerShell(git push -un*)\",\n \"PowerShell(git push * -un*)\",\n \"PowerShell(git push -uu*)\",\n \"PowerShell(git push * -uu*)\",\n \"PowerShell(git push -u4*)\",\n \"PowerShell(git push * -u4*)\",\n \"PowerShell(git push -u6*)\",\n \"PowerShell(git push * -u6*)\",\n \"PowerShell(git push -uf*)\",\n \"PowerShell(git push * -uf*)\",\n \"PowerShell(git push -4v*)\",\n \"PowerShell(git push * -4v*)\",\n \"PowerShell(git push -4q*)\",\n \"PowerShell(git push * -4q*)\",\n \"PowerShell(git push -4d*)\",\n \"PowerShell(git push * -4d*)\",\n \"PowerShell(git push -4n*)\",\n \"PowerShell(git push * -4n*)\",\n \"PowerShell(git push -4u*)\",\n \"PowerShell(git push * -4u*)\",\n \"PowerShell(git push -44*)\",\n \"PowerShell(git push * -44*)\",\n \"PowerShell(git push -46*)\",\n \"PowerShell(git push * -46*)\",\n \"PowerShell(git push -4f*)\",\n \"PowerShell(git push * -4f*)\",\n \"PowerShell(git push -6v*)\",\n \"PowerShell(git push * -6v*)\",\n \"PowerShell(git push -6q*)\",\n \"PowerShell(git push * -6q*)\",\n \"PowerShell(git push -6d*)\",\n \"PowerShell(git push * -6d*)\",\n \"PowerShell(git push -6n*)\",\n \"PowerShell(git push * -6n*)\",\n \"PowerShell(git push -6u*)\",\n \"PowerShell(git push * -6u*)\",\n \"PowerShell(git push -64*)\",\n \"PowerShell(git push * -64*)\",\n \"PowerShell(git push -66*)\",\n \"PowerShell(git push * -66*)\",\n \"PowerShell(git push -6f*)\",\n \"PowerShell(git push * -6f*)\",\n \"PowerShell(git push --f*)\",\n \"PowerShell(git push * --f*)\",\n \"PowerShell(git push --mi*)\",\n \"PowerShell(git push * --mi*)\",\n \"PowerShell(git push +*)\",\n \"PowerShell(git push * +*)\",\n \"PowerShell(git push \\\"*)\",\n \"PowerShell(git push * \\\"*)\",\n \"PowerShell(git push '*)\",\n \"PowerShell(git push * '*)\",\n \"PowerShell(git push \\\\\\\\*)\",\n \"PowerShell(git push * \\\\\\\\*)\",\n \"PowerShell(git push $*)\",\n \"PowerShell(git push * $*)\",\n \"PowerShell(git push `*)\",\n \"PowerShell(git push * `*)\",\n \"PowerShell(git rm *)\",\n \"PowerShell(git worktree remove *)\",\n \"PowerShell(Remove-Item -r*)\",\n \"PowerShell(Remove-Item * -r*)\",\n \"PowerShell(del -r*)\",\n \"PowerShell(del * -r*)\",\n \"PowerShell(erase -r*)\",\n \"PowerShell(erase * -r*)\",\n \"PowerShell(rd -r*)\",\n \"PowerShell(rd * -r*)\",\n \"PowerShell(ri -r*)\",\n \"PowerShell(ri * -r*)\",\n \"PowerShell(rm -r*)\",\n \"PowerShell(rm * -r*)\",\n \"PowerShell(rmdir -r*)\",\n \"PowerShell(rmdir * -r*)\"\n ]\n },\n \"hooks\": {\n \"SessionStart\": [\n {\n \"hooks\": [\n {\n \"type\": \"command\",\n \"command\": \"__DOCKS_KIT_BUN__\",\n \"args\": [\"__DOCKS_KIT_SESSION_START__\"],\n \"timeout\": 5\n }\n ]\n }\n ],\n \"Notification\": [\n {\n \"hooks\": [\n {\n \"type\": \"command\",\n \"command\": \"__DOCKS_KIT_BUN__\",\n \"args\": [\"__DOCKS_KIT_NOTIFY__\"],\n \"timeout\": 10,\n \"async\": true\n }\n ]\n }\n ],\n \"PostToolUseFailure\": [\n {\n \"matcher\": \"Bash|PowerShell\",\n \"hooks\": [\n {\n \"type\": \"command\",\n \"command\": \"echo '{\\\"hookSpecificOutput\\\":{\\\"hookEventName\\\":\\\"PostToolUseFailure\\\",\\\"additionalContext\\\":\\\"Last bash command failed. Repository / file state may have shifted \\u2014 re-read affected files before retrying. If the failure is a missing dependency or env mismatch, surface it to the user rather than retrying blindly.\\\"}}'\",\n \"timeout\": 5\n }\n ]\n }\n ],\n \"SubagentStop\": [\n {\n \"hooks\": [\n {\n \"type\": \"prompt\",\n \"prompt\": \"You are a quality gate for subagent outputs in a multi-agent code-analysis pipeline.\\n\\nEvaluate the subagent's `last_assistant_message` field (in the JSON below) against these requirements:\\n\\n1. ALLOW (return `{}`): Mode-selection or no-issues responses. Examples: \\\"Which mode do you prefer\\\", \\\"select an option\\\", \\\"no issues / problems / violations / blockers found\\\".\\n\\n2. ALLOW (return `{}`): Output contains at least one concrete file:line citation \\u2014 e.g. `src/auth.ts:42`, `lib/db.ts:100-115`, or path references that include line numbers.\\n\\n3. BLOCK (return `{\\\"decision\\\":\\\"block\\\",\\\"reason\\\":\\\"<one-line explanation>\\\"}`): Output claims about code or findings WITHOUT concrete file:line citations. Vague references like \\\"the auth handler\\\" or \\\"near the database code\\\" are not acceptable as the only evidence.\\n\\nSubagent invocation JSON:\\n$ARGUMENTS\\n\\nReturn ONLY the JSON decision (no commentary, no markdown fences).\",\n \"timeout\": 30\n }\n ]\n }\n ]\n },\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"__DOCKS_KIT_STATUSLINE__\",\n \"refreshInterval\": 5\n },\n \"enabledPlugins\": {\n \"docks@docks\": true,\n \"plan-lifecycle@docks\": true,\n \"php-lsp@claude-plugins-official\": true,\n \"rust-analyzer-lsp@claude-plugins-official\": true,\n \"typescript-lsp@claude-plugins-official\": true\n },\n \"extraKnownMarketplaces\": {\n \"docks\": {\n \"source\": {\n \"source\": \"github\",\n \"repo\": \"DocksDocks/docks\"\n }\n }\n },\n \"alwaysThinkingEnabled\": true,\n \"showThinkingSummaries\": true,\n \"viewMode\": \"default\",\n \"theme\": \"dark-daltonized\",\n \"skipDangerousModePermissionPrompt\": true\n}\n",
13
13
  "SoT/.claude/bin/statusline.mjs": "/**\n * @typedef {string | number | boolean | JsonRecord | JsonArray | null | undefined} JsonValue\n * @typedef {{ [key: string]: JsonValue }} JsonRecord\n * @typedef {Array<JsonValue>} JsonArray\n * @typedef {Record<string, string | undefined> | JsonRecord | typeof process.env} EnvInput\n * @typedef {(name: string) => string | null | undefined} WhichFn\n * @typedef {object} SyncSpawnOptions\n * @property {\"ignore\" | \"pipe\" | \"inherit\"} [stdin]\n * @property {\"ignore\" | \"pipe\" | \"inherit\"} [stdout]\n * @property {\"ignore\" | \"pipe\" | \"inherit\"} [stderr]\n * @typedef {object} SyncSpawnResult\n * @property {boolean} [success]\n * @property {Buffer | string | null | undefined} [stdout]\n * @typedef {(argv: string[], options: SyncSpawnOptions) => SyncSpawnResult} SyncSpawner\n * @typedef {object} FormatStatuslineOptions\n * @property {EnvInput} [env]\n * @property {number} [nowMs]\n * @property {string} [cwd]\n * @property {string} [branch]\n * @typedef {object} StatuslineMainOptions\n * @property {() => Promise<string>} [readStdin]\n * @property {(value: string) => void} [writeStdout]\n * @property {string} [cwd]\n * @property {EnvInput} [env]\n * @property {number} [nowMs]\n * @property {WhichFn} [which]\n * @property {SyncSpawner} [spawnSync]\n */\nconst ESC = \"\\x1b[\"\nconst PIPE = `${ESC}90m | ${ESC}0m`\nconst DOT = `${ESC}90m • ${ESC}0m`\nconst DIM = `${ESC}2m${ESC}38;2;156;162;175m`\nconst MIN_COMPACT_WINDOW = 100_000\nconst MAX_COMPACT_WINDOW = 1_000_000\n\n/**\n * @param {object | string | number | boolean | null | undefined} value\n * @returns {value is JsonRecord}\n */\nfunction isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n\n/**\n * @param {JsonValue} value\n * @returns {number | undefined}\n */\nfunction finitePercentage(value) {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0 && value <= 100\n ? value\n : undefined\n}\n\n/**\n * @param {number} value\n * @returns {number}\n */\nfunction roundHalfEven(value) {\n const lower = Math.floor(value)\n const fraction = value - lower\n if (fraction < 0.5) return lower\n if (fraction > 0.5) return lower + 1\n return lower % 2 === 0 ? lower : lower + 1\n}\n\n/**\n * @param {string} path\n * @returns {string}\n */\nfunction pathBasename(path) {\n const parts = path.split(/[\\\\/]+/).filter((part) => part !== \"\")\n return parts.at(-1) ?? \"\"\n}\n\n/**\n * @param {JsonRecord} input\n * @returns {string}\n */\nfunction modelName(input) {\n const model = isRecord(input.model) && typeof input.model.display_name === \"string\"\n ? input.model.display_name\n : \"\"\n const suffix = model.indexOf(\" (\")\n return suffix === -1 ? model : model.slice(0, suffix)\n}\n\n/**\n * @param {JsonRecord} input\n * @param {string} cwd\n * @returns {string}\n */\nfunction workingDirectory(input, cwd) {\n if (isRecord(input.workspace) && typeof input.workspace.current_dir === \"string\" && input.workspace.current_dir !== \"\") {\n return input.workspace.current_dir\n }\n if (typeof input.cwd === \"string\" && input.cwd !== \"\") return input.cwd\n return cwd\n}\n\n/**\n * @param {EnvInput} env\n * @param {number} total\n * @returns {number}\n */\nfunction compactWindow(env, total) {\n const raw = env.CLAUDE_CODE_AUTO_COMPACT_WINDOW\n if (typeof raw !== \"string\" || !/^[0-9]+$/.test(raw)) return total\n const parsed = Number(raw)\n if (!Number.isSafeInteger(parsed) || parsed <= 0) return total\n return Math.min(total, Math.max(MIN_COMPACT_WINDOW, Math.min(parsed, MAX_COMPACT_WINDOW)))\n}\n\n/**\n * @param {number} value\n * @returns {string}\n */\nfunction formatTokensK(value) {\n if (value < 1000) return `${value}k`\n if (value % 1000 === 0) return `${value / 1000}M`\n return `${(roundHalfEven(value / 100) / 10).toFixed(1)}M`\n}\n\n/**\n * @param {JsonRecord} input\n * @param {EnvInput} env\n * @returns {string}\n */\nfunction contextSegment(input, env) {\n if (!isRecord(input.context_window)) return \"\"\n const used = finitePercentage(input.context_window.used_percentage)\n if (used === undefined) return \"\"\n\n const total = input.context_window.context_window_size\n if (typeof total !== \"number\" || !Number.isFinite(total) || total <= 0) {\n return `${ESC}38;2;130;160;230mctx ${roundHalfEven(used)}%${ESC}0m`\n }\n\n const usedK = roundHalfEven((used / 100) * (total / 1000))\n const effectiveK = Math.trunc(compactWindow(env, total) / 1000)\n if (effectiveK <= 0) return `${ESC}38;2;130;160;230mctx ${roundHalfEven(used)}%${ESC}0m`\n const effectivePercentage = roundHalfEven((usedK / effectiveK) * 100)\n return `${ESC}38;2;130;160;230mctx ${effectivePercentage}%${ESC}0m ${DIM}(${formatTokensK(usedK)}/${formatTokensK(effectiveK)})${ESC}0m`\n}\n\n/**\n * @param {JsonValue} value\n * @param {number} nowMs\n * @returns {string}\n */\nfunction resetDelta(value, nowMs) {\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0) return \"\"\n const seconds = Math.trunc(value) - Math.floor(nowMs / 1000)\n if (seconds <= 0) return \"now\"\n const days = Math.trunc(seconds / 86_400)\n if (days > 0) return `${days}d`\n const hours = Math.trunc((seconds % 86_400) / 3_600)\n if (hours > 0) return `${hours}h`\n return `${Math.trunc((seconds % 3_600) / 60)}m`\n}\n\n/**\n * @param {JsonValue} value\n * @param {string} label\n * @param {string} color\n * @param {number} nowMs\n * @returns {string}\n */\nfunction quotaWindow(value, label, color, nowMs) {\n if (!isRecord(value)) return \"\"\n const used = finitePercentage(value.used_percentage)\n if (used === undefined) return \"\"\n const delta = resetDelta(value.resets_at, nowMs)\n const reset = delta === \"\" ? \"\" : ` ${DIM}(${delta})${ESC}0m`\n return `${ESC}38;2;${color}m${label} ${roundHalfEven(used)}%${ESC}0m${reset}`\n}\n\n/**\n * @param {SyncSpawnResult | null | undefined} result\n * @returns {string}\n */\nfunction decodeStdout(result) {\n const stdout = result?.stdout\n if (stdout === undefined || stdout === null) return \"\"\n return typeof stdout === \"string\" ? stdout : stdout.toString()\n}\n\n/**\n * @param {string} directory\n * @param {WhichFn} which\n * @param {SyncSpawner} spawnSync\n * @returns {string}\n */\nfunction resolveBranch(directory, which, spawnSync) {\n const git = which(\"git\")\n if (typeof git !== \"string\" || git === \"\") return \"\"\n const commands = [\n [git, \"-C\", directory, \"symbolic-ref\", \"--short\", \"HEAD\"],\n [git, \"-C\", directory, \"rev-parse\", \"--short\", \"HEAD\"]\n ]\n for (const command of commands) {\n try {\n const result = spawnSync(command, { stdin: \"ignore\", stdout: \"pipe\", stderr: \"ignore\" })\n if (result?.success === true) return decodeStdout(result).trim()\n } catch {\n return \"\"\n }\n }\n return \"\"\n}\n\n/**\n * @param {JsonRecord} input\n * @param {FormatStatuslineOptions} [options]\n * @returns {string}\n */\nexport function formatStatusline(input, options = {}) {\n if (!isRecord(input)) return \"\"\n const env = isRecord(options.env) ? options.env : process.env\n const nowMs = typeof options.nowMs === \"number\" ? options.nowMs : Date.now()\n const cwd = typeof options.cwd === \"string\" ? options.cwd : process.cwd()\n const branch = typeof options.branch === \"string\" ? options.branch : \"\"\n const directory = workingDirectory(input, cwd)\n\n const model = `${ESC}38;5;208m${ESC}1m${modelName(input)}${ESC}22m${ESC}0m`\n const folder = `${ESC}1m${ESC}38;2;76;208;222m${pathBasename(directory)}${ESC}22m${ESC}0m`\n const branchSegment = branch === \"\" ? \"\" : `${DOT}${ESC}1m${ESC}38;2;192;103;222m${branch}${ESC}22m${ESC}0m`\n const context = contextSegment(input, env)\n\n const rateLimits = isRecord(input.rate_limits) ? input.rate_limits : undefined\n const fiveHour = quotaWindow(rateLimits?.five_hour, \"5h\", \"100;200;200\", nowMs)\n const sevenDay = quotaWindow(rateLimits?.seven_day, \"7d\", \"230;180;90\", nowMs)\n const quota = fiveHour === \"\" && sevenDay === \"\"\n ? \"\"\n : `${PIPE}${fiveHour}${fiveHour !== \"\" && sevenDay !== \"\" ? DOT : \"\"}${sevenDay}`\n\n return `${model}${PIPE}${folder}${branchSegment}${context === \"\" ? \"\" : `${PIPE}${context}`}${quota}`\n}\n\n/**\n * @param {StatuslineMainOptions} [options]\n * @returns {Promise<number>}\n */\nexport async function main(options = {}) {\n const readStdin = options.readStdin ?? (() => Bun.stdin.text())\n const writeStdout = options.writeStdout ?? ((value) => process.stdout.write(value))\n let raw\n try {\n raw = await readStdin()\n } catch {\n return 0\n }\n\n let input\n try {\n input = JSON.parse(raw)\n } catch {\n return 0\n }\n if (!isRecord(input)) return 0\n\n const cwd = typeof options.cwd === \"string\" ? options.cwd : process.cwd()\n const directory = workingDirectory(input, cwd)\n const branch = resolveBranch(\n directory,\n options.which ?? ((name) => Bun.which(name)),\n options.spawnSync ?? ((argv, spawnOptions) => Bun.spawnSync(argv, spawnOptions))\n )\n const output = formatStatusline(input, {\n env: options.env ?? process.env,\n nowMs: options.nowMs ?? Date.now(),\n cwd,\n branch\n })\n if (output !== \"\") writeStdout(`${output}\\n`)\n return 0\n}\n\nif (import.meta.main) process.exit(await main())\n",
14
14
  "SoT/.claude/bin/session-start.mjs": "/**\n * @typedef {string | number | boolean | JsonRecord | JsonArray | null | undefined} JsonValue\n * @typedef {{ [key: string]: JsonValue }} JsonRecord\n * @typedef {Array<JsonValue>} JsonArray\n * @typedef {Record<string, string | undefined> | JsonRecord} EnvInput\n * @typedef {object} SessionStartOptions\n * @property {EnvInput} [env]\n * @property {Date} [now]\n * @property {string} [home]\n * @property {(path: string) => string} [readText]\n * @property {(value: string) => void} [writeStdout]\n */\nimport { readFileSync } from \"node:fs\"\nimport { homedir } from \"node:os\"\n\nconst MIN_COMPACT_WINDOW = 100_000\nconst MAX_COMPACT_WINDOW = 1_000_000\n\n/**\n * @param {object | string | number | boolean | null | undefined} value\n * @returns {value is JsonRecord}\n */\nfunction isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n\n/**\n * @param {JsonValue} value\n * @param {string} fallback\n * @returns {string}\n */\nfunction nonEmpty(value, fallback) {\n return typeof value === \"string\" && value !== \"\" ? value : fallback\n}\n\n/**\n * @param {number} value\n * @returns {string}\n */\nfunction pad(value) {\n return String(value).padStart(2, \"0\")\n}\n\n/**\n * @param {string} home\n * @param {(path: string) => string} readText\n * @returns {string}\n */\nfunction configuredEffort(home, readText) {\n try {\n const parsed = JSON.parse(readText(`${home}/.claude/settings.json`))\n return isRecord(parsed) ? nonEmpty(parsed.effortLevel, \"default\") : \"default\"\n } catch {\n return \"default\"\n }\n}\n\n/**\n * @param {Date} now\n * @returns {string}\n */\nfunction localZone(now) {\n const part = new Intl.DateTimeFormat(\"en-US\", { timeZoneName: \"short\" })\n .formatToParts(now)\n .find((value) => value.type === \"timeZoneName\")\n return part?.value ?? \"\"\n}\n\n/**\n * @param {JsonValue} raw\n * @param {number} contextTokens\n * @returns {string}\n */\nfunction effectiveCompactWindow(raw, contextTokens) {\n if (typeof raw !== \"string\" || !/^[0-9]+$/.test(raw)) return \"full\"\n const parsed = Number(raw)\n if (parsed <= 0) return \"full\"\n const clamped = Math.min(contextTokens, Math.max(MIN_COMPACT_WINDOW, Math.min(parsed, MAX_COMPACT_WINDOW)))\n return clamped === contextTokens ? \"full\" : String(clamped)\n}\n\n/**\n * @param {SessionStartOptions} [options]\n * @returns {string[]}\n */\nexport function sessionStartLines(options = {}) {\n const env = isRecord(options.env) ? options.env : process.env\n const now = options.now instanceof Date ? options.now : new Date()\n const home = typeof options.home === \"string\" ? options.home : homedir()\n const readText = options.readText ?? ((path) => readFileSync(path, \"utf8\"))\n const weekday = new Intl.DateTimeFormat(\"en-US\", { weekday: \"long\" }).format(now)\n const date = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`\n const time = `${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`\n const effort = nonEmpty(env.CLAUDE_CODE_EFFORT_LEVEL, configuredEffort(home, readText))\n const contextTokens = env.CLAUDE_CODE_DISABLE_1M_CONTEXT === \"1\" ? 200_000 : 1_000_000\n const context = contextTokens === 200_000 ? \"200K\" : \"1M\"\n const compactWindow = effectiveCompactWindow(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW, contextTokens)\n const subagent = nonEmpty(env.CLAUDE_CODE_SUBAGENT_MODEL, \"default\")\n return [\n `[CONTEXT] Current date: ${weekday}, ${date} ${time} ${localZone(now)}`,\n `[CONFIG] Context: ${context} | Compact-window: ${compactWindow} | Effort: ${effort} | Thinking: adaptive | Subagent: ${subagent}`\n ]\n}\n\n/**\n * @param {SessionStartOptions} [options]\n * @returns {Promise<number>}\n */\nexport async function main(options = {}) {\n const writeStdout = options.writeStdout ?? ((value) => process.stdout.write(value))\n const output = {\n hookSpecificOutput: {\n hookEventName: \"SessionStart\",\n additionalContext: sessionStartLines(options).join(\"\\n\")\n }\n }\n writeStdout(`${JSON.stringify(output)}\\n`)\n return 0\n}\n\nif (import.meta.main) process.exit(await main())\n",
15
15
  "SoT/.claude/bin/notify.mjs": "/**\n * @typedef {(name: string) => string | null | undefined} WhichFn\n * @typedef {(path: string) => Promise<boolean>} FileExistsFn\n * @typedef {object} QuietSpawnOptions\n * @property {\"ignore\" | \"pipe\" | \"inherit\"} [stdin]\n * @property {\"ignore\" | \"pipe\" | \"inherit\"} [stdout]\n * @property {\"ignore\" | \"pipe\" | \"inherit\"} [stderr]\n * @typedef {(argv: string[], options: QuietSpawnOptions) => void} QuietSpawner\n * @typedef {object} PlayerOptions\n * @property {string} [platform]\n * @property {string} [sound]\n * @property {WhichFn} [which]\n * @typedef {object} NotifyOptions\n * @property {string} [platform]\n * @property {string} [sound]\n * @property {WhichFn} [which]\n * @property {FileExistsFn} [fileExists]\n * @property {QuietSpawner} [spawnSync]\n */\nconst DEFAULT_SOUND = `${import.meta.dir}/../notification.mp3`\n\n/**\n * @param {PlayerOptions} [options]\n * @returns {string[] | undefined}\n */\nexport function selectPlayer(options = {}) {\n const platform = options.platform ?? process.platform\n const sound = options.sound ?? DEFAULT_SOUND\n const which = options.which ?? ((name) => Bun.which(name))\n if (platform === \"darwin\") {\n const afplay = which(\"afplay\")\n if (typeof afplay === \"string\" && afplay !== \"\") return [afplay, sound]\n }\n const ffplay = which(\"ffplay\")\n if (typeof ffplay === \"string\" && ffplay !== \"\") {\n return [ffplay, \"-nodisp\", \"-autoexit\", \"-loglevel\", \"quiet\", sound]\n }\n const paplay = which(\"paplay\")\n if (typeof paplay === \"string\" && paplay !== \"\") return [paplay, sound]\n return undefined\n}\n\n/**\n * @param {NotifyOptions} [options]\n * @returns {Promise<number>}\n */\nexport async function main(options = {}) {\n const sound = options.sound ?? DEFAULT_SOUND\n const fileExists = options.fileExists ?? ((path) => Bun.file(path).exists())\n if (!await fileExists(sound)) return 0\n const command = selectPlayer({ ...options, sound })\n if (command === undefined) return 0\n const spawnSync = options.spawnSync ?? ((argv, spawnOptions) => Bun.spawnSync(argv, spawnOptions))\n spawnSync(command, { stdin: \"ignore\", stdout: \"ignore\", stderr: \"ignore\" })\n return 0\n}\n\nif (import.meta.main) process.exit(await main())\n",
16
- "SoT/.codex/AGENTS.md": "# AGENTS.md\n\n## Research Before Implementation\n\nBefore writing or modifying code that uses an API, hook, method, or config surface you have not verified in this session, research current documentation first.\n\nResearch workflow:\n1. Prefer official documentation and primary sources for the specific library, framework, or API.\n2. If a local docs or MCP tool is available, use it before broad web search.\n3. Only then proceed to implementation.\n\nResearch when:\n- Installing or configuring a dependency.\n- Using an API, hook, method, or pattern not verified in this session.\n- Upgrading or migrating between versions.\n- Any task where relying on memory could cause stale syntax or behavior.\n\nDo not:\n- Assume API signatures, method names, or config options from memory.\n- Generate framework code without checking current docs first.\n- Skip research because the library seems familiar.\n\n<constraint>\nResearch the codebase before editing. Never change code you have not read.\n</constraint>\n\n## Removing Files\n\nTo remove, use the trash.\n\n- Move a file or directory to the trash: `gio trash -- <path>` on Linux, `trash <path>` on macOS. `gio trash` can refuse a path in `/tmp` (a system mount); leave temporary files there.\n- To remove a path from the git index, use `git rm -- <path>`; to remove a worktree, use `git worktree remove -- <path>`.\n- Every `rm`, `gio trash`, `git rm`, and `git worktree remove` asks for approval. Use plain `rm <file>` only for a single file you created.\n- Never delete recursively or in bulk (`rm -r`, `find -delete`, `git clean`, `git reset --hard`) without the user's approval. If you cannot ask, list the paths in your final report instead.\n- Never pass `--force`, `-f`, or an abbreviation of it to `git rm`, `git worktree remove`, or `git push`; it discards changes or history.\n- Write literal absolute paths in commands; never `~` or `$HOME`. Never set or export `HOME`.\n\n## Agentic Harness Heuristics\n\nModel-agnostic operating rules for coding-agent work.\n\n1. Persistence. Keep going until the user's request is actually handled. Only yield when the problem is solved or a concrete blocker is identified. Resolve in the fewest useful tool loops — once you can answer the core request with evidence, answer. Before ending a turn, check the last paragraph: if it is a plan, a question you can answer yourself, or a promise of work not done, do that work now.\n2. Default to parallel. When multiple reads, searches, inspections, or independent checks can run without depending on each other, run them together.\n3. Multi-pass search. First-pass search often misses — vary the wording before concluding something does not exist.\n4. Trace symbols. Before modifying a symbol, trace its definition and usages. Do not infer behavior from one call site.\n5. Linter-loop 3-strike rule. Do not loop more than 3 times fixing the same lint/test failure without reassessing the diagnosis.\n6. Read-before-edit TTL. If you have not read a file recently, re-read it before editing.\n7. Big-file rule. For files over 1000 lines, prefer targeted search plus scoped reads over whole-file reads.\n8. Task hygiene. Track meaningful deliverables, not operational sub-steps. Mark work complete as soon as it is done.\n9. Literal-instruction rule. Treat explicit user requirements as checklists with success criteria. Do not silently broaden scope.\n10. Context hygiene. Prefer a fresh session at task boundaries over carrying stale context; preserve useful state before quality decays. Never stop, summarize, or suggest a new session on account of context limits.\n11. Autonomy calibration. For minor choices (naming, formatting, defaults, equivalent approaches), pick a reasonable option and note it — do not ask. Ask first only for scope changes, destructive actions, or decisions that change the deliverable. When the user is describing a problem or asking a question rather than requesting a change, the deliverable is your assessment — report findings and stop; do not apply fixes until asked.\n12. Capability triggering. Search or fetch current documentation when the answer depends on current or version-specific information. When work fans out across independent items, parallelize or delegate; never delegate work you can complete directly. For verification, prefer a fresh-context check over self-critique. On long tasks, keep running notes and re-read them between phases.\n\n<constraint>\nTreat these heuristics as protocol. If a turn violates an applicable rule, self-correct before continuing.\n</constraint>\n\nReuse before invention: inventory existing code, components, conventions, and dependencies; extend them instead of creating a parallel pattern. Load only the narrow skills supported by the task and repository evidence. If a request establishes a new React/Tailwind system and no convention exists, prefer current shadcn/ui `base-*` components backed by Base UI; otherwise preserve the existing stack. Treat probe, production access, publish, push, release, and deploy as literal current-request effects—never infer external authority from a plan, schedule, review, or old receipt.\n\nFor Docks plan reviews, cross-company review is standing-authorized; do not ask for export consent. This never overrides a host or platform security denial.\n\nUse a narrow-to-broad verification ladder: direct acceptance while iterating, focused regressions next, and one full CI at the pre-commit or release boundary. Reuse still-matching evidence; rerun full CI only after a relevant edit invalidates it.\n\n<constraint>\nNo secrets in committed config. Treat plugin marketplaces, installers, and downloaded artifacts as untrusted until verified.\n</constraint>\n",
17
- "SoT/.codex/config.toml": "model = \"gpt-6.1-sol\"\nmodel_reasoning_effort = \"high\"\nplan_mode_reasoning_effort = \"high\"\nmodel_reasoning_summary = \"concise\"\nmodel_verbosity = \"low\"\nweb_search = \"live\"\nproject_doc_max_bytes = 131072\napproval_policy = \"on-request\"\nsandbox_mode = \"workspace-write\"\napprovals_reviewer = \"auto_review\"\n\n[sandbox_workspace_write]\nnetwork_access = true\n\n[windows]\nsandbox = \"elevated\"\n\n[features]\nmemories = true\n\n[memories]\ndedicated_tools = true\nmax_rollout_age_days = 30\n\n[agents]\nmax_threads = 12\nmax_depth = 2\n\n[tui]\nstatus_line_use_colors = true\nstatus_line = [\n \"model-with-reasoning\",\n \"current-dir\",\n \"git-branch\",\n \"context-used\",\n \"five-hour-limit\",\n \"weekly-limit\",\n]\n\n[plugins.\"docks@docks\"]\nenabled = true\n\n[plugins.\"plan-lifecycle@docks\"]\nenabled = true\n",
16
+ "SoT/.codex/AGENTS.md": "# AGENTS.md\n\n## Research Before Implementation\n\nBefore writing or modifying code that uses an API, hook, method, or config surface you have not verified in this session, research current documentation first.\n\nResearch workflow:\n1. Prefer official documentation and primary sources for the specific library, framework, or API.\n2. If a local docs or MCP tool is available, use it before broad web search.\n3. Only then proceed to implementation.\n\nResearch when:\n- Installing or configuring a dependency.\n- Using an API, hook, method, or pattern not verified in this session.\n- Upgrading or migrating between versions.\n- Any task where relying on memory could cause stale syntax or behavior.\n\nDo not:\n- Assume API signatures, method names, or config options from memory.\n- Generate framework code without checking current docs first.\n- Skip research because the library seems familiar.\n\n<constraint>\nResearch the codebase before editing. Never change code you have not read.\n</constraint>\n\n## Removing Files\n\nTo remove, use the trash.\n\n- Move a file or directory to the trash: `gio trash -- <path>` on Linux, `trash <path>` on macOS. `gio trash` can refuse a path in `/tmp` (a system mount); leave temporary files there.\n- To remove a path from the git index, use `git rm -- <path>`; to remove a worktree, use `git worktree remove -- <path>`.\n- Every `rm`, `gio trash`, `git rm`, and `git worktree remove` asks for approval. Use plain `rm <file>` only for a single file you created.\n- Never delete recursively or in bulk (`rm -r`, `find -delete`, `git clean`, `git reset --hard`) without the user's approval. If you cannot ask, list the paths in your final report instead.\n- Never pass `--force`, `-f`, or an abbreviation of it to `git rm`, `git worktree remove`, or `git push`; it discards changes or history.\n- Write literal absolute paths in commands; never `~` or `$HOME`. Never set or export `HOME`.\n\n## Agentic Harness Heuristics\n\nModel-agnostic operating rules for coding-agent work.\n\n1. Persistence. Keep going until the user's request is actually handled. Only yield when the problem is solved or a concrete blocker is identified. Resolve in the fewest useful tool loops — once you can answer the core request with evidence, answer. Before ending a turn, check the last paragraph: if it is a plan, a question you can answer yourself, or a promise of work not done, do that work now.\n2. Default to parallel. When multiple reads, searches, inspections, or independent checks can run without depending on each other, run them together.\n3. Multi-pass search. First-pass search often misses — vary the wording before concluding something does not exist.\n4. Trace symbols. Before modifying a symbol, trace its definition and usages. Do not infer behavior from one call site.\n5. Linter-loop 3-strike rule. Do not loop more than 3 times fixing the same lint/test failure without reassessing the diagnosis.\n6. Read-before-edit TTL. If you have not read a file recently, re-read it before editing.\n7. Big-file rule. For files over 1000 lines, prefer targeted search plus scoped reads over whole-file reads.\n8. Task hygiene. Track meaningful deliverables, not operational sub-steps. Mark work complete as soon as it is done.\n9. Literal-instruction rule. Treat explicit user requirements as checklists with success criteria. Do not silently broaden scope.\n10. Context hygiene. Prefer a fresh session at task boundaries over carrying stale context; preserve useful state before quality decays. Never stop, summarize, or suggest a new session on account of context limits.\n11. Autonomy calibration. For minor choices (naming, formatting, defaults, equivalent approaches), pick a reasonable option and note it — do not ask. Ask first only for scope changes, destructive actions, or decisions that change the deliverable. When the user is describing a problem or asking a question rather than requesting a change, the deliverable is your assessment — report findings and stop; do not apply fixes until asked.\n12. Capability triggering. Search or fetch current documentation when the answer depends on current or version-specific information. When work fans out across independent items, parallelize or delegate; never delegate work you can complete directly. For verification, prefer a fresh-context check over self-critique. On long tasks, keep running notes and re-read them between phases.\n\n<constraint>\nTreat these heuristics as protocol. If a turn violates an applicable rule, self-correct before continuing.\n</constraint>\n\nReuse before invention: inventory existing code, components, conventions, and dependencies; extend them instead of creating a parallel pattern. Load only the narrow skills supported by the task and repository evidence. If a request establishes a new React/Tailwind system and no convention exists, prefer current shadcn/ui `base-*` components backed by Base UI; otherwise preserve the existing stack. Treat probe, production access, publish, push, release, and deploy as literal current-request effects—never infer external authority from a plan, schedule, review, or old receipt.\n\nFor Docks plan reviews, cross-company review is standing-authorized; do not ask for export consent. This never overrides a host or platform security denial.\n\nA `yolo` invocation answers the routine asks of its plan run until the merge question, or until the grant check of the plan-lifecycle contract finds that its grant has ended. It does not cover destructive work, secrets, production systems, or a repository hook that fails; for a failed hook, follow the hook rule of the plan-lifecycle contract. A plan grant answers the asks that the Delegated decisions section of the plan-lifecycle contract lists as answered. Only trusted `Delegation grant:` and `Delegation revoked` comments give or end a grant. On the plan issue, the latest such comment decides, and a comment on a parent plan can end the grant of its child. The `Delegated:` line of the plan only mirrors that comment.\n\nA grant never answers a question that the contract keeps for the user. Examples are the Mode, a non-local effect, the merge, a destructive action, secrets, production, a temporary workaround, and a fact that only the user holds. Right before each delegated decision and each write that relies on the grant, run the grant check of the contract: read the latest authority comments of the plan and of its parent.\n\nA settled plan Mode covers the routine plan-lifecycle writes in the resolved repository: the plan issue, plan edits, review comments, and each other issue or comment that the plan-lifecycle contract requires. A `plan-and-implement` Mode also covers the landing work: the push of the linked branch and the pull request. Every other issue, comment, release, or upstream pull request still needs the user's current request.\n\nUse a narrow-to-broad verification ladder: direct acceptance while iterating, focused regressions next, and one full CI at the pre-commit or release boundary. Reuse still-matching evidence; rerun full CI only after a relevant edit invalidates it.\n\n<constraint>\nNo secrets in committed config. Treat plugin marketplaces, installers, and downloaded artifacts as untrusted until verified.\n</constraint>\n",
17
+ "SoT/.codex/config.toml": "model = \"gpt-6.2-sol\"\nmodel_reasoning_effort = \"high\"\nplan_mode_reasoning_effort = \"high\"\nmodel_reasoning_summary = \"concise\"\nmodel_verbosity = \"low\"\nweb_search = \"live\"\nproject_doc_max_bytes = 131072\napproval_policy = \"on-request\"\nsandbox_mode = \"workspace-write\"\napprovals_reviewer = \"auto_review\"\n\n[sandbox_workspace_write]\nnetwork_access = true\n\n[windows]\nsandbox = \"elevated\"\n\n[features]\nmemories = true\n\n[memories]\ndedicated_tools = true\nmax_rollout_age_days = 30\n\n[agents]\nmax_threads = 12\nmax_depth = 2\n\n[tui]\nstatus_line_use_colors = true\nstatus_line = [\n \"model-with-reasoning\",\n \"current-dir\",\n \"git-branch\",\n \"context-used\",\n \"five-hour-limit\",\n \"weekly-limit\",\n]\n\n[plugins.\"docks@docks\"]\nenabled = true\n\n[plugins.\"plan-lifecycle@docks\"]\nenabled = true\n",
18
18
  "SoT/.codex/plugins/marketplace.json": "{\n \"name\": \"docks\",\n \"interface\": {\n \"displayName\": \"DocksDocks\"\n },\n \"plugins\": [\n {\n \"name\": \"docks\",\n \"source\": {\n \"source\": \"git-subdir\",\n \"url\": \"https://github.com/DocksDocks/docks.git\",\n \"path\": \"./plugins/docks\",\n \"ref\": \"main\"\n },\n \"policy\": {\n \"installation\": \"AVAILABLE\",\n \"authentication\": \"ON_INSTALL\"\n },\n \"category\": \"Productivity\"\n },\n {\n \"name\": \"plan-lifecycle\",\n \"source\": {\n \"source\": \"git-subdir\",\n \"url\": \"https://github.com/DocksDocks/docks.git\",\n \"path\": \"./plugins/plan-lifecycle\",\n \"ref\": \"main\"\n },\n \"policy\": {\n \"installation\": \"AVAILABLE\",\n \"authentication\": \"ON_INSTALL\"\n },\n \"category\": \"Productivity\"\n }\n ]\n}\n",
19
19
  "SoT/.codex/rules/docks.rules": "prefix_rule(pattern=[\"pwd\"], decision=\"allow\")\nprefix_rule(pattern=[\"ls\"], decision=\"allow\")\nprefix_rule(pattern=[\"cat\"], decision=\"allow\")\nprefix_rule(pattern=[\"head\"], decision=\"allow\")\nprefix_rule(pattern=[\"tail\"], decision=\"allow\")\nprefix_rule(pattern=[\"wc\"], decision=\"allow\")\nprefix_rule(pattern=[\"nl\"], decision=\"allow\")\nprefix_rule(pattern=[\"grep\"], decision=\"allow\")\nprefix_rule(pattern=[\"diff\"], decision=\"allow\")\nprefix_rule(pattern=[\"which\"], decision=\"allow\")\nprefix_rule(pattern=[\"date\"], decision=\"allow\")\nprefix_rule(pattern=[\"basename\"], decision=\"allow\")\nprefix_rule(pattern=[\"dirname\"], decision=\"allow\")\nprefix_rule(pattern=[\"realpath\"], decision=\"allow\")\nprefix_rule(pattern=[\"readlink\"], decision=\"allow\")\nprefix_rule(pattern=[\"jq\"], decision=\"allow\")\nprefix_rule(pattern=[\"cut\"], decision=\"allow\")\nprefix_rule(pattern=[\"tr\"], decision=\"allow\")\nprefix_rule(pattern=[\"echo\"], decision=\"allow\")\nprefix_rule(pattern=[\"printf\"], decision=\"allow\")\nprefix_rule(pattern=[\"printenv\"], decision=\"allow\")\nprefix_rule(pattern=[\"uname\"], decision=\"allow\")\nprefix_rule(pattern=[\"file\"], decision=\"allow\")\nprefix_rule(pattern=[\"stat\"], decision=\"allow\")\nprefix_rule(pattern=[\"du\"], decision=\"allow\")\nprefix_rule(pattern=[\"id\"], decision=\"allow\")\nprefix_rule(pattern=[\"whoami\"], decision=\"allow\")\n\nprefix_rule(pattern=[\"git\", \"status\"], decision=\"allow\")\nprefix_rule(pattern=[\"git\", \"blame\"], decision=\"allow\")\nprefix_rule(pattern=[\"git\", \"rev-parse\"], decision=\"allow\")\nprefix_rule(pattern=[\"git\", \"ls-files\"], decision=\"allow\")\nprefix_rule(pattern=[\"git\", \"ls-tree\"], decision=\"allow\")\nprefix_rule(pattern=[\"git\", \"branch\", \"--show-current\"], decision=\"allow\")\nprefix_rule(pattern=[\"git\", \"branch\", \"-vv\"], decision=\"allow\")\n\nprefix_rule(pattern=[\"gh\", \"pr\", \"view\"], decision=\"allow\")\nprefix_rule(pattern=[\"gh\", \"pr\", \"list\"], decision=\"allow\")\nprefix_rule(pattern=[\"gh\", \"pr\", \"diff\"], decision=\"allow\")\nprefix_rule(pattern=[\"gh\", \"pr\", \"status\"], decision=\"allow\")\nprefix_rule(pattern=[\"gh\", \"pr\", \"checks\"], decision=\"allow\")\n\nprefix_rule(pattern=[\"docker\", \"ps\"], decision=\"allow\")\n\nprefix_rule(pattern=[\"git\", \"push\"], decision=\"prompt\")\nprefix_rule(pattern=[\"git\", \"reset\"], decision=\"prompt\")\nprefix_rule(pattern=[\"git\", \"clean\"], decision=\"prompt\")\nprefix_rule(pattern=[\"git\", \"merge\"], decision=\"prompt\")\nprefix_rule(pattern=[\"git\", \"rebase\"], decision=\"prompt\")\nprefix_rule(pattern=[\"git\", \"checkout\"], decision=\"prompt\")\nprefix_rule(pattern=[\"git\", \"mv\"], decision=\"prompt\")\n\nprefix_rule(pattern=[\"rm\"], decision=\"prompt\")\nprefix_rule(pattern=[\"mv\"], decision=\"prompt\")\nprefix_rule(pattern=[\"chmod\"], decision=\"prompt\")\nprefix_rule(pattern=[\"chown\"], decision=\"prompt\")\nprefix_rule(pattern=[\"kill\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pkill\"], decision=\"prompt\")\n\nprefix_rule(pattern=[\"npm\", \"install\"], decision=\"prompt\")\nprefix_rule(pattern=[\"npm\", \"uninstall\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pnpm\", \"add\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pnpm\", \"remove\"], decision=\"prompt\")\nprefix_rule(pattern=[\"yarn\", \"add\"], decision=\"prompt\")\nprefix_rule(pattern=[\"yarn\", \"remove\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pip\", \"install\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pip\", \"uninstall\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pip3\", \"install\"], decision=\"prompt\")\nprefix_rule(pattern=[\"pip3\", \"uninstall\"], decision=\"prompt\")\n\nprefix_rule(pattern=[\"docker\", \"run\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"rm\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"stop\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"volume\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"system\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"compose\", \"up\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"compose\", \"down\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"compose\", \"rm\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker\", \"compose\", \"stop\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker-compose\", \"up\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker-compose\", \"down\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker-compose\", \"rm\"], decision=\"prompt\")\nprefix_rule(pattern=[\"docker-compose\", \"stop\"], decision=\"prompt\")\n\n# `tail -f`/`--follow` never returns and hangs the agent (bare `tail` stays allowed above).\nprefix_rule(pattern=[\"tail\", \"-f\"], decision=\"prompt\")\nprefix_rule(pattern=[\"tail\", \"--follow\"], decision=\"prompt\")\n# These commands are prompt or absent, NOT allow, because argv-prefix matching\n# cannot gate a later write or exec flag, and allow runs outside the sandbox:\n# rg --pre=CMD; sed -n 'e CMD' or -ni; sort -o FILE or --compress-program=CMD;\n# the uniq OUTPUT operand; tree -o FILE; git diff/log/show --output=FILE;\n# git grep --open-files-in-pager=CMD or -O; git mv into .git/hooks.\n# Without a rule, sort, uniq, tree, git diff/log/show, and git grep run in the\n# sandbox with no prompt.\nprefix_rule(pattern=[\"rg\"], decision=\"prompt\")\nprefix_rule(pattern=[\"sed\", \"-n\"], decision=\"prompt\")\nprefix_rule(pattern=[\"find\"], decision=\"prompt\")\nprefix_rule(pattern=[\"sed\", \"-i\"], decision=\"prompt\")\nprefix_rule(pattern=[\"sed\", \"--in-place\"], decision=\"prompt\")\nprefix_rule(pattern=[\"awk\"], decision=\"prompt\")\nprefix_rule(pattern=[\"xargs\"], decision=\"prompt\")\nprefix_rule(pattern=[\"tee\"], decision=\"prompt\")\nprefix_rule(pattern=[\"curl\"], decision=\"prompt\")\nprefix_rule(pattern=[\"env\"], decision=\"prompt\")\n\nprefix_rule(pattern=[\"sudo\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"eval\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"mkfs\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"dd\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"git\", \"push\", \"--force\", \"origin\", \"main\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"git\", \"push\", \"--force\", \"origin\", \"master\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"git\", \"push\", \"-f\", \"origin\", \"main\"], decision=\"forbidden\")\nprefix_rule(pattern=[\"git\", \"push\", \"-f\", \"origin\", \"master\"], decision=\"forbidden\")\n\n# Destructive-command guards. Codex applies the strictest matching rule\n# (forbidden > prompt > allow), so an allow rule in another .rules file cannot\n# loosen them, and a narrow allow cannot carve an exception out of a prompt.\n# The rm, find, git push, git reset, and git clean prompt rules above already\n# make every recursive or bulk deletion and every history-destroying git\n# command prompt. Codex prefix rules cannot see an option after an operand,\n# so every rm prompts, a single-file rm too. A prompt goes to the approvals\n# reviewer in config.toml (auto_review), not always to a person.\n#\n# rm of the filesystem root as Codex runs it: argv tokens, or a plain script\n# that Codex splits into argv tokens.\nprefix_rule(pattern=[\"rm\", \"/\"], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[\"rm\", [\"-r\", \"-R\", \"-f\", \"-rf\", \"-fr\", \"-Rf\", \"-fR\", \"-rfv\", \"-vrf\", \"-v\", \"--recursive\", \"--force\", \"--no-preserve-root\", \"--\"], \"/\"], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[\"rm\", [\"-r\", \"-R\", \"-f\", \"-rf\", \"-fr\", \"-Rf\", \"-fR\", \"-rfv\", \"-vrf\", \"-v\", \"--recursive\", \"--force\", \"--no-preserve-root\", \"--\"], [\"-r\", \"-R\", \"-f\", \"-rf\", \"-fr\", \"-Rf\", \"-fR\", \"-rfv\", \"-vrf\", \"-v\", \"--recursive\", \"--force\", \"--no-preserve-root\", \"--\"], \"/\"], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[\"rm\", [\"-r\", \"-R\", \"-f\", \"-rf\", \"-fr\", \"-Rf\", \"-fR\", \"-rfv\", \"-vrf\", \"-v\", \"--recursive\", \"--force\", \"--no-preserve-root\", \"--\"], [\"-r\", \"-R\", \"-f\", \"-rf\", \"-fr\", \"-Rf\", \"-fR\", \"-rfv\", \"-vrf\", \"-v\", \"--recursive\", \"--force\", \"--no-preserve-root\", \"--\"], [\"-r\", \"-R\", \"-f\", \"-rf\", \"-fr\", \"-Rf\", \"-fR\", \"-rfv\", \"-vrf\", \"-v\", \"--recursive\", \"--force\", \"--no-preserve-root\", \"--\"], \"/\"], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\n# Codex does not split a script that holds ~, $HOME, a glob, or a substitution.\n# It matches the whole [shell, -c, script] invocation, so these rules forbid\n# only the exact scripts listed.\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm ~\", \"rm -r ~\", \"rm -R ~\", \"rm -f ~\", \"rm -rf ~\", \"rm -fr ~\", \"rm -Rf ~\", \"rm -fR ~\", \"rm -r -f ~\", \"rm -f -r ~\", \"rm --recursive ~\", \"rm --recursive --force ~\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm ~/\", \"rm -r ~/\", \"rm -R ~/\", \"rm -f ~/\", \"rm -rf ~/\", \"rm -fr ~/\", \"rm -Rf ~/\", \"rm -fR ~/\", \"rm -r -f ~/\", \"rm -f -r ~/\", \"rm --recursive ~/\", \"rm --recursive --force ~/\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm $HOME\", \"rm -r $HOME\", \"rm -R $HOME\", \"rm -f $HOME\", \"rm -rf $HOME\", \"rm -fr $HOME\", \"rm -Rf $HOME\", \"rm -fR $HOME\", \"rm -r -f $HOME\", \"rm -f -r $HOME\", \"rm --recursive $HOME\", \"rm --recursive --force $HOME\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm $HOME/\", \"rm -r $HOME/\", \"rm -R $HOME/\", \"rm -f $HOME/\", \"rm -rf $HOME/\", \"rm -fr $HOME/\", \"rm -Rf $HOME/\", \"rm -fR $HOME/\", \"rm -r -f $HOME/\", \"rm -f -r $HOME/\", \"rm --recursive $HOME/\", \"rm --recursive --force $HOME/\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm \\\"$HOME\\\"\", \"rm -r \\\"$HOME\\\"\", \"rm -R \\\"$HOME\\\"\", \"rm -f \\\"$HOME\\\"\", \"rm -rf \\\"$HOME\\\"\", \"rm -fr \\\"$HOME\\\"\", \"rm -Rf \\\"$HOME\\\"\", \"rm -fR \\\"$HOME\\\"\", \"rm -r -f \\\"$HOME\\\"\", \"rm -f -r \\\"$HOME\\\"\", \"rm --recursive \\\"$HOME\\\"\", \"rm --recursive --force \\\"$HOME\\\"\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm \\\"$HOME/\\\"\", \"rm -r \\\"$HOME/\\\"\", \"rm -R \\\"$HOME/\\\"\", \"rm -f \\\"$HOME/\\\"\", \"rm -rf \\\"$HOME/\\\"\", \"rm -fr \\\"$HOME/\\\"\", \"rm -Rf \\\"$HOME/\\\"\", \"rm -fR \\\"$HOME/\\\"\", \"rm -r -f \\\"$HOME/\\\"\", \"rm -f -r \\\"$HOME/\\\"\", \"rm --recursive \\\"$HOME/\\\"\", \"rm --recursive --force \\\"$HOME/\\\"\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm \\\"$HOME\\\"/\", \"rm -r \\\"$HOME\\\"/\", \"rm -R \\\"$HOME\\\"/\", \"rm -f \\\"$HOME\\\"/\", \"rm -rf \\\"$HOME\\\"/\", \"rm -fr \\\"$HOME\\\"/\", \"rm -Rf \\\"$HOME\\\"/\", \"rm -fR \\\"$HOME\\\"/\", \"rm -r -f \\\"$HOME\\\"/\", \"rm -f -r \\\"$HOME\\\"/\", \"rm --recursive \\\"$HOME\\\"/\", \"rm --recursive --force \\\"$HOME\\\"/\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm ${HOME}\", \"rm -r ${HOME}\", \"rm -R ${HOME}\", \"rm -f ${HOME}\", \"rm -rf ${HOME}\", \"rm -fr ${HOME}\", \"rm -Rf ${HOME}\", \"rm -fR ${HOME}\", \"rm -r -f ${HOME}\", \"rm -f -r ${HOME}\", \"rm --recursive ${HOME}\", \"rm --recursive --force ${HOME}\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm ${HOME}/\", \"rm -r ${HOME}/\", \"rm -R ${HOME}/\", \"rm -f ${HOME}/\", \"rm -rf ${HOME}/\", \"rm -fr ${HOME}/\", \"rm -Rf ${HOME}/\", \"rm -fR ${HOME}/\", \"rm -r -f ${HOME}/\", \"rm -f -r ${HOME}/\", \"rm --recursive ${HOME}/\", \"rm --recursive --force ${HOME}/\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm \\\"${HOME}\\\"\", \"rm -r \\\"${HOME}\\\"\", \"rm -R \\\"${HOME}\\\"\", \"rm -f \\\"${HOME}\\\"\", \"rm -rf \\\"${HOME}\\\"\", \"rm -fr \\\"${HOME}\\\"\", \"rm -Rf \\\"${HOME}\\\"\", \"rm -fR \\\"${HOME}\\\"\", \"rm -r -f \\\"${HOME}\\\"\", \"rm -f -r \\\"${HOME}\\\"\", \"rm --recursive \\\"${HOME}\\\"\", \"rm --recursive --force \\\"${HOME}\\\"\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm \\\"${HOME}/\\\"\", \"rm -r \\\"${HOME}/\\\"\", \"rm -R \\\"${HOME}/\\\"\", \"rm -f \\\"${HOME}/\\\"\", \"rm -rf \\\"${HOME}/\\\"\", \"rm -fr \\\"${HOME}/\\\"\", \"rm -Rf \\\"${HOME}/\\\"\", \"rm -fR \\\"${HOME}/\\\"\", \"rm -r -f \\\"${HOME}/\\\"\", \"rm -f -r \\\"${HOME}/\\\"\", \"rm --recursive \\\"${HOME}/\\\"\", \"rm --recursive --force \\\"${HOME}/\\\"\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm \\\"${HOME}\\\"/\", \"rm -r \\\"${HOME}\\\"/\", \"rm -R \\\"${HOME}\\\"/\", \"rm -f \\\"${HOME}\\\"/\", \"rm -rf \\\"${HOME}\\\"/\", \"rm -fr \\\"${HOME}\\\"/\", \"rm -Rf \\\"${HOME}\\\"/\", \"rm -fR \\\"${HOME}\\\"/\", \"rm -r -f \\\"${HOME}\\\"/\", \"rm -f -r \\\"${HOME}\\\"/\", \"rm --recursive \\\"${HOME}\\\"/\", \"rm --recursive --force \\\"${HOME}\\\"/\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"rm /*\", \"rm -r /*\", \"rm -R /*\", \"rm -f /*\", \"rm -rf /*\", \"rm -fr /*\", \"rm -Rf /*\", \"rm -fR /*\", \"rm -r -f /*\", \"rm -f -r /*\", \"rm --recursive /*\", \"rm --recursive --force /*\"]], decision=\"forbidden\", justification=\"Never remove the home directory or the filesystem root. Move a path to the trash with gio trash -- <path> (Linux) or trash <path> (macOS 15+).\")\nprefix_rule(pattern=[[\"bash\", \"sh\", \"zsh\"], [\"-c\", \"-lc\"], [\"export HOME=$(mktemp -d)\", \"export HOME=\\\"$(mktemp -d)\\\"\", \"HOME=$(mktemp -d)\", \"HOME=\\\"$(mktemp -d)\\\"\"]], decision=\"forbidden\", justification=\"Never reassign HOME. Each command runs in a new shell, so use literal absolute paths.\")\n\n# Forced git removal discards uncommitted changes, and the prefix cannot see a\n# later --force, so both commands ask in every form.\nprefix_rule(pattern=[\"git\", \"rm\"], decision=\"prompt\", justification=\"git rm --force and git worktree remove --force discard uncommitted changes. A prefix rule cannot see a later --force, so every git rm and git worktree remove asks.\")\nprefix_rule(pattern=[\"git\", \"worktree\", \"remove\"], decision=\"prompt\", justification=\"git rm --force and git worktree remove --force discard uncommitted changes. A prefix rule cannot see a later --force, so every git rm and git worktree remove asks.\")\n\n# gio trash can empty the trash or overwrite a restored path, and the prefix\n# cannot tell those forms from gio trash -- <path>, so every gio trash asks.\n# The macOS trash command has no such option.\nprefix_rule(pattern=[\"gio\", \"trash\"], decision=\"prompt\", justification=\"gio trash -f --empty, -ff --empty, and --restore --force delete or overwrite data, and a prefix rule cannot tell them from gio trash -- <path>, so every gio trash asks.\")\nprefix_rule(pattern=[\"trash\"], decision=\"allow\")\n",
20
- "SoT/.omp/AGENTS.md": "# Global OMP guidance\n\n- Verify unfamiliar or version-sensitive APIs and configuration against current official documentation before implementation.\n- When the user asks for an assessment rather than a change, report findings without editing.\n- For Docks plan reviews, cross-company review is standing-authorized; host security policy still applies.\n- Please remove all mannered prose.\n\n## Asking me things\n\nIf you need an answer from me, it MUST go through `ask`; do not ask in prose.\n\nMUST use `ask` before:\n- Anything irreversible or destructive: deleting/overwriting files or data you did not create,\n force-push, history rewrite, dropping tables, running migrations, mass rename, touching\n secrets/credentials, or publishing outward (release, upstream PR, issue, comment).\n- Two or more viable approaches whose tradeoffs are mine to own: schema/API/protocol shape,\n adding a dependency, or establishing a convention this repo does not already have.\n- A fact only I hold: intended semantics of an ambiguous requirement, which of several\n conflicting existing patterns is canonical, or which environment/account/target to use.\n- A request that contradicts the repo: surface the conflict and let me resolve it; never\n silently pick one side.\n\nWhen I invoke the `yolo` skill, that invocation answers every ask this section requires,\nuntil the run asks its merge question. It does not cover destructive work, secrets, or\nproduction systems.\n\nIf `ask` is not registered — subagent, headless, or `-p` print runs, where `hasUI` is false —\nthe MUST above cannot be satisfied: do not fabricate the call and do not stall on it. Take the\nconservative reversible option and put the question, plus the assumption you made, in your\nfinal report so whoever spawned you can decide.\n\nNEVER use `ask` for:\n- Permission to begin, or to confirm scope already stated in the request.\n- Anything a tool, grep, or doc can answer — go read it.\n- A cheap reversible choice — take the conservative option and say which you took.\n- Something already answered earlier in the conversation.\n\nBatch every open question into one `ask` call with multiple questions; do not serialize\nround trips. Being overruled ends the discussion — execute my call without relitigating.\n\n## Removing files\n\nTo remove, use the trash or a command that checks the path.\n\n- To remove a temporary file or directory, use the `scratch_remove` tool or run `docks-kit scratch remove <path>`. Both remove only a path inside the scratch root, the system temporary directory, or `/var/tmp`. `gio trash` does not work on a `tmpfs` `/tmp`.\n- To remove any other file or directory, run `gio trash -- <path>` on Linux or `trash <path>` on macOS.\n- To remove a path from the git index, run `git rm -- <path>`.\n- To remove a worktree, run `git worktree remove -- <path>`.\n- If git refuses because the worktree has changes, make sure that each of its commits is on the remote. Then make sure that `git status --porcelain` lists only generated files. Then run `git worktree remove --force -- <path>`.\n- Never pass `--force` two times to `git worktree remove`.\n- Write the `--` exactly as shown.\n- Do not use `rm`. omp denies a recursive `rm`, `find -delete`, `find -exec rm`, and `xargs rm`.\n- Do not delete files through `eval`, Python, or Node code.\n- A subagent cannot get my approval, so omp rejects every ask in a subagent.\n- Do not delete in bulk yourself (`git clean`, `git reset --hard`). In the main session, ask me first.\n- If a deletion needs `rm -r` or a bulk command, put the paths in your report. I run that deletion myself.\n- Do not use `--force`, `-f`, or an abbreviation of it with `git rm` or `git push`.\n- Write each ref of a `git push` command as literal text. Run `git push` as its own command. omp denies a command that holds a `$` or a backtick after `git push`.\n- To push the current branch, run `git push -u origin HEAD`. To delete several remote branches, list them in one command: `git push origin --delete <branch-a> <branch-b>`.\n- Write literal absolute paths. Do not use `~` or `$HOME` in a command.\n- Do not set or export `HOME`.\n\n## Repository hooks\n\n- Do not skip or turn off a repository hook. Do not use `--no-verify`, `git commit -n`, `git am -n`, or a `core.hooksPath` change.\n- When a hook fails on a problem that your change did not cause, report the failure. In the main session, ask me before you continue.\n\n## Cleaning up what you create\n\n- Follow the `workspace-hygiene` skill for each resource that you create: worktrees, temporary files and directories, processes, containers, clusters, tunnels, scheduled jobs, global installs, and remote test resources.\n- Create a temporary directory with the `scratch_new` tool or `docks-kit scratch new <label>`. Put each temporary file in that directory. Do not put a temporary file, a temporary directory, a package store, a cache, or a clone in `/tmp`.\n- Create a worktree only at `<data>/agent-worktrees/<repository>/<name>`. `<data>` is `$XDG_DATA_HOME`, or `.local/share` in the home directory when that variable is not set. Write the literal absolute path.\n- Run a test suite in single-run mode. Start a server, a watcher, a tunnel, or a database only as a named bash service or an async job. Do not detach a process with `nohup`, `setsid`, `disown`, `tmux`, or `screen`.\n- Do not install a package globally, add a scheduled job, or enable a service unless I ask for it.\n- Do not remove a Docker volume, image, or build cache that you did not create, and do not run `docker system prune`.\n- Before your final answer, remove each resource that you created and that the task no longer needs. Keep a resource only when I ask for it or a later step needs it, and name it in your final answer.\n- A scratch directory is deleted after 7 idle days. Put evidence that you cite in the issue, the pull request, or the repository.\n- Resources on this workstation are always development. A remote resource is one that you reach through SSH or a provider CLI, such as `wrangler`, `vercel`, `netlify`, `fly`, `supabase`, `kubectl`, or a remote Docker host.\n- Clean up a remote resource only when its target is named local, development, dev, test, homolog, homologation, staging, or preview. Every other target is production. For example, `wrangler delete` without `--env` acts on the top-level Worker, which is usually production.\n- Never stop, remove, undeploy, or delete a production resource without an `ask` immediately before it. A production cleanup must be rare. A `yolo` invocation does not answer this ask. In a subagent, do not do it; name the resource in your report.\n\n## Output Standard\n\nApply Simplified Technical English to all agent text. This includes responses, messages,\ndocumentation, comments, and interface text.\n\nReply in the language I use, and apply every rule below to that language.\n\nA rule that names English grammar applies only to English. The contraction ban is one\nsuch rule. In another language, follow the normal grammar of that language. Portuguese,\nSpanish, French, Italian, and German merge a preposition with an article, and that merge\nis required, not optional.\n\nTreat the word limits as approximate outside English.\n\n- Use the simplest precise technical term.\n- Use each term consistently.\n- Expand an abbreviation at its first occurrence.\n- Explain a technical term when I ask for an explanation.\n- Write complete and grammatically correct sentences.\n- Use active voice and identify the actor.\n- Use the imperative form for instructions.\n- Put only one action in each instruction sentence.\n- Put a necessary condition before its instruction.\n- Use simple verb tenses.\n- Do not use contractions, idioms, or slang. Avoid humor and rhetorical questions.\n- Keep procedural sentences to 20 words or fewer.\n- Keep descriptive sentences to 25 words or fewer.\n- Keep each paragraph to one topic and six sentences or fewer.\n- Do not use more than three nouns together.\n- Use vertical lists for complex information.\n- Put a warning or caution before a related hazardous instruction.\n\n### Naming\n\n- Say what the thing does before you name it. Put the technical term after the plain\n description, once, in parentheses.\n- Do not use a technical term as the only name for something you just introduced.\n- Prefer the short common word. Use \"use\", not \"utilize\". Use \"set up\", not \"provision\".\n- Do not explain by metaphor alone. A metaphor may follow a literal statement.\n",
21
- "SoT/.omp/config.yml": "statusLine:\n compactThinkingLevel: false\n\ncycleOrder:\n - smol\n - default\n - slow\n - fable\n - astra\n\ngithub:\n enabled: true\n\nfind:\n enabled: true\n\nbrowser:\n idleCloseSec: 600\n\ntask:\n eager: always\n showResolvedModelBadge: true\n enableLsp: true\n maxEffort: xhigh\n maxConcurrency: 16\n maxRuntimeMs: 3600000\n agentIdleTtlMs: 120000\n agentModelOverrides:\n reviewer: \"@reviewer\"\n security-reviewer: \"@reviewer\"\n code-reviewer: \"@reviewer\"\n plan-reviewer: \"@reviewer\"\n agentServiceTierOverrides:\n reviewer: inherit\n security-reviewer: inherit\n code-reviewer: inherit\n plan-reviewer: inherit\n\nmodelRoles:\n smol: openai-codex/gpt-6-luna:medium\n designer: anthropic/claude-opus-5-5:high\n plan: anthropic/claude-opus-5-5:xhigh\n commit: openai-codex/gpt-6-luna:medium\n task: anthropic/claude-opus-5-5:high\n vision: anthropic/claude-opus-5-5:medium\n tiny: openai-codex/gpt-6-luna:low\n default: anthropic/claude-opus-5-5:high\n slow: anthropic/claude-opus-5-5:xhigh\n fable: anthropic/claude-fable-5-2:medium\n switch_fable: anthropic/claude-fable-5-2:medium\n astra: openai-codex/gpt-6-astra:xhigh\n reviewer: openai-codex/gpt-6.1-terra:high\n web: web/firecrawl\n\nmodelTags:\n fable:\n name: Fable 5.2\n switch_fable:\n name: Fable switch default\n hidden: true\n astra:\n name: GPT-6 Astra\n reviewer:\n name: Reviewer\n hidden: true\n\ndisplay:\n showTokenUsage: true\n\nproviders:\n webSearchTimeoutSeconds: 30\n\nretry:\n fallbackChains:\n default:\n - openai-codex/gpt-6.1-sol:high\n task:\n - openai-codex/gpt-6.1-sol:high\n vision:\n - openai-codex/gpt-6.1-sol:medium\n smol:\n - anthropic/claude-opus-5-5:low\n tiny:\n - anthropic/claude-opus-5-5:low\n commit:\n - anthropic/claude-opus-5-5:medium\n switch_fable: []\n fable:\n - openai-codex/gpt-6-astra:xhigh\n astra:\n - anthropic/claude-fable-5-2:medium\n reviewer:\n - anthropic/claude-opus-5-5:high\n web:\n - web/exa\n - web/perplexity\n - openai-codex/gpt-6-luna\n - web/parallel\n - web/zai\n - web/tinyfish\n - web/jina\n - web/kagi\n - web/tavily\n - web/brave\n - web/kimi\n - web/synthetic\n - web/ollama\n - web/searxng\n - web/startpage\n - web/duckduckgo\n - web/ecosia\n - web/google\n - web/mojeek\n - web/public\n\nbranchSummary:\n enabled: true\n\ncommands:\n enableOpencodeProject: false\n\nsteeringMode: all\n\ndev:\n autoqa: false\n autoqaConsent: denied\n\ncompaction:\n idleEnabled: true\n handoffSaveToDisk: true\n\ndoubleEscapeAction: tree\n\nfeatures:\n unexpectedStopDetection: smart\n\ncodexResets:\n autoRedeem5h: \"no\"\n autoRedeemWeekly: \"no\"\n\nstartup:\n quiet: true\n\nbash:\n # First match wins. omp checks deny rules against the whole line and each\n # quote-stripped segment, so `rm -rf \"$HOME\"` matches `rm * $HOME`. `*`\n # matches any text, spaces and slashes included; no escape spells a literal\n # `*`.\n # The kit ships no prompt rule, because a subagent rejects every prompt.\n # A command that no deny rule matches runs under yolo, unless a prompt rule\n # that the user added matches it: a plain rm, git rm, git worktree remove,\n # gio trash, docks-kit scratch remove, git clean, git reset --hard, and\n # every git push that the denies below do not stop.\n # omp's critical-command check turns a prompt into an allow under yolo, so\n # every rm shape it can flag is a deny.\n patterns:\n # Deny: rm of the home directory or the filesystem root, sudo before rm,\n # rm with an r or f option before an absolute path, recursive rm (bare, by\n # path, or after any word such as env, xargs, find -exec, or git), bulk\n # removal through find -delete, find -exec rm, and xargs rm, HOME\n # reassignment, a force push to main or master, and a $ or a backtick\n # after git push.\n - { match: \"rm /\", approval: deny }\n - { match: \"rm / *\", approval: deny }\n - { match: \"rm * /\", approval: deny }\n - { match: \"rm * / *\", approval: deny }\n - { match: \"rm ~\", approval: deny }\n - { match: \"rm ~ *\", approval: deny }\n - { match: \"rm * ~\", approval: deny }\n - { match: \"rm * ~ *\", approval: deny }\n - { match: \"rm ~/\", approval: deny }\n - { match: \"rm ~/ *\", approval: deny }\n - { match: \"rm * ~/\", approval: deny }\n - { match: \"rm * ~/ *\", approval: deny }\n - { match: \"rm $HOME\", approval: deny }\n - { match: \"rm $HOME *\", approval: deny }\n - { match: \"rm * $HOME\", approval: deny }\n - { match: \"rm * $HOME *\", approval: deny }\n - { match: \"rm $HOME/\", approval: deny }\n - { match: \"rm $HOME/ *\", approval: deny }\n - { match: \"rm * $HOME/\", approval: deny }\n - { match: \"rm * $HOME/ *\", approval: deny }\n - { match: \"rm ${HOME}\", approval: deny }\n - { match: \"rm ${HOME} *\", approval: deny }\n - { match: \"rm * ${HOME}\", approval: deny }\n - { match: \"rm * ${HOME} *\", approval: deny }\n - { match: \"rm ${HOME}/\", approval: deny }\n - { match: \"rm ${HOME}/ *\", approval: deny }\n - { match: \"rm * ${HOME}/\", approval: deny }\n - { match: \"rm * ${HOME}/ *\", approval: deny }\n - { match: \"* rm /\", approval: deny }\n - { match: \"* rm / *\", approval: deny }\n - { match: \"* rm * /\", approval: deny }\n - { match: \"* rm * / *\", approval: deny }\n - { match: \"* rm ~\", approval: deny }\n - { match: \"* rm ~ *\", approval: deny }\n - { match: \"* rm * ~\", approval: deny }\n - { match: \"* rm * ~ *\", approval: deny }\n - { match: \"* rm ~/\", approval: deny }\n - { match: \"* rm ~/ *\", approval: deny }\n - { match: \"* rm * ~/\", approval: deny }\n - { match: \"* rm * ~/ *\", approval: deny }\n - { match: \"* rm $HOME\", approval: deny }\n - { match: \"* rm $HOME *\", approval: deny }\n - { match: \"* rm * $HOME\", approval: deny }\n - { match: \"* rm * $HOME *\", approval: deny }\n - { match: \"* rm $HOME/\", approval: deny }\n - { match: \"* rm $HOME/ *\", approval: deny }\n - { match: \"* rm * $HOME/\", approval: deny }\n - { match: \"* rm * $HOME/ *\", approval: deny }\n - { match: \"* rm ${HOME}\", approval: deny }\n - { match: \"* rm ${HOME} *\", approval: deny }\n - { match: \"* rm * ${HOME}\", approval: deny }\n - { match: \"* rm * ${HOME} *\", approval: deny }\n - { match: \"* rm ${HOME}/\", approval: deny }\n - { match: \"* rm ${HOME}/ *\", approval: deny }\n - { match: \"* rm * ${HOME}/\", approval: deny }\n - { match: \"* rm * ${HOME}/ *\", approval: deny }\n - { match: \"*/rm /\", approval: deny }\n - { match: \"*/rm / *\", approval: deny }\n - { match: \"*/rm * /\", approval: deny }\n - { match: \"*/rm * / *\", approval: deny }\n - { match: \"*/rm ~\", approval: deny }\n - { match: \"*/rm ~ *\", approval: deny }\n - { match: \"*/rm * ~\", approval: deny }\n - { match: \"*/rm * ~ *\", approval: deny }\n - { match: \"*/rm ~/\", approval: deny }\n - { match: \"*/rm ~/ *\", approval: deny }\n - { match: \"*/rm * ~/\", approval: deny }\n - { match: \"*/rm * ~/ *\", approval: deny }\n - { match: \"*/rm $HOME\", approval: deny }\n - { match: \"*/rm $HOME *\", approval: deny }\n - { match: \"*/rm * $HOME\", approval: deny }\n - { match: \"*/rm * $HOME *\", approval: deny }\n - { match: \"*/rm $HOME/\", approval: deny }\n - { match: \"*/rm $HOME/ *\", approval: deny }\n - { match: \"*/rm * $HOME/\", approval: deny }\n - { match: \"*/rm * $HOME/ *\", approval: deny }\n - { match: \"*/rm ${HOME}\", approval: deny }\n - { match: \"*/rm ${HOME} *\", approval: deny }\n - { match: \"*/rm * ${HOME}\", approval: deny }\n - { match: \"*/rm * ${HOME} *\", approval: deny }\n - { match: \"*/rm ${HOME}/\", approval: deny }\n - { match: \"*/rm ${HOME}/ *\", approval: deny }\n - { match: \"*/rm * ${HOME}/\", approval: deny }\n - { match: \"*/rm * ${HOME}/ *\", approval: deny }\n - { match: \"sudo rm\", approval: deny }\n - { match: \"sudo rm *\", approval: deny }\n - { match: \"sudo * rm\", approval: deny }\n - { match: \"sudo * rm *\", approval: deny }\n - { match: \"sudo */rm\", approval: deny }\n - { match: \"sudo */rm *\", approval: deny }\n - { match: \"* sudo rm\", approval: deny }\n - { match: \"* sudo rm *\", approval: deny }\n - { match: \"* sudo * rm\", approval: deny }\n - { match: \"* sudo * rm *\", approval: deny }\n - { match: \"* sudo */rm\", approval: deny }\n - { match: \"* sudo */rm *\", approval: deny }\n - { match: \"*/sudo rm\", approval: deny }\n - { match: \"*/sudo rm *\", approval: deny }\n - { match: \"*/sudo * rm\", approval: deny }\n - { match: \"*/sudo * rm *\", approval: deny }\n - { match: \"*/sudo */rm\", approval: deny }\n - { match: \"*/sudo */rm *\", approval: deny }\n - { match: \"rm *-*r* /*\", approval: deny }\n - { match: \"rm *-*R* /*\", approval: deny }\n - { match: \"rm *-*f* /*\", approval: deny }\n - { match: \"rm *-*F* /*\", approval: deny }\n - { match: \"rm *--no-preserve-root*\", approval: deny }\n - { match: \"* rm *-*r* /*\", approval: deny }\n - { match: \"* rm *-*R* /*\", approval: deny }\n - { match: \"* rm *-*f* /*\", approval: deny }\n - { match: \"* rm *-*F* /*\", approval: deny }\n - { match: \"* rm *--no-preserve-root*\", approval: deny }\n - { match: \"*/rm *-*r* /*\", approval: deny }\n - { match: \"*/rm *-*R* /*\", approval: deny }\n - { match: \"*/rm *-*f* /*\", approval: deny }\n - { match: \"*/rm *-*F* /*\", approval: deny }\n - { match: \"*/rm *--no-preserve-root*\", approval: deny }\n - { match: \"rm *-r *\", approval: deny }\n - { match: \"rm *-r\", approval: deny }\n - { match: \"rm *-rf *\", approval: deny }\n - { match: \"rm *-rf\", approval: deny }\n - { match: \"rm *-fr *\", approval: deny }\n - { match: \"rm *-fr\", approval: deny }\n - { match: \"rm *-rv *\", approval: deny }\n - { match: \"rm *-rv\", approval: deny }\n - { match: \"rm *-vr *\", approval: deny }\n - { match: \"rm *-vr\", approval: deny }\n - { match: \"rm *-rfv *\", approval: deny }\n - { match: \"rm *-rfv\", approval: deny }\n - { match: \"rm *-rvf *\", approval: deny }\n - { match: \"rm *-rvf\", approval: deny }\n - { match: \"rm *-frv *\", approval: deny }\n - { match: \"rm *-frv\", approval: deny }\n - { match: \"rm *-fvr *\", approval: deny }\n - { match: \"rm *-fvr\", approval: deny }\n - { match: \"rm *-vrf *\", approval: deny }\n - { match: \"rm *-vrf\", approval: deny }\n - { match: \"rm *-vfr *\", approval: deny }\n - { match: \"rm *-vfr\", approval: deny }\n - { match: \"rm *-ri *\", approval: deny }\n - { match: \"rm *-ri\", approval: deny }\n - { match: \"rm *-ir *\", approval: deny }\n - { match: \"rm *-ir\", approval: deny }\n - { match: \"rm *-Ri *\", approval: deny }\n - { match: \"rm *-Ri\", approval: deny }\n - { match: \"rm *-iR *\", approval: deny }\n - { match: \"rm *-iR\", approval: deny }\n - { match: \"rm *-R *\", approval: deny }\n - { match: \"rm *-R\", approval: deny }\n - { match: \"rm *-Rf *\", approval: deny }\n - { match: \"rm *-Rf\", approval: deny }\n - { match: \"rm *-fR *\", approval: deny }\n - { match: \"rm *-fR\", approval: deny }\n - { match: \"rm *-Rv *\", approval: deny }\n - { match: \"rm *-Rv\", approval: deny }\n - { match: \"rm *-vR *\", approval: deny }\n - { match: \"rm *-vR\", approval: deny }\n - { match: \"rm *-Rfv *\", approval: deny }\n - { match: \"rm *-Rfv\", approval: deny }\n - { match: \"rm *-Rvf *\", approval: deny }\n - { match: \"rm *-Rvf\", approval: deny }\n - { match: \"rm *-fRv *\", approval: deny }\n - { match: \"rm *-fRv\", approval: deny }\n - { match: \"rm *-fvR *\", approval: deny }\n - { match: \"rm *-fvR\", approval: deny }\n - { match: \"rm *-vRf *\", approval: deny }\n - { match: \"rm *-vRf\", approval: deny }\n - { match: \"rm *-vfR *\", approval: deny }\n - { match: \"rm *-vfR\", approval: deny }\n - { match: \"rm *--recursive *\", approval: deny }\n - { match: \"rm *--recursive\", approval: deny }\n - { match: \"*/rm *-r *\", approval: deny }\n - { match: \"*/rm *-r\", approval: deny }\n - { match: \"*/rm *-rf *\", approval: deny }\n - { match: \"*/rm *-rf\", approval: deny }\n - { match: \"*/rm *-fr *\", approval: deny }\n - { match: \"*/rm *-fr\", approval: deny }\n - { match: \"*/rm *-rv *\", approval: deny }\n - { match: \"*/rm *-rv\", approval: deny }\n - { match: \"*/rm *-vr *\", approval: deny }\n - { match: \"*/rm *-vr\", approval: deny }\n - { match: \"*/rm *-rfv *\", approval: deny }\n - { match: \"*/rm *-rfv\", approval: deny }\n - { match: \"*/rm *-rvf *\", approval: deny }\n - { match: \"*/rm *-rvf\", approval: deny }\n - { match: \"*/rm *-frv *\", approval: deny }\n - { match: \"*/rm *-frv\", approval: deny }\n - { match: \"*/rm *-fvr *\", approval: deny }\n - { match: \"*/rm *-fvr\", approval: deny }\n - { match: \"*/rm *-vrf *\", approval: deny }\n - { match: \"*/rm *-vrf\", approval: deny }\n - { match: \"*/rm *-vfr *\", approval: deny }\n - { match: \"*/rm *-vfr\", approval: deny }\n - { match: \"*/rm *-ri *\", approval: deny }\n - { match: \"*/rm *-ri\", approval: deny }\n - { match: \"*/rm *-ir *\", approval: deny }\n - { match: \"*/rm *-ir\", approval: deny }\n - { match: \"*/rm *-Ri *\", approval: deny }\n - { match: \"*/rm *-Ri\", approval: deny }\n - { match: \"*/rm *-iR *\", approval: deny }\n - { match: \"*/rm *-iR\", approval: deny }\n - { match: \"*/rm *-R *\", approval: deny }\n - { match: \"*/rm *-R\", approval: deny }\n - { match: \"*/rm *-Rf *\", approval: deny }\n - { match: \"*/rm *-Rf\", approval: deny }\n - { match: \"*/rm *-fR *\", approval: deny }\n - { match: \"*/rm *-fR\", approval: deny }\n - { match: \"*/rm *-Rv *\", approval: deny }\n - { match: \"*/rm *-Rv\", approval: deny }\n - { match: \"*/rm *-vR *\", approval: deny }\n - { match: \"*/rm *-vR\", approval: deny }\n - { match: \"*/rm *-Rfv *\", approval: deny }\n - { match: \"*/rm *-Rfv\", approval: deny }\n - { match: \"*/rm *-Rvf *\", approval: deny }\n - { match: \"*/rm *-Rvf\", approval: deny }\n - { match: \"*/rm *-fRv *\", approval: deny }\n - { match: \"*/rm *-fRv\", approval: deny }\n - { match: \"*/rm *-fvR *\", approval: deny }\n - { match: \"*/rm *-fvR\", approval: deny }\n - { match: \"*/rm *-vRf *\", approval: deny }\n - { match: \"*/rm *-vRf\", approval: deny }\n - { match: \"*/rm *-vfR *\", approval: deny }\n - { match: \"*/rm *-vfR\", approval: deny }\n - { match: \"*/rm *--recursive *\", approval: deny }\n - { match: \"*/rm *--recursive\", approval: deny }\n - { match: \"* rm *-r *\", approval: deny }\n - { match: \"* rm *-r\", approval: deny }\n - { match: \"* rm *-rf *\", approval: deny }\n - { match: \"* rm *-rf\", approval: deny }\n - { match: \"* rm *-fr *\", approval: deny }\n - { match: \"* rm *-fr\", approval: deny }\n - { match: \"* rm *-rv *\", approval: deny }\n - { match: \"* rm *-rv\", approval: deny }\n - { match: \"* rm *-vr *\", approval: deny }\n - { match: \"* rm *-vr\", approval: deny }\n - { match: \"* rm *-rfv *\", approval: deny }\n - { match: \"* rm *-rfv\", approval: deny }\n - { match: \"* rm *-rvf *\", approval: deny }\n - { match: \"* rm *-rvf\", approval: deny }\n - { match: \"* rm *-frv *\", approval: deny }\n - { match: \"* rm *-frv\", approval: deny }\n - { match: \"* rm *-fvr *\", approval: deny }\n - { match: \"* rm *-fvr\", approval: deny }\n - { match: \"* rm *-vrf *\", approval: deny }\n - { match: \"* rm *-vrf\", approval: deny }\n - { match: \"* rm *-vfr *\", approval: deny }\n - { match: \"* rm *-vfr\", approval: deny }\n - { match: \"* rm *-R *\", approval: deny }\n - { match: \"* rm *-R\", approval: deny }\n - { match: \"* rm *-ri *\", approval: deny }\n - { match: \"* rm *-ri\", approval: deny }\n - { match: \"* rm *-ir *\", approval: deny }\n - { match: \"* rm *-ir\", approval: deny }\n - { match: \"* rm *-Ri *\", approval: deny }\n - { match: \"* rm *-Ri\", approval: deny }\n - { match: \"* rm *-iR *\", approval: deny }\n - { match: \"* rm *-iR\", approval: deny }\n - { match: \"* rm *-Rf *\", approval: deny }\n - { match: \"* rm *-Rf\", approval: deny }\n - { match: \"* rm *-fR *\", approval: deny }\n - { match: \"* rm *-fR\", approval: deny }\n - { match: \"* rm *-Rv *\", approval: deny }\n - { match: \"* rm *-Rv\", approval: deny }\n - { match: \"* rm *-vR *\", approval: deny }\n - { match: \"* rm *-vR\", approval: deny }\n - { match: \"* rm *-Rfv *\", approval: deny }\n - { match: \"* rm *-Rfv\", approval: deny }\n - { match: \"* rm *-Rvf *\", approval: deny }\n - { match: \"* rm *-Rvf\", approval: deny }\n - { match: \"* rm *-fRv *\", approval: deny }\n - { match: \"* rm *-fRv\", approval: deny }\n - { match: \"* rm *-fvR *\", approval: deny }\n - { match: \"* rm *-fvR\", approval: deny }\n - { match: \"* rm *-vRf *\", approval: deny }\n - { match: \"* rm *-vRf\", approval: deny }\n - { match: \"* rm *-vfR *\", approval: deny }\n - { match: \"* rm *-vfR\", approval: deny }\n - { match: \"* rm *--recursive *\", approval: deny }\n - { match: \"* rm *--recursive\", approval: deny }\n # Bulk removal: find -delete, find -exec rm, and xargs rm, in every position.\n - { match: \"find *-delete*\", approval: deny }\n - { match: \"*/find *-delete*\", approval: deny }\n - { match: \"* find *-delete*\", approval: deny }\n - { match: \"*-exec rm *\", approval: deny }\n - { match: \"*-exec */rm *\", approval: deny }\n - { match: \"*-execdir rm *\", approval: deny }\n - { match: \"*-execdir */rm *\", approval: deny }\n - { match: \"*-ok rm *\", approval: deny }\n - { match: \"*-ok */rm *\", approval: deny }\n - { match: \"*-okdir rm *\", approval: deny }\n - { match: \"*-okdir */rm *\", approval: deny }\n - { match: \"*xargs rm\", approval: deny }\n - { match: \"*xargs rm *\", approval: deny }\n - { match: \"*xargs * rm\", approval: deny }\n - { match: \"*xargs * rm *\", approval: deny }\n - { match: \"*xargs */rm\", approval: deny }\n - { match: \"*xargs */rm *\", approval: deny }\n - { match: \"HOME=*\", approval: deny }\n - { match: \"export HOME=*\", approval: deny }\n - { match: \"env HOME=*\", approval: deny }\n - { match: \"env * HOME=*\", approval: deny }\n - { match: \"git push --force origin main\", approval: deny }\n - { match: \"git push --force origin main *\", approval: deny }\n - { match: \"git push --force origin master\", approval: deny }\n - { match: \"git push --force origin master *\", approval: deny }\n - { match: \"git push -f origin main\", approval: deny }\n - { match: \"git push -f origin main *\", approval: deny }\n - { match: \"git push -f origin master\", approval: deny }\n - { match: \"git push -f origin master *\", approval: deny }\n # A $ or a backtick anywhere after git push: the matcher reads the text\n # before the shell expands it, so it cannot tell a branch name from +main\n # or --force. An unquoted value inside a word also splits into more words.\n # A deny, not a prompt: the agent reads the refusal and writes the ref\n # literally (git push -u origin HEAD). No person is asked.\n # The leading * also reaches a git push after a shell keyword such as do,\n # after a wrapper such as env, and after a path such as /usr/bin/git.\n - { match: \"*git push *$*\", approval: deny }\n - { match: \"*git push *`*\", approval: deny }\n # Allow: the macOS trash command.\n - { match: \"trash *\", approval: allow }\n",
20
+ "SoT/.omp/AGENTS.md": "# Global OMP guidance\n\n- Verify an unfamiliar or version-sensitive API or configuration against current official documentation before you use it.\n- When I ask for an assessment, report the findings and do not edit.\n- Docks plan reviews have standing cross-company authorization. Host security policy still applies.\n- Please remove all mannered prose.\n\n## Asking me things\n\nAsk me only through `ask`, never in prose. Use `ask` before these steps:\n\n- An irreversible or outward action: delete or overwrite data that you did not create, force-push, rewrite history, drop tables, run migrations, rename in bulk, touch secrets, or publish a release, upstream PR, issue, or comment.\n- A choice between viable approaches whose tradeoffs I own: a schema, API, or protocol shape, a new dependency, or a new convention.\n- A fact that only I hold, or a request that contradicts the repository. Show the conflict.\n- A feature that the current structure cannot hold without a refactor. Propose the refactor before you write the feature.\n- A repository hook that fails on a problem that your change did not cause. Do not skip the hook.\n- A stop, removal, undeploy, or delete of a production resource, immediately before it. Keep such cleanups rare. A remote target is production unless it is named local, development, dev, test, homolog, homologation, staging, or preview.\n\nA settled plan Mode covers the routine plan-lifecycle writes in the resolved repository: the plan issue, plan edits, review comments, and each other issue or comment that the plan-lifecycle contract requires. A `plan-and-implement` Mode also covers the landing work: the push of the linked branch and the pull request. Every other issue, comment, release, or upstream pull request still needs an ask.\n\nA `yolo` invocation answers the routine asks of its plan run until its merge question, or until the grant check of the plan-lifecycle contract finds that its grant has ended. It does not cover destructive work, secrets, production systems, or a repository hook that fails; for a failed hook, follow the hook rule of the plan-lifecycle contract.\n\nA plan grant answers the asks that the Delegated decisions section of the plan-lifecycle contract lists as answered. Only trusted `Delegation grant:` and `Delegation revoked` comments give or end a grant. On the plan issue, the latest such comment decides, and a comment on a parent plan can end the grant of its child. The `Delegated:` line of the plan only mirrors that comment.\n\nA grant never answers a question that the contract keeps for me. Examples are the Mode, a non-local effect, the merge, a destructive action, secrets, production, a temporary workaround, and a fact that only I hold. Right before each delegated decision and each write that relies on the grant, run the grant check of the contract: read the latest authority comments of the plan and of its parent.\n\nWhen `ask` is not available, take the conservative reversible option. Put the question and your assumption in the final report.\n\n## Cleanup\n\nBefore your final answer, remove each resource that you created and that the task no longer needs. Follow the `workspace-hygiene` skill. Name each resource that you keep.\n\n## Output\n\n- Write Simplified Technical English in responses, documentation, comments, and interface text. Reply in my language.\n- Use the simplest precise term, and use it consistently. Expand an abbreviation at its first use. Explain a term when I ask.\n- Write complete sentences in active voice and simple tenses. In instructions, use the imperative, one action per sentence, and the condition first.\n- Do not use contractions, idioms, slang, humor, or rhetorical questions. Do not put more than three nouns together.\n- Keep procedural sentences to 20 words, descriptive sentences to 25 words, and paragraphs to one topic and six sentences.\n- Use vertical lists for complex information. Put a warning before its hazardous instruction.\n- Describe a thing in plain words before you name it. Give the term once, in parentheses. Prefer the short common word. Do not explain by metaphor alone.\n- Apply these rules in the language of the reply. The contraction ban applies only to English; elsewhere, follow the grammar of that language, and treat the word limits as approximate. For example, Portuguese \"do\" (de + o) and \"na\" (em + a) are required.\n",
21
+ "SoT/.omp/config.yml": "statusLine:\n compactThinkingLevel: false\n\ncycleOrder:\n - smol\n - default\n - slow\n - fable\n - astra\n\ngithub:\n enabled: true\n\nfind:\n enabled: true\n\nbrowser:\n idleCloseSec: 600\n\ntask:\n eager: always\n showResolvedModelBadge: true\n enableLsp: true\n maxEffort: xhigh\n maxConcurrency: 16\n maxRuntimeMs: 3600000\n agentIdleTtlMs: 120000\n agentModelOverrides:\n reviewer: \"@reviewer\"\n security-reviewer: \"@reviewer\"\n code-reviewer: \"@reviewer\"\n plan-reviewer: \"@reviewer\"\n agentServiceTierOverrides:\n reviewer: inherit\n security-reviewer: inherit\n code-reviewer: inherit\n plan-reviewer: inherit\n\nmodelRoles:\n smol: openai-codex/gpt-6-luna:medium\n designer: anthropic/claude-opus-5-5:high\n plan: anthropic/claude-opus-5-5:xhigh\n commit: openai-codex/gpt-6-luna:medium\n task: anthropic/claude-opus-5-5:high\n vision: anthropic/claude-opus-5-5:medium\n tiny: openai-codex/gpt-6-luna:low\n default: anthropic/claude-opus-5-5:high\n slow: anthropic/claude-opus-5-5:xhigh\n fable: anthropic/claude-fable-5-2:medium\n switch_fable: anthropic/claude-fable-5-2:medium\n astra: openai-codex/gpt-6.2-astra:xhigh\n reviewer: openai-codex/gpt-6.1-terra:high\n web: web/firecrawl\n\nmodelTags:\n fable:\n name: Fable 5.2\n switch_fable:\n name: Fable switch default\n hidden: true\n astra:\n name: GPT-6.2 Astra\n reviewer:\n name: Reviewer\n hidden: true\n\ndisplay:\n showTokenUsage: true\n\nproviders:\n webSearchTimeoutSeconds: 30\n\nretry:\n fallbackChains:\n default:\n - openai-codex/gpt-6.2-sol:high\n task:\n - openai-codex/gpt-6.2-sol:high\n vision:\n - openai-codex/gpt-6.2-sol:medium\n smol:\n - anthropic/claude-opus-5-5:low\n tiny:\n - anthropic/claude-opus-5-5:low\n commit:\n - anthropic/claude-opus-5-5:medium\n switch_fable: []\n fable:\n - openai-codex/gpt-6.2-astra:xhigh\n astra:\n - anthropic/claude-fable-5-2:medium\n reviewer:\n - anthropic/claude-opus-5-5:high\n web:\n - web/exa\n - web/perplexity\n - openai-codex/gpt-6-luna\n - web/parallel\n - web/zai\n - web/tinyfish\n - web/jina\n - web/kagi\n - web/tavily\n - web/brave\n - web/kimi\n - web/synthetic\n - web/ollama\n - web/searxng\n - web/startpage\n - web/duckduckgo\n - web/ecosia\n - web/google\n - web/mojeek\n - web/public\n\nbranchSummary:\n enabled: true\n\ncommands:\n enableOpencodeProject: false\n\nsteeringMode: all\n\ndev:\n autoqa: false\n autoqaConsent: denied\n\ncompaction:\n idleEnabled: true\n handoffSaveToDisk: true\n\ndoubleEscapeAction: tree\n\nfeatures:\n unexpectedStopDetection: smart\n\ncodexResets:\n autoRedeem5h: \"no\"\n autoRedeemWeekly: \"no\"\n\nstartup:\n quiet: true\n\nbash:\n # First match wins. omp checks deny rules against the whole line and each\n # quote-stripped segment, so `rm -rf \"$HOME\"` matches `rm * $HOME`. `*`\n # matches any text, spaces and slashes included; no escape spells a literal\n # `*`.\n # The kit ships no prompt rule, because a subagent rejects every prompt.\n # A command that no deny rule matches runs under yolo, unless a prompt rule\n # that the user added matches it: a plain rm, git rm, git worktree remove,\n # gio trash, docks-kit scratch remove, git clean, git reset --hard, and\n # every git push that the denies below do not stop.\n # omp's critical-command check turns a prompt into an allow under yolo, so\n # every rm shape it can flag is a deny.\n patterns:\n # Deny: rm of the home directory or the filesystem root, sudo before rm,\n # rm with an r or f option before an absolute path, recursive rm (bare, by\n # path, or after any word such as env, xargs, find -exec, or git), bulk\n # removal through find -delete, find -exec rm, and xargs rm, HOME\n # reassignment, a force push to main or master, and a $ or a backtick\n # after git push.\n - { match: \"rm /\", approval: deny }\n - { match: \"rm / *\", approval: deny }\n - { match: \"rm * /\", approval: deny }\n - { match: \"rm * / *\", approval: deny }\n - { match: \"rm ~\", approval: deny }\n - { match: \"rm ~ *\", approval: deny }\n - { match: \"rm * ~\", approval: deny }\n - { match: \"rm * ~ *\", approval: deny }\n - { match: \"rm ~/\", approval: deny }\n - { match: \"rm ~/ *\", approval: deny }\n - { match: \"rm * ~/\", approval: deny }\n - { match: \"rm * ~/ *\", approval: deny }\n - { match: \"rm $HOME\", approval: deny }\n - { match: \"rm $HOME *\", approval: deny }\n - { match: \"rm * $HOME\", approval: deny }\n - { match: \"rm * $HOME *\", approval: deny }\n - { match: \"rm $HOME/\", approval: deny }\n - { match: \"rm $HOME/ *\", approval: deny }\n - { match: \"rm * $HOME/\", approval: deny }\n - { match: \"rm * $HOME/ *\", approval: deny }\n - { match: \"rm ${HOME}\", approval: deny }\n - { match: \"rm ${HOME} *\", approval: deny }\n - { match: \"rm * ${HOME}\", approval: deny }\n - { match: \"rm * ${HOME} *\", approval: deny }\n - { match: \"rm ${HOME}/\", approval: deny }\n - { match: \"rm ${HOME}/ *\", approval: deny }\n - { match: \"rm * ${HOME}/\", approval: deny }\n - { match: \"rm * ${HOME}/ *\", approval: deny }\n - { match: \"* rm /\", approval: deny }\n - { match: \"* rm / *\", approval: deny }\n - { match: \"* rm * /\", approval: deny }\n - { match: \"* rm * / *\", approval: deny }\n - { match: \"* rm ~\", approval: deny }\n - { match: \"* rm ~ *\", approval: deny }\n - { match: \"* rm * ~\", approval: deny }\n - { match: \"* rm * ~ *\", approval: deny }\n - { match: \"* rm ~/\", approval: deny }\n - { match: \"* rm ~/ *\", approval: deny }\n - { match: \"* rm * ~/\", approval: deny }\n - { match: \"* rm * ~/ *\", approval: deny }\n - { match: \"* rm $HOME\", approval: deny }\n - { match: \"* rm $HOME *\", approval: deny }\n - { match: \"* rm * $HOME\", approval: deny }\n - { match: \"* rm * $HOME *\", approval: deny }\n - { match: \"* rm $HOME/\", approval: deny }\n - { match: \"* rm $HOME/ *\", approval: deny }\n - { match: \"* rm * $HOME/\", approval: deny }\n - { match: \"* rm * $HOME/ *\", approval: deny }\n - { match: \"* rm ${HOME}\", approval: deny }\n - { match: \"* rm ${HOME} *\", approval: deny }\n - { match: \"* rm * ${HOME}\", approval: deny }\n - { match: \"* rm * ${HOME} *\", approval: deny }\n - { match: \"* rm ${HOME}/\", approval: deny }\n - { match: \"* rm ${HOME}/ *\", approval: deny }\n - { match: \"* rm * ${HOME}/\", approval: deny }\n - { match: \"* rm * ${HOME}/ *\", approval: deny }\n - { match: \"*/rm /\", approval: deny }\n - { match: \"*/rm / *\", approval: deny }\n - { match: \"*/rm * /\", approval: deny }\n - { match: \"*/rm * / *\", approval: deny }\n - { match: \"*/rm ~\", approval: deny }\n - { match: \"*/rm ~ *\", approval: deny }\n - { match: \"*/rm * ~\", approval: deny }\n - { match: \"*/rm * ~ *\", approval: deny }\n - { match: \"*/rm ~/\", approval: deny }\n - { match: \"*/rm ~/ *\", approval: deny }\n - { match: \"*/rm * ~/\", approval: deny }\n - { match: \"*/rm * ~/ *\", approval: deny }\n - { match: \"*/rm $HOME\", approval: deny }\n - { match: \"*/rm $HOME *\", approval: deny }\n - { match: \"*/rm * $HOME\", approval: deny }\n - { match: \"*/rm * $HOME *\", approval: deny }\n - { match: \"*/rm $HOME/\", approval: deny }\n - { match: \"*/rm $HOME/ *\", approval: deny }\n - { match: \"*/rm * $HOME/\", approval: deny }\n - { match: \"*/rm * $HOME/ *\", approval: deny }\n - { match: \"*/rm ${HOME}\", approval: deny }\n - { match: \"*/rm ${HOME} *\", approval: deny }\n - { match: \"*/rm * ${HOME}\", approval: deny }\n - { match: \"*/rm * ${HOME} *\", approval: deny }\n - { match: \"*/rm ${HOME}/\", approval: deny }\n - { match: \"*/rm ${HOME}/ *\", approval: deny }\n - { match: \"*/rm * ${HOME}/\", approval: deny }\n - { match: \"*/rm * ${HOME}/ *\", approval: deny }\n - { match: \"sudo rm\", approval: deny }\n - { match: \"sudo rm *\", approval: deny }\n - { match: \"sudo * rm\", approval: deny }\n - { match: \"sudo * rm *\", approval: deny }\n - { match: \"sudo */rm\", approval: deny }\n - { match: \"sudo */rm *\", approval: deny }\n - { match: \"* sudo rm\", approval: deny }\n - { match: \"* sudo rm *\", approval: deny }\n - { match: \"* sudo * rm\", approval: deny }\n - { match: \"* sudo * rm *\", approval: deny }\n - { match: \"* sudo */rm\", approval: deny }\n - { match: \"* sudo */rm *\", approval: deny }\n - { match: \"*/sudo rm\", approval: deny }\n - { match: \"*/sudo rm *\", approval: deny }\n - { match: \"*/sudo * rm\", approval: deny }\n - { match: \"*/sudo * rm *\", approval: deny }\n - { match: \"*/sudo */rm\", approval: deny }\n - { match: \"*/sudo */rm *\", approval: deny }\n - { match: \"rm *-*r* /*\", approval: deny }\n - { match: \"rm *-*R* /*\", approval: deny }\n - { match: \"rm *-*f* /*\", approval: deny }\n - { match: \"rm *-*F* /*\", approval: deny }\n - { match: \"rm *--no-preserve-root*\", approval: deny }\n - { match: \"* rm *-*r* /*\", approval: deny }\n - { match: \"* rm *-*R* /*\", approval: deny }\n - { match: \"* rm *-*f* /*\", approval: deny }\n - { match: \"* rm *-*F* /*\", approval: deny }\n - { match: \"* rm *--no-preserve-root*\", approval: deny }\n - { match: \"*/rm *-*r* /*\", approval: deny }\n - { match: \"*/rm *-*R* /*\", approval: deny }\n - { match: \"*/rm *-*f* /*\", approval: deny }\n - { match: \"*/rm *-*F* /*\", approval: deny }\n - { match: \"*/rm *--no-preserve-root*\", approval: deny }\n - { match: \"rm *-r *\", approval: deny }\n - { match: \"rm *-r\", approval: deny }\n - { match: \"rm *-rf *\", approval: deny }\n - { match: \"rm *-rf\", approval: deny }\n - { match: \"rm *-fr *\", approval: deny }\n - { match: \"rm *-fr\", approval: deny }\n - { match: \"rm *-rv *\", approval: deny }\n - { match: \"rm *-rv\", approval: deny }\n - { match: \"rm *-vr *\", approval: deny }\n - { match: \"rm *-vr\", approval: deny }\n - { match: \"rm *-rfv *\", approval: deny }\n - { match: \"rm *-rfv\", approval: deny }\n - { match: \"rm *-rvf *\", approval: deny }\n - { match: \"rm *-rvf\", approval: deny }\n - { match: \"rm *-frv *\", approval: deny }\n - { match: \"rm *-frv\", approval: deny }\n - { match: \"rm *-fvr *\", approval: deny }\n - { match: \"rm *-fvr\", approval: deny }\n - { match: \"rm *-vrf *\", approval: deny }\n - { match: \"rm *-vrf\", approval: deny }\n - { match: \"rm *-vfr *\", approval: deny }\n - { match: \"rm *-vfr\", approval: deny }\n - { match: \"rm *-ri *\", approval: deny }\n - { match: \"rm *-ri\", approval: deny }\n - { match: \"rm *-ir *\", approval: deny }\n - { match: \"rm *-ir\", approval: deny }\n - { match: \"rm *-Ri *\", approval: deny }\n - { match: \"rm *-Ri\", approval: deny }\n - { match: \"rm *-iR *\", approval: deny }\n - { match: \"rm *-iR\", approval: deny }\n - { match: \"rm *-R *\", approval: deny }\n - { match: \"rm *-R\", approval: deny }\n - { match: \"rm *-Rf *\", approval: deny }\n - { match: \"rm *-Rf\", approval: deny }\n - { match: \"rm *-fR *\", approval: deny }\n - { match: \"rm *-fR\", approval: deny }\n - { match: \"rm *-Rv *\", approval: deny }\n - { match: \"rm *-Rv\", approval: deny }\n - { match: \"rm *-vR *\", approval: deny }\n - { match: \"rm *-vR\", approval: deny }\n - { match: \"rm *-Rfv *\", approval: deny }\n - { match: \"rm *-Rfv\", approval: deny }\n - { match: \"rm *-Rvf *\", approval: deny }\n - { match: \"rm *-Rvf\", approval: deny }\n - { match: \"rm *-fRv *\", approval: deny }\n - { match: \"rm *-fRv\", approval: deny }\n - { match: \"rm *-fvR *\", approval: deny }\n - { match: \"rm *-fvR\", approval: deny }\n - { match: \"rm *-vRf *\", approval: deny }\n - { match: \"rm *-vRf\", approval: deny }\n - { match: \"rm *-vfR *\", approval: deny }\n - { match: \"rm *-vfR\", approval: deny }\n - { match: \"rm *--recursive *\", approval: deny }\n - { match: \"rm *--recursive\", approval: deny }\n - { match: \"*/rm *-r *\", approval: deny }\n - { match: \"*/rm *-r\", approval: deny }\n - { match: \"*/rm *-rf *\", approval: deny }\n - { match: \"*/rm *-rf\", approval: deny }\n - { match: \"*/rm *-fr *\", approval: deny }\n - { match: \"*/rm *-fr\", approval: deny }\n - { match: \"*/rm *-rv *\", approval: deny }\n - { match: \"*/rm *-rv\", approval: deny }\n - { match: \"*/rm *-vr *\", approval: deny }\n - { match: \"*/rm *-vr\", approval: deny }\n - { match: \"*/rm *-rfv *\", approval: deny }\n - { match: \"*/rm *-rfv\", approval: deny }\n - { match: \"*/rm *-rvf *\", approval: deny }\n - { match: \"*/rm *-rvf\", approval: deny }\n - { match: \"*/rm *-frv *\", approval: deny }\n - { match: \"*/rm *-frv\", approval: deny }\n - { match: \"*/rm *-fvr *\", approval: deny }\n - { match: \"*/rm *-fvr\", approval: deny }\n - { match: \"*/rm *-vrf *\", approval: deny }\n - { match: \"*/rm *-vrf\", approval: deny }\n - { match: \"*/rm *-vfr *\", approval: deny }\n - { match: \"*/rm *-vfr\", approval: deny }\n - { match: \"*/rm *-ri *\", approval: deny }\n - { match: \"*/rm *-ri\", approval: deny }\n - { match: \"*/rm *-ir *\", approval: deny }\n - { match: \"*/rm *-ir\", approval: deny }\n - { match: \"*/rm *-Ri *\", approval: deny }\n - { match: \"*/rm *-Ri\", approval: deny }\n - { match: \"*/rm *-iR *\", approval: deny }\n - { match: \"*/rm *-iR\", approval: deny }\n - { match: \"*/rm *-R *\", approval: deny }\n - { match: \"*/rm *-R\", approval: deny }\n - { match: \"*/rm *-Rf *\", approval: deny }\n - { match: \"*/rm *-Rf\", approval: deny }\n - { match: \"*/rm *-fR *\", approval: deny }\n - { match: \"*/rm *-fR\", approval: deny }\n - { match: \"*/rm *-Rv *\", approval: deny }\n - { match: \"*/rm *-Rv\", approval: deny }\n - { match: \"*/rm *-vR *\", approval: deny }\n - { match: \"*/rm *-vR\", approval: deny }\n - { match: \"*/rm *-Rfv *\", approval: deny }\n - { match: \"*/rm *-Rfv\", approval: deny }\n - { match: \"*/rm *-Rvf *\", approval: deny }\n - { match: \"*/rm *-Rvf\", approval: deny }\n - { match: \"*/rm *-fRv *\", approval: deny }\n - { match: \"*/rm *-fRv\", approval: deny }\n - { match: \"*/rm *-fvR *\", approval: deny }\n - { match: \"*/rm *-fvR\", approval: deny }\n - { match: \"*/rm *-vRf *\", approval: deny }\n - { match: \"*/rm *-vRf\", approval: deny }\n - { match: \"*/rm *-vfR *\", approval: deny }\n - { match: \"*/rm *-vfR\", approval: deny }\n - { match: \"*/rm *--recursive *\", approval: deny }\n - { match: \"*/rm *--recursive\", approval: deny }\n - { match: \"* rm *-r *\", approval: deny }\n - { match: \"* rm *-r\", approval: deny }\n - { match: \"* rm *-rf *\", approval: deny }\n - { match: \"* rm *-rf\", approval: deny }\n - { match: \"* rm *-fr *\", approval: deny }\n - { match: \"* rm *-fr\", approval: deny }\n - { match: \"* rm *-rv *\", approval: deny }\n - { match: \"* rm *-rv\", approval: deny }\n - { match: \"* rm *-vr *\", approval: deny }\n - { match: \"* rm *-vr\", approval: deny }\n - { match: \"* rm *-rfv *\", approval: deny }\n - { match: \"* rm *-rfv\", approval: deny }\n - { match: \"* rm *-rvf *\", approval: deny }\n - { match: \"* rm *-rvf\", approval: deny }\n - { match: \"* rm *-frv *\", approval: deny }\n - { match: \"* rm *-frv\", approval: deny }\n - { match: \"* rm *-fvr *\", approval: deny }\n - { match: \"* rm *-fvr\", approval: deny }\n - { match: \"* rm *-vrf *\", approval: deny }\n - { match: \"* rm *-vrf\", approval: deny }\n - { match: \"* rm *-vfr *\", approval: deny }\n - { match: \"* rm *-vfr\", approval: deny }\n - { match: \"* rm *-R *\", approval: deny }\n - { match: \"* rm *-R\", approval: deny }\n - { match: \"* rm *-ri *\", approval: deny }\n - { match: \"* rm *-ri\", approval: deny }\n - { match: \"* rm *-ir *\", approval: deny }\n - { match: \"* rm *-ir\", approval: deny }\n - { match: \"* rm *-Ri *\", approval: deny }\n - { match: \"* rm *-Ri\", approval: deny }\n - { match: \"* rm *-iR *\", approval: deny }\n - { match: \"* rm *-iR\", approval: deny }\n - { match: \"* rm *-Rf *\", approval: deny }\n - { match: \"* rm *-Rf\", approval: deny }\n - { match: \"* rm *-fR *\", approval: deny }\n - { match: \"* rm *-fR\", approval: deny }\n - { match: \"* rm *-Rv *\", approval: deny }\n - { match: \"* rm *-Rv\", approval: deny }\n - { match: \"* rm *-vR *\", approval: deny }\n - { match: \"* rm *-vR\", approval: deny }\n - { match: \"* rm *-Rfv *\", approval: deny }\n - { match: \"* rm *-Rfv\", approval: deny }\n - { match: \"* rm *-Rvf *\", approval: deny }\n - { match: \"* rm *-Rvf\", approval: deny }\n - { match: \"* rm *-fRv *\", approval: deny }\n - { match: \"* rm *-fRv\", approval: deny }\n - { match: \"* rm *-fvR *\", approval: deny }\n - { match: \"* rm *-fvR\", approval: deny }\n - { match: \"* rm *-vRf *\", approval: deny }\n - { match: \"* rm *-vRf\", approval: deny }\n - { match: \"* rm *-vfR *\", approval: deny }\n - { match: \"* rm *-vfR\", approval: deny }\n - { match: \"* rm *--recursive *\", approval: deny }\n - { match: \"* rm *--recursive\", approval: deny }\n # Bulk removal: find -delete, find -exec rm, and xargs rm, in every position.\n - { match: \"find *-delete*\", approval: deny }\n - { match: \"*/find *-delete*\", approval: deny }\n - { match: \"* find *-delete*\", approval: deny }\n - { match: \"*-exec rm *\", approval: deny }\n - { match: \"*-exec */rm *\", approval: deny }\n - { match: \"*-execdir rm *\", approval: deny }\n - { match: \"*-execdir */rm *\", approval: deny }\n - { match: \"*-ok rm *\", approval: deny }\n - { match: \"*-ok */rm *\", approval: deny }\n - { match: \"*-okdir rm *\", approval: deny }\n - { match: \"*-okdir */rm *\", approval: deny }\n - { match: \"*xargs rm\", approval: deny }\n - { match: \"*xargs rm *\", approval: deny }\n - { match: \"*xargs * rm\", approval: deny }\n - { match: \"*xargs * rm *\", approval: deny }\n - { match: \"*xargs */rm\", approval: deny }\n - { match: \"*xargs */rm *\", approval: deny }\n - { match: \"HOME=*\", approval: deny }\n - { match: \"export HOME=*\", approval: deny }\n - { match: \"env HOME=*\", approval: deny }\n - { match: \"env * HOME=*\", approval: deny }\n - { match: \"git push --force origin main\", approval: deny }\n - { match: \"git push --force origin main *\", approval: deny }\n - { match: \"git push --force origin master\", approval: deny }\n - { match: \"git push --force origin master *\", approval: deny }\n - { match: \"git push -f origin main\", approval: deny }\n - { match: \"git push -f origin main *\", approval: deny }\n - { match: \"git push -f origin master\", approval: deny }\n - { match: \"git push -f origin master *\", approval: deny }\n # A $ or a backtick anywhere after git push: the matcher reads the text\n # before the shell expands it, so it cannot tell a branch name from +main\n # or --force. An unquoted value inside a word also splits into more words.\n # A deny, not a prompt: the agent reads the refusal and writes the ref\n # literally (git push -u origin HEAD). No person is asked.\n # The leading * also reaches a git push after a shell keyword such as do,\n # after a wrapper such as env, and after a path such as /usr/bin/git.\n - { match: \"*git push *$*\", approval: deny }\n - { match: \"*git push *`*\", approval: deny }\n # Allow: the macOS trash command.\n - { match: \"trash *\", approval: allow }\n",
22
22
  "SoT/.omp/intercom.json": "{\n \"brokerCommand\": \"bun\",\n \"brokerArgs\": []\n}\n",
23
23
  "SoT/.omp/mcp.json": "{\n \"$schema\": \"https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/src/config/mcp-schema.json\",\n \"disabledServers\": [\n \"chrome-devtools\",\n \"context7:context7\",\n \"openaiDeveloperDocs\"\n ]\n}\n",
24
- "SoT/.omp/models.yml": "providers:\n openai-codex:\n modelOverrides:\n gpt-6-astra:\n thinking:\n mode: effort\n efforts:\n - low\n - medium\n - high\n - xhigh\n - max\n defaultLevel: xhigh\n",
24
+ "SoT/.omp/models.yml": "providers:\n openai-codex:\n modelOverrides:\n gpt-6.2-astra:\n thinking:\n mode: effort\n efforts:\n - low\n - medium\n - high\n - xhigh\n - max\n defaultLevel: xhigh\n",
25
25
  "SoT/.omp/plugin/package.json": "{\n \"name\": \"docks-kit-omp\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"description\": \"docks-kit integration for omp: workspace hygiene tools, reminders, the automatic tidy sweep, and plugin upgrade reminders\",\n \"omp\": { \"extensions\": [\"./extensions/hygiene.ts\", \"./extensions/pluginUpgrades.ts\"] }\n}\n",
26
26
  "SoT/.omp/plugin/extensions/hygiene.ts": "/**\n * docks-kit-omp extension: workspace hygiene for omp sessions.\n *\n * - The tools scratch_new, scratch_remove, and tidy_report run docks-kit.\n * - The tool_result handler records each resource that a bash command\n * creates, and it adds a reminder that names the cleanup command.\n * - The tool_call handler reads the stash list before a `git stash` command,\n * so the tool_result handler can name the stash entry that the command\n * added. The tool_execution_end handler drops the list of a blocked call.\n * - The session_stop handler lists the recorded resources that still exist.\n * - The session_start handler of a main session starts `docks-kit tidy --apply`\n * in the background, at most one time in each sweep interval. When the\n * sweep cannot start, the next tool result of the main session tells why.\n *\n * The module imports only node: modules, so omp loads it without a package\n * install. No subprocess uses a command interpreter, so a tool argument never\n * gets to a shell.\n */\nimport { execFile, spawn } from \"node:child_process\";\nimport { randomBytes, randomUUID } from \"node:crypto\";\nimport {\n accessSync,\n chmodSync,\n closeSync,\n constants,\n existsSync,\n mkdirSync,\n openSync,\n readdirSync,\n readFileSync,\n statSync,\n unlinkSync,\n utimesSync,\n writeFileSync,\n} from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, isAbsolute, join, posix, resolve, win32 } from \"node:path\";\n\n// ------------------------------------------------------------- constants ----\n\nconst SWEEP_INTERVAL_MS = 12 * 60 * 60 * 1000;\nconst CLAIM_STALE_MS = 60 * 1000;\nconst STAMP_FILE = \"tidy.stamp\";\nconst CLAIM_FILE = \"tidy.stamp.claim\";\nconst TAKEOVER_FILE = \"tidy.stamp.takeover\";\nconst DOCKER_CHECK_TIMEOUT_MS = 5000;\nconst GIT_CHECK_TIMEOUT_MS = 5000;\n/** The pre-call stash read delays the command, so it gets a short timeout. */\nconst STASH_SNAPSHOT_TIMEOUT_MS = 1000;\n/** One line for each stash entry: full ID, short ID, and reflog message, split by NUL. */\nconst STASH_LIST_FORMAT = \"--format=%H%x00%h%x00%gs\";\nconst SCRATCH_TIMEOUT_MS = 60_000;\nconst REPORT_TIMEOUT_MS = 120_000;\nconst OUTPUT_LIMIT_BYTES = 16 * 1024 * 1024;\nconst COMMAND_TEXT_LIMIT = 120;\nconst LABEL_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;\nconst LABEL_ERROR = \"label must match ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$\";\nconst NOT_ON_PATH = \"docks-kit is not on PATH; install docks-kit and run docks-kit sync omp\";\n\n/**\n * A bash command that does not match this pattern creates no tracked\n * resource. Each detection rule below has a word in this pattern.\n */\nconst TRIGGER =\n /worktree\\s+add|compose|docker|scratch\\s+new|mktemp|nohup|setsid|disown|&|tmux|screen|ngrok|cloudflared|port-forward|ssh|cluster|minikube|multipass|limactl|machine|colima|crontab|\\bat\\b|systemctl|systemd-run|launchctl|install|(?:^|\\s)-g(?:\\s|$)|global|branches|branch\\s+create|vercel|netlify|wrangler|fly\\s|fork|codespace|stash/;\n\n/** The scope of the top-level command; a subshell scope extends it with `/<n>`. */\nconst ROOT_SCOPE = \"0\";\n\nconst UNRESOLVED = /[$`*]/;\nconst ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/;\nconst VARIABLE_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;\nconst REDIRECT_OPERATOR = /^(?:\\d+|&)?(?:<<<|<<-?|>>|>&|<&|>\\||<>|>|<)$/;\nconst ATTACHED_REDIRECT = /^(?:\\d+|&)?[<>]/;\n/**\n * A word that is one redirection of the standard error alone: `2>&1`, `2>&-`,\n * `2>file`, `2>>file`, or the operator `2>` before its target. A second `<`\n * or `>` in the word is a second redirection. The segment parser splits\n * `2>|file` at the `|`, so that form gives the generic note.\n */\nconst STDERR_REDIRECT = /^2(?:>&(?:\\d+|-)|>>?[^<>]*)$/;\nconst SHORT_CLUSTER_WITH_D = /^-[A-Za-z]*d[A-Za-z]*$/;\n/** The long options of GNU mktemp, which also accepts a unique prefix of each. */\nconst MKTEMP_LONG_OPTIONS: ReadonlyArray<string> = [\n \"--directory\",\n \"--dry-run\",\n \"--quiet\",\n \"--suffix\",\n \"--tmpdir\",\n \"--help\",\n \"--version\",\n];\nconst CONTAINER_ID = /^[0-9a-f]{64}$/;\nconst SAFE_WORD = /^[A-Za-z0-9_/.:@%+=,-]+$/;\nconst RESERVED_WORDS: Record<string, true> = {\n \"{\": true,\n \"}\": true,\n \"!\": true,\n if: true,\n then: true,\n else: true,\n elif: true,\n do: true,\n while: true,\n until: true,\n time: true,\n};\n/**\n * Reserved words of a conditional, a loop, or a function body, where a\n * command may run once, many times, or never. The list holds the closing\n * words too, because a segment can start with one of them.\n */\nconst COMPOUND_WORDS: Record<string, true> = {\n if: true,\n then: true,\n else: true,\n elif: true,\n fi: true,\n for: true,\n select: true,\n while: true,\n until: true,\n do: true,\n done: true,\n case: true,\n esac: true,\n function: true,\n coproc: true,\n};\n/** A shell function name, as in `name()` or `name ()`. */\nconst FUNCTION_NAME = /^[A-Za-z_][A-Za-z0-9_.:-]*$/;\n\nconst GIT_VALUE_OPTIONS: Record<string, true> = { \"-C\": true, \"-c\": true };\nconst WORKTREE_VALUE_OPTIONS: Record<string, true> = { \"-b\": true, \"-B\": true, \"--reason\": true };\n/** Docker global options that select the daemon, mapped to their long names. */\nconst DOCKER_CONNECTION_VALUE_OPTIONS: Record<string, string> = {\n \"-c\": \"--context\",\n \"--context\": \"--context\",\n \"-H\": \"--host\",\n \"--host\": \"--host\",\n \"--config\": \"--config\",\n \"--tlscacert\": \"--tlscacert\",\n \"--tlscert\": \"--tlscert\",\n \"--tlskey\": \"--tlskey\",\n};\nconst DOCKER_CONNECTION_FLAGS: Record<string, true> = { \"--tls\": true, \"--tlsverify\": true };\nconst DOCKER_LOG_LEVEL_OPTIONS: Record<string, true> = { \"-l\": true, \"--log-level\": true };\n/** Environment variables that select the Docker daemon. */\nconst DOCKER_ENVIRONMENT: Record<string, true> = {\n DOCKER_HOST: true,\n DOCKER_CONTEXT: true,\n DOCKER_CONFIG: true,\n DOCKER_TLS_VERIFY: true,\n DOCKER_CERT_PATH: true,\n};\n/** Builtins that declare shell variables, with options and `NAME=value` words. */\nconst DECLARATION_COMMANDS: Record<string, true> = {\n declare: true,\n typeset: true,\n local: true,\n readonly: true,\n};\n/** Builtins that run shell code that detection does not read. */\nconst SHELL_CODE_COMMANDS: Record<string, true> = { eval: true, source: true, \".\": true };\nconst COMPOSE_VALUE_OPTIONS: Record<string, true> = {\n \"-f\": true,\n \"--file\": true,\n \"-p\": true,\n \"--project-name\": true,\n \"--project-directory\": true,\n \"--env-file\": true,\n \"--profile\": true,\n \"--ansi\": true,\n \"--progress\": true,\n};\nconst SSH_VALUE_FLAGS = \"BbcDEeFIiJLlmOoPpQRSWw\";\nconst STASH_WITHOUT_ENTRY: Record<string, true> = {\n list: true,\n show: true,\n pop: true,\n apply: true,\n drop: true,\n clear: true,\n branch: true,\n};\n\nconst RM_NOTE = \"Add `--rm` to `docker run` so that Docker removes the container when it stops.\";\nconst SCRATCH_NOTE =\n \"Create temporary files and directories inside a directory from the `scratch_new` tool or `docks-kit scratch new <label>`, not in `/tmp`.\";\nconst KEEP_SENTENCE =\n \"Remove each resource that the task no longer needs. Keep a resource only when the user asked for it or a later step needs it, and name it with the reason in your final answer. Never stop or delete a production resource without an ask in the main session.\";\n\ninterface OtherRule {\n readonly category: string;\n readonly hint: string;\n}\n\nconst BACKGROUND: OtherRule = {\n category: \"background process\",\n hint: \"Stop it before your final answer, or start it as a named bash service.\",\n};\nconst TERMINAL: OtherRule = {\n category: \"detached terminal session\",\n hint: \"Kill the session when the task no longer needs it.\",\n};\nconst TUNNEL: OtherRule = {\n category: \"tunnel\",\n hint: \"Stop the tunnel when the task no longer needs it.\",\n};\nconst CLUSTER: OtherRule = {\n category: \"cluster or virtual machine\",\n hint: \"Stop or delete it with the same tool when the task no longer needs it.\",\n};\nconst DOCKER_RESOURCE: OtherRule = {\n category: \"Docker resource\",\n hint: \"Remove it with docker volume rm, docker network rm, or docker buildx rm when the task no longer needs it.\",\n};\nconst SCHEDULED: OtherRule = {\n category: \"scheduled job or service\",\n hint: \"Remove the entry or unit that you added, or name it in your final answer.\",\n};\nconst GLOBAL_INSTALL: OtherRule = {\n category: \"global install\",\n hint: \"Uninstall it unless the user asked for it.\",\n};\nconst REMOTE: OtherRule = {\n category: \"remote resource\",\n hint: \"Delete it with the provider's command only when its target is local, development, dev, test, homolog, homologation, staging, or preview, and the task no longer needs it. For a production target, ask the user first. If you do not delete it, name it in your final answer.\",\n};\n\nconst CLUSTER_COMMANDS: ReadonlyArray<ReadonlyArray<string>> = [\n [\"kind\", \"create\", \"cluster\"],\n [\"k3d\", \"cluster\", \"create\"],\n [\"minikube\", \"start\"],\n [\"multipass\", \"launch\"],\n [\"limactl\", \"start\"],\n [\"podman\", \"machine\", \"start\"],\n [\"colima\", \"start\"],\n];\nconst REMOTE_COMMANDS: ReadonlyArray<ReadonlyArray<string>> = [\n [\"supabase\", \"branches\", \"create\"],\n [\"neonctl\", \"branches\", \"create\"],\n [\"pscale\", \"branch\", \"create\"],\n [\"netlify\", \"deploy\"],\n [\"wrangler\", \"deploy\"],\n [\"fly\", \"deploy\"],\n [\"fly\", \"launch\"],\n [\"gh\", \"repo\", \"fork\"],\n [\"gh\", \"codespace\", \"create\"],\n];\n\n// ----------------------------------------------------------------- types ----\n\n/**\n * The Docker daemon that a command used: the `DOCKER_*` environment variables\n * and the global options before the subcommand. An empty target is the\n * default daemon of the omp process.\n */\nexport interface DockerTarget {\n environment: Record<string, string>;\n options: Array<string>;\n}\n\nexport type HygieneResource =\n | { kind: \"worktree\"; path: string }\n | { kind: \"compose\"; workingDir: string; down: string; docker: DockerTarget }\n | { kind: \"container\"; id: string; down: string; docker: DockerTarget }\n | { kind: \"scratch\"; path: string }\n | { kind: \"tempDir\"; path: string }\n | { kind: \"tempFile\"; path: string }\n | {\n kind: \"stash\";\n /** The directory where the command ran; the reminder names it. */\n directory: string;\n /** The common git directory. A linked worktree shares its stash list with it. */\n gitDir: string;\n id: string;\n shortId: string;\n message: string;\n }\n | { kind: \"other\"; category: string; command: string; hint: string };\n\ntype PathResource = Exclude<HygieneResource, { kind: \"other\" }>;\n\n/** One line of `git stash list`. */\ninterface StashEntry {\n readonly id: string;\n readonly shortId: string;\n readonly message: string;\n}\n\nexport interface ShellSegment {\n words: Array<string>;\n background: boolean;\n}\n\n/** The operator between two segments of one parse level; a newline counts as `;`. */\ntype Separator = \";\" | \"&&\" | \"||\" | \"|\" | \"&\";\n\n/** A segment with its subshell scope. A `cd` changes only its own scope. */\ninterface ScopedSegment extends ShellSegment {\n scope: string;\n /**\n * False when the control syntax of the segment's parse level can skip a\n * setup command (`cd`, `pushd`, `export`, `unset`) or run it in a subshell\n * while a later command still runs. See setupStateKnown.\n */\n setupKnown: boolean;\n}\n\nexport interface RunOptions {\n readonly signal?: AbortSignal;\n readonly timeoutMs: number;\n readonly env?: NodeJS.ProcessEnv;\n}\n\nexport interface RunResult {\n /** The exit code, or null when a signal or the timeout stopped the process. */\n readonly code: number | null;\n readonly stdout: string;\n readonly stderr: string;\n}\n\n// The local structural types below name only the omp extension API parts\n// that this module uses. The module does not import @oh-my-pi packages.\n\ninterface TextContent {\n readonly type: string;\n readonly text?: string;\n}\n\ninterface ExtensionContext {\n readonly cwd: string;\n readonly agent?: { readonly kind: \"main\" | \"sub\" };\n}\n\ninterface ToolCallEvent {\n readonly toolName: string;\n readonly toolCallId?: string;\n readonly input?: Readonly<Record<string, unknown>>;\n}\n\ninterface ToolResultEvent extends ToolCallEvent {\n readonly content?: ReadonlyArray<TextContent>;\n readonly isError?: boolean;\n}\n\ninterface SessionStopEvent {\n readonly stop_hook_active?: boolean;\n}\n\ninterface Schema {\n describe(description: string): Schema;\n}\n\ninterface SchemaBuilder {\n object(shape: Record<string, Schema>): Schema;\n string(): Schema;\n array(item: Schema): Schema;\n}\n\ninterface ToolResult {\n content: Array<{ type: \"text\"; text: string }>;\n details: Record<string, unknown>;\n}\n\ninterface ToolDefinition<Params> {\n name: string;\n label: string;\n description: string;\n parameters: Schema;\n execute(\n toolCallId: string,\n params: Params,\n signal: AbortSignal | undefined,\n onUpdate: unknown,\n ctx: ExtensionContext,\n ): Promise<ToolResult>;\n}\n\nexport interface ExtensionApi {\n readonly zod: SchemaBuilder;\n on(\n event: \"tool_call\",\n handler: (event: ToolCallEvent, ctx: ExtensionContext) => Promise<undefined>,\n ): void;\n on(\n event: \"tool_execution_end\",\n handler: (event: { readonly toolCallId?: string }, ctx: ExtensionContext) => Promise<undefined>,\n ): void;\n on(\n event: \"tool_result\",\n handler: (\n event: ToolResultEvent,\n ctx: ExtensionContext,\n ) => Promise<{ additionalContext: string } | undefined>,\n ): void;\n on(\n event: \"session_stop\",\n handler: (\n event: SessionStopEvent,\n ctx: ExtensionContext,\n ) => Promise<{ continue: true; additionalContext: string } | undefined>,\n ): void;\n on(\n event: \"session_start\",\n handler: (event: unknown, ctx: ExtensionContext) => Promise<undefined>,\n ): void;\n registerTool<Params>(definition: ToolDefinition<Params>): void;\n}\n\n// ------------------------------------------------------------ subprocess ----\n\n/**\n * Runs `command` with `args` through execFile without a shell. Each argument\n * gets to the child as one literal argv entry. A non-zero exit, a signal, or\n * the timeout resolves; a spawn failure or an abort rejects.\n */\nexport function run(\n command: string,\n args: ReadonlyArray<string>,\n options: RunOptions,\n): Promise<RunResult> {\n const { promise, resolve: resolveRun, reject: rejectRun } = Promise.withResolvers<RunResult>();\n execFile(\n command,\n [...args],\n {\n encoding: \"utf8\",\n env: options.env,\n maxBuffer: OUTPUT_LIMIT_BYTES,\n shell: false,\n signal: options.signal,\n timeout: options.timeoutMs,\n windowsHide: true,\n },\n (error, stdout, stderr) => {\n if (error === null) resolveRun({ code: 0, stdout, stderr });\n else if (typeof error.code === \"number\") resolveRun({ code: error.code, stdout, stderr });\n else if (\n error.name !== \"AbortError\" &&\n (error.killed === true || (error.signal ?? null) !== null)\n ) {\n resolveRun({ code: null, stdout, stderr });\n } else rejectRun(error);\n },\n );\n return promise;\n}\n\n/**\n * Finds docks-kit on PATH. Windows accepts only `docks-kit.exe`, because\n * execFile without a shell cannot start a `.cmd` or `.bat` shim. A relative\n * PATH entry is skipped.\n */\nexport function resolveDocksKit(\n env: NodeJS.ProcessEnv = process.env,\n platform: NodeJS.Platform = process.platform,\n): string {\n const windows = platform === \"win32\";\n const paths = windows ? win32 : posix;\n const searchPath = env[\"PATH\"] ?? env[\"Path\"] ?? \"\";\n for (const entry of searchPath.split(windows ? \";\" : \":\")) {\n const directory = entry.replace(/^\"(.*)\"$/, \"$1\");\n if (directory === \"\" || !paths.isAbsolute(directory)) continue;\n const candidate = paths.join(directory, windows ? \"docks-kit.exe\" : \"docks-kit\");\n if (isRunnableFile(candidate, windows)) return candidate;\n }\n throw new Error(NOT_ON_PATH);\n}\n\nfunction isRunnableFile(path: string, windows: boolean): boolean {\n try {\n if (!statSync(path).isFile()) return false;\n if (!windows) accessSync(path, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction errorCode(error: unknown): unknown {\n return typeof error === \"object\" && error !== null && \"code\" in error ? error.code : undefined;\n}\n\nfunction toError(error: unknown): Error {\n if (errorCode(error) === \"ENOENT\") return new Error(NOT_ON_PATH);\n return error instanceof Error ? error : new Error(String(error));\n}\n\nasync function runDocksKit(\n args: ReadonlyArray<string>,\n signal: AbortSignal | undefined,\n timeoutMs: number,\n): Promise<string> {\n const result = await run(resolveDocksKit(), args, { signal, timeoutMs });\n const output = [result.stdout.trim(), result.stderr.trim()].filter((text) => text !== \"\");\n if (result.code === 0) return result.stdout;\n const status = result.code === null ? \"was stopped\" : `exited with code ${result.code}`;\n throw new Error(output.length > 0 ? output.join(\"\\n\") : `docks-kit ${args.join(\" \")} ${status}`);\n}\n\n// --------------------------------------------------------- shell parsing ----\n\n/**\n * Splits a bash command into simple-command segments. This is a minimal\n * tokenizer: it removes single quotes, double quotes, and backslash escapes,\n * and it splits on `&&`, `||`, `;`, `|`, `&`, parentheses, and newlines.\n * `background` is true when a single `&` ended the segment. The command of a\n * `$(...)` or backtick substitution becomes a segment before its container.\n * A heredoc body is skipped.\n */\nexport function splitShellSegments(command: string): Array<ShellSegment> {\n return scopedSegments(command, ROOT_SCOPE).map(({ words, background }) => ({\n words,\n background,\n }));\n}\n\n/**\n * Does the work of splitShellSegments, and gives each segment its subshell\n * scope. A `( ... )` group, a `$( ... )` substitution, and a backtick\n * substitution each get a new scope `<parent>/<n>`. A `{ ...; }` group stays\n * in the scope around it, as in bash.\n *\n * Each call parses one level: the command, or the text of one substitution.\n * It stamps the segments of its level with setupStateKnown for the control\n * syntax of that level.\n */\nfunction scopedSegments(command: string, rootScope: string): Array<ScopedSegment> {\n const segments: Array<ScopedSegment> = [];\n const nested: Array<ScopedSegment> = [];\n const ownSegments: Array<ScopedSegment> = [];\n const separators = new Set<Separator>();\n const heredocs: Array<{ delimiter: string; strip: boolean }> = [];\n const scopes = [rootScope];\n let childScopes = 0;\n let words: Array<string> = [];\n let word = \"\";\n let inWord = false;\n /** True when the current word holds a quoted or escaped character. */\n let wordQuoted = false;\n /** The source index of the last character that the word took without quoting. */\n let lastUnquoted = -1;\n /** The strip flag of a `<<` operator whose delimiter is the next word. */\n let heredocOperator: boolean | undefined;\n /** The operators after the last segment; they count only when a segment follows. */\n const pendingSeparators = new Set<Separator>();\n let skipsCommands = false;\n\n const currentScope = (): string => scopes.at(-1) ?? rootScope;\n const childScope = (): string => `${currentScope()}/${childScopes++}`;\n const finishWord = (): void => {\n if (!inWord) return;\n if (heredocOperator !== undefined) {\n heredocs.push({ delimiter: word, strip: heredocOperator });\n heredocOperator = undefined;\n } else if (!word.includes(\"<<<\")) {\n const match = /^\\d*<<(-?)(.*)$/.exec(word);\n if (match !== null) {\n const strip = match[1] === \"-\";\n const delimiter = match[2] ?? \"\";\n if (delimiter === \"\") heredocOperator = strip;\n else heredocs.push({ delimiter, strip });\n }\n }\n words.push(word);\n word = \"\";\n inWord = false;\n wordQuoted = false;\n };\n\n /**\n * Ends the current segment. `ending` is the operator that ends it; a `(` or\n * a `)` passes undefined. Every operator between two segments counts, also\n * one that ends an empty segment, so `(true;) || cd` keeps both its `;` and\n * its `||`. An operator before the first segment of the level counts for\n * nothing.\n */\n const finishSegment = (ending: Separator | undefined): void => {\n finishWord();\n segments.push(...nested.splice(0));\n if (words.length > 0) {\n for (const separator of pendingSeparators) separators.add(separator);\n pendingSeparators.clear();\n if (changesControlFlow(words)) skipsCommands = true;\n const segment = {\n words,\n background: ending === \"&\",\n scope: currentScope(),\n setupKnown: true,\n };\n segments.push(segment);\n ownSegments.push(segment);\n }\n if (ending !== undefined && ownSegments.length > 0) pendingSeparators.add(ending);\n words = [];\n };\n\n const readSubstitution = (start: number): number => {\n let depth = 0;\n let openQuote: string | undefined;\n let index = start + 1;\n for (; index < command.length; index++) {\n const char = command[index];\n if (openQuote !== undefined) {\n if (char === \"\\\\\" && openQuote === '\"') index++;\n else if (char === openQuote) openQuote = undefined;\n continue;\n }\n if (char === \"\\\\\") index++;\n else if (char === \"'\" || char === '\"') openQuote = char;\n else if (char === \"(\") depth++;\n else if (char === \")\" && --depth === 0) break;\n }\n nested.push(...scopedSegments(command.slice(start + 2, index), childScope()));\n word += command.slice(start, index + 1);\n inWord = true;\n return index + 1;\n };\n\n const readBacktick = (start: number): number => {\n let index = start + 1;\n while (index < command.length && command[index] !== \"`\") {\n index += command[index] === \"\\\\\" ? 2 : 1;\n }\n nested.push(...scopedSegments(command.slice(start + 1, index), childScope()));\n word += command.slice(start, index + 1);\n inWord = true;\n return index + 1;\n };\n\n const readDoubleQuoted = (start: number): number => {\n let index = start;\n inWord = true;\n while (index < command.length && command[index] !== '\"') {\n const char = command[index];\n const next = command[index + 1];\n if (char === \"\\\\\" && next !== undefined && '\"\\\\$`\\n'.includes(next)) {\n if (next !== \"\\n\") word += next;\n index += 2;\n } else if (char === \"$\" && next === \"(\") {\n index = readSubstitution(index);\n } else if (char === \"`\") {\n index = readBacktick(index);\n } else {\n word += char;\n index++;\n }\n }\n return index + 1;\n };\n\n const skipHeredocBodies = (start: number): number => {\n let index = start;\n for (const { delimiter, strip } of heredocs.splice(0)) {\n while (index < command.length) {\n const newline = command.indexOf(\"\\n\", index);\n const end = newline === -1 ? command.length : newline;\n let line = command.slice(index, end);\n if (line.endsWith(\"\\r\")) line = line.slice(0, -1);\n index = end + 1;\n if ((strip ? line.replace(/^\\t+/, \"\") : line) === delimiter) break;\n }\n }\n heredocOperator = undefined;\n return index;\n };\n\n let index = 0;\n while (index < command.length) {\n const char = command[index] ?? \"\";\n const next = command[index + 1];\n if (char === \"'\") {\n const close = command.indexOf(\"'\", index + 1);\n const end = close === -1 ? command.length : close;\n word += command.slice(index + 1, end);\n inWord = true;\n wordQuoted = true;\n index = end + 1;\n } else if (char === '\"') {\n wordQuoted = true;\n index = readDoubleQuoted(index + 1);\n } else if (char === \"\\\\\") {\n if (next !== undefined && next !== \"\\n\") {\n word += next;\n inWord = true;\n wordQuoted = true;\n }\n index += 2;\n } else if (char === \"$\" && next === \"(\") {\n index = readSubstitution(index);\n } else if (char === \"`\") {\n index = readBacktick(index);\n } else if (char === \" \" || char === \"\\t\" || char === \"\\r\") {\n finishWord();\n index++;\n } else if (char === \"#\" && !inWord) {\n const newline = command.indexOf(\"\\n\", index);\n index = newline === -1 ? command.length : newline;\n } else if (char === \"\\n\") {\n // A line break after `&&`, `||`, or `|` continues the command, so it\n // separates nothing.\n const continues = words.length === 0 && !inWord && pendingSeparators.size > 0;\n finishSegment(continues ? undefined : \";\");\n index = skipHeredocBodies(index + 1);\n } else if (char === \"(\" && !inWord) {\n // `name ()` defines a function: its body runs only when it is called.\n if (definesFunction(words)) skipsCommands = true;\n finishSegment(undefined);\n scopes.push(childScope());\n index++;\n } else if (char === \")\") {\n finishSegment(undefined);\n if (scopes.length > 1) scopes.pop();\n index++;\n } else if (char === \";\") {\n finishSegment(\";\");\n index++;\n } else if (char === \"|\") {\n // In `>|file` the `|` belongs to the redirection; the split stays as it\n // was, but it separates nothing. Only an unquoted `>` directly before\n // the `|` makes a clobber, so `echo '>'|` and `echo \\>|` are pipes.\n const clobber = inWord && command[index - 1] === \">\" && lastUnquoted === index - 1;\n if (clobber) {\n finishSegment(undefined);\n index++;\n } else {\n finishSegment(next === \"|\" ? \"||\" : \"|\");\n index += next === \"|\" || next === \"&\" ? 2 : 1;\n }\n } else if (char === \"&\") {\n if (next === \"&\") {\n finishSegment(\"&&\");\n index += 2;\n } else if (next === \">\" || word.endsWith(\">\") || word.endsWith(\"<\")) {\n // A redirection such as `&>file` or `2>&1`.\n word += char;\n inWord = true;\n index++;\n } else {\n finishSegment(\"&\");\n index++;\n }\n } else {\n // `name()` without a space: an unquoted name word directly before `(`.\n if (char === \"(\" && words.length === 0 && !wordQuoted && FUNCTION_NAME.test(word)) {\n skipsCommands = true;\n }\n word += char;\n inWord = true;\n lastUnquoted = index;\n index++;\n }\n }\n finishSegment(undefined);\n const setupKnown = setupStateKnown(separators, skipsCommands);\n for (const segment of ownSegments) segment.setupKnown = setupKnown;\n return segments;\n}\n\n/**\n * True when each setup command of a parse level runs before every later\n * command of the level. A pure `&&` chain and a pure `;` list qualify. These\n * can skip a setup command, or run it in a subshell, while a later command\n * runs:\n *\n * - `||`, a pipeline, or a background job before a later segment;\n * - `!`, a conditional, a loop, or a function body;\n * - `&&` together with `;` or a newline.\n */\nfunction setupStateKnown(separators: ReadonlySet<Separator>, skipsCommands: boolean): boolean {\n if (skipsCommands) return false;\n if (separators.has(\"||\") || separators.has(\"|\") || separators.has(\"&\")) return false;\n return !(separators.has(\"&&\") && separators.has(\";\"));\n}\n\n/**\n * True when a segment starts or continues a conditional, a loop, or a\n * function body, or negates its status with `!`. A negation lets a `&&` chain\n * go on after a failed command. The scan passes the other leading reserved\n * words, such as `{` and `time`, as commandWords does.\n */\nfunction changesControlFlow(words: ReadonlyArray<string>): boolean {\n for (const word of words) {\n if (word === \"!\" || COMPOUND_WORDS[word] === true) return true;\n if (RESERVED_WORDS[word] !== true) return false;\n }\n return false;\n}\n\n/**\n * True when the words before a `(` define a function, as in `name ()`: one\n * name word. A reserved word before `(` starts a subshell, as in `time (make)`.\n */\nfunction definesFunction(words: ReadonlyArray<string>): boolean {\n const name = words.length === 1 ? words[0] : undefined;\n return name !== undefined && RESERVED_WORDS[name] !== true && FUNCTION_NAME.test(name);\n}\n\n/**\n * Removes redirections and leading reserved words, then splits off the\n * `NAME=value` words before the command, also after an `env`. The first of\n * the returned words is the command name. The words are empty when `sudo`\n * or an `env` option hides the command, its directory, or its Docker daemon.\n * `assignsShell` is true when the segment has only `NAME=value` words, which\n * then set shell variables.\n */\nfunction commandWords(segmentWords: ReadonlyArray<string>): {\n assignments: Array<string>;\n words: Array<string>;\n assignsShell: boolean;\n} {\n const result: Array<string> = [];\n for (let index = 0; index < segmentWords.length; index++) {\n const word = segmentWords[index] ?? \"\";\n if (REDIRECT_OPERATOR.test(word)) {\n index++;\n continue;\n }\n if (ATTACHED_REDIRECT.test(word)) continue;\n result.push(word);\n }\n const assignments: Array<string> = [];\n let start = 0;\n while (RESERVED_WORDS[result[start] ?? \"\"] === true) start++;\n while (ASSIGNMENT.test(result[start] ?? \"\")) assignments.push(result[start++] ?? \"\");\n if (start === result.length) return { assignments, words: [], assignsShell: true };\n // A command under sudo runs as another user, in an environment and a\n // directory that the sudoers policy controls, so it records nothing.\n if (result[start] === \"sudo\") return { assignments, words: [], assignsShell: false };\n if (result[start] === \"env\") {\n start++;\n // `env -u NAME` keeps the command and its directory when NAME is a literal\n // name that does not select the daemon. Another option can run another\n // program (`env -S`), change the directory (`env -C`), or clear the\n // environment (`env -i`), and `env -u DOCKER_HOST` or `env -u \"$name\"`\n // can change the daemon, so the command records nothing.\n while ((result[start] ?? \"\").startsWith(\"-\")) {\n const option = result[start] ?? \"\";\n if (option === \"--\") {\n start++;\n break;\n }\n const name = result[start + 1] ?? \"\";\n const keepsDaemon = VARIABLE_NAME.test(name) && DOCKER_ENVIRONMENT[name] !== true;\n if ((option !== \"-u\" && option !== \"--unset\") || !keepsDaemon) {\n return { assignments, words: [], assignsShell: false };\n }\n start += 2;\n }\n }\n while (ASSIGNMENT.test(result[start] ?? \"\")) assignments.push(result[start++] ?? \"\");\n return { assignments, words: result.slice(start), assignsShell: false };\n}\n\n/** Applies the `DOCKER_*=value` words of `assignments` to a copy of `environment`. */\nfunction dockerEnvironment(\n environment: Readonly<Record<string, string>>,\n assignments: ReadonlyArray<string>,\n): Record<string, string> {\n const result = { ...environment };\n for (const assignment of assignments) {\n if (!ASSIGNMENT.test(assignment)) continue;\n const equals = assignment.indexOf(\"=\");\n const variable = assignment.slice(0, equals);\n if (DOCKER_ENVIRONMENT[variable] === true) result[variable] = assignment.slice(equals + 1);\n }\n return result;\n}\n\n/**\n * The Docker environment after an `export` or an `unset`. When the command may\n * not run, a change makes the environment unknown, because a later command\n * can see either value.\n */\nfunction settledEnvironment(\n segment: ScopedSegment,\n before: Readonly<Record<string, string>> | undefined,\n after: Record<string, string> | undefined,\n): Record<string, string> | undefined {\n if (segment.setupKnown) return after;\n if (before === undefined || after === undefined) return undefined;\n const variables = new Set([...Object.keys(before), ...Object.keys(after)]);\n return [...variables].every((variable) => before[variable] === after[variable])\n ? after\n : undefined;\n}\n\n/** True when the `NAME` or `NAME=value` word names a variable that selects the Docker daemon. */\nfunction namesDaemonVariable(word: string): boolean {\n const equals = word.indexOf(\"=\");\n return DOCKER_ENVIRONMENT[equals < 0 ? word : word.slice(0, equals)] === true;\n}\n\n/**\n * True when detection can apply the `export` arguments: each operand is a\n * literal `NAME=value`, or a literal NAME that does not select the daemon.\n * An option such as `-n`, an operand that is not literal, or a daemon\n * variable without a value can give the daemon a value that detection does\n * not know. For example, `export DOCKER_HOST` exports a shell variable that\n * detection does not track.\n */\nfunction exportIsTracked(args: ReadonlyArray<string>): boolean {\n const operands = args[0] === \"--\" ? args.slice(1) : args;\n return operands.every(\n (word) => ASSIGNMENT.test(word) || (VARIABLE_NAME.test(word) && !namesDaemonVariable(word)),\n );\n}\n\n/**\n * Returns the variables that the `unset` arguments remove, or undefined when\n * detection cannot know them. Only `-v` and literal names keep them known:\n * `unset -f` and `unset -n` act on functions and name references, and\n * `unset \"$name\"` removes a variable that the command does not name.\n */\nfunction unsetVariables(args: ReadonlyArray<string>): ReadonlyArray<string> | undefined {\n let start = 0;\n while (args[start] === \"-v\") start++;\n if (args[start] === \"--\") start++;\n const operands = args.slice(start);\n return operands.every((word) => VARIABLE_NAME.test(word)) ? operands : undefined;\n}\n\n/**\n * True when the `declare`, `typeset`, `local`, or `readonly` arguments keep\n * the daemon variables unchanged: each word is a literal option, a literal\n * NAME, or a literal `NAME=value`, and no word names a daemon variable.\n */\nfunction declarationIsTracked(args: ReadonlyArray<string>): boolean {\n return args.every((word) => {\n if (word.startsWith(\"-\") || word.startsWith(\"+\")) return !UNRESOLVED.test(word);\n return (ASSIGNMENT.test(word) || VARIABLE_NAME.test(word)) && !namesDaemonVariable(word);\n });\n}\n\nfunction quote(word: string): string {\n return SAFE_WORD.test(word) ? word : `'${word.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n\n/** Resolves a path word, or returns undefined when the word is not literal. */\nfunction resolvePath(word: string, base: string | undefined, home: string): string | undefined {\n if (UNRESOLVED.test(word)) return undefined;\n if (word === \"~\") return resolve(home);\n if (word.startsWith(\"~/\")) return resolve(home, word.slice(2));\n if (word.startsWith(\"~\")) return undefined;\n if (isAbsolute(word)) return resolve(word);\n return base === undefined ? undefined : resolve(base, word);\n}\n\nfunction changeDirectory(\n args: ReadonlyArray<string>,\n directory: string | undefined,\n home: string,\n): string | undefined {\n const target = args.find((word) => word === \"-\" || !word.startsWith(\"-\"));\n if (target === undefined) return resolve(home);\n if (target === \"-\") return undefined;\n return resolvePath(target, directory, home);\n}\n\nfunction lastAbsoluteLine(output: string): string | undefined {\n return output\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && isAbsolute(line))\n .pop();\n}\n\n/** True when `sequence` occurs in `words` in order, with other words between. */\nfunction containsInOrder(words: ReadonlyArray<string>, sequence: ReadonlyArray<string>): boolean {\n let position = 0;\n for (const word of words) {\n if (word === sequence[position]) position++;\n if (position === sequence.length) return true;\n }\n return sequence.length === 0;\n}\n\nfunction matchesCommand(\n name: string,\n words: ReadonlyArray<string>,\n pattern: ReadonlyArray<string>,\n): boolean {\n return name === pattern[0] && containsInOrder(words.slice(1), pattern.slice(1));\n}\n\n/** Skips git global options and returns the effective directory and arguments. */\nfunction gitArguments(\n words: ReadonlyArray<string>,\n directory: string | undefined,\n home: string,\n): { directory: string | undefined; args: Array<string> } {\n let current = directory;\n let index = 1;\n while (index < words.length) {\n const word = words[index] ?? \"\";\n if (GIT_VALUE_OPTIONS[word] === true) {\n const value = words[index + 1];\n if (word === \"-C\")\n current = value === undefined ? undefined : resolvePath(value, current, home);\n index += 2;\n } else if (word.startsWith(\"-\")) {\n index++;\n } else {\n break;\n }\n }\n return { directory: current, args: words.slice(index) };\n}\n\n/**\n * Reads a docker command: the daemon target and the arguments after the\n * global options. `target` is undefined when the Docker environment is\n * unknown or a value of the target is not literal. Returns undefined for a\n * command that is not docker.\n */\nfunction dockerCommand(\n name: string,\n words: ReadonlyArray<string>,\n environment: Readonly<Record<string, string>> | undefined,\n): { target: DockerTarget | undefined; args: Array<string> } | undefined {\n if (name !== \"docker\" && name !== \"docker-compose\") return undefined;\n const target: DockerTarget = { environment: {}, options: [] };\n let literal = environment !== undefined;\n for (const [variable, value] of Object.entries(environment ?? {})) {\n if (value === \"\") continue;\n if (UNRESOLVED.test(value)) literal = false;\n target.environment[variable] = value;\n }\n if (name === \"docker-compose\") {\n return { target: literal ? target : undefined, args: [\"compose\", ...words.slice(1)] };\n }\n\n let index = 1;\n while (index < words.length && (words[index] ?? \"\").startsWith(\"-\")) {\n const word = words[index] ?? \"\";\n const equals = word.indexOf(\"=\");\n const option = equals > 0 ? word.slice(0, equals) : word;\n const longName = DOCKER_CONNECTION_VALUE_OPTIONS[option];\n if (longName !== undefined) {\n const value = equals > 0 ? word.slice(equals + 1) : words[index + 1];\n index += equals > 0 ? 1 : 2;\n if (value === undefined) break;\n if (UNRESOLVED.test(value)) literal = false;\n target.options.push(longName, value);\n } else {\n if (DOCKER_CONNECTION_FLAGS[option] === true) target.options.push(word);\n index += DOCKER_LOG_LEVEL_OPTIONS[option] === true && equals < 0 ? 2 : 1;\n }\n }\n return { target: literal ? target : undefined, args: words.slice(index) };\n}\n\n/** The docker command prefix that reaches `target`, for a cleanup command. */\nfunction dockerPrefix(target: DockerTarget): string {\n return [\n ...Object.entries(target.environment).map(([variable, value]) => `${variable}=${quote(value)}`),\n \"docker\",\n ...target.options.map(quote),\n ].join(\" \");\n}\n\nfunction sshFlags(args: ReadonlyArray<string>): Set<string> {\n const flags = new Set<string>();\n for (let index = 0; index < args.length; index++) {\n const word = args[index] ?? \"\";\n if (!word.startsWith(\"-\") || word.startsWith(\"--\") || word === \"-\") continue;\n for (let position = 1; position < word.length; position++) {\n const letter = word[position] ?? \"\";\n flags.add(letter);\n if (SSH_VALUE_FLAGS.includes(letter)) {\n if (position === word.length - 1) index++;\n break;\n }\n }\n }\n return flags;\n}\n\nfunction unresolvedNote(noun: string, command: string): string {\n return `You created a ${noun}. When the task no longer needs it, run \\`${command}\\`.`;\n}\n\n// ---------------------------------------------------------------- detect ----\n\ninterface Findings {\n readonly resource: (resource: HygieneResource) => void;\n readonly note: (note: string) => void;\n}\n\n/** The state that a `cd` or an `export` changes, one for each subshell scope. */\ninterface ScopeState {\n directory: string | undefined;\n /**\n * The `DOCKER_*` variables that the scope exported, or undefined when a\n * command changed them in a way that detection does not know. An unknown\n * environment stays unknown for the rest of the scope.\n */\n dockerEnvironment: Record<string, string> | undefined;\n}\n\n/** One simple command, with the state of its scope applied. */\ninterface CommandContext {\n readonly name: string;\n readonly words: ReadonlyArray<string>;\n readonly directory: string | undefined;\n /** The Docker environment of the command, or undefined when it is unknown. */\n readonly dockerEnvironment: Readonly<Record<string, string>> | undefined;\n}\n\n/**\n * Finds the resources that a successful bash command created. A resource\n * whose path or id is not literal in the command or the output gives a\n * generic note in place of a ledger entry.\n *\n * `stashes` lists the directories where a `git stash` command that can add a\n * stash entry ran. The command text cannot tell which entry it added, or if\n * it added one, so the handlers compare the stash list before and after the\n * command (see stashesBefore and createdStashes).\n */\nexport function detectResources(\n command: string,\n cwd: string,\n output: string,\n home: string,\n platform: NodeJS.Platform = process.platform,\n): { resources: Array<HygieneResource>; notes: Array<string>; stashes: Array<string> } {\n const found = new Map<string, HygieneResource>();\n const notes: Array<string> = [];\n const stashes = new Set<string>();\n const findings: Findings = {\n resource: (resource) => {\n found.set(resourceKey(resource), resource);\n },\n note: (note) => {\n if (!notes.includes(note)) notes.push(note);\n },\n };\n\n // A subshell scope starts with a copy of its parent state at its first\n // command, so a `cd` or an unknown Docker environment in a subshell does\n // not change the commands after it.\n const states = new Map<string, ScopeState>([\n [ROOT_SCOPE, { directory: cwd, dockerEnvironment: {} }],\n ]);\n const stateOf = (scope: string): ScopeState => {\n const known = states.get(scope);\n if (known !== undefined) return known;\n const parent = stateOf(scope.slice(0, scope.lastIndexOf(\"/\")));\n const environment = parent.dockerEnvironment;\n const state = {\n directory: parent.directory,\n dockerEnvironment: environment === undefined ? undefined : { ...environment },\n };\n states.set(scope, state);\n return state;\n };\n\n const segments = scopedSegments(command, ROOT_SCOPE);\n const owned = ownedOutput(segments, output);\n for (const segment of segments) {\n const { assignments, words, assignsShell } = commandWords(segment.words);\n const first = words[0];\n if (first === undefined) {\n // `DOCKER_HOST=value` without a command changes the daemon when the\n // shell already exports DOCKER_HOST, which detection does not know.\n if (assignsShell && assignments.some(namesDaemonVariable)) {\n stateOf(segment.scope).dockerEnvironment = undefined;\n }\n continue;\n }\n const name = (first.split(/[\\\\/]/).pop() ?? first).replace(/\\.exe$/i, \"\");\n const state = stateOf(segment.scope);\n const args = words.slice(1);\n if (name === \"cd\" || name === \"pushd\") {\n const directory = changeDirectory(args, state.directory, home);\n state.directory = segment.setupKnown || directory === state.directory ? directory : undefined;\n continue;\n }\n if (name === \"export\") {\n const environment =\n state.dockerEnvironment !== undefined && exportIsTracked(args)\n ? dockerEnvironment(state.dockerEnvironment, args)\n : undefined;\n state.dockerEnvironment = settledEnvironment(segment, state.dockerEnvironment, environment);\n continue;\n }\n if (name === \"unset\") {\n const variables = unsetVariables(args);\n let environment: Record<string, string> | undefined;\n if (variables !== undefined && state.dockerEnvironment !== undefined) {\n environment = { ...state.dockerEnvironment };\n for (const variable of variables) delete environment[variable];\n }\n // The shell can inherit a daemon variable that the tracked environment\n // does not hold, so an unset that may not run leaves the daemon unknown.\n const inheritedChange =\n !segment.setupKnown && (variables === undefined || variables.some(namesDaemonVariable));\n state.dockerEnvironment = inheritedChange\n ? undefined\n : settledEnvironment(segment, state.dockerEnvironment, environment);\n continue;\n }\n if (\n SHELL_CODE_COMMANDS[name] === true ||\n (DECLARATION_COMMANDS[name] === true && !declarationIsTracked(args))\n ) {\n state.dockerEnvironment = undefined;\n }\n const context: CommandContext = {\n name,\n words,\n directory: state.directory,\n dockerEnvironment:\n state.dockerEnvironment === undefined\n ? undefined\n : dockerEnvironment(state.dockerEnvironment, assignments),\n };\n detectCreation(context, home, owned, platform, findings);\n const text = segment.words.map(quote).join(\" \").slice(0, COMMAND_TEXT_LIMIT);\n for (const rule of otherRules(context, segment.background)) {\n findings.resource({ kind: \"other\", category: rule.category, command: text, hint: rule.hint });\n }\n const stash = stashDirectory(context, home);\n if (stash !== undefined) stashes.add(stash);\n }\n return { resources: [...found.values()], notes, stashes: [...stashes] };\n}\n\n/**\n * The tool output when one command owns it, else undefined. A command owns\n * the output only when it runs alone, without a wrapper, and prints to the\n * output. These cases fail:\n *\n * - A substitution such as `f=$(mktemp)` captures what mktemp prints.\n * - Another command can print an unrelated path or container ID, or `||`\n * can skip the command.\n * - A wrapper such as `env` or `time` stands between the command and the\n * output.\n * - A redirection or a process substitution sends the output elsewhere.\n *\n * The callers then give the generic note.\n */\nfunction ownedOutput(segments: ReadonlyArray<ScopedSegment>, output: string): string | undefined {\n const sole = segments.length === 1 ? segments[0] : undefined;\n return sole !== undefined && printsToOutput(sole.words) && runsWithoutWrapper(sole.words)\n ? output\n : undefined;\n}\n\nfunction detectCreation(\n context: CommandContext,\n home: string,\n owned: string | undefined,\n platform: NodeJS.Platform,\n findings: Findings,\n): void {\n const { name, words, directory } = context;\n if (name === \"git\") {\n const git = gitArguments(words, directory, home);\n if (git.args[0] === \"worktree\" && git.args[1] === \"add\") {\n detectWorktree(git.args.slice(2), git.directory, home, findings);\n }\n return;\n }\n\n const docker = dockerCommand(name, words, context.dockerEnvironment);\n if (docker !== undefined) {\n const { target, args } = docker;\n if (args[0] === \"compose\") detectCompose(args.slice(1), target, directory, home, findings);\n else if (args[0] === \"run\") detectContainer(args.slice(1), target, owned, findings);\n else if (args[0] === \"container\" && args[1] === \"run\") {\n detectContainer(args.slice(2), target, owned, findings);\n }\n return;\n }\n\n const ownPath = owned === undefined ? undefined : lastAbsoluteLine(owned);\n if (name === \"docks-kit\" && words[1] === \"scratch\" && words[2] === \"new\") {\n if (ownPath === undefined) {\n findings.note(unresolvedNote(\"scratch directory\", \"docks-kit scratch remove <path>\"));\n } else {\n findings.resource({ kind: \"scratch\", path: ownPath });\n }\n return;\n }\n\n if (name === \"mktemp\") detectMktemp(words.slice(1), ownPath, platform, findings);\n}\n\n/** mktemp creates a file, or a directory with `-d`; a dry run (`-u`) creates nothing. */\nfunction detectMktemp(\n args: ReadonlyArray<string>,\n path: string | undefined,\n platform: NodeJS.Platform,\n findings: Findings,\n): void {\n const effect = mktempEffect(args, platform);\n if (effect === \"nothing\") return;\n const directory = effect === \"directory\";\n if (path === undefined) {\n const noun = directory ? \"temporary directory\" : \"temporary file\";\n findings.note(unresolvedNote(noun, \"docks-kit scratch remove <path>\"));\n } else {\n findings.resource({ kind: directory ? \"tempDir\" : \"tempFile\", path });\n }\n findings.note(SCRATCH_NOTE);\n}\n\n/**\n * Reads the options of an mktemp call. GNU mktemp accepts options before and\n * after the template and a unique prefix of each long option; macOS mktemp\n * takes a prefix after `-t`. An option value, the template, and every word\n * after `--` are not options, so `--suffix -upload` is no dry run.\n */\nfunction mktempEffect(\n args: ReadonlyArray<string>,\n platform: NodeJS.Platform,\n): \"file\" | \"directory\" | \"nothing\" {\n let directory = false;\n for (let index = 0; index < args.length; index++) {\n const word = args[index] ?? \"\";\n if (word === \"--\") break;\n if (!word.startsWith(\"-\") || word === \"-\") continue;\n if (word.startsWith(\"--\")) {\n const typed = word.split(\"=\", 1)[0] ?? word;\n const matches = MKTEMP_LONG_OPTIONS.filter((option) => option.startsWith(typed));\n const option = matches.includes(typed)\n ? typed\n : matches.length === 1\n ? matches[0]\n : undefined;\n // mktemp stops on an unknown or ambiguous option, so it creates nothing.\n if (option === undefined || option === \"--dry-run\" || option === \"--help\") return \"nothing\";\n if (option === \"--version\") return \"nothing\";\n if (option === \"--directory\") directory = true;\n if (option === \"--suffix\" && !word.includes(\"=\")) index++;\n continue;\n }\n for (let at = 1; at < word.length; at++) {\n const flag = word[at];\n if (flag === \"u\") return \"nothing\";\n if (flag === \"d\") directory = true;\n if (flag === \"p\" || (flag === \"t\" && platform === \"darwin\")) {\n // `-p DIR` takes the next word; in `-pDIR` the rest of the word is the value.\n if (at === word.length - 1) index++;\n break;\n }\n }\n }\n return directory ? \"directory\" : \"file\";\n}\n\n/**\n * True when the command of the segment is its first word after the\n * `NAME=value` words and the redirections. A redirection before the command,\n * as in `2>/dev/null mktemp`, applies to the command itself, so it is no\n * wrapper.\n */\nfunction runsWithoutWrapper(words: ReadonlyArray<string>): boolean {\n let first: string | undefined;\n for (let index = 0; index < words.length && first === undefined; index++) {\n const word = words[index] ?? \"\";\n if (REDIRECT_OPERATOR.test(word)) index++;\n else if (!ATTACHED_REDIRECT.test(word) && !ASSIGNMENT.test(word)) first = word;\n }\n return first !== undefined && first === commandWords(words).words[0];\n}\n\n/**\n * True when the standard output of the segment reaches the tool output: no\n * word redirects the standard output or the input, and no word runs a\n * process substitution. A redirection of the standard error alone, such as\n * `2>&1` or `2>/dev/null`, keeps the standard output in place.\n */\nfunction printsToOutput(words: ReadonlyArray<string>): boolean {\n return !words.some(\n (word) =>\n ((REDIRECT_OPERATOR.test(word) || ATTACHED_REDIRECT.test(word)) &&\n !STDERR_REDIRECT.test(word)) ||\n word.includes(\"<(\") ||\n word.includes(\">(\"),\n );\n}\n\nfunction detectWorktree(\n args: ReadonlyArray<string>,\n directory: string | undefined,\n home: string,\n findings: Findings,\n): void {\n let optionsEnded = false;\n for (let index = 0; index < args.length; index++) {\n const word = args[index] ?? \"\";\n if (!optionsEnded && word === \"--\") {\n optionsEnded = true;\n } else if (!optionsEnded && WORKTREE_VALUE_OPTIONS[word] === true) {\n index++;\n } else if (optionsEnded || !word.startsWith(\"-\") || word === \"-\") {\n const path = resolvePath(word, directory, home);\n if (path === undefined) {\n findings.note(unresolvedNote(\"git worktree\", \"git worktree remove -- <path>\"));\n } else {\n findings.resource({ kind: \"worktree\", path });\n }\n return;\n }\n }\n}\n\nfunction detectCompose(\n args: ReadonlyArray<string>,\n target: DockerTarget | undefined,\n directory: string | undefined,\n home: string,\n findings: Findings,\n): void {\n const files: Array<string> = [];\n let project: string | undefined;\n let projectDirectory: string | undefined;\n let subcommand: string | undefined;\n for (let index = 0; index < args.length; index++) {\n const word = args[index] ?? \"\";\n const equals = word.startsWith(\"-\") ? word.indexOf(\"=\") : -1;\n const option = equals > 0 ? word.slice(0, equals) : word;\n if (COMPOSE_VALUE_OPTIONS[option] === true) {\n const value = equals > 0 ? word.slice(equals + 1) : args[++index];\n if (value === undefined) break;\n if (option === \"-f\" || option === \"--file\") files.push(value);\n else if (option === \"-p\" || option === \"--project-name\") project = value;\n else if (option === \"--project-directory\") projectDirectory = value;\n } else if (!word.startsWith(\"-\")) {\n subcommand = word;\n break;\n }\n }\n if (subcommand !== \"up\" && subcommand !== \"start\") return;\n\n const unresolved = unresolvedNote(\n \"detached container\",\n \"docker compose --project-directory <path> down\",\n );\n const resolvedFiles: Array<string> = [];\n for (const file of files) {\n const path = file === \"-\" ? undefined : resolvePath(file, directory, home);\n if (path === undefined) {\n findings.note(unresolved);\n return;\n }\n resolvedFiles.push(path);\n }\n const firstFile = resolvedFiles[0];\n const workingDir =\n projectDirectory !== undefined\n ? resolvePath(projectDirectory, directory, home)\n : firstFile !== undefined\n ? dirname(firstFile)\n : directory;\n if (\n target === undefined ||\n workingDir === undefined ||\n (project !== undefined && UNRESOLVED.test(project))\n ) {\n findings.note(unresolved);\n return;\n }\n\n const down = [dockerPrefix(target), \"compose\"];\n if (project !== undefined) down.push(\"-p\", quote(project));\n if (projectDirectory !== undefined || resolvedFiles.length === 0) {\n down.push(\"--project-directory\", quote(workingDir));\n }\n for (const file of resolvedFiles) down.push(\"-f\", quote(file));\n down.push(\"down\");\n findings.resource({ kind: \"compose\", workingDir, down: down.join(\" \"), docker: target });\n}\n\nfunction detectContainer(\n args: ReadonlyArray<string>,\n target: DockerTarget | undefined,\n owned: string | undefined,\n findings: Findings,\n): void {\n const detached = args.some(\n (word) => word === \"--detach\" || word === \"--detach=true\" || SHORT_CLUSTER_WITH_D.test(word),\n );\n const removesItself = args.some((word) => word === \"--rm\" || word === \"--rm=true\");\n if (detached) {\n const fullId = owned === undefined ? undefined : lastContainerIdLine(owned);\n if (target !== undefined && fullId !== undefined) {\n const id = fullId.slice(0, 12);\n const prefix = dockerPrefix(target);\n const down = removesItself\n ? `${prefix} stop ${id}`\n : `${prefix} stop ${id} && ${prefix} rm ${id}`;\n findings.resource({ kind: \"container\", id, down, docker: target });\n } else {\n findings.note(unresolvedNote(\"detached container\", \"docker stop <id>\"));\n }\n }\n if (!removesItself) findings.note(RM_NOTE);\n}\n\n/**\n * The last line that is a full container ID. omp appends notices such as\n * `Wall time: N seconds` after the command output, so the ID need not be the\n * last line.\n */\nfunction lastContainerIdLine(output: string): string | undefined {\n return output\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter((line) => CONTAINER_ID.test(line))\n .pop();\n}\n\nfunction otherRules(context: CommandContext, background: boolean): Array<OtherRule> {\n const { name, words } = context;\n const rules: Array<OtherRule> = [];\n const args = words.slice(1);\n const has = (word: string): boolean => args.includes(word);\n const hasAny = (...candidates: Array<string>): boolean => candidates.some(has);\n const global = hasAny(\"-g\", \"--global\");\n\n if (background || name === \"nohup\" || name === \"setsid\" || name === \"disown\" || has(\"disown\")) {\n rules.push(BACKGROUND);\n }\n\n const detachFlag = args.some((word) => SHORT_CLUSTER_WITH_D.test(word));\n if (((name === \"tmux\" && hasAny(\"new\", \"new-session\")) || name === \"screen\") && detachFlag) {\n rules.push(TERMINAL);\n }\n\n const ssh = name === \"ssh\" ? sshFlags(args) : undefined;\n if (\n name === \"ngrok\" ||\n (name === \"cloudflared\" && has(\"tunnel\")) ||\n (name === \"kubectl\" && has(\"port-forward\")) ||\n (ssh !== undefined &&\n (ssh.has(\"L\") || ssh.has(\"R\") || ssh.has(\"D\")) &&\n (ssh.has(\"N\") || ssh.has(\"f\")))\n ) {\n rules.push(TUNNEL);\n }\n\n if (CLUSTER_COMMANDS.some((pattern) => matchesCommand(name, words, pattern))) {\n rules.push(CLUSTER);\n }\n\n const docker = dockerCommand(name, words, context.dockerEnvironment)?.args;\n if (\n docker !== undefined &&\n (docker[0] === \"volume\" || docker[0] === \"network\" || docker[0] === \"buildx\") &&\n docker[1] === \"create\"\n ) {\n rules.push(DOCKER_RESOURCE);\n }\n\n if (\n (name === \"crontab\" && !has(\"-l\")) ||\n name === \"at\" ||\n (name === \"systemctl\" && has(\"--user\") && hasAny(\"enable\", \"start\")) ||\n (name === \"systemd-run\" && has(\"--user\")) ||\n (name === \"launchctl\" && hasAny(\"load\", \"bootstrap\"))\n ) {\n rules.push(SCHEDULED);\n }\n\n if (\n (name === \"npm\" && hasAny(\"i\", \"install\") && global) ||\n (name === \"bun\" && hasAny(\"add\", \"install\", \"i\") && global) ||\n (name === \"pnpm\" && has(\"add\") && global) ||\n (name === \"yarn\" && containsInOrder(args, [\"global\", \"add\"])) ||\n (/^pip[0-9.]*$/.test(name) && has(\"install\") && has(\"--user\")) ||\n ((name === \"pipx\" || name === \"cargo\" || name === \"go\") && has(\"install\"))\n ) {\n rules.push(GLOBAL_INSTALL);\n }\n\n if (\n (name === \"vercel\" && !has(\"env\")) ||\n REMOTE_COMMANDS.some((pattern) => matchesCommand(name, words, pattern))\n ) {\n rules.push(REMOTE);\n }\n return rules;\n}\n\n/**\n * The directory of a `git stash` command that can add a stash entry, else\n * undefined. An unknown directory also gives undefined: the handlers can then\n * read no stash list, so they record nothing and give no note.\n */\nfunction stashDirectory(context: CommandContext, home: string): string | undefined {\n if (context.name !== \"git\") return undefined;\n const git = gitArguments(context.words, context.directory, home);\n if (git.args[0] !== \"stash\" || STASH_WITHOUT_ENTRY[git.args[1] ?? \"\"] === true) return undefined;\n return git.directory;\n}\n\n// ----------------------------------------------------------- reminders ----\n\nfunction resourceKey(resource: HygieneResource): string {\n switch (resource.kind) {\n case \"worktree\":\n case \"scratch\":\n case \"tempDir\":\n case \"tempFile\":\n return `${resource.kind}:${resource.path}`;\n case \"compose\":\n return `compose:${dockerPrefix(resource.docker)}:${resource.workingDir}`;\n case \"container\":\n return `container:${dockerPrefix(resource.docker)}:${resource.id}`;\n case \"stash\":\n return `stash:${resource.gitDir}:${resource.id}`;\n case \"other\":\n return `other:${resource.category}:${resource.command}`;\n }\n}\n\nfunction describeResource(resource: PathResource): string {\n switch (resource.kind) {\n case \"worktree\":\n return `the worktree ${resource.path}`;\n case \"compose\":\n return `the compose project in ${resource.workingDir}`;\n case \"container\":\n return `the container ${resource.id}`;\n case \"scratch\":\n return `the scratch directory ${resource.path}`;\n case \"tempDir\":\n return `the temporary directory ${resource.path}`;\n case \"tempFile\":\n return `the temporary file ${resource.path}`;\n case \"stash\":\n return `the git stash entry ${resource.shortId} (${resource.message}) in ${resource.directory}`;\n }\n}\n\n/**\n * The command that removes the resource. For a stash entry, the command that\n * shows its current `stash@{n}` name: the name of an entry changes when\n * another entry is added or removed, so no fixed pop or drop command is safe.\n * When the worktree of the entry is gone, a read-only list of the common git\n * directory; it needs no worktree.\n */\nexport function cleanupCommand(resource: HygieneResource): string {\n switch (resource.kind) {\n case \"worktree\":\n return `git worktree remove -- ${quote(resource.path)}`;\n case \"compose\":\n case \"container\":\n return resource.down;\n case \"scratch\":\n case \"tempDir\":\n case \"tempFile\":\n return `docks-kit scratch remove ${quote(resource.path)}`;\n case \"stash\":\n return existsSync(resource.directory)\n ? `git -C ${quote(resource.directory)} stash list --format='%h %gd %gs'`\n : `git --git-dir=${quote(resource.gitDir)} stash list --format='%h %gd %gs'`;\n case \"other\":\n return resource.hint;\n }\n}\n\nexport function creationReminder(resource: HygieneResource): string {\n if (resource.kind === \"other\") {\n return `This command created a ${resource.category} (\\`${resource.command}\\`). ${resource.hint}`;\n }\n if (resource.kind === \"stash\") {\n return `The stash list got ${describeResource(resource)} while this command ran. When the task no longer needs it, ${cleanupAction(resource)}.`;\n }\n return `You created ${describeResource(resource)}. When the task no longer needs it, ${cleanupAction(resource)}.`;\n}\n\n/**\n * Names the entry, so the agent does not pop a stash entry of another owner.\n * The user or another session can add an entry while the command runs (see\n * createdStashes). A default message such as `WIP on main: abc1234 subject`\n * does not prove the owner, because two sessions on one branch make the same\n * message. So the agent pops the entry only when it holds a unique message\n * that the agent gave with `-m`, and it never drops the entry. When the\n * worktree of the entry is gone, a pop in another worktree would put the\n * changes into a checkout of the user or of another task, so the reminder\n * then asks only to name the entry.\n */\nfunction cleanupAction(resource: PathResource): string {\n if (resource.kind === \"stash\" && !existsSync(resource.directory)) {\n return `its worktree was removed. Run \\`${cleanupCommand(resource)}\\` to see ${resource.shortId}. Do not pop or drop it, and name it in your final answer`;\n }\n if (resource.kind === \"stash\") {\n return `run \\`${cleanupCommand(resource)}\\` and find ${resource.shortId}. Pop that entry by its \\`stash@{n}\\` name only when its message is a unique message that you gave with \\`-m\\`. Otherwise do not pop or drop it, and name it in your final answer`;\n }\n return `run \\`${cleanupCommand(resource)}\\``;\n}\n\nfunction stopLine(resource: HygieneResource): string {\n if (resource.kind === \"other\") {\n return `- ${resource.category}: \\`${resource.command}\\` (${resource.hint})`;\n }\n return `- ${describeResource(resource)}: ${cleanupAction(resource)}`;\n}\n\nexport function stopReminder(\n verified: ReadonlyArray<HygieneResource>,\n unverified: ReadonlyArray<HygieneResource>,\n): string {\n const lines: Array<string> = [];\n if (verified.length > 0) {\n lines.push(\"These resources from this session still exist:\", ...verified.map(stopLine));\n }\n if (unverified.length > 0) {\n lines.push(\n \"These commands from this session may have left something running, installed, or created:\",\n ...unverified.map(stopLine),\n );\n }\n lines.push(KEEP_SENTENCE);\n return lines.join(\"\\n\");\n}\n\n// ----------------------------------------------------------------- sweep ----\n\nexport function sweepDue(stampMtimeMs: number | undefined, nowMs: number): boolean {\n return stampMtimeMs === undefined || nowMs - stampMtimeMs >= SWEEP_INTERVAL_MS;\n}\n\nfunction mtimeMs(path: string): number | undefined {\n try {\n return statSync(path).mtimeMs;\n } catch {\n return undefined;\n }\n}\n\n/** A probe file of the claim or of the takeover mutex: `<file>.<pid>.<16 hex>.probe`. */\nconst PROBE_FILE = /^tidy\\.stamp\\.(?:claim|takeover)\\.(\\d+)\\.[0-9a-f]{16}\\.probe$/;\n\n/**\n * Creates `<path>.<pid>.<16 hex>.probe` with `wx`, then removes it. True when\n * both calls succeed: the folder lets this process create and delete files.\n * False when a call fails: the folder can deny the operation. A process that\n * stops between the two calls leaves the probe file, and removeExitedProbes\n * removes it later.\n */\nfunction probeSucceeds(path: string): boolean {\n const probe = `${path}.${process.pid}.${randomBytes(8).toString(\"hex\")}.probe`;\n try {\n closeSync(openSync(probe, \"wx\", 0o600));\n unlinkSync(probe);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * True on Windows for an error of an operation on `path` that another process\n * causes when it deletes or holds `path`. libuv runs the `node:fs` calls of\n * Bun and Node.js on Windows. It gives EBUSY only for a sharing or lock\n * violation, so EBUSY is always contention. It gives EPERM for\n * ERROR_ACCESS_DENIED. Windows returns that error for an open or a delete of a\n * \"delete pending\" name. Such a name is a deleted file that another process\n * still has open. Windows also returns the error for a folder that denies the\n * operation. Thus EPERM counts as contention only when the probe succeeds;\n * otherwise the caller throws the EPERM. On POSIX, EPERM and EBUSY are real\n * faults, so they stay errors.\n */\nfunction isWindowsContention(error: unknown, path: string): boolean {\n if (process.platform !== \"win32\") return false;\n const code = errorCode(error);\n return code === \"EBUSY\" || (code === \"EPERM\" && probeSucceeds(path));\n}\n\n/**\n * Removes `path`. Ignores a path that is absent or, on Windows, a path that\n * another process deletes or holds.\n */\nfunction removeIfPresent(path: string): void {\n try {\n unlinkSync(path);\n } catch (error) {\n if (errorCode(error) !== \"ENOENT\" && !isWindowsContention(error, path)) throw error;\n }\n}\n\n/**\n * Creates `path` with `wx` and writes an owner token into it. Returns the\n * token, or undefined when the file exists or, on Windows, when another\n * process deletes or holds it now.\n */\nfunction createOwned(path: string): string | undefined {\n let descriptor: number;\n try {\n descriptor = openSync(path, \"wx\", 0o600);\n } catch (error) {\n if (errorCode(error) === \"EEXIST\" || isWindowsContention(error, path)) return undefined;\n throw error;\n }\n const token = `${process.pid} ${randomUUID()}`;\n try {\n writeFileSync(descriptor, token);\n } finally {\n closeSync(descriptor);\n }\n return token;\n}\n\n/**\n * Removes `path` only when it still holds `token`, so that no process removes\n * the file of another. Ignores a path that is absent or, on Windows, a path\n * that another process deletes or holds. Such a file stays until it is stale.\n */\nfunction releaseOwned(path: string, token: string): void {\n try {\n if (readFileSync(path, \"utf8\") === token) unlinkSync(path);\n } catch (error) {\n if (errorCode(error) !== \"ENOENT\" && !isWindowsContention(error, path)) throw error;\n }\n}\n\n/** True when no process has `pid`: `process.kill(pid, 0)` fails with ESRCH. */\nfunction hasExited(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return false;\n } catch (error) {\n return errorCode(error) === \"ESRCH\";\n }\n}\n\n/**\n * Removes each probe file of the claim and of the takeover mutex whose process\n * has exited. Keeps the probe file of a running process, which removes it.\n * The removal is best effort and makes no probe. So a folder that denies\n * deletes keeps the file and cannot get a new probe file on each sweep.\n */\nfunction removeExitedProbes(cacheDir: string): void {\n for (const name of readdirSync(cacheDir)) {\n const pid = PROBE_FILE.exec(name)?.[1];\n if (pid === undefined || !hasExited(Number(pid))) continue;\n try {\n unlinkSync(join(cacheDir, name));\n } catch {\n // The next sweep tries again.\n }\n }\n}\n\n/** True when `path` is missing or older than CLAIM_STALE_MS: its process stopped. */\nfunction isStale(path: string, nowMs: number): boolean {\n const mtime = mtimeMs(path);\n return mtime === undefined || nowMs - mtime > CLAIM_STALE_MS;\n}\n\n/**\n * Creates the claim and returns its token, or returns undefined when another\n * process holds it. Only the holder of the takeover mutex replaces a stale\n * claim, and it checks the claim again while it holds the mutex. A stale\n * takeover can still let two processes claim the sweep. Each then starts\n * `docks-kit tidy --apply`, and the second one finds `tidy-lock.db` held and\n * stops, or plans from the current state after the first one ends. Thus a\n * duplicate claim only adds load; the claim limits load and does not protect\n * files. On Windows, a create that fails because another process deletes or\n * holds the file gives no token for that attempt. When the claim is then stale\n * or gone, the takeover path can still take it; otherwise a later main session\n * claims the sweep. A delete or a release that fails this way removes nothing.\n */\nfunction acquireClaim(cacheDir: string, nowMs: number): string | undefined {\n const claim = join(cacheDir, CLAIM_FILE);\n const token = createOwned(claim);\n if (token !== undefined || !isStale(claim, nowMs)) return token;\n\n const takeover = join(cacheDir, TAKEOVER_FILE);\n let mutex = createOwned(takeover);\n if (mutex === undefined && isStale(takeover, nowMs)) {\n removeIfPresent(takeover);\n mutex = createOwned(takeover);\n }\n if (mutex === undefined) return undefined;\n try {\n if (!isStale(claim, nowMs)) return undefined;\n removeIfPresent(claim);\n return createOwned(claim);\n } finally {\n releaseOwned(takeover, mutex);\n }\n}\n\n/**\n * Lets one process in each sweep interval start the sweep. It first removes\n * the probe files of exited processes. The process that holds\n * `tidy.stamp.claim` reads the stamp again. When the sweep is still due, it\n * writes the stamp and returns true. In each case, it then releases its claim.\n * When the release fails on Windows because of contention, the claim stays\n * until it is stale.\n */\nexport function claimSweep(cacheDir: string, nowMs: number): boolean {\n mkdirSync(cacheDir, { recursive: true, mode: 0o700 });\n chmodSync(cacheDir, 0o700);\n removeExitedProbes(cacheDir);\n const token = acquireClaim(cacheDir, nowMs);\n if (token === undefined) return false;\n try {\n const stamp = join(cacheDir, STAMP_FILE);\n if (!sweepDue(mtimeMs(stamp), nowMs)) return false;\n writeFileSync(stamp, \"\", { mode: 0o600 });\n chmodSync(stamp, 0o600);\n const seconds = nowMs / 1000;\n utimesSync(stamp, seconds, seconds);\n return true;\n } finally {\n releaseOwned(join(cacheDir, CLAIM_FILE), token);\n }\n}\n\n// ---------------------------------------------------------------- ledger ----\n\n/**\n * One omp process shares module state across its sessions, so the main\n * session also sees the resources that its subagents created.\n */\nconst ledger = new Map<string, HygieneResource>();\nconst reminded = new Set<string>();\n/**\n * The stash IDs of each directory of a bash call before the call ran, keyed\n * by tool call ID. The tool_result handler takes the snapshot out. omp sends\n * no tool_result for a call that it blocks or that the user denies after the\n * tool_call handler, but it sends tool_execution_end for each call after its\n * tool_result, so that handler removes the snapshot of such a call.\n */\nconst stashSnapshots = new Map<string, ReadonlyMap<string, ReadonlySet<string>>>();\n\nasync function dockerListsAny(target: DockerTarget, args: ReadonlyArray<string>): Promise<boolean> {\n try {\n const result = await run(\"docker\", [...target.options, ...args], {\n env: { ...process.env, ...target.environment },\n timeoutMs: DOCKER_CHECK_TIMEOUT_MS,\n });\n return result.code === 0 && result.stdout.trim() !== \"\";\n } catch {\n return false;\n }\n}\n\n/**\n * The entries of `git <location> stash list`, or undefined when git fails or\n * the timeout stops it.\n */\nasync function stashList(\n location: ReadonlyArray<string>,\n timeoutMs: number,\n): Promise<Array<StashEntry> | undefined> {\n try {\n const result = await run(\"git\", [...location, \"stash\", \"list\", STASH_LIST_FORMAT], {\n timeoutMs,\n });\n if (result.code !== 0) return undefined;\n return result.stdout\n .split(/\\r?\\n/)\n .filter((line) => line !== \"\")\n .map((line) => {\n const [id = \"\", shortId = \"\", message = \"\"] = line.split(\"\\0\");\n return { id, shortId, message };\n });\n } catch {\n return undefined;\n }\n}\n\n/** The absolute common git directory of `directory`, or undefined when git fails. */\nasync function commonGitDir(directory: string): Promise<string | undefined> {\n try {\n const result = await run(\"git\", [\"-C\", directory, \"rev-parse\", \"--git-common-dir\"], {\n timeoutMs: GIT_CHECK_TIMEOUT_MS,\n });\n const path = result.stdout.trim();\n return result.code === 0 && path !== \"\" ? resolve(directory, path) : undefined;\n } catch {\n return undefined;\n }\n}\n\nasync function stillExists(resource: HygieneResource): Promise<boolean> {\n switch (resource.kind) {\n case \"worktree\":\n case \"scratch\":\n case \"tempDir\":\n case \"tempFile\":\n return existsSync(resource.path);\n case \"compose\":\n return dockerListsAny(resource.docker, [\n \"ps\",\n \"-q\",\n \"--filter\",\n `label=com.docker.compose.project.working_dir=${resource.workingDir}`,\n ]);\n case \"container\":\n return dockerListsAny(resource.docker, [\"ps\", \"-aq\", \"--filter\", `id=${resource.id}`]);\n case \"stash\": {\n // The read uses the common git directory, so it also works after the\n // agent removes the worktree where the command ran. A failed read gives\n // no reminder, the same as dockerListsAny. The read fails mainly when\n // the repository is gone, and its stash list is then gone too. A\n // reminder that the extension cannot check is a possible false reminder.\n const entries = await stashList([`--git-dir=${resource.gitDir}`], GIT_CHECK_TIMEOUT_MS);\n return entries?.some((entry) => entry.id === resource.id) === true;\n }\n case \"other\":\n return true;\n }\n}\n\nfunction textResult(text: string, details: Record<string, unknown>): ToolResult {\n return { content: [{ type: \"text\", text }], details };\n}\n\n/** The command and the directory of a bash call that TRIGGER matches, else undefined. */\nfunction bashCall(\n event: ToolCallEvent,\n ctx: ExtensionContext,\n): { command: string; cwd: string } | undefined {\n if (event.toolName !== \"bash\") return undefined;\n const command = event.input?.[\"command\"];\n if (typeof command !== \"string\" || !TRIGGER.test(command)) return undefined;\n return { command, cwd: resolve(ctx.cwd, String(event.input?.[\"cwd\"] ?? \".\")) };\n}\n\n/**\n * Before a bash call runs, reads the stash list of each directory where the\n * call can add a stash entry. createdStashes compares it with the list after\n * the call. Only this comparison proves which entries the call can have\n * added:\n *\n * - `git stash push -q` prints nothing, also when it adds an entry.\n * - With nothing to save, it adds no entry, and `refs/stash` still names an\n * older entry, which can belong to the user.\n * - A tool_result handler cannot read the list as it was before the call.\n *\n * The read delays the command, so it has a short timeout. A directory whose\n * list git cannot read in that time gets no snapshot, so the call then\n * records no stash there.\n */\nasync function stashesBefore(event: ToolCallEvent, ctx: ExtensionContext): Promise<void> {\n const call = bashCall(event, ctx);\n if (call === undefined || event.toolCallId === undefined) return;\n const { stashes } = detectResources(call.command, call.cwd, \"\", homedir());\n if (stashes.length === 0) return;\n const snapshot = new Map<string, ReadonlySet<string>>();\n await Promise.all(\n stashes.map(async (directory) => {\n const entries = await stashList([\"-C\", directory], STASH_SNAPSHOT_TIMEOUT_MS);\n if (entries !== undefined) snapshot.set(directory, new Set(entries.map((entry) => entry.id)));\n }),\n );\n stashSnapshots.set(event.toolCallId, snapshot);\n}\n\n/**\n * The stash entries that are in the list after the call and not in its\n * snapshot. The user or another session can add an entry between the two\n * reads, for example while omp waits for the approval of the call, and that\n * entry also counts. So the reminder names the entry and its message, and it\n * tells the agent to check the message and never to drop the entry.\n */\nasync function createdStashes(\n directories: ReadonlyArray<string>,\n snapshot: ReadonlyMap<string, ReadonlySet<string>> | undefined,\n): Promise<Array<HygieneResource>> {\n if (snapshot === undefined) return [];\n const created = await Promise.all(\n directories.map(async (directory): Promise<Array<HygieneResource>> => {\n const before = snapshot.get(directory);\n if (before === undefined) return [];\n const [entries, gitDir] = await Promise.all([\n stashList([\"-C\", directory], GIT_CHECK_TIMEOUT_MS),\n commonGitDir(directory),\n ]);\n if (entries === undefined || gitDir === undefined) return [];\n return entries\n .filter((entry) => !before.has(entry.id))\n .map((entry) => ({\n kind: \"stash\",\n directory,\n gitDir,\n id: entry.id,\n shortId: entry.shortId,\n message: entry.message.slice(0, COMMAND_TEXT_LIMIT),\n }));\n }),\n );\n return created.flat();\n}\n\n/**\n * Records each resource that a bash command created and returns its reminder\n * lines and the notes on resources that the command can create.\n */\nasync function resourceLines(event: ToolResultEvent, ctx: ExtensionContext): Promise<Array<string>> {\n const id = event.toolCallId;\n const snapshot = id === undefined ? undefined : stashSnapshots.get(id);\n if (id !== undefined) stashSnapshots.delete(id);\n const failed = event.isError === true;\n // A failed call can still have added a stash entry, as in\n // `git stash push -q && false`, so the stash lists are compared also then.\n if (failed && snapshot === undefined) return [];\n const call = bashCall(event, ctx);\n if (call === undefined) return [];\n const output = (event.content ?? [])\n .map((block) => (block.type === \"text\" && typeof block.text === \"string\" ? block.text : \"\"))\n .join(\"\\n\");\n const detected = detectResources(call.command, call.cwd, output, homedir());\n const resources: Array<HygieneResource> = failed ? [] : detected.resources;\n resources.push(...(await createdStashes(detected.stashes, snapshot)));\n for (const resource of resources) ledger.set(resourceKey(resource), resource);\n return [...resources.map(creationReminder), ...(failed ? [] : detected.notes)];\n}\n\n// ------------------------------------------------------------- extension ----\n\nexport default function docksKitOmp(pi: ExtensionApi): void {\n const z = pi.zod;\n /**\n * The message of the error that stopped the last sweep start. The next tool\n * result of the main session shows it one time.\n */\n let sweepError: string | undefined;\n\n pi.registerTool<{ label: string }>({\n name: \"scratch_new\",\n label: \"Scratch New\",\n description:\n \"Create a private temporary directory under the docks-kit scratch root and return its path. Use it instead of /tmp, also for a single temporary file. Remove it with scratch_remove when the task no longer needs it.\",\n parameters: z.object({\n label: z.string().describe(\"Short name: letters, digits, dot, underscore, or hyphen\"),\n }),\n async execute(_toolCallId, params, signal) {\n try {\n if (!LABEL_PATTERN.test(params.label)) throw new Error(LABEL_ERROR);\n const output = await runDocksKit(\n [\"scratch\", \"new\", params.label],\n signal,\n SCRATCH_TIMEOUT_MS,\n );\n const path = lastAbsoluteLine(output);\n if (path === undefined) throw new Error(`docks-kit scratch new printed no path: ${output}`);\n const resource: HygieneResource = { kind: \"scratch\", path };\n ledger.set(resourceKey(resource), resource);\n return textResult(path, { path });\n } catch (error) {\n throw toError(error);\n }\n },\n });\n\n pi.registerTool<{ paths: Array<string> }>({\n name: \"scratch_remove\",\n label: \"Scratch Remove\",\n description:\n \"Remove temporary files and directories that you created. Use it instead of gio trash, which does not work on a tmpfs /tmp. Accepts only absolute paths inside the docks-kit scratch root, the system temporary directory, or /var/tmp; refuses every other path.\",\n parameters: z.object({\n paths: z.array(z.string()).describe(\"Absolute paths\"),\n }),\n async execute(_toolCallId, params, signal) {\n try {\n if (params.paths.length === 0) throw new Error(\"paths must not be empty\");\n const relative = params.paths.find((path) => !isAbsolute(path));\n if (relative !== undefined) throw new Error(`path must be absolute: ${relative}`);\n const output = await runDocksKit(\n [\"scratch\", \"remove\", ...params.paths],\n signal,\n SCRATCH_TIMEOUT_MS,\n );\n return textResult(output.trim(), { paths: params.paths });\n } catch (error) {\n throw toError(error);\n }\n },\n });\n\n pi.registerTool<Record<string, never>>({\n name: \"tidy_report\",\n label: \"Tidy Report\",\n description:\n \"List agent leftovers and other disk and memory use (worktrees, containers, orphaned processes, scratch, /tmp, caches, Trash, branches, scheduled jobs, global installs). Read-only.\",\n parameters: z.object({}),\n async execute(_toolCallId, _params, signal) {\n try {\n const output = await runDocksKit([\"tidy\", \"--report\"], signal, REPORT_TIMEOUT_MS);\n return textResult(output.trim(), {});\n } catch (error) {\n throw toError(error);\n }\n },\n });\n\n pi.on(\"tool_call\", async (event, ctx) => {\n // omp blocks the call when a tool_call handler throws, so a failed stash\n // read must end here. The call then records no stash.\n try {\n await stashesBefore(event, ctx);\n } catch {\n // Nothing to do: createdStashes finds no snapshot.\n }\n return undefined;\n });\n\n pi.on(\"tool_result\", async (event, ctx) => {\n let lines: Array<string>;\n try {\n lines = await resourceLines(event, ctx);\n } catch {\n lines = [];\n }\n if (ctx.agent?.kind !== \"sub\" && sweepError !== undefined) {\n lines.push(`docks-kit sweep did not start: ${sweepError}`);\n sweepError = undefined;\n }\n return lines.length === 0 ? undefined : { additionalContext: lines.join(\"\\n\") };\n });\n\n pi.on(\"tool_execution_end\", async (event) => {\n if (event.toolCallId !== undefined) stashSnapshots.delete(event.toolCallId);\n return undefined;\n });\n\n pi.on(\"session_stop\", async (event) => {\n try {\n if (event.stop_hook_active === true) return undefined;\n const pending = [...ledger].filter(([key]) => !reminded.has(key));\n if (pending.length === 0) return undefined;\n const states = await Promise.all(\n pending.map(async ([key, resource]) => ({\n key,\n resource,\n exists: await stillExists(resource),\n })),\n );\n const verified: Array<HygieneResource> = [];\n const unverified: Array<HygieneResource> = [];\n for (const { key, resource, exists } of states) {\n if (!exists) {\n ledger.delete(key);\n continue;\n }\n reminded.add(key);\n if (resource.kind === \"other\") unverified.push(resource);\n else verified.push(resource);\n }\n if (verified.length === 0 && unverified.length === 0) return undefined;\n return { continue: true, additionalContext: stopReminder(verified, unverified) };\n } catch {\n return undefined;\n }\n });\n\n pi.on(\"session_start\", async (_event, ctx) => {\n try {\n if (ctx.agent?.kind === \"sub\") return undefined;\n // The same directory as kitCacheDir in the docks-kit CLI.\n const cacheDir = join(homedir(), \".cache\", \"docks-kit\");\n const now = Date.now();\n if (!sweepDue(mtimeMs(join(cacheDir, STAMP_FILE)), now)) return undefined;\n let docksKit: string;\n try {\n docksKit = resolveDocksKit();\n } catch {\n // A checkout user who runs ./docks-kit has no launcher on PATH. A line\n // in each session would only repeat that, so the sweep stays silent.\n return undefined;\n }\n if (!claimSweep(cacheDir, now)) return undefined;\n const child = spawn(docksKit, [\"tidy\", \"--apply\"], {\n cwd: homedir(),\n detached: true,\n shell: false,\n stdio: \"ignore\",\n windowsHide: true,\n });\n child.on(\"error\", () => {});\n child.unref();\n } catch (error) {\n // A sweep that cannot start must not stop the session; the next tool\n // result of the main session reports it.\n sweepError = error instanceof Error ? error.message : String(error);\n }\n return undefined;\n });\n}\n",
27
27
  "SoT/.omp/plugin/extensions/pluginUpgrades.ts": "/**\n * docks-kit-omp extension: plugin upgrade reminders for omp sessions.\n *\n * omp deletes the previous plugin folder on `omp plugin upgrade`. A running\n * omp session keeps the plugin agents that it found at startup. So these\n * agents can fail after an upgrade, until the user runs /reload-plugins. The\n * skills of the session resolve to the new folder through `skill://`.\n * `docks-kit sync` writes one event file for each upgrade that changed a\n * version, or that can have changed it (the version `unknown`).\n *\n * In each tool_result of a main session, this extension reads the events that\n * finished after this omp process started. It adds one reminder for the events\n * that the session did not get before. A folder or file that it cannot read\n * gives no reminder for that tool result. The next tool result reads it again.\n *\n * The module imports only node: modules, so omp loads it without a package\n * install.\n */\nimport { readdirSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\n// ------------------------------------------------------------- constants ----\n\n/**\n * The start of this omp process. omp finds the plugin folders before it\n * imports extension modules, so a later upgrade can remove a loaded folder.\n */\nconst PROCESS_START_MS = Date.now() - process.uptime() * 1000;\n\n/** An event file name that `docks-kit sync` writes; a temporary name does not match. */\nconst EVENT_FILE = /^\\d+-[0-9a-f]+\\.json$/;\n/** A plugin id or version that the reminder can name without a quote. */\nconst SAFE_TOKEN = /^[A-Za-z0-9._@+-]+$/;\n\n// ----------------------------------------------------------- omp API types ----\n\n// The local structural types below name only the omp extension API parts\n// that this module uses. The module does not import @oh-my-pi packages.\n\ninterface ExtensionContext {\n readonly agent?: { readonly kind: \"main\" | \"sub\" };\n readonly sessionManager?: { getSessionId(): string };\n}\n\nexport interface ExtensionApi {\n on(\n event: \"tool_result\",\n handler: (\n event: unknown,\n ctx: ExtensionContext,\n ) => Promise<{ additionalContext: string } | undefined>,\n ): void;\n}\n\n// ---------------------------------------------------------------- events ----\n\n/** One plugin upgrade that `docks-kit sync` recorded. */\nexport interface PluginUpgradeEvent {\n readonly id: string;\n readonly before: string;\n readonly after: string;\n /** The time in milliseconds just after the upgrade command returned. */\n readonly finishedAtMs: number;\n}\n\n/** The upgrade log folder; `ompPlugins.ts syncPlugins` in the docks-kit CLI writes it. */\nexport function upgradeLogDir(home: string): string {\n return join(home, \".cache\", \"docks-kit\", \"omp-plugin-upgrades\");\n}\n\n/** The event in one event file, or undefined when the file is not a version 1 event. */\nexport function parseUpgradeEvent(text: string): PluginUpgradeEvent | undefined {\n let value: unknown;\n try {\n value = JSON.parse(text);\n } catch {\n return undefined;\n }\n if (typeof value !== \"object\" || value === null) return undefined;\n const { version, id, before, after, finishedAt } = value as Record<string, unknown>;\n if (version !== 1) return undefined;\n if (typeof id !== \"string\" || typeof before !== \"string\" || typeof after !== \"string\") {\n return undefined;\n }\n if (![id, before, after].every((token) => SAFE_TOKEN.test(token))) return undefined;\n const finishedAtMs = typeof finishedAt === \"string\" ? Date.parse(finishedAt) : Number.NaN;\n if (!Number.isFinite(finishedAtMs)) return undefined;\n return { id, before, after, finishedAtMs };\n}\n\n/** The reminder that names each upgrade. */\nexport function upgradeReminder(events: ReadonlyArray<PluginUpgradeEvent>): string {\n const upgrades = events.map((event) => `${event.id} ${event.before} -> ${event.after}`);\n return [\n `docks-kit sync upgraded these omp plugins after this omp process started: ${upgrades.join(\", \")}.`,\n \"omp removes the old plugin folder on upgrade, so this session's plugin agents may fail.\",\n \"Ask the user to run /reload-plugins in this session, then read each plugin skill again through skill:// before you run its scripts.\",\n \"Ask the user to restart omp instead when an upgraded plugin ships hooks, extension modules, or non-MCP tools.\",\n ].join(\" \");\n}\n\n// ------------------------------------------------------------- extension ----\n\nexport interface PluginUpgradesOptions {\n /** The home folder that holds the upgrade log. */\n readonly home: string;\n /** Events that finished at or before this time give no reminder. */\n readonly processStartMs: number;\n}\n\n/** The extension factory for one home folder and one process start. */\nexport function pluginUpgrades(options: PluginUpgradesOptions): (pi: ExtensionApi) => void {\n const dir = upgradeLogDir(options.home);\n /** Each event file read so far; undefined marks a file whose content is not an event. */\n const read = new Map<string, PluginUpgradeEvent | undefined>();\n /** For each session id, the event files that its reminders named. */\n const told = new Map<string, Set<string>>();\n\n /** The events of the log. Each file name is read until one read succeeds. */\n function currentEvents(): Array<{ name: string; event: PluginUpgradeEvent }> {\n let names: Array<string>;\n try {\n names = readdirSync(dir).filter((name) => EVENT_FILE.test(name));\n } catch {\n // A missing folder holds no events. Another error gives no events now,\n // and the next tool result reads the folder again.\n return [];\n }\n const present = new Set(names);\n // Sync prunes old files, so the cache forgets the names that are gone.\n for (const name of read.keys()) if (!present.has(name)) read.delete(name);\n const events: Array<{ name: string; event: PluginUpgradeEvent }> = [];\n for (const name of names) {\n if (!read.has(name)) {\n let text: string;\n try {\n text = readFileSync(join(dir, name), \"utf8\");\n } catch {\n // A prune removed the file (ENOENT), or the read failed for now.\n // The name stays out of the cache, so the next tool result reads it again.\n continue;\n }\n read.set(name, parseUpgradeEvent(text));\n }\n const event = read.get(name);\n if (event !== undefined) events.push({ name, event });\n }\n return events;\n }\n\n return (pi) => {\n pi.on(\"tool_result\", async (_event, ctx) => {\n try {\n if (ctx.agent?.kind !== \"main\") return undefined;\n const sessionId = ctx.sessionManager?.getSessionId();\n if (sessionId === undefined || sessionId === \"\") return undefined;\n const toldSession = told.get(sessionId) ?? new Set<string>();\n const fresh = currentEvents()\n .filter(\n ({ name, event }) =>\n event.finishedAtMs > options.processStartMs && !toldSession.has(name),\n )\n .sort(\n (a, b) => a.event.finishedAtMs - b.event.finishedAtMs || (a.name < b.name ? -1 : 1),\n );\n if (fresh.length === 0) return undefined;\n for (const { name } of fresh) toldSession.add(name);\n told.set(sessionId, toldSession);\n return { additionalContext: upgradeReminder(fresh.map(({ event }) => event)) };\n } catch {\n return undefined;\n }\n });\n };\n}\n\nexport default function docksKitPluginUpgrades(pi: ExtensionApi): void {\n pluginUpgrades({ home: homedir(), processStartMs: PROCESS_START_MS })(pi);\n}\n",
28
28
  "SoT/.omp/plugin/skills/workspace-hygiene/SKILL.md": "---\nname: workspace-hygiene\ndescription: Use when a task creates or ends with worktrees, temporary files or directories, servers, watchers, test runners, containers, clusters, tunnels, scheduled jobs, global installs, or remote test resources, or when disk or memory fills up. Says where to create each resource and how to remove it. Not for git history cleanup or dead-code removal.\n---\n\n# Workspace hygiene\n\n<constraint>\nRemove only what this task created. Never delete user data, named Docker volumes, or anything outside the classes in this skill. In the main session, ask the user first; in a subagent, list the item in your final report. Every local workstation resource is a development resource. Stop or delete a production resource only after an `ask` in the main session; see Production resources.\n</constraint>\n\n## Track what you create\n\nWhile you work, keep a list of each resource that you create.\nFor each resource, write its path, id, port, or remote name.\n\n## Resource classes\n\n| Class | Create | Remove | Keep when |\n|---|---|---|---|\n| Git worktree | `<data>/agent-worktrees/<repo>/<name>`; reuse a worktree of the same branch | `git worktree remove -- <path>`, then `git worktree prune`; one `--force` only after the commits are on the remote and the changes are generated files | its pull request is open |\n| Temporary file or directory | a directory from `scratch_new` or `docks-kit scratch new <label>`; each temporary file inside it; never `/tmp` | `scratch_remove`, or `docks-kit scratch remove <path>`; `gio trash` does not work on a `tmpfs` `/tmp` | a later step reads it |\n| Test artifacts (coverage, test results, traces, screenshots, videos) | inside the worktree, git-ignored | removed with the worktree; in the user's checkout, `gio trash -- <path>` | the user asked for them |\n| Server, watcher, test runner, browser | named bash service or async job; single-run tests | `write proc://<id>/kill`; outside omp, `kill <pid>` | the user asked for it |\n| Container or compose stack | `docker run --rm`; `docker compose up` in the worktree; no restart policy | `docker compose down`; `docker stop <id>`; on a remote Docker host, only for a development target; ask first for production | its worktree is kept |\n| Docker volume, network, or buildx builder that the task created | only for the task | `docker volume rm`, `docker network rm`, `docker buildx rm` | never |\n| Cluster or virtual machine | only on request | the tool's stop or delete command; for a remote cluster, only for a development target; ask first for production | the user asked for it |\n| Tunnel or port forward | named bash service | stop the local service; delete a remote tunnel only for a development target; ask first for production | the user asked for it |\n| Detached terminal session | do not create | `tmux kill-session -t <name>`, `screen -S <name> -X quit` | never |\n| Scheduled job or service | only on request | remove the entry or unit | the user asked for it |\n| Global install | only on request | the matching uninstall command | the user asked for it |\n| Git stash or local branch | avoid stash; if you must stash, give a unique message with `-m`; one branch per plan | find the short ID that the reminder names with `git stash list --format='%h %gd %gs'`; pop that entry by its `stash@{n}` name, in the worktree where you made it, only when its message is a unique message that you gave with `-m`; otherwise do not pop or drop it, and name it in your final answer; when that worktree is removed, do not pop the entry in another worktree, and name it in your final answer; never apply, pop, or drop a stash entry that you did not create; `git branch -d <branch>` after the merge | the branch has an open pull request |\n| Remote test resource (database branch, preview deployment, fork, cloud instance) | only for the task | the provider's delete command, only for a development or preview target; ask first for production | the user asked for it |\n| Package or tool cache | never in `/tmp` | do not prune; report the size | always |\n\n## Production resources\n\n- A local workstation resource is always a development resource. This includes worktrees, local compose stacks, local servers and processes, scratch directories, and temporary files and directories. Remove it as this skill says, without an additional question.\n- A remote resource is a resource that you reach through SSH or a provider CLI, for example `wrangler`, `vercel`, `netlify`, `fly`, `supabase`, `neonctl`, `pscale`, `kubectl`, or `gh`. A Docker host that `DOCKER_HOST`, `DOCKER_CONTEXT`, or `docker --context` selects is also remote.\n- A remote target is a development target only when its name is `local`, `development`, `dev`, `test`, `homolog`, `homologation`, `staging`, or `preview`. Every other target is production.\n- Clean up a remote resource with a development target as this skill says.\n- Stop, remove, undeploy, or delete a production resource only after an `ask` in the main session immediately before the action. Do this rarely. A yolo run does not answer this ask.\n- In a subagent, never clean up a production resource. Name it in your final report.\n- Example: `wrangler delete` without `--env` acts on the top-level Worker. That Worker is usually production, so ask first.\n\n## Before your final answer\n\n1. Find each resource of your list in the table.\n2. Remove each resource that the task no longer needs. Use the command in the `Remove` column.\n3. Name each resource that you keep, and give the reason from the `Keep when` column.\n\n## Find what you cannot see\n\nRun the `tidy_report` tool, or run `docks-kit tidy --report`.\nAct only on the items that this task created.\nReport the other items to the user.\n\n## Plan runs\n\n- For a plan run, follow the Teardown rule in the `plan-lifecycle` plan contract (`plan-manager/references/plan-contract.md`). That rule decides when the run stops stacks and processes, removes the linked worktree, deletes the branch, and keeps a resource.\n\n## Automatic sweep\n\nOne time in 12 hours, a main session starts `docks-kit tidy --apply`.\nThe sweep removes merged idle worktrees and their containers.\nIt stops orphaned processes in agent directories.\nIt removes scratch directories that are idle for 7 days.\nDo not rely on the sweep for a resource that the task can remove itself.\n",
29
- "SoT/.omp/plugin/commands/cleanup.md": "---\ndescription: Remove what this session created and list other leftovers\n---\nFollow the workspace-hygiene skill. List each resource that this session created. Remove each one that the task no longer needs. Remove only local resources and remote resources whose target is not production. For a production resource, ask first, and keep it if you get no answer. Then run tidy_report, and report the items that this session did not create without removing them.\n"
29
+ "SoT/.omp/plugin/commands/cleanup.md": "---\ndescription: Remove what this session created and list other leftovers\n---\nFollow the workspace-hygiene skill. List each resource that this session created. Remove each one that the task no longer needs. Remove only local resources and remote resources whose target is not production. For a production resource, ask first, and keep it if you get no answer. Then run tidy_report, and report the items that this session did not create without removing them.\n",
30
+ "SoT/.omp/plugin/rules/file-removal.md": "---\ndescription: Remove files through the trash or a command that checks the path, never through rm or code\ncondition:\n - '(?:(?:[;&|({`''\"!]|\\\\[nr])(?:\\s|\\\\t)*|(?:\\b|(?<=\\\\[nrt]))(?:sudo|doas|env|nice|nohup|time|timeout|exec|command|xargs|then|do|else)(?:(?:\\s|\\\\t)+(?:-[ugCnI](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|-(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*|\\d(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*|\\w+=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*|\\{\\}))*(?:\\s|\\\\t)+)(?:\\w+=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*(?:\\s|\\\\t)+)*(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)\\\\*(?:[\\w.~-]*/)*(?:rm|unlink|shred)(?=[\\s;&|)`''\"\\\\])'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:\\s|\\\\t)-(?:exec|execdir|ok|okdir)(?:\\s|\\\\t)+\\\\*(?:[\\w.~-]*/)*(?:rm|unlink|shred)(?=[\\s;&|)`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)find\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*(?:\\s|\\\\t)-delete(?=[\\s;&|)`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)os\\.(?:remove|unlink|rmdir|removedirs)(?:\\s|\\\\t)*\\('\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)shutil\\.rmtree(?=[^\\w$])'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)\\.(?:unlink|rmdir)(?:\\s|\\\\t)*\\('\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)fs(?:\\.promises)?\\.(?:rm|rmdir|unlink)(?:Sync)?(?=[^\\w$])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:rmSync|unlinkSync|rmdirSync)(?=[^\\w$])'\n - '(?:(?<![\\w$.])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:rm|rmdir|unlink)(?:\\s|\\\\t)*\\('\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)Bun\\.file\\([^)]*\\)\\.delete(?:\\s|\\\\t)*\\('\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+worktree(?:\\s|\\\\t)+remove\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:--f[\\w-]*|-[a-zA-Z]*f[a-zA-Z]*)(?=[\\s=;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+rm\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)-[a-zA-Z]*[rR][a-zA-Z]*(?=[\\s=;&|)`\"''\\\\])'\nscope: \"tool:bash, tool:eval\"\nrepeatMode: always\n---\nDo not use `rm`, `unlink`, or `shred`. Do not delete files through `eval`, Python, or Node code.\n\n- To remove a temporary file or directory, use the `scratch_remove` tool or run `docks-kit scratch remove <path>`. Both remove only a path in the scratch root, the system temporary directory, or `/var/tmp`.\n- `gio trash` fails on a `tmpfs` `/tmp`.\n- To remove any other file or directory, run `gio trash -- <path>` on Linux or `trash <path>` on macOS.\n- To remove a path from the git index, run `git rm -- <path>`.\n- omp denies `git rm -r`. To remove a folder from git, run `git rm -- '<dir>/*'`. To stop tracking a folder and keep its files, run `git rm --cached -- '<dir>/*'`. Keep the quotes: git then matches every file in every subfolder.\n- To remove a worktree, run `git worktree remove -- <path>`.\n- If git refuses because the worktree has changes, do these steps:\n 1. Make sure that each commit of the worktree is on the remote.\n 2. Make sure that `git status --porcelain` lists only generated files.\n 3. Run `git worktree remove --force -- <path>` one time.\n- This rule shows for each `git worktree remove` with `--force`, `-f`, or an abbreviation of `--force`. Use that form only after the two checks above.\n- Never pass `--force` two times to `git worktree remove`.\n- Write the `--` exactly as shown.\n- If a deletion needs `rm -r` or a bulk command, do not run it. Put the paths in your report.\n",
31
+ "SoT/.omp/plugin/rules/git-safety.md": "---\ndescription: Keep repository hooks on, push without force, and do not discard work in bulk\ncondition:\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+clean(?=[\\s;&|)`\"''\\\\])(?!(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:-[a-zA-Z]*n[a-zA-Z]*|--d[\\w-]*)(?=[\\s=;&|)`\"''\\\\]))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*(?=[;&|\"]|\\\\\\\\?n)'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+reset\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)--ha(?:rd?)?(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)--no-veri(?:fy?)?(?=[\\s=;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+(?:commit|am)\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)-[a-zA-Z]*n[a-zA-Z]*(?=[\\s;&|)`\"''\\\\])'\n - '(?i)(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)\\bcore\\.hooksPath(?:(?:\\s|\\\\t)*=|(?:\\s|\\\\t)+[^\\s;&|\"''\\\\-])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+push\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:--f(?!ol)[\\w-]*|--m[\\w-]*|--pru(?:ne?)?|-[a-zA-Z]*f[a-zA-Z]*)(?=[\\s=;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+push\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:\\\\*[\"''])?\\+[\\w/:.-]'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+push\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^\"\\\\`)])*?(?:\\$|`(?=[\\w/-]))'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+push\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^\"\\\\`)])*?(?:&&|\\|\\||;)'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:&&|\\|\\||;)(?:\\s|\\\\t)*(?:\\w+=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*(?:\\s|\\\\t)+)*git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+push(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+rm\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:--f[\\w-]*|-[a-zA-Z]*f[a-zA-Z]*)(?=[\\s=;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+branch\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)-[a-zA-Z]*D[a-zA-Z]*(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+branch\\b(?=(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:-[a-zA-Z]*d[a-zA-Z]*|--d[\\w-]*)(?=[\\s=;&|)`\"''\\\\]))(?=(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:-[a-zA-Z]*f[a-zA-Z]*|--f(?!orm)[\\w-]*)(?=[\\s=;&|)`\"''\\\\]))'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+checkout\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:\\\\*[\"''])?(?:\\./?|:/)(?:\\\\*[\"''])?(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+restore(?=[\\s;&|)`\"''\\\\])(?=(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:\\\\*[\"''])?(?:\\./?|:/)(?:\\\\*[\"''])?(?=[\\s;&|)`\"''\\\\]))(?:(?=(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:--w[\\w-]*|-[a-zA-Z]*W[a-zA-Z]*)(?=[\\s=;&|)`\"''\\\\]))|(?!(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:--st[\\w-]*|-[a-zA-Z]*S[a-zA-Z]*)(?=[\\s=;&|)`\"''\\\\])))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*(?=[;&|\"]|\\\\\\\\?n)'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+stash(?:(?:\\s|\\\\t)+-[\\w-]+)*(?:\\s|\\\\t)+(?:drop|clear)(?=[\\s;&|)`\"''\\\\])'\nscope: \"tool:bash, tool:eval\"\nrepeatMode: always\n---\nDo not skip or turn off a repository hook. Do not use `--no-verify`, `git commit -n`, `git am -n`, or a `core.hooksPath` change.\n\n- When a hook fails on a problem that your change did not cause, report the failure.\n- In the main session, ask the user before you continue.\n- With `git rm` or `git push`, do not use `-f`, a flag cluster that holds `f`, or a long option that starts with `--f`, such as `--force` or `--force-with-lease`. `git push --follow-tags` is correct.\n- Do not put `+` before a ref of `git push`. `git push origin +<ref>` is a force push.\n- Do not use `git push --mirror` or `git push --prune`.\n- Write each ref of a `git push` command as literal text. Do not put `$` or a backtick in it.\n- Run `git push` as its own command. Do not chain it with `&&`, `||`, or `;`.\n- To push the current branch, run `git push -u origin HEAD`.\n- To delete several remote branches, list them in one command: `git push origin --delete <branch-a> <branch-b>`.\n- To delete a merged local branch, run `git branch -d <branch>`. Do not use `git branch -D` or `git branch -d --force`.\n- To discard the changes in one file, run `git restore -- <path>`.\n- Do not discard work in bulk (`git clean` without `-n`, `git reset --hard`, `git checkout .`, `git restore .`, `git stash drop`, `git stash clear`). In the main session, ask the user first.\n- A word after ` -- ` is a path, not an option. For example, `git clean -fd -- -n` is not a dry run.\n- In a subagent, do not run a bulk discard. Name the command in your report.\n",
32
+ "SoT/.omp/plugin/rules/literal-paths.md": "---\ndescription: Write literal absolute paths and leave HOME unchanged\ncondition:\n - '(?:[\\s=:\"''(`]|\\\\[nt])(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)~/'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)\\$HOME(?=\\W)'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)\\$\\{HOME[}:]'\n - '(?:[\\s;&|(\"''`]|\\\\[nt])(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)HOME='\nscope: \"tool:bash, tool:eval\"\nrepeatMode: always\n---\nWrite literal absolute paths in each command.\n\n- Do not use `~` or `$HOME` in a command.\n- Do not set or export `HOME`.\n",
33
+ "SoT/.omp/plugin/rules/remote-cleanup.md": "---\ndescription: Clean up a remote resource only when its target is not production\ncondition:\n - '(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:wrangler|vercel|netlify|flyctl|fly|supabase|kubectl|oc|helm|terraform|pulumi|gcloud|gsutil|aws|az|doctl|heroku|railway|neonctl|neon|pscale|turso|firebase|s3cmd|hcloud|linode-cli|scw|oci|ibmcloud|nomad|eksctl|render|mc)(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?<=[\\s:-]|\\\\t)(?:delete|destroy|remove|rm|rb|rmdir|del|purge|drop|wipe|prune|undeploy|uninstall|deprovision|teardown|down|stop|terminate)(?=[-\\s;&|)`''\"\\\\])'\n - '(?i)(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:(?:psql|mysql|sqlite3|mongosh)\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^&|\"\\\\])*?(?:\\bdrop(?:\\s|\\\\t)+(?:table|database|schema)\\b|\\.drop(?:database)?(?:\\s|\\\\t)*\\()|dropdb(?=[\\s;&|)`''\"\\\\])|redis-cli\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)flush(?:all|db)(?=[\\s;&|)`''\"\\\\]))'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)docker\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:(?:\\s|\\\\t)-[Hc](?:[\\s=]|\\\\t)?(?=[^\\s;&|\"\\\\])|(?:\\s|\\\\t)--host(?:[\\s=]|\\\\t)|(?:\\s|\\\\t)--context(?:[\\s=]|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:rm|rmi|stop|kill|prune|down)(?=[\\s;&|)`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)podman\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:(?:\\s|\\\\t)--remote(?=[\\s=]|\\\\t)|(?:\\s|\\\\t)-r(?=\\s|\\\\t)|(?:\\s|\\\\t)--connection(?:[\\s=]|\\\\t)|(?:\\s|\\\\t)--url(?:[\\s=]|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:rm|rmi|stop|kill|prune|down)(?=[\\s;&|)`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:DOCKER_(?:HOST|CONTEXT)|CONTAINER_(?:HOST|CONNECTION))=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?\\b(?:docker|podman)\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:rm|rmi|stop|kill|prune|down)(?=[\\s;&|)`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)ssh(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^\"\\\\])*?(?:[\\s''`;&|(]|\\\\[\"t])(?:sudo(?:\\s|\\\\t)+)?(?:(?:[\\w.~-]*/)*rm|trash|shred|unlink|truncate|find(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)-delete|(?:docker|podman)(?:-compose)?[^;&|\"''`\\\\]*?(?:\\s|\\\\t)(?:rm|rmi|stop|kill|down|prune)|systemctl(?:(?:\\s|\\\\t)+-[\\w-]+)*(?:\\s|\\\\t)+(?:stop|disable|mask)|kill|killall|pkill)(?=[\\s;&|)`''\"\\\\])'\n - '(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)rsync(?:\\s|\\\\t)(?=(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)--del[\\w-]*(?=[\\s=;&|)`\"''\\\\]))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:\\\\*[\"''])?(?:[\\w.-]+@)?\\w[\\w.-]*::?[^\\s;&|\"''\\\\`]*(?:\\\\*[\"''])*(?:(?:\\s|\\\\t)+(?:-[^\\s;&|\"''\\\\`]+|&?\\d*[<>]+&?(?:\\s|\\\\t)*[^\\s;&|\"''\\\\`]*)(?:\\\\*[\"''])*)*(?:\\s|\\\\t)*(?=[;&|)`\"]|\\\\[nr])'\n - '(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)rclone(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?<=\\s|\\\\t)(?:delete|deletefile|purge|rmdirs?|cleanup)(?=[\\s;&|)`''\"\\\\])'\n - '(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)rclone(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?<=\\s|\\\\t)sync(?:\\s|\\\\t)(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*?(?:\\s|\\\\t)(?:\\\\*[\"''])?[\\w.-]*\\w:[^\\s;&|\"''\\\\`]*(?:\\\\*[\"''])*(?:(?:\\s|\\\\t)+(?:-[^\\s;&|\"''\\\\`]+|&?\\d*[<>]+&?(?:\\s|\\\\t)*[^\\s;&|\"''\\\\`]*)(?:\\\\*[\"''])*)*(?:\\s|\\\\t)*(?=[;&|)`\"]|\\\\[nr])'\n - '(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)gh(?:\\s|\\\\t)+[a-z][\\w-]*(?:(?:\\s|\\\\t)+[a-z][\\w-]*)?(?:\\s|\\\\t)+(?:[a-z]+-)?delete(?=[\\s;&|)`''\"\\\\])'\n - '(?:(?<![\\w./-])|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)gh(?:\\s|\\\\t)+api\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*?(?:\\s|\\\\t)(?:-X(?:\\s|\\\\t)*|--method(?:[\\s=]|\\\\t)(?:\\s|\\\\t)*)(?:\\\\*[\"''])?(?:DELETE|delete)(?=[\\s;&|)`''\"\\\\])'\nscope: \"tool:bash, tool:eval\"\nrepeatMode: always\n---\nResources on this workstation are always development. A remote resource is one that you reach through SSH, `rsync` to a `host:` target, `rclone`, `gh`, a remote `docker` or `podman`, a database client, or a provider CLI.\n\n- Clean up a remote resource only when its target is named local, development, dev, test, homolog, homologation, staging, or preview.\n- Every other target is production. For example, `wrangler delete` without `--env` acts on the top-level Worker.\n- A cleanup deletes, removes, drops, stops, disables, kills, or prunes. Examples: `gh repo delete`, `gh api -X DELETE`, `rclone purge`, `rclone sync` to a remote, `rsync --delete` to a host, `aws s3 rb`, `DROP TABLE` in `psql`, and `ssh <host> 'systemctl stop <unit>'`.\n- A production cleanup must be rare.\n- Never stop, remove, undeploy, or delete a production resource without an `ask` immediately before it.\n- A `yolo` invocation does not answer that `ask`.\n- In a subagent, do not clean up a production resource. Name it in your report.\n",
34
+ "SoT/.omp/plugin/rules/temp-and-background.md": "---\ndescription: Keep temporary files in a scratch directory and do not leave detached processes, global installs, or scheduled jobs\ncondition:\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:mkdir|touch|tee)\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*(?:\\s|\\\\t)(?:\\\\*[\"''])?/tmp(?=[/\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:cp|mv|ln|rsync|install)\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*(?:\\s|\\\\t)(?:\\\\*[\"''])?/tmp(?:/[^\\s;&|\"''\\\\`]*)?(?:\\\\*[\"''])*(?:(?:\\s|\\\\t)+(?:-[^\\s;&|\"''\\\\`]+|&?\\d*[<>]+&?(?:\\s|\\\\t)*[^\\s;&|\"''\\\\`]*)(?:\\\\*[\"''])*)*(?:\\s|\\\\t)*(?=[;&|)`\"]|\\\\[nr])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+clone\\b(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\])*(?:\\s|\\\\t)(?:\\\\*[\"''])?/tmp(?=[/\\s;&|)`\"''\\\\])'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)>(?:\\s|\\\\t)*(?:\\\\*[\"''])?/tmp(?=[/\\s;&|)`\"''\\\\])'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:(?:\\s|\\\\t)-o(?:\\s|\\\\t)*|(?:\\s|\\\\t)--output(?:[\\s=]|\\\\t)|(?:\\s|\\\\t)--out-?dir(?:[\\s=]|\\\\t))(?:\\\\*[\"''])?/tmp(?=[/\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)mktemp(?=[\\s;&|()`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)TMPDIR=(?:\\\\*[\"''])?/tmp(?=[/\\s;&|)`\"''\\\\])'\n - '(?:(?:[;&|({`''\"!]|\\\\[nr])(?:\\s|\\\\t)*|(?:\\b|(?<=\\\\[nrt]))sudo(?:\\s|\\\\t)+)(?:\\w+=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*(?:\\s|\\\\t)+)*(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:nohup|setsid|disown)(?=[\\s;&|)`''\"\\\\])'\n - '(?:[;&|({`''\"!]|\\\\[nr])(?:\\s|\\\\t)*(?:\\w+=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*(?:\\s|\\\\t)+)*(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)tmux(?:(?:\\s|\\\\t)+-[LSf](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)*(?:(?:\\s|\\\\t)+(?:new|new-session|new-window|neww|split-window|splitw|respawn-pane|respawn-window)(?=[\\s;&|)`''\"\\\\])|(?:\\s|\\\\t)*(?=[;&|)`''\"\\\\]))'\n - '(?:[;&|({`''\"!]|\\\\[nr])(?:\\s|\\\\t)*(?:\\w+=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])*(?:\\s|\\\\t)+)*(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)screen(?:(?:\\s|\\\\t)*(?=[;&|)`''\"\\\\])|(?:\\s|\\\\t)+(?!-(?:ls|list)(?=[\\s;&|)`''\"\\\\]))[^\\s;&|)`''\"\\\\]+(?=[\\s;&|)`''\"\\\\]))'\n - '(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:\\s|\\\\t)--watch(?:All)?(?:=(?!(?:false|0)(?=[\\s;&|)`''\"\\\\]))[^\\s;&|)`''\"\\\\]*)?(?=[\\s;&|)`''\"\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)npm(?:\\s|\\\\t)+(?:(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*(?:\\s|\\\\t))?(?:i|install|add)\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*(?:\\s|\\\\t)(?:-g|--global)(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)npm(?:\\s|\\\\t)+(?:-g|--global)(?:\\s|\\\\t)+(?:i|install|add)(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:bun|pnpm)(?:\\s|\\\\t)+(?:add|install|i)\\b(?:(?!(?:\\s|\\\\t)--(?:\\s|\\\\t))(?:\\\\[^n\\\\]|\\\\\\\\(?!n)|[^;&|\"\\\\]))*(?:\\s|\\\\t)(?:-g|--global)(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:bun|pnpm)(?:\\s|\\\\t)+(?:-g|--global)(?:\\s|\\\\t)+(?:add|install|i)(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)yarn(?:\\s|\\\\t)+global(?:\\s|\\\\t)+add(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)pipx(?:\\s|\\\\t)+install(?=[-\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)cargo(?:\\s|\\\\t)+install(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)(?:go|gem|uv(?:\\s|\\\\t)+tool)(?:\\s|\\\\t)+install(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)crontab(?:(?:\\s|\\\\t)*(?=[;&|)`''\"\\\\])|(?:\\s|\\\\t)+(?!-l(?=[\\s;&|)`''\"\\\\]))[^\\s;&|)`''\"\\\\]+(?=[\\s;&|)`''\"\\\\]))'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)systemctl(?:(?:\\s|\\\\t)+-(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)*(?:\\s|\\\\t)+enable(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)docker(?:\\s|\\\\t)+system(?:\\s|\\\\t)+prune(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)docker(?:\\s|\\\\t)+(?:volume|image)(?:\\s|\\\\t)+(?:rm|prune)(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)docker(?:\\s|\\\\t)+rmi(?=[\\s;&|)`\"''\\\\])'\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)docker(?:\\s|\\\\t)+(?:builder|buildx)(?:\\s|\\\\t)+prune(?=[\\s;&|)`\"''\\\\])'\nscope: \"tool:bash, tool:eval\"\nrepeatMode: always\n---\nDo not put a temporary file, a temporary directory, a package store, a cache, or a clone in `/tmp`.\n\n- Create a temporary directory with the `scratch_new` tool or `docks-kit scratch new <label>`. Put each temporary file in that directory.\n- A scratch directory is deleted after 7 idle days. Put evidence that you cite in the issue, the pull request, or the repository.\n- Run a test suite in single-run mode.\n- Start a server, a watcher, a tunnel, or a database only as a named bash service or an async job.\n- Do not detach a process with `nohup`, `setsid`, `disown`, `tmux`, or `screen`.\n- Do not install a package globally, add a scheduled job, or enable a service unless the user asks for it. `go install`, `gem install`, and `uv tool install` are global installs too.\n- Do not remove a Docker volume, image, or build cache that you did not create.\n- Do not run `docker system prune`.\n",
35
+ "SoT/.omp/plugin/rules/worktree-location.md": "---\ndescription: Create each git worktree under the agent-worktrees data directory with a literal absolute path\ncondition:\n - '(?:\\b|(?<=\\\\[nrt]))(?<=\"(?:command|code)\"\\s*:\\s*\"(?:\\\\.|[^\"\\\\])*)git(?:(?:\\s|\\\\t)+-[Cc](?:\\s|\\\\t)+(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+|(?:\\s|\\\\t)+-[pP]|(?:\\s|\\\\t)+--[\\w-]+(?:=(?:\\\\[^nrt]|[^\\s;&|\"\\\\])+)?)*(?:\\s|\\\\t)+worktree(?:\\s|\\\\t)+add(?=[\\s;&|)`\"''\\\\])'\nscope: \"tool:bash, tool:eval\"\nrepeatMode: always\n---\nCreate a worktree only at `<data>/agent-worktrees/<repository>/<name>`.\n\n- `<data>` is `$XDG_DATA_HOME`. When that variable is not set, `<data>` is `.local/share` in the home directory.\n- `agent-worktrees` must be a whole directory name in the path.\n- Write the literal absolute path in the command. Do not use `~`, `$HOME`, or another variable in it.\n- This reminder shows each time that you add a worktree, also at the correct path. If the path follows these rules, run the same command again.\n"
30
36
  } as const
31
37
 
32
38
  export const GENERATED_PAYLOAD_BASE64 = {
@@ -57,7 +63,13 @@ export const GENERATED_PAYLOAD_PATHS = [
57
63
  "SoT/.omp/plugin/extensions/pluginUpgrades.ts",
58
64
  "SoT/.omp/plugin/skills/workspace-hygiene/SKILL.md",
59
65
  "SoT/.omp/plugin/commands/cleanup.md",
66
+ "SoT/.omp/plugin/rules/file-removal.md",
67
+ "SoT/.omp/plugin/rules/git-safety.md",
68
+ "SoT/.omp/plugin/rules/literal-paths.md",
69
+ "SoT/.omp/plugin/rules/remote-cleanup.md",
70
+ "SoT/.omp/plugin/rules/temp-and-background.md",
71
+ "SoT/.omp/plugin/rules/worktree-location.md",
60
72
  "notification.mp3"
61
73
  ] as const
62
74
 
63
- export const GENERATED_PAYLOAD_HASH = "a90b2be634be9fe6b3b7e4188475c24f15513d75fba718dd300f10f2ae407b2a"
75
+ export const GENERATED_PAYLOAD_HASH = "0fcf69ccdba9a310f13b2ac57f8a4136f971fcd4b9a57aa9c1601ac60e2d1989"