@tea-agent/loop-agent 0.1.0-fe-test.3 → 0.1.0-fe-test.5
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 +6 -3
- package/CHANGELOG.md +607 -93
- package/README.md +11 -5
- package/bin/loop-agent.js +7 -3
- package/dist/adapters/context-transfer/optional-pi-handoff.js +31 -0
- package/dist/adapters/context-transfer/pi-session.js +61 -0
- package/dist/application/dag/generate-task-dag.js +90 -21
- package/dist/application/dag/run-dag.js +41 -0
- package/dist/application/task-lifecycle/advance.js +40 -5
- package/dist/application/task-lifecycle/observe.js +171 -17
- package/dist/application/task-lifecycle/plan-transitions.js +42 -7
- package/dist/application/task-lifecycle/recommendations.js +13 -2
- package/dist/build-stamp.json +3 -3
- package/dist/cli/command-definitions.js +44 -10
- package/dist/cli/program.js +82 -6
- package/dist/cli/update/notifier.js +2 -2
- package/dist/cli/update/runtime-activity.js +1 -29
- package/dist/cli.js +2 -1
- package/dist/commands/client-recovery.js +11 -36
- package/dist/commands/dag-artifact.js +284 -0
- package/dist/commands/dag-context.js +184 -0
- package/dist/commands/dag-follow-up.js +138 -0
- package/dist/commands/dag-rerun-task.js +2 -0
- package/dist/commands/dag-rerun.js +261 -2
- package/dist/commands/init-model-catalog.js +486 -0
- package/dist/commands/init-upgrade.js +265 -97
- package/dist/commands/init.js +455 -28
- package/dist/commands/inspect-next.js +8 -0
- package/dist/commands/task-advance.js +73 -1
- package/dist/commands/task-source-prepare.js +5 -0
- package/dist/commands/task-status.js +1 -0
- package/dist/executors/dag-pi-executor.js +4323 -231
- package/dist/executors/pi-event-serializer.js +42 -1
- package/dist/executors/pi-executor.js +70 -6
- package/dist/executors/pi-extension-resolver.js +245 -0
- package/dist/executors/pi-playwright-cli-tool.js +74 -28
- package/dist/executors/pi-read-budget-policy.js +239 -0
- package/dist/executors/pi-sdk-executor.js +263 -59
- package/dist/executors/pi-writer-tool-policy.js +57 -1
- package/dist/executors/shell-executor.js +1456 -240
- package/dist/executors/shell-write-guard.js +14 -0
- package/dist/executors/workspace-write-snapshot.js +68 -0
- package/dist/governance/checks.js +1 -0
- package/dist/{worker → infrastructure}/console/app-data.js +4 -0
- package/dist/infrastructure/console/artifact-revision-store.js +430 -0
- package/dist/infrastructure/console/context-export-store.js +160 -0
- package/dist/infrastructure/console/dir-lock.js +132 -0
- package/dist/infrastructure/console/operation-store.js +417 -0
- package/dist/infrastructure/harness/artifact-store.js +10 -1
- package/dist/infrastructure/harness/atomic-write.js +35 -2
- package/dist/shared/context-transfer/artifact-revision.js +172 -0
- package/dist/shared/context-transfer.js +418 -0
- package/dist/shared/dag-failure-category.js +150 -0
- package/dist/shared/dag-prompt-override.js +27 -0
- package/dist/shared/openspec-spec.js +70 -4
- package/dist/shared/operator/capabilities.js +65 -4
- package/dist/shared/operator/safe-run-summary.js +1 -0
- package/dist/shared/path-safety.js +93 -0
- package/dist/shared/pi-context-pressure/checkpoint.js +116 -0
- package/dist/shared/pi-context-pressure/compaction-policy.js +151 -0
- package/dist/shared/pi-context-pressure/env.js +58 -0
- package/dist/shared/pi-context-pressure/extension.js +100 -0
- package/dist/shared/pi-context-pressure/index.js +7 -0
- package/dist/shared/pi-context-pressure/overflow.js +252 -0
- package/dist/shared/pi-context-pressure/sift-bridge.js +386 -0
- package/dist/shared/pi-context-pressure/telemetry.js +51 -0
- package/dist/shared/playwright-cli-command-policy.js +15 -0
- package/dist/shared/preview.js +28 -4
- package/dist/shared/update/console-notifier.js +100 -0
- package/dist/{cli → shared}/update/npm-client.js +70 -15
- package/dist/{cli → shared}/update/state.js +41 -13
- package/dist/task/config-types.js +125 -6
- package/dist/task/contract/adopt.js +4 -0
- package/dist/task/contract/apply.js +11 -1
- package/dist/task/contract/constants.js +3 -0
- package/dist/task/contract/diff.js +26 -0
- package/dist/task/contract/hash.js +3 -0
- package/dist/task/contract/import-revision.js +4 -0
- package/dist/task/contract/observe.js +25 -4
- package/dist/task/contract/paths.js +2 -1
- package/dist/task/contract/project.js +23 -1
- package/dist/task/contract/schema.js +9 -1
- package/dist/task/contract/transaction.js +12 -0
- package/dist/task/frontend-project-capability.js +203 -20
- package/dist/task/runtime.js +5 -2
- package/dist/task/source-prepare/build-draft.js +18 -3
- package/dist/task/source-prepare/completeness.js +188 -0
- package/dist/task/source-prepare/fragment-inventory.js +513 -0
- package/dist/task/source-prepare/index.js +3 -0
- package/dist/task/source-prepare/ledger-reconciliation.js +127 -0
- package/dist/task/source-prepare/ledger-review.js +214 -0
- package/dist/task/source-prepare/ledger.js +545 -0
- package/dist/task/source-prepare/parse-intent.js +24 -4
- package/dist/task/source-prepare/prepare.js +368 -2
- package/dist/task/source-prepare/semantic-intake.js +25 -5
- package/dist/task/source-prepare/source-fidelity-pi.js +384 -0
- package/dist/task/source-prepare/types.js +22 -0
- package/dist/task/source-references.js +22 -1
- package/dist/task/task-demand-routing.js +3 -0
- package/dist/worker/cli.js +18 -2
- package/dist/worker/console/chat/assistant-content.js +7 -0
- package/dist/worker/console/chat/chat-event-store.js +159 -18
- package/dist/worker/console/chat/chat-ui-policy.js +4 -2
- package/dist/worker/console/chat/context-panel.js +7 -0
- package/dist/worker/console/chat/deferred-turn.js +103 -0
- package/dist/worker/console/chat/goal-round-driver.js +72 -0
- package/dist/worker/console/chat/goals.js +300 -0
- package/dist/worker/console/chat/model-resolver.js +7 -4
- 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 +868 -30
- package/dist/worker/console/chat/provider-error.js +99 -0
- package/dist/worker/console/chat/repo-browser.js +101 -12
- package/dist/worker/console/chat/resource-preferences-store.js +1 -1
- package/dist/worker/console/chat/routes.js +1451 -145
- package/dist/worker/console/chat/sdd-data-alignment.js +222 -0
- package/dist/worker/console/chat/semantic-activity.js +25 -24
- package/dist/worker/console/chat/session-catalog.js +50 -0
- package/dist/worker/console/chat/session-stats.js +275 -0
- package/dist/worker/console/chat/session-store.js +348 -76
- package/dist/worker/console/chat/shortcuts.js +26 -3
- package/dist/worker/console/chat/sift-bridge.js +1 -0
- package/dist/worker/console/chat/todos.js +115 -0
- package/dist/worker/console/chat/tool-preview.js +42 -0
- package/dist/worker/console/chat/turn-process.js +185 -112
- package/dist/worker/console/chat/user-questions.js +266 -0
- package/dist/worker/console/chat/workspace-landing.js +79 -0
- package/dist/worker/console/console-handoff.js +82 -0
- package/dist/worker/console/console-update-and-init.js +115 -0
- package/dist/worker/console/console-update-runtime.js +84 -0
- package/dist/worker/console/context-transfer-diagnostics.js +198 -0
- package/dist/worker/console/dag-confirmation.js +1 -1
- package/dist/worker/console/dag-execution-receipt.js +54 -3
- package/dist/worker/console/doctor.js +1 -1
- package/dist/worker/console/draft-store.js +50 -1
- package/dist/worker/console/frontend-human-decision-adapter.js +19 -0
- package/dist/worker/console/frontend-split-operation-adapter.js +20 -0
- package/dist/worker/console/human-gate-token.js +1 -1
- package/dist/worker/console/index.js +6 -3
- package/dist/worker/console/inspect-split.js +18 -0
- package/dist/worker/console/interview/assessment.js +1 -1
- package/dist/worker/console/interview/session.js +1 -1
- package/dist/worker/console/native-directory-picker.js +13 -0
- package/dist/worker/console/operation-run-facts.js +19 -3
- package/dist/worker/console/operation-runner.js +45 -4
- package/dist/worker/console/operation-sse.js +1 -1
- package/dist/worker/console/operation-wait.js +1 -1
- package/dist/worker/console/operator-actions.js +534 -15
- package/dist/worker/console/operator-selection.js +6 -2
- package/dist/worker/console/operator-surface-health.js +2 -1
- package/dist/worker/console/operator-user-error.js +171 -2
- package/dist/worker/console/pi-plugins.catalog.json +73658 -0
- package/dist/worker/console/pi-plugins.js +238 -0
- package/dist/worker/console/pi-readiness.js +7 -6
- package/dist/worker/console/prd-intake-bridge.js +13 -0
- 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 +1231 -10
- package/dist/worker/console/security.js +102 -13
- package/dist/worker/console/server.js +762 -159
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-BmOEx0gA.js → abnfDiagram-N423BO3Z-BZogYNl1.js} +1 -1
- package/dist/worker/console/static/assets/{arc-BGiVVe8b.js → arc-DcJTLe2v.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-nDdu4rgJ.js → architectureDiagram-T3A2C74G-B39EQQ9n.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-Bb5u0BWf.js → blockDiagram-VBNYF7ZC-CitCGV56.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-BlhC0j94.js → c4Diagram-5PPSVZJV-rvWuOHLG.js} +1 -1
- package/dist/worker/console/static/assets/channel-CXqdP5pW.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-Ai8_qQXI.js → chunk-2GRJ4B5K-DGXplIJs.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-B9gyCjqX.js → chunk-2Q5K7J3B-ur9OqjPn.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-Bzbj3zGH.js → chunk-5RXB4S5H-D1KqU_Vi.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-BT415PvT.js → chunk-5VM5RSS4-BlVZrbtM.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-D_A5_5QL.js → chunk-6Q2QTUOP-BAzz3nQy.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-srJkaP3f.js → chunk-GF5L2VYU-CP_nYuCV.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-UYGvEP4l.js → chunk-JWPE2WC7-CWvKQ80X.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-B8luBrrz.js → chunk-KBJHAD2P-CyUki8wp.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-DN7wXZSq.js → chunk-RYQCIY6F-5NYzNKfY.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DXKyMuKS.js → chunk-XXDRQBXY-DHdUgjS-.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-D9C3agF7.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-D9C3agF7.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-dqvoynXj.js → cose-bilkent-JH36ORCC-ANQ5g_t6.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2--PcyL34A.js → cynefin-VYW2F7L2-CruT_4-0.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-DvWs_hTY.js → cynefinDiagram-MW4NZA55-rbFo77ID.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-DxeIxbyO.js → dagre-VZM6K2ZE-asstxBQs.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-DPCG61Of.js → diagram-7IWD3JNH-DzTyBZwI.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-CmuU50-U.js → diagram-B4RE2ZJO-gw8ccH3B.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-B61XLD_v.js → diagram-LBJQPF4R-B8RpZzOf.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-BB7HTRRY.js → diagram-Q27KOJAE-B1zJkCS9.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-DvkboAIp.js → diagram-UB23O5K3-B6JLWZmO.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-BdJ_y1fL.js → ebnfDiagram-BXEA7PRR-q2iZP-Ps.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-9bUBZTRi.js → erDiagram-JOGREHBK-B3dbbktQ.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-Dw4L4RBa.js → flowDiagram-UKHOOZJN-C-zc6-kB.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-Jr82N_QP.js → ganttDiagram-PKOTCBZU-BSolnot9.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-DAz9wFLr.js → gitGraphDiagram-DS77QQ5N-Bo8jGxTk.js} +1 -1
- package/dist/worker/console/static/assets/index-CAZ2fC_X.css +1 -0
- package/dist/worker/console/static/assets/index-DhfjOafu.js +449 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-CBB5Np7y.js → infoDiagram-6WML65LV-DQaZqJOH.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-D8IOp94y.js → ishikawaDiagram-WSZJBQD7-DsdX1WnE.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-Dgd3AHGG.js → journeyDiagram-NVQOT4AX-CP5EYDZL.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-BmYOxLE9.js → kanban-definition-27J2QSJJ-DAm14Dr8.js} +1 -1
- package/dist/worker/console/static/assets/{linear-DfYTEF6J.js → linear-gZECoLc5.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-BjuFPRqa.js → mermaid.core-BRJNIM6p.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-CLyUViGd.js → mindmap-definition-FAOFIHXS-Cja3kLkR.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-BvX2Di4-.js → pegDiagram-VL7TDLO6-22ZGFisL.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-BFj0_OLv.js → pieDiagram-7S7Q4E2Y-BXin0Y1o.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-BIUrD_hx.js → quadrantDiagram-CIZ2JOQS-Cw6T69Yt.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-CHBB48fj.js → railroadDiagram-AXF67PYL-C1-gTieN.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-sJrYw2Sf.js → requirementDiagram-LRYGKXZP--H5N2iI1.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-BzHH6fPR.js → sankeyDiagram-W5VNT64P-CgWAPeRz.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-7QCnelCt.js → sequenceDiagram-SI44F4Z6-CrKqzGvt.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-sDYSxn72.js → sizeCapture-X5ZJPWSS-BB3wG06K.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-XpiUdwzm.js → stateDiagram-OKZ733FA-DjsGgdgY.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Tp7V0U4q.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-DvqgNPzD.js → swimlanes-SLNWSIFB-DYKEbvAR.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DUZWZWi8.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-2TyOYNx0.js → timeline-definition-Z64GVDOM-eQOb5k9Y.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-B-nM6wM2.js → vennDiagram-T6HMQDX7-B2-l9FIu.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-B86wPdbr.js → wardleyDiagram-T6FBY63Y-BX2Cda3l.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-Dr1C4AQz.js → xychartDiagram-ELKLHX3M-D9S892ph.js} +1 -1
- package/dist/worker/console/static/index.html +7 -2
- package/dist/worker/console/static-src/active-run-badge.js +17 -0
- package/dist/worker/console/static-src/app/console-types.js +68 -4
- package/dist/worker/console/static-src/app/useConsoleShell.js +30 -12
- package/dist/worker/console/static-src/app/useOperatorActions.js +43 -7
- package/dist/worker/console/static-src/app/useRecoveryActions.js +2 -2
- package/dist/worker/console/static-src/app/useRecoveryConsole.js +45 -10
- package/dist/worker/console/static-src/app/useRunProgress.js +54 -0
- package/dist/worker/console/static-src/app/useTaskWizard.js +74 -2
- package/dist/worker/console/static-src/night/useNightBoard.js +8 -5
- 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 +264 -13
- package/dist/worker/console/static-src/operator-chat/compaction-message.js +113 -0
- package/dist/worker/console/static-src/operator-chat/dag-progress-link.js +22 -0
- package/dist/worker/console/static-src/operator-chat/details-dag-actions.js +122 -0
- package/dist/worker/console/static-src/operator-chat/input-history.js +78 -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 +338 -0
- package/dist/worker/console/static-src/operator-chat/refs.js +3 -0
- package/dist/worker/console/static-src/operator-chat/runtime-selection-labels.js +27 -0
- package/dist/worker/console/static-src/operator-chat/runtime-snapshot-store.js +10 -0
- package/dist/worker/console/static-src/operator-chat/spatial-overlay.js +1 -2
- package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +33 -1
- package/dist/worker/console/static-src/operator-chat/turn-submission.js +55 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +448 -109
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +344 -27
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +323 -11
- package/dist/worker/console/static-src/operator-chat/useComposer.js +45 -4
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +97 -13
- package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +57 -9
- package/dist/worker/console/static-src/operator-chat/useRuntimeSnapshot.js +8 -2
- package/dist/worker/console/static-src/operator-chat/useWorkspaceBrowserGate.js +4 -0
- package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +3 -3
- package/dist/worker/console/static-src/operator-chat/workspace-reorder.js +18 -0
- 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 +216 -0
- package/dist/worker/console/static-src/shell/console-update-reload.js +52 -0
- package/dist/worker/console/static-src/shell/useWorkspaces.js +415 -0
- package/dist/worker/console/static-src/shell/workspace-route.js +356 -0
- package/dist/worker/console/workspace-context.js +399 -0
- package/dist/worker/console/workspace-registry.js +487 -0
- package/dist/worker/continuation/worker-continuation.js +278 -0
- package/dist/worker/loop-agent/loop-agent-client.js +7 -3
- package/dist/worker/materialize/frontend-split-task-materializer.js +72 -0
- package/dist/worker/materialize/harness-task-lineage.js +5 -2
- package/dist/worker/observability/init-runtime-activity.js +26 -0
- package/dist/worker/observability/read-model.js +26 -0
- package/dist/worker/observe/health.js +1 -1
- package/dist/worker/observe/node-input.js +160 -3
- package/dist/worker/observe/node-process.js +377 -0
- package/dist/worker/observe/node-transparency.js +572 -0
- package/dist/worker/observe/routes.js +278 -3
- package/dist/worker/observe/server.js +4 -0
- package/dist/worker/observe/shell-handler-keys.js +34 -0
- package/dist/worker/observe/static/api.js +154 -4
- package/dist/worker/observe/static/app.js +18 -70
- package/dist/worker/observe/static/constants.js +26 -19
- package/dist/worker/observe/static/dag-context-reason-labels.d.ts +9 -0
- package/dist/worker/observe/static/dag-context-reason-labels.js +139 -0
- package/dist/worker/observe/static/dag-helpers.js +4 -2
- package/dist/worker/observe/static/dag-history-labels.js +5 -0
- package/dist/worker/observe/static/dag-inspector-humanize.d.ts +16 -0
- package/dist/worker/observe/static/dag-inspector-humanize.js +339 -0
- package/dist/worker/observe/static/dag-node-purpose.d.ts +6 -0
- package/dist/worker/observe/static/dag-node-purpose.js +208 -0
- package/dist/worker/observe/static/format.js +60 -0
- package/dist/worker/observe/static/index.html +10 -5
- package/dist/worker/observe/static/inspect-bootstrap.d.ts +8 -0
- package/dist/worker/observe/static/inspect-bootstrap.js +57 -0
- package/dist/worker/observe/static/inspect-workspace.js +374 -0
- package/dist/worker/observe/static/kpi.js +2 -2
- package/dist/worker/observe/static/markdown-render.js +20 -1
- package/dist/worker/observe/static/operator-chrome.css +168 -24
- package/dist/worker/observe/static/operator-chrome.d.ts +30 -5
- package/dist/worker/observe/static/operator-chrome.js +354 -101
- package/dist/worker/observe/static/prompt-restart-candidates.d.ts +18 -0
- package/dist/worker/observe/static/prompt-restart-candidates.js +38 -0
- package/dist/worker/observe/static/relations.js +7 -7
- package/dist/worker/observe/static/router.d.ts +57 -0
- package/dist/worker/observe/static/router.js +67 -1
- package/dist/worker/observe/static/run-processing.js +4 -2
- package/dist/worker/observe/static/shell-chrome.js +2 -2
- package/dist/worker/observe/static/state.d.ts +50 -0
- package/dist/worker/observe/static/state.js +191 -1
- package/dist/worker/observe/static/styles.css +1720 -86
- package/dist/worker/observe/static/views/dag-graph.js +5 -3
- package/dist/worker/observe/static/views/dag-inspector.js +2601 -188
- package/dist/worker/observe/static/views/dag.d.ts +13 -0
- package/dist/worker/observe/static/views/dag.js +39 -18
- package/dist/worker/observe/static/views/dags.js +10 -6
- package/dist/worker/observe/static/views/dashboard.js +18 -8
- package/dist/worker/observe/static/views/failures.js +5 -2
- package/dist/worker/observe/static/views/night.js +2 -2
- package/dist/worker/observe/static/views/pool.js +8 -2
- package/dist/worker/observe/static/views/run.js +15 -4
- package/dist/worker/observe/static/views/session-timeline.js +386 -25
- package/dist/worker/observe/static/views/task.js +63 -3
- package/dist/worker/outcomes/adapters.js +19 -0
- package/dist/worker/outcomes/types.js +1 -0
- package/dist/worker/pool/attempt-lease.js +97 -66
- package/dist/worker/pool/begin-attempt-with-lease.js +1 -0
- package/dist/worker/pool/reconcile.js +46 -1
- package/dist/worker/pool/run-store.js +2 -0
- package/dist/worker/pool/state-projection.js +2 -0
- package/dist/worker/task-spec/workflow-routing.js +8 -3
- package/dist/workflows/dag/artifact-bindings.js +149 -0
- package/dist/workflows/dag/artifact-revision-schema-registry.js +31 -0
- package/dist/workflows/dag/backend-test-case-coverage-analysis.js +470 -31
- package/dist/workflows/dag/backend-test-markdown-workflow.js +189 -2
- package/dist/workflows/dag/backend-test-plan-protocol.js +210 -0
- package/dist/workflows/dag/backend-test-pytest-collection.js +168 -16
- package/dist/workflows/dag/backend-test-result-contract.js +5 -1
- package/dist/workflows/dag/backend-test-scenario-param.js +506 -73
- package/dist/workflows/dag/backend-test-scenario-partitions.js +135 -2
- package/dist/workflows/dag/backend-test-writer-completeness.js +131 -28
- package/dist/workflows/dag/budget-enforcement.js +10 -0
- package/dist/workflows/dag/context-receipt.js +305 -0
- package/dist/workflows/dag/context-transfer/context-bundle.js +423 -0
- package/dist/workflows/dag/context-transfer/operator-actions.js +61 -0
- package/dist/workflows/dag/context-transfer/renderers.js +93 -0
- package/dist/workflows/dag/contract-output-registry.js +15 -0
- package/dist/workflows/dag/contract-validator-registrations.js +1 -2
- package/dist/workflows/dag/convergence/controller.js +141 -0
- package/dist/workflows/dag/dag-retry-schema.js +138 -0
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +1 -1
- package/dist/workflows/dag/dynamic-runtime/map.js +17 -3
- package/dist/workflows/dag/failure-category.js +7 -116
- package/dist/workflows/dag/frontend-closeout.js +221 -0
- package/dist/workflows/dag/frontend-design-policy.js +400 -0
- package/dist/workflows/dag/frontend-human-decision.js +182 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +1377 -141
- package/dist/workflows/dag/frontend-plan-render.js +26 -1
- package/dist/workflows/dag/frontend-prewrite-gate.js +376 -318
- package/dist/workflows/dag/frontend-provider-capability-matrix.js +159 -0
- package/dist/workflows/dag/frontend-recovery-capsule.js +455 -0
- package/dist/workflows/dag/frontend-recovery-controller.js +226 -0
- package/dist/workflows/dag/frontend-recovery-lineage.js +178 -0
- package/dist/workflows/dag/frontend-recovery-plan.js +21 -10
- package/dist/workflows/dag/frontend-recovery-run.js +166 -34
- package/dist/workflows/dag/frontend-repair.js +7 -424
- package/dist/workflows/dag/frontend-review-context.js +348 -20
- package/dist/workflows/dag/frontend-review-findings.js +270 -0
- package/dist/workflows/dag/frontend-risk.js +15 -2
- package/dist/workflows/dag/frontend-shadow-dual-write.js +941 -0
- package/dist/workflows/dag/frontend-shape-capsule-store.js +191 -0
- package/dist/workflows/dag/frontend-shape-facts.js +419 -0
- package/dist/workflows/dag/frontend-shape.js +435 -0
- package/dist/workflows/dag/frontend-source-fidelity-ledger.js +108 -0
- package/dist/workflows/dag/frontend-split-application-service.js +203 -0
- package/dist/workflows/dag/frontend-split-orchestrator.js +899 -0
- package/dist/workflows/dag/frontend-test-case-checklist.js +32 -4
- package/dist/workflows/dag/frontend-test-case-generation-assessment.js +69 -0
- package/dist/workflows/dag/frontend-test-case-manifest.js +17 -5
- 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 +202 -42
- package/dist/workflows/dag/frontend-test-standard-scenarios.js +70 -0
- package/dist/workflows/dag/frontend-typed-event-store.js +452 -0
- package/dist/workflows/dag/frontend-typed-event-transaction.js +180 -0
- package/dist/workflows/dag/frontend-verification-trace.js +281 -29
- package/dist/workflows/dag/frontend-worktree-diff.js +250 -17
- package/dist/workflows/dag/frontend-writer-admission.js +319 -0
- package/dist/workflows/dag/frontend-writer-rollback.js +32 -0
- package/dist/workflows/dag/frontend-writer-status.js +256 -0
- package/dist/workflows/dag/init-hybrid.js +1771 -717
- package/dist/workflows/dag/interrupt-request.js +10 -3
- package/dist/workflows/dag/lifecycle.js +3 -3
- package/dist/workflows/dag/node-execution.js +1141 -32
- package/dist/workflows/dag/path-safety.js +1 -0
- package/dist/workflows/dag/prompt.js +158 -7
- package/dist/workflows/dag/recovery-lease.js +170 -0
- package/dist/workflows/dag/report.js +37 -1
- package/dist/workflows/dag/rerun-feedback.js +526 -0
- package/dist/workflows/dag/rerun-plan.js +790 -28
- package/dist/workflows/dag/rerun-run.js +700 -21
- package/dist/workflows/dag/rerun-task.js +311 -14
- package/dist/workflows/dag/retry-policy.js +336 -101
- package/dist/workflows/dag/runner.js +596 -121
- package/dist/workflows/dag/scheduler.js +133 -20
- package/dist/workflows/dag/skill-snapshot.js +17 -0
- package/dist/workflows/dag/structured-output-repair.js +712 -0
- package/dist/workflows/dag/types.js +600 -31
- package/dist/workflows/dag/validate.js +92 -32
- package/docs/README.md +2 -0
- package/docs/architecture/evolution.md +45 -0
- package/docs/architecture/runtime-boundaries.md +8 -7
- package/docs/architecture/worker-and-feature.md +1 -1
- package/docs/examples/README.md +5 -0
- package/docs/init-surface.manifest.json +36 -12
- package/docs/operations/README.md +1 -1
- package/docs/operations/local-development-environment.md +22 -5
- package/docs/skills/vetted-skill-registry.md +16 -0
- package/docs/templates/README.md +4 -2
- package/docs/templates/agent-dag-report.schema.json +8 -2
- package/docs/templates/agent-dag.schema.json +95 -1
- package/docs/templates/backend-test-dag.json +278 -244
- package/docs/templates/frontend-implementation-contract.schema.json +684 -24
- package/docs/templates/frontend-implementation-dag.json +89 -0
- package/docs/templates/frontend-test-case-checklist.md +2 -2
- package/docs/templates/frontend-test-dag.json +10 -12
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +1 -1
- package/docs/templates/init-managed-agents.md +13 -3
- package/docs/templates/product-line/task.yaml +1 -1
- package/docs/templates/spec-registry.schema.json +45 -0
- package/harness.json +2 -2
- package/package.json +19 -5
- 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-bounded-implement/SKILL.md +15 -14
- package/skills/frontend-bounded-implement/references/code-standards.md +19 -0
- package/skills/frontend-contract/SKILL.md +23 -0
- package/skills/frontend-contract/references/contract-protocol.md +34 -0
- package/skills/frontend-design-review/SKILL.md +22 -41
- package/skills/frontend-plan/SKILL.md +26 -0
- package/skills/frontend-plan/references/decision-contract.md +37 -0
- package/skills/frontend-plan/references/design-decisions.md +17 -0
- package/skills/frontend-review/SKILL.md +20 -15
- package/skills/frontend-review/references/review-findings.md +6 -7
- package/skills/frontend-scout/SKILL.md +25 -0
- package/skills/frontend-scout/references/design-evidence.md +16 -0
- package/skills/frontend-scout/references/scout-evidence.md +23 -0
- package/skills/frontend-verification/SKILL.md +1 -1
- 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 +32 -4
- package/skills/loop-agent/references/hybrid-dag.md +9 -2
- package/skills/playwright-cli/SKILL.md +23 -1
- package/skills/playwright-cli-case-generator/SKILL.md +50 -13
- package/dist/worker/console/operation-store.js +0 -169
- package/dist/worker/console/static/assets/channel-Tl-FkUqr.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-BaehtRk4.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-BaehtRk4.js +0 -1
- package/dist/worker/console/static/assets/index-B7Y-0g3J.css +0 -1
- package/dist/worker/console/static/assets/index-DkCrqaYg.js +0 -325
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-eEhq2A8Y.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-la8AC7fo.js +0 -8
- package/dist/worker/console/static-src/operator-chat/activity-rail-presentation.js +0 -73
- package/dist/worker/console/static-src/operator-chat/useActivityRailTransition.js +0 -59
- package/skills/frontend-implementation/SKILL.md +0 -52
- package/skills/frontend-implementation/references/code-standards.md +0 -33
- package/skills/frontend-implementation/references/design-spec.md +0 -56
- package/skills/frontend-implementation/references/node-contracts.md +0 -31
- /package/dist/{worker → infrastructure}/console/repo-fingerprint.js +0 -0
|
@@ -35,12 +35,75 @@ export const scenarioPartitionRowSchema = z.object({
|
|
|
35
35
|
const PARTITION_HEADING = /^##\s+Scenario Partitions\s*$/;
|
|
36
36
|
const PARTITION_TABLE_HEADER = /^\|\s*Partition ID\s*\|\s*Operation\s*\|\s*Axis\s*\|\s*Domain\s*\|\s*Required Slots\s*\|\s*Expected by Slot\s*\|\s*Bind Rule\s*\|\s*$/;
|
|
37
37
|
const TABLE_ROW = /^\|(.+)\|$/;
|
|
38
|
+
const FINITE_DOMAIN_MEMBER = /^[A-Za-z0-9]+(?:[._\- ][A-Za-z0-9]+)*$/;
|
|
39
|
+
const RESERVED_SLOT_TOKENS = new Set(["OMITTED", "NOT-IN-SET"]);
|
|
38
40
|
function splitCells(raw) {
|
|
39
41
|
return raw
|
|
40
42
|
.split("|")
|
|
41
43
|
.map((cell) => cell.trim())
|
|
42
44
|
.filter((cell, index, cells) => !(cell === "" && (index === 0 || index === cells.length - 1)));
|
|
43
45
|
}
|
|
46
|
+
function isExactSlotInventory(extras, partitionId) {
|
|
47
|
+
const tokens = extras
|
|
48
|
+
.join(";")
|
|
49
|
+
.split(/[;,,;]/)
|
|
50
|
+
.map((token) => token.trim().replace(/`/g, ""))
|
|
51
|
+
.filter((token) => token.length > 0);
|
|
52
|
+
if (tokens.length === 0)
|
|
53
|
+
return false;
|
|
54
|
+
const prefix = `TP-${partitionId.trim().toUpperCase()}-`;
|
|
55
|
+
return tokens.every((token) => /^TP-[A-Z0-9-]+$/i.test(token) &&
|
|
56
|
+
(token.toUpperCase().startsWith(prefix) || token.toUpperCase().startsWith("TP-SP-")));
|
|
57
|
+
}
|
|
58
|
+
function trimExactSlotInventoryCells(cells) {
|
|
59
|
+
if (cells.length <= 7)
|
|
60
|
+
return { cells, trimmed: false };
|
|
61
|
+
const partitionId = cells[0] ?? "";
|
|
62
|
+
if (!isExactSlotInventory(cells.slice(7), partitionId)) {
|
|
63
|
+
return { cells, trimmed: false };
|
|
64
|
+
}
|
|
65
|
+
return { cells: cells.slice(0, 7), trimmed: true };
|
|
66
|
+
}
|
|
67
|
+
export function canonicalizeScenarioPartitionTable(markdown) {
|
|
68
|
+
const lines = markdown.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n");
|
|
69
|
+
const headingIndex = lines.findIndex((line) => PARTITION_HEADING.test(line.trim()));
|
|
70
|
+
if (headingIndex === -1) {
|
|
71
|
+
return { markdown: lines.join("\n"), changed: false, trimmedRows: 0 };
|
|
72
|
+
}
|
|
73
|
+
let headerIndex = -1;
|
|
74
|
+
let sectionEnd = lines.length;
|
|
75
|
+
for (let i = headingIndex + 1; i < lines.length; i++) {
|
|
76
|
+
if (/^##\s+/.test(lines[i].trim()) && !PARTITION_HEADING.test(lines[i].trim())) {
|
|
77
|
+
sectionEnd = i;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
if (PARTITION_TABLE_HEADER.test(lines[i])) {
|
|
81
|
+
headerIndex = i;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (headerIndex === -1) {
|
|
85
|
+
return { markdown: lines.join("\n"), changed: false, trimmedRows: 0 };
|
|
86
|
+
}
|
|
87
|
+
let trimmedRows = 0;
|
|
88
|
+
for (let i = headerIndex + 2; i < sectionEnd; i++) {
|
|
89
|
+
const line = lines[i];
|
|
90
|
+
if (!TABLE_ROW.test(line)) {
|
|
91
|
+
if (/^##\s+/.test(line) || /^#\s+/.test(line))
|
|
92
|
+
break;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const { cells, trimmed } = trimExactSlotInventoryCells(splitCells(line));
|
|
96
|
+
if (!trimmed)
|
|
97
|
+
continue;
|
|
98
|
+
lines[i] = `| ${cells.join(" | ")} |`;
|
|
99
|
+
trimmedRows += 1;
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
markdown: lines.join("\n"),
|
|
103
|
+
changed: trimmedRows > 0,
|
|
104
|
+
trimmedRows,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
44
107
|
/**
|
|
45
108
|
* Parse the `## Scenario Partitions` section of the README into declared
|
|
46
109
|
* partitions. Returns { partitions, issues }; issues are fail-closed parse
|
|
@@ -75,7 +138,7 @@ export function parseScenarioPartitions(readmeMarkdown) {
|
|
|
75
138
|
break;
|
|
76
139
|
continue;
|
|
77
140
|
}
|
|
78
|
-
const cells = splitCells(line);
|
|
141
|
+
const { cells } = trimExactSlotInventoryCells(splitCells(line));
|
|
79
142
|
if (cells.length !== 7) {
|
|
80
143
|
issues.push(`MISSING_PARTITION: row has ${cells.length} cells, expected 7: ${line.trim()}`);
|
|
81
144
|
continue;
|
|
@@ -100,6 +163,11 @@ export function parseScenarioPartitions(readmeMarkdown) {
|
|
|
100
163
|
continue;
|
|
101
164
|
}
|
|
102
165
|
seen.add(partitionId);
|
|
166
|
+
const domainIssue = describeInvalidPartitionDomain(domain);
|
|
167
|
+
if (domainIssue) {
|
|
168
|
+
issues.push(`INVALID_PARTITION_DOMAIN: partition ${partitionId} ${domainIssue}`);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
103
171
|
partitions.push({
|
|
104
172
|
partitionId,
|
|
105
173
|
operation,
|
|
@@ -119,6 +187,40 @@ function slotToken(value) {
|
|
|
119
187
|
.replace(/[^A-Z0-9]+/g, "-")
|
|
120
188
|
.replace(/^-+|-+$/g, "");
|
|
121
189
|
}
|
|
190
|
+
function describeInvalidPartitionDomain(domain) {
|
|
191
|
+
const tokens = [];
|
|
192
|
+
const seenTokens = new Set();
|
|
193
|
+
for (const value of domain) {
|
|
194
|
+
if (!FINITE_DOMAIN_MEMBER.test(value)) {
|
|
195
|
+
return `value is not a finite identifier member: ${value}`;
|
|
196
|
+
}
|
|
197
|
+
const token = slotToken(value);
|
|
198
|
+
if (!token) {
|
|
199
|
+
return `value cannot produce a stable non-empty slot token: ${value}`;
|
|
200
|
+
}
|
|
201
|
+
if (RESERVED_SLOT_TOKENS.has(token)) {
|
|
202
|
+
return `value maps to reserved slot token ${token}: ${value}`;
|
|
203
|
+
}
|
|
204
|
+
if (seenTokens.has(token)) {
|
|
205
|
+
return `values collapse to duplicate slot token ${token}`;
|
|
206
|
+
}
|
|
207
|
+
seenTokens.add(token);
|
|
208
|
+
tokens.push(token);
|
|
209
|
+
}
|
|
210
|
+
return tokens.length === 0 ? "domain produced no slot tokens" : undefined;
|
|
211
|
+
}
|
|
212
|
+
function normalizePartitionAxisName(value) {
|
|
213
|
+
return value.trim().replace(/^(?:query|path)\s*:\s*/i, "").toLowerCase();
|
|
214
|
+
}
|
|
215
|
+
function normalizePartitionOperation(value) {
|
|
216
|
+
return value.trim().replace(/\s+/g, " ").toUpperCase();
|
|
217
|
+
}
|
|
218
|
+
function sameFiniteSet(left, right) {
|
|
219
|
+
if (left.length !== right.length)
|
|
220
|
+
return false;
|
|
221
|
+
const expected = new Set(left);
|
|
222
|
+
return right.every((value) => expected.has(value));
|
|
223
|
+
}
|
|
122
224
|
const STABLE_PARTITION_ID = /^SP-[A-Z0-9][A-Z0-9._-]*$/i;
|
|
123
225
|
/**
|
|
124
226
|
* Slot IDs are `TP-<Partition ID>-<VALUE|OMITTED|NOT-IN-SET>`.
|
|
@@ -138,13 +240,16 @@ function partitionToken(row) {
|
|
|
138
240
|
export function expandScenarioPartitions(partitions) {
|
|
139
241
|
const slots = [];
|
|
140
242
|
for (const row of partitions) {
|
|
243
|
+
if (describeInvalidPartitionDomain(row.domain))
|
|
244
|
+
continue;
|
|
141
245
|
const prefix = partitionToken(row);
|
|
142
246
|
for (const value of row.domain) {
|
|
247
|
+
const token = slotToken(value);
|
|
143
248
|
slots.push({
|
|
144
249
|
partitionId: row.partitionId,
|
|
145
250
|
operation: row.operation,
|
|
146
251
|
axis: row.axis,
|
|
147
|
-
slotId: `${prefix}-${
|
|
252
|
+
slotId: `${prefix}-${token}`,
|
|
148
253
|
kind: "each-value",
|
|
149
254
|
value,
|
|
150
255
|
intent: "nominal-filter",
|
|
@@ -176,6 +281,34 @@ export function expandScenarioPartitions(partitions) {
|
|
|
176
281
|
}
|
|
177
282
|
return slots;
|
|
178
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Bind parsed partitions to GET query/path OpenAPI axes.
|
|
286
|
+
* Unconfirmed axes keep identifier-valid Domain rows (requirement finite sets).
|
|
287
|
+
*/
|
|
288
|
+
export function applyOpenApiPartitionDomainPolicy(partitions, axes) {
|
|
289
|
+
const issues = [];
|
|
290
|
+
const valid = [];
|
|
291
|
+
for (const row of partitions) {
|
|
292
|
+
const operation = normalizePartitionOperation(row.operation);
|
|
293
|
+
const axisName = normalizePartitionAxisName(row.axis);
|
|
294
|
+
const matched = axes.find((axis) => normalizePartitionOperation(axis.operation) === operation &&
|
|
295
|
+
normalizePartitionAxisName(axis.name) === axisName);
|
|
296
|
+
if (!matched) {
|
|
297
|
+
valid.push(row);
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if (matched.enumValues === null) {
|
|
301
|
+
issues.push(`NO_FINITE_DOMAIN: partition ${row.partitionId} axis ${row.axis} exists on ${row.operation} without a documented enum`);
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
if (!sameFiniteSet(matched.enumValues, row.domain)) {
|
|
305
|
+
issues.push(`PARTITION_SOURCE_MISMATCH: partition ${row.partitionId} domain does not match OpenAPI enum for ${row.operation} ${row.axis}`);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
valid.push(row);
|
|
309
|
+
}
|
|
310
|
+
return { partitions: valid, issues };
|
|
311
|
+
}
|
|
179
312
|
/** Facts projection consumed by N6 and plan D gap-fill. */
|
|
180
313
|
export const scenarioPartitionFactsSchema = z.object({
|
|
181
314
|
partitions: z.array(z.object({
|
|
@@ -4,6 +4,8 @@ import path from "node:path";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { BACKEND_TEST_MAX_MODULE_COUNT, isOpaqueHashBackendTestModuleStem, isPriorityOnlyBackendTestModuleStem, } from "./backend-test-module-stem.js";
|
|
6
6
|
import { resolveBackendTestLayout, } from "./backend-test-layout.js";
|
|
7
|
+
import { canonicalizeBackendTestMarkdownTestPointBindings, inspectBackendTestMarkdownTestPointBindings, } from "./backend-test-case-coverage-analysis.js";
|
|
8
|
+
import { BACKEND_TEST_SCENARIO_PARTITION_SLOTS_SCHEMA_ID, canonicalizeBackendTestPlanProtocolHeadings, collectMarkdownPartitionSlotCoverage, lookupRequiredVariantSlotsForMarkdownPath, } from "./backend-test-plan-protocol.js";
|
|
7
9
|
/**
|
|
8
10
|
* Maps a backend-test generation writer task id to its writer-progress role.
|
|
9
11
|
* Returns undefined for nodes that are not completeness-gated generators.
|
|
@@ -46,8 +48,16 @@ const progressSchema = z
|
|
|
46
48
|
path: z.string().optional(),
|
|
47
49
|
detail: z.string(),
|
|
48
50
|
recoverable: z.boolean(),
|
|
51
|
+
failureSubreason: z.literal("markdown-test-point-binding-format").optional(),
|
|
52
|
+
affectedCases: z.array(z.string()).optional(),
|
|
53
|
+
testPointIds: z.array(z.string()).optional(),
|
|
54
|
+
canonicalizationEligible: z.boolean().optional(),
|
|
55
|
+
canonicalizationOutcome: z.enum(["not-attempted", "changed", "already-canonical", "unsafe", "revalidation-failed"]).optional(),
|
|
49
56
|
})
|
|
50
57
|
.strict()),
|
|
58
|
+
canonicalizationOutcome: z.enum(["not-attempted", "changed", "already-canonical", "unsafe", "revalidation-failed"]).optional(),
|
|
59
|
+
canonicalizedTestPointCount: z.number().int().min(0).optional(),
|
|
60
|
+
lightweightRepairEligible: z.boolean().optional(),
|
|
51
61
|
})
|
|
52
62
|
.strict();
|
|
53
63
|
async function exists(filePath) {
|
|
@@ -118,10 +128,8 @@ function looksLikeValidModuleStem(raw) {
|
|
|
118
128
|
return moduleStemInvalidReason(raw) === undefined;
|
|
119
129
|
}
|
|
120
130
|
function extractCanonicalModuleIndexSection(readme) {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
.replaceAll("\r", "\n")
|
|
124
|
-
.split("\n");
|
|
131
|
+
const canonical = canonicalizeBackendTestPlanProtocolHeadings(readme).markdown;
|
|
132
|
+
const lines = canonical.split("\n");
|
|
125
133
|
const headings = lines.flatMap((line, index) => line.trim() === "## Module Index" ? [index] : []);
|
|
126
134
|
if (headings.length === 0) {
|
|
127
135
|
return { section: "", structureIssues: ["missing-module-index"] };
|
|
@@ -276,6 +284,16 @@ function moduleStructurallyComplete(markdown) {
|
|
|
276
284
|
reasons: [`missing required sections: [${missing.join(", ")}]`],
|
|
277
285
|
};
|
|
278
286
|
}
|
|
287
|
+
const bindingReasons = inspectBackendTestMarkdownTestPointBindings(markdown).flatMap((entry) => [
|
|
288
|
+
...(entry.unclassifiedTestPoints.length > 0
|
|
289
|
+
? [`${entry.caseId} has unclassified Test Points: ${entry.unclassifiedTestPoints.join(", ")}`]
|
|
290
|
+
: []),
|
|
291
|
+
...(entry.duplicateBindingTestPoints.length > 0
|
|
292
|
+
? [`${entry.caseId} has duplicate Test Point bindings: ${entry.duplicateBindingTestPoints.join(", ")}`]
|
|
293
|
+
: []),
|
|
294
|
+
]);
|
|
295
|
+
if (bindingReasons.length > 0)
|
|
296
|
+
return { ok: false, reasons: bindingReasons };
|
|
279
297
|
return { ok: true, reasons: [] };
|
|
280
298
|
}
|
|
281
299
|
function moduleStructuralDetail(result) {
|
|
@@ -351,8 +369,6 @@ function pythonParseable(source) {
|
|
|
351
369
|
const normalized = source.replace(/\r\n/g, "\n");
|
|
352
370
|
if (!normalized.trim())
|
|
353
371
|
return false;
|
|
354
|
-
if (/^\s*(?:def|class|import|from)\b/m.test(normalized) === false)
|
|
355
|
-
return false;
|
|
356
372
|
const structural = pythonStructureOutsideStrings(normalized);
|
|
357
373
|
if (!structural.stringsClosed)
|
|
358
374
|
return false;
|
|
@@ -369,7 +385,13 @@ function pythonParseable(source) {
|
|
|
369
385
|
return false;
|
|
370
386
|
if (openBraces !== closeBraces)
|
|
371
387
|
return false;
|
|
372
|
-
|
|
388
|
+
// Business modules still need a statement. Evidence-only mapped scripts may
|
|
389
|
+
// be a closed module docstring + Case-ID with no `def test_` (R10 health).
|
|
390
|
+
if (/^\s*(?:def|class|import|from|__all__\s*=)/m.test(normalized))
|
|
391
|
+
return true;
|
|
392
|
+
return (/^\s*(?:'''|""")/.test(normalized) &&
|
|
393
|
+
/\bCase-ID\s*:/i.test(normalized) &&
|
|
394
|
+
!/^\s*(?:async\s+)?def\s+test_/m.test(normalized));
|
|
373
395
|
}
|
|
374
396
|
/**
|
|
375
397
|
* Forbidden generated shared helper/factory namespaces for the self-contained
|
|
@@ -385,12 +407,17 @@ export const FORBIDDEN_GENERATED_IMPORT_NAMESPACES = [
|
|
|
385
407
|
"testcase.helpers",
|
|
386
408
|
"testcase.factories",
|
|
387
409
|
];
|
|
388
|
-
const FORBIDDEN_GENERATED_IMPORT_PATTERN = /^\s*(?:from\s+(testcase_helpers|testcase\.helpers|testcase\.factories)\b|import\s+(testcase_helpers|testcase\.helpers|testcase\.factories)\b)/gm;
|
|
410
|
+
const FORBIDDEN_GENERATED_IMPORT_PATTERN = /^\s*(?:from\s+(testcase_helpers|testcase\.helpers|testcase\.factories|__\d+[A-Za-z0-9_]*)\b|import\s+(testcase_helpers|testcase\.helpers|testcase\.factories|__\d+[A-Za-z0-9_]*)\b)/gm;
|
|
389
411
|
/**
|
|
390
|
-
* Scan Python source for imports from forbidden generated shared namespaces
|
|
391
|
-
* Anchored at line start with a word
|
|
392
|
-
* substring inside a docstring
|
|
393
|
-
*
|
|
412
|
+
* Scan Python source for imports from forbidden generated shared namespaces
|
|
413
|
+
* or bare generated-local helper modules. Anchored at line start with a word
|
|
414
|
+
* boundary so `testcase.helpers_other` or a substring inside a docstring is not
|
|
415
|
+
* falsely flagged. In addition to the `testcase_helpers`/`testcase.helpers`/
|
|
416
|
+
* `testcase.factories` namespaces, bare `__<digits>...` helper modules (for
|
|
417
|
+
* example `from __551_manager_helpers import ...` / `import __551_manager_helpers`)
|
|
418
|
+
* are generated-local shared dependencies: a self-contained pytest child must
|
|
419
|
+
* inline or remove them rather than depend on a generated shared module.
|
|
420
|
+
* Returns the list of offending module names (deduplicated, order-preserving).
|
|
394
421
|
*/
|
|
395
422
|
export function findForbiddenGeneratedImports(source) {
|
|
396
423
|
const hits = [];
|
|
@@ -495,6 +522,19 @@ export async function loadBackendTestWriterProgressForRetry(runDir, taskId) {
|
|
|
495
522
|
* child's own target file(s): md children are checked for structural
|
|
496
523
|
* completeness, pytest children for parseability. Sibling modules are ignored.
|
|
497
524
|
*/
|
|
525
|
+
async function loadScenarioPartitionSlotInventory(runDir) {
|
|
526
|
+
if (!runDir)
|
|
527
|
+
return undefined;
|
|
528
|
+
try {
|
|
529
|
+
const raw = JSON.parse(await readFile(path.join(runDir, "contracts", "backend-test-scenario-partition-slots.json"), "utf8"));
|
|
530
|
+
if (raw?.schemaId !== BACKEND_TEST_SCENARIO_PARTITION_SLOTS_SCHEMA_ID)
|
|
531
|
+
return undefined;
|
|
532
|
+
return raw;
|
|
533
|
+
}
|
|
534
|
+
catch {
|
|
535
|
+
return undefined;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
498
538
|
export async function assessBackendTestShardChildCompleteness(input) {
|
|
499
539
|
const role = input.role;
|
|
500
540
|
const targetPaths = input.writeSet
|
|
@@ -504,6 +544,12 @@ export async function assessBackendTestShardChildCompleteness(input) {
|
|
|
504
544
|
const actualPaths = [];
|
|
505
545
|
const missingPaths = [];
|
|
506
546
|
const brokenPaths = [];
|
|
547
|
+
let canonicalizationOutcome = role === "md-generate" ? "already-canonical" : undefined;
|
|
548
|
+
let canonicalizedTestPointCount = 0;
|
|
549
|
+
let lightweightRepairEligible = false;
|
|
550
|
+
const slotInventory = role === "md-generate"
|
|
551
|
+
? await loadScenarioPartitionSlotInventory(input.runDir)
|
|
552
|
+
: undefined;
|
|
507
553
|
for (const target of targetPaths) {
|
|
508
554
|
// Rendered map-child writeSet entries are concrete (e.g.
|
|
509
555
|
// testcase/md/health.md / testcase/test_orders.py); glob-only entries are
|
|
@@ -522,16 +568,65 @@ export async function assessBackendTestShardChildCompleteness(input) {
|
|
|
522
568
|
continue;
|
|
523
569
|
}
|
|
524
570
|
actualPaths.push(target);
|
|
525
|
-
|
|
571
|
+
let body = await readFile(absolute, "utf8");
|
|
526
572
|
if (role === "md-generate") {
|
|
573
|
+
const beforeBindings = inspectBackendTestMarkdownTestPointBindings(body);
|
|
574
|
+
const canonicalization = canonicalizeBackendTestMarkdownTestPointBindings(body);
|
|
575
|
+
if (canonicalization.changed) {
|
|
576
|
+
await writeFile(absolute, canonicalization.markdown, "utf8");
|
|
577
|
+
body = canonicalization.markdown;
|
|
578
|
+
canonicalizationOutcome = "changed";
|
|
579
|
+
canonicalizedTestPointCount += canonicalization.canonicalizedTestPoints.length;
|
|
580
|
+
}
|
|
581
|
+
const afterBindings = inspectBackendTestMarkdownTestPointBindings(body);
|
|
582
|
+
const unresolved = afterBindings.flatMap((entry) => entry.unclassifiedTestPoints);
|
|
583
|
+
const bindingCases = afterBindings
|
|
584
|
+
.filter((entry) => entry.unclassifiedTestPoints.length > 0 || entry.duplicateBindingTestPoints.length > 0)
|
|
585
|
+
.map((entry) => entry.caseId);
|
|
527
586
|
const structural = moduleStructurallyComplete(body);
|
|
587
|
+
const requiredSlots = lookupRequiredVariantSlotsForMarkdownPath(slotInventory, target);
|
|
588
|
+
const slotCoverage = requiredSlots.length > 0
|
|
589
|
+
? collectMarkdownPartitionSlotCoverage(body, requiredSlots)
|
|
590
|
+
: undefined;
|
|
591
|
+
const missingSlots = orderedUnique([
|
|
592
|
+
...(slotCoverage?.missingFromDeclared ?? []),
|
|
593
|
+
...(slotCoverage?.missingFromVariant ?? []),
|
|
594
|
+
]);
|
|
595
|
+
if (missingSlots.length > 0) {
|
|
596
|
+
lightweightRepairEligible = true;
|
|
597
|
+
if (!brokenPaths.includes(target))
|
|
598
|
+
brokenPaths.push(target);
|
|
599
|
+
issues.push({
|
|
600
|
+
code: "T5",
|
|
601
|
+
path: target,
|
|
602
|
+
detail: `incomplete-partition-slot-set: missing ${missingSlots.join(", ")}; Scheme A requires each exact slot as an independent variant Test Point, not Case count or SINGLE/MULTIPLE aliases`,
|
|
603
|
+
recoverable: true,
|
|
604
|
+
affectedCases: afterBindings.map((entry) => entry.caseId),
|
|
605
|
+
testPointIds: missingSlots,
|
|
606
|
+
});
|
|
607
|
+
}
|
|
528
608
|
if (!structural.ok) {
|
|
609
|
+
lightweightRepairEligible = bindingCases.length > 0;
|
|
610
|
+
if (bindingCases.length > 0)
|
|
611
|
+
canonicalizationOutcome = canonicalization.changed ? "revalidation-failed" : "unsafe";
|
|
529
612
|
brokenPaths.push(target);
|
|
613
|
+
const bindingFormatIssue = bindingCases.length > 0;
|
|
530
614
|
issues.push({
|
|
531
615
|
code: "T5",
|
|
532
616
|
path: target,
|
|
533
617
|
detail: moduleStructuralDetail(structural),
|
|
534
618
|
recoverable: true,
|
|
619
|
+
...(bindingFormatIssue
|
|
620
|
+
? {
|
|
621
|
+
failureSubreason: "markdown-test-point-binding-format",
|
|
622
|
+
affectedCases: orderedUnique(bindingCases),
|
|
623
|
+
testPointIds: orderedUnique(unresolved),
|
|
624
|
+
canonicalizationEligible: canonicalization.canonicalizedTestPoints.length > 0,
|
|
625
|
+
canonicalizationOutcome: canonicalization.changed
|
|
626
|
+
? (unresolved.length === 0 ? "changed" : "revalidation-failed")
|
|
627
|
+
: (beforeBindings.some((entry) => entry.unclassifiedTestPoints.length > 0) ? "unsafe" : "already-canonical"),
|
|
628
|
+
}
|
|
629
|
+
: {}),
|
|
535
630
|
});
|
|
536
631
|
}
|
|
537
632
|
}
|
|
@@ -570,6 +665,9 @@ export async function assessBackendTestShardChildCompleteness(input) {
|
|
|
570
665
|
brokenPaths: orderedUnique(brokenPaths),
|
|
571
666
|
targetPaths: recoverableTargets,
|
|
572
667
|
issues,
|
|
668
|
+
...(role === "md-generate"
|
|
669
|
+
? { canonicalizationOutcome, canonicalizedTestPointCount, lightweightRepairEligible }
|
|
670
|
+
: {}),
|
|
573
671
|
};
|
|
574
672
|
}
|
|
575
673
|
export async function assessBackendTestMdWriterCompleteness(workspaceRoot, layout) {
|
|
@@ -593,7 +691,7 @@ export async function assessBackendTestMdWriterCompleteness(workspaceRoot, layou
|
|
|
593
691
|
}
|
|
594
692
|
else {
|
|
595
693
|
actualPaths.push(readmeRel);
|
|
596
|
-
readme = await readFile(readmePath, "utf8");
|
|
694
|
+
readme = canonicalizeBackendTestPlanProtocolHeadings(await readFile(readmePath, "utf8")).markdown;
|
|
597
695
|
if (!readme.includes("## Coverage Scope")) {
|
|
598
696
|
brokenPaths.push(readmeRel);
|
|
599
697
|
issues.push({
|
|
@@ -837,7 +935,7 @@ export async function writeBackendTestWriterProgressArtifacts(input) {
|
|
|
837
935
|
"## Issues",
|
|
838
936
|
"",
|
|
839
937
|
...(input.progress.issues.length
|
|
840
|
-
? input.progress.issues.map((issue) => `- [${issue.code}] ${issue.path ?? "(workspace)"}: ${issue.detail}`)
|
|
938
|
+
? input.progress.issues.map((issue) => `- [${issue.code}] ${issue.path ?? "(workspace)"}: ${issue.detail}${issue.failureSubreason ? `; failureSubreason=${issue.failureSubreason}; canonicalizationOutcome=${issue.canonicalizationOutcome ?? "not-attempted"}; canonicalizationEligible=${issue.canonicalizationEligible ?? false}; affectedCases=${(issue.affectedCases ?? []).join(",") || "none"}; testPointIds=${(issue.testPointIds ?? []).join(",") || "none"}` : ""}`)
|
|
841
939
|
: ["- None"]),
|
|
842
940
|
"",
|
|
843
941
|
`<!-- sha256:${createHash("sha256").update(JSON.stringify(parsed)).digest("hex")} -->`,
|
|
@@ -846,6 +944,16 @@ export async function writeBackendTestWriterProgressArtifacts(input) {
|
|
|
846
944
|
await writeFile(reportPath, body, "utf8");
|
|
847
945
|
return { factsPath, reportPath };
|
|
848
946
|
}
|
|
947
|
+
export function isBackendTestPytestCollectionRepairOutcomeRecoveryCandidate(task) {
|
|
948
|
+
return (task.id === "repair-backend-pytest-collection-pi" &&
|
|
949
|
+
task.executor === "pi" &&
|
|
950
|
+
task.role === "implementer" &&
|
|
951
|
+
task.toolProfile === "write" &&
|
|
952
|
+
task.writePolicy === "exclusive" &&
|
|
953
|
+
(task.writeSet?.length ?? 0) > 0 &&
|
|
954
|
+
task.writerOutcomePolicy?.type === "implementation-outcome-v1" &&
|
|
955
|
+
task.writerOutcomePolicy.requireChangedFiles === true);
|
|
956
|
+
}
|
|
849
957
|
export function isBackendTestCompletenessRetryCandidate(task) {
|
|
850
958
|
if (task.executor !== "pi" || task.role !== "implementer")
|
|
851
959
|
return false;
|
|
@@ -879,28 +987,23 @@ export function isBackendTestShardChildTask(task) {
|
|
|
879
987
|
task.id?.startsWith("generate-backend-pytest-case-"));
|
|
880
988
|
}
|
|
881
989
|
/**
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
885
|
-
* must NOT require module files to exist at plan time.
|
|
990
|
+
* Historical classifier for the Markdown plan node. Current backend-test N2
|
|
991
|
+
* is read-only and persists a run-owned plan.md, so writer completeness never
|
|
992
|
+
* invokes the workspace README assessment below for newly generated DAGs.
|
|
886
993
|
*/
|
|
887
994
|
export function isBackendTestMdPlanTask(task) {
|
|
888
995
|
return task.id === "generate-backend-md-plan-pi";
|
|
889
996
|
}
|
|
890
997
|
/**
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
* scripts are produced by the downstream map_agent children, so the Gate
|
|
894
|
-
* must NOT require mapped pytest scripts to exist at plan time.
|
|
998
|
+
* Historical classifier for the former shared-resources pytest writer. Current
|
|
999
|
+
* N7 is static and every map child writes one self-contained pytest module.
|
|
895
1000
|
*/
|
|
896
1001
|
export function isBackendTestPytestPlanTask(task) {
|
|
897
1002
|
return task.id === "generate-backend-pytest-plan-pi";
|
|
898
1003
|
}
|
|
899
1004
|
/**
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
* index), WITHOUT requiring the indexed module files to exist yet — those are
|
|
903
|
-
* written by the downstream map_agent shard children.
|
|
1005
|
+
* Legacy workspace-plan completeness helper retained for isolated historical
|
|
1006
|
+
* fixtures. New DAGs validate the run-owned plan artifact in N3 instead.
|
|
904
1007
|
*/
|
|
905
1008
|
export async function assessBackendTestMdPlanCompleteness(workspaceRoot, layout) {
|
|
906
1009
|
const resolvedPlan = layout ?? resolveBackendTestLayout(undefined);
|
|
@@ -922,7 +1025,7 @@ export async function assessBackendTestMdPlanCompleteness(workspaceRoot, layout)
|
|
|
922
1025
|
}
|
|
923
1026
|
else {
|
|
924
1027
|
actualPaths.push(planReadmeRel);
|
|
925
|
-
const readme = await readFile(readmePath, "utf8");
|
|
1028
|
+
const readme = canonicalizeBackendTestPlanProtocolHeadings(await readFile(readmePath, "utf8")).markdown;
|
|
926
1029
|
if (!readme.includes("## Coverage Scope")) {
|
|
927
1030
|
brokenPaths.push(planReadmeRel);
|
|
928
1031
|
issues.push({
|
|
@@ -8,9 +8,19 @@ export function initRunBudgetLedger(state, budget) {
|
|
|
8
8
|
state.budgetLedger = createBudgetLedger(budget);
|
|
9
9
|
}
|
|
10
10
|
function wallTimeMs(state, now = Date.now()) {
|
|
11
|
+
const lineage = state.continuation?.budgetLineage;
|
|
12
|
+
if (lineage) {
|
|
13
|
+
return (lineage.inheritedConsumed.wallTimeMs +
|
|
14
|
+
Math.max(0, now - new Date(lineage.inheritedAt).getTime()));
|
|
15
|
+
}
|
|
11
16
|
return Math.max(0, now - new Date(state.startedAt).getTime());
|
|
12
17
|
}
|
|
13
18
|
function repairPasses(state) {
|
|
19
|
+
const lineage = state.continuation?.budgetLineage;
|
|
20
|
+
if (lineage) {
|
|
21
|
+
return (lineage.inheritedConsumed.repairPasses +
|
|
22
|
+
Math.max(0, (state.convergence?.currentPass ?? 1) - 1));
|
|
23
|
+
}
|
|
14
24
|
return state.convergence?.currentPass ?? 0;
|
|
15
25
|
}
|
|
16
26
|
export function applyHardBudgetBreach(state, breach) {
|