@bonesofspring/ai-rules 0.2.56 → 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 +116 -1
- package/README.md +68 -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 +14 -1
- package/docs/TEAM-DB.md +34 -1
- package/docs/openapi/team-db.v1.json +17 -2
- 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 +4 -1
- package/presets/_shared/ai-local/scripts/check-write-scope.mjs +212 -0
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +674 -74
- package/presets/_shared/ai-local/scripts/run.mjs +143 -9
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +1 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +6 -1
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +1 -1
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +79 -9
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +29 -6
- package/presets/_shared/core/quality/self-review-and-context-hygiene.md +3 -1
- package/presets/_shared/core/review/code-review-mr.md +10 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +163 -16
- package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/claude/android-kotlin/agents/debugger.md +1 -1
- package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/commands/update.md +1 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/go/agents/build-verifier.md +1 -1
- package/presets/claude/go/agents/code-reviewer.md +1 -1
- package/presets/claude/go/agents/debugger.md +1 -1
- package/presets/claude/go/agents/feature-developer.md +1 -1
- package/presets/claude/go/agents/task-analyst.md +1 -1
- package/presets/claude/go/commands/update.md +1 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/go/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/claude/ios-swift/agents/debugger.md +1 -1
- package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
- package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
- package/presets/claude/ios-swift/commands/update.md +1 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/java/agents/build-verifier.md +1 -1
- package/presets/claude/java/agents/code-reviewer.md +1 -1
- package/presets/claude/java/agents/debugger.md +1 -1
- package/presets/claude/java/agents/feature-developer.md +1 -1
- package/presets/claude/java/agents/task-analyst.md +1 -1
- package/presets/claude/java/commands/update.md +1 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/java/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/claude/mcp-ts/commands/update.md +1 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/mol/agents/build-verifier.md +1 -1
- package/presets/claude/mol/agents/code-reviewer.md +1 -1
- package/presets/claude/mol/agents/debugger.md +1 -1
- package/presets/claude/mol/agents/feature-developer.md +1 -1
- package/presets/claude/mol/agents/task-analyst.md +1 -1
- package/presets/claude/mol/commands/update.md +1 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/claude/next/agents/build-verifier.md +18 -1
- package/presets/claude/next/agents/code-reviewer.md +9 -1
- package/presets/claude/next/agents/debugger.md +1 -1
- package/presets/claude/next/agents/feature-developer.md +13 -1
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +10 -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 +163 -16
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +12 -1
- package/presets/claude/nuxt/agents/build-verifier.md +1 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
- package/presets/claude/nuxt/agents/debugger.md +1 -1
- package/presets/claude/nuxt/agents/feature-developer.md +1 -1
- package/presets/claude/nuxt/agents/task-analyst.md +1 -1
- package/presets/claude/nuxt/commands/update.md +1 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
- package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/claude/php-hexagonal/commands/update.md +1 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/claude/php-laravel/agents/debugger.md +1 -1
- package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
- package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
- package/presets/claude/php-laravel/commands/update.md +1 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +10 -0
- package/presets/claude/svelte/agents/build-verifier.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +1 -1
- package/presets/claude/svelte/agents/debugger.md +1 -1
- package/presets/claude/svelte/agents/feature-developer.md +1 -1
- package/presets/claude/svelte/agents/task-analyst.md +1 -1
- package/presets/claude/svelte/commands/update.md +1 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +163 -16
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +29 -6
- package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +10 -0
- package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
- package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/commands/update.md +1 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/go/agents/build-verifier.md +1 -1
- package/presets/cursor/go/agents/code-reviewer.md +1 -1
- package/presets/cursor/go/agents/debugger.md +1 -1
- package/presets/cursor/go/agents/feature-developer.md +1 -1
- package/presets/cursor/go/agents/task-analyst.md +1 -1
- package/presets/cursor/go/commands/update.md +1 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/go/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/cursor/ios-swift/agents/debugger.md +1 -1
- package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
- package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
- package/presets/cursor/ios-swift/commands/update.md +1 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/java/agents/build-verifier.md +1 -1
- package/presets/cursor/java/agents/code-reviewer.md +1 -1
- package/presets/cursor/java/agents/debugger.md +1 -1
- package/presets/cursor/java/agents/feature-developer.md +1 -1
- package/presets/cursor/java/agents/task-analyst.md +1 -1
- package/presets/cursor/java/commands/update.md +1 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/java/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/cursor/mcp-ts/commands/update.md +1 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -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/agents/build-verifier.md +1 -1
- package/presets/cursor/mol/agents/code-reviewer.md +1 -1
- package/presets/cursor/mol/agents/debugger.md +1 -1
- package/presets/cursor/mol/agents/feature-developer.md +1 -1
- package/presets/cursor/mol/agents/task-analyst.md +1 -1
- package/presets/cursor/mol/commands/update.md +1 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +1 -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/README.md +2 -0
- package/presets/cursor/next/agents/build-verifier.md +18 -1
- package/presets/cursor/next/agents/code-reviewer.md +9 -1
- package/presets/cursor/next/agents/debugger.md +1 -1
- package/presets/cursor/next/agents/feature-developer.md +13 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +10 -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 +163 -16
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/rules/code-review-mr.mdc +12 -1
- package/presets/cursor/next/team/fixtures/feature-l2-lite.json +27 -0
- package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
- package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
- package/presets/cursor/nuxt/agents/debugger.md +1 -1
- package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
- package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
- package/presets/cursor/nuxt/commands/update.md +1 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/nuxt/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/cursor/php-hexagonal/commands/update.md +1 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/cursor/php-laravel/agents/debugger.md +1 -1
- package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
- package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
- package/presets/cursor/php-laravel/commands/update.md +1 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +10 -0
- package/presets/cursor/svelte/agents/build-verifier.md +1 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
- package/presets/cursor/svelte/agents/debugger.md +1 -1
- package/presets/cursor/svelte/agents/feature-developer.md +1 -1
- package/presets/cursor/svelte/agents/task-analyst.md +1 -1
- package/presets/cursor/svelte/commands/update.md +1 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +163 -16
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -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/agents/build-verifier.md +1 -1
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
- package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/mavis/android-kotlin/commands/update.md +1 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/go/agents/code-reviewer.md +1 -1
- package/presets/mavis/go/agents/debugger.md +1 -1
- package/presets/mavis/go/agents/feature-developer.md +1 -1
- package/presets/mavis/go/agents/task-analyst.md +1 -1
- package/presets/mavis/go/commands/update.md +1 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/go/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/mavis/ios-swift/agents/debugger.md +1 -1
- package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
- package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
- package/presets/mavis/ios-swift/commands/update.md +1 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/java/agents/code-reviewer.md +1 -1
- package/presets/mavis/java/agents/debugger.md +1 -1
- package/presets/mavis/java/agents/feature-developer.md +1 -1
- package/presets/mavis/java/agents/task-analyst.md +1 -1
- package/presets/mavis/java/commands/update.md +1 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/java/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/mavis/mcp-ts/commands/update.md +1 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/mol/agents/code-reviewer.md +1 -1
- package/presets/mavis/mol/agents/debugger.md +1 -1
- package/presets/mavis/mol/agents/feature-developer.md +1 -1
- package/presets/mavis/mol/agents/task-analyst.md +1 -1
- package/presets/mavis/mol/commands/update.md +1 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +29 -6
- 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 +9 -1
- package/presets/mavis/next/agents/build-verifier.md +18 -1
- package/presets/mavis/next/agents/code-reviewer.md +9 -1
- package/presets/mavis/next/agents/debugger.md +1 -1
- package/presets/mavis/next/agents/feature-developer.md +13 -1
- package/presets/mavis/next/agents/task-analyst.md +1 -1
- package/presets/mavis/next/agents/task-router.md +10 -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 +163 -16
- package/presets/mavis/next/rules/agent-team-orchestrator.md +29 -6
- package/presets/mavis/next/rules/code-review-mr.md +12 -1
- package/presets/mavis/next/team/fixtures/feature-l2-lite.json +27 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
- package/presets/mavis/nuxt/agents/debugger.md +1 -1
- package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
- package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
- package/presets/mavis/nuxt/commands/update.md +1 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
- package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/mavis/php-hexagonal/commands/update.md +1 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/mavis/php-laravel/agents/debugger.md +1 -1
- package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
- package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
- package/presets/mavis/php-laravel/commands/update.md +1 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
- package/presets/mavis/svelte/agents/debugger.md +1 -1
- package/presets/mavis/svelte/agents/feature-developer.md +1 -1
- package/presets/mavis/svelte/agents/task-analyst.md +1 -1
- package/presets/mavis/svelte/commands/update.md +1 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +163 -16
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
- package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/commands/update.md +1 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -1
- package/presets/opencode/go/agents/debugger.md +1 -1
- package/presets/opencode/go/agents/feature-developer.md +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/commands/update.md +1 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/go/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/debugger.md +1 -1
- package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
- package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/commands/update.md +1 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -1
- package/presets/opencode/java/agents/debugger.md +1 -1
- package/presets/opencode/java/agents/feature-developer.md +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/commands/update.md +1 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/java/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/commands/update.md +1 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/mol/agents/code-reviewer.md +1 -1
- package/presets/opencode/mol/agents/debugger.md +1 -1
- package/presets/opencode/mol/agents/feature-developer.md +1 -1
- package/presets/opencode/mol/agents/task-analyst.md +1 -1
- package/presets/opencode/mol/commands/update.md +1 -0
- package/presets/opencode/mol/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +29 -6
- 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 +9 -1
- package/presets/opencode/next/agents/build-verifier.md +18 -1
- package/presets/opencode/next/agents/code-reviewer.md +9 -1
- package/presets/opencode/next/agents/debugger.md +1 -1
- package/presets/opencode/next/agents/feature-developer.md +13 -1
- package/presets/opencode/next/agents/task-analyst.md +1 -1
- package/presets/opencode/next/agents/task-router.md +10 -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 +163 -16
- package/presets/opencode/next/rules/agent-team-orchestrator.md +29 -6
- package/presets/opencode/next/rules/code-review-mr.md +12 -1
- package/presets/opencode/next/team/fixtures/feature-l2-lite.json +27 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/debugger.md +1 -1
- package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/commands/update.md +1 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
- package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/commands/update.md +1 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/debugger.md +1 -1
- package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
- package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/commands/update.md +1 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/debugger.md +1 -1
- package/presets/opencode/svelte/agents/feature-developer.md +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/commands/update.md +1 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +163 -16
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/zcode/android-kotlin/agents/debugger.md +1 -1
- package/presets/zcode/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/zcode/android-kotlin/commands/update.md +1 -0
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/go/agents/code-reviewer.md +1 -1
- package/presets/zcode/go/agents/debugger.md +1 -1
- package/presets/zcode/go/agents/feature-developer.md +1 -1
- package/presets/zcode/go/agents/task-analyst.md +1 -1
- package/presets/zcode/go/commands/update.md +1 -0
- package/presets/zcode/go/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/go/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/zcode/ios-swift/agents/debugger.md +1 -1
- package/presets/zcode/ios-swift/agents/feature-developer.md +1 -1
- package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/zcode/ios-swift/commands/update.md +1 -0
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/java/agents/code-reviewer.md +1 -1
- package/presets/zcode/java/agents/debugger.md +1 -1
- package/presets/zcode/java/agents/feature-developer.md +1 -1
- package/presets/zcode/java/agents/task-analyst.md +1 -1
- package/presets/zcode/java/commands/update.md +1 -0
- package/presets/zcode/java/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/java/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/zcode/mcp-ts/commands/update.md +1 -0
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/mol/agents/code-reviewer.md +1 -1
- package/presets/zcode/mol/agents/debugger.md +1 -1
- package/presets/zcode/mol/agents/feature-developer.md +1 -1
- package/presets/zcode/mol/agents/task-analyst.md +1 -1
- package/presets/zcode/mol/commands/update.md +1 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +29 -6
- 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 +9 -1
- package/presets/zcode/next/agents/build-verifier.md +18 -1
- package/presets/zcode/next/agents/code-reviewer.md +9 -1
- package/presets/zcode/next/agents/debugger.md +1 -1
- package/presets/zcode/next/agents/feature-developer.md +13 -1
- package/presets/zcode/next/agents/task-analyst.md +1 -1
- package/presets/zcode/next/agents/task-router.md +10 -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 +163 -16
- package/presets/zcode/next/rules/agent-team-orchestrator.md +29 -6
- package/presets/zcode/next/rules/code-review-mr.md +12 -1
- package/presets/zcode/next/team/fixtures/feature-l2-lite.json +27 -0
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/agents/build-verifier.md +1 -1
- package/presets/zcode/nuxt/agents/code-reviewer.md +1 -1
- package/presets/zcode/nuxt/agents/debugger.md +1 -1
- package/presets/zcode/nuxt/agents/feature-developer.md +1 -1
- package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
- package/presets/zcode/nuxt/commands/update.md +1 -0
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/zcode/php-hexagonal/agents/debugger.md +1 -1
- package/presets/zcode/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/zcode/php-hexagonal/commands/update.md +1 -0
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/zcode/php-laravel/agents/debugger.md +1 -1
- package/presets/zcode/php-laravel/agents/feature-developer.md +1 -1
- package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/zcode/php-laravel/commands/update.md +1 -0
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +29 -6
- 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/agents/build-verifier.md +1 -1
- package/presets/zcode/svelte/agents/code-reviewer.md +1 -1
- package/presets/zcode/svelte/agents/debugger.md +1 -1
- package/presets/zcode/svelte/agents/feature-developer.md +1 -1
- package/presets/zcode/svelte/agents/task-analyst.md +1 -1
- package/presets/zcode/svelte/commands/update.md +1 -0
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +163 -16
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +29 -6
- package/presets/zcode/svelte/rules/code-review-mr.md +10 -0
|
@@ -29,7 +29,9 @@ import { pathToFileURL } from 'node:url';
|
|
|
29
29
|
import { appendSignal, groupSignatures, isSignalRecord } from './signals.mjs';
|
|
30
30
|
import {
|
|
31
31
|
MAX_ACTIVE_RULES,
|
|
32
|
-
|
|
32
|
+
MAX_RULE_LINES,
|
|
33
|
+
MAX_CONVENTION_LINES,
|
|
34
|
+
addedLine,
|
|
33
35
|
canonicalSignature,
|
|
34
36
|
collectScriptReport,
|
|
35
37
|
countRulesAndLines,
|
|
@@ -37,6 +39,7 @@ import {
|
|
|
37
39
|
formatLessonStatus,
|
|
38
40
|
loadAliasMap,
|
|
39
41
|
loadCatalog,
|
|
42
|
+
previewImprover,
|
|
40
43
|
resolveLesson,
|
|
41
44
|
runImprover,
|
|
42
45
|
thresholdAction,
|
|
@@ -236,14 +239,27 @@ export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
|
236
239
|
|
|
237
240
|
// The engine fails closed on an unreadable rule; the read-only report must
|
|
238
241
|
// still print, so the envelope degrades to `unreadable` instead of throwing.
|
|
242
|
+
// Two stores, two envelopes: the human `rules/` store and the machine
|
|
243
|
+
// `conventions.md` store each carry their own cap.
|
|
239
244
|
let envelope;
|
|
240
|
-
let
|
|
245
|
+
let rulesState;
|
|
246
|
+
let conventionsState;
|
|
241
247
|
try {
|
|
242
248
|
envelope = countRulesAndLines({ rulesDir, conventionsPath });
|
|
243
|
-
|
|
249
|
+
rulesState = evaluateEnvelope({
|
|
250
|
+
store: 'rules',
|
|
251
|
+
ruleCount: envelope.rules.ruleCount,
|
|
252
|
+
lineCount: envelope.rules.lineCount,
|
|
253
|
+
});
|
|
254
|
+
conventionsState = evaluateEnvelope({
|
|
255
|
+
store: 'conventions',
|
|
256
|
+
lineCount: envelope.conventions.lineCount,
|
|
257
|
+
});
|
|
244
258
|
} catch (error) {
|
|
245
|
-
envelope = { ruleCount: 0, lineCount: 0 };
|
|
246
|
-
|
|
259
|
+
envelope = { rules: { ruleCount: 0, lineCount: 0 }, conventions: { lineCount: 0 } };
|
|
260
|
+
const reason = `unreadable — ${error instanceof Error ? error.message : String(error)}`;
|
|
261
|
+
rulesState = { reason };
|
|
262
|
+
conventionsState = { reason };
|
|
247
263
|
}
|
|
248
264
|
const pending = deriveGateSignals({ baseDir }).signals.length;
|
|
249
265
|
|
|
@@ -251,7 +267,8 @@ export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
|
251
267
|
lines.push(`store: ${storeState}`);
|
|
252
268
|
lines.push(`pending derivations: ${pending}` + (pending > 0 ? ' (evidence not captured yet)' : ''));
|
|
253
269
|
lines.push(
|
|
254
|
-
`envelope: ${envelope.
|
|
270
|
+
`rules envelope: ${envelope.rules.lineCount}/${MAX_RULE_LINES} lines, ${envelope.rules.ruleCount}/${MAX_ACTIVE_RULES} rules — ${rulesState.reason}`,
|
|
271
|
+
`conventions envelope: ${envelope.conventions.lineCount}/${MAX_CONVENTION_LINES} lines — ${conventionsState.reason}`,
|
|
255
272
|
);
|
|
256
273
|
for (const error of errors) {
|
|
257
274
|
lines.push(` - malformed store line ${error.line}: ${error.reason}`);
|
|
@@ -363,17 +380,132 @@ export function strictReport(health) {
|
|
|
363
380
|
return `${lines.join('\n')}\n`;
|
|
364
381
|
}
|
|
365
382
|
|
|
366
|
-
|
|
383
|
+
// --- Read-only preview (`--dry-run`) ------------------------------------------
|
|
384
|
+
|
|
385
|
+
export const DRY_RUN_BANNER = 'DRY RUN — no files, signals, or ledger rows will be written';
|
|
386
|
+
|
|
387
|
+
function previewTarget(target, rootDir) {
|
|
388
|
+
if (typeof target !== 'string') return '(no file)';
|
|
389
|
+
if (!path.isAbsolute(target)) return target;
|
|
390
|
+
const relative = path.relative(rootDir, target);
|
|
391
|
+
return relative.split(path.sep).join('/');
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function conciseDelta(before, after) {
|
|
395
|
+
if (before == null && after == null) return 'no change';
|
|
396
|
+
if (before == null) return `new file (${String(after).split('\n').length} line(s))`;
|
|
397
|
+
if (after == null) return 'delete file';
|
|
398
|
+
if (before === after) return 'no change';
|
|
399
|
+
const line = addedLine(before, after);
|
|
400
|
+
if (line) return `+ ${line}`;
|
|
401
|
+
const beforeLines = new Set(String(before).split('\n').map((row) => row.trim()).filter(Boolean));
|
|
402
|
+
const afterLines = new Set(String(after).split('\n').map((row) => row.trim()).filter(Boolean));
|
|
403
|
+
let added = 0;
|
|
404
|
+
let removed = 0;
|
|
405
|
+
for (const row of afterLines) if (!beforeLines.has(row)) added += 1;
|
|
406
|
+
for (const row of beforeLines) if (!afterLines.has(row)) removed += 1;
|
|
407
|
+
return `+${added}/-${removed} line(s)`;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Read-only preview of the loop: the same derive and improver decision path,
|
|
412
|
+
* with every mutating transition recorded instead of executed. No signal is
|
|
413
|
+
* appended, no lock or intent file is created, no target or ledger is written.
|
|
414
|
+
*/
|
|
415
|
+
export function dryRunReport({ baseDir = DEFAULT_BASE_DIR, rootDir } = {}) {
|
|
416
|
+
const displayRoot = rootDir ?? path.dirname(baseDir);
|
|
417
|
+
const derived = deriveGateSignals({ baseDir });
|
|
418
|
+
const preview = previewImprover({ baseDir, ...(rootDir ? { rootDir } : {}) });
|
|
419
|
+
|
|
420
|
+
const lines = [DRY_RUN_BANNER, '', 'Self-learning loop — dry run', ''];
|
|
421
|
+
lines.push(`derived: ${derived.signals.length} signal(s) — none appended`);
|
|
422
|
+
for (const signal of derived.signals) {
|
|
423
|
+
lines.push(` - would append ${signal.signature} from ${signal.slug}`);
|
|
424
|
+
}
|
|
425
|
+
for (const item of derived.skipped) {
|
|
426
|
+
lines.push(` - skipped ${item.slug} (${item.kind}): ${item.reason}`);
|
|
427
|
+
}
|
|
428
|
+
for (const error of derived.errors) {
|
|
429
|
+
lines.push(` - derive error: ${error.reason}`);
|
|
430
|
+
}
|
|
431
|
+
lines.push('', 'The improver preview below reflects the current signal store; the derived signals above are not counted into tiers.');
|
|
432
|
+
|
|
433
|
+
const rows = new Map();
|
|
434
|
+
for (const decision of preview.decisions) {
|
|
435
|
+
rows.set(decision.signature, { signature: decision.signature, tier: decision.tier, writes: [] });
|
|
436
|
+
}
|
|
437
|
+
for (const op of preview.writes) {
|
|
438
|
+
const signature = op.entry && typeof op.entry.signature === 'string' ? op.entry.signature : '(no signature)';
|
|
439
|
+
const row = rows.get(signature) ?? { signature, tier: null, writes: [] };
|
|
440
|
+
row.writes.push(op);
|
|
441
|
+
rows.set(signature, row);
|
|
442
|
+
}
|
|
443
|
+
for (const item of preview.skipped) {
|
|
444
|
+
const row = rows.get(item.signature);
|
|
445
|
+
if (row) {
|
|
446
|
+
row.skipped = item.reason;
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
rows.set(item.signature, { signature: item.signature, tier: null, writes: [], skipped: item.reason });
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
lines.push('');
|
|
453
|
+
if (rows.size === 0) {
|
|
454
|
+
lines.push('no decision planned — nothing would be written');
|
|
455
|
+
}
|
|
456
|
+
for (const row of rows.values()) {
|
|
457
|
+
const tier = row.tier ? `tier ${row.tier.tier} → ${row.tier.action}` : 'no decision';
|
|
458
|
+
lines.push(`${row.signature} — ${tier}`);
|
|
459
|
+
if (row.skipped) {
|
|
460
|
+
lines.push(` skipped: ${row.skipped}`);
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
const fileOps = row.writes.filter((op) => op.kind === 'file');
|
|
464
|
+
const ledgerOps = row.writes.filter((op) => op.kind === 'ledger');
|
|
465
|
+
if (fileOps.length === 0) {
|
|
466
|
+
lines.push(` target: ${ledgerOps[0]?.entry?.target ?? '(ledger row only)'}`);
|
|
467
|
+
lines.push(' before → after: no target file write');
|
|
468
|
+
}
|
|
469
|
+
for (const op of fileOps) {
|
|
470
|
+
lines.push(` target: ${previewTarget(op.target, displayRoot)}`);
|
|
471
|
+
lines.push(` before → after: ${conciseDelta(op.before, op.after)}`);
|
|
472
|
+
}
|
|
473
|
+
const writeLabels = [
|
|
474
|
+
...fileOps.map((op) => {
|
|
475
|
+
const mode = op.after == null ? 'delete' : op.before == null ? 'create' : 'update';
|
|
476
|
+
return `file ${previewTarget(op.target, displayRoot)} (${mode})`;
|
|
477
|
+
}),
|
|
478
|
+
...ledgerOps.map((op) => `ledger ${op.entry?.action ?? 'row'}`),
|
|
479
|
+
];
|
|
480
|
+
lines.push(` writes: ${writeLabels.length > 0 ? writeLabels.join('; ') : 'none'}`);
|
|
481
|
+
}
|
|
482
|
+
if (preview.rejected.length > 0) {
|
|
483
|
+
lines.push('', `rejected (${preview.rejected.length}) — denylist`);
|
|
484
|
+
for (const item of preview.rejected) lines.push(` - ${item.signature}`);
|
|
485
|
+
}
|
|
486
|
+
if (preview.errors.length > 0) {
|
|
487
|
+
lines.push('', `errors (${preview.errors.length})`);
|
|
488
|
+
for (const error of preview.errors) {
|
|
489
|
+
lines.push(` - ${error.signature ?? 'unknown'}: ${error.reason}`);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
lines.push('', 'none of the writes above were performed');
|
|
493
|
+
return `${lines.join('\n')}\n`;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const CLI_USAGE = `Usage: node .ai.local/scripts/run.mjs [--status | --strict | --dry-run]
|
|
367
497
|
|
|
368
498
|
(no flag) run derive → append → improve and print the combined report
|
|
369
499
|
--status read-only report: per-signature slugs, tier, next action, last
|
|
370
500
|
capture, errors, cohort readiness, envelope, pending derivations
|
|
371
501
|
--strict read-only capture check; exit 1 when capture is broken
|
|
502
|
+
--dry-run read-only preview: the same decision path, banner, target,
|
|
503
|
+
before/after and the exact write plan; writes nothing
|
|
372
504
|
|
|
373
|
-
|
|
505
|
+
All inspection modes are write-free and must not be invoked by the chain hook.
|
|
374
506
|
`;
|
|
375
507
|
|
|
376
|
-
// CLI entry: `node run.mjs` runs the loop; `--status` / `--strict` inspect it.
|
|
508
|
+
// CLI entry: `node run.mjs` runs the loop; `--status` / `--strict` / `--dry-run` inspect it.
|
|
377
509
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
378
510
|
const args = process.argv.slice(2);
|
|
379
511
|
if (args.length === 0) {
|
|
@@ -384,6 +516,8 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
|
|
|
384
516
|
const health = captureHealth();
|
|
385
517
|
process.stdout.write(strictReport(health));
|
|
386
518
|
process.exitCode = health.broken ? 1 : 0;
|
|
519
|
+
} else if (args.length === 1 && args[0] === '--dry-run') {
|
|
520
|
+
process.stdout.write(dryRunReport());
|
|
387
521
|
} else {
|
|
388
522
|
process.stderr.write(CLI_USAGE);
|
|
389
523
|
process.exitCode = 2;
|
|
@@ -624,8 +624,12 @@ const schemas = {
|
|
|
624
624
|
['total', 'absent'],
|
|
625
625
|
),
|
|
626
626
|
projectedAt: nullable('string'),
|
|
627
|
+
capabilities: {
|
|
628
|
+
type: 'array',
|
|
629
|
+
items: { type: 'string', enum: ['sync', 'delete'] },
|
|
630
|
+
},
|
|
627
631
|
},
|
|
628
|
-
['status', 'db', 'tasks', 'projectedAt'],
|
|
632
|
+
['status', 'db', 'tasks', 'projectedAt', 'capabilities'],
|
|
629
633
|
),
|
|
630
634
|
Migration: object(
|
|
631
635
|
{
|
|
@@ -934,6 +938,7 @@ const EXAMPLES = {
|
|
|
934
938
|
db: { file: 'team.db', present: true, schemaVersion: 1, fingerprintOk: true, search: 'fts5' },
|
|
935
939
|
tasks: { total: 90, absent: 0 },
|
|
936
940
|
projectedAt: '2026-11-06T08:00:04.000Z',
|
|
941
|
+
capabilities: ['sync', 'delete'],
|
|
937
942
|
},
|
|
938
943
|
],
|
|
939
944
|
Meta: [
|
|
@@ -1609,7 +1609,7 @@ export function deleteTaskProjection(options = {}) {
|
|
|
1609
1609
|
teamDbFail('E_DISABLED', 'disabled by AI_RULES_TEAM_DB_DISABLE', 1);
|
|
1610
1610
|
}
|
|
1611
1611
|
if (!SLUG_RE.test(slug)) {
|
|
1612
|
-
teamDbFail('E_USAGE', `delete needs
|
|
1612
|
+
teamDbFail('E_USAGE', `delete needs --slug matching ${SLUG_RE.source}`, 3);
|
|
1613
1613
|
}
|
|
1614
1614
|
const teamRoot = path.resolve(options.teamRoot || process.env.AI_RULES_TEAM_DB_ROOT || DEFAULT_TEAM_ROOT);
|
|
1615
1615
|
const tasksRoot = path.join(teamRoot, 'tasks');
|
|
@@ -33,6 +33,44 @@ export const INDEX_UNAVAILABLE_LINE = `team-db: node:sqlite unavailable (require
|
|
|
33
33
|
|
|
34
34
|
export const DEFAULT_TEAM_ROOT = path.join(process.cwd(), '.ai.local', 'team');
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The released FTS layouts, oldest-first. The current shape is last.
|
|
38
|
+
*
|
|
39
|
+
* A shape is recorded in `schema_meta` under `search_fts_shape` when the search
|
|
40
|
+
* table is created. The registry enumerates **released** shapes only — a shape
|
|
41
|
+
* that was never released would make the registry lie — so the next shape is
|
|
42
|
+
* appended, never edited in place. The registry is not a migration chain: it
|
|
43
|
+
* records which layout is installed, and a drifted layout is reported, never
|
|
44
|
+
* rebuilt.
|
|
45
|
+
*/
|
|
46
|
+
export const FTS_SHAPES = [
|
|
47
|
+
{
|
|
48
|
+
id: 'fts5-v1',
|
|
49
|
+
columns: ['task_slug UNINDEXED', 'doc_path UNINDEXED', 'kind UNINDEXED', 'body'],
|
|
50
|
+
tokenizer: 'unicode61 remove_diacritics 2',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
export const CURRENT_FTS_SHAPE = FTS_SHAPES[FTS_SHAPES.length - 1];
|
|
54
|
+
export const FTS_SHAPE_META_KEY = 'search_fts_shape';
|
|
55
|
+
|
|
56
|
+
/** The five drift states of an installed search table. */
|
|
57
|
+
export const FTS_DRIFT_STATES = ['absent', 'current', 'unrecorded', 'superseded', 'unknown'];
|
|
58
|
+
|
|
59
|
+
/** The installed table's column names, in declaration order. */
|
|
60
|
+
export const ftsColumnNames = (db) =>
|
|
61
|
+
db
|
|
62
|
+
.prepare(`PRAGMA table_info(${SEARCH_TABLE})`)
|
|
63
|
+
.all()
|
|
64
|
+
.map((row) => String(row.name));
|
|
65
|
+
|
|
66
|
+
/** The comparable signature of a shape: its column names, `UNINDEXED` dropped. */
|
|
67
|
+
export const ftsShapeSignature = (shape) =>
|
|
68
|
+
shape.columns.map((column) => column.replace(/\s+UNINDEXED\b/i, '').trim()).join(',');
|
|
69
|
+
|
|
70
|
+
/** The DDL of a shape. */
|
|
71
|
+
export const ftsShapeSql = (shape) =>
|
|
72
|
+
`CREATE VIRTUAL TABLE IF NOT EXISTS ${SEARCH_TABLE} USING fts5(\n ${shape.columns.join(',\n ')},\n tokenize = '${shape.tokenizer}'\n )`;
|
|
73
|
+
|
|
36
74
|
const SQL = String.raw;
|
|
37
75
|
|
|
38
76
|
export const BASE_SQL = SQL`
|
|
@@ -501,17 +539,14 @@ export function ensureSearchIndex(db, options = {}) {
|
|
|
501
539
|
writeSchemaMeta(db, 'search', SEARCH_MODE_LIKE);
|
|
502
540
|
return SEARCH_MODE_LIKE;
|
|
503
541
|
}
|
|
542
|
+
const existed = tableExists(db, SEARCH_TABLE);
|
|
504
543
|
try {
|
|
505
|
-
db.exec(
|
|
506
|
-
`CREATE VIRTUAL TABLE IF NOT EXISTS ${SEARCH_TABLE} USING fts5(
|
|
507
|
-
task_slug UNINDEXED,
|
|
508
|
-
doc_path UNINDEXED,
|
|
509
|
-
kind UNINDEXED,
|
|
510
|
-
body,
|
|
511
|
-
tokenize = 'unicode61 remove_diacritics 2'
|
|
512
|
-
)`,
|
|
513
|
-
);
|
|
544
|
+
db.exec(ftsShapeSql(CURRENT_FTS_SHAPE));
|
|
514
545
|
writeSchemaMeta(db, 'search', SEARCH_MODE_FTS5);
|
|
546
|
+
// The shape token is written only when the table is created: a database
|
|
547
|
+
// that predates the registry keeps an absent token, so its state stays
|
|
548
|
+
// `unrecorded` and keeps being reported.
|
|
549
|
+
if (!existed) writeSchemaMeta(db, FTS_SHAPE_META_KEY, CURRENT_FTS_SHAPE.id);
|
|
515
550
|
return SEARCH_MODE_FTS5;
|
|
516
551
|
} catch {
|
|
517
552
|
writeSchemaMeta(db, 'search', SEARCH_MODE_LIKE);
|
|
@@ -519,6 +554,34 @@ export function ensureSearchIndex(db, options = {}) {
|
|
|
519
554
|
}
|
|
520
555
|
}
|
|
521
556
|
|
|
557
|
+
/**
|
|
558
|
+
* The drift state of the installed search table.
|
|
559
|
+
*
|
|
560
|
+
* The state is **reported**, never repaired: a drifted table is left as it is,
|
|
561
|
+
* the database stays readable, and the remedy is the existing rebuild path.
|
|
562
|
+
*/
|
|
563
|
+
export function detectFtsShapeDrift(db) {
|
|
564
|
+
if (!tableExists(db, SEARCH_TABLE)) {
|
|
565
|
+
return { state: 'absent', recorded: null, shape: null, columns: [] };
|
|
566
|
+
}
|
|
567
|
+
const columns = ftsColumnNames(db);
|
|
568
|
+
const recorded = readSchemaMeta(db, FTS_SHAPE_META_KEY);
|
|
569
|
+
if (recorded === null) {
|
|
570
|
+
return { state: 'unrecorded', recorded: null, shape: null, columns };
|
|
571
|
+
}
|
|
572
|
+
const known = FTS_SHAPES.find((shape) => shape.id === recorded);
|
|
573
|
+
if (!known) {
|
|
574
|
+
return { state: 'unknown', recorded, shape: null, columns };
|
|
575
|
+
}
|
|
576
|
+
if (known.id !== CURRENT_FTS_SHAPE.id) {
|
|
577
|
+
return { state: 'superseded', recorded, shape: known.id, columns };
|
|
578
|
+
}
|
|
579
|
+
if (columns.join(',') !== ftsShapeSignature(known)) {
|
|
580
|
+
return { state: 'unknown', recorded, shape: known.id, columns };
|
|
581
|
+
}
|
|
582
|
+
return { state: 'current', recorded, shape: known.id, columns };
|
|
583
|
+
}
|
|
584
|
+
|
|
522
585
|
export function readSearchMode(db) {
|
|
523
586
|
const meta = readSchemaMeta(db, 'search');
|
|
524
587
|
if (!tableExists(db, SEARCH_TABLE)) return SEARCH_MODE_LIKE;
|
|
@@ -783,6 +846,7 @@ export function openTeamDb(options = {}) {
|
|
|
783
846
|
schemaVersion: current < SCHEMA_VERSION ? SCHEMA_VERSION : current,
|
|
784
847
|
fingerprint,
|
|
785
848
|
searchMode,
|
|
849
|
+
searchShape: detectFtsShapeDrift(db),
|
|
786
850
|
};
|
|
787
851
|
} catch (error) {
|
|
788
852
|
try {
|
|
@@ -826,6 +890,12 @@ export function describeHandle(handle) {
|
|
|
826
890
|
`search ${handle.searchMode}`,
|
|
827
891
|
'integrity ok',
|
|
828
892
|
];
|
|
893
|
+
// A drifted search layout is reported, never repaired: the state names what
|
|
894
|
+
// is installed, and the rebuild path stays the remedy.
|
|
895
|
+
const shape = handle.searchShape;
|
|
896
|
+
if (shape && shape.state !== 'current' && shape.state !== 'absent') {
|
|
897
|
+
parts.push(`search-shape ${shape.state}`);
|
|
898
|
+
}
|
|
829
899
|
if (handle.rebuilt) parts.push('rebuilt=1');
|
|
830
900
|
return `${handle.dbPath}: ok (${parts.join(', ')})`;
|
|
831
901
|
}
|
|
@@ -196,6 +196,16 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
|
|
|
196
196
|
| `validation_failed` | build-verifier failed; re-run developer then build-verifier |
|
|
197
197
|
| `blocked` | Pipeline / step cannot proceed (e.g. `pipeline_parse_error`, completion of a parallel step whose producer's receipt was missing — see `agent-artifact-contracts.md` § Completion receipts) |
|
|
198
198
|
| `awaiting_artifact_receipt` | Producer stopped but the bound or assigned-output receipt was missing or stale; hook keeps the attempt active and does not advance. See `agent-artifact-contracts.md` (Schema field name + Receipt binding) for the silent-bug class that lands here. |
|
|
199
|
+
| `paused` | Operator sentinel engaged; the hook recorded the pause and refused to advance or hand off. Remove the sentinel and run `/task-continue`. |
|
|
200
|
+
|
|
201
|
+
### Operator pause and stale-attempt recovery
|
|
202
|
+
|
|
203
|
+
- Pause new steps with a file at `.ai.local/STOP` (also accepted: `.ai.local/ESTOP`). The chain hook finishes the in-flight attempt and its terminal receipt, records `state: paused` / `phase: paused`, and emits no handoff. An empty or corrupt sentinel still counts as engaged.
|
|
204
|
+
- A paused human gate stays open: the pause check runs before `end_human_gate` closes it, so removing the sentinel and running `/task-continue <slug>` reruns the same gate resume.
|
|
205
|
+
- Remove the sentinel, then run `/task-continue <slug>`. Only the hook writes the `paused` state; never edit `status.json` to pause or resume.
|
|
206
|
+
- An `activeAttempts` entry for the step being activated (or a sibling in the same parallel group) older than `AI_RULES_ATTEMPT_STALE_MS` with no terminal manifest receipt is reclaimed as `attempt_finished` with `outcome: stale` and `source: hook`, removed from `activeAttempts`, and that activation opens a new attempt. The override is **milliseconds** (default `3600000`, one hour); a value below the `60000` floor falls back to the default. An attempt belonging to another step is never reclaimed — its own activation owns it. A terminal receipt always wins; a fresh attempt is never reclaimed. The stale entry stays in the metrics ledger.
|
|
207
|
+
- The reclaim runs only inside the hook, immediately before a new attempt is activated. Never hand-reclaim an attempt by editing `.ai.local/team/tasks/<slug>` lifecycle files.
|
|
208
|
+
- In graph mode, a stale attempt on an in-flight step of another agent is reclaimed by that step's own activation or terminal receipt, not by an unrelated step; recovery is a receipt or `/task-continue <slug>`.
|
|
199
209
|
|
|
200
210
|
On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt (`completed` \| `changes_requested` \| `validation_failed`) when agents left lifecycle fields untouched. Parent orchestrators must wait for that handoff before invoking the next step.
|
|
201
211
|
|
|
@@ -212,6 +222,8 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
|
|
|
212
222
|
| `scope` | e.g. `unit-in-dev`, `e2e-only` — passed to developer/qa |
|
|
213
223
|
| `model` | `cheap` \| `standard` \| `strong` — optional tier override |
|
|
214
224
|
|
|
225
|
+
`writeScopes` are reconciled after the step, never in the hook: `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id> --json` labels every changed path `declared`, `derived`, or `out-of-scope`. `build-verifier` hard-fails an out-of-scope implementation write; `code-reviewer` reports a reviewer-step path as advisory.
|
|
226
|
+
|
|
215
227
|
## Rules (strict)
|
|
216
228
|
|
|
217
229
|
1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline). When `.ai.local/rules/task-levels.md` selects **L0** or a skip-analyst **L1**, task-router may emit a short `steps[]` list for that level. **L2** / **L3** still attach an OpenSpec change. `pipeline.json` → `steps[]` still schedules the run. This short list does not remove `build-verifier` or `code-reviewer` from implementation pipelines.
|
|
@@ -244,13 +256,24 @@ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
|
|
|
244
256
|
### Model when invoking (Task)
|
|
245
257
|
|
|
246
258
|
1. Read `steps[i].model` if present; else use the agent’s frontmatter `model` (see `agents/README.md` matrix).
|
|
247
|
-
2.
|
|
248
|
-
- **`cheap`** →
|
|
249
|
-
- **`standard`** →
|
|
250
|
-
- **`strong`** →
|
|
251
|
-
|
|
259
|
+
2. Resolve the tier through `.ai.local/team/model-tiers.json` → `tiers.<tier>` when that file exists. The user approved that map, so passing an explicit model is allowed. Pass the resolved `providerID/modelID` (or `providerID/modelID#variant`) to the Task/subagent tool.
|
|
260
|
+
- **`cheap`** → mechanical steps only (router, analyst, tech-writer, codebase-analyzer).
|
|
261
|
+
- **`standard`** → implementation, verification, review, QA, contract review.
|
|
262
|
+
- **`strong`** → architecture, security, migration, performance, mockup review. Never downgrade a `strong` step to the parent default.
|
|
263
|
+
- If a tier is declared but the file has no mapping, **STOP** and report `model-tier-unmapped`; do not silently inherit the parent model.
|
|
264
|
+
3. If the tool does not accept a model (Cursor/Claude adapters), record the resolved tier in the handoff and let the platform pin apply.
|
|
265
|
+
4. Parallel steps: apply the step-level `model` to **each** agent in the array (or omit → each agent’s own frontmatter).
|
|
266
|
+
5. The tier never changes the step order, gates, receipts, or retry policy.
|
|
267
|
+
|
|
268
|
+
**Token usage.** When the host exposes token counts, append a `usage_recorded` event next to the attempt:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--model <id>]
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The chain hook also forwards a `usage` object from its input into the `attempt_finished` event. Never estimate or invent token counts; a missing usage record stays missing.
|
|
252
275
|
|
|
253
|
-
After each agent completes, verify its terminal manifest receipt, then let the orchestration runtime/hook reconcile `status.json` (`completed`, a blocking outcome, or `awaiting_approval`) from that receipt. Do not ask the agent to mutate shared lifecycle fields, and do not invoke the next specialist until the hook has written the handoff / updated `status.json`.
|
|
276
|
+
After each agent completes, verify its terminal manifest receipt, then let the orchestration runtime/hook reconcile `status.json` (`completed`, a blocking outcome, or `awaiting_approval`) from that receipt. Pass the active slug explicitly: `TEAM_TASK_SLUG=<slug> bash .opencode/hooks/chain-team-phases.sh` (or the host's hook path). The `active-task.json` pointer is a single-slot fallback and a parallel session can overwrite it; do not rely on it alone. Do not ask the agent to mutate shared lifecycle fields, and do not invoke the next specialist until the hook has written the handoff / updated `status.json`.
|
|
254
277
|
|
|
255
278
|
## Legacy mode
|
|
256
279
|
|
|
@@ -58,7 +58,9 @@ multi-wave work). It ratchets down for bounded/spike tasks (see § Ratchet).
|
|
|
58
58
|
- **Opt-in and conditional — only when the engine exists.** In-task self-learning loop: run
|
|
59
59
|
`node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn
|
|
60
60
|
with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with
|
|
61
|
-
`node .ai.local/scripts/run.mjs --status`.
|
|
61
|
+
`node .ai.local/scripts/run.mjs --status`. Keep the loop deterministic: it runs no model-driven pass — rule text
|
|
62
|
+
is template-derived from the validated signature; a model-driven pass is not part of the loop, and if one is ever
|
|
63
|
+
added it must be default-off and may write only to the staged band.
|
|
62
64
|
- The engine enforces the Rule of Three (≥2 distinct tasks → edit a local rule or `conventions.md` gotcha; ≥3 →
|
|
63
65
|
stage a new rule) and applies or stages per the two-band autonomy policy. Never count the threshold by hand; never
|
|
64
66
|
edit the engine. Engine absent → nothing to run; say so in the receipt instead of guessing. Not a new pipeline
|
|
@@ -30,6 +30,7 @@ A diff-shaped read is a floor, not a review. Run these five passes on every non-
|
|
|
30
30
|
- **`finding`** — reported like any other finding, with `path:line`.
|
|
31
31
|
- **`no finding`** — with one line of evidence: what was searched or read.
|
|
32
32
|
- **`unable to run`** — with the reason: the pass does not apply to this diff, or an input is missing.
|
|
33
|
+
- **`partial`** — the breadth budget stopped the pass; name every unread path or glob. Use it only on the call-site sweep.
|
|
33
34
|
|
|
34
35
|
An outcome word alone is not a record: `no finding` without its evidence line, or `unable to run` without its reason, is an unfinished pass.
|
|
35
36
|
|
|
@@ -39,6 +40,15 @@ An outcome word alone is not a record: `no finding` without its evidence line, o
|
|
|
39
40
|
4. **Test gap** — not "is there a test" but "which behaviour change would still pass every existing test". That gap is the finding.
|
|
40
41
|
5. **Half-life** — what breaks in six months: hidden coupling, implicit contract, missing migration, an unowned copy of the same rule.
|
|
41
42
|
|
|
43
|
+
## Review breadth budget
|
|
44
|
+
|
|
45
|
+
- Bound **breadth**, not depth: the call-site sweep and the one-hop consumer read stop at this budget. The five depth passes still run on what was read.
|
|
46
|
+
- Budget: the changed exports, types, routes, and events in the diff, plus one hop of their consumers. Read no consumer that neither the diff nor a recorded finding names.
|
|
47
|
+
- Stop when either limit is reached: 40 changed-symbol call sites, or 15 minutes of breadth reads on one review.
|
|
48
|
+
- When the budget is exhausted, stop the sweep and record `partial` in `## Depth passes` for the call-site sweep, with every unread path or glob named inline.
|
|
49
|
+
- Never claim full coverage after a `partial` row. The verdict follows the findings actually recorded.
|
|
50
|
+
- A deliberate overrun (frozen contract, security boundary, migration) states the limit exceeded in one line; do not extend the budget silently.
|
|
51
|
+
|
|
42
52
|
## Constraints
|
|
43
53
|
|
|
44
54
|
- The diff defines the **change under review**, not the boundary of the review. Follow the change one hop out: call sites, consumers, contracts, migrations, and the tests that already cover the touched path. Do not review unchanged code for its own sake — cite it only as evidence about the change.
|