@bonesofspring/ai-rules 0.2.63 → 0.2.65
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 +96 -1
- package/README.md +11 -4
- package/bin/cli.js +7 -5
- package/bin/lib/ai-local-drift.js +7 -6
- package/bin/lib/engine-scripts.js +17 -4
- package/bin/lib/engine-upgrade.js +10 -2
- package/bin/lib/manifest-schema.js +12 -0
- package/bin/lib/seed-ai-local-team.js +20 -0
- package/bin/mavis-install.js +4 -3
- package/bin/opencode-install.js +22 -6
- package/bin/zcode-install.js +4 -3
- package/docs/MCP-CATALOG.md +1 -1
- package/docs/OPENCODE-COMPATIBILITY.md +3 -2
- package/docs/OPENCODE.md +22 -2
- package/docs/PRESET-CONTRIBUTION.md +43 -2
- package/docs/TEAM-DB.md +213 -5
- package/docs/openapi/team-db.v1.json +5928 -3045
- package/mcp/defectdojo-mcp.mjs +44 -12
- package/mcp/lib/defectdojo.mjs +57 -2
- package/package.json +27 -15
- package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +279 -0
- package/presets/_shared/ai-local/scripts/process-lease.mjs +576 -0
- package/presets/_shared/ai-local/scripts/processes.mjs +1618 -0
- package/presets/_shared/ai-local/scripts/run.mjs +5 -5
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +784 -7
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +235 -10
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +813 -7
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +397 -4
- package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +86 -10
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +221 -0
- package/presets/_shared/ai-local/scripts/team-db-task-runner.mjs +567 -0
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +2069 -0
- package/presets/_shared/ai-local/scripts/team-db-ui.mjs +750 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +151 -7
- package/presets/_shared/ai-local/scripts/upstream-research.mjs +3 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +7 -2
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +2 -1
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +314 -1
- package/presets/_shared/hooks/guard-shell-command.mjs.tmpl +40 -2
- package/presets/_shared/hooks/run-hook.mjs +2 -1
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/android-kotlin/hooks/run-hook.mjs +2 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/android-kotlin/settings.json +6 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/go/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/go/hooks/run-hook.mjs +2 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/go/settings.json +6 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/ios-swift/hooks/run-hook.mjs +2 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/ios-swift/settings.json +6 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/java/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/java/hooks/run-hook.mjs +2 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/java/settings.json +6 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/mcp-ts/hooks/run-hook.mjs +2 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/mcp-ts/settings.json +6 -1
- package/presets/claude/mol/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/mol/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/mol/hooks/run-hook.mjs +2 -1
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/mol/settings.json +6 -1
- package/presets/claude/next/MCP.md +2 -0
- package/presets/claude/next/REPO_AGENTS.md +2 -0
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/agents/ci-investigator.md +3 -0
- package/presets/claude/next/agents/code-reviewer.md +1 -0
- package/presets/claude/next/agents/debugger.md +3 -0
- package/presets/claude/next/agents/feature-developer.md +3 -0
- package/presets/claude/next/agents/mockup-reviewer.md +4 -1
- package/presets/claude/next/agents/performance-auditor.md +2 -0
- package/presets/claude/next/agents/playwright-test-generator.md +3 -0
- package/presets/claude/next/agents/playwright-test-healer.md +3 -0
- package/presets/claude/next/agents/playwright-test-planner.md +3 -0
- package/presets/claude/next/agents/qa-tester.md +3 -0
- package/presets/claude/next/agents/task-analyst.md +2 -0
- package/presets/claude/next/commands/README.md +6 -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/ui-start.md +78 -0
- package/presets/claude/next/commands/ui-stop.md +71 -0
- package/presets/claude/next/commands/upstream-research.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/next/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/next/hooks/run-hook.mjs +2 -1
- package/presets/claude/next/rules/README.md +2 -1
- package/presets/claude/next/rules/stack/next-app-core.md +1 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/next/rules/tooling-and-review/dev-process-lifecycle.md +43 -0
- package/presets/claude/next/settings.json +6 -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 +314 -1
- package/presets/claude/nuxt/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/nuxt/hooks/run-hook.mjs +2 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/nuxt/settings.json +6 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/php-hexagonal/hooks/run-hook.mjs +2 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/php-hexagonal/settings.json +6 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +315 -2
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/php-laravel/hooks/run-hook.mjs +2 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/php-laravel/settings.json +6 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +314 -1
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/svelte/hooks/run-hook.mjs +2 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +2 -1
- package/presets/claude/svelte/settings.json +6 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/android-kotlin/hooks/run-hook.mjs +2 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/go/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/go/hooks/run-hook.mjs +2 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/ios-swift/hooks/run-hook.mjs +2 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/java/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/java/hooks/run-hook.mjs +2 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/mcp-ts/hooks/run-hook.mjs +2 -1
- package/presets/cursor/mol/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/mol/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/mol/hooks/run-hook.mjs +2 -1
- package/presets/cursor/next/MCP.md +2 -0
- package/presets/cursor/next/REPO_AGENTS.md +2 -0
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/agents/ci-investigator.md +2 -0
- package/presets/cursor/next/agents/code-reviewer.md +1 -0
- package/presets/cursor/next/agents/debugger.md +2 -0
- package/presets/cursor/next/agents/feature-developer.md +2 -0
- package/presets/cursor/next/agents/mockup-reviewer.md +4 -1
- package/presets/cursor/next/agents/performance-auditor.md +2 -0
- package/presets/cursor/next/agents/playwright-test-generator.md +2 -0
- package/presets/cursor/next/agents/playwright-test-healer.md +2 -0
- package/presets/cursor/next/agents/playwright-test-planner.md +2 -0
- package/presets/cursor/next/agents/qa-tester.md +2 -0
- package/presets/cursor/next/agents/task-analyst.md +2 -0
- package/presets/cursor/next/ai-local/rules-library/storybook-dev-compare-figma.md +2 -1
- package/presets/cursor/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/cursor/next/commands/README.md +6 -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/ui-start.md +78 -0
- package/presets/cursor/next/commands/ui-stop.md +71 -0
- package/presets/cursor/next/commands/upstream-research.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/next/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/next/hooks/run-hook.mjs +2 -1
- package/presets/cursor/next/rules/README.md +2 -1
- package/presets/cursor/next/rules/dev-process-lifecycle.mdc +43 -0
- package/presets/cursor/next/rules/next-app-core.mdc +1 -0
- 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 +314 -1
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/nuxt/hooks/run-hook.mjs +2 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/php-hexagonal/hooks/run-hook.mjs +2 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +315 -2
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/php-laravel/hooks/run-hook.mjs +2 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +314 -1
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/svelte/hooks/run-hook.mjs +2 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/go/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/java/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/next/MCP.md +2 -0
- package/presets/mavis/next/REPO_AGENTS.md +2 -0
- package/presets/mavis/next/adapter-map.json +33 -1
- package/presets/mavis/next/agents/build-verifier.md +1 -1
- package/presets/mavis/next/agents/ci-investigator.md +3 -0
- package/presets/mavis/next/agents/code-reviewer.md +1 -0
- package/presets/mavis/next/agents/debugger.md +3 -0
- package/presets/mavis/next/agents/feature-developer.md +3 -0
- package/presets/mavis/next/agents/mockup-reviewer.md +4 -1
- package/presets/mavis/next/agents/performance-auditor.md +2 -0
- package/presets/mavis/next/agents/playwright-test-generator.md +3 -0
- package/presets/mavis/next/agents/playwright-test-healer.md +3 -0
- package/presets/mavis/next/agents/playwright-test-planner.md +3 -0
- package/presets/mavis/next/agents/qa-tester.md +3 -0
- package/presets/mavis/next/agents/task-analyst.md +2 -0
- package/presets/mavis/next/ai-local/rules-library/storybook-dev-compare-figma.md +2 -1
- package/presets/mavis/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/mavis/next/commands/README.md +6 -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/ui-start.md +73 -0
- package/presets/mavis/next/commands/ui-stop.md +66 -0
- package/presets/mavis/next/commands/upstream-research.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/next/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/next/rules/dev-process-lifecycle.md +38 -0
- package/presets/mavis/next/rules/next-app-core.md +1 -0
- 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 +314 -1
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +315 -2
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +2 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +314 -1
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/android-kotlin/opencode.json +5 -1
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/go/opencode.json +5 -1
- package/presets/opencode/go/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/ios-swift/opencode.json +5 -1
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/java/opencode.json +5 -1
- package/presets/opencode/java/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/mcp-ts/opencode.json +5 -1
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/mol/opencode.json +4 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +2 -1
- package/presets/opencode/next/MCP.md +2 -0
- package/presets/opencode/next/OPENCODE.md +4 -1
- package/presets/opencode/next/README.md +1 -0
- package/presets/opencode/next/REPO_AGENTS.md +2 -0
- package/presets/opencode/next/adapter-map.json +33 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/ci-investigator.md +3 -0
- package/presets/opencode/next/agents/code-reviewer.md +1 -0
- package/presets/opencode/next/agents/debugger.md +3 -0
- package/presets/opencode/next/agents/feature-developer.md +3 -0
- package/presets/opencode/next/agents/mockup-reviewer.md +4 -1
- package/presets/opencode/next/agents/performance-auditor.md +2 -0
- package/presets/opencode/next/agents/playwright-test-generator.md +3 -0
- package/presets/opencode/next/agents/playwright-test-healer.md +3 -0
- package/presets/opencode/next/agents/playwright-test-planner.md +3 -0
- package/presets/opencode/next/agents/qa-tester.md +3 -0
- package/presets/opencode/next/agents/task-analyst.md +2 -0
- package/presets/opencode/next/ai-local/rules-library/storybook-dev-compare-figma.md +2 -1
- package/presets/opencode/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/opencode/next/commands/README.md +6 -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/ui-start.md +81 -0
- package/presets/opencode/next/commands/ui-stop.md +74 -0
- 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 +314 -1
- package/presets/opencode/next/opencode.json +4 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +2 -1
- package/presets/opencode/next/rules/dev-process-lifecycle.md +38 -0
- package/presets/opencode/next/rules/next-app-core.md +1 -0
- 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 +314 -1
- package/presets/opencode/nuxt/opencode.json +4 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/php-hexagonal/opencode.json +5 -1
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +2 -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 +315 -2
- package/presets/opencode/php-laravel/opencode.json +5 -1
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +2 -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 +314 -1
- package/presets/opencode/svelte/opencode.json +4 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/go/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/java/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/next/MCP.md +2 -0
- package/presets/zcode/next/REPO_AGENTS.md +2 -0
- package/presets/zcode/next/adapter-map.json +33 -1
- package/presets/zcode/next/agents/build-verifier.md +1 -1
- package/presets/zcode/next/agents/ci-investigator.md +3 -0
- package/presets/zcode/next/agents/code-reviewer.md +1 -0
- package/presets/zcode/next/agents/debugger.md +3 -0
- package/presets/zcode/next/agents/feature-developer.md +3 -0
- package/presets/zcode/next/agents/mockup-reviewer.md +4 -1
- package/presets/zcode/next/agents/performance-auditor.md +2 -0
- package/presets/zcode/next/agents/playwright-test-generator.md +3 -0
- package/presets/zcode/next/agents/playwright-test-healer.md +3 -0
- package/presets/zcode/next/agents/playwright-test-planner.md +3 -0
- package/presets/zcode/next/agents/qa-tester.md +3 -0
- package/presets/zcode/next/agents/task-analyst.md +2 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-dev-compare-figma.md +2 -1
- package/presets/zcode/next/ai-local/rules-library/ui-change-review-gate.md +1 -0
- package/presets/zcode/next/commands/README.md +6 -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/ui-start.md +81 -0
- package/presets/zcode/next/commands/ui-stop.md +74 -0
- package/presets/zcode/next/commands/upstream-research.md +1 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/next/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/next/rules/dev-process-lifecycle.md +38 -0
- package/presets/zcode/next/rules/next-app-core.md +1 -0
- 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 +314 -1
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +315 -2
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +2 -1
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +314 -1
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +2 -1
- package/scripts/aggregate-agent-task-metrics.mjs +48 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.2.65
|
|
4
|
+
|
|
5
|
+
### Agent process manager
|
|
6
|
+
|
|
7
|
+
- **`processes.mjs` gives a checkout one view and one lease protocol.** New engine modules `processes.mjs` and `process-lease.mjs` (both in `ENGINE_SCRIPTS`, mirrored to `.ai.local/scripts/`) own `.ai.local/.processes/`: `leases/<name>.json` created with `open(…, 'wx')`, a single-line `events.jsonl`, and a `.reclaim/` guard per lease. `acquire` / `release` / `run` / `list` / `status` / `watch` / `scan` / `doctor` / `stop` / `serve`; exit codes are `0` ok, `1` held/timeout, `2` usage, `3` fatal, `4` refused.
|
|
8
|
+
- **Liveness defeats pid reuse; release is token-owned.** A holder is live only while its pid is alive **and** the recorded `pidStart` (`ps -o lstart=`, `/proc/<pid>/stat` without `ps`) still matches; a heartbeat never makes a live holder stale, and a different start time is reclaimed on the first attempt inside `.reclaim/<name>`. `release` refuses a foreign token, and `run` releases in `finally` and exits with the child's status (`128 + signo`).
|
|
9
|
+
- **One snapshot over the markers that already exist.** `list` / `watch` / `serve` read own leases plus `preset-tree` (`.preset-tree-lock/owner.json`), `dev:<name>` (`.ai.local/.dev/*.json`), `team-db-serve` (`.ai.local/.ui/api.json`), `scheduler`, `runner:<slug>` (active runs only), and `git-index`; a missing source is skipped and a malformed one is a `warnings[]` entry. `watch` refreshes every second (`--once`, `--json`, `--no-color`), and `serve` answers `GET /api/v1/processes`, an SSE `/api/v1/processes/stream` (initial snapshot, then one event per change), and a minimal HTML table on `127.0.0.1:4179`.
|
|
10
|
+
- **`scan` shows what bypasses the leases, `doctor` reports what is broken.** `scan` reads listening TCP ports (`lsof`, `ss` fallback) and the known command shapes (`fix-generated.mjs`, `check-preset-*.sh`, `team-db.mjs serve`, `storybook`, `next dev`, Playwright browsers), labels a lease-covered pid `leased` and everything else `foreign`; `doctor` exits non-zero on a stale lease, a dead marker, or a lease port with no listener. `stop` re-proves ownership (live pid + matching `pidStart` + command line or lease port) and never signals an unproven pid.
|
|
11
|
+
- **One lifecycle CLI.** `processes.mjs start` spawns a detached child, records a `port` lease, and reuses a live lease or a foreign listener; `list` / `status` / `stop` are the same CLI. `stop --task <slug>` filters leases by task, and the chain postflight calls it directly.
|
|
12
|
+
- **Wiring and fixtures.** `check:processes` runs `test-process-lease.mjs`, `test-process-adapters.mjs`, and `test-process-scan.mjs`; the composite gains the `process lease fixtures` and `process view fixtures` rows; `docs/PRESET-CONTRIBUTION.md` gains an "Agent process manager" section and the `dev-process-lifecycle` rule tells agents to start and inspect work through the manager.
|
|
13
|
+
|
|
14
|
+
### Preset-tree lock and the loop
|
|
15
|
+
|
|
16
|
+
- **The preset-tree lock fails closed and can wait.** A fatal lock reason (`unwritable` / `reclaim-failed`) now stops `fix:generated` and both shell gates with exit 1 before any work instead of "continuing unlocked"; `--allow-unlocked` / `AI_RULES_ALLOW_UNLOCKED=1` is the loud opt-in. `--wait <ms>` / `AI_RULES_LOCK_WAIT_MS` polls every 500 ms (default fail-fast) in `fix:generated` and `run-locked.mjs` only — the shell gates stay fail-fast — and a dead named owner is still reclaimed on the first attempt. Every acquire result carries `fatal` and `code`; read `fatal` before `skipped`.
|
|
17
|
+
- **Read-side gates take the lock.** New `run-locked.mjs` acquires, runs the child with inherited stdio, releases in `finally`, and exits with the child's status (`128 + signo` on a signal death). Eleven package gates (generated drift, twin map, twin drift, token budget, leakage, frontmatter, consumer links, shared-core drift, reachability, i18n, CLI init clean) run through it; the composites and `preset:loop` are never wrapped.
|
|
18
|
+
- **`yarn preset:loop`** runs `fix:generated && check:changed && check:fast` in series and holds no lock across phases.
|
|
19
|
+
- **The delta classifier names four preset domains.** `check-preset-delta.mjs` splits the old `preset-core` into `preset-content`, `preset-generator`, `preset-install` and `preset-tooling`: a generator change demands `fix-generated` + drift + twin drift + init-clean, an install change demands init-clean + drift, a tooling change demands only the classifier `--self-test`, and `.ai.local/**` no longer counts as `docs`. `release:gate` is reserved for `preset-content`, `preset-generator` and release changes.
|
|
20
|
+
- **The engine mirror replaces atomically.** `mirrorEngineScripts` writes a same-directory temp file and renames it over `.ai.local/scripts/<name>`, so a live engine process never reads a torn `run.mjs` / `lock.mjs`.
|
|
21
|
+
|
|
22
|
+
### Dev process lifecycle
|
|
23
|
+
|
|
24
|
+
- **`processes.mjs start` owns long-lived local servers.** It reuses a live lease or a foreign listener and spawns only on a free port, detached in its own process group; the lease `.ai.local/.processes/leases/<name>.json` records pid + start time, port, command, cwd, and task. `stop` proves ownership, clears stale leases, and offers `--task` cleanup.
|
|
25
|
+
- **The `dev-process-lifecycle` rule (next).** Reuse before start, own what you start, stop when done, never mass-kill unowned processes; the browser section covers the single-instance Playwright MCP profile, `--isolated` for one-off work, and the shared-Chrome CDP recipe launched through `processes.mjs start` so task-end cleanup closes only that instance. Wired into the implementer and e2e zone rules, the Storybook Figma-compare seed, `playwright-agents`, the five `MCP.md` files, and the root `AGENTS.md` entry. The description names the trigger so the main session can pull the rule on demand.
|
|
26
|
+
- **The chain postflight stops the task's servers.** When `status.json` reaches `completed` or `blocked`, the postflight runs `processes.mjs stop --task <slug>` in a bounded 8 s child; ownership refusal is a warning, never a hook failure. Manual sessions keep the rule.
|
|
27
|
+
- **The shell guard probes the port and always asks on mass-kill.** A per-stack `guard-ports.json` names the dev-server command shape and the ports to probe; an explicit `--port` probes that port only, and `pkill` / `killall` / `xargs kill` always ask. OpenCode enforces the same mass-kill family through `permission.bash` (`ask`); Mavis and ZCode have no shell hook, so the rule remains their only control.
|
|
28
|
+
- **Fixtures.** `test-dev-processes.mjs` (9 cases) and `test-guard-shell-command.mjs` (8 cases) run from `check-preset-structure.sh`; the engine mirror and CLI goldens are regenerated.
|
|
29
|
+
|
|
30
|
+
### Dashboard lifecycle
|
|
31
|
+
|
|
32
|
+
- **`team-db.mjs ui start|stop|status|restart`.** The shipped no-build dashboard gets a lifecycle. `start` is probe-first and idempotent: a healthy server for this repository is a no-op with the same pid, and only a free port spawns a detached `serve` and writes `.ai.local/.ui/api.json` atomically with a hashed `rootId`. `stop` re-proves ownership from the live command line (pid **and** a `team-db.mjs serve` match), signals that leader pid only, escalates to `SIGKILL` after the 5 s `SIGTERM` window, and keeps the marker with exit 1 if the process survives. Exit codes are `0` ok/no-op, `1` refusal, `2` start failure, `3` usage; `--allow-remote` is refused, and the scheduler timer stays a separate foreground process. No Docker, no build step, no new runtime dependency.
|
|
33
|
+
- **Two `next` commands.** `/ui-start` and `/ui-stop` ship on the `next` stack — one authored pair, ten generated twins — while every other stack runs the verb directly, with `team-db.mjs serve` as the fallback for a fork that predates it. `ai-rules update --fix` is the upgrade step; a plain `update` leaves a stale engine module that answers `ui` with exit 3.
|
|
34
|
+
- **The dashboard closes task delete and a read-only tracker view.** The delete sits behind a confirmation, announces the `200` in the page-level live region with focus back on the list heading, and surfaces `409 E_ACTIVE_TASK` with its `activeSlug` in the detail live region; a third nav tab lists tracker items with the item panel and the queue, and carries no create, update, enqueue or cancel control. The task surface keeps a named two-call mutating allowlist (`POST /api/v1/sync`, `DELETE /api/v1/tasks/{slug}`) beside the four enumerated jobs writes, and the shipped seeder git-ignores `.ui/`.
|
|
35
|
+
- **`/health.rootId`.** One additive, optional field — `sha256(resolved team root).slice(0, 12)` — turns the cross-root case into `E_UI_OTHER_ROOT`. The contract document is regenerated by the checker; no route, operation, or error code changes.
|
|
36
|
+
|
|
37
|
+
### Tracker
|
|
38
|
+
|
|
39
|
+
- **The tracker replaces the backlog module and renames its paths.** `.ai.local/team/tracker/` (`items/`, `queue/`, `links/`), `/api/v1/tracker*`, the `tracker` CLI verb family, the `tracker_items`/`tracker_queue`/`tracker_item_tasks` projection tables and the `/tracker` operator pages replace every `backlog` name. **Backlog is now one stored status** (`backlog`), the captured state that is not launchable until promoted to `planned`.
|
|
40
|
+
- **The file-authoritative plan store.** `tracker/items/<id>.json` and `tracker/links/` are committed; `tracker/queue/` and `team/task-runs/` are runtime state. `team-db.mjs tracker` ships the verb family `add`, `set`, `show`, `list`, `ready`, `validate`, `import` (the versioned envelope, idempotent by id, `--dry-run`), `enqueue`, `cancel`, `drain --claim`, `recover`, `prune`, `link`, `delete`, `adopt` and `migrate-ids`. Every operational status (`effectiveStatus`, `ready`, `waitingOn`) is derived from the items, links, queue entries and the hook-owned task state, never written; the deterministic total order is `priority` ascending (lower runs first, default 5) → `createdAt` → `id`.
|
|
41
|
+
- **The launch queue.** `tracker/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. `tracker 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_TRACKER_DRAIN_DISABLE=1` stops only the auto-drain. A claim older than 90 s with no task row is released on the next drain or by `tracker recover`.
|
|
42
|
+
- **Tracker CRUD.** The item id is an opaque tracker key, the UI gains `/tracker/new`, `/tracker/[id]/edit`, a hard delete with active-link/live-queue protection, and the full item form; the API gains `DELETE /api/v1/tracker/{id}`. The item id no longer becomes the team-task slug.
|
|
43
|
+
- **Item ↔ task links.** `tracker/links/<itemId>--<taskSlug>.json` plus its prompt is the file-authoritative relation; one item may be closed by several tasks. A new `tracker_item_tasks` table, a link walker, `tracker link add|set|remove|list|adopt`, and the item detail `tasks[]` expose the relation. Legacy `tasks/<itemId>/` folders remain readable as implicit links.
|
|
44
|
+
- **Start/stop/continue.** The item detail starts a new task as one link + queue request (the queue entry carries its own `taskSlug`/`linkId`); the hook bootstrap copies the link prompt into `tasks/<taskSlug>/` and records the tracker provenance. Stop cancels a request and writes a per-task `STOP` sentinel; Continue starts the seeded `team/runner.json` supervisor (`task-run` verbs) with no shell, a confined cwd, an env allow-list, a timeout and a process-group kill.
|
|
45
|
+
- **`ui start` is probe-first.** A server that already answers `/health` for this repository is the no-op: same pid, untouched `startedAt`, nothing spawned. Only a free port leads to a detached `serve` and the marker; the path writes the marker plus at most one bounded `sync` (the missing-projection repair), never `migrate-tasks` and never `team/runner.json`. `ui restart` is the explicit stop-then-start verb.
|
|
46
|
+
- **Contract and projection.** The OpenAPI document moves to 43 operations and 14 mutations, migration `0004-tracker` renames the backlog tables and carries `tracker_item_tasks`, and the app operations table/DTO/mappers/service/store/forms follow the tracker schemas.
|
|
47
|
+
|
|
48
|
+
### Upstream research
|
|
49
|
+
|
|
50
|
+
- **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.
|
|
51
|
+
- **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.
|
|
52
|
+
|
|
53
|
+
### Scheduler and pipeline
|
|
54
|
+
|
|
55
|
+
- **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.
|
|
56
|
+
- **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.
|
|
57
|
+
- **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.
|
|
58
|
+
- **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.
|
|
59
|
+
|
|
60
|
+
### Preset tooling
|
|
61
|
+
|
|
62
|
+
- **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.
|
|
63
|
+
- **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.
|
|
64
|
+
|
|
65
|
+
### Install and upgrade
|
|
66
|
+
|
|
67
|
+
- **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.
|
|
68
|
+
- **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.
|
|
69
|
+
|
|
70
|
+
### DefectDojo import scan
|
|
71
|
+
|
|
72
|
+
- **`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.
|
|
73
|
+
|
|
74
|
+
### Operator app
|
|
75
|
+
|
|
76
|
+
- **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.
|
|
77
|
+
- **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`.
|
|
78
|
+
- **Tracker actions validate in place.** The dialog renders a field error through the DS control (`errorMessage`/`note`) and takes `ITEM_ID_PATTERN` from the API layer, so the client and the service share one item-id grammar.
|
|
79
|
+
|
|
80
|
+
### Gates
|
|
81
|
+
|
|
82
|
+
- **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. The tracker family (`test-team-db-tracker.mjs`, `-tracker-order`, `-tracker-project`, `-tracker-queue`, `-tracker-import`, `-task-runner`) and `test-team-db-ui.mjs` join `yarn test:team-db`, and `test-team-db-schema.mjs` covers migration `0004-tracker`. Platform smoke runs `doctor` on the five-platform multi install instead of a separate Cursor project.
|
|
83
|
+
|
|
84
|
+
## 0.2.64
|
|
85
|
+
|
|
86
|
+
### Composed-order gate, metrics bootstrap, and the shipped aggregator
|
|
87
|
+
|
|
88
|
+
- **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.
|
|
89
|
+
- **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`.
|
|
90
|
+
- **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`.
|
|
91
|
+
- **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.
|
|
92
|
+
- **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.
|
|
93
|
+
|
|
94
|
+
### OpenCode task-status plugin
|
|
95
|
+
|
|
96
|
+
- **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.
|
|
97
|
+
- **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.
|
|
98
|
+
- **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.
|
|
4
99
|
|
|
5
100
|
### Preset update notice
|
|
6
101
|
|
package/README.md
CHANGED
|
@@ -25,9 +25,11 @@ Run `init` from the **app root** (`--cwd` if needed). Default `--preset` is `nex
|
|
|
25
25
|
| Root agents | `REPO_AGENTS.md` → `AGENTS.md` (same file on all five; ZCode loads it natively) | | | | |
|
|
26
26
|
| `/task` artifacts | **`.ai.local/team/`** (shared; templates refreshed; `tasks/<slug>/` never overwritten) | | | |
|
|
27
27
|
| Template drift | **`.ai.local/.template-base.json`** (shared; one record per tree of files that hold a shipped template byte; `update` prints one drift line, `update --merge-ai-local` fast-forwards a file only when its recorded base still matches and reports the rest) | | | |
|
|
28
|
-
| Self-learning engine | **`.ai.local/scripts/`** (shared;
|
|
28
|
+
| Self-learning engine | **`.ai.local/scripts/`** (shared; twenty-two scripts — the six self-learning engine modules, `manifest.mjs`, the ten `team-db*.mjs` projection, scheduler and lifecycle modules, the `upstream-research.mjs` review, the read-only `check-write-scope.mjs` write audit, the `aggregate-agent-task-metrics.mjs` aggregator, and the `processes.mjs` + `process-lease.mjs` process manager; 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.
|
|
@@ -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 tracker list # the ordered tracker: items, ready set, waiting-on
|
|
142
|
+
node .ai.local/scripts/team-db.mjs tracker enqueue --file <path|-> # record one launch request
|
|
143
|
+
node .ai.local/scripts/team-db.mjs tracker 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 fourteen documented mutations
|
|
152
|
+
(`POST /api/v1/sync`, the task delete, the four job writes and the eight tracker 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
|
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
|
}
|
|
@@ -13,10 +13,10 @@ const path = require('path');
|
|
|
13
13
|
* `.ai.local/team/tasks/<slug>/artifact-manifest.json`; producers call it
|
|
14
14
|
* instead of patching the JSON, which is a whole-file merge target.
|
|
15
15
|
*
|
|
16
|
-
* The
|
|
17
|
-
* read-only dashboard,
|
|
18
|
-
* are loaded by it on demand, so a runtime
|
|
19
|
-
* them.
|
|
16
|
+
* The `team-db*.mjs` modules are the rebuildable SQLite projection, its
|
|
17
|
+
* read-only dashboard, the scheduler, and the `ui` lifecycle supervisor.
|
|
18
|
+
* `team-db.mjs` is the CLI; the others are loaded by it on demand, so a runtime
|
|
19
|
+
* without `node:sqlite` never imports them.
|
|
20
20
|
*/
|
|
21
21
|
const ENGINE_SCRIPTS = [
|
|
22
22
|
'run.mjs',
|
|
@@ -27,6 +27,9 @@ const ENGINE_SCRIPTS = [
|
|
|
27
27
|
'efficacy-oracle.mjs',
|
|
28
28
|
'manifest.mjs',
|
|
29
29
|
'team-db.mjs',
|
|
30
|
+
'team-db-ui.mjs',
|
|
31
|
+
'team-db-tracker.mjs',
|
|
32
|
+
'team-db-task-runner.mjs',
|
|
30
33
|
'team-db-schema.mjs',
|
|
31
34
|
'team-db-project.mjs',
|
|
32
35
|
'team-db-api.mjs',
|
|
@@ -39,6 +42,16 @@ const ENGINE_SCRIPTS = [
|
|
|
39
42
|
// Read-only post-step write-scope audit used by build-verifier and code-reviewer.
|
|
40
43
|
// Shells out to git, so it is not part of the self-learning loop module set.
|
|
41
44
|
'check-write-scope.mjs',
|
|
45
|
+
// Process leases and the one view over them (`start|acquire|run|list|watch|
|
|
46
|
+
// scan|doctor|stop|serve`). `processes.mjs` owns a detached dev-server start
|
|
47
|
+
// and reuses `process-lease.mjs` for the protocol; both spawn `ps`/`lsof` and
|
|
48
|
+
// `processes.mjs` listens on loopback, so they are process tooling, not part
|
|
49
|
+
// of the self-learning loop modules.
|
|
50
|
+
'process-lease.mjs',
|
|
51
|
+
'processes.mjs',
|
|
52
|
+
// Role/task metrics aggregation used by technical-retro; ships with the engine
|
|
53
|
+
// so a consumer can run it from `.ai.local/scripts/` without the package.
|
|
54
|
+
'aggregate-agent-task-metrics.mjs',
|
|
42
55
|
];
|
|
43
56
|
|
|
44
57
|
/** 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 };
|
|
@@ -37,9 +37,16 @@ const AI_LOCAL_GITIGNORE = [
|
|
|
37
37
|
'# Scheduler runtime state; jobs.json stays tracked (jobs as code).',
|
|
38
38
|
'team/scheduler/runs/',
|
|
39
39
|
'team/scheduler/state.json',
|
|
40
|
+
'# Tracker launch queue and opt-in runner runtime state; items and links stay tracked.',
|
|
41
|
+
'team/tracker/queue/',
|
|
42
|
+
'team/task-runs/',
|
|
40
43
|
'# Per-step write-scope baselines; derived from git, never a project input.',
|
|
41
44
|
'team/.write-scope/',
|
|
42
45
|
'team/upstream/cursor.json',
|
|
46
|
+
'# Dashboard lifecycle marker (`.ai.local/.ui/api.json`); local runtime state, never commit.',
|
|
47
|
+
'.ui/',
|
|
48
|
+
'# Dev-server lifecycle markers (`.ai.local/.dev/<name>.json`); local runtime state, never commit.',
|
|
49
|
+
'.dev/',
|
|
43
50
|
'',
|
|
44
51
|
].join('\n');
|
|
45
52
|
const POINTER_README = `# Agent team artifacts moved
|
|
@@ -357,6 +364,19 @@ function copyTemplates(presetTeamSrc, dest) {
|
|
|
357
364
|
copyFile(source, target);
|
|
358
365
|
written.push(`.ai.local/team/upstream/${name}`);
|
|
359
366
|
}
|
|
367
|
+
// The shipped weekly `upstream-research` job seeds only when absent, like the
|
|
368
|
+
// research data above: the template carries the definition the docs advertise,
|
|
369
|
+
// and an operator-edited `scheduler/jobs.json` (tracked on purpose — jobs as
|
|
370
|
+
// code) is never overwritten. The scheduler owns the file under
|
|
371
|
+
// `scheduler/`; the template lives beside the other upstream templates.
|
|
372
|
+
{
|
|
373
|
+
const jobsSource = path.join(upstreamSrc, 'jobs.json');
|
|
374
|
+
const jobsTarget = path.join(dest, 'scheduler', 'jobs.json');
|
|
375
|
+
if (fs.existsSync(jobsSource) && !fs.existsSync(jobsTarget)) {
|
|
376
|
+
copyFile(jobsSource, jobsTarget);
|
|
377
|
+
written.push('.ai.local/team/scheduler/jobs.json');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
360
380
|
const gitkeepSrc = path.join(presetTeamSrc, 'tasks', '.gitkeep');
|
|
361
381
|
if (fs.existsSync(gitkeepSrc) && !hasConsumerTaskSlugs(path.join(dest, 'tasks'))) {
|
|
362
382
|
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,9 +270,9 @@ function cmdInitMavis({ preset, cwdOption, helpers }) {
|
|
|
269
270
|
managedFiles[item.rel] = sha256File(item.dest);
|
|
270
271
|
}
|
|
271
272
|
const manifest = {
|
|
272
|
-
//
|
|
273
|
-
// files, so `doctor` and update pruning can trust it.
|
|
274
|
-
schemaVersion:
|
|
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,
|
|
275
276
|
packageVersion: packageVersion(packageRoot),
|
|
276
277
|
platform: 'mavis',
|
|
277
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,16 +479,19 @@ function cmdInitOpencode({ preset, cwdOption, helpers }) {
|
|
|
466
479
|
managedFiles[item.rel] = sha256File(item.dest);
|
|
467
480
|
}
|
|
468
481
|
const manifest = {
|
|
469
|
-
//
|
|
470
|
-
// files, so `doctor` and update pruning can trust it.
|
|
471
|
-
schemaVersion:
|
|
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,
|
|
472
485
|
packageVersion: packageVersion(packageRoot),
|
|
473
486
|
platform: 'opencode',
|
|
474
487
|
preset: stack,
|
|
475
488
|
installedAt: new Date().toISOString(),
|
|
476
489
|
managedFiles,
|
|
477
490
|
mergedConfigs,
|
|
478
|
-
managedDirectories:
|
|
491
|
+
managedDirectories: [
|
|
492
|
+
...(contract.directoryMappings || []).map((entry) => entry.destination),
|
|
493
|
+
...(contract.sharedDirectoryMappings || []).map((entry) => entry.destination),
|
|
494
|
+
],
|
|
479
495
|
shippedMcpServerIds: plan.mcp ? shippedMcpIds(plan.mcp.source) : [],
|
|
480
496
|
docsSeed: seeded
|
|
481
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,9 +367,9 @@ function cmdInitZcode({ preset, cwdOption, helpers }) {
|
|
|
366
367
|
managedFiles[item.rel] = sha256File(item.dest);
|
|
367
368
|
}
|
|
368
369
|
const manifest = {
|
|
369
|
-
//
|
|
370
|
-
// files, so `doctor` and update pruning can trust it.
|
|
371
|
-
schemaVersion:
|
|
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,
|
|
372
373
|
packageVersion: packageVersion(packageRoot),
|
|
373
374
|
platform: 'zcode',
|
|
374
375
|
preset: stack,
|
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.
|