@tea-agent/loop-agent 0.1.0-fe-test.4 → 0.1.0-fe-test.6
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 +1 -1
- package/CHANGELOG.md +442 -2524
- package/README.md +19 -12
- package/dist/adapters/loop-agent.js +34 -0
- package/dist/application/dag/args.js +8 -0
- package/dist/application/dag/run-dag.js +5 -0
- package/dist/application/evaluation/budget.js +40 -1
- package/dist/application/evaluation/corpus-hash.js +10 -15
- package/dist/application/evaluation/corpus.js +2 -1
- package/dist/application/evaluation/frontend-browser-acceptance.js +77 -0
- package/dist/application/evaluation/frontend-corpus-browser-acceptance.js +175 -0
- package/dist/application/evaluation/frontend-gateway-evidence.js +226 -0
- package/dist/application/evaluation/frontend-pair-registration.js +143 -0
- package/dist/application/evaluation/frontend-paired-summary.js +150 -0
- package/dist/application/evaluation/frontend-run-observation.js +144 -0
- package/dist/application/evaluation/frontend-shared-evidence.js +105 -0
- package/dist/application/evaluation/types.js +45 -12
- package/dist/application/task-lifecycle/advance.js +64 -15
- package/dist/application/task-lifecycle/observe.js +69 -30
- package/dist/application/task-lifecycle/plan-transitions.js +5 -4
- package/dist/build-stamp.json +3 -3
- package/dist/cli/command-definitions.js +18 -5
- package/dist/cli/program.js +8 -5
- package/dist/cli/update/init-surface-notifier.js +2 -0
- package/dist/cli/update/policy.js +2 -0
- package/dist/commands/client-recovery.js +20 -55
- package/dist/commands/cursor-prompt.js +2 -0
- package/dist/commands/dag-approve.js +2 -0
- package/dist/commands/dag-final-verification.js +2 -0
- package/dist/commands/dag-init-hybrid.js +2 -0
- package/dist/commands/dag-reconcile-tasks.js +2 -0
- package/dist/commands/dag-reject.js +2 -0
- package/dist/commands/dag-report.js +2 -0
- package/dist/commands/dag-rerun.js +2 -0
- package/dist/commands/dag-resume.js +2 -0
- package/dist/commands/dag-workflow-compile.js +2 -0
- package/dist/commands/dag-workflow-plan.js +2 -0
- package/dist/commands/dag-workflow-validate.js +2 -0
- package/dist/commands/delegate.js +2 -0
- package/dist/commands/examples.js +2 -0
- package/dist/commands/import-prd.js +2 -0
- package/dist/commands/init-legacy-audit.js +330 -0
- package/dist/commands/init-model-catalog.js +2 -0
- package/dist/commands/init-upgrade.js +644 -104
- package/dist/commands/init.js +700 -338
- package/dist/commands/instructions.js +2 -0
- package/dist/commands/knowledge.js +2 -0
- package/dist/commands/loop-benchmark.js +2 -0
- package/dist/commands/operator-guide.js +99 -0
- package/dist/commands/operator.js +16 -3
- package/dist/commands/pi-prompt.js +2 -0
- package/dist/commands/pi-reuse-benchmark.js +2 -0
- package/dist/commands/promote-run.js +2 -0
- package/dist/commands/stats.js +1 -1
- package/dist/commands/study-init.js +2 -0
- package/dist/commands/task-advance.js +32 -0
- package/dist/commands/task-source-prepare.js +18 -2
- package/dist/commands/worktree-create.js +2 -0
- package/dist/commands/worktree-remove.js +2 -0
- package/dist/executors/dag-pi/guards.js +4 -0
- package/dist/executors/dag-pi/model-config.js +30 -0
- package/dist/executors/dag-pi/plan/fact-adoption.js +55 -0
- package/dist/executors/dag-pi/plan/facts.js +180 -0
- package/dist/executors/dag-pi/plan/finalize-tools.js +259 -0
- package/dist/executors/dag-pi/plan/ledger-contract.js +55 -0
- package/dist/executors/dag-pi/plan/record-tools.js +861 -0
- package/dist/executors/dag-pi/plan/schema.js +129 -0
- package/dist/executors/dag-pi/plan/tool-helpers.js +16 -0
- package/dist/executors/dag-pi/sessions/index.js +6 -0
- package/dist/executors/dag-pi/sessions/plan-batches.js +280 -0
- package/dist/executors/dag-pi/sessions/plan-prompts.js +367 -0
- package/dist/executors/dag-pi/sessions/scout-parallel.js +197 -0
- package/dist/executors/dag-pi/sessions/segmented-plan.js +1184 -0
- package/dist/executors/dag-pi/sessions/writer-evidence.js +60 -0
- package/dist/executors/dag-pi/tools/contract-tools.js +515 -0
- package/dist/executors/dag-pi/tools/design-terminal-tools.js +159 -0
- package/dist/executors/dag-pi/tools/plan-decision-tools.js +529 -0
- package/dist/executors/dag-pi/tools/review-terminal-tools.js +159 -0
- package/dist/executors/dag-pi/tools/scout-evidence-tools.js +270 -0
- package/dist/executors/dag-pi-executor.js +1517 -3180
- package/dist/executors/pi-executor.js +112 -4
- package/dist/executors/pi-sdk-executor.js +258 -44
- package/dist/executors/pi-writer-tool-policy.js +60 -4
- package/dist/executors/playwright-cli-launcher.js +31 -45
- package/dist/executors/shell-executor.js +358 -48
- package/dist/executors/shell-presets.js +1 -1
- package/dist/executors/shell-verification.js +3 -0
- package/dist/executors/shell-write-guard.js +77 -102
- package/dist/governance/exec-plans.js +16 -4
- package/dist/governance/harness.js +2 -7
- package/dist/governance/manifest-types.js +28 -9
- package/dist/governance/project-capability-scanner.js +263 -0
- package/dist/governance/project-config.js +96 -0
- package/dist/governance/resource-catalog.js +151 -0
- package/dist/infrastructure/console/app-data.js +12 -2
- package/dist/infrastructure/console/operation-store.js +48 -14
- package/dist/infrastructure/evaluation/corpus-store.js +37 -12
- package/dist/shared/artifacts-core.js +2 -0
- package/dist/shared/backend-dogfood-preflight.js +47 -0
- package/dist/shared/dag-failure-category.js +9 -0
- package/dist/shared/file-identity.js +23 -0
- package/dist/shared/frontend-execution-policy.js +23 -0
- package/dist/shared/git-progress.js +2 -0
- package/dist/shared/git-workspace-status.js +482 -0
- package/dist/shared/one-shot-prompt-args.js +2 -0
- package/dist/shared/operator/capabilities.js +185 -0
- package/dist/shared/package-metadata.js +29 -11
- package/dist/shared/path-safety.js +2 -2
- package/dist/shared/pi-context-pressure/extension.js +49 -16
- package/dist/shared/pi-context-pressure/index.js +1 -0
- package/dist/shared/pi-context-pressure/sift-bridge.js +1 -1
- package/dist/shared/pi-context-pressure/telemetry.js +4 -0
- package/dist/shared/pi-context-pressure/tool-result-pruner.js +98 -0
- package/dist/shared/pi-provider-recovery.js +182 -0
- package/dist/shared/pi-retry-settings.js +40 -0
- package/dist/shared/reference-context.js +2 -0
- package/dist/shared/update/npm-client.js +49 -1
- package/dist/shared/wizard-local-telemetry.js +51 -0
- package/dist/task/config-types.js +51 -2
- package/dist/task/contract/apply.js +36 -2
- package/dist/task/contract/project.js +22 -0
- package/dist/task/contract/recover.js +6 -0
- package/dist/task/contract/schema.js +12 -0
- package/dist/task/frontend-preflight.js +1 -1
- package/dist/task/source-prepare/artifact-meta.js +9 -2
- package/dist/task/source-prepare/build-draft.js +61 -0
- package/dist/task/source-prepare/fragment-inventory.js +4 -1
- package/dist/task/source-prepare/ledger-reconciliation.js +2 -2
- package/dist/task/source-prepare/ledger-review.js +6 -9
- package/dist/task/source-prepare/parse-intent.js +165 -14
- package/dist/task/source-prepare/path-policy.js +17 -7
- package/dist/task/source-prepare/prepare.js +6 -1
- package/dist/task/source-prepare/semantic-intake.js +33 -28
- package/dist/task/source-prepare/source-execution.js +65 -0
- package/dist/task/source-prepare/source-fidelity-pi.js +49 -17
- package/dist/task/source-prepare/source-provider-budget.js +290 -0
- package/dist/task/source-references.js +48 -23
- package/dist/task/task-demand-routing.js +5 -2
- package/dist/worker/cli.js +3 -5
- package/dist/worker/console/chat/assistant-content.js +5 -13
- package/dist/worker/console/chat/browser-automation.js +937 -0
- package/dist/worker/console/chat/browser-content.js +74 -0
- package/dist/worker/console/chat/browser-diagnostics.js +250 -0
- package/dist/worker/console/chat/browser-evaluation.js +58 -0
- package/dist/worker/console/chat/browser-operation-queue.js +19 -0
- package/dist/worker/console/chat/browser-pick.js +113 -0
- package/dist/worker/console/chat/browser-policy.js +113 -0
- package/dist/worker/console/chat/browser-routes.js +329 -0
- package/dist/worker/console/chat/browser-screenshot-result.js +47 -0
- package/dist/worker/console/chat/browser-storage.js +89 -0
- package/dist/worker/console/chat/chat-event-store.js +73 -18
- package/dist/worker/console/chat/context-insights.js +788 -0
- package/dist/worker/console/chat/conversation-nodes.js +383 -0
- package/dist/worker/console/chat/db-connections.js +854 -0
- package/dist/worker/console/chat/explore-tools.js +18 -2
- package/dist/worker/console/chat/pet/pet-affinity.js +169 -0
- package/dist/worker/console/chat/pet/pet-persist.js +109 -0
- package/dist/worker/console/chat/pet/pet-registry.js +142 -0
- package/dist/worker/console/chat/pet/pet-remarks.js +48 -0
- package/dist/worker/console/chat/pet/pet-routes.js +125 -0
- package/dist/worker/console/chat/pet/pet-service.js +262 -0
- package/dist/worker/console/chat/pet/pet-state.js +99 -0
- package/dist/worker/console/chat/pi-mode-loop-isolation.js +170 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/ask-user-question.js +44 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/browser-tools.js +135 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/explore-tools.js +202 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/goal-tools.js +79 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/operator-tools.js +94 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/scheduled-goal-tools.js +22 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/sql-tools.js +670 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/todo-write.js +38 -0
- package/dist/worker/console/chat/pi-runtime/inspection-types.js +28 -0
- package/dist/worker/console/chat/pi-runtime/inspection.js +439 -0
- package/dist/worker/console/chat/pi-runtime/progressive-tools.js +195 -0
- package/dist/worker/console/chat/pi-runtime/sdk-bindings.js +153 -0
- package/dist/worker/console/chat/pi-runtime/sdk-session.js +5 -0
- package/dist/worker/console/chat/pi-runtime.js +793 -1230
- package/dist/worker/console/chat/provider-error.js +0 -12
- package/dist/worker/console/chat/repo-browser.js +132 -6
- package/dist/worker/console/chat/repo-preview-kind.js +155 -0
- package/dist/worker/console/chat/resource-loader.js +4 -1
- package/dist/worker/console/chat/routes.js +861 -148
- package/dist/worker/console/chat/scheduled-goal-booking.js +59 -0
- package/dist/worker/console/chat/scheduled-goal-delivery.js +27 -0
- package/dist/worker/console/chat/scheduled-goal-request.js +198 -0
- package/dist/worker/console/chat/scm-routes.js +217 -0
- package/dist/worker/console/chat/scm-service.js +283 -0
- package/dist/worker/console/chat/scm-tools.js +111 -0
- package/dist/worker/console/chat/sdd-data-alignment.js +85 -41
- package/dist/worker/console/chat/session-catalog.js +32 -0
- package/dist/worker/console/chat/session-mode-view.js +49 -0
- package/dist/worker/console/chat/session-mode.js +224 -0
- package/dist/worker/console/chat/session-store.js +232 -32
- package/dist/worker/console/chat/shortcuts.js +13 -0
- package/dist/worker/console/chat/subagents/agent-tool.js +62 -0
- package/dist/worker/console/chat/subagents/explore-agent.js +169 -0
- package/dist/worker/console/chat/subagents/index.js +5 -0
- package/dist/worker/console/chat/subagents/orchestrator.js +273 -0
- package/dist/worker/console/chat/subagents/tool-policy.js +53 -0
- package/dist/worker/console/chat/subagents/types.js +13 -0
- package/dist/worker/console/chat/terminal-routes.js +216 -0
- package/dist/worker/console/chat/terminal-sessions.js +348 -0
- package/dist/worker/console/chat/terminal-tools.js +211 -0
- package/dist/worker/console/chat/timeline-message-order.js +22 -0
- package/dist/worker/console/chat/tool-preview.js +136 -0
- package/dist/worker/console/chat/tools.js +69 -1
- package/dist/worker/console/chat/turn-order.js +13 -0
- package/dist/worker/console/chat/turn-process.js +210 -36
- package/dist/worker/console/chat/user-turn-outline.js +19 -0
- package/dist/worker/console/console-shutdown.js +34 -0
- package/dist/worker/console/console-update-and-init.js +1 -19
- package/dist/worker/console/console-update-runtime.js +7 -22
- package/dist/worker/console/dag-confirmation.js +3 -0
- package/dist/worker/console/dag-execution-receipt.js +3 -0
- package/dist/worker/console/interview/tools.js +1 -0
- package/dist/worker/console/operator-actions.js +95 -4
- package/dist/worker/console/operator-user-error.js +28 -1
- package/dist/worker/console/pi-readiness.js +4 -4
- package/dist/worker/console/prd-intake-bridge.js +47 -1
- package/dist/worker/console/recovery-cta.js +14 -14
- package/dist/worker/console/routes.js +13 -0
- package/dist/worker/console/scheduled-goal-host.js +98 -0
- package/dist/worker/console/scheduled-goal-operation-adapter.js +127 -0
- package/dist/worker/console/server.js +33 -31
- package/dist/worker/console/static/app-icon.svg +39 -0
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-BZogYNl1.js → abnfDiagram-N423BO3Z-DASc69AM.js} +1 -1
- package/dist/worker/console/static/assets/{arc-DcJTLe2v.js → arc-h09p-LAc.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-B39EQQ9n.js → architectureDiagram-T3A2C74G-CZ3dtLkh.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-CitCGV56.js → blockDiagram-VBNYF7ZC-DMrRhMXG.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-rvWuOHLG.js → c4Diagram-5PPSVZJV-DQxisHV6.js} +1 -1
- package/dist/worker/console/static/assets/channel-D1zgKZfg.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-DGXplIJs.js → chunk-2GRJ4B5K-CefVN9zh.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-ur9OqjPn.js → chunk-2Q5K7J3B-DmR1Koq2.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-D1KqU_Vi.js → chunk-5RXB4S5H-NlzrSW7L.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-BlVZrbtM.js → chunk-5VM5RSS4-DfelJv-0.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-BAzz3nQy.js → chunk-6Q2QTUOP-BK6RFy58.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-CP_nYuCV.js → chunk-GF5L2VYU-BAeh9lz4.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-CWvKQ80X.js → chunk-JWPE2WC7-ChPS5WzG.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-CyUki8wp.js → chunk-KBJHAD2P-BoVe5IM6.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-5NYzNKfY.js → chunk-RYQCIY6F-C4q_0Lw9.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DHdUgjS-.js → chunk-XXDRQBXY-Bb9TvjeY.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-CXNNsY2M.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-CXNNsY2M.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-ANQ5g_t6.js → cose-bilkent-JH36ORCC-DmNnL8Ff.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-CruT_4-0.js → cynefin-VYW2F7L2-Contvx58.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-rbFo77ID.js → cynefinDiagram-MW4NZA55-Cigq7cjk.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-asstxBQs.js → dagre-VZM6K2ZE-dEbC0nxb.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-DzTyBZwI.js → diagram-7IWD3JNH-CzIztESV.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-gw8ccH3B.js → diagram-B4RE2ZJO-Bo14zbaY.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-B8RpZzOf.js → diagram-LBJQPF4R-C4xUyil6.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-B1zJkCS9.js → diagram-Q27KOJAE-CaBY_uYa.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-B6JLWZmO.js → diagram-UB23O5K3-ClUXUeiu.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-q2iZP-Ps.js → ebnfDiagram-BXEA7PRR-BbGCgjC6.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-B3dbbktQ.js → erDiagram-JOGREHBK-Dr-AcwSl.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-C-zc6-kB.js → flowDiagram-UKHOOZJN-BG8Gcfyc.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-BSolnot9.js → ganttDiagram-PKOTCBZU-CFVaPs5r.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-Bo8jGxTk.js → gitGraphDiagram-DS77QQ5N-ChJ8pm-O.js} +1 -1
- package/dist/worker/console/static/assets/index-B_5GhVIO.js +488 -0
- package/dist/worker/console/static/assets/index-C7YMBluX.css +1 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-DQaZqJOH.js → infoDiagram-6WML65LV-C5J9-uCZ.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-DsdX1WnE.js → ishikawaDiagram-WSZJBQD7-BcfjqzDv.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-CP5EYDZL.js → journeyDiagram-NVQOT4AX-BzzCO-rD.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-DAm14Dr8.js → kanban-definition-27J2QSJJ-NCHUZ46h.js} +1 -1
- package/dist/worker/console/static/assets/{linear-gZECoLc5.js → linear-BKZlWCUU.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-BRJNIM6p.js → mermaid.core-DbTaQjFE.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-Cja3kLkR.js → mindmap-definition-FAOFIHXS-CroYl5xQ.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-22ZGFisL.js → pegDiagram-VL7TDLO6-DgMBx-9k.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-BXin0Y1o.js → pieDiagram-7S7Q4E2Y-CyWDmbq1.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-Cw6T69Yt.js → quadrantDiagram-CIZ2JOQS-BgGEOqSP.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-C1-gTieN.js → railroadDiagram-AXF67PYL-BMZ7oeeV.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP--H5N2iI1.js → requirementDiagram-LRYGKXZP-DxqyGhcc.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-CgWAPeRz.js → sankeyDiagram-W5VNT64P-DnSvNCG8.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-CrKqzGvt.js → sequenceDiagram-SI44F4Z6-BiZh6f-R.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-BB3wG06K.js → sizeCapture-X5ZJPWSS-BKXSI8WB.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-DjsGgdgY.js → stateDiagram-OKZ733FA-CfSgoYFm.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DgHi3vjb.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-DYKEbvAR.js → swimlanes-SLNWSIFB-CyGADcHe.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-Bgvdt1Y0.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-eQOb5k9Y.js → timeline-definition-Z64GVDOM-HmPaSPOK.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-B2-l9FIu.js → vennDiagram-T6HMQDX7-VA2VBbez.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-BX2Cda3l.js → wardleyDiagram-T6FBY63Y-BxjiBPZa.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-D9S892ph.js → xychartDiagram-ELKLHX3M--hUY-qFj.js} +1 -1
- package/dist/worker/console/static/index.html +5 -2
- package/dist/worker/console/static/manifest.webmanifest +19 -0
- package/dist/worker/console/static/pets/ember/pet.json +167 -0
- package/dist/worker/console/static/pets/ember/spritesheet.png +0 -0
- package/dist/worker/console/static-src/app/console-types.js +9 -1
- package/dist/worker/console/static-src/chat-view-types.js +1 -1
- package/dist/worker/console/static-src/operator-chat/active-turn-tail.js +10 -0
- package/dist/worker/console/static-src/operator-chat/animation-frame-batcher.js +38 -0
- package/dist/worker/console/static-src/operator-chat/chat-link.js +114 -0
- package/dist/worker/console/static-src/operator-chat/chat-scroll-position.js +24 -0
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +360 -14
- package/dist/worker/console/static-src/operator-chat/chat-stream-continuity.js +101 -0
- package/dist/worker/console/static-src/operator-chat/compaction-message.js +10 -2
- package/dist/worker/console/static-src/operator-chat/composer-session-ledger.js +192 -0
- package/dist/worker/console/static-src/operator-chat/context-insights-store.js +64 -0
- package/dist/worker/console/static-src/operator-chat/details-rail-surfaces.js +99 -0
- package/dist/worker/console/static-src/operator-chat/file-palette-nav.js +81 -0
- package/dist/worker/console/static-src/operator-chat/open-preview-in-browser.js +57 -9
- package/dist/worker/console/static-src/operator-chat/pending-user-message.js +66 -0
- package/dist/worker/console/static-src/operator-chat/process-label.js +63 -0
- package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +15 -5
- package/dist/worker/console/static-src/operator-chat/timeline-merge.js +29 -0
- package/dist/worker/console/static-src/operator-chat/tools-catalog.js +36 -8
- package/dist/worker/console/static-src/operator-chat/transcript-mode.js +21 -0
- package/dist/worker/console/static-src/operator-chat/turn-group-equality.js +16 -0
- package/dist/worker/console/static-src/operator-chat/turn-process-disclosure.js +18 -0
- package/dist/worker/console/static-src/operator-chat/turn-state-projection.js +166 -0
- package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +58 -2
- package/dist/worker/console/static-src/operator-chat/use-searchable-hidden.js +51 -0
- package/dist/worker/console/static-src/operator-chat/use-stat-dialog.js +95 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +338 -93
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +310 -106
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +179 -75
- package/dist/worker/console/static-src/operator-chat/useComposer.js +281 -79
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +21 -3
- package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +36 -17
- package/dist/worker/console/static-src/operator-chat/useRuntimeSnapshot.js +18 -0
- package/dist/worker/console/static-src/operator-chat/useWorkspaceBrowserGate.js +4 -0
- package/dist/worker/console/static-src/operator-chat/user-turn-anchor-equality.js +21 -0
- package/dist/worker/console/static-src/prd-file-import.js +3 -1
- package/dist/worker/console/static-src/shell/console-update-reload.js +1 -1
- package/dist/worker/console/workspace-context.js +54 -1
- package/dist/worker/console/workspace-initialization.js +218 -0
- package/dist/worker/delivery/git-transaction.js +2 -0
- package/dist/worker/delivery/package.js +4 -1
- package/dist/worker/feature/fullstack-validate.js +2 -0
- package/dist/worker/loop-agent/loop-agent-client.js +8 -2
- package/dist/worker/materialize/harness-task-lineage.js +4 -2
- package/dist/worker/materialize/harness-task-materializer.js +4 -1
- package/dist/worker/metrics/projector.js +1 -1
- package/dist/worker/observability/event-store.js +4 -1
- package/dist/worker/observability/read-model.js +27 -3
- package/dist/worker/observe/node-context-insights.js +479 -0
- package/dist/worker/observe/node-transparency.js +103 -72
- package/dist/worker/observe/routes.js +24 -1
- package/dist/worker/observe/static/console-theme.css +178 -0
- package/dist/worker/observe/static/console-theme.js +74 -0
- package/dist/worker/observe/static/dag-inspector-humanize.js +3 -0
- package/dist/worker/observe/static/dom.js +20 -1
- package/dist/worker/observe/static/format-pool.d.ts +2 -0
- package/dist/worker/observe/static/format-pool.js +6 -0
- package/dist/worker/observe/static/format.js +7 -0
- package/dist/worker/observe/static/inspect-workspace.js +34 -7
- package/dist/worker/observe/static/inspector-submission.js +32 -0
- package/dist/worker/observe/static/kpi.js +1 -0
- package/dist/worker/observe/static/operator-chrome.css +85 -0
- package/dist/worker/observe/static/operator-chrome.js +13 -1
- package/dist/worker/observe/static/relations.js +2 -0
- package/dist/worker/observe/static/router.js +13 -0
- package/dist/worker/observe/static/run-processing.js +2 -0
- package/dist/worker/observe/static/shell-chrome.js +36 -3
- package/dist/worker/observe/static/state.js +35 -2
- package/dist/worker/observe/static/styles.css +263 -39
- package/dist/worker/observe/static/task-failure-labels.d.ts +4 -0
- package/dist/worker/observe/static/task-failure-labels.js +67 -0
- package/dist/worker/observe/static/task-history.js +12 -0
- package/dist/worker/observe/static/views/batch.js +6 -13
- package/dist/worker/observe/static/views/dag-graph.js +50 -3
- package/dist/worker/observe/static/views/dag-inspector.js +742 -268
- package/dist/worker/observe/static/views/dag-trajectory.js +3 -0
- package/dist/worker/observe/static/views/dag.d.ts +6 -0
- package/dist/worker/observe/static/views/dag.js +49 -11
- package/dist/worker/observe/static/views/dags.js +2 -0
- package/dist/worker/observe/static/views/dashboard.js +21 -12
- package/dist/worker/observe/static/views/failures.js +21 -11
- package/dist/worker/observe/static/views/feature.js +11 -29
- package/dist/worker/observe/static/views/pool.js +37 -28
- package/dist/worker/observe/static/views/run.js +48 -5
- package/dist/worker/observe/static/views/session-timeline.js +189 -240
- package/dist/worker/observe/static/views/task.js +81 -62
- package/dist/worker/outcomes/declared-artifacts.js +2 -0
- package/dist/worker/preflight.js +3 -0
- package/dist/worker/scheduler/scheduled-goal-dispatch.js +118 -0
- package/dist/worker/scheduler/scheduled-goal-evidence.js +230 -0
- package/dist/worker/scheduler/scheduled-goal-recovery.js +62 -0
- package/dist/worker/scheduler/scheduled-goal-store.js +709 -0
- package/dist/worker/scheduler/scheduled-goal-supervisor.js +132 -0
- package/dist/worker/scheduler/scheduled-goal-time.js +102 -0
- package/dist/worker/scheduler/scheduled-goal-types.js +95 -0
- package/dist/worker/task-spec/validate.js +4 -1
- package/dist/workflows/dag/backend-test-case-coverage-analysis.js +3 -1
- package/dist/workflows/dag/backend-test-layout.js +27 -7
- package/dist/workflows/dag/backend-test-markdown-workflow.js +9 -25
- package/dist/workflows/dag/backend-test-plan-protocol.js +82 -5
- package/dist/workflows/dag/backend-test-pytest-collection.js +4 -1
- package/dist/workflows/dag/budget-enforcement.js +82 -3
- package/dist/workflows/dag/checkpoint.js +686 -0
- package/dist/workflows/dag/dag-retry-schema.js +14 -0
- package/dist/workflows/dag/decision-envelope.js +2 -0
- package/dist/workflows/dag/dynamic-runtime/map.js +15 -2
- package/dist/workflows/dag/dynamic-runtime/shared.js +2 -2
- package/dist/workflows/dag/final-verification.js +45 -10
- package/dist/workflows/dag/frontend-capacity.js +9 -0
- package/dist/workflows/dag/frontend-closeout.js +5 -1
- package/dist/workflows/dag/frontend-committed-facts.js +461 -0
- package/dist/workflows/dag/frontend-contract-facts.js +133 -0
- package/dist/workflows/dag/frontend-design-policy.js +107 -21
- package/dist/workflows/dag/frontend-durable-tools.js +225 -0
- package/dist/workflows/dag/frontend-execution-groups.js +24 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +554 -26
- package/dist/workflows/dag/frontend-input-projection.js +76 -0
- package/dist/workflows/dag/frontend-plan-canary.js +103 -0
- package/dist/workflows/dag/frontend-plan-decision-contract.js +795 -0
- package/dist/workflows/dag/frontend-plan-progress.js +92 -0
- package/dist/workflows/dag/frontend-plan-recovery-policy.js +18 -0
- package/dist/workflows/dag/frontend-plan-render.js +21 -5
- package/dist/workflows/dag/frontend-provider-capability-matrix.js +8 -61
- package/dist/workflows/dag/frontend-recovery-controller.js +7 -7
- package/dist/workflows/dag/frontend-recovery-lineage.js +13 -0
- package/dist/workflows/dag/frontend-recovery-plan.js +10 -5
- package/dist/workflows/dag/frontend-recovery-run.js +148 -47
- package/dist/workflows/dag/frontend-repair-assertions.js +36 -0
- package/dist/workflows/dag/frontend-repair.js +79 -76
- package/dist/workflows/dag/frontend-review-context.js +71 -69
- package/dist/workflows/dag/frontend-review-scopes.js +237 -0
- package/dist/workflows/dag/frontend-risk.js +101 -12
- package/dist/workflows/dag/frontend-root-observation.js +261 -0
- package/dist/workflows/dag/frontend-session-budget.js +376 -0
- package/dist/workflows/dag/frontend-session-context.js +10 -0
- package/dist/workflows/dag/frontend-shape-facts.js +12 -2
- package/dist/workflows/dag/frontend-shape.js +27 -32
- package/dist/workflows/dag/frontend-test-case-checklist.js +14 -3
- package/dist/workflows/dag/frontend-test-case-generation-assessment.js +88 -0
- package/dist/workflows/dag/frontend-test-case-manifest.js +6 -1
- package/dist/workflows/dag/frontend-test-case-quality.js +3 -3
- package/dist/workflows/dag/frontend-test-environment-probe.js +0 -2
- package/dist/workflows/dag/frontend-test-execution-evidence.js +328 -0
- package/dist/workflows/dag/frontend-test-framework-adapters.js +309 -0
- package/dist/workflows/dag/frontend-test-layout.js +41 -12
- package/dist/workflows/dag/frontend-test-result-contract.js +15 -1
- package/dist/workflows/dag/frontend-typed-event-store.js +57 -26
- package/dist/workflows/dag/frontend-verification-trace.js +65 -48
- package/dist/workflows/dag/frontend-writer-admission.js +6 -48
- package/dist/workflows/dag/frontend-writer-status.js +0 -23
- package/dist/workflows/dag/hybrid/sources.js +1831 -0
- package/dist/workflows/dag/hybrid/templates/backend-test.js +1822 -0
- package/dist/workflows/dag/hybrid/templates/frontend-test.js +807 -0
- package/dist/workflows/dag/hybrid/templates/frontend.js +1529 -0
- package/dist/workflows/dag/hybrid/templates/index.js +8 -0
- package/dist/workflows/dag/hybrid/templates/kg-bootstrap.js +449 -0
- package/dist/workflows/dag/hybrid/templates/knowledge-sync.js +495 -0
- package/dist/workflows/dag/hybrid/templates/shared.js +101 -0
- package/dist/workflows/dag/hybrid/templates/standard.js +265 -0
- package/dist/workflows/dag/hybrid/types.js +32 -0
- package/dist/workflows/dag/init-hybrid.js +57 -7077
- package/dist/workflows/dag/interrupt-request.js +2 -0
- package/dist/workflows/dag/lifecycle.js +11 -2
- package/dist/workflows/dag/node-execution.js +257 -247
- package/dist/workflows/dag/output-protocol.js +1 -0
- package/dist/workflows/dag/prompt.js +4 -0
- package/dist/workflows/dag/reconcile-run.js +2 -0
- package/dist/workflows/dag/repair-artifact.js +3 -1
- package/dist/workflows/dag/report.js +2 -0
- package/dist/workflows/dag/rerun-feedback.js +36 -4
- package/dist/workflows/dag/rerun-plan.js +106 -4
- package/dist/workflows/dag/rerun-run.js +7 -0
- package/dist/workflows/dag/rerun-task.js +75 -1
- package/dist/workflows/dag/retry-policy.js +34 -10
- package/dist/workflows/dag/runner-exit-diagnostics.js +125 -0
- package/dist/workflows/dag/runner.js +38 -1074
- package/dist/workflows/dag/scheduler.js +2 -4
- package/dist/workflows/dag/skill-instructions.js +102 -32
- package/dist/workflows/dag/skill-snapshot.js +3 -0
- package/dist/workflows/dag/skills.js +7 -7
- package/dist/workflows/dag/structured-output-repair.js +4 -1
- package/dist/workflows/dag/terminal-status.js +502 -0
- package/dist/workflows/dag/test-artifact-namespace.js +73 -0
- package/dist/workflows/dag/types.js +79 -7
- package/dist/workflows/dag/validate.js +38 -13
- package/dist/workflows/dag/workspace-checkpoint.js +79 -1
- package/dist/workflows/loop/benchmark.js +11 -8
- package/docs/README.md +2 -1
- package/docs/architecture/dag-execution.md +4 -4
- package/docs/architecture/runtime-boundaries.md +29 -23
- package/docs/governance/README.md +1 -0
- package/docs/governance/harness-methodology-verification.md +11 -0
- package/docs/init-surface.manifest.json +44 -295
- package/docs/operations/README.md +4 -0
- package/docs/templates/README.md +5 -5
- package/docs/templates/agent-dag.base.json +9 -9
- package/docs/templates/agent-dag.final-verification.json +6 -6
- package/docs/templates/agent-dag.schema.json +2 -2
- package/docs/templates/agent-dag.supervised-implementation.json +12 -12
- package/docs/templates/backend-test-dag.generate-pytest.prompt.md +3 -3
- package/docs/templates/backend-test-dag.json +708 -703
- package/docs/templates/backend-test-dag.review-cases.prompt.md +3 -3
- package/docs/templates/frontend-design-contract.md +4 -4
- package/docs/templates/frontend-implementation-contract.schema.json +99 -22
- package/docs/templates/frontend-implementation-dag.json +7 -7
- package/docs/templates/frontend-test-case-checklist.md +2 -2
- package/docs/templates/frontend-test-case.example.md +2 -0
- package/docs/templates/frontend-test-dag.generate-cases.prompt.md +1 -1
- package/docs/templates/frontend-test-dag.json +48 -39
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +2 -2
- package/docs/templates/frontend-test-dag.retrospect.prompt.md +1 -1
- package/docs/templates/frontend-test-dag.review-cases.prompt.md +1 -1
- package/docs/templates/hybrid-dag.json +9 -9
- package/docs/templates/knowledge-sync-dag.json +8 -8
- package/harness.json +1 -1
- package/package.json +27 -8
- package/resource-catalog.v1.json +1981 -0
- package/resources/agent-bridge/loop-agent/SKILL.md +40 -0
- package/resources/init-history/legacy-surface.v1.json +33 -0
- package/skills/fe-test-ui-scout/SKILL.md +4 -4
- package/skills/fe-test-ui-scout/references/ledger-schema.md +1 -1
- package/skills/frontend-bounded-implement/references/code-standards.md +3 -3
- package/skills/frontend-contract/SKILL.md +2 -1
- package/skills/frontend-contract/references/contract-protocol.md +22 -4
- package/skills/frontend-design-review/SKILL.md +16 -18
- package/skills/frontend-design-review/references/review-checklist.md +3 -4
- package/skills/frontend-plan/SKILL.md +25 -3
- package/skills/frontend-plan/references/decision-contract.md +117 -8
- package/skills/frontend-plan/references/design-decisions.md +32 -0
- package/skills/frontend-review/SKILL.md +29 -36
- package/skills/frontend-review/references/review-findings.md +8 -3
- package/skills/frontend-scout/references/scout-evidence.md +4 -0
- package/skills/init-update/SKILL.md +34 -0
- package/skills/init-update/agents/openai.yaml +6 -0
- package/skills/loop-agent/references/command-reference.md +8 -0
- package/skills/loop-agent/references/hybrid-dag.md +1 -1
- package/skills/playwright-cli/SKILL.md +1 -1
- package/skills/playwright-cli-case-generator/SKILL.md +7 -5
- package/dist/commands/new-task.js +0 -5
- package/dist/commands/status.js +0 -57
- package/dist/commands/task-contract.js +0 -269
- package/dist/shared/prompts.js +0 -26
- package/dist/task/config.js +0 -2
- package/dist/task/contract/validate-draft.js +0 -106
- package/dist/task/goal.js +0 -3
- package/dist/task/index.js +0 -12
- package/dist/task/lifecycle.js +0 -1
- package/dist/task/operator/capabilities.js +0 -6
- package/dist/task/operator/envelope.js +0 -2
- package/dist/task/operator/index.js +0 -5
- package/dist/task/operator/registry.js +0 -2
- package/dist/task/paths.js +0 -1
- package/dist/task/source-state.js +0 -1
- package/dist/task/subagent-guidance.js +0 -1
- package/dist/worker/console/chat/sift-bridge.js +0 -1
- package/dist/worker/console/index.js +0 -20
- package/dist/worker/console/static/assets/channel-CXqdP5pW.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-D9C3agF7.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-D9C3agF7.js +0 -1
- package/dist/worker/console/static/assets/index-CAZ2fC_X.css +0 -1
- package/dist/worker/console/static/assets/index-DhfjOafu.js +0 -449
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Tp7V0U4q.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DUZWZWi8.js +0 -8
- package/dist/worker/scheduler/index.js +0 -25
- package/dist/workflows/dag/facts.js +0 -4
- package/dist/workflows/dag/frontend-shadow-dual-write.js +0 -941
- package/dist/workflows/dag/index.js +0 -6
- package/dist/workflows/dynamic/index.js +0 -7
- /package/dist/{task/operator/types.js → executors/dag-pi/plan/session.js} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
/**
|
|
5
|
+
* Framework adapters decouple the frontend behavior-verification contract from
|
|
6
|
+
* any single test runner.
|
|
7
|
+
*
|
|
8
|
+
* The contract, writer admission and execution all need three things from a
|
|
9
|
+
* frozen verify command:
|
|
10
|
+
* 1. whether the runner can emit a machine-readable execution report at all
|
|
11
|
+
* (capability), so an unsupported runner fails closed *before* implement;
|
|
12
|
+
* 2. how to ask that runner for a report without clobbering the project's
|
|
13
|
+
* own reporter configuration;
|
|
14
|
+
* 3. how to read that report back as uniform file/title/status triples.
|
|
15
|
+
*
|
|
16
|
+
* Historically all three were hardcoded to Vitest (`vitest-json-v1`), while the
|
|
17
|
+
* command classifier was already framework-agnostic. Jest and Playwright
|
|
18
|
+
* commands were therefore classified into the behavior lane correctly and then
|
|
19
|
+
* rejected as "unsupported", surfacing a capability gap to the user as if they
|
|
20
|
+
* had misconfigured their project. Adapters make the two sources of truth agree.
|
|
21
|
+
*/
|
|
22
|
+
/** Report protocols a frozen behavior command may be observed through. */
|
|
23
|
+
export const frontendTestReportSchemeSchema = z.enum([
|
|
24
|
+
"vitest-json-v1",
|
|
25
|
+
"jest-json-v1",
|
|
26
|
+
"playwright-json-v1",
|
|
27
|
+
]);
|
|
28
|
+
/** Runtime guard for a persisted scheme, e.g. read back from a trace artifact. */
|
|
29
|
+
export const isFrontendTestReportScheme = (value) => typeof value === "string" &&
|
|
30
|
+
frontendTestReportSchemeSchema.options.includes(value);
|
|
31
|
+
const asRecord = (value) => typeof value === "object" && value !== null
|
|
32
|
+
? value
|
|
33
|
+
: undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve a runner-relative path into contract workspace coordinates.
|
|
36
|
+
*
|
|
37
|
+
* A runner may report an absolute path (`config.rootDir` is absolute in a
|
|
38
|
+
* Playwright report) or one relative to its own root. Either way the result is
|
|
39
|
+
* expressed against `workspaceRoot`, which is resolved physically first: a
|
|
40
|
+
* workspace reached through a symlink (macOS `/var` -> `/private/var`, i.e. the
|
|
41
|
+
* default `os.tmpdir()`) is never a lexical prefix of the runner's canonical
|
|
42
|
+
* path, so comparing raw strings would yield a `../..` escape instead of a
|
|
43
|
+
* contract-relative file.
|
|
44
|
+
*/
|
|
45
|
+
const toWorkspacePath = (raw, cwd, workspaceRoot) => {
|
|
46
|
+
const absolute = path.resolve(cwd, raw);
|
|
47
|
+
const physical = (target) => {
|
|
48
|
+
try {
|
|
49
|
+
return realpathSync(target);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const root = physical(path.resolve(workspaceRoot));
|
|
56
|
+
// The path may itself sit under the unresolved root; re-anchor it physically
|
|
57
|
+
// by resolving its root-relative tail against the physical root.
|
|
58
|
+
const anchored = absolute.startsWith(path.resolve(workspaceRoot) + path.sep)
|
|
59
|
+
? path.join(root, path.relative(path.resolve(workspaceRoot), absolute))
|
|
60
|
+
: absolute;
|
|
61
|
+
return path.relative(root, physical(anchored)).replace(/\\/g, "/");
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Strip package-manager indirection so `npx vitest run`, `pnpm exec vitest
|
|
65
|
+
* run`, `yarn exec vitest run` and a bare `vitest run` all reduce to the same
|
|
66
|
+
* runner invocation. Returns the remaining words.
|
|
67
|
+
*/
|
|
68
|
+
export function resolveRunnerArgv(argv) {
|
|
69
|
+
const words = [...argv];
|
|
70
|
+
// Skip leading env assignments (`CI=1 vitest run`).
|
|
71
|
+
while (words.length > 0 && /^[A-Za-z_][A-Za-z0-9_]*=/.test(words[0])) {
|
|
72
|
+
words.shift();
|
|
73
|
+
}
|
|
74
|
+
const head = words[0];
|
|
75
|
+
if (head === "npx" || head === "pnpx" || head === "bunx") {
|
|
76
|
+
words.shift();
|
|
77
|
+
// `npx --no-install vitest run` / `npx -y vitest run`
|
|
78
|
+
while (words[0]?.startsWith("-"))
|
|
79
|
+
words.shift();
|
|
80
|
+
return words;
|
|
81
|
+
}
|
|
82
|
+
if ((head === "pnpm" || head === "yarn" || head === "npm") && words[1] === "exec") {
|
|
83
|
+
words.splice(0, 2);
|
|
84
|
+
while (words[0]?.startsWith("-"))
|
|
85
|
+
words.shift();
|
|
86
|
+
return words;
|
|
87
|
+
}
|
|
88
|
+
return words;
|
|
89
|
+
}
|
|
90
|
+
/** Runner binaries each adapter claims, keyed by adapter scheme. */
|
|
91
|
+
const VITEST_BINARIES = new Set(["vitest"]);
|
|
92
|
+
const JEST_BINARIES = new Set(["jest"]);
|
|
93
|
+
const PLAYWRIGHT_BINARIES = new Set(["playwright"]);
|
|
94
|
+
const basenameOf = (value) => value.split(/[\\/]/).pop() ?? "";
|
|
95
|
+
/** True when `runner` invokes `binary` directly (allowing an explicit path). */
|
|
96
|
+
const invokesBinary = (runner, binaries) => binaries.has(basenameOf(runner[0] ?? ""));
|
|
97
|
+
const vitestAdapter = {
|
|
98
|
+
scheme: "vitest-json-v1",
|
|
99
|
+
runner: "vitest",
|
|
100
|
+
matches: ({ runner }) => invokesBinary(runner, VITEST_BINARIES),
|
|
101
|
+
// Vitest's json reporter writes to stdout unless an output file is given,
|
|
102
|
+
// and the executor reads the report from disk, so both flags are required.
|
|
103
|
+
reportSuffix: () => `--reporter=json --outputFile=`,
|
|
104
|
+
parse: (raw, cwd, workspaceRoot) => {
|
|
105
|
+
const schema = z.object({
|
|
106
|
+
testResults: z.array(z.object({
|
|
107
|
+
name: z.string().min(1),
|
|
108
|
+
assertionResults: z.array(z.object({
|
|
109
|
+
title: z.string(),
|
|
110
|
+
fullName: z.string().optional(),
|
|
111
|
+
ancestorTitles: z.array(z.string()).optional(),
|
|
112
|
+
status: z.string(),
|
|
113
|
+
})),
|
|
114
|
+
})),
|
|
115
|
+
});
|
|
116
|
+
return schema
|
|
117
|
+
.parse(raw)
|
|
118
|
+
.testResults.flatMap((suite) => suite.assertionResults.map((test) => ({
|
|
119
|
+
file: toWorkspacePath(suite.name, cwd, workspaceRoot),
|
|
120
|
+
title: test.fullName ??
|
|
121
|
+
[...(test.ancestorTitles ?? []), test.title].join(" "),
|
|
122
|
+
status: test.status,
|
|
123
|
+
})));
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
const jestAdapter = {
|
|
127
|
+
scheme: "jest-json-v1",
|
|
128
|
+
runner: "jest",
|
|
129
|
+
matches: ({ runner }) => invokesBinary(runner, JEST_BINARIES),
|
|
130
|
+
reportSuffix: () => `--json --outputFile`,
|
|
131
|
+
parse: (raw, cwd, workspaceRoot) => {
|
|
132
|
+
// Jest's `--json` shape: testResults[] carry a per-file `name` plus
|
|
133
|
+
// assertionResults[] that mirror Vitest's field names.
|
|
134
|
+
const schema = z.object({
|
|
135
|
+
testResults: z.array(z.object({
|
|
136
|
+
name: z.string().min(1),
|
|
137
|
+
assertionResults: z.array(z.object({
|
|
138
|
+
title: z.string(),
|
|
139
|
+
fullName: z.string().optional(),
|
|
140
|
+
ancestorTitles: z.array(z.string()).optional(),
|
|
141
|
+
status: z.string(),
|
|
142
|
+
})),
|
|
143
|
+
})),
|
|
144
|
+
});
|
|
145
|
+
return schema
|
|
146
|
+
.parse(raw)
|
|
147
|
+
.testResults.flatMap((suite) => suite.assertionResults.map((test) => ({
|
|
148
|
+
file: toWorkspacePath(suite.name, cwd, workspaceRoot),
|
|
149
|
+
title: test.fullName ??
|
|
150
|
+
[...(test.ancestorTitles ?? []), test.title].join(" "),
|
|
151
|
+
status: test.status,
|
|
152
|
+
})));
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Playwright's JSON reporter emits a nested `suites` tree whose leaf `specs`
|
|
157
|
+
* carry `tests[].results[].status`. File paths live on the enclosing `file`
|
|
158
|
+
* field of each suite node, so the tree is walked while tracking it.
|
|
159
|
+
*/
|
|
160
|
+
const playwrightAdapter = {
|
|
161
|
+
scheme: "playwright-json-v1",
|
|
162
|
+
runner: "playwright",
|
|
163
|
+
matches: ({ runner }) => {
|
|
164
|
+
if (!invokesBinary(runner, PLAYWRIGHT_BINARIES))
|
|
165
|
+
return false;
|
|
166
|
+
// `playwright test` runs tests; `playwright install`/`codegen` do not.
|
|
167
|
+
return runner[1] === "test" || runner[1] === undefined;
|
|
168
|
+
},
|
|
169
|
+
reportSuffix: () => `--reporter=json`,
|
|
170
|
+
// Playwright ignores an output filename on the CLI (`--output` is its
|
|
171
|
+
// artifacts directory); its JSON reporter goes to stdout unless this
|
|
172
|
+
// variable names a file.
|
|
173
|
+
reportPathEnv: "PLAYWRIGHT_JSON_OUTPUT_NAME",
|
|
174
|
+
parse: (raw, cwd, workspaceRoot) => {
|
|
175
|
+
const suiteSchema = z.lazy(() => z.object({
|
|
176
|
+
file: z.string().optional(),
|
|
177
|
+
title: z.string().optional(),
|
|
178
|
+
specs: z
|
|
179
|
+
.array(z.object({
|
|
180
|
+
title: z.string(),
|
|
181
|
+
ok: z.boolean(),
|
|
182
|
+
tests: z.array(z.object({
|
|
183
|
+
status: z.string().optional(),
|
|
184
|
+
results: z
|
|
185
|
+
.array(z.object({
|
|
186
|
+
status: z.string(),
|
|
187
|
+
}))
|
|
188
|
+
.optional(),
|
|
189
|
+
})),
|
|
190
|
+
}))
|
|
191
|
+
.optional(),
|
|
192
|
+
suites: z.array(suiteSchema).optional(),
|
|
193
|
+
}));
|
|
194
|
+
const root = z
|
|
195
|
+
.object({
|
|
196
|
+
suites: z.array(suiteSchema).optional(),
|
|
197
|
+
// Playwright reports each suite's `file` relative to the resolved
|
|
198
|
+
// `testDir` (`config.rootDir`), not to the process cwd. A project
|
|
199
|
+
// with `testDir: "./tests"` reports `orders.spec.js` for
|
|
200
|
+
// `tests/orders.spec.js`, so resolving against cwd would produce a
|
|
201
|
+
// path that can never match a contract target.
|
|
202
|
+
config: z
|
|
203
|
+
.object({ rootDir: z.string().optional() })
|
|
204
|
+
.optional(),
|
|
205
|
+
})
|
|
206
|
+
.parse(raw);
|
|
207
|
+
// Prefer the runner's own reported root; fall back to cwd only when the
|
|
208
|
+
// report omitted it (older report shapes).
|
|
209
|
+
const reportedRoot = root.config?.rootDir;
|
|
210
|
+
const baseCwd = typeof reportedRoot === "string" && reportedRoot.length > 0
|
|
211
|
+
? reportedRoot
|
|
212
|
+
: cwd;
|
|
213
|
+
const out = [];
|
|
214
|
+
const walk = (node, inheritedFile) => {
|
|
215
|
+
const record = asRecord(node);
|
|
216
|
+
if (!record)
|
|
217
|
+
return;
|
|
218
|
+
const file = typeof record.file === "string" ? record.file : inheritedFile;
|
|
219
|
+
for (const spec of record.specs ?? []) {
|
|
220
|
+
const specRecord = asRecord(spec);
|
|
221
|
+
if (!specRecord)
|
|
222
|
+
continue;
|
|
223
|
+
const title = String(specRecord.title ?? "");
|
|
224
|
+
const tests = specRecord.tests ?? [];
|
|
225
|
+
// A spec with several projects/retries yields several tests; the
|
|
226
|
+
// spec only passes when every attempt passed.
|
|
227
|
+
const statuses = tests.flatMap((test) => {
|
|
228
|
+
const testRecord = asRecord(test);
|
|
229
|
+
const results = testRecord?.results ?? [];
|
|
230
|
+
const attempts = results
|
|
231
|
+
.map((result) => asRecord(result)?.status)
|
|
232
|
+
.filter((value) => typeof value === "string");
|
|
233
|
+
return attempts.length > 0
|
|
234
|
+
? attempts
|
|
235
|
+
: [String(testRecord?.status ?? "unknown")];
|
|
236
|
+
});
|
|
237
|
+
const status = statuses.every((value) => value === "passed")
|
|
238
|
+
? "passed"
|
|
239
|
+
: statuses.includes("passed")
|
|
240
|
+
? "failed"
|
|
241
|
+
: (statuses[0] ?? "unknown");
|
|
242
|
+
out.push({
|
|
243
|
+
file: toWorkspacePath(file ?? "", baseCwd, workspaceRoot),
|
|
244
|
+
title,
|
|
245
|
+
status,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
for (const child of record.suites ?? []) {
|
|
249
|
+
walk(child, file);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
for (const suite of root.suites ?? [])
|
|
253
|
+
walk(suite, undefined);
|
|
254
|
+
return out;
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
export const FRONTEND_TEST_ADAPTERS = [
|
|
258
|
+
vitestAdapter,
|
|
259
|
+
jestAdapter,
|
|
260
|
+
playwrightAdapter,
|
|
261
|
+
];
|
|
262
|
+
/**
|
|
263
|
+
* Runners the container classifier recognizes as behavior verification but
|
|
264
|
+
* that have no adapter yet. Naming them lets the capability gap read as
|
|
265
|
+
* "framework not adapted yet" instead of a user configuration error.
|
|
266
|
+
*/
|
|
267
|
+
const KNOWN_UNADAPTED_RUNNERS = new Set([
|
|
268
|
+
"mocha",
|
|
269
|
+
"ava",
|
|
270
|
+
"tap",
|
|
271
|
+
"cypress",
|
|
272
|
+
"testcafe",
|
|
273
|
+
"nightwatch",
|
|
274
|
+
"wdio",
|
|
275
|
+
"webdriverio",
|
|
276
|
+
]);
|
|
277
|
+
/** Resolve the adapter for a command, or `undefined` when none matches. */
|
|
278
|
+
export function resolveFrontendTestAdapter(context) {
|
|
279
|
+
// A package script owns the detail: `npm test` must resolve through the
|
|
280
|
+
// script body, not the wrapper, or `npm test` and `vitest run` would
|
|
281
|
+
// disagree about capability.
|
|
282
|
+
if (context.scriptArgv) {
|
|
283
|
+
const scriptRunner = resolveRunnerArgv(context.scriptArgv);
|
|
284
|
+
const fromScript = FRONTEND_TEST_ADAPTERS.find((adapter) => adapter.matches({ ...context, runner: scriptRunner }));
|
|
285
|
+
if (fromScript)
|
|
286
|
+
return fromScript;
|
|
287
|
+
}
|
|
288
|
+
return FRONTEND_TEST_ADAPTERS.find((adapter) => adapter.matches(context));
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Detect a recognized-but-unadapted runner so callers can report a capability
|
|
292
|
+
* gap. Returns the runner name when the command is a test runner we know of
|
|
293
|
+
* but cannot observe.
|
|
294
|
+
*/
|
|
295
|
+
export function detectUnadaptedRunner(runner) {
|
|
296
|
+
const binary = basenameOf(runner[0] ?? "").replace(/\.(?:js|cjs|mjs|cmd|exe)$/u, "");
|
|
297
|
+
if (KNOWN_UNADAPTED_RUNNERS.has(binary))
|
|
298
|
+
return binary;
|
|
299
|
+
// `node --test`, `node --test-only`, plus `deno test`/`bun test`.
|
|
300
|
+
if (binary === "node" && runner.includes("--test"))
|
|
301
|
+
return "node --test";
|
|
302
|
+
if (binary === "deno" && runner[1] === "test")
|
|
303
|
+
return "deno test";
|
|
304
|
+
if (binary === "bun" && runner[1] === "test")
|
|
305
|
+
return "bun test";
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
/** Empty `file` means the runner reported a spec outside the workspace. */
|
|
309
|
+
export const isOutsideWorkspacePath = (file) => file === ".." || file.startsWith("../") || path.isAbsolute(file);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { canonicalTestArtifactRoot, } from "./test-artifact-namespace.js";
|
|
2
3
|
/**
|
|
3
4
|
* Frontend-test artifact layout (configurable testRoot).
|
|
4
5
|
*
|
|
@@ -6,14 +7,16 @@ import path from "node:path";
|
|
|
6
7
|
* frozen on the spec for the whole run. Writers, gates, Playwright fences
|
|
7
8
|
* and TaskSpec allowedPaths all derive from this single object.
|
|
8
9
|
*
|
|
9
|
-
* Default layout
|
|
10
|
-
* testcase/frontend/rag/**
|
|
11
|
-
* testcase/frontend/cases/**
|
|
12
|
-
* testcase/frontend/evidence/**
|
|
13
|
-
* testcase/frontend/reports/**
|
|
14
|
-
* testcase/frontend/fixtures/**
|
|
10
|
+
* Default layout (since 2026-09-17) lives under the shared runtime namespace:
|
|
11
|
+
* .harness/testcase/frontend/rag/**
|
|
12
|
+
* .harness/testcase/frontend/cases/**
|
|
13
|
+
* .harness/testcase/frontend/evidence/**
|
|
14
|
+
* .harness/testcase/frontend/reports/**
|
|
15
|
+
* .harness/testcase/frontend/fixtures/**
|
|
15
16
|
*/
|
|
16
|
-
export const FRONTEND_TEST_DEFAULT_TEST_ROOT = "
|
|
17
|
+
export const FRONTEND_TEST_DEFAULT_TEST_ROOT = canonicalTestArtifactRoot("frontend-test");
|
|
18
|
+
/** Historical pre-2026-09-17 default root, kept for text rewrites only. */
|
|
19
|
+
export const FRONTEND_TEST_LEGACY_DEFAULT_TEST_ROOT = "testcase/frontend";
|
|
17
20
|
const FORBIDDEN_TEST_ROOT_PREFIXES = [
|
|
18
21
|
"src",
|
|
19
22
|
"app",
|
|
@@ -59,6 +62,10 @@ function normalizeRelPosix(value, label) {
|
|
|
59
62
|
return segments.join("/");
|
|
60
63
|
}
|
|
61
64
|
function assertTestRootAllowed(testRoot) {
|
|
65
|
+
// D3: the canonical harness test-artifact root is the ONLY hidden-root
|
|
66
|
+
// exception. Every other hidden or forbidden top segment stays rejected.
|
|
67
|
+
if (testRoot === FRONTEND_TEST_DEFAULT_TEST_ROOT)
|
|
68
|
+
return;
|
|
62
69
|
const topSegment = testRoot.split("/")[0];
|
|
63
70
|
if (FORBIDDEN_TEST_ROOT_PREFIXES.some((forbidden) => topSegment === forbidden || topSegment.startsWith(`${forbidden}.`))) {
|
|
64
71
|
throw new Error(`frontendTest.testRoot must not target production/governance trees: ${testRoot}`);
|
|
@@ -67,14 +74,25 @@ function assertTestRootAllowed(testRoot) {
|
|
|
67
74
|
throw new Error(`frontendTest.testRoot must not target hidden directories: ${testRoot}`);
|
|
68
75
|
}
|
|
69
76
|
}
|
|
77
|
+
function resolveTestRootInput(raw, canonical) {
|
|
78
|
+
// D3: only the EXACT canonical harness test-artifact root may be a hidden
|
|
79
|
+
// path. Compare after trimming + stripping trailing slashes so
|
|
80
|
+
// `.harness/testcase/frontend/` matches, but every other hidden spelling
|
|
81
|
+
// falls through to the fail-closed normalizer below.
|
|
82
|
+
const trimmed = raw.trim().replace(/\/+$/, "");
|
|
83
|
+
if (trimmed === canonical)
|
|
84
|
+
return canonical;
|
|
85
|
+
return normalizeRelPosix(raw, "testRoot");
|
|
86
|
+
}
|
|
70
87
|
/**
|
|
71
88
|
* Resolve the frozen frontend-test artifact layout from task config.
|
|
72
|
-
*
|
|
89
|
+
* Roots of the form `.harness/testcase/frontend` are accepted only as the
|
|
90
|
+
* exact canonical default; all other hidden roots fail closed (D3).
|
|
73
91
|
*/
|
|
74
92
|
export function resolveFrontendTestLayout(config) {
|
|
75
93
|
const testRoot = config?.testRoot === undefined || config?.testRoot === null
|
|
76
94
|
? FRONTEND_TEST_DEFAULT_TEST_ROOT
|
|
77
|
-
:
|
|
95
|
+
: resolveTestRootInput(config.testRoot, FRONTEND_TEST_DEFAULT_TEST_ROOT);
|
|
78
96
|
assertTestRootAllowed(testRoot);
|
|
79
97
|
const isDefault = testRoot === FRONTEND_TEST_DEFAULT_TEST_ROOT;
|
|
80
98
|
return {
|
|
@@ -98,10 +116,16 @@ export function frontendTestLayoutFromSpec(spec) {
|
|
|
98
116
|
return resolveFrontendTestLayout({ testRoot: frozen.testRoot });
|
|
99
117
|
}
|
|
100
118
|
const DEFAULT_PREFIX = `${FRONTEND_TEST_DEFAULT_TEST_ROOT}/`;
|
|
119
|
+
const LEGACY_DEFAULT_PREFIX = `${FRONTEND_TEST_LEGACY_DEFAULT_TEST_ROOT}/`;
|
|
101
120
|
/**
|
|
102
|
-
* Longest-prefix rewrite of
|
|
103
|
-
*
|
|
104
|
-
*
|
|
121
|
+
* Longest-prefix rewrite of frontend test-root paths in template text.
|
|
122
|
+
*
|
|
123
|
+
* No-op when layout.isDefault (default DAGs stay byte-identical to their
|
|
124
|
+
* templates, which already use the canonical `.harness/testcase/frontend`
|
|
125
|
+
* root). Custom roots rewrite BOTH the canonical default prefix and the
|
|
126
|
+
* historical `testcase/frontend/` prefix, so legacy templates and frozen
|
|
127
|
+
* specs converge onto the configured root. Never replaces the short token
|
|
128
|
+
* `testcase/` alone (would collide with backend-test).
|
|
105
129
|
*/
|
|
106
130
|
export function applyFrontendTestLayoutToText(text, layout) {
|
|
107
131
|
if (layout.isDefault)
|
|
@@ -119,6 +143,11 @@ export function applyFrontendTestLayoutToText(text, layout) {
|
|
|
119
143
|
i += DEFAULT_PREFIX.length;
|
|
120
144
|
continue;
|
|
121
145
|
}
|
|
146
|
+
if (text.startsWith(LEGACY_DEFAULT_PREFIX, i)) {
|
|
147
|
+
output += replacement;
|
|
148
|
+
i += LEGACY_DEFAULT_PREFIX.length;
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
122
151
|
output += text[i];
|
|
123
152
|
i += 1;
|
|
124
153
|
}
|
|
@@ -555,7 +555,21 @@ export async function materializeFrontendTestResult(input) {
|
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
|
|
558
|
+
let caseContent;
|
|
559
|
+
let testPoints = [];
|
|
560
|
+
try {
|
|
561
|
+
({ caseContent, testPoints } = await readFrontendCaseContent(input.workspaceRoot, item.casePath, layout));
|
|
562
|
+
}
|
|
563
|
+
catch (error) {
|
|
564
|
+
if (item.generationStatus !== "blocked")
|
|
565
|
+
throw error;
|
|
566
|
+
status = "blocked";
|
|
567
|
+
blockedReason = typeof item.generationBlockedReason === "string" && item.generationBlockedReason.trim()
|
|
568
|
+
? item.generationBlockedReason.trim()
|
|
569
|
+
: "generation-repair-exhausted";
|
|
570
|
+
advisoryFindings.push({ ruleId: "generation-blocked", caseId: item.caseId, detail: blockedReason ?? "generation-repair-exhausted" });
|
|
571
|
+
caseContent = { purpose: "用例生成未完成", preconditions: [], steps: [], expectedResults: [] };
|
|
572
|
+
}
|
|
559
573
|
// Parse bounded fixed sections from execution.md. Missing optional
|
|
560
574
|
// summary/steps are advisory only and never downgrade a passed status.
|
|
561
575
|
let executionSummary = "";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sanitizeRepairAssertions } from "./frontend-repair-assertions.js";
|
|
1
2
|
import { readFile } from "node:fs/promises";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { sha256OfCanonicalJson } from "../../task/contract/hash.js";
|
|
@@ -31,18 +32,11 @@ export const TYPED_EVENT_FACT_KINDS = [
|
|
|
31
32
|
"provider-ended-without-terminal",
|
|
32
33
|
"read-only-fact-channel",
|
|
33
34
|
];
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
* Kept deliberately separate from `TYPED_EVENT_FACT_KINDS`: widening the shadow
|
|
41
|
-
* catalog must never widen the provider capability matrix (which stays frozen
|
|
42
|
-
* at its seven kinds). `target-surface` is shared by the scout and plan
|
|
43
|
-
* origins, so the union of the two catalogs is 12 unique kinds.
|
|
44
|
-
*/
|
|
45
|
-
export const SHADOW_FACT_KINDS = [
|
|
35
|
+
/** Frontend DAG decision facts. These are committed runtime facts, not a
|
|
36
|
+
* secondary text channel; Policy, Admission and Plan compilation read them
|
|
37
|
+
* directly. Kept separate from provider capability facts so the provider
|
|
38
|
+
* matrix remains frozen. */
|
|
39
|
+
export const FRONTEND_DAG_FACT_KINDS = [
|
|
46
40
|
"requirement",
|
|
47
41
|
"constraint",
|
|
48
42
|
"open-question",
|
|
@@ -56,11 +50,26 @@ export const SHADOW_FACT_KINDS = [
|
|
|
56
50
|
"design-deviation",
|
|
57
51
|
"dependency",
|
|
58
52
|
];
|
|
53
|
+
/** Experimental decision Plan fact catalog. The decision tools emit semantic
|
|
54
|
+
* decisions (module placement, reuse, state ownership, Mock boundary, behavior
|
|
55
|
+
* verification focus); `data-flow` and `dependency` reuse the DAG catalog above.
|
|
56
|
+
* Kept as a dedicated catalog so widening the decision surface never widens the
|
|
57
|
+
* frozen provider / event / review / design catalogs. */
|
|
58
|
+
export const FRONTEND_DECISION_FACT_KINDS = [
|
|
59
|
+
"module-placement",
|
|
60
|
+
"reuse-decision",
|
|
61
|
+
"state-ownership",
|
|
62
|
+
"api-mock-boundary",
|
|
63
|
+
"verification-focus",
|
|
64
|
+
];
|
|
65
|
+
/** Terminal fact for the experimental decision Plan path. Kept separate from the
|
|
66
|
+
* decision fact catalog so it never gets collected as a decision entry. */
|
|
67
|
+
export const DECISION_TERMINAL_FACT_KINDS = ["finalize_decision"];
|
|
59
68
|
/**
|
|
60
69
|
* M5 review terminal fact catalog (AC-001). These two committed typed tools are
|
|
61
70
|
* the authoritative terminal verdict of `frontend-review-pi`. They are kept in
|
|
62
71
|
* a dedicated catalog so widening the review terminal surface never widens the
|
|
63
|
-
* frozen
|
|
72
|
+
* frozen provider/event catalogs.
|
|
64
73
|
*/
|
|
65
74
|
export const REVIEW_TERMINAL_FACT_KINDS = [
|
|
66
75
|
"approve_review",
|
|
@@ -72,7 +81,7 @@ export const REVIEW_TERMINAL_FACT_KINDS = [
|
|
|
72
81
|
* `approve_design` / `request_design_changes` instead of the legacy first-line
|
|
73
82
|
* `VERDICT: pass|request-revision` text protocol. Kept in a dedicated catalog
|
|
74
83
|
* so widening the design terminal surface never widens the frozen provider /
|
|
75
|
-
*
|
|
84
|
+
* event / review catalogs.
|
|
76
85
|
*/
|
|
77
86
|
export const DESIGN_TERMINAL_FACT_KINDS = [
|
|
78
87
|
"approve_design",
|
|
@@ -84,7 +93,7 @@ export const DESIGN_TERMINAL_FACT_KINDS = [
|
|
|
84
93
|
* open-question/split-proposal facts plus the `contract-finalized` terminal
|
|
85
94
|
* fact carrying the terminal disposition (`ready | ready-with-assumptions |
|
|
86
95
|
* blocked` + optional `blockingOwner`). Kept in a dedicated catalog so
|
|
87
|
-
* widening the contract surface never widens the frozen provider /
|
|
96
|
+
* widening the contract surface never widens the frozen provider /
|
|
88
97
|
* event / review / design catalogs.
|
|
89
98
|
*/
|
|
90
99
|
export const CONTRACT_FACT_KINDS = [
|
|
@@ -95,6 +104,8 @@ export const CONTRACT_FACT_KINDS = [
|
|
|
95
104
|
"open-question",
|
|
96
105
|
"split-proposal",
|
|
97
106
|
"openspec-selection",
|
|
107
|
+
"ui-state-declaration",
|
|
108
|
+
"required-deliverables",
|
|
98
109
|
"contract-finalized",
|
|
99
110
|
];
|
|
100
111
|
export const CONTRACT_TERMINAL_FACT_KINDS = ["contract-finalized"];
|
|
@@ -124,7 +135,9 @@ export const PLAN_RECORD_FACT_KINDS = [
|
|
|
124
135
|
"plan-requirement",
|
|
125
136
|
"plan-verification-target",
|
|
126
137
|
"plan-evidence-gap",
|
|
138
|
+
"state-registry",
|
|
127
139
|
];
|
|
140
|
+
export const INCREMENTAL_DETAIL_FACT_KINDS = ["mock-endpoint", "review-finding", "design-finding", "contract-scope-completed", "plan-group-coverage", "scout-scope", "review-scope-completed", "design-scope-completed"];
|
|
128
141
|
/**
|
|
129
142
|
* A+B (AC-009): typed issue category shared by review and design change
|
|
130
143
|
* requests. The five-value enum replaces free-form issueCategory strings.
|
|
@@ -138,8 +151,8 @@ export const FRONTEND_ISSUE_CATEGORY_VALUES = [
|
|
|
138
151
|
];
|
|
139
152
|
export const frontendIssueCategorySchema = z.enum(FRONTEND_ISSUE_CATEGORY_VALUES);
|
|
140
153
|
/** Runtime control facts committed at frontend shape boundaries. Kept outside
|
|
141
|
-
* the frozen provider
|
|
142
|
-
*
|
|
154
|
+
* the frozen provider catalog so adding control authority cannot widen that
|
|
155
|
+
* capability surface. */
|
|
143
156
|
export const FRONTEND_SHAPE_FACT_KINDS = ["frontend-shape"];
|
|
144
157
|
export const typedEventPhaseSchema = z.enum([
|
|
145
158
|
"staged",
|
|
@@ -149,19 +162,22 @@ export const typedEventPhaseSchema = z.enum([
|
|
|
149
162
|
const ALL_TYPED_EVENT_FACT_KIND_VALUES = [
|
|
150
163
|
...new Set([
|
|
151
164
|
...TYPED_EVENT_FACT_KINDS,
|
|
152
|
-
...
|
|
165
|
+
...FRONTEND_DAG_FACT_KINDS,
|
|
166
|
+
...FRONTEND_DECISION_FACT_KINDS,
|
|
167
|
+
...DECISION_TERMINAL_FACT_KINDS,
|
|
153
168
|
...REVIEW_TERMINAL_FACT_KINDS,
|
|
154
169
|
...DESIGN_TERMINAL_FACT_KINDS,
|
|
155
170
|
...FRONTEND_SHAPE_FACT_KINDS,
|
|
156
171
|
...CONTRACT_FACT_KINDS,
|
|
157
172
|
...PLAN_TERMINAL_FACT_KINDS,
|
|
158
173
|
...PLAN_RECORD_FACT_KINDS,
|
|
174
|
+
...INCREMENTAL_DETAIL_FACT_KINDS,
|
|
159
175
|
]),
|
|
160
176
|
];
|
|
161
177
|
export const typedEventFactKindSchema = z.enum(ALL_TYPED_EVENT_FACT_KIND_VALUES);
|
|
162
178
|
/** A typed event fact is a `kind`-discriminated record. The schema stays
|
|
163
179
|
* permissive beyond `kind` (arbitrary JSON-safe payload) so provider/model
|
|
164
|
-
*
|
|
180
|
+
* provider facts can carry their own fields, but `kind` is always validated. */
|
|
165
181
|
export const typedEventFactSchema = z
|
|
166
182
|
.record(z.unknown())
|
|
167
183
|
.superRefine((value, ctx) => {
|
|
@@ -173,8 +189,7 @@ export const typedEventFactSchema = z
|
|
|
173
189
|
});
|
|
174
190
|
}
|
|
175
191
|
});
|
|
176
|
-
/** A single review finding shared by both typed terminal verdicts.
|
|
177
|
-
* legacy JSON review finding shape so typed↔JSON equivalence stays total. */
|
|
192
|
+
/** A single review finding shared by both typed terminal verdicts. */
|
|
178
193
|
export const reviewFindingSchema = z
|
|
179
194
|
.object({
|
|
180
195
|
severity: z.enum(["Critical", "Important", "Minor", "Info"]),
|
|
@@ -182,11 +197,19 @@ export const reviewFindingSchema = z
|
|
|
182
197
|
line: z.number().int().positive().optional(),
|
|
183
198
|
issue: z.string().min(1),
|
|
184
199
|
requiredChange: z.string().min(1).optional(),
|
|
200
|
+
repairAssertions: z.unknown().optional(),
|
|
201
|
+
repairAssertionDiagnostics: z.array(z.string()).optional(),
|
|
185
202
|
})
|
|
186
|
-
.strict()
|
|
203
|
+
.strict().transform(finding => {
|
|
204
|
+
const { repairAssertions, ...base } = finding;
|
|
205
|
+
if (repairAssertions === undefined)
|
|
206
|
+
return base;
|
|
207
|
+
const sanitized = sanitizeRepairAssertions(repairAssertions);
|
|
208
|
+
const diagnostics = [...(finding.repairAssertionDiagnostics ?? []), ...sanitized.diagnostics];
|
|
209
|
+
return { ...finding, repairAssertions: sanitized.assertions, ...(diagnostics.length ? { repairAssertionDiagnostics: [...new Set(diagnostics)] } : {}) };
|
|
210
|
+
});
|
|
187
211
|
/** `approve_review` terminal fact payload. Approval may carry informational
|
|
188
|
-
* findings (Minor/Info) but never Critical/Important
|
|
189
|
-
* JSON verdict applies to `verdict: "pass"`. */
|
|
212
|
+
* findings (Minor/Info) but never Critical/Important. */
|
|
190
213
|
export const approveReviewFactSchema = z
|
|
191
214
|
.object({
|
|
192
215
|
kind: z.literal("approve_review"),
|
|
@@ -216,8 +239,7 @@ export const requestReviewChangesFactSchema = z
|
|
|
216
239
|
})
|
|
217
240
|
.strict();
|
|
218
241
|
/** `approve_design` terminal fact payload. Approval may carry informational
|
|
219
|
-
* findings (Minor/Info) but never Critical/Important
|
|
220
|
-
* text protocol applies to `VERDICT: pass`. */
|
|
242
|
+
* findings (Minor/Info) but never Critical/Important. */
|
|
221
243
|
export const approveDesignFactSchema = z
|
|
222
244
|
.object({
|
|
223
245
|
kind: z.literal("approve_design"),
|
|
@@ -258,6 +280,15 @@ export const typedEventRecordSchema = z
|
|
|
258
280
|
revision: z.number().int().nonnegative(),
|
|
259
281
|
recordedAt: z.string().min(1),
|
|
260
282
|
quarantineReason: z.string().min(1).optional(),
|
|
283
|
+
submission: z.object({
|
|
284
|
+
version: z.literal(1),
|
|
285
|
+
bindingSha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
286
|
+
tool: z.string(),
|
|
287
|
+
callId: z.string(),
|
|
288
|
+
identity: z.string(),
|
|
289
|
+
paramsSha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
290
|
+
receipt: z.record(z.unknown()).optional(),
|
|
291
|
+
}).strict().optional(),
|
|
261
292
|
})
|
|
262
293
|
.strict()
|
|
263
294
|
.superRefine((value, ctx) => {
|