diff --git a/.trajectories/completed/traj_1775734701264_ba65c69b.json b/.trajectories/completed/traj_1775734701264_ba65c69b.json new file mode 100644 index 0000000..ec3271b --- /dev/null +++ b/.trajectories/completed/traj_1775734701264_ba65c69b.json @@ -0,0 +1,326 @@ +{ + "id": "traj_1775734701264_ba65c69b", + "version": 1, + "task": { + "title": "finish-npm-provenance-persona-workflow", + "source": { + "system": "workflow-runner", + "id": "051e6f8a822765938d8f29fc" + } + }, + "status": "completed", + "startedAt": "2026-04-09T11:38:21.264Z", + "agents": [ + { + "name": "orchestrator", + "role": "workflow-runner", + "joinedAt": "2026-04-09T11:38:21.264Z" + }, + { + "name": "docs", + "role": "specialist", + "joinedAt": "2026-04-09T11:38:24.613Z" + }, + { + "name": "publisher", + "role": "specialist", + "joinedAt": "2026-04-09T11:38:24.614Z" + }, + { + "name": "checker", + "role": "specialist", + "joinedAt": "2026-04-09T11:39:02.796Z" + } + ], + "chapters": [ + { + "id": "ch_efda3e2f", + "title": "Planning", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:38:21.264Z", + "events": [ + { + "ts": 1775734701264, + "type": "note", + "content": "Purpose: Document persona skills + npm-provenance persona and configure OIDC trusted publishing for workload-router." + }, + { + "ts": 1775734701264, + "type": "note", + "content": "Approach: 10-step dag workflow — Parsed 10 steps, 3 parallel tracks, 7 dependent steps, DAG validated, no cycles" + } + ], + "endedAt": "2026-04-09T11:38:24.583Z" + }, + { + "id": "ch_b9efe123", + "title": "Execution: read-readme, read-persona, read-router-pkg", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:38:24.583Z", + "events": [], + "endedAt": "2026-04-09T11:38:24.612Z" + }, + { + "id": "ch_a9551244", + "title": "Convergence: read-readme + read-persona + read-router-pkg", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:38:24.612Z", + "events": [ + { + "ts": 1775734704612, + "type": "reflection", + "content": "read-readme + read-persona + read-router-pkg resolved. 3/3 steps completed. All steps completed on first attempt. Unblocking: update-readme, create-publish-workflow.", + "significance": "high", + "raw": { + "confidence": 0.75, + "focalPoints": [ + "read-readme: completed", + "read-persona: completed", + "read-router-pkg: completed" + ] + } + } + ], + "endedAt": "2026-04-09T11:38:24.613Z" + }, + { + "id": "ch_a8a6a1a8", + "title": "Execution: update-readme, create-publish-workflow", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:38:24.613Z", + "events": [], + "endedAt": "2026-04-09T11:38:24.614Z" + }, + { + "id": "ch_9cb95cec", + "title": "Execution: update-readme", + "agentName": "docs", + "startedAt": "2026-04-09T11:38:24.614Z", + "events": [ + { + "ts": 1775734704614, + "type": "note", + "content": "\"update-readme\": Edit README.md only", + "raw": { + "agent": "docs" + } + } + ], + "endedAt": "2026-04-09T11:38:24.614Z" + }, + { + "id": "ch_0df34242", + "title": "Execution: create-publish-workflow", + "agentName": "publisher", + "startedAt": "2026-04-09T11:38:24.614Z", + "events": [ + { + "ts": 1775734704614, + "type": "note", + "content": "\"create-publish-workflow\": Apply the prpm/npm-trusted-publishing skill (https://prpm.dev/packages/prpm/npm-trusted-publishing) to configure OIDC tr", + "raw": { + "agent": "publisher" + } + }, + { + "ts": 1775734734733, + "type": "completion-evidence", + "content": "\"update-readme\" verification-based completion — Verification passed (2 signal(s), 3 file change(s), exit=0; signals=0, Verification passed; files=created:.github/workflows/publish-workload-router.yml, modified:packages/workload-router/package.json, modified:README.md; exit=0)", + "significance": "medium", + "raw": { + "stepName": "update-readme", + "completionMode": "verification", + "reason": "Verification passed", + "evidence": { + "summary": "2 signal(s), 3 file change(s), exit=0", + "signals": [ + "0", + "Verification passed" + ], + "files": [ + "created:.github/workflows/publish-workload-router.yml", + "modified:packages/workload-router/package.json", + "modified:README.md" + ], + "exitCode": 0 + } + } + }, + { + "ts": 1775734734733, + "type": "finding", + "content": "\"update-readme\" completed → No other files were modified.", + "significance": "medium" + }, + { + "ts": 1775734742758, + "type": "completion-evidence", + "content": "\"create-publish-workflow\" verification-based completion — Verification passed (4 signal(s), 1 relevant channel post(s), 3 file change(s), exit=0; signals=0, ## Summary, Verification passed, **[create-publish-workflow] Output:**; channel=**[create-publish-workflow] Output:**\n```\n## Summary\n**Completed: OIDC trusted publishing configuration for `@agentworkforce/workload-router`**\n### Files create; files=created:.github/workflows/publish-workload-router.yml, modified:packages/workload-router/package.json, modified:README.md; exit=0)", + "significance": "medium", + "raw": { + "stepName": "create-publish-workflow", + "completionMode": "verification", + "reason": "Verification passed", + "evidence": { + "summary": "4 signal(s), 1 relevant channel post(s), 3 file change(s), exit=0", + "signals": [ + "0", + "## Summary", + "Verification passed", + "**[create-publish-workflow] Output:**" + ], + "channelPosts": [ + "**[create-publish-workflow] Output:**\n```\n## Summary\n**Completed: OIDC trusted publishing configuration for `@agentworkforce/workload-router`**\n### Files create" + ], + "files": [ + "created:.github/workflows/publish-workload-router.yml", + "modified:packages/workload-router/package.json", + "modified:README.md" + ], + "exitCode": 0 + } + } + }, + { + "ts": 1775734742758, + "type": "finding", + "content": "\"create-publish-workflow\" completed → ## Summary\n\n**Completed: OIDC trusted publishing configuration for `@agentworkforce/workload-router`**\n\n### Files create", + "significance": "medium" + } + ], + "endedAt": "2026-04-09T11:39:02.759Z" + }, + { + "id": "ch_39fdc7ed", + "title": "Convergence: update-readme + create-publish-workflow", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:39:02.759Z", + "events": [ + { + "ts": 1775734742759, + "type": "reflection", + "content": "update-readme + create-publish-workflow resolved. 2/2 steps completed. All steps completed on first attempt. Unblocking: verify-readme-modified, verify-publish-workflow, verify-repository-url.", + "significance": "high", + "raw": { + "confidence": 1, + "focalPoints": [ + "update-readme: completed", + "create-publish-workflow: completed" + ] + } + } + ], + "endedAt": "2026-04-09T11:39:02.759Z" + }, + { + "id": "ch_c29e70ab", + "title": "Execution: verify-readme-modified, verify-publish-workflow, verify-repository-url", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:39:02.759Z", + "events": [], + "endedAt": "2026-04-09T11:39:02.795Z" + }, + { + "id": "ch_1c679dc6", + "title": "Convergence: verify-readme-modified + verify-publish-workflow + verify-repository-url", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:39:02.795Z", + "events": [ + { + "ts": 1775734742795, + "type": "reflection", + "content": "verify-readme-modified + verify-publish-workflow + verify-repository-url resolved. 3/3 steps completed. All steps completed on first attempt. Unblocking: check.", + "significance": "high", + "raw": { + "confidence": 0.75, + "focalPoints": [ + "verify-readme-modified: completed", + "verify-publish-workflow: completed", + "verify-repository-url: completed" + ] + } + } + ], + "endedAt": "2026-04-09T11:39:02.796Z" + }, + { + "id": "ch_cf39570a", + "title": "Execution: check", + "agentName": "checker", + "startedAt": "2026-04-09T11:39:02.796Z", + "events": [ + { + "ts": 1775734742796, + "type": "note", + "content": "\"check\": Run `corepack pnpm install --frozen-lockfile` then `corepack pnpm run check` from the repo root", + "raw": { + "agent": "checker" + } + }, + { + "ts": 1775734810769, + "type": "completion-evidence", + "content": "\"check\" verification-based completion — Verification passed (5 signal(s), 1 relevant channel post(s), 6 file change(s), exit=0; signals=0, Repository: `/Users/khaliqgant/Projects/AgentWorkforce/workforce`, OpenAI Codex v0.116.0 (research preview), Verification passed, **[check] Output:**; channel=**[check] Output:**\n```\nRepository: `/Users/khaliqgant/Projects/AgentWorkforce/workforce`\nCommand: `corepack pnpm install --frozen-lockfile`\nExit code: `1`\nstdo; files=created:packages/workload-router/dist/eval.d.ts, created:packages/workload-router/dist/eval.d.ts.map, created:packages/workload-router/dist/eval.js, created:packages/workload-router/dist/eval.js.map, created:packages/workload-router/dist/index.d.ts, created:packages/workload-router/dist/index.d.ts.map; exit=0)", + "significance": "medium", + "raw": { + "stepName": "check", + "completionMode": "verification", + "reason": "Verification passed", + "evidence": { + "summary": "5 signal(s), 1 relevant channel post(s), 6 file change(s), exit=0", + "signals": [ + "0", + "Repository: `/Users/khaliqgant/Projects/AgentWorkforce/workforce`", + "OpenAI Codex v0.116.0 (research preview)", + "Verification passed", + "**[check] Output:**" + ], + "channelPosts": [ + "**[check] Output:**\n```\nRepository: `/Users/khaliqgant/Projects/AgentWorkforce/workforce`\nCommand: `corepack pnpm install --frozen-lockfile`\nExit code: `1`\nstdo" + ], + "files": [ + "created:packages/workload-router/dist/eval.d.ts", + "created:packages/workload-router/dist/eval.d.ts.map", + "created:packages/workload-router/dist/eval.js", + "created:packages/workload-router/dist/eval.js.map", + "created:packages/workload-router/dist/index.d.ts", + "created:packages/workload-router/dist/index.d.ts.map" + ], + "exitCode": 0 + } + } + }, + { + "ts": 1775734810769, + "type": "finding", + "content": "\"check\" completed → Repository: `/Users/khaliqgant/Projects/AgentWorkforce/workforce`\n\nCommand: `corepack pnpm install --frozen-lockfile`\nEx", + "significance": "medium" + } + ], + "endedAt": "2026-04-09T11:40:10.797Z" + }, + { + "id": "ch_d6cf7565", + "title": "Retrospective", + "agentName": "orchestrator", + "startedAt": "2026-04-09T11:40:10.797Z", + "events": [ + { + "ts": 1775734810797, + "type": "reflection", + "content": "All 10 steps completed in 2min. (completed in 2 minutes)", + "significance": "high" + } + ], + "endedAt": "2026-04-09T11:40:10.797Z" + } + ], + "completedAt": "2026-04-09T11:40:10.797Z", + "retrospective": { + "summary": "All 10 steps completed in 2min.", + "approach": "dag workflow (3 agents)", + "confidence": 0.825, + "learnings": [], + "challenges": [] + } +} \ No newline at end of file diff --git a/.trajectories/completed/traj_1775760549887_744167d6.json b/.trajectories/completed/traj_1775760549887_744167d6.json new file mode 100644 index 0000000..f324a4f --- /dev/null +++ b/.trajectories/completed/traj_1775760549887_744167d6.json @@ -0,0 +1,283 @@ +{ + "id": "traj_1775760549887_744167d6", + "version": 1, + "task": { + "title": "add-opencode-workflow-specialist-persona-workflow", + "source": { + "system": "workflow-runner", + "id": "73d5ca64e67c724618abac1f" + } + }, + "status": "abandoned", + "startedAt": "2026-04-09T18:49:09.887Z", + "agents": [ + { + "name": "orchestrator", + "role": "workflow-runner", + "joinedAt": "2026-04-09T18:49:09.887Z" + }, + { + "name": "planner", + "role": "specialist", + "joinedAt": "2026-04-09T18:49:19.506Z" + }, + { + "name": "impl-persona", + "role": "specialist", + "joinedAt": "2026-04-09T18:53:41.484Z" + }, + { + "name": "reviewer", + "role": "specialist", + "joinedAt": "2026-04-09T18:54:25.601Z" + } + ], + "chapters": [ + { + "id": "ch_c618fedc", + "title": "Planning", + "agentName": "orchestrator", + "startedAt": "2026-04-09T18:49:09.887Z", + "events": [ + { + "ts": 1775760549887, + "type": "note", + "content": "Purpose: Add a dedicated opencode-workflow-specialist persona to workforce/personas/ following the existing schema." + }, + { + "ts": 1775760549887, + "type": "note", + "content": "Approach: 12-step dag workflow — Parsed 12 steps, 11 dependent steps, DAG validated, no cycles" + } + ], + "endedAt": "2026-04-09T18:49:13.478Z" + }, + { + "id": "ch_0fc3c61a", + "title": "Execution: list-existing-personas, read-flake-hunter-schema, read-debugger-for-second-example, check-readme-or-index", + "agentName": "orchestrator", + "startedAt": "2026-04-09T18:49:13.478Z", + "events": [], + "endedAt": "2026-04-09T18:49:19.504Z" + }, + { + "id": "ch_801b6675", + "title": "Convergence: list-existing-personas + read-flake-hunter-schema + read-debugger-for-second-example + check-readme-or-index", + "agentName": "orchestrator", + "startedAt": "2026-04-09T18:49:19.504Z", + "events": [ + { + "ts": 1775760559504, + "type": "reflection", + "content": "list-existing-personas + read-flake-hunter-schema + read-debugger-for-second-example + check-readme-or-index resolved. 4/4 steps completed. All steps completed on first attempt. Unblocking: plan.", + "significance": "high", + "raw": { + "confidence": 0.75, + "focalPoints": [ + "list-existing-personas: completed", + "read-flake-hunter-schema: completed", + "read-debugger-for-second-example: completed", + "check-readme-or-index: completed" + ] + } + } + ], + "endedAt": "2026-04-09T18:49:19.506Z" + }, + { + "id": "ch_d1f2ed00", + "title": "Execution: plan", + "agentName": "planner", + "startedAt": "2026-04-09T18:49:19.506Z", + "events": [ + { + "ts": 1775760559506, + "type": "note", + "content": "\"plan\": You are designing a new workforce persona at", + "raw": { + "agent": "planner" + } + }, + { + "ts": 1775760821483, + "type": "completion-evidence", + "content": "\"plan\" verification-based completion — Verification passed (4 signal(s), exit=0; signals=0, ```json, OpenAI Codex v0.116.0 (research preview), PLAN_COMPLETE; exit=0)", + "significance": "medium", + "raw": { + "stepName": "plan", + "completionMode": "verification", + "reason": "Verification passed", + "evidence": { + "summary": "4 signal(s), exit=0", + "signals": [ + "0", + "```json", + "OpenAI Codex v0.116.0 (research preview)", + "PLAN_COMPLETE" + ], + "exitCode": 0 + } + } + }, + { + "ts": 1775760821483, + "type": "finding", + "content": "\"plan\" completed → PLAN_COMPLETE", + "significance": "medium" + } + ], + "endedAt": "2026-04-09T18:53:41.484Z" + }, + { + "id": "ch_345b70e1", + "title": "Execution: write-persona", + "agentName": "impl-persona", + "startedAt": "2026-04-09T18:53:41.484Z", + "events": [ + { + "ts": 1775760821484, + "type": "note", + "content": "\"write-persona\": Write the file personas/opencode-workflow-specialist.json with", + "raw": { + "agent": "impl-persona" + } + }, + { + "ts": 1775760865540, + "type": "completion-evidence", + "content": "\"write-persona\" verification-based completion — Verification passed (5 signal(s), 1 relevant channel post(s), 1 file change(s), exit=0; signals=0, Completed the requested single-file change., OpenAI Codex v0.116.0 (research preview), Verification passed, **[write-persona] Output:**; channel=**[write-persona] Output:**\n```\nCompleted the requested single-file change.\nArtifact produced:\n- `/Users/khaliqgant/Projects/AgentWorkforce/workforce/personas/o; files=created:personas/opencode-workflow-specialist.json; exit=0)", + "significance": "medium", + "raw": { + "stepName": "write-persona", + "completionMode": "verification", + "reason": "Verification passed", + "evidence": { + "summary": "5 signal(s), 1 relevant channel post(s), 1 file change(s), exit=0", + "signals": [ + "0", + "Completed the requested single-file change.", + "OpenAI Codex v0.116.0 (research preview)", + "Verification passed", + "**[write-persona] Output:**" + ], + "channelPosts": [ + "**[write-persona] Output:**\n```\nCompleted the requested single-file change.\nArtifact produced:\n- `/Users/khaliqgant/Projects/AgentWorkforce/workforce/personas/o" + ], + "files": [ + "created:personas/opencode-workflow-specialist.json" + ], + "exitCode": 0 + } + } + }, + { + "ts": 1775760865540, + "type": "finding", + "content": "\"write-persona\" completed → - Other files changed: none", + "significance": "medium" + } + ], + "endedAt": "2026-04-09T18:54:25.603Z" + }, + { + "id": "ch_064fba8c", + "title": "Execution: final-review", + "agentName": "reviewer", + "startedAt": "2026-04-09T18:54:25.603Z", + "events": [ + { + "ts": 1775760865603, + "type": "note", + "content": "\"final-review\": Review the diff against the plan", + "raw": { + "agent": "reviewer" + } + }, + { + "ts": 1775760954353, + "type": "note", + "content": "\"final-review\" retrying (attempt 1/2)" + } + ], + "endedAt": "2026-04-09T18:55:55.357Z" + }, + { + "id": "ch_14449f0e", + "title": "Execution: final-review", + "agentName": "reviewer", + "startedAt": "2026-04-09T18:55:55.357Z", + "events": [ + { + "ts": 1775760955357, + "type": "note", + "content": "\"final-review\": Review the diff against the plan", + "raw": { + "agent": "reviewer" + } + }, + { + "ts": 1775761044219, + "type": "error", + "content": "\"final-review\" failed [verification_mismatch]: Agent completed but did not output the expected sentinel \"REVIEW_OK\". The task prompt may not clearly specify the required output format, or the agent produced correct work but did not emit the signal.", + "significance": "high", + "raw": { + "cause": "verification_mismatch", + "rawError": "Verification failed for \"final-review\": output does not contain \"REVIEW_OK\"", + "attempt": 2, + "maxRetries": 1 + } + }, + { + "ts": 1775761044222, + "type": "note", + "content": "\"print-summary\" skipped — Upstream dependency \"final-review\" failed" + }, + { + "ts": 1775761044223, + "type": "decision", + "content": "Whether to skip print-summary → skip: Upstream dependency \"final-review\" failed", + "significance": "medium", + "raw": { + "question": "Whether to skip print-summary", + "chosen": "skip", + "reasoning": "Upstream dependency \"final-review\" failed" + } + } + ], + "endedAt": "2026-04-09T18:57:24.224Z" + }, + { + "id": "ch_9a40b909", + "title": "Retrospective", + "agentName": "orchestrator", + "startedAt": "2026-04-09T18:57:24.224Z", + "events": [ + { + "ts": 1775761044224, + "type": "reflection", + "content": "Failed at \"final-review\" [verification_mismatch] after 8min. Caused 1 downstream step(s) to be skipped: print-summary. 10/12 steps completed before failure. (abandoned after 8 minutes)", + "significance": "high" + }, + { + "ts": 1775761044224, + "type": "error", + "content": "Workflow abandoned: Step \"final-review\" failed: Step \"final-review\" failed after 1 retries: Verification failed for \"final-review\": output does not contain \"REVIEW_OK\"", + "significance": "high" + } + ], + "endedAt": "2026-04-09T18:57:24.224Z" + } + ], + "completedAt": "2026-04-09T18:57:24.224Z", + "retrospective": { + "summary": "Failed at \"final-review\" [verification_mismatch] after 8min. Caused 1 downstream step(s) to be skipped: print-summary. 10/12 steps completed before failure.", + "approach": "dag workflow (3 agents)", + "confidence": 0.6666666666666666, + "learnings": [ + "Verification mismatch on: \"final-review\" (expected \"?\"). Make the required output format more explicit in the task prompt." + ], + "challenges": [ + "Agent completed but did not output the expected sentinel \"(unknown)\". The task prompt may not clearly specify the required output format, or the agent produced correct work but did not emit the signal." + ] + } +} \ No newline at end of file diff --git a/README.md b/README.md index 65b7e6f..23c6bb0 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ A **routing profile** is policy-only. It does not carry runtime fields; it only - `personas/test-strategist.json` - `personas/tdd-guard.json` - `personas/flake-hunter.json` +- `personas/opencode-workflow-specialist.json` - `personas/npm-provenance-publisher.json` ## Routing profiles @@ -80,6 +81,7 @@ for (const install of plan.installs) { - `test-strategy` - `tdd-enforcement` - `flake-investigation` + - `opencode-workflow-correctness` - `npm-provenance` 2. Resolve profile policy + persona runtime via `resolvePersona(intent)`. 3. Spawn subagent with returned harness/model/settings/prompt. diff --git a/packages/workload-router/routing-profiles/default.json b/packages/workload-router/routing-profiles/default.json index 8a6c9b5..64aac1e 100644 --- a/packages/workload-router/routing-profiles/default.json +++ b/packages/workload-router/routing-profiles/default.json @@ -47,6 +47,10 @@ "tier": "best", "rationale": "Intermittent failures are expensive and subtle; prioritize deeper reasoning for reproduction and root-cause analysis." }, + "opencode-workflow-correctness": { + "tier": "best", + "rationale": "Cross-layer opencode workflow failures are expensive to misdiagnose; default to the deepest tier for end-to-end reproduction and root-cause analysis." + }, "npm-provenance": { "tier": "best-value", "rationale": "Publishing setup is mostly mechanical workflow configuration; best-value is sufficient when guided by the prpm/npm-trusted-publishing skill." diff --git a/packages/workload-router/routing-profiles/schema.json b/packages/workload-router/routing-profiles/schema.json index f3dd3b1..cba0514 100644 --- a/packages/workload-router/routing-profiles/schema.json +++ b/packages/workload-router/routing-profiles/schema.json @@ -10,7 +10,7 @@ "intents": { "type": "object", "additionalProperties": false, - "required": ["implement-frontend", "review", "architecture-plan", "requirements-analysis", "debugging", "security-review", "documentation", "verification", "test-strategy", "tdd-enforcement", "flake-investigation", "npm-provenance"], + "required": ["implement-frontend", "review", "architecture-plan", "requirements-analysis", "debugging", "security-review", "documentation", "verification", "test-strategy", "tdd-enforcement", "flake-investigation", "opencode-workflow-correctness", "npm-provenance"], "properties": { "implement-frontend": { "$ref": "#/definitions/rule" }, "review": { "$ref": "#/definitions/rule" }, @@ -23,6 +23,7 @@ "test-strategy": { "$ref": "#/definitions/rule" }, "tdd-enforcement": { "$ref": "#/definitions/rule" }, "flake-investigation": { "$ref": "#/definitions/rule" }, + "opencode-workflow-correctness": { "$ref": "#/definitions/rule" }, "npm-provenance": { "$ref": "#/definitions/rule" } } } diff --git a/packages/workload-router/src/index.test.ts b/packages/workload-router/src/index.test.ts index e19f885..562ca61 100644 --- a/packages/workload-router/src/index.test.ts +++ b/packages/workload-router/src/index.test.ts @@ -67,6 +67,10 @@ test('resolves review from custom routing profile rule', () => { tier: 'best', rationale: 'deep debugging is worth the cost' }, + 'opencode-workflow-correctness': { + tier: 'best', + rationale: 'cross-layer workflow failures need deeper investigation' + }, 'npm-provenance': { tier: 'best-value', rationale: 'mechanical workflow wiring' @@ -123,6 +127,11 @@ test('resolves newly added personas from the default routing profile', () => { const verification = resolvePersona('verification'); assert.equal(verification.personaId, 'verifier'); assert.equal(verification.tier, 'best-value'); + + const opencodeWorkflow = resolvePersona('opencode-workflow-correctness'); + assert.equal(opencodeWorkflow.personaId, 'opencode-workflow-specialist'); + assert.equal(opencodeWorkflow.tier, 'best'); + assert.equal(opencodeWorkflow.runtime.harness, 'codex'); }); test('claude is a recognized harness value', () => { diff --git a/packages/workload-router/src/index.ts b/packages/workload-router/src/index.ts index 2a6d41a..a032b69 100644 --- a/packages/workload-router/src/index.ts +++ b/packages/workload-router/src/index.ts @@ -9,6 +9,7 @@ import verifierPersona from '../../../personas/verifier.json' with { type: 'json import testStrategist from '../../../personas/test-strategist.json' with { type: 'json' }; import tddGuard from '../../../personas/tdd-guard.json' with { type: 'json' }; import flakeHunter from '../../../personas/flake-hunter.json' with { type: 'json' }; +import opencodeWorkflowSpecialist from '../../../personas/opencode-workflow-specialist.json' with { type: 'json' }; import npmProvenancePublisher from '../../../personas/npm-provenance-publisher.json' with { type: 'json' }; import defaultRoutingProfileJson from '../routing-profiles/default.json' with { type: 'json' }; @@ -26,6 +27,7 @@ export const PERSONA_INTENTS = [ 'test-strategy', 'tdd-enforcement', 'flake-investigation', + 'opencode-workflow-correctness', 'npm-provenance' ] as const; @@ -391,6 +393,10 @@ export const personaCatalog: Record = { 'test-strategy': parsePersonaSpec(testStrategist, 'test-strategy'), 'tdd-enforcement': parsePersonaSpec(tddGuard, 'tdd-enforcement'), 'flake-investigation': parsePersonaSpec(flakeHunter, 'flake-investigation'), + 'opencode-workflow-correctness': parsePersonaSpec( + opencodeWorkflowSpecialist, + 'opencode-workflow-correctness' + ), 'npm-provenance': parsePersonaSpec(npmProvenancePublisher, 'npm-provenance') }; diff --git a/personas/opencode-workflow-specialist.json b/personas/opencode-workflow-specialist.json new file mode 100644 index 0000000..e212324 --- /dev/null +++ b/personas/opencode-workflow-specialist.json @@ -0,0 +1,25 @@ +{ + "id": "opencode-workflow-specialist", + "intent": "opencode-workflow-correctness", + "description": "Diagnoses and repairs opencode-based agent-relay workflow failures across SDK, broker, cloud bootstrap, and CLI layers", + "tiers": { + "best": { + "harness": "codex", + "model": "openai-codex/gpt-5.3-codex", + "systemPrompt": "You are the opencode workflow specialist. Keep opencode-using agent-relay workflows working end-to-end across the full surface area: SDK workflow runner spawn dispatch, SDK transport selection, opencode session collection from ~/.local/share/opencode/opencode.db, the Rust broker headless worker execution loop, cloud bootstrap config extraction and standalone fallback, Daytona snapshot and launcher provisioning of the opencode binary plus relayfile/runtime bindings, and opencode CLI quirks including TUI vs headless execution, model selection, and auth state in ~/.local/share/opencode/auth.json. Process: (1) reproduce the failure or hang before theorizing, (2) isolate the broken layer and distinguish execution bugs from collector/observability, auth, bootstrap, or environment issues, (3) identify the root cause instead of the nearest symptom, (4) apply the smallest fix in the correct layer, and (5) verify with repeat runs across the original failing case plus nearby shared-path scenarios such as local headless execution, mixed-provider workflows, model-pin cases, and cloud/bootstrap paths when relevant. Quality bar is fixed across tiers: same correctness standard, lower tiers reduce only depth and verbosity. Priorities: end-to-end correctness > local test fidelity > observability > cleanup > speed. Avoid shortcuts: do not flip interactive: false to dodge a headless bug, add env-var hacks without proof, add manual or parallel spawn paths that bypass the SDK or broker, or ship an opencode-only patch without checking shared provider paths for regressions. Output contract: repro status, broken layer, reproduction recipe, root cause, minimal fix, and repeat-run evidence across multiple scenarios.", + "harnessSettings": { "reasoning": "high", "timeoutSeconds": 1500 } + }, + "best-value": { + "harness": "opencode", + "model": "opencode/gpt-5-nano", + "systemPrompt": "You are the opencode workflow specialist in efficient mode. Keep the same quality bar as top tier; reduce only depth and verbosity. Own the full opencode workflow surface area: SDK spawn dispatch and transport selection, opencode session collection, the Rust headless worker, cloud bootstrap extraction/fallback, Daytona snapshot and launcher provisioning, and opencode CLI auth/model/mode quirks. Reproduce first, isolate the broken layer, fix the root cause in the correct layer, and verify with repeat runs across the failing opencode case plus nearby shared paths when relevant. Priorities remain end-to-end correctness, local test fidelity, observability, cleanup, then speed. Avoid interactive: false workarounds, env-var hacks, SDK-bypassing spawn paths, and untested fixes that may regress other providers. Output contract: brief repro status, broken layer, reproduction recipe, root cause, minimal fix, and multi-scenario evidence.", + "harnessSettings": { "reasoning": "medium", "timeoutSeconds": 1100 } + }, + "minimum": { + "harness": "opencode", + "model": "opencode/mimo-v2-flash-free", + "systemPrompt": "You are a concise opencode workflow specialist. Enforce the same quality bar as all tiers; only limit detail. Cover SDK spawn/transport behavior, opencode collector state, the broker headless worker, cloud bootstrap/snapshot wiring, and opencode CLI auth/model/mode issues. Required process: reproduce first, identify the broken layer, fix the root cause rather than routing around it, and show repeat-run evidence on the failing case plus at least one nearby shared path when possible. Priorities: end-to-end correctness, trustworthy local signal, observability, and no symptom masking. Do not rely on interactive: false detours, env-var hacks, or bypassing the SDK or broker. Output contract: short repro summary, broken layer, likely root cause, fix direction, and evidence.", + "harnessSettings": { "reasoning": "low", "timeoutSeconds": 800 } + } + } +}