opencastle 0.35.2 → 0.36.0
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/README.md +105 -145
- package/bin/cli.mjs +204 -63
- package/dist/cli/adapters/adapter-contract.test.d.ts +2 -0
- package/dist/cli/adapters/adapter-contract.test.d.ts.map +1 -0
- package/dist/cli/adapters/adapter-contract.test.js +53 -0
- package/dist/cli/adapters/adapter-contract.test.js.map +1 -0
- package/dist/cli/adapters/antigravity.d.ts +1 -1
- package/dist/cli/adapters/antigravity.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.d.ts +1 -1
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/codex.d.ts +1 -1
- package/dist/cli/adapters/codex.d.ts.map +1 -1
- package/dist/cli/adapters/cursor.d.ts +3 -20
- package/dist/cli/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/adapters/cursor.js +27 -256
- package/dist/cli/adapters/cursor.js.map +1 -1
- package/dist/cli/adapters/opencode.d.ts +1 -1
- package/dist/cli/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/adapters/rules-dir-base.d.ts +53 -0
- package/dist/cli/adapters/rules-dir-base.d.ts.map +1 -0
- package/dist/cli/adapters/rules-dir-base.js +309 -0
- package/dist/cli/adapters/rules-dir-base.js.map +1 -0
- package/dist/cli/adapters/rules-dir-base.test.d.ts +2 -0
- package/dist/cli/adapters/rules-dir-base.test.d.ts.map +1 -0
- package/dist/cli/adapters/rules-dir-base.test.js +203 -0
- package/dist/cli/adapters/rules-dir-base.test.js.map +1 -0
- package/dist/cli/adapters/single-file-base.d.ts +0 -14
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +250 -64
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/adapters/vscode.d.ts +1 -1
- package/dist/cli/adapters/vscode.d.ts.map +1 -1
- package/dist/cli/adapters/vscode.js +151 -53
- package/dist/cli/adapters/vscode.js.map +1 -1
- package/dist/cli/adapters/windsurf.d.ts +3 -20
- package/dist/cli/adapters/windsurf.d.ts.map +1 -1
- package/dist/cli/adapters/windsurf.js +33 -264
- package/dist/cli/adapters/windsurf.js.map +1 -1
- package/dist/cli/add.d.ts +3 -0
- package/dist/cli/add.d.ts.map +1 -0
- package/dist/cli/add.js +113 -0
- package/dist/cli/add.js.map +1 -0
- package/dist/cli/agent-roster.test.d.ts +2 -0
- package/dist/cli/agent-roster.test.d.ts.map +1 -0
- package/dist/cli/agent-roster.test.js +192 -0
- package/dist/cli/agent-roster.test.js.map +1 -0
- package/dist/cli/boundary.test.d.ts +2 -0
- package/dist/cli/boundary.test.d.ts.map +1 -0
- package/dist/cli/boundary.test.js +209 -0
- package/dist/cli/boundary.test.js.map +1 -0
- package/dist/cli/convoy/artifacts.d.ts +2 -2
- package/dist/cli/convoy/artifacts.d.ts.map +1 -1
- package/dist/cli/convoy/artifacts.js +4 -4
- package/dist/cli/convoy/artifacts.js.map +1 -1
- package/dist/cli/convoy/built-in-gates.test.d.ts +2 -0
- package/dist/cli/convoy/built-in-gates.test.d.ts.map +1 -0
- package/dist/cli/convoy/built-in-gates.test.js +109 -0
- package/dist/cli/convoy/built-in-gates.test.js.map +1 -0
- package/dist/cli/convoy/contracts.d.ts +7 -0
- package/dist/cli/convoy/contracts.d.ts.map +1 -1
- package/dist/cli/convoy/contracts.js +48 -65
- package/dist/cli/convoy/contracts.js.map +1 -1
- package/dist/cli/convoy/contracts.test.js +44 -21
- package/dist/cli/convoy/contracts.test.js.map +1 -1
- package/dist/cli/convoy/crash-status.test.d.ts +2 -0
- package/dist/cli/convoy/crash-status.test.d.ts.map +1 -0
- package/dist/cli/convoy/crash-status.test.js +215 -0
- package/dist/cli/convoy/crash-status.test.js.map +1 -0
- package/dist/cli/convoy/dag-analysis.d.ts +0 -1
- package/dist/cli/convoy/dag-analysis.d.ts.map +1 -1
- package/dist/cli/convoy/dag-analysis.js +0 -3
- package/dist/cli/convoy/dag-analysis.js.map +1 -1
- package/dist/cli/convoy/engine.d.ts +1 -7
- package/dist/cli/convoy/engine.d.ts.map +1 -1
- package/dist/cli/convoy/engine.js +185 -239
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/engine.test.js +151 -50
- package/dist/cli/convoy/engine.test.js.map +1 -1
- package/dist/cli/convoy/event-schemas.d.ts +0 -4
- package/dist/cli/convoy/event-schemas.d.ts.map +1 -1
- package/dist/cli/convoy/event-schemas.js +1 -1
- package/dist/cli/convoy/event-schemas.js.map +1 -1
- package/dist/cli/convoy/events.test.js.map +1 -1
- package/dist/cli/convoy/formula.d.ts +1 -1
- package/dist/cli/convoy/formula.d.ts.map +1 -1
- package/dist/cli/convoy/formula.test.js.map +1 -1
- package/dist/cli/convoy/gates.d.ts +47 -0
- package/dist/cli/convoy/gates.d.ts.map +1 -1
- package/dist/cli/convoy/gates.js +94 -0
- package/dist/cli/convoy/gates.js.map +1 -1
- package/dist/cli/convoy/health.d.ts +1 -1
- package/dist/cli/convoy/health.d.ts.map +1 -1
- package/dist/cli/convoy/ledger-paths.test.d.ts +2 -0
- package/dist/cli/convoy/ledger-paths.test.d.ts.map +1 -0
- package/dist/cli/convoy/ledger-paths.test.js +118 -0
- package/dist/cli/convoy/ledger-paths.test.js.map +1 -0
- package/dist/cli/convoy/lock.d.ts +0 -1
- package/dist/cli/convoy/lock.d.ts.map +1 -1
- package/dist/cli/convoy/lock.js +0 -3
- package/dist/cli/convoy/lock.js.map +1 -1
- package/dist/cli/convoy/lock.test.js.map +1 -1
- package/dist/cli/convoy/no-op-gate.test.d.ts +2 -0
- package/dist/cli/convoy/no-op-gate.test.d.ts.map +1 -0
- package/dist/cli/convoy/no-op-gate.test.js +135 -0
- package/dist/cli/convoy/no-op-gate.test.js.map +1 -0
- package/dist/cli/convoy/partition.d.ts +1 -1
- package/dist/cli/convoy/partition.d.ts.map +1 -1
- package/dist/cli/convoy/pipeline.d.ts +1 -1
- package/dist/cli/convoy/pipeline.d.ts.map +1 -1
- package/dist/cli/convoy/pipeline.js +1 -1
- package/dist/cli/convoy/pipeline.js.map +1 -1
- package/dist/cli/convoy/spec-builder.d.ts +0 -5
- package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
- package/dist/cli/convoy/spec-builder.js +1 -4
- package/dist/cli/convoy/spec-builder.js.map +1 -1
- package/dist/cli/convoy/spec-builder.test.js +0 -3
- package/dist/cli/convoy/spec-builder.test.js.map +1 -1
- package/dist/cli/convoy/spec-types.d.ts +250 -0
- package/dist/cli/convoy/spec-types.d.ts.map +1 -0
- package/dist/cli/convoy/spec-types.js +16 -0
- package/dist/cli/convoy/spec-types.js.map +1 -0
- package/dist/cli/convoy/tdd-gate.js +1 -1
- package/dist/cli/convoy/tdd-gate.js.map +1 -1
- package/dist/cli/convoy/tdd-gate.test.js +5 -5
- package/dist/cli/convoy/tdd-gate.test.js.map +1 -1
- package/dist/cli/convoy/types.d.ts +2 -0
- package/dist/cli/convoy/types.d.ts.map +1 -1
- package/dist/cli/convoy/types.js.map +1 -1
- package/dist/cli/convoy-cmd.d.ts +3 -0
- package/dist/cli/convoy-cmd.d.ts.map +1 -0
- package/dist/cli/convoy-cmd.js +187 -0
- package/dist/cli/convoy-cmd.js.map +1 -0
- package/dist/cli/copy.d.ts +16 -0
- package/dist/cli/copy.d.ts.map +1 -1
- package/dist/cli/copy.js +87 -6
- package/dist/cli/copy.js.map +1 -1
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +6 -28
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/detect.d.ts +11 -0
- package/dist/cli/detect.d.ts.map +1 -1
- package/dist/cli/detect.js +51 -0
- package/dist/cli/detect.js.map +1 -1
- package/dist/cli/dispatcher.test.d.ts +2 -0
- package/dist/cli/dispatcher.test.d.ts.map +1 -0
- package/dist/cli/dispatcher.test.js +119 -0
- package/dist/cli/dispatcher.test.js.map +1 -0
- package/dist/cli/docs-accuracy.test.d.ts +2 -0
- package/dist/cli/docs-accuracy.test.d.ts.map +1 -0
- package/dist/cli/docs-accuracy.test.js +630 -0
- package/dist/cli/docs-accuracy.test.js.map +1 -0
- package/dist/cli/doctor-remedies.test.d.ts +2 -0
- package/dist/cli/doctor-remedies.test.d.ts.map +1 -0
- package/dist/cli/doctor-remedies.test.js +184 -0
- package/dist/cli/doctor-remedies.test.js.map +1 -0
- package/dist/cli/doctor.d.ts +30 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +741 -35
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/gitignore.d.ts +41 -12
- package/dist/cli/gitignore.d.ts.map +1 -1
- package/dist/cli/gitignore.js +544 -55
- package/dist/cli/gitignore.js.map +1 -1
- package/dist/cli/gitignore.property.test.d.ts +2 -0
- package/dist/cli/gitignore.property.test.d.ts.map +1 -0
- package/dist/cli/gitignore.property.test.js +360 -0
- package/dist/cli/gitignore.property.test.js.map +1 -0
- package/dist/cli/init-detect.test.d.ts +2 -0
- package/dist/cli/init-detect.test.d.ts.map +1 -0
- package/dist/cli/init-detect.test.js +145 -0
- package/dist/cli/init-detect.test.js.map +1 -0
- package/dist/cli/init.d.ts +30 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +522 -162
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/init.test.d.ts +1 -1
- package/dist/cli/init.test.js +59 -77
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/legacy-install.test.d.ts +2 -0
- package/dist/cli/legacy-install.test.d.ts.map +1 -0
- package/dist/cli/legacy-install.test.js +273 -0
- package/dist/cli/legacy-install.test.js.map +1 -0
- package/dist/cli/lesson.d.ts +0 -5
- package/dist/cli/lesson.d.ts.map +1 -1
- package/dist/cli/lesson.js +1 -1
- package/dist/cli/lesson.js.map +1 -1
- package/dist/cli/log.d.ts +0 -2
- package/dist/cli/log.d.ts.map +1 -1
- package/dist/cli/log.js +3 -3
- package/dist/cli/log.js.map +1 -1
- package/dist/cli/managed-block.d.ts +223 -0
- package/dist/cli/managed-block.d.ts.map +1 -0
- package/dist/cli/managed-block.js +822 -0
- package/dist/cli/managed-block.js.map +1 -0
- package/dist/cli/managed-block.property.test.d.ts +2 -0
- package/dist/cli/managed-block.property.test.d.ts.map +1 -0
- package/dist/cli/managed-block.property.test.js +290 -0
- package/dist/cli/managed-block.property.test.js.map +1 -0
- package/dist/cli/managed-block.test.d.ts +2 -0
- package/dist/cli/managed-block.test.d.ts.map +1 -0
- package/dist/cli/managed-block.test.js +633 -0
- package/dist/cli/managed-block.test.js.map +1 -0
- package/dist/cli/managed-paths.d.ts +46 -0
- package/dist/cli/managed-paths.d.ts.map +1 -0
- package/dist/cli/managed-paths.js +106 -0
- package/dist/cli/managed-paths.js.map +1 -0
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +51 -9
- package/dist/cli/manifest.js.map +1 -1
- package/dist/cli/mcp.d.ts +34 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +232 -11
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/pipeline.d.ts.map +1 -1
- package/dist/cli/pipeline.js +8 -10
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +5 -5
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/prompt.d.ts +14 -1
- package/dist/cli/prompt.d.ts.map +1 -1
- package/dist/cli/prompt.js +43 -4
- package/dist/cli/prompt.js.map +1 -1
- package/dist/cli/publish-workflow.test.d.ts +2 -0
- package/dist/cli/publish-workflow.test.d.ts.map +1 -0
- package/dist/cli/publish-workflow.test.js +60 -0
- package/dist/cli/publish-workflow.test.js.map +1 -0
- package/dist/cli/remove.d.ts +3 -0
- package/dist/cli/remove.d.ts.map +1 -0
- package/dist/cli/remove.js +401 -0
- package/dist/cli/remove.js.map +1 -0
- package/dist/cli/remove.test.d.ts +2 -0
- package/dist/cli/remove.test.d.ts.map +1 -0
- package/dist/cli/remove.test.js +445 -0
- package/dist/cli/remove.test.js.map +1 -0
- package/dist/cli/run/adapters/claude.d.ts +1 -1
- package/dist/cli/run/adapters/claude.d.ts.map +1 -1
- package/dist/cli/run/adapters/claude.js +13 -119
- package/dist/cli/run/adapters/claude.js.map +1 -1
- package/dist/cli/run/adapters/claude.test.js +31 -47
- package/dist/cli/run/adapters/claude.test.js.map +1 -1
- package/dist/cli/run/adapters/codex.d.ts +1 -1
- package/dist/cli/run/adapters/codex.d.ts.map +1 -1
- package/dist/cli/run/adapters/copilot.d.ts +1 -1
- package/dist/cli/run/adapters/copilot.d.ts.map +1 -1
- package/dist/cli/run/adapters/cursor.d.ts +1 -1
- package/dist/cli/run/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/run/adapters/index.d.ts +1 -1
- package/dist/cli/run/adapters/index.d.ts.map +1 -1
- package/dist/cli/run/adapters/opencode.d.ts +1 -1
- package/dist/cli/run/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/run/executor.d.ts +1 -1
- package/dist/cli/run/executor.d.ts.map +1 -1
- package/dist/cli/run/executor.test.js +1 -2
- package/dist/cli/run/executor.test.js.map +1 -1
- package/dist/cli/run/reporter.d.ts +1 -1
- package/dist/cli/run/reporter.d.ts.map +1 -1
- package/dist/cli/run/schema.d.ts +1 -9
- package/dist/cli/run/schema.d.ts.map +1 -1
- package/dist/cli/run/schema.js +50 -50
- package/dist/cli/run/schema.js.map +1 -1
- package/dist/cli/run/schema.test.js +83 -4
- package/dist/cli/run/schema.test.js.map +1 -1
- package/dist/cli/run-finish.test.d.ts +2 -0
- package/dist/cli/run-finish.test.d.ts.map +1 -0
- package/dist/cli/run-finish.test.js +77 -0
- package/dist/cli/run-finish.test.js.map +1 -0
- package/dist/cli/run.d.ts +23 -0
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +95 -120
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/stack-config.d.ts +27 -6
- package/dist/cli/stack-config.d.ts.map +1 -1
- package/dist/cli/stack-config.js +83 -6
- package/dist/cli/stack-config.js.map +1 -1
- package/dist/cli/status.d.ts +27 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +380 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/cli/status.test.d.ts +2 -0
- package/dist/cli/status.test.d.ts.map +1 -0
- package/dist/cli/status.test.js +218 -0
- package/dist/cli/status.test.js.map +1 -0
- package/dist/cli/sync-check.d.ts +38 -0
- package/dist/cli/sync-check.d.ts.map +1 -0
- package/dist/cli/sync-check.js +525 -0
- package/dist/cli/sync-check.js.map +1 -0
- package/dist/cli/sync-check.test.d.ts +2 -0
- package/dist/cli/sync-check.test.d.ts.map +1 -0
- package/dist/cli/sync-check.test.js +366 -0
- package/dist/cli/sync-check.test.js.map +1 -0
- package/dist/cli/sync.d.ts +3 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +39 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/cli/tiers.d.ts +26 -0
- package/dist/cli/tiers.d.ts.map +1 -0
- package/dist/cli/tiers.js +50 -0
- package/dist/cli/tiers.js.map +1 -0
- package/dist/cli/tiers.test.d.ts +2 -0
- package/dist/cli/tiers.test.d.ts.map +1 -0
- package/dist/cli/tiers.test.js +268 -0
- package/dist/cli/tiers.test.js.map +1 -0
- package/dist/cli/types.d.ts +92 -231
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js +26 -0
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/unreadable-report.d.ts +18 -0
- package/dist/cli/unreadable-report.d.ts.map +1 -0
- package/dist/cli/unreadable-report.js +28 -0
- package/dist/cli/unreadable-report.js.map +1 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +395 -64
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/watch.d.ts +1 -1
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +1 -1
- package/dist/cli/watch.js.map +1 -1
- package/dist/orchestrator/plugins/astro/config.js +1 -1
- package/dist/orchestrator/plugins/astro/config.js.map +1 -1
- package/dist/orchestrator/plugins/chrome-devtools/config.js +1 -1
- package/dist/orchestrator/plugins/chrome-devtools/config.js.map +1 -1
- package/dist/orchestrator/plugins/contentful/config.js +2 -2
- package/dist/orchestrator/plugins/contentful/config.js.map +1 -1
- package/dist/orchestrator/plugins/convex/config.js +1 -1
- package/dist/orchestrator/plugins/convex/config.js.map +1 -1
- package/dist/orchestrator/plugins/netlify/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/netlify/config.js +0 -1
- package/dist/orchestrator/plugins/netlify/config.js.map +1 -1
- package/dist/orchestrator/plugins/notion/config.js +1 -1
- package/dist/orchestrator/plugins/notion/config.js.map +1 -1
- package/dist/orchestrator/plugins/nx/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/nx/config.js +0 -1
- package/dist/orchestrator/plugins/nx/config.js.map +1 -1
- package/dist/orchestrator/plugins/prisma/config.js +1 -1
- package/dist/orchestrator/plugins/prisma/config.js.map +1 -1
- package/dist/orchestrator/plugins/resend/config.js +1 -1
- package/dist/orchestrator/plugins/resend/config.js.map +1 -1
- package/dist/orchestrator/plugins/sanity/config.js +2 -2
- package/dist/orchestrator/plugins/sanity/config.js.map +1 -1
- package/dist/orchestrator/plugins/slack/config.js +1 -1
- package/dist/orchestrator/plugins/slack/config.js.map +1 -1
- package/dist/orchestrator/plugins/strapi/config.js +2 -2
- package/dist/orchestrator/plugins/strapi/config.js.map +1 -1
- package/dist/orchestrator/plugins/stripe/config.js +1 -1
- package/dist/orchestrator/plugins/stripe/config.js.map +1 -1
- package/dist/orchestrator/plugins/supabase/config.js +1 -1
- package/dist/orchestrator/plugins/supabase/config.js.map +1 -1
- package/dist/orchestrator/plugins/teams/config.js +1 -1
- package/dist/orchestrator/plugins/teams/config.js.map +1 -1
- package/dist/orchestrator/plugins/vercel/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/vercel/config.js +0 -4
- package/dist/orchestrator/plugins/vercel/config.js.map +1 -1
- package/package.json +10 -13
- package/src/cli/adapters/adapter-contract.test.ts +58 -0
- package/src/cli/adapters/cursor.ts +25 -409
- package/src/cli/adapters/rules-dir-base.test.ts +246 -0
- package/src/cli/adapters/rules-dir-base.ts +456 -0
- package/src/cli/adapters/single-file-base.ts +270 -66
- package/src/cli/adapters/vscode.ts +146 -50
- package/src/cli/adapters/windsurf.ts +32 -416
- package/src/cli/add.ts +125 -0
- package/src/cli/agent-roster.test.ts +209 -0
- package/src/cli/boundary.test.ts +221 -0
- package/src/cli/convoy/artifacts.ts +4 -4
- package/src/cli/convoy/built-in-gates.test.ts +117 -0
- package/src/cli/convoy/contracts.test.ts +51 -20
- package/src/cli/convoy/contracts.ts +50 -65
- package/src/cli/convoy/crash-status.test.ts +245 -0
- package/src/cli/convoy/dag-analysis.ts +0 -4
- package/src/cli/convoy/engine.test.ts +169 -51
- package/src/cli/convoy/engine.ts +231 -247
- package/src/cli/convoy/event-schemas.ts +1 -1
- package/src/cli/convoy/events.test.ts +1 -1
- package/src/cli/convoy/formula.test.ts +0 -1
- package/src/cli/convoy/formula.ts +1 -1
- package/src/cli/convoy/gates.ts +126 -0
- package/src/cli/convoy/health.test.ts +1 -1
- package/src/cli/convoy/health.ts +1 -1
- package/src/cli/convoy/ledger-paths.test.ts +138 -0
- package/src/cli/convoy/lock.test.ts +0 -1
- package/src/cli/convoy/lock.ts +0 -4
- package/src/cli/convoy/no-op-gate.test.ts +156 -0
- package/src/cli/convoy/partition.test.ts +1 -1
- package/src/cli/convoy/partition.ts +1 -1
- package/src/cli/convoy/pipeline.test.ts +1 -1
- package/src/cli/convoy/pipeline.ts +2 -2
- package/src/cli/convoy/spec-builder.test.ts +0 -3
- package/src/cli/convoy/spec-builder.ts +1 -4
- package/src/cli/convoy/spec-types.ts +286 -0
- package/src/cli/convoy/tdd-gate.test.ts +5 -5
- package/src/cli/convoy/tdd-gate.ts +1 -1
- package/src/cli/convoy/types.ts +3 -1
- package/src/cli/convoy-cmd.ts +216 -0
- package/src/cli/copy.ts +90 -6
- package/src/cli/dashboard.ts +6 -25
- package/src/cli/detect.ts +64 -0
- package/src/cli/dispatcher.test.ts +135 -0
- package/src/cli/docs-accuracy.test.ts +674 -0
- package/src/cli/doctor-remedies.test.ts +218 -0
- package/src/cli/doctor.ts +799 -35
- package/src/cli/gitignore.property.test.ts +425 -0
- package/src/cli/gitignore.ts +556 -60
- package/src/cli/init-detect.test.ts +182 -0
- package/src/cli/init.test.ts +60 -78
- package/src/cli/init.ts +580 -176
- package/src/cli/legacy-install.test.ts +324 -0
- package/src/cli/lesson.ts +1 -1
- package/src/cli/log.ts +3 -3
- package/src/cli/managed-block.property.test.ts +372 -0
- package/src/cli/managed-block.test.ts +755 -0
- package/src/cli/managed-block.ts +1011 -0
- package/src/cli/managed-paths.ts +117 -0
- package/src/cli/manifest.ts +50 -14
- package/src/cli/mcp.ts +249 -12
- package/src/cli/pipeline.ts +9 -11
- package/src/cli/plan.ts +7 -6
- package/src/cli/prompt.ts +45 -4
- package/src/cli/publish-workflow.test.ts +73 -0
- package/src/cli/remove.test.ts +530 -0
- package/src/cli/remove.ts +449 -0
- package/src/cli/run/adapters/claude.test.ts +37 -62
- package/src/cli/run/adapters/claude.ts +14 -148
- package/src/cli/run/adapters/codex.test.ts +1 -1
- package/src/cli/run/adapters/codex.ts +1 -1
- package/src/cli/run/adapters/copilot.test.ts +1 -1
- package/src/cli/run/adapters/copilot.ts +1 -1
- package/src/cli/run/adapters/cursor.test.ts +1 -1
- package/src/cli/run/adapters/cursor.ts +1 -1
- package/src/cli/run/adapters/index.ts +1 -1
- package/src/cli/run/adapters/opencode.test.ts +1 -1
- package/src/cli/run/adapters/opencode.ts +1 -1
- package/src/cli/run/executor.test.ts +3 -4
- package/src/cli/run/executor.ts +1 -1
- package/src/cli/run/reporter.ts +1 -1
- package/src/cli/run/schema.test.ts +94 -4
- package/src/cli/run/schema.ts +53 -52
- package/src/cli/run-finish.test.ts +91 -0
- package/src/cli/run.ts +112 -105
- package/src/cli/stack-config.ts +96 -7
- package/src/cli/status.test.ts +251 -0
- package/src/cli/status.ts +404 -0
- package/src/cli/sync-check.test.ts +435 -0
- package/src/cli/sync-check.ts +573 -0
- package/src/cli/sync.ts +44 -0
- package/src/cli/tiers.test.ts +294 -0
- package/src/cli/tiers.ts +63 -0
- package/src/cli/types.ts +109 -255
- package/src/cli/unreadable-report.ts +26 -0
- package/src/cli/update.ts +430 -67
- package/src/cli/watch.ts +2 -3
- package/src/dashboard/dist/data/convoy-list.json +1 -93
- package/src/dashboard/dist/data/overall-stats.json +15 -99
- package/src/dashboard/dist/index.html +47 -56
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/dashboard/public/data/convoy-list.json +1 -93
- package/src/dashboard/public/data/overall-stats.json +15 -99
- package/src/dashboard/scripts/generate-demo-db.ts +26 -20
- package/src/dashboard/seed-data/delegations.ndjson +35 -35
- package/src/dashboard/seed-data/events.ndjson +104 -104
- package/src/dashboard/seed-data/panels.ndjson +13 -13
- package/src/dashboard/seed-data/reviews.ndjson +6 -6
- package/src/dashboard/seed-data/sessions.ndjson +50 -50
- package/src/dashboard/src/pages/index.astro +45 -54
- package/src/orchestrator/agent-workflows/data-pipeline.md +4 -4
- package/src/orchestrator/agent-workflows/database-migration.md +3 -3
- package/src/orchestrator/agent-workflows/feature-implementation.md +3 -3
- package/src/orchestrator/agent-workflows/performance-optimization.md +1 -1
- package/src/orchestrator/agents/architect.agent.md +24 -43
- package/src/orchestrator/agents/content-engineer.agent.md +19 -29
- package/src/orchestrator/agents/data-engineer.agent.md +65 -0
- package/src/orchestrator/agents/developer.agent.md +24 -37
- package/src/orchestrator/agents/devops-expert.agent.md +32 -39
- package/src/orchestrator/agents/performance-expert.agent.md +28 -42
- package/src/orchestrator/agents/researcher.agent.md +20 -40
- package/src/orchestrator/agents/reviewer.agent.md +13 -15
- package/src/orchestrator/agents/security-expert.agent.md +27 -38
- package/src/orchestrator/agents/team-lead.agent.md +16 -22
- package/src/orchestrator/agents/testing-expert.agent.md +21 -38
- package/src/orchestrator/agents/ui-ux-expert.agent.md +28 -41
- package/src/orchestrator/agents/writer.agent.md +68 -0
- package/src/orchestrator/customizations/AGENT-EXPERTISE.md +7 -7
- package/src/orchestrator/customizations/AGENT-PERFORMANCE.md +1 -1
- package/src/orchestrator/customizations/agents/agent-registry.md +19 -20
- package/src/orchestrator/customizations/agents/skill-matrix.json +157 -60
- package/src/orchestrator/customizations/agents/skill-matrix.md +12 -12
- package/src/orchestrator/customizations/logs/README.md +10 -10
- package/src/orchestrator/customizations/project/tracker-config.md +2 -2
- package/src/orchestrator/instructions/general.instructions.md +29 -6
- package/src/orchestrator/plugins/astro/SKILL.md +16 -109
- package/src/orchestrator/plugins/astro/config.ts +1 -1
- package/src/orchestrator/plugins/chrome-devtools/SKILL.md +15 -128
- package/src/orchestrator/plugins/chrome-devtools/config.ts +1 -1
- package/src/orchestrator/plugins/cloudflare/SKILL.md +17 -95
- package/src/orchestrator/plugins/contentful/SKILL.md +15 -68
- package/src/orchestrator/plugins/contentful/config.ts +2 -2
- package/src/orchestrator/plugins/convex/SKILL.md +49 -133
- package/src/orchestrator/plugins/convex/config.ts +1 -1
- package/src/orchestrator/plugins/coolify/SKILL.md +18 -122
- package/src/orchestrator/plugins/cypress/SKILL.md +15 -66
- package/src/orchestrator/plugins/drizzle/SKILL.md +15 -112
- package/src/orchestrator/plugins/expo/SKILL.md +13 -101
- package/src/orchestrator/plugins/figma/SKILL.md +30 -47
- package/src/orchestrator/plugins/jira/SKILL.md +14 -58
- package/src/orchestrator/plugins/linear/SKILL.md +19 -75
- package/src/orchestrator/plugins/netlify/SKILL.md +18 -87
- package/src/orchestrator/plugins/netlify/config.ts +0 -1
- package/src/orchestrator/plugins/nextjs/SKILL.md +12 -58
- package/src/orchestrator/plugins/notion/SKILL.md +16 -46
- package/src/orchestrator/plugins/notion/config.ts +1 -1
- package/src/orchestrator/plugins/nx/SKILL.md +30 -114
- package/src/orchestrator/plugins/nx/config.ts +0 -1
- package/src/orchestrator/plugins/playwright/SKILL.md +23 -96
- package/src/orchestrator/plugins/prisma/SKILL.md +20 -68
- package/src/orchestrator/plugins/prisma/config.ts +1 -1
- package/src/orchestrator/plugins/resend/SKILL.md +15 -58
- package/src/orchestrator/plugins/resend/config.ts +1 -1
- package/src/orchestrator/plugins/sanity/SKILL.md +15 -54
- package/src/orchestrator/plugins/sanity/config.ts +2 -2
- package/src/orchestrator/plugins/sentry/SKILL.md +14 -81
- package/src/orchestrator/plugins/slack/SKILL.md +20 -56
- package/src/orchestrator/plugins/slack/config.ts +1 -1
- package/src/orchestrator/plugins/strapi/SKILL.md +19 -65
- package/src/orchestrator/plugins/strapi/config.ts +2 -2
- package/src/orchestrator/plugins/stripe/SKILL.md +18 -124
- package/src/orchestrator/plugins/stripe/config.ts +1 -1
- package/src/orchestrator/plugins/supabase/SKILL.md +22 -36
- package/src/orchestrator/plugins/supabase/config.ts +1 -1
- package/src/orchestrator/plugins/teams/SKILL.md +1 -1
- package/src/orchestrator/plugins/teams/config.ts +1 -1
- package/src/orchestrator/plugins/turborepo/SKILL.md +0 -2
- package/src/orchestrator/plugins/vercel/SKILL.md +1 -1
- package/src/orchestrator/plugins/vercel/config.ts +0 -4
- package/src/orchestrator/prompts/assess-complexity.prompt.md +8 -8
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +18 -18
- package/src/orchestrator/prompts/brainstorm.prompt.md +17 -17
- package/src/orchestrator/prompts/bug-fix.prompt.md +12 -12
- package/src/orchestrator/prompts/create-skill.prompt.md +21 -21
- package/src/orchestrator/prompts/fix-convoy.prompt.md +8 -8
- package/src/orchestrator/prompts/fix-prd.prompt.md +12 -12
- package/src/orchestrator/prompts/generate-convoy.prompt.md +51 -52
- package/src/orchestrator/prompts/generate-prd.prompt.md +31 -35
- package/src/orchestrator/prompts/implement-feature.prompt.md +17 -17
- package/src/orchestrator/prompts/quick-refinement.prompt.md +18 -18
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +9 -9
- package/src/orchestrator/prompts/validate-convoy.prompt.md +10 -10
- package/src/orchestrator/prompts/validate-prd.prompt.md +10 -10
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +18 -88
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +6 -8
- package/src/orchestrator/skills/agent-hooks/SKILL.md +7 -7
- package/src/orchestrator/skills/agent-memory/SKILL.md +12 -13
- package/src/orchestrator/skills/api-patterns/SKILL.md +11 -69
- package/src/orchestrator/skills/code-commenting/SKILL.md +7 -72
- package/src/orchestrator/skills/context-map/REFERENCE.md +1 -2
- package/src/orchestrator/skills/context-map/SKILL.md +5 -5
- package/src/orchestrator/skills/data-engineering/SKILL.md +12 -44
- package/src/orchestrator/skills/decomposition/SKILL.md +33 -25
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +15 -68
- package/src/orchestrator/skills/documentation-standards/SKILL.md +11 -103
- package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +3 -3
- package/src/orchestrator/skills/fast-review/SKILL.md +4 -7
- package/src/orchestrator/skills/frontend-design/COMPONENTS.md +1 -1
- package/src/orchestrator/skills/frontend-design/SKILL.md +10 -48
- package/src/orchestrator/skills/git-workflow/SKILL.md +11 -6
- package/src/orchestrator/skills/memory-merger/SKILL.md +15 -11
- package/src/orchestrator/skills/observability-logging/SKILL.md +14 -17
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +1 -1
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +23 -35
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -2
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +7 -15
- package/src/orchestrator/skills/performance-optimization/SKILL.md +12 -69
- package/src/orchestrator/skills/project-consistency/SKILL.md +7 -19
- package/src/orchestrator/skills/react-development/SKILL.md +13 -65
- package/src/orchestrator/skills/security-hardening/SKILL.md +14 -142
- package/src/orchestrator/skills/self-improvement/SKILL.md +13 -14
- package/src/orchestrator/skills/seo-patterns/SKILL.md +14 -53
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +11 -38
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +9 -15
- package/src/orchestrator/skills/testing-workflow/SKILL.md +17 -99
- package/src/orchestrator/skills/validation-gates/SKILL.md +23 -19
- package/dist/cli/agents.d.ts +0 -3
- package/dist/cli/agents.d.ts.map +0 -1
- package/dist/cli/agents.js +0 -175
- package/dist/cli/agents.js.map +0 -1
- package/dist/cli/artifacts-cli.d.ts +0 -3
- package/dist/cli/artifacts-cli.d.ts.map +0 -1
- package/dist/cli/artifacts-cli.js +0 -36
- package/dist/cli/artifacts-cli.js.map +0 -1
- package/dist/cli/baselines.d.ts +0 -3
- package/dist/cli/baselines.d.ts.map +0 -1
- package/dist/cli/baselines.js +0 -151
- package/dist/cli/baselines.js.map +0 -1
- package/dist/cli/convoy/compaction.d.ts +0 -23
- package/dist/cli/convoy/compaction.d.ts.map +0 -1
- package/dist/cli/convoy/compaction.js +0 -117
- package/dist/cli/convoy/compaction.js.map +0 -1
- package/dist/cli/convoy/compaction.test.d.ts +0 -2
- package/dist/cli/convoy/compaction.test.d.ts.map +0 -1
- package/dist/cli/convoy/compaction.test.js +0 -205
- package/dist/cli/convoy/compaction.test.js.map +0 -1
- package/dist/cli/convoy/expertise.d.ts +0 -16
- package/dist/cli/convoy/expertise.d.ts.map +0 -1
- package/dist/cli/convoy/expertise.js +0 -121
- package/dist/cli/convoy/expertise.js.map +0 -1
- package/dist/cli/convoy/expertise.test.d.ts +0 -2
- package/dist/cli/convoy/expertise.test.d.ts.map +0 -1
- package/dist/cli/convoy/expertise.test.js +0 -96
- package/dist/cli/convoy/expertise.test.js.map +0 -1
- package/dist/cli/convoy/export.d.ts +0 -2
- package/dist/cli/convoy/export.d.ts.map +0 -1
- package/dist/cli/convoy/export.js +0 -10
- package/dist/cli/convoy/export.js.map +0 -1
- package/dist/cli/convoy/export.test.d.ts +0 -2
- package/dist/cli/convoy/export.test.d.ts.map +0 -1
- package/dist/cli/convoy/export.test.js +0 -10
- package/dist/cli/convoy/export.test.js.map +0 -1
- package/dist/cli/convoy/issues.d.ts +0 -8
- package/dist/cli/convoy/issues.d.ts.map +0 -1
- package/dist/cli/convoy/issues.js +0 -98
- package/dist/cli/convoy/issues.js.map +0 -1
- package/dist/cli/convoy/issues.test.d.ts +0 -2
- package/dist/cli/convoy/issues.test.d.ts.map +0 -1
- package/dist/cli/convoy/issues.test.js +0 -108
- package/dist/cli/convoy/issues.test.js.map +0 -1
- package/dist/cli/convoy/knowledge.d.ts +0 -5
- package/dist/cli/convoy/knowledge.d.ts.map +0 -1
- package/dist/cli/convoy/knowledge.js +0 -116
- package/dist/cli/convoy/knowledge.js.map +0 -1
- package/dist/cli/convoy/knowledge.test.d.ts +0 -2
- package/dist/cli/convoy/knowledge.test.d.ts.map +0 -1
- package/dist/cli/convoy/knowledge.test.js +0 -87
- package/dist/cli/convoy/knowledge.test.js.map +0 -1
- package/dist/cli/convoy/lessons.d.ts +0 -17
- package/dist/cli/convoy/lessons.d.ts.map +0 -1
- package/dist/cli/convoy/lessons.js +0 -149
- package/dist/cli/convoy/lessons.js.map +0 -1
- package/dist/cli/convoy/lessons.test.d.ts +0 -2
- package/dist/cli/convoy/lessons.test.d.ts.map +0 -1
- package/dist/cli/convoy/lessons.test.js +0 -135
- package/dist/cli/convoy/lessons.test.js.map +0 -1
- package/dist/cli/convoy/skill-refinement.d.ts +0 -39
- package/dist/cli/convoy/skill-refinement.d.ts.map +0 -1
- package/dist/cli/convoy/skill-refinement.js +0 -239
- package/dist/cli/convoy/skill-refinement.js.map +0 -1
- package/dist/cli/convoy/skill-refinement.test.d.ts +0 -2
- package/dist/cli/convoy/skill-refinement.test.d.ts.map +0 -1
- package/dist/cli/convoy/skill-refinement.test.js +0 -230
- package/dist/cli/convoy/skill-refinement.test.js.map +0 -1
- package/dist/cli/destroy.d.ts +0 -3
- package/dist/cli/destroy.d.ts.map +0 -1
- package/dist/cli/destroy.js +0 -82
- package/dist/cli/destroy.js.map +0 -1
- package/dist/cli/destroy.test.d.ts +0 -2
- package/dist/cli/destroy.test.d.ts.map +0 -1
- package/dist/cli/destroy.test.js +0 -116
- package/dist/cli/destroy.test.js.map +0 -1
- package/dist/cli/dispute.d.ts +0 -3
- package/dist/cli/dispute.d.ts.map +0 -1
- package/dist/cli/dispute.js +0 -25
- package/dist/cli/dispute.js.map +0 -1
- package/dist/cli/eject.d.ts +0 -3
- package/dist/cli/eject.d.ts.map +0 -1
- package/dist/cli/eject.js +0 -46
- package/dist/cli/eject.js.map +0 -1
- package/dist/cli/insights.d.ts +0 -3
- package/dist/cli/insights.d.ts.map +0 -1
- package/dist/cli/insights.js +0 -98
- package/dist/cli/insights.js.map +0 -1
- package/dist/cli/package-config.d.ts +0 -12
- package/dist/cli/package-config.d.ts.map +0 -1
- package/dist/cli/package-config.js +0 -37
- package/dist/cli/package-config.js.map +0 -1
- package/dist/cli/package.d.ts +0 -23
- package/dist/cli/package.d.ts.map +0 -1
- package/dist/cli/package.js +0 -293
- package/dist/cli/package.js.map +0 -1
- package/dist/cli/package.test.d.ts +0 -2
- package/dist/cli/package.test.d.ts.map +0 -1
- package/dist/cli/package.test.js +0 -236
- package/dist/cli/package.test.js.map +0 -1
- package/dist/cli/skills.d.ts +0 -3
- package/dist/cli/skills.d.ts.map +0 -1
- package/dist/cli/skills.js +0 -107
- package/dist/cli/skills.js.map +0 -1
- package/dist/cli/validate.d.ts +0 -3
- package/dist/cli/validate.d.ts.map +0 -1
- package/dist/cli/validate.js +0 -60
- package/dist/cli/validate.js.map +0 -1
- package/src/cli/agents.ts +0 -192
- package/src/cli/artifacts-cli.ts +0 -41
- package/src/cli/baselines.ts +0 -158
- package/src/cli/convoy/compaction.test.ts +0 -245
- package/src/cli/convoy/compaction.ts +0 -164
- package/src/cli/convoy/expertise.test.ts +0 -128
- package/src/cli/convoy/expertise.ts +0 -163
- package/src/cli/convoy/export.test.ts +0 -11
- package/src/cli/convoy/export.ts +0 -10
- package/src/cli/convoy/issues.test.ts +0 -144
- package/src/cli/convoy/issues.ts +0 -136
- package/src/cli/convoy/knowledge.test.ts +0 -101
- package/src/cli/convoy/knowledge.ts +0 -132
- package/src/cli/convoy/lessons.test.ts +0 -188
- package/src/cli/convoy/lessons.ts +0 -164
- package/src/cli/convoy/skill-refinement.test.ts +0 -277
- package/src/cli/convoy/skill-refinement.ts +0 -306
- package/src/cli/destroy.test.ts +0 -141
- package/src/cli/destroy.ts +0 -103
- package/src/cli/dispute.ts +0 -28
- package/src/cli/eject.ts +0 -61
- package/src/cli/insights.ts +0 -100
- package/src/cli/package-config.ts +0 -48
- package/src/cli/package.test.ts +0 -276
- package/src/cli/package.ts +0 -331
- package/src/cli/run/adapters/vendor.d.ts +0 -2
- package/src/cli/skills.ts +0 -121
- package/src/cli/validate.ts +0 -65
- package/src/dashboard/dist/data/convoys/demo-api-v2.json +0 -183
- package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +0 -249
- package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +0 -342
- package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +0 -193
- package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +0 -157
- package/src/dashboard/dist/data/convoys/demo-docs-update.json +0 -158
- package/src/dashboard/dist/data/convoys/demo-perf-opt.json +0 -235
- package/src/dashboard/dist/data/events.ndjson +0 -115
- package/src/dashboard/public/data/convoys/demo-api-v2.json +0 -183
- package/src/dashboard/public/data/convoys/demo-auth-revamp.json +0 -249
- package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +0 -342
- package/src/dashboard/public/data/convoys/demo-data-pipeline.json +0 -193
- package/src/dashboard/public/data/convoys/demo-deploy-ci.json +0 -157
- package/src/dashboard/public/data/convoys/demo-docs-update.json +0 -158
- package/src/dashboard/public/data/convoys/demo-perf-opt.json +0 -235
- package/src/dashboard/public/data/events.ndjson +0 -115
- package/src/dashboard/scripts/generate-seed-data.ts +0 -335
- package/src/orchestrator/agents/api-designer.agent.md +0 -52
- package/src/orchestrator/agents/copywriter.agent.md +0 -65
- package/src/orchestrator/agents/data-expert.agent.md +0 -56
- package/src/orchestrator/agents/database-engineer.agent.md +0 -55
- package/src/orchestrator/agents/documentation-writer.agent.md +0 -60
- package/src/orchestrator/agents/release-manager.agent.md +0 -56
- package/src/orchestrator/agents/seo-specialist.agent.md +0 -54
- package/src/orchestrator/agents/session-guard.agent.md +0 -57
- package/src/orchestrator/plugins/astro/REFERENCE.md +0 -5
- package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +0 -9
- package/src/orchestrator/plugins/cloudflare/references/deployment.md +0 -147
- package/src/orchestrator/plugins/cloudflare/references/storage.md +0 -118
- package/src/orchestrator/plugins/cloudflare/references/workers.md +0 -135
- package/src/orchestrator/plugins/contentful/REFERENCE.md +0 -16
- package/src/orchestrator/plugins/convex/references/auth-auth0.md +0 -116
- package/src/orchestrator/plugins/convex/references/auth-clerk.md +0 -113
- package/src/orchestrator/plugins/convex/references/auth-convex-auth.md +0 -143
- package/src/orchestrator/plugins/convex/references/auth-setup.md +0 -87
- package/src/orchestrator/plugins/convex/references/auth-workos.md +0 -114
- package/src/orchestrator/plugins/convex/references/components-advanced.md +0 -134
- package/src/orchestrator/plugins/convex/references/components.md +0 -171
- package/src/orchestrator/plugins/convex/references/function-budget.md +0 -232
- package/src/orchestrator/plugins/convex/references/hot-path-rules.md +0 -371
- package/src/orchestrator/plugins/convex/references/migrations-component.md +0 -170
- package/src/orchestrator/plugins/convex/references/migrations.md +0 -259
- package/src/orchestrator/plugins/convex/references/occ-conflicts.md +0 -126
- package/src/orchestrator/plugins/convex/references/performance-audit.md +0 -80
- package/src/orchestrator/plugins/convex/references/quickstart.md +0 -176
- package/src/orchestrator/plugins/convex/references/subscription-cost.md +0 -252
- package/src/orchestrator/plugins/coolify/references/applications.md +0 -65
- package/src/orchestrator/plugins/coolify/references/ci-cd-webhooks.md +0 -73
- package/src/orchestrator/plugins/coolify/references/databases-services.md +0 -57
- package/src/orchestrator/plugins/coolify/references/docker-compose.md +0 -121
- package/src/orchestrator/plugins/coolify/references/infrastructure.md +0 -77
- package/src/orchestrator/plugins/cypress/REFERENCE.md +0 -5
- package/src/orchestrator/plugins/drizzle/references/migrations.md +0 -112
- package/src/orchestrator/plugins/drizzle/references/query-patterns.md +0 -127
- package/src/orchestrator/plugins/drizzle/references/schema-patterns.md +0 -105
- package/src/orchestrator/plugins/expo/references/eas-build.md +0 -73
- package/src/orchestrator/plugins/expo/references/native-modules.md +0 -71
- package/src/orchestrator/plugins/expo/references/routing.md +0 -83
- package/src/orchestrator/plugins/figma/REFERENCE.md +0 -18
- package/src/orchestrator/plugins/jira/REFERENCE.md +0 -9
- package/src/orchestrator/plugins/netlify/REFERENCE.md +0 -33
- package/src/orchestrator/plugins/nextjs/REFERENCE.md +0 -73
- package/src/orchestrator/plugins/notion/TEMPLATES.md +0 -88
- package/src/orchestrator/plugins/nx/REFERENCE.md +0 -10
- package/src/orchestrator/plugins/playwright/REFERENCE.md +0 -12
- package/src/orchestrator/plugins/prisma/REFERENCE.md +0 -42
- package/src/orchestrator/plugins/resend/REFERENCE.md +0 -61
- package/src/orchestrator/plugins/sentry/references/error-patterns.md +0 -112
- package/src/orchestrator/plugins/sentry/references/performance.md +0 -66
- package/src/orchestrator/plugins/sentry/references/sdk-setup.md +0 -108
- package/src/orchestrator/plugins/slack/REFERENCE.md +0 -24
- package/src/orchestrator/plugins/strapi/REFERENCE.md +0 -35
- package/src/orchestrator/plugins/stripe/references/api-patterns.md +0 -57
- package/src/orchestrator/plugins/stripe/references/projects-setup.md +0 -30
- package/src/orchestrator/plugins/stripe/references/upgrade-guide.md +0 -105
- package/src/orchestrator/plugins/supabase/REFERENCE.md +0 -9
- package/src/orchestrator/plugins/teams/REFERENCE.md +0 -36
- package/src/orchestrator/plugins/trello/REFERENCE.md +0 -9
- package/src/orchestrator/plugins/turborepo/REFERENCE.md +0 -9
- package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +0 -16
- package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +0 -115
- package/src/orchestrator/skills/decomposition/REFERENCE.md +0 -28
- package/src/orchestrator/skills/memory-merger/REFERENCE.md +0 -20
- package/src/orchestrator/skills/react-development/REFERENCE.md +0 -7
- package/src/orchestrator/skills/seo-patterns/REFERENCE.md +0 -54
- package/src/orchestrator/snippets/base-output-contract.md +0 -14
- package/src/orchestrator/snippets/discovered-issues-policy.md +0 -15
- package/src/orchestrator/snippets/logging-mandatory.md +0 -11
- package/src/orchestrator/snippets/never-expose-secrets.md +0 -22
package/src/cli/convoy/engine.ts
CHANGED
|
@@ -2,20 +2,16 @@ import { execFile as execFileCb } from 'node:child_process'
|
|
|
2
2
|
import { createHash } from 'node:crypto'
|
|
3
3
|
import {
|
|
4
4
|
appendFileSync,
|
|
5
|
-
closeSync,
|
|
6
5
|
existsSync,
|
|
7
|
-
fsyncSync,
|
|
8
6
|
mkdirSync,
|
|
9
|
-
openSync,
|
|
10
7
|
readFileSync,
|
|
11
8
|
renameSync,
|
|
12
9
|
unlinkSync,
|
|
13
|
-
writeFileSync,
|
|
14
10
|
} from 'node:fs'
|
|
15
11
|
import { dirname, join, resolve } from 'node:path'
|
|
16
12
|
import { DatabaseSync } from 'node:sqlite'
|
|
17
13
|
import { promisify } from 'node:util'
|
|
18
|
-
import type { Task, TaskSpec, AgentAdapter, ExecuteResult, ReviewHeuristics } from '
|
|
14
|
+
import type { Task, TaskSpec, AgentAdapter, ExecuteResult, ReviewHeuristics, PermissionMode } from './spec-types.js'
|
|
19
15
|
import { createConvoyStore, ConvoyArtifactLimitError, type ConvoyStore } from './store.js'
|
|
20
16
|
import { acquireEngineLock } from './lock.js'
|
|
21
17
|
import { createEventEmitter, ndjsonPathForConvoy, recoverNdjson, type ConvoyEventEmitter } from './events.js'
|
|
@@ -28,45 +24,25 @@ import { parseTimeout, parseYaml } from '../run/schema.js'
|
|
|
28
24
|
import { getAdapter, detectAdapter } from '../run/adapters/index.js'
|
|
29
25
|
import { c } from '../prompt.js'
|
|
30
26
|
import { validateFilePartitions, scanSymlinks, scanNewSymlinks, normalizePath, pathsOverlap } from './partition.js'
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
import {
|
|
28
|
+
scanForSecrets,
|
|
29
|
+
runSecretScanGate,
|
|
30
|
+
runBlastRadiusGate,
|
|
31
|
+
runDependencyAuditGate,
|
|
32
|
+
runRegressionTestGate,
|
|
33
|
+
browserTestGate,
|
|
34
|
+
noOpGate,
|
|
35
|
+
collectWorktreeChanges,
|
|
36
|
+
} from './gates.js'
|
|
36
37
|
import { validateOutput, buildContractInstruction, buildContractRetryPrompt } from './contracts.js'
|
|
37
38
|
import { runTwoStageReview } from './review-stages.js'
|
|
38
39
|
import { buildIsolationPreamble, resolveDependencyResults, detectPartitionViolations } from './isolation.js'
|
|
39
40
|
import { checkTDD, formatTDDFailure, DEFAULT_TDD_CONFIG } from './tdd-gate.js'
|
|
40
|
-
import { runSkillRefinementCheck } from './skill-refinement.js'
|
|
41
41
|
import { getArtifactDir, extractArtifactRefs } from './artifacts.js'
|
|
42
|
-
import { shouldCompact, parseCompactionSummary, saveCompaction, canCompact, getMaxCompactions, generateCompactionPrompt, buildContinuationPrompt } from './compaction.js'
|
|
43
42
|
import { calculateCost } from './pricing.js'
|
|
44
43
|
|
|
45
44
|
const execFile = promisify(execFileCb)
|
|
46
45
|
|
|
47
|
-
/** Map agent names to their default model. Used when adapters don't report model. */
|
|
48
|
-
const AGENT_MODEL_MAP: Record<string, string> = {
|
|
49
|
-
'developer': 'claude-sonnet-4-6',
|
|
50
|
-
'ui-ux-expert': 'claude-sonnet-4-6',
|
|
51
|
-
'testing-expert': 'claude-sonnet-4-6',
|
|
52
|
-
'security-expert': 'claude-sonnet-4-6',
|
|
53
|
-
'performance-expert': 'claude-sonnet-4-6',
|
|
54
|
-
'devops-expert': 'claude-sonnet-4-6',
|
|
55
|
-
'data-expert': 'claude-sonnet-4-6',
|
|
56
|
-
'api-designer': 'claude-sonnet-4-6',
|
|
57
|
-
'copywriter': 'claude-sonnet-4-6',
|
|
58
|
-
'content-engineer': 'claude-sonnet-4-6',
|
|
59
|
-
'database-engineer': 'claude-sonnet-4-6',
|
|
60
|
-
'researcher': 'claude-sonnet-4-6',
|
|
61
|
-
'release-manager': 'claude-sonnet-4-6',
|
|
62
|
-
'architect': 'claude-opus-4-6',
|
|
63
|
-
'team-lead': 'claude-opus-4-6',
|
|
64
|
-
'reviewer': 'claude-haiku-3-5',
|
|
65
|
-
'documentation-writer': 'claude-haiku-3-5',
|
|
66
|
-
'seo-specialist': 'claude-haiku-3-5',
|
|
67
|
-
'session-guard': 'claude-haiku-3-5',
|
|
68
|
-
}
|
|
69
|
-
|
|
70
46
|
// ── Public interfaces ─────────────────────────────────────────────────────────
|
|
71
47
|
|
|
72
48
|
export interface ConvoyEngineOptions {
|
|
@@ -223,47 +199,6 @@ export class CircuitBreakerManager {
|
|
|
223
199
|
|
|
224
200
|
// ── Branch management ───────────────────────────────────────────────────────
|
|
225
201
|
|
|
226
|
-
/**
|
|
227
|
-
* Ensure the given branch exists and is checked out.
|
|
228
|
-
* Creates the branch from HEAD if it does not yet exist.
|
|
229
|
-
* Fails fast if there are uncommitted changes.
|
|
230
|
-
*/
|
|
231
|
-
export async function ensureBranch(branchName: string, basePath: string, skipDirtyCheck = false): Promise<void> {
|
|
232
|
-
// Validate refspec — reject shell metacharacters
|
|
233
|
-
if (!/^[a-zA-Z0-9\-/_\.]+$/.test(branchName)) {
|
|
234
|
-
throw new Error(
|
|
235
|
-
`Invalid branch name "${branchName}": only alphanumeric, -, /, _, and . are allowed`,
|
|
236
|
-
)
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (!skipDirtyCheck) {
|
|
240
|
-
// Refuse to switch branches with uncommitted changes
|
|
241
|
-
// Untracked files (??) don't block branch checkout — ignore them
|
|
242
|
-
const { stdout: statusOut } = await execFile('git', ['status', '--porcelain'], {
|
|
243
|
-
cwd: basePath,
|
|
244
|
-
})
|
|
245
|
-
const trackedChanges = statusOut
|
|
246
|
-
.split('\n')
|
|
247
|
-
.filter(line => line.trim() && !line.startsWith('??'))
|
|
248
|
-
.join('\n')
|
|
249
|
-
if (trackedChanges) {
|
|
250
|
-
throw new Error(
|
|
251
|
-
`Uncommitted changes detected in "${basePath}". Commit or stash before switching branches.`,
|
|
252
|
-
)
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Check if branch already exists
|
|
257
|
-
try {
|
|
258
|
-
await execFile('git', ['rev-parse', '--verify', branchName], { cwd: basePath })
|
|
259
|
-
// Branch exists — check it out
|
|
260
|
-
await execFile('git', ['checkout', branchName], { cwd: basePath })
|
|
261
|
-
} catch {
|
|
262
|
-
// Branch does not exist — create from current HEAD
|
|
263
|
-
await execFile('git', ['checkout', '-b', branchName], { cwd: basePath })
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
202
|
// ── Convoy guard ──────────────────────────────────────────────────────────────
|
|
268
203
|
|
|
269
204
|
export interface ConvoyGuardResult {
|
|
@@ -381,8 +316,8 @@ export function evaluateReviewLevel(
|
|
|
381
316
|
allGatesPassed?: boolean,
|
|
382
317
|
): ReviewLevel {
|
|
383
318
|
const panelPaths = heuristics?.panel_paths ?? ['auth/', 'security/', 'migrations/', 'rls/']
|
|
384
|
-
const panelAgents = heuristics?.panel_agents ?? ['security-expert', '
|
|
385
|
-
const autoPassAgents = heuristics?.auto_pass_agents ?? ['
|
|
319
|
+
const panelAgents = heuristics?.panel_agents ?? ['security-expert', 'data-engineer']
|
|
320
|
+
const autoPassAgents = heuristics?.auto_pass_agents ?? ['writer']
|
|
386
321
|
const autoPassMaxLines = heuristics?.auto_pass_max_lines ?? 10
|
|
387
322
|
const autoPassMaxFiles = heuristics?.auto_pass_max_files ?? 2
|
|
388
323
|
|
|
@@ -449,8 +384,8 @@ function buildDlqMarkdownEntry(
|
|
|
449
384
|
|
|
450
385
|
// Appends a pre-scanned DLQ entry to AGENT-FAILURES.md. The caller must have
|
|
451
386
|
// already verified the entry is clean via scanForSecrets — no re-scan here.
|
|
452
|
-
function appendDlqMarkdownClean(marker: string, entry: string): void {
|
|
453
|
-
const mdPath = join(resolve(
|
|
387
|
+
function appendDlqMarkdownClean(marker: string, entry: string, basePath: string): void {
|
|
388
|
+
const mdPath = join(resolve(basePath), '.opencastle', 'AGENT-FAILURES.md')
|
|
454
389
|
try {
|
|
455
390
|
const existing = readFileSync(mdPath, 'utf8')
|
|
456
391
|
if (existing.includes(marker)) return
|
|
@@ -461,14 +396,38 @@ function appendDlqMarkdownClean(marker: string, entry: string): void {
|
|
|
461
396
|
appendFileSync(mdPath, entry)
|
|
462
397
|
}
|
|
463
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Marks a convoy 'failed' after an unexpected throw escapes runConvoy.
|
|
401
|
+
*
|
|
402
|
+
* Both run() and resume() previously wrapped runConvoy in try/finally with no
|
|
403
|
+
* catch, so a crash left the row reading 'running' — which resume() then treats
|
|
404
|
+
* as owned by a live engine and refuses to pick up (KI-003). Best-effort: if the
|
|
405
|
+
* store is already closed or the DB is gone, the original error still wins.
|
|
406
|
+
*/
|
|
407
|
+
function markConvoyCrashed(
|
|
408
|
+
store: ConvoyStore,
|
|
409
|
+
events: ConvoyEventEmitter | null,
|
|
410
|
+
convoyId: string,
|
|
411
|
+
err: unknown,
|
|
412
|
+
): void {
|
|
413
|
+
const reason = err instanceof Error ? err.message : String(err)
|
|
414
|
+
try {
|
|
415
|
+
store.updateConvoyStatus(convoyId, 'failed', { finished_at: new Date().toISOString() })
|
|
416
|
+
} catch { /* store may already be closed — the throw we are handling matters more */ }
|
|
417
|
+
try {
|
|
418
|
+
events?.emit('convoy_failed', { status: 'failed', reason: `engine crashed: ${reason}` }, { convoy_id: convoyId })
|
|
419
|
+
} catch { /* ditto */ }
|
|
420
|
+
}
|
|
421
|
+
|
|
464
422
|
function writeDisputeToMarkdown(
|
|
465
423
|
disputeId: string,
|
|
466
424
|
convoyId: string,
|
|
467
425
|
task: TaskRecord,
|
|
468
426
|
panelResults: ReviewResult[],
|
|
427
|
+
basePath: string,
|
|
469
428
|
events?: ConvoyEventEmitter | null,
|
|
470
429
|
): void {
|
|
471
|
-
const mdPath = join(resolve(
|
|
430
|
+
const mdPath = join(resolve(basePath), '.opencastle', 'DISPUTES.md')
|
|
472
431
|
const marker = `<!-- dispute:${disputeId} -->`
|
|
473
432
|
|
|
474
433
|
try {
|
|
@@ -502,6 +461,7 @@ function writeDisputeToMarkdown(
|
|
|
502
461
|
return
|
|
503
462
|
}
|
|
504
463
|
|
|
464
|
+
mkdirSync(dirname(mdPath), { recursive: true })
|
|
505
465
|
appendFileSync(mdPath, entry)
|
|
506
466
|
}
|
|
507
467
|
|
|
@@ -581,6 +541,7 @@ async function executeSteps(
|
|
|
581
541
|
store: ConvoyStore,
|
|
582
542
|
convoyId: string,
|
|
583
543
|
verbose: boolean,
|
|
544
|
+
permissionMode: PermissionMode | undefined,
|
|
584
545
|
): Promise<ExecuteResult> {
|
|
585
546
|
const now = () => new Date().toISOString()
|
|
586
547
|
const stepResults = new Map<string, { exitCode: number }>()
|
|
@@ -597,7 +558,7 @@ async function executeSteps(
|
|
|
597
558
|
if (step.if) {
|
|
598
559
|
const condMet = evaluateStepCondition(step.if, stepResults, worktreePath, basePath)
|
|
599
560
|
if (!condMet) {
|
|
600
|
-
|
|
561
|
+
store.insertTaskStep({
|
|
601
562
|
task_id: taskRecord.id,
|
|
602
563
|
step_index: i,
|
|
603
564
|
prompt: step.prompt,
|
|
@@ -656,7 +617,7 @@ async function executeSteps(
|
|
|
656
617
|
}
|
|
657
618
|
|
|
658
619
|
try {
|
|
659
|
-
stepResult = await adapter.execute(stepTask, { verbose, cwd: worktreePath ?? basePath })
|
|
620
|
+
stepResult = await adapter.execute(stepTask, { verbose, cwd: worktreePath ?? basePath, permissionMode })
|
|
660
621
|
} catch (err) {
|
|
661
622
|
stepResult = { success: false, output: (err as Error).message, exitCode: -1 }
|
|
662
623
|
}
|
|
@@ -911,7 +872,7 @@ async function runConvoy(
|
|
|
911
872
|
store,
|
|
912
873
|
events,
|
|
913
874
|
convoyId,
|
|
914
|
-
onKill: (
|
|
875
|
+
onKill: (_workerId, taskId) => {
|
|
915
876
|
const task = activeTaskMap.get(taskId)
|
|
916
877
|
const taskAdpt = taskAdapterMap.get(taskId) ?? adapter
|
|
917
878
|
if (task && typeof taskAdpt.kill === 'function') {
|
|
@@ -1018,7 +979,7 @@ async function runConvoy(
|
|
|
1018
979
|
created_at: new Date().toISOString(),
|
|
1019
980
|
resolved_at: null,
|
|
1020
981
|
})
|
|
1021
|
-
appendDlqMarkdownClean(dlqMarker, dlqMdEntry)
|
|
982
|
+
appendDlqMarkdownClean(dlqMarker, dlqMdEntry, basePath)
|
|
1022
983
|
events.emit('dlq_entry_created', {
|
|
1023
984
|
dlq_id: dlqId,
|
|
1024
985
|
task_id: taskRecord.id,
|
|
@@ -1088,7 +1049,7 @@ async function runConvoy(
|
|
|
1088
1049
|
max_retries: 0,
|
|
1089
1050
|
}
|
|
1090
1051
|
try {
|
|
1091
|
-
const hookResult = await adapter.execute(hookTask, { verbose, cwd: context.cwd })
|
|
1052
|
+
const hookResult = await adapter.execute(hookTask, { verbose, cwd: context.cwd, permissionMode: spec.defaults?.permission_mode })
|
|
1092
1053
|
if (!hookResult.success) {
|
|
1093
1054
|
return { passed: false, failedHook: hook, error: hookResult.output }
|
|
1094
1055
|
}
|
|
@@ -1177,23 +1138,6 @@ async function runConvoy(
|
|
|
1177
1138
|
}
|
|
1178
1139
|
}
|
|
1179
1140
|
|
|
1180
|
-
// ── Intelligence: circuit breaker weak-area avoidance (Phase 18.2) ─────
|
|
1181
|
-
if (spec.defaults?.avoid_weak_agents) {
|
|
1182
|
-
try {
|
|
1183
|
-
const weakAreas = feedCircuitBreaker(taskRecord.agent, basePath)
|
|
1184
|
-
const taskFiles = taskRecord.files ? JSON.parse(taskRecord.files) as string[] : []
|
|
1185
|
-
const matchesWeakArea = weakAreas.some(area =>
|
|
1186
|
-
taskFiles.some(f => f.toLowerCase().includes(area.toLowerCase()))
|
|
1187
|
-
)
|
|
1188
|
-
if (matchesWeakArea && taskRecord.retries === 0) {
|
|
1189
|
-
events.emit('weak_area_skipped', { agent: taskRecord.agent, weak_areas: weakAreas, task_files: taskFiles }, { convoy_id: convoyId, task_id: taskRecord.id })
|
|
1190
|
-
store.updateTaskStatus(taskRecord.id, convoyId, 'skipped', { output: `Agent "${taskRecord.agent}" has weak-area match for task files. Skipped by avoid_weak_agents policy.` })
|
|
1191
|
-
completedCount++
|
|
1192
|
-
taskAdapterMap.delete(taskRecord.id)
|
|
1193
|
-
return
|
|
1194
|
-
}
|
|
1195
|
-
} catch { /* non-critical */ }
|
|
1196
|
-
}
|
|
1197
1141
|
|
|
1198
1142
|
// Create worktree (skip for copilot adapter)
|
|
1199
1143
|
let worktreePath: string | null = null
|
|
@@ -1311,7 +1255,7 @@ async function runConvoy(
|
|
|
1311
1255
|
|
|
1312
1256
|
// ── Artifact output instructions (Phase 43) ────────────────────────────
|
|
1313
1257
|
try {
|
|
1314
|
-
const artifactDir = getArtifactDir(convoyId, taskRecord.id)
|
|
1258
|
+
const artifactDir = getArtifactDir(convoyId, taskRecord.id, basePath)
|
|
1315
1259
|
const artifactInstructions = [
|
|
1316
1260
|
'',
|
|
1317
1261
|
'## Artifact Output (for large results)',
|
|
@@ -1327,20 +1271,6 @@ async function runConvoy(
|
|
|
1327
1271
|
task.prompt = task.prompt + '\n' + artifactInstructions
|
|
1328
1272
|
} catch { /* non-critical */ }
|
|
1329
1273
|
|
|
1330
|
-
// ── Intelligence: inject lessons (Phase 18.1) ─────────────────────────
|
|
1331
|
-
if (spec.defaults?.inject_lessons !== false) {
|
|
1332
|
-
try {
|
|
1333
|
-
const taskFiles = taskRecord.files ? JSON.parse(taskRecord.files) as string[] : []
|
|
1334
|
-
const lessons = readLessons(taskRecord.agent, taskFiles, basePath)
|
|
1335
|
-
if (lessons.length > 0) {
|
|
1336
|
-
const lessonsBlock
|
|
1337
|
-
= '\n\n---\nRelevant lessons from previous sessions:\n'
|
|
1338
|
-
+ lessons.join('\n\n')
|
|
1339
|
-
+ '\n---\n\n'
|
|
1340
|
-
task.prompt = lessonsBlock + task.prompt
|
|
1341
|
-
}
|
|
1342
|
-
} catch { /* non-critical */ }
|
|
1343
|
-
}
|
|
1344
1274
|
// ── Intelligence: inject persistent agent identity (Phase 17.2) ────────
|
|
1345
1275
|
const specTaskForPersistent = (spec.tasks ?? []).find(t => t.id === taskRecord.id)
|
|
1346
1276
|
if (specTaskForPersistent?.persistent) {
|
|
@@ -1354,10 +1284,6 @@ async function runConvoy(
|
|
|
1354
1284
|
}
|
|
1355
1285
|
} catch { /* non-critical */ }
|
|
1356
1286
|
}
|
|
1357
|
-
// ── Intelligence: inject discovered issues instruction (Phase 18.4) ────
|
|
1358
|
-
if (spec.defaults?.track_discovered_issues) {
|
|
1359
|
-
task.prompt = injectDiscoveredIssuesInstruction(task.prompt)
|
|
1360
|
-
}
|
|
1361
1287
|
|
|
1362
1288
|
// ── Output contract injection ─────────────────────────────────────────
|
|
1363
1289
|
const contractInstruction = buildContractInstruction(taskRecord.agent)
|
|
@@ -1418,12 +1344,12 @@ async function runConvoy(
|
|
|
1418
1344
|
try {
|
|
1419
1345
|
if (steps && steps.length > 0) {
|
|
1420
1346
|
result = await Promise.race([
|
|
1421
|
-
executeSteps(taskRecord, steps, taskAdapter, worktreePath, basePath, store, convoyId, verbose),
|
|
1347
|
+
executeSteps(taskRecord, steps, taskAdapter, worktreePath, basePath, store, convoyId, verbose, spec.defaults?.permission_mode),
|
|
1422
1348
|
timeout.promise,
|
|
1423
1349
|
])
|
|
1424
1350
|
} else {
|
|
1425
1351
|
result = await Promise.race([
|
|
1426
|
-
taskAdapter.execute(task, { verbose, cwd: worktreePath ?? basePath }),
|
|
1352
|
+
taskAdapter.execute(task, { verbose, cwd: worktreePath ?? basePath, permissionMode: spec.defaults?.permission_mode }),
|
|
1427
1353
|
timeout.promise,
|
|
1428
1354
|
])
|
|
1429
1355
|
}
|
|
@@ -1465,7 +1391,7 @@ async function runConvoy(
|
|
|
1465
1391
|
// Estimate tokens even for timed-out tasks — you still paid for them
|
|
1466
1392
|
const estimatedPrompt = Math.ceil(taskRecord.prompt.length / 4)
|
|
1467
1393
|
const estimatedCompletion = Math.ceil((result.output?.length ?? 0) / 4)
|
|
1468
|
-
const timeoutModel = taskRecord.model ??
|
|
1394
|
+
const timeoutModel = taskRecord.model ?? taskAdapter.name
|
|
1469
1395
|
const timeoutCost = calculateCost(timeoutModel, estimatedPrompt, estimatedCompletion)
|
|
1470
1396
|
store.withTransaction(() => {
|
|
1471
1397
|
store.updateTaskStatus(taskRecord.id, convoyId, 'timed-out', {
|
|
@@ -1591,8 +1517,70 @@ async function runConvoy(
|
|
|
1591
1517
|
}
|
|
1592
1518
|
}
|
|
1593
1519
|
|
|
1594
|
-
// ── Built-in gates ────────────────────────────────────────────────────
|
|
1595
1520
|
const builtInGates = spec.defaults?.built_in_gates
|
|
1521
|
+
|
|
1522
|
+
// ── No-op gate ────────────────────────────────────────────────────────
|
|
1523
|
+
// A clean exit is not proof the work happened. This one is on unless the
|
|
1524
|
+
// spec turns it off, because the state it catches — a task that promised
|
|
1525
|
+
// files and produced none — used to be recorded as `done` with exit 0, and
|
|
1526
|
+
// a silent green is worse than a loud red.
|
|
1527
|
+
const contractResult = validateOutput(taskRecord.agent, result.output)
|
|
1528
|
+
if (taskFiles.length > 0 && (builtInGates ? builtInGates.no_op !== false : true)) {
|
|
1529
|
+
const noOpResult = noOpGate({
|
|
1530
|
+
declaredFiles: taskFiles,
|
|
1531
|
+
changedFiles: worktreePath ? await collectWorktreeChanges(worktreePath, baseBranch) : null,
|
|
1532
|
+
agent: taskRecord.agent,
|
|
1533
|
+
contractData: contractResult.data,
|
|
1534
|
+
})
|
|
1535
|
+
|
|
1536
|
+
if (!noOpResult.passed) {
|
|
1537
|
+
events.emit(
|
|
1538
|
+
'built_in_gate_result',
|
|
1539
|
+
{ gate: 'no_op', passed: false, output: noOpResult.output },
|
|
1540
|
+
{ convoy_id: convoyId, task_id: taskRecord.id },
|
|
1541
|
+
)
|
|
1542
|
+
await removeWorktree()
|
|
1543
|
+
const freshRecord = store.getTask(taskRecord.id, convoyId)!
|
|
1544
|
+
if (freshRecord.retries < freshRecord.max_retries && spec.on_failure !== 'stop') {
|
|
1545
|
+
store.updateTaskStatus(taskRecord.id, convoyId, 'pending', {
|
|
1546
|
+
retries: freshRecord.retries + 1,
|
|
1547
|
+
worker_id: null,
|
|
1548
|
+
worktree: null,
|
|
1549
|
+
started_at: null,
|
|
1550
|
+
finished_at: null,
|
|
1551
|
+
prompt: `Your previous attempt produced no changes.\n${noOpResult.output}\n\nWrite the files the task asks for. If you cannot, say why and stop.\n\n${taskRecord.prompt}`,
|
|
1552
|
+
})
|
|
1553
|
+
store.updateWorkerStatus(workerId, 'failed', { finished_at: finishedAt })
|
|
1554
|
+
process.stdout.write(
|
|
1555
|
+
` ${c.yellow('⟳')} ${c.bold(`[${taskRecord.id}]`)} no changes produced, retry ${freshRecord.retries + 1}/${freshRecord.max_retries}\n`,
|
|
1556
|
+
)
|
|
1557
|
+
} else {
|
|
1558
|
+
store.withTransaction(() => {
|
|
1559
|
+
store.updateTaskStatus(taskRecord.id, convoyId, 'gate-failed', {
|
|
1560
|
+
finished_at: finishedAt,
|
|
1561
|
+
output: `Built-in gate (no_op) failed:\n${noOpResult.output}`,
|
|
1562
|
+
exit_code: 1,
|
|
1563
|
+
contract_result: JSON.stringify(contractResult),
|
|
1564
|
+
})
|
|
1565
|
+
store.updateWorkerStatus(workerId, 'failed', { finished_at: finishedAt })
|
|
1566
|
+
})
|
|
1567
|
+
completedCount++
|
|
1568
|
+
process.stdout.write(
|
|
1569
|
+
` ${c.red('✗')} ${c.bold(`[${taskRecord.id}]`)} produced no changes ${elapsed} ${c.dim(`[${completedCount}/${totalTasks}]`)}\n`,
|
|
1570
|
+
)
|
|
1571
|
+
events.emit(
|
|
1572
|
+
'task_failed',
|
|
1573
|
+
{ reason: 'no-op', gate: 'no_op', worker_id: workerId },
|
|
1574
|
+
{ convoy_id: convoyId, task_id: taskRecord.id, worker_id: workerId },
|
|
1575
|
+
)
|
|
1576
|
+
handleExhaustion(freshRecord, 'no-op', noOpResult.output)
|
|
1577
|
+
}
|
|
1578
|
+
taskAdapterMap.delete(taskRecord.id)
|
|
1579
|
+
return
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
// ── Built-in gates ────────────────────────────────────────────────────
|
|
1596
1584
|
if (builtInGates && worktreePath) {
|
|
1597
1585
|
if (builtInGates.browser_test) {
|
|
1598
1586
|
const specTask = (spec.tasks ?? []).find(t => t.id === taskRecord.id)
|
|
@@ -1767,6 +1755,110 @@ async function runConvoy(
|
|
|
1767
1755
|
}
|
|
1768
1756
|
}
|
|
1769
1757
|
|
|
1758
|
+
// Dependency audit and regression test gates
|
|
1759
|
+
//
|
|
1760
|
+
// Both were declared in the spec validator, implemented in full, and set to
|
|
1761
|
+
// 'auto' by `spec-builder.ts` on its own — and never called from here. A
|
|
1762
|
+
// spec could ask for `regression_test`, validate, run green, and never run
|
|
1763
|
+
// the test suite. Nothing failed, which is the worst way for a gate to be
|
|
1764
|
+
// broken. `built-in-gates.test.ts` now derives the accepted-gate list from
|
|
1765
|
+
// the validator and fails if any of them is not branched on and invoked.
|
|
1766
|
+
//
|
|
1767
|
+
// The failure path is shared between the two rather than copied, because
|
|
1768
|
+
// copying it is how the three gates above came to hold three near-identical
|
|
1769
|
+
// 40-line blocks that have to be kept in step by hand.
|
|
1770
|
+
const failGate = async (gate: string, label: string, output: string): Promise<void> => {
|
|
1771
|
+
await removeWorktree()
|
|
1772
|
+
const freshRecord = store.getTask(taskRecord.id, convoyId)!
|
|
1773
|
+
if (freshRecord.retries < freshRecord.max_retries && spec.on_failure !== 'stop') {
|
|
1774
|
+
store.updateTaskStatus(taskRecord.id, convoyId, 'pending', {
|
|
1775
|
+
retries: freshRecord.retries + 1,
|
|
1776
|
+
worker_id: null,
|
|
1777
|
+
worktree: null,
|
|
1778
|
+
started_at: null,
|
|
1779
|
+
finished_at: null,
|
|
1780
|
+
prompt: `${label} gate failed.\n${output}\n\nFix the issues and try again.`,
|
|
1781
|
+
})
|
|
1782
|
+
store.updateWorkerStatus(workerId, 'failed', { finished_at: finishedAt })
|
|
1783
|
+
process.stdout.write(
|
|
1784
|
+
` ${c.yellow('⟳')} ${c.bold(`[${taskRecord.id}]`)} ${label} gate failed, retry ${freshRecord.retries + 1}/${freshRecord.max_retries}\n`,
|
|
1785
|
+
)
|
|
1786
|
+
} else {
|
|
1787
|
+
store.withTransaction(() => {
|
|
1788
|
+
store.updateTaskStatus(taskRecord.id, convoyId, 'gate-failed', {
|
|
1789
|
+
finished_at: finishedAt,
|
|
1790
|
+
output: `Built-in gate (${gate}) failed:\n${output}`,
|
|
1791
|
+
exit_code: 1,
|
|
1792
|
+
})
|
|
1793
|
+
store.updateWorkerStatus(workerId, 'failed', { finished_at: finishedAt })
|
|
1794
|
+
})
|
|
1795
|
+
completedCount++
|
|
1796
|
+
process.stdout.write(
|
|
1797
|
+
` ${c.red('✗')} ${c.bold(`[${taskRecord.id}]`)} ${label} gate failed ${elapsed} ${c.dim(`(worker ${workerId})`)}\n`,
|
|
1798
|
+
)
|
|
1799
|
+
events.emit(
|
|
1800
|
+
'task_failed',
|
|
1801
|
+
{ reason: 'gate-failed', gate, worker_id: workerId },
|
|
1802
|
+
{ convoy_id: convoyId, task_id: taskRecord.id, worker_id: workerId },
|
|
1803
|
+
)
|
|
1804
|
+
handleExhaustion(freshRecord, 'gate-failed', output)
|
|
1805
|
+
}
|
|
1806
|
+
taskAdapterMap.delete(taskRecord.id)
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
// Both gates shell out to npm, and `runGateCommand` reports a spawn failure
|
|
1810
|
+
// as a non-zero exit — so without this a project that is not an npm package
|
|
1811
|
+
// would have every task fail on a gate it cannot possibly satisfy. Announced
|
|
1812
|
+
// and skipped, the way the browser_test gate handles a missing config.
|
|
1813
|
+
const pkgJsonPath = resolve(worktreePath, 'package.json')
|
|
1814
|
+
let pkgScripts: Record<string, unknown> | null = null
|
|
1815
|
+
if (existsSync(pkgJsonPath)) {
|
|
1816
|
+
try {
|
|
1817
|
+
pkgScripts = (JSON.parse(readFileSync(pkgJsonPath, 'utf8')) as { scripts?: Record<string, unknown> })
|
|
1818
|
+
.scripts ?? {}
|
|
1819
|
+
} catch {
|
|
1820
|
+
pkgScripts = null
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
if (builtInGates.dependency_audit) {
|
|
1825
|
+
if (pkgScripts === null) {
|
|
1826
|
+
process.stderr.write(
|
|
1827
|
+
`Warning: dependency_audit gate enabled but ${worktreePath} has no readable package.json — skipping\n`,
|
|
1828
|
+
)
|
|
1829
|
+
} else {
|
|
1830
|
+
const auditResult = await runDependencyAuditGate(worktreePath)
|
|
1831
|
+
events.emit(
|
|
1832
|
+
'built_in_gate_result',
|
|
1833
|
+
{ gate: 'dependency_audit', passed: auditResult.passed, output: auditResult.output },
|
|
1834
|
+
{ convoy_id: convoyId, task_id: taskRecord.id },
|
|
1835
|
+
)
|
|
1836
|
+
if (!auditResult.passed) {
|
|
1837
|
+
await failGate('dependency_audit', 'dependency audit', auditResult.output)
|
|
1838
|
+
return
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
if (builtInGates.regression_test) {
|
|
1844
|
+
if (pkgScripts === null || typeof pkgScripts.test !== 'string') {
|
|
1845
|
+
process.stderr.write(
|
|
1846
|
+
`Warning: regression_test gate enabled but no "test" script found in package.json — skipping\n`,
|
|
1847
|
+
)
|
|
1848
|
+
} else {
|
|
1849
|
+
const regressionResult = await runRegressionTestGate(worktreePath)
|
|
1850
|
+
events.emit(
|
|
1851
|
+
'built_in_gate_result',
|
|
1852
|
+
{ gate: 'regression_test', passed: regressionResult.passed, output: regressionResult.output },
|
|
1853
|
+
{ convoy_id: convoyId, task_id: taskRecord.id },
|
|
1854
|
+
)
|
|
1855
|
+
if (!regressionResult.passed) {
|
|
1856
|
+
await failGate('regression_test', 'regression test', regressionResult.output)
|
|
1857
|
+
return
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1770
1862
|
// ── Partition violation check (Phase 41) ────────────────────────────
|
|
1771
1863
|
if (changedFiles.length > 0) {
|
|
1772
1864
|
try {
|
|
@@ -2111,7 +2203,7 @@ async function runConvoy(
|
|
|
2111
2203
|
const onDispute = spec.defaults?.on_dispute ?? 'stop'
|
|
2112
2204
|
|
|
2113
2205
|
store.updateTaskDisputeStatus(taskRecord.id, convoyId, 'disputed', disputeId)
|
|
2114
|
-
writeDisputeToMarkdown(disputeId, convoyId, taskRecord, panelResults, events)
|
|
2206
|
+
writeDisputeToMarkdown(disputeId, convoyId, taskRecord, panelResults, basePath, events)
|
|
2115
2207
|
|
|
2116
2208
|
events.emit('dispute_opened', {
|
|
2117
2209
|
dispute_id: disputeId,
|
|
@@ -2168,12 +2260,6 @@ async function runConvoy(
|
|
|
2168
2260
|
}
|
|
2169
2261
|
}
|
|
2170
2262
|
|
|
2171
|
-
// ── Intelligence: check discovered issues (Phase 18.4) ─────────────
|
|
2172
|
-
if (spec.defaults?.track_discovered_issues) {
|
|
2173
|
-
try {
|
|
2174
|
-
checkDiscoveredIssues(taskRecord.id, events, convoyId, worktreePath ?? basePath)
|
|
2175
|
-
} catch { /* non-critical */ }
|
|
2176
|
-
}
|
|
2177
2263
|
|
|
2178
2264
|
// ── post_task hooks ───────────────────────────────────────────────────
|
|
2179
2265
|
if (taskHooks.length > 0) {
|
|
@@ -2346,16 +2432,6 @@ async function runConvoy(
|
|
|
2346
2432
|
taskAdapterMap.delete(taskRecord.id)
|
|
2347
2433
|
return
|
|
2348
2434
|
}
|
|
2349
|
-
|
|
2350
|
-
// ── Intelligence: update expertise post-merge (Phase 18.2) ─────────
|
|
2351
|
-
try {
|
|
2352
|
-
updateExpertise(taskRecord.agent, { taskId: taskRecord.id, success: true, retries: taskRecord.retries, files: taskRecord.files ? JSON.parse(taskRecord.files) as string[] : [] }, basePath)
|
|
2353
|
-
} catch { /* non-critical */ }
|
|
2354
|
-
// ── Intelligence: build knowledge graph post-merge (Phase 18.3) ────
|
|
2355
|
-
try {
|
|
2356
|
-
const { stdout: diffOut } = await execFile('git', ['diff', 'HEAD~1'], { cwd: basePath })
|
|
2357
|
-
buildKnowledgeGraph(diffOut, convoyId, basePath)
|
|
2358
|
-
} catch { /* non-critical */ }
|
|
2359
2435
|
}
|
|
2360
2436
|
|
|
2361
2437
|
const usageExtra: Partial<{ prompt_tokens: number; completion_tokens: number; total_tokens: number }> = {}
|
|
@@ -2375,71 +2451,6 @@ async function runConvoy(
|
|
|
2375
2451
|
}
|
|
2376
2452
|
}
|
|
2377
2453
|
|
|
2378
|
-
// ── Context compaction check (Phase 44) ─────────────────────────────
|
|
2379
|
-
const compactionConfig = spec.defaults?.compaction
|
|
2380
|
-
if (compactionConfig?.enabled && usageExtra.total_tokens != null && taskRecord.model) {
|
|
2381
|
-
if (shouldCompact(usageExtra.total_tokens, taskRecord.model, compactionConfig)) {
|
|
2382
|
-
if (canCompact(taskRecord.compaction_count)) {
|
|
2383
|
-
const newCount = taskRecord.compaction_count + 1
|
|
2384
|
-
store.updateTaskCompaction(taskRecord.id, convoyId, newCount)
|
|
2385
|
-
|
|
2386
|
-
const summaryFromOutput = parseCompactionSummary(result.output, taskRecord.id, convoyId)
|
|
2387
|
-
let summaryPath: string | undefined
|
|
2388
|
-
if (summaryFromOutput) {
|
|
2389
|
-
try {
|
|
2390
|
-
summaryPath = saveCompaction(convoyId, taskRecord.id, summaryFromOutput, newCount)
|
|
2391
|
-
} catch { /* non-critical */ }
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
const compactionTaskFiles = taskRecord.files ? JSON.parse(taskRecord.files) as string[] : []
|
|
2395
|
-
const compactionDepIds = taskRecord.depends_on ? JSON.parse(taskRecord.depends_on) as string[] : []
|
|
2396
|
-
const compactionDepResults = resolveDependencyResults(store, convoyId, compactionDepIds)
|
|
2397
|
-
const compactionPreamble = buildIsolationPreamble(
|
|
2398
|
-
{ id: taskRecord.id, description: taskRecord.prompt.slice(0, 200), prompt: taskRecord.prompt, files: compactionTaskFiles, agent: taskRecord.agent },
|
|
2399
|
-
compactionDepResults,
|
|
2400
|
-
)
|
|
2401
|
-
|
|
2402
|
-
const continuationPrompt = summaryPath
|
|
2403
|
-
? buildContinuationPrompt(taskRecord.prompt, summaryPath, compactionPreamble)
|
|
2404
|
-
: compactionPreamble + '\n\n' + generateCompactionPrompt(taskRecord.id) + '\n\n' + taskRecord.prompt
|
|
2405
|
-
|
|
2406
|
-
store.updateTaskStatus(taskRecord.id, convoyId, 'pending', {
|
|
2407
|
-
worker_id: null,
|
|
2408
|
-
worktree: null,
|
|
2409
|
-
started_at: null,
|
|
2410
|
-
finished_at: null,
|
|
2411
|
-
prompt: continuationPrompt,
|
|
2412
|
-
})
|
|
2413
|
-
store.updateWorkerStatus(workerId, 'failed', { finished_at: finishedAt })
|
|
2414
|
-
|
|
2415
|
-
events.emit('context_compacted', {
|
|
2416
|
-
task_id: taskRecord.id,
|
|
2417
|
-
compaction_count: newCount,
|
|
2418
|
-
summary_path: summaryPath ?? '',
|
|
2419
|
-
model: taskRecord.model,
|
|
2420
|
-
tokens_used: usageExtra.total_tokens,
|
|
2421
|
-
}, { convoy_id: convoyId, task_id: taskRecord.id })
|
|
2422
|
-
|
|
2423
|
-
taskAdapterMap.delete(taskRecord.id)
|
|
2424
|
-
return
|
|
2425
|
-
} else {
|
|
2426
|
-
// Max compactions exceeded — fail the task
|
|
2427
|
-
const exhaustedAt = new Date().toISOString()
|
|
2428
|
-
store.updateTaskStatus(taskRecord.id, convoyId, 'failed', {
|
|
2429
|
-
finished_at: exhaustedAt,
|
|
2430
|
-
output: `Context exhausted: reached maximum ${getMaxCompactions()} compactions`,
|
|
2431
|
-
exit_code: 1,
|
|
2432
|
-
})
|
|
2433
|
-
store.updateWorkerStatus(workerId, 'failed', { finished_at: exhaustedAt })
|
|
2434
|
-
events.emit('task_failed', {
|
|
2435
|
-
reason: 'context_exhausted',
|
|
2436
|
-
worker_id: workerId,
|
|
2437
|
-
}, { convoy_id: convoyId, task_id: taskRecord.id })
|
|
2438
|
-
taskAdapterMap.delete(taskRecord.id)
|
|
2439
|
-
return
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
|
-
}
|
|
2443
2454
|
|
|
2444
2455
|
// ── Capture outputs as artifacts ────────────────────────────────────────
|
|
2445
2456
|
if (taskRecord.outputs) {
|
|
@@ -2515,7 +2526,7 @@ async function runConvoy(
|
|
|
2515
2526
|
}
|
|
2516
2527
|
|
|
2517
2528
|
// ── Output contract validation ────────────────────────────────────────
|
|
2518
|
-
|
|
2529
|
+
// Validated once, up at the no-op gate, which reads the same block.
|
|
2519
2530
|
if (!contractResult.valid) {
|
|
2520
2531
|
const freshRecordForContract = store.getTask(taskRecord.id, convoyId)!
|
|
2521
2532
|
if (freshRecordForContract.retries < freshRecordForContract.max_retries) {
|
|
@@ -2577,7 +2588,7 @@ async function runConvoy(
|
|
|
2577
2588
|
} catch { /* non-critical */ }
|
|
2578
2589
|
}
|
|
2579
2590
|
|
|
2580
|
-
const taskModel = taskRecord.model ??
|
|
2591
|
+
const taskModel = taskRecord.model ?? taskAdapter.name
|
|
2581
2592
|
const taskCost = calculateCost(taskModel, usageExtra.prompt_tokens, usageExtra.completion_tokens)
|
|
2582
2593
|
|
|
2583
2594
|
store.withTransaction(() => {
|
|
@@ -2597,19 +2608,6 @@ async function runConvoy(
|
|
|
2597
2608
|
circuitBreaker.recordSuccess(taskRecord.agent)
|
|
2598
2609
|
try { store.updateConvoyCircuitState(convoyId, circuitBreaker.serialize()) } catch { /* non-critical */ }
|
|
2599
2610
|
}
|
|
2600
|
-
// ── Intelligence: capture retry lesson (Phase 18.1) ─────────────────
|
|
2601
|
-
if (taskRecord.retries > 0 && spec.defaults?.inject_lessons !== false) {
|
|
2602
|
-
try {
|
|
2603
|
-
captureLessons({
|
|
2604
|
-
title: `Retry success for ${taskRecord.agent} on ${taskRecord.id}`,
|
|
2605
|
-
category: 'convoy',
|
|
2606
|
-
agent: taskRecord.agent,
|
|
2607
|
-
problem: `Task ${taskRecord.id} required ${taskRecord.retries} retries`,
|
|
2608
|
-
solution: 'Succeeded after retry with adjusted approach',
|
|
2609
|
-
files: taskRecord.files ? JSON.parse(taskRecord.files) as string[] : undefined,
|
|
2610
|
-
}, basePath)
|
|
2611
|
-
} catch { /* non-critical */ }
|
|
2612
|
-
}
|
|
2613
2611
|
completedCount++
|
|
2614
2612
|
process.stdout.write(` ${c.green('✓')} ${c.bold(`[${taskRecord.id}]`)} ${elapsed} ${c.dim(`[${completedCount}/${totalTasks}]`)}\n`)
|
|
2615
2613
|
events.emit(
|
|
@@ -2664,7 +2662,7 @@ async function runConvoy(
|
|
|
2664
2662
|
// Estimate tokens even for failed tasks — you still paid for them
|
|
2665
2663
|
const estimatedPrompt = Math.ceil(taskRecord.prompt.length / 4)
|
|
2666
2664
|
const estimatedCompletion = Math.ceil((result.output?.length ?? 0) / 4)
|
|
2667
|
-
const failModel = taskRecord.model ??
|
|
2665
|
+
const failModel = taskRecord.model ?? taskAdapter.name
|
|
2668
2666
|
const failCost = calculateCost(failModel, estimatedPrompt, estimatedCompletion)
|
|
2669
2667
|
store.withTransaction(() => {
|
|
2670
2668
|
store.updateTaskStatus(taskRecord.id, convoyId, 'failed', {
|
|
@@ -2680,9 +2678,6 @@ async function runConvoy(
|
|
|
2680
2678
|
store.updateWorkerStatus(workerId, 'failed', { finished_at: finishedAt })
|
|
2681
2679
|
})
|
|
2682
2680
|
// ── Intelligence: record failure in expertise (Phase 18.2) ──────────
|
|
2683
|
-
try {
|
|
2684
|
-
updateExpertise(taskRecord.agent, { taskId: taskRecord.id, success: false, retries: freshRecord.retries, files: taskRecord.files ? JSON.parse(taskRecord.files) as string[] : [] }, basePath)
|
|
2685
|
-
} catch { /* non-critical */ }
|
|
2686
2681
|
// ── Circuit breaker: record failure ────────────────────────────────────
|
|
2687
2682
|
if (circuitBreakerConfig) {
|
|
2688
2683
|
const { tripped } = circuitBreaker.recordFailure(taskRecord.agent)
|
|
@@ -2847,7 +2842,7 @@ async function runConvoy(
|
|
|
2847
2842
|
max_retries: 0,
|
|
2848
2843
|
}
|
|
2849
2844
|
|
|
2850
|
-
const fixResult = await adapter.execute(fixTask, { verbose, cwd: basePath })
|
|
2845
|
+
const fixResult = await adapter.execute(fixTask, { verbose, cwd: basePath, permissionMode: spec.defaults?.permission_mode })
|
|
2851
2846
|
|
|
2852
2847
|
if (fixResult.success) {
|
|
2853
2848
|
process.stdout.write(` ${c.green('✓')} ${c.bold(`[${fixTaskId}]`)} fix applied\n`)
|
|
@@ -2876,25 +2871,6 @@ async function runConvoy(
|
|
|
2876
2871
|
}
|
|
2877
2872
|
|
|
2878
2873
|
// ── Intelligence: post-convoy consolidation ──────────────────────────────
|
|
2879
|
-
if (spec.defaults?.inject_lessons !== false) {
|
|
2880
|
-
try { consolidateLessons(basePath) } catch { /* non-critical */ }
|
|
2881
|
-
}
|
|
2882
|
-
if (spec.defaults?.track_discovered_issues) {
|
|
2883
|
-
try { consolidateIssues(basePath) } catch { /* non-critical */ }
|
|
2884
|
-
}
|
|
2885
|
-
|
|
2886
|
-
// ── Intelligence: skill refinement check ───────────────────────────────
|
|
2887
|
-
try {
|
|
2888
|
-
const proposals = runSkillRefinementCheck(convoyId, basePath)
|
|
2889
|
-
for (const p of proposals) {
|
|
2890
|
-
events.emit('skill_refinement_proposed', {
|
|
2891
|
-
skill_name: p.skill,
|
|
2892
|
-
proposal_path: p.proposalPath,
|
|
2893
|
-
}, { convoy_id: convoyId })
|
|
2894
|
-
process.stdout.write(` ${c.yellow('◆')} Skill refinement proposed for "${p.skill}". Review at ${p.proposalPath}\n`)
|
|
2895
|
-
}
|
|
2896
|
-
} catch { /* non-critical */ }
|
|
2897
|
-
|
|
2898
2874
|
// ── Final status & summary ────────────────────────────────────────────────
|
|
2899
2875
|
|
|
2900
2876
|
const allTasksFinal = store.getTasksByConvoy(convoyId)
|
|
@@ -3118,6 +3094,11 @@ export function createConvoyEngine(options: ConvoyEngineOptions): ConvoyEngine {
|
|
|
3118
3094
|
wtManager, mergeQueue, effectiveBasePath, baseBranch, verbose, startTime, ndjsonPath,
|
|
3119
3095
|
options._reviewRunner,
|
|
3120
3096
|
)
|
|
3097
|
+
} catch (err) {
|
|
3098
|
+
// Without this, an unexpected throw from runConvoy leaves the convoy row
|
|
3099
|
+
// reading 'running' forever, and a later resume() refuses to touch it.
|
|
3100
|
+
markConvoyCrashed(store, events, convoyId, err)
|
|
3101
|
+
throw err
|
|
3121
3102
|
} finally {
|
|
3122
3103
|
events.close()
|
|
3123
3104
|
store.close()
|
|
@@ -3253,6 +3234,9 @@ export function createConvoyEngine(options: ConvoyEngineOptions): ConvoyEngine {
|
|
|
3253
3234
|
wtManager, mergeQueue, effectiveBasePath, baseBranch, verbose, startTime, ndjsonPath,
|
|
3254
3235
|
options._reviewRunner,
|
|
3255
3236
|
)
|
|
3237
|
+
} catch (err) {
|
|
3238
|
+
markConvoyCrashed(store, events ?? null, convoyId, err)
|
|
3239
|
+
throw err
|
|
3256
3240
|
} finally {
|
|
3257
3241
|
events?.close()
|
|
3258
3242
|
store.close()
|