@bonesofspring/ai-rules 0.2.33 → 0.2.34
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/docs/PRESET-CONTRIBUTION.md +2 -2
- package/package.json +4 -1
- package/presets/_shared/README.md +1 -1
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +22 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +12 -1
- package/presets/_shared/core/agent-team/agent-team-intake.md +1 -1
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +18 -4
- package/presets/_shared/core/agent-team/plan-graph.md +28 -0
- package/presets/_shared/core/agent-team/task-classification.md +2 -0
- package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/agents/task-router.md +10 -0
- package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
- package/presets/claude/android-kotlin/commands/task.md +1 -1
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +369 -16
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/android-kotlin/team/README.md +4 -1
- package/presets/claude/go/agents/task-analyst.md +1 -1
- package/presets/claude/go/agents/task-router.md +10 -0
- package/presets/claude/go/commands/task-continue.md +1 -1
- package/presets/claude/go/commands/task.md +1 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +367 -16
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/go/team/README.md +4 -1
- package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
- package/presets/claude/ios-swift/agents/task-router.md +10 -0
- package/presets/claude/ios-swift/commands/task-continue.md +1 -1
- package/presets/claude/ios-swift/commands/task.md +1 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +369 -16
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/ios-swift/team/README.md +4 -1
- package/presets/claude/java/agents/task-analyst.md +1 -1
- package/presets/claude/java/agents/task-router.md +10 -0
- package/presets/claude/java/commands/task-continue.md +1 -1
- package/presets/claude/java/commands/task.md +1 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +367 -16
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/java/team/README.md +4 -1
- package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/claude/mcp-ts/agents/task-router.md +10 -0
- package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
- package/presets/claude/mcp-ts/commands/task.md +1 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +367 -16
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/mcp-ts/team/README.md +4 -1
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +10 -0
- package/presets/claude/next/commands/task-continue.md +1 -1
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +369 -16
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/next/team/README.md +4 -1
- package/presets/claude/next/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/claude/next/team/fixtures/feature-parallel.json +84 -0
- package/presets/claude/nuxt/agents/task-analyst.md +1 -1
- package/presets/claude/nuxt/agents/task-router.md +10 -0
- package/presets/claude/nuxt/commands/task-continue.md +1 -1
- package/presets/claude/nuxt/commands/task.md +1 -1
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +369 -16
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/nuxt/team/README.md +4 -1
- package/presets/claude/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/claude/php-hexagonal/agents/task-router.md +10 -0
- package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/claude/php-hexagonal/commands/task.md +1 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +367 -16
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/php-hexagonal/team/README.md +4 -1
- package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
- package/presets/claude/php-laravel/agents/task-router.md +10 -0
- package/presets/claude/php-laravel/commands/task-continue.md +1 -1
- package/presets/claude/php-laravel/commands/task.md +1 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +367 -16
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/php-laravel/team/README.md +4 -1
- package/presets/claude/svelte/agents/task-analyst.md +1 -1
- package/presets/claude/svelte/agents/task-router.md +10 -0
- package/presets/claude/svelte/commands/task-continue.md +1 -1
- package/presets/claude/svelte/commands/task.md +1 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +369 -16
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +12 -1
- package/presets/claude/svelte/team/README.md +4 -1
- package/presets/claude/svelte/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/agents/task-router.md +10 -0
- package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
- package/presets/cursor/android-kotlin/commands/task.md +1 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +369 -16
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/android-kotlin/team/README.md +4 -1
- package/presets/cursor/go/agents/task-analyst.md +1 -1
- package/presets/cursor/go/agents/task-router.md +10 -0
- package/presets/cursor/go/commands/task-continue.md +1 -1
- package/presets/cursor/go/commands/task.md +1 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +367 -16
- package/presets/cursor/go/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/go/team/README.md +4 -1
- package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
- package/presets/cursor/ios-swift/agents/task-router.md +10 -0
- package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
- package/presets/cursor/ios-swift/commands/task.md +1 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +369 -16
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/ios-swift/team/README.md +4 -1
- package/presets/cursor/java/agents/task-analyst.md +1 -1
- package/presets/cursor/java/agents/task-router.md +10 -0
- package/presets/cursor/java/commands/task-continue.md +1 -1
- package/presets/cursor/java/commands/task.md +1 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +367 -16
- package/presets/cursor/java/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/java/team/README.md +4 -1
- package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/cursor/mcp-ts/agents/task-router.md +10 -0
- package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
- package/presets/cursor/mcp-ts/commands/task.md +1 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +367 -16
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/mcp-ts/team/README.md +4 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +10 -0
- package/presets/cursor/next/commands/task-continue.md +1 -1
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +369 -16
- package/presets/cursor/next/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/next/team/README.md +4 -1
- package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/cursor/next/team/fixtures/feature-parallel.json +84 -0
- package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
- package/presets/cursor/nuxt/agents/task-router.md +10 -0
- package/presets/cursor/nuxt/commands/task-continue.md +1 -1
- package/presets/cursor/nuxt/commands/task.md +1 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +369 -16
- package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/nuxt/team/README.md +4 -1
- package/presets/cursor/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/cursor/php-hexagonal/agents/task-router.md +10 -0
- package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/cursor/php-hexagonal/commands/task.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +367 -16
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/php-hexagonal/team/README.md +4 -1
- package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
- package/presets/cursor/php-laravel/agents/task-router.md +10 -0
- package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
- package/presets/cursor/php-laravel/commands/task.md +1 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +367 -16
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/php-laravel/team/README.md +4 -1
- package/presets/cursor/svelte/agents/task-analyst.md +1 -1
- package/presets/cursor/svelte/agents/task-router.md +10 -0
- package/presets/cursor/svelte/commands/task-continue.md +1 -1
- package/presets/cursor/svelte/commands/task.md +1 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +369 -16
- package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +12 -1
- package/presets/cursor/svelte/team/README.md +4 -1
- package/presets/cursor/svelte/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/mavis/android-kotlin/agents/task-router.md +10 -0
- package/presets/mavis/android-kotlin/commands/task-continue.md +1 -1
- package/presets/mavis/android-kotlin/commands/task.md +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +369 -16
- package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -1
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/android-kotlin/team/README.md +4 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/agents/task-analyst.md +1 -1
- package/presets/mavis/go/agents/task-router.md +10 -0
- package/presets/mavis/go/commands/task-continue.md +1 -1
- package/presets/mavis/go/commands/task.md +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +367 -16
- package/presets/mavis/go/rules/agent-team-intake.md +1 -1
- package/presets/mavis/go/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/go/team/README.md +4 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
- package/presets/mavis/ios-swift/agents/task-router.md +10 -0
- package/presets/mavis/ios-swift/commands/task-continue.md +1 -1
- package/presets/mavis/ios-swift/commands/task.md +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +369 -16
- package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -1
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/ios-swift/team/README.md +4 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/agents/task-analyst.md +1 -1
- package/presets/mavis/java/agents/task-router.md +10 -0
- package/presets/mavis/java/commands/task-continue.md +1 -1
- package/presets/mavis/java/commands/task.md +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +367 -16
- package/presets/mavis/java/rules/agent-team-intake.md +1 -1
- package/presets/mavis/java/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/java/team/README.md +4 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/mavis/mcp-ts/agents/task-router.md +10 -0
- package/presets/mavis/mcp-ts/commands/task-continue.md +1 -1
- package/presets/mavis/mcp-ts/commands/task.md +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +367 -16
- package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -1
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/mcp-ts/team/README.md +4 -1
- package/presets/mavis/next/adapter-map.json +9 -1
- package/presets/mavis/next/agents/task-analyst.md +1 -1
- package/presets/mavis/next/agents/task-router.md +10 -0
- package/presets/mavis/next/commands/task-continue.md +1 -1
- package/presets/mavis/next/commands/task.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +369 -16
- package/presets/mavis/next/rules/agent-team-intake.md +1 -1
- package/presets/mavis/next/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/next/team/README.md +4 -1
- package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/mavis/next/team/fixtures/feature-parallel.json +84 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
- package/presets/mavis/nuxt/agents/task-router.md +10 -0
- package/presets/mavis/nuxt/commands/task-continue.md +1 -1
- package/presets/mavis/nuxt/commands/task.md +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +369 -16
- package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -1
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/nuxt/team/README.md +4 -1
- package/presets/mavis/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/mavis/php-hexagonal/agents/task-router.md +10 -0
- package/presets/mavis/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/mavis/php-hexagonal/commands/task.md +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +367 -16
- package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -1
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/php-hexagonal/team/README.md +4 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
- package/presets/mavis/php-laravel/agents/task-router.md +10 -0
- package/presets/mavis/php-laravel/commands/task-continue.md +1 -1
- package/presets/mavis/php-laravel/commands/task.md +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +367 -16
- package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -1
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/php-laravel/team/README.md +4 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/agents/task-analyst.md +1 -1
- package/presets/mavis/svelte/agents/task-router.md +10 -0
- package/presets/mavis/svelte/commands/task-continue.md +1 -1
- package/presets/mavis/svelte/commands/task.md +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +369 -16
- package/presets/mavis/svelte/rules/agent-team-intake.md +1 -1
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +18 -4
- package/presets/mavis/svelte/team/README.md +4 -1
- package/presets/mavis/svelte/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-router.md +10 -0
- package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
- package/presets/opencode/android-kotlin/commands/task.md +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +369 -16
- package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -1
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/android-kotlin/team/README.md +4 -1
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/agents/task-router.md +10 -0
- package/presets/opencode/go/commands/task-continue.md +1 -1
- package/presets/opencode/go/commands/task.md +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +367 -16
- package/presets/opencode/go/rules/agent-team-intake.md +1 -1
- package/presets/opencode/go/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/go/team/README.md +4 -1
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/agents/task-router.md +10 -0
- package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
- package/presets/opencode/ios-swift/commands/task.md +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +369 -16
- package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -1
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/ios-swift/team/README.md +4 -1
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/agents/task-router.md +10 -0
- package/presets/opencode/java/commands/task-continue.md +1 -1
- package/presets/opencode/java/commands/task.md +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +367 -16
- package/presets/opencode/java/rules/agent-team-intake.md +1 -1
- package/presets/opencode/java/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/java/team/README.md +4 -1
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-router.md +10 -0
- package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
- package/presets/opencode/mcp-ts/commands/task.md +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +367 -16
- package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -1
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/mcp-ts/team/README.md +4 -1
- package/presets/opencode/next/adapter-map.json +9 -1
- package/presets/opencode/next/agents/task-analyst.md +1 -1
- package/presets/opencode/next/agents/task-router.md +10 -0
- package/presets/opencode/next/commands/task-continue.md +1 -1
- package/presets/opencode/next/commands/task.md +1 -1
- package/presets/opencode/next/hooks/chain-team-phases.sh +369 -16
- package/presets/opencode/next/rules/agent-team-intake.md +1 -1
- package/presets/opencode/next/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/next/team/README.md +4 -1
- package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/opencode/next/team/fixtures/feature-parallel.json +84 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/agents/task-router.md +10 -0
- package/presets/opencode/nuxt/commands/task-continue.md +1 -1
- package/presets/opencode/nuxt/commands/task.md +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +369 -16
- package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -1
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/nuxt/team/README.md +4 -1
- package/presets/opencode/nuxt/team/fixtures/artifact-manifest.example.json +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-router.md +10 -0
- package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/opencode/php-hexagonal/commands/task.md +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +367 -16
- package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -1
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/php-hexagonal/team/README.md +4 -1
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/agents/task-router.md +10 -0
- package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
- package/presets/opencode/php-laravel/commands/task.md +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +367 -16
- package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -1
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/php-laravel/team/README.md +4 -1
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/agents/task-router.md +10 -0
- package/presets/opencode/svelte/commands/task-continue.md +1 -1
- package/presets/opencode/svelte/commands/task.md +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +369 -16
- package/presets/opencode/svelte/rules/agent-team-intake.md +1 -1
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +18 -4
- package/presets/opencode/svelte/team/README.md +4 -1
- package/presets/opencode/svelte/team/fixtures/artifact-manifest.example.json +1 -1
- package/scripts/_lib/agent-write-scopes.json +27 -0
- package/scripts/check-parallel-plan.sh +353 -0
- package/scripts/check-preset-prompt-persistence.sh +51 -24
- package/scripts/check-preset-structure.sh +2 -0
- package/scripts/check-step-graph-contract.sh +123 -0
- package/scripts/fixtures/cli-golden/claude/next.json +10 -9
- package/scripts/fixtures/cli-golden/cursor/next.json +10 -9
- package/scripts/fixtures/cli-golden/mavis/android-kotlin.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/go.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/ios-swift.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/java.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/mcp-ts.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/next.json +10 -9
- package/scripts/fixtures/cli-golden/mavis/nuxt.json +9 -9
- package/scripts/fixtures/cli-golden/mavis/php-hexagonal.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/php-laravel.json +8 -8
- package/scripts/fixtures/cli-golden/mavis/svelte.json +9 -9
- package/scripts/fixtures/cli-golden/opencode/android-kotlin.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/go.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/ios-swift.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/java.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/mcp-ts.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/next.json +10 -9
- package/scripts/fixtures/cli-golden/opencode/nuxt.json +9 -9
- package/scripts/fixtures/cli-golden/opencode/php-hexagonal.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/php-laravel.json +8 -8
- package/scripts/fixtures/cli-golden/opencode/svelte.json +9 -9
- package/scripts/test-agent-task-metrics-hooks.mjs +167 -0
- package/scripts/test-chain-team-phases-coverage.mjs +129 -0
- package/scripts/test-parallel-plan-fixtures.mjs +173 -0
- package/scripts/test-preset-prompt-persistence-fixtures.mjs +58 -1
|
@@ -73,6 +73,9 @@ const statusPath = path.join(taskDir, 'status.json');
|
|
|
73
73
|
const pipelinePath = path.join(taskDir, 'pipeline.json');
|
|
74
74
|
const METRICS_PATH = path.join(taskDir, 'metrics.json');
|
|
75
75
|
const METRICS_LOCK = `${METRICS_PATH}.lock`;
|
|
76
|
+
// Pipeline step graph is assigned once pipeline.json is parsed; declared early so the
|
|
77
|
+
// gate-resume branch can schedule from the graph before the main parse point.
|
|
78
|
+
let steps = [];
|
|
76
79
|
|
|
77
80
|
if (!fs.existsSync(statusPath)) {
|
|
78
81
|
process.stdout.write('{}');
|
|
@@ -207,15 +210,16 @@ function artifactOutputIdFor(step, agent) {
|
|
|
207
210
|
if (step?.artifactOutputIds && typeof step.artifactOutputIds[agent] === 'string') return step.artifactOutputIds[agent];
|
|
208
211
|
return DEFAULT_ARTIFACT_OUTPUT_IDS[agent] || agent;
|
|
209
212
|
}
|
|
210
|
-
function activateAttempts(step, stepIndex) {
|
|
211
|
-
const active = { ...(status.activeAttempts || {}) };
|
|
212
|
-
const
|
|
213
|
+
function activateAttempts(step, stepIndex, waveId = null, agentsOverride = null) {
|
|
214
|
+
const active = { ...(status.activeAttempts || {}) };
|
|
215
|
+
const agents = Array.isArray(agentsOverride) && agentsOverride.length > 0 ? agentsOverride : getStepAgents(step);
|
|
216
|
+
const parallelGroupId = step.parallel && getStepAgents(step).length > 1 ? `${status.metricsRunId || slug}:step-${stepIndex}` : null;
|
|
213
217
|
for (const agent of agents) {
|
|
214
218
|
const attempt = nextAttemptOrdinal(stepIndex, agent); const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
215
219
|
status.metricsRunId = runId; const attemptId = `${runId}:step-${stepIndex}:${agent}:attempt-${attempt}`;
|
|
216
220
|
if (active[attemptId]) continue;
|
|
217
|
-
active[attemptId] = { agent, stepIndex, attempt, startedAt: now, parallelGroupId };
|
|
218
|
-
appendMetric({ type: 'attempt_started', at: now, attemptId, stepIndex, stepLabel: step.label || null, agent, role: roleFor(agent), attempt, parallelGroupId, source: 'hook', attributionConfidence: 'high' });
|
|
221
|
+
active[attemptId] = { agent, stepIndex, attempt, startedAt: now, parallelGroupId, waveId: waveId || null };
|
|
222
|
+
appendMetric({ type: 'attempt_started', at: now, attemptId, stepIndex, stepLabel: step.label || null, agent, role: roleFor(agent), attempt, parallelGroupId, waveId: waveId || null, source: 'hook', attributionConfidence: 'high' });
|
|
219
223
|
}
|
|
220
224
|
status.activeAttempts = active;
|
|
221
225
|
}
|
|
@@ -309,8 +313,8 @@ function reconcileStatusFromManifest(agent, step, resolved) {
|
|
|
309
313
|
return status.state;
|
|
310
314
|
}
|
|
311
315
|
|
|
312
|
-
function finishActiveAttempt() {
|
|
313
|
-
const resolved = resolvedAttempt(); if (!resolved) return null;
|
|
316
|
+
function finishActiveAttempt(forced) {
|
|
317
|
+
const resolved = forced || resolvedAttempt(); if (!resolved) return null;
|
|
314
318
|
const durationMs = Date.parse(now) - Date.parse(resolved.entry.startedAt);
|
|
315
319
|
const outcome = ['completed', 'blocked', 'changes_requested', 'validation_failed'].includes(status.state) ? status.state : 'unknown';
|
|
316
320
|
appendMetric({ type: 'attempt_finished', at: now, attemptId: resolved.attemptId, outcome, durationMs: Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : null, retryAfterFix: status.retryAfterFix || null, source: resolved.source || 'hook', attributionConfidence: resolved.confidence });
|
|
@@ -390,6 +394,208 @@ function findNextExecutableStep(steps, startIdx, dir) {
|
|
|
390
394
|
return null;
|
|
391
395
|
}
|
|
392
396
|
|
|
397
|
+
// --- Parallel scheduling & conflict model (mirrors _shared/core/agent-team/plan-graph.md) ---
|
|
398
|
+
function isGraphMode() { return steps.some((step) => step && Array.isArray(step.dependsOn)); }
|
|
399
|
+
function graphSlotKey(stepIndex, agent) { return `${stepIndex}:${agent}`; }
|
|
400
|
+
function readJoinedSlots() { return { ...(status.joinedSlots || {}) }; }
|
|
401
|
+
function isSlotSatisfied(stepIndex, agent) { return Boolean((status.joinedSlots || {})[graphSlotKey(stepIndex, agent)]); }
|
|
402
|
+
function resolveStepIndex(dep) {
|
|
403
|
+
for (let i = 0; i < steps.length; i += 1) if (steps[i] && steps[i].id === dep) return i;
|
|
404
|
+
for (let i = 0; i < steps.length; i += 1) {
|
|
405
|
+
const ids = Array.isArray(steps[i]?.taskIds) ? steps[i].taskIds : [];
|
|
406
|
+
if (ids.includes(dep)) return i;
|
|
407
|
+
}
|
|
408
|
+
return -1;
|
|
409
|
+
}
|
|
410
|
+
function isStepSkipped(stepIndex) {
|
|
411
|
+
if (Array.isArray(status.skippedSteps) && status.skippedSteps.includes(stepIndex)) return true;
|
|
412
|
+
return skipIfMatches(steps[stepIndex]?.skipIf, taskDir);
|
|
413
|
+
}
|
|
414
|
+
function isStepSatisfied(stepIndex) {
|
|
415
|
+
const step = steps[stepIndex];
|
|
416
|
+
if (!step) return false;
|
|
417
|
+
if (isStepSkipped(stepIndex)) return true;
|
|
418
|
+
return getStepAgents(step).every((agent) => isSlotSatisfied(stepIndex, agent));
|
|
419
|
+
}
|
|
420
|
+
function pendingStepIndexes() { return steps.map((_, index) => index).filter((index) => !isStepSatisfied(index)); }
|
|
421
|
+
function unsatisfiedAgents(stepIndex) {
|
|
422
|
+
const step = steps[stepIndex];
|
|
423
|
+
if (!step) return [];
|
|
424
|
+
return getStepAgents(step).filter((agent) => !isSlotSatisfied(stepIndex, agent));
|
|
425
|
+
}
|
|
426
|
+
function declaredScopes(step) {
|
|
427
|
+
return Array.isArray(step?.writeScopes) ? step.writeScopes.filter((scope) => typeof scope === 'string' && scope.length > 0) : [];
|
|
428
|
+
}
|
|
429
|
+
function normalizeScope(scope) { return String(scope).replace(/\/+$/, ''); }
|
|
430
|
+
function scopesOverlap(left, right) {
|
|
431
|
+
const a = normalizeScope(left); const b = normalizeScope(right);
|
|
432
|
+
return a === b || a.startsWith(`${b}/`) || b.startsWith(`${a}/`);
|
|
433
|
+
}
|
|
434
|
+
function stepsConflict(leftIndex, rightIndex) {
|
|
435
|
+
if (leftIndex === rightIndex) return true;
|
|
436
|
+
const leftStep = steps[leftIndex]; const rightStep = steps[rightIndex];
|
|
437
|
+
const leftAgents = getStepAgents(leftStep); const rightAgents = getStepAgents(rightStep);
|
|
438
|
+
if (leftAgents.some((agent) => rightAgents.includes(agent))) return true;
|
|
439
|
+
const leftOutputs = new Set(leftAgents.map((agent) => artifactOutputIdFor(leftStep, agent)));
|
|
440
|
+
if (rightAgents.some((agent) => leftOutputs.has(artifactOutputIdFor(rightStep, agent)))) return true;
|
|
441
|
+
// An undeclared scope is unknown, and an unknown unit conflicts with everything (safe default).
|
|
442
|
+
const leftScopes = declaredScopes(leftStep); const rightScopes = declaredScopes(rightStep);
|
|
443
|
+
if (leftScopes.length === 0 || rightScopes.length === 0) return true;
|
|
444
|
+
for (const a of leftScopes) for (const b of rightScopes) if (scopesOverlap(a, b)) return true;
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
function selectWave(candidates) {
|
|
448
|
+
const wave = []; const deferred = [];
|
|
449
|
+
for (const index of candidates) {
|
|
450
|
+
if (wave.every((chosen) => !stepsConflict(chosen, index))) wave.push(index);
|
|
451
|
+
else deferred.push(index);
|
|
452
|
+
}
|
|
453
|
+
return { wave, deferred };
|
|
454
|
+
}
|
|
455
|
+
function invalidateFrom(stepIndex, preserveStepIndex) {
|
|
456
|
+
const remove = new Set([stepIndex]);
|
|
457
|
+
let changed = true;
|
|
458
|
+
while (changed) {
|
|
459
|
+
changed = false;
|
|
460
|
+
for (let i = 0; i < steps.length; i += 1) {
|
|
461
|
+
if (remove.has(i)) continue;
|
|
462
|
+
const deps = Array.isArray(steps[i]?.dependsOn) ? steps[i].dependsOn : [];
|
|
463
|
+
if (deps.some((dep) => { const j = resolveStepIndex(dep); return j >= 0 && remove.has(j); })) { remove.add(i); changed = true; }
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
// Preserve the requesting step's satisfied slots so a sibling is never re-invoked.
|
|
467
|
+
if (Number.isInteger(preserveStepIndex)) remove.delete(preserveStepIndex);
|
|
468
|
+
const slots = readJoinedSlots();
|
|
469
|
+
const removedAgents = new Set();
|
|
470
|
+
for (const key of Object.keys(slots)) {
|
|
471
|
+
const index = Number(key.split(':')[0]);
|
|
472
|
+
if (remove.has(index)) { removedAgents.add(slots[key].agent); delete slots[key]; }
|
|
473
|
+
}
|
|
474
|
+
status.joinedSlots = slots;
|
|
475
|
+
status.parallelCompleted = (status.parallelCompleted || []).filter((agent) => !removedAgents.has(agent));
|
|
476
|
+
return remove;
|
|
477
|
+
}
|
|
478
|
+
function computeReadySteps() {
|
|
479
|
+
if (!isGraphMode()) return [];
|
|
480
|
+
const inFlight = new Set(Object.values(status.activeAttempts || {}).map((entry) => entry.stepIndex));
|
|
481
|
+
const blocked = new Set(Array.isArray(status.blockedSteps) ? status.blockedSteps : []);
|
|
482
|
+
const skipped = new Set(Array.isArray(status.skippedSteps) ? status.skippedSteps : []);
|
|
483
|
+
const ready = [];
|
|
484
|
+
for (let i = 0; i < steps.length; i += 1) {
|
|
485
|
+
if (blocked.has(i) || inFlight.has(i)) continue;
|
|
486
|
+
if (skipIfMatches(steps[i].skipIf, taskDir)) {
|
|
487
|
+
if (!skipped.has(i)) { recordSkippedStep(steps[i], i); skipped.add(i); }
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (isStepSatisfied(i)) continue;
|
|
491
|
+
const deps = Array.isArray(steps[i].dependsOn) ? steps[i].dependsOn : [];
|
|
492
|
+
if (deps.every((dep) => { const j = resolveStepIndex(dep); return j >= 0 && isStepSatisfied(j); })) ready.push(i);
|
|
493
|
+
}
|
|
494
|
+
status.skippedSteps = [...skipped];
|
|
495
|
+
return ready;
|
|
496
|
+
}
|
|
497
|
+
function handoffForWave(units, waveId) {
|
|
498
|
+
const labels = units.map((unit) => `${steps[unit.stepIndex].id || `step-${unit.stepIndex}`}=${unit.agent}`);
|
|
499
|
+
const attemptIds = Object.entries(status.activeAttempts || {})
|
|
500
|
+
.filter(([, entry]) => units.some((unit) => unit.stepIndex === entry.stepIndex && unit.agent === entry.agent))
|
|
501
|
+
.map(([attemptId, entry]) => `${entry.agent}=${attemptId}`);
|
|
502
|
+
const outputIds = units.map((unit) => `${unit.agent}=${artifactOutputIdFor(steps[unit.stepIndex], unit.agent)}`);
|
|
503
|
+
const inputIds = [...new Set(units.flatMap((unit) => (Array.isArray(steps[unit.stepIndex].artifactInputIds) ? steps[unit.stepIndex].artifactInputIds : [])))];
|
|
504
|
+
return (
|
|
505
|
+
`Invoke IN PARALLEL (one message, multiple Task calls): ${labels.join(' AND ')} for slug "${slug}"${waveId ? ` (waveId=${waveId})` : ''}. ` +
|
|
506
|
+
`Each agent writes its artifact and owned receipt; the hook records slot joins from stops. Do not mutate status.json lifecycle fields. ` +
|
|
507
|
+
`Artifact inputs: ${inputIds.length > 0 ? inputIds.join(', ') : 'manifest defaults'}; owned output IDs: ${outputIds.join('; ')}. ` +
|
|
508
|
+
`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.`
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
function blockedNotice(blockedIndex, agent) {
|
|
512
|
+
const gated = [];
|
|
513
|
+
for (let i = 0; i < steps.length; i += 1) {
|
|
514
|
+
if (i === blockedIndex || isStepSatisfied(i)) continue;
|
|
515
|
+
const deps = Array.isArray(steps[i].dependsOn) ? steps[i].dependsOn : [];
|
|
516
|
+
if (deps.some((dep) => resolveStepIndex(dep) === blockedIndex)) gated.push(steps[i].id || `step-${i}`);
|
|
517
|
+
}
|
|
518
|
+
return `Step ${blockedIndex} (${agent}) is blocked for slug "${slug}"${gated.length > 0 ? ` and gates: ${gated.join(', ')}` : ''}. No independent ready step remains. Resume only via /task-continue ${slug}.`;
|
|
519
|
+
}
|
|
520
|
+
function noProgressNotice() {
|
|
521
|
+
const pending = pendingStepIndexes().map((index) => steps[index].id || `step-${index}`);
|
|
522
|
+
return `No schedulable step remains for slug "${slug}" (unsatisfied: ${pending.join(', ')}). Resume only via /task-continue ${slug}.`;
|
|
523
|
+
}
|
|
524
|
+
function dispatchReadyWave(prefixMessage) {
|
|
525
|
+
const ready = computeReadySteps();
|
|
526
|
+
if (ready.length === 0) return false;
|
|
527
|
+
const { wave, deferred } = selectWave(ready);
|
|
528
|
+
if (deferred.length > 0) {
|
|
529
|
+
appendMetric({ type: 'parallel_conflict_deferred', at: now, stepIndex: wave[0], deferredStepIndexes: deferred, reason: 'ready set not conflict-free or writeScopes undeclared', source: 'hook', attributionConfidence: 'fallback' });
|
|
530
|
+
}
|
|
531
|
+
// Slot-filtered dispatch: only unsatisfied (stepIndex, agent) slots are invoked.
|
|
532
|
+
const units = wave.flatMap((stepIndex) => unsatisfiedAgents(stepIndex).map((agent) => ({ stepIndex, agent })));
|
|
533
|
+
if (units.length === 0) return false;
|
|
534
|
+
const first = units[0].stepIndex;
|
|
535
|
+
const waveId = `${status.metricsRunId || slug}:wave-${first}`;
|
|
536
|
+
for (const unit of units) activateAttempts(steps[unit.stepIndex], unit.stepIndex, units.length > 1 ? waveId : null, [unit.agent]);
|
|
537
|
+
writeStatus({
|
|
538
|
+
pipelineIndex: first,
|
|
539
|
+
currentAgent: units[0].agent,
|
|
540
|
+
phase: 'executing',
|
|
541
|
+
state: 'in_progress',
|
|
542
|
+
awaitingHumanGate: false,
|
|
543
|
+
parallelCompleted: [],
|
|
544
|
+
parallelOutcomes: {},
|
|
545
|
+
waveSteps: wave,
|
|
546
|
+
waveId,
|
|
547
|
+
});
|
|
548
|
+
const stepIndexes = [...new Set(units.map((unit) => unit.stepIndex))];
|
|
549
|
+
appendMetric({ type: 'parallel_wave_started', at: now, waveId, stepIndexes, agents: units.map((unit) => unit.agent), source: 'hook', attributionConfidence: 'high' });
|
|
550
|
+
let message;
|
|
551
|
+
if (units.length === 1) message = handoffForAgent(units[0].agent, steps[first]?.scope, steps[first]);
|
|
552
|
+
else if (stepIndexes.length === 1 && steps[first].parallel && units.length === getStepAgents(steps[first]).length) message = handoffForParallelStep(steps[first]);
|
|
553
|
+
else message = handoffForWave(units, waveId);
|
|
554
|
+
out(prefixMessage ? `${prefixMessage} ${message}` : message);
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
557
|
+
function resolveProducerStepIndex(agent, fromIndex) {
|
|
558
|
+
const seen = new Set([fromIndex]);
|
|
559
|
+
const stack = [fromIndex];
|
|
560
|
+
let best = -1;
|
|
561
|
+
while (stack.length > 0) {
|
|
562
|
+
const node = stack.pop();
|
|
563
|
+
const deps = Array.isArray(steps[node]?.dependsOn) ? steps[node].dependsOn : [];
|
|
564
|
+
for (const dep of deps) {
|
|
565
|
+
const j = resolveStepIndex(dep);
|
|
566
|
+
if (j < 0 || seen.has(j)) continue;
|
|
567
|
+
seen.add(j);
|
|
568
|
+
if (getStepAgents(steps[j]).includes(agent)) best = Math.max(best, j);
|
|
569
|
+
stack.push(j);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return best >= 0 ? best : -1;
|
|
573
|
+
}
|
|
574
|
+
function repairUnattributableStop() {
|
|
575
|
+
const entries = Object.entries(status.activeAttempts || {});
|
|
576
|
+
if (entries.length === 0) return null;
|
|
577
|
+
const bindByAgent = (agent) => {
|
|
578
|
+
if (!agent) return null;
|
|
579
|
+
const matches = entries.filter(([, entry]) => entry.agent === agent);
|
|
580
|
+
return matches.length === 1 ? { attemptId: matches[0][0], entry: matches[0][1], confidence: 'fallback', repaired: true } : null;
|
|
581
|
+
};
|
|
582
|
+
const payloadAgent = typeof hookInput.agentType === 'string' ? hookInput.agentType : (typeof hookInput.agent_type === 'string' ? hookInput.agent_type : null);
|
|
583
|
+
const byPayload = bindByAgent(payloadAgent);
|
|
584
|
+
if (byPayload) return byPayload;
|
|
585
|
+
if (Array.isArray(status.waveSteps) && status.waveSteps.length > 0) {
|
|
586
|
+
const outcomes = status.parallelOutcomes || {};
|
|
587
|
+
const unrecorded = status.waveSteps.flatMap((index) => getStepAgents(steps[index])).filter((agent) => !outcomes[agent]);
|
|
588
|
+
if (unrecorded.length === 1) { const bySole = bindByAgent(unrecorded[0]); if (bySole) return bySole; }
|
|
589
|
+
}
|
|
590
|
+
const byCurrent = bindByAgent(status.currentAgent);
|
|
591
|
+
if (byCurrent) return byCurrent;
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
function repairHandoffMessage() {
|
|
595
|
+
const listing = Object.entries(status.activeAttempts || {}).map(([attemptId, entry]) => `${entry.agent}=${attemptId}`).join('; ');
|
|
596
|
+
return `Parallel stop could not be attributed for slug "${slug}": in-flight attempts ${listing}; no payload attemptId and no bound receipt for the finished agent. Resume deterministically: append a minimal { attemptId, outcome } receipt for the agent that just finished to .ai.local/team/tasks/${slug}/.metrics-receipts.json, then re-run the installed hooks/chain-team-phases.sh with that attemptId. Do not edit status.json manually.`;
|
|
597
|
+
}
|
|
598
|
+
|
|
393
599
|
const AGENT_HANDOFF = {
|
|
394
600
|
'task-analyst': (s) =>
|
|
395
601
|
`Invoke task-analyst for slug "${s}". Write brief.md and decomposition.md under .ai.local/team/tasks/${s}/. ` +
|
|
@@ -604,6 +810,24 @@ if (hookInput.action === 'end_human_gate') {
|
|
|
604
810
|
try { resumePipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8')); } catch {}
|
|
605
811
|
if (resumePipeline) {
|
|
606
812
|
const resumeSteps = resumePipeline.steps || [];
|
|
813
|
+
if (resumeSteps.some((step) => step && Array.isArray(step.dependsOn))) {
|
|
814
|
+
steps = resumeSteps;
|
|
815
|
+
status.blockedSteps = [];
|
|
816
|
+
status.parallelCompleted = [];
|
|
817
|
+
status.parallelOutcomes = {};
|
|
818
|
+
status.waveSteps = [];
|
|
819
|
+
status.waveId = null;
|
|
820
|
+
if (dispatchReadyWave()) process.exit(0);
|
|
821
|
+
if (pendingStepIndexes().length === 0) {
|
|
822
|
+
status.state = 'completed';
|
|
823
|
+
completeTaskMetrics();
|
|
824
|
+
writeStatus({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
|
|
825
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
826
|
+
process.exit(0);
|
|
827
|
+
}
|
|
828
|
+
out(noProgressNotice());
|
|
829
|
+
process.exit(0);
|
|
830
|
+
}
|
|
607
831
|
const resumeStart = (typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0) + 1;
|
|
608
832
|
const resumeNext = findNextExecutableStep(resumeSteps, resumeStart, taskDir);
|
|
609
833
|
if (resumeNext) {
|
|
@@ -702,7 +926,7 @@ if (pipelineParseError) {
|
|
|
702
926
|
legacyFlow();
|
|
703
927
|
}
|
|
704
928
|
|
|
705
|
-
|
|
929
|
+
steps = pipeline.steps || [];
|
|
706
930
|
const initialIdx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
707
931
|
const initialStep = steps[initialIdx];
|
|
708
932
|
const activeAttemptCountBeforeFinish = Object.keys(status.activeAttempts || {}).length;
|
|
@@ -719,10 +943,23 @@ if (status.state === 'awaiting_artifact_receipt') {
|
|
|
719
943
|
process.stdout.write('{}');
|
|
720
944
|
process.exit(0);
|
|
721
945
|
}
|
|
722
|
-
|
|
723
|
-
if (!finishedAttempt &&
|
|
724
|
-
|
|
725
|
-
|
|
946
|
+
let finishedAttempt = finishActiveAttempt();
|
|
947
|
+
if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
|
|
948
|
+
if (!hookInput.attemptId) {
|
|
949
|
+
const repaired = repairUnattributableStop();
|
|
950
|
+
if (repaired) {
|
|
951
|
+
appendMetric({ type: 'parallel_attribution_repair', at: now, attemptIds: [repaired.attemptId], source: 'hook', attributionConfidence: 'fallback' });
|
|
952
|
+
reconcileStatusFromManifest(repaired.entry.agent, steps[repaired.entry.stepIndex], repaired);
|
|
953
|
+
finishedAttempt = finishActiveAttempt(repaired);
|
|
954
|
+
} else {
|
|
955
|
+
writeStatus({});
|
|
956
|
+
out(repairHandoffMessage());
|
|
957
|
+
process.exit(0);
|
|
958
|
+
}
|
|
959
|
+
} else {
|
|
960
|
+
process.stdout.write('{}');
|
|
961
|
+
process.exit(0);
|
|
962
|
+
}
|
|
726
963
|
}
|
|
727
964
|
endHumanGateIfResumed();
|
|
728
965
|
if (steps.length === 0 || pipeline.autoChain === false) {
|
|
@@ -758,10 +995,28 @@ function scheduleRetry(agent, retryAfterFix, predecessor, explicitStepIndex = nu
|
|
|
758
995
|
const idx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
759
996
|
const currentStep = steps[idx];
|
|
760
997
|
const completedAgent = finishedAttempt?.entry?.agent || status.currentAgent || getStepAgents(currentStep)[0];
|
|
998
|
+
const completedStepIndex = Number.isInteger(finishedAttempt?.entry?.stepIndex) ? finishedAttempt.entry.stepIndex : idx;
|
|
761
999
|
const stepAgents = getStepAgents(currentStep);
|
|
1000
|
+
const activeWave = isGraphMode() && Array.isArray(status.waveSteps) && status.waveSteps.filter((i) => Number.isInteger(i) && steps[i]).length > 0
|
|
1001
|
+
? status.waveSteps.filter((i) => Number.isInteger(i) && steps[i])
|
|
1002
|
+
: null;
|
|
1003
|
+
const waveIndexes = activeWave
|
|
1004
|
+
? activeWave
|
|
1005
|
+
: (currentStep?.parallel && stepAgents.length > 1
|
|
1006
|
+
? [idx]
|
|
1007
|
+
: (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
|
|
762
1008
|
|
|
763
|
-
|
|
1009
|
+
|
|
1010
|
+
if (waveIndexes) {
|
|
1011
|
+
const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
|
|
764
1012
|
const done = [...(status.parallelCompleted || [])];
|
|
1013
|
+
if (isGraphMode()) {
|
|
1014
|
+
for (const waveStep of waveIndexes) {
|
|
1015
|
+
for (const waveAgent of getStepAgents(steps[waveStep])) {
|
|
1016
|
+
if (isSlotSatisfied(waveStep, waveAgent) && !done.includes(waveAgent)) done.push(waveAgent);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
765
1020
|
const outcomes = { ...(status.parallelOutcomes || {}) };
|
|
766
1021
|
if (finishedAttempt && completedAgent) {
|
|
767
1022
|
if (!done.includes(completedAgent)) done.push(completedAgent);
|
|
@@ -771,21 +1026,39 @@ if (currentStep?.parallel && stepAgents.length > 1) {
|
|
|
771
1026
|
confidence: finishedAttempt.confidence,
|
|
772
1027
|
};
|
|
773
1028
|
}
|
|
1029
|
+
if (finishedAttempt && completedAgent && isGraphMode() && (finishedAttempt.outcome || status.state) === 'completed') {
|
|
1030
|
+
const completedSlots = readJoinedSlots();
|
|
1031
|
+
completedSlots[graphSlotKey(completedStepIndex, completedAgent)] = {
|
|
1032
|
+
agent: completedAgent,
|
|
1033
|
+
stepIndex: completedStepIndex,
|
|
1034
|
+
attemptId: finishedAttempt.attemptId,
|
|
1035
|
+
outcome: 'completed',
|
|
1036
|
+
};
|
|
1037
|
+
status.joinedSlots = completedSlots;
|
|
1038
|
+
appendMetric({ type: 'step_joined', at: now, stepIndex: completedStepIndex, slotKeys: [graphSlotKey(completedStepIndex, completedAgent)], attemptIds: [finishedAttempt.attemptId], source: 'hook', attributionConfidence: 'high' });
|
|
1039
|
+
}
|
|
774
1040
|
writeStatus({ parallelCompleted: done, parallelOutcomes: outcomes });
|
|
775
|
-
const remaining =
|
|
1041
|
+
const remaining = waveAgents.filter((agent) => !done.includes(agent));
|
|
776
1042
|
if (remaining.length > 0) {
|
|
777
1043
|
process.stdout.write('{}');
|
|
778
1044
|
process.exit(0);
|
|
779
1045
|
}
|
|
780
1046
|
|
|
781
|
-
const blockedProducer =
|
|
1047
|
+
const blockedProducer = waveAgents.find((agent) => outcomes[agent]?.outcome === 'blocked');
|
|
782
1048
|
if (blockedProducer) {
|
|
1049
|
+
if (isGraphMode()) {
|
|
1050
|
+
const blockedStepIndex = waveIndexes.find((i) => getStepAgents(steps[i]).includes(blockedProducer));
|
|
1051
|
+
status.blockedSteps = [...new Set([...(status.blockedSteps || []), blockedStepIndex])];
|
|
1052
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: blockedProducer, parallelCompleted: [], parallelOutcomes: {}, waveSteps: [], waveId: null });
|
|
1053
|
+
if (!dispatchReadyWave(`Step ${blockedStepIndex} (${blockedProducer}) is blocked; proceeding with independent ready steps.`)) out(blockedNotice(blockedStepIndex, blockedProducer));
|
|
1054
|
+
process.exit(0);
|
|
1055
|
+
}
|
|
783
1056
|
writeStatus({ parallelCompleted: [], parallelOutcomes: {}, state: 'blocked', phase: 'blocked', currentAgent: blockedProducer });
|
|
784
1057
|
process.stdout.write('{}');
|
|
785
1058
|
process.exit(0);
|
|
786
1059
|
}
|
|
787
1060
|
|
|
788
|
-
const retryReviewer =
|
|
1061
|
+
const retryReviewer = waveAgents.find((agent) => outcomes[agent]?.outcome === 'changes_requested');
|
|
789
1062
|
if (retryReviewer === 'mockup-reviewer') {
|
|
790
1063
|
beginHumanGate();
|
|
791
1064
|
writeStatus({
|
|
@@ -794,11 +1067,34 @@ if (currentStep?.parallel && stepAgents.length > 1) {
|
|
|
794
1067
|
currentAgent: 'mockup-reviewer',
|
|
795
1068
|
parallelCompleted: [],
|
|
796
1069
|
parallelOutcomes: {},
|
|
1070
|
+
waveSteps: [],
|
|
1071
|
+
waveId: null,
|
|
797
1072
|
});
|
|
798
1073
|
out(`Mockup review FAIL for slug "${slug}". Read mockup-review.md. Resume only via /task-continue. Do not retry feature-developer.`);
|
|
799
1074
|
process.exit(0);
|
|
800
1075
|
}
|
|
801
1076
|
if (retryReviewer) {
|
|
1077
|
+
if (isGraphMode()) {
|
|
1078
|
+
const reviewerStepIndex = waveIndexes.find((i) => getStepAgents(steps[i]).includes(retryReviewer));
|
|
1079
|
+
const producerIndex = resolveProducerStepIndex('feature-developer', reviewerStepIndex);
|
|
1080
|
+
if (producerIndex < 0) {
|
|
1081
|
+
beginHumanGate();
|
|
1082
|
+
writeStatus({ awaitingHumanGate: true, state: 'awaiting_approval', currentAgent: retryReviewer, parallelCompleted: [], parallelOutcomes: {}, waveSteps: [], waveId: null });
|
|
1083
|
+
out(`${retryReviewer} requested changes for slug "${slug}" but no graph ancestor authors fixes. Read the review artifact. Resume only via /task-continue.`);
|
|
1084
|
+
process.exit(0);
|
|
1085
|
+
}
|
|
1086
|
+
const graphPredecessor = outcomes[retryReviewer]
|
|
1087
|
+
? { attemptId: outcomes[retryReviewer].attemptId, confidence: outcomes[retryReviewer].confidence }
|
|
1088
|
+
: finishedAttempt;
|
|
1089
|
+
appendMetric({ type: 'retry_scheduled', at: now, attemptId: graphPredecessor?.attemptId || status.lastCompletedAttempt?.attemptId || null, nextAgent: 'feature-developer', retryAfterFix: retryReviewer, source: 'hook', attributionConfidence: graphPredecessor ? graphPredecessor.confidence : 'unknown' });
|
|
1090
|
+
invalidateFrom(producerIndex, reviewerStepIndex);
|
|
1091
|
+
const siblingOutcomes = { ...(status.parallelOutcomes || {}) };
|
|
1092
|
+
delete siblingOutcomes[retryReviewer];
|
|
1093
|
+
status.parallelOutcomes = siblingOutcomes;
|
|
1094
|
+
writeStatus({ state: 'in_progress', phase: 'executing', waveSteps: [], waveId: null, retryAfterFix: null, retryAfterFixStepIndex: null });
|
|
1095
|
+
if (!dispatchReadyWave(`Step ${reviewerStepIndex} (${retryReviewer}) requested changes; re-dispatching unsatisfied steps.`)) out(noProgressNotice());
|
|
1096
|
+
process.exit(0);
|
|
1097
|
+
}
|
|
802
1098
|
const retryAfterFixStepIndex = idx;
|
|
803
1099
|
const predecessor = outcomes[retryReviewer]
|
|
804
1100
|
? {
|
|
@@ -833,10 +1129,51 @@ if (currentStep?.parallel && stepAgents.length > 1) {
|
|
|
833
1129
|
process.exit(0);
|
|
834
1130
|
}
|
|
835
1131
|
|
|
1132
|
+
if (isGraphMode()) {
|
|
1133
|
+
const validationProducer = waveAgents.find((agent) => outcomes[agent]?.outcome === 'validation_failed');
|
|
1134
|
+
if (validationProducer) {
|
|
1135
|
+
const verifierStepIndex = waveIndexes.find((i) => getStepAgents(steps[i]).includes(validationProducer));
|
|
1136
|
+
const producerIndex = resolveProducerStepIndex('feature-developer', verifierStepIndex);
|
|
1137
|
+
if (producerIndex >= 0) {
|
|
1138
|
+
appendMetric({ type: 'retry_scheduled', at: now, attemptId: outcomes[validationProducer]?.attemptId || null, nextAgent: 'feature-developer', retryAfterFix: validationProducer, source: 'hook', attributionConfidence: 'fallback' });
|
|
1139
|
+
invalidateFrom(producerIndex, verifierStepIndex);
|
|
1140
|
+
writeStatus({ state: 'in_progress', phase: 'executing', parallelCompleted: [], parallelOutcomes: {}, waveSteps: [], waveId: null });
|
|
1141
|
+
if (dispatchReadyWave(`Step ${verifierStepIndex} (${validationProducer}) failed validation; re-dispatching unsatisfied steps.`)) process.exit(0);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
const gatedStep = waveIndexes.find((i) => hasGateAfterStep(steps[i], pipeline.humanGates));
|
|
1145
|
+
if (gatedStep !== undefined) {
|
|
1146
|
+
beginHumanGate();
|
|
1147
|
+
writeStatus({ awaitingHumanGate: true, state: 'awaiting_approval', currentAgent: completedAgent, pipelineIndex: gatedStep, parallelCompleted: [], parallelOutcomes: {}, waveSteps: [], waveId: null });
|
|
1148
|
+
process.stdout.write('{}');
|
|
1149
|
+
process.exit(0);
|
|
1150
|
+
}
|
|
1151
|
+
writeStatus({ parallelCompleted: [], parallelOutcomes: {}, waveSteps: [], waveId: null, state: 'completed' });
|
|
1152
|
+
if (dispatchReadyWave()) process.exit(0);
|
|
1153
|
+
if (Object.keys(status.activeAttempts || {}).length > 0) {
|
|
1154
|
+
process.stdout.write('{}');
|
|
1155
|
+
process.exit(0);
|
|
1156
|
+
}
|
|
1157
|
+
if (pendingStepIndexes().length === 0) {
|
|
1158
|
+
completeTaskMetrics();
|
|
1159
|
+
writeStatus({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
|
|
1160
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
1161
|
+
process.exit(0);
|
|
1162
|
+
}
|
|
1163
|
+
out(noProgressNotice());
|
|
1164
|
+
process.exit(0);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
836
1167
|
writeStatus({ parallelCompleted: [], parallelOutcomes: {}, state: 'completed' });
|
|
837
1168
|
}
|
|
838
1169
|
|
|
839
1170
|
if (status.state === 'blocked') {
|
|
1171
|
+
if (isGraphMode()) {
|
|
1172
|
+
status.blockedSteps = [...new Set([...(status.blockedSteps || []), idx])];
|
|
1173
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: completedAgent, waveSteps: [], waveId: null, parallelCompleted: [], parallelOutcomes: {} });
|
|
1174
|
+
if (!dispatchReadyWave(`Step ${idx} (${completedAgent}) is blocked; proceeding with independent ready steps.`)) out(blockedNotice(idx, completedAgent));
|
|
1175
|
+
process.exit(0);
|
|
1176
|
+
}
|
|
840
1177
|
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: completedAgent });
|
|
841
1178
|
process.stdout.write('{}');
|
|
842
1179
|
process.exit(0);
|
|
@@ -929,6 +1266,22 @@ if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
|
|
|
929
1266
|
process.exit(0);
|
|
930
1267
|
}
|
|
931
1268
|
|
|
1269
|
+
if (isGraphMode()) {
|
|
1270
|
+
if (Object.keys(status.activeAttempts || {}).length > 0) {
|
|
1271
|
+
process.stdout.write('{}');
|
|
1272
|
+
process.exit(0);
|
|
1273
|
+
}
|
|
1274
|
+
if (dispatchReadyWave()) process.exit(0);
|
|
1275
|
+
if (pendingStepIndexes().length === 0) {
|
|
1276
|
+
completeTaskMetrics();
|
|
1277
|
+
writeStatus({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
|
|
1278
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
1279
|
+
process.exit(0);
|
|
1280
|
+
}
|
|
1281
|
+
out(noProgressNotice());
|
|
1282
|
+
process.exit(0);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
932
1285
|
const next = findNextExecutableStep(steps, idx + 1, taskDir);
|
|
933
1286
|
if (!next) {
|
|
934
1287
|
completeTaskMetrics();
|
|
@@ -14,7 +14,7 @@ When the user message looks like a **work request** (implement, add, fix, refact
|
|
|
14
14
|
2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
|
|
15
15
|
3. Pure questions (“how does X work”, “explain”) — prefer agent **`codebase-analyzer`** (explain-as-is); trivial one-liners may be answered inline. Do not open `/task`.
|
|
16
16
|
4. A work request now runs the planning workflow — **goal frame → requirements → information-sufficiency → decompose** (dependency graph / epics); see **task-framing** and **plan-graph**.
|
|
17
|
-
5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file.
|
|
17
|
+
5. Every **work request** — with or without `/task`, and even when the user says “no pipeline” / “just do it” — persists the **verbatim** original prompt at `.ai.local/team/tasks/<slug>/prompt.md`. Prefer `/task` (its **Slug** step writes it). If handling inline without `/task`, first create the slug dir and write `prompt.md` (write-if-absent), then proceed. Pure questions and trivial one-liners are not work requests → no file. On an inline follow-up for an existing slug (no `/task`) where the user authors new text, append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; create on first append; exclude machine-generated and empty/argument-less invocations).
|
|
18
18
|
6. **Resolve the dialogue language before you speak to the user.** Read the `## Language` section of `.ai.local/conventions.md` (nearest `.ai.local` first); else infer from the prompt language; else English (mixed → dominant). Persist it once in the `prompt.md` header (`language: <BCP-47>`) + a `.memlog.md` `event:` line, and reuse it for the whole task. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
|
|
19
19
|
|
|
20
20
|
Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
|
|
@@ -159,6 +159,16 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
|
|
|
159
159
|
| `scope` | e.g. `unit-in-dev`, `e2e-only` |
|
|
160
160
|
| `model` | `cheap` \| `standard` \| `strong` — optional tier override |
|
|
161
161
|
|
|
162
|
+
## Parallel scheduling (graph mode)
|
|
163
|
+
|
|
164
|
+
`pipeline.json` may carry an optional step graph: `steps[].id`, `steps[].taskIds[]`, `steps[].dependsOn[]`, `steps[].writeScopes[]`. While no step declares `dependsOn`, the hook keeps the legacy linear advance; any occurrence switches it to graph mode.
|
|
165
|
+
|
|
166
|
+
- The hook recomputes the **ready queue** on every stop: steps whose `dependsOn` are satisfied, not yet satisfied, not in flight, not skipped, not blocked.
|
|
167
|
+
- The **wave** is the join unit; a single `parallel: true` step is a one-step wave. `status.joinedSlots` is the persistent satisfaction ledger; `status.waveSteps`/`waveId` name the in-flight wave; `status.blockedSteps` excludes a blocked step.
|
|
168
|
+
- Set `parallel: true` only for a set proven conflict-free (disjoint `writeScopes`, distinct agents and `artifactOutputIds`); never place `mockup-reviewer` in a parallel group.
|
|
169
|
+
- **No advance before reconciliation.** Invoke exactly the handoff's agent list (a wave in one turn, multiple Task calls) and do not start a next step from your own reasoning until the hook records the join.
|
|
170
|
+
- A retry re-dispatches only unsatisfied slots: a satisfied sibling keeps its entry and terminal metric and is never re-invoked.
|
|
171
|
+
|
|
162
172
|
## Rules (strict)
|
|
163
173
|
|
|
164
174
|
1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline).
|
|
@@ -170,7 +180,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
|
|
|
170
180
|
7. On `validation_failed`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
|
|
171
181
|
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
172
182
|
9. If `autoChain: false`, manual step only.
|
|
173
|
-
10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). Not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
|
|
183
|
+
10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). Not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
|
|
174
184
|
11. **Answer the user in the resolved dialogue language for the whole task.** Resolve once at task start
|
|
175
185
|
(`.ai.local` `## Language` → prompt language → English) and pass it to every step; `/task-continue` keeps
|
|
176
186
|
it. Never ask the user to pick a language. Development, reasoning, and artifacts stay English. See
|
|
@@ -179,6 +189,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
|
|
|
179
189
|
## Team artifact I/O
|
|
180
190
|
|
|
181
191
|
- **Persist the original prompt.** For **every** task — `/task` or a routed work request — write the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). The header is additive provenance only; the fenced text block holds the user's words unchanged. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact.
|
|
192
|
+
- **Append follow-up prompts.** When a user-authored prompt arrives for an active slug (new message, `/task-continue` args, gate feedback, clarification), append it verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` — `seq` = current max + 1, create on first append, never rewrite or duplicate an entry, never touch `prompt.md`. Exclude hook `followup_message` and empty/argument-less invocations. Not a manifest `artifacts[]` body — the path lives on the `routing` entry. See **agent-artifact-contracts** § Prompt log.
|
|
182
193
|
- **Answer in the resolved dialogue language.** Resolve once at task start (`.ai.local` `## Language` →
|
|
183
194
|
prompt language → English; mixed → dominant; nearest `.ai.local` wins) and reuse it for every user-facing
|
|
184
195
|
message and `/task-continue`. Record the tag in the `prompt.md` header (`language: <BCP-47>`) + a
|
|
@@ -17,6 +17,7 @@ Shared `/task` runtime for Cursor, Claude, Mavis, and OpenCode. Seeded at **`.ai
|
|
|
17
17
|
metrics.json # hook-owned append-only ledger
|
|
18
18
|
artifact-manifest.json # producer receipts
|
|
19
19
|
prompt.md # verbatim original ask + resolved `language: <BCP-47>` header (write-if-absent; write point = /task Slug bootstrap; path on the routing entry)
|
|
20
|
+
prompt-log.md # append-only ledger of subsequent user-authored prompts (orchestrator-written; created on first follow-up; path on the routing entry)
|
|
20
21
|
brief.md, decomposition.md, implementation.md, review.md, …
|
|
21
22
|
figma-contract.json # frozen Figma node map + per-node spec (writer: mockup-reviewer)
|
|
22
23
|
.memlog.md # optional agent notes (hook does not parse)
|
|
@@ -54,7 +55,7 @@ Bootstrap a slug by **writing** `pipeline.json` (editor Write tool). Do not `mkd
|
|
|
54
55
|
|
|
55
56
|
## status.json
|
|
56
57
|
|
|
57
|
-
Prefer `phase: executing`. States: `in_progress`, `completed`, `awaiting_approval` (`/task-continue`), `changes_requested`, `validation_failed`.
|
|
58
|
+
Prefer `phase: executing`. States: `in_progress`, `completed`, `awaiting_approval` (`/task-continue`), `changes_requested`, `validation_failed`, `blocked` (graph mode still dispatches independent ready steps), `awaiting_artifact_receipt`.
|
|
58
59
|
|
|
59
60
|
## Commands
|
|
60
61
|
|
|
@@ -84,6 +85,8 @@ Same JSON on Claude, Mavis, or OpenCode: `bash .<tool>/hooks/chain-team-phases.s
|
|
|
84
85
|
|
|
85
86
|
`pipeline.json` MAY carry these additive, **hook-ignored** fields (schema v1 ignores unknown fields; the hook never parses them): `epics[]` (staging + exit criteria), `planRevision` (current plan rev), `contextBudget` (budget / checkpoint note).
|
|
86
87
|
|
|
88
|
+
`pipeline.json` `steps[]` MAY also carry the optional **step graph**: `id`, `taskIds[]`, `dependsOn[]`, `writeScopes[]`. While no step declares `dependsOn`, the hook keeps the linear pass; any occurrence switches it to graph mode, where the hook computes the ready queue and dispatches each conflict-free wave (one turn, multiple Task calls). `writeScopes` is the declared write surface that proves conflict-freedom (see shared-core `agent-team/plan-graph.md` § Pipeline step graph / § Conflict model). The hook records satisfaction in `status.joinedSlots` and names the in-flight wave in `status.waveSteps` / `status.waveId`.
|
|
89
|
+
|
|
87
90
|
**Checkpoint / resume:** progress is checkpointed to `tasks/<slug>/.memlog.md` (`## <date>` + `event:` entries) and the `artifact-manifest.json` `implementation` entry (`authoritativePaths`). A resumed run reads both and continues at the first stage whose exit criteria are unmet.
|
|
88
91
|
|
|
89
92
|
**Self-review / re-anchor:** each producing agent records a `## Self-review` block in the artifact it owns (`brief.md` / `implementation.md` / `debug-report.md` / `validation-report.md` / `review.md`) and, on detected context loss / excess, a re-anchor line in `.memlog.md` — `event:` (no plan change) or `decision: replan rev N → N+1` (plan change). No hook/lifecycle field is added.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"id": "routing",
|
|
8
8
|
"producer": "task-router",
|
|
9
9
|
"status": "completed",
|
|
10
|
-
"authoritativePaths": ["pipeline.json", "prompt.md"],
|
|
10
|
+
"authoritativePaths": ["pipeline.json", "prompt.md", "prompt-log.md"],
|
|
11
11
|
"acceptanceCriteriaIds": [],
|
|
12
12
|
"taskIds": [],
|
|
13
13
|
"timestamps": {
|