@bonesofspring/ai-rules 0.2.60 → 0.2.63
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 +102 -0
- package/README.md +62 -29
- package/bin/cli.js +368 -59
- package/bin/lib/ai-local-drift.js +18 -0
- package/bin/lib/engine-scripts.js +22 -5
- package/bin/lib/engine-upgrade.js +279 -0
- package/bin/lib/mcp/catalog.js +66 -5
- package/bin/lib/mcp/clients.js +4 -4
- package/bin/lib/mcp/credentials.js +88 -0
- package/bin/lib/mcp/doctor.js +100 -8
- package/bin/lib/mcp/npx.js +17 -0
- package/bin/lib/mcp/registry.js +2 -0
- package/bin/lib/merged-config.js +38 -0
- package/bin/lib/seed-ai-local-team.js +32 -14
- package/bin/mavis-install.js +3 -1
- package/bin/opencode-install.js +3 -1
- package/bin/zcode-install.js +3 -1
- package/docs/MAVIS.md +5 -2
- package/docs/MCP-CATALOG.md +30 -2
- package/docs/MCP-SETUP.md +30 -6
- package/docs/OPENCODE.md +27 -4
- package/docs/PLATFORMS.md +38 -0
- package/docs/PRESET-CONTRIBUTION.md +27 -14
- package/docs/TEAM-DB.md +194 -21
- package/docs/openapi/team-db.v1.json +4443 -2083
- package/mcp/defectdojo-mcp.mjs +353 -0
- package/mcp/gitlab.mjs +5 -1
- package/mcp/lib/defectdojo.mjs +249 -0
- package/mcp/lib/yandex.mjs +39 -15
- package/package.json +11 -5
- package/presets/_shared/ai-local/scripts/check-write-scope.mjs +176 -28
- package/presets/_shared/ai-local/scripts/lock.mjs +128 -69
- package/presets/_shared/ai-local/scripts/signals.mjs +17 -1
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +496 -67
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +816 -5
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +761 -6
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +10 -0
- package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +2360 -0
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +87 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +151 -9
- package/presets/_shared/ai-local/scripts/upstream-research.mjs +2961 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +17 -0
- package/presets/_shared/core/agent-team/agent-team-intake.md +1 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -2
- package/presets/_shared/core/meta/preset-pr-checklist.md +4 -4
- package/presets/_shared/core/meta/preset-twin-sync.md +1 -1
- package/presets/_shared/hooks/README.md +23 -3
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +57 -3
- package/presets/_shared/hooks/check-preset-update.mjs +4 -3
- package/presets/{claude/nuxt/hooks/guard-shell-command.sh → _shared/hooks/guard-shell-command.mjs.tmpl} +29 -35
- package/presets/_shared/hooks/run-hook.mjs +102 -0
- package/presets/claude/android-kotlin/hooks/README.md +4 -3
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/android-kotlin/hooks/examples/README.md +2 -2
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/android-kotlin/hooks/run-hook.mjs +102 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/android-kotlin/settings.json +2 -2
- package/presets/claude/android-kotlin/team/README.md +5 -0
- package/presets/claude/go/hooks/README.md +4 -3
- package/presets/claude/go/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/go/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/go/hooks/examples/README.md +2 -2
- package/presets/claude/go/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/go/hooks/run-hook.mjs +102 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/go/settings.json +2 -2
- package/presets/claude/go/team/README.md +5 -0
- package/presets/claude/ios-swift/hooks/README.md +4 -3
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/ios-swift/hooks/examples/README.md +2 -2
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/ios-swift/hooks/run-hook.mjs +102 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/ios-swift/settings.json +2 -2
- package/presets/claude/ios-swift/team/README.md +5 -0
- package/presets/claude/java/hooks/README.md +4 -3
- package/presets/claude/java/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/java/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/java/hooks/examples/README.md +2 -2
- package/presets/claude/java/hooks/{guard-shell-command.sh → guard-shell-command.mjs} +31 -38
- package/presets/claude/java/hooks/run-hook.mjs +102 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/java/settings.json +2 -2
- package/presets/claude/java/team/README.md +5 -0
- package/presets/claude/mcp-ts/hooks/README.md +4 -3
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/mcp-ts/hooks/examples/README.md +1 -1
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/mcp-ts/hooks/run-hook.mjs +102 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/mcp-ts/settings.json +2 -2
- package/presets/claude/mcp-ts/team/README.md +5 -0
- package/presets/claude/mol/hooks/README.md +20 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/{svelte/hooks/guard-shell-command.sh → mol/hooks/guard-shell-command.mjs} +29 -35
- package/presets/claude/mol/hooks/run-hook.mjs +102 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/mol/settings.json +2 -2
- package/presets/claude/mol/team/README.md +5 -0
- package/presets/claude/next/agents/build-verifier.md +18 -3
- package/presets/claude/next/agents/code-reviewer.md +2 -0
- package/presets/claude/next/agents/feature-developer.md +3 -1
- package/presets/claude/next/agents/task-analyst.md +6 -0
- package/presets/claude/next/agents/task-router.md +5 -3
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/task-continue.md +1 -1
- package/presets/claude/next/commands/upstream-research.md +23 -0
- package/presets/claude/next/hooks/README.md +4 -3
- package/presets/claude/next/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/next/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/next/hooks/examples/README.md +2 -2
- package/presets/claude/next/hooks/guard-shell-command.mjs +94 -0
- package/presets/claude/next/hooks/run-hook.mjs +102 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/next/settings.json +2 -2
- package/presets/claude/next/team/README.md +23 -0
- package/presets/claude/next/team/upstream/config.json +31 -0
- package/presets/claude/next/team/upstream/digest-template.md +55 -0
- package/presets/claude/next/team/upstream/opencode.json +34 -0
- package/presets/claude/next/team/upstream/projects.json +4 -0
- package/presets/claude/next/team/upstream/prompt.md +77 -0
- package/presets/claude/next/team/upstream/signatures.json +9 -0
- package/presets/claude/nuxt/hooks/README.md +4 -3
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/nuxt/hooks/examples/README.md +2 -2
- package/presets/claude/{ios-swift/hooks/guard-shell-command.sh → nuxt/hooks/guard-shell-command.mjs} +29 -37
- package/presets/claude/nuxt/hooks/run-hook.mjs +102 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/nuxt/settings.json +2 -2
- package/presets/claude/nuxt/team/README.md +5 -0
- package/presets/claude/php-hexagonal/hooks/README.md +4 -3
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/php-hexagonal/hooks/examples/README.md +2 -2
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/php-hexagonal/hooks/run-hook.mjs +102 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/php-hexagonal/settings.json +2 -2
- package/presets/claude/php-hexagonal/team/README.md +5 -0
- package/presets/claude/php-laravel/hooks/README.md +4 -3
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/php-laravel/hooks/examples/README.md +2 -2
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/php-laravel/hooks/run-hook.mjs +102 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/php-laravel/settings.json +2 -2
- package/presets/claude/php-laravel/team/README.md +5 -0
- package/presets/claude/svelte/hooks/README.md +4 -3
- package/presets/claude/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/svelte/hooks/examples/README.md +2 -2
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +94 -0
- package/presets/claude/svelte/hooks/run-hook.mjs +102 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/svelte/settings.json +2 -2
- package/presets/claude/svelte/team/README.md +5 -0
- package/presets/cursor/android-kotlin/hooks/README.md +2 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/android-kotlin/hooks/run-hook.mjs +102 -0
- package/presets/cursor/android-kotlin/hooks.json +2 -2
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/android-kotlin/team/README.md +5 -0
- package/presets/cursor/go/hooks/README.md +2 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/go/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/go/hooks/examples/README.md +1 -1
- package/presets/cursor/go/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/go/hooks/run-hook.mjs +102 -0
- package/presets/cursor/go/hooks.json +2 -2
- package/presets/cursor/go/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/go/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/go/team/README.md +5 -0
- package/presets/cursor/ios-swift/hooks/README.md +2 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/ios-swift/hooks/run-hook.mjs +102 -0
- package/presets/cursor/ios-swift/hooks.json +2 -2
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/ios-swift/team/README.md +5 -0
- package/presets/cursor/java/hooks/README.md +2 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/java/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/java/hooks/examples/README.md +1 -1
- package/presets/cursor/java/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/java/hooks/run-hook.mjs +102 -0
- package/presets/cursor/java/hooks.json +2 -2
- package/presets/cursor/java/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/java/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/java/team/README.md +5 -0
- package/presets/cursor/mcp-ts/hooks/README.md +2 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/mcp-ts/hooks/run-hook.mjs +102 -0
- package/presets/cursor/mcp-ts/hooks.json +2 -2
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/mcp-ts/team/README.md +5 -0
- package/presets/cursor/mol/hooks/README.md +2 -1
- package/presets/cursor/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/mol/hooks/examples/README.md +1 -1
- package/presets/{claude/next/hooks/guard-shell-command.sh → cursor/mol/hooks/guard-shell-command.mjs} +29 -35
- package/presets/cursor/mol/hooks/run-hook.mjs +102 -0
- package/presets/cursor/mol/hooks.json +2 -2
- package/presets/cursor/mol/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/mol/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/mol/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/mol/team/README.md +5 -0
- package/presets/cursor/next/agents/build-verifier.md +18 -3
- package/presets/cursor/next/agents/code-reviewer.md +2 -0
- package/presets/cursor/next/agents/feature-developer.md +3 -1
- package/presets/cursor/next/agents/task-analyst.md +6 -0
- package/presets/cursor/next/agents/task-router.md +5 -3
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/task-continue.md +1 -1
- package/presets/cursor/next/commands/upstream-research.md +23 -0
- package/presets/cursor/next/hooks/README.md +2 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/next/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/next/hooks/examples/README.md +1 -1
- package/presets/cursor/next/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/next/hooks/run-hook.mjs +102 -0
- package/presets/cursor/next/hooks.json +2 -2
- package/presets/cursor/next/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/next/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/next/team/README.md +23 -0
- package/presets/cursor/next/team/upstream/config.json +31 -0
- package/presets/cursor/next/team/upstream/digest-template.md +55 -0
- package/presets/cursor/next/team/upstream/opencode.json +34 -0
- package/presets/cursor/next/team/upstream/projects.json +4 -0
- package/presets/cursor/next/team/upstream/prompt.md +77 -0
- package/presets/cursor/next/team/upstream/signatures.json +9 -0
- package/presets/cursor/nuxt/hooks/README.md +2 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/nuxt/hooks/run-hook.mjs +102 -0
- package/presets/cursor/nuxt/hooks.json +2 -2
- package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/nuxt/team/README.md +5 -0
- package/presets/cursor/php-hexagonal/hooks/README.md +2 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/php-hexagonal/hooks/run-hook.mjs +102 -0
- package/presets/cursor/php-hexagonal/hooks.json +2 -2
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/php-hexagonal/team/README.md +5 -0
- package/presets/cursor/php-laravel/hooks/README.md +2 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/php-laravel/hooks/run-hook.mjs +102 -0
- package/presets/cursor/php-laravel/hooks.json +2 -2
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/php-laravel/team/README.md +5 -0
- package/presets/cursor/svelte/hooks/README.md +2 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/svelte/hooks/examples/README.md +1 -1
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/svelte/hooks/run-hook.mjs +102 -0
- package/presets/cursor/svelte/hooks.json +2 -2
- package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/svelte/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/svelte/team/README.md +5 -0
- package/presets/mavis/android-kotlin/adapter-map.json +11 -3
- package/presets/mavis/android-kotlin/hooks/README.md +2 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/android-kotlin/team/README.md +5 -0
- package/presets/mavis/go/adapter-map.json +11 -3
- package/presets/mavis/go/hooks/README.md +2 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/go/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/go/rules/agent-team-intake.md +1 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/go/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/go/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/go/team/README.md +5 -0
- package/presets/mavis/ios-swift/adapter-map.json +11 -3
- package/presets/mavis/ios-swift/hooks/README.md +2 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/ios-swift/team/README.md +5 -0
- package/presets/mavis/java/adapter-map.json +11 -3
- package/presets/mavis/java/hooks/README.md +2 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/java/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/java/rules/agent-team-intake.md +1 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/java/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/java/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/java/team/README.md +5 -0
- package/presets/mavis/mcp-ts/adapter-map.json +11 -3
- package/presets/mavis/mcp-ts/hooks/README.md +2 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/mcp-ts/team/README.md +5 -0
- package/presets/mavis/mol/adapter-map.json +11 -3
- package/presets/mavis/mol/hooks/README.md +2 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/mol/rules/agent-team-intake.md +1 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/mol/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/mol/team/README.md +5 -0
- package/presets/mavis/next/adapter-map.json +67 -3
- package/presets/mavis/next/agents/build-verifier.md +18 -3
- package/presets/mavis/next/agents/code-reviewer.md +2 -0
- package/presets/mavis/next/agents/feature-developer.md +3 -1
- package/presets/mavis/next/agents/task-analyst.md +6 -0
- package/presets/mavis/next/agents/task-router.md +5 -3
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/task-continue.md +1 -1
- package/presets/mavis/next/commands/upstream-research.md +18 -0
- package/presets/mavis/next/hooks/README.md +2 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/next/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/next/rules/agent-team-intake.md +1 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/next/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/next/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/next/team/README.md +23 -0
- package/presets/mavis/next/team/upstream/config.json +31 -0
- package/presets/mavis/next/team/upstream/digest-template.md +55 -0
- package/presets/mavis/next/team/upstream/opencode.json +34 -0
- package/presets/mavis/next/team/upstream/projects.json +4 -0
- package/presets/mavis/next/team/upstream/prompt.md +77 -0
- package/presets/mavis/next/team/upstream/signatures.json +9 -0
- package/presets/mavis/nuxt/adapter-map.json +11 -3
- package/presets/mavis/nuxt/hooks/README.md +2 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/nuxt/team/README.md +5 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +11 -3
- package/presets/mavis/php-hexagonal/hooks/README.md +2 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/php-hexagonal/team/README.md +5 -0
- package/presets/mavis/php-laravel/adapter-map.json +11 -3
- package/presets/mavis/php-laravel/hooks/README.md +2 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/php-laravel/team/README.md +5 -0
- package/presets/mavis/svelte/adapter-map.json +11 -3
- package/presets/mavis/svelte/hooks/README.md +2 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/svelte/rules/agent-team-intake.md +1 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/svelte/team/README.md +5 -0
- package/presets/opencode/android-kotlin/OPENCODE.md +1 -1
- package/presets/opencode/android-kotlin/README.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +11 -3
- package/presets/opencode/android-kotlin/hooks/README.md +3 -2
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/android-kotlin/team/README.md +5 -0
- package/presets/opencode/go/OPENCODE.md +1 -1
- package/presets/opencode/go/README.md +1 -1
- package/presets/opencode/go/adapter-map.json +11 -3
- package/presets/opencode/go/hooks/README.md +3 -2
- package/presets/opencode/go/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/go/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/go/rules/agent-team-intake.md +1 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/go/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/go/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/go/team/README.md +5 -0
- package/presets/opencode/ios-swift/OPENCODE.md +1 -1
- package/presets/opencode/ios-swift/README.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +11 -3
- package/presets/opencode/ios-swift/hooks/README.md +3 -2
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/ios-swift/team/README.md +5 -0
- package/presets/opencode/java/OPENCODE.md +1 -1
- package/presets/opencode/java/README.md +1 -1
- package/presets/opencode/java/adapter-map.json +11 -3
- package/presets/opencode/java/hooks/README.md +3 -2
- package/presets/opencode/java/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/java/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/java/rules/agent-team-intake.md +1 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/java/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/java/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/java/team/README.md +5 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +1 -1
- package/presets/opencode/mcp-ts/README.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +11 -3
- package/presets/opencode/mcp-ts/hooks/README.md +3 -2
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/mcp-ts/team/README.md +5 -0
- package/presets/opencode/mol/OPENCODE.md +1 -1
- package/presets/opencode/mol/README.md +1 -1
- package/presets/opencode/mol/adapter-map.json +11 -3
- package/presets/opencode/mol/hooks/README.md +3 -2
- package/presets/opencode/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/mol/rules/agent-team-intake.md +1 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/mol/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/mol/team/README.md +5 -0
- package/presets/opencode/next/OPENCODE.md +1 -1
- package/presets/opencode/next/README.md +1 -1
- package/presets/opencode/next/adapter-map.json +67 -3
- package/presets/opencode/next/agents/build-verifier.md +18 -3
- package/presets/opencode/next/agents/code-reviewer.md +2 -0
- package/presets/opencode/next/agents/feature-developer.md +3 -1
- package/presets/opencode/next/agents/task-analyst.md +6 -0
- package/presets/opencode/next/agents/task-router.md +5 -3
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/task-continue.md +1 -1
- package/presets/opencode/next/commands/upstream-research.md +26 -0
- package/presets/opencode/next/hooks/README.md +3 -2
- package/presets/opencode/next/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/next/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/next/rules/agent-team-intake.md +1 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/next/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/next/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/next/team/README.md +23 -0
- package/presets/opencode/next/team/upstream/config.json +31 -0
- package/presets/opencode/next/team/upstream/digest-template.md +55 -0
- package/presets/opencode/next/team/upstream/opencode.json +34 -0
- package/presets/opencode/next/team/upstream/projects.json +4 -0
- package/presets/opencode/next/team/upstream/prompt.md +77 -0
- package/presets/opencode/next/team/upstream/signatures.json +9 -0
- package/presets/opencode/nuxt/OPENCODE.md +1 -1
- package/presets/opencode/nuxt/README.md +1 -1
- package/presets/opencode/nuxt/adapter-map.json +11 -3
- package/presets/opencode/nuxt/hooks/README.md +3 -2
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/nuxt/team/README.md +5 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +1 -1
- package/presets/opencode/php-hexagonal/README.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +11 -3
- package/presets/opencode/php-hexagonal/hooks/README.md +3 -2
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/php-hexagonal/team/README.md +5 -0
- package/presets/opencode/php-laravel/OPENCODE.md +1 -1
- package/presets/opencode/php-laravel/README.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +11 -3
- package/presets/opencode/php-laravel/hooks/README.md +3 -2
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/php-laravel/team/README.md +5 -0
- package/presets/opencode/svelte/OPENCODE.md +1 -1
- package/presets/opencode/svelte/README.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +11 -3
- package/presets/opencode/svelte/hooks/README.md +3 -2
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/svelte/rules/agent-team-intake.md +1 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/svelte/team/README.md +5 -0
- package/presets/zcode/android-kotlin/adapter-map.json +11 -3
- package/presets/zcode/android-kotlin/hooks/README.md +2 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/android-kotlin/team/README.md +5 -0
- package/presets/zcode/go/adapter-map.json +11 -3
- package/presets/zcode/go/hooks/README.md +2 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/go/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/go/rules/agent-team-intake.md +1 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/go/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/go/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/go/team/README.md +5 -0
- package/presets/zcode/ios-swift/adapter-map.json +11 -3
- package/presets/zcode/ios-swift/hooks/README.md +2 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/ios-swift/team/README.md +5 -0
- package/presets/zcode/java/adapter-map.json +11 -3
- package/presets/zcode/java/hooks/README.md +2 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/java/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/java/rules/agent-team-intake.md +1 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/java/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/java/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/java/team/README.md +5 -0
- package/presets/zcode/mcp-ts/adapter-map.json +11 -3
- package/presets/zcode/mcp-ts/hooks/README.md +2 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/mcp-ts/team/README.md +5 -0
- package/presets/zcode/mol/adapter-map.json +11 -3
- package/presets/zcode/mol/hooks/README.md +2 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/mol/rules/agent-team-intake.md +1 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/mol/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/mol/team/README.md +5 -0
- package/presets/zcode/next/adapter-map.json +67 -3
- package/presets/zcode/next/agents/build-verifier.md +18 -3
- package/presets/zcode/next/agents/code-reviewer.md +2 -0
- package/presets/zcode/next/agents/feature-developer.md +3 -1
- package/presets/zcode/next/agents/task-analyst.md +6 -0
- package/presets/zcode/next/agents/task-router.md +5 -3
- package/presets/zcode/next/commands/README.md +1 -0
- package/presets/zcode/next/commands/task-continue.md +1 -1
- package/presets/zcode/next/commands/upstream-research.md +26 -0
- package/presets/zcode/next/hooks/README.md +2 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/next/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/next/rules/agent-team-intake.md +1 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/next/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/next/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/next/team/README.md +23 -0
- package/presets/zcode/next/team/upstream/config.json +31 -0
- package/presets/zcode/next/team/upstream/digest-template.md +55 -0
- package/presets/zcode/next/team/upstream/opencode.json +34 -0
- package/presets/zcode/next/team/upstream/projects.json +4 -0
- package/presets/zcode/next/team/upstream/prompt.md +77 -0
- package/presets/zcode/next/team/upstream/signatures.json +9 -0
- package/presets/zcode/nuxt/adapter-map.json +11 -3
- package/presets/zcode/nuxt/hooks/README.md +2 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/nuxt/team/README.md +5 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +11 -3
- package/presets/zcode/php-hexagonal/hooks/README.md +2 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/php-hexagonal/team/README.md +5 -0
- package/presets/zcode/php-laravel/adapter-map.json +11 -3
- package/presets/zcode/php-laravel/hooks/README.md +2 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/php-laravel/team/README.md +5 -0
- package/presets/zcode/svelte/adapter-map.json +11 -3
- package/presets/zcode/svelte/hooks/README.md +2 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/svelte/rules/agent-team-intake.md +1 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/svelte/team/README.md +5 -0
- package/presets/claude/android-kotlin/hooks/guard-shell-command.sh +0 -103
- package/presets/claude/go/hooks/guard-shell-command.sh +0 -102
- package/presets/claude/mcp-ts/hooks/guard-shell-command.sh +0 -102
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.sh +0 -103
- package/presets/claude/php-laravel/hooks/guard-shell-command.sh +0 -103
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/go/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/ios-swift/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/java/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/mol/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/next/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/nuxt/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/php-laravel/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/svelte/hooks/guard-shell-command.sh +0 -77
|
@@ -169,24 +169,25 @@ Summary:
|
|
|
169
169
|
- [ ] Reachability: every new OpenCode/Mavis rule is named by an agent/command/skill/entry or an always-on rule (or is `preset-*` authoring-only) — `scripts/check-preset-reachability.sh`
|
|
170
170
|
- [ ] Embed drift: `scripts/check-shared-core-drift.sh` after core/embed edits
|
|
171
171
|
- [ ] Anti-hallucination: `check-anti-hallucination-coverage.mjs` passes. New skill families are registered in `SKILL_CONTRACT_CLASS` (`writer` loads the stack floor; `reader` loads the contract only). `code-review` is `writer`.
|
|
172
|
-
- [ ] Structure gates: `yarn check:
|
|
172
|
+
- [ ] Structure gates: `yarn check:fast` in the loop; `yarn release:gate` before a release (the full `bash scripts/check-preset-structure.sh` composite)
|
|
173
173
|
- [ ] Twin drift: after editing a Claude `commands/**` or `skills/**` file, `node scripts/check-preset-twin-drift.mjs` passes — mirror the change in the Cursor twin (delta and divergence unchanged) or record a deliberate divergence with `--update`. A deliberate divergence that **raises** an allowance needs `--update --widen`; dropping a baseline row needs `--update --prune`. A plain `--update` refuses both.
|
|
174
174
|
- [ ] Generated trees regenerated (`generate-mavis.mjs` + `generate-opencode.mjs`) and CLI goldens recaptured (`capture-cli-golden.mjs`) after any preset-installed file changes
|
|
175
175
|
|
|
176
|
-
Validation: `yarn check:
|
|
176
|
+
Validation: `yarn check:fast` + the `preset-pr-checklist` rule; the full composite runs in `yarn release:gate`; CI workflow `preset-structure.yml` (`check`, `hooks`, `ai-local-engine-tests`).
|
|
177
177
|
|
|
178
178
|
## Release order
|
|
179
179
|
|
|
180
180
|
The published artifact must document the release it carries.
|
|
181
181
|
|
|
182
182
|
1. Write the `CHANGELOG.md` section for the version and bump `packages/ai-rules/package.json` to that version **in one commit** — the gate compares the two, so a changelog-only commit is red.
|
|
183
|
-
2.
|
|
183
|
+
2. Run `yarn release:gate` on that commit and keep `release-gate-report.json`.
|
|
184
|
+
3. Tag the release and publish the tag.
|
|
184
185
|
|
|
185
186
|
A tag that carries a version bump without its changelog section ships the previous release's notes. `scripts/check-release-consistency.mjs` (wired into `check-preset-structure.sh`, alias `yarn check:release-consistency`) fails the build when `package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree; fixture `test-release-consistency.mjs` covers the two failure shapes.
|
|
186
187
|
|
|
187
188
|
## Anti-hallucination oracle
|
|
188
189
|
|
|
189
|
-
`yarn
|
|
190
|
+
`yarn release:gate` runs `scripts/check-anti-hallucination-coverage.mjs` inside the composite, immediately after the Claude agent-block check. FAIL means a released stack dropped the shared contract, a writer role dropped `STACK_FLOOR_STEMS`, a Cursor agent or in-scope skill lost the load-line marker, `/task` or the shared orchestrator named a floor stem, or a generated `## Rules to load` block no longer contains the stem `getZoneRulesForAgent` requires. The gate does not scan consumer `app/**` and does not call Context7.
|
|
190
191
|
|
|
191
192
|
`scripts/test-anti-hallucination-coverage.mjs` clones `zoneRulesByRole`, deletes `anti-hallucination-contract` from `next.reviewer`, and expects FAIL mentioning `next` and `reviewer`. It does not edit the preset tree.
|
|
192
193
|
|
|
@@ -263,7 +264,7 @@ Consumer guide: [`ZCODE.md`](./ZCODE.md). Compatibility evidence: [`ZCODE-COMPAT
|
|
|
263
264
|
| Validation | code-reviewer **WARN** drift / **FAIL** broken INDEX or missing required FM on touched specs; `check:preset-structure` **FAIL** missing assets/twins/requestable; optional `scripts/check-product-specs.sh` (**WARN** default, **`--strict`** FAIL; ships in the npm `files` tarball). Checker is bash INDEX/keys/headings — it does **not** evaluate `frontmatter-v1.schema.json` |
|
|
264
265
|
| Dogfood | `dogfood/mcp-ts-sample/docs/specs/` — mcp-ts field semantics (`routes` = tool names) |
|
|
265
266
|
|
|
266
|
-
When adding or changing either stem: update **both** ×20 adapters, README mapping rows, and run `check:shared-core-drift` + `
|
|
267
|
+
When adding or changing either stem: update **both** ×20 adapters, README mapping rows, and run `check:shared-core-drift` + the delta gates; the full `release:gate` runs before a release.
|
|
267
268
|
|
|
268
269
|
---
|
|
269
270
|
|
|
@@ -408,10 +409,11 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
|
|
|
408
409
|
|--------------|---------|
|
|
409
410
|
| `yarn fix:generated` | Regenerate every released generated platform and recapture the CLI goldens it owns (`cursor/next`, `claude/next`, and every Mavis/OpenCode stack). Run after changing Cursor SoT, before fail-only checks. Capture a non-`next` Cursor/Claude golden explicitly with `node scripts/capture-cli-golden.mjs <cursor|claude> <stack>`; never hand-edit one. Dogfood sync remains separate. |
|
|
410
411
|
| `scripts/sync-dogfood-cursor.sh` | Copy `presets/cursor/<preset>/` → root `.cursor/` (`AI_RULES_DOGFOOD_PRESET`, default `next`). Also copies `REPO_AGENTS.md` → repo-root `AGENTS.md`. Seeds `.ai.local/team` templates; preserves `.ai.local/team/tasks/`. |
|
|
411
|
-
| `scripts/check-shared-core-drift.sh` / `yarn check:shared-core-drift` | Check embed-mode adapters vs core; lists lineage consumers. **Always hard:** every `_shared/core/**` file must be classified `embed | lineage | internal` in `_lib/embed-stems.json` (unclassified → exit 1). Drift is soft by default; set `AI_RULES_DRIFT_FAIL=1` (or use `
|
|
412
|
+
| `scripts/check-shared-core-drift.sh` / `yarn check:shared-core-drift` | Check embed-mode adapters vs core; lists lineage consumers. **Always hard:** every `_shared/core/**` file must be classified `embed | lineage | internal` in `_lib/embed-stems.json` (unclassified → exit 1). Drift is soft by default; set `AI_RULES_DRIFT_FAIL=1` (or use `release:gate`) to exit non-zero. A stem listed in `requiredSentences` is checked in the core **and in every adapter of that stem, whatever the lineage class** — the body comparison cannot cover a platform whose adapter is not a byte-embed of the core (the Cursor family reorders, omits and adds sections), so the normative fragments of that stem are pinned separately. |
|
|
412
413
|
| `scripts/check-preset-twin-map.sh` / `yarn check:preset-twin-map` | **FAIL** if Cursor `.mdc` missing from Claude mapping table, twin file missing, or orphan topic `.md` (excl. `**/README.md`). Stacks: `next`, `nuxt`, `svelte`, `mol`, `ios-swift`, `android-kotlin`, `go`, `java`, `mcp-ts`, `php-hexagonal`, `php-laravel`. **Rules only** — commands and skills are guarded by `check-preset-twin-drift.mjs`. |
|
|
413
414
|
| `scripts/check-preset-twin-drift.mjs` / `yarn check:preset-twin-drift` | **FAIL** when a hand-maintained Claude twin (`presets/claude/<stack>/{commands,skills}/**/*.md`) drifts further from its Cursor source than `scripts/_lib/claude-twin-drift-baseline.json` records, when the recorded divergence between the twins changes while the line delta does not, when a command/skill has no twin on the other side, when a new pair has no baseline row, when a baseline row has no live pair, or when the baseline itself is missing its hash rows. Full parity is not required: mirror a change in both twins (delta and divergence unchanged) or record a deliberate divergence with `--update`. Raising an allowance needs `--update --widen`; dropping a row needs `--update --prune`. Fixture `test-preset-twin-drift.mjs`. |
|
|
414
415
|
| `scripts/check-claude-agent-parity.mjs` / `yarn check:claude-agent-parity` | **FAIL** when a hand-maintained Claude `agents/*.md` twin drifts from its Cursor source beyond `scripts/_lib/claude-agent-parity-baseline.json`: a grown or shrunk normalized line delta, a one-sided rewrite at an unchanged delta, a changed divergence hash, a missing twin, an unrecorded pair, an orphan row, or a pair in the static `parity` allowlist that is not at delta 0. Normalization masks packaging only — YAML frontmatter, the `## Rules to load (subagent context)` block, `<!-- shared-core -->` markers, the two anti-hallucination load lines, the `.cursor/` / `.claude/` root, and `.mdc` → `.md` — and reuses the twin-drift diff helpers. `--update` re-records deltas and hashes; `--widen` / `--prune` gate a raised allowance or a dropped row; `parity` is never edited by `--update`. Fixture `test-claude-agent-parity.mjs` proves one-sided Claude FAIL, one-sided Cursor FAIL and mirrored PASS. Wired into `check-preset-structure.sh` next to `claude-agent-blocks`. |
|
|
416
|
+
| `scripts/check-generated-drift.mjs` / `yarn check:generated-drift` | Regenerates Mavis, OpenCode, ZCode and the mapped Claude trees into a temp root and byte-compares them with the committed artifacts, then asserts the `.ai.local/scripts/` engine mirror. Also compares the eleven **hand-maintained** Claude `team/README.md` twins with their Cursor sources by line multiset: `generateClaudeStack` writes `rules/**` and `hooks/**` only, so those READMEs are not generator output and a Cursor-source edit must be mirrored by hand; section order differs by design and is not compared. |
|
|
415
417
|
| `scripts/check-consumer-links.mjs` / `yarn check:consumer-links` | **FAIL** when a generated Claude rule or agent carries a source-only `.cursor/` path or a `.mdc` reference whose stem resolves through `claude/<stack>/rules/README.md`; `README.md` and `preset-*.md` are exempt by class. `scripts/_lib/claude-consumer-link-allowlist.json` records the legitimate lines one hash at a time; a stale row fails, and a planted line in an allowlisted file still fails unless it matches the recorded hash. `--update` re-hashes recorded rows only and refuses to add one. Scans `next` by default; `--stack` opts another stack in. Fixture `test-consumer-links.mjs`. Wired into `check-preset-structure.sh` next to `generated-drift`. |
|
|
416
418
|
| `scripts/check-preset-token-budget.sh` / `yarn check:preset-token-budget` | **FAIL** if Cursor `alwaysApply: true` or Claude no-`paths:` (excl. README) count is outside **3–10**, `preset-*` always-on, or intended body sum > **4000**. Stacks include `nuxt`, `svelte`. CI also compares the baseline to the base revision (`--base`); a widening needs `--update --widen`. |
|
|
417
419
|
| `scripts/check-preset-leakage.sh` / `yarn check:preset-leakage` | **FAIL** on forbidden stems in `hooks/**/*.sh` (recursive), wrong-stack agent filenames, or **positive** (non-negation) agent body mentions; **FAIL** if chain scripts are byte-identical across stacks. Explicit **negation** of forbidden stems in agent bodies is **suppressed** (INFO summary count only — not a merge blocker). Non-negation mentions in `build-verifier` → **WARN only**. |
|
|
@@ -420,23 +422,34 @@ Load these when editing files under `packages/ai-rules/presets/**`, `.cursor/**`
|
|
|
420
422
|
| `scripts/check-preset-language-policy.sh` / `yarn check:preset-structure` | **FAIL** if the native-language policy is absent: the core `_shared/core/agent-team/language-policy.md` tokens, the `language-policy` consumer + `<!-- shared-core -->` marker, the Cursor `globs:`/`alwaysApply: false` + Claude `paths:` shape, the `## Language` setting home (with a BCP-47 marker) in `ai-local/conventions.md`, the always-on anchors (`ai-local-overlay` + `<app-core>` + `REPO_AGENTS.md` must contain `native language` and `every user message`), or the `language:` persistence token in `commands/task.md`; **refuses vacuous PASS** when the iteration set is empty. Wired into `check-preset-structure.sh` next to `goal-contract` / `prompt-persistence`; fixture `test-preset-language-policy-fixtures.mjs`. |
|
|
421
423
|
| `scripts/check-preset-self-review-contract.sh` / `yarn check:preset-structure` | **FAIL** if the producer-side self-review / context-hygiene contract is absent: the core `_shared/core/quality/self-review-and-context-hygiene.md` tokens (G0 non-vacuous guard), the `<!-- shared-core: quality/self-review-and-context-hygiene.md -->` marker on `task-analyst` / `feature-developer` / `build-verifier` (×10) and on `debugger` / `code-reviewer` where present (skip-if-absent → `mcp-ts`), the `Self-review` + `re-anchor` tokens on every orchestrator rule, `Self-review` in `team/README.md` + `commands/task.md`, and leakage-free core + docs; **refuses vacuous PASS** when the iteration set is empty. Also holds two prose contracts: the canonical self-learning-loop sentence must not be followed by unsanctioned prose (an allowlist of sanctioned clauses; the tail is bounded by the carrier's **section**, not by a blank line, so prose moved one paragraph down still fails — a tail in a later `## ` section is out of scope), and every retro carrier (command, skill, rule) must state `finding_category`. Wired into `check-preset-structure.sh` next to `goal-contract`; fixture `test-preset-self-review-contract-fixtures.mjs`. |
|
|
422
424
|
| `scripts/check-anti-hallucination-coverage.mjs` | **FAIL** when the shared contract, a Cursor load-line embed, a writer stack floor, or a generated Rules-to-load stem is missing. Writer roles are `implementer`, `unit-test`, `e2e`, `qa`, and `reviewer` (`code-reviewer` loads `STACK_FLOOR_STEMS` plus the contract). `/task` and the orchestrator must not name a floor stem. Does not scan consumer `app/**` and does not call Context7. Fixture `test-anti-hallucination-coverage.mjs` deletes `anti-hallucination-contract` from `next.reviewer` in memory and expects FAIL mentioning `next` and `reviewer`. Wired into `check-preset-structure.sh` immediately after `check-claude-agent-blocks.mjs`. |
|
|
423
|
-
| `presets/_shared/ai-local/scripts/check-write-scope.mjs` | Read-only post-step audit: compares the actual changed paths with the current `pipeline.json` step's `writeScopes` and labels each path `declared`, `derived` (task folder, engine mirror, generated platform tree/golden/hook, dogfood tree, adapter map), or `out-of-scope`, with the source named. Shipped to consumers as `.ai.local/scripts/check-write-scope.mjs` (`ENGINE_SCRIPTS`). `--slug <slug> [--step <id>] [--base <ref>] [--root <project>] [--paths a,b] [--json]`.
|
|
424
|
-
| `scripts/check-preset-structure.sh` / `yarn check:preset-structure` |
|
|
425
|
+
| `presets/_shared/ai-local/scripts/check-write-scope.mjs` | Read-only post-step audit: compares the actual changed paths with the current `pipeline.json` step's `writeScopes` and labels each path `declared`, `derived` (task folder, engine mirror, generated platform tree/golden/hook, dogfood tree, adapter map), or `out-of-scope`, with the source named. Shipped to consumers as `.ai.local/scripts/check-write-scope.mjs` (`ENGINE_SCRIPTS`). `--slug <slug> [--step <id>] [--base <ref>] [--root <project>] [--paths a,b] [--save-baseline] [--json]`. Baseline resolution: `--paths`, then `--base <ref>`, then the step baseline written by `--step <id> --save-baseline` (every dirty path with its content hash, so an earlier step's path is not attributed to this one and an already-dirty path the step edits still is), then `HEAD` (whole uncommitted change-set, reported with a notice). Exit `1` for an out-of-scope path on an implementation step, `0` for a reviewer/verifier step (advisory), `2` on a usage/config error, `3` (SKIP) when the pipeline predates step ids or `writeScopes` and is therefore not auditable. Fixture `test-write-scope.mjs`; wired into the build-verifier and code-reviewer prompts, never a hook. |
|
|
426
|
+
| `scripts/check-preset-structure.sh` / `yarn check:preset-structure` | Low-level orchestrator: twin-map + token-budget + leakage + shared-core drift + anti-hallucination coverage + rule-eval (**all hard**; drift via `AI_RULES_DRIFT_FAIL=1`). Invoked by `yarn release:gate` and CI; not a feature-task gate. |
|
|
425
427
|
| `scripts/check-product-specs.sh` / `yarn check:product-specs` | Opt-in consumer tree check: frontmatter v1 keys + required body headings on `docs/specs/**` (bash; does **not** run JSON Schema). Ships in the npm package `files` (`scripts/`). **WARN** by default; **`--strict`** exits non-zero. |
|
|
426
|
-
| `yarn check:product-specs:dogfood` | Same script against monorepo `dogfood/mcp-ts-sample`. Soft WARN inside
|
|
428
|
+
| `yarn check:product-specs:dogfood` | Same script against monorepo `dogfood/mcp-ts-sample`. Soft WARN inside the composite + CI step (`continue-on-error`); the release gate runs `--strict`; not a hard consumer CI gate. |
|
|
427
429
|
| `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` | **Hard gate** inside `check-preset-structure.sh`: validates Incorrect/Correct pairs + `impact:` on **next-only** golden stems (`eval/next/manifest.json`). Backend / ios / php-hexagonal / php-laravel stems are out of scope until a stack adds `eval/<stack>/`. |
|
|
428
430
|
| `scripts/check-release-consistency.mjs` / `yarn check:release-consistency` | **FAIL** when `packages/ai-rules/package.json` version and the newest `## <version>` heading in `CHANGELOG.md` disagree — a tag must not ship the previous release's notes. Wired into `check-preset-structure.sh`; fixture `test-release-consistency.mjs`. |
|
|
429
431
|
| `scripts/check-team-db-contract.mjs` / `yarn check:team-db-contract` | **FAIL** when the checked-in OpenAPI 3.1 document (`docs/openapi/team-db.v1.json`) drifts from `team-db-openapi.mjs`, fails the vendored 3.1 meta-schema (sha256-pinned), loses an `operationId`, diverges from `ROUTE_TABLE` in either direction, carries an invalid example, or leaves a `$ref` unresolved. `--write` is the only writer; no network at gate time. Wired into `check-preset-structure.sh`. |
|
|
430
|
-
| `scripts/
|
|
432
|
+
| `presets/_shared/ai-local/scripts/team-db-scheduler.mjs` | The scheduled-jobs module, shipped to consumers as `.ai.local/scripts/team-db-scheduler.mjs` (`ENGINE_SCRIPTS`): the job validator, a dependency-free five-field cron parser and next-fire on `Intl` zone math (both DST transitions are fixtures), the deterministic atomic `scheduler/jobs.json` store, the run-manifest and capped-capture helpers (the recorded sha256 covers exactly the pre-marker bytes, so a capped stream is not reported `E_LOG_HASH`), the projection into `scheduled_jobs` / `job_runs` / `job_run_events`, retention (1 MiB per stream, 200 runs, 30 days, 2 GiB; a pruned run directory takes its row with it; an active run is never pruned), restart reconciliation to `interrupted`, and `runScheduler` — the lease, the `BEGIN IMMEDIATE` claim, a durable run-now queue the timer re-reads and merges at every tick, the detached child with a process-group kill, `catch-up` bounded to five occurrences per gap with the truncation recorded (`E_CATCH_UP_TRUNCATED`), and the kill-switch drain. Fixture `test-team-db-scheduler.mjs`; concurrency fixtures live in `test-team-db-concurrency.mjs`. |
|
|
433
|
+
| `scripts/test-team-db-*.mjs` | The team-db suite family: schema (17), project (18), migrate-tasks (5), dual-write (13), API (27), security (17), dashboard (10), concurrency (10), scheduler (34), and FAIL-direction fixtures (22). The fixtures prove each gate fails on its planted defect; `test-team-db-concurrency.mjs` covers first-creation races, a mixed writer/reader load, `SIGKILL` recovery, a held lock, the 5 s hook budget, and the scheduler's four seams (scheduler versus projector on one database, a `SIGKILL`ed scheduler reconciled to one `interrupted` row, 50 finalized runs inside the WAL bound, and a held exclusive lock that neither hangs nor leaves a lease). Wired into `check-preset-structure.sh`; `yarn test:team-db` runs the family. |
|
|
431
434
|
|
|
432
435
|
Run from `packages/ai-rules/`:
|
|
433
436
|
|
|
434
437
|
```bash
|
|
435
|
-
yarn check:
|
|
436
|
-
|
|
437
|
-
|
|
438
|
+
yarn check:changed
|
|
439
|
+
yarn check:fast
|
|
440
|
+
# release only, from the repo root:
|
|
441
|
+
yarn release:gate
|
|
438
442
|
```
|
|
439
443
|
|
|
444
|
+
Iteration versus release:
|
|
445
|
+
|
|
446
|
+
- **`yarn check:changed`** — the changed-domain classifier (`check-preset-delta.mjs --base HEAD`, or `--paths a,b`). Run the gates it names; this is the cheap loop. It prints `affected loop gates` and a separate `release-only gates` line.
|
|
447
|
+
- **`yarn check:fast`** — the ~50-second loop gate (`check-preset-fast.sh`: generated drift, twin drift, token budget, frontmatter, consumer links, next attached budget, OpenCode platform contract self-test). `test-cli-init-clean` stays in the delta gates and CI. Use it before handoff.
|
|
448
|
+
- **`yarn release:gate`** — the full release gate: `check-preset-structure.sh` with the hook suites, `test:ai-local`, and the strict product-specs dogfood. Run it alone on the release commit before a tag.
|
|
449
|
+
- **`yarn check:preset-structure`** — the low-level composite; CI and `release:gate` call it. Do not run it in a feature task.
|
|
450
|
+
|
|
451
|
+
`check-generated-drift` caches generated trees in the OS temp directory, keyed by a digest of the Cursor/`_shared` sources and the generator libraries. A source or generator edit misses the cache and regenerates; the cache is disposable and never hides drift.
|
|
452
|
+
|
|
440
453
|
CI: [`.github/workflows/preset-structure.yml`](../../../.github/workflows/preset-structure.yml) runs the orchestrator on PRs touching `packages/ai-rules/**`.
|
|
441
454
|
|
|
442
455
|
---
|
|
@@ -474,7 +487,7 @@ Author-only: this section is **not** copied by `init`.
|
|
|
474
487
|
- Expect four finding classes: `restated-stem`, `paraphrased-when-do`, `unjustified-body-size`, `issue-number-density`.
|
|
475
488
|
- Expect one line per finding and a final `advisory-findings: <n>`; the checker always exits `0`.
|
|
476
489
|
- Read a finding as a review item, never as a gate failure.
|
|
477
|
-
- Run it through `
|
|
490
|
+
- Run it through the composite (inside `release:gate`): the `authoring-advisory` row is non-blocking (`<<< authoring-advisory: WARN (<n> finding(s); not a hard gate)`), so the release gate stays green with findings present.
|
|
478
491
|
- Read the per-rule body threshold (`advisoryPerRuleBodyCap`) from `scripts/_lib/preset-token-budget-baseline.json` — the same baseline the blocking token-budget gate reads. The advisory tier holds no cap literal of its own; the threshold is advisory metadata, not one of the five ratcheted hard caps.
|
|
479
492
|
- Fix a `restated-stem` finding by linking the sibling stem instead of repeating its sentence.
|
|
480
493
|
- Keep the tier out of the pipeline hook tree: it is a repository gate, not a hook.
|
package/docs/TEAM-DB.md
CHANGED
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
The task files remain the source of truth; the database exists so an operator or a tool can
|
|
5
5
|
query history without walking JSON on every request.
|
|
6
6
|
|
|
7
|
-
The projection is installed by `init` as
|
|
7
|
+
The projection is installed by `init` as seven modules under `.ai.local/scripts/`:
|
|
8
8
|
|
|
9
9
|
| Module | Role |
|
|
10
10
|
|---|---|
|
|
11
|
-
| `team-db.mjs` | CLI: `init`, `sync`, `delete`, `migrate-tasks`, `check`, `serve` |
|
|
11
|
+
| `team-db.mjs` | CLI: `init`, `sync`, `delete`, `migrate-tasks`, `check`, `serve`, `jobs`, `schedule` |
|
|
12
12
|
| `team-db-schema.mjs` | capability probe, embedded migrations, pragmas, fingerprint, integrity |
|
|
13
13
|
| `team-db-project.mjs` | parsers, idempotent projector, confirmed task deletion, retention, search |
|
|
14
|
-
| `team-db-api.mjs` | `node:http` server (reads plus
|
|
14
|
+
| `team-db-api.mjs` | `node:http` server (reads plus the bounded mutations), query layer, security boundary |
|
|
15
15
|
| `team-db-openapi.mjs` | the OpenAPI 3.1 document source |
|
|
16
16
|
| `team-db-dashboard.mjs` | the no-build dashboard (HTML, CSS, JS strings) |
|
|
17
|
+
| `team-db-scheduler.mjs` | job model, cron/interval math, the file store, the projection, and the timer |
|
|
17
18
|
|
|
18
19
|
## Behavior contract
|
|
19
20
|
|
|
@@ -27,11 +28,17 @@ The projection is installed by `init` as six modules under `.ai.local/scripts/`:
|
|
|
27
28
|
one line to `team-db-errors.log` on failure; the confirmed task delete runs its own
|
|
28
29
|
bounded child (30 s, `SIGKILL`), and its failure reaches the caller through the one error
|
|
29
30
|
envelope, or one stderr line on the CLI.
|
|
30
|
-
- **
|
|
31
|
-
/api/v1/tasks/{slug}` deletes one confirmed task (the folder first, then the rows)
|
|
32
|
-
other route is `GET`/`HEAD
|
|
33
|
-
|
|
34
|
-
child is spawned.
|
|
31
|
+
- **Bounded mutations.** `POST /api/v1/sync` re-runs the projector and `DELETE
|
|
32
|
+
/api/v1/tasks/{slug}` deletes one confirmed task (the folder first, then the rows); every
|
|
33
|
+
other route is `GET`/`HEAD` apart from the four job writes. Each mutation runs as an
|
|
34
|
+
asynchronous child process — the server never opens a writable connection, and the kill
|
|
35
|
+
switch answers before a child is spawned. Job writes carry `application/json` and at most
|
|
36
|
+
64 KiB, run-now an absent body or `{}`. The rescan and delete children are bounded at 30 s,
|
|
37
|
+
a job write or run-now at 10 s. There is no write-back, no telemetry, and no outbound call.
|
|
38
|
+
- **The scheduler writes files before rows.** `scheduler/jobs.json` is the definition of
|
|
39
|
+
record, `scheduler/runs/**` and `scheduler/state.json` are its runtime state, and the three
|
|
40
|
+
`scheduled_jobs` / `job_runs` / `job_run_events` tables are projections of those files. The
|
|
41
|
+
scheduler never writes `status.json`, `metrics.json`, or a receipt.
|
|
35
42
|
- **Local only.** The server binds loopback by default, checks `Host` and `Origin`, sends no
|
|
36
43
|
CORS header, and serves raw documents from SQLite by exact `(slug, path)` lookup.
|
|
37
44
|
|
|
@@ -45,9 +52,12 @@ team.db
|
|
|
45
52
|
team.db-wal
|
|
46
53
|
team.db-shm
|
|
47
54
|
team-db-errors.log
|
|
55
|
+
team/scheduler/runs/
|
|
56
|
+
team/scheduler/state.json
|
|
48
57
|
```
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
`team/scheduler/jobs.json` stays tracked: definitions are code, run output is not. The
|
|
60
|
+
consumer root `.gitignore` is never created or edited. Never commit the database even
|
|
51
61
|
for a demo: it contains copies of prompts and task documents.
|
|
52
62
|
|
|
53
63
|
## Node floor
|
|
@@ -56,7 +66,8 @@ The floor is Node 22.13.0. `node:sqlite` was unflagged in that release
|
|
|
56
66
|
([Node.js 22.13.0 release notes](https://nodejs.org/en/blog/release/v22.13.0), commit
|
|
57
67
|
`55239a48b6`, PR [#55890](https://github.com/nodejs/node/pull/55890)); the module is still
|
|
58
68
|
marked experimental. `MIN_NODE = '22.13.0'` in `team-db-schema.mjs` is the code constant
|
|
59
|
-
behind this sentence
|
|
69
|
+
behind this sentence. `engines` in `package.json` is the package runtime contract and is not
|
|
70
|
+
the SQLite floor; a runtime below `MIN_NODE`, or one without `node:sqlite`, stays file-only.
|
|
60
71
|
|
|
61
72
|
Measured surface: Node 24.21.0 with SQLite 3.54.1 (`DatabaseSync`, prepared statements,
|
|
62
73
|
`PRAGMA`, WAL, FTS5); re-verified on Node 26.13.0 / SQLite 3.54.1 for this release. A runtime
|
|
@@ -70,6 +81,15 @@ below the floor, or a build without `node:sqlite`, is detected at runtime:
|
|
|
70
81
|
| `team-db.mjs check` | one line, exit 1 | one line, exit 1 |
|
|
71
82
|
| `team-db.mjs delete` | one line, exit 2 | one line, exit 1 |
|
|
72
83
|
| `team-db.mjs serve` | one line, exit 0 | one line, exit 0 |
|
|
84
|
+
| `team-db.mjs jobs list\|get` | exit 0, file-only | exit 0, file-only |
|
|
85
|
+
| `team-db.mjs jobs put\|delete\|run\|enable\|disable` | exit 0, file-only, no row | exit 1, no write |
|
|
86
|
+
| `team-db.mjs jobs reconcile` | exit 0 | exit 0, no row written |
|
|
87
|
+
| `team-db.mjs schedule` | exit 0, no file | exit 0, no claim |
|
|
88
|
+
|
|
89
|
+
The scheduler reads a job's IANA zone through `Intl.DateTimeFormat`. On a build with small ICU
|
|
90
|
+
(`--with-intl=small-icu`) every zone name resolves, so a zone that needs full ICU data is
|
|
91
|
+
treated as UTC instead of being refused. The runtime stays supported and the projection still
|
|
92
|
+
works; check a job's next fire on such a build before trusting it.
|
|
73
93
|
|
|
74
94
|
The file-only pipeline is unchanged: `status.json` / `metrics.json` writes, manifest upserts,
|
|
75
95
|
and the pipeline run with exit 0.
|
|
@@ -87,6 +107,15 @@ node .ai.local/scripts/team-db.mjs migrate-tasks [--root <team-dir>] [--quiet] [
|
|
|
87
107
|
node .ai.local/scripts/team-db.mjs check [--root <team-dir>]
|
|
88
108
|
node .ai.local/scripts/team-db.mjs serve [--root <team-dir>] [--host <addr>] [--port <n>]
|
|
89
109
|
[--allow-remote] [--open]
|
|
110
|
+
node .ai.local/scripts/team-db.mjs jobs list [--enabled] [--sort <key>] [--json] [--quiet]
|
|
111
|
+
node .ai.local/scripts/team-db.mjs jobs get <id> [--json]
|
|
112
|
+
node .ai.local/scripts/team-db.mjs jobs put --file <path|-> [--dry-run] [--json]
|
|
113
|
+
node .ai.local/scripts/team-db.mjs jobs delete <id> [--keep-runs] [--json]
|
|
114
|
+
node .ai.local/scripts/team-db.mjs jobs enable|disable <id> [--json]
|
|
115
|
+
node .ai.local/scripts/team-db.mjs jobs reconcile [--json]
|
|
116
|
+
node .ai.local/scripts/team-db.mjs jobs run --id <id> [--json]
|
|
117
|
+
node .ai.local/scripts/team-db.mjs schedule [--once] [--interval-ms <n>] [--grace-ms <n>]
|
|
118
|
+
[--drain-ms <n>] [--json] [--quiet]
|
|
90
119
|
```
|
|
91
120
|
|
|
92
121
|
Exit codes: `0` ok, `1` at least one task failed, a delete refusal (unknown slug, active
|
|
@@ -140,6 +169,119 @@ No other environment value is read or persisted. The error log stores a timestam
|
|
|
140
169
|
a phase, and a message; it never stores prompt content or an environment value, and it is
|
|
141
170
|
trimmed to the newest 200 lines / 64 KiB.
|
|
142
171
|
|
|
172
|
+
## Scheduled jobs
|
|
173
|
+
|
|
174
|
+
`scheduler/jobs.json` holds the definitions, sorted by `id` and rewritten atomically; it is
|
|
175
|
+
meant to be **committed** ("jobs as code"), while run output and runtime state are ignored
|
|
176
|
+
(§ Location and ignore rules). A job carries `id`, `title`, `enabled`, a `schedule` (`cron`
|
|
177
|
+
five-field expression or `interval` with `everySeconds`), the IANA `timezone`, a `payload`,
|
|
178
|
+
`cwd`, `envPassthrough` (names only), `timeoutMs` (1 s – 12 h, default 15 min), `concurrency`
|
|
179
|
+
(`skip` / `queue` / `allow`), and `misfire` (`skip` / `run-once` / `catch-up`). The id is
|
|
180
|
+
immutable; a stale `revision` is `409 E_CONFLICT`.
|
|
181
|
+
|
|
182
|
+
**Payload kinds.** `command` runs `payload.argv` directly — `spawn(argv[0], argv.slice(1),
|
|
183
|
+
{ shell: false })`, never a shell string. `pipeline` lowers the same call after rendering
|
|
184
|
+
`payload.promptTemplate` into `<runDir>/prompt.md` (placeholders `{{job.id}}`, `{{run.id}}`,
|
|
185
|
+
`{{run.dir}}`, `{{team.root}}`, `{{now}}`) and substituting `{promptFile}` in
|
|
186
|
+
`payload.runner`. A `pipeline` job without `runner` is refused at validation; there is no
|
|
187
|
+
bundled agent runtime. The child environment is `PATH`, `HOME`, `TMPDIR`, `LANG`, `TZ` plus
|
|
188
|
+
the `envPassthrough` names; no `AI_RULES_TEAM_DB_*` value is forwarded, and `TZ` is the job's
|
|
189
|
+
timezone.
|
|
190
|
+
|
|
191
|
+
**Runs.** One tick claims each due occurrence inside `BEGIN IMMEDIATE` against `job_runs`, so
|
|
192
|
+
two racing firings produce one child and one `skipped` row. Children are spawned detached in
|
|
193
|
+
their own process group and bounded by `timeoutMs`: `SIGTERM`, a 5 s grace, then `SIGKILL` to
|
|
194
|
+
the group. `stdout` and `stderr` land in separate files capped at 1 MiB, the run manifest
|
|
195
|
+
carries the byte count, sha256, and truncation flag, and a run's state is one of `claimed`,
|
|
196
|
+
`running`, `succeeded`, `failed`, `timeout`, `skipped`, `interrupted`. The recorded sha256
|
|
197
|
+
covers exactly the capped bytes; the truncation marker is appended outside that scope, so a
|
|
198
|
+
capped stream projects clean instead of reporting `E_LOG_HASH`. A run-now request is durable:
|
|
199
|
+
`jobs run` appends it to `state.json`, the live timer re-reads and merges the queue at every
|
|
200
|
+
tick, and a request leaves the queue only when its run is claimed.
|
|
201
|
+
|
|
202
|
+
**Retention.** 1 MiB per stream per run, 200 runs per job, 30 days, and 2 GiB per team root,
|
|
203
|
+
enforced before the next write; an active run is never pruned, and a pruned run directory
|
|
204
|
+
takes its `job_runs` row with it. `state.json` keeps the last fire instant per job, which is
|
|
205
|
+
what makes `run-once` and `catch-up` survive downtime. `catch-up` replays at most five
|
|
206
|
+
occurrences per gap; when more were due, the replay is marked truncated (`catchUp.truncated`
|
|
207
|
+
on the manifest and an `E_CATCH_UP_TRUNCATED` event) and the remainder is dropped instead of
|
|
208
|
+
replaying five more on the next tick. A candidate fire must be later than the recorded one, so
|
|
209
|
+
a clock jump backwards never re-fires.
|
|
210
|
+
|
|
211
|
+
**There is no redaction.** A child's output is persisted verbatim in
|
|
212
|
+
`.ai.local/team/scheduler/runs/<jobId>/<runId>/`. Treat a job's output as secret-bearing: it
|
|
213
|
+
inherits the operator's environment through `envPassthrough`, the run directory is git-ignored
|
|
214
|
+
by the rule above, and retention bounds how long it is kept. `envPassthrough` carries names,
|
|
215
|
+
so `jobs.json` never holds a value.
|
|
216
|
+
|
|
217
|
+
**Recovery.** One scheduler per team root: the lease file `scheduler/scheduler.lock` refuses a
|
|
218
|
+
second `schedule` with exit 4, and a lease older than 90 s is stale, never deleted. A
|
|
219
|
+
`claimed`/`running` run whose process is gone is orphaned by definition: the next `schedule`
|
|
220
|
+
reconciles it before the first fire, and `jobs reconcile` does the same on demand — the
|
|
221
|
+
manifest and the row become `interrupted` with reason `E_ORPHANED`. `sync --rebuild` and
|
|
222
|
+
`sync --vacuum` refuse with `E_SCHEDULER_RUNNING` (exit 4) while a fresh lease exists. That
|
|
223
|
+
guard covers the explicit destructive flags only: a plain `init` or `sync` opens writable, and
|
|
224
|
+
a database whose recorded schema fingerprint no longer matches is moved aside as
|
|
225
|
+
`team.db.mismatch-<stamp>` and rebuilt (see § Schema) even while a scheduler holds the lease.
|
|
226
|
+
Stop the scheduler before any schema upgrade; the explicit flags are a backstop, not a
|
|
227
|
+
complete guard. The kill switch drains: no new claim, the in-flight child finishes inside its
|
|
228
|
+
own timeout, the result is recorded, exit 0. Supervision (launchd, systemd, Task Scheduler) is
|
|
229
|
+
documented practice, never shipped as a second timer, and Windows process-group termination is
|
|
230
|
+
not supported in v1.
|
|
231
|
+
|
|
232
|
+
## Upstream research job
|
|
233
|
+
|
|
234
|
+
The `next` preset ships one `pipeline` job, `upstream-research`, and one engine module,
|
|
235
|
+
`.ai.local/scripts/upstream-research.mjs`. The job renders `upstream/prompt.md` and runs the
|
|
236
|
+
module with `--prompt {promptFile} --team-root . --repo-root ../..`; it is a normal
|
|
237
|
+
definition in `scheduler/jobs.json`, so `jobs list|get|put|enable|disable|run`, the dashboard
|
|
238
|
+
Jobs tab, and every job route work unchanged.
|
|
239
|
+
|
|
240
|
+
**Supervision.** `misfire: run-once` fires one missed Monday at the next tick, and
|
|
241
|
+
`concurrency: skip` consumes and drops a manual request while a weekly run is live (the drop
|
|
242
|
+
is a `skipped` row with `E_CONCURRENCY_SKIP`). `jobs run` is durable: a request executes only
|
|
243
|
+
when a `schedule` tick claims it. Keep one supervisor (`launchd`, `systemd`, Task Scheduler)
|
|
244
|
+
running `node .ai.local/scripts/team-db.mjs schedule`; without one, `/upstream-research` adds
|
|
245
|
+
one `schedule --once` tick.
|
|
246
|
+
|
|
247
|
+
**Cursor.** Per-project scan state lives in the git-ignored
|
|
248
|
+
`.ai.local/team/upstream/cursor.json`. A lost cursor is rebuilt from the newest
|
|
249
|
+
`scheduler/runs/upstream-research/<runId>/report.json`, then degrades to a bounded baseline
|
|
250
|
+
when the run tree has been pruned. `upstream/projects.json`, `config.json`, `signatures.json`,
|
|
251
|
+
the prompt, the digest template, and the agent config are committed; `docs/upstream/digest-
|
|
252
|
+
<runId>.md` is committed and never pruned.
|
|
253
|
+
|
|
254
|
+
**Write allow-list.** A run writes only `scheduler/runs/upstream-research/<runId>/**`, the
|
|
255
|
+
cursor, and the committed digest. It never writes `status.json` or `metrics.json`, and the
|
|
256
|
+
scheduler keeps owning `run.json`, `stdout.log`, `stderr.log`, and `<runDir>/prompt.md`.
|
|
257
|
+
|
|
258
|
+
**Failure surface.** The scheduler's reason codes are a closed set, so a runner code such as
|
|
259
|
+
`E_OPENCODE_MISSING` lives in `report.json`, `stderr.log`, and the digest header; the job row
|
|
260
|
+
reports `E_EXIT_10` / `E_EXIT_11` / `E_EXIT_12` / `E_EXIT_13` / `E_EXIT_15` / `E_EXIT_16`.
|
|
261
|
+
`E_AGENT_CONFIG_INVALID` (12) means the resolved `upstream-researcher` no longer denies
|
|
262
|
+
every tool (the global `*` or a named action); reinstall `team/upstream/opencode.json` with
|
|
263
|
+
`init`/`update`.
|
|
264
|
+
|
|
265
|
+
**Commands.** Validate the registry with
|
|
266
|
+
`node .ai.local/scripts/upstream-research.mjs registry --check --team-root .`; refresh the
|
|
267
|
+
durable prior-art index with `signatures --write` (`--check` reports drift and writes
|
|
268
|
+
nothing). Adding a comparison project is one registry object plus a commit — no scheduler,
|
|
269
|
+
prompt, or code change.
|
|
270
|
+
|
|
271
|
+
**Model route.** `upstream/config.json` `agent.model` is `null` by default, so the agent runs
|
|
272
|
+
on whatever model the installed `opencode` resolves; set it to a `provider/model` id to pin
|
|
273
|
+
the route, which adds `--model` to the call with no code change.
|
|
274
|
+
|
|
275
|
+
## Upgrading an installed engine set
|
|
276
|
+
|
|
277
|
+
`update --fix` rewrites a seeded module only when its bytes still equal the digest recorded in
|
|
278
|
+
`.ai.local/.template-base.json`; the previous bytes go to `.ai.local/.rollback/engine-<stamp>/`
|
|
279
|
+
(the newest five runs are kept). `update --check` is the dry run: it names each eligible rel
|
|
280
|
+
and writes nothing. A module whose bytes differ from the recorded base is reported
|
|
281
|
+
`kept modified` and stays byte-identical — review the diff and delete the module to let the
|
|
282
|
+
next `update` seed it again. A module with no recorded base is `unattributable` and is never
|
|
283
|
+
written; delete it and re-run `init`. `doctor --fix` runs the same plan and writer.
|
|
284
|
+
|
|
143
285
|
## Schema
|
|
144
286
|
|
|
145
287
|
One embedded migration (`0001-init`, sha256-pinned) creates 15 row tables: `schema_migrations`,
|
|
@@ -148,6 +290,14 @@ One embedded migration (`0001-init`, sha256-pinned) creates 15 row tables: `sche
|
|
|
148
290
|
`sync_runs`; 19 indexes; and the `attempt_timeline` view. FTS5 (`search_fts`) is a runtime
|
|
149
291
|
capability created after migration, with an escaped `LIKE` fallback.
|
|
150
292
|
|
|
293
|
+
Migration `0002-scheduler` adds the scheduler's three tables — `scheduled_jobs`, `job_runs`,
|
|
294
|
+
`job_run_events` — and five indexes, and moves `SCHEMA_VERSION` to 2. It is additive and
|
|
295
|
+
sha256-pinned like the first one: a tampered literal aborts with `E_MIGRATION_CHECKSUM` before
|
|
296
|
+
any DDL. A v1 database is not read forward: its recorded fingerprint no longer describes the
|
|
297
|
+
schema, so the next open moves the file aside as `team.db.mismatch-<stamp>`, rebuilds, and
|
|
298
|
+
reprojects from the task files — database-only rows are discarded by design, which is why the
|
|
299
|
+
files are the source of truth. Run `sync` after an upgrade and the counters reconverge.
|
|
300
|
+
|
|
151
301
|
Each connection sets `journal_mode=WAL`, `busy_timeout=5000`, `foreign_keys=ON`, and
|
|
152
302
|
`synchronous=NORMAL`. One task is projected in one transaction; a `SIGKILL` mid-sync
|
|
153
303
|
rolls back the in-flight task and leaves `integrity_check` `ok`.
|
|
@@ -211,26 +361,46 @@ Security boundary: loopback bind by default (`--host` outside loopback needs
|
|
|
211
361
|
`--allow-remote`, and a wildcard address is refused), exact `Host`/`Origin` allow-list,
|
|
212
362
|
no `Access-Control-*` header, hardened response headers, request bodies bounded at 1 KiB,
|
|
213
363
|
document chunks at 1 MiB, exports at 5 MiB, parameterized SQL only, and no outbound call.
|
|
214
|
-
`--allow-remote` also exposes the
|
|
215
|
-
|
|
364
|
+
`--allow-remote` also exposes the four job mutations — `POST /api/v1/jobs`,
|
|
365
|
+
`PUT /api/v1/jobs/{id}`, `DELETE /api/v1/jobs/{id}`, and `POST /api/v1/jobs/{id}/run` —
|
|
366
|
+
the confirmed task delete and the rescan to the named interface without authentication.
|
|
367
|
+
A job definition carries arbitrary `argv` and run-now enqueues it, so that surface
|
|
368
|
+
executes operator-supplied commands as the API user; see `## Scheduled jobs`.
|
|
369
|
+
|
|
370
|
+
## Prompt capture
|
|
371
|
+
|
|
372
|
+
`prompt.md` and `prompt-log.md` are read by the existing projection. An inline work request calls `sync --slug <slug>` once after writing `prompt.md`; a post-terminal entry calls the same once after appending to `prompt-log.md`. Both are bounded, off the critical path, and never fail the file write. A missed projection is staleness, not data loss — the next full sync rebuilds the row.
|
|
216
373
|
|
|
217
374
|
## Privacy and retention
|
|
218
375
|
|
|
219
376
|
Prompts are copied verbatim into `prompts` and `documents`. The database is local, git-ignored,
|
|
220
377
|
and readable by the same OS user who can read the task folder; that is the trust boundary.
|
|
221
378
|
There is no upload, telemetry, or remote asset. `sync --maintain` nulls raw document content
|
|
222
|
-
for tasks absent longer than 90 days while keeping normalized rows and hashes.
|
|
379
|
+
for tasks absent longer than 90 days while keeping normalized rows and hashes. It does not
|
|
380
|
+
null `prompts.content`: prompt retention equals task-folder retention, and deleting the folder
|
|
381
|
+
is the lever.
|
|
382
|
+
|
|
383
|
+
Run output crosses the same boundary and is **not** redacted: `scheduler/runs/**` holds a
|
|
384
|
+
child's `stdout` and `stderr` verbatim, a job inherits the listed `envPassthrough` names, and
|
|
385
|
+
only the retention caps bound how long the bytes stay on disk.
|
|
223
386
|
|
|
224
387
|
## Rollback
|
|
225
388
|
|
|
226
389
|
1. Set `AI_RULES_TEAM_DB_DISABLE=1`. Every write point becomes a no-op: the hook,
|
|
227
|
-
`manifest.mjs`, `init`/`sync`/`migrate-tasks` and `serve` exit 0; `
|
|
228
|
-
exit 1 and
|
|
229
|
-
2.
|
|
230
|
-
|
|
231
|
-
|
|
390
|
+
`manifest.mjs`, `init`/`sync`/`migrate-tasks` and `serve` exit 0; `jobs` writes and
|
|
391
|
+
`delete` refuse with exit 1; `schedule` starts no claim and exits 0.
|
|
392
|
+
2. Stop the scheduler: send `SIGTERM` to the `schedule` process and let its in-flight run
|
|
393
|
+
finish, or let `--once` return. The lease is released on a clean exit; a lease left by a
|
|
394
|
+
killed process goes stale after 90 s, and `jobs reconcile` marks its runs `interrupted`.
|
|
395
|
+
3. Delete the projection: `rm -rf .ai.local/team/team.db .ai.local/team/team.db-wal
|
|
396
|
+
.ai.local/team/team.db-shm .ai.local/team/team-db-errors.log
|
|
397
|
+
.ai.local/team/scheduler/runs .ai.local/team/scheduler/state.json`. `scheduler/jobs.json`
|
|
398
|
+
is a definition file — keep it unless you are removing the feature. No task file is touched.
|
|
399
|
+
4. Revert the code: remove the hook region and the `projectAfterReceipt` call, delete the seven
|
|
232
400
|
modules from `ENGINE_SCRIPTS`, then run `yarn fix:generated` and recapture the goldens.
|
|
233
|
-
|
|
401
|
+
`update --fix` restores a module whose bytes still match the recorded base; `cp -R
|
|
402
|
+
.ai.local/.rollback/engine-<stamp>/.ai.local .` restores a whole previous set.
|
|
403
|
+
5. The ADR stays as history: mark it superseded instead of deleting it.
|
|
234
404
|
|
|
235
405
|
## Gates
|
|
236
406
|
|
|
@@ -246,6 +416,7 @@ node scripts/test-team-db-api.mjs
|
|
|
246
416
|
node scripts/test-team-db-security.mjs
|
|
247
417
|
node scripts/test-team-db-dashboard.mjs
|
|
248
418
|
node scripts/test-team-db-concurrency.mjs
|
|
419
|
+
node scripts/test-team-db-scheduler.mjs
|
|
249
420
|
node scripts/test-team-db-fixtures.mjs
|
|
250
421
|
```
|
|
251
422
|
|
|
@@ -253,5 +424,7 @@ node scripts/test-team-db-fixtures.mjs
|
|
|
253
424
|
planted defect, not only on the happy path.
|
|
254
425
|
|
|
255
426
|
Links: [`../README.md`](../README.md), [`PRESET-CONTRIBUTION.md`](PRESET-CONTRIBUTION.md),
|
|
256
|
-
the OpenSpec
|
|
257
|
-
|
|
427
|
+
the OpenSpec changes `openspec/changes/2026-11-06-agent-team-sqlite-dashboard/` and
|
|
428
|
+
`openspec/changes/2026-11-10-preset-task-scheduler-impl/`, and ADRs
|
|
429
|
+
`.ai.local/adr/0004-team-db-projection.md` and `.ai.local/adr/0005-team-db-scheduler.md` in
|
|
430
|
+
this repository.
|