@bf-meishijian/aip 0.0.42 → 0.0.43
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/dist/apps/local-coding-host/src/bash-discovery.d.ts +8 -0
- package/dist/apps/local-coding-host/src/bash-discovery.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/bash-discovery.js +66 -0
- package/dist/apps/local-coding-host/src/bash-discovery.js.map +1 -0
- package/dist/apps/local-coding-host/src/cli.d.ts +4 -0
- package/dist/apps/local-coding-host/src/cli.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/cli.js +388 -0
- package/dist/apps/local-coding-host/src/cli.js.map +1 -0
- package/dist/apps/local-coding-host/src/coding-run-manager.d.ts +174 -0
- package/dist/apps/local-coding-host/src/coding-run-manager.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/coding-run-manager.js +1587 -0
- package/dist/apps/local-coding-host/src/coding-run-manager.js.map +1 -0
- package/dist/apps/local-coding-host/src/coding-subagent-child.d.ts +22 -0
- package/dist/apps/local-coding-host/src/coding-subagent-child.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/coding-subagent-child.js +96 -0
- package/dist/apps/local-coding-host/src/coding-subagent-child.js.map +1 -0
- package/dist/apps/local-coding-host/src/coding-subagents.d.ts +65 -0
- package/dist/apps/local-coding-host/src/coding-subagents.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/coding-subagents.js +521 -0
- package/dist/apps/local-coding-host/src/coding-subagents.js.map +1 -0
- package/dist/apps/local-coding-host/src/command-executor.d.ts +9 -0
- package/dist/apps/local-coding-host/src/command-executor.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/command-executor.js +222 -0
- package/dist/apps/local-coding-host/src/command-executor.js.map +1 -0
- package/dist/apps/local-coding-host/src/command-wakeup.d.ts +19 -0
- package/dist/apps/local-coding-host/src/command-wakeup.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/command-wakeup.js +109 -0
- package/dist/apps/local-coding-host/src/command-wakeup.js.map +1 -0
- package/dist/apps/local-coding-host/src/daemon.d.ts +8 -0
- package/dist/apps/local-coding-host/src/daemon.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/daemon.js +314 -0
- package/dist/apps/local-coding-host/src/daemon.js.map +1 -0
- package/dist/apps/local-coding-host/src/delivery-files.d.ts +39 -0
- package/dist/apps/local-coding-host/src/delivery-files.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/delivery-files.js +237 -0
- package/dist/apps/local-coding-host/src/delivery-files.js.map +1 -0
- package/dist/apps/local-coding-host/src/delivery-tools.d.ts +30 -0
- package/dist/apps/local-coding-host/src/delivery-tools.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/delivery-tools.js +196 -0
- package/dist/apps/local-coding-host/src/delivery-tools.js.map +1 -0
- package/dist/apps/local-coding-host/src/diagnostic-log.d.ts +20 -0
- package/dist/apps/local-coding-host/src/diagnostic-log.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/diagnostic-log.js +61 -0
- package/dist/apps/local-coding-host/src/diagnostic-log.js.map +1 -0
- package/dist/apps/local-coding-host/src/diagnostics.d.ts +38 -0
- package/dist/apps/local-coding-host/src/diagnostics.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/diagnostics.js +217 -0
- package/dist/apps/local-coding-host/src/diagnostics.js.map +1 -0
- package/dist/apps/local-coding-host/src/execution-process-observer.d.ts +19 -0
- package/dist/apps/local-coding-host/src/execution-process-observer.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/execution-process-observer.js +35 -0
- package/dist/apps/local-coding-host/src/execution-process-observer.js.map +1 -0
- package/dist/apps/local-coding-host/src/execution-process-tree.d.ts +32 -0
- package/dist/apps/local-coding-host/src/execution-process-tree.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/execution-process-tree.js +288 -0
- package/dist/apps/local-coding-host/src/execution-process-tree.js.map +1 -0
- package/dist/apps/local-coding-host/src/execution-process.d.ts +59 -0
- package/dist/apps/local-coding-host/src/execution-process.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/execution-process.js +112 -0
- package/dist/apps/local-coding-host/src/execution-process.js.map +1 -0
- package/dist/apps/local-coding-host/src/execution-receipts.d.ts +12 -0
- package/dist/apps/local-coding-host/src/execution-receipts.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/execution-receipts.js +89 -0
- package/dist/apps/local-coding-host/src/execution-receipts.js.map +1 -0
- package/dist/apps/local-coding-host/src/execution-supervisor.d.ts +25 -0
- package/dist/apps/local-coding-host/src/execution-supervisor.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/execution-supervisor.js +482 -0
- package/dist/apps/local-coding-host/src/execution-supervisor.js.map +1 -0
- package/dist/apps/local-coding-host/src/execution-worker.d.ts +42 -0
- package/dist/apps/local-coding-host/src/execution-worker.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/execution-worker.js +165 -0
- package/dist/apps/local-coding-host/src/execution-worker.js.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-client.d.ts +111 -0
- package/dist/apps/local-coding-host/src/general-run-client.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-client.js +41 -0
- package/dist/apps/local-coding-host/src/general-run-client.js.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-manager.d.ts +33 -0
- package/dist/apps/local-coding-host/src/general-run-manager.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-manager.js +363 -0
- package/dist/apps/local-coding-host/src/general-run-manager.js.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-supervisor.d.ts +12 -0
- package/dist/apps/local-coding-host/src/general-run-supervisor.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-supervisor.js +160 -0
- package/dist/apps/local-coding-host/src/general-run-supervisor.js.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-tools.d.ts +25 -0
- package/dist/apps/local-coding-host/src/general-run-tools.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/general-run-tools.js +123 -0
- package/dist/apps/local-coding-host/src/general-run-tools.js.map +1 -0
- package/dist/apps/local-coding-host/src/git-credential-environment.d.ts +3 -0
- package/dist/apps/local-coding-host/src/git-credential-environment.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/git-credential-environment.js +46 -0
- package/dist/apps/local-coding-host/src/git-credential-environment.js.map +1 -0
- package/dist/apps/local-coding-host/src/git-credential-helper.d.ts +2 -0
- package/dist/apps/local-coding-host/src/git-credential-helper.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/git-credential-helper.js +38 -0
- package/dist/apps/local-coding-host/src/git-credential-helper.js.map +1 -0
- package/dist/apps/local-coding-host/src/git-http-migration.d.ts +24 -0
- package/dist/apps/local-coding-host/src/git-http-migration.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/git-http-migration.js +197 -0
- package/dist/apps/local-coding-host/src/git-http-migration.js.map +1 -0
- package/dist/apps/local-coding-host/src/git-process.d.ts +25 -0
- package/dist/apps/local-coding-host/src/git-process.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/git-process.js +85 -0
- package/dist/apps/local-coding-host/src/git-process.js.map +1 -0
- package/dist/apps/local-coding-host/src/git-transport.d.ts +6 -0
- package/dist/apps/local-coding-host/src/git-transport.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/git-transport.js +57 -0
- package/dist/apps/local-coding-host/src/git-transport.js.map +1 -0
- package/dist/apps/local-coding-host/src/gitlab-cli.d.ts +2 -0
- package/dist/apps/local-coding-host/src/gitlab-cli.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/gitlab-cli.js +39 -0
- package/dist/apps/local-coding-host/src/gitlab-cli.js.map +1 -0
- package/dist/apps/local-coding-host/src/gitlab-credentials.d.ts +18 -0
- package/dist/apps/local-coding-host/src/gitlab-credentials.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/gitlab-credentials.js +137 -0
- package/dist/apps/local-coding-host/src/gitlab-credentials.js.map +1 -0
- package/dist/apps/local-coding-host/src/handoff-cli.d.ts +2 -0
- package/dist/apps/local-coding-host/src/handoff-cli.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/handoff-cli.js +86 -0
- package/dist/apps/local-coding-host/src/handoff-cli.js.map +1 -0
- package/dist/apps/local-coding-host/src/harness.d.ts +2 -0
- package/dist/apps/local-coding-host/src/harness.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/harness.js +2 -0
- package/dist/apps/local-coding-host/src/harness.js.map +1 -0
- package/dist/apps/local-coding-host/src/host-log.d.ts +13 -0
- package/dist/apps/local-coding-host/src/host-log.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/host-log.js +43 -0
- package/dist/apps/local-coding-host/src/host-log.js.map +1 -0
- package/dist/apps/local-coding-host/src/host-shell.d.ts +2 -0
- package/dist/apps/local-coding-host/src/host-shell.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/host-shell.js +2 -0
- package/dist/apps/local-coding-host/src/host-shell.js.map +1 -0
- package/dist/apps/local-coding-host/src/host-status.d.ts +57 -0
- package/dist/apps/local-coding-host/src/host-status.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/host-status.js +144 -0
- package/dist/apps/local-coding-host/src/host-status.js.map +1 -0
- package/dist/apps/local-coding-host/src/host-tools.d.ts +15 -0
- package/dist/apps/local-coding-host/src/host-tools.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/host-tools.js +178 -0
- package/dist/apps/local-coding-host/src/host-tools.js.map +1 -0
- package/dist/apps/local-coding-host/src/host-update.d.ts +3 -0
- package/dist/apps/local-coding-host/src/host-update.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/host-update.js +95 -0
- package/dist/apps/local-coding-host/src/host-update.js.map +1 -0
- package/dist/apps/local-coding-host/src/installer.d.ts +28 -0
- package/dist/apps/local-coding-host/src/installer.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/installer.js +346 -0
- package/dist/apps/local-coding-host/src/installer.js.map +1 -0
- package/dist/apps/local-coding-host/src/linux-service.d.ts +14 -0
- package/dist/apps/local-coding-host/src/linux-service.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/linux-service.js +63 -0
- package/dist/apps/local-coding-host/src/linux-service.js.map +1 -0
- package/dist/apps/local-coding-host/src/live-employee.d.ts +17 -0
- package/dist/apps/local-coding-host/src/live-employee.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/live-employee.js +74 -0
- package/dist/apps/local-coding-host/src/live-employee.js.map +1 -0
- package/dist/apps/local-coding-host/src/local-employee-runtime.d.ts +30 -0
- package/dist/apps/local-coding-host/src/local-employee-runtime.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/local-employee-runtime.js +521 -0
- package/dist/apps/local-coding-host/src/local-employee-runtime.js.map +1 -0
- package/dist/apps/local-coding-host/src/local-handoff-workspace.d.ts +27 -0
- package/dist/apps/local-coding-host/src/local-handoff-workspace.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/local-handoff-workspace.js +71 -0
- package/dist/apps/local-coding-host/src/local-handoff-workspace.js.map +1 -0
- package/dist/apps/local-coding-host/src/local-mcp.d.ts +246 -0
- package/dist/apps/local-coding-host/src/local-mcp.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/local-mcp.js +173 -0
- package/dist/apps/local-coding-host/src/local-mcp.js.map +1 -0
- package/dist/apps/local-coding-host/src/local-model-usage.d.ts +6 -0
- package/dist/apps/local-coding-host/src/local-model-usage.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/local-model-usage.js +40 -0
- package/dist/apps/local-coding-host/src/local-model-usage.js.map +1 -0
- package/dist/apps/local-coding-host/src/login-url.d.ts +3 -0
- package/dist/apps/local-coding-host/src/login-url.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/login-url.js +30 -0
- package/dist/apps/local-coding-host/src/login-url.js.map +1 -0
- package/dist/apps/local-coding-host/src/managed-process.d.ts +21 -0
- package/dist/apps/local-coding-host/src/managed-process.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/managed-process.js +119 -0
- package/dist/apps/local-coding-host/src/managed-process.js.map +1 -0
- package/dist/apps/local-coding-host/src/merge-requests.d.ts +54 -0
- package/dist/apps/local-coding-host/src/merge-requests.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/merge-requests.js +230 -0
- package/dist/apps/local-coding-host/src/merge-requests.js.map +1 -0
- package/dist/apps/local-coding-host/src/model-stores.d.ts +20 -0
- package/dist/apps/local-coding-host/src/model-stores.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/model-stores.js +77 -0
- package/dist/apps/local-coding-host/src/model-stores.js.map +1 -0
- package/dist/apps/local-coding-host/src/open-browser.d.ts +2 -0
- package/dist/apps/local-coding-host/src/open-browser.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/open-browser.js +20 -0
- package/dist/apps/local-coding-host/src/open-browser.js.map +1 -0
- package/dist/apps/local-coding-host/src/operation-context.d.ts +31 -0
- package/dist/apps/local-coding-host/src/operation-context.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/operation-context.js +166 -0
- package/dist/apps/local-coding-host/src/operation-context.js.map +1 -0
- package/dist/apps/local-coding-host/src/outcome-cli.d.ts +3 -0
- package/dist/apps/local-coding-host/src/outcome-cli.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/outcome-cli.js +91 -0
- package/dist/apps/local-coding-host/src/outcome-cli.js.map +1 -0
- package/dist/apps/local-coding-host/src/paths.d.ts +30 -0
- package/dist/apps/local-coding-host/src/paths.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/paths.js +52 -0
- package/dist/apps/local-coding-host/src/paths.js.map +1 -0
- package/dist/apps/local-coding-host/src/pi-message-queue.d.ts +20 -0
- package/dist/apps/local-coding-host/src/pi-message-queue.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/pi-message-queue.js +78 -0
- package/dist/apps/local-coding-host/src/pi-message-queue.js.map +1 -0
- package/dist/apps/local-coding-host/src/pi-model-service.d.ts +91 -0
- package/dist/apps/local-coding-host/src/pi-model-service.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/pi-model-service.js +372 -0
- package/dist/apps/local-coding-host/src/pi-model-service.js.map +1 -0
- package/dist/apps/local-coding-host/src/platform-client.d.ts +398 -0
- package/dist/apps/local-coding-host/src/platform-client.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/platform-client.js +255 -0
- package/dist/apps/local-coding-host/src/platform-client.js.map +1 -0
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.d.ts +8 -0
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.js +31 -0
- package/dist/apps/local-coding-host/src/platform-gitlab-credential.js.map +1 -0
- package/dist/apps/local-coding-host/src/platform.d.ts +2 -0
- package/dist/apps/local-coding-host/src/platform.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/platform.js +15 -0
- package/dist/apps/local-coding-host/src/platform.js.map +1 -0
- package/dist/apps/local-coding-host/src/profile.d.ts +9 -0
- package/dist/apps/local-coding-host/src/profile.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/profile.js +43 -0
- package/dist/apps/local-coding-host/src/profile.js.map +1 -0
- package/dist/apps/local-coding-host/src/project-facts.d.ts +20 -0
- package/dist/apps/local-coding-host/src/project-facts.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/project-facts.js +94 -0
- package/dist/apps/local-coding-host/src/project-facts.js.map +1 -0
- package/dist/apps/local-coding-host/src/provider-auth-error.d.ts +3 -0
- package/dist/apps/local-coding-host/src/provider-auth-error.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/provider-auth-error.js +12 -0
- package/dist/apps/local-coding-host/src/provider-auth-error.js.map +1 -0
- package/dist/apps/local-coding-host/src/qa-contract.d.ts +2 -0
- package/dist/apps/local-coding-host/src/qa-contract.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/qa-contract.js +3 -0
- package/dist/apps/local-coding-host/src/qa-contract.js.map +1 -0
- package/dist/apps/local-coding-host/src/qa-project-checkout.d.ts +16 -0
- package/dist/apps/local-coding-host/src/qa-project-checkout.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/qa-project-checkout.js +92 -0
- package/dist/apps/local-coding-host/src/qa-project-checkout.js.map +1 -0
- package/dist/apps/local-coding-host/src/qa-session-manager.d.ts +83 -0
- package/dist/apps/local-coding-host/src/qa-session-manager.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/qa-session-manager.js +782 -0
- package/dist/apps/local-coding-host/src/qa-session-manager.js.map +1 -0
- package/dist/apps/local-coding-host/src/run-resources.d.ts +17 -0
- package/dist/apps/local-coding-host/src/run-resources.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/run-resources.js +115 -0
- package/dist/apps/local-coding-host/src/run-resources.js.map +1 -0
- package/dist/apps/local-coding-host/src/runtime-cleanup.d.ts +5 -0
- package/dist/apps/local-coding-host/src/runtime-cleanup.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/runtime-cleanup.js +187 -0
- package/dist/apps/local-coding-host/src/runtime-cleanup.js.map +1 -0
- package/dist/apps/local-coding-host/src/runtime-environment.d.ts +2 -0
- package/dist/apps/local-coding-host/src/runtime-environment.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/runtime-environment.js +7 -0
- package/dist/apps/local-coding-host/src/runtime-environment.js.map +1 -0
- package/dist/apps/local-coding-host/src/runtime-search-tools.d.ts +3 -0
- package/dist/apps/local-coding-host/src/runtime-search-tools.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/runtime-search-tools.js +30 -0
- package/dist/apps/local-coding-host/src/runtime-search-tools.js.map +1 -0
- package/dist/apps/local-coding-host/src/secure-json.d.ts +12 -0
- package/dist/apps/local-coding-host/src/secure-json.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/secure-json.js +129 -0
- package/dist/apps/local-coding-host/src/secure-json.js.map +1 -0
- package/dist/apps/local-coding-host/src/self-check.d.ts +3 -0
- package/dist/apps/local-coding-host/src/self-check.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/self-check.js +9 -0
- package/dist/apps/local-coding-host/src/self-check.js.map +1 -0
- package/dist/apps/local-coding-host/src/skill-bundle-cache.d.ts +11 -0
- package/dist/apps/local-coding-host/src/skill-bundle-cache.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/skill-bundle-cache.js +76 -0
- package/dist/apps/local-coding-host/src/skill-bundle-cache.js.map +1 -0
- package/dist/apps/local-coding-host/src/skill-storage.d.ts +18 -0
- package/dist/apps/local-coding-host/src/skill-storage.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/skill-storage.js +287 -0
- package/dist/apps/local-coding-host/src/skill-storage.js.map +1 -0
- package/dist/apps/local-coding-host/src/stage-delivery.d.ts +2 -0
- package/dist/apps/local-coding-host/src/stage-delivery.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/stage-delivery.js +3 -0
- package/dist/apps/local-coding-host/src/stage-delivery.js.map +1 -0
- package/dist/apps/local-coding-host/src/state.d.ts +55 -0
- package/dist/apps/local-coding-host/src/state.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/state.js +151 -0
- package/dist/apps/local-coding-host/src/state.js.map +1 -0
- package/dist/apps/local-coding-host/src/storage-maintenance.d.ts +13 -0
- package/dist/apps/local-coding-host/src/storage-maintenance.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/storage-maintenance.js +62 -0
- package/dist/apps/local-coding-host/src/storage-maintenance.js.map +1 -0
- package/dist/apps/local-coding-host/src/test-cli.d.ts +2 -0
- package/dist/apps/local-coding-host/src/test-cli.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/test-cli.js +48 -0
- package/dist/apps/local-coding-host/src/test-cli.js.map +1 -0
- package/dist/apps/local-coding-host/src/test-executor.d.ts +41 -0
- package/dist/apps/local-coding-host/src/test-executor.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/test-executor.js +483 -0
- package/dist/apps/local-coding-host/src/test-executor.js.map +1 -0
- package/dist/apps/local-coding-host/src/test-reports.d.ts +25 -0
- package/dist/apps/local-coding-host/src/test-reports.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/test-reports.js +129 -0
- package/dist/apps/local-coding-host/src/test-reports.js.map +1 -0
- package/dist/apps/local-coding-host/src/test-run-manager.d.ts +34 -0
- package/dist/apps/local-coding-host/src/test-run-manager.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/test-run-manager.js +180 -0
- package/dist/apps/local-coding-host/src/test-run-manager.js.map +1 -0
- package/dist/apps/local-coding-host/src/tool-dispatch.d.ts +14 -0
- package/dist/apps/local-coding-host/src/tool-dispatch.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/tool-dispatch.js +59 -0
- package/dist/apps/local-coding-host/src/tool-dispatch.js.map +1 -0
- package/dist/apps/local-coding-host/src/tool-probe.d.ts +31 -0
- package/dist/apps/local-coding-host/src/tool-probe.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/tool-probe.js +95 -0
- package/dist/apps/local-coding-host/src/tool-probe.js.map +1 -0
- package/dist/apps/local-coding-host/src/windows-runtime.d.ts +9 -0
- package/dist/apps/local-coding-host/src/windows-runtime.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/windows-runtime.js +64 -0
- package/dist/apps/local-coding-host/src/windows-runtime.js.map +1 -0
- package/dist/apps/local-coding-host/src/windows-service.d.ts +22 -0
- package/dist/apps/local-coding-host/src/windows-service.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/windows-service.js +126 -0
- package/dist/apps/local-coding-host/src/windows-service.js.map +1 -0
- package/dist/apps/local-coding-host/src/workflow-guidance.d.ts +2 -0
- package/dist/apps/local-coding-host/src/workflow-guidance.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/workflow-guidance.js +3 -0
- package/dist/apps/local-coding-host/src/workflow-guidance.js.map +1 -0
- package/dist/apps/local-coding-host/src/workspace-diff.d.ts +6 -0
- package/dist/apps/local-coding-host/src/workspace-diff.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/workspace-diff.js +280 -0
- package/dist/apps/local-coding-host/src/workspace-diff.js.map +1 -0
- package/dist/apps/local-coding-host/src/workspace-gc.d.ts +25 -0
- package/dist/apps/local-coding-host/src/workspace-gc.d.ts.map +1 -0
- package/dist/apps/local-coding-host/src/workspace-gc.js +417 -0
- package/dist/apps/local-coding-host/src/workspace-gc.js.map +1 -0
- package/dist/apps/local-coding-host/tests/bash-discovery.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/bash-discovery.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/bash-discovery.test.js +36 -0
- package/dist/apps/local-coding-host/tests/bash-discovery.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/cli-startup.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/cli-startup.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/cli-startup.test.js +176 -0
- package/dist/apps/local-coding-host/tests/cli-startup.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.js +3211 -0
- package/dist/apps/local-coding-host/tests/coding-run-manager.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.js +223 -0
- package/dist/apps/local-coding-host/tests/coding-subagent-child.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.js +390 -0
- package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/command-wakeup.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/command-wakeup.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/command-wakeup.test.js +148 -0
- package/dist/apps/local-coding-host/tests/command-wakeup.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.js +636 -0
- package/dist/apps/local-coding-host/tests/daemon-wakeup.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.js +37 -0
- package/dist/apps/local-coding-host/tests/database-tool-transport.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/delivery-files.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/delivery-files.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/delivery-files.test.js +655 -0
- package/dist/apps/local-coding-host/tests/delivery-files.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.js +116 -0
- package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.js +143 -0
- package/dist/apps/local-coding-host/tests/diagnostic-logging.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/execution-process.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/execution-process.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/execution-process.test.js +127 -0
- package/dist/apps/local-coding-host/tests/execution-process.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/execution-receipts.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/execution-receipts.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/execution-receipts.test.js +72 -0
- package/dist/apps/local-coding-host/tests/execution-receipts.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.js +488 -0
- package/dist/apps/local-coding-host/tests/execution-supervisor.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/general-employee-fixture.d.ts +3 -0
- package/dist/apps/local-coding-host/tests/general-employee-fixture.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/general-employee-fixture.js +43 -0
- package/dist/apps/local-coding-host/tests/general-employee-fixture.js.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run-manager.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/general-run-manager.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run-manager.test.js +506 -0
- package/dist/apps/local-coding-host/tests/general-run-manager.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.js +252 -0
- package/dist/apps/local-coding-host/tests/general-run-supervisor.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run-tools.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/general-run-tools.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run-tools.test.js +202 -0
- package/dist/apps/local-coding-host/tests/general-run-tools.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run.integration.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/general-run.integration.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/general-run.integration.test.js +150 -0
- package/dist/apps/local-coding-host/tests/general-run.integration.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/git-http-migration.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/git-http-migration.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/git-http-migration.test.js +140 -0
- package/dist/apps/local-coding-host/tests/git-http-migration.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/git-process.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/git-process.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/git-process.test.js +106 -0
- package/dist/apps/local-coding-host/tests/git-process.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/git-transport.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/git-transport.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/git-transport.test.js +56 -0
- package/dist/apps/local-coding-host/tests/git-transport.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.js +130 -0
- package/dist/apps/local-coding-host/tests/gitlab-credentials.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.js +273 -0
- package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/host-log.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/host-log.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/host-log.test.js +51 -0
- package/dist/apps/local-coding-host/tests/host-log.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.js +256 -0
- package/dist/apps/local-coding-host/tests/host-status-workspace.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.js +82 -0
- package/dist/apps/local-coding-host/tests/host-tool-stages.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.js +110 -0
- package/dist/apps/local-coding-host/tests/host-tools-logging.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/host-tools.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/host-tools.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/host-tools.test.js +96 -0
- package/dist/apps/local-coding-host/tests/host-tools.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/host-update.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/host-update.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/host-update.test.js +102 -0
- package/dist/apps/local-coding-host/tests/host-update.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/install-scripts.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/install-scripts.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/install-scripts.test.js +80 -0
- package/dist/apps/local-coding-host/tests/install-scripts.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/linux-service.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/linux-service.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/linux-service.test.js +32 -0
- package/dist/apps/local-coding-host/tests/linux-service.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/live-employee.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/live-employee.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/live-employee.test.js +739 -0
- package/dist/apps/local-coding-host/tests/live-employee.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.js +33 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.js +67 -0
- package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-host.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-host.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-host.test.js +1009 -0
- package/dist/apps/local-coding-host/tests/local-host.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.js +71 -0
- package/dist/apps/local-coding-host/tests/local-intake-recovery.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-mcp.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-mcp.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-mcp.test.js +193 -0
- package/dist/apps/local-coding-host/tests/local-mcp.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-model-usage.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-model-usage.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-model-usage.test.js +55 -0
- package/dist/apps/local-coding-host/tests/local-model-usage.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.js +87 -0
- package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/login-url.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/login-url.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/login-url.test.js +82 -0
- package/dist/apps/local-coding-host/tests/login-url.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/material-fixture.d.ts +13 -0
- package/dist/apps/local-coding-host/tests/material-fixture.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/material-fixture.js +32 -0
- package/dist/apps/local-coding-host/tests/material-fixture.js.map +1 -0
- package/dist/apps/local-coding-host/tests/merge-requests.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/merge-requests.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/merge-requests.test.js +318 -0
- package/dist/apps/local-coding-host/tests/merge-requests.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/model-stores.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/model-stores.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/model-stores.test.js +152 -0
- package/dist/apps/local-coding-host/tests/model-stores.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/operation-context.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/operation-context.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/operation-context.test.js +171 -0
- package/dist/apps/local-coding-host/tests/operation-context.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/outcome-cli.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/outcome-cli.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/outcome-cli.test.js +208 -0
- package/dist/apps/local-coding-host/tests/outcome-cli.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.js +91 -0
- package/dist/apps/local-coding-host/tests/pi-message-queue.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.js +244 -0
- package/dist/apps/local-coding-host/tests/pi-model-switch.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.js +75 -0
- package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.js +183 -0
- package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.js +84 -0
- package/dist/apps/local-coding-host/tests/pi-session-restore.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/platform-client-status.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/platform-client-status.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/platform-client-status.test.js +29 -0
- package/dist/apps/local-coding-host/tests/platform-client-status.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/platform-models.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/platform-models.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/platform-models.test.js +395 -0
- package/dist/apps/local-coding-host/tests/platform-models.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.js +138 -0
- package/dist/apps/local-coding-host/tests/powershell-resolution.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/profile-installer.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/profile-installer.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/profile-installer.test.js +88 -0
- package/dist/apps/local-coding-host/tests/profile-installer.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/profile.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/profile.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/profile.test.js +88 -0
- package/dist/apps/local-coding-host/tests/profile.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.js +82 -0
- package/dist/apps/local-coding-host/tests/provider-auth-status.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.js +101 -0
- package/dist/apps/local-coding-host/tests/qa-project-checkout.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.js +1493 -0
- package/dist/apps/local-coding-host/tests/qa-session-manager.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.js +208 -0
- package/dist/apps/local-coding-host/tests/qa-verification-contract.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.js +69 -0
- package/dist/apps/local-coding-host/tests/recovery-workspace.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/review-query.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/review-query.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/review-query.test.js +66 -0
- package/dist/apps/local-coding-host/tests/review-query.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/run-resources.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/run-resources.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/run-resources.test.js +207 -0
- package/dist/apps/local-coding-host/tests/run-resources.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.js +161 -0
- package/dist/apps/local-coding-host/tests/runtime-cleanup.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.js +63 -0
- package/dist/apps/local-coding-host/tests/runtime-package-install.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/runtime-version.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/runtime-version.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/runtime-version.test.js +15 -0
- package/dist/apps/local-coding-host/tests/runtime-version.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/secure-json.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/secure-json.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/secure-json.test.js +64 -0
- package/dist/apps/local-coding-host/tests/secure-json.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.js +312 -0
- package/dist/apps/local-coding-host/tests/skill-storage-gc.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.js +135 -0
- package/dist/apps/local-coding-host/tests/storage-maintenance.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/test-executor.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/test-executor.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/test-executor.test.js +365 -0
- package/dist/apps/local-coding-host/tests/test-executor.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/test-reports.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/test-reports.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/test-reports.test.js +68 -0
- package/dist/apps/local-coding-host/tests/test-reports.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/test-run-manager.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/test-run-manager.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/test-run-manager.test.js +287 -0
- package/dist/apps/local-coding-host/tests/test-run-manager.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.js +224 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.js +47 -0
- package/dist/apps/local-coding-host/tests/tool-dispatch.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/tool-probe.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/tool-probe.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/tool-probe.test.js +55 -0
- package/dist/apps/local-coding-host/tests/tool-probe.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-background-check.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/windows-background-check.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-background-check.test.js +60 -0
- package/dist/apps/local-coding-host/tests/windows-background-check.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-install-script.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/windows-install-script.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-install-script.test.js +170 -0
- package/dist/apps/local-coding-host/tests/windows-install-script.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-installer.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/windows-installer.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-installer.test.js +244 -0
- package/dist/apps/local-coding-host/tests/windows-installer.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.js +34 -0
- package/dist/apps/local-coding-host/tests/windows-task-configuration.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.js +370 -0
- package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/workspace-diff.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/workspace-diff.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/workspace-diff.test.js +166 -0
- package/dist/apps/local-coding-host/tests/workspace-diff.test.js.map +1 -0
- package/dist/apps/local-coding-host/tests/workspace-gc.test.d.ts +2 -0
- package/dist/apps/local-coding-host/tests/workspace-gc.test.d.ts.map +1 -0
- package/dist/apps/local-coding-host/tests/workspace-gc.test.js +391 -0
- package/dist/apps/local-coding-host/tests/workspace-gc.test.js.map +1 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +23 -0
- package/dist/daemon.js.map +1 -1
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/general-run-client.d.ts.map +1 -1
- package/dist/git-process.d.ts +1 -0
- package/dist/git-process.d.ts.map +1 -1
- package/dist/git-process.js +5 -1
- package/dist/git-process.js.map +1 -1
- package/dist/host-status.d.ts.map +1 -1
- package/dist/pi-model-service.d.ts.map +1 -1
- package/dist/platform-client.d.ts +4 -0
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/platform-client.js +3 -0
- package/dist/platform-client.js.map +1 -1
- package/dist/project-facts.d.ts +1 -0
- package/dist/project-facts.d.ts.map +1 -1
- package/dist/project-facts.js +1 -1
- package/dist/project-facts.js.map +1 -1
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.d.ts +83 -0
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.d.ts.map +1 -0
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.js +282 -0
- package/dist/services/platform-api/src/coding-run/coding-tool-definitions.js.map +1 -0
- package/dist/services/platform-api/src/coding-run/delivery-requirements.d.ts +15 -0
- package/dist/services/platform-api/src/coding-run/delivery-requirements.d.ts.map +1 -0
- package/dist/services/platform-api/src/coding-run/delivery-requirements.js +60 -0
- package/dist/services/platform-api/src/coding-run/delivery-requirements.js.map +1 -0
- package/dist/services/platform-api/src/coding-run/development-test-report.d.ts +10 -0
- package/dist/services/platform-api/src/coding-run/development-test-report.d.ts.map +1 -0
- package/dist/services/platform-api/src/coding-run/development-test-report.js +32 -0
- package/dist/services/platform-api/src/coding-run/development-test-report.js.map +1 -0
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.d.ts +21 -0
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.d.ts.map +1 -0
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.js +86 -0
- package/dist/services/platform-api/src/coding-run/host-tool-dispatch.js.map +1 -0
- package/dist/services/platform-api/src/coding-run/workspace-materials.d.ts +37 -0
- package/dist/services/platform-api/src/coding-run/workspace-materials.d.ts.map +1 -0
- package/dist/services/platform-api/src/coding-run/workspace-materials.js +99 -0
- package/dist/services/platform-api/src/coding-run/workspace-materials.js.map +1 -0
- package/dist/services/platform-api/src/common/app-exception.d.ts +17 -0
- package/dist/services/platform-api/src/common/app-exception.d.ts.map +1 -0
- package/dist/services/platform-api/src/common/app-exception.js +46 -0
- package/dist/services/platform-api/src/common/app-exception.js.map +1 -0
- package/dist/services/platform-api/src/config/environment.d.ts +30 -0
- package/dist/services/platform-api/src/config/environment.d.ts.map +1 -0
- package/dist/services/platform-api/src/config/environment.js +123 -0
- package/dist/services/platform-api/src/config/environment.js.map +1 -0
- package/dist/services/platform-api/src/database/database.service.d.ts +38 -0
- package/dist/services/platform-api/src/database/database.service.d.ts.map +1 -0
- package/dist/services/platform-api/src/database/database.service.js +520 -0
- package/dist/services/platform-api/src/database/database.service.js.map +1 -0
- package/dist/services/platform-api/src/database/migration-ledger.d.ts +5 -0
- package/dist/services/platform-api/src/database/migration-ledger.d.ts.map +1 -0
- package/dist/services/platform-api/src/database/migration-ledger.js +33 -0
- package/dist/services/platform-api/src/database/migration-ledger.js.map +1 -0
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.d.ts +13 -0
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.d.ts.map +1 -0
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.js +25 -0
- package/dist/services/platform-api/src/digital-employee/local-skill-bundles.js.map +1 -0
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.d.ts +6 -0
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.d.ts.map +1 -0
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.js +20 -0
- package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.js.map +1 -0
- package/dist/services/platform-api/src/qa/qa-tool-definitions.d.ts +100 -0
- package/dist/services/platform-api/src/qa/qa-tool-definitions.d.ts.map +1 -0
- package/dist/services/platform-api/src/qa/qa-tool-definitions.js +498 -0
- package/dist/services/platform-api/src/qa/qa-tool-definitions.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/workspace-diff.d.ts +6 -0
- package/dist/workspace-diff.d.ts.map +1 -0
- package/dist/workspace-diff.js +278 -0
- package/dist/workspace-diff.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,1493 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { chmod, mkdir, mkdtemp, readFile, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
import { Check } from "typebox/value";
|
|
7
|
+
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
|
8
|
+
import { qaToolDefinitions } from "../../../services/platform-api/src/qa/qa-tool-definitions.js";
|
|
9
|
+
import { PlatformClientError } from "../src/platform-client.js";
|
|
10
|
+
import { configureOperationResources } from "../src/operation-context.js";
|
|
11
|
+
import { currentQaBranch, prepareQaProject, prepareQaWorkspace, QaSessionManager, qaTools, readQaAssetState, readQaScreenshot, } from "../src/qa-session-manager.js";
|
|
12
|
+
const mocks = vi.hoisted(() => ({ open: vi.fn(), live: vi.fn(), prepareMergeRequest: vi.fn() }));
|
|
13
|
+
vi.mock("../src/merge-requests.js", () => ({ prepareMergeRequest: mocks.prepareMergeRequest }));
|
|
14
|
+
vi.mock("../src/coding-run-manager.js", async (original) => ({
|
|
15
|
+
...(await original()),
|
|
16
|
+
openPiSession: mocks.open,
|
|
17
|
+
}));
|
|
18
|
+
vi.mock("../src/live-employee.js", () => ({ liveEmployee: mocks.live }));
|
|
19
|
+
const git = promisify(execFile);
|
|
20
|
+
let home, repository, input;
|
|
21
|
+
let client;
|
|
22
|
+
const host = { hostId: "host-1", generation: 1 };
|
|
23
|
+
const hostState = { ...host, catalogRevision: 7 };
|
|
24
|
+
const model = {
|
|
25
|
+
resolveRuntimeModel: vi.fn(),
|
|
26
|
+
login: vi.fn(),
|
|
27
|
+
logout: vi.fn(),
|
|
28
|
+
readProviderStates: vi.fn(),
|
|
29
|
+
readAvailableModels: vi.fn(),
|
|
30
|
+
};
|
|
31
|
+
let listeners;
|
|
32
|
+
let session;
|
|
33
|
+
function command(id = "command-1", kind = "TEST_SESSION_START") {
|
|
34
|
+
return {
|
|
35
|
+
id,
|
|
36
|
+
kind,
|
|
37
|
+
test: { ...input, message: { id: `message-${id}`, contentMarkdown: "请维护用例" } },
|
|
38
|
+
expiresAt: new Date(Date.now() + 60000).toISOString(),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
beforeEach(async () => {
|
|
42
|
+
vi.clearAllMocks();
|
|
43
|
+
mocks.prepareMergeRequest.mockImplementation(async ({ project }) => ({
|
|
44
|
+
projectId: project.id,
|
|
45
|
+
sourceBranch: project.devBranch,
|
|
46
|
+
targetBranch: project.baselineBranch,
|
|
47
|
+
mrIid: 7,
|
|
48
|
+
url: "https://git.example/tests/-/merge_requests/7",
|
|
49
|
+
noChanges: false,
|
|
50
|
+
}));
|
|
51
|
+
home = await mkdtemp(join(tmpdir(), "qa-session-"));
|
|
52
|
+
repository = join(home, "origin");
|
|
53
|
+
vi.stubEnv("AIP_HOME", join(home, "host"));
|
|
54
|
+
await git("git", ["init", "-b", "main", repository]);
|
|
55
|
+
await git("git", ["config", "user.name", "QA"], { cwd: repository });
|
|
56
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd: repository });
|
|
57
|
+
await writeFile(join(repository, "README.md"), "test project");
|
|
58
|
+
await git("git", ["add", "."], { cwd: repository });
|
|
59
|
+
await git("git", ["commit", "-m", "initial"], { cwd: repository });
|
|
60
|
+
input = {
|
|
61
|
+
workspaceId: "workspace-1",
|
|
62
|
+
roundId: null,
|
|
63
|
+
sessionId: "session-1",
|
|
64
|
+
releaseAssetTask: {
|
|
65
|
+
id: "task-1",
|
|
66
|
+
sourceId: "source-1",
|
|
67
|
+
deliveryId: "delivery-1",
|
|
68
|
+
projectId: "project-1",
|
|
69
|
+
sourceBranch: "aip/QA-42",
|
|
70
|
+
targetBranch: "main",
|
|
71
|
+
},
|
|
72
|
+
workItem: { id: "item-1", key: "QA-42", title: "用例" },
|
|
73
|
+
project: {
|
|
74
|
+
id: "project-1",
|
|
75
|
+
name: "tests",
|
|
76
|
+
remoteUrl: repository,
|
|
77
|
+
branch: "main",
|
|
78
|
+
mainBranch: "main",
|
|
79
|
+
},
|
|
80
|
+
providerId: "mandao",
|
|
81
|
+
modelId: "model",
|
|
82
|
+
};
|
|
83
|
+
client = {
|
|
84
|
+
qaReadTestPlan: vi.fn().mockResolvedValue({ current: null }),
|
|
85
|
+
qaCreateTestPlan: vi.fn().mockResolvedValue({ id: "TP-QA-42", version: 1 }),
|
|
86
|
+
qaUpdateTestPlan: vi.fn().mockResolvedValue({ id: "TP-QA-42", version: 1 }),
|
|
87
|
+
qaReadResults: vi.fn().mockResolvedValue({
|
|
88
|
+
execution: { status: "PENDING", transferStatus: "PENDING" },
|
|
89
|
+
cases: { items: [], total: 0 },
|
|
90
|
+
verifications: [],
|
|
91
|
+
}),
|
|
92
|
+
qaEmployeeConfig: vi.fn().mockResolvedValue({
|
|
93
|
+
agent: { name: "QA", enabledTools: ["read", "bash", "browser"] },
|
|
94
|
+
toolDefinitions: qaToolDefinitions(),
|
|
95
|
+
activeToolNames: ["read", "bash", "browser", ...qaToolDefinitions().map((tool) => tool.name)],
|
|
96
|
+
}),
|
|
97
|
+
qaEmployeeTool: vi.fn(),
|
|
98
|
+
qaSessionEvents: vi.fn().mockResolvedValue({ accepted: true }),
|
|
99
|
+
qaRequestExecution: vi.fn().mockResolvedValue({ id: "execution-1" }),
|
|
100
|
+
qaUploadSessionAttachment: vi.fn().mockResolvedValue({ id: "attachment-1" }),
|
|
101
|
+
qaSubmitVerification: vi.fn().mockResolvedValue({ accepted: true }),
|
|
102
|
+
qaReuseVerification: vi.fn().mockResolvedValue({ accepted: true }),
|
|
103
|
+
qaRequestWaiver: vi.fn().mockResolvedValue({ accepted: true }),
|
|
104
|
+
qaSubmitConclusion: vi.fn().mockResolvedValue({ accepted: true }),
|
|
105
|
+
qaReportDefects: vi.fn().mockResolvedValue({ accepted: true }),
|
|
106
|
+
qaRequestRework: vi.fn().mockResolvedValue({ accepted: true }),
|
|
107
|
+
qaResolveDefect: vi.fn().mockResolvedValue({ accepted: true }),
|
|
108
|
+
qaCompleteReview: vi.fn().mockResolvedValue({ accepted: true }),
|
|
109
|
+
qaReportAssetMerge: vi.fn().mockResolvedValue({ accepted: true }),
|
|
110
|
+
};
|
|
111
|
+
listeners = [];
|
|
112
|
+
session = {
|
|
113
|
+
model: { id: "model", provider: "mandao" },
|
|
114
|
+
isIdle: false,
|
|
115
|
+
agent: {
|
|
116
|
+
steer: vi.fn((_message) => { }),
|
|
117
|
+
followUp: vi.fn((_message) => { }),
|
|
118
|
+
getQueuedMessages: vi.fn(() => ({ steering: [], followUp: [] })),
|
|
119
|
+
},
|
|
120
|
+
steer: vi.fn(async (text) => session.agent.steer({ role: "user", content: text })),
|
|
121
|
+
followUp: vi.fn(async (text) => session.agent.followUp({ role: "user", content: text })),
|
|
122
|
+
clearQueue: vi.fn(),
|
|
123
|
+
setSteeringMode: vi.fn(),
|
|
124
|
+
setFollowUpMode: vi.fn(),
|
|
125
|
+
getContextUsage: vi.fn().mockReturnValue({ tokens: 12000, contextWindow: 100000 }),
|
|
126
|
+
settingsManager: {
|
|
127
|
+
getCompactionSettings: vi.fn().mockReturnValue({ enabled: true, reserveTokens: 16000 }),
|
|
128
|
+
},
|
|
129
|
+
prompt: vi.fn(async () => {
|
|
130
|
+
for (const listener of listeners)
|
|
131
|
+
listener({
|
|
132
|
+
type: "message_end",
|
|
133
|
+
message: {
|
|
134
|
+
role: "assistant",
|
|
135
|
+
content: [{ type: "text", text: "已检查用例" }],
|
|
136
|
+
stopReason: "stop",
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}),
|
|
140
|
+
subscribe: vi.fn((listener) => {
|
|
141
|
+
listeners.push(listener);
|
|
142
|
+
return () => { };
|
|
143
|
+
}),
|
|
144
|
+
abort: vi.fn(),
|
|
145
|
+
dispose: vi.fn(),
|
|
146
|
+
};
|
|
147
|
+
mocks.open.mockResolvedValue({ session, sessionId: "pi-session-1" });
|
|
148
|
+
mocks.live.mockReturnValue({ extension: () => { }, attach: vi.fn() });
|
|
149
|
+
model.resolveRuntimeModel.mockResolvedValue({ runtime: {}, model: {} });
|
|
150
|
+
});
|
|
151
|
+
afterEach(async () => {
|
|
152
|
+
configureOperationResources();
|
|
153
|
+
vi.unstubAllEnvs();
|
|
154
|
+
await rm(home, { recursive: true, force: true });
|
|
155
|
+
});
|
|
156
|
+
it("不同 QA 会话共用工单目录时等待整次执行释放,取消等待者后不会延迟启动", async () => {
|
|
157
|
+
const owner = { executionKey: "qa:session-1", bootId: "boot", ownerId: "owner" };
|
|
158
|
+
const acquired = vi.fn(async () => { });
|
|
159
|
+
const released = vi.fn(async () => { });
|
|
160
|
+
configureOperationResources(owner, { acquired, released });
|
|
161
|
+
let finish;
|
|
162
|
+
session.prompt.mockImplementationOnce(() => new Promise((resolve) => {
|
|
163
|
+
finish = resolve;
|
|
164
|
+
}));
|
|
165
|
+
const first = new QaSessionManager(model);
|
|
166
|
+
await first.execute(client, host, command("owner"));
|
|
167
|
+
await vi.waitFor(() => expect(session.prompt).toHaveBeenCalledTimes(1));
|
|
168
|
+
const directory = dirname(mocks.open.mock.calls[0][0].cwd);
|
|
169
|
+
expect(JSON.parse(await readFile(`${directory}.aip-owner.json`, "utf8"))).toEqual(owner);
|
|
170
|
+
const cancel = new AbortController();
|
|
171
|
+
const second = new QaSessionManager(model, cancel.signal);
|
|
172
|
+
input.sessionId = "session-2";
|
|
173
|
+
await second.execute(client, host, command("waiting"));
|
|
174
|
+
expect(second.isBusy()).toBe(true);
|
|
175
|
+
await new Promise((resolve) => setTimeout(resolve, 120));
|
|
176
|
+
expect(acquired).toHaveBeenCalledTimes(1);
|
|
177
|
+
expect(session.prompt).toHaveBeenCalledTimes(1);
|
|
178
|
+
cancel.abort();
|
|
179
|
+
await second.settled();
|
|
180
|
+
expect(second.isBusy()).toBe(false);
|
|
181
|
+
expect(released).not.toHaveBeenCalled();
|
|
182
|
+
finish();
|
|
183
|
+
await first.settled();
|
|
184
|
+
expect(released).toHaveBeenCalledExactlyOnceWith(directory);
|
|
185
|
+
await expect(readFile(`${directory}.aip-owner.json`)).rejects.toThrow();
|
|
186
|
+
expect(session.prompt).toHaveBeenCalledTimes(1);
|
|
187
|
+
});
|
|
188
|
+
it("按工单独立 clone,复用时保留未提交和未跟踪文件,拒绝另一分支且不清理现场", async () => {
|
|
189
|
+
const cwd = await prepareQaProject(input);
|
|
190
|
+
expect((await git("git", ["branch", "--show-current"], { cwd })).stdout.trim()).toBe("aip/QA-42");
|
|
191
|
+
await writeFile(join(cwd, "README.md"), "pending");
|
|
192
|
+
await writeFile(join(cwd, "draft.txt"), "keep");
|
|
193
|
+
expect(await prepareQaProject(input)).toBe(cwd);
|
|
194
|
+
expect(await readFile(join(cwd, "README.md"), "utf8")).toBe("pending");
|
|
195
|
+
await git("git", ["switch", "-c", "other"], { cwd });
|
|
196
|
+
await expect(prepareQaProject(input)).rejects.toThrow("QA_WORK_BRANCH_CHANGED");
|
|
197
|
+
expect(await readFile(join(cwd, "draft.txt"), "utf8")).toBe("keep");
|
|
198
|
+
});
|
|
199
|
+
it("QA 复用 HTTP 地址并保留现场,拒绝不相关的 origin", async () => {
|
|
200
|
+
const cwd = await prepareQaProject(input);
|
|
201
|
+
if (!input.project)
|
|
202
|
+
throw new Error("fixture test project missing");
|
|
203
|
+
input.project.remoteUrl = "https://git.example.test/qa/tests.git";
|
|
204
|
+
await git("git", ["remote", "set-url", "origin", input.project.remoteUrl], { cwd });
|
|
205
|
+
await git("git", ["config", "remote.origin.pushurl", input.project.remoteUrl], { cwd });
|
|
206
|
+
await writeFile(join(cwd, "README.md"), "pending");
|
|
207
|
+
await prepareQaProject(input);
|
|
208
|
+
expect((await git("git", ["config", "--get", "remote.origin.url"], { cwd })).stdout.trim()).toBe(input.project.remoteUrl);
|
|
209
|
+
expect((await git("git", ["config", "--get", "remote.origin.pushurl"], { cwd })).stdout.trim()).toBe(input.project.remoteUrl);
|
|
210
|
+
expect(await readFile(join(cwd, "README.md"), "utf8")).toBe("pending");
|
|
211
|
+
await git("git", ["remote", "set-url", "origin", "git@unrelated.test:other.git"], { cwd });
|
|
212
|
+
await expect(prepareQaProject(input)).rejects.toThrow("QA_REPOSITORY_ORIGIN_MISMATCH");
|
|
213
|
+
});
|
|
214
|
+
it("请求测试只读取当前分支,提交由平台在创建执行时固定", async () => {
|
|
215
|
+
const cwd = await prepareQaProject(input);
|
|
216
|
+
expect(await currentQaBranch(cwd)).toBe("aip/QA-42");
|
|
217
|
+
await git("git", ["checkout", "--detach"], { cwd });
|
|
218
|
+
await expect(currentQaBranch(cwd)).rejects.toThrow("QA_BRANCH_REQUIRED");
|
|
219
|
+
});
|
|
220
|
+
it("截图读取拒绝越界符号链接,只允许图片和有界文件", async () => {
|
|
221
|
+
const cwd = await prepareQaProject(input);
|
|
222
|
+
await writeFile(join(home, "secret.png"), "private");
|
|
223
|
+
await symlink(join(home, "secret.png"), join(cwd, "link.png"));
|
|
224
|
+
await expect(readQaScreenshot(cwd, "link.png")).rejects.toThrow("OUTSIDE_WORKSPACE");
|
|
225
|
+
await expect(readQaScreenshot(cwd, "README.md")).rejects.toThrow("TYPE_INVALID");
|
|
226
|
+
await writeFile(join(cwd, "screen.png"), "image");
|
|
227
|
+
expect(await readQaScreenshot(cwd, "screen.png")).toMatchObject({
|
|
228
|
+
filename: "screen.png",
|
|
229
|
+
mediaType: "image/png",
|
|
230
|
+
contentBase64: Buffer.from("image").toString("base64"),
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
it("快速接受消息,恢复 Pi 会话并绑定本条 message id;正文事件不冒充状态,重复指令不重放", async () => {
|
|
234
|
+
const manager = new QaSessionManager(model);
|
|
235
|
+
await manager.execute(client, hostState, command());
|
|
236
|
+
expect(manager.isBusy()).toBe(true);
|
|
237
|
+
await manager.settled("session-1");
|
|
238
|
+
expect(model.resolveRuntimeModel).toHaveBeenCalledWith("mandao", "model", {
|
|
239
|
+
...host,
|
|
240
|
+
turnId: "message-command-1",
|
|
241
|
+
runId: "session-1",
|
|
242
|
+
kind: "QA",
|
|
243
|
+
});
|
|
244
|
+
expect(vi.mocked(client.qaEmployeeConfig).mock.calls[0]?.[1]).not.toHaveProperty("catalogRevision");
|
|
245
|
+
expect(vi.mocked(client.qaSessionEvents).mock.calls[0]?.[1]).not.toHaveProperty("catalogRevision");
|
|
246
|
+
const events = vi.mocked(client.qaSessionEvents).mock.calls.flatMap((call) => call[1].events);
|
|
247
|
+
expect(events.map((event) => event.kind)).toEqual([
|
|
248
|
+
"WORKSPACE_PREPARED",
|
|
249
|
+
"CONTEXT_UPDATED",
|
|
250
|
+
"SESSION_STARTED",
|
|
251
|
+
"CONTEXT_UPDATED",
|
|
252
|
+
"MESSAGE",
|
|
253
|
+
"SESSION_COMPLETED",
|
|
254
|
+
]);
|
|
255
|
+
expect(events.find((event) => event.kind === "CONTEXT_UPDATED")?.payload?.contextUsage).toEqual({
|
|
256
|
+
modelId: "mandao/model",
|
|
257
|
+
tokens: 12000,
|
|
258
|
+
contextWindow: 100000,
|
|
259
|
+
status: "READY",
|
|
260
|
+
source: "ESTIMATE",
|
|
261
|
+
compressionThreshold: 84000,
|
|
262
|
+
});
|
|
263
|
+
expect(events.find((event) => event.kind === "MESSAGE")?.contentMarkdown).toBe("已检查用例");
|
|
264
|
+
expect(mocks.live.mock.calls[0]?.[3].agent.enabledTools).toContain("browser");
|
|
265
|
+
expect(mocks.live.mock.calls[0]?.[3].activeToolNames).toContain("request_qa");
|
|
266
|
+
await manager.execute(client, hostState, command());
|
|
267
|
+
await manager.settled("session-1");
|
|
268
|
+
expect(mocks.open).toHaveBeenCalledTimes(1);
|
|
269
|
+
await manager.execute(client, hostState, command("command-2", "TEST_SESSION_MESSAGE"));
|
|
270
|
+
await manager.settled("session-1");
|
|
271
|
+
expect(mocks.open.mock.calls[1]?.[0].existingId).toBe("pi-session-1");
|
|
272
|
+
expect(vi.mocked(client.qaEmployeeConfig).mock.calls.at(-1)?.[1].turnId).toBe("message-command-2");
|
|
273
|
+
});
|
|
274
|
+
it("准备后的模型配置等待收到公共取消时,不再创建或启动会话,也不伪报停止", async () => {
|
|
275
|
+
const ac = new AbortController();
|
|
276
|
+
let finish;
|
|
277
|
+
model.resolveRuntimeModel.mockImplementationOnce(() => new Promise((resolve) => {
|
|
278
|
+
finish = resolve;
|
|
279
|
+
}));
|
|
280
|
+
const manager = new QaSessionManager(model, ac.signal);
|
|
281
|
+
await manager.execute(client, hostState, command());
|
|
282
|
+
await vi.waitFor(() => expect(model.resolveRuntimeModel).toHaveBeenCalled());
|
|
283
|
+
ac.abort();
|
|
284
|
+
finish({ runtime: {}, model: { input: ["text"] } });
|
|
285
|
+
await manager.settled();
|
|
286
|
+
expect(manager.isBusy()).toBe(false);
|
|
287
|
+
expect(manager.cleanupConfirmed).toBe(true);
|
|
288
|
+
expect(mocks.open).not.toHaveBeenCalled();
|
|
289
|
+
expect(session.prompt).not.toHaveBeenCalled();
|
|
290
|
+
const kinds = vi
|
|
291
|
+
.mocked(client.qaSessionEvents)
|
|
292
|
+
.mock.calls.flatMap((call) => call[1].events.map((event) => event.kind));
|
|
293
|
+
expect(kinds).not.toContain("SESSION_STOPPED");
|
|
294
|
+
expect(kinds).not.toContain("SESSION_FAILED");
|
|
295
|
+
});
|
|
296
|
+
it("模型错误只上报失败,停止会话能中断已接受的长任务", async () => {
|
|
297
|
+
session.prompt.mockImplementation(async () => {
|
|
298
|
+
for (const listener of listeners)
|
|
299
|
+
listener({
|
|
300
|
+
type: "message_end",
|
|
301
|
+
message: {
|
|
302
|
+
role: "assistant",
|
|
303
|
+
content: [],
|
|
304
|
+
stopReason: "error",
|
|
305
|
+
errorMessage: "model unavailable",
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
const manager = new QaSessionManager(model);
|
|
310
|
+
await manager.execute(client, hostState, command());
|
|
311
|
+
await expect(manager.settled("session-1")).rejects.toThrow("model unavailable");
|
|
312
|
+
expect(vi
|
|
313
|
+
.mocked(client.qaSessionEvents)
|
|
314
|
+
.mock.calls.flatMap((c) => c[1].events)
|
|
315
|
+
.map((e) => e.kind)).toEqual([
|
|
316
|
+
"WORKSPACE_PREPARED",
|
|
317
|
+
"CONTEXT_UPDATED",
|
|
318
|
+
"SESSION_STARTED",
|
|
319
|
+
"CONTEXT_UPDATED",
|
|
320
|
+
"SESSION_FAILED",
|
|
321
|
+
]);
|
|
322
|
+
let finish = () => { };
|
|
323
|
+
session.prompt.mockImplementation(() => new Promise((resolve) => {
|
|
324
|
+
finish = resolve;
|
|
325
|
+
}));
|
|
326
|
+
session.abort.mockImplementation(() => {
|
|
327
|
+
finish();
|
|
328
|
+
});
|
|
329
|
+
await manager.execute(client, hostState, command("command-2", "TEST_SESSION_MESSAGE"));
|
|
330
|
+
await vi.waitFor(() => expect(session.prompt).toHaveBeenCalledTimes(2));
|
|
331
|
+
await manager.execute(client, hostState, {
|
|
332
|
+
id: "stop-2",
|
|
333
|
+
kind: "TEST_SESSION_STOP",
|
|
334
|
+
expiresAt: new Date(Date.now() + 60000).toISOString(),
|
|
335
|
+
qaControl: { sessionId: "session-1", messageId: "message-command-2" },
|
|
336
|
+
});
|
|
337
|
+
await manager.settled("session-1");
|
|
338
|
+
expect(session.abort).toHaveBeenCalledTimes(1);
|
|
339
|
+
expect(vi.mocked(client.qaSessionEvents).mock.calls.at(-1)?.[1].events[0]?.kind).toBe("SESSION_STOPPED");
|
|
340
|
+
});
|
|
341
|
+
it("工具参数只有业务意图,上下文派生元数据;上传失败不提交验证也不重试", async () => {
|
|
342
|
+
const cwd = await prepareQaProject(input);
|
|
343
|
+
await git("git", ["push", "-u", "origin", "aip/QA-42"], { cwd });
|
|
344
|
+
const tools = [];
|
|
345
|
+
qaTools(client, input, { ...host, turnId: "turn" }, cwd, qaToolDefinitions())({
|
|
346
|
+
registerTool(tool) {
|
|
347
|
+
tools.push(tool);
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
const read = tools.find((tool) => tool.name === "read_qa_results");
|
|
351
|
+
if (!read)
|
|
352
|
+
throw new Error("read tool missing");
|
|
353
|
+
expect(Object.keys(read.parameters.properties)).toEqual(["page"]);
|
|
354
|
+
await read.execute("read-1", { page: 2, hostId: "forged-host", turnId: "forged-turn" });
|
|
355
|
+
expect(client.qaReadResults).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
356
|
+
...host,
|
|
357
|
+
turnId: "turn",
|
|
358
|
+
page: 2,
|
|
359
|
+
});
|
|
360
|
+
vi.mocked(client.qaReadResults).mockRejectedValue(new Error("offline"));
|
|
361
|
+
await expect(read.execute("read-2", {})).rejects.toThrow("offline");
|
|
362
|
+
expect(client.qaReadResults).toHaveBeenCalledTimes(2);
|
|
363
|
+
const request = tools.find((tool) => tool.name === "request_qa");
|
|
364
|
+
if (!request)
|
|
365
|
+
throw new Error("request tool missing");
|
|
366
|
+
expect(Object.keys(request.parameters.properties)).toEqual([
|
|
367
|
+
"environment",
|
|
368
|
+
"caseIds",
|
|
369
|
+
"domains",
|
|
370
|
+
"note",
|
|
371
|
+
]);
|
|
372
|
+
await request.execute("tool-request", { environment: "scf-test", note: "修正测试断言" });
|
|
373
|
+
expect(client.qaRequestExecution).toHaveBeenCalledWith("session-1", expect.objectContaining({
|
|
374
|
+
...host,
|
|
375
|
+
turnId: "turn",
|
|
376
|
+
environment: "scf-test",
|
|
377
|
+
branch: "aip/QA-42",
|
|
378
|
+
note: "修正测试断言",
|
|
379
|
+
}));
|
|
380
|
+
expect(vi.mocked(client.qaRequestExecution).mock.calls[0]?.[1]).not.toHaveProperty("commit");
|
|
381
|
+
expect(vi.mocked(client.qaRequestExecution).mock.calls[0]?.[1]).not.toHaveProperty("deploymentReference");
|
|
382
|
+
const verification = tools.find((tool) => tool.name === "submit_qa_verification");
|
|
383
|
+
if (!verification)
|
|
384
|
+
throw new Error("verification tool missing");
|
|
385
|
+
expect(verification.parameters.properties.conclusion).toMatchObject({
|
|
386
|
+
description: expect.stringContaining("PASSED(通过)、FAILED(失败)、UNVERIFIABLE(无法验证)"),
|
|
387
|
+
});
|
|
388
|
+
await writeFile(join(cwd, "screen.png"), "image");
|
|
389
|
+
vi.mocked(client.qaUploadSessionAttachment).mockRejectedValue(new Error("offline"));
|
|
390
|
+
await expect(verification.execute("tool-verify", {
|
|
391
|
+
content: "控台",
|
|
392
|
+
steps: ["查看"],
|
|
393
|
+
conclusion: "PASSED",
|
|
394
|
+
screenshots: ["screen.png"],
|
|
395
|
+
})).rejects.toThrow("offline");
|
|
396
|
+
expect(client.qaUploadSessionAttachment).toHaveBeenCalledTimes(1);
|
|
397
|
+
expect(client.qaSubmitVerification).not.toHaveBeenCalled();
|
|
398
|
+
});
|
|
399
|
+
it("平台模型使用 QA 会话代理路径,继续携带设备、Host 与当前消息绑定", async () => {
|
|
400
|
+
const { ProductionPiModelService } = await import("../src/pi-model-service.js");
|
|
401
|
+
const { writeDeviceAuth } = await import("../src/state.js");
|
|
402
|
+
await writeDeviceAuth({
|
|
403
|
+
platformUrl: "https://platform.test",
|
|
404
|
+
deviceToken: "device-test-only",
|
|
405
|
+
expiresAt: new Date(Date.now() + 60000).toISOString(),
|
|
406
|
+
user: { id: "user", username: "qa" },
|
|
407
|
+
});
|
|
408
|
+
vi.stubGlobal("fetch", vi.fn(async () => Response.json({
|
|
409
|
+
models: [
|
|
410
|
+
{
|
|
411
|
+
providerId: "mandao",
|
|
412
|
+
providerDisplayName: "Mandao",
|
|
413
|
+
modelId: "deepseek",
|
|
414
|
+
displayName: "DeepSeek",
|
|
415
|
+
piProviderId: "deepseek",
|
|
416
|
+
piModelId: "deepseek-flash",
|
|
417
|
+
contextWindowTokens: 1000000,
|
|
418
|
+
maxOutputTokens: 16384,
|
|
419
|
+
allowedThinkingLevels: ["off", "high"],
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
})));
|
|
423
|
+
try {
|
|
424
|
+
const resolved = await new ProductionPiModelService().resolveRuntimeModel("mandao", "deepseek", { ...host, runId: "qa-session", turnId: "message-2", kind: "QA" });
|
|
425
|
+
expect(resolved.model.baseUrl).toBe("https://platform.test/api/v1/qa/sessions/qa-session/model");
|
|
426
|
+
expect(resolved.model.headers).toMatchObject({
|
|
427
|
+
"x-aip-turn-id": "message-2",
|
|
428
|
+
"x-aip-host-id": "host-1",
|
|
429
|
+
"x-aip-host-generation": "1",
|
|
430
|
+
Authorization: "Device device-test-only",
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
finally {
|
|
434
|
+
vi.unstubAllGlobals();
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
it("正文上报失败保留告警,但不覆盖执行成功,也不自动重传原事件", async () => {
|
|
438
|
+
const warning = vi.spyOn(process.stderr, "write").mockReturnValue(true);
|
|
439
|
+
vi.mocked(client.qaSessionEvents).mockImplementation(async (_id, body) => {
|
|
440
|
+
if (body.events[0]?.kind === "MESSAGE")
|
|
441
|
+
throw new PlatformClientError(502, "REQUEST_FAILED", "event transport unavailable");
|
|
442
|
+
return { accepted: true };
|
|
443
|
+
});
|
|
444
|
+
const manager = new QaSessionManager(model);
|
|
445
|
+
await manager.execute(client, hostState, command());
|
|
446
|
+
await manager.settled("session-1");
|
|
447
|
+
expect(warning).toHaveBeenCalledWith(expect.stringContaining("qa_session_event_report_failed"));
|
|
448
|
+
expect(JSON.parse(String(warning.mock.calls[0]?.[0]))).toMatchObject({
|
|
449
|
+
sessionId: "session-1",
|
|
450
|
+
kind: "MESSAGE",
|
|
451
|
+
status: 502,
|
|
452
|
+
code: "REQUEST_FAILED",
|
|
453
|
+
});
|
|
454
|
+
warning.mockRestore();
|
|
455
|
+
const kinds = vi
|
|
456
|
+
.mocked(client.qaSessionEvents)
|
|
457
|
+
.mock.calls.flatMap((call) => call[1].events.map((event) => event.kind));
|
|
458
|
+
expect(kinds).toEqual([
|
|
459
|
+
"WORKSPACE_PREPARED",
|
|
460
|
+
"CONTEXT_UPDATED",
|
|
461
|
+
"SESSION_STARTED",
|
|
462
|
+
"CONTEXT_UPDATED",
|
|
463
|
+
"MESSAGE",
|
|
464
|
+
"SESSION_COMPLETED",
|
|
465
|
+
]);
|
|
466
|
+
});
|
|
467
|
+
it("工具失败后 Agent 正常结束仍可完成会话,保留工具失败事实", async () => {
|
|
468
|
+
session.prompt.mockImplementation(async () => {
|
|
469
|
+
for (const listener of listeners)
|
|
470
|
+
listener({
|
|
471
|
+
type: "tool_execution_end",
|
|
472
|
+
toolName: "bash",
|
|
473
|
+
toolCallId: "failed-tool",
|
|
474
|
+
isError: true,
|
|
475
|
+
});
|
|
476
|
+
for (const listener of listeners)
|
|
477
|
+
listener({
|
|
478
|
+
type: "message_end",
|
|
479
|
+
message: {
|
|
480
|
+
role: "assistant",
|
|
481
|
+
content: [{ type: "text", text: "已检查用例" }],
|
|
482
|
+
stopReason: "stop",
|
|
483
|
+
},
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
const manager = new QaSessionManager(model);
|
|
487
|
+
await manager.execute(client, hostState, command());
|
|
488
|
+
await manager.settled("session-1");
|
|
489
|
+
const events = vi.mocked(client.qaSessionEvents).mock.calls.flatMap((call) => call[1].events);
|
|
490
|
+
expect(events.find((event) => event.kind === "TOOL_COMPLETED")?.payload).toMatchObject({
|
|
491
|
+
isError: true,
|
|
492
|
+
});
|
|
493
|
+
expect(events.at(-1)?.kind).toBe("SESSION_COMPLETED");
|
|
494
|
+
expect(events.some((event) => event.kind === "SESSION_FAILED")).toBe(false);
|
|
495
|
+
});
|
|
496
|
+
it("过程上报失败不能掩盖后续模型错误", async () => {
|
|
497
|
+
vi.mocked(client.qaSessionEvents).mockImplementation(async (_id, body) => {
|
|
498
|
+
if (body.events[0]?.kind === "CONTEXT_UPDATED")
|
|
499
|
+
throw new Error("event transport unavailable");
|
|
500
|
+
return { accepted: true };
|
|
501
|
+
});
|
|
502
|
+
session.prompt.mockRejectedValue(new Error("model unavailable"));
|
|
503
|
+
const manager = new QaSessionManager(model);
|
|
504
|
+
await manager.execute(client, hostState, command());
|
|
505
|
+
await expect(manager.settled("session-1")).rejects.toThrow("model unavailable");
|
|
506
|
+
const events = vi.mocked(client.qaSessionEvents).mock.calls.flatMap((call) => call[1].events);
|
|
507
|
+
expect(events.at(-1)).toMatchObject({
|
|
508
|
+
kind: "SESSION_FAILED",
|
|
509
|
+
contentMarkdown: "model unavailable",
|
|
510
|
+
});
|
|
511
|
+
expect(events.some((event) => event.kind === "SESSION_COMPLETED")).toBe(false);
|
|
512
|
+
});
|
|
513
|
+
it("完成事件未确认时仍反馈失败,不把终态上报当作可忽略过程事件", async () => {
|
|
514
|
+
vi.mocked(client.qaSessionEvents).mockImplementation(async (_id, body) => {
|
|
515
|
+
if (body.events[0]?.kind === "SESSION_COMPLETED")
|
|
516
|
+
throw new Error("completion transport unavailable");
|
|
517
|
+
return { accepted: true };
|
|
518
|
+
});
|
|
519
|
+
const manager = new QaSessionManager(model);
|
|
520
|
+
await manager.execute(client, hostState, command());
|
|
521
|
+
await expect(manager.settled("session-1")).rejects.toThrow("completion transport unavailable");
|
|
522
|
+
const events = vi.mocked(client.qaSessionEvents).mock.calls.flatMap((call) => call[1].events);
|
|
523
|
+
expect(events.at(-1)).toMatchObject({
|
|
524
|
+
kind: "SESSION_FAILED",
|
|
525
|
+
contentMarkdown: "completion transport unavailable",
|
|
526
|
+
});
|
|
527
|
+
});
|
|
528
|
+
it("测试资产成功必须来自远端 main 的真实祖先关系,拒绝仅本地合并", async () => {
|
|
529
|
+
const cwd = await prepareQaProject(input);
|
|
530
|
+
await git("git", ["config", "user.name", "QA"], { cwd });
|
|
531
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd });
|
|
532
|
+
await writeFile(join(cwd, "new-test.txt"), "test");
|
|
533
|
+
await git("git", ["add", "new-test.txt"], { cwd });
|
|
534
|
+
await git("git", ["commit", "-m", "new test"], { cwd });
|
|
535
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
536
|
+
await expect(readQaAssetState(cwd, repository, "aip/QA-42", "main")).resolves.toMatchObject({
|
|
537
|
+
hasChanges: true,
|
|
538
|
+
});
|
|
539
|
+
// 远端仓库自身快进 main,模拟真实合并已推送的结果。
|
|
540
|
+
await git("git", ["merge", "--ff-only", "aip/QA-42"], { cwd: repository });
|
|
541
|
+
await expect(readQaAssetState(cwd, repository, "aip/ANOTHER-1", "main")).rejects.toThrow("QA_WORK_BRANCH_CHANGED");
|
|
542
|
+
const result = await readQaAssetState(cwd, repository, "aip/QA-42", "main");
|
|
543
|
+
const { stdout } = await git("git", ["rev-parse", "HEAD"], { cwd });
|
|
544
|
+
expect(result).toEqual({
|
|
545
|
+
sourceCommitSha: stdout.trim(),
|
|
546
|
+
mainCommitSha: stdout.trim(),
|
|
547
|
+
hasChanges: false,
|
|
548
|
+
hasLocalChanges: false,
|
|
549
|
+
});
|
|
550
|
+
await expect(readQaAssetState(cwd, "another-remote", "aip/QA-42", "main")).rejects.toThrow("ORIGIN_MISMATCH");
|
|
551
|
+
});
|
|
552
|
+
it("新增 QA 工具不暴露内部上下文或 SHA,失败原样反馈且不重复返工", async () => {
|
|
553
|
+
const cwd = await prepareQaProject(input);
|
|
554
|
+
const tools = [];
|
|
555
|
+
qaTools(client, input, { ...host, turnId: "turn" }, cwd, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
556
|
+
for (const tool of tools) {
|
|
557
|
+
for (const hidden of [
|
|
558
|
+
"hostId",
|
|
559
|
+
"generation",
|
|
560
|
+
"turnId",
|
|
561
|
+
"toolCallId",
|
|
562
|
+
"releaseAssetTaskId",
|
|
563
|
+
"mergeRequest",
|
|
564
|
+
"executionId",
|
|
565
|
+
"sourceCommitSha",
|
|
566
|
+
"mainCommitSha",
|
|
567
|
+
])
|
|
568
|
+
expect(tool.parameters.properties).not.toHaveProperty(hidden);
|
|
569
|
+
}
|
|
570
|
+
const rework = tools.find((tool) => tool.name === "request_qa_rework");
|
|
571
|
+
if (!rework)
|
|
572
|
+
throw new Error("rework tool missing");
|
|
573
|
+
vi.mocked(client.qaRequestRework).mockRejectedValue(new Error("QA_REWORK_LIMIT_REACHED"));
|
|
574
|
+
await expect(rework.execute("rework-1", { reason: "筛选不符", hostId: "forged" })).rejects.toThrow("QA_REWORK_LIMIT_REACHED");
|
|
575
|
+
expect(client.qaRequestRework).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
576
|
+
...host,
|
|
577
|
+
turnId: "turn",
|
|
578
|
+
toolCallId: "rework-1",
|
|
579
|
+
reason: "筛选不符",
|
|
580
|
+
});
|
|
581
|
+
const merge = tools.find((tool) => tool.name === "report_qa_asset_merge");
|
|
582
|
+
if (!merge)
|
|
583
|
+
throw new Error("merge tool missing");
|
|
584
|
+
await writeFile(join(cwd, "unmerged-test.txt"), "尚未合入的测试资产");
|
|
585
|
+
await expect(merge.execute("merge-1", { status: "SUCCEEDED", summary: "已合入", sourceCommitSha: "forged" })).rejects.toThrow();
|
|
586
|
+
expect(client.qaReportAssetMerge).not.toHaveBeenCalled();
|
|
587
|
+
await merge.execute("merge-2", { status: "FAILED", summary: "远端保护规则拒绝推送" });
|
|
588
|
+
expect(mocks.prepareMergeRequest).not.toHaveBeenCalled();
|
|
589
|
+
expect(client.qaReportAssetMerge).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
590
|
+
...host,
|
|
591
|
+
turnId: "turn",
|
|
592
|
+
toolCallId: "merge-2",
|
|
593
|
+
releaseAssetTaskId: "task-1",
|
|
594
|
+
status: "FAILED",
|
|
595
|
+
summary: "远端保护规则拒绝推送",
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
it.each(["merge-conflict", "protected-main"])("真实 Git %s 保留失败现场并通过工具如实上报,不假报资产入库", async (scenario) => {
|
|
599
|
+
const cwd = await prepareQaProject(input);
|
|
600
|
+
await git("git", ["config", "user.name", "QA"], { cwd });
|
|
601
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd });
|
|
602
|
+
await writeFile(join(cwd, "README.md"), "QA changes\n");
|
|
603
|
+
await git("git", ["add", "README.md"], { cwd });
|
|
604
|
+
await git("git", ["commit", "-m", "QA asset change"], { cwd });
|
|
605
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
606
|
+
if (scenario === "merge-conflict") {
|
|
607
|
+
await writeFile(join(repository, "README.md"), "main changes\n");
|
|
608
|
+
await git("git", ["add", "README.md"], { cwd: repository });
|
|
609
|
+
await git("git", ["commit", "-m", "concurrent main change"], { cwd: repository });
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
// 本地接收钩子产生真实拒绝;不声称是实际 GitLab 保护规则的验收。
|
|
613
|
+
await git("git", ["config", "receive.denyCurrentBranch", "ignore"], { cwd: repository });
|
|
614
|
+
const hook = join(repository, ".git/hooks/pre-receive");
|
|
615
|
+
await writeFile(hook, '#!/bin/sh\necho "protected main: push denied" >&2\nexit 1\n');
|
|
616
|
+
await chmod(hook, 0o755);
|
|
617
|
+
}
|
|
618
|
+
const before = (await git("git", ["rev-parse", "main"], { cwd: repository })).stdout;
|
|
619
|
+
await git("git", ["fetch", "origin", "main"], { cwd });
|
|
620
|
+
let failure = "";
|
|
621
|
+
try {
|
|
622
|
+
await git("git", scenario === "merge-conflict" ? ["merge", "origin/main"] : ["push", "origin", "HEAD:main"], { cwd });
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
const result = error;
|
|
626
|
+
failure = result.stdout + result.stderr;
|
|
627
|
+
}
|
|
628
|
+
expect(failure).toContain(scenario === "merge-conflict" ? "CONFLICT" : "protected main: push denied");
|
|
629
|
+
expect((await git("git", ["rev-parse", "main"], { cwd: repository })).stdout).toBe(before);
|
|
630
|
+
if (scenario === "merge-conflict")
|
|
631
|
+
expect((await git("git", ["diff", "--name-only", "--diff-filter=U"], { cwd })).stdout.trim()).toBe("README.md");
|
|
632
|
+
await expect(readQaAssetState(cwd, repository, "aip/QA-42", "main")).resolves.toMatchObject({
|
|
633
|
+
hasChanges: true,
|
|
634
|
+
});
|
|
635
|
+
const tools = [];
|
|
636
|
+
qaTools(client, input, { ...host, turnId: "turn" }, cwd, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
637
|
+
const merge = tools.find((tool) => tool.name === "report_qa_asset_merge");
|
|
638
|
+
if (!merge)
|
|
639
|
+
throw new Error("merge tool missing");
|
|
640
|
+
await merge.execute("actual-git-failure", { status: "FAILED", summary: failure });
|
|
641
|
+
expect(client.qaReportAssetMerge).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
642
|
+
...host,
|
|
643
|
+
turnId: "turn",
|
|
644
|
+
toolCallId: "actual-git-failure",
|
|
645
|
+
releaseAssetTaskId: "task-1",
|
|
646
|
+
status: "FAILED",
|
|
647
|
+
summary: failure,
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
it("结构化计划与证据工具只暴露业务字段,计划编号版本由平台绑定且无 Agent 批准豁免入口", async () => {
|
|
651
|
+
const tools = [];
|
|
652
|
+
const binding = { ...host, turnId: "turn" };
|
|
653
|
+
qaTools(client, input, binding, home, qaToolDefinitions())({
|
|
654
|
+
registerTool: (tool) => tools.push(tool),
|
|
655
|
+
});
|
|
656
|
+
const read = tools.find((tool) => tool.name === "read_qa_test_plan");
|
|
657
|
+
if (!read)
|
|
658
|
+
throw new Error("read_qa_test_plan missing");
|
|
659
|
+
const submit = tools.find((tool) => tool.name === "create_qa_test_plan");
|
|
660
|
+
if (!submit)
|
|
661
|
+
throw new Error("create_qa_test_plan missing");
|
|
662
|
+
expect(Object.keys(read.parameters.properties)).toEqual([]);
|
|
663
|
+
await read.execute("read", { hostId: "forged", version: 99 });
|
|
664
|
+
expect(client.qaReadTestPlan).toHaveBeenCalledExactlyOnceWith("session-1", binding);
|
|
665
|
+
for (const tool of tools) {
|
|
666
|
+
expect(Object.keys(tool.parameters.properties)).not.toEqual(expect.arrayContaining(["toolCallId"]));
|
|
667
|
+
for (const field of [
|
|
668
|
+
"revision",
|
|
669
|
+
"version",
|
|
670
|
+
"planVersion",
|
|
671
|
+
"planRevisionId",
|
|
672
|
+
"hash",
|
|
673
|
+
"traceId",
|
|
674
|
+
"toolCallId",
|
|
675
|
+
])
|
|
676
|
+
expect(tool.parameters.properties).not.toHaveProperty(field);
|
|
677
|
+
}
|
|
678
|
+
expect(tools.filter((tool) => /waiv|exempt/i.test(tool.name)).map((tool) => tool.name)).toEqual([
|
|
679
|
+
"request_qa_waiver",
|
|
680
|
+
]);
|
|
681
|
+
const plan = {
|
|
682
|
+
scope: "筛选",
|
|
683
|
+
strategy: "业务与参数边界",
|
|
684
|
+
preconditions: ["部署就绪"],
|
|
685
|
+
exclusions: [],
|
|
686
|
+
items: [
|
|
687
|
+
{
|
|
688
|
+
id: "TC-001",
|
|
689
|
+
name: "筛选",
|
|
690
|
+
perspectives: ["BUSINESS"],
|
|
691
|
+
ac: ["FX-02"],
|
|
692
|
+
methods: ["API"],
|
|
693
|
+
executionModes: ["AUTOMATED"],
|
|
694
|
+
preconditions: [],
|
|
695
|
+
steps: ["筛选"],
|
|
696
|
+
expectedResults: ["仅匹配项"],
|
|
697
|
+
automationCaseIds: ["delivery.items.filter"],
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
name: "非法参数",
|
|
701
|
+
perspectives: ["BOUNDARY"],
|
|
702
|
+
ac: [],
|
|
703
|
+
extensionReason: "异常参数风险",
|
|
704
|
+
methods: ["API"],
|
|
705
|
+
executionModes: ["AUTOMATED"],
|
|
706
|
+
preconditions: [],
|
|
707
|
+
steps: ["输入非法参数"],
|
|
708
|
+
expectedResults: ["符合接口约定"],
|
|
709
|
+
automationCaseIds: ["delivery.items.invalid"],
|
|
710
|
+
},
|
|
711
|
+
],
|
|
712
|
+
};
|
|
713
|
+
const created = await submit.execute("plan-call", {
|
|
714
|
+
...plan,
|
|
715
|
+
hostId: "forged",
|
|
716
|
+
toolCallId: "forged",
|
|
717
|
+
version: 99,
|
|
718
|
+
});
|
|
719
|
+
expect(JSON.stringify(created)).toContain("旧版本验证结果和人工豁免不会自动沿用");
|
|
720
|
+
expect(tools.some((tool) => tool.name === "submit_qa_test_plan")).toBe(false);
|
|
721
|
+
expect(client.qaCreateTestPlan).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
722
|
+
...plan,
|
|
723
|
+
...binding,
|
|
724
|
+
toolCallId: "plan-call",
|
|
725
|
+
});
|
|
726
|
+
vi.mocked(client.qaCreateTestPlan).mockRejectedValueOnce(new Error("offline"));
|
|
727
|
+
await expect(submit.execute("next", plan)).rejects.toThrow("offline");
|
|
728
|
+
expect(client.qaCreateTestPlan).toHaveBeenCalledTimes(2);
|
|
729
|
+
const verify = tools.find((tool) => tool.name === "submit_qa_verification");
|
|
730
|
+
if (!verify)
|
|
731
|
+
throw new Error("submit_qa_verification missing");
|
|
732
|
+
await writeFile(join(home, "screen.png"), "image");
|
|
733
|
+
const evidence = {
|
|
734
|
+
content: "筛选页面",
|
|
735
|
+
testItemIds: ["TC-001"],
|
|
736
|
+
expected: "仅启用项",
|
|
737
|
+
actual: "显示启用项",
|
|
738
|
+
checkpoints: [{ group: "列表", title: "状态", expected: "启用", actual: "启用" }],
|
|
739
|
+
steps: ["点击启用"],
|
|
740
|
+
conclusion: "PASSED",
|
|
741
|
+
};
|
|
742
|
+
await verify.execute("verify-call", {
|
|
743
|
+
...evidence,
|
|
744
|
+
screenshots: ["screen.png"],
|
|
745
|
+
planVersion: 99,
|
|
746
|
+
});
|
|
747
|
+
expect(client.qaSubmitVerification).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
748
|
+
...evidence,
|
|
749
|
+
attachmentIds: ["attachment-1"],
|
|
750
|
+
...binding,
|
|
751
|
+
toolCallId: "verify-call",
|
|
752
|
+
});
|
|
753
|
+
const defect = tools.find((tool) => tool.name === "report_qa_defects");
|
|
754
|
+
if (!defect)
|
|
755
|
+
throw new Error("report_qa_defects missing");
|
|
756
|
+
const defects = [
|
|
757
|
+
{
|
|
758
|
+
title: "非法参数异常",
|
|
759
|
+
ac: [],
|
|
760
|
+
testItemIds: ["TC-002"],
|
|
761
|
+
steps: ["输入非法参数"],
|
|
762
|
+
expected: "按约定响应",
|
|
763
|
+
actual: "内部异常",
|
|
764
|
+
evidence: "真实执行结果",
|
|
765
|
+
},
|
|
766
|
+
];
|
|
767
|
+
await defect.execute("defect-call", { defects });
|
|
768
|
+
expect(client.qaReportDefects).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
769
|
+
defects,
|
|
770
|
+
...binding,
|
|
771
|
+
toolCallId: "defect-call",
|
|
772
|
+
});
|
|
773
|
+
const conclusion = tools.find((tool) => tool.name === "submit_qa_conclusion");
|
|
774
|
+
if (!conclusion)
|
|
775
|
+
throw new Error("submit_qa_conclusion missing");
|
|
776
|
+
const summary = {
|
|
777
|
+
contentMarkdown: "需要返修",
|
|
778
|
+
unfinishedDetails: [
|
|
779
|
+
{ testItemId: "TC-002", reason: "非法参数返回异常", nextAction: "交研发返修后复测" },
|
|
780
|
+
],
|
|
781
|
+
recommendation: "NOT_READY",
|
|
782
|
+
unfinishedItems: ["TC-002"],
|
|
783
|
+
risks: ["非法参数异常"],
|
|
784
|
+
evidenceRefs: ["execution-1"],
|
|
785
|
+
};
|
|
786
|
+
await conclusion.execute("conclusion-call", summary);
|
|
787
|
+
expect(client.qaSubmitConclusion).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
788
|
+
...summary,
|
|
789
|
+
...binding,
|
|
790
|
+
toolCallId: "conclusion-call",
|
|
791
|
+
});
|
|
792
|
+
});
|
|
793
|
+
it("非浏览器扩展项无法验证可空截图提交真实阻塞原因,不伪造附件", async () => {
|
|
794
|
+
const tools = [];
|
|
795
|
+
qaTools(client, input, { ...host, turnId: "turn" }, home, qaToolDefinitions())({
|
|
796
|
+
registerTool: (tool) => tools.push(tool),
|
|
797
|
+
});
|
|
798
|
+
const tool = tools.find((item) => item.name === "submit_qa_verification");
|
|
799
|
+
if (!tool)
|
|
800
|
+
throw new Error("verification tool missing");
|
|
801
|
+
expect(tool.parameters.properties.screenshots).toHaveProperty("minItems", 0);
|
|
802
|
+
const args = {
|
|
803
|
+
content: "性能预算缺失",
|
|
804
|
+
testItemIds: ["TC-004"],
|
|
805
|
+
steps: ["检查负载预算"],
|
|
806
|
+
expected: "取得批准的负载预算后执行",
|
|
807
|
+
actual: "无负载预算,未发起压测",
|
|
808
|
+
checkpoints: [],
|
|
809
|
+
conclusion: "UNVERIFIABLE",
|
|
810
|
+
unverifiableReason: "未批准负载预算和压测窗口",
|
|
811
|
+
};
|
|
812
|
+
for (const reason of [undefined, "", " "]) {
|
|
813
|
+
await expect(tool.execute("invalid-blocked", { ...args, unverifiableReason: reason, screenshots: [] })).rejects.toThrow("QA_VERIFICATION_DETAILS_REQUIRED");
|
|
814
|
+
}
|
|
815
|
+
expect(client.qaSubmitVerification).not.toHaveBeenCalled();
|
|
816
|
+
await tool.execute("blocked-call", { ...args, screenshots: [] });
|
|
817
|
+
expect(client.qaUploadSessionAttachment).not.toHaveBeenCalled();
|
|
818
|
+
expect(client.qaSubmitVerification).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
819
|
+
...args,
|
|
820
|
+
attachmentIds: [],
|
|
821
|
+
...host,
|
|
822
|
+
turnId: "turn",
|
|
823
|
+
toolCallId: "blocked-call",
|
|
824
|
+
});
|
|
825
|
+
});
|
|
826
|
+
it("已通过与失败验证允许原因省略或空字符串,工具schema和提交不要求不适用占位", async () => {
|
|
827
|
+
const tools = [];
|
|
828
|
+
qaTools(client, input, { ...host, turnId: "turn" }, home, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
829
|
+
const tool = tools.find((item) => item.name === "submit_qa_verification");
|
|
830
|
+
if (!tool)
|
|
831
|
+
throw new Error("verification tool missing");
|
|
832
|
+
await writeFile(join(home, "screen.png"), "image");
|
|
833
|
+
for (const conclusion of ["PASSED", "FAILED"]) {
|
|
834
|
+
for (const reason of [undefined, ""]) {
|
|
835
|
+
const args = {
|
|
836
|
+
content: "实际验证",
|
|
837
|
+
testItemIds: ["TC-003"],
|
|
838
|
+
expected: "符合预期",
|
|
839
|
+
actual: "真实观察",
|
|
840
|
+
checkpoints: [],
|
|
841
|
+
steps: ["检查页面"],
|
|
842
|
+
conclusion,
|
|
843
|
+
screenshots: ["screen.png"],
|
|
844
|
+
...(reason === undefined ? {} : { unverifiableReason: reason }),
|
|
845
|
+
};
|
|
846
|
+
expect(Check(tool.parameters, args)).toBe(true);
|
|
847
|
+
await tool.execute(`verify-${conclusion}-${String(reason)}`, args);
|
|
848
|
+
const submitted = vi.mocked(client.qaSubmitVerification).mock.calls.at(-1)?.[1];
|
|
849
|
+
expect(submitted).not.toHaveProperty("unverifiableReason");
|
|
850
|
+
expect(submitted).toHaveProperty("conclusion", conclusion);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
it("空分支和无内容提交不冒充待合入改动,本地文件单独记录", async () => {
|
|
855
|
+
const cwd = await prepareQaProject(input);
|
|
856
|
+
await git("git", ["config", "user.name", "QA"], { cwd });
|
|
857
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd });
|
|
858
|
+
const state = () => readQaAssetState(cwd, repository, "aip/QA-42", "main");
|
|
859
|
+
expect(await state()).toMatchObject({ hasChanges: false, hasLocalChanges: false });
|
|
860
|
+
await git("git", ["commit", "--allow-empty", "-m", "verification only"], { cwd });
|
|
861
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
862
|
+
expect(await state()).toMatchObject({ hasChanges: false, hasLocalChanges: false });
|
|
863
|
+
await writeFile(join(cwd, "verification.log"), "QA evidence");
|
|
864
|
+
expect(await state()).toMatchObject({ hasChanges: false, hasLocalChanges: true });
|
|
865
|
+
});
|
|
866
|
+
it("真实 bare 仓库按配置主分支核对无变化、未推送、dirty 与已合入事实", async () => {
|
|
867
|
+
const bare = join(home, "bare.git");
|
|
868
|
+
await git("git", ["clone", "--bare", repository, bare]);
|
|
869
|
+
await git("git", ["branch", "trunk", "main"], { cwd: bare });
|
|
870
|
+
if (!input.project)
|
|
871
|
+
throw new Error("fixture test project missing");
|
|
872
|
+
input.project.remoteUrl = bare;
|
|
873
|
+
input.project.mainBranch = "trunk";
|
|
874
|
+
const cwd = await prepareQaProject(input);
|
|
875
|
+
await git("git", ["config", "user.name", "QA"], { cwd });
|
|
876
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd });
|
|
877
|
+
const state = () => readQaAssetState(cwd, bare, "aip/QA-42", "trunk");
|
|
878
|
+
// 从未测试且工作区与主分支一致,不必先创建空远端分支。
|
|
879
|
+
expect((await state()).hasChanges).toBe(false);
|
|
880
|
+
await expect(readQaAssetState(cwd, bare, "aip/QA-42", "trunk")).resolves.toMatchObject({
|
|
881
|
+
sourceCommitSha: expect.any(String),
|
|
882
|
+
mainCommitSha: expect.any(String),
|
|
883
|
+
});
|
|
884
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
885
|
+
expect((await state()).hasChanges).toBe(false);
|
|
886
|
+
await writeFile(join(cwd, "case.txt"), "case");
|
|
887
|
+
await expect(readQaAssetState(cwd, bare, "aip/QA-42", "trunk")).resolves.toMatchObject({
|
|
888
|
+
hasChanges: false,
|
|
889
|
+
hasLocalChanges: true,
|
|
890
|
+
});
|
|
891
|
+
await git("git", ["add", "case.txt"], { cwd });
|
|
892
|
+
await git("git", ["commit", "-m", "case"], { cwd });
|
|
893
|
+
expect((await state()).hasChanges).toBe(true);
|
|
894
|
+
await git("git", ["push", "origin", "HEAD:trunk"], { cwd });
|
|
895
|
+
// 主分支已有本地提交;工单分支尚未同步,只提示本地内容待确认。
|
|
896
|
+
await expect(readQaAssetState(cwd, bare, "aip/QA-42", "trunk")).resolves.toMatchObject({
|
|
897
|
+
hasChanges: false,
|
|
898
|
+
hasLocalChanges: true,
|
|
899
|
+
});
|
|
900
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
901
|
+
const facts = await state();
|
|
902
|
+
expect(facts.hasChanges).toBe(false);
|
|
903
|
+
expect(facts.sourceCommitSha).toBe(facts.mainCommitSha);
|
|
904
|
+
await expect(readQaAssetState(cwd, bare, "aip/QA-42", "missing")).rejects.toThrow();
|
|
905
|
+
}, 15_000);
|
|
906
|
+
it("QA 完成采集 Git 事实,准备工具绑定当前任务并登记 MR,历史任务不可重用", async () => {
|
|
907
|
+
const cwd = await prepareQaProject(input);
|
|
908
|
+
await git("git", ["config", "user.name", "QA"], { cwd });
|
|
909
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd });
|
|
910
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
911
|
+
const sourceCommitSha = (await git("git", ["rev-parse", "HEAD"], { cwd })).stdout.trim();
|
|
912
|
+
const tools = [];
|
|
913
|
+
qaTools(client, input, { ...host, turnId: "turn" }, cwd, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
914
|
+
const complete = tools.find((tool) => tool.name === "complete_qa_review");
|
|
915
|
+
const merge = tools.find((tool) => tool.name === "report_qa_asset_merge");
|
|
916
|
+
await complete.execute("complete", { summary: "就绪", assetState: { hasChanges: true } });
|
|
917
|
+
expect(client.qaCompleteReview).toHaveBeenCalledWith("session-1", expect.objectContaining({
|
|
918
|
+
assetState: {
|
|
919
|
+
sourceCommitSha: sourceCommitSha,
|
|
920
|
+
mainCommitSha: sourceCommitSha,
|
|
921
|
+
hasChanges: false,
|
|
922
|
+
hasLocalChanges: false,
|
|
923
|
+
},
|
|
924
|
+
}));
|
|
925
|
+
await merge.execute("merge", {
|
|
926
|
+
status: "SUCCEEDED",
|
|
927
|
+
summary: "无变化",
|
|
928
|
+
deliveryId: "forged",
|
|
929
|
+
contentChanged: true,
|
|
930
|
+
});
|
|
931
|
+
expect(client.qaReportAssetMerge).toHaveBeenLastCalledWith("session-1", expect.objectContaining({
|
|
932
|
+
releaseAssetTaskId: "task-1",
|
|
933
|
+
mergeRequest: expect.objectContaining({ projectId: "project-1", mrIid: 7 }),
|
|
934
|
+
}));
|
|
935
|
+
await writeFile(join(cwd, "changed.txt"), "new assertion");
|
|
936
|
+
await git("git", ["add", "."], { cwd });
|
|
937
|
+
await git("git", ["commit", "-m", "changed assertion"], { cwd });
|
|
938
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
939
|
+
await git("git", ["merge", "--ff-only", "aip/QA-42"], { cwd: repository });
|
|
940
|
+
await merge.execute("changed", { status: "SUCCEEDED", summary: "变化", contentChanged: false });
|
|
941
|
+
expect(client.qaReportAssetMerge).toHaveBeenLastCalledWith("session-1", expect.objectContaining({
|
|
942
|
+
releaseAssetTaskId: "task-1",
|
|
943
|
+
mergeRequest: expect.objectContaining({ mrIid: 7 }),
|
|
944
|
+
}));
|
|
945
|
+
delete input.releaseAssetTask;
|
|
946
|
+
await expect(merge.execute("followup", { status: "SUCCEEDED", summary: "历史任务" })).rejects.toThrow("QA_RELEASE_TASK_REQUIRED");
|
|
947
|
+
expect(mocks.prepareMergeRequest).toHaveBeenCalledTimes(2);
|
|
948
|
+
});
|
|
949
|
+
it.each(["conflict-rewrite", "parallel-unrelated", "conflict-keep-approved"])("真实 bare Git 合入结果核对:%s,回到原 QA 分支上报仍检查远端内容", async (scenario) => {
|
|
950
|
+
const bare = join(home, "merge-origin.git");
|
|
951
|
+
await git("git", ["clone", "--bare", repository, bare]);
|
|
952
|
+
if (!input.project)
|
|
953
|
+
throw new Error("fixture test project missing");
|
|
954
|
+
input.project.remoteUrl = bare;
|
|
955
|
+
const cwd = await prepareQaProject(input);
|
|
956
|
+
await git("git", ["config", "user.name", "QA"], { cwd });
|
|
957
|
+
await git("git", ["config", "user.email", "qa@example.test"], { cwd });
|
|
958
|
+
await writeFile(join(cwd, "README.md"), "approved assertion\n");
|
|
959
|
+
await git("git", ["commit", "-am", "approved test"], { cwd });
|
|
960
|
+
const sourceCommitSha = (await git("git", ["rev-parse", "HEAD"], { cwd })).stdout.trim();
|
|
961
|
+
await git("git", ["push", "origin", "aip/QA-42"], { cwd });
|
|
962
|
+
await git("git", ["switch", "main"], { cwd });
|
|
963
|
+
const conflict = scenario !== "parallel-unrelated";
|
|
964
|
+
await writeFile(join(cwd, conflict ? "README.md" : "unrelated.txt"), "parallel change\n");
|
|
965
|
+
await git("git", ["add", "."], { cwd });
|
|
966
|
+
await git("git", ["commit", "-m", "parallel main work"], { cwd });
|
|
967
|
+
if (conflict) {
|
|
968
|
+
await expect(git("git", ["merge", "--no-ff", "aip/QA-42"], { cwd })).rejects.toThrow();
|
|
969
|
+
await writeFile(join(cwd, "README.md"), scenario === "conflict-rewrite" ? "changed semantic assertion\n" : "approved assertion\n");
|
|
970
|
+
await git("git", ["add", "."], { cwd });
|
|
971
|
+
await git("git", ["commit", "-m", "resolve conflict"], { cwd });
|
|
972
|
+
}
|
|
973
|
+
else {
|
|
974
|
+
await git("git", ["merge", "--no-ff", "aip/QA-42", "-m", "merge approved test"], { cwd });
|
|
975
|
+
}
|
|
976
|
+
await git("git", ["push", "origin", "main"], { cwd });
|
|
977
|
+
await git("git", ["switch", "aip/QA-42"], { cwd });
|
|
978
|
+
expect((await git("git", ["rev-parse", "HEAD"], { cwd })).stdout.trim()).toBe(sourceCommitSha);
|
|
979
|
+
const tools = [];
|
|
980
|
+
qaTools(client, input, { ...host, turnId: "turn" }, cwd, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
981
|
+
const merge = tools.find((tool) => tool.name === "report_qa_asset_merge");
|
|
982
|
+
await merge.execute("merge-result", {
|
|
983
|
+
status: "SUCCEEDED",
|
|
984
|
+
summary: "远端合入结果",
|
|
985
|
+
contentChanged: false,
|
|
986
|
+
});
|
|
987
|
+
expect(client.qaReportAssetMerge).toHaveBeenCalledExactlyOnceWith("session-1", expect.objectContaining({
|
|
988
|
+
releaseAssetTaskId: "task-1",
|
|
989
|
+
mergeRequest: expect.objectContaining({
|
|
990
|
+
projectId: "project-1",
|
|
991
|
+
sourceBranch: "aip/QA-42",
|
|
992
|
+
targetBranch: "main",
|
|
993
|
+
}),
|
|
994
|
+
}));
|
|
995
|
+
await expect(merge.execute("missing-snapshot", { status: "SUCCEEDED", summary: "缺批准快照" })).resolves.toBeDefined();
|
|
996
|
+
});
|
|
997
|
+
it("QA 注册使用平台下发的名称、说明和 Schema,并保持原执行绑定", async () => {
|
|
998
|
+
const definitions = qaToolDefinitions().map((definition) => definition.handler === "read_qa_test_plan"
|
|
999
|
+
? {
|
|
1000
|
+
...definition,
|
|
1001
|
+
name: "read_current_test_plan",
|
|
1002
|
+
label: "平台计划",
|
|
1003
|
+
description: "平台更新说明",
|
|
1004
|
+
parametersJson: JSON.stringify({
|
|
1005
|
+
type: "object",
|
|
1006
|
+
properties: { note: { type: "string" } },
|
|
1007
|
+
}),
|
|
1008
|
+
}
|
|
1009
|
+
: definition);
|
|
1010
|
+
const tools = [];
|
|
1011
|
+
qaTools(client, input, { ...host, turnId: "turn" }, repository, definitions)({
|
|
1012
|
+
registerTool(tool) {
|
|
1013
|
+
tools.push(tool);
|
|
1014
|
+
},
|
|
1015
|
+
});
|
|
1016
|
+
const tool = tools.find((entry) => entry.name === "read_current_test_plan");
|
|
1017
|
+
expect(tool).toMatchObject({
|
|
1018
|
+
label: "平台计划",
|
|
1019
|
+
description: "平台更新说明",
|
|
1020
|
+
parameters: { type: "object", properties: { note: { type: "string" } } },
|
|
1021
|
+
});
|
|
1022
|
+
expect(tools.some((entry) => entry.name === "read_qa_test_plan")).toBe(false);
|
|
1023
|
+
await tool?.execute("call-1", {});
|
|
1024
|
+
expect(client.qaReadTestPlan).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
1025
|
+
...host,
|
|
1026
|
+
turnId: "turn",
|
|
1027
|
+
});
|
|
1028
|
+
});
|
|
1029
|
+
it("QA 用量随压缩开始、结束更新,未知用量不伪装成零", async () => {
|
|
1030
|
+
session.prompt.mockImplementation(async () => {
|
|
1031
|
+
for (const listener of listeners)
|
|
1032
|
+
listener({ type: "compaction_start" });
|
|
1033
|
+
session.getContextUsage.mockReturnValue({ tokens: null, contextWindow: 100000 });
|
|
1034
|
+
for (const listener of listeners)
|
|
1035
|
+
listener({ type: "compaction_end" });
|
|
1036
|
+
session.getContextUsage.mockReturnValue({ tokens: 4000, contextWindow: 100000 });
|
|
1037
|
+
for (const listener of listeners)
|
|
1038
|
+
listener({ type: "agent_settled" });
|
|
1039
|
+
});
|
|
1040
|
+
const manager = new QaSessionManager(model);
|
|
1041
|
+
await manager.execute(client, hostState, command());
|
|
1042
|
+
await manager.settled("session-1");
|
|
1043
|
+
const usage = vi
|
|
1044
|
+
.mocked(client.qaSessionEvents)
|
|
1045
|
+
.mock.calls.flatMap((call) => call[1].events)
|
|
1046
|
+
.filter((event) => event.kind === "CONTEXT_UPDATED")
|
|
1047
|
+
.map((event) => event.payload?.contextUsage);
|
|
1048
|
+
expect(usage).toMatchObject([
|
|
1049
|
+
{ status: "READY", tokens: 12000 },
|
|
1050
|
+
{ status: "COMPACTING", tokens: null },
|
|
1051
|
+
{ status: "UNKNOWN", tokens: null },
|
|
1052
|
+
{ status: "READY", tokens: 4000 },
|
|
1053
|
+
]);
|
|
1054
|
+
});
|
|
1055
|
+
it.each(["STEER", "FOLLOW_UP"])("运行中 %s 复用同一 Pi 会话和原轮次,停止清理未读队列", async (mode) => {
|
|
1056
|
+
let finish = () => { };
|
|
1057
|
+
session.prompt.mockImplementation(() => new Promise((resolve) => {
|
|
1058
|
+
finish = resolve;
|
|
1059
|
+
}));
|
|
1060
|
+
const nativeSubmit = mode === "STEER" ? session.agent.steer : session.agent.followUp;
|
|
1061
|
+
const manager = new QaSessionManager(model);
|
|
1062
|
+
await manager.execute(client, hostState, command());
|
|
1063
|
+
await vi.waitFor(() => expect(session.prompt).toHaveBeenCalledOnce());
|
|
1064
|
+
const queued = command("queued", "TEST_SESSION_MESSAGE");
|
|
1065
|
+
queued.test.turnId = "message-command-1";
|
|
1066
|
+
queued.test.message.mode = mode;
|
|
1067
|
+
await manager.execute(client, hostState, queued);
|
|
1068
|
+
expect(mode === "STEER" ? session.steer : session.followUp).toHaveBeenCalledWith("请维护用例");
|
|
1069
|
+
expect(mocks.open).toHaveBeenCalledOnce();
|
|
1070
|
+
const native = nativeSubmit.mock.calls[0][0];
|
|
1071
|
+
session.agent.getQueuedMessages.mockReturnValue({
|
|
1072
|
+
steering: mode === "STEER" ? [native] : [],
|
|
1073
|
+
followUp: mode === "FOLLOW_UP" ? [native] : [],
|
|
1074
|
+
});
|
|
1075
|
+
session.abort.mockImplementation(() => finish());
|
|
1076
|
+
await manager.execute(client, hostState, {
|
|
1077
|
+
id: "stop",
|
|
1078
|
+
kind: "TEST_SESSION_STOP",
|
|
1079
|
+
qaControl: { sessionId: "session-1", messageId: "message-command-1" },
|
|
1080
|
+
expiresAt: "",
|
|
1081
|
+
});
|
|
1082
|
+
await manager.settled("session-1");
|
|
1083
|
+
const calls = vi.mocked(client.qaSessionEvents).mock.calls;
|
|
1084
|
+
expect(calls.every(([, body]) => body.turnId === "message-command-1")).toBe(true);
|
|
1085
|
+
expect(calls
|
|
1086
|
+
.flatMap(([, body]) => body.events)
|
|
1087
|
+
.filter((event) => event.kind === "MESSAGE_QUEUE_UPDATED")
|
|
1088
|
+
.map((event) => event.payload?.deliveryStatus)).toEqual(["QUEUED", "CANCELLED"]);
|
|
1089
|
+
});
|
|
1090
|
+
it("取回只返回 Pi 中尚未消费的消息,不停止当前执行", async () => {
|
|
1091
|
+
let finish = () => { };
|
|
1092
|
+
session.prompt.mockImplementation(() => new Promise((resolve) => {
|
|
1093
|
+
finish = resolve;
|
|
1094
|
+
}));
|
|
1095
|
+
const nativeSubmit = session.agent.followUp;
|
|
1096
|
+
const manager = new QaSessionManager(model);
|
|
1097
|
+
await manager.execute(client, hostState, command());
|
|
1098
|
+
await vi.waitFor(() => expect(session.prompt).toHaveBeenCalledOnce());
|
|
1099
|
+
const queued = command("queued", "TEST_SESSION_MESSAGE");
|
|
1100
|
+
queued.test.turnId = "message-command-1";
|
|
1101
|
+
queued.test.message.mode = "FOLLOW_UP";
|
|
1102
|
+
await manager.execute(client, hostState, queued);
|
|
1103
|
+
session.agent.getQueuedMessages.mockReturnValue({
|
|
1104
|
+
steering: [],
|
|
1105
|
+
followUp: [nativeSubmit.mock.calls[0][0]],
|
|
1106
|
+
});
|
|
1107
|
+
await manager.execute(client, hostState, {
|
|
1108
|
+
id: "recall",
|
|
1109
|
+
kind: "TEST_SESSION_RECALL",
|
|
1110
|
+
qaControl: { sessionId: "session-1", messageId: "message-command-1" },
|
|
1111
|
+
expiresAt: "",
|
|
1112
|
+
});
|
|
1113
|
+
expect(session.abort).not.toHaveBeenCalled();
|
|
1114
|
+
expect(vi.mocked(client.qaSessionEvents).mock.calls.flatMap(([, body]) => body.events)).toContainEqual(expect.objectContaining({
|
|
1115
|
+
kind: "QUEUE_RECALLED",
|
|
1116
|
+
payload: { requestId: "recall", recalledMessageIds: ["message-queued"] },
|
|
1117
|
+
}));
|
|
1118
|
+
session.agent.getQueuedMessages.mockReturnValue({ steering: [], followUp: [] });
|
|
1119
|
+
finish();
|
|
1120
|
+
await manager.settled("session-1");
|
|
1121
|
+
});
|
|
1122
|
+
it("补充消息在运行中判定后、Pi 已收尾时才入队:同一 QA 继续处理后才报告本轮完成", async () => {
|
|
1123
|
+
let finish = () => { };
|
|
1124
|
+
session.prompt.mockImplementationOnce(() => new Promise((resolve) => {
|
|
1125
|
+
finish = resolve;
|
|
1126
|
+
}));
|
|
1127
|
+
session.prompt.mockResolvedValue(undefined);
|
|
1128
|
+
let allowSubmit = () => { };
|
|
1129
|
+
const submitGate = new Promise((resolve) => {
|
|
1130
|
+
allowSubmit = resolve;
|
|
1131
|
+
});
|
|
1132
|
+
let queuedNative;
|
|
1133
|
+
session.followUp.mockImplementation(async (text) => {
|
|
1134
|
+
await submitGate; // Pi 输入处理期间本次运行已收尾
|
|
1135
|
+
queuedNative = { role: "user", content: [{ type: "text", text }] };
|
|
1136
|
+
session.agent.followUp(queuedNative);
|
|
1137
|
+
});
|
|
1138
|
+
session.agent.getQueuedMessages.mockImplementation(() => ({
|
|
1139
|
+
steering: [],
|
|
1140
|
+
followUp: queuedNative ? [queuedNative] : [],
|
|
1141
|
+
}));
|
|
1142
|
+
session.clearQueue.mockImplementation(() => {
|
|
1143
|
+
queuedNative = undefined;
|
|
1144
|
+
});
|
|
1145
|
+
const manager = new QaSessionManager(model);
|
|
1146
|
+
await manager.execute(client, hostState, command());
|
|
1147
|
+
await vi.waitFor(() => expect(session.prompt).toHaveBeenCalledOnce());
|
|
1148
|
+
const queued = command("queued", "TEST_SESSION_MESSAGE");
|
|
1149
|
+
queued.test.turnId = "message-command-1";
|
|
1150
|
+
queued.test.message.mode = "FOLLOW_UP";
|
|
1151
|
+
const queuing = manager.execute(client, hostState, queued);
|
|
1152
|
+
await vi.waitFor(() => expect(session.followUp).toHaveBeenCalledOnce());
|
|
1153
|
+
session.isIdle = true;
|
|
1154
|
+
finish();
|
|
1155
|
+
allowSubmit();
|
|
1156
|
+
await queuing;
|
|
1157
|
+
await manager.settled("session-1");
|
|
1158
|
+
expect(session.prompt).toHaveBeenCalledTimes(2);
|
|
1159
|
+
expect(session.prompt).toHaveBeenLastCalledWith("请维护用例");
|
|
1160
|
+
const kinds = vi
|
|
1161
|
+
.mocked(client.qaSessionEvents)
|
|
1162
|
+
.mock.calls.flatMap(([, body]) => body.events)
|
|
1163
|
+
.map((event) => event.kind === "MESSAGE_QUEUE_UPDATED"
|
|
1164
|
+
? `${String(event.payload?.messageId)}:${String(event.payload?.deliveryStatus)}`
|
|
1165
|
+
: event.kind);
|
|
1166
|
+
const id = queued.test.message.id;
|
|
1167
|
+
expect(kinds).not.toContain(`${id}:CANCELLED`);
|
|
1168
|
+
expect(kinds.indexOf(`${id}:QUEUED`)).toBeLessThan(kinds.indexOf(`${id}:READ`));
|
|
1169
|
+
expect(kinds.indexOf(`${id}:READ`)).toBeLessThan(kinds.indexOf("SESSION_COMPLETED"));
|
|
1170
|
+
expect(kinds.filter((kind) => kind === "SESSION_COMPLETED")).toHaveLength(1);
|
|
1171
|
+
});
|
|
1172
|
+
it.each(["STOP", "FAILURE"])("晚到补充消息提交期间 %s:不再继续处理,消息如实标记未执行", async (ending) => {
|
|
1173
|
+
let finish = () => { };
|
|
1174
|
+
let fail = (_error) => { };
|
|
1175
|
+
session.prompt.mockImplementationOnce(() => new Promise((resolve, reject) => {
|
|
1176
|
+
finish = resolve;
|
|
1177
|
+
fail = reject;
|
|
1178
|
+
}));
|
|
1179
|
+
session.prompt.mockResolvedValue(undefined);
|
|
1180
|
+
let allowSubmit = () => { };
|
|
1181
|
+
const submitGate = new Promise((resolve) => {
|
|
1182
|
+
allowSubmit = resolve;
|
|
1183
|
+
});
|
|
1184
|
+
let queuedNative;
|
|
1185
|
+
session.followUp.mockImplementation(async (text) => {
|
|
1186
|
+
await submitGate;
|
|
1187
|
+
queuedNative = { role: "user", content: [{ type: "text", text }] };
|
|
1188
|
+
session.agent.followUp(queuedNative);
|
|
1189
|
+
});
|
|
1190
|
+
session.agent.getQueuedMessages.mockImplementation(() => ({
|
|
1191
|
+
steering: [],
|
|
1192
|
+
followUp: queuedNative ? [queuedNative] : [],
|
|
1193
|
+
}));
|
|
1194
|
+
session.clearQueue.mockImplementation(() => {
|
|
1195
|
+
queuedNative = undefined;
|
|
1196
|
+
});
|
|
1197
|
+
const manager = new QaSessionManager(model);
|
|
1198
|
+
await manager.execute(client, hostState, command());
|
|
1199
|
+
await vi.waitFor(() => expect(session.prompt).toHaveBeenCalledOnce());
|
|
1200
|
+
const queued = command("queued", "TEST_SESSION_MESSAGE");
|
|
1201
|
+
queued.test.turnId = "message-command-1";
|
|
1202
|
+
queued.test.message.mode = "FOLLOW_UP";
|
|
1203
|
+
const queuing = manager.execute(client, hostState, queued);
|
|
1204
|
+
await vi.waitFor(() => expect(session.followUp).toHaveBeenCalledOnce());
|
|
1205
|
+
session.isIdle = true;
|
|
1206
|
+
if (ending === "STOP") {
|
|
1207
|
+
session.abort.mockImplementation(() => finish());
|
|
1208
|
+
await manager.execute(client, hostState, {
|
|
1209
|
+
id: "stop",
|
|
1210
|
+
kind: "TEST_SESSION_STOP",
|
|
1211
|
+
qaControl: { sessionId: "session-1", messageId: "message-command-1" },
|
|
1212
|
+
expiresAt: "",
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
else {
|
|
1216
|
+
fail(new Error("模型服务异常"));
|
|
1217
|
+
// 失败已上报后提交才进入 Pi:收尾清理仍须等待它并如实标记。
|
|
1218
|
+
await vi.waitFor(() => expect(vi
|
|
1219
|
+
.mocked(client.qaSessionEvents)
|
|
1220
|
+
.mock.calls.some(([, body]) => body.events[0]?.kind === "SESSION_FAILED")).toBe(true));
|
|
1221
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
1222
|
+
}
|
|
1223
|
+
allowSubmit();
|
|
1224
|
+
await queuing;
|
|
1225
|
+
await manager.settled("session-1").catch(() => undefined);
|
|
1226
|
+
expect(session.prompt).toHaveBeenCalledOnce();
|
|
1227
|
+
const kinds = vi
|
|
1228
|
+
.mocked(client.qaSessionEvents)
|
|
1229
|
+
.mock.calls.flatMap(([, body]) => body.events)
|
|
1230
|
+
.map((event) => event.kind === "MESSAGE_QUEUE_UPDATED"
|
|
1231
|
+
? `${String(event.payload?.messageId)}:${String(event.payload?.deliveryStatus)}`
|
|
1232
|
+
: event.kind);
|
|
1233
|
+
const id = queued.test.message.id;
|
|
1234
|
+
expect(kinds).toContain(`${id}:QUEUED`);
|
|
1235
|
+
expect(kinds).toContain(`${id}:CANCELLED`);
|
|
1236
|
+
expect(kinds).not.toContain(`${id}:READ`);
|
|
1237
|
+
expect(kinds).toContain(ending === "STOP" ? "SESSION_STOPPED" : "SESSION_FAILED");
|
|
1238
|
+
expect(kinds).not.toContain("SESSION_COMPLETED");
|
|
1239
|
+
});
|
|
1240
|
+
it("QA 准备独立业务源码并上报真实目录分支提交,续接不清理现场", async () => {
|
|
1241
|
+
const cwd = await prepareQaProject(input);
|
|
1242
|
+
input.sourceProjects = [
|
|
1243
|
+
{ id: "business", name: "service", repositoryUrl: repository, testBranch: "main" },
|
|
1244
|
+
];
|
|
1245
|
+
const prepared = await prepareQaWorkspace(input, cwd);
|
|
1246
|
+
expect(prepared.testProject?.directory).toBe(cwd);
|
|
1247
|
+
expect(prepared.testProject?.branch).toBe("aip/QA-42");
|
|
1248
|
+
const source = prepared.sourceProjects[0];
|
|
1249
|
+
expect(source.directory).not.toBe(cwd);
|
|
1250
|
+
expect(source.branch).toBe("main");
|
|
1251
|
+
expect(source.commitSha).toBe((await git("git", ["rev-parse", "HEAD"], { cwd: repository })).stdout.trim());
|
|
1252
|
+
await writeFile(join(source.directory, "uncommitted.txt"), "keep");
|
|
1253
|
+
expect(await prepareQaWorkspace(input, cwd)).toEqual(prepared);
|
|
1254
|
+
expect(await readFile(join(source.directory, "uncommitted.txt"), "utf8")).toBe("keep");
|
|
1255
|
+
input.deploymentRef = { id: "next-deployment", label: "下一部署" };
|
|
1256
|
+
expect((await prepareQaWorkspace(input, cwd)).sourceProjects[0].directory).not.toBe(source.directory);
|
|
1257
|
+
});
|
|
1258
|
+
it("QA 无正文回复仍上传订阅美元费用快照", async () => {
|
|
1259
|
+
session.model = { provider: "anthropic", id: "claude" };
|
|
1260
|
+
session.prompt.mockImplementation(async () => {
|
|
1261
|
+
for (const listener of listeners)
|
|
1262
|
+
listener({
|
|
1263
|
+
type: "message_end",
|
|
1264
|
+
message: {
|
|
1265
|
+
role: "assistant",
|
|
1266
|
+
content: [],
|
|
1267
|
+
stopReason: "stop",
|
|
1268
|
+
usage: {
|
|
1269
|
+
input: 10,
|
|
1270
|
+
output: 2,
|
|
1271
|
+
cacheRead: 0,
|
|
1272
|
+
cacheWrite: 0,
|
|
1273
|
+
totalTokens: 12,
|
|
1274
|
+
cost: { total: 0.00006 },
|
|
1275
|
+
},
|
|
1276
|
+
},
|
|
1277
|
+
});
|
|
1278
|
+
});
|
|
1279
|
+
const manager = new QaSessionManager(model);
|
|
1280
|
+
await manager.execute(client, hostState, command());
|
|
1281
|
+
await manager.settled("session-1");
|
|
1282
|
+
const event = vi
|
|
1283
|
+
.mocked(client.qaSessionEvents)
|
|
1284
|
+
.mock.calls.flatMap((call) => call[1].events)
|
|
1285
|
+
.find((entry) => entry.kind === "MESSAGE");
|
|
1286
|
+
expect(event).toMatchObject({
|
|
1287
|
+
contentMarkdown: "",
|
|
1288
|
+
payload: {
|
|
1289
|
+
usage: { input: 10, output: 2 },
|
|
1290
|
+
modelCost: { source: "PI", currency: "USD", amount: 0.00006, providerId: "anthropic" },
|
|
1291
|
+
},
|
|
1292
|
+
});
|
|
1293
|
+
});
|
|
1294
|
+
it.each(["AGENT", "AUTO"])("%s 无测试项目可准备证据和业务源码并完成会话", async (verificationMode) => {
|
|
1295
|
+
input.project = null;
|
|
1296
|
+
input.verificationMode = verificationMode;
|
|
1297
|
+
input.sourceProjects = [
|
|
1298
|
+
{ id: "business", name: "service", repositoryUrl: repository, testBranch: "main" },
|
|
1299
|
+
];
|
|
1300
|
+
const cwd = await prepareQaProject(input);
|
|
1301
|
+
expect(cwd).toContain("evidence");
|
|
1302
|
+
await expect(stat(join(cwd, ".git"))).rejects.toMatchObject({ code: "ENOENT" });
|
|
1303
|
+
await writeFile(join(cwd, "screen.png"), "evidence");
|
|
1304
|
+
expect(await prepareQaProject(input)).toBe(cwd);
|
|
1305
|
+
expect(await readFile(join(cwd, "screen.png"), "utf8")).toBe("evidence");
|
|
1306
|
+
const prepared = await prepareQaWorkspace(input, cwd);
|
|
1307
|
+
expect(prepared.testProject).toBeNull();
|
|
1308
|
+
expect(prepared.sourceProjects[0]).toMatchObject({ projectName: "service", branch: "main" });
|
|
1309
|
+
const manager = new QaSessionManager(model);
|
|
1310
|
+
await manager.execute(client, hostState, command());
|
|
1311
|
+
await manager.settled("session-1");
|
|
1312
|
+
expect(session.prompt).toHaveBeenCalledOnce();
|
|
1313
|
+
expect(vi.mocked(client.qaSessionEvents).mock.calls.at(-1)?.[1].events[0]?.kind).toBe("SESSION_COMPLETED");
|
|
1314
|
+
expect(mocks.live.mock.calls[0]?.[9]()).toContain(`验证方式:${verificationMode}`);
|
|
1315
|
+
const context = mocks.live.mock.calls[0]?.[9]();
|
|
1316
|
+
expect(context).toContain("测试仓库:未准备");
|
|
1317
|
+
expect(context).toContain("业务源码参考");
|
|
1318
|
+
expect(context).not.toMatch(/report_qa_readiness|不核对部署版本|整轮等待/);
|
|
1319
|
+
});
|
|
1320
|
+
it("Agent 验证配置测试仓库后,明确准备任务可复用 MR 工具", async () => {
|
|
1321
|
+
input.verificationMode = "AGENT";
|
|
1322
|
+
const cwd = await prepareQaProject(input);
|
|
1323
|
+
expect((await prepareQaWorkspace(input, cwd)).testProject?.projectId).toBe(input.project.id);
|
|
1324
|
+
const tools = [];
|
|
1325
|
+
qaTools(client, input, { ...host, turnId: "turn" }, cwd, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
1326
|
+
const merge = tools.find((tool) => tool.name === "report_qa_asset_merge");
|
|
1327
|
+
await merge.execute("no-changes", { status: "SUCCEEDED", summary: "未修改资产,无需合入" });
|
|
1328
|
+
expect(client.qaReportAssetMerge).toHaveBeenCalledWith("session-1", expect.objectContaining({
|
|
1329
|
+
status: "SUCCEEDED",
|
|
1330
|
+
releaseAssetTaskId: "task-1",
|
|
1331
|
+
mergeRequest: expect.objectContaining({ projectId: "project-1", mrIid: 7 }),
|
|
1332
|
+
}));
|
|
1333
|
+
});
|
|
1334
|
+
it("未准备测试项目也可保存阶段报告,Host 不要求整轮就绪或自动中断", async () => {
|
|
1335
|
+
input.project = null;
|
|
1336
|
+
session.prompt.mockImplementation(async () => {
|
|
1337
|
+
const tools = [];
|
|
1338
|
+
mocks.open.mock.calls.at(-1)?.[0].extensions[0]({
|
|
1339
|
+
registerTool(tool) {
|
|
1340
|
+
tools.push(tool);
|
|
1341
|
+
},
|
|
1342
|
+
});
|
|
1343
|
+
expect(tools.map((tool) => tool.name)).not.toContain("report_qa_readiness");
|
|
1344
|
+
const submit = tools.find((tool) => tool.name === "submit_qa_conclusion");
|
|
1345
|
+
if (!submit)
|
|
1346
|
+
throw new Error("conclusion tool missing");
|
|
1347
|
+
await submit.execute("draft", { contentMarkdown: "已有一项证据,另一项缺账号。" });
|
|
1348
|
+
});
|
|
1349
|
+
const manager = new QaSessionManager(model);
|
|
1350
|
+
await manager.execute(client, hostState, command());
|
|
1351
|
+
await manager.settled("session-1");
|
|
1352
|
+
expect(client.qaSubmitConclusion).toHaveBeenCalledWith("session-1", expect.objectContaining({
|
|
1353
|
+
contentMarkdown: "已有一项证据,另一项缺账号。",
|
|
1354
|
+
toolCallId: "draft",
|
|
1355
|
+
}));
|
|
1356
|
+
expect(session.abort).not.toHaveBeenCalled();
|
|
1357
|
+
expect(vi.mocked(client.qaSessionEvents).mock.calls.at(-1)?.[1].events[0]).toMatchObject({
|
|
1358
|
+
kind: "SESSION_COMPLETED",
|
|
1359
|
+
contentMarkdown: "QA 员工已完成本条消息",
|
|
1360
|
+
});
|
|
1361
|
+
});
|
|
1362
|
+
it("真实 UUID 输入使用工单号短目录,并拒绝归属不符的复用", async () => {
|
|
1363
|
+
input.workspaceId = "2694dd41-f699-4664-aadc-84fea3defc3d";
|
|
1364
|
+
input.workItem = { id: "7ef13076-2501-473f-8ca6-31cc97219b0c", key: "BAOFU-167", title: "验收" };
|
|
1365
|
+
input.verificationMode = "AGENT";
|
|
1366
|
+
input.deploymentRef = { id: "ff1e24fb-109b-4442-bf28-52f31eba1461", label: "部署" };
|
|
1367
|
+
input.sourceProjects = [
|
|
1368
|
+
{
|
|
1369
|
+
id: "c0e9ec7b-f5b2-4b72-afb5-8b54b56a89b9",
|
|
1370
|
+
name: "mtc-sale-tests",
|
|
1371
|
+
repositoryUrl: repository,
|
|
1372
|
+
testBranch: "main",
|
|
1373
|
+
},
|
|
1374
|
+
];
|
|
1375
|
+
const cwd = await prepareQaProject(input);
|
|
1376
|
+
const prepared = await prepareQaWorkspace(input, cwd);
|
|
1377
|
+
const source = prepared.sourceProjects[0];
|
|
1378
|
+
if (!source)
|
|
1379
|
+
throw new Error("missing source");
|
|
1380
|
+
const suffix = source.directory.split("workspaces")[1]?.replaceAll("\\", "/");
|
|
1381
|
+
expect(suffix).toMatch(/qa\/[a-f0-9]{8}\/BAOFU-167\/sources\/[a-f0-9]{8}\/mtc-sale-tests-[a-f0-9]{8}$/u);
|
|
1382
|
+
expect(`C:\\Users\\yaping_li\\.aip\\profiles\\default\\workspaces${suffix}`.length).toBeLessThan(120);
|
|
1383
|
+
await writeFile(join(source.directory, "uncommitted.txt"), "keep");
|
|
1384
|
+
const marker = `${source.directory}.owner.json`;
|
|
1385
|
+
const owner = JSON.parse(await readFile(marker, "utf8"));
|
|
1386
|
+
await writeFile(marker, JSON.stringify({ ...owner, projectId: "another-project" }));
|
|
1387
|
+
await expect(prepareQaWorkspace(input, cwd)).rejects.toThrow("QA_DIRECTORY_IDENTITY_MISMATCH");
|
|
1388
|
+
expect(await readFile(join(source.directory, "uncommitted.txt"), "utf8")).toBe("keep");
|
|
1389
|
+
});
|
|
1390
|
+
it("同号工单不跨工作区复用,同工作区同号不同ID拒绝复用", async () => {
|
|
1391
|
+
input.verificationMode = "AGENT";
|
|
1392
|
+
const first = await prepareQaProject(input);
|
|
1393
|
+
input.workspaceId = "another-workspace";
|
|
1394
|
+
const second = await prepareQaProject(input);
|
|
1395
|
+
expect(second).not.toBe(first);
|
|
1396
|
+
input.workItem = { ...input.workItem, id: "another-item" };
|
|
1397
|
+
await expect(prepareQaProject(input)).rejects.toThrow("QA_DIRECTORY_IDENTITY_MISMATCH");
|
|
1398
|
+
});
|
|
1399
|
+
it("短目录准备不移动或删除旧 UUID 目录中的验收证据", async () => {
|
|
1400
|
+
input.verificationMode = "AGENT";
|
|
1401
|
+
const legacy = join(home, "host", "profiles", "default", "workspaces", "qa", input.workspaceId, input.workItem.id, "evidence");
|
|
1402
|
+
await mkdir(legacy, { recursive: true });
|
|
1403
|
+
await writeFile(join(legacy, "evidence.txt"), "keep old evidence");
|
|
1404
|
+
const cwd = await prepareQaProject(input);
|
|
1405
|
+
expect(cwd).not.toBe(legacy);
|
|
1406
|
+
expect(await readFile(join(legacy, "evidence.txt"), "utf8")).toBe("keep old evidence");
|
|
1407
|
+
});
|
|
1408
|
+
it("已有短目录丢失归属记录时保留现场并阻止复用", async () => {
|
|
1409
|
+
input.verificationMode = "AGENT";
|
|
1410
|
+
const cwd = await prepareQaProject(input);
|
|
1411
|
+
await writeFile(join(cwd, "evidence.txt"), "keep");
|
|
1412
|
+
await rm(`${cwd}.owner.json`);
|
|
1413
|
+
await expect(prepareQaProject(input)).rejects.toThrow("QA_DIRECTORY_IDENTITY_MISSING");
|
|
1414
|
+
expect(await readFile(join(cwd, "evidence.txt"), "utf8")).toBe("keep");
|
|
1415
|
+
});
|
|
1416
|
+
it("局部更新与复测范围先上报,Host 不让模型注入内部绑定或意外补齐未提供字段", async () => {
|
|
1417
|
+
const tools = [];
|
|
1418
|
+
const binding = { ...host, turnId: "turn" };
|
|
1419
|
+
qaTools(client, input, binding, home, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
1420
|
+
const update = tools.find((tool) => tool.name === "update_qa_test_plan");
|
|
1421
|
+
const patch = {
|
|
1422
|
+
reason: "只修正筛选缺陷,复测其边界",
|
|
1423
|
+
items: [{ id: "TC-001", name: "状态筛选" }],
|
|
1424
|
+
retestItemIds: ["TC-001", "TC-002"],
|
|
1425
|
+
itemOrder: ["TC-002", "TC-001"],
|
|
1426
|
+
};
|
|
1427
|
+
expect(Check(update.parameters, patch)).toBe(true);
|
|
1428
|
+
expect(Check(update.parameters, { reason: "变更", items: [{ name: "不完整新增项" }] })).toBe(false);
|
|
1429
|
+
await update.execute("patch-call", {
|
|
1430
|
+
...patch,
|
|
1431
|
+
hostId: "forged",
|
|
1432
|
+
toolCallId: "forged",
|
|
1433
|
+
version: 99,
|
|
1434
|
+
});
|
|
1435
|
+
expect(client.qaUpdateTestPlan).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
1436
|
+
...patch,
|
|
1437
|
+
...binding,
|
|
1438
|
+
toolCallId: "patch-call",
|
|
1439
|
+
});
|
|
1440
|
+
expect(vi.mocked(client.qaUpdateTestPlan).mock.calls[0]?.[1]).not.toHaveProperty("scope");
|
|
1441
|
+
});
|
|
1442
|
+
it("引用已有验证仅传来源和测试项,不重传附件或伪造新的验证事实", async () => {
|
|
1443
|
+
const tools = [];
|
|
1444
|
+
const binding = { ...host, turnId: "turn" };
|
|
1445
|
+
qaTools(client, input, binding, home, qaToolDefinitions())({
|
|
1446
|
+
registerTool: (tool) => tools.push(tool),
|
|
1447
|
+
});
|
|
1448
|
+
const verify = tools.find((tool) => tool.name === "reuse_qa_verification");
|
|
1449
|
+
const reference = {
|
|
1450
|
+
sourceVerificationId: "926f5048-6460-4d7f-8a20-a622dc4da57b",
|
|
1451
|
+
testItemIds: ["TC-001"],
|
|
1452
|
+
};
|
|
1453
|
+
expect(Check(verify.parameters, reference)).toBe(true);
|
|
1454
|
+
await verify.execute("reuse-call", reference);
|
|
1455
|
+
expect(client.qaReuseVerification).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
1456
|
+
...reference,
|
|
1457
|
+
...binding,
|
|
1458
|
+
toolCallId: "reuse-call",
|
|
1459
|
+
});
|
|
1460
|
+
expect(client.qaUploadSessionAttachment).not.toHaveBeenCalled();
|
|
1461
|
+
});
|
|
1462
|
+
it("自主豁免申请不制造验证步骤或截图,缺少真实理由或风险不允许提交", async () => {
|
|
1463
|
+
const tools = [];
|
|
1464
|
+
const binding = { ...host, turnId: "turn" };
|
|
1465
|
+
qaTools(client, input, binding, home, qaToolDefinitions())({ registerTool: (tool) => tools.push(tool) });
|
|
1466
|
+
const verify = tools.find((tool) => tool.name === "request_qa_waiver");
|
|
1467
|
+
const request = {
|
|
1468
|
+
content: "千万条数据性能测试申请豁免",
|
|
1469
|
+
testItemIds: ["TC-003"],
|
|
1470
|
+
waiverReason: "当前环境无足够存储,准备千万条数据的成本不合理",
|
|
1471
|
+
waiverRisk: "未证明千万级数据的查询延迟与吞吐",
|
|
1472
|
+
waiverScope: "TC-003 的千万级数据压力场景",
|
|
1473
|
+
};
|
|
1474
|
+
expect(Check(verify.parameters, request)).toBe(true);
|
|
1475
|
+
const missingRisk = { ...request };
|
|
1476
|
+
delete missingRisk.waiverRisk;
|
|
1477
|
+
expect(Check(verify.parameters, missingRisk)).toBe(false);
|
|
1478
|
+
await verify.execute("waiver-call", request);
|
|
1479
|
+
expect(client.qaRequestWaiver).toHaveBeenCalledExactlyOnceWith("session-1", {
|
|
1480
|
+
...request,
|
|
1481
|
+
...binding,
|
|
1482
|
+
toolCallId: "waiver-call",
|
|
1483
|
+
});
|
|
1484
|
+
expect(client.qaUploadSessionAttachment).not.toHaveBeenCalled();
|
|
1485
|
+
expect(() => verify.prepareArguments({ ...request, waiverRisk: " " })).toThrow("waiverRisk");
|
|
1486
|
+
expect(client.qaRequestWaiver).toHaveBeenCalledTimes(1);
|
|
1487
|
+
expect(Check(verify.parameters, {
|
|
1488
|
+
content: "通过",
|
|
1489
|
+
testItemIds: ["TC-003"],
|
|
1490
|
+
conclusion: "PASSED",
|
|
1491
|
+
})).toBe(false);
|
|
1492
|
+
});
|
|
1493
|
+
//# sourceMappingURL=qa-session-manager.test.js.map
|