@bonesofspring/ai-rules 0.2.57 → 0.2.60
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.
- package/CHANGELOG.md +50 -0
- package/README.md +41 -3
- package/bin/cli.js +399 -27
- package/bin/lib/engine-scripts.js +3 -0
- package/bin/lib/mcp/catalog.js +97 -0
- package/bin/lib/mcp/clients.js +35 -2
- package/bin/lib/mcp/credentials.js +85 -1
- package/bin/lib/mcp/doctor.js +93 -17
- package/bin/lib/mcp/registry.js +10 -4
- package/bin/lib/seed-ai-local-team.js +8 -5
- package/docs/MCP-CATALOG.md +56 -0
- package/docs/MCP-SETUP.md +38 -6
- package/docs/PRESET-CONTRIBUTION.md +1 -0
- package/mcp/github-proxy.mjs +133 -0
- package/mcp/lib/github.mjs +187 -0
- package/mcp/lib/streamable-http.mjs +185 -0
- package/mcp/lib/yandex.mjs +16 -137
- package/package.json +3 -1
- package/presets/_shared/ai-local/scripts/check-write-scope.mjs +212 -0
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +343 -50
- package/presets/_shared/ai-local/scripts/run.mjs +122 -3
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +12 -0
- package/presets/_shared/core/review/code-review-mr.md +10 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +143 -1
- package/presets/claude/android-kotlin/commands/update.md +1 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/go/commands/update.md +1 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/go/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/ios-swift/commands/update.md +1 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/java/commands/update.md +1 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/java/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/mcp-ts/commands/update.md +1 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/mol/commands/update.md +1 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/claude/next/agents/build-verifier.md +2 -0
- package/presets/claude/next/agents/code-reviewer.md +8 -0
- package/presets/claude/next/commands/task-continue.md +3 -1
- package/presets/claude/next/commands/update.md +1 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/claude/nuxt/commands/update.md +1 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/claude/php-hexagonal/commands/update.md +1 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/php-laravel/commands/update.md +1 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/svelte/commands/update.md +1 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +143 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +12 -0
- package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/cursor/android-kotlin/commands/update.md +1 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/go/commands/update.md +1 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/go/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/ios-swift/commands/update.md +1 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/java/commands/update.md +1 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/java/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/mcp-ts/commands/update.md +1 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/mol/MCP.md +4 -3
- package/presets/cursor/mol/commands/update.md +1 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/mol/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/next/MCP.md +4 -3
- package/presets/cursor/next/agents/build-verifier.md +2 -0
- package/presets/cursor/next/agents/code-reviewer.md +8 -0
- package/presets/cursor/next/commands/task-continue.md +3 -1
- package/presets/cursor/next/commands/update.md +1 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/next/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/nuxt/commands/update.md +1 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/nuxt/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/php-hexagonal/commands/update.md +1 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/php-laravel/commands/update.md +1 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/svelte/commands/update.md +1 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +143 -1
- package/presets/cursor/svelte/rules/code-review-mr.mdc +10 -0
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/commands/update.md +1 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/android-kotlin/rules/code-review-mr.md +10 -0
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/commands/update.md +1 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/go/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/go/rules/code-review-mr.md +10 -0
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/commands/update.md +1 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/ios-swift/rules/code-review-mr.md +10 -0
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/commands/update.md +1 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/java/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/java/rules/code-review-mr.md +10 -0
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/commands/update.md +1 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/mcp-ts/rules/code-review-mr.md +10 -0
- package/presets/mavis/mol/MCP.md +4 -3
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/commands/update.md +1 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/mol/rules/code-review-mr.md +10 -0
- package/presets/mavis/next/MCP.md +4 -3
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/agents/build-verifier.md +2 -0
- package/presets/mavis/next/agents/code-reviewer.md +8 -0
- package/presets/mavis/next/commands/task-continue.md +3 -1
- package/presets/mavis/next/commands/update.md +1 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/next/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/next/rules/code-review-mr.md +10 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/commands/update.md +1 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/nuxt/rules/code-review-mr.md +10 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/commands/update.md +1 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/php-hexagonal/rules/code-review-mr.md +10 -0
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/commands/update.md +1 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/php-laravel/rules/code-review-mr.md +10 -0
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/commands/update.md +1 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +143 -1
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/svelte/rules/code-review-mr.md +10 -0
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/commands/update.md +1 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/android-kotlin/rules/code-review-mr.md +10 -0
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/commands/update.md +1 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/go/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/go/rules/code-review-mr.md +10 -0
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/commands/update.md +1 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/ios-swift/rules/code-review-mr.md +10 -0
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/commands/update.md +1 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/java/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/java/rules/code-review-mr.md +10 -0
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/commands/update.md +1 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/mcp-ts/rules/code-review-mr.md +10 -0
- package/presets/opencode/mol/MCP.md +4 -3
- package/presets/opencode/mol/adapter-map.json +1 -1
- package/presets/opencode/mol/commands/update.md +1 -0
- package/presets/opencode/mol/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/mol/rules/code-review-mr.md +10 -0
- package/presets/opencode/next/MCP.md +4 -3
- package/presets/opencode/next/adapter-map.json +1 -1
- package/presets/opencode/next/agents/build-verifier.md +2 -0
- package/presets/opencode/next/agents/code-reviewer.md +8 -0
- package/presets/opencode/next/commands/task-continue.md +3 -1
- package/presets/opencode/next/commands/update.md +1 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/next/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/next/rules/code-review-mr.md +10 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/commands/update.md +1 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/nuxt/rules/code-review-mr.md +10 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/commands/update.md +1 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/php-hexagonal/rules/code-review-mr.md +10 -0
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/commands/update.md +1 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/php-laravel/rules/code-review-mr.md +10 -0
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/commands/update.md +1 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +143 -1
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/svelte/rules/code-review-mr.md +10 -0
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/commands/update.md +1 -0
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/android-kotlin/rules/code-review-mr.md +10 -0
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/commands/update.md +1 -0
- package/presets/zcode/go/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/go/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/go/rules/code-review-mr.md +10 -0
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/commands/update.md +1 -0
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/ios-swift/rules/code-review-mr.md +10 -0
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/commands/update.md +1 -0
- package/presets/zcode/java/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/java/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/java/rules/code-review-mr.md +10 -0
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/commands/update.md +1 -0
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/mcp-ts/rules/code-review-mr.md +10 -0
- package/presets/zcode/mol/MCP.md +4 -3
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/commands/update.md +1 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/mol/rules/code-review-mr.md +10 -0
- package/presets/zcode/next/MCP.md +4 -3
- package/presets/zcode/next/adapter-map.json +1 -1
- package/presets/zcode/next/agents/build-verifier.md +2 -0
- package/presets/zcode/next/agents/code-reviewer.md +8 -0
- package/presets/zcode/next/commands/task-continue.md +3 -1
- package/presets/zcode/next/commands/update.md +1 -0
- package/presets/zcode/next/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/next/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/next/rules/code-review-mr.md +10 -0
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/commands/update.md +1 -0
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/nuxt/rules/code-review-mr.md +10 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/commands/update.md +1 -0
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/php-hexagonal/rules/code-review-mr.md +10 -0
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/commands/update.md +1 -0
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/php-laravel/rules/code-review-mr.md +10 -0
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/commands/update.md +1 -0
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +143 -1
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/svelte/rules/code-review-mr.md +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.60
|
|
4
|
+
|
|
5
|
+
`0.2.58` (no tag, no npm version) and `0.2.59` (a tag, no npm version) were never published — their notes ship as `0.2.60`.
|
|
6
|
+
|
|
7
|
+
### Operator control, loop preview, and install integrity
|
|
8
|
+
|
|
9
|
+
- **Operator pause sentinel.** The chain hook checks `.ai.local/STOP` (also `.ai.local/ESTOP`) before it activates or advances a step. While engaged it records `state: paused` / `phase: paused`, emits no handoff, and prints the sentinel reason; an empty or unreadable file still counts as engaged, and a sentinel that cannot be stat-ed is treated as engaged with a warning rather than ignored. The completing receipt and `attempt_finished` event still land, and a paused human gate stays open and is resumed through the same `end_human_gate` path. The seeded `.ai.local/.gitignore` gains `STOP` and `ESTOP`. Remove the file and run `/task-continue`: the command now accepts `state: paused`, resumes a paused human gate through the same path, and otherwise closes the pause through the hook instead of advancing by hand.
|
|
10
|
+
- **Stale-attempt takeover.** Before a new attempt opens, an `activeAttempts` entry for that step (or its parallel group) older than `AI_RULES_ATTEMPT_STALE_MS` (milliseconds; default 60 minutes, `60000` floor) with no terminal manifest receipt is reclaimed as `attempt_finished` with `outcome: "stale"` and `source: "hook"`, removed from `activeAttempts`, and named in a warning. An attempt belonging to another step is left alone — in graph mode it is reclaimed by that step's own activation or terminal receipt — a terminal receipt wins, and a fresh attempt is never reclaimed.
|
|
11
|
+
- **`run.mjs --dry-run`.** Runs the same derive and improver decision path and prints `DRY RUN — no files, signals, or ledger rows will be written`, then per signature the tier/action, target, before/after, and the exact file + ledger writes it would perform. It creates no lock or intent file and appends no signal or ledger row; `--status` is unchanged and still read-only.
|
|
12
|
+
- **`rule-improver.mjs --rollback <ref>`.** Resolves the newest invertible `rule-changes.jsonl` entry by target path, signature, or exact ISO timestamp, pre-checks that the target still holds the entry's `after`, and appends the `rollback` safety row through the existing `rollbackInverse`. A changed target or an ambiguous ref writes nothing and exits 1. The write must land inside the ledger's `.ai.local` overlay: a symlinked path component, or a real path outside the overlay, is refused before anything is written.
|
|
13
|
+
- **Write-scope reconciliation.** New read-only `presets/_shared/ai-local/scripts/check-write-scope.mjs`, shipped as `.ai.local/scripts/check-write-scope.mjs` and seeded as the fourteenth engine module, labels every changed path `declared` / `derived` / `out-of-scope` against the step's `writeScopes`, hard-fails an implementation step, reports a reviewer/verifier step as advisory, and supports `--step`, `--base`, `--root`, `--paths`, and `--json`. Exit `1` on an out-of-scope path in an implementation step, `0` for a reviewer/verifier advisory, `2` on a usage or config error. Wired into the build-verifier and code-reviewer prompts and documented in the orchestrator rule, never the hook.
|
|
14
|
+
- **Install-state doctor.** `ai-rules doctor [--json]` reports `missing` / `modified` managed files, `legacy-manifest` for a schema-v1 install, `version-mismatch`, and `stale-engine` / `missing-engine` for the shared `.ai.local/scripts/` set, naming the module. Read-only, no `--fix`; the F-1 mixed-engine `SyntaxError` is one `stale-engine` finding. Exit `0` is clean, `1` means findings, `2` a usage error.
|
|
15
|
+
- **Review breadth budget.** `code-review-mr` bounds the call-site sweep and the one-hop consumer read (40 changed symbols or 15 minutes) and adds a `partial` depth-pass outcome that names every unread path. The five depth passes still run on what was read; the diff stays a floor, not the boundary.
|
|
16
|
+
- **Gates.** `check-preset-structure.sh` runs the new `test-write-scope.mjs` and `test-install-doctor.mjs`, and its hook block runs the pause-sentinel and stale-attempt suites; the pack-tarball, CLI registration, init-clean and rule-improver ledger suites gain GitHub, rollback and seeded-script cases. The self-review contract exempts the read-only `check-write-scope.mjs` from the loop-module `child_process` ban because it shells out to git. CLI goldens are recaptured for the new engine module, the two `.ai.local/.gitignore` lines, and the changed `run.mjs` / `rule-improver.mjs` hashes.
|
|
17
|
+
|
|
18
|
+
### Preset-tree lock: the generator and the gate stop racing
|
|
19
|
+
|
|
20
|
+
- **The race.** `yarn fix:generated` deletes and rebuilds each platform stack, so a gate that reads `presets/**` while it runs fails on a file that is momentarily absent. Both sides now take one advisory lock, `packages/ai-rules/.preset-tree-lock/` (`owner.json` = `pid`, `label`, `startedAt`).
|
|
21
|
+
- **Acquire and release.** A second acquire against a live owner is refused with the owner's label, pid and start time; a dead pid, a corrupt `owner.json`, or an owner-less directory is reclaimed and reported; `release` removes only the caller's lock. A lock path the OS refuses to create is skipped with a warning and the command proceeds unlocked — the lock never turns an unwritable checkout into a red build. It stays advisory: a process that never asks for it can still race.
|
|
22
|
+
- **CLI.** `node scripts/lib/preset-tree-lock.mjs acquire --label <label> [--pid <pid>] [--root <dir>]` exits `0` when acquired or unwritable, `1` when a live owner holds it; `release [--pid <pid>] [--root <dir>]` exits `0` released, `1` refused; a usage error exits `2`.
|
|
23
|
+
- **Wiring.** `fix-generated.mjs` holds the lock across every generator, the Claude settings sync, and the golden captures, and releases it in `finally`; a live owner stops the run with the next step. `check-preset-structure.sh` takes the same lock before it reads `presets/**` and releases it on exit, so a concurrent run reports "the preset tree is being regenerated; re-run the gate when it finishes" instead of failing on a missing hook. `.preset-tree-lock/` is git-ignored.
|
|
24
|
+
- **Fixtures.** `test-preset-tree-lock.mjs` covers acquire/release, a live owner (the second acquire leaves the owner untouched), a stale-owner reclaim, a refused foreign release, the unwritable path, and the CLI exit codes; `check-preset-structure.sh` runs it as its own row.
|
|
25
|
+
|
|
26
|
+
### Update covers the fifth platform
|
|
27
|
+
|
|
28
|
+
- **Command surface.** All 55 `commands/update.md` files (11 stacks × 5 platforms) list `.zcode/.ai-rules-install.json` beside the other four manifests; the CLI already had `zcode` in `UPDATE_TARGETS`, but the documented record list and the dogfood install did not. `test-cli-update.mjs` parses `UPDATE_TARGETS` and asserts every shipped `update.md` documents every target root, so a sixth platform cannot leave the docs behind.
|
|
29
|
+
- **Dogfood install.** The root `.zcode` tree was created by `sync-dogfood-zcode.sh`, which copies preset bytes but writes no install manifest, so `update` skipped it. A one-time `init zcode --preset next` now records `.zcode/.ai-rules-install.json` (and refreshes the stale tree to the current preset); `update` reports `zcode (next)` on every run after that.
|
|
30
|
+
|
|
31
|
+
### GitHub MCP provider
|
|
32
|
+
|
|
33
|
+
- **`mcp setup github`.** The managed pack gains a GitHub provider: the official remote GitHub MCP server (`https://api.githubcopilot.com/mcp/`) behind a stdio proxy (`mcp/github-proxy.mjs`), registered into the same five client shapes as GitLab and Yandex. The token is read from the shell (`GITHUB_TOKEN`, or `GITHUB_PERSONAL_ACCESS_TOKEN`) or from `.env.github` in the project root; the package never writes a GitHub secret and never puts one into a client config. `mcp remove --purge` never deletes the consumer-owned `.env.github`.
|
|
34
|
+
- **`mcp doctor` default scope.** With no provider argument the doctor checks every managed-pack provider, GitHub included. A project that had GitLab and Yandex configured and passing now also gets `github` registration and credentials failures and exits 1 until it runs `mcp setup github`; `mcp doctor github` (or any single provider) scopes the run. `mcp setup all` and `mcp add all` cover GitHub too, so `setup all` needs `GITHUB_TOKEN` (or `.env.github`) and stops at the GitHub step without one; `mcp remove all` removes the GitHub entry as well. The CLI registration suite pins the default report: GitLab, GitHub, Yandex Tracker and Yandex Wiki each appear, the run exits 1 while any of them is unconfigured, and every next step names its own setup command.
|
|
35
|
+
- **Credential flow.** `mcp setup github` validates the token against `GET /user` before it registers anything, refuses to run while `.env.github` is not git-ignored, and writes no credential file. `mcp doctor github` reports runtime, registration, credentials and upstream, with one actionable next step per failure (missing token, unignored file, rejected token, unreachable endpoint). A token held in `.env.github` counts as a secret at rest even when the shell shadows it, so the ignore check still applies to that file; a file that holds no token is reported as such instead of being passed over.
|
|
36
|
+
- **Shared transport.** The streamable-HTTP transport (one POST per JSON-RPC message, JSON or SSE response, session id and protocol-version tracking) moved to `mcp/lib/streamable-http.mjs` and is now shared by the Yandex proxy and the GitHub proxy; the Yandex error semantics (`UnauthorizedError` on 401, `UpstreamError` otherwise, token redaction) are unchanged.
|
|
37
|
+
- **Overrides.** `GITHUB_MCP_URL` and `GITHUB_API_URL` point the provider at a GitHub Enterprise endpoint or a local relay; `mcp run github --print-env` prints the masked mapping (`GITHUB_TOKEN=***`).
|
|
38
|
+
- **Client registration.** The MCP doctor previously read a hardcoded four-client map with a flat `mcpServers` key; it now resolves every client through the registry entry (`clientById`) and a dotted-key lookup (`containerAt`), so the ZCode client (`.zcode/config.json`, nested `mcp.servers`) is checked like the other four. The registry's secret-value pattern also matches `gh[pousr]_` and `github_pat_`, so a GitHub token left inside a client config is reported.
|
|
39
|
+
- **Docs.** `docs/MCP-SETUP.md` gains the GitHub sequence and a § Diagnostics rule for the doctor's default scope; the preset `MCP.md` lists GitHub in the managed pack. The package README documents `doctor`, `--dry-run`, `--rollback`, the fourteen-module engine set and the `STOP`/`ESTOP` ignore lines; `docs/PRESET-CONTRIBUTION.md` gains the write-scope audit row.
|
|
40
|
+
|
|
41
|
+
### The requirements checker separates declared from executed steps
|
|
42
|
+
|
|
43
|
+
- **`--require-receipts`.** `check-requirements-compliance.mjs --task <slug|dir> --require-receipts` compares every routed step that produces a required artifact against the task's `artifact-manifest.json`: a step whose entry is not `completed` or `archived` is `E_STEP_UNEXECUTED` and exit `1`. Without the flag the same gap stays an advisory `declared, not executed: <id> (<agent>)` note, so a compliant artifact set is no longer enough when the caller asks for execution evidence. The flag applies only to `--task`; `--integrity`, `--routing`, and `--census` reject it with exit `2`.
|
|
44
|
+
- **Fixtures.** The checker's suite covers the advisory note, the strict `E_STEP_UNEXECUTED` failure, completed entries satisfying the flag, and the three usage errors.
|
|
45
|
+
|
|
46
|
+
### Upgrade
|
|
47
|
+
|
|
48
|
+
- Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks and the shared orchestrator/review rules.
|
|
49
|
+
- `.ai.local/scripts/` stays skip-if-exists: delete `run.mjs` and `rule-improver.mjs` before the update to take `--dry-run` and `--rollback`; `check-write-scope.mjs` is new and is seeded on the next `init` or `update`.
|
|
50
|
+
- Run `npx @bonesofspring/ai-rules doctor` after the update; a `stale-engine` finding names the module that is still the old copy.
|
|
51
|
+
- The preset-tree lock and `--require-receipts` are preset-repository tooling, not installed files: no consumer action and no engine seed for either.
|
|
52
|
+
|
|
3
53
|
## 0.2.57
|
|
4
54
|
|
|
5
55
|
### L2-lite and a lighter bounded-contract pipeline
|
package/README.md
CHANGED
|
@@ -6,7 +6,9 @@ Presets for **Cursor**, **Claude Code**, **Mavis** (MiniMax `mcode`), **OpenCode
|
|
|
6
6
|
npx @bonesofspring/ai-rules init multi --preset next
|
|
7
7
|
npx @bonesofspring/ai-rules update # reinstall tools already recorded in this repo
|
|
8
8
|
npx @bonesofspring/ai-rules update --merge-ai-local # fast-forward files whose recorded base still matches; edits and pre-record files stay put
|
|
9
|
+
npx @bonesofspring/ai-rules doctor # read-only install health: managed files, engine set, version
|
|
9
10
|
npx @bonesofspring/ai-rules clean cursor # never deletes .ai.local/
|
|
11
|
+
npx @bonesofspring/ai-rules init mcp --all # third-party catalog: context7, playwright, chrome-devtools, figma-desktop, figma-cloud
|
|
10
12
|
```
|
|
11
13
|
|
|
12
14
|
Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `next`. Forms: `init cursor --preset next`, `init cursor next`, `init cursor`. Global: `npm i -g @bonesofspring/ai-rules`.
|
|
@@ -23,9 +25,22 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
|
|
|
23
25
|
| Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all five; ZCode loads it natively) | | | | |
|
|
24
26
|
| `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
|
|
25
27
|
| Template drift | **`.ai.local/.template-base.json`** (shared; one record per tree of files that hold a shipped template byte; `update` prints one drift line, `update --merge-ai-local` fast-forwards a file only when its recorded base still matches and reports the rest) | | | |
|
|
26
|
-
| Self-learning engine | **`.ai.local/scripts/`** (shared;
|
|
28
|
+
| Self-learning engine | **`.ai.local/scripts/`** (shared; fourteen scripts — the engine, `manifest.mjs`, the six `team-db*.mjs` projection modules, and the read-only `check-write-scope.mjs` write audit; existing files never overwritten) | | | |
|
|
27
29
|
| Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
|
|
28
30
|
|
|
31
|
+
### Project MCP catalog
|
|
32
|
+
|
|
33
|
+
`init mcp` writes the third-party servers this package uses into every installed client; `--tools` narrows the list to the clients you name. Entries render in each client's native shape and merge like `init`: extra servers, the consumer's `env` / `headers`, and other top-level keys stay. Names: `context7`, `playwright` (Claude's id is `playwright-test`), `chrome-devtools`, `figma-desktop` (alias `figma`, the local `http://127.0.0.1:3845/mcp` server), and `figma-cloud` (the remote `https://mcp.figma.com/mcp` server); `--all` selects every one.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @bonesofspring/ai-rules init mcp context7
|
|
37
|
+
npx @bonesofspring/ai-rules init mcp figma-desktop figma-cloud
|
|
38
|
+
npx @bonesofspring/ai-rules init mcp --all --tools cursor,claude
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Details: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md). The credential-bearing pack (GitLab, GitHub, Yandex) is a separate command group: the `mcp setup|add|remove|doctor|refresh|run` namespace.
|
|
42
|
+
|
|
43
|
+
|
|
29
44
|
The engine is the in-task self-learning loop: `.ai.local/signals.jsonl` → `.ai.local/rule-changes.jsonl` →
|
|
30
45
|
`.ai.local/conventions.md` / `.ai.local/rules-library/`. The chain hook runs it after every producer receipt; run it
|
|
31
46
|
yourself when the hook is disabled:
|
|
@@ -34,13 +49,16 @@ yourself when the hook is disabled:
|
|
|
34
49
|
node .ai.local/scripts/run.mjs # derive → append → improve
|
|
35
50
|
node .ai.local/scripts/run.mjs --status # read-only: per-signature state, last capture, envelope
|
|
36
51
|
node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture is broken
|
|
52
|
+
node .ai.local/scripts/run.mjs --dry-run # read-only preview: decision, target, before/after, exact writes
|
|
37
53
|
```
|
|
38
54
|
|
|
55
|
+
`build-verifier` and `code-reviewer` also run the read-only write audit `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id>`: it labels every changed path `declared`, `derived`, or `out-of-scope` against the step's `writeScopes`. It is never a hook gate.
|
|
56
|
+
|
|
39
57
|
`init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
|
|
40
58
|
`--force`. Re-running `init` does not update a seeded module, so delete the file to pick up a newer engine. The seeded
|
|
41
59
|
tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created when absent, missing
|
|
42
|
-
required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `
|
|
43
|
-
`team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
|
|
60
|
+
required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `STOP`, `ESTOP`, `team.db`,
|
|
61
|
+
`team.db-wal`, `team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
|
|
44
62
|
|
|
45
63
|
The seeded engine copy is **skip-if-exists** too, so a consumer that already holds `.ai.local/scripts/rule-improver.mjs`
|
|
46
64
|
keeps the old engine and does **not** get the per-store budget split — the human store `.ai.local/rules/**` (≤ 5 rules,
|
|
@@ -55,6 +73,8 @@ rm .ai.local/scripts/team-db-schema.mjs
|
|
|
55
73
|
npx @bonesofspring/ai-rules update
|
|
56
74
|
```
|
|
57
75
|
|
|
76
|
+
`--dry-run` and `--rollback` live in the newer `run.mjs` / `rule-improver.mjs`, so the same two deletions take them.
|
|
77
|
+
|
|
58
78
|
The 0.2.56 delete-task release also changes `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and
|
|
59
79
|
`team-db-openapi.mjs`; delete those too if you are taking both changes.
|
|
60
80
|
|
|
@@ -69,6 +89,21 @@ The command strips the provenance footer from `.ai.local/rules-library/<stem>.md
|
|
|
69
89
|
engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`); a
|
|
70
90
|
copy of a shipped template carries none.
|
|
71
91
|
|
|
92
|
+
Undo one auto-applied ledger entry; the command is fail-closed:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
node .ai.local/scripts/rule-improver.mjs --rollback <target|signature|ISO timestamp>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`--rollback` resolves the newest matching `rule-changes.jsonl` entry, refuses when the
|
|
99
|
+
target changed since that entry or the ref is ambiguous, and appends a `rollback` safety row
|
|
100
|
+
that is itself the inverse. It writes nothing on refusal.
|
|
101
|
+
|
|
102
|
+
`--dry-run` runs the same derive and improver decision path as the real loop, prints
|
|
103
|
+
`DRY RUN — no files, signals, or ledger rows will be written`, and shows per signature the tier/action, target,
|
|
104
|
+
before/after, and the exact file and ledger writes it would perform. It creates no lock, no intent file, and no
|
|
105
|
+
signal append; `--status` stays read-only and unchanged.
|
|
106
|
+
|
|
72
107
|
The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
|
|
73
108
|
|
|
74
109
|
```bash
|
|
@@ -122,6 +157,8 @@ Mavis never writes `~/.minimax/**`. OpenCode never writes `~/.config/opencode/**
|
|
|
122
157
|
|
|
123
158
|
`update` reinstalls each tool whose `<tool>/.ai-rules-install.json` is already present, using the `preset` field `init` wrote (`platform` + `preset`). Slash command `/update` runs that CLI. A tool without a manifest stays uninstalled, and the recorded preset stays as stored. To switch preset, run `init <tool> --preset <name>`.
|
|
124
159
|
|
|
160
|
+
`doctor` is the read-only install-state check. For every installed platform it reports `missing` or `modified` managed files, a manifest without a `managedFiles` map, `legacy-manifest` for schema v1, and a `version-mismatch` between the manifest's `packageVersion` and the package you are running. Once per project it compares `.ai.local/scripts/` with `presets/_shared/ai-local/scripts/` and reports `stale-engine` (naming the module) or `missing-engine`; the F-1 class — an old `run.mjs` next to a newer `rule-improver.mjs` — is exactly one `stale-engine` finding. `--json` prints one object. Exit `0` means clean, `1` means findings, `2` means a usage error (unknown option, bad positional, bad `--cwd`). There is no `--fix`: fix by re-running `init` / `update` after deleting the changed seeded module.
|
|
161
|
+
|
|
125
162
|
On session start (Cursor and Claude hooks; Mavis, OpenCode, and ZCode on the first reply) the preset compares that recorded `packageVersion` with the latest `@bonesofspring/ai-rules` release. When a newer release exists, the reply opens with a level-2 heading and a blockquote naming the installed version, the latest version, and `/update`. That block stays out of the task answer. `/update` then says the update finished successfully, or that it did not, without quoting the exit code.
|
|
126
163
|
|
|
127
164
|
## Stacks
|
|
@@ -155,6 +192,7 @@ Every installed preset ships requestable `anti-hallucination-contract` (not alwa
|
|
|
155
192
|
- Guide: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md)
|
|
156
193
|
- Overlay: [`docs/LOCAL-OVERLAY.md`](docs/LOCAL-OVERLAY.md)
|
|
157
194
|
- MCP setup: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md)
|
|
195
|
+
- MCP catalog: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md)
|
|
158
196
|
- Dogfood: [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/sync-dogfood-claude.sh`](scripts/sync-dogfood-claude.sh), [`scripts/sync-dogfood-mavis.sh`](scripts/sync-dogfood-mavis.sh), [`scripts/sync-dogfood-opencode.sh`](scripts/sync-dogfood-opencode.sh) — seeds `.ai.local/team`, preserves slugs
|
|
159
197
|
- Gates: `yarn check:preset-structure`
|
|
160
198
|
|