@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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The OpenAPI 3.1 document for the team-db API: reads plus
|
|
3
|
-
* mutations (the idempotent rescan, the confirmed task delete,
|
|
4
|
-
*
|
|
2
|
+
* The OpenAPI 3.1 document for the team-db API: reads plus fourteen bounded
|
|
3
|
+
* mutations (the idempotent rescan, the confirmed task delete, the four job
|
|
4
|
+
* writes, and the eight tracker writes: item create/update/delete, queue
|
|
5
|
+
* enqueue/cancel, task start/stop/continue).
|
|
5
6
|
*
|
|
6
7
|
* This module is the single source of the checked-in
|
|
7
8
|
* `packages/ai-rules/docs/openapi/team-db.v1.json`: `check-team-db-contract.mjs
|
|
@@ -16,6 +17,16 @@
|
|
|
16
17
|
|
|
17
18
|
// The run-reason vocabulary is the scheduler's own list: one source, no drift.
|
|
18
19
|
import { REASON_CODES } from './team-db-scheduler.mjs';
|
|
20
|
+
// The tracker vocabularies are the engine's own lists: one source, no drift.
|
|
21
|
+
import {
|
|
22
|
+
EFFECTIVE_ENTRY_STATUSES,
|
|
23
|
+
EFFECTIVE_ITEM_STATUSES,
|
|
24
|
+
ENTRY_HISTORY_TYPES,
|
|
25
|
+
ENTRY_STATUSES,
|
|
26
|
+
ITEM_HISTORY_TYPES,
|
|
27
|
+
ITEM_STATUSES,
|
|
28
|
+
ITEM_TYPES,
|
|
29
|
+
} from './team-db-tracker.mjs';
|
|
19
30
|
|
|
20
31
|
export const API_MAJOR = 1;
|
|
21
32
|
export const API_VERSION = '1.0.0';
|
|
@@ -23,6 +34,17 @@ export const OPENAPI_VERSION = '3.1.0';
|
|
|
23
34
|
export const OPENAPI_JSON_SCHEMA_DIALECT = 'https://json-schema.org/draft/2020-12/schema';
|
|
24
35
|
export const OPENAPI_SERVER_URL = 'http://127.0.0.1:4178';
|
|
25
36
|
|
|
37
|
+
/** The tracker vocabularies, in the engine's declaration order. */
|
|
38
|
+
export const TRACKER_ITEM_STATUS = [...ITEM_STATUSES];
|
|
39
|
+
export const TRACKER_EFFECTIVE_ITEM_STATUS = [...EFFECTIVE_ITEM_STATUSES];
|
|
40
|
+
export const TRACKER_ENTRY_STATUS = [...ENTRY_STATUSES];
|
|
41
|
+
export const TRACKER_EFFECTIVE_ENTRY_STATUS = [...EFFECTIVE_ENTRY_STATUSES];
|
|
42
|
+
export const TRACKER_ITEM_TYPES = [...ITEM_TYPES];
|
|
43
|
+
export const TRACKER_ITEM_HISTORY_TYPES = [...ITEM_HISTORY_TYPES];
|
|
44
|
+
export const TRACKER_ENTRY_HISTORY_TYPES = [...ENTRY_HISTORY_TYPES];
|
|
45
|
+
/** One history schema serves both stores: item and entry event types united. */
|
|
46
|
+
export const TRACKER_HISTORY_TYPES = [...new Set([...TRACKER_ITEM_HISTORY_TYPES, ...TRACKER_ENTRY_HISTORY_TYPES])];
|
|
47
|
+
|
|
26
48
|
/** Mirrors `SLUG_RE` in `team-db-project.mjs`; a path parameter, never a file path. */
|
|
27
49
|
export const SLUG_PATTERN = '^[a-z0-9]+(?:-[a-z0-9]+)*$';
|
|
28
50
|
export const JOB_ID_PATTERN = '^[a-z0-9]+(?:-[a-z0-9]+)*$';
|
|
@@ -614,6 +636,12 @@ const schemas = {
|
|
|
614
636
|
Health: object(
|
|
615
637
|
{
|
|
616
638
|
status: { type: 'string', enum: ['ok', 'degraded'] },
|
|
639
|
+
rootId: {
|
|
640
|
+
type: 'string',
|
|
641
|
+
pattern: '^[0-9a-f]{12}$',
|
|
642
|
+
description:
|
|
643
|
+
'Identity of the repository this server projects: the first 12 hex characters of sha256 of the resolved team root. A hash, never a path. Additive and optional — a v1 consumer must not require it, and its absence means "no identity", never a mismatch.',
|
|
644
|
+
},
|
|
617
645
|
db: object(
|
|
618
646
|
{
|
|
619
647
|
file: { type: 'string' },
|
|
@@ -634,7 +662,7 @@ const schemas = {
|
|
|
634
662
|
projectedAt: nullable('string'),
|
|
635
663
|
capabilities: {
|
|
636
664
|
type: 'array',
|
|
637
|
-
items: { type: 'string', enum: ['sync', 'delete', 'jobs', 'schedule'] },
|
|
665
|
+
items: { type: 'string', enum: ['sync', 'delete', 'jobs', 'schedule', 'tracker'] },
|
|
638
666
|
},
|
|
639
667
|
scheduler: object(
|
|
640
668
|
{
|
|
@@ -981,6 +1009,329 @@ const schemas = {
|
|
|
981
1009
|
},
|
|
982
1010
|
['requested', 'requestedAt', 'schedulerOnline'],
|
|
983
1011
|
),
|
|
1012
|
+
TrackerDependency: object(
|
|
1013
|
+
{
|
|
1014
|
+
id: { type: 'integer', minimum: 1 },
|
|
1015
|
+
title: { type: 'string' },
|
|
1016
|
+
// The effective status of the related item, what an operator sees.
|
|
1017
|
+
status: { type: 'string', enum: TRACKER_EFFECTIVE_ITEM_STATUS },
|
|
1018
|
+
satisfied: { type: 'boolean' },
|
|
1019
|
+
},
|
|
1020
|
+
['id', 'title', 'status', 'satisfied'],
|
|
1021
|
+
),
|
|
1022
|
+
TrackerHistoryEntry: object(
|
|
1023
|
+
{
|
|
1024
|
+
at: { type: 'string' },
|
|
1025
|
+
type: { type: 'string', enum: TRACKER_HISTORY_TYPES },
|
|
1026
|
+
actor: { type: 'string' },
|
|
1027
|
+
detail: nullable('string'),
|
|
1028
|
+
},
|
|
1029
|
+
['at', 'type', 'actor', 'detail'],
|
|
1030
|
+
),
|
|
1031
|
+
TrackerItem: object(
|
|
1032
|
+
{
|
|
1033
|
+
schemaVersion: { type: 'integer', const: 1 },
|
|
1034
|
+
id: { type: 'integer', minimum: 1 },
|
|
1035
|
+
revision: { type: 'integer', minimum: 1 },
|
|
1036
|
+
title: { type: 'string' },
|
|
1037
|
+
// The stored decision only; `effectiveStatus` is the derived view.
|
|
1038
|
+
status: { type: 'string', enum: TRACKER_ITEM_STATUS },
|
|
1039
|
+
priority: { type: 'integer', minimum: 0, maximum: 9 },
|
|
1040
|
+
type: { type: 'string', enum: TRACKER_ITEM_TYPES },
|
|
1041
|
+
description: nullable('string'),
|
|
1042
|
+
labels: { type: 'array', items: { type: 'string' } },
|
|
1043
|
+
history: { type: 'array', items: ref('TrackerHistoryEntry') },
|
|
1044
|
+
dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1045
|
+
sourceTask: nullable('string'),
|
|
1046
|
+
sourceRefs: { type: 'array', items: { type: 'string' } },
|
|
1047
|
+
createdAt: { type: 'string' },
|
|
1048
|
+
updatedAt: { type: 'string' },
|
|
1049
|
+
completedAt: nullable('string'),
|
|
1050
|
+
cancelledAt: nullable('string'),
|
|
1051
|
+
cancelReason: nullable('string'),
|
|
1052
|
+
supersededBy: { type: ['integer', 'null'], minimum: 1 },
|
|
1053
|
+
effectiveStatus: { type: 'string', enum: TRACKER_EFFECTIVE_ITEM_STATUS },
|
|
1054
|
+
taskState: nullable('string'),
|
|
1055
|
+
ready: { type: 'boolean' },
|
|
1056
|
+
waitingOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1057
|
+
queueEntryId: nullable('string'),
|
|
1058
|
+
queuedAt: nullable('string'),
|
|
1059
|
+
},
|
|
1060
|
+
[
|
|
1061
|
+
'schemaVersion',
|
|
1062
|
+
'id',
|
|
1063
|
+
'revision',
|
|
1064
|
+
'title',
|
|
1065
|
+
'status',
|
|
1066
|
+
'priority',
|
|
1067
|
+
'type',
|
|
1068
|
+
'description',
|
|
1069
|
+
'labels',
|
|
1070
|
+
'history',
|
|
1071
|
+
'dependsOn',
|
|
1072
|
+
'sourceTask',
|
|
1073
|
+
'sourceRefs',
|
|
1074
|
+
'createdAt',
|
|
1075
|
+
'updatedAt',
|
|
1076
|
+
'completedAt',
|
|
1077
|
+
'cancelledAt',
|
|
1078
|
+
'cancelReason',
|
|
1079
|
+
'supersededBy',
|
|
1080
|
+
'effectiveStatus',
|
|
1081
|
+
'taskState',
|
|
1082
|
+
'ready',
|
|
1083
|
+
'waitingOn',
|
|
1084
|
+
'queueEntryId',
|
|
1085
|
+
'queuedAt',
|
|
1086
|
+
],
|
|
1087
|
+
),
|
|
1088
|
+
TrackerItemSummary: object(
|
|
1089
|
+
{
|
|
1090
|
+
id: { type: 'integer', minimum: 1 },
|
|
1091
|
+
title: { type: 'string' },
|
|
1092
|
+
status: { type: 'string', enum: TRACKER_ITEM_STATUS },
|
|
1093
|
+
effectiveStatus: { type: 'string', enum: TRACKER_EFFECTIVE_ITEM_STATUS },
|
|
1094
|
+
priority: { type: 'integer', minimum: 0, maximum: 9 },
|
|
1095
|
+
type: { type: 'string', enum: TRACKER_ITEM_TYPES },
|
|
1096
|
+
description: nullable('string'),
|
|
1097
|
+
labels: { type: 'array', items: { type: 'string' } },
|
|
1098
|
+
dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1099
|
+
waitingOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1100
|
+
ready: { type: 'boolean' },
|
|
1101
|
+
sourceTask: nullable('string'),
|
|
1102
|
+
sourceRefs: { type: 'array', items: { type: 'string' } },
|
|
1103
|
+
taskState: nullable('string'),
|
|
1104
|
+
createdAt: { type: 'string' },
|
|
1105
|
+
updatedAt: { type: 'string' },
|
|
1106
|
+
queueEntryId: nullable('string'),
|
|
1107
|
+
linkCount: { type: 'integer', minimum: 0 },
|
|
1108
|
+
linkedTasks: { type: 'array', items: { type: 'string' } },
|
|
1109
|
+
},
|
|
1110
|
+
[
|
|
1111
|
+
'id',
|
|
1112
|
+
'title',
|
|
1113
|
+
'status',
|
|
1114
|
+
'effectiveStatus',
|
|
1115
|
+
'priority',
|
|
1116
|
+
'type',
|
|
1117
|
+
'description',
|
|
1118
|
+
'labels',
|
|
1119
|
+
'dependsOn',
|
|
1120
|
+
'waitingOn',
|
|
1121
|
+
'ready',
|
|
1122
|
+
'sourceTask',
|
|
1123
|
+
'sourceRefs',
|
|
1124
|
+
'taskState',
|
|
1125
|
+
'createdAt',
|
|
1126
|
+
'updatedAt',
|
|
1127
|
+
'queueEntryId',
|
|
1128
|
+
'linkCount',
|
|
1129
|
+
'linkedTasks',
|
|
1130
|
+
],
|
|
1131
|
+
),
|
|
1132
|
+
TrackerTaskRun: object(
|
|
1133
|
+
{
|
|
1134
|
+
runId: { type: 'string', pattern: RUN_ID_PATTERN },
|
|
1135
|
+
state: { type: 'string' },
|
|
1136
|
+
startedAt: nullable('string'),
|
|
1137
|
+
finishedAt: nullable('string'),
|
|
1138
|
+
error: nullable('string'),
|
|
1139
|
+
},
|
|
1140
|
+
['runId', 'state', 'startedAt', 'finishedAt', 'error'],
|
|
1141
|
+
),
|
|
1142
|
+
TrackerTaskLink: object(
|
|
1143
|
+
{
|
|
1144
|
+
schemaVersion: { type: 'integer', const: 1 },
|
|
1145
|
+
linkId: { type: 'string', pattern: '^[1-9][0-9]*--[a-z0-9]+(?:-[a-z0-9]+)*$' },
|
|
1146
|
+
itemId: { type: 'integer', minimum: 1 },
|
|
1147
|
+
taskSlug: { type: 'string', pattern: SLUG_PATTERN },
|
|
1148
|
+
entryId: nullable('string'),
|
|
1149
|
+
role: { type: 'string', enum: ['primary', 'follow-up'] },
|
|
1150
|
+
decision: { type: 'string', enum: ['requested', 'stopped', 'unlinked'] },
|
|
1151
|
+
promptPath: nullable('string'),
|
|
1152
|
+
language: nullable('string'),
|
|
1153
|
+
revision: { type: 'integer', minimum: 0 },
|
|
1154
|
+
createdAt: { type: 'string' },
|
|
1155
|
+
updatedAt: { type: 'string' },
|
|
1156
|
+
history: { type: 'array', items: ref('TrackerHistoryEntry') },
|
|
1157
|
+
effectiveState: {
|
|
1158
|
+
type: 'string',
|
|
1159
|
+
enum: ['requested', 'claimed', 'active', 'paused', 'stopped', 'completed', 'failed', 'unlinked'],
|
|
1160
|
+
},
|
|
1161
|
+
taskState: nullable('string'),
|
|
1162
|
+
taskStartAt: nullable('string'),
|
|
1163
|
+
taskEndAt: nullable('string'),
|
|
1164
|
+
entryStatus: nullable('string'),
|
|
1165
|
+
latestRun: { oneOf: [ref('TrackerTaskRun'), { type: 'null' }] },
|
|
1166
|
+
legacy: { type: 'boolean' },
|
|
1167
|
+
},
|
|
1168
|
+
[
|
|
1169
|
+
'schemaVersion',
|
|
1170
|
+
'linkId',
|
|
1171
|
+
'itemId',
|
|
1172
|
+
'taskSlug',
|
|
1173
|
+
'entryId',
|
|
1174
|
+
'role',
|
|
1175
|
+
'decision',
|
|
1176
|
+
'promptPath',
|
|
1177
|
+
'language',
|
|
1178
|
+
'revision',
|
|
1179
|
+
'createdAt',
|
|
1180
|
+
'updatedAt',
|
|
1181
|
+
'history',
|
|
1182
|
+
'effectiveState',
|
|
1183
|
+
'taskState',
|
|
1184
|
+
'taskStartAt',
|
|
1185
|
+
'taskEndAt',
|
|
1186
|
+
'entryStatus',
|
|
1187
|
+
'latestRun',
|
|
1188
|
+
],
|
|
1189
|
+
),
|
|
1190
|
+
TrackerItemDetail: object(
|
|
1191
|
+
{
|
|
1192
|
+
item: ref('TrackerItem'),
|
|
1193
|
+
dependencies: { type: 'array', items: ref('TrackerDependency') },
|
|
1194
|
+
dependents: { type: 'array', items: ref('TrackerDependency') },
|
|
1195
|
+
queue: { type: 'array', items: ref('TrackerQueueEntry') },
|
|
1196
|
+
tasks: { type: 'array', items: ref('TrackerTaskLink') },
|
|
1197
|
+
criticalPath: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1198
|
+
},
|
|
1199
|
+
['item', 'dependencies', 'dependents', 'queue', 'tasks', 'criticalPath'],
|
|
1200
|
+
),
|
|
1201
|
+
TrackerItemList: object(
|
|
1202
|
+
{
|
|
1203
|
+
items: { type: 'array', items: ref('TrackerItemSummary') },
|
|
1204
|
+
total: { type: 'integer', minimum: 0 },
|
|
1205
|
+
limit: { type: 'integer', minimum: 1, maximum: 200 },
|
|
1206
|
+
offset: { type: 'integer', minimum: 0 },
|
|
1207
|
+
nextOffset: nullable('integer'),
|
|
1208
|
+
asOf: { type: 'string' },
|
|
1209
|
+
readyCount: { type: 'integer', minimum: 0 },
|
|
1210
|
+
criticalPathIds: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1211
|
+
maxActive: { type: 'integer', minimum: 1, maximum: 8 },
|
|
1212
|
+
activeCount: { type: 'integer', minimum: 0 },
|
|
1213
|
+
},
|
|
1214
|
+
['items', 'total', 'limit', 'offset', 'nextOffset', 'asOf', 'readyCount', 'criticalPathIds', 'maxActive', 'activeCount'],
|
|
1215
|
+
),
|
|
1216
|
+
TrackerCreateRequest: object(
|
|
1217
|
+
{
|
|
1218
|
+
title: { type: 'string' },
|
|
1219
|
+
status: { type: 'string', enum: TRACKER_ITEM_STATUS },
|
|
1220
|
+
dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1221
|
+
priority: { type: 'integer', minimum: 0, maximum: 9 },
|
|
1222
|
+
sourceTask: { type: 'string', pattern: SLUG_PATTERN },
|
|
1223
|
+
sourceRefs: { type: 'array', items: { type: 'string' } },
|
|
1224
|
+
type: { type: 'string', enum: TRACKER_ITEM_TYPES },
|
|
1225
|
+
description: nullable('string'),
|
|
1226
|
+
labels: { type: 'array', items: { type: 'string' } },
|
|
1227
|
+
},
|
|
1228
|
+
['title'],
|
|
1229
|
+
),
|
|
1230
|
+
TrackerUpdateRequest: object(
|
|
1231
|
+
{
|
|
1232
|
+
revision: { type: 'integer', minimum: 1 },
|
|
1233
|
+
title: { type: 'string' },
|
|
1234
|
+
status: { type: 'string', enum: TRACKER_ITEM_STATUS },
|
|
1235
|
+
priority: { type: 'integer', minimum: 0, maximum: 9 },
|
|
1236
|
+
dependsOn: { type: 'array', items: { type: 'integer', minimum: 1 } },
|
|
1237
|
+
completedAt: nullable('string'),
|
|
1238
|
+
cancelledAt: nullable('string'),
|
|
1239
|
+
cancelReason: { type: 'string' },
|
|
1240
|
+
supersededBy: { type: ['integer', 'null'], minimum: 1 },
|
|
1241
|
+
type: { type: 'string', enum: TRACKER_ITEM_TYPES },
|
|
1242
|
+
description: nullable('string'),
|
|
1243
|
+
labels: { type: 'array', items: { type: 'string' } },
|
|
1244
|
+
},
|
|
1245
|
+
['revision'],
|
|
1246
|
+
),
|
|
1247
|
+
TrackerQueueEntry: object(
|
|
1248
|
+
{
|
|
1249
|
+
entryId: { type: 'string', pattern: RUN_ID_PATTERN },
|
|
1250
|
+
itemId: { type: 'integer', minimum: 1 },
|
|
1251
|
+
taskSlug: { type: 'string', pattern: SLUG_PATTERN },
|
|
1252
|
+
linkId: nullable('string'),
|
|
1253
|
+
// The derived effective entry status; `active`/`done` are never stored.
|
|
1254
|
+
status: { type: 'string', enum: TRACKER_EFFECTIVE_ENTRY_STATUS },
|
|
1255
|
+
reason: { type: 'string' },
|
|
1256
|
+
requestedBy: { type: 'string' },
|
|
1257
|
+
command: nullable('string'),
|
|
1258
|
+
revision: { type: 'integer', minimum: 1 },
|
|
1259
|
+
requestedAt: { type: 'string' },
|
|
1260
|
+
claimedAt: nullable('string'),
|
|
1261
|
+
finishedAt: nullable('string'),
|
|
1262
|
+
history: { type: 'array', items: ref('TrackerHistoryEntry') },
|
|
1263
|
+
itemTitle: { type: 'string' },
|
|
1264
|
+
taskState: nullable('string'),
|
|
1265
|
+
taskStartAt: nullable('string'),
|
|
1266
|
+
taskEndAt: nullable('string'),
|
|
1267
|
+
},
|
|
1268
|
+
[
|
|
1269
|
+
'entryId',
|
|
1270
|
+
'itemId',
|
|
1271
|
+
'taskSlug',
|
|
1272
|
+
'linkId',
|
|
1273
|
+
'status',
|
|
1274
|
+
'reason',
|
|
1275
|
+
'requestedBy',
|
|
1276
|
+
'command',
|
|
1277
|
+
'revision',
|
|
1278
|
+
'requestedAt',
|
|
1279
|
+
'claimedAt',
|
|
1280
|
+
'finishedAt',
|
|
1281
|
+
'history',
|
|
1282
|
+
'itemTitle',
|
|
1283
|
+
'taskState',
|
|
1284
|
+
'taskStartAt',
|
|
1285
|
+
'taskEndAt',
|
|
1286
|
+
],
|
|
1287
|
+
),
|
|
1288
|
+
TrackerQueueList: object(
|
|
1289
|
+
{
|
|
1290
|
+
items: { type: 'array', items: ref('TrackerQueueEntry') },
|
|
1291
|
+
total: { type: 'integer', minimum: 0 },
|
|
1292
|
+
limit: { type: 'integer', minimum: 1, maximum: 200 },
|
|
1293
|
+
offset: { type: 'integer', minimum: 0 },
|
|
1294
|
+
nextOffset: nullable('integer'),
|
|
1295
|
+
asOf: { type: 'string' },
|
|
1296
|
+
activeEntryId: nullable('string'),
|
|
1297
|
+
},
|
|
1298
|
+
['items', 'total', 'limit', 'offset', 'nextOffset', 'asOf', 'activeEntryId'],
|
|
1299
|
+
),
|
|
1300
|
+
TrackerEnqueueRequest: object(
|
|
1301
|
+
{
|
|
1302
|
+
itemId: { type: 'integer', minimum: 1 },
|
|
1303
|
+
taskSlug: { type: 'string', pattern: SLUG_PATTERN },
|
|
1304
|
+
linkId: { type: 'string', pattern: '^[1-9][0-9]*--[a-z0-9]+(?:-[a-z0-9]+)*$' },
|
|
1305
|
+
reason: { type: 'string' },
|
|
1306
|
+
requestedBy: { type: 'string' },
|
|
1307
|
+
command: { type: 'string' },
|
|
1308
|
+
},
|
|
1309
|
+
['itemId', 'reason', 'requestedBy'],
|
|
1310
|
+
),
|
|
1311
|
+
TrackerTaskStartRequest: object(
|
|
1312
|
+
{
|
|
1313
|
+
taskSlug: { type: 'string', pattern: SLUG_PATTERN },
|
|
1314
|
+
prompt: { type: 'string' },
|
|
1315
|
+
language: nullable('string'),
|
|
1316
|
+
role: { type: 'string', enum: ['primary', 'follow-up'] },
|
|
1317
|
+
reason: { type: 'string' },
|
|
1318
|
+
requestedBy: { type: 'string' },
|
|
1319
|
+
},
|
|
1320
|
+
['taskSlug'],
|
|
1321
|
+
),
|
|
1322
|
+
TrackerTaskActionRequest: object(
|
|
1323
|
+
{
|
|
1324
|
+
reason: nullable('string'),
|
|
1325
|
+
requestedBy: { type: 'string' },
|
|
1326
|
+
},
|
|
1327
|
+
[],
|
|
1328
|
+
),
|
|
1329
|
+
TrackerDeleteResult: object(
|
|
1330
|
+
{
|
|
1331
|
+
id: { type: 'integer', minimum: 1 },
|
|
1332
|
+
},
|
|
1333
|
+
['id'],
|
|
1334
|
+
),
|
|
984
1335
|
};
|
|
985
1336
|
|
|
986
1337
|
|
|
@@ -1112,6 +1463,134 @@ const syncRunExample = {
|
|
|
1112
1463
|
error: null,
|
|
1113
1464
|
};
|
|
1114
1465
|
|
|
1466
|
+
const trackerHistoryExample = { at: '2026-11-12T10:00:00.000Z', type: 'created', actor: 'operator', detail: null };
|
|
1467
|
+
|
|
1468
|
+
const trackerQueueEntryExample = {
|
|
1469
|
+
entryId: '20261112T100000Z-1a2b3c4d',
|
|
1470
|
+
itemId: 1,
|
|
1471
|
+
taskSlug: 'ship-tracker-ui',
|
|
1472
|
+
linkId: '1--ship-tracker-ui',
|
|
1473
|
+
status: 'queued',
|
|
1474
|
+
reason: 'ready to ship',
|
|
1475
|
+
requestedBy: 'operator',
|
|
1476
|
+
command: '/task ship-tracker-ui',
|
|
1477
|
+
revision: 2,
|
|
1478
|
+
requestedAt: '2026-11-12T10:00:00.000Z',
|
|
1479
|
+
claimedAt: null,
|
|
1480
|
+
finishedAt: null,
|
|
1481
|
+
history: [{ at: '2026-11-12T10:00:00.000Z', type: 'enqueued', actor: 'operator', detail: null }],
|
|
1482
|
+
itemTitle: 'Ship the tracker operator UI',
|
|
1483
|
+
taskState: null,
|
|
1484
|
+
taskStartAt: null,
|
|
1485
|
+
taskEndAt: null,
|
|
1486
|
+
};
|
|
1487
|
+
|
|
1488
|
+
const trackerTaskLinkExample = {
|
|
1489
|
+
schemaVersion: 1,
|
|
1490
|
+
linkId: '1--ship-tracker-ui',
|
|
1491
|
+
itemId: 1,
|
|
1492
|
+
taskSlug: 'ship-tracker-ui',
|
|
1493
|
+
entryId: '20261112T100000Z-1a2b3c4d',
|
|
1494
|
+
role: 'primary',
|
|
1495
|
+
decision: 'requested',
|
|
1496
|
+
promptPath: 'tracker/links/1--ship-tracker-ui.md',
|
|
1497
|
+
language: 'ru',
|
|
1498
|
+
revision: 1,
|
|
1499
|
+
createdAt: '2026-11-12T09:59:00.000Z',
|
|
1500
|
+
updatedAt: '2026-11-12T10:00:00.000Z',
|
|
1501
|
+
history: [{ at: '2026-11-12T09:59:00.000Z', type: 'created', actor: 'operator', detail: null }],
|
|
1502
|
+
effectiveState: 'requested',
|
|
1503
|
+
taskState: null,
|
|
1504
|
+
taskStartAt: null,
|
|
1505
|
+
taskEndAt: null,
|
|
1506
|
+
entryStatus: 'queued',
|
|
1507
|
+
latestRun: null,
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
const trackerDependencyExample = {
|
|
1511
|
+
id: 2,
|
|
1512
|
+
title: 'The file-authoritative tracker engine',
|
|
1513
|
+
status: 'completed',
|
|
1514
|
+
satisfied: true,
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
const trackerItemExample = {
|
|
1518
|
+
schemaVersion: 1,
|
|
1519
|
+
id: 1,
|
|
1520
|
+
revision: 3,
|
|
1521
|
+
title: 'Ship the tracker operator UI',
|
|
1522
|
+
status: 'planned',
|
|
1523
|
+
priority: 2,
|
|
1524
|
+
type: 'feature',
|
|
1525
|
+
description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
|
|
1526
|
+
labels: ['tracker', 'ui'],
|
|
1527
|
+
history: [trackerHistoryExample],
|
|
1528
|
+
dependsOn: [2],
|
|
1529
|
+
sourceTask: 'task-tracker-tracker-impl',
|
|
1530
|
+
sourceRefs: ['AC-5', 'WP7'],
|
|
1531
|
+
createdAt: '2026-11-10T09:00:00.000Z',
|
|
1532
|
+
updatedAt: '2026-11-12T10:00:00.000Z',
|
|
1533
|
+
completedAt: null,
|
|
1534
|
+
cancelledAt: null,
|
|
1535
|
+
cancelReason: null,
|
|
1536
|
+
supersededBy: null,
|
|
1537
|
+
effectiveStatus: 'queued',
|
|
1538
|
+
taskState: null,
|
|
1539
|
+
ready: true,
|
|
1540
|
+
waitingOn: [],
|
|
1541
|
+
queueEntryId: '20261112T100000Z-1a2b3c4d',
|
|
1542
|
+
queuedAt: '2026-11-12T10:00:00.000Z',
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
const trackerItemSummaryExample = {
|
|
1546
|
+
id: 1,
|
|
1547
|
+
title: 'Ship the tracker operator UI',
|
|
1548
|
+
status: 'planned',
|
|
1549
|
+
effectiveStatus: 'queued',
|
|
1550
|
+
priority: 2,
|
|
1551
|
+
type: 'feature',
|
|
1552
|
+
description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
|
|
1553
|
+
labels: ['tracker', 'ui'],
|
|
1554
|
+
dependsOn: [2],
|
|
1555
|
+
waitingOn: [],
|
|
1556
|
+
ready: true,
|
|
1557
|
+
sourceTask: 'task-tracker-tracker-impl',
|
|
1558
|
+
sourceRefs: ['AC-5', 'WP7'],
|
|
1559
|
+
taskState: null,
|
|
1560
|
+
createdAt: '2026-11-10T09:00:00.000Z',
|
|
1561
|
+
updatedAt: '2026-11-12T10:00:00.000Z',
|
|
1562
|
+
queueEntryId: '20261112T100000Z-1a2b3c4d',
|
|
1563
|
+
linkCount: 1,
|
|
1564
|
+
linkedTasks: ['ship-tracker-ui'],
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
const trackerCreateRequestExample = {
|
|
1568
|
+
title: 'Ship the tracker operator UI',
|
|
1569
|
+
dependsOn: [2],
|
|
1570
|
+
priority: 2,
|
|
1571
|
+
sourceTask: 'task-tracker-tracker-impl',
|
|
1572
|
+
sourceRefs: ['AC-5', 'WP7'],
|
|
1573
|
+
type: 'feature',
|
|
1574
|
+
description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
|
|
1575
|
+
labels: ['tracker', 'ui'],
|
|
1576
|
+
};
|
|
1577
|
+
|
|
1578
|
+
const trackerUpdateRequestExample = {
|
|
1579
|
+
revision: 3,
|
|
1580
|
+
title: 'Ship the tracker operator UI',
|
|
1581
|
+
priority: 1,
|
|
1582
|
+
type: 'feature',
|
|
1583
|
+
description: 'The /tracker list and the /tracker/[id] detail over the existing proxy.',
|
|
1584
|
+
labels: ['tracker', 'ui'],
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
const trackerEnqueueRequestExample = {
|
|
1588
|
+
itemId: 1,
|
|
1589
|
+
reason: 'ready to ship',
|
|
1590
|
+
requestedBy: 'operator',
|
|
1591
|
+
command: '/task ship-tracker-ui',
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1115
1594
|
const EXAMPLES = {
|
|
1116
1595
|
ErrorEnvelope: [{ error: { code: 'E_VALIDATION', message: 'limit must be an integer between 1 and 200', details: { parameter: 'limit' } } }],
|
|
1117
1596
|
TaskSummary: [taskSummaryExample],
|
|
@@ -1226,10 +1705,11 @@ const EXAMPLES = {
|
|
|
1226
1705
|
Health: [
|
|
1227
1706
|
{
|
|
1228
1707
|
status: 'ok',
|
|
1708
|
+
rootId: 'a1b2c3d4e5f6',
|
|
1229
1709
|
db: { file: 'team.db', present: true, schemaVersion: 1, fingerprintOk: true, search: 'fts5' },
|
|
1230
1710
|
tasks: { total: 90, absent: 0 },
|
|
1231
1711
|
projectedAt: '2026-11-06T08:00:04.000Z',
|
|
1232
|
-
capabilities: ['sync', 'delete', 'jobs', 'schedule'],
|
|
1712
|
+
capabilities: ['sync', 'delete', 'jobs', 'schedule', 'tracker'],
|
|
1233
1713
|
scheduler: {
|
|
1234
1714
|
state: 'running',
|
|
1235
1715
|
pid: 41231,
|
|
@@ -1239,6 +1719,21 @@ const EXAMPLES = {
|
|
|
1239
1719
|
jobsDue: 1,
|
|
1240
1720
|
},
|
|
1241
1721
|
},
|
|
1722
|
+
{
|
|
1723
|
+
status: 'ok',
|
|
1724
|
+
db: { file: 'team.db', present: true, schemaVersion: 1, fingerprintOk: true, search: 'fts5' },
|
|
1725
|
+
tasks: { total: 0, absent: 0 },
|
|
1726
|
+
projectedAt: null,
|
|
1727
|
+
capabilities: ['sync', 'delete', 'jobs', 'schedule', 'tracker'],
|
|
1728
|
+
scheduler: {
|
|
1729
|
+
state: 'stopped',
|
|
1730
|
+
pid: null,
|
|
1731
|
+
startedAt: null,
|
|
1732
|
+
heartbeatAt: null,
|
|
1733
|
+
nextTickAt: null,
|
|
1734
|
+
jobsDue: 0,
|
|
1735
|
+
},
|
|
1736
|
+
},
|
|
1242
1737
|
],
|
|
1243
1738
|
JobSchedule: [{ kind: 'cron', expression: '0 3 * * *', timezone: 'Europe/Berlin' }],
|
|
1244
1739
|
JobPayload: [{ kind: 'command', argv: ['node', '.ai.local/scripts/run.mjs', '--nightly'] }],
|
|
@@ -1440,6 +1935,49 @@ const EXAMPLES = {
|
|
|
1440
1935
|
],
|
|
1441
1936
|
JobDeleteResult: [{ ok: true, id: 'nightly-retro', runsRemoved: 12 }],
|
|
1442
1937
|
JobRunRequest: [{ requested: true, requestedAt: '2026-11-10T12:00:00.000Z', schedulerOnline: true }],
|
|
1938
|
+
TrackerDependency: [trackerDependencyExample],
|
|
1939
|
+
TrackerHistoryEntry: [trackerHistoryExample],
|
|
1940
|
+
TrackerItem: [trackerItemExample],
|
|
1941
|
+
TrackerItemSummary: [trackerItemSummaryExample],
|
|
1942
|
+
TrackerItemDetail: [
|
|
1943
|
+
{
|
|
1944
|
+
item: trackerItemExample,
|
|
1945
|
+
dependencies: [trackerDependencyExample],
|
|
1946
|
+
dependents: [],
|
|
1947
|
+
queue: [trackerQueueEntryExample],
|
|
1948
|
+
tasks: [trackerTaskLinkExample],
|
|
1949
|
+
criticalPath: [2, 1],
|
|
1950
|
+
},
|
|
1951
|
+
],
|
|
1952
|
+
TrackerItemList: [
|
|
1953
|
+
{
|
|
1954
|
+
items: [trackerItemSummaryExample],
|
|
1955
|
+
total: 3,
|
|
1956
|
+
limit: 50,
|
|
1957
|
+
offset: 0,
|
|
1958
|
+
nextOffset: null,
|
|
1959
|
+
asOf: '2026-11-12T10:00:00.000Z',
|
|
1960
|
+
readyCount: 1,
|
|
1961
|
+
criticalPathIds: [2, 1],
|
|
1962
|
+
maxActive: 1,
|
|
1963
|
+
activeCount: 0,
|
|
1964
|
+
},
|
|
1965
|
+
],
|
|
1966
|
+
TrackerCreateRequest: [trackerCreateRequestExample],
|
|
1967
|
+
TrackerUpdateRequest: [trackerUpdateRequestExample],
|
|
1968
|
+
TrackerQueueEntry: [trackerQueueEntryExample],
|
|
1969
|
+
TrackerQueueList: [
|
|
1970
|
+
{
|
|
1971
|
+
items: [trackerQueueEntryExample],
|
|
1972
|
+
total: 1,
|
|
1973
|
+
limit: 50,
|
|
1974
|
+
offset: 0,
|
|
1975
|
+
nextOffset: null,
|
|
1976
|
+
asOf: '2026-11-12T10:00:00.000Z',
|
|
1977
|
+
activeEntryId: null,
|
|
1978
|
+
},
|
|
1979
|
+
],
|
|
1980
|
+
TrackerEnqueueRequest: [trackerEnqueueRequestExample],
|
|
1443
1981
|
Meta: [
|
|
1444
1982
|
{
|
|
1445
1983
|
apiVersion: API_VERSION,
|
|
@@ -1585,6 +2123,83 @@ const jobWriteBody = {
|
|
|
1585
2123
|
content: { 'application/json': { schema: ref('JobWrite') } },
|
|
1586
2124
|
};
|
|
1587
2125
|
|
|
2126
|
+
const trackerIdParameter = {
|
|
2127
|
+
name: 'id',
|
|
2128
|
+
in: 'path',
|
|
2129
|
+
required: true,
|
|
2130
|
+
description: 'Tracker item id: the immutable positive integer key; linked team tasks carry their own slugs.',
|
|
2131
|
+
schema: { type: 'integer', minimum: 1 },
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2134
|
+
const trackerTaskSlugParameter = {
|
|
2135
|
+
name: 'taskSlug',
|
|
2136
|
+
in: 'path',
|
|
2137
|
+
required: true,
|
|
2138
|
+
description: 'Team-task slug linked to this tracker item.',
|
|
2139
|
+
schema: { type: 'string', pattern: SLUG_PATTERN },
|
|
2140
|
+
};
|
|
2141
|
+
|
|
2142
|
+
const trackerEntryIdParameter = {
|
|
2143
|
+
name: 'entryId',
|
|
2144
|
+
in: 'path',
|
|
2145
|
+
required: true,
|
|
2146
|
+
description: 'Queue entry id: `YYYYMMDDTHHMMSSZ-<8 hex>`, lexicographically sortable.',
|
|
2147
|
+
schema: { type: 'string', pattern: RUN_ID_PATTERN },
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2150
|
+
const trackerListStatusParameter = {
|
|
2151
|
+
name: 'status',
|
|
2152
|
+
in: 'query',
|
|
2153
|
+
description: csvParameterDescription('effective item statuses (any subset)', TRACKER_EFFECTIVE_ITEM_STATUS),
|
|
2154
|
+
required: false,
|
|
2155
|
+
schema: { type: 'string' },
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
const trackerQueueStatusParameter = {
|
|
2159
|
+
name: 'status',
|
|
2160
|
+
in: 'query',
|
|
2161
|
+
description: csvParameterDescription('effective entry statuses (any subset)', TRACKER_EFFECTIVE_ENTRY_STATUS),
|
|
2162
|
+
required: false,
|
|
2163
|
+
schema: { type: 'string' },
|
|
2164
|
+
};
|
|
2165
|
+
|
|
2166
|
+
const TRACKER_LIST_PARAMETERS = [
|
|
2167
|
+
trackerListStatusParameter,
|
|
2168
|
+
{ name: 'ready', in: 'query', description: 'Narrow to launchable items.', required: false, schema: { type: 'boolean' } },
|
|
2169
|
+
{ name: 'sourceTask', in: 'query', required: false, schema: { type: 'string', pattern: SLUG_PATTERN } },
|
|
2170
|
+
...paginationParameters,
|
|
2171
|
+
];
|
|
2172
|
+
|
|
2173
|
+
const TRACKER_QUEUE_LIST_PARAMETERS = [
|
|
2174
|
+
trackerQueueStatusParameter,
|
|
2175
|
+
{ name: 'itemId', in: 'query', required: false, schema: { type: 'integer', minimum: 1 } },
|
|
2176
|
+
...paginationParameters,
|
|
2177
|
+
];
|
|
2178
|
+
|
|
2179
|
+
const trackerItemWriteBody = (schemaName) => ({
|
|
2180
|
+
required: true,
|
|
2181
|
+
description: `One item payload as \`application/json\`, at most 16 KiB.`,
|
|
2182
|
+
content: { 'application/json': { schema: ref(schemaName) } },
|
|
2183
|
+
});
|
|
2184
|
+
|
|
2185
|
+
const trackerEnqueueBody = {
|
|
2186
|
+
required: true,
|
|
2187
|
+
description: 'One enqueue payload as `application/json`, at most 1 KiB.',
|
|
2188
|
+
content: { 'application/json': { schema: ref('TrackerEnqueueRequest') } },
|
|
2189
|
+
};
|
|
2190
|
+
|
|
2191
|
+
const trackerTaskStartBody = {
|
|
2192
|
+
required: true,
|
|
2193
|
+
description: 'One task-start payload as `application/json`, at most 64 KiB (the prompt is the largest field).',
|
|
2194
|
+
content: { 'application/json': { schema: ref('TrackerTaskStartRequest') } },
|
|
2195
|
+
};
|
|
2196
|
+
|
|
2197
|
+
const trackerTaskActionBody = {
|
|
2198
|
+
required: false,
|
|
2199
|
+
description: 'An optional action body as `application/json`, at most 1 KiB.',
|
|
2200
|
+
content: { 'application/json': { schema: ref('TrackerTaskActionRequest') } },
|
|
2201
|
+
};
|
|
2202
|
+
|
|
1588
2203
|
const emptyBody = {
|
|
1589
2204
|
required: false,
|
|
1590
2205
|
description: 'Absent or an empty JSON object; any other body is rejected.',
|
|
@@ -1724,9 +2339,9 @@ export const OPENAPI_DOCUMENT = {
|
|
|
1724
2339
|
info: {
|
|
1725
2340
|
title: 'Agent team SQLite projection API',
|
|
1726
2341
|
summary:
|
|
1727
|
-
'Projection of `.ai.local/team`. Task files, job definitions
|
|
2342
|
+
'Projection of `.ai.local/team`. Task files, job definitions, run manifests and the tracker store are authoritative; the database is a rebuildable copy. Fourteen mutations exist — the idempotent rescan, the confirmed task delete, the four job writes, and the eight tracker writes — and every one runs as a bounded child process.',
|
|
1728
2343
|
description:
|
|
1729
|
-
'Loopback-only operator API. No authentication by design, no CORS, no outbound request. Errors use one `{error:{code,message,details?}}` envelope. Every non-GET/HEAD request to a read-only path returns 405 `E_METHOD_NOT_ALLOWED` with `Allow: GET, HEAD`; `GET` and `HEAD` on `/api/v1/sync` return 405 with `Allow: POST`; any other method on `/api/v1/tasks/{slug}` returns 405 with `Allow: GET, HEAD, DELETE`.',
|
|
2344
|
+
'Loopback-only operator API. No authentication by design, no CORS, no outbound request. Errors use one `{error:{code,message,details?}}` envelope. Every non-GET/HEAD request to a read-only path returns 405 `E_METHOD_NOT_ALLOWED` with `Allow: GET, HEAD`; `GET` and `HEAD` on `/api/v1/sync` return 405 with `Allow: POST`; any other method on `/api/v1/tasks/{slug}` returns 405 with `Allow: GET, HEAD, DELETE`. The tracker paths advertise `GET, HEAD, POST` (`/api/v1/tracker`, `/api/v1/tracker/queue`), `GET, HEAD, PUT, DELETE` (`/api/v1/tracker/{id}`), `POST` (`/api/v1/tracker/queue/{entryId}/cancel`, `/api/v1/tracker/{id}/tasks`, `/api/v1/tracker/{id}/tasks/{taskSlug}/stop|continue`).',
|
|
1730
2345
|
version: API_VERSION,
|
|
1731
2346
|
'x-api-major': API_MAJOR,
|
|
1732
2347
|
},
|
|
@@ -1747,6 +2362,7 @@ export const OPENAPI_DOCUMENT = {
|
|
|
1747
2362
|
{ name: 'stats', description: 'Aggregate counts and durations' },
|
|
1748
2363
|
{ name: 'sync', description: 'Projection runs and the one idempotent rescan' },
|
|
1749
2364
|
{ name: 'jobs', description: 'Scheduled jobs, their runs and their logs' },
|
|
2365
|
+
{ name: 'tracker', description: 'The file-authoritative task tracker: items, ordering and the launch queue' },
|
|
1750
2366
|
],
|
|
1751
2367
|
paths: {
|
|
1752
2368
|
'/': {
|
|
@@ -2051,6 +2667,196 @@ export const OPENAPI_DOCUMENT = {
|
|
|
2051
2667
|
},
|
|
2052
2668
|
}),
|
|
2053
2669
|
},
|
|
2670
|
+
'/api/v1/tracker': {
|
|
2671
|
+
get: listOperation(
|
|
2672
|
+
['tracker'],
|
|
2673
|
+
'List tracker items in the canonical total order',
|
|
2674
|
+
'listTrackerItems',
|
|
2675
|
+
'TrackerItemList',
|
|
2676
|
+
TRACKER_LIST_PARAMETERS,
|
|
2677
|
+
{},
|
|
2678
|
+
'The canonical order is `priority ASC → createdAt ASC → id ASC`; there is deliberately no `sort` parameter, so the UI and the drain can never disagree. `status` matches the derived effective status, not the four-value stored decision — which stays visible per item as `status` in the payload. `ready` narrows to launchable items.',
|
|
2679
|
+
),
|
|
2680
|
+
post: operation({
|
|
2681
|
+
tags: ['tracker'],
|
|
2682
|
+
summary: 'Create one tracker item',
|
|
2683
|
+
description:
|
|
2684
|
+
'The body is the file-authoritative item (`tracker/items/<id>.json`); the server never writes it directly. The store assigns the next positive integer id from `tracker/sequence.json`; the body carries no id. A refusal carries `details.code` with the CLI code (`E_SCHEMA`/`E_TRACKER_UNKNOWN_DEP`/`E_TRACKER_CYCLE`). Executed as a bounded child (10 s, `SIGKILL`) that projects the tracker store before returning; `AI_RULES_TEAM_DB_DISABLE=1` answers 503 `E_DISABLED` before the child.',
|
|
2685
|
+
operationId: 'createTrackerItem',
|
|
2686
|
+
parameters: [],
|
|
2687
|
+
requestBody: trackerItemWriteBody('TrackerCreateRequest'),
|
|
2688
|
+
responses: {
|
|
2689
|
+
201: jsonResponse('TrackerItemDetail', 'The stored item with its dependency and queue context'),
|
|
2690
|
+
400: errorResponse('Malformed request'),
|
|
2691
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2692
|
+
405: methodNotAllowedResponse,
|
|
2693
|
+
413: errorResponse('The body exceeds the 16 KiB JSON bound'),
|
|
2694
|
+
422: errorResponse('A field is outside its documented bound or the media type is not JSON; `details.code` carries the CLI refusal'),
|
|
2695
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
|
|
2696
|
+
},
|
|
2697
|
+
}),
|
|
2698
|
+
},
|
|
2699
|
+
'/api/v1/tracker/queue': {
|
|
2700
|
+
get: listOperation(
|
|
2701
|
+
['tracker'],
|
|
2702
|
+
'List launch-queue entries',
|
|
2703
|
+
'listTrackerQueue',
|
|
2704
|
+
'TrackerQueueList',
|
|
2705
|
+
TRACKER_QUEUE_LIST_PARAMETERS,
|
|
2706
|
+
{},
|
|
2707
|
+
'`status` matches the derived effective entry status (`active` and `done` are computed from the task row, never stored); `itemId` narrows to one item.',
|
|
2708
|
+
),
|
|
2709
|
+
post: operation({
|
|
2710
|
+
tags: ['tracker'],
|
|
2711
|
+
summary: 'Enqueue one tracker item',
|
|
2712
|
+
description:
|
|
2713
|
+
'Idempotent per item: a non-terminal entry already exists → 200 with that entry and the new reason appended to its history (R3-5); otherwise a new entry is written → 201. A blocked item is still enqueueable — a blocked launch request is legal. A terminal item is 409 `E_CONFLICT`. Executed as a bounded child (10 s, `SIGKILL`) behind the `E_DISABLED` guard.',
|
|
2714
|
+
operationId: 'enqueueTrackerItem',
|
|
2715
|
+
parameters: [],
|
|
2716
|
+
requestBody: trackerEnqueueBody,
|
|
2717
|
+
responses: {
|
|
2718
|
+
200: jsonResponse('TrackerQueueEntry', 'The existing entry, unchanged apart from the appended history event'),
|
|
2719
|
+
201: jsonResponse('TrackerQueueEntry', 'The newly written entry'),
|
|
2720
|
+
400: errorResponse('Malformed request'),
|
|
2721
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2722
|
+
404: errorResponse('The item does not exist'),
|
|
2723
|
+
405: methodNotAllowedResponse,
|
|
2724
|
+
409: errorResponse('The item is terminal (completed, cancelled or superseded)'),
|
|
2725
|
+
413: errorResponse('The body exceeds the 1 KiB JSON bound'),
|
|
2726
|
+
422: errorResponse('A field is outside its documented bound or the media type is not JSON'),
|
|
2727
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
|
|
2728
|
+
},
|
|
2729
|
+
}),
|
|
2730
|
+
},
|
|
2731
|
+
'/api/v1/tracker/queue/{entryId}/cancel': {
|
|
2732
|
+
post: operation({
|
|
2733
|
+
tags: ['tracker'],
|
|
2734
|
+
summary: 'Cancel one launch-queue entry',
|
|
2735
|
+
description:
|
|
2736
|
+
'Idempotent for any non-`active` entry: an already cancelled or done entry answers 200 unchanged. The `active` entry belongs to the hook and is refused with 409 `E_CONFLICT`. An absent or empty body is accepted; any other body is 422 `E_VALIDATION`. Executed as a bounded child (10 s, `SIGKILL`) behind the `E_DISABLED` guard.',
|
|
2737
|
+
operationId: 'cancelTrackerQueueEntry',
|
|
2738
|
+
parameters: [trackerEntryIdParameter],
|
|
2739
|
+
requestBody: {
|
|
2740
|
+
required: false,
|
|
2741
|
+
description: 'Absent or empty; a non-empty body is rejected with 422.',
|
|
2742
|
+
content: { 'application/json': { schema: object({}, []) } },
|
|
2743
|
+
},
|
|
2744
|
+
responses: {
|
|
2745
|
+
200: jsonResponse('TrackerQueueEntry', 'The entry at its terminal state'),
|
|
2746
|
+
400: errorResponse('Malformed request'),
|
|
2747
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2748
|
+
404: errorResponse('The entry does not exist'),
|
|
2749
|
+
405: methodNotAllowedResponse,
|
|
2750
|
+
409: errorResponse('The entry is active; an active run belongs to the hook'),
|
|
2751
|
+
413: errorResponse('The body exceeds the declared bound'),
|
|
2752
|
+
422: errorResponse('A non-empty body, or an entry id outside its documented shape'),
|
|
2753
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
|
|
2754
|
+
},
|
|
2755
|
+
}),
|
|
2756
|
+
},
|
|
2757
|
+
'/api/v1/tracker/{id}': {
|
|
2758
|
+
get: taskScopedOperation(['tracker'], 'One tracker item with its dependency and queue context', 'getTrackerItem', 'TrackerItemDetail', [trackerIdParameter]),
|
|
2759
|
+
put: operation({
|
|
2760
|
+
tags: ['tracker'],
|
|
2761
|
+
summary: 'Update one tracker item (optimistic on `revision`)',
|
|
2762
|
+
description:
|
|
2763
|
+
'Optimistic concurrency: `revision` is required and must equal the stored revision; a missing or stale `revision` is 409 `E_CONFLICT` and the file is untouched. The body `id`, when present, must equal the path id. A terminal transition, a stale revision or a live queue entry is 409; the item is 404 when it does not exist. Executed as a bounded child (10 s, `SIGKILL`) behind the `E_DISABLED` guard.',
|
|
2764
|
+
operationId: 'updateTrackerItem',
|
|
2765
|
+
parameters: [trackerIdParameter],
|
|
2766
|
+
requestBody: trackerItemWriteBody('TrackerUpdateRequest'),
|
|
2767
|
+
responses: {
|
|
2768
|
+
200: jsonResponse('TrackerItemDetail', 'The stored item at its incremented revision'),
|
|
2769
|
+
400: errorResponse('Malformed request: an invalid item id'),
|
|
2770
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2771
|
+
404: errorResponse('The item does not exist'),
|
|
2772
|
+
405: methodNotAllowedResponse,
|
|
2773
|
+
409: errorResponse('A missing or stale `revision`, a body id that differs from the path id, a terminal transition, or a live queue entry'),
|
|
2774
|
+
413: errorResponse('The body exceeds the 16 KiB JSON bound'),
|
|
2775
|
+
422: errorResponse('A field is outside its documented bound or the media type is not JSON; `details.code` carries the CLI refusal'),
|
|
2776
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
|
|
2777
|
+
},
|
|
2778
|
+
}),
|
|
2779
|
+
delete: operation({
|
|
2780
|
+
tags: ['tracker'],
|
|
2781
|
+
summary: 'Hard delete one tracker item with its links and prompts',
|
|
2782
|
+
description:
|
|
2783
|
+
'Removes `tracker/items/<id>.json`, every `tracker/links/<linkId>.json` and its prompt, and terminal queue entries for the item. Team tasks are never removed. Refused with 409 while a linked task is active or a queue entry is non-terminal. Executed as a bounded child (30 s, `SIGKILL`) behind the `E_DISABLED` guard.',
|
|
2784
|
+
operationId: 'deleteTrackerItem',
|
|
2785
|
+
parameters: [trackerIdParameter],
|
|
2786
|
+
responses: {
|
|
2787
|
+
200: jsonResponse('TrackerDeleteResult', 'The deleted item id'),
|
|
2788
|
+
400: errorResponse('Malformed request: an invalid item id'),
|
|
2789
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2790
|
+
404: errorResponse('The item does not exist'),
|
|
2791
|
+
405: methodNotAllowedResponse,
|
|
2792
|
+
409: errorResponse('A linked task is active or a queue entry is non-terminal; `details.code` names the refusal'),
|
|
2793
|
+
413: errorResponse('The body exceeds the declared bound'),
|
|
2794
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or the child exceeded its time bound'),
|
|
2795
|
+
},
|
|
2796
|
+
}),
|
|
2797
|
+
},
|
|
2798
|
+
'/api/v1/tracker/{id}/tasks': {
|
|
2799
|
+
post: operation({
|
|
2800
|
+
tags: ['tracker'],
|
|
2801
|
+
summary: 'Start a new team task linked to one tracker item',
|
|
2802
|
+
description:
|
|
2803
|
+
'Writes one `tracker/links/<itemId>--<taskSlug>.json` plus its prompt and enqueues a launch request. The item id and the task slug are independent: the same item may accumulate several linked tasks. The hook drain bootstraps `tasks/<taskSlug>/`; this route never starts an agent. Executed as two bounded children (10 s each, `SIGKILL`); the link is removed if the enqueue fails.',
|
|
2804
|
+
operationId: 'startTrackerTask',
|
|
2805
|
+
parameters: [trackerIdParameter],
|
|
2806
|
+
requestBody: trackerTaskStartBody,
|
|
2807
|
+
responses: {
|
|
2808
|
+
201: jsonResponse('TrackerItemDetail', 'The item with the new link and queue request'),
|
|
2809
|
+
400: errorResponse('Malformed request: an invalid item id or task slug'),
|
|
2810
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2811
|
+
404: errorResponse('The item does not exist'),
|
|
2812
|
+
405: methodNotAllowedResponse,
|
|
2813
|
+
409: errorResponse('The link already exists or the item is terminal'),
|
|
2814
|
+
413: errorResponse('The body exceeds the 64 KiB JSON bound'),
|
|
2815
|
+
422: errorResponse('A field is outside its documented bound or the media type is not JSON'),
|
|
2816
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or a child exceeded its time bound'),
|
|
2817
|
+
},
|
|
2818
|
+
}),
|
|
2819
|
+
},
|
|
2820
|
+
'/api/v1/tracker/{id}/tasks/{taskSlug}/stop': {
|
|
2821
|
+
post: operation({
|
|
2822
|
+
tags: ['tracker'],
|
|
2823
|
+
summary: 'Stop a linked task and request a pause',
|
|
2824
|
+
description:
|
|
2825
|
+
'Cancels a queued or claimed entry, writes the per-task `STOP` sentinel so the chain hook pauses at its next stop, and terminates the opt-in runner process group when one is active. Never writes `status.json`. Executed as bounded children (10 s).',
|
|
2826
|
+
operationId: 'stopTrackerTask',
|
|
2827
|
+
parameters: [trackerIdParameter, trackerTaskSlugParameter],
|
|
2828
|
+
requestBody: trackerTaskActionBody,
|
|
2829
|
+
responses: {
|
|
2830
|
+
200: jsonResponse('TrackerItemDetail', 'The item after the stop request'),
|
|
2831
|
+
400: errorResponse('Malformed request: an invalid item id or task slug'),
|
|
2832
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2833
|
+
404: errorResponse('The item or the link does not exist'),
|
|
2834
|
+
405: methodNotAllowedResponse,
|
|
2835
|
+
409: errorResponse('The link cannot be stopped in its current state'),
|
|
2836
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or a child exceeded its time bound'),
|
|
2837
|
+
},
|
|
2838
|
+
}),
|
|
2839
|
+
},
|
|
2840
|
+
'/api/v1/tracker/{id}/tasks/{taskSlug}/continue': {
|
|
2841
|
+
post: operation({
|
|
2842
|
+
tags: ['tracker'],
|
|
2843
|
+
summary: 'Continue a linked task through the opt-in runner',
|
|
2844
|
+
description:
|
|
2845
|
+
'Clears the per-task `STOP` sentinel and starts `team/runner.json` with a generated `/task-continue <taskSlug>` prompt. The runner is supervised: argv only, no shell, cwd confined to the repository, env allow-list, timeout and process-group kill. Without `team/runner.json` the route answers 409 `E_RUNNER_OFFLINE` and changes nothing.',
|
|
2846
|
+
operationId: 'continueTrackerTask',
|
|
2847
|
+
parameters: [trackerIdParameter, trackerTaskSlugParameter],
|
|
2848
|
+
requestBody: trackerTaskActionBody,
|
|
2849
|
+
responses: {
|
|
2850
|
+
202: jsonResponse('TrackerItemDetail', 'The item after the runner was started'),
|
|
2851
|
+
400: errorResponse('Malformed request: an invalid item id or task slug'),
|
|
2852
|
+
403: errorResponse('A non-loopback Host or Origin was rejected before routing'),
|
|
2853
|
+
404: errorResponse('The item or the link does not exist'),
|
|
2854
|
+
405: methodNotAllowedResponse,
|
|
2855
|
+
409: errorResponse('The task is not bootstrapped, the runner is not configured, or another run is active'),
|
|
2856
|
+
503: errorResponse('The projection is disabled, the database is missing, unusable, busy, or a child exceeded its time bound'),
|
|
2857
|
+
},
|
|
2858
|
+
}),
|
|
2859
|
+
},
|
|
2054
2860
|
'/api/v1/stats': {
|
|
2055
2861
|
get: listOperation(['stats'], 'Aggregate counts and durations', 'getStats', 'Stats', [
|
|
2056
2862
|
{ name: 'includeAbsent', in: 'query', required: false, schema: { type: 'boolean', default: false } },
|