@tea-agent/loop-agent 0.39.0-next.8 → 0.39.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/AGENTS.md +4 -1
- package/CHANGELOG.md +264 -67
- package/README.md +11 -5
- package/bin/loop-agent.js +7 -3
- package/dist/application/dag/generate-task-dag.js +9 -0
- package/dist/application/task-lifecycle/advance.js +4 -0
- package/dist/build-stamp.json +3 -3
- package/dist/cli/command-definitions.js +16 -5
- package/dist/cli/program.js +16 -2
- package/dist/cli/update/notifier.js +2 -2
- package/dist/cli.js +2 -1
- package/dist/commands/dag-rerun.js +55 -1
- package/dist/commands/init-model-catalog.js +464 -0
- package/dist/commands/init-upgrade.js +265 -97
- package/dist/commands/init.js +428 -27
- package/dist/commands/inspect-next.js +8 -0
- package/dist/commands/task-advance.js +31 -0
- package/dist/executors/dag-pi-executor.js +124 -18
- package/dist/executors/pi-event-serializer.js +42 -1
- package/dist/executors/pi-executor.js +51 -0
- package/dist/executors/pi-extension-resolver.js +233 -0
- package/dist/executors/pi-playwright-cli-tool.js +74 -28
- package/dist/executors/pi-sdk-executor.js +187 -59
- package/dist/executors/shell-executor.js +554 -33
- package/dist/executors/shell-write-guard.js +7 -0
- package/dist/shared/dag-failure-category.js +138 -0
- package/dist/shared/dag-prompt-override.js +28 -0
- package/dist/shared/operator/capabilities.js +181 -27
- package/dist/shared/playwright-cli-command-policy.js +15 -0
- package/dist/shared/update/console-notifier.js +100 -0
- package/dist/{cli → shared}/update/npm-client.js +41 -8
- package/dist/{cli → shared}/update/state.js +41 -13
- package/dist/task/config-types.js +28 -0
- package/dist/task/contract/constants.js +1 -0
- package/dist/task/contract/diff.js +26 -0
- package/dist/task/contract/project.js +5 -0
- package/dist/task/contract/schema.js +6 -1
- package/dist/task/source-prepare/build-draft.js +15 -0
- package/dist/task/source-prepare/parse-intent.js +24 -4
- package/dist/worker/cli.js +31 -1
- package/dist/worker/console/chat/deferred-turn.js +91 -0
- package/dist/worker/console/chat/mcp-inventory.js +221 -0
- package/dist/worker/console/chat/operation-card.js +8 -1
- package/dist/worker/console/chat/pi-console-config.js +81 -10
- package/dist/worker/console/chat/pi-runtime.js +165 -83
- package/dist/worker/console/chat/repo-walk.js +10 -1
- package/dist/worker/console/chat/routes.js +480 -55
- package/dist/worker/console/chat/semantic-activity.js +20 -8
- package/dist/worker/console/chat/session-store.js +146 -2
- package/dist/worker/console/chat/turn-process.js +10 -10
- package/dist/worker/console/dag-execution-receipt.js +33 -0
- package/dist/worker/console/inspect-split.js +18 -0
- package/dist/worker/console/operation-run-facts.js +19 -3
- package/dist/worker/console/operator-actions.js +195 -4
- package/dist/worker/console/operator-user-error.js +2 -2
- package/dist/worker/console/pi-readiness.js +5 -4
- package/dist/worker/console/recovery-cta.js +4 -4
- package/dist/worker/console/recovery-error-copy.js +4 -4
- package/dist/worker/console/routes.js +43 -2
- package/dist/worker/console/security.js +63 -9
- package/dist/worker/console/server.js +42 -6
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-BLXFe4qI.js → abnfDiagram-N423BO3Z-Br92EGb7.js} +1 -1
- package/dist/worker/console/static/assets/{arc-7iOJeqho.js → arc-oulImtQq.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-CYoyj5K7.js → architectureDiagram-T3A2C74G-tyHc6aqO.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-fK01JNlR.js → blockDiagram-VBNYF7ZC-CY86BSpT.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-bzbw5D_Z.js → c4Diagram-5PPSVZJV-BKKsDmNs.js} +1 -1
- package/dist/worker/console/static/assets/channel-TY36zt-i.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-Cf6hJFFG.js → chunk-2GRJ4B5K-CXZdjl3B.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-DSFXR-et.js → chunk-2Q5K7J3B-B-aIFDQ5.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-BagJechl.js → chunk-5RXB4S5H-BDgAW_B2.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-E7QNMFaW.js → chunk-5VM5RSS4-DABa4UPR.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-BG_eOBrC.js → chunk-6Q2QTUOP-aGbysVOx.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-Bo42dqol.js → chunk-GF5L2VYU-B8MSZDVs.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-dibM-87v.js → chunk-JWPE2WC7-CpelV73g.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-Bytrp3Oe.js → chunk-KBJHAD2P-BE04ty3z.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-DBABILrr.js → chunk-RYQCIY6F-BUxTkaaR.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DCUk5Pf9.js → chunk-XXDRQBXY-CYYBVKfX.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-Dk7QCChM.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-Dk7QCChM.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-BlGE9v6E.js → cose-bilkent-JH36ORCC-CEQF_xmQ.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-DGl5ewph.js → cynefin-VYW2F7L2-CqpxN5IT.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-DsJ_SVH_.js → cynefinDiagram-MW4NZA55-B3PzanVi.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BIhjFdzv.js → dagre-VZM6K2ZE-BSUGCNx1.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-Dmy1ctTb.js → diagram-7IWD3JNH-CdLevU5T.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-DYCtWUF3.js → diagram-B4RE2ZJO-BjpF_Kok.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-BMZFHVd2.js → diagram-LBJQPF4R-C4I6NJny.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-b_U8gfaO.js → diagram-Q27KOJAE-C8hecCr5.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-Dzy_bn-I.js → diagram-UB23O5K3-Daod6tOS.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-DJCiMNEI.js → ebnfDiagram-BXEA7PRR-BvvmazGv.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-28lD016B.js → erDiagram-JOGREHBK-DeN_vfV4.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-DGyHJmIw.js → flowDiagram-UKHOOZJN-D6dq1t9z.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-CzdwUjrO.js → ganttDiagram-PKOTCBZU-DziIdNY4.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-D9bGwuo8.js → gitGraphDiagram-DS77QQ5N-Dy4s5CXr.js} +1 -1
- package/dist/worker/console/static/assets/index-C3GgHg-g.css +1 -0
- package/dist/worker/console/static/assets/index-Ci8ksvBm.js +406 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-LJgJUQFC.js → infoDiagram-6WML65LV-Czv5eYx2.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-98LaB8zb.js → ishikawaDiagram-WSZJBQD7-Bsk3nFRT.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-D-ISzwlQ.js → journeyDiagram-NVQOT4AX-DxGmNj5K.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-gfYOI-EL.js → kanban-definition-27J2QSJJ-CYCFqkO_.js} +1 -1
- package/dist/worker/console/static/assets/{linear-CyntZgKV.js → linear-B0YzRwrd.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-BBOR7dg0.js → mermaid.core-t3EZtIGh.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-CQAgwPMk.js → mindmap-definition-FAOFIHXS-BTXpTv0T.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-DkMiZFuV.js → pegDiagram-VL7TDLO6-DU8UkKqA.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-DLNXa_0J.js → pieDiagram-7S7Q4E2Y-DP4y8ohp.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-Dc7bdzjm.js → quadrantDiagram-CIZ2JOQS-B07vNaYR.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-BxMB0QqW.js → railroadDiagram-AXF67PYL-xDWktb2i.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-FjumoKn4.js → requirementDiagram-LRYGKXZP-BLNMKqeS.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-CkhKc_E3.js → sankeyDiagram-W5VNT64P-n0adalxH.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DoBWqTTH.js → sequenceDiagram-SI44F4Z6-BbnS-2DL.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-CQeh_YeE.js → sizeCapture-X5ZJPWSS-B4uPpCLu.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-LuHmFW-I.js → stateDiagram-OKZ733FA--MMbB0fX.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BqOigMQ4.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-CHwbDctY.js → swimlanes-SLNWSIFB-BXUgp2QY.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-Caxz9UA2.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-CoMngk0X.js → timeline-definition-Z64GVDOM-CsaMxki7.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-CURYbtbO.js → vennDiagram-T6HMQDX7-C2IuG9iH.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-BdqSECjU.js → wardleyDiagram-T6FBY63Y-CmEWOXCW.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-DbMUYuAg.js → xychartDiagram-ELKLHX3M-D_9LE0MG.js} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/app/useOperatorActions.js +1 -1
- package/dist/worker/console/static-src/app/useRecoveryActions.js +2 -2
- package/dist/worker/console/static-src/app/useRecoveryConsole.js +38 -2
- package/dist/worker/console/static-src/app/useRunProgress.js +46 -0
- package/dist/worker/console/static-src/operator-chat/cards/failure-category-advice.js +25 -0
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +74 -26
- package/dist/worker/console/static-src/operator-chat/input-history.js +76 -0
- package/dist/worker/console/static-src/operator-chat/mutation-gate.js +1 -1
- package/dist/worker/console/static-src/operator-chat/open-preview-in-browser.js +328 -0
- package/dist/worker/console/static-src/operator-chat/resource-diagnostics.js +204 -0
- package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +8 -1
- package/dist/worker/console/static-src/operator-chat/turn-submission.js +54 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +3 -0
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +237 -11
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +50 -22
- package/dist/worker/console/static-src/operator-chat/useComposer.js +32 -0
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +26 -1
- package/dist/worker/console/static-src/pages/tasks/run-id-resolution.js +79 -0
- package/dist/worker/console/static-src/pages/tasks/run-ownership-verify.js +23 -0
- package/dist/worker/console/static-src/pages/tasks/run-panel-progress.js +110 -0
- package/dist/worker/loop-agent/loop-agent-client.js +7 -3
- package/dist/worker/materialize/harness-task-lineage.js +5 -2
- package/dist/worker/observability/read-model.js +22 -0
- package/dist/worker/observe/node-input.js +74 -3
- package/dist/worker/observe/node-process.js +377 -0
- package/dist/worker/observe/routes.js +36 -3
- package/dist/worker/observe/shell-handler-keys.js +34 -0
- package/dist/worker/observe/static/api.js +66 -0
- package/dist/worker/observe/static/constants.js +8 -1
- package/dist/worker/observe/static/dag-history-labels.js +4 -0
- package/dist/worker/observe/static/format.js +23 -0
- package/dist/worker/observe/static/markdown-render.js +20 -1
- package/dist/worker/observe/static/operator-chrome.js +4 -0
- package/dist/worker/observe/static/state.js +13 -2
- package/dist/worker/observe/static/styles.css +73 -0
- package/dist/worker/observe/static/views/dag-inspector.js +612 -8
- package/dist/worker/observe/static/views/dag.js +8 -1
- package/dist/worker/observe/static/views/failures.js +5 -2
- package/dist/worker/observe/static/views/session-timeline.js +78 -9
- package/dist/workflows/dag/backend-test-case-coverage-analysis.js +827 -53
- package/dist/workflows/dag/backend-test-case-manifest.js +4 -0
- package/dist/workflows/dag/backend-test-execution-contract.js +18 -9
- package/dist/workflows/dag/backend-test-gap-fill.js +205 -0
- package/dist/workflows/dag/backend-test-intake-context.js +32 -0
- package/dist/workflows/dag/backend-test-layout.js +133 -0
- package/dist/workflows/dag/backend-test-markdown-workflow.js +167 -32
- package/dist/workflows/dag/backend-test-module-stem.js +5 -0
- package/dist/workflows/dag/backend-test-pytest-collection.js +368 -33
- package/dist/workflows/dag/backend-test-result-contract.js +1 -1
- package/dist/workflows/dag/backend-test-scenario-param.js +884 -140
- package/dist/workflows/dag/backend-test-scenario-partitions.js +321 -0
- package/dist/workflows/dag/backend-test-writer-completeness.js +100 -56
- package/dist/workflows/dag/contract-output-registry.js +15 -0
- package/dist/workflows/dag/contract-validator-registrations.js +3 -1
- package/dist/workflows/dag/convergence/controller.js +141 -0
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +1 -1
- package/dist/workflows/dag/dynamic-runtime/map.js +25 -9
- package/dist/workflows/dag/dynamic-runtime/shared.js +1 -1
- package/dist/workflows/dag/failure-category.js +7 -116
- package/dist/workflows/dag/frontend-implementation-contract.js +377 -4
- package/dist/workflows/dag/frontend-plan-render.js +1 -1
- package/dist/workflows/dag/frontend-prewrite-gate.js +96 -84
- package/dist/workflows/dag/frontend-repair.js +14 -0
- package/dist/workflows/dag/frontend-risk.js +15 -2
- package/dist/workflows/dag/frontend-test-case-checklist.js +30 -4
- package/dist/workflows/dag/frontend-test-case-manifest.js +11 -4
- package/dist/workflows/dag/frontend-test-case-quality.js +11 -16
- package/dist/workflows/dag/frontend-test-environment-probe.js +230 -0
- package/dist/workflows/dag/frontend-test-html-report.js +3 -1
- package/dist/workflows/dag/frontend-test-l5-report.js +3 -1
- package/dist/workflows/dag/frontend-test-layout.js +159 -0
- package/dist/workflows/dag/frontend-test-markdown.js +61 -0
- package/dist/workflows/dag/frontend-test-result-contract.js +188 -42
- package/dist/workflows/dag/frontend-test-standard-scenarios.js +70 -0
- package/dist/workflows/dag/frontend-verification-trace.js +29 -4
- package/dist/workflows/dag/init-hybrid.js +894 -205
- package/dist/workflows/dag/node-execution.js +183 -15
- package/dist/workflows/dag/prompt.js +60 -1
- package/dist/workflows/dag/rerun-feedback.js +212 -0
- package/dist/workflows/dag/rerun-plan.js +224 -27
- package/dist/workflows/dag/rerun-run.js +61 -6
- package/dist/workflows/dag/rerun-task.js +61 -2
- package/dist/workflows/dag/retry-policy.js +109 -0
- package/dist/workflows/dag/structured-output-repair.js +712 -0
- package/dist/workflows/dag/types.js +143 -1
- package/dist/workflows/dag/validate.js +64 -20
- package/docs/init-surface.manifest.json +5 -0
- package/docs/operations/README.md +1 -1
- package/docs/operations/local-development-environment.md +1 -5
- package/docs/skills/vetted-skill-registry.md +14 -0
- package/docs/templates/README.md +1 -1
- package/docs/templates/agent-dag.schema.json +44 -0
- package/docs/templates/backend-test-dag.json +60 -35
- package/docs/templates/frontend-implementation-contract.schema.json +1 -1
- package/docs/templates/frontend-test-case-checklist.md +2 -2
- package/docs/templates/frontend-test-dag.json +8 -10
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +1 -1
- package/docs/templates/init-managed-agents.md +13 -3
- package/harness.json +6 -4
- package/package.json +12 -4
- package/scripts/next-info.mjs +356 -0
- package/scripts/next-publish-gate.mjs +238 -0
- package/scripts/release-source-binding.mjs +251 -0
- package/skills/analyze-product-requirements/SKILL.md +8 -5
- package/skills/analyze-product-requirements/references/acceptance-criteria.md +1 -1
- package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +10 -6
- package/skills/analyze-product-requirements/references/example.md +50 -0
- package/skills/analyze-product-requirements/references/forward-test-cases.md +11 -7
- package/skills/analyze-product-requirements/references/kb-integration.md +5 -5
- package/skills/analyze-product-requirements/references/product-analysis-schema.md +8 -4
- package/skills/analyze-product-requirements/references/product-requirement-schema.md +2 -2
- package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +1 -1
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +11 -1
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +20 -1
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +9 -0
- package/skills/codebase-scout/SKILL.md +1 -1
- package/skills/fe-test-ui-scout/SKILL.md +65 -0
- package/skills/fe-test-ui-scout/references/ledger-schema.md +62 -0
- package/skills/fe-test-ui-scout/references/recon-protocol.md +54 -0
- package/skills/frontend-implementation/references/node-contracts.md +2 -2
- package/skills/improve-codebase-architecture/SKILL.md +81 -0
- package/skills/improve-codebase-architecture/deepening.md +37 -0
- package/skills/improve-codebase-architecture/html-report.md +123 -0
- package/skills/improve-codebase-architecture/interface-design.md +44 -0
- package/skills/improve-codebase-architecture/language.md +53 -0
- package/skills/loop-agent/references/command-reference.md +11 -4
- package/skills/playwright-cli/SKILL.md +23 -1
- package/skills/playwright-cli-case-generator/SKILL.md +29 -8
- package/dist/worker/console/static/assets/channel-BBOTJHvD.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-Cm8Yf8tD.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-Cm8Yf8tD.js +0 -1
- package/dist/worker/console/static/assets/index-B-qWGThd.js +0 -325
- package/dist/worker/console/static/assets/index-C-xRgY_0.css +0 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DZihfdKc.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CKnXCjHX.js +0 -8
|
@@ -98,6 +98,13 @@ export function isEphemeralToolCachePath(filePath) {
|
|
|
98
98
|
const normalized = normalizePath(filePath);
|
|
99
99
|
if (!normalized)
|
|
100
100
|
return false;
|
|
101
|
+
// CodeGraph extension sync side effect (plan 2026-08-21 D7): a loaded
|
|
102
|
+
// pi-codegraph extension keeps an existing .codegraph/ index fresh at
|
|
103
|
+
// session start; those index files are extension-owned run state, not
|
|
104
|
+
// writer output, so they never count as write-guard violations.
|
|
105
|
+
if (normalized === ".codegraph" || normalized.startsWith(".codegraph/")) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
101
108
|
if (normalized === ".pytest_cache" ||
|
|
102
109
|
normalized.startsWith(".pytest_cache/")) {
|
|
103
110
|
return true;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure DAG failure-category classification shared by the workflows kernel and
|
|
3
|
+
* the Operator Console projection (console sources may not import
|
|
4
|
+
* src/workflows — security-and-tools boundary test).
|
|
5
|
+
*
|
|
6
|
+
* No runtime imports: this module is a leaf safe for both the CLI kernel and
|
|
7
|
+
* the browser bundle.
|
|
8
|
+
*/
|
|
9
|
+
export const DAG_NORMALIZED_FAILURE_CATEGORY_VALUES = [
|
|
10
|
+
"success",
|
|
11
|
+
"validation",
|
|
12
|
+
"executor",
|
|
13
|
+
"write-guard",
|
|
14
|
+
"timeout",
|
|
15
|
+
"auth",
|
|
16
|
+
"human-required",
|
|
17
|
+
"human-rejected",
|
|
18
|
+
"shell-command",
|
|
19
|
+
"static-error",
|
|
20
|
+
"decision-envelope",
|
|
21
|
+
"skipped",
|
|
22
|
+
"unknown",
|
|
23
|
+
];
|
|
24
|
+
const RAW_TO_NORMALIZED = {
|
|
25
|
+
success: "success",
|
|
26
|
+
"write-guard": "write-guard",
|
|
27
|
+
timeout: "timeout",
|
|
28
|
+
// Clean implementer stall with zero writes — still a timeout class for report,
|
|
29
|
+
// but retryable under WRITER_TRANSPORT_RETRY_POLICY.
|
|
30
|
+
"writer-clean-timeout": "timeout",
|
|
31
|
+
"missing-api-key": "auth",
|
|
32
|
+
auth: "auth",
|
|
33
|
+
"human-rejected": "human-rejected",
|
|
34
|
+
"human-required": "human-required",
|
|
35
|
+
"decision-envelope-invalid": "decision-envelope",
|
|
36
|
+
"nonzero-exit": "shell-command",
|
|
37
|
+
"spawn-error": "shell-command",
|
|
38
|
+
"test-timeout": "timeout",
|
|
39
|
+
"static-error": "static-error",
|
|
40
|
+
"invalid-output": "validation",
|
|
41
|
+
"structured-output-truncated": "validation",
|
|
42
|
+
"output-too-large": "validation",
|
|
43
|
+
"structured-repair-exhausted": "validation",
|
|
44
|
+
"governance-blocked": "validation",
|
|
45
|
+
"path-violation": "validation",
|
|
46
|
+
"empty-output": "validation",
|
|
47
|
+
"verify-failure": "validation",
|
|
48
|
+
"test-failure": "validation",
|
|
49
|
+
"verification-plan-stale": "validation",
|
|
50
|
+
network: "executor",
|
|
51
|
+
quota: "executor",
|
|
52
|
+
"rate-limit": "executor",
|
|
53
|
+
unavailable: "executor",
|
|
54
|
+
// Deterministic capability/policy refusal: missing verified launcher JS
|
|
55
|
+
// entry, capability allowlist rejection, or missing bounded write tool
|
|
56
|
+
// profile. These are environment/config defects the operator repairs
|
|
57
|
+
// before rerunning; classify as executor so recovery recommends
|
|
58
|
+
// rerun-after-fix WITHOUT forcing a human-decision gate on
|
|
59
|
+
// standaloneTaskRerun (run-failed same-task rerun).
|
|
60
|
+
"tool-policy": "executor",
|
|
61
|
+
unknown: "unknown",
|
|
62
|
+
};
|
|
63
|
+
/** Status inputs are deliberately `string`: projection layers pass bounded
|
|
64
|
+
* text from CLI JSON; unmatched values simply fall through to unknown. */
|
|
65
|
+
function isFinishedStatus(status) {
|
|
66
|
+
return status === "FINISHED" || status === "finished";
|
|
67
|
+
}
|
|
68
|
+
function isInProgressStatus(status) {
|
|
69
|
+
return (status === "PENDING" ||
|
|
70
|
+
status === "RUNNING" ||
|
|
71
|
+
status === "pending" ||
|
|
72
|
+
status === "running");
|
|
73
|
+
}
|
|
74
|
+
function isFailureStatus(status) {
|
|
75
|
+
return (status === "ERROR" ||
|
|
76
|
+
status === "failed" ||
|
|
77
|
+
status === "partial_failed");
|
|
78
|
+
}
|
|
79
|
+
function mapRawCategory(raw) {
|
|
80
|
+
const direct = RAW_TO_NORMALIZED[raw];
|
|
81
|
+
if (direct)
|
|
82
|
+
return direct;
|
|
83
|
+
const lower = raw.toLowerCase();
|
|
84
|
+
if (lower.includes("timeout"))
|
|
85
|
+
return "timeout";
|
|
86
|
+
if (lower.includes("validation") ||
|
|
87
|
+
lower.includes("invalid") ||
|
|
88
|
+
lower.includes("verification-plan-stale") ||
|
|
89
|
+
lower.includes("plan-stale"))
|
|
90
|
+
return "validation";
|
|
91
|
+
if (lower.includes("auth") || lower.includes("api-key"))
|
|
92
|
+
return "auth";
|
|
93
|
+
if (lower.includes("write-guard") || lower.includes("write_guard"))
|
|
94
|
+
return "write-guard";
|
|
95
|
+
if (lower.includes("decision-envelope") || lower.includes("decision_envelope"))
|
|
96
|
+
return "decision-envelope";
|
|
97
|
+
if (lower.includes("human-rejected"))
|
|
98
|
+
return "human-rejected";
|
|
99
|
+
if (lower.includes("human-required"))
|
|
100
|
+
return "human-required";
|
|
101
|
+
if (lower.includes("static-error"))
|
|
102
|
+
return "static-error";
|
|
103
|
+
if (lower.includes("nonzero-exit") ||
|
|
104
|
+
lower.includes("spawn-error") ||
|
|
105
|
+
lower.includes("shell"))
|
|
106
|
+
return "shell-command";
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
export function isDagFailureCategory(value) {
|
|
110
|
+
return DAG_NORMALIZED_FAILURE_CATEGORY_VALUES.includes(value);
|
|
111
|
+
}
|
|
112
|
+
export function normalizeDagFailureCategory(raw, status) {
|
|
113
|
+
if (status === "SKIPPED") {
|
|
114
|
+
return "skipped";
|
|
115
|
+
}
|
|
116
|
+
if (raw !== undefined) {
|
|
117
|
+
const mapped = mapRawCategory(raw);
|
|
118
|
+
if (mapped) {
|
|
119
|
+
if (mapped === "success") {
|
|
120
|
+
return isFinishedStatus(status) ? "success" : "unknown";
|
|
121
|
+
}
|
|
122
|
+
return mapped;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (raw === undefined && isFinishedStatus(status)) {
|
|
126
|
+
return "success";
|
|
127
|
+
}
|
|
128
|
+
if (isInProgressStatus(status)) {
|
|
129
|
+
return "unknown";
|
|
130
|
+
}
|
|
131
|
+
if (isFailureStatus(status)) {
|
|
132
|
+
return "unknown";
|
|
133
|
+
}
|
|
134
|
+
if (raw === "success" && isFinishedStatus(status)) {
|
|
135
|
+
return "success";
|
|
136
|
+
}
|
|
137
|
+
return "unknown";
|
|
138
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal switch for the experimental "rerun failed node with an edited
|
|
3
|
+
* prompt" capability. Default is OFF; nothing may depend on it being enabled.
|
|
4
|
+
* The switch is deliberately env-based (no harness.json surface) while the
|
|
5
|
+
* feature is internal.
|
|
6
|
+
*/
|
|
7
|
+
export const DAG_RERUN_PROMPT_OVERRIDE_ENV = "HARNESS_DAG_RERUN_PROMPT_OVERRIDE";
|
|
8
|
+
/** Upper bound for an override input body (characters). */
|
|
9
|
+
export const MAX_DAG_RERUN_PROMPT_OVERRIDE_CHARS = 65_536;
|
|
10
|
+
export function isDagRerunPromptOverrideEnabled(env = process.env) {
|
|
11
|
+
const value = env[DAG_RERUN_PROMPT_OVERRIDE_ENV];
|
|
12
|
+
return value === "1" || value === "true";
|
|
13
|
+
}
|
|
14
|
+
export const DAG_RERUN_PROMPT_ADDENDUM_TAG = "operator_addendum";
|
|
15
|
+
/**
|
|
16
|
+
* Compose the final subtask_prompt for a rerun override.
|
|
17
|
+
* - "replace": the operator text becomes the whole prompt (advanced mode).
|
|
18
|
+
* - "append" (recommended): the frozen base prompt is kept verbatim and the
|
|
19
|
+
* operator addendum is appended in a clearly marked block, mirroring the
|
|
20
|
+
* rerunFeedback / retry_instruction augmentation semantics — small diffs,
|
|
21
|
+
* no risk of dropping template scaffolding.
|
|
22
|
+
*/
|
|
23
|
+
export function composeDagPromptOverridePrompt(input) {
|
|
24
|
+
if (input.mode === "replace") {
|
|
25
|
+
return input.text;
|
|
26
|
+
}
|
|
27
|
+
return `${input.basePrompt}\n\n<${DAG_RERUN_PROMPT_ADDENDUM_TAG}>\n${input.text.trim()}\n</${DAG_RERUN_PROMPT_ADDENDUM_TAG}>\n`;
|
|
28
|
+
}
|
|
@@ -13,13 +13,45 @@ const CONTROLLER_PROTOCOL_CAPABILITIES = [
|
|
|
13
13
|
"worker-attempt-revision-v1",
|
|
14
14
|
"recovery-decision-v2",
|
|
15
15
|
];
|
|
16
|
-
function officialModelCallable(coverage,
|
|
16
|
+
function officialModelCallable(coverage, _kind) {
|
|
17
17
|
if (coverage === "human-gated-required")
|
|
18
18
|
return "prepare-only";
|
|
19
|
-
|
|
19
|
+
// 2026-08-18: advanced actions (read or mutation) stay OUT of the model
|
|
20
|
+
// tool surface — low-frequency/forensic commands with generic args[] params
|
|
21
|
+
// diluted model attention. They remain dispatchable via UI capabilities.
|
|
22
|
+
if (coverage === "advanced")
|
|
20
23
|
return "never";
|
|
21
24
|
return "always";
|
|
22
25
|
}
|
|
26
|
+
const OFFICIAL_ACTION_DESCRIPTIONS = {
|
|
27
|
+
dagDecisionInspect: "Inspect a pending DAG decision envelope (inputs, options, chosen branch). Use before advising the operator on approve/reject; read-only.",
|
|
28
|
+
dagDecisionValidate: "Validate a DAG decision envelope against its schema. Use when a decision payload looks malformed or a writer emitted a suspect envelope; read-only.",
|
|
29
|
+
dagCloseoutDraft: "Draft the closeout handoff document for a finished DAG run. Use when the run is FINISHED and you need the handoff text; read-only.",
|
|
30
|
+
planList: "List execution plans in the repository. Use to discover plan ids before plan create/complete/check.",
|
|
31
|
+
planCreate: "Create an execution plan from a summary. Use to record the next work block before starting it.",
|
|
32
|
+
planComplete: "Mark an execution plan complete with a summary of what was delivered. Use after a work block is done and verified.",
|
|
33
|
+
planCheck: "Check execution-plan health and drift. Use to audit plan state without mutating anything.",
|
|
34
|
+
docsAudit: "Audit docs freshness and links (document catalog policy). Use when asked whether docs are stale or need review.",
|
|
35
|
+
handoffCheck: "Check handoff document completeness against the verification matrix. Use before claiming a task is fully handed off.",
|
|
36
|
+
handoffCoverage: "Show verification coverage across tests/docs/links for the repo. Use when asked what is verified and what is not.",
|
|
37
|
+
coverageReport: "Produce the verification coverage report. Use for a structured view of tests vs requirements.",
|
|
38
|
+
stats: "Repository workflow statistics (tasks, runs, durations). Use for quantitative status questions.",
|
|
39
|
+
promoteRun: "Task advance alias; passes a task id and flags through to task advance to promote a run. Does not pre-verify run state here — confirm with dagReport that the run is FINISHED before calling.",
|
|
40
|
+
closeoutTask: "Task advance alias; passes a task id and flags through to task advance to close out a task. Confirm the task's work is delivered and verified before calling.",
|
|
41
|
+
knowledgeCurate: "Generate knowledge-base curation proposals (may write a proposal file when --output is passed). Write-capable; use via the operator CLI, not as a model tool.",
|
|
42
|
+
knowledgeQuery: "Query the repository knowledge base. Use instead of re-reading files when a curated answer may exist.",
|
|
43
|
+
workerFeatureReview: "Review worker feature status and checkpoints (agent-worker). Use to see where a feature line stands.",
|
|
44
|
+
workerFeatureDoctor: "Diagnose worker feature health (agent-worker). Use when a feature line looks stuck or inconsistent.",
|
|
45
|
+
workerTaskValidate: "Validate a worker task spec (agent-worker). Use before queuing or when a task looks malformed.",
|
|
46
|
+
workerBatchPlanReady: "Show which batch tasks are ready to run (agent-worker). Use for queue triage before workerBatchRunReady.",
|
|
47
|
+
workerReportMorning: "Morning report for overnight worker activity (agent-worker). Use at the start of a session to catch overnight failures.",
|
|
48
|
+
workerReportMetrics: "Worker throughput and failure metrics (agent-worker). Use for quantitative worker questions.",
|
|
49
|
+
workerAdmissionShow: "Show night admission queue state (agent-worker). Use before night-scheduler mutations.",
|
|
50
|
+
workerSchedulerList: "List night-scheduler schedules (agent-worker). Use to discover schedule ids.",
|
|
51
|
+
workerSchedulerStatus: "Night-scheduler status overview (agent-worker). Use to check whether overnight jobs are healthy.",
|
|
52
|
+
workerSchedulerLedger: "Night-scheduler harvest ledger (agent-worker). Use to audit what overnight runs produced.",
|
|
53
|
+
workerSchedulerDoctor: "Diagnose night-scheduler health (agent-worker). Use when overnight jobs fail to fire or harvest.",
|
|
54
|
+
};
|
|
23
55
|
const officialAction = (action, cli, kind, coverage) => ({
|
|
24
56
|
action,
|
|
25
57
|
cli,
|
|
@@ -38,7 +70,8 @@ const officialAction = (action, cli, kind, coverage) => ({
|
|
|
38
70
|
"TRANSACTION_INCOMPLETE",
|
|
39
71
|
"NOT_FOUND",
|
|
40
72
|
],
|
|
41
|
-
description:
|
|
73
|
+
description: OFFICIAL_ACTION_DESCRIPTIONS[action] ??
|
|
74
|
+
`Official CLI action coverage for ${cli}.`,
|
|
42
75
|
inputParams: [
|
|
43
76
|
{
|
|
44
77
|
name: "args",
|
|
@@ -63,8 +96,6 @@ const officialAction = (action, cli, kind, coverage) => ({
|
|
|
63
96
|
});
|
|
64
97
|
const OFFICIAL_ACTIONS = [
|
|
65
98
|
...[
|
|
66
|
-
["dagDoctor", "loop-agent dag doctor", "read", "model-callable"],
|
|
67
|
-
["dagStatus", "loop-agent dag status", "read", "model-callable"],
|
|
68
99
|
[
|
|
69
100
|
"dagDecisionInspect",
|
|
70
101
|
"loop-agent dag decision inspect",
|
|
@@ -160,8 +191,8 @@ const OFFICIAL_ACTIONS = [
|
|
|
160
191
|
[
|
|
161
192
|
"knowledgeCurate",
|
|
162
193
|
"loop-agent knowledge curate",
|
|
163
|
-
"
|
|
164
|
-
"
|
|
194
|
+
"mutation",
|
|
195
|
+
"advanced",
|
|
165
196
|
],
|
|
166
197
|
["knowledgeQuery", "loop-agent knowledge query", "read", "model-callable"],
|
|
167
198
|
[
|
|
@@ -284,7 +315,6 @@ const OFFICIAL_ACTIONS = [
|
|
|
284
315
|
"long-running",
|
|
285
316
|
"advanced",
|
|
286
317
|
],
|
|
287
|
-
["workerPoolDoctor", "agent-worker pool doctor", "read", "model-callable"],
|
|
288
318
|
[
|
|
289
319
|
"workerPoolMarkFailed",
|
|
290
320
|
"agent-worker pool mark-failed",
|
|
@@ -337,6 +367,12 @@ const OFFICIAL_ACTIONS = [
|
|
|
337
367
|
],
|
|
338
368
|
],
|
|
339
369
|
].map(([action, cli, kind, coverage]) => officialAction(action, cli, kind, coverage));
|
|
370
|
+
/**
|
|
371
|
+
* Action ids produced by the officialAction() factory (the generic CLI
|
|
372
|
+
* coverage tail). Derived from the same tuple table so dispatcher / gate
|
|
373
|
+
* checks do not string-match descriptions.
|
|
374
|
+
*/
|
|
375
|
+
export const OFFICIAL_TAIL_ACTION_IDS = new Set(OFFICIAL_ACTIONS.map((entry) => entry.action));
|
|
340
376
|
/** Shared constants so dag + dagSpecVersions cannot diverge. */
|
|
341
377
|
const DAG_SPEC_SUPPORTED_PARSE = [1, 2, 3, 4];
|
|
342
378
|
const DAG_SPEC_NEW_WRITER_DEFAULT = 4;
|
|
@@ -612,7 +648,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
612
648
|
resultSchemaVersion: 1,
|
|
613
649
|
envelopeSchemaVersion: 1,
|
|
614
650
|
requiredErrorCodes: [...COMMON_MUTATION_ERRORS],
|
|
615
|
-
description: "Create
|
|
651
|
+
description: "Create a new task (lifecycle entry). Prefer taskAdvance for the standard flow (PRD import, taskKind, boundaries, DAG generation); newTask only bootstraps a task id + title.",
|
|
616
652
|
inputParams: [
|
|
617
653
|
{
|
|
618
654
|
name: "taskId",
|
|
@@ -688,7 +724,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
688
724
|
resultSchemaVersion: 1,
|
|
689
725
|
envelopeSchemaVersion: 1,
|
|
690
726
|
requiredErrorCodes: ["NOT_FOUND", "INVALID_INPUT"],
|
|
691
|
-
description: "Read source instruction contract
|
|
727
|
+
description: "Read the task's source instruction contract (需求.md/执行约束.md projection: requirements, constraints, allowed/forbidden paths). Use before drafting or revising a contract to stay aligned with the source.",
|
|
692
728
|
inputParams: [
|
|
693
729
|
{
|
|
694
730
|
name: "taskId",
|
|
@@ -838,8 +874,33 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
838
874
|
resultSchemaVersion: 1,
|
|
839
875
|
envelopeSchemaVersion: 1,
|
|
840
876
|
requiredErrorCodes: ["INVALID_INPUT"],
|
|
841
|
-
description: "Build Observe deep link from stable object identity.",
|
|
842
|
-
inputParams: [
|
|
877
|
+
description: "Build Observe deep link from stable object identity. Pass exactly one of dagRunId (preferred), taskId (resolves to latest run), featureId, or workerRunId; omit all for the Console home link.",
|
|
878
|
+
inputParams: [
|
|
879
|
+
{
|
|
880
|
+
name: "dagRunId",
|
|
881
|
+
type: "string",
|
|
882
|
+
required: false,
|
|
883
|
+
description: "dag run id; deep-links to #/dag/<runId> (preferred when known)",
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: "taskId",
|
|
887
|
+
type: "string",
|
|
888
|
+
required: false,
|
|
889
|
+
description: "task id; resolves to the latest dag run when one exists, else #/task/<taskId>",
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: "featureId",
|
|
893
|
+
type: "string",
|
|
894
|
+
required: false,
|
|
895
|
+
description: "feature line id; deep-links to the feature view",
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
name: "workerRunId",
|
|
899
|
+
type: "string",
|
|
900
|
+
required: false,
|
|
901
|
+
description: "worker run id; deep-links to the worker run view",
|
|
902
|
+
},
|
|
903
|
+
],
|
|
843
904
|
modelCallable: "always",
|
|
844
905
|
humanConfirmation: "none",
|
|
845
906
|
},
|
|
@@ -851,7 +912,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
851
912
|
resultSchemaVersion: 1,
|
|
852
913
|
envelopeSchemaVersion: 1,
|
|
853
914
|
requiredErrorCodes: ["INVALID_INPUT"],
|
|
854
|
-
description: "
|
|
915
|
+
description: "Preflight a repository for loop-agent: checks harness presence, task-pool layout, and reports what the Console can operate on. Use at session start on an unfamiliar repo, before init/upgrade decisions.",
|
|
855
916
|
inputParams: [],
|
|
856
917
|
modelCallable: "always",
|
|
857
918
|
humanConfirmation: "none",
|
|
@@ -910,7 +971,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
910
971
|
resultSchemaVersion: 1,
|
|
911
972
|
envelopeSchemaVersion: 1,
|
|
912
973
|
requiredErrorCodes: ["NOT_FOUND", "INVALID_INPUT"],
|
|
913
|
-
description: "
|
|
974
|
+
description: "Read one task's lifecycle status: state, blockers, gates, contract revision, run associations. Use for task-level questions; use dagStatus for a specific DAG run's live node/liveness.",
|
|
914
975
|
inputParams: [
|
|
915
976
|
{
|
|
916
977
|
name: "taskId",
|
|
@@ -930,7 +991,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
930
991
|
resultSchemaVersion: 1,
|
|
931
992
|
envelopeSchemaVersion: 1,
|
|
932
993
|
requiredErrorCodes: ["NOT_FOUND", "INVALID_INPUT"],
|
|
933
|
-
description: "
|
|
994
|
+
description: "Audit a task's minimal spec spine: source docs, path ownership, requirement ids, final verification coverage. Use before closing out a task to confirm every AC is verified.",
|
|
934
995
|
inputParams: [
|
|
935
996
|
{
|
|
936
997
|
name: "taskId",
|
|
@@ -1023,7 +1084,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1023
1084
|
"EXTERNALLY_MODIFIED",
|
|
1024
1085
|
"INVALID_INPUT",
|
|
1025
1086
|
],
|
|
1026
|
-
description: "Generate + strict-validate DAG via task advance
|
|
1087
|
+
description: "Generate + strict-validate a task's DAG (via task advance, stops at the writeSet gate). Legacy entry; the standard flow is taskAdvance then prepareDagExecution + runDag.",
|
|
1027
1088
|
inputParams: [
|
|
1028
1089
|
{
|
|
1029
1090
|
name: "taskId",
|
|
@@ -1079,7 +1140,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1079
1140
|
"CONTROLLER_MISMATCH",
|
|
1080
1141
|
"INVALID_INPUT",
|
|
1081
1142
|
],
|
|
1082
|
-
description: "Consume a single-use
|
|
1143
|
+
description: "Consume a single-use executionId from prepareDagExecution and execute the reviewed DAG. Do not pass a DAG path and do not bash `task advance --approve-gate`. accepted/queued/running/operationId are NOT completion — supervise via operationGet/status/dagReport/dagDoctor/operationWait.",
|
|
1083
1144
|
inputParams: [
|
|
1084
1145
|
{
|
|
1085
1146
|
name: "executionId",
|
|
@@ -1094,6 +1155,19 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1094
1155
|
modelCallable: "always",
|
|
1095
1156
|
humanConfirmation: "none",
|
|
1096
1157
|
},
|
|
1158
|
+
{
|
|
1159
|
+
action: "dagPromptOverrideConfig",
|
|
1160
|
+
cli: "console dag-prompt-override-config",
|
|
1161
|
+
kind: "read",
|
|
1162
|
+
inputSchemaVersion: 1,
|
|
1163
|
+
resultSchemaVersion: 1,
|
|
1164
|
+
envelopeSchemaVersion: 1,
|
|
1165
|
+
requiredErrorCodes: [],
|
|
1166
|
+
description: "Read-only probe of the experimental prompt-override rerun switch (env-gated, default off). The browser Recovery UI hides the failed-node prompt editor unless this returns enabled=true. Never mutates.",
|
|
1167
|
+
inputParams: [],
|
|
1168
|
+
modelCallable: "always",
|
|
1169
|
+
humanConfirmation: "none",
|
|
1170
|
+
},
|
|
1097
1171
|
{
|
|
1098
1172
|
action: "dagRerunPlan",
|
|
1099
1173
|
cli: "loop-agent dag rerun --run-id <id> --from-node <node> --plan --json",
|
|
@@ -1102,7 +1176,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1102
1176
|
resultSchemaVersion: 1,
|
|
1103
1177
|
envelopeSchemaVersion: 1,
|
|
1104
1178
|
requiredErrorCodes: ["INVALID_INPUT", "NOT_FOUND"],
|
|
1105
|
-
description: "Read-only
|
|
1179
|
+
description: "Read-only check for failed-node recovery; it does not execute. Call after dagReport with primaryFailure.nodeId. eligible=true returns the exact planHash required by dagRerun. eligible=false covers writer/decision/fingerprint, unsafe shell, Worker ownership, or workspace/controller drift: use workerTaskRetry for Worker/Task Pool failures, or standaloneTaskRerun after any required contract adopt for standalone runs. Do not force dagRerun or invent a new task.",
|
|
1106
1180
|
inputParams: [
|
|
1107
1181
|
{
|
|
1108
1182
|
name: "runId",
|
|
@@ -1116,6 +1190,12 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1116
1190
|
required: true,
|
|
1117
1191
|
description: "node id to rerun from (prefer failed/attention node from dagReport primaryFailure.nodeId)",
|
|
1118
1192
|
},
|
|
1193
|
+
{
|
|
1194
|
+
name: "promptOverrides",
|
|
1195
|
+
type: "array",
|
|
1196
|
+
required: false,
|
|
1197
|
+
description: "experimental (switch off by default): [{nodeId, prompt, mode?}] — mode append (recommended) keeps the frozen base prompt and appends the text as a marked addendum block, replace swaps the whole subtask_prompt; only FAILED nodes inside the reset closure are admitted and the planHash binds the composed change",
|
|
1198
|
+
},
|
|
1119
1199
|
],
|
|
1120
1200
|
modelCallable: "always",
|
|
1121
1201
|
humanConfirmation: "none",
|
|
@@ -1132,7 +1212,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1132
1212
|
"BINDING_DRIFT",
|
|
1133
1213
|
"INVALID_INPUT",
|
|
1134
1214
|
],
|
|
1135
|
-
description: "
|
|
1215
|
+
description: "Continue the same DAG from the effective failed node by creating a continuation run. Requires a fresh eligible dagRerunPlan and its exact planHash. Prefer this for provider, network, rate-limit, timeout, and other safe downstream failures. Not a full task regenerate: use standaloneTaskRerun for that. Server rejects stale planHash, binding, or fingerprint drift.",
|
|
1136
1216
|
inputParams: [
|
|
1137
1217
|
{
|
|
1138
1218
|
name: "runId",
|
|
@@ -1158,6 +1238,12 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1158
1238
|
required: true,
|
|
1159
1239
|
description: "why continue from this node (e.g. provider flake; resume from review-pi)",
|
|
1160
1240
|
},
|
|
1241
|
+
{
|
|
1242
|
+
name: "promptOverrides",
|
|
1243
|
+
type: "array",
|
|
1244
|
+
required: false,
|
|
1245
|
+
description: "experimental (switch off by default): must match the dagRerunPlan promptOverrides exactly (same mode/text); the planHash already binds them, any drift is rejected",
|
|
1246
|
+
},
|
|
1161
1247
|
],
|
|
1162
1248
|
// always: fresh eligible dagRerun plans are model-callable (2026-08-11).
|
|
1163
1249
|
// The CLI keeps enforcing parent lifecycle, fromNode, planHash,
|
|
@@ -1498,7 +1584,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1498
1584
|
"INVALID_INPUT",
|
|
1499
1585
|
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1500
1586
|
],
|
|
1501
|
-
description: "
|
|
1587
|
+
description: "Regenerate the whole standalone DAG from the CURRENT contract, then validate and execute a new run with parent lineage and the latest unresolved verify/review feedback when available. This is NOT continue-from-failed-node (use dagRerun for that). Server rejects the call when dagRerunPlan is eligible, primaryRecovery.humanRequired=true, or run facts do not recommend rerun-task. Feedback is recovery context, not a contract rewrite; adopt required contract changes before calling or the new DAG repeats the same failure.",
|
|
1502
1588
|
inputParams: [
|
|
1503
1589
|
{
|
|
1504
1590
|
name: "runId",
|
|
@@ -1542,7 +1628,7 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1542
1628
|
"INVALID_INPUT",
|
|
1543
1629
|
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1544
1630
|
],
|
|
1545
|
-
description: "Requeue
|
|
1631
|
+
description: "Requeue a Worker Task Pool task Failed → Ready. Not a DAG node rerun (use dagRerun) and not a standalone DAG regenerate (use standaloneTaskRerun). Confirm with workerPoolDoctor first; server accepts only Failed pool tasks. Pass featureId when known — it must match the pool record.",
|
|
1546
1632
|
inputParams: [
|
|
1547
1633
|
{
|
|
1548
1634
|
name: "taskId",
|
|
@@ -1568,6 +1654,66 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
1568
1654
|
modelCallable: "always",
|
|
1569
1655
|
humanConfirmation: "none",
|
|
1570
1656
|
},
|
|
1657
|
+
{
|
|
1658
|
+
action: "dagDoctor",
|
|
1659
|
+
cli: "loop-agent dag doctor [--run-id <id>] --json",
|
|
1660
|
+
kind: "read",
|
|
1661
|
+
inputSchemaVersion: 1,
|
|
1662
|
+
resultSchemaVersion: 1,
|
|
1663
|
+
envelopeSchemaVersion: 1,
|
|
1664
|
+
requiredErrorCodes: ["NOT_FOUND", "INVALID_INPUT"],
|
|
1665
|
+
description: "Diagnose DAG run health. Omit runId for a repo-wide inventory (active/paused/completed + health issues). Pass runId for one run's liveness, heartbeat, failure node, and recovery hints. Use this to supervise stalls; it does not mutate the run.",
|
|
1666
|
+
inputParams: [
|
|
1667
|
+
{
|
|
1668
|
+
name: "runId",
|
|
1669
|
+
type: "string",
|
|
1670
|
+
required: false,
|
|
1671
|
+
description: "optional dag run id; omit to inventory all runs, pass to diagnose one run",
|
|
1672
|
+
},
|
|
1673
|
+
],
|
|
1674
|
+
modelCallable: "always",
|
|
1675
|
+
humanConfirmation: "none",
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
action: "dagStatus",
|
|
1679
|
+
cli: "loop-agent dag status --run-id <id>",
|
|
1680
|
+
kind: "read",
|
|
1681
|
+
inputSchemaVersion: 1,
|
|
1682
|
+
resultSchemaVersion: 1,
|
|
1683
|
+
envelopeSchemaVersion: 1,
|
|
1684
|
+
requiredErrorCodes: ["NOT_FOUND", "INVALID_INPUT"],
|
|
1685
|
+
description: "Read one DAG run's live status, current node, and liveness. Requires runId. Complements dagReport (terminal handoff) and dagDoctor (health diagnosis). Does not mutate the run.",
|
|
1686
|
+
inputParams: [
|
|
1687
|
+
{
|
|
1688
|
+
name: "runId",
|
|
1689
|
+
type: "string",
|
|
1690
|
+
required: true,
|
|
1691
|
+
description: "dag run id",
|
|
1692
|
+
},
|
|
1693
|
+
],
|
|
1694
|
+
modelCallable: "always",
|
|
1695
|
+
humanConfirmation: "none",
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
action: "workerPoolDoctor",
|
|
1699
|
+
cli: "agent-worker pool doctor --repo . --json",
|
|
1700
|
+
kind: "read",
|
|
1701
|
+
inputSchemaVersion: 1,
|
|
1702
|
+
resultSchemaVersion: 1,
|
|
1703
|
+
envelopeSchemaVersion: 1,
|
|
1704
|
+
requiredErrorCodes: ["INVALID_INPUT", "NOT_FOUND"],
|
|
1705
|
+
description: "Read-only Task Pool inventory (legacy + v2). Use before workerTaskRetry to confirm the task exists and status is Failed. Optional taskId filters the returned inventory to that task.",
|
|
1706
|
+
inputParams: [
|
|
1707
|
+
{
|
|
1708
|
+
name: "taskId",
|
|
1709
|
+
type: "string",
|
|
1710
|
+
required: false,
|
|
1711
|
+
description: "optional task id to focus the inventory",
|
|
1712
|
+
},
|
|
1713
|
+
],
|
|
1714
|
+
modelCallable: "always",
|
|
1715
|
+
humanConfirmation: "none",
|
|
1716
|
+
},
|
|
1571
1717
|
...OFFICIAL_ACTIONS,
|
|
1572
1718
|
];
|
|
1573
1719
|
return {
|
|
@@ -1701,6 +1847,13 @@ export const OPERATOR_COMMAND_COVERAGE = Object.freeze([
|
|
|
1701
1847
|
source: "loop-agent",
|
|
1702
1848
|
exclusionReason: "Not exposed to Operator Chat in M5.",
|
|
1703
1849
|
},
|
|
1850
|
+
{
|
|
1851
|
+
command: "loop-agent init model-catalog",
|
|
1852
|
+
coverage: "excluded",
|
|
1853
|
+
action: null,
|
|
1854
|
+
source: "loop-agent",
|
|
1855
|
+
exclusionReason: "Not exposed to Operator Chat in M5.",
|
|
1856
|
+
},
|
|
1704
1857
|
{
|
|
1705
1858
|
command: "loop-agent init doctor",
|
|
1706
1859
|
coverage: "excluded",
|
|
@@ -1947,12 +2100,12 @@ export const OPERATOR_COMMAND_COVERAGE = Object.freeze([
|
|
|
1947
2100
|
},
|
|
1948
2101
|
{
|
|
1949
2102
|
command: "loop-agent knowledge curate",
|
|
1950
|
-
coverage: "
|
|
2103
|
+
coverage: "advanced",
|
|
1951
2104
|
action: "knowledgeCurate",
|
|
1952
2105
|
source: "loop-agent",
|
|
2106
|
+
note: "Writes knowledge proposals (conditional on --output); not model-callable.",
|
|
1953
2107
|
},
|
|
1954
|
-
{
|
|
1955
|
-
command: "loop-agent knowledge query",
|
|
2108
|
+
{ command: "loop-agent knowledge query",
|
|
1956
2109
|
coverage: "model-callable",
|
|
1957
2110
|
action: "knowledgeQuery",
|
|
1958
2111
|
source: "loop-agent",
|
|
@@ -2527,9 +2680,10 @@ export function assertCoverageManifestConsistent() {
|
|
|
2527
2680
|
capability.humanConfirmation !== "required"))
|
|
2528
2681
|
throw new Error(`invalid required gate classification: ${entry.action}`);
|
|
2529
2682
|
if (entry.coverage === "advanced") {
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2683
|
+
// 2026-08-18: advanced actions are never model-callable (read or
|
|
2684
|
+
// mutation) — see officialModelCallable. UI dispatch stays available.
|
|
2685
|
+
if (capability.modelCallable !== "never") {
|
|
2686
|
+
throw new Error(`invalid advanced classification: ${entry.action} (expected modelCallable=never)`);
|
|
2533
2687
|
}
|
|
2534
2688
|
}
|
|
2535
2689
|
}
|
|
@@ -9,6 +9,7 @@ export const PLAYWRIGHT_CLI_ALLOWED_COMMANDS = [
|
|
|
9
9
|
"goto",
|
|
10
10
|
"snapshot",
|
|
11
11
|
"find",
|
|
12
|
+
"find-unique",
|
|
12
13
|
"click",
|
|
13
14
|
"dblclick",
|
|
14
15
|
"fill",
|
|
@@ -35,6 +36,20 @@ export const PLAYWRIGHT_CLI_ALLOWED_COMMANDS = [
|
|
|
35
36
|
"requests",
|
|
36
37
|
"request",
|
|
37
38
|
];
|
|
39
|
+
/**
|
|
40
|
+
* Parse the match count from a playwright-cli find output. The CLI prints
|
|
41
|
+
* `Found N match(es) for "...":` on success and `No matches found for "...".`
|
|
42
|
+
* on zero — both with exit code 0, so the count is the only assertion signal.
|
|
43
|
+
* Returns undefined when the output shape is unrecognized (e.g. error pages).
|
|
44
|
+
*/
|
|
45
|
+
export function parsePlaywrightCliFindMatchCount(output) {
|
|
46
|
+
const found = /Found\s+(\d+)\s+match(?:es)?\s+for\b/i.exec(output);
|
|
47
|
+
if (found)
|
|
48
|
+
return Number(found[1]);
|
|
49
|
+
if (/No matches found for\b/i.test(output))
|
|
50
|
+
return 0;
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
38
53
|
const allowedCommandSet = new Set(PLAYWRIGHT_CLI_ALLOWED_COMMANDS);
|
|
39
54
|
export function isPlaywrightCliCommand(value) {
|
|
40
55
|
return allowedCommandSet.has(value);
|