@bonesofspring/ai-rules 0.2.57 → 0.2.61
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 +127 -0
- package/README.md +91 -20
- package/bin/cli.js +714 -33
- package/bin/lib/ai-local-drift.js +18 -0
- package/bin/lib/engine-scripts.js +25 -5
- package/bin/lib/engine-upgrade.js +279 -0
- package/bin/lib/mcp/catalog.js +158 -0
- package/bin/lib/mcp/clients.js +35 -2
- package/bin/lib/mcp/credentials.js +173 -1
- package/bin/lib/mcp/doctor.js +192 -24
- package/bin/lib/mcp/npx.js +17 -0
- package/bin/lib/mcp/registry.js +12 -4
- package/bin/lib/merged-config.js +38 -0
- package/bin/lib/seed-ai-local-team.js +37 -19
- package/docs/MCP-CATALOG.md +84 -0
- package/docs/MCP-SETUP.md +62 -6
- package/docs/OPENCODE.md +22 -2
- package/docs/PLATFORMS.md +38 -0
- package/docs/PRESET-CONTRIBUTION.md +12 -1
- package/docs/TEAM-DB.md +187 -20
- package/docs/openapi/team-db.v1.json +4443 -2083
- package/mcp/defectdojo-mcp.mjs +353 -0
- package/mcp/github-proxy.mjs +133 -0
- package/mcp/gitlab.mjs +5 -1
- package/mcp/lib/defectdojo.mjs +249 -0
- package/mcp/lib/github.mjs +187 -0
- package/mcp/lib/streamable-http.mjs +185 -0
- package/mcp/lib/yandex.mjs +55 -152
- package/package.json +11 -3
- package/presets/_shared/ai-local/scripts/check-write-scope.mjs +212 -0
- package/presets/_shared/ai-local/scripts/lock.mjs +139 -19
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +343 -50
- package/presets/_shared/ai-local/scripts/run.mjs +122 -3
- package/presets/_shared/ai-local/scripts/signals.mjs +17 -1
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +496 -67
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +816 -5
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +761 -6
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +10 -0
- package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +2360 -0
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +87 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +151 -9
- package/presets/_shared/ai-local/scripts/upstream-research.mjs +2961 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +13 -0
- 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/README.md +23 -3
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +200 -4
- package/presets/{claude/nuxt/hooks/guard-shell-command.sh → _shared/hooks/guard-shell-command.mjs.tmpl} +29 -35
- package/presets/_shared/hooks/run-hook.mjs +102 -0
- package/presets/claude/android-kotlin/commands/update.md +1 -0
- package/presets/claude/android-kotlin/hooks/README.md +4 -3
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/android-kotlin/hooks/examples/README.md +2 -2
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/android-kotlin/hooks/run-hook.mjs +102 -0
- 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/android-kotlin/settings.json +2 -2
- package/presets/claude/android-kotlin/team/README.md +5 -0
- package/presets/claude/go/commands/update.md +1 -0
- package/presets/claude/go/hooks/README.md +4 -3
- package/presets/claude/go/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/go/hooks/examples/README.md +2 -2
- package/presets/claude/go/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/go/hooks/run-hook.mjs +102 -0
- 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/go/settings.json +2 -2
- package/presets/claude/go/team/README.md +5 -0
- package/presets/claude/ios-swift/commands/update.md +1 -0
- package/presets/claude/ios-swift/hooks/README.md +4 -3
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/ios-swift/hooks/examples/README.md +2 -2
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/ios-swift/hooks/run-hook.mjs +102 -0
- 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/ios-swift/settings.json +2 -2
- package/presets/claude/ios-swift/team/README.md +5 -0
- package/presets/claude/java/commands/update.md +1 -0
- package/presets/claude/java/hooks/README.md +4 -3
- package/presets/claude/java/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/java/hooks/examples/README.md +2 -2
- package/presets/claude/java/hooks/{guard-shell-command.sh → guard-shell-command.mjs} +31 -38
- package/presets/claude/java/hooks/run-hook.mjs +102 -0
- 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/java/settings.json +2 -2
- package/presets/claude/java/team/README.md +5 -0
- package/presets/claude/mcp-ts/commands/update.md +1 -0
- package/presets/claude/mcp-ts/hooks/README.md +4 -3
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/mcp-ts/hooks/examples/README.md +1 -1
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/mcp-ts/hooks/run-hook.mjs +102 -0
- 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/mcp-ts/settings.json +2 -2
- package/presets/claude/mcp-ts/team/README.md +5 -0
- package/presets/claude/mol/commands/update.md +1 -0
- package/presets/claude/mol/hooks/README.md +20 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/{svelte/hooks/guard-shell-command.sh → mol/hooks/guard-shell-command.mjs} +29 -35
- package/presets/claude/mol/hooks/run-hook.mjs +102 -0
- 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/mol/settings.json +2 -2
- package/presets/claude/mol/team/README.md +5 -0
- package/presets/claude/next/agents/build-verifier.md +4 -0
- package/presets/claude/next/agents/code-reviewer.md +10 -0
- package/presets/claude/next/agents/feature-developer.md +1 -0
- package/presets/claude/next/agents/task-analyst.md +4 -0
- package/presets/claude/next/agents/task-router.md +5 -3
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/task-continue.md +4 -2
- package/presets/claude/next/commands/update.md +1 -0
- package/presets/claude/next/commands/upstream-research.md +23 -0
- package/presets/claude/next/hooks/README.md +4 -3
- package/presets/claude/next/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/next/hooks/examples/README.md +2 -2
- package/presets/claude/next/hooks/guard-shell-command.mjs +94 -0
- package/presets/claude/next/hooks/run-hook.mjs +102 -0
- 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/next/settings.json +2 -2
- package/presets/claude/next/team/README.md +23 -0
- package/presets/claude/next/team/upstream/config.json +31 -0
- package/presets/claude/next/team/upstream/digest-template.md +55 -0
- package/presets/claude/next/team/upstream/opencode.json +34 -0
- package/presets/claude/next/team/upstream/projects.json +4 -0
- package/presets/claude/next/team/upstream/prompt.md +77 -0
- package/presets/claude/next/team/upstream/signatures.json +9 -0
- package/presets/claude/nuxt/commands/update.md +1 -0
- package/presets/claude/nuxt/hooks/README.md +4 -3
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/nuxt/hooks/examples/README.md +2 -2
- package/presets/claude/{ios-swift/hooks/guard-shell-command.sh → nuxt/hooks/guard-shell-command.mjs} +29 -37
- package/presets/claude/nuxt/hooks/run-hook.mjs +102 -0
- 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/nuxt/settings.json +2 -2
- package/presets/claude/nuxt/team/README.md +5 -0
- package/presets/claude/php-hexagonal/commands/update.md +1 -0
- package/presets/claude/php-hexagonal/hooks/README.md +4 -3
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/php-hexagonal/hooks/examples/README.md +2 -2
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/php-hexagonal/hooks/run-hook.mjs +102 -0
- 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-hexagonal/settings.json +2 -2
- package/presets/claude/php-hexagonal/team/README.md +5 -0
- package/presets/claude/php-laravel/commands/update.md +1 -0
- package/presets/claude/php-laravel/hooks/README.md +4 -3
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/php-laravel/hooks/examples/README.md +2 -2
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/php-laravel/hooks/run-hook.mjs +102 -0
- 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/php-laravel/settings.json +2 -2
- package/presets/claude/php-laravel/team/README.md +5 -0
- package/presets/claude/svelte/commands/update.md +1 -0
- package/presets/claude/svelte/hooks/README.md +4 -3
- package/presets/claude/svelte/hooks/chain-team-phases.sh +200 -4
- package/presets/claude/svelte/hooks/examples/README.md +2 -2
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +94 -0
- package/presets/claude/svelte/hooks/run-hook.mjs +102 -0
- 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/claude/svelte/settings.json +2 -2
- package/presets/claude/svelte/team/README.md +5 -0
- package/presets/cursor/android-kotlin/commands/update.md +1 -0
- package/presets/cursor/android-kotlin/hooks/README.md +2 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/android-kotlin/hooks/run-hook.mjs +102 -0
- package/presets/cursor/android-kotlin/hooks.json +2 -2
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/android-kotlin/team/README.md +5 -0
- package/presets/cursor/go/commands/update.md +1 -0
- package/presets/cursor/go/hooks/README.md +2 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/go/hooks/examples/README.md +1 -1
- package/presets/cursor/go/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/go/hooks/run-hook.mjs +102 -0
- package/presets/cursor/go/hooks.json +2 -2
- package/presets/cursor/go/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/go/team/README.md +5 -0
- package/presets/cursor/ios-swift/commands/update.md +1 -0
- package/presets/cursor/ios-swift/hooks/README.md +2 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/ios-swift/hooks/run-hook.mjs +102 -0
- package/presets/cursor/ios-swift/hooks.json +2 -2
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/ios-swift/team/README.md +5 -0
- package/presets/cursor/java/commands/update.md +1 -0
- package/presets/cursor/java/hooks/README.md +2 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/java/hooks/examples/README.md +1 -1
- package/presets/cursor/java/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/java/hooks/run-hook.mjs +102 -0
- package/presets/cursor/java/hooks.json +2 -2
- package/presets/cursor/java/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/java/team/README.md +5 -0
- package/presets/cursor/mcp-ts/commands/update.md +1 -0
- package/presets/cursor/mcp-ts/hooks/README.md +2 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/mcp-ts/hooks/run-hook.mjs +102 -0
- package/presets/cursor/mcp-ts/hooks.json +2 -2
- package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/mcp-ts/team/README.md +5 -0
- package/presets/cursor/mol/MCP.md +4 -3
- package/presets/cursor/mol/commands/update.md +1 -0
- package/presets/cursor/mol/hooks/README.md +2 -1
- package/presets/cursor/mol/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/mol/hooks/examples/README.md +1 -1
- package/presets/{claude/next/hooks/guard-shell-command.sh → cursor/mol/hooks/guard-shell-command.mjs} +29 -35
- package/presets/cursor/mol/hooks/run-hook.mjs +102 -0
- package/presets/cursor/mol/hooks.json +2 -2
- package/presets/cursor/mol/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/mol/team/README.md +5 -0
- package/presets/cursor/next/MCP.md +4 -3
- package/presets/cursor/next/agents/build-verifier.md +4 -0
- package/presets/cursor/next/agents/code-reviewer.md +10 -0
- package/presets/cursor/next/agents/feature-developer.md +1 -0
- package/presets/cursor/next/agents/task-analyst.md +4 -0
- package/presets/cursor/next/agents/task-router.md +5 -3
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/task-continue.md +4 -2
- package/presets/cursor/next/commands/update.md +1 -0
- package/presets/cursor/next/commands/upstream-research.md +23 -0
- package/presets/cursor/next/hooks/README.md +2 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/next/hooks/examples/README.md +1 -1
- package/presets/cursor/next/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/next/hooks/run-hook.mjs +102 -0
- package/presets/cursor/next/hooks.json +2 -2
- package/presets/cursor/next/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/next/team/README.md +23 -0
- package/presets/cursor/next/team/upstream/config.json +31 -0
- package/presets/cursor/next/team/upstream/digest-template.md +55 -0
- package/presets/cursor/next/team/upstream/opencode.json +34 -0
- package/presets/cursor/next/team/upstream/projects.json +4 -0
- package/presets/cursor/next/team/upstream/prompt.md +77 -0
- package/presets/cursor/next/team/upstream/signatures.json +9 -0
- package/presets/cursor/nuxt/commands/update.md +1 -0
- package/presets/cursor/nuxt/hooks/README.md +2 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/nuxt/hooks/run-hook.mjs +102 -0
- package/presets/cursor/nuxt/hooks.json +2 -2
- package/presets/cursor/nuxt/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/nuxt/team/README.md +5 -0
- package/presets/cursor/php-hexagonal/commands/update.md +1 -0
- package/presets/cursor/php-hexagonal/hooks/README.md +2 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/php-hexagonal/hooks/run-hook.mjs +102 -0
- package/presets/cursor/php-hexagonal/hooks.json +2 -2
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/php-hexagonal/team/README.md +5 -0
- package/presets/cursor/php-laravel/commands/update.md +1 -0
- package/presets/cursor/php-laravel/hooks/README.md +2 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/php-laravel/hooks/run-hook.mjs +102 -0
- package/presets/cursor/php-laravel/hooks.json +2 -2
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/php-laravel/team/README.md +5 -0
- package/presets/cursor/svelte/commands/update.md +1 -0
- package/presets/cursor/svelte/hooks/README.md +2 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +200 -4
- package/presets/cursor/svelte/hooks/examples/README.md +1 -1
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/svelte/hooks/run-hook.mjs +102 -0
- package/presets/cursor/svelte/hooks.json +2 -2
- package/presets/cursor/svelte/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/svelte/team/README.md +5 -0
- package/presets/mavis/android-kotlin/adapter-map.json +11 -3
- package/presets/mavis/android-kotlin/commands/update.md +1 -0
- package/presets/mavis/android-kotlin/hooks/README.md +2 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +200 -4
- 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/android-kotlin/team/README.md +5 -0
- package/presets/mavis/go/adapter-map.json +11 -3
- package/presets/mavis/go/commands/update.md +1 -0
- package/presets/mavis/go/hooks/README.md +2 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +200 -4
- 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/go/team/README.md +5 -0
- package/presets/mavis/ios-swift/adapter-map.json +11 -3
- package/presets/mavis/ios-swift/commands/update.md +1 -0
- package/presets/mavis/ios-swift/hooks/README.md +2 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +200 -4
- 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/ios-swift/team/README.md +5 -0
- package/presets/mavis/java/adapter-map.json +11 -3
- package/presets/mavis/java/commands/update.md +1 -0
- package/presets/mavis/java/hooks/README.md +2 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +200 -4
- 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/java/team/README.md +5 -0
- package/presets/mavis/mcp-ts/adapter-map.json +11 -3
- package/presets/mavis/mcp-ts/commands/update.md +1 -0
- package/presets/mavis/mcp-ts/hooks/README.md +2 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +200 -4
- 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/mcp-ts/team/README.md +5 -0
- package/presets/mavis/mol/MCP.md +4 -3
- package/presets/mavis/mol/adapter-map.json +11 -3
- package/presets/mavis/mol/commands/update.md +1 -0
- package/presets/mavis/mol/hooks/README.md +2 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +200 -4
- 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/mol/team/README.md +5 -0
- package/presets/mavis/next/MCP.md +4 -3
- package/presets/mavis/next/adapter-map.json +67 -3
- package/presets/mavis/next/agents/build-verifier.md +4 -0
- package/presets/mavis/next/agents/code-reviewer.md +10 -0
- package/presets/mavis/next/agents/feature-developer.md +1 -0
- package/presets/mavis/next/agents/task-analyst.md +4 -0
- package/presets/mavis/next/agents/task-router.md +5 -3
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/task-continue.md +4 -2
- package/presets/mavis/next/commands/update.md +1 -0
- package/presets/mavis/next/commands/upstream-research.md +18 -0
- package/presets/mavis/next/hooks/README.md +2 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +200 -4
- 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/next/team/README.md +23 -0
- package/presets/mavis/next/team/upstream/config.json +31 -0
- package/presets/mavis/next/team/upstream/digest-template.md +55 -0
- package/presets/mavis/next/team/upstream/opencode.json +34 -0
- package/presets/mavis/next/team/upstream/projects.json +4 -0
- package/presets/mavis/next/team/upstream/prompt.md +77 -0
- package/presets/mavis/next/team/upstream/signatures.json +9 -0
- package/presets/mavis/nuxt/adapter-map.json +11 -3
- package/presets/mavis/nuxt/commands/update.md +1 -0
- package/presets/mavis/nuxt/hooks/README.md +2 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +200 -4
- 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/nuxt/team/README.md +5 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +11 -3
- package/presets/mavis/php-hexagonal/commands/update.md +1 -0
- package/presets/mavis/php-hexagonal/hooks/README.md +2 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +200 -4
- 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-hexagonal/team/README.md +5 -0
- package/presets/mavis/php-laravel/adapter-map.json +11 -3
- package/presets/mavis/php-laravel/commands/update.md +1 -0
- package/presets/mavis/php-laravel/hooks/README.md +2 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +200 -4
- 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/php-laravel/team/README.md +5 -0
- package/presets/mavis/svelte/adapter-map.json +11 -3
- package/presets/mavis/svelte/commands/update.md +1 -0
- package/presets/mavis/svelte/hooks/README.md +2 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +200 -4
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +12 -0
- package/presets/mavis/svelte/rules/code-review-mr.md +10 -0
- package/presets/mavis/svelte/team/README.md +5 -0
- package/presets/opencode/android-kotlin/OPENCODE.md +1 -1
- package/presets/opencode/android-kotlin/README.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +11 -3
- package/presets/opencode/android-kotlin/commands/update.md +1 -0
- package/presets/opencode/android-kotlin/hooks/README.md +3 -2
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +200 -4
- 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/android-kotlin/team/README.md +5 -0
- package/presets/opencode/go/OPENCODE.md +1 -1
- package/presets/opencode/go/README.md +1 -1
- package/presets/opencode/go/adapter-map.json +11 -3
- package/presets/opencode/go/commands/update.md +1 -0
- package/presets/opencode/go/hooks/README.md +3 -2
- package/presets/opencode/go/hooks/chain-team-phases.sh +200 -4
- 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/go/team/README.md +5 -0
- package/presets/opencode/ios-swift/OPENCODE.md +1 -1
- package/presets/opencode/ios-swift/README.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +11 -3
- package/presets/opencode/ios-swift/commands/update.md +1 -0
- package/presets/opencode/ios-swift/hooks/README.md +3 -2
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +200 -4
- 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/ios-swift/team/README.md +5 -0
- package/presets/opencode/java/OPENCODE.md +1 -1
- package/presets/opencode/java/README.md +1 -1
- package/presets/opencode/java/adapter-map.json +11 -3
- package/presets/opencode/java/commands/update.md +1 -0
- package/presets/opencode/java/hooks/README.md +3 -2
- package/presets/opencode/java/hooks/chain-team-phases.sh +200 -4
- 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/java/team/README.md +5 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +1 -1
- package/presets/opencode/mcp-ts/README.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +11 -3
- package/presets/opencode/mcp-ts/commands/update.md +1 -0
- package/presets/opencode/mcp-ts/hooks/README.md +3 -2
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +200 -4
- 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/mcp-ts/team/README.md +5 -0
- package/presets/opencode/mol/MCP.md +4 -3
- package/presets/opencode/mol/OPENCODE.md +1 -1
- package/presets/opencode/mol/README.md +1 -1
- package/presets/opencode/mol/adapter-map.json +11 -3
- package/presets/opencode/mol/commands/update.md +1 -0
- package/presets/opencode/mol/hooks/README.md +3 -2
- package/presets/opencode/mol/hooks/chain-team-phases.sh +200 -4
- 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/mol/team/README.md +5 -0
- package/presets/opencode/next/MCP.md +4 -3
- package/presets/opencode/next/OPENCODE.md +1 -1
- package/presets/opencode/next/README.md +1 -1
- package/presets/opencode/next/adapter-map.json +67 -3
- package/presets/opencode/next/agents/build-verifier.md +4 -0
- package/presets/opencode/next/agents/code-reviewer.md +10 -0
- package/presets/opencode/next/agents/feature-developer.md +1 -0
- package/presets/opencode/next/agents/task-analyst.md +4 -0
- package/presets/opencode/next/agents/task-router.md +5 -3
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/task-continue.md +4 -2
- package/presets/opencode/next/commands/update.md +1 -0
- package/presets/opencode/next/commands/upstream-research.md +26 -0
- package/presets/opencode/next/hooks/README.md +3 -2
- package/presets/opencode/next/hooks/chain-team-phases.sh +200 -4
- 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/next/team/README.md +23 -0
- package/presets/opencode/next/team/upstream/config.json +31 -0
- package/presets/opencode/next/team/upstream/digest-template.md +55 -0
- package/presets/opencode/next/team/upstream/opencode.json +34 -0
- package/presets/opencode/next/team/upstream/projects.json +4 -0
- package/presets/opencode/next/team/upstream/prompt.md +77 -0
- package/presets/opencode/next/team/upstream/signatures.json +9 -0
- package/presets/opencode/nuxt/OPENCODE.md +1 -1
- package/presets/opencode/nuxt/README.md +1 -1
- package/presets/opencode/nuxt/adapter-map.json +11 -3
- package/presets/opencode/nuxt/commands/update.md +1 -0
- package/presets/opencode/nuxt/hooks/README.md +3 -2
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +200 -4
- 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/nuxt/team/README.md +5 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +1 -1
- package/presets/opencode/php-hexagonal/README.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +11 -3
- package/presets/opencode/php-hexagonal/commands/update.md +1 -0
- package/presets/opencode/php-hexagonal/hooks/README.md +3 -2
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +200 -4
- 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-hexagonal/team/README.md +5 -0
- package/presets/opencode/php-laravel/OPENCODE.md +1 -1
- package/presets/opencode/php-laravel/README.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +11 -3
- package/presets/opencode/php-laravel/commands/update.md +1 -0
- package/presets/opencode/php-laravel/hooks/README.md +3 -2
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +200 -4
- 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/php-laravel/team/README.md +5 -0
- package/presets/opencode/svelte/OPENCODE.md +1 -1
- package/presets/opencode/svelte/README.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +11 -3
- package/presets/opencode/svelte/commands/update.md +1 -0
- package/presets/opencode/svelte/hooks/README.md +3 -2
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +200 -4
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +12 -0
- package/presets/opencode/svelte/rules/code-review-mr.md +10 -0
- package/presets/opencode/svelte/team/README.md +5 -0
- package/presets/zcode/android-kotlin/adapter-map.json +11 -3
- package/presets/zcode/android-kotlin/commands/update.md +1 -0
- package/presets/zcode/android-kotlin/hooks/README.md +2 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +200 -4
- 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/android-kotlin/team/README.md +5 -0
- package/presets/zcode/go/adapter-map.json +11 -3
- package/presets/zcode/go/commands/update.md +1 -0
- package/presets/zcode/go/hooks/README.md +2 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +200 -4
- 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/go/team/README.md +5 -0
- package/presets/zcode/ios-swift/adapter-map.json +11 -3
- package/presets/zcode/ios-swift/commands/update.md +1 -0
- package/presets/zcode/ios-swift/hooks/README.md +2 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +200 -4
- 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/ios-swift/team/README.md +5 -0
- package/presets/zcode/java/adapter-map.json +11 -3
- package/presets/zcode/java/commands/update.md +1 -0
- package/presets/zcode/java/hooks/README.md +2 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +200 -4
- 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/java/team/README.md +5 -0
- package/presets/zcode/mcp-ts/adapter-map.json +11 -3
- package/presets/zcode/mcp-ts/commands/update.md +1 -0
- package/presets/zcode/mcp-ts/hooks/README.md +2 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +200 -4
- 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/mcp-ts/team/README.md +5 -0
- package/presets/zcode/mol/MCP.md +4 -3
- package/presets/zcode/mol/adapter-map.json +11 -3
- package/presets/zcode/mol/commands/update.md +1 -0
- package/presets/zcode/mol/hooks/README.md +2 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +200 -4
- 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/mol/team/README.md +5 -0
- package/presets/zcode/next/MCP.md +4 -3
- package/presets/zcode/next/adapter-map.json +67 -3
- package/presets/zcode/next/agents/build-verifier.md +4 -0
- package/presets/zcode/next/agents/code-reviewer.md +10 -0
- package/presets/zcode/next/agents/feature-developer.md +1 -0
- package/presets/zcode/next/agents/task-analyst.md +4 -0
- package/presets/zcode/next/agents/task-router.md +5 -3
- package/presets/zcode/next/commands/README.md +1 -0
- package/presets/zcode/next/commands/task-continue.md +4 -2
- package/presets/zcode/next/commands/update.md +1 -0
- package/presets/zcode/next/commands/upstream-research.md +26 -0
- package/presets/zcode/next/hooks/README.md +2 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +200 -4
- 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/next/team/README.md +23 -0
- package/presets/zcode/next/team/upstream/config.json +31 -0
- package/presets/zcode/next/team/upstream/digest-template.md +55 -0
- package/presets/zcode/next/team/upstream/opencode.json +34 -0
- package/presets/zcode/next/team/upstream/projects.json +4 -0
- package/presets/zcode/next/team/upstream/prompt.md +77 -0
- package/presets/zcode/next/team/upstream/signatures.json +9 -0
- package/presets/zcode/nuxt/adapter-map.json +11 -3
- package/presets/zcode/nuxt/commands/update.md +1 -0
- package/presets/zcode/nuxt/hooks/README.md +2 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +200 -4
- 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/nuxt/team/README.md +5 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +11 -3
- package/presets/zcode/php-hexagonal/commands/update.md +1 -0
- package/presets/zcode/php-hexagonal/hooks/README.md +2 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +200 -4
- 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-hexagonal/team/README.md +5 -0
- package/presets/zcode/php-laravel/adapter-map.json +11 -3
- package/presets/zcode/php-laravel/commands/update.md +1 -0
- package/presets/zcode/php-laravel/hooks/README.md +2 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +200 -4
- 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/php-laravel/team/README.md +5 -0
- package/presets/zcode/svelte/adapter-map.json +11 -3
- package/presets/zcode/svelte/commands/update.md +1 -0
- package/presets/zcode/svelte/hooks/README.md +2 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +200 -4
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +12 -0
- package/presets/zcode/svelte/rules/code-review-mr.md +10 -0
- package/presets/zcode/svelte/team/README.md +5 -0
- package/presets/claude/android-kotlin/hooks/guard-shell-command.sh +0 -103
- package/presets/claude/go/hooks/guard-shell-command.sh +0 -102
- package/presets/claude/mcp-ts/hooks/guard-shell-command.sh +0 -102
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.sh +0 -103
- package/presets/claude/php-laravel/hooks/guard-shell-command.sh +0 -103
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/go/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/ios-swift/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/java/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/mol/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/next/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/nuxt/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/php-laravel/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/svelte/hooks/guard-shell-command.sh +0 -77
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,132 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.61
|
|
4
|
+
|
|
5
|
+
### Cross-platform support
|
|
6
|
+
|
|
7
|
+
- **Hook registration through Node.** Every Cursor and Claude stack registers the guard and the chain hook as `node <file>.mjs` commands, so hook startup no longer depends on a shell being executable. `failClosed: true` stays on the guard; the chain hook stays fail-open.
|
|
8
|
+
- **Guard as an `.mjs` file.** The bash guard is replaced by one Node source rendered per stack; the deny/allow contract is unchanged (malformed stdin → `allow`, destructive git → `ask`, package-manager mismatch → `ask`). An existing consumer tree keeps the old `.cursor/hooks/guard-shell-command.sh` / `.claude/hooks/guard-shell-command.sh` as an inert, unmanaged file, because `init` does not delete paths it no longer manages — delete it manually after upgrading. The `.claude/settings.json` merge drops the two legacy bash commands (`guard-shell-command.sh`, `chain-team-phases.sh`) from every event group before it adds the Node commands, so a re-init does not leave a dead hook beside the live one; no other consumer command is touched.
|
|
9
|
+
- **Chain-hook bash resolver.** A Node resolver locates `bash` (PATH, then the usual Git Bash locations on Windows), forwards stdin/stdout, and exits 0 with one actionable line when bash is absent, so a machine without bash no longer blocks the pipeline silently.
|
|
10
|
+
- **Node 20 floor.** `engines.node` is `>=20` in the package and the workspace, and both READMEs link the platform matrix. The `team-db` SQLite projection still needs Node 22.13+ and degrades to file-only below it.
|
|
11
|
+
- **`.gitattributes`.** A repository-root attribute file forces LF for shell scripts, JavaScript, JSON, Markdown, and workflow files, so a Windows checkout cannot produce CRLF shebangs or byte-digest drift; image and font assets stay binary.
|
|
12
|
+
- **Perl-less engine lock.** The self-learning lock keeps the `perl` `flock` fast path but falls back to an atomic directory lock with owner-pid stale recovery, so `manifest.mjs`, `signals.mjs`, and `rule-improver.mjs` work when `perl` is absent without opening a double-writer window.
|
|
13
|
+
- **Windows fixes.** The GitLab MCP runtime and `mcp doctor` launch `npx`/`npm` through the platform-aware invocation (a `.cmd` needs a shell on current Node); the scheduler forwards the Windows child environment and resolves `.cmd` executables; `team-db serve --open` survives a missing browser opener and prints one diagnostic line; signal paths are normalized from `\` to `/` before the traversal guard runs.
|
|
14
|
+
|
|
15
|
+
### Scheduled jobs
|
|
16
|
+
|
|
17
|
+
- **`team-db.mjs schedule`.** One timer per team root: `scheduler/jobs.json` holds the definitions, the lease file `scheduler/scheduler.lock` refuses a second process with exit 4 and goes stale after 90 s, and every due occurrence is claimed inside `BEGIN IMMEDIATE` against `job_runs` — so two racing firings produce one child and one `skipped` row, and `concurrency: allow` still works (no unique active-run index exists).
|
|
18
|
+
- **Bounded children.** A claimed run spawns detached in its own process group, is bounded by the job's `timeoutMs` (`SIGTERM`, a 5 s grace, then `SIGKILL` to the group), and records `succeeded` / `failed` / `timeout` / `skipped` / `interrupted` in a run manifest that is written twice (claim and finalize). `stdout` and `stderr` land in separate files capped at 1 MiB, with the byte count, sha256, and truncation flag on the row.
|
|
19
|
+
- **Two payload kinds.** `command` spawns `payload.argv` with `shell: false` (a resolved Windows `.cmd`/`.bat` is the one exception: it needs a shell); `pipeline` renders `payload.promptTemplate` into `<runDir>/prompt.md` and substitutes `{promptFile}` in a consumer-configured `payload.runner`. The child environment is `PATH`, `HOME`, `TMPDIR`, `LANG`, `TZ` plus `envPassthrough` names (plus the Windows system names on `win32`); no `AI_RULES_TEAM_DB_*` value is forwarded and no new dependency is added — the cron parser and next-fire are hand-written on `node:*` with `Intl` zone math (both `Europe/Berlin` 2027 DST transitions are fixtures).
|
|
20
|
+
- **Definitions are files.** `jobs list|get|put|delete|enable|disable|reconcile|run` write `scheduler/jobs.json` first (sorted by `id`, atomic, an unchanged rewrite is byte-identical) and project `scheduled_jobs`; `--dry-run` writes nothing, a stale `revision` is `409 E_CONFLICT`, and an invalid definition is refused with the offending parameter and the file untouched.
|
|
21
|
+
- **Retention and recovery.** 1 MiB per stream per run, 200 runs per job, 30 days, 2 GiB per team root, never pruning an active run; `state.json` keeps the last fire instant, so a restart replays a gap once (`run-once`) or up to five occurrences (`catch-up`) and a clock jump backwards never re-fires. A `claimed`/`running` run whose process is gone is reconciled to `interrupted` with `E_ORPHANED` before the first fire; `sync --rebuild` and `sync --vacuum` refuse with `E_SCHEDULER_RUNNING` while a fresh lease exists. The kill switch drains: no new claim, the in-flight child finishes, exit 0.
|
|
22
|
+
- **No redaction.** Run output is persisted verbatim under `scheduler/runs/**`, which `.ai.local/.gitignore` ignores together with `state.json`; `jobs.json` stays tracked.
|
|
23
|
+
- **Schema v2.** Migration `0002-scheduler` adds `scheduled_jobs`, `job_runs`, `job_run_events`, and five indexes; migration 1's bytes and checksum literal are unchanged. A v1 database carries a fingerprint that no longer describes the schema, so the next open moves it aside as `team.db.mismatch-<stamp>` and rebuilds from the task files.
|
|
24
|
+
- **Contract.** Nine job routes take the API to 32 operations (`jobs` list/create, `jobs/{id}` read/update/delete, its runs and run log, and run-now), with per-route body bounds (64 KiB for a job write, 1 KiB for run-now), `E_CONFLICT` / `E_SCHEDULER_OFFLINE` in the documented code table plus `E_ORPHANED` as the run reason, `capabilities` gaining `jobs` and `schedule`, and `Health.scheduler` derived from the lease. The two existing `spawnSync` mutations became asynchronous bounded children, so no request path blocks the event loop.
|
|
25
|
+
- **Dashboard.** `team-db.mjs serve` gains a jobs list with filters and load-more, a job detail with recent runs, a run page with two incremental log streams polled at 2 000 ms by byte offset, a create/edit form with per-field errors, enable/disable, run-now, and delete — each destructive action behind its own confirmation, and every section with empty, error, and loading states.
|
|
26
|
+
- **Install surface.** `team-db-scheduler.mjs` joins `ENGINE_SCRIPTS` (fifteen modules) and the seeded `.ai.local/.gitignore`; an existing consumer receives it plus migration 2 through one `update --fix` (the missing module by the seed, the stale schema by the guard, backed up before it is overwritten). `update --check` names that eligible rel set and writes none of it; a module the consumer edited is kept byte-identical.
|
|
27
|
+
- **Gates.** New `test-team-db-scheduler.mjs`; `test-team-db-concurrency.mjs` adds a scheduler-versus-projector run on one database, a `SIGKILL`ed scheduler that leaves `integrity_check` ok and one `interrupted` row, 50 finalized runs inside the WAL bound, and a held exclusive lock that neither hangs nor leaves a lease; `test-team-db-fixtures.mjs` plants a defect for every new or edited gate (migration 2 checksum, claim overlap, capture cap, route parity at 32, `E_DISABLED` ordering, the dashboard per-route table, the app operations table). Both suites are wired into `check-preset-structure.sh` and `yarn test:team-db`.
|
|
28
|
+
|
|
29
|
+
### Upstream research
|
|
30
|
+
|
|
31
|
+
- **Weekly and manual evolution review.** A new `upstream-research` pipeline job runs one engine module, `.ai.local/scripts/upstream-research.mjs`, over a growing registry of comparison repositories. A run probes `opencode` first (exit `10` / `11` before any cursor, digest, or project write), scans each due clone with `git fetch --depth 1`, labels exactly one window (`range`, `baseline`, `unprovable`, `no-change`), calls a read-only agent, validates a marked JSON answer, re-checks every citation inside the clone, dedupes by mechanism, and commits one ranked digest to `docs/upstream/digest-<runId>.md`.
|
|
32
|
+
- **Registry and caps are data.** `.ai.local/team/upstream/projects.json` is typed and bounded (`schemaVersion: 1`, named `E_REGISTRY_*` errors, ≤ 100 entries, `refs.branch` must be a git ref name and never a `git` option); `config.json` carries the frozen caps (5 projects, 20 minutes per project, 60 minutes total, 3 digest items) with the same loader; the per-project cursor is git-ignored, type-checked, and rebuilt from the newest `report.json`. `config.agent.model` is `null` by default, so the call uses the model the installed `opencode` resolves; a `provider/model` id adds `--model` to the call with no code change.
|
|
33
|
+
- **Read-only agent.** `team/upstream/opencode.json` ships `agent.upstream-researcher` with a global `"*": "deny"` — no built-in, MCP, or custom tool — plus `edit`, `bash`, `read`, `glob`, `grep`, `list`, `webfetch`, `websearch`, `task`, and `external_directory` denied on `*`; the invocation is `opencode run --agent upstream-researcher --format json --archived --auto`, never `--worktree`. Before phase 1 the runner resolves the installed agent with `opencode debug agents` and fails `E_AGENT_CONFIG_INVALID` (12) if the wildcard or any named action was widened, or if the deciding deny is narrower than resource `*`. The runner also compares `git status --porcelain` before and after each call (`E_WORKTREE_CHANGED`, `E_UPSTREAM_DIRTY`).
|
|
34
|
+
- **Durable dedupe.** The attribution list is git-ignored, so `.ai.local/team/upstream/signatures.json` is the durable index (`generatedFrom.{path,sha256,rows}`). An adopted mechanism drops; a rejected one returns only with an `invalidates` change inside the window; a near-miss is kept and annotated; missing prior art marks every idea `dedupe: unverified` and never new.
|
|
35
|
+
- **Failure isolation.** One failed project leaves the run successful; every project failing exits `13` with a digest; `budget.maxConsecutiveAgentFailures` stops starting projects and marks the tail `skipped: agent-unavailable`; one `budget.projectTimeoutMs` deadline bounds a project's scan and both agent attempts; `concurrency: skip` records `E_CONCURRENCY_SKIP`; the scheduler's closed reason codes stay untouched, so the job row reports `E_EXIT_<n>`.
|
|
36
|
+
- **Install surface.** `upstream-research.mjs` joins `ENGINE_SCRIPTS`; `.ai.local/.gitignore` gains `team/upstream/cursor.json`; `init`/`update` refresh `prompt.md`, `digest-template.md`, and `opencode.json` while seeding `projects.json`, `config.json`, and `signatures.json` only when absent; `/upstream-research` queues a run and adds one `schedule --once` tick when the timer is offline. Docs: `docs/TEAM-DB.md` § Upstream research job, `docs/OPENCODE.md` § Upstream research agent.
|
|
37
|
+
- **Gates.** New `scripts/test-upstream-research.mjs` covers the probe failures, registry and policy bounds, the four window labels, the fetch-failure cursor guarantee, the answer schema and one-retry path, the full read-only deny set plus the runtime `debug agents` assertion, the ref-option and digest-forgery FAIL-direction fixtures, the evidence drop, prior-art parsing and dedupe, the digest ranking/state machine/prune survival, and the isolation/budget/ordering rules; `scripts/test-team-db-scheduler.mjs` stays green with `team-db-scheduler.mjs` byte-identical. All 55 CLI goldens are recaptured by `fix:generated`.
|
|
38
|
+
|
|
39
|
+
### Engine repair verbs
|
|
40
|
+
|
|
41
|
+
- **`update --fix`.** Upgrades a seeded `.ai.local/scripts/` module only when its current bytes still match the shipped digest recorded in `.ai.local/.template-base.json`. A consumer-edited module is reported `kept modified` and left byte-identical; a module with no recorded base is reported `unattributable` and never written; a symlinked module is reported `skipped symlink` and never written through. `--no-backup` skips the durable copy; failure atomicity and the `safe-path` refusal stay on.
|
|
42
|
+
- **Backup and restore.** The default run writes `.ai.local/.rollback/engine-<stamp>/<rel>` for every overwritten module before the first module write, keeps the five newest `engine-*` runs, and never touches `template-drift/` or `legacy-team-*`. Restore with `cp -R .ai.local/.rollback/engine-<stamp>/.ai.local .`.
|
|
43
|
+
- **`update --check` parity.** The `check fast-forward .ai.local/scripts/<name>` set is computed from the same plan as the `--fix` write set — including a module whose recorded base names a tool you have since cleaned — and is exactly that set; `--check` still writes nothing.
|
|
44
|
+
- **`doctor --fix` and `fixable`.** Every doctor finding now carries `fixable` (`stale-engine` → `true`; `missing-engine`, `modified`, `legacy-manifest`, and `version-mismatch` → `false`). `doctor --fix` runs the same plan and writer, re-runs its checks, prints the post-state, and exits `0` only when that state is clean; `doctor --json` keeps `schemaVersion: 1` and adds one `fix` field when `--fix` ran.
|
|
45
|
+
- **Finding split.** `stale-engine` now means "bytes still equal the recorded shipped base, so the module is safely upgradeable". A consumer-edited module is `modified` (`fixable: false`), removing the conflation that made the old `stale-engine` report unsafe to repair.
|
|
46
|
+
- **`init --fix`.** Rejected with exit `1` and a message pointing at `update --fix`; `init` keeps skip-if-exists and never overwrites a consumer module.
|
|
47
|
+
- **Gates.** `test-engine-upgrade.mjs` covers `current`, `modified`, `stale`, and `no-base`, the `--check`/`--fix` set equality, backup/restore/retention, a backup-failure abort, `init --fix`, the `fixable` table, and the help block; it is wired into `check-preset-structure.sh` after `cli-install-doctor`.
|
|
48
|
+
|
|
49
|
+
### Project MCP catalog
|
|
50
|
+
|
|
51
|
+
- **`init mcp`.** `ai-rules init mcp <name…|--all> [--tools <list>]` writes the third-party servers this package uses into every detected client (`--tools` narrows the set and warns for a client that is not installed). One canonical catalog in `bin/lib/mcp/catalog.js` renders into each client's native shape: Cursor `.cursor/mcp.json` (`mcpServers`), Claude `.mcp.json` (remotes carry `type: "http"`), Mavis `.mavis/mcp.json`, OpenCode `opencode.json` (`local` argv / `remote` url), ZCode `.zcode/config.json` (nested `mcp.servers`). Names: `context7`, `playwright` (Claude's own id is `playwright-test`), `chrome-devtools`, `next-devtools`, `semgrep`, `sentry`, `figma-desktop` (alias `figma`), `figma-cloud`, `storybook`, plus the runtime rows `defectdojo`, `gitlab`, `github`, `yandex-tracker`, `yandex-wiki` that resolve to `npx -y @bonesofspring/ai-rules@<version> mcp run <slug>`.
|
|
52
|
+
- **Merge and idempotence.** A catalog id is written or refreshed and its scalar fields (`command`, `args`, `url`, `type`) win; a foreign server id, consumer `env` / `headers`, and other top-level keys stay. A second run is byte-identical and does not move the file mtime (it prints `already up to date`); a file that is not valid JSON, or whose `mcp` / `mcpServers` key is not an object, exits `1` untouched. Pins mirror `presets/<tool>/next/mcp.json`, and `test-cli-mcp-catalog.mjs` — wired into `check-preset-structure.sh` — fails when the two drift, when a catalog row is missing on any client shape, or when the doctor stops reporting a registered-but-unconfigured provider.
|
|
53
|
+
- **DefectDojo runtime provider.** `mcp/defectdojo-mcp.mjs` over `mcp/lib/defectdojo.mjs` is the new stdio wrapper; `mcp setup defectdojo` reads `DEFECTDOJO_URL` / `DEFECTDOJO_TOKEN` from the shell or `.env.defectdojo` in the project root, refuses to run while that file is not git-ignored, validates the pair with `GET /api/v2/findings/` before registering anything, and never writes the secret. `mcp doctor` with no provider now covers five providers (GitLab, GitHub, Yandex Tracker, Yandex Wiki, DefectDojo) and names one next step per failure; `mcp remove --purge` deletes only `.ai-rules/mcp/{credentials,config}.env` and never the consumer's `.env.defectdojo`. Docs: `docs/MCP-CATALOG.md`, `docs/MCP-SETUP.md` § 4.
|
|
54
|
+
|
|
55
|
+
### Chain hook: per-session slug binding
|
|
56
|
+
|
|
57
|
+
- **Resolution order.** The chain hook now resolves the task slug from `TEAM_TASK_SLUG`, then from a per-session lease `.ai.local/team/.session-leases/<session>.json` (session id from `OPENCODE_SESSION_ID` or `AI_RULES_SESSION_ID`, `[A-Za-z0-9_-]{1,128}`), then from `active-task.json`. A lease is written atomically (temp + rename), expires after 7 days, and stale leases are pruned on every write; the lease is best-effort and never gates a hook.
|
|
58
|
+
- **Write and warning.** Only an explicit `TEAM_TASK_SLUG` writes the lease, so a fallback-derived slug never becomes another session's binding. Every fallback prints one stderr line naming the slug and the source; an explicit binding or a lease prints none. Two parallel OpenCode sessions no longer no-op each other's handoffs, and a missing env is visible instead of silent.
|
|
59
|
+
- **Surface and gates.** The shared template and all 55 hooks carry the resolver. The `next` command twins, every stack's orchestrator rule, the OpenCode-generated `README.md` / `OPENCODE.md`, and the published `docs/OPENCODE.md` show `TEAM_TASK_SLUG=<slug>` on the manual call. The seeded `.ai.local/.gitignore` gains `team/.session-leases/` (an existing install gets the line appended by `init`/`update`). `test-chain-team-phases-session-lease.mjs` covers the explicit write, a same-session lease beating a foreign pointer, a foreign session falling back with the warning and writing no lease, and an explicit rebind; it is wired into `check-preset-structure.sh`, and the pre-existing postflight suite now binds the slug from the pointer before it calls the hook, so its runs stay warning-free.
|
|
60
|
+
|
|
61
|
+
### Leaner pipeline defaults
|
|
62
|
+
|
|
63
|
+
- **Profile caps.** `task-router` selects `full` only for app code that carries a named risk flag or an e2e AC; preset-only, docs, review, and test-only tasks are never `full`, and a `high` classification without a named flag stays `standard`. Generated trees, snapshots, CLI goldens, docs, and test fixtures do not raise the profile, so a large mechanical diff no longer buys the heavy pipeline. `light` keeps its explicit-AC meaning.
|
|
64
|
+
- **Artifact budgets.** `agent-artifact-contracts.md` ships a size table — `brief.md` ≤ 80 prose lines, `decomposition.md` ≤ 60 and only when the task has more than 3 work packages, `implementation.md` ≤ 80, `validation-report.md` ≤ 40, `review.md` ≤ 100, `.memlog.md` ≤ 40 — with evidence tables and finding rows exempt. The four producer prompts (`task-analyst`, `feature-developer`, `build-verifier`, `code-reviewer`) carry their own cap; the Cursor source, the Claude twins, the generated trees, and the goldens carry the same text.
|
|
65
|
+
- **Requirements registry removed (repo-local).** The 28-R-ID registry left this repository: `.ai.local/requirements/**`, `check-requirements-compliance.mjs`, `requirements-registry.mjs`, and `requirements-block.mjs` are gone, the two auto-created gate rules merged into `agent-pipeline-gates.md`, and `task-levels.md` is now L0–L2 with the artifact budgets above. The preset-development checklist is six lines in `.ai.local/conventions.md` § Patterns. These modules were never in `ENGINE_SCRIPTS`; consumers of `0.2.60` did not receive them and need no action.
|
|
66
|
+
|
|
67
|
+
### Faster iteration gates
|
|
68
|
+
|
|
69
|
+
- **`yarn check:changed`.** The changed-domain classifier gets a script alias (`check-preset-delta.mjs --base HEAD`), so the cheap loop is one command that names the gates a diff can affect; `yarn check:fast` stays the structure gate without the hook matrix, and `yarn check:preset-structure` remains the release gate. `docs/PRESET-CONTRIBUTION.md` gains an "iteration versus release" section.
|
|
70
|
+
- **Generated-tree cache.** `check-generated-drift.mjs` caches each generated subtree in the OS temp directory under a digest of `presets/cursor/<stack>`, `presets/_shared`, `scripts/lib`, and `package.json` (the Claude tree adds its mapping table). A source or generator edit changes the key and forces a fresh generation; a hit compares the working tree against byte-identical generated output, so the cache can never hide drift, and it is pruned after 7 days. `test-generated-cache.mjs` covers a hit, a source-edit invalidation, and the temp-directory location, and runs as its own gate row.
|
|
71
|
+
- **Hook matrix.** The coverage suite's dynamic fixtures run on the `cursor/next` representative hook instead of all 55; the other 54 stay held by the static `check-chain-hook-coverage.sh`, `check-hook-body-parity.mjs`, and the pause/stale-attempt suites. The suite drops from 15–20 minutes to ~41 s while every generated body is still asserted.
|
|
72
|
+
|
|
73
|
+
### Upgrade
|
|
74
|
+
|
|
75
|
+
- Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks, the commands, the shared rules, and the `next` agents. Pass `TEAM_TASK_SLUG=<slug>` on every manual hook call: the fallback still works, but it now warns and the lease only binds from an explicit slug. A registered host hook that cannot set the env still resolves `active-task.json` and prints that warning on each call — the intended loud signal, not an error. An existing `.ai.local/.gitignore` receives `team/.session-leases/` from the same run.
|
|
76
|
+
- `npx @bonesofspring/ai-rules init mcp --all` (or a named subset) wires the third-party servers into the installed clients; nothing is registered until you run it. Use `mcp setup defectdojo` for the new provider, and `mcp doctor` to see all five credential-bearing providers.
|
|
77
|
+
- `upstream-research.mjs` joins the sixteen-module engine seed; the next `init`/`update` installs it, and `update --fix` upgrades a seeded module whose bytes still match the recorded base (`update --check` names that set without writing).
|
|
78
|
+
- Profile caps and artifact budgets change routing and artifact size only: no file migration, no schema change, no consumer action.
|
|
79
|
+
|
|
80
|
+
## 0.2.60
|
|
81
|
+
|
|
82
|
+
`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`.
|
|
83
|
+
|
|
84
|
+
### Operator control, loop preview, and install integrity
|
|
85
|
+
|
|
86
|
+
- **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.
|
|
87
|
+
- **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.
|
|
88
|
+
- **`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.
|
|
89
|
+
- **`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.
|
|
90
|
+
- **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.
|
|
91
|
+
- **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.
|
|
92
|
+
- **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.
|
|
93
|
+
- **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.
|
|
94
|
+
|
|
95
|
+
### Preset-tree lock: the generator and the gate stop racing
|
|
96
|
+
|
|
97
|
+
- **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`).
|
|
98
|
+
- **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.
|
|
99
|
+
- **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`.
|
|
100
|
+
- **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.
|
|
101
|
+
- **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.
|
|
102
|
+
|
|
103
|
+
### Update covers the fifth platform
|
|
104
|
+
|
|
105
|
+
- **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.
|
|
106
|
+
- **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.
|
|
107
|
+
|
|
108
|
+
### GitHub MCP provider
|
|
109
|
+
|
|
110
|
+
- **`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`.
|
|
111
|
+
- **`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.
|
|
112
|
+
- **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.
|
|
113
|
+
- **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.
|
|
114
|
+
- **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=***`).
|
|
115
|
+
- **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.
|
|
116
|
+
- **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.
|
|
117
|
+
|
|
118
|
+
### The requirements checker separates declared from executed steps
|
|
119
|
+
|
|
120
|
+
- **`--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`.
|
|
121
|
+
- **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.
|
|
122
|
+
|
|
123
|
+
### Upgrade
|
|
124
|
+
|
|
125
|
+
- Run `npx @bonesofspring/ai-rules update` to refresh the 55 hooks and the shared orchestrator/review rules.
|
|
126
|
+
- `.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`.
|
|
127
|
+
- Run `npx @bonesofspring/ai-rules doctor` after the update; a `stale-engine` finding names the module that is still the old copy.
|
|
128
|
+
- The preset-tree lock and `--require-receipts` are preset-repository tooling, not installed files: no consumer action and no engine seed for either.
|
|
129
|
+
|
|
3
130
|
## 0.2.57
|
|
4
131
|
|
|
5
132
|
### L2-lite and a lighter bounded-contract pipeline
|
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# @bonesofspring/ai-rules
|
|
2
2
|
|
|
3
|
-
Presets for **Cursor**, **Claude Code**, **Mavis** (MiniMax `mcode`), **OpenCode**, and **ZCode**. Node
|
|
3
|
+
Presets for **Cursor**, **Claude Code**, **Mavis** (MiniMax `mcode`), **OpenCode**, and **ZCode**. Node 20+. Platform support, prerequisites, and the Windows setup (Git Bash): [`docs/PLATFORMS.md`](docs/PLATFORMS.md).
|
|
4
4
|
|
|
5
5
|
```bash
|
|
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 # install health: managed files, engine set, version; --fix upgrades stale engine modules
|
|
9
10
|
npx @bonesofspring/ai-rules clean cursor # never deletes .ai.local/
|
|
11
|
+
npx @bonesofspring/ai-rules init mcp --all # catalog: context7, playwright, chrome/next-devtools, semgrep, sentry, figma, storybook, defectdojo, gitlab/github, yandex-*
|
|
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; sixteen scripts — the six self-learning engine modules, `manifest.mjs`, the seven `team-db*.mjs` projection and scheduler modules, the `upstream-research.mjs` review, 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 ships plus Storybook, DefectDojo, and the packaged GitLab / GitHub / Yandex runtime entries 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`, `next-devtools`, `semgrep`, `sentry`, `figma-desktop` (alias `figma`, the local `http://127.0.0.1:3845/mcp` server), `figma-cloud` (the remote `https://mcp.figma.com/mcp` server), `storybook` (`http://localhost:6200/mcp`), `defectdojo`, `gitlab`, `github`, `yandex-tracker`, and `yandex-wiki`; `--all` selects every one. The last five are packaged runtime entries: they are registered without credentials and need `mcp setup <provider>` once (DefectDojo reads `.env.defectdojo`). Next.js DevTools needs a running `next dev` on Next.js 16+; Semgrep needs the `semgrep` CLI; Sentry uses OAuth.
|
|
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, DefectDojo) is 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,29 +49,38 @@ 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
|
|
|
39
|
-
`
|
|
40
|
-
`--force`. Re-running `init` does not update a seeded module, so delete the file to pick up a newer engine. The seeded
|
|
41
|
-
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/`, `team.db`, `team.db-wal`,
|
|
43
|
-
`team.db-shm`, and `team-db-errors.log`; the root `.gitignore` is never edited.
|
|
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.
|
|
44
56
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
`init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
|
|
58
|
+
`--force`. The seeded tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created
|
|
59
|
+
when absent, missing required lines appended to an existing file) ignores `*.lock`, `*.tmp`, `.rollback/`, `STOP`,
|
|
60
|
+
`ESTOP`, `team.db`, `team.db-wal`, `team.db-shm`, `team-db-errors.log`, `team/scheduler/runs/`, and
|
|
61
|
+
`team/scheduler/state.json`; the root `.gitignore` is never edited.
|
|
62
|
+
|
|
63
|
+
Upgrade a seeded module with `update --fix`: it writes a module only when its current bytes still match the shipped digest
|
|
64
|
+
recorded in `.ai.local/.template-base.json`. A module you edited is reported `kept modified` and stays byte-identical; a
|
|
65
|
+
module with no recorded base (installed before the record existed) is reported `unattributable` and never written — delete
|
|
66
|
+
that one file and re-run `init` to adopt it. Every overwritten module is backed up by default to
|
|
67
|
+
`.ai.local/.rollback/engine-<stamp>/` (the five newest runs are kept); `--no-backup` skips the durable copy while keeping
|
|
68
|
+
the failure rollback. Restore a run with:
|
|
50
69
|
|
|
51
70
|
```bash
|
|
52
|
-
|
|
53
|
-
rm .ai.local/scripts/run.mjs
|
|
54
|
-
rm .ai.local/scripts/team-db-schema.mjs
|
|
55
|
-
npx @bonesofspring/ai-rules update
|
|
71
|
+
cp -R .ai.local/.rollback/engine-<stamp>/.ai.local .
|
|
56
72
|
```
|
|
57
73
|
|
|
74
|
+
`update --check` prints the same `check fast-forward .ai.local/scripts/<name>` lines and writes nothing, so it previews the
|
|
75
|
+
`--fix` write set; both come from one plan, including a module whose recorded base names a tool you have since cleaned. A
|
|
76
|
+
symlinked module is reported `skipped symlink` and never written through. `doctor --json` marks every engine finding
|
|
77
|
+
`fixable` (`stale-engine` → `true`; `modified`, `missing-engine`, `legacy-manifest`, and `version-mismatch` → `false`), and
|
|
78
|
+
`doctor --fix` runs the same plan and writer before printing the post-state. A consumer that already holds
|
|
79
|
+
`.ai.local/scripts/rule-improver.mjs` keeps the old engine
|
|
80
|
+
until it upgrades; `--dry-run` and `--rollback` live in the newer `run.mjs` / `rule-improver.mjs`.
|
|
81
|
+
|
|
58
82
|
The 0.2.56 delete-task release also changes `team-db.mjs`, `team-db-project.mjs`, `team-db-api.mjs`, and
|
|
59
|
-
`team-db-openapi.mjs`;
|
|
83
|
+
`team-db-openapi.mjs`; `update --fix` takes those too when you never edited them.
|
|
60
84
|
|
|
61
85
|
Promote a staged seed by hand; the engine never activates one on its own:
|
|
62
86
|
|
|
@@ -69,6 +93,21 @@ The command strips the provenance footer from `.ai.local/rules-library/<stem>.md
|
|
|
69
93
|
engine stages carries a four-field footer (`signature`, `stagedAt`, `sourceSlug`, `state: awaiting-human-promotion`); a
|
|
70
94
|
copy of a shipped template carries none.
|
|
71
95
|
|
|
96
|
+
Undo one auto-applied ledger entry; the command is fail-closed:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node .ai.local/scripts/rule-improver.mjs --rollback <target|signature|ISO timestamp>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`--rollback` resolves the newest matching `rule-changes.jsonl` entry, refuses when the
|
|
103
|
+
target changed since that entry or the ref is ambiguous, and appends a `rollback` safety row
|
|
104
|
+
that is itself the inverse. It writes nothing on refusal.
|
|
105
|
+
|
|
106
|
+
`--dry-run` runs the same derive and improver decision path as the real loop, prints
|
|
107
|
+
`DRY RUN — no files, signals, or ledger rows will be written`, and shows per signature the tier/action, target,
|
|
108
|
+
before/after, and the exact file and ledger writes it would perform. It creates no lock, no intent file, and no
|
|
109
|
+
signal append; `--status` stays read-only and unchanged.
|
|
110
|
+
|
|
72
111
|
The same seeding ships `manifest.mjs`, the writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`:
|
|
73
112
|
|
|
74
113
|
```bash
|
|
@@ -95,6 +134,8 @@ node .ai.local/scripts/team-db.mjs sync # full backfill + reconc
|
|
|
95
134
|
node .ai.local/scripts/team-db.mjs sync --slug <slug> # the bounded hook-shaped projection
|
|
96
135
|
node .ai.local/scripts/team-db.mjs check # schema, fingerprint, integrity
|
|
97
136
|
node .ai.local/scripts/team-db.mjs serve # http://127.0.0.1:4178 + dashboard
|
|
137
|
+
node .ai.local/scripts/team-db.mjs schedule # the timer: claims, runs, captures, reconciles
|
|
138
|
+
node .ai.local/scripts/team-db.mjs jobs list # definitions + next fire, file-authoritative
|
|
98
139
|
AI_RULES_TEAM_DB_DISABLE=1 node .ai.local/scripts/team-db.mjs sync # no-op: file-only mode
|
|
99
140
|
```
|
|
100
141
|
|
|
@@ -102,9 +143,36 @@ Requires Node 22.13.0+ for `node:sqlite`; older runtimes stay file-only with one
|
|
|
102
143
|
`migrate-tasks` is the one-command path: it creates the database when it is absent and writes
|
|
103
144
|
only the delta against an existing one, so a fresh workspace and a populated database converge
|
|
104
145
|
in one invocation.
|
|
105
|
-
`team-db.mjs serve` binds loopback only, is read-only apart from
|
|
106
|
-
|
|
107
|
-
and rollback:
|
|
146
|
+
`team-db.mjs serve` binds loopback only, is read-only apart from the six documented mutations
|
|
147
|
+
(`POST /api/v1/sync`, the task delete, and four job writes), and serves the OpenAPI 3.1
|
|
148
|
+
document at `/openapi.json`. Details, environment names, retention, and rollback:
|
|
149
|
+
[`docs/TEAM-DB.md`](docs/TEAM-DB.md).
|
|
150
|
+
|
|
151
|
+
### Scheduled jobs
|
|
152
|
+
|
|
153
|
+
`scheduler/jobs.json` defines cron or interval jobs — a `command` argv or a `pipeline` prompt
|
|
154
|
+
lowered to a consumer-configured runner — and `team-db.mjs schedule` runs one at a time per
|
|
155
|
+
team root: one `BEGIN IMMEDIATE` claim per occurrence, a detached child with a process-group
|
|
156
|
+
timeout kill, split `stdout`/`stderr` capped at 1 MiB, and a reconciled restart. The
|
|
157
|
+
definitions are committed, run output and `state.json` are ignored, and the captured output is
|
|
158
|
+
never redacted. The `queue` concurrency policy and the `run-once` / `catch-up` (five
|
|
159
|
+
occurrences) misfire policies cover overlap and downtime; the kill switch drains instead of
|
|
160
|
+
dropping a claim. The same nine job routes drive the shipped dashboard (its Jobs tab under
|
|
161
|
+
`team-db.mjs serve`) and any other client. Schema v2 adds the three projection tables; a
|
|
162
|
+
pre-v2 database is rebuilt from the files on the next `sync`.
|
|
163
|
+
|
|
164
|
+
### Upstream research
|
|
165
|
+
|
|
166
|
+
The `next` preset ships a weekly `upstream-research` job and a read-only `opencode` agent for
|
|
167
|
+
it. The runner (`.ai.local/scripts/upstream-research.mjs`) probes `opencode`, loads
|
|
168
|
+
`upstream/projects.json` and `upstream/config.json`, fetches each due clone with
|
|
169
|
+
`git fetch --depth 1`, labels the window (`range`, `baseline`, `unprovable`, `no-change`),
|
|
170
|
+
validates the agent's marked JSON, re-checks every citation inside the clone, dedupes by
|
|
171
|
+
mechanism against the committed `upstream/signatures.json`, and writes one ranked digest to
|
|
172
|
+
`docs/upstream/digest-<runId>.md`. The cursor is git-ignored; the caps are data. `/upstream-research`
|
|
173
|
+
queues a run and adds one `schedule --once` tick when no timer is online. Details:
|
|
174
|
+
[`docs/TEAM-DB.md`](docs/TEAM-DB.md#upstream-research-job) and
|
|
175
|
+
[`docs/OPENCODE.md`](docs/OPENCODE.md#upstream-research-agent).
|
|
108
176
|
|
|
109
177
|
Living exceptions: **`.ai.local/rules/`** and **`.ai.local/conventions.md`** (`init` does not overwrite them). The only exception is opt-in and hash-gated: `update --merge-ai-local` fast-forwards a file whose recorded base in `.ai.local/.template-base.json` still matches, keeps an edited file byte-identical, and diverts its unified diff to `.ai.local/.rollback/template-drift/` (never a `.md`, never a conflict marker). Plain `update` only prints one drift line and records the files that already hold the shipped template; your own bytes never become a base. Overlay does not load `.ai.local/team/**` as rules; see [`docs/LOCAL-OVERLAY.md`](docs/LOCAL-OVERLAY.md#template-drift).
|
|
110
178
|
|
|
@@ -122,6 +190,8 @@ Mavis never writes `~/.minimax/**`. OpenCode never writes `~/.config/opencode/**
|
|
|
122
190
|
|
|
123
191
|
`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
192
|
|
|
193
|
+
`doctor` is the 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 classifies `.ai.local/scripts/` with the same predicate `update --fix` writes with: `stale-engine` is safely upgradeable (`fixable: true`), `modified` is your edit (`fixable: false`), and `missing-engine`, `legacy-manifest`, and `version-mismatch` are not fixable. `--json` prints one object with `fixable` on every finding and adds one `fix` field when `--fix` ran. Exit `0` means clean, `1` means findings, `2` means a usage error (unknown option, bad positional, bad `--cwd`). `doctor --fix` applies the same plan and writer as `update --fix`, re-runs the check, prints the post-state, and exits `0` only when that post-state is clean; a `modified` module is never overwritten, and a module with no recorded base needs the delete + `init` remedy.
|
|
194
|
+
|
|
125
195
|
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
196
|
|
|
127
197
|
## Stacks
|
|
@@ -155,6 +225,7 @@ Every installed preset ships requestable `anti-hallucination-contract` (not alwa
|
|
|
155
225
|
- Guide: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md)
|
|
156
226
|
- Overlay: [`docs/LOCAL-OVERLAY.md`](docs/LOCAL-OVERLAY.md)
|
|
157
227
|
- MCP setup: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md)
|
|
228
|
+
- MCP catalog: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md)
|
|
158
229
|
- 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
230
|
- Gates: `yarn check:preset-structure`
|
|
160
231
|
|