@bonesofspring/ai-rules 0.2.61 → 0.2.64
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 +85 -0
- package/README.md +13 -6
- package/bin/cli.js +7 -5
- package/bin/lib/ai-local-drift.js +7 -6
- package/bin/lib/engine-scripts.js +4 -0
- package/bin/lib/engine-upgrade.js +10 -2
- package/bin/lib/manifest-schema.js +12 -0
- package/bin/lib/seed-ai-local-team.js +16 -0
- package/bin/mavis-install.js +4 -1
- package/bin/opencode-install.js +22 -4
- package/bin/zcode-install.js +4 -1
- package/docs/MAVIS.md +5 -2
- package/docs/MCP-CATALOG.md +1 -1
- package/docs/OPENCODE-COMPATIBILITY.md +3 -2
- package/docs/OPENCODE.md +27 -4
- package/docs/PLATFORMS.md +1 -1
- package/docs/PRESET-CONTRIBUTION.md +20 -17
- package/docs/TEAM-DB.md +78 -5
- package/docs/openapi/team-db.v1.json +4817 -2795
- package/mcp/defectdojo-mcp.mjs +41 -11
- package/mcp/lib/defectdojo.mjs +45 -2
- package/package.json +10 -4
- package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +279 -0
- package/presets/_shared/ai-local/scripts/check-write-scope.mjs +176 -28
- package/presets/_shared/ai-local/scripts/lock.mjs +60 -121
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +471 -7
- package/presets/_shared/ai-local/scripts/team-db-backlog.mjs +1366 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +573 -7
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +288 -4
- package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +82 -10
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +83 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +69 -6
- package/presets/_shared/ai-local/scripts/upstream-research.mjs +3 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +4 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +7 -2
- package/presets/_shared/core/agent-team/agent-team-intake.md +1 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +6 -2
- package/presets/_shared/core/meta/preset-pr-checklist.md +4 -4
- package/presets/_shared/core/meta/preset-twin-sync.md +1 -1
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +225 -0
- package/presets/_shared/hooks/check-preset-update.mjs +4 -3
- package/presets/_shared/hooks/run-hook.mjs +2 -1
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/android-kotlin/hooks/run-hook.mjs +2 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/go/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/go/hooks/run-hook.mjs +2 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/ios-swift/hooks/run-hook.mjs +2 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/java/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/java/hooks/run-hook.mjs +2 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/mcp-ts/hooks/run-hook.mjs +2 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/mol/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/mol/hooks/run-hook.mjs +2 -1
- package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/next/agents/build-verifier.md +16 -3
- package/presets/claude/next/agents/code-reviewer.md +1 -0
- package/presets/claude/next/agents/feature-developer.md +2 -1
- package/presets/claude/next/agents/mockup-reviewer.md +2 -1
- package/presets/claude/next/agents/task-analyst.md +4 -0
- package/presets/claude/next/commands/task.md +7 -1
- package/presets/claude/next/commands/technical-retro.md +7 -1
- package/presets/claude/next/commands/upstream-research.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/next/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/next/hooks/run-hook.mjs +2 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/next/skills/figma-fidelity/SKILL.md +4 -1
- package/presets/claude/next/skills/mockup-review/SKILL.md +4 -0
- package/presets/claude/next/team/README.md +5 -1
- package/presets/claude/next/team/upstream/jobs.json +34 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/nuxt/hooks/run-hook.mjs +2 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/php-hexagonal/hooks/run-hook.mjs +2 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/php-laravel/hooks/run-hook.mjs +2 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +225 -0
- package/presets/claude/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/svelte/hooks/run-hook.mjs +2 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +6 -2
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/android-kotlin/hooks/run-hook.mjs +2 -1
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/go/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/go/hooks/run-hook.mjs +2 -1
- package/presets/cursor/go/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/go/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/ios-swift/hooks/run-hook.mjs +2 -1
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/java/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/java/hooks/run-hook.mjs +2 -1
- package/presets/cursor/java/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/java/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/mcp-ts/hooks/run-hook.mjs +2 -1
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/mol/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/mol/hooks/run-hook.mjs +2 -1
- package/presets/cursor/mol/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/mol/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/mol/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/next/agents/build-verifier.md +16 -3
- package/presets/cursor/next/agents/code-reviewer.md +1 -0
- package/presets/cursor/next/agents/feature-developer.md +2 -1
- package/presets/cursor/next/agents/mockup-reviewer.md +2 -1
- package/presets/cursor/next/agents/task-analyst.md +4 -0
- package/presets/cursor/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -0
- package/presets/cursor/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/cursor/next/commands/task.md +7 -1
- package/presets/cursor/next/commands/technical-retro.md +7 -1
- package/presets/cursor/next/commands/upstream-research.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/next/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/next/hooks/run-hook.mjs +2 -1
- package/presets/cursor/next/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/next/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/next/skills/figma-fidelity/SKILL.md +4 -1
- package/presets/cursor/next/skills/mockup-review/SKILL.md +4 -0
- package/presets/cursor/next/team/README.md +5 -1
- package/presets/cursor/next/team/upstream/jobs.json +34 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/nuxt/hooks/run-hook.mjs +2 -1
- package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/php-hexagonal/hooks/run-hook.mjs +2 -1
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/php-laravel/hooks/run-hook.mjs +2 -1
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +225 -0
- package/presets/cursor/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/svelte/hooks/run-hook.mjs +2 -1
- package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/svelte/rules/preset-twin-sync.mdc +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/go/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/go/rules/agent-team-intake.md +1 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/go/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/go/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/java/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/java/rules/agent-team-intake.md +1 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/java/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/java/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/mol/rules/agent-team-intake.md +1 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/mol/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/next/adapter-map.json +9 -1
- package/presets/mavis/next/agents/build-verifier.md +16 -3
- package/presets/mavis/next/agents/code-reviewer.md +1 -0
- package/presets/mavis/next/agents/feature-developer.md +2 -1
- package/presets/mavis/next/agents/mockup-reviewer.md +2 -1
- package/presets/mavis/next/agents/task-analyst.md +4 -0
- package/presets/mavis/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -0
- package/presets/mavis/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/mavis/next/commands/task.md +7 -1
- package/presets/mavis/next/commands/technical-retro.md +7 -1
- package/presets/mavis/next/commands/upstream-research.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/next/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/next/rules/agent-team-intake.md +1 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/next/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/next/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/next/skills/figma-fidelity/SKILL.md +4 -1
- package/presets/mavis/next/skills/mockup-review/SKILL.md +4 -0
- package/presets/mavis/next/team/README.md +5 -1
- package/presets/mavis/next/team/upstream/jobs.json +34 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +225 -0
- package/presets/mavis/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/svelte/rules/agent-team-intake.md +1 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +6 -2
- package/presets/mavis/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/android-kotlin/OPENCODE.md +4 -1
- package/presets/opencode/android-kotlin/README.md +1 -0
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/hooks/README.md +4 -2
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/go/OPENCODE.md +4 -1
- package/presets/opencode/go/README.md +1 -0
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/hooks/README.md +4 -2
- package/presets/opencode/go/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/go/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/go/rules/agent-team-intake.md +1 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/go/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/go/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/ios-swift/OPENCODE.md +4 -1
- package/presets/opencode/ios-swift/README.md +1 -0
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/hooks/README.md +4 -2
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/java/OPENCODE.md +4 -1
- package/presets/opencode/java/README.md +1 -0
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/hooks/README.md +4 -2
- package/presets/opencode/java/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/java/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/java/rules/agent-team-intake.md +1 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/java/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/java/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/mcp-ts/OPENCODE.md +4 -1
- package/presets/opencode/mcp-ts/README.md +1 -0
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/hooks/README.md +4 -2
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/mol/OPENCODE.md +4 -1
- package/presets/opencode/mol/README.md +1 -0
- package/presets/opencode/mol/adapter-map.json +1 -1
- package/presets/opencode/mol/hooks/README.md +4 -2
- package/presets/opencode/mol/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/mol/rules/agent-team-intake.md +1 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/mol/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/next/OPENCODE.md +4 -1
- package/presets/opencode/next/README.md +1 -0
- package/presets/opencode/next/adapter-map.json +9 -1
- package/presets/opencode/next/agents/build-verifier.md +16 -3
- package/presets/opencode/next/agents/code-reviewer.md +1 -0
- package/presets/opencode/next/agents/feature-developer.md +2 -1
- package/presets/opencode/next/agents/mockup-reviewer.md +2 -1
- package/presets/opencode/next/agents/task-analyst.md +4 -0
- package/presets/opencode/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -0
- package/presets/opencode/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/opencode/next/commands/task.md +7 -1
- package/presets/opencode/next/commands/technical-retro.md +7 -1
- package/presets/opencode/next/commands/upstream-research.md +1 -1
- package/presets/opencode/next/hooks/README.md +4 -2
- package/presets/opencode/next/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/next/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/next/rules/agent-team-intake.md +1 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/next/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/next/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/next/skills/figma-fidelity/SKILL.md +4 -1
- package/presets/opencode/next/skills/mockup-review/SKILL.md +4 -0
- package/presets/opencode/next/team/README.md +5 -1
- package/presets/opencode/next/team/upstream/jobs.json +34 -0
- package/presets/opencode/nuxt/OPENCODE.md +4 -1
- package/presets/opencode/nuxt/README.md +1 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/hooks/README.md +4 -2
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/php-hexagonal/OPENCODE.md +4 -1
- package/presets/opencode/php-hexagonal/README.md +1 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/hooks/README.md +4 -2
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/php-laravel/OPENCODE.md +4 -1
- package/presets/opencode/php-laravel/README.md +1 -0
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/hooks/README.md +4 -2
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/platform-contract.json +6 -0
- package/presets/opencode/plugins/task-status/README.md +92 -0
- package/presets/opencode/plugins/task-status/details-data.ts +130 -0
- package/presets/opencode/plugins/task-status/details.tsx +84 -0
- package/presets/opencode/plugins/task-status/eta.ts +230 -0
- package/presets/opencode/plugins/task-status/index.ts +6 -0
- package/presets/opencode/plugins/task-status/package.json +10 -0
- package/presets/opencode/plugins/task-status/task-view.ts +606 -0
- package/presets/opencode/plugins/task-status/tui.tsx +139 -0
- package/presets/opencode/svelte/OPENCODE.md +4 -1
- package/presets/opencode/svelte/README.md +1 -0
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/hooks/README.md +4 -2
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +225 -0
- package/presets/opencode/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/svelte/rules/agent-team-intake.md +1 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +6 -2
- package/presets/opencode/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/go/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/go/rules/agent-team-intake.md +1 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/go/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/go/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/java/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/java/rules/agent-team-intake.md +1 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/java/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/java/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/mol/rules/agent-team-intake.md +1 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/mol/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/next/adapter-map.json +9 -1
- package/presets/zcode/next/agents/build-verifier.md +16 -3
- package/presets/zcode/next/agents/code-reviewer.md +1 -0
- package/presets/zcode/next/agents/feature-developer.md +2 -1
- package/presets/zcode/next/agents/mockup-reviewer.md +2 -1
- package/presets/zcode/next/agents/task-analyst.md +4 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -0
- package/presets/zcode/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/zcode/next/commands/task.md +7 -1
- package/presets/zcode/next/commands/technical-retro.md +7 -1
- package/presets/zcode/next/commands/upstream-research.md +1 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/next/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/next/rules/agent-team-intake.md +1 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/next/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/next/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/next/skills/figma-fidelity/SKILL.md +4 -1
- package/presets/zcode/next/skills/mockup-review/SKILL.md +4 -0
- package/presets/zcode/next/team/README.md +5 -1
- package/presets/zcode/next/team/upstream/jobs.json +34 -0
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +225 -0
- package/presets/zcode/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/svelte/rules/agent-team-intake.md +1 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +6 -2
- package/presets/zcode/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/svelte/rules/preset-twin-sync.md +1 -1
- package/scripts/aggregate-agent-task-metrics.mjs +48 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,90 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Upstream research
|
|
6
|
+
|
|
7
|
+
- **The weekly job actually ships.** `presets/cursor/next/team/upstream/jobs.json` is the preset-owned definition of the advertised `upstream-research` job (cron `0 9 * * 1` `Europe/Moscow`, pipeline payload over `upstream/prompt.md`, 75-minute timeout, `skip` concurrency, `run-once` misfire); `init`/`update` seed it into `.ai.local/team/scheduler/jobs.json` when the file is absent, and an operator-edited definition is never overwritten. `test-upstream-research.mjs` is reachable from its own `test:upstream` script and the preset-structure composite.
|
|
8
|
+
- **A clone target is bounded.** `projects[].fetchStrategy.path` is capped at 200 characters (`REGISTRY_BOUNDS.fetchPathMax`); a longer path is refused with `E_REGISTRY_FETCH` and the field name, so a registry entry cannot hand `git fetch` an unbounded target.
|
|
9
|
+
|
|
10
|
+
### Scheduler and pipeline
|
|
11
|
+
|
|
12
|
+
- **One exclusive create claims the scheduler lease.** `team-db.mjs schedule` read the lease and then wrote it, so two simultaneous starts could both see an empty root and both write one; the claim is now a single `wx` create, the loser exits `4` with `E_BUSY` exactly like a sequential second start, and a stale lease is re-read immediately before removal, so a lease another start reclaimed in the meantime is left standing.
|
|
13
|
+
- **Pipeline placeholders are a closed vocabulary.** `PROMPT_TOKENS` (`{{job.id}}`, `{{run.id}}`, `{{run.dir}}`, `{{team.root}}`, `{{now}}`) is the one list shared by `validateJob` and the render pass: a `payload.promptTemplate` with any other `{{token}}` is refused at definition time with the offending placeholder and the allowed list, so a run cannot start with a raw token left in the prompt. An absent template stays a runtime `E_PROMPT_MISSING`, not a definition error.
|
|
14
|
+
- **Bootstrap starts the first executable step.** The idempotent `bootstrap` action activated `steps[0]` even when that step was `skipIf`-matched, while the advance path skipped it; it now uses `findNextExecutableStep`, records that `pipelineIndex`, and reports a skip instead of a phantom attempt when every step is skipIf-matched.
|
|
15
|
+
- **Windows `.cmd` arguments keep embedded quotes.** `quoteWindowsArg` doubles a `"` as `""` per the cmd.exe convention; the previous `\"` ended the quoted argument instead of escaping the quote inside it.
|
|
16
|
+
|
|
17
|
+
### Preset tooling
|
|
18
|
+
|
|
19
|
+
- **The preset-tree lock is token-owned and reclaim-safe.** `owner.json` now carries a random `token`; `release` refuses a token that does not match, so a `--pid` override or a recycled pid cannot release a stolen lock. Reclaim runs under an exclusive `<lock>.reclaim` guard whose winner re-reads the owner, an owner-less directory younger than 30 s is held as warming instead of stolen (the old `mkdir` + separate `owner.json` write could lose a directory another process had just created), and a stale guard only delays the next reclaimer. `fix:generated`, `check:fast`, and `check:preset-structure` pass the token they acquired.
|
|
20
|
+
- **The generated-tree cache keys on the platform contract.** `presets/<platform>/platform-contract.json` is a generator input, so it joins `presets/cursor/<stack>`, `presets/_shared`, `scripts/lib`, and `package.json` in the cache digest; flipping a stack's release state now misses the cache instead of false-PASSing a stale subtree. `test-generated-cache.mjs` adds a real-generator equivalence check: a cold fill and a hit must byte-match a fresh `generateMavisStack` run.
|
|
21
|
+
|
|
22
|
+
### Install and upgrade
|
|
23
|
+
|
|
24
|
+
- **A record entry without a source is unattributable.** `.ai.local/.template-base.json` entries without `source` used to fall back to the rendered source, so `doctor` and `update --check` could report `current` — "matches the shipped template" — for bytes the package never attributed. They now report `no recorded source`, the rel is never planned for writing, and a module with no recorded base still takes the `unattributable` path.
|
|
25
|
+
- **One line per engine rel.** `update --fix` printed the write result and then let the drift pass classify the same rel again, producing a duplicate line; the engine plan now owns its rels on both `--check` and `--fix`, so each rel is reported once.
|
|
26
|
+
|
|
27
|
+
### DefectDojo import scan
|
|
28
|
+
|
|
29
|
+
- **`dd_import_scan` reads inside the project root only.** The report file must be repo-relative: an absolute path (POSIX, Windows drive, UNC), any `..` traversal (raw, percent-encoded, or backslash), and a symlink that leaves the real project root are refused before any read or upload; a malformed encoding is denied closed. Declared integer arguments (`id`, `product`, `engagement`) are validated at runtime, and an unexpected failure returns a generic message to the client while the stack goes to the server log, so a local path never reaches the model.
|
|
30
|
+
|
|
31
|
+
### Operator app
|
|
32
|
+
|
|
33
|
+
- **The job form runs on one resolver.** The private `apps/team-tasks-ui` create/edit form uses `react-hook-form` with a yup resolver (`mode: 'onTouched'`): submit stays disabled while the model is invalid, a field the API names is marked in place, a create-mode `409` names the duplicate id, and an edit-mode `409` renders the reload banner that re-reads the stored revision.
|
|
34
|
+
- **A lossy write is refused, not invented.** `toJobWrite` returns `null` when a stored definition lacks the field its own kind requires (cron `expression`, interval `everySeconds`, command `argv`, pipeline `promptTemplate`/`runner`); the job detail toggle rejects with `E_VALIDATION` and says to rewrite the definition instead of substituting `''`, `0`, or `[]` into a `PUT`.
|
|
35
|
+
- **Backlog actions validate in place.** The dialog renders a field error through the DS control (`errorMessage`/`note`) and takes `SLUG_PATTERN` from the API layer, so the client and the service share one slug grammar.
|
|
36
|
+
|
|
37
|
+
### Backlog tracker
|
|
38
|
+
|
|
39
|
+
- **The `backlog` verb family.** `team-db.mjs backlog` adds the file-authoritative plan store (`backlog/items/*.json` committed, `backlog/queue/` ignored): `add`, `set`, `show`, `list`, `ready`, `validate`, `import` (the versioned envelope, idempotent by id, `--dry-run`), `enqueue`, `cancel`, `drain --claim`, `recover` and `prune`. The stored status lattice is the decision; every operational status (`effectiveStatus`, `ready`, `waitingOn`) is derived from the items, the queue entries and the hook-owned task state. The deterministic total order is `priority` ascending (lower runs first, default 5) → `createdAt` → `id`.
|
|
40
|
+
- **The launch queue.** `backlog/config.json` carries `maxActive` (1…8, default 1); a task in a holding state (`in_progress`, `awaiting_artifact_receipt`, `blocked`) occupies a slot, one at a human gate does not. `backlog drain --claim` grants at most one claim and never starts a run; the hook stop seam consumes the claim, re-checks the graph at claim time, and `AI_RULES_TEAM_DB_BACKLOG_DRAIN_DISABLE=1` stops only the auto-drain. Claims older than 90 s with no task row are released on the next drain.
|
|
41
|
+
- **Seven backlog routes.** `GET/POST /api/v1/backlog`, `GET/POST /api/v1/backlog/queue` + `POST …/queue/{entryId}/cancel`, and `GET/PUT /api/v1/backlog/{id}` take the HTTP API from 32 to **39 operations**; migration `0003-backlog` projects the store, and the kill switch `AI_RULES_TEAM_DB_DISABLE=1` turns the projection off while the backlog file verbs stay usable.
|
|
42
|
+
- **Operator pages.** The private `apps/team-tasks-ui` app gains `/backlog` (the ordered list and the queue section of one snapshot, five states at three viewports) and `/backlog/[id]` (dependency state, queue history and the `stored` vs `task` completion source). The no-build `team-db-dashboard.mjs` is unchanged.
|
|
43
|
+
- **Gates.** `test-team-db-backlog.mjs`, `test-team-db-backlog-order.mjs`, `-project`, `-queue`, and `-import` join `yarn test:team-db`, and `test-team-db-schema.mjs` covers migration `0003-backlog`.
|
|
44
|
+
|
|
45
|
+
### Gates
|
|
46
|
+
|
|
47
|
+
- **The new seams are covered.** `test-team-db-scheduler.mjs` races two starts (one `E_BUSY`, exit `4`), refuses an unknown placeholder, and pins the cmd.exe quote convention; `test-preset-tree-lock.mjs` covers token-guarded release, the warming window, the guard re-read, and a two-contender race; `test-generated-cache.mjs` asserts real-generator equivalence; `test-engine-upgrade.mjs` covers the empty/missing source and the duplicate-line fix; `test-cli-mcp-registration.mjs` covers import containment and error sanitization; `test-cli-update.mjs` covers the seed-when-absent job; `test-chain-team-phases-coverage.mjs` covers bootstrap `skipIf`; `test-upstream-research.mjs` runs from `test:upstream` and the preset-structure composite. Platform smoke runs `doctor` on the five-platform multi install instead of a separate Cursor project.
|
|
48
|
+
|
|
49
|
+
## 0.2.64
|
|
50
|
+
|
|
51
|
+
### Composed-order gate, metrics bootstrap, and the shipped aggregator
|
|
52
|
+
|
|
53
|
+
- **Composed-order review.** A re-parenting change now freezes `hostCard.order[]` and per-node `order`/`siblingIndex` in `figma-contract.json`; `mockup-review`, `figma-fidelity` G4, `task-analyst`, `code-reviewer`, and the `ui-change-review-gate` seed require the host card's child order, not only the component subtree. A component-only review is incomplete.
|
|
54
|
+
- **Metrics bootstrap and profile revision.** The chain hook gains an idempotent `bootstrap` action that creates `task_started` and the first `attempt_started` before `steps[0]`; `/task` calls it. A plan revision records `profile_changed` and aligns `metrics.task.profile` with `pipeline.profile`.
|
|
55
|
+
- **Out-of-band accounting.** `out_of_band_start` / `out_of_band_end` record `out_of_band_started` / `out_of_band_finished` with `outOfBandId`, `agent`, `reason`, `durationMs`, `outcome` — reported separately from attempt duration and gate wait, without an invented `attemptId`.
|
|
56
|
+
- **Shipped metrics aggregator.** `aggregate-agent-task-metrics.mjs` ships to `.ai.local/scripts`; it adds `--slug`, per-task `taskReports[]` (`elapsedMs`, `activeMs`, `gateWaitMs`, `outOfBandMs`), and a top-level `outOfBand` summary. `technical-retro` uses it.
|
|
57
|
+
- **Narrow-width a11y sweep.** `figma-fidelity` checks the WCAG 1.4.10 320 px width plus the project's mobile frame widths and samples text-over-artwork pixels; artwork entering the text ink box is a blocker.
|
|
58
|
+
|
|
59
|
+
### OpenCode task-status plugin
|
|
60
|
+
|
|
61
|
+
- **Shipped TUI sidebar.** `init opencode` and `update` copy `presets/opencode/plugins/task-status/` to `.opencode/plugins/task-status/`; OpenCode auto-loads it from there, so no `opencode.json` `plugins` entry is needed. The plugin shows the active `/task` run in the TUI `sidebar.content` slot (slug, state, elapsed time, current step, soft-stop) and reads `.ai.local/team/` from the session directory. It is TUI-only; OpenCode Desktop does not render it, and the chain hook stays manual.
|
|
62
|
+
- **Managed install surface.** The plugin files join the OpenCode install manifest: `update` refreshes them, `doctor` reports missing/modified copies, and `clean opencode` removes unchanged ones.
|
|
63
|
+
- **Remaining-time estimate.** The sidebar row `eta` shows `~p50 · p90` for the remaining plan steps, from per-agent attempt medians and per-step retry rates across every `metrics.json` under the team root. Calibrated on 66 ledgers: 52% of runs finish below the p50, 89% below the p90; the row hides on a human gate, pause, stale run, or completion. It estimates agent work — gates and step parallelism stay out, so the real wait is often 20–25% shorter.
|
|
64
|
+
|
|
65
|
+
### Preset update notice
|
|
66
|
+
|
|
67
|
+
- **The `Shape:` sample carries the recorded version.** `check-preset-update.mjs` interpolated `latest` but left `<installed>` as a literal, so an agent that copied the sample verbatim printed the placeholder to the user instead of the installed version.
|
|
68
|
+
- **ZCode installs are checked.** `TOOL_ROOTS` includes `.zcode`, so a ZCode-only install is compared with the latest release and appears in the notice.
|
|
69
|
+
|
|
70
|
+
### Release gate and a fast loop gate
|
|
71
|
+
|
|
72
|
+
- **`yarn release:gate`.** The full structure composite, the `.ai.local` engine tests, and the strict product-specs dogfood run in one release-only command. It refuses `AI_RULES_SKIP_HOOK_TESTS=1` / `AI_RULES_SKIP_PACK_TESTS=1` and a dirty tracked tree, records the release `HEAD`, and writes a report under `.release-gate/`.
|
|
73
|
+
- **`yarn check:fast`.** The loop gate is now `check-preset-fast.sh` (~50 s: generated drift, twin drift, token budget, frontmatter, consumer links, next attached budget, OpenCode platform contract self-test), not the composite with the hook suites skipped. `test-cli-init-clean` moves to the delta gates and CI.
|
|
74
|
+
- **`yarn check:changed`.** The delta classifier prints `affected loop gates` and a separate `release-only gates` line; the preset-domain list names the targeted checks instead of `check:preset-structure (full)`.
|
|
75
|
+
- **Preset agent DoD.** `feature-developer` and `build-verifier` send preset-source changes to `check:changed` + `check:fast`; the full gate is release-only. The PR checklist separates merge from release.
|
|
76
|
+
- **`check:all` removed.** It duplicated the composite; use `yarn release:gate`.
|
|
77
|
+
|
|
78
|
+
## 0.2.62
|
|
79
|
+
|
|
80
|
+
### Engine lock and write audit
|
|
81
|
+
|
|
82
|
+
- **One lock protocol.** `<lock>.d` is the only mutual exclusion for the self-learning journal: a `mkdir` with `owner.json`, no `perl`, no `flock`, no shell. Before, a host with `perl` and a container without it locked different paths (`flock` on the file, `mkdir` on the sibling directory) and could enter together; the `AI_RULES_LOCK_NO_PERL` switch and the short-lived `perl` helper are gone, which also removes one fork per acquisition and the `lock timeout` it could raise while the mutex was free.
|
|
83
|
+
- **Reclaim cannot evict a live owner.** A dead owner is removed inside an atomic `<lock>.d.reclaim` guard, and the owner is re-read after the guard is taken. The previous rename could move a directory another contender had just created, admitting two writers to the journal and the manifest. Fixture: `test-platform-lock-exclusion.mjs` (cross-mode exclusion both ways, plus a five-iteration two-contender reclaim race).
|
|
84
|
+
- **Step-scoped write audit.** `check-write-scope.mjs --step <id> --save-baseline` records every dirty path with its content hash before a step writes; the audit then reports only paths the step created or changed. `--base HEAD` alone attributed every earlier step of the session to the current one, because agents never commit. `--paths` and `--base` stay as escape hatches.
|
|
85
|
+
- **A legacy pipeline is a skip.** `check-write-scope.mjs` exits `3` (SKIP, with `skipReason` and a `hint` in the JSON payload) when the pipeline has no step ids or no `writeScopes`. `build-verifier` records that under `## Soft notes` instead of failing, so a mandatory gate no longer becomes unsatisfiable for work that predates the schema. Step ids are backfillable with `team-db.mjs migrate-tasks`; `writeScopes` are only ever declared by `task-router`.
|
|
86
|
+
- **Install surface.** `.ai.local/.gitignore` gains `team/.write-scope/`; `update` adds the line to an existing ignore file and seeds the unchanged scripts.
|
|
87
|
+
|
|
3
88
|
## 0.2.61
|
|
4
89
|
|
|
5
90
|
### Cross-platform support
|
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
|
|
|
28
28
|
| Self-learning engine | **`.ai.local/scripts/`** (shared; sixteen scripts — the six self-learning engine modules, `manifest.mjs`, the seven `team-db*.mjs` projection and scheduler modules, the `upstream-research.mjs` review, and the read-only `check-write-scope.mjs` write audit; existing files never overwritten) | | | |
|
|
29
29
|
| Specs seed | `docs/specs/` copied only if the directory is **absent** | | | |
|
|
30
30
|
|
|
31
|
+
OpenCode also ships **`.opencode/plugins/task-status/`**, a TUI sidebar for the active `/task` run (slug, state, elapsed time, step, remaining-time estimate, soft-stop). OpenCode auto-loads it; it needs no `opencode.json` entry, is refreshed by `update`, and is a viewer only — the chain hook stays manual.
|
|
32
|
+
|
|
31
33
|
### Project MCP catalog
|
|
32
34
|
|
|
33
35
|
`init mcp` writes the third-party servers this package ships plus Storybook, DefectDojo, and the packaged GitLab / GitHub / Yandex runtime entries into every installed client; `--tools` narrows the list to the clients you name. Entries render in each client's native shape and merge like `init`: extra servers, the consumer's `env` / `headers`, and other top-level keys stay. Names: `context7`, `playwright` (Claude's id is `playwright-test`), `chrome-devtools`, `next-devtools`, `semgrep`, `sentry`, `figma-desktop` (alias `figma`, the local `http://127.0.0.1:3845/mcp` server), `figma-cloud` (the remote `https://mcp.figma.com/mcp` server), `storybook` (`http://localhost:6200/mcp`), `defectdojo`, `gitlab`, `github`, `yandex-tracker`, and `yandex-wiki`; `--all` selects every one. The last five are packaged runtime entries: they are registered without credentials and need `mcp setup <provider>` once (DefectDojo reads `.env.defectdojo`). Next.js DevTools needs a running `next dev` on Next.js 16+; Semgrep needs the `semgrep` CLI; Sentry uses OAuth.
|
|
@@ -52,7 +54,7 @@ node .ai.local/scripts/run.mjs --strict # read-only check: exit 1 when capture
|
|
|
52
54
|
node .ai.local/scripts/run.mjs --dry-run # read-only preview: decision, target, before/after, exact writes
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
`build-verifier` and `code-reviewer` also run the read-only write audit `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id>`: it labels every changed path `declared`, `derived`, or `out-of-scope` against the step's `writeScopes`. It is never a hook gate.
|
|
57
|
+
`build-verifier` and `code-reviewer` also run the read-only write audit `node .ai.local/scripts/check-write-scope.mjs --slug <slug> --step <step-id>`: it labels every changed path `declared`, `derived`, or `out-of-scope` against the step's `writeScopes`. The orchestrator saves the step baseline (`--step <step-id> --save-baseline`) before the step writes, so the audit covers that step rather than the whole session. A pipeline that predates `writeScopes` exits `3` (skip), never a failure. It is never a hook gate.
|
|
56
58
|
|
|
57
59
|
`init` seeds the engine with **skip-if-exists** — a modified `run.mjs` stays yours and is reported as kept; there is no
|
|
58
60
|
`--force`. The seeded tree is byte-identical to `presets/_shared/ai-local/scripts/`, and `.ai.local/.gitignore` (created
|
|
@@ -136,6 +138,9 @@ node .ai.local/scripts/team-db.mjs check # schema, fingerprint, i
|
|
|
136
138
|
node .ai.local/scripts/team-db.mjs serve # http://127.0.0.1:4178 + dashboard
|
|
137
139
|
node .ai.local/scripts/team-db.mjs schedule # the timer: claims, runs, captures, reconciles
|
|
138
140
|
node .ai.local/scripts/team-db.mjs jobs list # definitions + next fire, file-authoritative
|
|
141
|
+
node .ai.local/scripts/team-db.mjs backlog list # the ordered backlog: items, ready set, waiting-on
|
|
142
|
+
node .ai.local/scripts/team-db.mjs backlog enqueue --file <path|-> # record one launch request
|
|
143
|
+
node .ai.local/scripts/team-db.mjs backlog drain --claim # grant one claim, never start a run
|
|
139
144
|
AI_RULES_TEAM_DB_DISABLE=1 node .ai.local/scripts/team-db.mjs sync # no-op: file-only mode
|
|
140
145
|
```
|
|
141
146
|
|
|
@@ -143,8 +148,8 @@ Requires Node 22.13.0+ for `node:sqlite`; older runtimes stay file-only with one
|
|
|
143
148
|
`migrate-tasks` is the one-command path: it creates the database when it is absent and writes
|
|
144
149
|
only the delta against an existing one, so a fresh workspace and a populated database converge
|
|
145
150
|
in one invocation.
|
|
146
|
-
`team-db.mjs serve` binds loopback only, is read-only apart from the
|
|
147
|
-
(`POST /api/v1/sync`, the task delete,
|
|
151
|
+
`team-db.mjs serve` binds loopback only, is read-only apart from the ten documented mutations
|
|
152
|
+
(`POST /api/v1/sync`, the task delete, the four job writes and the four backlog writes), and serves the OpenAPI 3.1
|
|
148
153
|
document at `/openapi.json`. Details, environment names, retention, and rollback:
|
|
149
154
|
[`docs/TEAM-DB.md`](docs/TEAM-DB.md).
|
|
150
155
|
|
|
@@ -164,7 +169,9 @@ pre-v2 database is rebuilt from the files on the next `sync`.
|
|
|
164
169
|
### Upstream research
|
|
165
170
|
|
|
166
171
|
The `next` preset ships a weekly `upstream-research` job and a read-only `opencode` agent for
|
|
167
|
-
it.
|
|
172
|
+
it. `init`/`update` seed the job definition into `.ai.local/team/scheduler/jobs.json` when the
|
|
173
|
+
file is absent; an operator-edited definition is never overwritten. The runner
|
|
174
|
+
(`.ai.local/scripts/upstream-research.mjs`) probes `opencode`, loads
|
|
168
175
|
`upstream/projects.json` and `upstream/config.json`, fetches each due clone with
|
|
169
176
|
`git fetch --depth 1`, labels the window (`range`, `baseline`, `unprovable`, `no-change`),
|
|
170
177
|
validates the agent's marked JSON, re-checks every citation inside the clone, dedupes by
|
|
@@ -217,7 +224,7 @@ Optional check: `yarn check:product-specs [<repo-root>]` (WARN) or `--strict`. T
|
|
|
217
224
|
|
|
218
225
|
## Anti-hallucination
|
|
219
226
|
|
|
220
|
-
Every installed preset ships requestable `anti-hallucination-contract` (not always-on). Writer roles — implementer, unit-test, e2e, qa, and `code-reviewer` — also load that stack's floor stem. `yarn
|
|
227
|
+
Every installed preset ships requestable `anti-hallucination-contract` (not always-on). Writer roles — implementer, unit-test, e2e, qa, and `code-reviewer` — also load that stack's floor stem. `yarn release:gate` fails if a role or skill binding is removed. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`). Details: [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md).
|
|
221
228
|
|
|
222
229
|
## Contributing
|
|
223
230
|
|
|
@@ -227,7 +234,7 @@ Every installed preset ships requestable `anti-hallucination-contract` (not alwa
|
|
|
227
234
|
- MCP setup: [`docs/MCP-SETUP.md`](docs/MCP-SETUP.md)
|
|
228
235
|
- MCP catalog: [`docs/MCP-CATALOG.md`](docs/MCP-CATALOG.md)
|
|
229
236
|
- Dogfood: [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/sync-dogfood-claude.sh`](scripts/sync-dogfood-claude.sh), [`scripts/sync-dogfood-mavis.sh`](scripts/sync-dogfood-mavis.sh), [`scripts/sync-dogfood-opencode.sh`](scripts/sync-dogfood-opencode.sh) — seeds `.ai.local/team`, preserves slugs
|
|
230
|
-
- Gates: `yarn check:
|
|
237
|
+
- Gates: loop `yarn check:changed` + `yarn check:fast`; release `yarn release:gate`
|
|
231
238
|
|
|
232
239
|
`_shared` is not an installable `--preset`.
|
|
233
240
|
|
package/bin/cli.js
CHANGED
|
@@ -54,7 +54,7 @@ const {
|
|
|
54
54
|
process.on('exit', flushAllAiLocalDriftSummaries);
|
|
55
55
|
|
|
56
56
|
const FAIL_PHASE_ENV = 'AI_RULES_CLI_FAIL_PHASE';
|
|
57
|
-
const MANIFEST_SCHEMA_VERSION =
|
|
57
|
+
const { MANIFEST_SCHEMA_VERSION } = require('./lib/manifest-schema');
|
|
58
58
|
|
|
59
59
|
/** Single path segment: letters, digits, dot, underscore, hyphen; no separators or "..". */
|
|
60
60
|
const PRESET_NAME_RE = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
@@ -828,11 +828,13 @@ function cmdUpdate(cwdOption, opts) {
|
|
|
828
828
|
console.log(`update: reinstalling ${plan}`);
|
|
829
829
|
const packageRoot = getPackageRoot();
|
|
830
830
|
// One plan per command: the engine classifier reads the record before any pass
|
|
831
|
-
// can adopt a rel, and `applyEngineUpgrade` writes after the last pass.
|
|
832
|
-
//
|
|
833
|
-
//
|
|
831
|
+
// can adopt a rel, and `applyEngineUpgrade` writes after the last pass. The
|
|
832
|
+
// engine rels are owned on both output paths — `--check` previews the lines
|
|
833
|
+
// from this plan, `--fix` prints the write result — so the drift pass must
|
|
834
|
+
// not classify them a second time with a source that may not match the
|
|
835
|
+
// record (duplicate engine lines).
|
|
834
836
|
const enginePlan = fix || check ? planEngineUpgrade({ cwd, packageRoot }) : null;
|
|
835
|
-
if (
|
|
837
|
+
if (enginePlan) {
|
|
836
838
|
ownEngineCheck(cwd, new Set(enginePlan.entries.map((entry) => entry.rel)));
|
|
837
839
|
}
|
|
838
840
|
// One command, one tree, one summary: each tool's pass accumulates, this flushes.
|
|
@@ -375,15 +375,16 @@ const driftTotals = new Map();
|
|
|
375
375
|
const claimedRels = new Map();
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
* Engine rels one command
|
|
379
|
-
*
|
|
380
|
-
* which is the source `--fix`
|
|
381
|
-
*
|
|
382
|
-
*
|
|
378
|
+
* Engine rels one command owns via its plan (`update --check` previews them,
|
|
379
|
+
* `update --fix` prints the write result). The plan already classifies every
|
|
380
|
+
* engine module with the recorded base `source`, which is the source `--fix`
|
|
381
|
+
* writes with; a second classification here would print a line from a
|
|
382
|
+
* different predicate (and none at all when the base names a tool that has
|
|
383
|
+
* since been cleaned). Command-scoped like {@link driftTotals}.
|
|
383
384
|
*/
|
|
384
385
|
const engineCheckOwners = new Map();
|
|
385
386
|
|
|
386
|
-
/** Hand the engine rels of one `update --check` command to its `planEngineUpgrade` result. */
|
|
387
|
+
/** Hand the engine rels of one `update --check`/`--fix` command to its `planEngineUpgrade` result. */
|
|
387
388
|
function ownEngineCheck(cwd, rels) {
|
|
388
389
|
engineCheckOwners.set(path.resolve(cwd), rels);
|
|
389
390
|
}
|
|
@@ -27,6 +27,7 @@ const ENGINE_SCRIPTS = [
|
|
|
27
27
|
'efficacy-oracle.mjs',
|
|
28
28
|
'manifest.mjs',
|
|
29
29
|
'team-db.mjs',
|
|
30
|
+
'team-db-backlog.mjs',
|
|
30
31
|
'team-db-schema.mjs',
|
|
31
32
|
'team-db-project.mjs',
|
|
32
33
|
'team-db-api.mjs',
|
|
@@ -39,6 +40,9 @@ const ENGINE_SCRIPTS = [
|
|
|
39
40
|
// Read-only post-step write-scope audit used by build-verifier and code-reviewer.
|
|
40
41
|
// Shells out to git, so it is not part of the self-learning loop module set.
|
|
41
42
|
'check-write-scope.mjs',
|
|
43
|
+
// Role/task metrics aggregation used by technical-retro; ships with the engine
|
|
44
|
+
// so a consumer can run it from `.ai.local/scripts/` without the package.
|
|
45
|
+
'aggregate-agent-task-metrics.mjs',
|
|
42
46
|
];
|
|
43
47
|
|
|
44
48
|
/** Package `presets/`-relative directory holding the engine source of truth. */
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* module is written only when its bytes still equal the digest the package
|
|
7
7
|
* recorded in `.ai.local/.template-base.json` for a previously shipped
|
|
8
8
|
* template. A consumer edit is reported `modified` and never touched; a module
|
|
9
|
-
* with no recorded base
|
|
9
|
+
* with no recorded base — or a record entry without a `source` — is reported
|
|
10
|
+
* unattributable and never written.
|
|
10
11
|
*
|
|
11
12
|
* The durable backup (`.ai.local/.rollback/engine-<stamp>/<rel>`, keep the last
|
|
12
13
|
* five runs) is a user-facing restore point. Failure atomicity is separate: the
|
|
@@ -69,7 +70,8 @@ function shippedEngineTemplates(packageRoot) {
|
|
|
69
70
|
* States: `current` (already at the template, or adoptable), `stale` (bytes
|
|
70
71
|
* still equal the recorded base and the template moved — the would-write set),
|
|
71
72
|
* `modified` (consumer bytes differ from the recorded base), `no-base` (no
|
|
72
|
-
* recorded base, so the bytes cannot be
|
|
73
|
+
* recorded base, or a base entry without a source, so the bytes cannot be
|
|
74
|
+
* attributed), `missing`, `symlink`.
|
|
73
75
|
*
|
|
74
76
|
* `checkOutcome` carries the row's `decide()` outcome in the shipped
|
|
75
77
|
* `check <outcome> <rel>` vocabulary, so `update --check` previews the engine
|
|
@@ -134,6 +136,12 @@ function planEngineUpgrade({ cwd, packageRoot }) {
|
|
|
134
136
|
detail = consumer.normSha256 === template.digest.normSha256
|
|
135
137
|
? `matches the shipped ${template.name} template`
|
|
136
138
|
: `${template.name} differs from the shipped template and ${reason}; bytes cannot be attributed (delete the module and re-run init)`;
|
|
139
|
+
} else if (base && !base.source) {
|
|
140
|
+
// A record entry without a source is never attributed (D-3): mapping it
|
|
141
|
+
// onto the fallback source would let decide() report `current` — doctor
|
|
142
|
+
// saying "matches the shipped template" — for bytes never attributed.
|
|
143
|
+
state = 'no-base';
|
|
144
|
+
detail = `${template.name} has no recorded source; bytes cannot be attributed (delete the module and re-run init)`;
|
|
137
145
|
} else {
|
|
138
146
|
const source = (base && base.source) || RECORDED_SOURCE_FALLBACK;
|
|
139
147
|
const outcome = decide({ consumer, base, template: template.digest, source });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema version of the per-tool install manifest (`manifest.json` under the
|
|
3
|
+
* tool root). One constant for every writer: `cli.js` reads and upgrades it
|
|
4
|
+
* and writes the cursor manifest, while the mavis/opencode/zcode installers
|
|
5
|
+
* write their own manifests — a bump cannot forget one of the four writers.
|
|
6
|
+
*
|
|
7
|
+
* A v2 manifest lists only preset files, so `doctor` and update pruning can
|
|
8
|
+
* trust it.
|
|
9
|
+
*/
|
|
10
|
+
const MANIFEST_SCHEMA_VERSION = 2;
|
|
11
|
+
|
|
12
|
+
module.exports = { MANIFEST_SCHEMA_VERSION };
|
|
@@ -19,6 +19,7 @@ const AI_LOCAL_GITIGNORE = [
|
|
|
19
19
|
'# Files written by the in-task self-learning engine and by legacy-team',
|
|
20
20
|
'# migration backups. Local safety net — never commit.',
|
|
21
21
|
'*.lock',
|
|
22
|
+
'*.lock.d/',
|
|
22
23
|
'*.tmp',
|
|
23
24
|
'.rollback/',
|
|
24
25
|
'.template-base.json',
|
|
@@ -36,6 +37,8 @@ const AI_LOCAL_GITIGNORE = [
|
|
|
36
37
|
'# Scheduler runtime state; jobs.json stays tracked (jobs as code).',
|
|
37
38
|
'team/scheduler/runs/',
|
|
38
39
|
'team/scheduler/state.json',
|
|
40
|
+
'# Per-step write-scope baselines; derived from git, never a project input.',
|
|
41
|
+
'team/.write-scope/',
|
|
39
42
|
'team/upstream/cursor.json',
|
|
40
43
|
'',
|
|
41
44
|
].join('\n');
|
|
@@ -354,6 +357,19 @@ function copyTemplates(presetTeamSrc, dest) {
|
|
|
354
357
|
copyFile(source, target);
|
|
355
358
|
written.push(`.ai.local/team/upstream/${name}`);
|
|
356
359
|
}
|
|
360
|
+
// The shipped weekly `upstream-research` job seeds only when absent, like the
|
|
361
|
+
// research data above: the template carries the definition the docs advertise,
|
|
362
|
+
// and an operator-edited `scheduler/jobs.json` (tracked on purpose — jobs as
|
|
363
|
+
// code) is never overwritten. The scheduler owns the file under
|
|
364
|
+
// `scheduler/`; the template lives beside the other upstream templates.
|
|
365
|
+
{
|
|
366
|
+
const jobsSource = path.join(upstreamSrc, 'jobs.json');
|
|
367
|
+
const jobsTarget = path.join(dest, 'scheduler', 'jobs.json');
|
|
368
|
+
if (fs.existsSync(jobsSource) && !fs.existsSync(jobsTarget)) {
|
|
369
|
+
copyFile(jobsSource, jobsTarget);
|
|
370
|
+
written.push('.ai.local/team/scheduler/jobs.json');
|
|
371
|
+
}
|
|
372
|
+
}
|
|
357
373
|
const gitkeepSrc = path.join(presetTeamSrc, 'tasks', '.gitkeep');
|
|
358
374
|
if (fs.existsSync(gitkeepSrc) && !hasConsumerTaskSlugs(path.join(dest, 'tasks'))) {
|
|
359
375
|
copyFile(gitkeepSrc, path.join(dest, 'tasks', '.gitkeep'));
|
package/bin/mavis-install.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const { assertSafeDest, escapesRoot, resolveManagedPath } = require('./lib/safe-path');
|
|
7
|
+
const { MANIFEST_SCHEMA_VERSION } = require('./lib/manifest-schema');
|
|
7
8
|
const {
|
|
8
9
|
createInstallTransaction,
|
|
9
10
|
isPlainObject,
|
|
@@ -269,7 +270,9 @@ function cmdInitMavis({ preset, cwdOption, helpers }) {
|
|
|
269
270
|
managedFiles[item.rel] = sha256File(item.dest);
|
|
270
271
|
}
|
|
271
272
|
const manifest = {
|
|
272
|
-
|
|
273
|
+
// Shared constant (bin/lib/manifest-schema.js): a v2 manifest lists only
|
|
274
|
+
// preset files, so `doctor` and update pruning can trust it.
|
|
275
|
+
schemaVersion: MANIFEST_SCHEMA_VERSION,
|
|
273
276
|
packageVersion: packageVersion(packageRoot),
|
|
274
277
|
platform: 'mavis',
|
|
275
278
|
preset: stack,
|
package/bin/opencode-install.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const { assertSafeDest, escapesRoot, resolveManagedPath } = require('./lib/safe-path');
|
|
7
|
+
const { MANIFEST_SCHEMA_VERSION } = require('./lib/manifest-schema');
|
|
7
8
|
const {
|
|
8
9
|
createInstallTransaction,
|
|
9
10
|
isPlainObject,
|
|
@@ -65,7 +66,7 @@ function packageVersion(packageRoot) {
|
|
|
65
66
|
return loadJson(path.join(packageRoot, 'package.json')).version;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
function buildPlan({ contract, sourceBase, cwd }) {
|
|
69
|
+
function buildPlan({ contract, sourceBase, sharedSourceBase, cwd }) {
|
|
69
70
|
const files = [];
|
|
70
71
|
const seen = new Set();
|
|
71
72
|
const addFile = (source, destRel) => {
|
|
@@ -97,6 +98,18 @@ function buildPlan({ contract, sourceBase, cwd }) {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
|
|
101
|
+
// Shared platform assets (for example the TUI plugins) live beside the stack
|
|
102
|
+
// directories, so every released preset installs the same copy.
|
|
103
|
+
for (const mapping of contract.sharedDirectoryMappings || []) {
|
|
104
|
+
const sourceDir = path.join(sharedSourceBase, mapping.source);
|
|
105
|
+
if (!fs.existsSync(sourceDir)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
for (const rel of walkFiles(sourceDir)) {
|
|
109
|
+
addFile(path.join(sourceDir, rel), `${mapping.destination}/${rel}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
100
113
|
const mcpMd = path.join(sourceBase, 'MCP.md');
|
|
101
114
|
if (fs.existsSync(mcpMd)) {
|
|
102
115
|
addFile(mcpMd, path.join(contract.managedRoot, 'MCP.md'));
|
|
@@ -403,7 +416,7 @@ function cmdInitOpencode({ preset, cwdOption, helpers }) {
|
|
|
403
416
|
|
|
404
417
|
try {
|
|
405
418
|
throwIfPhase('validate');
|
|
406
|
-
const plan = buildPlan({ contract, sourceBase, cwd });
|
|
419
|
+
const plan = buildPlan({ contract, sourceBase, sharedSourceBase: sourceRoot, cwd });
|
|
407
420
|
for (const item of plan.files) {
|
|
408
421
|
if (!fs.existsSync(item.source)) {
|
|
409
422
|
throw new Error(`Source missing: ${item.source}`);
|
|
@@ -466,14 +479,19 @@ function cmdInitOpencode({ preset, cwdOption, helpers }) {
|
|
|
466
479
|
managedFiles[item.rel] = sha256File(item.dest);
|
|
467
480
|
}
|
|
468
481
|
const manifest = {
|
|
469
|
-
|
|
482
|
+
// Shared constant (bin/lib/manifest-schema.js): a v2 manifest lists only
|
|
483
|
+
// preset files, so `doctor` and update pruning can trust it.
|
|
484
|
+
schemaVersion: MANIFEST_SCHEMA_VERSION,
|
|
470
485
|
packageVersion: packageVersion(packageRoot),
|
|
471
486
|
platform: 'opencode',
|
|
472
487
|
preset: stack,
|
|
473
488
|
installedAt: new Date().toISOString(),
|
|
474
489
|
managedFiles,
|
|
475
490
|
mergedConfigs,
|
|
476
|
-
managedDirectories:
|
|
491
|
+
managedDirectories: [
|
|
492
|
+
...(contract.directoryMappings || []).map((entry) => entry.destination),
|
|
493
|
+
...(contract.sharedDirectoryMappings || []).map((entry) => entry.destination),
|
|
494
|
+
],
|
|
477
495
|
shippedMcpServerIds: plan.mcp ? shippedMcpIds(plan.mcp.source) : [],
|
|
478
496
|
docsSeed: seeded
|
|
479
497
|
? { seeded: true }
|
package/bin/zcode-install.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
const fs = require('fs');
|
|
8
8
|
const path = require('path');
|
|
9
9
|
const { assertSafeDest, escapesRoot, resolveManagedPath } = require('./lib/safe-path');
|
|
10
|
+
const { MANIFEST_SCHEMA_VERSION } = require('./lib/manifest-schema');
|
|
10
11
|
const {
|
|
11
12
|
createInstallTransaction,
|
|
12
13
|
isPlainObject,
|
|
@@ -366,7 +367,9 @@ function cmdInitZcode({ preset, cwdOption, helpers }) {
|
|
|
366
367
|
managedFiles[item.rel] = sha256File(item.dest);
|
|
367
368
|
}
|
|
368
369
|
const manifest = {
|
|
369
|
-
|
|
370
|
+
// Shared constant (bin/lib/manifest-schema.js): a v2 manifest lists only
|
|
371
|
+
// preset files, so `doctor` and update pruning can trust it.
|
|
372
|
+
schemaVersion: MANIFEST_SCHEMA_VERSION,
|
|
370
373
|
packageVersion: packageVersion(packageRoot),
|
|
371
374
|
platform: 'zcode',
|
|
372
375
|
preset: stack,
|
package/docs/MAVIS.md
CHANGED
|
@@ -115,15 +115,18 @@ Desktop/CLI versions in the compatibility doc are **operator snapshots**, not pa
|
|
|
115
115
|
| [`MAVIS-COMPATIBILITY.md`](./MAVIS-COMPATIBILITY.md) | Probe evidence and go/no-go |
|
|
116
116
|
| [`PRESET-CONTRIBUTION.md`](./PRESET-CONTRIBUTION.md) | Sibling adapter authoring |
|
|
117
117
|
|
|
118
|
-
Validate after preset edits:
|
|
118
|
+
Validate after preset edits (loop):
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
121
|
cd packages/ai-rules
|
|
122
|
-
|
|
122
|
+
yarn check:changed
|
|
123
|
+
yarn check:fast
|
|
123
124
|
node scripts/check-mavis-platform-contract.mjs --self-test
|
|
124
125
|
node scripts/check-mavis-adapter-map.mjs --self-test
|
|
125
126
|
```
|
|
126
127
|
|
|
128
|
+
The full `scripts/check-preset-structure.sh` composite runs in `yarn release:gate` before a release.
|
|
129
|
+
|
|
127
130
|
## Released stacks
|
|
128
131
|
|
|
129
132
|
`init mavis --preset <stack>` and `init multi --preset <stack>` install Mavis for every stack in `presets/mavis/platform-contract.json` `releasedStacks` (all 11). Per-stack always-on rules live in `scripts/lib/stack-platform-profiles.mjs`. Derive with `node scripts/generate-mavis.mjs --stack <stack>` from Cursor SoT — never from Claude.
|
package/docs/MCP-CATALOG.md
CHANGED
|
@@ -61,7 +61,7 @@ Only clients detected in the project are written (`mcp.json` exists, or the inst
|
|
|
61
61
|
| Yandex | `.ai-rules/mcp/config.env` or `YANDEX_ORG_ID` | `ai-rules mcp setup yandex` |
|
|
62
62
|
| DefectDojo | `.env.defectdojo` (project root, ignored) or `DEFECTDOJO_TOKEN` | `ai-rules mcp setup defectdojo` |
|
|
63
63
|
|
|
64
|
-
The DefectDojo token is never written by the package. `.env.defectdojo` holds `DEFECTDOJO_URL` and `DEFECTDOJO_TOKEN`; the file must be gitignored. `mcp setup defectdojo` proves the pair with `GET /api/v2/findings/` before registering.
|
|
64
|
+
The DefectDojo token is never written by the package. `.env.defectdojo` holds `DEFECTDOJO_URL` and `DEFECTDOJO_TOKEN`; the file must be gitignored. `mcp setup defectdojo` proves the pair with `GET /api/v2/findings/` before registering. `dd_import_scan` reads the report file only inside the project root — repo-relative paths; absolute paths, `..` traversal, and symlinks pointing outside the root are refused before any read or upload.
|
|
65
65
|
|
|
66
66
|
## Merge rules
|
|
67
67
|
|
|
@@ -35,7 +35,8 @@ Allowed status values are `confirmed`, `partial`, `unknown`, `manual`, and `no-e
|
|
|
35
35
|
| Workspace agent discovery | `confirmed` | opencode.ai/docs/agents | `.opencode/agents/` | Native |
|
|
36
36
|
| Workspace Skill discovery | `confirmed` | opencode.ai/docs/skills | `.opencode/skills/<name>/SKILL.md` | Native `skill` tool |
|
|
37
37
|
| Project MCP | `confirmed` | opencode.ai/docs/mcp-servers | `opencode.json` `mcp` | Merge on init |
|
|
38
|
-
|
|
|
38
|
+
| TUI plugin discovery | `confirmed` | opencode.ai/docs/plugins | `.opencode/plugins/<name>/` loads automatically | Ships `task-status` TUI sidebar |
|
|
39
|
+
| Project hooks (`hooks.json`) | `manual` | plugins exist; this preset ships a TUI viewer, not a hook plugin | No confirmed `subagentStop` analog was opened | Manual `chain-team-phases.sh` |
|
|
39
40
|
| Slash commands | `confirmed` | opencode.ai/docs/commands | `.opencode/commands/<name>.md` | Native `/task` |
|
|
40
41
|
| Plugin / skill / MCP combo | `confirmed` | skills + mcp docs | MCP inflates context | Gate unused servers in operator config |
|
|
41
42
|
| Native Team lifecycle | `partial` | file pipeline is ai-rules SoT | No native team runtime | Hook owns `status.json` / `metrics.json` |
|
|
@@ -45,7 +46,7 @@ Allowed status values are `confirmed`, `partial`, `unknown`, `manual`, and `no-e
|
|
|
45
46
|
|
|
46
47
|
- Cursor `alwaysApply` / `globs` on OpenCode
|
|
47
48
|
- Claude topic-folder twins as the OpenCode source
|
|
48
|
-
- Auto-registration of `hooks.json` or a
|
|
49
|
+
- Auto-registration of `hooks.json` or a hook plugin in v1
|
|
49
50
|
- `init opencode --dry-run` / manifest preview (v1 is apply + rollback only)
|
|
50
51
|
- Writes to `~/.config/opencode/**` or `~/.opencode/**`
|
|
51
52
|
|
package/docs/OPENCODE.md
CHANGED
|
@@ -78,10 +78,30 @@ printf '%s\n' '{"status":"completed","attemptId":"<from-status.json>"}' \
|
|
|
78
78
|
| TEAM_TASK_SLUG=<slug> bash .opencode/hooks/chain-team-phases.sh
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
Human gates pause with `awaitingHumanGate: true`. Resume with `/task-continue`. There is **no** shipped `hooks.json` or
|
|
81
|
+
Human gates pause with `awaitingHumanGate: true`. Resume with `/task-continue`. There is **no** shipped `hooks.json` or hook plugin in v1.
|
|
82
82
|
|
|
83
83
|
Full team layout: `.ai.local/team/README.md`.
|
|
84
84
|
|
|
85
|
+
## Task status sidebar (TUI plugin)
|
|
86
|
+
|
|
87
|
+
`.opencode/plugins/task-status/` ships with every OpenCode preset. `init` and
|
|
88
|
+
`update` copy it as a managed file; OpenCode auto-loads every plugin under
|
|
89
|
+
`.opencode/plugins/`, so `opencode.json` needs no `plugins` entry.
|
|
90
|
+
|
|
91
|
+
- Reads the nearest `.ai.local/team/` above the session directory and maps the
|
|
92
|
+
active session to a task by its user messages.
|
|
93
|
+
- Renders slug, state, elapsed time, current step, and a soft-stop button in the
|
|
94
|
+
TUI `sidebar.content` slot. Toggle the sidebar with `ctrl+x b`.
|
|
95
|
+
- Shows a `~p50 · p90` estimate for the remaining steps, built from the attempt
|
|
96
|
+
durations of every ledger under the team root; hidden on a human gate, pause,
|
|
97
|
+
stale run, or completion. It estimates agent work, not wall-clock time.
|
|
98
|
+
- The stop button writes `.ai.local/STOP`; the in-flight attempt finishes and no
|
|
99
|
+
next step starts. Resume with `/task-continue <slug>`.
|
|
100
|
+
- TUI-only: OpenCode Desktop does not render TUI plugins.
|
|
101
|
+
|
|
102
|
+
`update` refreshes the installed copy; `clean opencode` removes unchanged files.
|
|
103
|
+
Do not edit the installed copy in place.
|
|
104
|
+
|
|
85
105
|
## MCP
|
|
86
106
|
|
|
87
107
|
Preset servers merge into project **`opencode.json`** `mcp`:
|
|
@@ -101,7 +121,7 @@ Labels from official OpenCode docs (live CLI probe not yet run). Full matrix: [`
|
|
|
101
121
|
| `.opencode/agents` / `skills` / `commands` | **confirmed** (docs) | Native discovery |
|
|
102
122
|
| `opencode.json` MCP | **confirmed** (docs) | Merge `mcp` |
|
|
103
123
|
| Glob / alwaysApply rules | **no-equivalent** | Lazy Read catalog under `.opencode/rules/` |
|
|
104
|
-
| `hooks.json` / subagentStop | **manual** | `TEAM_TASK_SLUG=<slug> bash .opencode/hooks/chain-team-phases.sh` after receipts;
|
|
124
|
+
| `hooks.json` / subagentStop | **manual** | `TEAM_TASK_SLUG=<slug> bash .opencode/hooks/chain-team-phases.sh` after receipts; the `task-status` TUI plugin is a viewer, not a hook |
|
|
105
125
|
| Native Team lifecycle | **partial** | File pipeline is SoT; hook is single lifecycle writer |
|
|
106
126
|
|
|
107
127
|
Do not pin OpenCode CLI or TUI versions in the contract.
|
|
@@ -139,15 +159,18 @@ row; the job asserts its resolved rules with `opencode debug agents` before the
|
|
|
139
159
|
| [`OPENCODE-COMPATIBILITY.md`](./OPENCODE-COMPATIBILITY.md) | Evidence and go/no-go |
|
|
140
160
|
| [`PRESET-CONTRIBUTION.md`](./PRESET-CONTRIBUTION.md) | Sibling adapter authoring |
|
|
141
161
|
|
|
142
|
-
Validate after preset edits:
|
|
162
|
+
Validate after preset edits (loop):
|
|
143
163
|
|
|
144
164
|
```bash
|
|
145
165
|
cd packages/ai-rules
|
|
146
|
-
|
|
166
|
+
yarn check:changed
|
|
167
|
+
yarn check:fast
|
|
147
168
|
node scripts/check-opencode-platform-contract.mjs --self-test
|
|
148
169
|
node scripts/check-opencode-adapter-map.mjs --self-test
|
|
149
170
|
```
|
|
150
171
|
|
|
172
|
+
The full `scripts/check-preset-structure.sh` composite runs in `yarn release:gate` before a release.
|
|
173
|
+
|
|
151
174
|
## Released stacks
|
|
152
175
|
|
|
153
176
|
`init opencode --preset <stack>` and `init multi --preset <stack>` install OpenCode for every stack in `presets/opencode/platform-contract.json` `releasedStacks` (all 11). Per-stack always-on rules and `permission.edit` allow-lists live in `scripts/lib/stack-platform-profiles.mjs`. Derive with `node scripts/generate-opencode.mjs --stack <stack>` from Cursor SoT — never from Claude.
|
package/docs/PLATFORMS.md
CHANGED
|
@@ -12,7 +12,7 @@ macOS and Linux are fully supported. Windows is supported with the prerequisites
|
|
|
12
12
|
| Node.js for the `team-db` SQLite projection | **>= 22.13** | `team-db.mjs` uses `node:sqlite`. Below 22.13 the projection degrades to file-only with one diagnostic line; the rest of the engine keeps working. |
|
|
13
13
|
| `git` | required | Install state, generated-file drift, and every gate read the work tree through `git`. |
|
|
14
14
|
| `bash` | required for the chain hook only | The Cursor/Claude guard and the hook resolver run through Node. `chain-team-phases.sh` itself is still a bash script. |
|
|
15
|
-
| `perl` |
|
|
15
|
+
| `perl` | not required | The engine lock is a sibling directory `<lock>.d` (`mkdir` + `owner.json`), so the same path excludes every process on a shared checkout. No `flock` helper and no shell, so a runtime without `perl` is not a slower path. |
|
|
16
16
|
|
|
17
17
|
### Windows `bash`
|
|
18
18
|
|