@bonesofspring/ai-rules 0.2.44 → 0.2.46
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 +51 -1
- package/bin/lib/engine-scripts.js +6 -1
- package/docs/MAVIS.md +1 -1
- package/docs/OPENCODE.md +1 -1
- package/package.json +1 -1
- package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +10 -2
- package/presets/_shared/ai-local/scripts/manifest.mjs +406 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +23 -1
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +11 -2
- package/presets/_shared/core/review/code-review-mr.md +9 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +2 -2
- package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/claude/android-kotlin/agents/debugger.md +1 -1
- package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/claude/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/android-kotlin/team/README.md +17 -0
- package/presets/claude/go/agents/build-verifier.md +1 -1
- package/presets/claude/go/agents/code-reviewer.md +1 -1
- package/presets/claude/go/agents/debugger.md +1 -1
- package/presets/claude/go/agents/feature-developer.md +1 -1
- package/presets/claude/go/agents/qa-tester.md +1 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/go/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/go/team/README.md +17 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/claude/ios-swift/agents/debugger.md +1 -1
- package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
- package/presets/claude/ios-swift/agents/qa-tester.md +1 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/ios-swift/team/README.md +17 -0
- package/presets/claude/java/agents/build-verifier.md +1 -1
- package/presets/claude/java/agents/code-reviewer.md +1 -1
- package/presets/claude/java/agents/debugger.md +1 -1
- package/presets/claude/java/agents/feature-developer.md +1 -1
- package/presets/claude/java/agents/qa-tester.md +1 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/java/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/java/team/README.md +17 -0
- package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/mcp-ts/team/README.md +17 -0
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/agents/code-reviewer.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/qa-tester.md +1 -1
- package/presets/claude/next/agents/security-reviewer.md +5 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +9 -0
- package/presets/claude/next/team/README.md +17 -0
- package/presets/claude/nuxt/agents/build-verifier.md +1 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
- package/presets/claude/nuxt/agents/debugger.md +1 -1
- package/presets/claude/nuxt/agents/feature-developer.md +1 -1
- package/presets/claude/nuxt/agents/qa-tester.md +1 -1
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +9 -0
- package/presets/claude/nuxt/team/README.md +17 -0
- package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
- package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/claude/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/php-hexagonal/team/README.md +17 -0
- package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/claude/php-laravel/agents/debugger.md +1 -1
- package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
- package/presets/claude/php-laravel/agents/qa-tester.md +1 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +9 -0
- package/presets/claude/php-laravel/team/README.md +17 -0
- package/presets/claude/svelte/agents/build-verifier.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +1 -1
- package/presets/claude/svelte/agents/debugger.md +1 -1
- package/presets/claude/svelte/agents/feature-developer.md +1 -1
- package/presets/claude/svelte/agents/qa-tester.md +1 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +2 -2
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +11 -2
- package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +9 -0
- package/presets/claude/svelte/team/README.md +17 -0
- package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
- package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/cursor/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/android-kotlin/team/README.md +17 -0
- package/presets/cursor/go/agents/build-verifier.md +1 -1
- package/presets/cursor/go/agents/code-reviewer.md +1 -1
- package/presets/cursor/go/agents/debugger.md +1 -1
- package/presets/cursor/go/agents/feature-developer.md +1 -1
- package/presets/cursor/go/agents/qa-tester.md +1 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/go/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/go/team/README.md +17 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/cursor/ios-swift/agents/debugger.md +1 -1
- package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
- package/presets/cursor/ios-swift/agents/qa-tester.md +1 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/ios-swift/team/README.md +17 -0
- package/presets/cursor/java/agents/build-verifier.md +1 -1
- package/presets/cursor/java/agents/code-reviewer.md +1 -1
- package/presets/cursor/java/agents/debugger.md +1 -1
- package/presets/cursor/java/agents/feature-developer.md +1 -1
- package/presets/cursor/java/agents/qa-tester.md +1 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/java/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/java/team/README.md +17 -0
- package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/mcp-ts/team/README.md +17 -0
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/agents/code-reviewer.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/qa-tester.md +1 -1
- package/presets/cursor/next/agents/security-reviewer.md +5 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/next/team/README.md +17 -0
- package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
- package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
- package/presets/cursor/nuxt/agents/debugger.md +1 -1
- package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
- package/presets/cursor/nuxt/agents/qa-tester.md +1 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/nuxt/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/nuxt/team/README.md +17 -0
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/php-hexagonal/team/README.md +17 -0
- package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/cursor/php-laravel/agents/debugger.md +1 -1
- package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
- package/presets/cursor/php-laravel/agents/qa-tester.md +1 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/php-laravel/team/README.md +17 -0
- package/presets/cursor/svelte/agents/build-verifier.md +1 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
- package/presets/cursor/svelte/agents/debugger.md +1 -1
- package/presets/cursor/svelte/agents/feature-developer.md +1 -1
- package/presets/cursor/svelte/agents/qa-tester.md +1 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +2 -2
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/svelte/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/svelte/team/README.md +17 -0
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
- package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/mavis/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/android-kotlin/rules/code-review-mr.md +9 -0
- package/presets/mavis/android-kotlin/team/README.md +17 -0
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/agents/build-verifier.md +1 -1
- package/presets/mavis/go/agents/code-reviewer.md +1 -1
- package/presets/mavis/go/agents/debugger.md +1 -1
- package/presets/mavis/go/agents/feature-developer.md +1 -1
- package/presets/mavis/go/agents/qa-tester.md +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/go/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/go/rules/code-review-mr.md +9 -0
- package/presets/mavis/go/team/README.md +17 -0
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
- package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/mavis/ios-swift/agents/debugger.md +1 -1
- package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
- package/presets/mavis/ios-swift/agents/qa-tester.md +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/ios-swift/rules/code-review-mr.md +9 -0
- package/presets/mavis/ios-swift/team/README.md +17 -0
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/agents/build-verifier.md +1 -1
- package/presets/mavis/java/agents/code-reviewer.md +1 -1
- package/presets/mavis/java/agents/debugger.md +1 -1
- package/presets/mavis/java/agents/feature-developer.md +1 -1
- package/presets/mavis/java/agents/qa-tester.md +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/java/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/java/rules/code-review-mr.md +9 -0
- package/presets/mavis/java/team/README.md +17 -0
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/mcp-ts/rules/code-review-mr.md +9 -0
- package/presets/mavis/mcp-ts/team/README.md +17 -0
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/agents/build-verifier.md +1 -1
- package/presets/mavis/next/agents/code-reviewer.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/qa-tester.md +1 -1
- package/presets/mavis/next/agents/security-reviewer.md +5 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/next/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/next/rules/code-review-mr.md +9 -0
- package/presets/mavis/next/team/README.md +17 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
- package/presets/mavis/nuxt/agents/debugger.md +1 -1
- package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
- package/presets/mavis/nuxt/agents/qa-tester.md +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/nuxt/rules/code-review-mr.md +9 -0
- package/presets/mavis/nuxt/team/README.md +17 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
- package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/php-hexagonal/rules/code-review-mr.md +9 -0
- package/presets/mavis/php-hexagonal/team/README.md +17 -0
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
- package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/mavis/php-laravel/agents/debugger.md +1 -1
- package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
- package/presets/mavis/php-laravel/agents/qa-tester.md +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/php-laravel/rules/code-review-mr.md +9 -0
- package/presets/mavis/php-laravel/team/README.md +17 -0
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/agents/build-verifier.md +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
- package/presets/mavis/svelte/agents/debugger.md +1 -1
- package/presets/mavis/svelte/agents/feature-developer.md +1 -1
- package/presets/mavis/svelte/agents/qa-tester.md +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +2 -2
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +11 -2
- package/presets/mavis/svelte/rules/code-review-mr.md +9 -0
- package/presets/mavis/svelte/team/README.md +17 -0
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
- package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/android-kotlin/rules/code-review-mr.md +9 -0
- package/presets/opencode/android-kotlin/team/README.md +17 -0
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -1
- package/presets/opencode/go/agents/debugger.md +1 -1
- package/presets/opencode/go/agents/feature-developer.md +1 -1
- package/presets/opencode/go/agents/qa-tester.md +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/go/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/go/rules/code-review-mr.md +9 -0
- package/presets/opencode/go/team/README.md +17 -0
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/debugger.md +1 -1
- package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
- package/presets/opencode/ios-swift/agents/qa-tester.md +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/ios-swift/rules/code-review-mr.md +9 -0
- package/presets/opencode/ios-swift/team/README.md +17 -0
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -1
- package/presets/opencode/java/agents/debugger.md +1 -1
- package/presets/opencode/java/agents/feature-developer.md +1 -1
- package/presets/opencode/java/agents/qa-tester.md +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/java/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/java/rules/code-review-mr.md +9 -0
- package/presets/opencode/java/team/README.md +17 -0
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/mcp-ts/rules/code-review-mr.md +9 -0
- package/presets/opencode/mcp-ts/team/README.md +17 -0
- package/presets/opencode/next/adapter-map.json +1 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/code-reviewer.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/qa-tester.md +1 -1
- package/presets/opencode/next/agents/security-reviewer.md +5 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/next/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/next/rules/code-review-mr.md +9 -0
- package/presets/opencode/next/team/README.md +17 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/debugger.md +1 -1
- package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
- package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/nuxt/rules/code-review-mr.md +9 -0
- package/presets/opencode/nuxt/team/README.md +17 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
- package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/php-hexagonal/rules/code-review-mr.md +9 -0
- package/presets/opencode/php-hexagonal/team/README.md +17 -0
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/debugger.md +1 -1
- package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
- package/presets/opencode/php-laravel/agents/qa-tester.md +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/php-laravel/rules/code-review-mr.md +9 -0
- package/presets/opencode/php-laravel/team/README.md +17 -0
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/debugger.md +1 -1
- package/presets/opencode/svelte/agents/feature-developer.md +1 -1
- package/presets/opencode/svelte/agents/qa-tester.md +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +2 -2
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +11 -2
- package/presets/opencode/svelte/rules/code-review-mr.md +9 -0
- package/presets/opencode/svelte/team/README.md +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.2.46
|
|
4
|
+
|
|
5
|
+
### The manifest writer validates before it writes
|
|
6
|
+
|
|
7
|
+
- **Why.** A review of the 0.2.45 writer found four gaps: an unconditional `archive/` ban that contradicted the hook compacting a closed entry into `archive/<date>/`, path guards that only matched a leading `../`, `init` writing a skeleton outside `.manifest.lock`, and `--outcome blocked` landing as `status: "completed"`.
|
|
8
|
+
- **Paths.** `upsert` and `check` normalize each `authoritativePaths` entry before judging it, so `reports/../../x.md`, `./archive/x.md`, and `.` hit the same guards as `../x.md` and `archive/x.md`; `reports/../review.md` is stored as `review.md`. `archive/` is accepted only on a `completed` or `superseded` entry — the state the hook leaves after it relocates a closed body — so `check` is green again for an archived task.
|
|
9
|
+
- **Outcome → status.** An outcome now implies the artifact status (`completed` → `completed`; `blocked` / `changes_requested` / `validation_failed` → `blocked`), a contradictory `--status` is rejected with exit 1, and `check` reports a stored `status`/`receipt.outcome` mismatch instead of blessing it. A manifest written before this release may carry such a pair; `check` names the entry and the expected status.
|
|
10
|
+
- **Concurrency.** `init` takes the same `.manifest.lock` as `upsert` and re-checks existence after acquiring it, so entries a concurrent producer already wrote are never replaced by the empty skeleton.
|
|
11
|
+
- **Read safety.** A non-array `artifacts` (or a missing key) is a hard read error (exit 2) that leaves the file untouched: `check` cannot bless a corrupt file and a later `upsert` cannot drop its entries. An empty array belongs only to a new skeleton.
|
|
12
|
+
- **Gate.** `test-manifest-writer.mjs` gains path normalization, archive scope, outcome→status, stored-contradiction, and init/upsert race cases; `check:preset-structure` and `check-rule-eval.mjs` pass.
|
|
13
|
+
|
|
14
|
+
### Upgrade
|
|
15
|
+
|
|
16
|
+
- Run `npx @bonesofspring/ai-rules update`. Seeding the writer is skip-if-exists, so delete `.ai.local/scripts/manifest.mjs` first to take the hardened copy, then re-run `node .ai.local/scripts/manifest.mjs check --slug <slug>` on completed tasks.
|
|
17
|
+
|
|
18
|
+
## 0.2.45
|
|
19
|
+
|
|
20
|
+
### The manifest is a whole-file merge, not a fragment edit
|
|
21
|
+
|
|
22
|
+
- **Why.** Agents patched `artifact-manifest.json` with a reconstructed fragment. Any parallel producer write or refreshed `updatedAt` broke the match: the receipt aborted mid-task and the step stalled in `awaiting_artifact_receipt`.
|
|
23
|
+
- **Writer.** `init` seeds `.ai.local/scripts/manifest.mjs` (`init` / `upsert` / `get` / `check`). It merges by entry `id` under `.manifest.lock`, writes a temp file plus rename, rejects absolute, `..`, and repo-root `authoritativePaths`, and exits 2 without a write on invalid JSON. Direct invocation compares realpaths, so a symlinked or tmpdir checkout no longer no-ops silently.
|
|
24
|
+
- **Contract.** Shared core gains § Manifest write protocol; every `team/README.md` ships § artifact-manifest.json — write protocol; the receipt-binding callout in every owning-agent prompt names the writer and forbids a fragment/replace edit. Hook stall messages name the exact `manifest.mjs upsert` command instead of `Write the artifact and its receipt`.
|
|
25
|
+
- **Gate.** `check-manifest-write-protocol.mjs` plus `test-manifest-write-protocol.mjs` (five negative surfaces) and `test-manifest-writer.mjs` (merge, guards, parse safety, concurrent writers) run inside `check:preset-structure`.
|
|
26
|
+
|
|
27
|
+
### A fixable finding cannot hide behind "notes"
|
|
28
|
+
|
|
29
|
+
- **Why.** A review run filed a `medium` defect as `PASS_WITH_NOTES` / "approve with notes", emitted receipt `completed`, and the pipeline's existing retry never fired. The fix happened out of band: no attempt id, no `build-verifier` re-run, nothing in the run ledger.
|
|
30
|
+
- **Contract.** `code-review-mr` gains § Verdict and terminal receipt: any `blocker`/`important` (`high`/`medium`) finding emits `changes_requested`, which the orchestrator already routes as a developer retry. A notes-only verdict is reserved for `nit`/informational. A spec-vs-code divergence, and a wire contract that contradicts the repository's existing handler/decoder convention, are findings of that class.
|
|
31
|
+
- **Agents.** `security-reviewer` states the same mapping next to its verdict: `PASS_WITH_NOTES` is `low`-only, `medium` and above is `FAIL` + `changes_requested`.
|
|
32
|
+
|
|
33
|
+
### The efficacy oracle ignores non-task entries
|
|
34
|
+
|
|
35
|
+
- **Why.** A `.gitkeep` (or any plain file) in `.ai.local/team/tasks/` made `readAllTasks` read `<file>/metrics.json`, throw `ENOTDIR`, record a task error and downgrade every verdict to `insufficient-data (metrics parse error)` — so the self-learning verdict was permanently unusable in a repo that keeps a placeholder in the tasks folder.
|
|
36
|
+
- **Fix.** Non-directory entries are skipped before the ledger read, and `ENOTDIR` is treated like `ENOENT`. Real read failures still fail the verdict.
|
|
37
|
+
- **Gate.** `scripts/test-efficacy-oracle.mjs` pins the discovery contract (skipped file, skipped ledger-less task, surviving read error) and runs inside `check-preset-structure`.
|
|
38
|
+
|
|
39
|
+
### A producer outside the step graph is still a run artifact
|
|
40
|
+
|
|
41
|
+
- **Why.** A security finding and a review finding each led to a developer pass that existed only in chat: no attempt id, no `build-verifier` re-run, no ledger row. The receipt carried a hand-made label (`security-fix:attempt-1`) that no metrics reader can reconcile.
|
|
42
|
+
- **Contract.** `agent-team-orchestrator` gains § Out-of-band producer passes: one `.memlog.md` `event:` line (trigger, agent, files, gate re-run), its own manifest entry, no invented `attemptId`, and a re-run of the affected gate. The routed path — `changes_requested` re-dispatching the developer — stays the default.
|
|
43
|
+
|
|
44
|
+
### A closed receipt ticks its own plan rows
|
|
45
|
+
|
|
46
|
+
- **Why.** `tasks.md` boxes stayed open through the whole run and were ticked only at closure, so `openspec list` reported `0/24` while 24 tasks were done.
|
|
47
|
+
- **Contract.** `agent-artifact-contracts` § Completion receipts and the installed `team/README.md` write protocol require the producer to tick every row its receipt closes in the same turn.
|
|
48
|
+
|
|
49
|
+
### Upgrade
|
|
50
|
+
|
|
51
|
+
- `npx @bonesofspring/ai-rules update` seeds `.ai.local/scripts/manifest.mjs` and replaces `hooks/chain-team-phases.sh`, the managed rules, the agent prompts, and `team/README.md`, so the manifest writer, the named stall command, the verdict mapping, and the out-of-band pass rules land on re-init. Seeding is skip-if-exists, so delete an existing `.ai.local/scripts/manifest.mjs` to take the package copy.
|
|
52
|
+
|
|
53
|
+
## 0.2.44
|
|
4
54
|
|
|
5
55
|
### Dialogue language resolves on every user message
|
|
6
56
|
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The shipped
|
|
2
|
+
* The shipped `.ai.local/scripts/` set, declared once.
|
|
3
3
|
*
|
|
4
4
|
* `init` seeds exactly these files into a consumer's `.ai.local/scripts/`, and
|
|
5
5
|
* the monorepo dogfood copy is mirrored from the same source by
|
|
6
6
|
* `scripts/lib/engine-mirror.mjs`. An explicit list — never a glob — keeps the
|
|
7
7
|
* repo-local tooling (the `*.test.mjs` suites and `requirements-*.mjs`) out of
|
|
8
8
|
* the shipped set.
|
|
9
|
+
*
|
|
10
|
+
* `manifest.mjs` is the deterministic writer for
|
|
11
|
+
* `.ai.local/team/tasks/<slug>/artifact-manifest.json`; producers call it
|
|
12
|
+
* instead of patching the JSON, which is a whole-file merge target.
|
|
9
13
|
*/
|
|
10
14
|
const ENGINE_SCRIPTS = [
|
|
11
15
|
'run.mjs',
|
|
@@ -14,6 +18,7 @@ const ENGINE_SCRIPTS = [
|
|
|
14
18
|
'rule-improver.mjs',
|
|
15
19
|
'derive-gate-signals.mjs',
|
|
16
20
|
'efficacy-oracle.mjs',
|
|
21
|
+
'manifest.mjs',
|
|
17
22
|
];
|
|
18
23
|
|
|
19
24
|
/** Preset-root-relative directory holding the engine source of truth. */
|
package/docs/MAVIS.md
CHANGED
|
@@ -58,7 +58,7 @@ Parse `mcode exec --output-format json` as the `exec.result` wrapper (see [compa
|
|
|
58
58
|
File-based orchestration under `.ai.local/team/` mirrors Cursor/Claude:
|
|
59
59
|
|
|
60
60
|
1. Start work via the task procedure (`.mavis/commands/task.md`) or `task-router` agent.
|
|
61
|
-
2. Producers write artifacts and upsert `artifact-manifest.json`
|
|
61
|
+
2. Producers write artifacts and merge their receipt with `node .ai.local/scripts/manifest.mjs upsert …` (whole-file merge; never a fragment edit of `artifact-manifest.json`).
|
|
62
62
|
3. **Do not** mutate `status.json` / `metrics.json` lifecycle fields from agent prompts — the chain hook owns them.
|
|
63
63
|
4. After each producer receipt, run the chain runner:
|
|
64
64
|
|
package/docs/OPENCODE.md
CHANGED
|
@@ -69,7 +69,7 @@ Do not pin a model in this preset — use the operator’s OpenCode provider con
|
|
|
69
69
|
File-based orchestration under `.ai.local/team/` mirrors Cursor/Claude:
|
|
70
70
|
|
|
71
71
|
1. Start work with `/task` (`.opencode/commands/task.md`).
|
|
72
|
-
2. Producers write artifacts and upsert `artifact-manifest.json`
|
|
72
|
+
2. Producers write artifacts and merge their receipt with `node .ai.local/scripts/manifest.mjs upsert …` (whole-file merge; never a fragment edit of `artifact-manifest.json`).
|
|
73
73
|
3. **Do not** mutate `status.json` / `metrics.json` lifecycle fields from agent prompts — the chain runner owns them.
|
|
74
74
|
4. After each producer receipt, run:
|
|
75
75
|
|
package/package.json
CHANGED
|
@@ -381,14 +381,22 @@ export function readAllTasks(tasksDir) {
|
|
|
381
381
|
throw error;
|
|
382
382
|
}
|
|
383
383
|
for (const name of names) {
|
|
384
|
-
const
|
|
384
|
+
const taskPath = path.join(tasksDir, name);
|
|
385
|
+
// A plain file (`.gitkeep`, a stray note) is not a task directory: reading
|
|
386
|
+
// `<file>/metrics.json` throws ENOTDIR, which is not ENOENT and would fail
|
|
387
|
+
// the whole verdict with "metrics parse error".
|
|
388
|
+
let isDir = false;
|
|
389
|
+
try { isDir = fs.statSync(taskPath).isDirectory(); } catch { isDir = false; }
|
|
390
|
+
if (!isDir) continue;
|
|
391
|
+
|
|
392
|
+
const metricsPath = path.join(taskPath, 'metrics.json');
|
|
385
393
|
let raw;
|
|
386
394
|
try {
|
|
387
395
|
raw = fs.readFileSync(metricsPath, 'utf8');
|
|
388
396
|
} catch (error) {
|
|
389
397
|
// A task dir without metrics.json yet is normal (in-flight); any other
|
|
390
398
|
// read error is real and must fail the verdict, not shrink the cohort.
|
|
391
|
-
if (error && error.code === 'ENOENT') continue;
|
|
399
|
+
if (error && (error.code === 'ENOENT' || error.code === 'ENOTDIR')) continue;
|
|
392
400
|
errors.push({ task: name, reason: error instanceof Error ? error.message : String(error) });
|
|
393
401
|
continue;
|
|
394
402
|
}
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic writer for `.ai.local/team/tasks/<slug>/artifact-manifest.json`.
|
|
3
|
+
*
|
|
4
|
+
* The manifest is a whole-file merge target: producers rewrite it, so a
|
|
5
|
+
* substring/replace edit over a reconstructed JSON fragment fails as soon as a
|
|
6
|
+
* parallel producer writes or `updatedAt` moves. This CLI does read → merge by
|
|
7
|
+
* entry id → atomic write under the shared exclusive lock, which is the only
|
|
8
|
+
* supported write path for producers and the hook's stall hint.
|
|
9
|
+
*
|
|
10
|
+
* Commands:
|
|
11
|
+
* init --slug <slug> create the skeleton when absent
|
|
12
|
+
* upsert --slug <slug> --id <id> --producer <agent> … merge one owned entry + receipt
|
|
13
|
+
* get --slug <slug> --id <id> print one entry
|
|
14
|
+
* check --slug <slug> validate; exit 1 on schema problems, 2 on an unreadable file
|
|
15
|
+
*
|
|
16
|
+
* Exit codes: 0 ok, 1 usage/validation, 2 unreadable manifest (invalid JSON or a
|
|
17
|
+
* non-array `artifacts`); nothing is written on 2.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import fs from 'node:fs';
|
|
21
|
+
import path from 'node:path';
|
|
22
|
+
import { fileURLToPath } from 'node:url';
|
|
23
|
+
|
|
24
|
+
import { acquireLock, releaseLock } from './lock.mjs';
|
|
25
|
+
|
|
26
|
+
export const MANIFEST_FILE = 'artifact-manifest.json';
|
|
27
|
+
export const DEFAULT_TEAM_ROOT = path.join(process.cwd(), '.ai.local', 'team');
|
|
28
|
+
|
|
29
|
+
const ARTIFACT_STATUSES = ['planned', 'in_progress', 'completed', 'blocked', 'superseded'];
|
|
30
|
+
const TERMINAL_STATUSES = new Set(['completed', 'blocked', 'superseded']);
|
|
31
|
+
// The hook compacts a closed entry's body into `archive/<date>/` only for `completed`.
|
|
32
|
+
const ARCHIVABLE_STATUSES = new Set(['completed', 'superseded']);
|
|
33
|
+
const OUTCOMES = ['completed', 'blocked', 'changes_requested', 'validation_failed'];
|
|
34
|
+
// An outcome implies the artifact status: `blocked` and the two blocking review
|
|
35
|
+
// outcomes are non-advancing, so they land on `blocked` (agent-artifact-contracts).
|
|
36
|
+
// `superseded` stays a lifecycle override on top of any receipt.
|
|
37
|
+
const OUTCOME_STATUS = {
|
|
38
|
+
completed: 'completed',
|
|
39
|
+
blocked: 'blocked',
|
|
40
|
+
changes_requested: 'blocked',
|
|
41
|
+
validation_failed: 'blocked',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const USAGE = `usage:
|
|
45
|
+
manifest.mjs init --slug <slug> [--root <team-dir>]
|
|
46
|
+
manifest.mjs upsert --slug <slug> --id <id> --producer <agent> [--status <status>]
|
|
47
|
+
[--outcome <outcome>] [--summary "<text>"] [--paths a.md,b.md]
|
|
48
|
+
[--evidence c.md] [--acs AC-1,AC-2] [--tasks T1,T2]
|
|
49
|
+
[--attempt <attemptId>] [--root <team-dir>]
|
|
50
|
+
manifest.mjs get --slug <slug> --id <id> [--root <team-dir>]
|
|
51
|
+
manifest.mjs check --slug <slug> [--root <team-dir>]`;
|
|
52
|
+
|
|
53
|
+
const fail = (message, code = 1) => {
|
|
54
|
+
const error = new Error(message);
|
|
55
|
+
error.exitCode = code;
|
|
56
|
+
throw error;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
60
|
+
|
|
61
|
+
const describeShape = (value) => {
|
|
62
|
+
if (value === undefined) return 'no "artifacts" key';
|
|
63
|
+
if (value === null) return 'null';
|
|
64
|
+
if (Array.isArray(value)) return 'an array';
|
|
65
|
+
return `a ${typeof value}`;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const parseArgs = (argv) => {
|
|
69
|
+
const [command, ...rest] = argv;
|
|
70
|
+
const flags = {};
|
|
71
|
+
for (let index = 0; index < rest.length; index += 1) {
|
|
72
|
+
const token = rest[index];
|
|
73
|
+
if (!token.startsWith('--')) fail(`unexpected argument "${token}"`);
|
|
74
|
+
const [name, inline] = token.slice(2).split('=');
|
|
75
|
+
if (inline !== undefined) {
|
|
76
|
+
flags[name] = inline;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const next = rest[index + 1];
|
|
80
|
+
if (next === undefined || next.startsWith('--')) fail(`flag --${name} needs a value`);
|
|
81
|
+
flags[name] = next;
|
|
82
|
+
index += 1;
|
|
83
|
+
}
|
|
84
|
+
return { command, flags };
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const csv = (value) =>
|
|
88
|
+
(value || '')
|
|
89
|
+
.split(',')
|
|
90
|
+
.map((item) => item.trim())
|
|
91
|
+
.filter(Boolean);
|
|
92
|
+
|
|
93
|
+
export const manifestPath = (slug, teamRoot = DEFAULT_TEAM_ROOT) =>
|
|
94
|
+
path.join(teamRoot, 'tasks', slug, MANIFEST_FILE);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Task-directory-relative path guard; mirrors the hook's receipt rejection.
|
|
98
|
+
* `status` scopes the archive ban: the hook relocates a closed entry's body to
|
|
99
|
+
* `archive/<date>/` and rewrites that entry's `authoritativePaths`, so only an
|
|
100
|
+
* open entry is required to cite current files.
|
|
101
|
+
*/
|
|
102
|
+
export function assertAuthoritativePath(value, slug, status) {
|
|
103
|
+
if (typeof value !== 'string' || value.trim() === '') fail('authoritativePaths entries must be non-empty strings');
|
|
104
|
+
const candidate = value.trim();
|
|
105
|
+
if (path.isAbsolute(candidate)) {
|
|
106
|
+
fail(`authoritativePaths must be relative to the task directory, got absolute "${candidate}"`);
|
|
107
|
+
}
|
|
108
|
+
// Normalize before judging, or `reports/../../x.md` and `./archive/x.md` slip
|
|
109
|
+
// past the guards written for `../x.md` and `archive/x.md`.
|
|
110
|
+
const normalized = path.posix.normalize(candidate.split(path.sep).join('/'));
|
|
111
|
+
if (normalized === '.' || normalized === '') {
|
|
112
|
+
fail(`authoritativePaths must name a file inside the task directory, got "${candidate}"`);
|
|
113
|
+
}
|
|
114
|
+
if (normalized === '..' || normalized.startsWith('../')) {
|
|
115
|
+
fail(`authoritativePaths must stay inside the task directory, got "${candidate}"`);
|
|
116
|
+
}
|
|
117
|
+
if (normalized.startsWith('.ai.local/team/tasks/')) {
|
|
118
|
+
fail(
|
|
119
|
+
`authoritativePaths are task-relative ("brief.md"), got the repo-root form "${candidate}" — use evidencePaths for anything outside the task directory`,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
if ((normalized === 'archive' || normalized.startsWith('archive/')) && !ARCHIVABLE_STATUSES.has(status)) {
|
|
123
|
+
fail(
|
|
124
|
+
`authoritativePaths must point at current files, got archived "${candidate}" — only a completed or superseded entry may cite archive/`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
void slug;
|
|
128
|
+
return normalized;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const skeleton = (slug) => ({
|
|
132
|
+
schemaVersion: 1,
|
|
133
|
+
slug,
|
|
134
|
+
updatedAt: new Date().toISOString(),
|
|
135
|
+
artifacts: [],
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Read the manifest; `{ manifest, exists }`. Returns the file as parsed, without
|
|
140
|
+
* repairing it. Throws exitCode 2 on invalid JSON or a non-array `artifacts`, so a
|
|
141
|
+
* corrupt file can never be blessed by `check` and then rewritten by `upsert`.
|
|
142
|
+
* An empty `artifacts` array exists only in the skeleton for a new manifest.
|
|
143
|
+
*/
|
|
144
|
+
export function readManifest(slug, teamRoot = DEFAULT_TEAM_ROOT) {
|
|
145
|
+
const filePath = manifestPath(slug, teamRoot);
|
|
146
|
+
if (!fs.existsSync(filePath)) return { manifest: skeleton(slug), exists: false, filePath };
|
|
147
|
+
const raw = fs.readFileSync(filePath, 'utf8');
|
|
148
|
+
let parsed;
|
|
149
|
+
try {
|
|
150
|
+
parsed = JSON.parse(raw);
|
|
151
|
+
} catch (error) {
|
|
152
|
+
fail(
|
|
153
|
+
`${filePath}: invalid JSON (${error.message}). Re-read the file and repair it before retrying; nothing was written.`,
|
|
154
|
+
2,
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
if (!isRecord(parsed)) fail(`${filePath}: top level must be an object`, 2);
|
|
158
|
+
if (parsed.entries !== undefined) {
|
|
159
|
+
process.stderr.write(
|
|
160
|
+
`WARNING: ${filePath} has a top-level "entries" key; the schema reads only "artifacts". ` +
|
|
161
|
+
'Re-run the merge with this writer to drop the stray key.\n',
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
if (!Array.isArray(parsed.artifacts)) {
|
|
165
|
+
fail(
|
|
166
|
+
`${filePath}: "artifacts" must be an array, got ${describeShape(parsed.artifacts)}. ` +
|
|
167
|
+
'Repair the file by hand (merge the artifact entries into the array) and retry; nothing was written.',
|
|
168
|
+
2,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return { manifest: parsed, exists: true, filePath };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Atomic whole-file write: temp file in the same directory, then rename. */
|
|
175
|
+
export function writeManifestSync(filePath, manifest) {
|
|
176
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
177
|
+
const temporary = `${filePath}.${process.pid}.tmp`;
|
|
178
|
+
fs.writeFileSync(temporary, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
|
|
179
|
+
fs.renameSync(temporary, filePath);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function mergeEntry(manifest, entry) {
|
|
183
|
+
const index = manifest.artifacts.findIndex((item) => isRecord(item) && item.id === entry.id);
|
|
184
|
+
const previous = index >= 0 ? manifest.artifacts[index] : null;
|
|
185
|
+
const now = new Date().toISOString();
|
|
186
|
+
const timestamps = {
|
|
187
|
+
...(isRecord(previous?.timestamps) ? previous.timestamps : {}),
|
|
188
|
+
createdAt: previous?.timestamps?.createdAt || now,
|
|
189
|
+
updatedAt: now,
|
|
190
|
+
};
|
|
191
|
+
if (TERMINAL_STATUSES.has(entry.status)) timestamps.completedAt = now;
|
|
192
|
+
const merged = {
|
|
193
|
+
...(previous || {}),
|
|
194
|
+
...entry,
|
|
195
|
+
timestamps,
|
|
196
|
+
};
|
|
197
|
+
if (index >= 0) manifest.artifacts[index] = merged;
|
|
198
|
+
else manifest.artifacts.push(merged);
|
|
199
|
+
return merged;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Merge one owned entry into the manifest. Exported for fixtures; the CLI is
|
|
204
|
+
* the supported entry point.
|
|
205
|
+
*/
|
|
206
|
+
export function upsertManifestEntry({ slug, entry, teamRoot = DEFAULT_TEAM_ROOT }) {
|
|
207
|
+
const { manifest, filePath } = readManifest(slug, teamRoot);
|
|
208
|
+
delete manifest.entries;
|
|
209
|
+
manifest.schemaVersion = manifest.schemaVersion || 1;
|
|
210
|
+
manifest.slug = manifest.slug || slug;
|
|
211
|
+
const merged = mergeEntry(manifest, entry);
|
|
212
|
+
manifest.updatedAt = new Date().toISOString();
|
|
213
|
+
writeManifestSync(filePath, manifest);
|
|
214
|
+
return { filePath, entry: merged };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const buildEntry = (flags, slug) => {
|
|
218
|
+
const id = flags.id;
|
|
219
|
+
const producer = flags.producer;
|
|
220
|
+
if (!id) fail('--id is required');
|
|
221
|
+
if (!producer) fail('--producer is required');
|
|
222
|
+
const outcome = flags.outcome;
|
|
223
|
+
if (outcome && !OUTCOMES.includes(outcome)) fail(`--outcome must be one of ${OUTCOMES.join(' | ')}`);
|
|
224
|
+
const impliedStatus = outcome ? OUTCOME_STATUS[outcome] : null;
|
|
225
|
+
const status = flags.status || impliedStatus || 'in_progress';
|
|
226
|
+
if (!ARTIFACT_STATUSES.includes(status)) fail(`--status must be one of ${ARTIFACT_STATUSES.join(' | ')}`);
|
|
227
|
+
if (impliedStatus && status !== impliedStatus && status !== 'superseded') {
|
|
228
|
+
fail(`--status ${status} contradicts --outcome ${outcome}; use --status ${impliedStatus} (superseded is also allowed)`);
|
|
229
|
+
}
|
|
230
|
+
if (TERMINAL_STATUSES.has(status) && !outcome) fail(`--outcome is required when --status is ${status}`);
|
|
231
|
+
const authoritativePaths = csv(flags.paths).map((value) => assertAuthoritativePath(value, slug, status));
|
|
232
|
+
if (authoritativePaths.length === 0) fail('--paths is required (comma-separated task-relative paths)');
|
|
233
|
+
const entry = {
|
|
234
|
+
id,
|
|
235
|
+
producer,
|
|
236
|
+
status,
|
|
237
|
+
authoritativePaths,
|
|
238
|
+
acceptanceCriteriaIds: csv(flags.acs),
|
|
239
|
+
taskIds: csv(flags.tasks),
|
|
240
|
+
};
|
|
241
|
+
if (outcome) {
|
|
242
|
+
entry.receipt = {
|
|
243
|
+
outcome,
|
|
244
|
+
summary: flags.summary || `${producer} ${outcome} (${id})`,
|
|
245
|
+
evidencePaths: csv(flags.evidence).length > 0 ? csv(flags.evidence) : authoritativePaths,
|
|
246
|
+
};
|
|
247
|
+
if (flags.attempt) entry.receipt.attemptId = flags.attempt;
|
|
248
|
+
if (flags.claim) entry.receipt.claim = flags.claim;
|
|
249
|
+
if (flags['context-files']) entry.receipt.contextFiles = csv(flags['context-files']);
|
|
250
|
+
}
|
|
251
|
+
return entry;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/** Schema check used by `check` and by fixtures. Returns a list of problem strings. */
|
|
255
|
+
export function validateManifest(manifest, slug) {
|
|
256
|
+
const problems = [];
|
|
257
|
+
if (!isRecord(manifest)) return ['top level must be an object'];
|
|
258
|
+
if (manifest.schemaVersion !== 1) problems.push('schemaVersion must be 1');
|
|
259
|
+
if (manifest.slug !== slug) problems.push(`slug must match the task directory ("${slug}")`);
|
|
260
|
+
if (typeof manifest.updatedAt !== 'string' || Number.isNaN(Date.parse(manifest.updatedAt))) {
|
|
261
|
+
problems.push('updatedAt must be an ISO 8601 timestamp');
|
|
262
|
+
}
|
|
263
|
+
// readManifest already rejects a non-array file; keep the contract check for direct callers.
|
|
264
|
+
if (!Array.isArray(manifest.artifacts)) return [...problems, 'artifacts must be an array'];
|
|
265
|
+
if (manifest.entries !== undefined) problems.push('top-level "entries" is not part of the schema; merge into "artifacts"');
|
|
266
|
+
const seen = new Set();
|
|
267
|
+
manifest.artifacts.forEach((entry, index) => {
|
|
268
|
+
const at = `artifacts[${index}]`;
|
|
269
|
+
if (!isRecord(entry)) {
|
|
270
|
+
problems.push(`${at} must be an object`);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (typeof entry.id !== 'string' || entry.id === '') problems.push(`${at}.id is required`);
|
|
274
|
+
else if (seen.has(entry.id)) problems.push(`${at}.id "${entry.id}" is duplicated`);
|
|
275
|
+
else seen.add(entry.id);
|
|
276
|
+
if (typeof entry.producer !== 'string' || entry.producer === '') problems.push(`${at}.producer is required`);
|
|
277
|
+
if (!ARTIFACT_STATUSES.includes(entry.status)) problems.push(`${at}.status must be one of ${ARTIFACT_STATUSES.join(' | ')}`);
|
|
278
|
+
if (!Array.isArray(entry.authoritativePaths) || entry.authoritativePaths.length === 0) {
|
|
279
|
+
problems.push(`${at}.authoritativePaths must be a non-empty array`);
|
|
280
|
+
} else {
|
|
281
|
+
for (const value of entry.authoritativePaths) {
|
|
282
|
+
try {
|
|
283
|
+
assertAuthoritativePath(value, slug, entry.status);
|
|
284
|
+
} catch (error) {
|
|
285
|
+
problems.push(`${at}.authoritativePaths: ${error.message}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
for (const key of ['acceptanceCriteriaIds', 'taskIds']) {
|
|
290
|
+
if (!Array.isArray(entry[key])) problems.push(`${at}.${key} must be an array (may be empty)`);
|
|
291
|
+
}
|
|
292
|
+
if (!isRecord(entry.timestamps) || typeof entry.timestamps.updatedAt !== 'string') {
|
|
293
|
+
problems.push(`${at}.timestamps.updatedAt is required`);
|
|
294
|
+
}
|
|
295
|
+
if (TERMINAL_STATUSES.has(entry.status)) {
|
|
296
|
+
if (!isRecord(entry.receipt) || !OUTCOMES.includes(entry.receipt.outcome)) {
|
|
297
|
+
problems.push(`${at}.receipt.outcome is required when status is ${entry.status}`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (
|
|
301
|
+
isRecord(entry.receipt) &&
|
|
302
|
+
OUTCOMES.includes(entry.receipt.outcome) &&
|
|
303
|
+
ARTIFACT_STATUSES.includes(entry.status) &&
|
|
304
|
+
entry.status !== OUTCOME_STATUS[entry.receipt.outcome] &&
|
|
305
|
+
entry.status !== 'superseded'
|
|
306
|
+
) {
|
|
307
|
+
problems.push(
|
|
308
|
+
`${at}.status "${entry.status}" contradicts receipt.outcome "${entry.receipt.outcome}"; expected "${OUTCOME_STATUS[entry.receipt.outcome]}"`,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
return problems;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export function runCli(argv) {
|
|
316
|
+
const { command, flags } = parseArgs(argv);
|
|
317
|
+
if (!command || command === '--help' || command === 'help') {
|
|
318
|
+
process.stdout.write(`${USAGE}\n`);
|
|
319
|
+
return 0;
|
|
320
|
+
}
|
|
321
|
+
const slug = flags.slug;
|
|
322
|
+
if (!slug) fail('--slug is required');
|
|
323
|
+
const teamRoot = flags.root ? path.resolve(flags.root) : DEFAULT_TEAM_ROOT;
|
|
324
|
+
const taskDir = path.join(teamRoot, 'tasks', slug);
|
|
325
|
+
|
|
326
|
+
if (command === 'init') {
|
|
327
|
+
const filePath = manifestPath(slug, teamRoot);
|
|
328
|
+
fs.mkdirSync(taskDir, { recursive: true });
|
|
329
|
+
// Same lock as `upsert`, plus a re-check under it: a concurrent producer that
|
|
330
|
+
// wrote entries first must not be replaced by the empty skeleton.
|
|
331
|
+
const lockPath = path.join(taskDir, '.manifest.lock');
|
|
332
|
+
const token = acquireLock(lockPath, { timeoutMs: 5000 });
|
|
333
|
+
let created = false;
|
|
334
|
+
try {
|
|
335
|
+
if (!fs.existsSync(filePath)) {
|
|
336
|
+
writeManifestSync(filePath, skeleton(slug));
|
|
337
|
+
created = true;
|
|
338
|
+
}
|
|
339
|
+
} finally {
|
|
340
|
+
releaseLock(lockPath, token);
|
|
341
|
+
}
|
|
342
|
+
process.stdout.write(created ? `${filePath} created\n` : `${filePath} already exists; left untouched\n`);
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (command === 'get') {
|
|
347
|
+
if (!flags.id) fail('--id is required');
|
|
348
|
+
const { manifest } = readManifest(slug, teamRoot);
|
|
349
|
+
const entry = manifest.artifacts.find((item) => isRecord(item) && item.id === flags.id);
|
|
350
|
+
if (!entry) fail(`no artifact entry with id "${flags.id}" in ${manifestPath(slug, teamRoot)}`, 2);
|
|
351
|
+
process.stdout.write(`${JSON.stringify(entry, null, 2)}\n`);
|
|
352
|
+
return 0;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (command === 'check') {
|
|
356
|
+
const { manifest, filePath, exists } = readManifest(slug, teamRoot);
|
|
357
|
+
if (!exists) fail(`${filePath} does not exist; run "manifest.mjs init --slug ${slug}" first`);
|
|
358
|
+
const problems = validateManifest(manifest, slug);
|
|
359
|
+
if (problems.length > 0) {
|
|
360
|
+
for (const problem of problems) process.stdout.write(`${filePath}: ${problem}\n`);
|
|
361
|
+
return 1;
|
|
362
|
+
}
|
|
363
|
+
process.stdout.write(`${filePath}: ok (${manifest.artifacts.length} entries)\n`);
|
|
364
|
+
return 0;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if (command === 'upsert') {
|
|
368
|
+
const entry = buildEntry(flags, slug);
|
|
369
|
+
fs.mkdirSync(taskDir, { recursive: true });
|
|
370
|
+
const lockPath = path.join(taskDir, '.manifest.lock');
|
|
371
|
+
const token = acquireLock(lockPath, { timeoutMs: 5000 });
|
|
372
|
+
let result;
|
|
373
|
+
try {
|
|
374
|
+
result = upsertManifestEntry({ slug, entry, teamRoot });
|
|
375
|
+
} finally {
|
|
376
|
+
releaseLock(lockPath, token);
|
|
377
|
+
}
|
|
378
|
+
process.stdout.write(
|
|
379
|
+
`${result.filePath}: ${result.entry.id} → ${result.entry.status}` +
|
|
380
|
+
`${result.entry.receipt ? ` (${result.entry.receipt.outcome})` : ''}\n`,
|
|
381
|
+
);
|
|
382
|
+
return 0;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
fail(`unknown command "${command}"\n${USAGE}`);
|
|
386
|
+
return 1;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const invokedDirectly = (() => {
|
|
390
|
+
if (!process.argv[1]) return false;
|
|
391
|
+
try {
|
|
392
|
+
// Compare realpaths: a tmpdir / symlinked checkout path would otherwise
|
|
393
|
+
// skip the CLI silently while still exiting 0.
|
|
394
|
+
return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
|
|
395
|
+
} catch {
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
})();
|
|
399
|
+
if (invokedDirectly) {
|
|
400
|
+
try {
|
|
401
|
+
process.exitCode = runCli(process.argv.slice(2));
|
|
402
|
+
} catch (error) {
|
|
403
|
+
process.stderr.write(`${error.message}\n`);
|
|
404
|
+
process.exitCode = error.exitCode || 1;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
@@ -75,12 +75,15 @@ A producer finishes its step by upserting only its owned artifact entry and term
|
|
|
75
75
|
- `evidencePaths`: authoritative files that support the outcome
|
|
76
76
|
- `authoritativePaths`: paths relative to the task directory (`brief.md`). A repo-root path (`.ai.local/team/tasks/<slug>/brief.md`) resolves outside that directory and the hook rejects the receipt.
|
|
77
77
|
|
|
78
|
-
`changes_requested` and `validation_failed` use artifact `status: "blocked"` while retaining their distinct receipt outcome. A later successful attempt updates the same owned entry to `completed`; timestamps and evidence must reflect the latest result. Do not infer success from a Markdown filename alone.
|
|
78
|
+
`changes_requested` and `validation_failed` use artifact `status: "blocked"` while retaining their distinct receipt outcome; `outcome: "blocked"` maps to `status: "blocked"` too. A later successful attempt updates the same owned entry to `completed`; timestamps and evidence must reflect the latest result. Do not infer success from a Markdown filename alone.
|
|
79
79
|
|
|
80
80
|
`blocked` is terminal for the producer attempt but non-advancing for the pipeline: the hook persists `status.state` / `phase` as `blocked` and emits no next-agent handoff. A receipt must either carry the active `attemptId` or belong to the step's assigned output entry. Its terminal timestamp must be at or after the active attempt's `startedAt`; otherwise the hook keeps the attempt active in `awaiting_artifact_receipt` and does not advance or retry.
|
|
81
81
|
|
|
82
82
|
> **Receipt binding (owner prompts).** Each owning-agent prompt (`feature-developer`, `build-verifier`, `code-reviewer`, `debugger`, `qa-tester` across `cursor/` and `claude/` platforms × 10 stacks) carries the same one-paragraph callout under `## On completion` (or appended as `## Receipt binding` when no `On completion` section exists). When writing the terminal receipt, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>`. The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls.
|
|
83
83
|
|
|
84
|
+
> **Plan closure is part of the receipt.** When the change carries `openspec/changes/<id>/tasks.md`, the producing agent ticks (`- [ ]` → `- [x]`) every row it closed in the same turn as the receipt. A closed receipt with unticked rows makes `openspec list` report stale progress and hides the real exit criteria from the next agent; the owner reconciles it before the next handoff and names the gap when it cannot.
|
|
85
|
+
|
|
86
|
+
|
|
84
87
|
## Ownership and writes
|
|
85
88
|
|
|
86
89
|
- Agents own their output artifacts and their items in `manifest.artifacts[]` (with their receipts). They merge by stable `id` and preserve all foreign items.
|
|
@@ -91,6 +94,25 @@ A producer finishes its step by upserting only its owned artifact entry and term
|
|
|
91
94
|
- Parallel producers need distinct entry IDs. Their parent/orchestrator serializes manifest merges; agents must not use the shared manifest as a concurrency lock.
|
|
92
95
|
- Re-dispatch after a retry is **slot-filtered**: only unsatisfied `(stepIndex, agent)` slots are re-invoked. A satisfied sibling keeps its entry and its terminal metric and is never re-run; the hook resolves the producer through the step graph when one exists.
|
|
93
96
|
|
|
97
|
+
## Manifest write protocol
|
|
98
|
+
|
|
99
|
+
The manifest is a **whole-file merge target**, never a substring patch. Producers rewrite it while other producers rewrite it, and every write refreshes root `updatedAt`, so a reconstructed fragment stops matching.
|
|
100
|
+
|
|
101
|
+
1. Read the file; when it is absent create the skeleton `{ "schemaVersion": 1, "slug": "<slug>", "updatedAt": "<iso>", "artifacts": [] }`. The hook seeds the same skeleton when a receipt is missing (`chain-team-phases.sh` › `readBoundReceiptOutcome`).
|
|
102
|
+
2. Merge by stable `entry.id` **in memory**: replace the owned entry, keep every foreign item and every unknown field you do not own, then refresh root `updatedAt`.
|
|
103
|
+
3. Write the whole file atomically (temp file in the task directory, then rename). Read → merge → write in one process call; never carry a snapshot across steps or turns.
|
|
104
|
+
4. Use the shipped writer (`init` seeds it at `.ai.local/scripts/manifest.mjs`):
|
|
105
|
+
```bash
|
|
106
|
+
node .ai.local/scripts/manifest.mjs upsert --slug <slug> --id <id> --producer <agent> \
|
|
107
|
+
--status completed --outcome completed --paths brief.md,decomposition.md \
|
|
108
|
+
--acs AC-1 --tasks T1 --attempt <attemptId>
|
|
109
|
+
node .ai.local/scripts/manifest.mjs check --slug <slug>
|
|
110
|
+
```
|
|
111
|
+
It normalizes each path before judging it, so `reports/../../x.md` and `./archive/x.md` hit the same guards as `../x.md` and `archive/x.md`; it rejects absolute paths, `..` escapes, and repo-root `authoritativePaths`, and it drops a stray top-level `entries` key. `archive/` is accepted only on a `completed` or `superseded` entry, because the hook relocates a closed body there and rewrites that entry's paths. An outcome implies the status (`completed` → `completed`; `blocked` / `changes_requested` / `validation_failed` → `blocked`); a contradictory `--status` is rejected and `check` reports a stored mismatch. `init` takes the same `.manifest.lock` and re-checks existence after acquiring it, so it never replaces entries a concurrent `upsert` already wrote. A non-array `artifacts` (or a missing key) is a hard read error (exit 2) that leaves the file untouched: repair the file by hand — an empty array belongs only to a new skeleton.
|
|
112
|
+
5. Never patch the JSON with a fragment/replace edit (`edit`, `str_replace`, `apply_patch`). A single-byte mismatch aborts the receipt mid-task, leaves the manifest out of sync with the produced artifact, and stalls the step in `awaiting_artifact_receipt`.
|
|
113
|
+
6. A failed merge or parse is a retry signal, not a guess signal: re-read, merge again, at most twice, then report `blocked` with the parse/merge error. Never leave the file truncated or half-written.
|
|
114
|
+
7. Parallel wave: the writer holds `.manifest.lock` in the task directory, so concurrent producers serialize. A hand-written merge must take the same lock. Entry `id` uniqueness stays the only shared invariant — the manifest is not a coordination lock.
|
|
115
|
+
|
|
94
116
|
## Figma contract artifact
|
|
95
117
|
|
|
96
118
|
A UI task with a Figma mockup persists a machine-readable **Figma contract** alongside the human review:
|
|
@@ -123,12 +123,21 @@ Each slug has one `artifact-manifest.json` at `.ai.local/team/tasks/<slug>/`. Th
|
|
|
123
123
|
|
|
124
124
|
- Read the manifest before broad prior-artifact discovery. Each step receives authoritative input entry IDs, owns named output entry IDs, and finishes with one terminal receipt linked to AC/task IDs.
|
|
125
125
|
- Markdown remains detailed evidence; the manifest points to authoritative paths and records producer, status, timestamps, outcome, and evidence paths.
|
|
126
|
-
- Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs; the parent/
|
|
126
|
+
- Agents upsert only the items they own in `manifest.artifacts[]` and preserve all foreign items in that array. Parallel agents use distinct IDs. Every write is a whole-file merge through `node .ai.local/scripts/manifest.mjs upsert …` under `.manifest.lock` (see the installed `team/README.md` § artifact-manifest.json — write protocol); the parent does not need to serialize merges, and a fragment/replace edit of the JSON is forbidden. The top-level array key is `artifacts` — not `entries`; see `agent-artifact-contracts.md` for the schema callout.
|
|
127
127
|
- The orchestration runtime/hook is the single writer for `status.json` lifecycle fields and `metrics.json`. Agents read status for eligibility but never rewrite unrelated state, gate, retry, attempt, timestamp, or metrics fields.
|
|
128
128
|
- Missing/stale manifests are reported as a handoff gap; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` rather than inventing authority.
|
|
129
129
|
|
|
130
|
-
##
|
|
130
|
+
## Out-of-band producer passes
|
|
131
|
+
|
|
132
|
+
A producer invoked outside `pipeline.json.steps` — a remediation pass after a reviewer finding, a manual fix, a re-run of one agent — is still a run artifact, not an informal turn.
|
|
131
133
|
|
|
134
|
+
- Record it as one `event:` line in `.memlog.md`: the trigger, the agent, the files touched, and the gate that was re-run.
|
|
135
|
+
- Upsert its receipt into `artifact-manifest.json` as its own owned entry, never folded into the previous step's entry, with `outcome` and `evidencePaths`.
|
|
136
|
+
- Do not invent an `attemptId` for it. An id the hook did not allocate cannot be reconciled by the metrics ledger; leave the receipt unbound and let the `.memlog.md` line carry the provenance.
|
|
137
|
+
- Re-run the affected gate (the step's `build-verifier` or the owned check) after the pass. An unverified pass is not a delivery.
|
|
138
|
+
- Prefer the routed path: a `changes_requested` receipt already re-dispatches the developer and keeps the ledger intact. Out-of-band work is the fallback, used when the finding arrives after the gate or comes from a human.
|
|
139
|
+
|
|
140
|
+
## Plan revision (replanning)
|
|
132
141
|
Replanning is a **named, auditable operation** — never a silent reorder. Trigger it when an evaluation oracle fails twice on the same task, when scope or requirements change, or when a previously unknown dependency/consumer is discovered. Procedure: append `decision: replan rev N → N+1` (with the reason) to `.memlog.md`, update `decomposition.md` (task add/remove or dependency change) and any optional plan fields, then **re-run the affected gate**. Scope-changing revisions return to the human gate.
|
|
133
142
|
|
|
134
143
|
## Context budget & checkpoint/resume
|
|
@@ -36,3 +36,12 @@ Procedure details live in skill `code-review`. Required shape:
|
|
|
36
36
|
- Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
37
37
|
- Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
|
|
38
38
|
- End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
|
|
39
|
+
|
|
40
|
+
## Verdict and terminal receipt
|
|
41
|
+
|
|
42
|
+
The verdict and the receipt are the same decision expressed twice — never let a fixable defect hide behind "notes".
|
|
43
|
+
|
|
44
|
+
- Any `blocker` or `important` finding (a scale that names `high`/`medium` maps them here) means the MR is **not** mergeable as-is: emit receipt outcome `changes_requested` so the orchestrator runs its existing developer retry, not `completed`.
|
|
45
|
+
- Reserve a notes-only verdict for `nit`/informational items. Reporting a non-cosmetic fixable defect as a note converts it into unplanned out-of-band work and leaves it unrecorded in the run ledger.
|
|
46
|
+
- A divergence between the frozen spec/design and the shipped code is a finding, never a note: cite the spec line and the code line in the same finding.
|
|
47
|
+
- Before freezing a wire contract, confirm the stated behaviour against the repository's existing handler/decoder convention; a spec that contradicts the codebase convention is the same finding class.
|
|
@@ -724,9 +724,9 @@ function readBoundReceiptOutcome(agent, step, resolved) {
|
|
|
724
724
|
const seeded = writeSkeletonManifest(manifestPath);
|
|
725
725
|
const stepIndex = typeof resolved.entry.stepIndex === 'number' ? resolved.entry.stepIndex : 0;
|
|
726
726
|
if (seeded) {
|
|
727
|
-
return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: artifact-manifest.json is missing and the skeleton could not be written (${seeded}). Create .ai.local/
|
|
727
|
+
return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: artifact-manifest.json is missing and the skeleton could not be written (${seeded}). Create it with "node .ai.local/scripts/manifest.mjs init --slug ${slug}", then merge the receipt for artifactOutputId "${expectedOutputId}" with "node .ai.local/scripts/manifest.mjs upsert --slug ${slug} --id ${expectedOutputId} --producer ${agent} --outcome completed --paths <artifact>.md" (whole-file merge; never patch the JSON), then resume with: /task-continue ${slug}` };
|
|
728
728
|
}
|
|
729
|
-
return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: no artifact-manifest.json for step ${stepIndex} (${agent}). Wrote a skeleton {schemaVersion:1, slug, artifacts:[]}. Expected artifactOutputId "${expectedOutputId}". Write the artifact
|
|
729
|
+
return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: no artifact-manifest.json for step ${stepIndex} (${agent}). Wrote a skeleton {schemaVersion:1, slug, artifacts:[]}. Expected artifactOutputId "${expectedOutputId}". Write the artifact, then merge its receipt with "node .ai.local/scripts/manifest.mjs upsert --slug ${slug} --id ${expectedOutputId} --producer ${agent} --outcome completed --paths <artifact>.md" (whole-file merge; never patch the JSON), then resume with: /task-continue ${slug}` };
|
|
730
730
|
}
|
|
731
731
|
try {
|
|
732
732
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|