@bonesofspring/ai-rules 0.2.40 → 0.2.42
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 +358 -329
- package/package.json +1 -1
- package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +7 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +1 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +62 -5
- package/presets/claude/android-kotlin/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/claude/android-kotlin/agents/performance-auditor.md +1 -1
- package/presets/claude/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/agents/task-router.md +1 -1
- package/presets/claude/android-kotlin/agents/tech-writer.md +1 -1
- package/presets/claude/android-kotlin/agents/unit-test-generator.md +1 -1
- package/presets/claude/android-kotlin/agents/unit-test-healer.md +1 -1
- package/presets/claude/android-kotlin/agents/unit-test-planner.md +1 -1
- package/presets/claude/android-kotlin/commands/task.md +1 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/android-kotlin/team/README.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/agents/task-router.md +1 -1
- package/presets/claude/go/commands/task.md +1 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/go/team/README.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/agents/task-router.md +1 -1
- package/presets/claude/ios-swift/commands/task.md +1 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/ios-swift/team/README.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/agents/task-router.md +1 -1
- package/presets/claude/java/commands/task.md +1 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/java/team/README.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/agents/task-router.md +1 -1
- package/presets/claude/mcp-ts/commands/task.md +1 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/mcp-ts/team/README.md +1 -1
- package/presets/claude/next/agents/ci-investigator.md +1 -1
- package/presets/claude/next/agents/debugger.md +1 -1
- package/presets/claude/next/agents/feature-developer.md +1 -1
- package/presets/claude/next/agents/migration-specialist.md +1 -1
- package/presets/claude/next/agents/performance-auditor.md +1 -1
- package/presets/claude/next/agents/qa-tester.md +1 -1
- package/presets/claude/next/agents/solution-architect.md +1 -1
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +1 -1
- package/presets/claude/next/agents/tech-writer.md +1 -1
- package/presets/claude/next/agents/unit-test-generator.md +1 -1
- package/presets/claude/next/agents/unit-test-healer.md +1 -1
- package/presets/claude/next/agents/unit-test-planner.md +1 -1
- package/presets/claude/next/commands/task.md +2 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/next/team/README.md +1 -1
- package/presets/claude/nuxt/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/claude/nuxt/agents/performance-auditor.md +1 -1
- package/presets/claude/nuxt/agents/qa-tester.md +1 -1
- package/presets/claude/nuxt/agents/solution-architect.md +1 -1
- package/presets/claude/nuxt/agents/task-analyst.md +1 -1
- package/presets/claude/nuxt/agents/task-router.md +1 -1
- package/presets/claude/nuxt/agents/tech-writer.md +1 -1
- package/presets/claude/nuxt/agents/unit-test-generator.md +1 -1
- package/presets/claude/nuxt/agents/unit-test-healer.md +1 -1
- package/presets/claude/nuxt/agents/unit-test-planner.md +1 -1
- package/presets/claude/nuxt/commands/task.md +1 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/nuxt/team/README.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/agents/task-router.md +1 -1
- package/presets/claude/php-hexagonal/commands/task.md +1 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/php-hexagonal/team/README.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/agents/task-router.md +1 -1
- package/presets/claude/php-laravel/commands/task.md +1 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/php-laravel/team/README.md +1 -1
- package/presets/claude/svelte/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/claude/svelte/agents/performance-auditor.md +1 -1
- package/presets/claude/svelte/agents/qa-tester.md +1 -1
- package/presets/claude/svelte/agents/solution-architect.md +1 -1
- package/presets/claude/svelte/agents/task-analyst.md +1 -1
- package/presets/claude/svelte/agents/task-router.md +1 -1
- package/presets/claude/svelte/agents/tech-writer.md +1 -1
- package/presets/claude/svelte/agents/unit-test-generator.md +1 -1
- package/presets/claude/svelte/agents/unit-test-healer.md +1 -1
- package/presets/claude/svelte/agents/unit-test-planner.md +1 -1
- package/presets/claude/svelte/commands/task.md +1 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +62 -5
- package/presets/claude/svelte/team/README.md +1 -1
- package/presets/cursor/android-kotlin/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/cursor/android-kotlin/agents/performance-auditor.md +1 -1
- package/presets/cursor/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/agents/task-router.md +1 -1
- package/presets/cursor/android-kotlin/agents/tech-writer.md +1 -1
- package/presets/cursor/android-kotlin/agents/unit-test-generator.md +1 -1
- package/presets/cursor/android-kotlin/agents/unit-test-healer.md +1 -1
- package/presets/cursor/android-kotlin/agents/unit-test-planner.md +1 -1
- package/presets/cursor/android-kotlin/commands/task.md +1 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/android-kotlin/team/README.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/agents/task-router.md +1 -1
- package/presets/cursor/go/commands/task.md +1 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/go/team/README.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/agents/task-router.md +1 -1
- package/presets/cursor/ios-swift/commands/task.md +1 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/ios-swift/team/README.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/agents/task-router.md +1 -1
- package/presets/cursor/java/commands/task.md +1 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/java/team/README.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/agents/task-router.md +1 -1
- package/presets/cursor/mcp-ts/commands/task.md +1 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/mcp-ts/team/README.md +1 -1
- package/presets/cursor/next/agents/ci-investigator.md +1 -1
- package/presets/cursor/next/agents/debugger.md +1 -1
- package/presets/cursor/next/agents/feature-developer.md +1 -1
- package/presets/cursor/next/agents/migration-specialist.md +1 -1
- package/presets/cursor/next/agents/performance-auditor.md +1 -1
- package/presets/cursor/next/agents/qa-tester.md +1 -1
- package/presets/cursor/next/agents/solution-architect.md +1 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +1 -1
- package/presets/cursor/next/agents/tech-writer.md +1 -1
- package/presets/cursor/next/agents/unit-test-generator.md +1 -1
- package/presets/cursor/next/agents/unit-test-healer.md +1 -1
- package/presets/cursor/next/agents/unit-test-planner.md +1 -1
- package/presets/cursor/next/commands/task.md +1 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/next/team/README.md +1 -1
- package/presets/cursor/nuxt/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/cursor/nuxt/agents/performance-auditor.md +1 -1
- package/presets/cursor/nuxt/agents/qa-tester.md +1 -1
- package/presets/cursor/nuxt/agents/solution-architect.md +1 -1
- package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
- package/presets/cursor/nuxt/agents/task-router.md +1 -1
- package/presets/cursor/nuxt/agents/tech-writer.md +1 -1
- package/presets/cursor/nuxt/agents/unit-test-generator.md +1 -1
- package/presets/cursor/nuxt/agents/unit-test-healer.md +1 -1
- package/presets/cursor/nuxt/agents/unit-test-planner.md +1 -1
- package/presets/cursor/nuxt/commands/task.md +1 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/nuxt/team/README.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/agents/task-router.md +1 -1
- package/presets/cursor/php-hexagonal/commands/task.md +1 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/php-hexagonal/team/README.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/agents/task-router.md +1 -1
- package/presets/cursor/php-laravel/commands/task.md +1 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/php-laravel/team/README.md +1 -1
- package/presets/cursor/svelte/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/cursor/svelte/agents/performance-auditor.md +1 -1
- package/presets/cursor/svelte/agents/qa-tester.md +1 -1
- package/presets/cursor/svelte/agents/solution-architect.md +1 -1
- package/presets/cursor/svelte/agents/task-analyst.md +1 -1
- package/presets/cursor/svelte/agents/task-router.md +1 -1
- package/presets/cursor/svelte/agents/tech-writer.md +1 -1
- package/presets/cursor/svelte/agents/unit-test-generator.md +1 -1
- package/presets/cursor/svelte/agents/unit-test-healer.md +1 -1
- package/presets/cursor/svelte/agents/unit-test-planner.md +1 -1
- package/presets/cursor/svelte/commands/task.md +1 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +62 -5
- package/presets/cursor/svelte/team/README.md +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/mavis/android-kotlin/agents/performance-auditor.md +1 -1
- package/presets/mavis/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/mavis/android-kotlin/agents/task-router.md +1 -1
- package/presets/mavis/android-kotlin/agents/tech-writer.md +1 -1
- package/presets/mavis/android-kotlin/agents/unit-test-generator.md +1 -1
- package/presets/mavis/android-kotlin/agents/unit-test-healer.md +1 -1
- package/presets/mavis/android-kotlin/agents/unit-test-planner.md +1 -1
- package/presets/mavis/android-kotlin/commands/task.md +1 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/android-kotlin/team/README.md +1 -1
- package/presets/mavis/go/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/mavis/go/commands/task.md +1 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/go/team/README.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/mavis/ios-swift/commands/task.md +1 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/ios-swift/team/README.md +1 -1
- package/presets/mavis/java/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/mavis/java/commands/task.md +1 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/java/team/README.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/mavis/mcp-ts/commands/task.md +1 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/mcp-ts/team/README.md +1 -1
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/agents/ci-investigator.md +1 -1
- package/presets/mavis/next/agents/debugger.md +1 -1
- package/presets/mavis/next/agents/feature-developer.md +1 -1
- package/presets/mavis/next/agents/migration-specialist.md +1 -1
- package/presets/mavis/next/agents/performance-auditor.md +1 -1
- package/presets/mavis/next/agents/qa-tester.md +1 -1
- package/presets/mavis/next/agents/solution-architect.md +1 -1
- package/presets/mavis/next/agents/task-analyst.md +1 -1
- package/presets/mavis/next/agents/task-router.md +1 -1
- package/presets/mavis/next/agents/tech-writer.md +1 -1
- package/presets/mavis/next/agents/unit-test-generator.md +1 -1
- package/presets/mavis/next/agents/unit-test-healer.md +1 -1
- package/presets/mavis/next/agents/unit-test-planner.md +1 -1
- package/presets/mavis/next/commands/task.md +1 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/next/team/README.md +1 -1
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/mavis/nuxt/agents/performance-auditor.md +1 -1
- package/presets/mavis/nuxt/agents/qa-tester.md +1 -1
- package/presets/mavis/nuxt/agents/solution-architect.md +1 -1
- package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
- package/presets/mavis/nuxt/agents/task-router.md +1 -1
- package/presets/mavis/nuxt/agents/tech-writer.md +1 -1
- package/presets/mavis/nuxt/agents/unit-test-generator.md +1 -1
- package/presets/mavis/nuxt/agents/unit-test-healer.md +1 -1
- package/presets/mavis/nuxt/agents/unit-test-planner.md +1 -1
- package/presets/mavis/nuxt/commands/task.md +1 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/nuxt/team/README.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/mavis/php-hexagonal/commands/task.md +1 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/php-hexagonal/team/README.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/mavis/php-laravel/commands/task.md +1 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/php-laravel/team/README.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/mavis/svelte/agents/performance-auditor.md +1 -1
- package/presets/mavis/svelte/agents/qa-tester.md +1 -1
- package/presets/mavis/svelte/agents/solution-architect.md +1 -1
- package/presets/mavis/svelte/agents/task-analyst.md +1 -1
- package/presets/mavis/svelte/agents/task-router.md +1 -1
- package/presets/mavis/svelte/agents/tech-writer.md +1 -1
- package/presets/mavis/svelte/agents/unit-test-generator.md +1 -1
- package/presets/mavis/svelte/agents/unit-test-healer.md +1 -1
- package/presets/mavis/svelte/agents/unit-test-planner.md +1 -1
- package/presets/mavis/svelte/commands/task.md +1 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +62 -5
- package/presets/mavis/svelte/team/README.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/opencode/android-kotlin/agents/performance-auditor.md +1 -1
- package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-router.md +1 -1
- package/presets/opencode/android-kotlin/agents/tech-writer.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-generator.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-healer.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-planner.md +1 -1
- package/presets/opencode/android-kotlin/commands/task.md +1 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/android-kotlin/team/README.md +1 -1
- package/presets/opencode/go/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/opencode/go/commands/task.md +1 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/go/team/README.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/opencode/ios-swift/commands/task.md +1 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/ios-swift/team/README.md +1 -1
- package/presets/opencode/java/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/opencode/java/commands/task.md +1 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/java/team/README.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/opencode/mcp-ts/commands/task.md +1 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/mcp-ts/team/README.md +1 -1
- package/presets/opencode/next/adapter-map.json +1 -1
- package/presets/opencode/next/agents/ci-investigator.md +1 -1
- package/presets/opencode/next/agents/debugger.md +1 -1
- package/presets/opencode/next/agents/feature-developer.md +1 -1
- package/presets/opencode/next/agents/migration-specialist.md +1 -1
- package/presets/opencode/next/agents/performance-auditor.md +1 -1
- package/presets/opencode/next/agents/qa-tester.md +1 -1
- package/presets/opencode/next/agents/solution-architect.md +1 -1
- package/presets/opencode/next/agents/task-analyst.md +1 -1
- package/presets/opencode/next/agents/task-router.md +1 -1
- package/presets/opencode/next/agents/tech-writer.md +1 -1
- package/presets/opencode/next/agents/unit-test-generator.md +1 -1
- package/presets/opencode/next/agents/unit-test-healer.md +1 -1
- package/presets/opencode/next/agents/unit-test-planner.md +1 -1
- package/presets/opencode/next/commands/task.md +1 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/next/team/README.md +1 -1
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/opencode/nuxt/agents/performance-auditor.md +1 -1
- package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
- package/presets/opencode/nuxt/agents/solution-architect.md +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/agents/task-router.md +1 -1
- package/presets/opencode/nuxt/agents/tech-writer.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-generator.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-healer.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-planner.md +1 -1
- package/presets/opencode/nuxt/commands/task.md +1 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/nuxt/team/README.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/opencode/php-hexagonal/commands/task.md +1 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/php-hexagonal/team/README.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +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/agents/task-router.md +1 -1
- package/presets/opencode/php-laravel/commands/task.md +1 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/php-laravel/team/README.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/agents/ci-investigator.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/migration-specialist.md +1 -1
- package/presets/opencode/svelte/agents/performance-auditor.md +1 -1
- package/presets/opencode/svelte/agents/qa-tester.md +1 -1
- package/presets/opencode/svelte/agents/solution-architect.md +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/agents/task-router.md +1 -1
- package/presets/opencode/svelte/agents/tech-writer.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-generator.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-healer.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-planner.md +1 -1
- package/presets/opencode/svelte/commands/task.md +1 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +62 -5
- package/presets/opencode/svelte/team/README.md +1 -1
|
@@ -225,5 +225,5 @@ If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is r
|
|
|
225
225
|
|
|
226
226
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
|
|
227
227
|
- **Owned outputs:** `brief.md` and `decomposition.md` (plus `ux-design.md` when produced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `analysis`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
228
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
228
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
229
229
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -217,5 +217,5 @@ Return the routing receipt to the orchestrator. The orchestration runtime/hook e
|
|
|
217
217
|
|
|
218
218
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume the user request and any existing authoritative task/decision entries.
|
|
219
219
|
- **Owned outputs:** `pipeline.json` and the routing entry in `manifest.artifacts[]`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `routing`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
220
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
220
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
221
221
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -73,7 +73,7 @@ Post-delivery: when behavior or public docs changed and `docs/specs/` is in play
|
|
|
73
73
|
|
|
74
74
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and available architecture/migration/review artifacts.
|
|
75
75
|
- **Owned outputs:** `documentation.md` (and any explicitly requested docs paths); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `documentation`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
76
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
76
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
77
77
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
78
78
|
|
|
79
79
|
Suggest `/technical-retro <slug>` when this is the final pipeline step.
|
|
@@ -49,7 +49,7 @@ Run affected unit tests from `app/` when feasible. Report files changed, command
|
|
|
49
49
|
|
|
50
50
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `unit-test-plan.md`, brief/decomposition when present, and target modules.
|
|
51
51
|
- **Owned outputs:** generated/updated `*.spec.ts` / `*.spec.tsx` paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-generator`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
52
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
52
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
53
53
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
54
54
|
|
|
55
55
|
## Design guidance
|
|
@@ -50,7 +50,7 @@ Report root cause, files changed, validation result, and remaining risk.
|
|
|
50
50
|
|
|
51
51
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for failing test evidence, `unit-test-plan.md` when present, and recent diff.
|
|
52
52
|
- **Owned outputs:** healed `*.spec.ts` / `*.spec.tsx` paths (and minimal production fixes only when evidenced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-healer`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
53
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
53
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
54
54
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
55
55
|
|
|
56
56
|
## Design guidance
|
|
@@ -70,7 +70,7 @@ Test titles in the plan use the project locale (as enforced by repo lint/convent
|
|
|
70
70
|
|
|
71
71
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and target modules under `app/src/**`.
|
|
72
72
|
- **Owned outputs:** `unit-test-plan.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-planner`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
73
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
73
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
74
74
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
75
75
|
|
|
76
76
|
Do not write `*.spec.ts` files — that is `unit-test-generator`'s job.
|
|
@@ -3,6 +3,8 @@ name: task
|
|
|
3
3
|
description: "Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist.
|
|
7
|
+
|
|
6
8
|
<!-- shared-core: quality/anti-hallucination-load-line.md -->
|
|
7
9
|
|
|
8
10
|
Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
|
|
@@ -471,7 +471,21 @@ function endHumanGateIfResumed() {
|
|
|
471
471
|
appendMetric({ type: 'human_gate_ended', at: now, gateStartedEventId: status.activeHumanGateEventId, source: 'hook', attributionConfidence: 'high' });
|
|
472
472
|
delete status.activeHumanGateEventId;
|
|
473
473
|
}
|
|
474
|
-
function completeTaskMetrics() {
|
|
474
|
+
function completeTaskMetrics() {
|
|
475
|
+
// Two hook processes can both enter completion before either writes the
|
|
476
|
+
// event. The metrics lock serializes them; the second sees the first write.
|
|
477
|
+
mutateMetrics((metrics) => {
|
|
478
|
+
if (metrics.events.some((event) => event && event.type === 'task_completed')) return;
|
|
479
|
+
metrics.events.push({
|
|
480
|
+
eventId: `${metrics.task.runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
|
|
481
|
+
type: 'task_completed',
|
|
482
|
+
at: now,
|
|
483
|
+
outcome: status.state === 'completed' ? 'completed' : 'unknown',
|
|
484
|
+
source: 'hook',
|
|
485
|
+
attributionConfidence: 'high',
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
}
|
|
475
489
|
function recordSkippedStep(step, stepIndex) {
|
|
476
490
|
for (const agent of getStepAgents(step)) {
|
|
477
491
|
const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
@@ -659,7 +673,7 @@ function handoffForWave(units, waveId) {
|
|
|
659
673
|
`Invoke IN PARALLEL (one message, multiple Task calls): ${labels.join(' AND ')} for slug "${slug}"${waveId ? ` (waveId=${waveId})` : ''}. ` +
|
|
660
674
|
`Each agent writes its artifact and owned receipt; the hook records slot joins from stops. Do not mutate status.json lifecycle fields. ` +
|
|
661
675
|
`Artifact inputs: ${inputIds.length > 0 ? inputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${outputIds.join('; ')}. ` +
|
|
662
|
-
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration
|
|
676
|
+
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
|
|
663
677
|
);
|
|
664
678
|
}
|
|
665
679
|
function blockedNotice(blockedIndex, agent) {
|
|
@@ -675,12 +689,22 @@ function noProgressNotice() {
|
|
|
675
689
|
const pending = pendingStepIndexes().map((index) => steps[index].id || `step-${index}`);
|
|
676
690
|
return `No schedulable step remains for slug "${slug}" (unsatisfied: ${pending.join(', ')}). Resume only via /task-continue ${slug}.`;
|
|
677
691
|
}
|
|
692
|
+
function deferReason(wave, deferred) {
|
|
693
|
+
const sameAgent = deferred.some((index) => wave.some((chosen) => {
|
|
694
|
+
const left = getStepAgents(steps[chosen]);
|
|
695
|
+
return getStepAgents(steps[index]).some((agent) => left.includes(agent));
|
|
696
|
+
}));
|
|
697
|
+
if (sameAgent) return 'same agent already in the wave';
|
|
698
|
+
const missingScope = [...wave, ...deferred].some((index) => declaredScopes(steps[index]).length === 0);
|
|
699
|
+
if (missingScope) return 'writeScopes undeclared';
|
|
700
|
+
return 'writeScopes overlap';
|
|
701
|
+
}
|
|
678
702
|
function dispatchReadyWave(prefixMessage) {
|
|
679
703
|
const ready = computeReadySteps();
|
|
680
704
|
if (ready.length === 0) return false;
|
|
681
705
|
const { wave, deferred } = selectWave(ready);
|
|
682
706
|
if (deferred.length > 0) {
|
|
683
|
-
appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason:
|
|
707
|
+
appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: deferReason(wave, deferred), source: 'hook', attributionConfidence: 'fallback' });
|
|
684
708
|
}
|
|
685
709
|
// Slot-filtered dispatch: only unsatisfied (stepIndex, agent) slots are invoked.
|
|
686
710
|
const units = wave.flatMap((stepIndex) => unsatisfiedAgents(stepIndex).map((agent) => ({ stepIndex, agent })));
|
|
@@ -826,9 +850,12 @@ function metricsHandoff(agent) {
|
|
|
826
850
|
return ' Metrics: use the supplied attemptId when available; for a parallel completion, write a minimal { attemptId, outcome } receipt to .metrics-receipts.json rather than relying on currentAgent. Do not calculate duration.';
|
|
827
851
|
}
|
|
828
852
|
|
|
853
|
+
function receiptPathClause() {
|
|
854
|
+
return 'authoritativePaths are relative to the task folder (brief.md), not the repo root; put external files in evidencePaths.';
|
|
855
|
+
}
|
|
829
856
|
function artifactHandoff(step, agent) {
|
|
830
857
|
const inputIds = Array.isArray(step?.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults';
|
|
831
|
-
return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId
|
|
858
|
+
return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId. ${receiptPathClause()}`;
|
|
832
859
|
}
|
|
833
860
|
|
|
834
861
|
function handoffForAgent(agent, scope, step = null) {
|
|
@@ -846,7 +873,7 @@ function handoffForParallelStep(step) {
|
|
|
846
873
|
`Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
|
|
847
874
|
`Each agent writes its artifact and owned receipt; the hook records parallelCompleted from stops. Do not mutate status.json lifecycle fields. ` +
|
|
848
875
|
`Artifact inputs: ${Array.isArray(step.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${agents.map((agent) => `${agent}=${artifactOutputIdFor(step, agent)}`).join('; ')}. ` +
|
|
849
|
-
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration
|
|
876
|
+
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
|
|
850
877
|
);
|
|
851
878
|
}
|
|
852
879
|
|
|
@@ -855,9 +882,35 @@ function hasGateAfter(agent, humanGates) {
|
|
|
855
882
|
}
|
|
856
883
|
|
|
857
884
|
function hasGateAfterStep(step, humanGates) {
|
|
885
|
+
if (!Array.isArray(humanGates) || !step) return false;
|
|
886
|
+
if (typeof step.id === 'string' && step.id.length > 0 && humanGates.includes(`after:${step.id}`)) return true;
|
|
858
887
|
return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
|
|
859
888
|
}
|
|
860
889
|
|
|
890
|
+
// A followup loop of the subagent that just finished arrives with no attemptId
|
|
891
|
+
// and no receipt for the attempt this same transition opened. That stop is not
|
|
892
|
+
// the next agent. A stop more than 15s later, still without a receipt, is a
|
|
893
|
+
// real missing receipt and must stall.
|
|
894
|
+
function isSchedulingEcho() {
|
|
895
|
+
if (typeof hookInput.attemptId === 'string' && hookInput.attemptId.length > 0) return false;
|
|
896
|
+
const entries = Object.entries(status.activeAttempts || {});
|
|
897
|
+
if (entries.length !== 1) return false;
|
|
898
|
+
const [attemptId, entry] = entries[0];
|
|
899
|
+
const previous = status.lastCompletedAttempt;
|
|
900
|
+
if (!previous || previous.completedAt !== entry.startedAt) return false;
|
|
901
|
+
const ageMs = Date.parse(now) - Date.parse(entry.startedAt);
|
|
902
|
+
if (!Number.isFinite(ageMs) || ageMs < 0 || ageMs > 15000) return false;
|
|
903
|
+
const previousJoined = Object.values(status.joinedSlots || {}).some((slot) => slot && slot.attemptId === previous.attemptId);
|
|
904
|
+
const linearAdvance = !isGraphMode() && typeof entry.stepIndex === 'number' && entry.stepIndex > 0;
|
|
905
|
+
if (!previousJoined && !linearAdvance) return false;
|
|
906
|
+
try {
|
|
907
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(taskDir, 'artifact-manifest.json'), 'utf8'));
|
|
908
|
+
const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
|
|
909
|
+
if (artifacts.some((item) => item && item.receipt && item.receipt.attemptId === attemptId)) return false;
|
|
910
|
+
} catch {}
|
|
911
|
+
return true;
|
|
912
|
+
}
|
|
913
|
+
|
|
861
914
|
function legacyFlow() {
|
|
862
915
|
if (status.phase === 'analysis') {
|
|
863
916
|
process.stdout.write('{}');
|
|
@@ -1075,6 +1128,10 @@ if (pipelineParseError) {
|
|
|
1075
1128
|
}
|
|
1076
1129
|
|
|
1077
1130
|
steps = pipeline.steps || [];
|
|
1131
|
+
if (isSchedulingEcho()) {
|
|
1132
|
+
process.stdout.write('{}');
|
|
1133
|
+
process.exit(0);
|
|
1134
|
+
}
|
|
1078
1135
|
const initialIdx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
1079
1136
|
const initialStep = steps[initialIdx];
|
|
1080
1137
|
const activeAttemptCountBeforeFinish = Object.keys(status.activeAttempts || {}).length;
|
|
@@ -76,7 +76,7 @@ Same JSON on Claude, Mavis, or OpenCode: `bash .<tool>/hooks/chain-team-phases.s
|
|
|
76
76
|
## Contracts
|
|
77
77
|
|
|
78
78
|
- **Manifest field name:** receipts go in `artifacts[]`. Anything written under `entries` is ignored — the hook reads only `artifacts` and prints a dual-read warning naming the file. See `agent-team/agent-artifact-contracts.md` § Schema field name.
|
|
79
|
-
- **Evidence paths:** `authoritativePaths[]`
|
|
79
|
+
- **Evidence paths:** `authoritativePaths[]` is relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) is rejected. Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
|
|
80
80
|
- Manifest schema: shared core `agent-team/agent-artifact-contracts.md`. Read it first; producers upsert only their IDs.
|
|
81
81
|
- Metrics: append-only allowlisted events — `agent-team/agent-task-metrics.md`. Aggregate: `node node_modules/@bonesofspring/ai-rules/scripts/aggregate-agent-task-metrics.mjs --team-root .ai.local/team`.
|
|
82
82
|
- Commit `.ai.local/team/` templates (and slugs if you want them in clones).
|
|
@@ -93,7 +93,7 @@ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error
|
|
|
93
93
|
|
|
94
94
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition when present, failing check context, and prior validation/debug artifacts.
|
|
95
95
|
- **Owned outputs:** `ci-report.md` plus any minimal fix paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `ci`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
96
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
96
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
97
97
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
98
98
|
|
|
99
99
|
Provide summary: failed check, root cause, files changed, validation commands run. Keep `fixApplied: true/false` (and verdict) in `ci-report.md` / the owned receipt summary — do not encode them by mutating `status.json`.
|
|
@@ -114,7 +114,7 @@ If a Sentry/Datadog (or similar) MCP is ready and the task is a production error
|
|
|
114
114
|
|
|
115
115
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition when present, failing evidence, and related prior artifacts.
|
|
116
116
|
- **Owned outputs:** `debug-report.md` plus any minimal fix paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `debug`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
117
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
117
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
118
118
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
119
119
|
|
|
120
120
|
Handoff summary: root cause, recommended fix, files touched (if any). Keep `fixApplied: true/false` in `debug-report.md` / the owned receipt — do not mutate `status.json` for that signal.
|
|
@@ -152,5 +152,5 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
|
|
|
152
152
|
|
|
153
153
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
|
|
154
154
|
- **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
155
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
155
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
156
156
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -81,7 +81,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
|
|
|
81
81
|
|
|
82
82
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and stack/version context from the repo.
|
|
83
83
|
- **Owned outputs:** `migration-plan.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `migration-plan`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
84
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
84
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
85
85
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
86
86
|
|
|
87
87
|
Hand off: orchestrator/hook runs human gate (if configured), then `feature-developer` executes phases from the plan.
|
|
@@ -80,7 +80,7 @@ If Chrome DevTools MCP is ready and the app is running, use it for console/netwo
|
|
|
80
80
|
|
|
81
81
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief when present and the scoped git diff / routes under audit.
|
|
82
82
|
- **Owned outputs:** `perf-report.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `perf-report`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
83
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
83
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
84
84
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
85
85
|
|
|
86
86
|
For standalone `perf-audit` intent, suggest `/technical-retro` or a follow-up `/task` to implement fixes.
|
|
@@ -61,7 +61,7 @@ When the task is mostly e2e, prefer invoking the dedicated `playwright-test-plan
|
|
|
61
61
|
|
|
62
62
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition, reviewer notes when present, and prior implementation/validation artifacts.
|
|
63
63
|
- **Owned outputs:** changed/added test paths (and any QA notes written under the slug dir); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `qa-tester`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
64
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
64
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
65
65
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
66
66
|
|
|
67
67
|
Provide summary:
|
|
@@ -80,7 +80,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
|
|
|
80
80
|
|
|
81
81
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and applicable prior analysis artifacts.
|
|
82
82
|
- **Owned outputs:** `architecture.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `architecture`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
83
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
83
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
84
84
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
85
85
|
|
|
86
86
|
For `spike` intent needing user sign-off: emit receipt outcome `completed` (or `blocked` if design cannot proceed) and state the approval need in the receipt summary — the orchestration runtime/hook owns human-gate lifecycle (`awaiting_approval`), not this agent.
|
|
@@ -218,5 +218,5 @@ If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is r
|
|
|
218
218
|
|
|
219
219
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
|
|
220
220
|
- **Owned outputs:** `brief.md` and `decomposition.md` (plus `ux-design.md` when produced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `analysis`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
221
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
221
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
222
222
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -216,5 +216,5 @@ Return the routing receipt to the orchestrator. The orchestration runtime/hook e
|
|
|
216
216
|
|
|
217
217
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume the user request and any existing authoritative task/decision entries.
|
|
218
218
|
- **Owned outputs:** `pipeline.json` and the routing entry in `manifest.artifacts[]`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `routing`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
219
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
219
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
220
220
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -73,7 +73,7 @@ Post-delivery: when behavior or public docs changed and `docs/specs/` is in play
|
|
|
73
73
|
|
|
74
74
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and available architecture/migration/review artifacts.
|
|
75
75
|
- **Owned outputs:** `documentation.md` (and any explicitly requested docs paths); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `documentation`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
76
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
76
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
77
77
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
78
78
|
|
|
79
79
|
Suggest `/technical-retro <slug>` when this is the final pipeline step.
|
|
@@ -49,7 +49,7 @@ Run affected unit tests from repository root when feasible. Report files changed
|
|
|
49
49
|
|
|
50
50
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `unit-test-plan.md`, brief/decomposition when present, and target modules.
|
|
51
51
|
- **Owned outputs:** generated/updated `*.spec.ts` / `*.spec.ts` paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-generator`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
52
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
52
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
53
53
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
54
54
|
|
|
55
55
|
## Design guidance
|
|
@@ -50,7 +50,7 @@ Report root cause, files changed, validation result, and remaining risk.
|
|
|
50
50
|
|
|
51
51
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for failing test evidence, `unit-test-plan.md` when present, and recent diff.
|
|
52
52
|
- **Owned outputs:** healed `*.spec.ts` / `*.spec.ts` paths (and minimal production fixes only when evidenced); upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-healer`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
53
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
53
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
54
54
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
55
55
|
|
|
56
56
|
## Design guidance
|
|
@@ -70,7 +70,7 @@ Test titles in the plan use the project locale (as enforced by repo lint/convent
|
|
|
70
70
|
|
|
71
71
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for brief/decomposition and target modules under `**`.
|
|
72
72
|
- **Owned outputs:** `unit-test-plan.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `unit-test-planner`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
73
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
73
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
74
74
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
75
75
|
|
|
76
76
|
Do not write `*.spec.ts` files — that is `unit-test-generator`'s job.
|
|
@@ -3,6 +3,7 @@ name: task
|
|
|
3
3
|
description: "Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist.
|
|
6
7
|
|
|
7
8
|
<!-- shared-core: quality/anti-hallucination-load-line.md -->
|
|
8
9
|
|
|
@@ -471,7 +471,21 @@ function endHumanGateIfResumed() {
|
|
|
471
471
|
appendMetric({ type: 'human_gate_ended', at: now, gateStartedEventId: status.activeHumanGateEventId, source: 'hook', attributionConfidence: 'high' });
|
|
472
472
|
delete status.activeHumanGateEventId;
|
|
473
473
|
}
|
|
474
|
-
function completeTaskMetrics() {
|
|
474
|
+
function completeTaskMetrics() {
|
|
475
|
+
// Two hook processes can both enter completion before either writes the
|
|
476
|
+
// event. The metrics lock serializes them; the second sees the first write.
|
|
477
|
+
mutateMetrics((metrics) => {
|
|
478
|
+
if (metrics.events.some((event) => event && event.type === 'task_completed')) return;
|
|
479
|
+
metrics.events.push({
|
|
480
|
+
eventId: `${metrics.task.runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
|
|
481
|
+
type: 'task_completed',
|
|
482
|
+
at: now,
|
|
483
|
+
outcome: status.state === 'completed' ? 'completed' : 'unknown',
|
|
484
|
+
source: 'hook',
|
|
485
|
+
attributionConfidence: 'high',
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
}
|
|
475
489
|
function recordSkippedStep(step, stepIndex) {
|
|
476
490
|
for (const agent of getStepAgents(step)) {
|
|
477
491
|
const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
@@ -659,7 +673,7 @@ function handoffForWave(units, waveId) {
|
|
|
659
673
|
`Invoke IN PARALLEL (one message, multiple Task calls): ${labels.join(' AND ')} for slug "${slug}"${waveId ? ` (waveId=${waveId})` : ''}. ` +
|
|
660
674
|
`Each agent writes its artifact and owned receipt; the hook records slot joins from stops. Do not mutate status.json lifecycle fields. ` +
|
|
661
675
|
`Artifact inputs: ${inputIds.length > 0 ? inputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${outputIds.join('; ')}. ` +
|
|
662
|
-
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration
|
|
676
|
+
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
|
|
663
677
|
);
|
|
664
678
|
}
|
|
665
679
|
function blockedNotice(blockedIndex, agent) {
|
|
@@ -675,12 +689,22 @@ function noProgressNotice() {
|
|
|
675
689
|
const pending = pendingStepIndexes().map((index) => steps[index].id || `step-${index}`);
|
|
676
690
|
return `No schedulable step remains for slug "${slug}" (unsatisfied: ${pending.join(', ')}). Resume only via /task-continue ${slug}.`;
|
|
677
691
|
}
|
|
692
|
+
function deferReason(wave, deferred) {
|
|
693
|
+
const sameAgent = deferred.some((index) => wave.some((chosen) => {
|
|
694
|
+
const left = getStepAgents(steps[chosen]);
|
|
695
|
+
return getStepAgents(steps[index]).some((agent) => left.includes(agent));
|
|
696
|
+
}));
|
|
697
|
+
if (sameAgent) return 'same agent already in the wave';
|
|
698
|
+
const missingScope = [...wave, ...deferred].some((index) => declaredScopes(steps[index]).length === 0);
|
|
699
|
+
if (missingScope) return 'writeScopes undeclared';
|
|
700
|
+
return 'writeScopes overlap';
|
|
701
|
+
}
|
|
678
702
|
function dispatchReadyWave(prefixMessage) {
|
|
679
703
|
const ready = computeReadySteps();
|
|
680
704
|
if (ready.length === 0) return false;
|
|
681
705
|
const { wave, deferred } = selectWave(ready);
|
|
682
706
|
if (deferred.length > 0) {
|
|
683
|
-
appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason:
|
|
707
|
+
appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: deferReason(wave, deferred), source: 'hook', attributionConfidence: 'fallback' });
|
|
684
708
|
}
|
|
685
709
|
// Slot-filtered dispatch: only unsatisfied (stepIndex, agent) slots are invoked.
|
|
686
710
|
const units = wave.flatMap((stepIndex) => unsatisfiedAgents(stepIndex).map((agent) => ({ stepIndex, agent })));
|
|
@@ -826,9 +850,12 @@ function metricsHandoff(agent) {
|
|
|
826
850
|
return ' Metrics: use the supplied attemptId when available; for a parallel completion, write a minimal { attemptId, outcome } receipt to .metrics-receipts.json rather than relying on currentAgent. Do not calculate duration.';
|
|
827
851
|
}
|
|
828
852
|
|
|
853
|
+
function receiptPathClause() {
|
|
854
|
+
return 'authoritativePaths are relative to the task folder (brief.md), not the repo root; put external files in evidencePaths.';
|
|
855
|
+
}
|
|
829
856
|
function artifactHandoff(step, agent) {
|
|
830
857
|
const inputIds = Array.isArray(step?.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults';
|
|
831
|
-
return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId
|
|
858
|
+
return ` Artifact inputs: ${inputIds}; owned output ID: ${artifactOutputIdFor(step, agent)}. Bind the terminal receipt to the supplied attemptId. ${receiptPathClause()}`;
|
|
832
859
|
}
|
|
833
860
|
|
|
834
861
|
function handoffForAgent(agent, scope, step = null) {
|
|
@@ -846,7 +873,7 @@ function handoffForParallelStep(step) {
|
|
|
846
873
|
`Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
|
|
847
874
|
`Each agent writes its artifact and owned receipt; the hook records parallelCompleted from stops. Do not mutate status.json lifecycle fields. ` +
|
|
848
875
|
`Artifact inputs: ${Array.isArray(step.artifactInputIds) ? step.artifactInputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${agents.map((agent) => `${agent}=${artifactOutputIdFor(step, agent)}`).join('; ')}. ` +
|
|
849
|
-
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration
|
|
876
|
+
`Metrics attemptIds: ${attemptIds.join('; ')}. If the hook cannot identify a parallel stop, append a minimal { attemptId, outcome } receipt to .metrics-receipts.json; do not calculate duration. ${receiptPathClause()}`
|
|
850
877
|
);
|
|
851
878
|
}
|
|
852
879
|
|
|
@@ -855,9 +882,35 @@ function hasGateAfter(agent, humanGates) {
|
|
|
855
882
|
}
|
|
856
883
|
|
|
857
884
|
function hasGateAfterStep(step, humanGates) {
|
|
885
|
+
if (!Array.isArray(humanGates) || !step) return false;
|
|
886
|
+
if (typeof step.id === 'string' && step.id.length > 0 && humanGates.includes(`after:${step.id}`)) return true;
|
|
858
887
|
return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
|
|
859
888
|
}
|
|
860
889
|
|
|
890
|
+
// A followup loop of the subagent that just finished arrives with no attemptId
|
|
891
|
+
// and no receipt for the attempt this same transition opened. That stop is not
|
|
892
|
+
// the next agent. A stop more than 15s later, still without a receipt, is a
|
|
893
|
+
// real missing receipt and must stall.
|
|
894
|
+
function isSchedulingEcho() {
|
|
895
|
+
if (typeof hookInput.attemptId === 'string' && hookInput.attemptId.length > 0) return false;
|
|
896
|
+
const entries = Object.entries(status.activeAttempts || {});
|
|
897
|
+
if (entries.length !== 1) return false;
|
|
898
|
+
const [attemptId, entry] = entries[0];
|
|
899
|
+
const previous = status.lastCompletedAttempt;
|
|
900
|
+
if (!previous || previous.completedAt !== entry.startedAt) return false;
|
|
901
|
+
const ageMs = Date.parse(now) - Date.parse(entry.startedAt);
|
|
902
|
+
if (!Number.isFinite(ageMs) || ageMs < 0 || ageMs > 15000) return false;
|
|
903
|
+
const previousJoined = Object.values(status.joinedSlots || {}).some((slot) => slot && slot.attemptId === previous.attemptId);
|
|
904
|
+
const linearAdvance = !isGraphMode() && typeof entry.stepIndex === 'number' && entry.stepIndex > 0;
|
|
905
|
+
if (!previousJoined && !linearAdvance) return false;
|
|
906
|
+
try {
|
|
907
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(taskDir, 'artifact-manifest.json'), 'utf8'));
|
|
908
|
+
const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
|
|
909
|
+
if (artifacts.some((item) => item && item.receipt && item.receipt.attemptId === attemptId)) return false;
|
|
910
|
+
} catch {}
|
|
911
|
+
return true;
|
|
912
|
+
}
|
|
913
|
+
|
|
861
914
|
function legacyFlow() {
|
|
862
915
|
if (status.phase === 'analysis') {
|
|
863
916
|
process.stdout.write('{}');
|
|
@@ -1075,6 +1128,10 @@ if (pipelineParseError) {
|
|
|
1075
1128
|
}
|
|
1076
1129
|
|
|
1077
1130
|
steps = pipeline.steps || [];
|
|
1131
|
+
if (isSchedulingEcho()) {
|
|
1132
|
+
process.stdout.write('{}');
|
|
1133
|
+
process.exit(0);
|
|
1134
|
+
}
|
|
1078
1135
|
const initialIdx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
1079
1136
|
const initialStep = steps[initialIdx];
|
|
1080
1137
|
const activeAttemptCountBeforeFinish = Object.keys(status.activeAttempts || {}).length;
|
|
@@ -75,7 +75,7 @@ Same JSON on Claude, Mavis, or OpenCode: `bash .<tool>/hooks/chain-team-phases.s
|
|
|
75
75
|
## Contracts
|
|
76
76
|
|
|
77
77
|
- **Manifest field name:** receipts go in `artifacts[]`. Anything written under `entries` is ignored — the hook reads only `artifacts` and prints a dual-read warning naming the file. See `agent-team/agent-artifact-contracts.md` § Schema field name.
|
|
78
|
-
- **Evidence paths:** `authoritativePaths[]`
|
|
78
|
+
- **Evidence paths:** `authoritativePaths[]` is relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) is rejected. Put anything outside the task directory — e.g. `openspec/changes/**` — in `evidencePaths[]`.
|
|
79
79
|
- Manifest schema: shared core `agent-team/agent-artifact-contracts.md`. Read it first; producers upsert only their IDs.
|
|
80
80
|
- Metrics: append-only allowlisted events — `agent-team/agent-task-metrics.md`. Aggregate: `node node_modules/@bonesofspring/ai-rules/scripts/aggregate-agent-task-metrics.mjs --team-root .ai.local/team`.
|
|
81
81
|
- Commit `.ai.local/team/` templates (and slugs if you want them in clones).
|
|
@@ -131,7 +131,7 @@ Load requestable rule `mcp-usage` when verifying third-party library APIs (Conte
|
|
|
131
131
|
|
|
132
132
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
|
|
133
133
|
- **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
134
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
134
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
135
135
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
136
136
|
|
|
137
137
|
## Receipt binding
|
|
@@ -122,5 +122,5 @@ If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is r
|
|
|
122
122
|
|
|
123
123
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
|
|
124
124
|
- **Owned outputs:** `brief.md` and `decomposition.md`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `analysis`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
125
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
125
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
126
126
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -170,5 +170,5 @@ Return the routing receipt to the orchestrator. The orchestration runtime/hook e
|
|
|
170
170
|
|
|
171
171
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume the user request and any existing authoritative task/decision entries.
|
|
172
172
|
- **Owned outputs:** `pipeline.json` and the routing entry in `manifest.artifacts[]`; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `routing`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
173
|
-
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
173
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
174
174
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -3,6 +3,7 @@ name: task
|
|
|
3
3
|
description: "Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist.
|
|
6
7
|
|
|
7
8
|
<!-- shared-core: quality/anti-hallucination-load-line.md -->
|
|
8
9
|
|