@sanqianx/project-knowledge 5.3.1 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/README.md +17 -14
  4. package/bin/project-knowledge-integrations.js +3 -3
  5. package/bin/project-knowledge-kb.js +2 -2
  6. package/bin/project-knowledge-mcp.js +3 -3
  7. package/bin/project-knowledge.js +5 -5
  8. package/module-runtime-manifest.json +24 -23
  9. package/package.json +31 -27
  10. package/plugins/project-knowledge/.claude-plugin/plugin.json +1 -1
  11. package/plugins/project-knowledge/.codex-plugin/plugin.json +1 -1
  12. package/plugins/project-knowledge/.mcp.json +1 -1
  13. package/{_site → src}/README.md +30 -30
  14. package/{_site/lib → src/automation}/capture-hook-config.js +1 -1
  15. package/{_site/lib → src/automation}/commit-conversation-binder.js +4 -4
  16. package/{_site/lib → src/automation}/commit-processing-ledger.js +27 -27
  17. package/{_site/lib → src/automation}/commit-reconciler.js +11 -11
  18. package/{_site/lib → src/automation}/hook-manager.js +203 -203
  19. package/{_site/lib → src/automation}/post-commit-automation.js +87 -87
  20. package/{_site/lib → src/common}/atomic-file.js +1 -0
  21. package/{_site/lib → src/common}/runtime-endpoint.js +153 -160
  22. package/{_site/lib → src/common}/structured-logger.js +574 -574
  23. package/{_site/lib → src/conversations}/bridge-adapter.js +2 -2
  24. package/{_site/lib → src/conversations}/codex-notify-config.js +6 -3
  25. package/{_site/lib → src/conversations}/conversation-exclusions.js +2 -2
  26. package/{_site/lib → src/conversations}/conversation-query-service.js +144 -144
  27. package/{_site/lib → src/conversations}/conversation-store.js +3 -3
  28. package/{_site/lib → src/conversations}/zcode-context-integration.js +1 -1
  29. package/{_site/lib → src/integrations}/ai-profile-resolver.js +78 -78
  30. package/{_site/lib → src/integrations}/ai-workspace.js +101 -101
  31. package/{_site/lib → src/integrations}/claude-cli-runner.js +1510 -1510
  32. package/{_site/lib → src/integrations}/integration-installer.js +11 -15
  33. package/{_site/lib → src/integrations}/llm-client.js +161 -161
  34. package/{_site/lib → src/knowledge}/context-pack-builder.js +3 -3
  35. package/{_site/lib → src/knowledge}/evidence-bundle.js +2 -2
  36. package/{_site/lib → src/knowledge}/index-service.js +173 -173
  37. package/{_site/lib → src/knowledge}/kb-framework.js +171 -191
  38. package/{_site/lib → src/knowledge}/knowledge-promotion.js +6 -6
  39. package/{_site/lib → src/knowledge}/knowledge-retrieval-service.js +401 -401
  40. package/{_site/lib → src/module_bridge}/engine-connection.js +2 -2
  41. package/{_site/lib → src/module_bridge}/engine-knowledge-client.js +3 -3
  42. package/{_site/lib → src/module_bridge}/module-bridge.js +99 -10
  43. package/{_site/lib → src/projects}/github-team-store.js +1172 -1172
  44. package/{_site/lib → src/projects}/project-lifecycle-service.js +5 -5
  45. package/{_site/lib → src/projects}/project-registry-store.js +3 -3
  46. package/{_site/lib → src/projects}/project-store.js +268 -268
  47. package/{_site/lib → src/projects}/scanner.js +3 -3
  48. package/{_site/lib → src/projects}/settings-store.js +3 -3
  49. package/{_site → src}/scripts/ab-rank-v2-v3.js +4 -4
  50. package/{_site → src}/scripts/hook-trigger.js +158 -158
  51. package/{_site → src}/scripts/install-module-candidates.js +2 -2
  52. package/{_site → src}/scripts/pack-module-candidates.js +5 -3
  53. package/{_site → src}/scripts/refresh-runtime-manifest.js +1 -1
  54. package/{_site → src}/scripts/run-retrieval-gold-isolated.js +6 -6
  55. package/{_site → src}/scripts/sync-product-content.js +2 -2
  56. package/{_site → src}/scripts/verify-product-runtime.js +3 -3
  57. package/{_site → src}/scripts/verify-retrieval-gold.js +1 -1
  58. package/{_site/lib → src/server}/product-data.js +2 -2
  59. package/{_site/lib → src/server}/server-app.js +74 -52
  60. package/{_site/lib → src/server}/storage-layout.js +166 -166
  61. package/{_site → src}/server.js +1 -1
  62. package/{_site/lib → src/tools}/knowledge-tool-runtime.js +366 -366
  63. package/{_site/lib → src/tools}/prompt-registry.js +1 -1
  64. package/{_site/lib → src/tools}/requirement-adapters.js +1 -1
  65. package/{_site/lib → src/tools}/requirement-binder.js +4 -4
  66. package/{_site/lib → src/tools}/requirement-recorder.js +278 -278
  67. package/{_site/lib → src/tools}/workflow-tool-runtime.js +3 -3
  68. package/_site/_test/agent-capture-mcp-ui-test.js +0 -118
  69. package/_site/_test/agent-capture-ui-test.js +0 -103
  70. package/_site/_test/ai-profile-resolver-test.js +0 -137
  71. package/_site/_test/ai-profile-test.js +0 -75
  72. package/_site/_test/ai-team-ui-integration-test.js +0 -219
  73. package/_site/_test/ai-vendor-presets-test.js +0 -91
  74. package/_site/_test/appearance-settings-test.js +0 -148
  75. package/_site/_test/automatic-context-test.js +0 -95
  76. package/_site/_test/automation-queue-test.js +0 -14
  77. package/_site/_test/automation-ui-test.js +0 -40
  78. package/_site/_test/background-task-registry-test.js +0 -43
  79. package/_site/_test/baseline-schema-test.js +0 -91
  80. package/_site/_test/bin-cli-test.js +0 -231
  81. package/_site/_test/bridge-adapter-test.js +0 -95
  82. package/_site/_test/bridge-consumer-service-test.js +0 -310
  83. package/_site/_test/candidate-bin-content-test.js +0 -35
  84. package/_site/_test/candidate-product-assets-test.js +0 -13
  85. package/_site/_test/candidate-release-contract-test.js +0 -14
  86. package/_site/_test/capture-hook-dedup-test.js +0 -198
  87. package/_site/_test/cdp-browser-failure-test.js +0 -103
  88. package/_site/_test/chat-claudecodeui-match-test.js +0 -111
  89. package/_site/_test/claude-executable-discovery-test.js +0 -90
  90. package/_site/_test/claude-session-lifecycle-sweep-test.js +0 -252
  91. package/_site/_test/claude-workbench-test.js +0 -174
  92. package/_site/_test/cli-instance-management-test.js +0 -62
  93. package/_site/_test/cli-version-report-test.js +0 -22
  94. package/_site/_test/client-capture-restart-e2e-test.js +0 -189
  95. package/_site/_test/codex-conversation-projection-test.js +0 -60
  96. package/_site/_test/codex-marketplace-scoped-path-test.js +0 -186
  97. package/_site/_test/codex-notify-capture-e2e-test.js +0 -101
  98. package/_site/_test/codex-notify-fanout-test.js +0 -141
  99. package/_site/_test/codex-notify-upgrade-test.js +0 -260
  100. package/_site/_test/commit-boundary-freeze-test.js +0 -147
  101. package/_site/_test/commit-conversation-binding-test.js +0 -99
  102. package/_site/_test/commit-evidence-test.js +0 -110
  103. package/_site/_test/configuration-generation-test.js +0 -22
  104. package/_site/_test/context-pack-test.js +0 -200
  105. package/_site/_test/context-session-index-test.js +0 -254
  106. package/_site/_test/conversation-api-test.js +0 -119
  107. package/_site/_test/conversation-origin-test.js +0 -15
  108. package/_site/_test/conversation-store-test.js +0 -138
  109. package/_site/_test/cross-repo-isolation-e2e-test.js +0 -187
  110. package/_site/_test/desktop-browser-compat-test.js +0 -28
  111. package/_site/_test/desktop-hook-runtime-regression-test.js +0 -204
  112. package/_site/_test/embedding-config-test.js +0 -32
  113. package/_site/_test/explicit-commit-processor-test.js +0 -37
  114. package/_site/_test/fixtures/fake-browser-exit.js +0 -10
  115. package/_site/_test/fixtures/fake-browser-hang.js +0 -10
  116. package/_site/_test/fixtures/integration-busy-worker.cjs +0 -14
  117. package/_site/_test/fixtures/make-git-repos.js +0 -92
  118. package/_site/_test/fixtures/retrieval-gold-queries.json +0 -36
  119. package/_site/_test/fixtures/slow-startup-integration.cjs +0 -12
  120. package/_site/_test/fixtures/startup-repair-worker.cjs +0 -13
  121. package/_site/_test/folder-picker-output-test.js +0 -19
  122. package/_site/_test/fresh-hook-reimport-test.js +0 -53
  123. package/_site/_test/fresh-product-data-test.js +0 -56
  124. package/_site/_test/full-integration-e2e-test.js +0 -167
  125. package/_site/_test/git-path-compatibility-test.js +0 -80
  126. package/_site/_test/git-validation-test.js +0 -81
  127. package/_site/_test/glm-ui-refresh-review-test.js +0 -313
  128. package/_site/_test/harness-isolation-test.js +0 -138
  129. package/_site/_test/helpers/ai-team-ui-fixture.js +0 -235
  130. package/_site/_test/helpers/cdp-browser.js +0 -386
  131. package/_site/_test/helpers/cdp-network-capture.js +0 -66
  132. package/_site/_test/helpers/find-chrome.js +0 -34
  133. package/_site/_test/helpers/free-port.js +0 -8
  134. package/_site/_test/helpers/logging-ui-fixture.js +0 -131
  135. package/_site/_test/helpers/module-fixture.js +0 -282
  136. package/_site/_test/helpers/parallel-capture-safety-r5-cap-shell.js +0 -606
  137. package/_site/_test/helpers/parallel-capture-safety-r5-memory-shell.js +0 -464
  138. package/_site/_test/helpers/parallel-dock-acceptance-env.js +0 -301
  139. package/_site/_test/helpers/parallel-dock-acceptance-r2-env.js +0 -378
  140. package/_site/_test/helpers/parallel-dock-acceptance-r2-ui.js +0 -314
  141. package/_site/_test/helpers/parallel-dock-acceptance-ui.js +0 -195
  142. package/_site/_test/helpers/parallel-dock-isolation-r3-credential-preload.js +0 -113
  143. package/_site/_test/helpers/parallel-dock-isolation-r3-env.js +0 -307
  144. package/_site/_test/helpers/parallel-dock-isolation-r3-fixture.js +0 -373
  145. package/_site/_test/helpers/parallel-dock-isolation-r3-ui.js +0 -314
  146. package/_site/_test/helpers/parallel-engine-advanced-engine-child.js +0 -45
  147. package/_site/_test/helpers/parallel-engine-advanced-fault-writer.js +0 -171
  148. package/_site/_test/helpers/parallel-engine-advanced-harness.js +0 -245
  149. package/_site/_test/helpers/parallel-engine-advanced-standin-analyzer.js +0 -80
  150. package/_site/_test/helpers/parallel-engine-advanced-ui-host.js +0 -177
  151. package/_site/_test/helpers/parallel-engine-final-harness.js +0 -314
  152. package/_site/_test/helpers/parallel-engine-final-standin-analyzer.js +0 -159
  153. package/_site/_test/helpers/parallel-engine-reconcile-r4-harness.js +0 -340
  154. package/_site/_test/helpers/parallel-engine-reconcile-r4-standin-analyzer.js +0 -82
  155. package/_site/_test/helpers/parallel-knowledge-fixture.js +0 -255
  156. package/_site/_test/helpers/parallel-logging-acceptance-fixture.js +0 -111
  157. package/_site/_test/helpers/parallel-logging-acceptance-proxy.js +0 -106
  158. package/_site/_test/helpers/parallel-logging-fix-r2-proxy.js +0 -205
  159. package/_site/_test/helpers/parallel-logging-integration-5025-env.js +0 -432
  160. package/_site/_test/helpers/parallel-memory-analyzer.js +0 -81
  161. package/_site/_test/helpers/parallel-memory-capture-r3-cap-shell.js +0 -605
  162. package/_site/_test/helpers/parallel-memory-capture-r3-shell.js +0 -176
  163. package/_site/_test/helpers/parallel-memory-capture-r4-cap-shell.js +0 -577
  164. package/_site/_test/helpers/parallel-memory-event-bridge.js +0 -128
  165. package/_site/_test/helpers/parallel-memory-injection-shell.js +0 -723
  166. package/_site/_test/helpers/parallel-memory-injection-wb-host.js +0 -81
  167. package/_site/_test/helpers/parallel-memory-shell.js +0 -489
  168. package/_site/_test/helpers/parallel-nav-isolation-env.js +0 -389
  169. package/_site/_test/helpers/parallel-nav-module-ui.js +0 -186
  170. package/_site/_test/helpers/parallel-nav-proxy.js +0 -148
  171. package/_site/_test/helpers/parallel-nav-shell.js +0 -361
  172. package/_site/_test/helpers/parallel-qa-engine-endpoint-guard.js +0 -206
  173. package/_site/_test/helpers/parallel-qa-engine-endpoint-isolate.js +0 -259
  174. package/_site/_test/helpers/parallel-retrieval-followup-corpus.js +0 -293
  175. package/_site/_test/helpers/parallel-retrieval-followup-next-session.js +0 -70
  176. package/_site/_test/helpers/parallel-retrieval-followup-r2-shell.js +0 -737
  177. package/_site/_test/helpers/parallel-retrieval-followup-r2-wb-host.js +0 -82
  178. package/_site/_test/helpers/parallel-retrieval-followup-shell.js +0 -279
  179. package/_site/_test/helpers/parallel-workbench-drafts-r5-fixture.js +0 -295
  180. package/_site/_test/helpers/parallel-workbench-drafts-r5-harness.js +0 -573
  181. package/_site/_test/helpers/parallel-workbench-drafts-r5-host.js +0 -69
  182. package/_site/_test/helpers/parallel-workbench-fixture.js +0 -371
  183. package/_site/_test/helpers/parallel-workbench-host.js +0 -80
  184. package/_site/_test/helpers/parallel-workbench-integration-5025-fixture.js +0 -408
  185. package/_site/_test/helpers/parallel-workbench-integration-5025-harness.js +0 -593
  186. package/_site/_test/helpers/parallel-workbench-integration-5025-host.js +0 -70
  187. package/_site/_test/helpers/parallel-workbench-integration-5025-launcher.js +0 -240
  188. package/_site/_test/helpers/parallel-workbench-integration-5025-runtime-harness.js +0 -630
  189. package/_site/_test/helpers/parallel-workbench-runtime-harness.js +0 -587
  190. package/_site/_test/helpers/parallel-workbench-source-map.js +0 -196
  191. package/_site/_test/helpers/qa-r44-env.js +0 -418
  192. package/_site/_test/helpers/qa-r44-report.js +0 -656
  193. package/_site/_test/helpers/qa-r44-ui.js +0 -347
  194. package/_site/_test/helpers/qa-r45-harness.js +0 -94
  195. package/_site/_test/helpers/qa-r48-env.js +0 -64
  196. package/_site/_test/helpers/qa-r49-wb-host.js +0 -58
  197. package/_site/_test/helpers/qa-r51-env.cjs +0 -77
  198. package/_site/_test/helpers/qa-r91-harness.cjs +0 -534
  199. package/_site/_test/helpers/single-repo-maintenance-fixture.js +0 -94
  200. package/_site/_test/helpers/single-repo-maintenance-tool.js +0 -56
  201. package/_site/_test/helpers/spawn-server.js +0 -106
  202. package/_site/_test/helpers/version-visibility-fixture.js +0 -251
  203. package/_site/_test/home-overview-test.js +0 -64
  204. package/_site/_test/hook-relocation-rebind-test.js +0 -120
  205. package/_site/_test/hook-runtime-endpoint-test.js +0 -88
  206. package/_site/_test/hook-status-repair-api-test.js +0 -152
  207. package/_site/_test/hook-trigger-test.js +0 -85
  208. package/_site/_test/hook-worktree-test.js +0 -42
  209. package/_site/_test/import-preflight-api-test.js +0 -234
  210. package/_site/_test/index-builder-test.js +0 -41
  211. package/_site/_test/index-error-display-contract-test.js +0 -32
  212. package/_site/_test/index-writer-concurrency-test.js +0 -135
  213. package/_site/_test/integration-adapters-test.js +0 -262
  214. package/_site/_test/integration-auto-repair-test.js +0 -115
  215. package/_site/_test/integration-capture-setup-test.js +0 -118
  216. package/_site/_test/integration-intent-test.js +0 -85
  217. package/_site/_test/integration-runtime-binding-a2-test.js +0 -566
  218. package/_site/_test/integration-runtime-binding-a3-test.js +0 -227
  219. package/_site/_test/integration-runtime-binding-test.js +0 -473
  220. package/_site/_test/integration-status-scan-test.js +0 -160
  221. package/_site/_test/integration-surface-coverage-test.js +0 -165
  222. package/_site/_test/kb-framework-test.js +0 -57
  223. package/_site/_test/kbpath-follow-test.js +0 -63
  224. package/_site/_test/knowledge-db-test.js +0 -144
  225. package/_site/_test/knowledge-engine-client-test.js +0 -120
  226. package/_site/_test/knowledge-language-control-test.js +0 -170
  227. package/_site/_test/knowledge-maintenance-test.js +0 -40
  228. package/_site/_test/knowledge-panel-lifecycle-test.js +0 -154
  229. package/_site/_test/knowledge-panel-ui-contract-test.js +0 -110
  230. package/_site/_test/knowledge-promotion-recovery-test.js +0 -260
  231. package/_site/_test/knowledge-query-test.js +0 -54
  232. package/_site/_test/knowledge-retrieval-service-test.js +0 -77
  233. package/_site/_test/knowledge-scopes-test.js +0 -37
  234. package/_site/_test/knowledge-storage-location-test.js +0 -28
  235. package/_site/_test/knowledge-storage-startup-test.js +0 -52
  236. package/_site/_test/knowledge-store-logs-supervision-test.js +0 -89
  237. package/_site/_test/launcher-readiness-test.js +0 -80
  238. package/_site/_test/legacy-claude-session-alias-test.js +0 -106
  239. package/_site/_test/legacy-relocation-recovery-test.js +0 -258
  240. package/_site/_test/legacy-routes-removed-test.js +0 -47
  241. package/_site/_test/legacy-workbench-exclusion-test.js +0 -92
  242. package/_site/_test/live-gateway-test.js +0 -48
  243. package/_site/_test/local-marketplace-test.js +0 -16
  244. package/_site/_test/log-redaction-test.js +0 -58
  245. package/_site/_test/logging-api-test.js +0 -89
  246. package/_site/_test/logging-sse-no-gap-test.js +0 -88
  247. package/_site/_test/logging-ui-test.js +0 -107
  248. package/_site/_test/markdown-delta-overlay-test.js +0 -85
  249. package/_site/_test/markdown-maintenance-api-test.js +0 -75
  250. package/_site/_test/markdown-maintenance-test.js +0 -11
  251. package/_site/_test/mcp-server-test.js +0 -149
  252. package/_site/_test/memory-groups-ui-test.js +0 -173
  253. package/_site/_test/model-context-windows-test.js +0 -89
  254. package/_site/_test/module-agent-start-proxy-test.js +0 -65
  255. package/_site/_test/module-artifact-integrity-test.js +0 -27
  256. package/_site/_test/module-boundary-test.js +0 -30
  257. package/_site/_test/module-bridge-eventbridge-test.js +0 -202
  258. package/_site/_test/module-dynamic-port-test.js +0 -118
  259. package/_site/_test/module-index-proxy-test.js +0 -33
  260. package/_site/_test/module-model-configuration-test.js +0 -44
  261. package/_site/_test/module-process-lifecycle-test.js +0 -35
  262. package/_site/_test/module-stream-proxy-test.js +0 -34
  263. package/_site/_test/module-supervisor-backoff-reset-test.js +0 -64
  264. package/_site/_test/module-terminal-restart-test.js +0 -63
  265. package/_site/_test/module-wiring-unbind-race-test.js +0 -59
  266. package/_site/_test/native-context-integrations-test.js +0 -86
  267. package/_site/_test/non-release-ci-test.js +0 -34
  268. package/_site/_test/offline-boundary-isolation-test.js +0 -32
  269. package/_site/_test/orphaned-claim-recovery-test.js +0 -80
  270. package/_site/_test/package-boundary-test.js +0 -48
  271. package/_site/_test/package-startup-test.js +0 -56
  272. package/_site/_test/packaged-ui-smoke-test.js +0 -126
  273. package/_site/_test/parallel-capture-safety-r5-cap006-probe.js +0 -524
  274. package/_site/_test/parallel-capture-safety-r5-cap008e-probe.js +0 -577
  275. package/_site/_test/parallel-capture-safety-r5-mem005-health-test.js +0 -381
  276. package/_site/_test/parallel-ci-r9-posix-socket-budget-test.js +0 -156
  277. package/_site/_test/parallel-engine-advanced-eng005-test.js +0 -136
  278. package/_site/_test/parallel-engine-advanced-eng006-test.js +0 -171
  279. package/_site/_test/parallel-engine-advanced-eng007-reconcile-test.js +0 -231
  280. package/_site/_test/parallel-engine-advanced-eng009-test.js +0 -208
  281. package/_site/_test/parallel-engine-advanced-eng010-test.js +0 -213
  282. package/_site/_test/parallel-engine-advanced-eng011-ui-probe.js +0 -459
  283. package/_site/_test/parallel-engine-final-eng002-test.js +0 -255
  284. package/_site/_test/parallel-engine-final-eng007-test.js +0 -269
  285. package/_site/_test/parallel-engine-final-eng011-test.js +0 -197
  286. package/_site/_test/parallel-engine-final-eng012-test.js +0 -354
  287. package/_site/_test/parallel-engine-reconcile-r4-eng007-probe.js +0 -304
  288. package/_site/_test/parallel-knowledge-client-error-code-test.js +0 -194
  289. package/_site/_test/parallel-knowledge-engine-test.js +0 -353
  290. package/_site/_test/parallel-knowledge-retrieval-test.js +0 -292
  291. package/_site/_test/parallel-knowledge-vector-test.js +0 -168
  292. package/_site/_test/parallel-linux-ci-r7-log007-day-test.js +0 -110
  293. package/_site/_test/parallel-logging-acceptance-log003-probe.js +0 -78
  294. package/_site/_test/parallel-logging-acceptance-log003-test.js +0 -224
  295. package/_site/_test/parallel-logging-acceptance-log004-probe.js +0 -85
  296. package/_site/_test/parallel-logging-acceptance-log004-test.js +0 -231
  297. package/_site/_test/parallel-logging-acceptance-log005-test.js +0 -208
  298. package/_site/_test/parallel-logging-acceptance-log006-test.js +0 -214
  299. package/_site/_test/parallel-logging-acceptance-log007-test.js +0 -223
  300. package/_site/_test/parallel-logging-acceptance-log008-test.js +0 -192
  301. package/_site/_test/parallel-logging-fix-r2-crash-probe.js +0 -271
  302. package/_site/_test/parallel-logging-fix-r2-gap-test.js +0 -294
  303. package/_site/_test/parallel-logging-fix-r2-normalhook-test.js +0 -330
  304. package/_site/_test/parallel-logging-integration-5025-portability-test.js +0 -554
  305. package/_site/_test/parallel-memory-candidate-test.js +0 -353
  306. package/_site/_test/parallel-memory-capture-r3-cap001-probe.js +0 -238
  307. package/_site/_test/parallel-memory-capture-r3-cap006-probe.js +0 -371
  308. package/_site/_test/parallel-memory-capture-r3-cap008-probe.js +0 -439
  309. package/_site/_test/parallel-memory-capture-r3-mem005-persistence-test.js +0 -333
  310. package/_site/_test/parallel-memory-capture-r4-cap006-probe.js +0 -519
  311. package/_site/_test/parallel-memory-capture-r4-cap008e-probe.js +0 -569
  312. package/_site/_test/parallel-memory-capture-r4-mem005-health-test.js +0 -374
  313. package/_site/_test/parallel-memory-home-review-test.js +0 -148
  314. package/_site/_test/parallel-memory-injection-origin-probe.js +0 -412
  315. package/_site/_test/parallel-memory-injection-probe.js +0 -411
  316. package/_site/_test/parallel-memory-manual-test.js +0 -292
  317. package/_site/_test/parallel-memory-scope-test.js +0 -98
  318. package/_site/_test/parallel-memory-source-test.js +0 -254
  319. package/_site/_test/parallel-memory-sync-test.js +0 -274
  320. package/_site/_test/parallel-memory-view-r8-reload-gate-test.js +0 -123
  321. package/_site/_test/parallel-nav-failure-test.js +0 -139
  322. package/_site/_test/parallel-nav-home-issues-test.js +0 -159
  323. package/_site/_test/parallel-nav-isolation-test.js +0 -308
  324. package/_site/_test/parallel-nav-isolation-vector-path-test.js +0 -90
  325. package/_site/_test/parallel-nav-offline-test.js +0 -300
  326. package/_site/_test/parallel-nav-operability-test.js +0 -268
  327. package/_site/_test/parallel-nav-switch-test.js +0 -293
  328. package/_site/_test/parallel-nav-theme-test.js +0 -176
  329. package/_site/_test/parallel-nav-viewport-test.js +0 -321
  330. package/_site/_test/parallel-qa-engine-endpoint-guard-test.js +0 -275
  331. package/_site/_test/parallel-retrieval-followup-citation-test.js +0 -219
  332. package/_site/_test/parallel-retrieval-followup-corpus-test.js +0 -289
  333. package/_site/_test/parallel-workbench-drafts-r4-probe.js +0 -477
  334. package/_site/_test/parallel-workbench-drafts-r5-chrome-env-bisect.js +0 -89
  335. package/_site/_test/parallel-workbench-drafts-r5-probe.js +0 -593
  336. package/_site/_test/parallel-workbench-independent-host.js +0 -262
  337. package/_site/_test/parallel-workbench-integration-5025-abort-probe.js +0 -340
  338. package/_site/_test/parallel-workbench-integration-5025-drafts-probe.js +0 -588
  339. package/_site/_test/parallel-workbench-integration-5025-env-check.js +0 -317
  340. package/_site/_test/parallel-workbench-integration-5025-model-probe.js +0 -342
  341. package/_site/_test/parallel-workbench-integration-5025-ordering-probe.js +0 -326
  342. package/_site/_test/parallel-workbench-model-probe.js +0 -336
  343. package/_site/_test/parallel-workbench-offline-test.js +0 -169
  344. package/_site/_test/parallel-workbench-provenance-trace.js +0 -134
  345. package/_site/_test/parallel-workbench-runtime-minimax-probe.js +0 -321
  346. package/_site/_test/parallel-workbench-runtime-wb004-ordering.js +0 -307
  347. package/_site/_test/parallel-workbench-runtime-wb005-drafts.js +0 -313
  348. package/_site/_test/parallel-workbench-runtime-wb008-abort.js +0 -321
  349. package/_site/_test/parallel-workbench-source-match.js +0 -206
  350. package/_site/_test/parallel-workbench-standalone-turn.js +0 -349
  351. package/_site/_test/path-consistency-test.js +0 -151
  352. package/_site/_test/pending-sweep-test.js +0 -9
  353. package/_site/_test/post-commit-automation-test.js +0 -87
  354. package/_site/_test/pr-consumer-contract-test.js +0 -55
  355. package/_site/_test/product-brand-contract-test.js +0 -25
  356. package/_site/_test/product-diagnostics-ui-test.js +0 -105
  357. package/_site/_test/product-empty-state-test.js +0 -214
  358. package/_site/_test/product-import-ui-test.js +0 -245
  359. package/_site/_test/product-navigation-test.js +0 -213
  360. package/_site/_test/product-progress-status-test.js +0 -100
  361. package/_site/_test/project-delete-recovery-test.js +0 -64
  362. package/_site/_test/project-domain-create-test.js +0 -91
  363. package/_site/_test/project-domain-scope-retrieval-test.js +0 -214
  364. package/_site/_test/project-git-init-confirm-test.js +0 -115
  365. package/_site/_test/project-goal-editor-test.js +0 -145
  366. package/_site/_test/project-import-duplicate-alias-test.js +0 -134
  367. package/_site/_test/project-import-unicode-restart-test.js +0 -140
  368. package/_site/_test/project-lifecycle-transaction-test.js +0 -106
  369. package/_site/_test/project-module-partial-recovery-test.js +0 -237
  370. package/_site/_test/project-remove-running-guard-test.js +0 -79
  371. package/_site/_test/project-store-test.js +0 -90
  372. package/_site/_test/project-team-ui-test.js +0 -128
  373. package/_site/_test/project-unbind-late-read-ui-test.js +0 -281
  374. package/_site/_test/project-unbind-writer-guard-test.js +0 -231
  375. package/_site/_test/prompt-settings-test.js +0 -115
  376. package/_site/_test/protected-architecture-gate-test.js +0 -123
  377. package/_site/_test/qa-r44-permission-question.js +0 -756
  378. package/_site/_test/qa-r45-offline-backfill-test.js +0 -279
  379. package/_site/_test/qa-r48-sys003-blank-secret-test.js +0 -258
  380. package/_site/_test/qa-r49-sys003-real-blank-probe.js +0 -374
  381. package/_site/_test/recovery-label-contract-test.js +0 -55
  382. package/_site/_test/refactor-characterization-test.js +0 -36
  383. package/_site/_test/registry-events-test.js +0 -38
  384. package/_site/_test/release-version-sync-test.js +0 -115
  385. package/_site/_test/requirement-binding-test.js +0 -113
  386. package/_site/_test/requirement-recorder-test.js +0 -173
  387. package/_site/_test/run-all-tests.js +0 -196
  388. package/_site/_test/runtime-endpoint-test.js +0 -64
  389. package/_site/_test/scanner-test.js +0 -83
  390. package/_site/_test/server-security-test.js +0 -96
  391. package/_site/_test/sessions-stream-test.js +0 -93
  392. package/_site/_test/shared-contracts-test.js +0 -58
  393. package/_site/_test/shared-scope-root-binding-test.js +0 -75
  394. package/_site/_test/simple-import-test.js +0 -98
  395. package/_site/_test/single-repo-maintenance-e2e-test.js +0 -200
  396. package/_site/_test/startup-analysis-disabled-test.js +0 -16
  397. package/_site/_test/startup-integration-isolation-test.js +0 -59
  398. package/_site/_test/startup-integration-repair-test.js +0 -43
  399. package/_site/_test/storage-foundation-test.js +0 -78
  400. package/_site/_test/structured-logger-test.js +0 -101
  401. package/_site/_test/t07b-cln-005-coverage-test.js +0 -212
  402. package/_site/_test/t07c-cln-001-002-007-coverage-test.js +0 -135
  403. package/_site/_test/t07d-git-rel-coverage-test.js +0 -226
  404. package/_site/_test/t07e-qta-coverage-test.js +0 -195
  405. package/_site/_test/t07f-mem-008-coverage-test.js +0 -100
  406. package/_site/_test/team-knowledge-store-sparse-checkout-test.js +0 -196
  407. package/_site/_test/team-knowledge-store-test.js +0 -132
  408. package/_site/_test/test-server-cleanup-test.js +0 -35
  409. package/_site/_test/test-server-module-isolation-test.js +0 -37
  410. package/_site/_test/tracking-start-test.js +0 -144
  411. package/_site/_test/vector-storage-root-test.js +0 -75
  412. package/_site/_test/version-visibility-browser-probe.js +0 -249
  413. package/_site/_test/version-visibility-test.js +0 -92
  414. package/_site/_test/workbench-context-receipts-test.js +0 -27
  415. package/_site/_test/workbench-permission-test.js +0 -118
  416. package/_site/_test/workflow-module-wiring-test.js +0 -252
  417. package/_site/_test/workflow-tools-test.js +0 -243
  418. package/_site/_test/workspace-ui-contract-test.js +0 -77
  419. package/_site/_test/zcode-capture-integration-test.js +0 -112
  420. package/templates/change.md +0 -30
  421. package/templates/project-readme.md +0 -52
  422. /package/docs/{assets → images}/architecture.svg +0 -0
  423. /package/docs/{assets → images}/dashboard.png +0 -0
  424. /package/docs/{assets → images}/draft-review.png +0 -0
  425. /package/docs/{assets → images}/logo.svg +0 -0
  426. /package/docs/{assets → images}/runs-drafts.png +0 -0
  427. /package/docs/{assets → images}/settings.png +0 -0
  428. /package/{ui → resources/ui}/favicon.svg +0 -0
  429. /package/{ui → resources/ui}/index.html +0 -0
  430. /package/{ui → resources/ui}/knowledge-panel.html +0 -0
  431. /package/{ui → resources/ui}/live-client.js +0 -0
  432. /package/{ui → resources/ui}/product.css +0 -0
  433. /package/{ui → resources/ui}/product.js +0 -0
  434. /package/{ui → resources/ui}/version-info.css +0 -0
  435. /package/{ui → resources/ui}/version-info.js +0 -0
  436. /package/{_site/lib → src/automation}/automation-config.js +0 -0
  437. /package/{_site/lib → src/automation}/commit-prompt.js +0 -0
  438. /package/{_site/lib → src/common}/cli-instances.js +0 -0
  439. /package/{_site/lib → src/common}/contracts.js +0 -0
  440. /package/{_site/lib → src/common}/data-dir.js +0 -0
  441. /package/{_site/lib → src/common}/folder-picker-output.js +0 -0
  442. /package/{_site/lib → src/common}/git-path.js +0 -0
  443. /package/{_site/lib → src/common}/git-runner.js +0 -0
  444. /package/{_site/lib → src/common}/runtime-control.js +0 -0
  445. /package/{_site/lib → src/conversations}/bridge-consumer-service.js +0 -0
  446. /package/{_site/lib → src/conversations}/codex-context-status.js +0 -0
  447. /package/{_site/lib → src/integrations}/ai-vendor-presets.js +0 -0
  448. /package/{_site/lib → src/integrations}/claude-plugin-status.js +0 -0
  449. /package/{_site/lib → src/integrations}/integration-auto-repair.js +0 -0
  450. /package/{_site/lib → src/integrations}/integration-intent.js +0 -0
  451. /package/{_site/lib → src/integrations}/integration-repair-worker.js +0 -0
  452. /package/{_site/lib → src/integrations}/integration-status-scan.js +0 -0
  453. /package/{_site/lib → src/integrations}/integration-status-worker.js +0 -0
  454. /package/{_site/lib → src/integrations}/model-context-windows.js +0 -0
  455. /package/{_site/lib → src/integrations}/startup-integration-repair.js +0 -0
  456. /package/{_site/lib → src/knowledge}/embedding-service.js +0 -0
  457. /package/{_site/lib → src/knowledge}/index-builder.js +0 -0
  458. /package/{_site/lib → src/knowledge}/kb-validator.js +0 -0
  459. /package/{_site/lib → src/knowledge}/knowledge-db.js +0 -0
  460. /package/{_site/lib → src/knowledge}/knowledge-schema.js +0 -0
  461. /package/{_site/lib → src/knowledge}/markdown-knowledge-indexer.js +0 -0
  462. /package/{_site → src}/scripts/codex-notify-fanout.cjs +0 -0
  463. /package/{_site → src}/scripts/folder-picker.ps1 +0 -0
  464. /package/{_site → src}/scripts/sync-release-version.js +0 -0
  465. /package/{_site → src}/scripts/verify-module-runtime.js +0 -0
  466. /package/{_site/lib → src/server}/live-gateway.js +0 -0
  467. /package/{_site/lib → src/server}/module-port-resolver.js +0 -0
  468. /package/{_site/lib → src/server}/public-version-info.js +0 -0
  469. /package/{_site → src}/start.bat +0 -0
  470. /package/{_site → src}/stop.bat +0 -0
  471. /package/{_site/lib → src/tools}/registry-events.js +0 -0
@@ -1,588 +0,0 @@
1
- 'use strict';
2
- // P-WB-QA-INTEGRATION-5025 — WB-005 草稿与附件隔离的 canonical 复测入口。
3
- //
4
- // 本入口是已接受的 R5 探针(parallel-workbench-drafts-r5-probe.js,冻结
5
- // 只读)在 integration-5025 独占前缀下的整理版:8 个子项的产品 expected
6
- // 与断言语义逐条原样,变化只在工具链层面——
7
- // 1. fixture/harness 换成 canonical 的 integration-5025 版:可移植临时根
8
- // (PK_TEST_TEMP_ROOT → 仓库旁共享根 → TEMP/TMP/TMPDIR → os.tmpdir,
9
- // 全部拒绝落在仓库内)、完整 env 白名单(含 APPDATA/LOCALAPPDATA/
10
- // CODEX_HOME)、Chrome>=136 默认目录脚手架,全在每次运行独立的
11
- // owner root 下;不硬编码任何盘符或用户目录;
12
- // 2. 模块身份是独立链:期望版本默认取根 package.json 的精确依赖约束
13
- // (claude-ai-workbench: npm:@sanqianx/claude-ai-workbench@<version>),
14
- // 与被测模块自报版本比对,绝不"自读自比";候选发布可用
15
- // PK_WB_EXPECTED_VERSION / PK_WB_MODULE_ROOT 显式指定新版本/新根;
16
- // 3. 真实 profile 来源整体不带入:宿主用产品自己的 ProfileStore 在隔离
17
- // dataDir 播种纯虚构 profile(i5025fake / i5025-fake-provider /
18
- // https://i5025-fake.invalid —— RFC 2606 保留域)与显式假 Key;
19
- // 4. 退出纪律、整探针 watchdog、每步预算、状态驱动侧栏展开全部沿用
20
- // R5 已接受的根修实现。
21
- //
22
- // 退出码:0 = 全部证明;3 = 诚实 BLOCKED/超时;1 = 脚本错误。
23
- const fs = require('node:fs');
24
- const path = require('node:path');
25
- const crypto = require('node:crypto');
26
- const launcher = require('./helpers/parallel-workbench-integration-5025-launcher');
27
- const fixture = require('./helpers/parallel-workbench-integration-5025-fixture');
28
- const harness = require('./helpers/parallel-workbench-integration-5025-harness');
29
-
30
- const DRAFT_A = '1111';
31
- const DRAFT_B = '2222';
32
- const DRAFT_S2 = '1111-two';
33
- const FAKE_PROFILE_ID = 'i5025fake';
34
- const FAKE_PROFILE_NAME = 'I5025-Fake';
35
- const FAKE_MODEL = 'i5025-fake-model';
36
- const FAKE_BASE_URL = 'https://i5025-fake.invalid/anthropic';
37
- const FAKE_KEY = 'i5025-fake-key-never-dial';
38
- // 候选发布支持显式期望版本;默认独立取根 package 的精确依赖约束。
39
- const EXPLICIT_EXPECTED_VERSION = String(process.env.PK_WB_EXPECTED_VERSION || '').trim() || null;
40
-
41
- const KB_ROOT = path.resolve(__dirname, '..', '..');
42
- const EVIDENCE_DIR = path.join(KB_ROOT, 'qa-autopilot', 'artifacts', 'parallel-20261023', 'workbench-integration-5025');
43
- const PROBE_TIMEOUT_MS = Number(process.env.PK_WB_INTEGRATION_5025_TIMEOUT_MS || 450000);
44
-
45
- const results = [];
46
- const stepTimings = [];
47
- function record(caseId, status, detail) {
48
- results.push({ caseId, status, detail });
49
- console.log(`CASE ${caseId} ${status} ${JSON.stringify(detail).slice(0, 300)}`);
50
- }
51
- function assertTrue(condition, message) { if (!condition) throw new Error(message); }
52
-
53
- function isInside(candidate, parent) {
54
- const relative = path.relative(parent, candidate);
55
- return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
56
- }
57
-
58
- // 每步骤独立预算:waitUntil 自身的超时管“条件迟迟不满足”,预算管
59
- // “evaluate/fetch 本身挂死”这类 waitUntil 管不到的等待。
60
- async function withBudget(label, budgetMs, fn) {
61
- const started = Date.now();
62
- let timer = null;
63
- try {
64
- const value = await Promise.race([
65
- fn(),
66
- new Promise((_, reject) => {
67
- timer = setTimeout(() => reject(new Error(`STEP TIMEOUT: ${label} exceeded its ${budgetMs}ms budget`)), budgetMs);
68
- }),
69
- ]);
70
- stepTimings.push({ step: label, ms: Date.now() - started, outcome: 'ok' });
71
- return value;
72
- } catch (error) {
73
- stepTimings.push({ step: label, ms: Date.now() - started, outcome: String(error && error.message || error).slice(0, 200) });
74
- throw error;
75
- } finally {
76
- if (timer) clearTimeout(timer);
77
- }
78
- }
79
-
80
- function sha256Text(text) { return crypto.createHash('sha256').update(text, 'utf8').digest('hex'); }
81
-
82
- async function waitSidebarProjects(browser, count) {
83
- return harness.waitUntil(async () => {
84
- const ids = await browser.evaluate("Array.from(document.querySelectorAll('#project-list .proj')).map(node => node.dataset.project)");
85
- return ids.length === count ? ids : null;
86
- }, `the sidebar to list ${count} projects`, 30000);
87
- }
88
-
89
- // 等产品自己的 input 处理器把草稿写进它自己的 localStorage 键(只读旁观,
90
- // 不代写):证明持久化发生在产品侧,后续的切换/刷新/重启恢复才是产品行为。
91
- async function waitStorageDraft(browser, projectId, sessionId, text) {
92
- const key = JSON.stringify([projectId, sessionId || null]);
93
- return harness.waitUntil(async () => {
94
- const storage = await harness.readDraftStorage(browser);
95
- return storage.parsed && Object.prototype.hasOwnProperty.call(storage.parsed, key) && storage.parsed[key] === text;
96
- }, `the product to persist its own draft ${key} as ${JSON.stringify(text)}`, 15000);
97
- }
98
-
99
- // 挂起/失败归因快照:网络(宿主健康)、DOM(页面就绪度)、服务(进程存活)。
100
- async function diagnose(host, browser) {
101
- const out = { at: new Date().toISOString() };
102
- if (host && host.base) {
103
- try {
104
- const health = await harness.getJson(`${host.base}${harness.API_BASE}/health`);
105
- out.hostHealth = { status: health.status, ok: health.ok, body: health.body };
106
- } catch (error) { out.hostHealth = { error: String(error && error.message || error).slice(0, 160) }; }
107
- if (host.child && host.child.child) {
108
- out.hostPid = host.child.child.pid;
109
- out.hostPidAlive = harness.listProcesses().some(entry => entry.pid === host.child.child.pid);
110
- }
111
- }
112
- if (browser) {
113
- try {
114
- out.page = await browser.evaluate("({ readyState: document.readyState, hasInput: !!document.getElementById('chat-input'), stateDefined: typeof state !== 'undefined' && !!state, sidebarProjects: document.querySelectorAll('#project-list .proj').length, composer: (document.getElementById('chat-input') || {}).value || '' })");
115
- } catch (error) { out.page = { error: String(error && error.message || error).slice(0, 200) }; }
116
- }
117
- return out;
118
- }
119
-
120
- (async () => {
121
- const startedAt = new Date().toISOString();
122
- fs.mkdirSync(path.join(EVIDENCE_DIR, 'evidence'), { recursive: true });
123
-
124
- // 整探针 watchdog:非 unref —— 它既保证“永不无限等待”(到点强制退),
125
- // 也保证被挂住的 await 之外事件循环仍有心跳可触发它。
126
- const watchdog = setTimeout(() => {
127
- const target = path.join(EVIDENCE_DIR, 'evidence', 'drafts-5025-watchdog.json');
128
- try {
129
- fs.writeFileSync(target, `${JSON.stringify({
130
- probe: 'parallel-workbench-integration-5025-drafts-probe', firedAt: new Date().toISOString(), startedAt,
131
- verdict: 'WATCHDOG TIMEOUT', exitCode: 3, steps: stepTimings, cases: results,
132
- }, null, 2)}\n`);
133
- } catch { /* best effort */ }
134
- console.log(`WATCHDOG TIMEOUT after ${PROBE_TIMEOUT_MS}ms — checkpoint at ${target}; forcing exit 3`);
135
- process.exit(3);
136
- }, PROBE_TIMEOUT_MS);
137
-
138
- // 统一入口纪律(P-WB-CANONICAL-R2):先门检、再真实 env 只读发现(Chrome
139
- // 走 LOCALAPPDATA,模块走 APPDATA / 显式 PK_WB_MODULE_ROOT),然后本进程
140
- // 套完整隔离白名单;捕获值以显式 override 贯穿(含安装包身份)。真实
141
- // profile 目录只取路径字符串用于 guard,本入口无任何真实 profile 读取。
142
- const boot = launcher.boot({ prefix: 'parallel-wb-integration-5025', paid: false, needsRealProfile: false });
143
- const chromePath = boot.discovery.chrome;
144
- const moduleRoot = boot.discovery.moduleRoot;
145
- const realProfileDir = fixture.realWorkbenchProfileDir();
146
- assertTrue(chromePath, 'no real Chrome was found with the real environment');
147
- assertTrue(moduleRoot, 'no claude-ai-workbench module copy was found with the real environment');
148
-
149
- // 独立身份链:期望版本来自根 package 的精确依赖约束(或显式覆盖),
150
- // 与被测模块自报版本比对。
151
- const identityCheck = fixture.verifyModuleIdentity({ moduleRoot, expectedVersion: EXPLICIT_EXPECTED_VERSION || undefined });
152
- assertTrue(identityCheck.ok, `the hosted module is ${JSON.stringify(identityCheck.actual)}, the independent chain requires ${JSON.stringify(identityCheck.expected)}`);
153
-
154
- // 隔离布局 + 探针自身的完整隔离白名单(宿主另有同一白名单的显式副本)。
155
- const layout = boot.layout;
156
- const envApplied = boot.envApplied;
157
- const ambientClean = ![...fixture.AMBIENT_MODULE_URLS, ...fixture.AMBIENT_MODEL_ENV].some(key => process.env[key] !== undefined);
158
- const pathKeyValues = {};
159
- for (const key of fixture.ISOLATION_PATH_KEYS) {
160
- const value = path.resolve(process.env[key]);
161
- pathKeyValues[key] = value;
162
- assertTrue(isInside(value, layout.root), `the isolated ${key} must live inside this run's layout root, saw ${value}`);
163
- assertTrue(!isInside(value, fixture.REAL_HOME), `the isolated ${key} must not live inside the real home, saw ${value}`);
164
- assertTrue(!value.includes(realProfileDir) && !realProfileDir.includes(value), `the isolated ${key} must not reference the real profile directory`);
165
- }
166
-
167
- let host = null;
168
- let browser = null;
169
- let opened = null;
170
- let identity = null;
171
- let sceneKept = null;
172
- let isolationDetail = null;
173
- let bDetail = null;
174
- let cDetail = null;
175
- let dDetail = null;
176
- let eDetail = null;
177
- let fDetail = null;
178
- let gDetail = null;
179
- let hDetail = null;
180
- let servedIntegrity = null;
181
-
182
- try {
183
- host = await withBudget('start-host', 90000, () => harness.startHost({ layout, moduleRoot, prefix: 'parallel-wb-integration-5025' }));
184
- opened = await withBudget('open-browser', 90000, () => harness.openBrowser(host.base, host.layout, { chrome: chromePath }));
185
- browser = opened.browser;
186
- identity = harness.moduleIdentity(host.moduleRoot);
187
- const identityAfterStart = fixture.verifyModuleIdentity({ moduleRoot: host.moduleRoot, expectedVersion: EXPLICIT_EXPECTED_VERSION || undefined });
188
- assertTrue(identityAfterStart.ok, `the hosted module is ${JSON.stringify(identityAfterStart.actual)}, the independent chain requires ${JSON.stringify(identityAfterStart.expected)}`);
189
-
190
- // --- a. 真实宿主/浏览器身份 + served/pinned 哈希 + 完整隔离前提 --------
191
- const health = await harness.getJson(`${host.base}${harness.API_BASE}/health`);
192
- assertTrue(health.ok && health.body && health.body.status === 'ok', 'the isolated host is not healthy');
193
- const servedFiles = {};
194
- for (const rel of ['app.js', 'index.html']) {
195
- const response = await fetch(`${host.base}/agent-terminal/${rel}`, { signal: AbortSignal.timeout(10000) });
196
- const text = await response.text();
197
- servedFiles[rel] = {
198
- httpStatus: response.status,
199
- servedSha256: sha256Text(text),
200
- diskSha256: harness.sha256File(path.join(host.moduleRoot, 'apps', 'agent-terminal', rel)),
201
- };
202
- }
203
- const servedMatches = Object.values(servedFiles).every(file => file.httpStatus === 200 && file.servedSha256 && file.servedSha256 === file.diskSha256);
204
- assertTrue(servedMatches, 'the served agent-terminal UI is not byte-identical to the hosted module files');
205
- servedIntegrity = { checked: Object.keys(servedFiles), servedEqualsDisk: servedMatches, files: servedFiles };
206
-
207
- // 虚构 profile 是唯一被服务的 profile;假 Key 从不出现在公开列表里。
208
- const profilesResp = await harness.getJson(`${host.base}${harness.API_BASE}/profiles`);
209
- const listed = Array.isArray(profilesResp.body && profilesResp.body.profiles) ? profilesResp.body.profiles : [];
210
- assertTrue(listed.length === 1, `the isolated store must serve exactly the fictional profile, saw ${JSON.stringify(listed.map(item => item.id))}`);
211
- const fakeListed = listed[0];
212
- assertTrue(fakeListed.id === FAKE_PROFILE_ID && fakeListed.name === FAKE_PROFILE_NAME, 'the served profile is not the fictional one');
213
- assertTrue(fakeListed.provider === 'i5025-fake-provider' && fakeListed.baseUrl === FAKE_BASE_URL, 'the fictional profile was altered on the way out');
214
- assertTrue(!JSON.stringify(listed).includes(FAKE_KEY), 'the fake key leaked through the public profile listing');
215
-
216
- // 隔离 dataDir 里的 store 文件只含虚构条目(假 Key 是显式假值,可入证据)。
217
- const profilesRaw = JSON.parse(fs.readFileSync(path.join(layout.dataDir, 'profiles.v2.json'), 'utf8'));
218
- const credentialsRaw = JSON.parse(fs.readFileSync(path.join(layout.dataDir, 'credentials.v1.json'), 'utf8'));
219
- assertTrue(Array.isArray(profilesRaw.profiles) && profilesRaw.profiles.length === 1 && profilesRaw.profiles[0].id === FAKE_PROFILE_ID, 'the isolated profile file holds more than the fictional profile');
220
- const credentialKeys = Object.keys(credentialsRaw.credentials || {});
221
- assertTrue(credentialKeys.length === 1 && credentialKeys[0] === `credential:${FAKE_PROFILE_ID}`, 'the isolated credential file holds more than the fake credential');
222
- assertTrue(credentialsRaw.credentials[credentialKeys[0]] === FAKE_KEY, 'the isolated credential is not the explicit fake key');
223
-
224
- isolationDetail = {
225
- envWhitelistApplied: envApplied,
226
- pathKeysResolvedInsideLayoutRoot: pathKeyValues,
227
- ambientCredentialVarsPresentAfterSanitize: !ambientClean,
228
- realProfileSource: 'absent by construction — the integration-5025 fixture has no read-only facade, no PK_WB_REAL_PROFILE_DIR and no digest machinery',
229
- fakeProfile: {
230
- seededThrough: "the product's own ProfileStore.save/setCredential on the isolated dataDir",
231
- profile: profilesRaw.profiles[0],
232
- credentialKeys,
233
- baseUrlUnroutable: 'i5025-fake.invalid is a reserved RFC 2606 TLD — it can never resolve to a provider',
234
- },
235
- browser: 'real Chrome via CDP (headless), isolated user-data-dir below the same isolated layout',
236
- chrome: opened.chrome,
237
- };
238
-
239
- const projectA = await withBudget('create-project-a', 60000, () => harness.ensureProject(browser, path.join(layout.root, 'i5025-project-a'), { name: 'i5025-project-a' }));
240
- const projectB = await withBudget('create-project-b', 60000, () => harness.ensureProject(browser, path.join(layout.root, 'i5025-project-b'), { name: 'i5025-project-b' }));
241
- assertTrue(projectA.created === true && projectB.created === true, 'the two projects were not created through the product form');
242
- assertTrue(projectA.projectId && projectB.projectId && projectA.projectId !== projectB.projectId, 'the two projects do not have distinct ids');
243
- record('WB005-5025.a-real-browser-host-and-isolation', 'PASS', {
244
- module: identity,
245
- identityChain: identityAfterStart,
246
- servedUiIntegrity: servedIntegrity,
247
- host: { mode: 'standalone (fictional profile)', pid: host.child.child.pid, port: host.port, dataDir: layout.dataDir, workspace: layout.workspace, tempRoot: path.dirname(layout.root) },
248
- isolation: isolationDetail,
249
- projects: [
250
- { id: projectA.projectId, name: projectA.name, createdThroughTheProductForm: true },
251
- { id: projectB.projectId, name: projectB.name, createdThroughTheProductForm: true },
252
- ],
253
- health: health.body,
254
- });
255
-
256
- // 只选模型让产品具备建会话条件;从不发送消息,见 g/h 项证据。
257
- await withBudget('select-model', 60000, () => harness.selectModel(browser, FAKE_PROFILE_NAME, FAKE_MODEL));
258
-
259
- // --- b. 项目级草稿:A=1111、B=2222,产品侧边栏切换各自恢复 ------------
260
- await withBudget('project-drafts', 90000, async () => {
261
- await harness.selectProject(browser, projectA.projectId);
262
- await harness.typeText(browser, DRAFT_A);
263
- await waitStorageDraft(browser, projectA.projectId, null, DRAFT_A);
264
- await harness.selectProject(browser, projectB.projectId);
265
- const firstEntryB = await harness.readState(browser);
266
- assertTrue(firstEntryB.inputValue === '', `project B must start with an empty composer, saw ${JSON.stringify(firstEntryB.inputValue)}`);
267
- await harness.typeText(browser, DRAFT_B);
268
- await waitStorageDraft(browser, projectB.projectId, null, DRAFT_B);
269
- await harness.selectProject(browser, projectA.projectId);
270
- const backInA = await harness.readState(browser);
271
- assertTrue(backInA.inputValue === DRAFT_A, `project A did not restore its draft: ${JSON.stringify(backInA.inputValue)}`);
272
- await harness.selectProject(browser, projectB.projectId);
273
- const backInB = await harness.readState(browser);
274
- assertTrue(backInB.inputValue === DRAFT_B, `project B did not restore its draft: ${JSON.stringify(backInB.inputValue)}`);
275
- assertTrue(!backInA.inputValue.includes(DRAFT_B) && !backInB.inputValue.includes(DRAFT_A), 'a project draft leaked across projects');
276
- bDetail = {
277
- switch: "the product's own sidebar project head (.proj-item), a real click",
278
- projectA: { id: projectA.projectId, draft: DRAFT_A, composerAfterSwitchBack: backInA.inputValue },
279
- projectB: { id: projectB.projectId, draft: DRAFT_B, composerOnFirstEntry: firstEntryB.inputValue, composerAfterSwitchBack: backInB.inputValue },
280
- crossLeak: backInA.inputValue.includes(DRAFT_B) || backInB.inputValue.includes(DRAFT_A),
281
- persistedByTheProduct: true,
282
- };
283
- });
284
- record('WB005-5025.b-project-drafts-are-isolated', 'PASS', bDetail);
285
-
286
- // --- c. 真实浏览器刷新后项目级草稿恢复(此时还没有任何会话)-----------
287
- await withBudget('refresh-project-drafts', 60000, async () => {
288
- await harness.reloadPage(browser);
289
- await waitSidebarProjects(browser, 2);
290
- await harness.selectProject(browser, projectA.projectId);
291
- const aAfter = await harness.readState(browser);
292
- assertTrue(aAfter.inputValue === DRAFT_A, `project A draft lost after refresh: ${JSON.stringify(aAfter.inputValue)}`);
293
- await harness.selectProject(browser, projectB.projectId);
294
- const bAfter = await harness.readState(browser);
295
- assertTrue(bAfter.inputValue === DRAFT_B, `project B draft lost after refresh: ${JSON.stringify(bAfter.inputValue)}`);
296
- cDetail = {
297
- refresh: 'a real Page.reload; the sidebar re-rendered both projects before any click',
298
- composerInProjectAAfterRefresh: aAfter.inputValue,
299
- composerInProjectBAfterRefresh: bAfter.inputValue,
300
- storageKeysAfterRefresh: (await harness.readDraftStorage(browser)).keys,
301
- };
302
- });
303
- record('WB005-5025.c-drafts-survive-a-real-browser-refresh', 'PASS', cDetail);
304
-
305
- // --- d. 同一项目两个会话的草稿隔离 -------------------------------------
306
- let sessionS1 = null;
307
- let sessionS2 = null;
308
- await withBudget('session-drafts', 120000, async () => {
309
- await harness.selectProject(browser, projectA.projectId);
310
- await harness.clickNewSession(browser);
311
- const s1State = await harness.waitForState(browser, state => state.product && state.product.activeSessionId, 'the first session of project A', 30000);
312
- sessionS1 = s1State.product.activeSessionId;
313
- // 首会话创建时产品把项目级草稿 1111 迁入该会话(app.js newSession)。
314
- const inS1 = await harness.readState(browser);
315
- assertTrue(inS1.inputValue === DRAFT_A, `the project draft did not migrate into the first session: ${JSON.stringify(inS1.inputValue)}`);
316
- const tombstone = await harness.readDraftStorage(browser);
317
- const tombstoneKey = JSON.stringify([projectA.projectId, null]);
318
- assertTrue(tombstone.parsed && tombstone.parsed[tombstoneKey] === '', 'the project-level entry must be an empty migration tombstone after the first session');
319
-
320
- await harness.clickNewSession(browser);
321
- const s2State = await harness.waitForState(browser, state => state.product && state.product.activeSessionId && state.product.activeSessionId !== sessionS1, 'the second session of project A', 30000);
322
- sessionS2 = s2State.product.activeSessionId;
323
- const s2Fresh = await harness.readState(browser);
324
- assertTrue(s2Fresh.inputValue === '', `session two must start empty, saw ${JSON.stringify(s2Fresh.inputValue)}`);
325
- await harness.typeText(browser, DRAFT_S2);
326
- await waitStorageDraft(browser, projectA.projectId, sessionS2, DRAFT_S2);
327
-
328
- await harness.openSessionRow(browser, projectA.projectId, sessionS1);
329
- const backInS1 = await harness.readState(browser);
330
- assertTrue(backInS1.inputValue === DRAFT_A, `session one draft not restored: ${JSON.stringify(backInS1.inputValue)}`);
331
- assertTrue(!backInS1.inputValue.includes(DRAFT_S2), 'session two draft leaked into session one');
332
- await harness.openSessionRow(browser, projectA.projectId, sessionS2);
333
- const backInS2 = await harness.readState(browser);
334
- assertTrue(backInS2.inputValue === DRAFT_S2, `session two draft not restored: ${JSON.stringify(backInS2.inputValue)}`);
335
- assertTrue(backInS2.inputValue !== DRAFT_A, 'session two must not hold session one draft (exact equality)');
336
- dDetail = {
337
- switch: "the product's own sidebar session row (.session), real clicks",
338
- projectId: projectA.projectId,
339
- migrationIntoFirstSession: { sessionId: sessionS1, composerAfterCreate: inS1.inputValue, projectLevelTombstone: true },
340
- sessionOne: { sessionId: sessionS1, draft: DRAFT_A, composerAfterReopen: backInS1.inputValue },
341
- sessionTwo: { sessionId: sessionS2, draft: DRAFT_S2, composerOnCreate: s2Fresh.inputValue, composerAfterReopen: backInS2.inputValue },
342
- sessionOneDraftLeakedIntoSessionTwo: s2Fresh.inputValue !== '',
343
- sessionTwoDraftLeakedIntoSessionOne: backInS1.inputValue === DRAFT_S2,
344
- };
345
- });
346
- record('WB005-5025.d-session-drafts-are-isolated', 'PASS', dDetail);
347
-
348
- // --- e. 附件生命周期与跨项目隔离 ---------------------------------------
349
- await withBudget('attachments', 120000, async () => {
350
- await harness.openSessionRow(browser, projectA.projectId, sessionS1);
351
- const tokenA = `I5025-ATTACH-A-${crypto.randomBytes(4).toString('hex')}`;
352
- const contentA = `${tokenA}\nP-WB-QA-INTEGRATION-5025 attachment of project A session one\n`;
353
- await harness.attachFile(browser, 'i5025-note.txt', contentA);
354
- const s1WithAttachment = await harness.readState(browser);
355
- assertTrue(s1WithAttachment.attachments.length === 1 && s1WithAttachment.attachments[0].includes('i5025-note.txt'), 'the attachment did not reach the tray of session one');
356
- assertTrue(s1WithAttachment.product.attachmentCount === 1, 'the product did not count the attachment');
357
- const base64A = Buffer.from(contentA, 'utf8').toString('base64');
358
- const storageWithA = await harness.readDraftStorage(browser);
359
- const bytesAInStorage = storageWithA.raw.includes(tokenA) || storageWithA.raw.includes(base64A);
360
-
361
- await harness.selectProject(browser, projectB.projectId);
362
- const trayInB = await harness.readState(browser);
363
- assertTrue(trayInB.attachments.length === 0 && trayInB.product.attachmentCount === 0, "A's attachment leaked into project B");
364
-
365
- const tokenB = `I5025-ATTACH-B-${crypto.randomBytes(4).toString('hex')}`;
366
- const contentB = `${tokenB}\nP-WB-QA-INTEGRATION-5025 attachment of project B\n`;
367
- await harness.attachFile(browser, 'i5025-b.txt', contentB);
368
- const bWithAttachment = await harness.readState(browser);
369
- assertTrue(bWithAttachment.attachments.length === 1 && bWithAttachment.attachments[0].includes('i5025-b.txt'), 'the attachment of project B did not reach its tray');
370
- const base64B = Buffer.from(contentB, 'utf8').toString('base64');
371
- const storageWithB = await harness.readDraftStorage(browser);
372
- const bytesBInStorage = storageWithB.raw.includes(tokenB) || storageWithB.raw.includes(base64B);
373
- assertTrue(!bytesAInStorage && !bytesBInStorage, 'attachment bytes entered the browser storage');
374
-
375
- await harness.openSessionRow(browser, projectA.projectId, sessionS1);
376
- const backInS1 = await harness.readState(browser);
377
- assertTrue(backInS1.attachments.length === 1 && backInS1.attachments[0].includes('i5025-note.txt'), "session one's attachment did not come back");
378
- assertTrue(!backInS1.attachments.join(' ').includes('i5025-b.txt'), "B's attachment leaked into A's session");
379
- eDetail = {
380
- attach: "the product's own <input type=\"file\"> change handler (a real File into the real input)",
381
- sessionOne: { sessionId: sessionS1, file: 'i5025-note.txt', tray: s1WithAttachment.attachments, productAttachmentCount: s1WithAttachment.product.attachmentCount, trayAfterReturn: backInS1.attachments },
382
- projectB: { file: 'i5025-b.txt', trayWhenInA: trayInB.attachments, ownTray: bWithAttachment.attachments },
383
- attachmentBytesInBrowserStorage: bytesAInStorage || bytesBInStorage,
384
- storageKeys: storageWithB.keys,
385
- contract: 'app.js writeDraft(): only the text is persisted, attachment bytes stay in page memory',
386
- };
387
- });
388
- record('WB005-5025.e-attachment-lifecycle-and-isolation', 'PASS', eDetail);
389
-
390
- // --- f. 只重启本用例自己的隔离宿主(同布局/同端口/同浏览器 profile)----
391
- await withBudget('own-host-restart', 180000, async () => {
392
- const oldPid = host.child.child.pid;
393
- const oldPort = host.port;
394
- await harness.stopHost(host);
395
- const exitInfo = await host.child.exited;
396
- const oldGone = !harness.listProcesses().some(entry => entry.pid === oldPid);
397
- assertTrue(oldGone && Boolean(exitInfo), 'the own host did not really exit');
398
-
399
- const restarted = await harness.startHost({ layout: host.layout, port: oldPort, moduleRoot: host.moduleRoot });
400
- host = restarted;
401
- const identityAfter = harness.moduleIdentity(restarted.moduleRoot);
402
- assertTrue(identityAfter.version === identity.version && identityAfter.uiFiles['apps/agent-terminal/app.js'] === identity.uiFiles['apps/agent-terminal/app.js'], 'the restarted host serves different UI bytes');
403
- const healthAfter = await harness.getJson(`${restarted.base}${harness.API_BASE}/health`);
404
- assertTrue(healthAfter.ok && healthAfter.body && healthAfter.body.status === 'ok', 'the restarted host is not healthy');
405
-
406
- // 隔离 store 的虚构 profile 跨重启仍在且仍唯一(同数据目录)。
407
- const profilesAfter = await harness.getJson(`${restarted.base}${harness.API_BASE}/profiles`);
408
- const listedAfter = Array.isArray(profilesAfter.body && profilesAfter.body.profiles) ? profilesAfter.body.profiles : [];
409
- assertTrue(listedAfter.length === 1 && listedAfter[0].id === FAKE_PROFILE_ID, 'the fictional profile did not survive the own-host restart as the only profile');
410
-
411
- await harness.reloadPage(browser);
412
- await waitSidebarProjects(browser, 2);
413
- const stateAfterRestart = await harness.waitForState(browser, state => state.product && state.product.projects.length === 2, 'both projects after the restart', 30000);
414
-
415
- await harness.selectProject(browser, projectB.projectId);
416
- const bAfter = await harness.readState(browser);
417
- assertTrue(bAfter.inputValue === DRAFT_B, `project B draft lost after the own-host restart: ${JSON.stringify(bAfter.inputValue)}`);
418
- assertTrue(bAfter.attachments.length === 0, 'a memory-backed attachment survived the restart or leaked into B');
419
-
420
- await harness.selectProject(browser, projectA.projectId);
421
- const aProjectAfter = await harness.readState(browser);
422
- assertTrue(aProjectAfter.inputValue === '', `project A project-level entry must stay the migration tombstone, saw ${JSON.stringify(aProjectAfter.inputValue)}`);
423
- await harness.openSessionRow(browser, projectA.projectId, sessionS1);
424
- const s1After = await harness.readState(browser);
425
- assertTrue(s1After.inputValue === DRAFT_A, `session one draft lost after the restart: ${JSON.stringify(s1After.inputValue)}`);
426
- await harness.openSessionRow(browser, projectA.projectId, sessionS2);
427
- const s2After = await harness.readState(browser);
428
- assertTrue(s2After.inputValue === DRAFT_S2, `session two draft lost after the restart: ${JSON.stringify(s2After.inputValue)}`);
429
-
430
- const storageFinal = await harness.readDraftStorage(browser);
431
- fDetail = {
432
- restart: "only this case's own isolated host child was stopped and restarted (same layout, same port, same browser profile)",
433
- oldHostPid: oldPid, oldHostExited: true, oldHostProcessStillListed: !oldGone, oldHostExitCode: exitInfo && exitInfo.code,
434
- newHostPid: restarted.child.child.pid, portKept: oldPort === restarted.port,
435
- healthAfterRestart: healthAfter.body,
436
- fakeProfileAfterRestart: { soleProfile: listedAfter[0].id, model: listedAfter[0].models && listedAfter[0].models.default },
437
- projectsAfterRestart: stateAfterRestart.product.projects.map(project => ({ id: project.id, name: project.name })),
438
- composerInProjectBAfterRestart: bAfter.inputValue,
439
- attachmentTrayInProjectBAfterRestart: bAfter.attachments,
440
- projectAProjectLevelAfterRestart: aProjectAfter.inputValue,
441
- projectAProjectLevelNote: 'the empty value is the migration tombstone the product itself wrote; the draft lives in session one',
442
- composerInSessionOneAfterRestart: s1After.inputValue,
443
- composerInSessionTwoAfterRestart: s2After.inputValue,
444
- storageKeysAfterRestart: storageFinal.keys,
445
- };
446
- });
447
- record('WB005-5025.f-own-host-restart-keeps-projects-and-drafts', 'PASS', fDetail);
448
-
449
- // --- g. 全程零模型请求 -------------------------------------------------
450
- await withBudget('no-model-request', 30000, async () => {
451
- const events = await harness.recordedEvents(browser);
452
- const modelEvents = events.filter(event => event.type === 'claude/result' || event.type === 'claude/init' || event.type === 'claude/user-prompt');
453
- assertTrue(modelEvents.length === 0, `the draft case triggered model stream events: ${JSON.stringify(modelEvents.map(event => event.type))}`);
454
- gDetail = { recordedStreamEvents: events.map(event => event.type), modelStreamEvents: [], draftsNeverSentToAnyModel: [DRAFT_A, DRAFT_B, DRAFT_S2], paidTurns: 0 };
455
- });
456
- record('WB005-5025.g-no-model-request-was-made', 'PASS', gDetail);
457
- } catch (error) {
458
- const diagnosis = await diagnose(host, browser).catch(() => null);
459
- record('WB005-5025.runtime', 'BLOCKED', { error: String(error && error.message || error), diagnosis, stepsSoFar: stepTimings.slice() });
460
- sceneKept = layout.root;
461
- } finally {
462
- // 先关浏览器(内部会杀 Chrome 树并清 profile),再显式等 CDP websocket
463
- // 的 close 事件(至多 1.5s)——长命 socket 拖住事件循环是旧三挂的根因
464
- // 类别;随后才停自有宿主。
465
- if (browser) {
466
- try { await browser.close(); } catch { /* disposable */ }
467
- try {
468
- await Promise.race([
469
- new Promise(resolve => { try { browser.socket.once('close', resolve); } catch { resolve(); } }),
470
- new Promise(resolve => setTimeout(resolve, 1500)),
471
- ]);
472
- } catch { /* best effort */ }
473
- }
474
- try { if (host && host.child) await harness.stopHost(host); } catch { /* best effort */ }
475
- }
476
-
477
- // --- h. 无真实 profile 读取 + 假 Key 从未外呼 ---------------------------
478
- try {
479
- // 复核白名单在整场运行后仍成立(宿主已停,浏览器已关)。
480
- let guardsHold = true;
481
- const guardValues = {};
482
- for (const key of fixture.ISOLATION_PATH_KEYS) {
483
- const value = path.resolve(process.env[key]);
484
- guardValues[key] = value;
485
- if (!isInside(value, layout.root) || isInside(value, fixture.REAL_HOME) || value.includes(realProfileDir)) guardsHold = false;
486
- }
487
- assertTrue(guardsHold, 'the isolation whitelist no longer holds at the end of the run');
488
- // 零模型请求引用 g 项在真实页面上录得的事件流(浏览器此时已按退出纪律
489
- // 关闭,不再有可询问的页面)。
490
- assertTrue(gDetail && Array.isArray(gDetail.modelStreamEvents) && gDetail.modelStreamEvents.length === 0, 'case g did not prove a clean event stream');
491
- hDetail = {
492
- realProfileDirPathKnownToThisProbe: realProfileDir,
493
- realProfileDirFilesystemAccess: 'none — this probe performs no fs operation on it (path string only, for the guards above); the integration-5025 fixture has no digest machinery at all',
494
- isolationGuards: { everyIsolationEnvValueInsideLayoutRoot: true, noIsolationEnvValueInsideTheRealHome: true, noIsolationEnvValueReferencesTheRealProfileDir: true, finalCheck: guardValues },
495
- fakeCredential: { value: FAKE_KEY, everSentToAnyProvider: false, baseUrlHost: 'i5025-fake.invalid (RFC 2606 reserved — unresolvable by construction)', providerRequests: 0 },
496
- servedProfilesOverTheWholeRun: 'exactly one fictional profile (case a + case f restart)',
497
- draftsSentToAnyModel: [],
498
- };
499
- record('WB005-5025.h-no-real-profile-read-and-fake-key-never-dialled', 'PASS', hDetail);
500
- } catch (error) {
501
- record('WB005-5025.h-no-real-profile-read-and-fake-key-never-dialled', 'FAIL', { error: String(error && error.message || error) });
502
- }
503
-
504
- // --- 自有残留清点:宿主 pid 消失 + 命令行引用隔离 root 的自有进程清零 ----
505
- let ownResidue = null;
506
- try {
507
- ownResidue = await withBudget('own-residue-census', 30000, () => harness.waitUntil(async () => {
508
- const remaining = harness.listProcesses().filter(entry => entry.commandLine.includes(layout.root));
509
- return remaining.length === 0 ? [] : null;
510
- }, 'every own process referencing the isolated root to be gone', 20000).catch(() => harness.listProcesses().filter(entry => entry.commandLine.includes(layout.root))));
511
- } catch (error) { ownResidue = [{ note: String(error && error.message || error) }]; }
512
- const finalHostPid = host && host.child && host.child.child ? host.child.child.pid : null;
513
- const hostStillListed = finalHostPid ? harness.listProcesses().some(entry => entry.pid === finalHostPid) : false;
514
- const ownResidueClean = Array.isArray(ownResidue) && ownResidue.length === 0 && !hostStillListed;
515
-
516
- clearTimeout(watchdog);
517
-
518
- const essential = [
519
- 'WB005-5025.a-real-browser-host-and-isolation',
520
- 'WB005-5025.b-project-drafts-are-isolated',
521
- 'WB005-5025.c-drafts-survive-a-real-browser-refresh',
522
- 'WB005-5025.d-session-drafts-are-isolated',
523
- 'WB005-5025.e-attachment-lifecycle-and-isolation',
524
- 'WB005-5025.f-own-host-restart-keeps-projects-and-drafts',
525
- 'WB005-5025.g-no-model-request-was-made',
526
- 'WB005-5025.h-no-real-profile-read-and-fake-key-never-dialled',
527
- ];
528
- const proven = essential.every(id => (results.find(entry => entry.caseId === id) || {}).status === 'PASS') && ownResidueClean;
529
-
530
- const summary = {
531
- lane: 'workbench-integration-5025',
532
- file: 'parallel-workbench-integration-5025-drafts-probe.js',
533
- case: 'WB-005',
534
- title: '草稿与附件隔离(真实浏览器 + 真实 UI 操作,canonical 集成复测)',
535
- startedAt,
536
- finishedAt: new Date().toISOString(),
537
- module: identity,
538
- identityChain: identityCheck,
539
- servedUiIntegrity: servedIntegrity,
540
- host: host ? { mode: 'standalone (fictional profile)', pid: host.child.child.pid, port: host.port, dataDir: host.layout.dataDir, workspace: host.layout.workspace } : null,
541
- isolation: {
542
- envWhitelistApplied: envApplied,
543
- pathKeysResolvedInsideLayoutRoot: pathKeyValues,
544
- realProfileSourceAbsent: true,
545
- fakeProfile: { id: FAKE_PROFILE_ID, name: FAKE_PROFILE_NAME, provider: 'i5025-fake-provider', baseUrl: FAKE_BASE_URL, model: FAKE_MODEL, credential: FAKE_KEY, credentialSentAnywhere: false },
546
- chromeResolvedBeforeEnvSwitch: chromePath,
547
- moduleRootResolvedBeforeEnvSwitch: moduleRoot,
548
- },
549
- timeouts: { wholeProbeWatchdogMs: PROBE_TIMEOUT_MS, perStepBudgets: 'withBudget labels in steps below', exitDiscipline: 'graceful CDP close wait (<=1.5s) then forced process.exit after the verdict' },
550
- drafts: { projectA: DRAFT_A, projectB: DRAFT_B, sessionTwoOfProjectA: DRAFT_S2, sentToAnyModel: false },
551
- uiActions: [
552
- "the product's own add-project form to create both projects",
553
- "the product's own sidebar project head (.proj-item) to switch projects",
554
- "the product's own sidebar session row (.session) to open sessions",
555
- "the product's own 新会话 button to create sessions",
556
- "the product's own <input type=\"file\"> change handler to attach files",
557
- 'a real Page.reload of the real page (twice: refresh case and after the own-host restart)',
558
- "a real stop+start of only this case's own isolated host child",
559
- ],
560
- storeApiUsedAsUiSubstitute: false,
561
- recoveryExpectationsFollowTheProductLifecycle: 'text drafts are storage-backed and must survive switch/refresh/restart; the first session migrates the project-level draft and leaves a tombstone; attachments are page-memory only and must vanish on refresh/restart without ever entering storage (expecteds identical to the accepted R4/R5 runs)',
562
- steps: stepTimings,
563
- cases: results,
564
- ownResidue: { processesReferencingTheIsolatedRoot: ownResidue, finalHostPid, finalHostStillListed: hostStillListed, clean: ownResidueClean },
565
- verdict: proven
566
- ? 'PASS: canonical 集成复测——可移植临时根与独立 owner root、完整环境白名单(含 APPDATA/LOCALAPPDATA/CODEX_HOME)、Chrome>=136 脚手架、独立身份链(根 package 精确依赖约束 vs 被测模块自报版本 + served 字节逐字节一致);真实 profile 来源不带入,宿主以产品自身 ProfileStore 播种纯虚构 profile 与假 Key;草稿按项目/会话隔离并在切换/刷新/自有宿主重启后分别恢复;附件按会话生命周期不跨项目泄漏且字节永不入存储;全程零模型请求;自有宿主/浏览器无残留;进程真实退出(exit code 由运行方观测)'
567
- : 'BLOCKED',
568
- paidTurnsSent: 0,
569
- quotaEndpointQueried: false,
570
- sceneKeptOnFailure: sceneKept,
571
- };
572
-
573
- harness.writeEvidence(path.join(EVIDENCE_DIR, 'evidence', 'drafts-5025-probe.json'), summary);
574
- if (!proven) {
575
- if (sceneKept) console.log(`SCENE KEPT ${sceneKept}`);
576
- } else {
577
- fixture.removeTree(layout.root);
578
- }
579
- console.log(`parallel-workbench-integration-5025-drafts-probe verdict=${summary.verdict}`);
580
- const exitCode = proven ? 0 : 3;
581
- // 强制退出(hangRuling 认可的根修):verdict 打印后进程必须真的退。
582
- setTimeout(() => process.exit(exitCode), 300);
583
- process.exitCode = exitCode;
584
- })().catch(error => {
585
- console.error(error);
586
- setTimeout(() => process.exit(1), 300);
587
- process.exitCode = 1;
588
- });