@tea-agent/loop-agent 0.1.0-fe-test.2 → 0.1.0-fe-test.4
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 +4321 -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 +1443 -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 +2 -1
- 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 +53 -5
- package/dist/workflows/dag/frontend-test-case-manifest.js +11 -4
- package/dist/workflows/dag/frontend-test-case-quality.js +11 -16
- package/dist/workflows/dag/frontend-test-environment-probe.js +230 -0
- package/dist/workflows/dag/frontend-test-html-report.js +3 -1
- package/dist/workflows/dag/frontend-test-l5-report.js +3 -1
- package/dist/workflows/dag/frontend-test-layout.js +159 -0
- package/dist/workflows/dag/frontend-test-markdown.js +61 -0
- package/dist/workflows/dag/frontend-test-rerun-candidates.js +103 -0
- package/dist/workflows/dag/frontend-test-result-contract.js +188 -42
- package/dist/workflows/dag/frontend-test-standard-scenarios.js +70 -0
- package/dist/workflows/dag/frontend-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 +1675 -721
- 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 +585 -31
- package/dist/workflows/dag/validate.js +93 -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 +8 -10
- 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
|
@@ -20,6 +20,14 @@ export const backendPytestCollectionFindingSchema = z.object({
|
|
|
20
20
|
classification: z.literal("test-asset-defect"),
|
|
21
21
|
repairability: z.enum(["repairable", "blocked"]),
|
|
22
22
|
detail: z.string().min(1),
|
|
23
|
+
caseId: z.string().min(1).optional(),
|
|
24
|
+
reasonCodes: z.array(z.string().min(1)).optional(),
|
|
25
|
+
repairPaths: z.array(z.string().min(1)).optional(),
|
|
26
|
+
payloadExpectedPaths: z.array(z.string()).optional(),
|
|
27
|
+
payloadObservedPaths: z.array(z.string()).optional(),
|
|
28
|
+
payloadMissingPaths: z.array(z.string()).optional(),
|
|
29
|
+
payloadUnexpectedPaths: z.array(z.string()).optional(),
|
|
30
|
+
payloadEnumMismatches: z.array(z.string()).optional(),
|
|
23
31
|
}).strict();
|
|
24
32
|
export const backendPytestCollectionFactsSchema = z.object({
|
|
25
33
|
schemaId: z.literal("backend-test-pytest-collection-v3"),
|
|
@@ -61,11 +69,22 @@ export const backendPytestCollectionFactsSchema = z.object({
|
|
|
61
69
|
context.addIssue({ code: z.ZodIssueCode.custom, message: "backend pytest fixture resolution without an attempt cannot have an exit code" });
|
|
62
70
|
}
|
|
63
71
|
});
|
|
72
|
+
const backendTestScenarioParamDiagnosticSchema = z.object({
|
|
73
|
+
reasonCode: z.enum(["SCENARIO_PARAM_MISMATCH", "SCENARIO_PARAM_UNDETERMINED"]),
|
|
74
|
+
tpId: z.string().min(1).max(256),
|
|
75
|
+
field: z.string().min(1).max(256).optional(),
|
|
76
|
+
expectedRaw: z.string().max(512).optional(),
|
|
77
|
+
observedRaw: z.string().max(512),
|
|
78
|
+
expectedNormalized: z.string().max(512).optional(),
|
|
79
|
+
observedNormalized: z.string().max(512).optional(),
|
|
80
|
+
sourceLocation: z.string().max(512).optional(),
|
|
81
|
+
}).strict();
|
|
64
82
|
const backendTestExcludedItemSchema = z.object({
|
|
65
83
|
itemId: z.string().min(1),
|
|
66
84
|
caseId: z.string().optional(),
|
|
67
85
|
symbol: z.string().optional(),
|
|
68
86
|
reasons: z.array(z.string().min(1)).min(1),
|
|
87
|
+
scenarioParamDiagnostics: z.array(backendTestScenarioParamDiagnosticSchema).max(16).optional(),
|
|
69
88
|
}).strict();
|
|
70
89
|
export const backendTestExecutionReadinessSchema = z.object({
|
|
71
90
|
schemaId: z.literal("backend-test-execution-readiness-v2"),
|
|
@@ -81,6 +100,14 @@ export const backendTestExecutionReadinessSchema = z.object({
|
|
|
81
100
|
collectedItemIds: z.array(z.string()),
|
|
82
101
|
eligibleItemIds: z.array(z.string()),
|
|
83
102
|
excludedItems: z.array(backendTestExcludedItemSchema),
|
|
103
|
+
exclusionSummary: z.object({
|
|
104
|
+
excludedItemCount: z.number().int().min(0),
|
|
105
|
+
excludedCaseCount: z.number().int().min(0),
|
|
106
|
+
excludedByReason: z.record(z.string(), z.number().int().min(1)),
|
|
107
|
+
excludedByCase: z.record(z.string(), z.number().int().min(1)),
|
|
108
|
+
}).strict(),
|
|
109
|
+
pytestSpawned: z.literal(false),
|
|
110
|
+
businessTestBodyExecutedCount: z.literal(0),
|
|
84
111
|
fixtureIssues: z.array(z.string()),
|
|
85
112
|
assetHashes: z.record(z.string(), z.string().regex(SHA256)),
|
|
86
113
|
eligibilityInputHashes: z.record(z.string(), z.string().regex(SHA256)),
|
|
@@ -131,6 +158,23 @@ function normalizeHazardOccurrenceIdentity(line) {
|
|
|
131
158
|
// Unclosed quote or no out-of-string `#`: do not invent a comment boundary.
|
|
132
159
|
return trimmed;
|
|
133
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Bare `__NNN_*` helper module names imported by a Python source snippet.
|
|
163
|
+
* Only the head token of an `import`/`from` statement is considered a module
|
|
164
|
+
* name; dotted submodules (`__551_manager_helpers.x`) collapse to the head.
|
|
165
|
+
*/
|
|
166
|
+
function importedBareHelperModules(source) {
|
|
167
|
+
const names = [];
|
|
168
|
+
const seen = new Set();
|
|
169
|
+
for (const match of normalizeSourceNewlines(source).matchAll(/\b(?:import|from)\s+([A-Za-z0-9_.]+)/g)) {
|
|
170
|
+
const head = match[1].split(".")[0];
|
|
171
|
+
if (/^__\d+[A-Za-z0-9_]*$/.test(head) && !seen.has(head)) {
|
|
172
|
+
seen.add(head);
|
|
173
|
+
names.push(head);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return names;
|
|
177
|
+
}
|
|
134
178
|
function listPatternOccurrences(source, patternSource, flags = "") {
|
|
135
179
|
const normalized = normalizeSourceNewlines(source);
|
|
136
180
|
const pattern = new RegExp(patternSource, flags.includes("g") ? flags : `${flags}g`);
|
|
@@ -221,6 +265,8 @@ export async function buildBackendPytestAssetInventory(workspaceRoot, mappedScri
|
|
|
221
265
|
const inputHashes = {};
|
|
222
266
|
const hazardOccurrenceCounts = {};
|
|
223
267
|
const hazardOccurrences = {};
|
|
268
|
+
const scriptBareImports = {};
|
|
269
|
+
const mappedScriptSet = new Set(normalizedScripts);
|
|
224
270
|
for (const file of assetFiles) {
|
|
225
271
|
const bytes = await readFile(path.resolve(workspaceRoot, file));
|
|
226
272
|
const source = bytes.toString("utf8");
|
|
@@ -228,8 +274,10 @@ export async function buildBackendPytestAssetInventory(workspaceRoot, mappedScri
|
|
|
228
274
|
const lists = scanRepairHazardOccurrenceLists(source);
|
|
229
275
|
hazardOccurrences[file] = lists;
|
|
230
276
|
hazardOccurrenceCounts[file] = Object.fromEntries(Object.entries(lists).map(([label, identities]) => [label, identities.length]));
|
|
277
|
+
if (mappedScriptSet.has(file))
|
|
278
|
+
scriptBareImports[file] = importedBareHelperModules(source);
|
|
231
279
|
}
|
|
232
|
-
return { mappedScripts: normalizedScripts, assetFiles, inputHashes, hazardOccurrenceCounts, hazardOccurrences };
|
|
280
|
+
return { mappedScripts: normalizedScripts, assetFiles, inputHashes, hazardOccurrenceCounts, hazardOccurrences, scriptBareImports };
|
|
233
281
|
}
|
|
234
282
|
function bounded(value) {
|
|
235
283
|
const normalized = value.replaceAll(/(Bearer|Basic)\s+[A-Za-z0-9._~+\/-]+/gi, "$1 [REDACTED]");
|
|
@@ -237,13 +285,14 @@ function bounded(value) {
|
|
|
237
285
|
? normalized
|
|
238
286
|
: `${normalized.slice(0, MAX_DIAGNOSTIC_CHARS)}\n...[truncated]`;
|
|
239
287
|
}
|
|
240
|
-
function collectionItems(stdout) {
|
|
288
|
+
function collectionItems(stdout, layout) {
|
|
289
|
+
const rootPrefix = `${(layout ?? resolveBackendTestLayout(undefined)).testRoot}/`;
|
|
241
290
|
return [...new Set(stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => {
|
|
242
291
|
if (!line.includes("::"))
|
|
243
292
|
return false;
|
|
244
293
|
if (/^(ERROR|FAILED|E\s+)/.test(line))
|
|
245
294
|
return false;
|
|
246
|
-
return
|
|
295
|
+
return line.replaceAll("\\", "/").startsWith(rootPrefix);
|
|
247
296
|
}).map((line) => line.replaceAll("\\", "/")))];
|
|
248
297
|
}
|
|
249
298
|
function escapeRegExp(value) {
|
|
@@ -308,8 +357,68 @@ function classifyFixtureResolutionFailure(output, layout) {
|
|
|
308
357
|
repairPaths: paths,
|
|
309
358
|
};
|
|
310
359
|
}
|
|
311
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Generated-local bare helper module signatures found in the bound pytest
|
|
362
|
+
* asset inventory. A file such as `testcase/__551_manager_helpers.py` in the
|
|
363
|
+
* test root/script dir is generated-local: when collection reports
|
|
364
|
+
* `No module named '__551_manager_helpers'`, the defect can be precisely
|
|
365
|
+
* attributed to the generated mapped script instead of a missing third-party
|
|
366
|
+
* package.
|
|
367
|
+
*/
|
|
368
|
+
function generatedLocalBareHelperNames(inventory) {
|
|
369
|
+
if (!inventory)
|
|
370
|
+
return [];
|
|
371
|
+
const names = [];
|
|
372
|
+
for (const file of inventory.assetFiles) {
|
|
373
|
+
const stem = path.posix.basename(file).replace(/\.py$/, "");
|
|
374
|
+
if (/^__\d+[A-Za-z0-9_]*$/.test(stem))
|
|
375
|
+
names.push(stem);
|
|
376
|
+
}
|
|
377
|
+
return [...new Set(names)];
|
|
378
|
+
}
|
|
379
|
+
function classifyCollectionFailure(output, evidence) {
|
|
312
380
|
const normalized = output.replaceAll("\\", "/");
|
|
381
|
+
const helperNames = generatedLocalBareHelperNames(evidence?.inventory);
|
|
382
|
+
const helperByLower = new Map(helperNames.map((name) => [name.toLowerCase(), name]));
|
|
383
|
+
// A bare `__NNN_...` module import that collection cannot find is only a
|
|
384
|
+
// candidate generated-local helper signature. REPAIRABLE requires two
|
|
385
|
+
// deterministic pieces of evidence: (1) a helper asset of the same name in
|
|
386
|
+
// the bound inventory, and (2) at least one mapped generated script whose
|
|
387
|
+
// source truly imports that bare module. Without both — or when attribution
|
|
388
|
+
// is impossible — fail closed as BLOCKED so an un-attributable dependency
|
|
389
|
+
// error is never widened into a repair. Genuine third-party modules (no
|
|
390
|
+
// `__NNN_` signature) stay BLOCKED below.
|
|
391
|
+
const missingModule = /No module named ['\"]([^'\"]+)['\"]/i.exec(normalized)?.[1];
|
|
392
|
+
if (missingModule && /^__\d+[A-Za-z0-9_]*$/.test(missingModule)) {
|
|
393
|
+
const helperAsset = helperByLower.get(missingModule.toLowerCase());
|
|
394
|
+
const inventory = evidence?.inventory;
|
|
395
|
+
const scriptBareImports = inventory?.scriptBareImports ?? {};
|
|
396
|
+
const missingLower = missingModule.toLowerCase();
|
|
397
|
+
const importedByMappedScript = inventory
|
|
398
|
+
? inventory.mappedScripts.some((script) => (scriptBareImports[script] ?? []).some((name) => name.toLowerCase() === missingLower))
|
|
399
|
+
: false;
|
|
400
|
+
if (helperAsset && importedByMappedScript && inventory) {
|
|
401
|
+
const repairPaths = [...new Set([
|
|
402
|
+
...(helperAsset
|
|
403
|
+
? inventory.assetFiles.filter((file) => path.posix.basename(file).replace(/\.py$/, "") === helperAsset)
|
|
404
|
+
: []),
|
|
405
|
+
...inventory.mappedScripts,
|
|
406
|
+
])].sort();
|
|
407
|
+
return {
|
|
408
|
+
status: "REPAIRABLE",
|
|
409
|
+
kind: "missing-generated-local-helper",
|
|
410
|
+
detail: `generated testcase asset imports missing bare generated-local helper module ${missingModule}; inline the helper or remove the generated shared dependency`,
|
|
411
|
+
repairPaths,
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
status: "BLOCKED",
|
|
416
|
+
kind: "missing-generated-local-helper-without-evidence",
|
|
417
|
+
detail: helperAsset
|
|
418
|
+
? `missing bare generated-local helper module ${missingModule} has a name match but no mapped generated script imports it (no precise generated-local attribution)`
|
|
419
|
+
: `missing bare __NNN_* module ${missingModule} has no generated-local helper asset in the bound inventory (cannot be precisely attributed)`,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
313
422
|
const blockedPatterns = [
|
|
314
423
|
[/No module named ['\"](?!testcase(?:\.|['\"]))/i, "missing-third-party-module"],
|
|
315
424
|
[/pytest(?:_|-)plugin|pluggy|unknown hook|unrecognized arguments/i, "pytest-plugin-or-config"],
|
|
@@ -335,7 +444,7 @@ function classifyCollectionFailure(output) {
|
|
|
335
444
|
return { status: "BLOCKED", kind: "unclassified-collection-error", detail: "collection failure cannot be safely attributed to generated testcase assets" };
|
|
336
445
|
}
|
|
337
446
|
export function assessBackendPytestCollection(input) {
|
|
338
|
-
const items = collectionItems(input.stdout);
|
|
447
|
+
const items = collectionItems(input.stdout, input.layout);
|
|
339
448
|
const fixtureResolution = input.fixtureResolution ?? { exitCode: 0, stdout: "fixture resolution assumed by direct assessor", stderr: "" };
|
|
340
449
|
if (input.exitCode === 0 && fixtureResolution.exitCode === 0) {
|
|
341
450
|
return backendPytestCollectionFactsSchema.parse({
|
|
@@ -401,7 +510,7 @@ export function assessBackendPytestCollection(input) {
|
|
|
401
510
|
fixtureStderrExcerpt: bounded(fixtureResolution.stderr),
|
|
402
511
|
});
|
|
403
512
|
}
|
|
404
|
-
const classification = classifyCollectionFailure(`${input.stdout}\n${input.stderr}
|
|
513
|
+
const classification = classifyCollectionFailure(`${input.stdout}\n${input.stderr}`, { layout: input.layout, inventory: input.inventory });
|
|
405
514
|
return backendPytestCollectionFactsSchema.parse({
|
|
406
515
|
schemaId: "backend-test-pytest-collection-v3",
|
|
407
516
|
phase: input.phase,
|
|
@@ -412,7 +521,9 @@ export function assessBackendPytestCollection(input) {
|
|
|
412
521
|
fixtureResolutionAttempted: false,
|
|
413
522
|
fixtureResolutionStatus: "NOT_RUN",
|
|
414
523
|
fixtureResolutionExitCode: null,
|
|
415
|
-
repairPaths:
|
|
524
|
+
repairPaths: classification.repairPaths && classification.repairPaths.length > 0
|
|
525
|
+
? classification.repairPaths
|
|
526
|
+
: testcasePythonPaths(`${input.stdout}\n${input.stderr}`),
|
|
416
527
|
mappedScripts: input.inventory.mappedScripts,
|
|
417
528
|
existingMappedScripts: input.inventory.mappedScripts,
|
|
418
529
|
missingMappedScripts: [],
|
|
@@ -618,6 +729,7 @@ export function buildBackendTestItemEligibility(collectedItemIds, input) {
|
|
|
618
729
|
const parameterTokens = orderedUnique((itemId.match(/TP-[A-Z0-9-]+/g) ?? []));
|
|
619
730
|
const mapping = input.correspondenceEntries.find((entry) => symbol && (entry.declaredPrimarySymbol === symbol || entry.pytestSymbols.includes(symbol)));
|
|
620
731
|
const reasons = [];
|
|
732
|
+
const scenarioParamDiagnostics = [];
|
|
621
733
|
if (!mapping)
|
|
622
734
|
reasons.push("no exact Markdown Case/primary-symbol correspondence");
|
|
623
735
|
if (mapping && mapping.status !== "EXACT_1_TO_1")
|
|
@@ -640,13 +752,30 @@ export function buildBackendTestItemEligibility(collectedItemIds, input) {
|
|
|
640
752
|
// or observed Python payload shape.
|
|
641
753
|
const normalizedField = entry.field?.toLowerCase();
|
|
642
754
|
const fieldIsPayloadBound = Boolean(normalizedField && payloadPaths.some((item) => item === normalizedField || item.endsWith(`.${normalizedField}`)));
|
|
643
|
-
if (fieldIsPayloadBound && entry.status !== "MATCH")
|
|
755
|
+
if (fieldIsPayloadBound && entry.status !== "MATCH") {
|
|
644
756
|
reasons.push(`scenario-param ${entry.tpId} field ${entry.field} is ${entry.status}`);
|
|
757
|
+
scenarioParamDiagnostics.push({
|
|
758
|
+
reasonCode: entry.status === "MISMATCH" ? "SCENARIO_PARAM_MISMATCH" : "SCENARIO_PARAM_UNDETERMINED",
|
|
759
|
+
tpId: entry.tpId,
|
|
760
|
+
...(entry.field ? { field: entry.field } : {}),
|
|
761
|
+
...(entry.expectedRaw !== undefined ? { expectedRaw: entry.expectedRaw.slice(0, 512) } : {}),
|
|
762
|
+
observedRaw: (entry.observedRaw ?? "unavailable").slice(0, 512),
|
|
763
|
+
...(entry.expectedNormalized !== undefined ? { expectedNormalized: entry.expectedNormalized.slice(0, 512) } : {}),
|
|
764
|
+
...(entry.observedNormalized !== undefined ? { observedNormalized: entry.observedNormalized.slice(0, 512) } : {}),
|
|
765
|
+
...(entry.sourceLocation ? { sourceLocation: entry.sourceLocation.slice(0, 512) } : {}),
|
|
766
|
+
});
|
|
767
|
+
}
|
|
645
768
|
}
|
|
646
769
|
if (reasons.length === 0)
|
|
647
770
|
eligibleItemIds.push(itemId);
|
|
648
771
|
else
|
|
649
|
-
excludedItems.push({
|
|
772
|
+
excludedItems.push({
|
|
773
|
+
itemId,
|
|
774
|
+
...(mapping?.caseId ? { caseId: mapping.caseId } : {}),
|
|
775
|
+
...(symbol ? { symbol } : {}),
|
|
776
|
+
reasons: orderedUnique(reasons),
|
|
777
|
+
...(scenarioParamDiagnostics.length > 0 ? { scenarioParamDiagnostics: scenarioParamDiagnostics.slice(0, 16) } : {}),
|
|
778
|
+
});
|
|
650
779
|
}
|
|
651
780
|
return { eligibleItemIds, excludedItems };
|
|
652
781
|
}
|
|
@@ -657,7 +786,7 @@ export async function materializeBackendTestExecutionReadiness(input) {
|
|
|
657
786
|
if (input.effective.phase !== "effective" || input.effective.status !== "PASS" || input.effective.fixtureResolutionStatus !== "PASS") {
|
|
658
787
|
throw new Error("backend-test execution readiness requires effective collection and fixture-resolution PASS");
|
|
659
788
|
}
|
|
660
|
-
const current = await buildBackendPytestAssetInventory(input.workspaceRoot, input.effective.mappedScripts);
|
|
789
|
+
const current = await buildBackendPytestAssetInventory(input.workspaceRoot, input.effective.mappedScripts, { layout: input.layout });
|
|
661
790
|
assertSameInventory(input.effective, current);
|
|
662
791
|
const eligibility = input.eligibility ?? { eligibleItemIds: input.effective.collectedItemIds, excludedItems: [] };
|
|
663
792
|
const status = eligibility.eligibleItemIds.length === 0
|
|
@@ -679,6 +808,9 @@ export async function materializeBackendTestExecutionReadiness(input) {
|
|
|
679
808
|
collectedItemIds: input.effective.collectedItemIds,
|
|
680
809
|
eligibleItemIds: eligibility.eligibleItemIds,
|
|
681
810
|
excludedItems: eligibility.excludedItems,
|
|
811
|
+
exclusionSummary: summarizeBackendTestExclusions(eligibility.excludedItems),
|
|
812
|
+
pytestSpawned: false,
|
|
813
|
+
businessTestBodyExecutedCount: 0,
|
|
682
814
|
fixtureIssues: input.effective.findings.filter((item) => /fixture/i.test(item.kind)).map((item) => item.detail),
|
|
683
815
|
assetHashes: input.effective.inputHashes,
|
|
684
816
|
eligibilityInputHashes: input.eligibilityInputHashes ?? {},
|
|
@@ -694,6 +826,26 @@ export async function readBackendTestExecutionReadiness(filePath) {
|
|
|
694
826
|
function formatReadinessCounts(readiness) {
|
|
695
827
|
return `mapped=${readiness.mappedScripts.length} collected=${readiness.collectedItemIds.length} eligible=${readiness.eligibleItemIds.length} excluded=${readiness.excludedItems.length}`;
|
|
696
828
|
}
|
|
829
|
+
export function summarizeBackendTestExclusions(excludedItems) {
|
|
830
|
+
const reasonCounts = new Map();
|
|
831
|
+
const caseCounts = new Map();
|
|
832
|
+
for (const item of excludedItems) {
|
|
833
|
+
if (item.caseId)
|
|
834
|
+
caseCounts.set(item.caseId, (caseCounts.get(item.caseId) ?? 0) + 1);
|
|
835
|
+
for (const reason of item.reasons) {
|
|
836
|
+
const category = classifyExclusionReason(reason);
|
|
837
|
+
reasonCounts.set(category, (reasonCounts.get(category) ?? 0) + 1);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return {
|
|
841
|
+
excludedItemCount: excludedItems.length,
|
|
842
|
+
excludedCaseCount: caseCounts.size,
|
|
843
|
+
excludedByReason: Object.fromEntries(READINESS_EXCLUSION_CATEGORIES
|
|
844
|
+
.filter((category) => (reasonCounts.get(category) ?? 0) > 0)
|
|
845
|
+
.map((category) => [category, reasonCounts.get(category)])),
|
|
846
|
+
excludedByCase: Object.fromEntries([...caseCounts.entries()].sort(([left], [right]) => left.localeCompare(right))),
|
|
847
|
+
};
|
|
848
|
+
}
|
|
697
849
|
export function classifyExclusionReason(reason) {
|
|
698
850
|
if (reason === "no exact Markdown Case/primary-symbol correspondence")
|
|
699
851
|
return "correspondence-missing";
|
|
@@ -756,7 +908,7 @@ async function firstUnreadableAssetPath(workspaceRoot, readiness) {
|
|
|
756
908
|
}
|
|
757
909
|
return undefined;
|
|
758
910
|
}
|
|
759
|
-
export async function assertBackendTestExecutionReadinessFresh(workspaceRoot, readiness) {
|
|
911
|
+
export async function assertBackendTestExecutionReadinessFresh(workspaceRoot, readiness, layout) {
|
|
760
912
|
if (!["PASS", "PARTIAL"].includes(readiness.status)) {
|
|
761
913
|
const counts = formatReadinessCounts(readiness);
|
|
762
914
|
const reasonTally = readiness.eligibleItemIds.length === 0 && readiness.excludedItems.length > 0
|
|
@@ -779,7 +931,7 @@ export async function assertBackendTestExecutionReadinessFresh(workspaceRoot, re
|
|
|
779
931
|
}
|
|
780
932
|
let current;
|
|
781
933
|
try {
|
|
782
|
-
current = await buildBackendPytestAssetInventory(workspaceRoot, readiness.mappedScripts);
|
|
934
|
+
current = await buildBackendPytestAssetInventory(workspaceRoot, readiness.mappedScripts, { layout });
|
|
783
935
|
}
|
|
784
936
|
catch {
|
|
785
937
|
const fallbackPath = [...readiness.mappedScripts].sort()[0] ?? Object.keys(readiness.assetHashes).sort()[0] ?? "unknown";
|
|
@@ -814,11 +966,11 @@ export async function assertBackendTestExecutionReadinessFresh(workspaceRoot, re
|
|
|
814
966
|
}
|
|
815
967
|
}
|
|
816
968
|
}
|
|
817
|
-
export async function assertBackendPytestCollectionFresh(workspaceRoot, effective) {
|
|
969
|
+
export async function assertBackendPytestCollectionFresh(workspaceRoot, effective, layout) {
|
|
818
970
|
if (effective.phase !== "effective" || effective.status !== "PASS") {
|
|
819
971
|
throw new Error("backend pytest execution requires effective collection PASS facts");
|
|
820
972
|
}
|
|
821
|
-
const current = await buildBackendPytestAssetInventory(workspaceRoot, effective.mappedScripts);
|
|
973
|
+
const current = await buildBackendPytestAssetInventory(workspaceRoot, effective.mappedScripts, { layout });
|
|
822
974
|
const priorityOnly = priorityOnlyBackendPytestScripts(current.assetFiles);
|
|
823
975
|
if (priorityOnly.length > 0)
|
|
824
976
|
throw new Error(`priority-only-pytest-module: ${priorityOnly.join(", ")}`);
|
|
@@ -826,7 +978,7 @@ export async function assertBackendPytestCollectionFresh(workspaceRoot, effectiv
|
|
|
826
978
|
}
|
|
827
979
|
export async function materializeEffectiveBackendPytestCollection(input) {
|
|
828
980
|
if (input.initial.status === "PASS") {
|
|
829
|
-
const current = await buildBackendPytestAssetInventory(input.workspaceRoot, input.initial.mappedScripts);
|
|
981
|
+
const current = await buildBackendPytestAssetInventory(input.workspaceRoot, input.initial.mappedScripts, { layout: input.layout });
|
|
830
982
|
const priorityOnly = priorityOnlyBackendPytestScripts(current.assetFiles);
|
|
831
983
|
if (priorityOnly.length > 0)
|
|
832
984
|
throw new Error(`priority-only-pytest-module: ${priorityOnly.join(", ")}`);
|
|
@@ -844,7 +996,7 @@ export async function materializeEffectiveBackendPytestCollection(input) {
|
|
|
844
996
|
if (input.final.status !== "PASS")
|
|
845
997
|
throw new Error("backend pytest collection still fails after bounded repair");
|
|
846
998
|
await assertBackendPytestRepairSafety(input.workspaceRoot, input.initial, input.final);
|
|
847
|
-
const current = await buildBackendPytestAssetInventory(input.workspaceRoot, input.final.mappedScripts);
|
|
999
|
+
const current = await buildBackendPytestAssetInventory(input.workspaceRoot, input.final.mappedScripts, { layout: input.layout });
|
|
848
1000
|
const priorityOnly = priorityOnlyBackendPytestScripts(current.assetFiles);
|
|
849
1001
|
if (priorityOnly.length > 0)
|
|
850
1002
|
throw new Error(`priority-only-pytest-module: ${priorityOnly.join(", ")}`);
|
|
@@ -70,6 +70,7 @@ export const backendTestResultContractSchema = z
|
|
|
70
70
|
schemaVersion: z.literal(1),
|
|
71
71
|
/** Process-level status of the pytest invocation. Task Pool: use with outcome. */
|
|
72
72
|
executionStatus: backendTestExecutionStatusSchema,
|
|
73
|
+
pytestSpawned: z.literal(true),
|
|
73
74
|
pytestExitCode: z.number().int().min(0).max(255),
|
|
74
75
|
collectionStatus: backendTestCollectionStatusSchema,
|
|
75
76
|
/** Total tests counted from JUnit (or 0 when report unavailable). */
|
|
@@ -659,6 +660,7 @@ export function deriveBackendTestResult(input) {
|
|
|
659
660
|
const result = {
|
|
660
661
|
schemaVersion: 1,
|
|
661
662
|
executionStatus,
|
|
663
|
+
pytestSpawned: true,
|
|
662
664
|
pytestExitCode: input.pytestExitCode,
|
|
663
665
|
collectionStatus: "unknown",
|
|
664
666
|
tests: 0,
|
|
@@ -733,6 +735,7 @@ export function deriveBackendTestResult(input) {
|
|
|
733
735
|
const result = {
|
|
734
736
|
schemaVersion: 1,
|
|
735
737
|
executionStatus,
|
|
738
|
+
pytestSpawned: true,
|
|
736
739
|
pytestExitCode: exit,
|
|
737
740
|
collectionStatus,
|
|
738
741
|
tests: parsed.tests,
|
|
@@ -931,11 +934,12 @@ export async function materializeBackendTestResultFromPytestHtml(input) {
|
|
|
931
934
|
outcome = "command-error";
|
|
932
935
|
}
|
|
933
936
|
const commandSummary = input.commandSummary ??
|
|
934
|
-
`PYTHONUTF8=1 PYTHONIOENCODING=utf-8 PYTHONDONTWRITEBYTECODE=1 python -
|
|
937
|
+
`PYTHONUTF8=1 PYTHONIOENCODING=utf-8 PYTHONDONTWRITEBYTECODE=1 python reports/backend-test-pytest-launcher.py reports/backend-test-pytest-targets.txt ${htmlRelativePath} -> pytest.main(-v -p no:cacheprovider --self-contained-html)`;
|
|
935
938
|
assertNoSecrets("commandSummary", commandSummary);
|
|
936
939
|
const result = backendTestResultContractSchema.parse({
|
|
937
940
|
schemaVersion: 1,
|
|
938
941
|
executionStatus,
|
|
942
|
+
pytestSpawned: true,
|
|
939
943
|
pytestExitCode: exit,
|
|
940
944
|
collectionStatus,
|
|
941
945
|
tests: parsed.tests,
|