@bonesofspring/ai-rules 0.2.78 → 0.2.80
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 +47 -0
- package/README.md +4 -2
- package/bin/lib/engine-scripts.js +6 -0
- package/bin/lib/seed-ai-local-team.js +2 -0
- package/docs/TEAM-DB.md +118 -15
- package/docs/openapi/team-db.v1.json +2879 -1858
- package/package.json +5 -1
- package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +264 -0
- package/presets/_shared/ai-local/scripts/rr-migrate-repositories.mjs +481 -0
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +211 -12
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +289 -3
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +857 -1
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +68 -0
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +29 -10
- package/presets/_shared/ai-local/scripts/team-db.mjs +46 -1
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +69 -1
- package/presets/claude/android-kotlin/agents/task-router.md +2 -0
- package/presets/claude/android-kotlin/commands/README.md +1 -0
- package/presets/claude/android-kotlin/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/android-kotlin/commands/task.md +4 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/go/agents/task-router.md +2 -0
- package/presets/claude/go/commands/README.md +1 -0
- package/presets/claude/go/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/go/commands/task.md +4 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/ios-swift/agents/task-router.md +2 -0
- package/presets/claude/ios-swift/commands/README.md +1 -0
- package/presets/claude/ios-swift/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/ios-swift/commands/task.md +4 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/java/agents/task-router.md +2 -0
- package/presets/claude/java/commands/README.md +1 -0
- package/presets/claude/java/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/java/commands/task.md +4 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/mcp-ts/agents/task-router.md +2 -0
- package/presets/claude/mcp-ts/commands/README.md +1 -0
- package/presets/claude/mcp-ts/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/mcp-ts/commands/task.md +4 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/mol/agents/task-router.md +2 -0
- package/presets/claude/mol/commands/README.md +1 -0
- package/presets/claude/mol/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/mol/commands/task.md +4 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/next/agents/task-router.md +2 -0
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/next/commands/task.md +4 -0
- package/presets/claude/next/commands/ui-start.md +12 -4
- package/presets/claude/next/commands/ui-stop.md +5 -2
- package/presets/claude/next/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/nuxt/agents/task-router.md +2 -0
- package/presets/claude/nuxt/commands/README.md +1 -0
- package/presets/claude/nuxt/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/nuxt/commands/task.md +4 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/php-hexagonal/agents/task-router.md +2 -0
- package/presets/claude/php-hexagonal/commands/README.md +1 -0
- package/presets/claude/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/php-hexagonal/commands/task.md +4 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/php-laravel/agents/task-router.md +2 -0
- package/presets/claude/php-laravel/commands/README.md +1 -0
- package/presets/claude/php-laravel/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/php-laravel/commands/task.md +4 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/svelte/agents/task-router.md +2 -0
- package/presets/claude/svelte/commands/README.md +1 -0
- package/presets/claude/svelte/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/svelte/commands/task.md +4 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/android-kotlin/agents/task-router.md +2 -0
- package/presets/cursor/android-kotlin/commands/README.md +1 -0
- package/presets/cursor/android-kotlin/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/android-kotlin/commands/task.md +4 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/go/agents/task-router.md +2 -0
- package/presets/cursor/go/commands/README.md +1 -0
- package/presets/cursor/go/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/go/commands/task.md +4 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/ios-swift/agents/task-router.md +2 -0
- package/presets/cursor/ios-swift/commands/README.md +1 -0
- package/presets/cursor/ios-swift/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/ios-swift/commands/task.md +4 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/java/agents/task-router.md +2 -0
- package/presets/cursor/java/commands/README.md +1 -0
- package/presets/cursor/java/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/java/commands/task.md +4 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/mcp-ts/agents/task-router.md +2 -0
- package/presets/cursor/mcp-ts/commands/README.md +1 -0
- package/presets/cursor/mcp-ts/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/mcp-ts/commands/task.md +4 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/mol/agents/task-router.md +2 -0
- package/presets/cursor/mol/commands/README.md +1 -0
- package/presets/cursor/mol/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/mol/commands/task.md +4 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/next/agents/task-router.md +2 -0
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/next/commands/task.md +4 -0
- package/presets/cursor/next/commands/ui-start.md +12 -4
- package/presets/cursor/next/commands/ui-stop.md +5 -2
- package/presets/cursor/next/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/nuxt/agents/task-router.md +2 -0
- package/presets/cursor/nuxt/commands/README.md +1 -0
- package/presets/cursor/nuxt/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/nuxt/commands/task.md +4 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/php-hexagonal/agents/task-router.md +2 -0
- package/presets/cursor/php-hexagonal/commands/README.md +1 -0
- package/presets/cursor/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/php-hexagonal/commands/task.md +4 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/php-laravel/agents/task-router.md +2 -0
- package/presets/cursor/php-laravel/commands/README.md +1 -0
- package/presets/cursor/php-laravel/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/php-laravel/commands/task.md +4 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/svelte/agents/task-router.md +2 -0
- package/presets/cursor/svelte/commands/README.md +1 -0
- package/presets/cursor/svelte/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/svelte/commands/task.md +4 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/android-kotlin/adapter-map.json +9 -1
- package/presets/mavis/android-kotlin/agents/task-router.md +2 -0
- package/presets/mavis/android-kotlin/commands/README.md +1 -0
- package/presets/mavis/android-kotlin/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/android-kotlin/commands/task.md +4 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/go/adapter-map.json +9 -1
- package/presets/mavis/go/agents/task-router.md +2 -0
- package/presets/mavis/go/commands/README.md +1 -0
- package/presets/mavis/go/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/go/commands/task.md +4 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/ios-swift/adapter-map.json +9 -1
- package/presets/mavis/ios-swift/agents/task-router.md +2 -0
- package/presets/mavis/ios-swift/commands/README.md +1 -0
- package/presets/mavis/ios-swift/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/ios-swift/commands/task.md +4 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/java/adapter-map.json +9 -1
- package/presets/mavis/java/agents/task-router.md +2 -0
- package/presets/mavis/java/commands/README.md +1 -0
- package/presets/mavis/java/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/java/commands/task.md +4 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/mcp-ts/adapter-map.json +9 -1
- package/presets/mavis/mcp-ts/agents/task-router.md +2 -0
- package/presets/mavis/mcp-ts/commands/README.md +1 -0
- package/presets/mavis/mcp-ts/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/mcp-ts/commands/task.md +4 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/mol/adapter-map.json +9 -1
- package/presets/mavis/mol/agents/task-router.md +2 -0
- package/presets/mavis/mol/commands/README.md +1 -0
- package/presets/mavis/mol/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/mol/commands/task.md +4 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/next/adapter-map.json +9 -1
- package/presets/mavis/next/agents/task-router.md +2 -0
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/next/commands/task.md +4 -0
- package/presets/mavis/next/commands/ui-start.md +12 -4
- package/presets/mavis/next/commands/ui-stop.md +5 -2
- package/presets/mavis/next/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/nuxt/adapter-map.json +9 -1
- package/presets/mavis/nuxt/agents/task-router.md +2 -0
- package/presets/mavis/nuxt/commands/README.md +1 -0
- package/presets/mavis/nuxt/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/nuxt/commands/task.md +4 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +9 -1
- package/presets/mavis/php-hexagonal/agents/task-router.md +2 -0
- package/presets/mavis/php-hexagonal/commands/README.md +1 -0
- package/presets/mavis/php-hexagonal/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/php-hexagonal/commands/task.md +4 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/php-laravel/adapter-map.json +9 -1
- package/presets/mavis/php-laravel/agents/task-router.md +2 -0
- package/presets/mavis/php-laravel/commands/README.md +1 -0
- package/presets/mavis/php-laravel/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/php-laravel/commands/task.md +4 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/svelte/adapter-map.json +9 -1
- package/presets/mavis/svelte/agents/task-router.md +2 -0
- package/presets/mavis/svelte/commands/README.md +1 -0
- package/presets/mavis/svelte/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/svelte/commands/task.md +4 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/android-kotlin/adapter-map.json +9 -1
- package/presets/opencode/android-kotlin/agents/task-router.md +2 -0
- package/presets/opencode/android-kotlin/commands/README.md +1 -0
- package/presets/opencode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/android-kotlin/commands/task.md +4 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/go/adapter-map.json +9 -1
- package/presets/opencode/go/agents/task-router.md +2 -0
- package/presets/opencode/go/commands/README.md +1 -0
- package/presets/opencode/go/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/go/commands/task.md +4 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/ios-swift/adapter-map.json +9 -1
- package/presets/opencode/ios-swift/agents/task-router.md +2 -0
- package/presets/opencode/ios-swift/commands/README.md +1 -0
- package/presets/opencode/ios-swift/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/ios-swift/commands/task.md +4 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/java/adapter-map.json +9 -1
- package/presets/opencode/java/agents/task-router.md +2 -0
- package/presets/opencode/java/commands/README.md +1 -0
- package/presets/opencode/java/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/java/commands/task.md +4 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/mcp-ts/adapter-map.json +9 -1
- package/presets/opencode/mcp-ts/agents/task-router.md +2 -0
- package/presets/opencode/mcp-ts/commands/README.md +1 -0
- package/presets/opencode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/mcp-ts/commands/task.md +4 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/mol/adapter-map.json +9 -1
- package/presets/opencode/mol/agents/task-router.md +2 -0
- package/presets/opencode/mol/commands/README.md +1 -0
- package/presets/opencode/mol/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/mol/commands/task.md +4 -0
- package/presets/opencode/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/next/adapter-map.json +9 -1
- package/presets/opencode/next/agents/task-router.md +2 -0
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/next/commands/task.md +4 -0
- package/presets/opencode/next/commands/ui-start.md +12 -4
- package/presets/opencode/next/commands/ui-stop.md +5 -2
- package/presets/opencode/next/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/nuxt/adapter-map.json +9 -1
- package/presets/opencode/nuxt/agents/task-router.md +2 -0
- package/presets/opencode/nuxt/commands/README.md +1 -0
- package/presets/opencode/nuxt/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/nuxt/commands/task.md +4 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +9 -1
- package/presets/opencode/php-hexagonal/agents/task-router.md +2 -0
- package/presets/opencode/php-hexagonal/commands/README.md +1 -0
- package/presets/opencode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/php-hexagonal/commands/task.md +4 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/php-laravel/adapter-map.json +9 -1
- package/presets/opencode/php-laravel/agents/task-router.md +2 -0
- package/presets/opencode/php-laravel/commands/README.md +1 -0
- package/presets/opencode/php-laravel/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/php-laravel/commands/task.md +4 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/plugins/task-status/README.md +15 -7
- package/presets/opencode/plugins/task-status/deepseek.ts +193 -0
- package/presets/opencode/plugins/task-status/details-data.ts +39 -2
- package/presets/opencode/plugins/task-status/prompt-text.ts +18 -8
- package/presets/opencode/plugins/task-status/task-view.ts +253 -63
- package/presets/opencode/plugins/task-status/tui.tsx +48 -11
- package/presets/opencode/svelte/adapter-map.json +9 -1
- package/presets/opencode/svelte/agents/task-router.md +2 -0
- package/presets/opencode/svelte/commands/README.md +1 -0
- package/presets/opencode/svelte/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/svelte/commands/task.md +4 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/android-kotlin/adapter-map.json +9 -1
- package/presets/zcode/android-kotlin/agents/task-router.md +2 -0
- package/presets/zcode/android-kotlin/commands/README.md +1 -0
- package/presets/zcode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/android-kotlin/commands/task.md +4 -0
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/go/adapter-map.json +9 -1
- package/presets/zcode/go/agents/task-router.md +2 -0
- package/presets/zcode/go/commands/README.md +1 -0
- package/presets/zcode/go/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/go/commands/task.md +4 -0
- package/presets/zcode/go/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/ios-swift/adapter-map.json +9 -1
- package/presets/zcode/ios-swift/agents/task-router.md +2 -0
- package/presets/zcode/ios-swift/commands/README.md +1 -0
- package/presets/zcode/ios-swift/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/ios-swift/commands/task.md +4 -0
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/java/adapter-map.json +9 -1
- package/presets/zcode/java/agents/task-router.md +2 -0
- package/presets/zcode/java/commands/README.md +1 -0
- package/presets/zcode/java/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/java/commands/task.md +4 -0
- package/presets/zcode/java/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/mcp-ts/adapter-map.json +9 -1
- package/presets/zcode/mcp-ts/agents/task-router.md +2 -0
- package/presets/zcode/mcp-ts/commands/README.md +1 -0
- package/presets/zcode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/mcp-ts/commands/task.md +4 -0
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/mol/adapter-map.json +9 -1
- package/presets/zcode/mol/agents/task-router.md +2 -0
- package/presets/zcode/mol/commands/README.md +1 -0
- package/presets/zcode/mol/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/mol/commands/task.md +4 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/next/adapter-map.json +9 -1
- package/presets/zcode/next/agents/task-router.md +2 -0
- package/presets/zcode/next/commands/README.md +1 -0
- package/presets/zcode/next/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/next/commands/task.md +4 -0
- package/presets/zcode/next/commands/ui-start.md +12 -4
- package/presets/zcode/next/commands/ui-stop.md +5 -2
- package/presets/zcode/next/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/nuxt/adapter-map.json +9 -1
- package/presets/zcode/nuxt/agents/task-router.md +2 -0
- package/presets/zcode/nuxt/commands/README.md +1 -0
- package/presets/zcode/nuxt/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/nuxt/commands/task.md +4 -0
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/php-hexagonal/adapter-map.json +9 -1
- package/presets/zcode/php-hexagonal/agents/task-router.md +2 -0
- package/presets/zcode/php-hexagonal/commands/README.md +1 -0
- package/presets/zcode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/php-hexagonal/commands/task.md +4 -0
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/php-laravel/adapter-map.json +9 -1
- package/presets/zcode/php-laravel/agents/task-router.md +2 -0
- package/presets/zcode/php-laravel/commands/README.md +1 -0
- package/presets/zcode/php-laravel/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/php-laravel/commands/task.md +4 -0
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/svelte/adapter-map.json +9 -1
- package/presets/zcode/svelte/agents/task-router.md +2 -0
- package/presets/zcode/svelte/commands/README.md +1 -0
- package/presets/zcode/svelte/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/svelte/commands/task.md +4 -0
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +69 -1
|
@@ -2950,6 +2950,10 @@ if (status.state === 'awaiting_artifact_receipt') {
|
|
|
2950
2950
|
emitArtifactStall(artifactStallMessage, !wasWaitingForReceipt);
|
|
2951
2951
|
process.exit(0);
|
|
2952
2952
|
}
|
|
2953
|
+
// Snapshot before `finishActiveAttempt` writes `lastCompletedAttempt`: the
|
|
2954
|
+
// repositories intake gate judges a task at its first receipt, so a folder whose
|
|
2955
|
+
// first step already completed is never re-judged.
|
|
2956
|
+
const hadPriorCompletion = Boolean(status.lastCompletedAttempt);
|
|
2953
2957
|
let finishedAttempt = finishActiveAttempt();
|
|
2954
2958
|
// The just-finished attempt's metric is already written; a pause now blocks
|
|
2955
2959
|
// every handoff, including the unattributable-stop repair path below.
|
|
@@ -2977,7 +2981,7 @@ if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
|
|
|
2977
2981
|
}
|
|
2978
2982
|
}
|
|
2979
2983
|
endHumanGateIfResumed();
|
|
2980
|
-
if (steps.length === 0
|
|
2984
|
+
if (steps.length === 0) {
|
|
2981
2985
|
writeStatus({});
|
|
2982
2986
|
process.stdout.write('{}');
|
|
2983
2987
|
process.exit(0);
|
|
@@ -3024,6 +3028,70 @@ const waveIndexes = activeWave
|
|
|
3024
3028
|
? [idx]
|
|
3025
3029
|
: (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
|
|
3026
3030
|
|
|
3031
|
+
/**
|
|
3032
|
+
* Intake invariant: a task records which repositories it touches — or says that
|
|
3033
|
+
* it does not know. Judged on the first receipt of a task: the router's, or the
|
|
3034
|
+
* first step's when a pipeline runs without one. A task that already completed a
|
|
3035
|
+
* step predates the invariant and is never re-judged.
|
|
3036
|
+
* `intakeExemption: { approvedBy, reason, at }` is the recorded escape hatch; a
|
|
3037
|
+
* bare boolean does not count, so an exemption always names who approved it. The
|
|
3038
|
+
* shape mirrors `check-task-repositories.mjs`, which audits the same field after
|
|
3039
|
+
* the fact.
|
|
3040
|
+
*/
|
|
3041
|
+
const REPOSITORY_INFERENCES = new Set(['evidence-paths', 'repo-scope-only', 'unknown', 'ambiguous']);
|
|
3042
|
+
const EXEMPTION_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
3043
|
+
function repositoriesIntakeViolation(record) {
|
|
3044
|
+
if (!record) return 'has no `repositories` array';
|
|
3045
|
+
const ids = record.repositories;
|
|
3046
|
+
const inference = record.repositoriesInference;
|
|
3047
|
+
if (!Array.isArray(ids)) return 'carries no `repositories` array';
|
|
3048
|
+
if (ids.some((id) => typeof id !== 'string' || id.trim() === '')) return 'carries a `repositories` entry that is not a non-empty registry id';
|
|
3049
|
+
if (ids.length === 0) {
|
|
3050
|
+
return inference === 'unknown' ? null : 'carries `repositories: []` without `"repositoriesInference": "unknown"`';
|
|
3051
|
+
}
|
|
3052
|
+
if (inference !== undefined && !REPOSITORY_INFERENCES.has(inference)) return `carries an unknown \`repositoriesInference\` value "${inference}"`;
|
|
3053
|
+
if (inference === 'unknown') return 'lists repositories beside `"repositoriesInference": "unknown"`';
|
|
3054
|
+
let known = null;
|
|
3055
|
+
try {
|
|
3056
|
+
const registry = JSON.parse(fs.readFileSync(path.join(TEAM_ROOT, 'repositories.json'), 'utf8'));
|
|
3057
|
+
known = new Set((Array.isArray(registry.repositories) ? registry.repositories : []).map((row) => row && row.id).filter((id) => typeof id === 'string'));
|
|
3058
|
+
} catch { known = null; }
|
|
3059
|
+
if (known && known.size > 0) {
|
|
3060
|
+
const unknownIds = ids.filter((id) => !known.has(id));
|
|
3061
|
+
if (unknownIds.length > 0) return `names ${unknownIds.join(', ')} — not in .ai.local/team/repositories.json`;
|
|
3062
|
+
}
|
|
3063
|
+
return null;
|
|
3064
|
+
}
|
|
3065
|
+
function repositoriesIntakeExemption(record) {
|
|
3066
|
+
const entry = record && record.intakeExemption;
|
|
3067
|
+
if (!entry || typeof entry !== 'object') return null;
|
|
3068
|
+
const approvedBy = typeof entry.approvedBy === 'string' ? entry.approvedBy.trim() : '';
|
|
3069
|
+
const reason = typeof entry.reason === 'string' ? entry.reason.trim() : '';
|
|
3070
|
+
const at = typeof entry.at === 'string' ? entry.at.trim() : '';
|
|
3071
|
+
if (approvedBy === '' || reason.length < 10 || !EXEMPTION_DATE.test(at)) return null;
|
|
3072
|
+
return { approvedBy, reason, at };
|
|
3073
|
+
}
|
|
3074
|
+
const repositoriesGateApplies = Boolean(finishedAttempt)
|
|
3075
|
+
&& (completedAgent === 'task-router' || (!hadPriorCompletion && completedStepIndex === 0));
|
|
3076
|
+
if (repositoriesGateApplies) {
|
|
3077
|
+
const violation = repositoriesIntakeViolation(pipeline);
|
|
3078
|
+
if (violation) {
|
|
3079
|
+
const exemption = repositoriesIntakeExemption(pipeline);
|
|
3080
|
+
if (!exemption) {
|
|
3081
|
+
appendMetric({ type: 'intake_repositories_blocked', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, source: 'hook', attributionConfidence: 'high' });
|
|
3082
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
|
|
3083
|
+
out(`pipeline.json for "${slug}" ${violation}. Intake stays open until the repositories are recorded: set "repositories" to the ids in .ai.local/team/repositories.json with "repositoriesInference": "evidence-paths" (or "repo-scope-only"), or "repositories": [] with "repositoriesInference": "unknown" when the request names none. Rewrite pipeline.json through the task-router, then resume via /task-continue ${slug}. A task that predates the invariant carries "intakeExemption": { "approvedBy": "<human>", "reason": "<why, 10+ characters>", "at": "YYYY-MM-DD" } — a bare boolean is not accepted.`);
|
|
3084
|
+
process.exit(0);
|
|
3085
|
+
}
|
|
3086
|
+
appendMetric({ type: 'intake_repositories_exempted', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, approvedBy: exemption.approvedBy, reason: exemption.reason, exemptedAt: exemption.at, source: 'hook', attributionConfidence: 'high' });
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
if (pipeline.autoChain === false) {
|
|
3090
|
+
writeStatus({});
|
|
3091
|
+
process.stdout.write('{}');
|
|
3092
|
+
process.exit(0);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3027
3095
|
|
|
3028
3096
|
if (waveIndexes) {
|
|
3029
3097
|
const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
|
|
@@ -171,6 +171,8 @@ Do **not** add a dedicated `spec-author` agent for `docs/specs/**`. Do not requi
|
|
|
171
171
|
|
|
172
172
|
**specMode (optional `pipeline.json` field):** `none` for spike/research; `generate` for `spec-gen` / `/spec-start`; `consume` default when INDEX exists. Echo top-level `specMode`. Brief `## Spec mode` wins on conflict.
|
|
173
173
|
|
|
174
|
+
**repositories (mandatory `pipeline.json` field):** echo `"repositories": [<ids>]` and `"repositoriesInference": "evidence-paths" | "repo-scope-only" | "unknown" | "ambiguous"` immediately after `specMode`, before `summary`; the ids come from `.ai.local/team/repositories.json` and are never defaulted to the workspace repository. Then record the same list as link rows through `node .ai.local/scripts/team-db.mjs repositories apply --file -` — one `{"links": [{taskSlug, repositoryId, source: "intake", inference: "evidence-paths"}]}` envelope per touched repository (the verb takes the envelope, never a bare row). When the request names no repository, write `"repositories": []` with `"unknown"` and one `{"attributions": [{taskSlug, verdict: "unknown", evidence: ""}]}` envelope; `yarn check:task-repositories` fails a folder without the field.
|
|
175
|
+
|
|
174
176
|
Do **not** add a pipeline step for `spec-discovery`. Instruct analyst to load that skill only when the user/AC asks research-before-spec.
|
|
175
177
|
|
|
176
178
|
## Runtime initialization
|
|
@@ -11,6 +11,7 @@ Slash commands are copied to `.claude/commands/` on `ai-rules init claude --pres
|
|
|
11
11
|
| `/technical-retro [slug]` | Retro; with slug — “Agent work” block |
|
|
12
12
|
| `update.md` | Reinstall each installed tool with the preset recorded at init |
|
|
13
13
|
| `migrate-tasks.md` | Create or reconcile `.ai.local/team/team.db`; writes only the delta |
|
|
14
|
+
| `rr-migrate-repositories.md` | Scan repositories on disk, add the missing ones to the local registry, and project the file into `team.db` |
|
|
14
15
|
|
|
15
16
|
## `/task` examples
|
|
16
17
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rr-migrate-repositories
|
|
3
|
+
description: Scan repositories on disk, add the missing ones to the local registry, and project the file into team.db.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate repositories
|
|
7
|
+
|
|
8
|
+
Turn the repositories already cloned on this machine into registry records, then
|
|
9
|
+
sync the registry file into the team database.
|
|
10
|
+
|
|
11
|
+
## What to do
|
|
12
|
+
|
|
13
|
+
1. From the repository root, run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node .ai.local/scripts/rr-migrate-repositories.mjs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Report the summary in the user's native language, keeping the counters
|
|
20
|
+
verbatim: `scanned`, `repositories`, `duplicates`, `create`, `update`,
|
|
21
|
+
`unchanged`, `not-on-disk`, and the `project` line.
|
|
22
|
+
3. A `disabled by AI_RULES_TEAM_DB_DISABLE` line means the plan was computed and
|
|
23
|
+
nothing was written; exit 0 is the documented fallback. Relay it and stop.
|
|
24
|
+
4. Any non-zero exit: quote stderr and stop.
|
|
25
|
+
|
|
26
|
+
## Arguments
|
|
27
|
+
|
|
28
|
+
- `--scan <dir>` — directory to scan; repeatable. Default: the parent of the
|
|
29
|
+
repository root (the repository root itself when its parent is `$HOME`), so
|
|
30
|
+
sibling clones are picked up.
|
|
31
|
+
- `--depth <n>` — directory levels below a scan root (default `4`).
|
|
32
|
+
- `--dry-run` — print the plan and write nothing.
|
|
33
|
+
- `--no-update` — create missing records only; never touch an existing one.
|
|
34
|
+
- `--team-root <dir>` — team store root (default `<repo-root>/.ai.local/team`).
|
|
35
|
+
- `--json` — machine-readable summary.
|
|
36
|
+
|
|
37
|
+
## What the script does
|
|
38
|
+
|
|
39
|
+
- Walks the scan roots; a directory with `.git` is a repository and is not
|
|
40
|
+
descended into. Submodule checkouts and linked worktrees are skipped.
|
|
41
|
+
- Collapses clones that share one remote to the shallowest path.
|
|
42
|
+
- Keeps the id of a record whose locator already exists, so a re-run is
|
|
43
|
+
idempotent; a new id is the slug of the directory name, with a parent prefix
|
|
44
|
+
when that slug is taken.
|
|
45
|
+
- Creates missing records through `team-db.mjs repositories apply`, updates a
|
|
46
|
+
changed `name`, `locator`, or `status` through `repositories put`, then runs
|
|
47
|
+
`repositories project`. The lock-guarded verb is the only writer.
|
|
48
|
+
- Never deletes a record: a repository missing from this scan may simply live
|
|
49
|
+
outside the scanned roots.
|
|
50
|
+
|
|
51
|
+
`.ai.local/team/repositories.json` is local-only and git-ignored. The database is
|
|
52
|
+
derived: deleting `team.db` costs a rebuild, not the records.
|
|
53
|
+
|
|
54
|
+
## Do not
|
|
55
|
+
|
|
56
|
+
- Hand-edit `.ai.local/team/repositories.json`; the verb owns the write lock.
|
|
57
|
+
- Commit the registry file or `team.db*`.
|
|
58
|
+
- Delete registry records to make a scan look clean.
|
|
59
|
+
- Pass `--scan` a filesystem root without a matching `--depth`.
|
|
@@ -44,6 +44,10 @@ Examples:
|
|
|
44
44
|
6. **After each agent** — wait for hook handoff / reconciliation of the terminal receipt → `status.state`; do not start the next step until `status.json` reflects the handoff (or until there is a hook `followup_message`).
|
|
45
45
|
7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
|
|
46
46
|
|
|
47
|
+
## Repositories (mandatory)
|
|
48
|
+
|
|
49
|
+
The repositories a task touches are part of its intake: `pipeline.json` must carry `"repositories": [<registry ids>]`, or `"repositories": []` together with `"repositoriesInference": "unknown"` when the request names none. The router reads `.ai.local/team/repositories.json` and records the same list as link rows; the field is never defaulted; `node .ai.local/scripts/check-task-repositories.mjs` audits the store and the chain hook blocks a task-router receipt that omits it. See `agents/task-router.md`.
|
|
50
|
+
|
|
47
51
|
## Plan contract
|
|
48
52
|
|
|
49
53
|
Intake runs the planning workflow before any implementation: **goal frame** (goal, user value, success + result-evaluation criteria) → **requirements + AC-IDs** → **information-sufficiency** verdict (`sufficient` | `insufficient`) → decompose with a **dependency graph** (`dependsOn[]`, DAG, critical path) and, for large flows, **epics / stages** with exit criteria. The plan is revisable: a **plan revision** is a named, recorded operation (`planRevision`), and progress is checkpointed to `.memlog.md` (with the optional `contextBudget` note) so a run can resume.
|
|
@@ -2955,6 +2955,10 @@ if (status.state === 'awaiting_artifact_receipt') {
|
|
|
2955
2955
|
emitArtifactStall(artifactStallMessage, !wasWaitingForReceipt);
|
|
2956
2956
|
process.exit(0);
|
|
2957
2957
|
}
|
|
2958
|
+
// Snapshot before `finishActiveAttempt` writes `lastCompletedAttempt`: the
|
|
2959
|
+
// repositories intake gate judges a task at its first receipt, so a folder whose
|
|
2960
|
+
// first step already completed is never re-judged.
|
|
2961
|
+
const hadPriorCompletion = Boolean(status.lastCompletedAttempt);
|
|
2958
2962
|
let finishedAttempt = finishActiveAttempt();
|
|
2959
2963
|
// The just-finished attempt's metric is already written; a pause now blocks
|
|
2960
2964
|
// every handoff, including the unattributable-stop repair path below.
|
|
@@ -2982,7 +2986,7 @@ if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
|
|
|
2982
2986
|
}
|
|
2983
2987
|
}
|
|
2984
2988
|
endHumanGateIfResumed();
|
|
2985
|
-
if (steps.length === 0
|
|
2989
|
+
if (steps.length === 0) {
|
|
2986
2990
|
writeStatus({});
|
|
2987
2991
|
process.stdout.write('{}');
|
|
2988
2992
|
process.exit(0);
|
|
@@ -3029,6 +3033,70 @@ const waveIndexes = activeWave
|
|
|
3029
3033
|
? [idx]
|
|
3030
3034
|
: (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
|
|
3031
3035
|
|
|
3036
|
+
/**
|
|
3037
|
+
* Intake invariant: a task records which repositories it touches — or says that
|
|
3038
|
+
* it does not know. Judged on the first receipt of a task: the router's, or the
|
|
3039
|
+
* first step's when a pipeline runs without one. A task that already completed a
|
|
3040
|
+
* step predates the invariant and is never re-judged.
|
|
3041
|
+
* `intakeExemption: { approvedBy, reason, at }` is the recorded escape hatch; a
|
|
3042
|
+
* bare boolean does not count, so an exemption always names who approved it. The
|
|
3043
|
+
* shape mirrors `check-task-repositories.mjs`, which audits the same field after
|
|
3044
|
+
* the fact.
|
|
3045
|
+
*/
|
|
3046
|
+
const REPOSITORY_INFERENCES = new Set(['evidence-paths', 'repo-scope-only', 'unknown', 'ambiguous']);
|
|
3047
|
+
const EXEMPTION_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
3048
|
+
function repositoriesIntakeViolation(record) {
|
|
3049
|
+
if (!record) return 'has no `repositories` array';
|
|
3050
|
+
const ids = record.repositories;
|
|
3051
|
+
const inference = record.repositoriesInference;
|
|
3052
|
+
if (!Array.isArray(ids)) return 'carries no `repositories` array';
|
|
3053
|
+
if (ids.some((id) => typeof id !== 'string' || id.trim() === '')) return 'carries a `repositories` entry that is not a non-empty registry id';
|
|
3054
|
+
if (ids.length === 0) {
|
|
3055
|
+
return inference === 'unknown' ? null : 'carries `repositories: []` without `"repositoriesInference": "unknown"`';
|
|
3056
|
+
}
|
|
3057
|
+
if (inference !== undefined && !REPOSITORY_INFERENCES.has(inference)) return `carries an unknown \`repositoriesInference\` value "${inference}"`;
|
|
3058
|
+
if (inference === 'unknown') return 'lists repositories beside `"repositoriesInference": "unknown"`';
|
|
3059
|
+
let known = null;
|
|
3060
|
+
try {
|
|
3061
|
+
const registry = JSON.parse(fs.readFileSync(path.join(TEAM_ROOT, 'repositories.json'), 'utf8'));
|
|
3062
|
+
known = new Set((Array.isArray(registry.repositories) ? registry.repositories : []).map((row) => row && row.id).filter((id) => typeof id === 'string'));
|
|
3063
|
+
} catch { known = null; }
|
|
3064
|
+
if (known && known.size > 0) {
|
|
3065
|
+
const unknownIds = ids.filter((id) => !known.has(id));
|
|
3066
|
+
if (unknownIds.length > 0) return `names ${unknownIds.join(', ')} — not in .ai.local/team/repositories.json`;
|
|
3067
|
+
}
|
|
3068
|
+
return null;
|
|
3069
|
+
}
|
|
3070
|
+
function repositoriesIntakeExemption(record) {
|
|
3071
|
+
const entry = record && record.intakeExemption;
|
|
3072
|
+
if (!entry || typeof entry !== 'object') return null;
|
|
3073
|
+
const approvedBy = typeof entry.approvedBy === 'string' ? entry.approvedBy.trim() : '';
|
|
3074
|
+
const reason = typeof entry.reason === 'string' ? entry.reason.trim() : '';
|
|
3075
|
+
const at = typeof entry.at === 'string' ? entry.at.trim() : '';
|
|
3076
|
+
if (approvedBy === '' || reason.length < 10 || !EXEMPTION_DATE.test(at)) return null;
|
|
3077
|
+
return { approvedBy, reason, at };
|
|
3078
|
+
}
|
|
3079
|
+
const repositoriesGateApplies = Boolean(finishedAttempt)
|
|
3080
|
+
&& (completedAgent === 'task-router' || (!hadPriorCompletion && completedStepIndex === 0));
|
|
3081
|
+
if (repositoriesGateApplies) {
|
|
3082
|
+
const violation = repositoriesIntakeViolation(pipeline);
|
|
3083
|
+
if (violation) {
|
|
3084
|
+
const exemption = repositoriesIntakeExemption(pipeline);
|
|
3085
|
+
if (!exemption) {
|
|
3086
|
+
appendMetric({ type: 'intake_repositories_blocked', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, source: 'hook', attributionConfidence: 'high' });
|
|
3087
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
|
|
3088
|
+
out(`pipeline.json for "${slug}" ${violation}. Intake stays open until the repositories are recorded: set "repositories" to the ids in .ai.local/team/repositories.json with "repositoriesInference": "evidence-paths" (or "repo-scope-only"), or "repositories": [] with "repositoriesInference": "unknown" when the request names none. Rewrite pipeline.json through the task-router, then resume via /task-continue ${slug}. A task that predates the invariant carries "intakeExemption": { "approvedBy": "<human>", "reason": "<why, 10+ characters>", "at": "YYYY-MM-DD" } — a bare boolean is not accepted.`);
|
|
3089
|
+
process.exit(0);
|
|
3090
|
+
}
|
|
3091
|
+
appendMetric({ type: 'intake_repositories_exempted', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, approvedBy: exemption.approvedBy, reason: exemption.reason, exemptedAt: exemption.at, source: 'hook', attributionConfidence: 'high' });
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
if (pipeline.autoChain === false) {
|
|
3095
|
+
writeStatus({});
|
|
3096
|
+
process.stdout.write('{}');
|
|
3097
|
+
process.exit(0);
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3032
3100
|
|
|
3033
3101
|
if (waveIndexes) {
|
|
3034
3102
|
const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
|
|
@@ -160,6 +160,8 @@ Do **not** add a dedicated `spec-author` agent for `docs/specs/**`. Do not requi
|
|
|
160
160
|
|
|
161
161
|
**specMode (optional `pipeline.json` field):** `none` for spike/research; `generate` for `spec-gen` / `/spec-start`; `consume` default when INDEX exists. Echo top-level `specMode`. Brief `## Spec mode` wins on conflict.
|
|
162
162
|
|
|
163
|
+
**repositories (mandatory `pipeline.json` field):** echo `"repositories": [<ids>]` and `"repositoriesInference": "evidence-paths" | "repo-scope-only" | "unknown" | "ambiguous"` immediately after `specMode`, before `summary`; the ids come from `.ai.local/team/repositories.json` and are never defaulted to the workspace repository. Then record the same list as link rows through `node .ai.local/scripts/team-db.mjs repositories apply --file -` — one `{"links": [{taskSlug, repositoryId, source: "intake", inference: "evidence-paths"}]}` envelope per touched repository (the verb takes the envelope, never a bare row). When the request names no repository, write `"repositories": []` with `"unknown"` and one `{"attributions": [{taskSlug, verdict: "unknown", evidence: ""}]}` envelope; `yarn check:task-repositories` fails a folder without the field.
|
|
164
|
+
|
|
163
165
|
Do **not** add a pipeline step for `spec-discovery`. Instruct analyst to load that skill only when the user/AC asks research-before-spec.
|
|
164
166
|
|
|
165
167
|
## Runtime initialization
|
|
@@ -9,6 +9,7 @@ Slash-command and on-demand scenario definitions. Copied to `.claude/commands/`
|
|
|
9
9
|
| `technical-retro.md` | Facilitate a technical retro, including the “Agent work” block |
|
|
10
10
|
| `update.md` | Reinstall each installed tool with the preset recorded at init |
|
|
11
11
|
| `migrate-tasks.md` | Create or reconcile `.ai.local/team/team.db`; writes only the delta |
|
|
12
|
+
| `rr-migrate-repositories.md` | Scan repositories on disk, add the missing ones to the local registry, and project the file into `team.db` |
|
|
12
13
|
|
|
13
14
|
See also the preset root `README.md`. Artifacts: `.ai.local/team/README.md`.
|
|
14
15
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rr-migrate-repositories
|
|
3
|
+
description: Scan repositories on disk, add the missing ones to the local registry, and project the file into team.db.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate repositories
|
|
7
|
+
|
|
8
|
+
Turn the repositories already cloned on this machine into registry records, then
|
|
9
|
+
sync the registry file into the team database.
|
|
10
|
+
|
|
11
|
+
## What to do
|
|
12
|
+
|
|
13
|
+
1. From the repository root, run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node .ai.local/scripts/rr-migrate-repositories.mjs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Report the summary in the user's native language, keeping the counters
|
|
20
|
+
verbatim: `scanned`, `repositories`, `duplicates`, `create`, `update`,
|
|
21
|
+
`unchanged`, `not-on-disk`, and the `project` line.
|
|
22
|
+
3. A `disabled by AI_RULES_TEAM_DB_DISABLE` line means the plan was computed and
|
|
23
|
+
nothing was written; exit 0 is the documented fallback. Relay it and stop.
|
|
24
|
+
4. Any non-zero exit: quote stderr and stop.
|
|
25
|
+
|
|
26
|
+
## Arguments
|
|
27
|
+
|
|
28
|
+
- `--scan <dir>` — directory to scan; repeatable. Default: the parent of the
|
|
29
|
+
repository root (the repository root itself when its parent is `$HOME`), so
|
|
30
|
+
sibling clones are picked up.
|
|
31
|
+
- `--depth <n>` — directory levels below a scan root (default `4`).
|
|
32
|
+
- `--dry-run` — print the plan and write nothing.
|
|
33
|
+
- `--no-update` — create missing records only; never touch an existing one.
|
|
34
|
+
- `--team-root <dir>` — team store root (default `<repo-root>/.ai.local/team`).
|
|
35
|
+
- `--json` — machine-readable summary.
|
|
36
|
+
|
|
37
|
+
## What the script does
|
|
38
|
+
|
|
39
|
+
- Walks the scan roots; a directory with `.git` is a repository and is not
|
|
40
|
+
descended into. Submodule checkouts and linked worktrees are skipped.
|
|
41
|
+
- Collapses clones that share one remote to the shallowest path.
|
|
42
|
+
- Keeps the id of a record whose locator already exists, so a re-run is
|
|
43
|
+
idempotent; a new id is the slug of the directory name, with a parent prefix
|
|
44
|
+
when that slug is taken.
|
|
45
|
+
- Creates missing records through `team-db.mjs repositories apply`, updates a
|
|
46
|
+
changed `name`, `locator`, or `status` through `repositories put`, then runs
|
|
47
|
+
`repositories project`. The lock-guarded verb is the only writer.
|
|
48
|
+
- Never deletes a record: a repository missing from this scan may simply live
|
|
49
|
+
outside the scanned roots.
|
|
50
|
+
|
|
51
|
+
`.ai.local/team/repositories.json` is local-only and git-ignored. The database is
|
|
52
|
+
derived: deleting `team.db` costs a rebuild, not the records.
|
|
53
|
+
|
|
54
|
+
## Do not
|
|
55
|
+
|
|
56
|
+
- Hand-edit `.ai.local/team/repositories.json`; the verb owns the write lock.
|
|
57
|
+
- Commit the registry file or `team.db*`.
|
|
58
|
+
- Delete registry records to make a scan look clean.
|
|
59
|
+
- Pass `--scan` a filesystem root without a matching `--depth`.
|
|
@@ -41,6 +41,10 @@ Examples:
|
|
|
41
41
|
6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`).
|
|
42
42
|
7. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug>`.
|
|
43
43
|
|
|
44
|
+
## Repositories (mandatory)
|
|
45
|
+
|
|
46
|
+
The repositories a task touches are part of its intake: `pipeline.json` must carry `"repositories": [<registry ids>]`, or `"repositories": []` together with `"repositoriesInference": "unknown"` when the request names none. The router reads `.ai.local/team/repositories.json` and records the same list as link rows; the field is never defaulted; `node .ai.local/scripts/check-task-repositories.mjs` audits the store and the chain hook blocks a task-router receipt that omits it. See `agents/task-router.md`.
|
|
47
|
+
|
|
44
48
|
## Plan contract
|
|
45
49
|
|
|
46
50
|
Intake runs the planning workflow before any implementation: **goal frame** (goal, user value, success + result-evaluation criteria) → **requirements + AC-IDs** → **information-sufficiency** verdict (`sufficient` | `insufficient`) → decompose with a **dependency graph** (`dependsOn[]`, DAG, critical path) and, for large flows, **epics / stages** with exit criteria. The plan is revisable: a **plan revision** is a named, recorded operation (`planRevision`), and progress is checkpointed to `.memlog.md` (with the optional `contextBudget` note) so a run can resume.
|
|
@@ -2950,6 +2950,10 @@ if (status.state === 'awaiting_artifact_receipt') {
|
|
|
2950
2950
|
emitArtifactStall(artifactStallMessage, !wasWaitingForReceipt);
|
|
2951
2951
|
process.exit(0);
|
|
2952
2952
|
}
|
|
2953
|
+
// Snapshot before `finishActiveAttempt` writes `lastCompletedAttempt`: the
|
|
2954
|
+
// repositories intake gate judges a task at its first receipt, so a folder whose
|
|
2955
|
+
// first step already completed is never re-judged.
|
|
2956
|
+
const hadPriorCompletion = Boolean(status.lastCompletedAttempt);
|
|
2953
2957
|
let finishedAttempt = finishActiveAttempt();
|
|
2954
2958
|
// The just-finished attempt's metric is already written; a pause now blocks
|
|
2955
2959
|
// every handoff, including the unattributable-stop repair path below.
|
|
@@ -2977,7 +2981,7 @@ if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
|
|
|
2977
2981
|
}
|
|
2978
2982
|
}
|
|
2979
2983
|
endHumanGateIfResumed();
|
|
2980
|
-
if (steps.length === 0
|
|
2984
|
+
if (steps.length === 0) {
|
|
2981
2985
|
writeStatus({});
|
|
2982
2986
|
process.stdout.write('{}');
|
|
2983
2987
|
process.exit(0);
|
|
@@ -3024,6 +3028,70 @@ const waveIndexes = activeWave
|
|
|
3024
3028
|
? [idx]
|
|
3025
3029
|
: (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
|
|
3026
3030
|
|
|
3031
|
+
/**
|
|
3032
|
+
* Intake invariant: a task records which repositories it touches — or says that
|
|
3033
|
+
* it does not know. Judged on the first receipt of a task: the router's, or the
|
|
3034
|
+
* first step's when a pipeline runs without one. A task that already completed a
|
|
3035
|
+
* step predates the invariant and is never re-judged.
|
|
3036
|
+
* `intakeExemption: { approvedBy, reason, at }` is the recorded escape hatch; a
|
|
3037
|
+
* bare boolean does not count, so an exemption always names who approved it. The
|
|
3038
|
+
* shape mirrors `check-task-repositories.mjs`, which audits the same field after
|
|
3039
|
+
* the fact.
|
|
3040
|
+
*/
|
|
3041
|
+
const REPOSITORY_INFERENCES = new Set(['evidence-paths', 'repo-scope-only', 'unknown', 'ambiguous']);
|
|
3042
|
+
const EXEMPTION_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
3043
|
+
function repositoriesIntakeViolation(record) {
|
|
3044
|
+
if (!record) return 'has no `repositories` array';
|
|
3045
|
+
const ids = record.repositories;
|
|
3046
|
+
const inference = record.repositoriesInference;
|
|
3047
|
+
if (!Array.isArray(ids)) return 'carries no `repositories` array';
|
|
3048
|
+
if (ids.some((id) => typeof id !== 'string' || id.trim() === '')) return 'carries a `repositories` entry that is not a non-empty registry id';
|
|
3049
|
+
if (ids.length === 0) {
|
|
3050
|
+
return inference === 'unknown' ? null : 'carries `repositories: []` without `"repositoriesInference": "unknown"`';
|
|
3051
|
+
}
|
|
3052
|
+
if (inference !== undefined && !REPOSITORY_INFERENCES.has(inference)) return `carries an unknown \`repositoriesInference\` value "${inference}"`;
|
|
3053
|
+
if (inference === 'unknown') return 'lists repositories beside `"repositoriesInference": "unknown"`';
|
|
3054
|
+
let known = null;
|
|
3055
|
+
try {
|
|
3056
|
+
const registry = JSON.parse(fs.readFileSync(path.join(TEAM_ROOT, 'repositories.json'), 'utf8'));
|
|
3057
|
+
known = new Set((Array.isArray(registry.repositories) ? registry.repositories : []).map((row) => row && row.id).filter((id) => typeof id === 'string'));
|
|
3058
|
+
} catch { known = null; }
|
|
3059
|
+
if (known && known.size > 0) {
|
|
3060
|
+
const unknownIds = ids.filter((id) => !known.has(id));
|
|
3061
|
+
if (unknownIds.length > 0) return `names ${unknownIds.join(', ')} — not in .ai.local/team/repositories.json`;
|
|
3062
|
+
}
|
|
3063
|
+
return null;
|
|
3064
|
+
}
|
|
3065
|
+
function repositoriesIntakeExemption(record) {
|
|
3066
|
+
const entry = record && record.intakeExemption;
|
|
3067
|
+
if (!entry || typeof entry !== 'object') return null;
|
|
3068
|
+
const approvedBy = typeof entry.approvedBy === 'string' ? entry.approvedBy.trim() : '';
|
|
3069
|
+
const reason = typeof entry.reason === 'string' ? entry.reason.trim() : '';
|
|
3070
|
+
const at = typeof entry.at === 'string' ? entry.at.trim() : '';
|
|
3071
|
+
if (approvedBy === '' || reason.length < 10 || !EXEMPTION_DATE.test(at)) return null;
|
|
3072
|
+
return { approvedBy, reason, at };
|
|
3073
|
+
}
|
|
3074
|
+
const repositoriesGateApplies = Boolean(finishedAttempt)
|
|
3075
|
+
&& (completedAgent === 'task-router' || (!hadPriorCompletion && completedStepIndex === 0));
|
|
3076
|
+
if (repositoriesGateApplies) {
|
|
3077
|
+
const violation = repositoriesIntakeViolation(pipeline);
|
|
3078
|
+
if (violation) {
|
|
3079
|
+
const exemption = repositoriesIntakeExemption(pipeline);
|
|
3080
|
+
if (!exemption) {
|
|
3081
|
+
appendMetric({ type: 'intake_repositories_blocked', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, source: 'hook', attributionConfidence: 'high' });
|
|
3082
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
|
|
3083
|
+
out(`pipeline.json for "${slug}" ${violation}. Intake stays open until the repositories are recorded: set "repositories" to the ids in .ai.local/team/repositories.json with "repositoriesInference": "evidence-paths" (or "repo-scope-only"), or "repositories": [] with "repositoriesInference": "unknown" when the request names none. Rewrite pipeline.json through the task-router, then resume via /task-continue ${slug}. A task that predates the invariant carries "intakeExemption": { "approvedBy": "<human>", "reason": "<why, 10+ characters>", "at": "YYYY-MM-DD" } — a bare boolean is not accepted.`);
|
|
3084
|
+
process.exit(0);
|
|
3085
|
+
}
|
|
3086
|
+
appendMetric({ type: 'intake_repositories_exempted', at: now, stepIndex: completedStepIndex, agent: completedAgent, violation, approvedBy: exemption.approvedBy, reason: exemption.reason, exemptedAt: exemption.at, source: 'hook', attributionConfidence: 'high' });
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
if (pipeline.autoChain === false) {
|
|
3090
|
+
writeStatus({});
|
|
3091
|
+
process.stdout.write('{}');
|
|
3092
|
+
process.exit(0);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3027
3095
|
|
|
3028
3096
|
if (waveIndexes) {
|
|
3029
3097
|
const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
|
|
@@ -156,6 +156,8 @@ Do **not** add a dedicated `spec-author` agent. Do not require solution-architec
|
|
|
156
156
|
|
|
157
157
|
**specMode (optional `pipeline.json` field):** `none` for spike/research; `generate` for `spec-gen` / `/spec-start`; `consume` default when INDEX exists. Echo top-level `specMode`. Brief `## Spec mode` wins on conflict.
|
|
158
158
|
|
|
159
|
+
**repositories (mandatory `pipeline.json` field):** echo `"repositories": [<ids>]` and `"repositoriesInference": "evidence-paths" | "repo-scope-only" | "unknown" | "ambiguous"` immediately after `specMode`, before `summary`; the ids come from `.ai.local/team/repositories.json` and are never defaulted to the workspace repository. Then record the same list as link rows through `node .ai.local/scripts/team-db.mjs repositories apply --file -` — one `{"links": [{taskSlug, repositoryId, source: "intake", inference: "evidence-paths"}]}` envelope per touched repository (the verb takes the envelope, never a bare row). When the request names no repository, write `"repositories": []` with `"unknown"` and one `{"attributions": [{taskSlug, verdict: "unknown", evidence: ""}]}` envelope; `yarn check:task-repositories` fails a folder without the field.
|
|
160
|
+
|
|
159
161
|
Do **not** add a pipeline step for `spec-discovery`. Instruct analyst to load that skill only when the user/AC asks research-before-spec.
|
|
160
162
|
|
|
161
163
|
## Runtime initialization
|
|
@@ -9,6 +9,7 @@ Slash commands are copied to `.cursor/commands/` (Cursor) or `.claude/commands/`
|
|
|
9
9
|
| `/technical-retro` | Retro |
|
|
10
10
|
| `update.md` | Reinstall each installed tool with the preset recorded at init |
|
|
11
11
|
| `migrate-tasks.md` | Create or reconcile `.ai.local/team/team.db`; writes only the delta |
|
|
12
|
+
| `rr-migrate-repositories.md` | Scan repositories on disk, add the missing ones to the local registry, and project the file into `team.db` |
|
|
12
13
|
|
|
13
14
|
## Scheduler
|
|
14
15
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rr-migrate-repositories
|
|
3
|
+
description: Scan repositories on disk, add the missing ones to the local registry, and project the file into team.db.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate repositories
|
|
7
|
+
|
|
8
|
+
Turn the repositories already cloned on this machine into registry records, then
|
|
9
|
+
sync the registry file into the team database.
|
|
10
|
+
|
|
11
|
+
## What to do
|
|
12
|
+
|
|
13
|
+
1. From the repository root, run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node .ai.local/scripts/rr-migrate-repositories.mjs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Report the summary in the user's native language, keeping the counters
|
|
20
|
+
verbatim: `scanned`, `repositories`, `duplicates`, `create`, `update`,
|
|
21
|
+
`unchanged`, `not-on-disk`, and the `project` line.
|
|
22
|
+
3. A `disabled by AI_RULES_TEAM_DB_DISABLE` line means the plan was computed and
|
|
23
|
+
nothing was written; exit 0 is the documented fallback. Relay it and stop.
|
|
24
|
+
4. Any non-zero exit: quote stderr and stop.
|
|
25
|
+
|
|
26
|
+
## Arguments
|
|
27
|
+
|
|
28
|
+
- `--scan <dir>` — directory to scan; repeatable. Default: the parent of the
|
|
29
|
+
repository root (the repository root itself when its parent is `$HOME`), so
|
|
30
|
+
sibling clones are picked up.
|
|
31
|
+
- `--depth <n>` — directory levels below a scan root (default `4`).
|
|
32
|
+
- `--dry-run` — print the plan and write nothing.
|
|
33
|
+
- `--no-update` — create missing records only; never touch an existing one.
|
|
34
|
+
- `--team-root <dir>` — team store root (default `<repo-root>/.ai.local/team`).
|
|
35
|
+
- `--json` — machine-readable summary.
|
|
36
|
+
|
|
37
|
+
## What the script does
|
|
38
|
+
|
|
39
|
+
- Walks the scan roots; a directory with `.git` is a repository and is not
|
|
40
|
+
descended into. Submodule checkouts and linked worktrees are skipped.
|
|
41
|
+
- Collapses clones that share one remote to the shallowest path.
|
|
42
|
+
- Keeps the id of a record whose locator already exists, so a re-run is
|
|
43
|
+
idempotent; a new id is the slug of the directory name, with a parent prefix
|
|
44
|
+
when that slug is taken.
|
|
45
|
+
- Creates missing records through `team-db.mjs repositories apply`, updates a
|
|
46
|
+
changed `name`, `locator`, or `status` through `repositories put`, then runs
|
|
47
|
+
`repositories project`. The lock-guarded verb is the only writer.
|
|
48
|
+
- Never deletes a record: a repository missing from this scan may simply live
|
|
49
|
+
outside the scanned roots.
|
|
50
|
+
|
|
51
|
+
`.ai.local/team/repositories.json` is local-only and git-ignored. The database is
|
|
52
|
+
derived: deleting `team.db` costs a rebuild, not the records.
|
|
53
|
+
|
|
54
|
+
## Do not
|
|
55
|
+
|
|
56
|
+
- Hand-edit `.ai.local/team/repositories.json`; the verb owns the write lock.
|
|
57
|
+
- Commit the registry file or `team.db*`.
|
|
58
|
+
- Delete registry records to make a scan look clean.
|
|
59
|
+
- Pass `--scan` a filesystem root without a matching `--depth`.
|
|
@@ -41,6 +41,10 @@ Examples:
|
|
|
41
41
|
6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`).
|
|
42
42
|
7. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug>`.
|
|
43
43
|
|
|
44
|
+
## Repositories (mandatory)
|
|
45
|
+
|
|
46
|
+
The repositories a task touches are part of its intake: `pipeline.json` must carry `"repositories": [<registry ids>]`, or `"repositories": []` together with `"repositoriesInference": "unknown"` when the request names none. The router reads `.ai.local/team/repositories.json` and records the same list as link rows; the field is never defaulted; `node .ai.local/scripts/check-task-repositories.mjs` audits the store and the chain hook blocks a task-router receipt that omits it. See `agents/task-router.md`.
|
|
47
|
+
|
|
44
48
|
## Plan contract
|
|
45
49
|
|
|
46
50
|
Intake runs the planning workflow before any implementation: **goal frame** (goal, user value, success + result-evaluation criteria) → **requirements + AC-IDs** → **information-sufficiency** verdict (`sufficient` | `insufficient`) → decompose with a **dependency graph** (`dependsOn[]`, DAG, critical path) and, for large flows, **epics / stages** with exit criteria. The plan is revisable: a **plan revision** is a named, recorded operation (`planRevision`), and progress is checkpointed to `.memlog.md` (with the optional `contextBudget` note) so a run can resume.
|