@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.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +17 -14
- package/bin/project-knowledge-integrations.js +3 -3
- package/bin/project-knowledge-kb.js +2 -2
- package/bin/project-knowledge-mcp.js +3 -3
- package/bin/project-knowledge.js +5 -5
- package/module-runtime-manifest.json +24 -23
- package/package.json +31 -27
- package/plugins/project-knowledge/.claude-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.codex-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.mcp.json +1 -1
- package/{_site → src}/README.md +30 -30
- package/{_site/lib → src/automation}/capture-hook-config.js +1 -1
- package/{_site/lib → src/automation}/commit-conversation-binder.js +4 -4
- package/{_site/lib → src/automation}/commit-processing-ledger.js +27 -27
- package/{_site/lib → src/automation}/commit-reconciler.js +11 -11
- package/{_site/lib → src/automation}/hook-manager.js +203 -203
- package/{_site/lib → src/automation}/post-commit-automation.js +87 -87
- package/{_site/lib → src/common}/atomic-file.js +1 -0
- package/{_site/lib → src/common}/runtime-endpoint.js +153 -160
- package/{_site/lib → src/common}/structured-logger.js +574 -574
- package/{_site/lib → src/conversations}/bridge-adapter.js +2 -2
- package/{_site/lib → src/conversations}/codex-notify-config.js +6 -3
- package/{_site/lib → src/conversations}/conversation-exclusions.js +2 -2
- package/{_site/lib → src/conversations}/conversation-query-service.js +144 -144
- package/{_site/lib → src/conversations}/conversation-store.js +3 -3
- package/{_site/lib → src/conversations}/zcode-context-integration.js +1 -1
- package/{_site/lib → src/integrations}/ai-profile-resolver.js +78 -78
- package/{_site/lib → src/integrations}/ai-workspace.js +101 -101
- package/{_site/lib → src/integrations}/claude-cli-runner.js +1510 -1510
- package/{_site/lib → src/integrations}/integration-installer.js +11 -15
- package/{_site/lib → src/integrations}/llm-client.js +161 -161
- package/{_site/lib → src/knowledge}/context-pack-builder.js +3 -3
- package/{_site/lib → src/knowledge}/evidence-bundle.js +2 -2
- package/{_site/lib → src/knowledge}/index-service.js +173 -173
- package/{_site/lib → src/knowledge}/kb-framework.js +171 -191
- package/{_site/lib → src/knowledge}/knowledge-promotion.js +6 -6
- package/{_site/lib → src/knowledge}/knowledge-retrieval-service.js +401 -401
- package/{_site/lib → src/module_bridge}/engine-connection.js +2 -2
- package/{_site/lib → src/module_bridge}/engine-knowledge-client.js +3 -3
- package/{_site/lib → src/module_bridge}/module-bridge.js +99 -10
- package/{_site/lib → src/projects}/github-team-store.js +1172 -1172
- package/{_site/lib → src/projects}/project-lifecycle-service.js +5 -5
- package/{_site/lib → src/projects}/project-registry-store.js +3 -3
- package/{_site/lib → src/projects}/project-store.js +268 -268
- package/{_site/lib → src/projects}/scanner.js +3 -3
- package/{_site/lib → src/projects}/settings-store.js +3 -3
- package/{_site → src}/scripts/ab-rank-v2-v3.js +4 -4
- package/{_site → src}/scripts/hook-trigger.js +158 -158
- package/{_site → src}/scripts/install-module-candidates.js +2 -2
- package/{_site → src}/scripts/pack-module-candidates.js +5 -3
- package/{_site → src}/scripts/refresh-runtime-manifest.js +1 -1
- package/{_site → src}/scripts/run-retrieval-gold-isolated.js +6 -6
- package/{_site → src}/scripts/sync-product-content.js +2 -2
- package/{_site → src}/scripts/verify-product-runtime.js +3 -3
- package/{_site → src}/scripts/verify-retrieval-gold.js +1 -1
- package/{_site/lib → src/server}/product-data.js +2 -2
- package/{_site/lib → src/server}/server-app.js +74 -52
- package/{_site/lib → src/server}/storage-layout.js +166 -166
- package/{_site → src}/server.js +1 -1
- package/{_site/lib → src/tools}/knowledge-tool-runtime.js +366 -366
- package/{_site/lib → src/tools}/prompt-registry.js +1 -1
- package/{_site/lib → src/tools}/requirement-adapters.js +1 -1
- package/{_site/lib → src/tools}/requirement-binder.js +4 -4
- package/{_site/lib → src/tools}/requirement-recorder.js +278 -278
- package/{_site/lib → src/tools}/workflow-tool-runtime.js +3 -3
- package/_site/_test/agent-capture-mcp-ui-test.js +0 -118
- package/_site/_test/agent-capture-ui-test.js +0 -103
- package/_site/_test/ai-profile-resolver-test.js +0 -137
- package/_site/_test/ai-profile-test.js +0 -75
- package/_site/_test/ai-team-ui-integration-test.js +0 -219
- package/_site/_test/ai-vendor-presets-test.js +0 -91
- package/_site/_test/appearance-settings-test.js +0 -148
- package/_site/_test/automatic-context-test.js +0 -95
- package/_site/_test/automation-queue-test.js +0 -14
- package/_site/_test/automation-ui-test.js +0 -40
- package/_site/_test/background-task-registry-test.js +0 -43
- package/_site/_test/baseline-schema-test.js +0 -91
- package/_site/_test/bin-cli-test.js +0 -231
- package/_site/_test/bridge-adapter-test.js +0 -95
- package/_site/_test/bridge-consumer-service-test.js +0 -310
- package/_site/_test/candidate-bin-content-test.js +0 -35
- package/_site/_test/candidate-product-assets-test.js +0 -13
- package/_site/_test/candidate-release-contract-test.js +0 -14
- package/_site/_test/capture-hook-dedup-test.js +0 -198
- package/_site/_test/cdp-browser-failure-test.js +0 -103
- package/_site/_test/chat-claudecodeui-match-test.js +0 -111
- package/_site/_test/claude-executable-discovery-test.js +0 -90
- package/_site/_test/claude-session-lifecycle-sweep-test.js +0 -252
- package/_site/_test/claude-workbench-test.js +0 -174
- package/_site/_test/cli-instance-management-test.js +0 -62
- package/_site/_test/cli-version-report-test.js +0 -22
- package/_site/_test/client-capture-restart-e2e-test.js +0 -189
- package/_site/_test/codex-conversation-projection-test.js +0 -60
- package/_site/_test/codex-marketplace-scoped-path-test.js +0 -186
- package/_site/_test/codex-notify-capture-e2e-test.js +0 -101
- package/_site/_test/codex-notify-fanout-test.js +0 -141
- package/_site/_test/codex-notify-upgrade-test.js +0 -260
- package/_site/_test/commit-boundary-freeze-test.js +0 -147
- package/_site/_test/commit-conversation-binding-test.js +0 -99
- package/_site/_test/commit-evidence-test.js +0 -110
- package/_site/_test/configuration-generation-test.js +0 -22
- package/_site/_test/context-pack-test.js +0 -200
- package/_site/_test/context-session-index-test.js +0 -254
- package/_site/_test/conversation-api-test.js +0 -119
- package/_site/_test/conversation-origin-test.js +0 -15
- package/_site/_test/conversation-store-test.js +0 -138
- package/_site/_test/cross-repo-isolation-e2e-test.js +0 -187
- package/_site/_test/desktop-browser-compat-test.js +0 -28
- package/_site/_test/desktop-hook-runtime-regression-test.js +0 -204
- package/_site/_test/embedding-config-test.js +0 -32
- package/_site/_test/explicit-commit-processor-test.js +0 -37
- package/_site/_test/fixtures/fake-browser-exit.js +0 -10
- package/_site/_test/fixtures/fake-browser-hang.js +0 -10
- package/_site/_test/fixtures/integration-busy-worker.cjs +0 -14
- package/_site/_test/fixtures/make-git-repos.js +0 -92
- package/_site/_test/fixtures/retrieval-gold-queries.json +0 -36
- package/_site/_test/fixtures/slow-startup-integration.cjs +0 -12
- package/_site/_test/fixtures/startup-repair-worker.cjs +0 -13
- package/_site/_test/folder-picker-output-test.js +0 -19
- package/_site/_test/fresh-hook-reimport-test.js +0 -53
- package/_site/_test/fresh-product-data-test.js +0 -56
- package/_site/_test/full-integration-e2e-test.js +0 -167
- package/_site/_test/git-path-compatibility-test.js +0 -80
- package/_site/_test/git-validation-test.js +0 -81
- package/_site/_test/glm-ui-refresh-review-test.js +0 -313
- package/_site/_test/harness-isolation-test.js +0 -138
- package/_site/_test/helpers/ai-team-ui-fixture.js +0 -235
- package/_site/_test/helpers/cdp-browser.js +0 -386
- package/_site/_test/helpers/cdp-network-capture.js +0 -66
- package/_site/_test/helpers/find-chrome.js +0 -34
- package/_site/_test/helpers/free-port.js +0 -8
- package/_site/_test/helpers/logging-ui-fixture.js +0 -131
- package/_site/_test/helpers/module-fixture.js +0 -282
- package/_site/_test/helpers/parallel-capture-safety-r5-cap-shell.js +0 -606
- package/_site/_test/helpers/parallel-capture-safety-r5-memory-shell.js +0 -464
- package/_site/_test/helpers/parallel-dock-acceptance-env.js +0 -301
- package/_site/_test/helpers/parallel-dock-acceptance-r2-env.js +0 -378
- package/_site/_test/helpers/parallel-dock-acceptance-r2-ui.js +0 -314
- package/_site/_test/helpers/parallel-dock-acceptance-ui.js +0 -195
- package/_site/_test/helpers/parallel-dock-isolation-r3-credential-preload.js +0 -113
- package/_site/_test/helpers/parallel-dock-isolation-r3-env.js +0 -307
- package/_site/_test/helpers/parallel-dock-isolation-r3-fixture.js +0 -373
- package/_site/_test/helpers/parallel-dock-isolation-r3-ui.js +0 -314
- package/_site/_test/helpers/parallel-engine-advanced-engine-child.js +0 -45
- package/_site/_test/helpers/parallel-engine-advanced-fault-writer.js +0 -171
- package/_site/_test/helpers/parallel-engine-advanced-harness.js +0 -245
- package/_site/_test/helpers/parallel-engine-advanced-standin-analyzer.js +0 -80
- package/_site/_test/helpers/parallel-engine-advanced-ui-host.js +0 -177
- package/_site/_test/helpers/parallel-engine-final-harness.js +0 -314
- package/_site/_test/helpers/parallel-engine-final-standin-analyzer.js +0 -159
- package/_site/_test/helpers/parallel-engine-reconcile-r4-harness.js +0 -340
- package/_site/_test/helpers/parallel-engine-reconcile-r4-standin-analyzer.js +0 -82
- package/_site/_test/helpers/parallel-knowledge-fixture.js +0 -255
- package/_site/_test/helpers/parallel-logging-acceptance-fixture.js +0 -111
- package/_site/_test/helpers/parallel-logging-acceptance-proxy.js +0 -106
- package/_site/_test/helpers/parallel-logging-fix-r2-proxy.js +0 -205
- package/_site/_test/helpers/parallel-logging-integration-5025-env.js +0 -432
- package/_site/_test/helpers/parallel-memory-analyzer.js +0 -81
- package/_site/_test/helpers/parallel-memory-capture-r3-cap-shell.js +0 -605
- package/_site/_test/helpers/parallel-memory-capture-r3-shell.js +0 -176
- package/_site/_test/helpers/parallel-memory-capture-r4-cap-shell.js +0 -577
- package/_site/_test/helpers/parallel-memory-event-bridge.js +0 -128
- package/_site/_test/helpers/parallel-memory-injection-shell.js +0 -723
- package/_site/_test/helpers/parallel-memory-injection-wb-host.js +0 -81
- package/_site/_test/helpers/parallel-memory-shell.js +0 -489
- package/_site/_test/helpers/parallel-nav-isolation-env.js +0 -389
- package/_site/_test/helpers/parallel-nav-module-ui.js +0 -186
- package/_site/_test/helpers/parallel-nav-proxy.js +0 -148
- package/_site/_test/helpers/parallel-nav-shell.js +0 -361
- package/_site/_test/helpers/parallel-qa-engine-endpoint-guard.js +0 -206
- package/_site/_test/helpers/parallel-qa-engine-endpoint-isolate.js +0 -259
- package/_site/_test/helpers/parallel-retrieval-followup-corpus.js +0 -293
- package/_site/_test/helpers/parallel-retrieval-followup-next-session.js +0 -70
- package/_site/_test/helpers/parallel-retrieval-followup-r2-shell.js +0 -737
- package/_site/_test/helpers/parallel-retrieval-followup-r2-wb-host.js +0 -82
- package/_site/_test/helpers/parallel-retrieval-followup-shell.js +0 -279
- package/_site/_test/helpers/parallel-workbench-drafts-r5-fixture.js +0 -295
- package/_site/_test/helpers/parallel-workbench-drafts-r5-harness.js +0 -573
- package/_site/_test/helpers/parallel-workbench-drafts-r5-host.js +0 -69
- package/_site/_test/helpers/parallel-workbench-fixture.js +0 -371
- package/_site/_test/helpers/parallel-workbench-host.js +0 -80
- package/_site/_test/helpers/parallel-workbench-integration-5025-fixture.js +0 -408
- package/_site/_test/helpers/parallel-workbench-integration-5025-harness.js +0 -593
- package/_site/_test/helpers/parallel-workbench-integration-5025-host.js +0 -70
- package/_site/_test/helpers/parallel-workbench-integration-5025-launcher.js +0 -240
- package/_site/_test/helpers/parallel-workbench-integration-5025-runtime-harness.js +0 -630
- package/_site/_test/helpers/parallel-workbench-runtime-harness.js +0 -587
- package/_site/_test/helpers/parallel-workbench-source-map.js +0 -196
- package/_site/_test/helpers/qa-r44-env.js +0 -418
- package/_site/_test/helpers/qa-r44-report.js +0 -656
- package/_site/_test/helpers/qa-r44-ui.js +0 -347
- package/_site/_test/helpers/qa-r45-harness.js +0 -94
- package/_site/_test/helpers/qa-r48-env.js +0 -64
- package/_site/_test/helpers/qa-r49-wb-host.js +0 -58
- package/_site/_test/helpers/qa-r51-env.cjs +0 -77
- package/_site/_test/helpers/qa-r91-harness.cjs +0 -534
- package/_site/_test/helpers/single-repo-maintenance-fixture.js +0 -94
- package/_site/_test/helpers/single-repo-maintenance-tool.js +0 -56
- package/_site/_test/helpers/spawn-server.js +0 -106
- package/_site/_test/helpers/version-visibility-fixture.js +0 -251
- package/_site/_test/home-overview-test.js +0 -64
- package/_site/_test/hook-relocation-rebind-test.js +0 -120
- package/_site/_test/hook-runtime-endpoint-test.js +0 -88
- package/_site/_test/hook-status-repair-api-test.js +0 -152
- package/_site/_test/hook-trigger-test.js +0 -85
- package/_site/_test/hook-worktree-test.js +0 -42
- package/_site/_test/import-preflight-api-test.js +0 -234
- package/_site/_test/index-builder-test.js +0 -41
- package/_site/_test/index-error-display-contract-test.js +0 -32
- package/_site/_test/index-writer-concurrency-test.js +0 -135
- package/_site/_test/integration-adapters-test.js +0 -262
- package/_site/_test/integration-auto-repair-test.js +0 -115
- package/_site/_test/integration-capture-setup-test.js +0 -118
- package/_site/_test/integration-intent-test.js +0 -85
- package/_site/_test/integration-runtime-binding-a2-test.js +0 -566
- package/_site/_test/integration-runtime-binding-a3-test.js +0 -227
- package/_site/_test/integration-runtime-binding-test.js +0 -473
- package/_site/_test/integration-status-scan-test.js +0 -160
- package/_site/_test/integration-surface-coverage-test.js +0 -165
- package/_site/_test/kb-framework-test.js +0 -57
- package/_site/_test/kbpath-follow-test.js +0 -63
- package/_site/_test/knowledge-db-test.js +0 -144
- package/_site/_test/knowledge-engine-client-test.js +0 -120
- package/_site/_test/knowledge-language-control-test.js +0 -170
- package/_site/_test/knowledge-maintenance-test.js +0 -40
- package/_site/_test/knowledge-panel-lifecycle-test.js +0 -154
- package/_site/_test/knowledge-panel-ui-contract-test.js +0 -110
- package/_site/_test/knowledge-promotion-recovery-test.js +0 -260
- package/_site/_test/knowledge-query-test.js +0 -54
- package/_site/_test/knowledge-retrieval-service-test.js +0 -77
- package/_site/_test/knowledge-scopes-test.js +0 -37
- package/_site/_test/knowledge-storage-location-test.js +0 -28
- package/_site/_test/knowledge-storage-startup-test.js +0 -52
- package/_site/_test/knowledge-store-logs-supervision-test.js +0 -89
- package/_site/_test/launcher-readiness-test.js +0 -80
- package/_site/_test/legacy-claude-session-alias-test.js +0 -106
- package/_site/_test/legacy-relocation-recovery-test.js +0 -258
- package/_site/_test/legacy-routes-removed-test.js +0 -47
- package/_site/_test/legacy-workbench-exclusion-test.js +0 -92
- package/_site/_test/live-gateway-test.js +0 -48
- package/_site/_test/local-marketplace-test.js +0 -16
- package/_site/_test/log-redaction-test.js +0 -58
- package/_site/_test/logging-api-test.js +0 -89
- package/_site/_test/logging-sse-no-gap-test.js +0 -88
- package/_site/_test/logging-ui-test.js +0 -107
- package/_site/_test/markdown-delta-overlay-test.js +0 -85
- package/_site/_test/markdown-maintenance-api-test.js +0 -75
- package/_site/_test/markdown-maintenance-test.js +0 -11
- package/_site/_test/mcp-server-test.js +0 -149
- package/_site/_test/memory-groups-ui-test.js +0 -173
- package/_site/_test/model-context-windows-test.js +0 -89
- package/_site/_test/module-agent-start-proxy-test.js +0 -65
- package/_site/_test/module-artifact-integrity-test.js +0 -27
- package/_site/_test/module-boundary-test.js +0 -30
- package/_site/_test/module-bridge-eventbridge-test.js +0 -202
- package/_site/_test/module-dynamic-port-test.js +0 -118
- package/_site/_test/module-index-proxy-test.js +0 -33
- package/_site/_test/module-model-configuration-test.js +0 -44
- package/_site/_test/module-process-lifecycle-test.js +0 -35
- package/_site/_test/module-stream-proxy-test.js +0 -34
- package/_site/_test/module-supervisor-backoff-reset-test.js +0 -64
- package/_site/_test/module-terminal-restart-test.js +0 -63
- package/_site/_test/module-wiring-unbind-race-test.js +0 -59
- package/_site/_test/native-context-integrations-test.js +0 -86
- package/_site/_test/non-release-ci-test.js +0 -34
- package/_site/_test/offline-boundary-isolation-test.js +0 -32
- package/_site/_test/orphaned-claim-recovery-test.js +0 -80
- package/_site/_test/package-boundary-test.js +0 -48
- package/_site/_test/package-startup-test.js +0 -56
- package/_site/_test/packaged-ui-smoke-test.js +0 -126
- package/_site/_test/parallel-capture-safety-r5-cap006-probe.js +0 -524
- package/_site/_test/parallel-capture-safety-r5-cap008e-probe.js +0 -577
- package/_site/_test/parallel-capture-safety-r5-mem005-health-test.js +0 -381
- package/_site/_test/parallel-ci-r9-posix-socket-budget-test.js +0 -156
- package/_site/_test/parallel-engine-advanced-eng005-test.js +0 -136
- package/_site/_test/parallel-engine-advanced-eng006-test.js +0 -171
- package/_site/_test/parallel-engine-advanced-eng007-reconcile-test.js +0 -231
- package/_site/_test/parallel-engine-advanced-eng009-test.js +0 -208
- package/_site/_test/parallel-engine-advanced-eng010-test.js +0 -213
- package/_site/_test/parallel-engine-advanced-eng011-ui-probe.js +0 -459
- package/_site/_test/parallel-engine-final-eng002-test.js +0 -255
- package/_site/_test/parallel-engine-final-eng007-test.js +0 -269
- package/_site/_test/parallel-engine-final-eng011-test.js +0 -197
- package/_site/_test/parallel-engine-final-eng012-test.js +0 -354
- package/_site/_test/parallel-engine-reconcile-r4-eng007-probe.js +0 -304
- package/_site/_test/parallel-knowledge-client-error-code-test.js +0 -194
- package/_site/_test/parallel-knowledge-engine-test.js +0 -353
- package/_site/_test/parallel-knowledge-retrieval-test.js +0 -292
- package/_site/_test/parallel-knowledge-vector-test.js +0 -168
- package/_site/_test/parallel-linux-ci-r7-log007-day-test.js +0 -110
- package/_site/_test/parallel-logging-acceptance-log003-probe.js +0 -78
- package/_site/_test/parallel-logging-acceptance-log003-test.js +0 -224
- package/_site/_test/parallel-logging-acceptance-log004-probe.js +0 -85
- package/_site/_test/parallel-logging-acceptance-log004-test.js +0 -231
- package/_site/_test/parallel-logging-acceptance-log005-test.js +0 -208
- package/_site/_test/parallel-logging-acceptance-log006-test.js +0 -214
- package/_site/_test/parallel-logging-acceptance-log007-test.js +0 -223
- package/_site/_test/parallel-logging-acceptance-log008-test.js +0 -192
- package/_site/_test/parallel-logging-fix-r2-crash-probe.js +0 -271
- package/_site/_test/parallel-logging-fix-r2-gap-test.js +0 -294
- package/_site/_test/parallel-logging-fix-r2-normalhook-test.js +0 -330
- package/_site/_test/parallel-logging-integration-5025-portability-test.js +0 -554
- package/_site/_test/parallel-memory-candidate-test.js +0 -353
- package/_site/_test/parallel-memory-capture-r3-cap001-probe.js +0 -238
- package/_site/_test/parallel-memory-capture-r3-cap006-probe.js +0 -371
- package/_site/_test/parallel-memory-capture-r3-cap008-probe.js +0 -439
- package/_site/_test/parallel-memory-capture-r3-mem005-persistence-test.js +0 -333
- package/_site/_test/parallel-memory-capture-r4-cap006-probe.js +0 -519
- package/_site/_test/parallel-memory-capture-r4-cap008e-probe.js +0 -569
- package/_site/_test/parallel-memory-capture-r4-mem005-health-test.js +0 -374
- package/_site/_test/parallel-memory-home-review-test.js +0 -148
- package/_site/_test/parallel-memory-injection-origin-probe.js +0 -412
- package/_site/_test/parallel-memory-injection-probe.js +0 -411
- package/_site/_test/parallel-memory-manual-test.js +0 -292
- package/_site/_test/parallel-memory-scope-test.js +0 -98
- package/_site/_test/parallel-memory-source-test.js +0 -254
- package/_site/_test/parallel-memory-sync-test.js +0 -274
- package/_site/_test/parallel-memory-view-r8-reload-gate-test.js +0 -123
- package/_site/_test/parallel-nav-failure-test.js +0 -139
- package/_site/_test/parallel-nav-home-issues-test.js +0 -159
- package/_site/_test/parallel-nav-isolation-test.js +0 -308
- package/_site/_test/parallel-nav-isolation-vector-path-test.js +0 -90
- package/_site/_test/parallel-nav-offline-test.js +0 -300
- package/_site/_test/parallel-nav-operability-test.js +0 -268
- package/_site/_test/parallel-nav-switch-test.js +0 -293
- package/_site/_test/parallel-nav-theme-test.js +0 -176
- package/_site/_test/parallel-nav-viewport-test.js +0 -321
- package/_site/_test/parallel-qa-engine-endpoint-guard-test.js +0 -275
- package/_site/_test/parallel-retrieval-followup-citation-test.js +0 -219
- package/_site/_test/parallel-retrieval-followup-corpus-test.js +0 -289
- package/_site/_test/parallel-workbench-drafts-r4-probe.js +0 -477
- package/_site/_test/parallel-workbench-drafts-r5-chrome-env-bisect.js +0 -89
- package/_site/_test/parallel-workbench-drafts-r5-probe.js +0 -593
- package/_site/_test/parallel-workbench-independent-host.js +0 -262
- package/_site/_test/parallel-workbench-integration-5025-abort-probe.js +0 -340
- package/_site/_test/parallel-workbench-integration-5025-drafts-probe.js +0 -588
- package/_site/_test/parallel-workbench-integration-5025-env-check.js +0 -317
- package/_site/_test/parallel-workbench-integration-5025-model-probe.js +0 -342
- package/_site/_test/parallel-workbench-integration-5025-ordering-probe.js +0 -326
- package/_site/_test/parallel-workbench-model-probe.js +0 -336
- package/_site/_test/parallel-workbench-offline-test.js +0 -169
- package/_site/_test/parallel-workbench-provenance-trace.js +0 -134
- package/_site/_test/parallel-workbench-runtime-minimax-probe.js +0 -321
- package/_site/_test/parallel-workbench-runtime-wb004-ordering.js +0 -307
- package/_site/_test/parallel-workbench-runtime-wb005-drafts.js +0 -313
- package/_site/_test/parallel-workbench-runtime-wb008-abort.js +0 -321
- package/_site/_test/parallel-workbench-source-match.js +0 -206
- package/_site/_test/parallel-workbench-standalone-turn.js +0 -349
- package/_site/_test/path-consistency-test.js +0 -151
- package/_site/_test/pending-sweep-test.js +0 -9
- package/_site/_test/post-commit-automation-test.js +0 -87
- package/_site/_test/pr-consumer-contract-test.js +0 -55
- package/_site/_test/product-brand-contract-test.js +0 -25
- package/_site/_test/product-diagnostics-ui-test.js +0 -105
- package/_site/_test/product-empty-state-test.js +0 -214
- package/_site/_test/product-import-ui-test.js +0 -245
- package/_site/_test/product-navigation-test.js +0 -213
- package/_site/_test/product-progress-status-test.js +0 -100
- package/_site/_test/project-delete-recovery-test.js +0 -64
- package/_site/_test/project-domain-create-test.js +0 -91
- package/_site/_test/project-domain-scope-retrieval-test.js +0 -214
- package/_site/_test/project-git-init-confirm-test.js +0 -115
- package/_site/_test/project-goal-editor-test.js +0 -145
- package/_site/_test/project-import-duplicate-alias-test.js +0 -134
- package/_site/_test/project-import-unicode-restart-test.js +0 -140
- package/_site/_test/project-lifecycle-transaction-test.js +0 -106
- package/_site/_test/project-module-partial-recovery-test.js +0 -237
- package/_site/_test/project-remove-running-guard-test.js +0 -79
- package/_site/_test/project-store-test.js +0 -90
- package/_site/_test/project-team-ui-test.js +0 -128
- package/_site/_test/project-unbind-late-read-ui-test.js +0 -281
- package/_site/_test/project-unbind-writer-guard-test.js +0 -231
- package/_site/_test/prompt-settings-test.js +0 -115
- package/_site/_test/protected-architecture-gate-test.js +0 -123
- package/_site/_test/qa-r44-permission-question.js +0 -756
- package/_site/_test/qa-r45-offline-backfill-test.js +0 -279
- package/_site/_test/qa-r48-sys003-blank-secret-test.js +0 -258
- package/_site/_test/qa-r49-sys003-real-blank-probe.js +0 -374
- package/_site/_test/recovery-label-contract-test.js +0 -55
- package/_site/_test/refactor-characterization-test.js +0 -36
- package/_site/_test/registry-events-test.js +0 -38
- package/_site/_test/release-version-sync-test.js +0 -115
- package/_site/_test/requirement-binding-test.js +0 -113
- package/_site/_test/requirement-recorder-test.js +0 -173
- package/_site/_test/run-all-tests.js +0 -196
- package/_site/_test/runtime-endpoint-test.js +0 -64
- package/_site/_test/scanner-test.js +0 -83
- package/_site/_test/server-security-test.js +0 -96
- package/_site/_test/sessions-stream-test.js +0 -93
- package/_site/_test/shared-contracts-test.js +0 -58
- package/_site/_test/shared-scope-root-binding-test.js +0 -75
- package/_site/_test/simple-import-test.js +0 -98
- package/_site/_test/single-repo-maintenance-e2e-test.js +0 -200
- package/_site/_test/startup-analysis-disabled-test.js +0 -16
- package/_site/_test/startup-integration-isolation-test.js +0 -59
- package/_site/_test/startup-integration-repair-test.js +0 -43
- package/_site/_test/storage-foundation-test.js +0 -78
- package/_site/_test/structured-logger-test.js +0 -101
- package/_site/_test/t07b-cln-005-coverage-test.js +0 -212
- package/_site/_test/t07c-cln-001-002-007-coverage-test.js +0 -135
- package/_site/_test/t07d-git-rel-coverage-test.js +0 -226
- package/_site/_test/t07e-qta-coverage-test.js +0 -195
- package/_site/_test/t07f-mem-008-coverage-test.js +0 -100
- package/_site/_test/team-knowledge-store-sparse-checkout-test.js +0 -196
- package/_site/_test/team-knowledge-store-test.js +0 -132
- package/_site/_test/test-server-cleanup-test.js +0 -35
- package/_site/_test/test-server-module-isolation-test.js +0 -37
- package/_site/_test/tracking-start-test.js +0 -144
- package/_site/_test/vector-storage-root-test.js +0 -75
- package/_site/_test/version-visibility-browser-probe.js +0 -249
- package/_site/_test/version-visibility-test.js +0 -92
- package/_site/_test/workbench-context-receipts-test.js +0 -27
- package/_site/_test/workbench-permission-test.js +0 -118
- package/_site/_test/workflow-module-wiring-test.js +0 -252
- package/_site/_test/workflow-tools-test.js +0 -243
- package/_site/_test/workspace-ui-contract-test.js +0 -77
- package/_site/_test/zcode-capture-integration-test.js +0 -112
- package/templates/change.md +0 -30
- package/templates/project-readme.md +0 -52
- /package/docs/{assets → images}/architecture.svg +0 -0
- /package/docs/{assets → images}/dashboard.png +0 -0
- /package/docs/{assets → images}/draft-review.png +0 -0
- /package/docs/{assets → images}/logo.svg +0 -0
- /package/docs/{assets → images}/runs-drafts.png +0 -0
- /package/docs/{assets → images}/settings.png +0 -0
- /package/{ui → resources/ui}/favicon.svg +0 -0
- /package/{ui → resources/ui}/index.html +0 -0
- /package/{ui → resources/ui}/knowledge-panel.html +0 -0
- /package/{ui → resources/ui}/live-client.js +0 -0
- /package/{ui → resources/ui}/product.css +0 -0
- /package/{ui → resources/ui}/product.js +0 -0
- /package/{ui → resources/ui}/version-info.css +0 -0
- /package/{ui → resources/ui}/version-info.js +0 -0
- /package/{_site/lib → src/automation}/automation-config.js +0 -0
- /package/{_site/lib → src/automation}/commit-prompt.js +0 -0
- /package/{_site/lib → src/common}/cli-instances.js +0 -0
- /package/{_site/lib → src/common}/contracts.js +0 -0
- /package/{_site/lib → src/common}/data-dir.js +0 -0
- /package/{_site/lib → src/common}/folder-picker-output.js +0 -0
- /package/{_site/lib → src/common}/git-path.js +0 -0
- /package/{_site/lib → src/common}/git-runner.js +0 -0
- /package/{_site/lib → src/common}/runtime-control.js +0 -0
- /package/{_site/lib → src/conversations}/bridge-consumer-service.js +0 -0
- /package/{_site/lib → src/conversations}/codex-context-status.js +0 -0
- /package/{_site/lib → src/integrations}/ai-vendor-presets.js +0 -0
- /package/{_site/lib → src/integrations}/claude-plugin-status.js +0 -0
- /package/{_site/lib → src/integrations}/integration-auto-repair.js +0 -0
- /package/{_site/lib → src/integrations}/integration-intent.js +0 -0
- /package/{_site/lib → src/integrations}/integration-repair-worker.js +0 -0
- /package/{_site/lib → src/integrations}/integration-status-scan.js +0 -0
- /package/{_site/lib → src/integrations}/integration-status-worker.js +0 -0
- /package/{_site/lib → src/integrations}/model-context-windows.js +0 -0
- /package/{_site/lib → src/integrations}/startup-integration-repair.js +0 -0
- /package/{_site/lib → src/knowledge}/embedding-service.js +0 -0
- /package/{_site/lib → src/knowledge}/index-builder.js +0 -0
- /package/{_site/lib → src/knowledge}/kb-validator.js +0 -0
- /package/{_site/lib → src/knowledge}/knowledge-db.js +0 -0
- /package/{_site/lib → src/knowledge}/knowledge-schema.js +0 -0
- /package/{_site/lib → src/knowledge}/markdown-knowledge-indexer.js +0 -0
- /package/{_site → src}/scripts/codex-notify-fanout.cjs +0 -0
- /package/{_site → src}/scripts/folder-picker.ps1 +0 -0
- /package/{_site → src}/scripts/sync-release-version.js +0 -0
- /package/{_site → src}/scripts/verify-module-runtime.js +0 -0
- /package/{_site/lib → src/server}/live-gateway.js +0 -0
- /package/{_site/lib → src/server}/module-port-resolver.js +0 -0
- /package/{_site/lib → src/server}/public-version-info.js +0 -0
- /package/{_site → src}/start.bat +0 -0
- /package/{_site → src}/stop.bat +0 -0
- /package/{_site/lib → src/tools}/registry-events.js +0 -0
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
// _site/_test/helpers/qa-r44-ui.js
|
|
3
|
-
//
|
|
4
|
-
// The R44 lane's real-UI actions on the product's own permission and
|
|
5
|
-
// question cards.
|
|
6
|
-
//
|
|
7
|
-
// Every function below drives the DOM control the product itself renders:
|
|
8
|
-
// the 允许 / 拒绝 buttons of the tool permission card, the radio / checkbox /
|
|
9
|
-
// custom input and the 提交答案 button of the question card, and the
|
|
10
|
-
// product's own permission-mode menu. Nothing here fabricates an event, calls
|
|
11
|
-
// a product endpoint in place of the UI, or writes a card state by hand.
|
|
12
|
-
//
|
|
13
|
-
// The product marks its own cards:
|
|
14
|
-
// tool card <div class="perm" data-perm-id="..."> with .p-title,
|
|
15
|
-
// .p-sub, .btn-allow (允许), .btn-deny (拒绝) and, once it
|
|
16
|
-
// settles, .p-state (已允许 / 已拒绝)
|
|
17
|
-
// question card <section class="perm question-card" data-perm-id="...">
|
|
18
|
-
// with one .question-field per question, .question-option
|
|
19
|
-
// labels, an optional .question-custom input and a
|
|
20
|
-
// .question-submit button (提交答案)
|
|
21
|
-
|
|
22
|
-
function wait(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
|
|
23
|
-
|
|
24
|
-
async function waitUntil(fn, label, timeoutMs = 30000, intervalMs = 150) {
|
|
25
|
-
const deadline = Date.now() + timeoutMs;
|
|
26
|
-
let last;
|
|
27
|
-
while (Date.now() < deadline) {
|
|
28
|
-
try {
|
|
29
|
-
const value = await fn();
|
|
30
|
-
if (value) return value;
|
|
31
|
-
last = value;
|
|
32
|
-
} catch (error) { last = error && error.message; }
|
|
33
|
-
await wait(intervalMs);
|
|
34
|
-
}
|
|
35
|
-
const detail = last === undefined ? '' : ` (last: ${typeof last === 'string' ? last : JSON.stringify(last)})`;
|
|
36
|
-
throw new Error(`timed out after ${timeoutMs}ms waiting for ${label}${detail}`);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// --- the tool permission card ----------------------------------------------
|
|
40
|
-
|
|
41
|
-
const READ_TOOL_CARDS = `(() => {
|
|
42
|
-
const cards = Array.from(document.querySelectorAll('.perm[data-perm-id]')).filter(node => !node.classList.contains('question-card'));
|
|
43
|
-
return cards.map(node => {
|
|
44
|
-
const title = node.querySelector('.p-title');
|
|
45
|
-
const sub = node.querySelector('.p-sub');
|
|
46
|
-
const state = node.querySelector('.p-state');
|
|
47
|
-
const allow = node.querySelector('.btn-allow');
|
|
48
|
-
const deny = node.querySelector('.btn-deny');
|
|
49
|
-
const titleText = ((title && title.textContent) || '').trim();
|
|
50
|
-
return {
|
|
51
|
-
requestId: node.dataset.permId || '',
|
|
52
|
-
title: titleText,
|
|
53
|
-
toolName: titleText.split(/\\s+/)[0] || '',
|
|
54
|
-
sub: ((sub && sub.textContent) || '').trim(),
|
|
55
|
-
hasAllow: Boolean(allow),
|
|
56
|
-
hasDeny: Boolean(deny),
|
|
57
|
-
settledState: state ? (state.textContent || '').trim() : null,
|
|
58
|
-
settled: Boolean(state),
|
|
59
|
-
cardClass: node.className,
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
})()`;
|
|
63
|
-
|
|
64
|
-
async function readToolPermissionCards(browser) {
|
|
65
|
-
return browser.evaluate(READ_TOOL_CARDS);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// The card of one specific request. The product renders the tool name of a
|
|
69
|
-
// permission card only in the EVENT summary, not in the card title (the card
|
|
70
|
-
// reads "Agent 请求执行操作"), so the card is identified by the request id
|
|
71
|
-
// the product itself put into `data-perm-id`.
|
|
72
|
-
async function findToolCard(browser, requestId) {
|
|
73
|
-
const cards = await readToolPermissionCards(browser);
|
|
74
|
-
return cards.find(card => card.requestId === requestId) || null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// The event streams the PAGE itself opened, read from the recorder the
|
|
78
|
-
// frozen harness injects into every page it opens. The lane uses it to know
|
|
79
|
-
// that the page is subscribed to a session BEFORE a turn is sent.
|
|
80
|
-
async function readPageStreams(browser) {
|
|
81
|
-
return browser.evaluate(`(() => {
|
|
82
|
-
const streams = (window.__wbRecorder && window.__wbRecorder.streams) || [];
|
|
83
|
-
return streams.map(entry => String(entry.url || ''));
|
|
84
|
-
})()`);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// The events the PAGE itself received, read from the recorder the frozen
|
|
88
|
-
// harness injects into every page it opens. This is the browser's own
|
|
89
|
-
// receipt of the product's event stream.
|
|
90
|
-
async function readPageEvents(browser, type) {
|
|
91
|
-
return browser.evaluate(`(() => {
|
|
92
|
-
const log = (window.__wbRecorder && window.__wbRecorder.log) || [];
|
|
93
|
-
const wanted = ${JSON.stringify(type || null)};
|
|
94
|
-
const out = [];
|
|
95
|
-
for (const entry of log) {
|
|
96
|
-
if (wanted && entry.type !== wanted) continue;
|
|
97
|
-
let event = null;
|
|
98
|
-
try { event = JSON.parse(entry.data); } catch (error) { event = null; }
|
|
99
|
-
out.push({ type: entry.type, event });
|
|
100
|
-
}
|
|
101
|
-
return out;
|
|
102
|
-
})()`);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// What the page shows right now: the permission cards, the question cards and
|
|
106
|
-
// the product's own session state. Used as the driver-side diagnostic.
|
|
107
|
-
async function readDomDiagnostics(browser) {
|
|
108
|
-
return browser.evaluate(`(() => {
|
|
109
|
-
const col = document.getElementById('stream-col');
|
|
110
|
-
return {
|
|
111
|
-
permCount: document.querySelectorAll('.perm').length,
|
|
112
|
-
permIds: Array.from(document.querySelectorAll('.perm[data-perm-id]')).map(node => node.dataset.permId || ''),
|
|
113
|
-
questionCardCount: document.querySelectorAll('.perm.question-card').length,
|
|
114
|
-
streamChildren: col ? col.childElementCount : null,
|
|
115
|
-
streamTextLength: col ? (col.textContent || '').length : null,
|
|
116
|
-
sessionState: (typeof state !== 'undefined' && state) ? (state.sessionState || null) : null,
|
|
117
|
-
activeSessionId: (typeof state !== 'undefined' && state) ? (state.activeSessionId || null) : null,
|
|
118
|
-
permissionMode: (typeof state !== 'undefined' && state) ? (state.permissionMode || null) : null,
|
|
119
|
-
recordedEventTypes: ((window.__wbRecorder && window.__wbRecorder.log) || []).map(entry => entry.type),
|
|
120
|
-
};
|
|
121
|
-
})()`);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// The product's own 拒绝 button of the card with that requestId.
|
|
125
|
-
async function clickDeny(browser, requestId) {
|
|
126
|
-
const result = await browser.evaluate(`(() => {
|
|
127
|
-
const id = ${JSON.stringify(requestId)};
|
|
128
|
-
const node = document.querySelector('.perm[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]:not(.question-card)');
|
|
129
|
-
if (!node) return { clicked: false, reason: 'no such permission card' };
|
|
130
|
-
const deny = node.querySelector('.btn-deny');
|
|
131
|
-
if (!deny) return { clicked: false, reason: 'the card has no 拒绝 button' };
|
|
132
|
-
deny.click();
|
|
133
|
-
return { clicked: true, title: ((node.querySelector('.p-title') || {}).textContent || '').trim() };
|
|
134
|
-
})()`);
|
|
135
|
-
if (!result.clicked) throw new Error(`the 拒绝 button could not be clicked: ${result.reason || 'unknown'}`);
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// The product's own 允许 button of the card with that requestId.
|
|
140
|
-
async function clickAllow(browser, requestId) {
|
|
141
|
-
const result = await browser.evaluate(`(() => {
|
|
142
|
-
const id = ${JSON.stringify(requestId)};
|
|
143
|
-
const node = document.querySelector('.perm[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]:not(.question-card)');
|
|
144
|
-
if (!node) return { clicked: false, reason: 'no such permission card' };
|
|
145
|
-
const allow = node.querySelector('.btn-allow');
|
|
146
|
-
if (!allow) return { clicked: false, reason: 'the card has no 允许 button' };
|
|
147
|
-
allow.click();
|
|
148
|
-
return { clicked: true };
|
|
149
|
-
})()`);
|
|
150
|
-
if (!result.clicked) throw new Error(`the 允许 button could not be clicked: ${result.reason || 'unknown'}`);
|
|
151
|
-
return result;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// The state the product itself rendered after it settled the card.
|
|
155
|
-
async function readSettledCard(browser, requestId) {
|
|
156
|
-
return browser.evaluate(`(() => {
|
|
157
|
-
const id = ${JSON.stringify(requestId)};
|
|
158
|
-
const node = document.querySelector('.perm[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]');
|
|
159
|
-
if (!node) return { found: false };
|
|
160
|
-
const state = node.querySelector('.p-state');
|
|
161
|
-
return {
|
|
162
|
-
found: true,
|
|
163
|
-
isQuestionCard: node.classList.contains('question-card'),
|
|
164
|
-
settledState: state ? (state.textContent || '').trim() : null,
|
|
165
|
-
settled: node.classList.contains('question-settled') || node.classList.contains('settled'),
|
|
166
|
-
title: ((node.querySelector('.p-title') || node.querySelector('.question-title')) || {}).textContent || '',
|
|
167
|
-
cardClass: node.className,
|
|
168
|
-
};
|
|
169
|
-
})()`);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// --- the user question card ------------------------------------------------
|
|
173
|
-
|
|
174
|
-
const READ_QUESTION_CARDS = `(() => {
|
|
175
|
-
const cards = Array.from(document.querySelectorAll('.perm.question-card[data-perm-id]'));
|
|
176
|
-
return cards.map(node => {
|
|
177
|
-
const fields = Array.from(node.querySelectorAll('.question-field')).map(field => {
|
|
178
|
-
const legend = field.querySelector('legend');
|
|
179
|
-
const options = Array.from(field.querySelectorAll('.question-option')).map(label => {
|
|
180
|
-
const input = label.querySelector('input');
|
|
181
|
-
const text = label.querySelector('.question-option-label');
|
|
182
|
-
return {
|
|
183
|
-
label: ((text && text.textContent) || '').trim(),
|
|
184
|
-
inputType: input ? input.type : null,
|
|
185
|
-
checked: input ? input.checked === true : false,
|
|
186
|
-
value: input ? input.value : null,
|
|
187
|
-
};
|
|
188
|
-
});
|
|
189
|
-
const custom = field.querySelector('input.question-custom');
|
|
190
|
-
return {
|
|
191
|
-
legend: ((legend && legend.textContent) || '').trim(),
|
|
192
|
-
options,
|
|
193
|
-
customPresent: Boolean(custom),
|
|
194
|
-
customValue: custom ? custom.value : null,
|
|
195
|
-
customType: custom ? custom.type : null,
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
const submit = node.querySelector('.question-submit');
|
|
199
|
-
const title = node.querySelector('.question-title');
|
|
200
|
-
return {
|
|
201
|
-
requestId: node.dataset.permId || '',
|
|
202
|
-
title: ((title && title.textContent) || '').trim(),
|
|
203
|
-
settled: node.classList.contains('question-settled'),
|
|
204
|
-
fields,
|
|
205
|
-
submitDisabled: submit ? submit.disabled === true : null,
|
|
206
|
-
submitText: submit ? (submit.textContent || '').trim() : null,
|
|
207
|
-
errorText: ((node.querySelector('.question-error') || {}).textContent || '').trim(),
|
|
208
|
-
};
|
|
209
|
-
});
|
|
210
|
-
})()`;
|
|
211
|
-
|
|
212
|
-
async function readQuestionCards(browser) {
|
|
213
|
-
return browser.evaluate(READ_QUESTION_CARDS);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Click the radio of a single-select question by its visible label.
|
|
217
|
-
async function selectRadioOption(browser, requestId, fieldIndex, optionLabel) {
|
|
218
|
-
const result = await browser.evaluate(`(() => {
|
|
219
|
-
const id = ${JSON.stringify(requestId)};
|
|
220
|
-
const index = ${Number(fieldIndex)};
|
|
221
|
-
const label = ${JSON.stringify(optionLabel)};
|
|
222
|
-
const node = document.querySelector('.perm.question-card[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]');
|
|
223
|
-
if (!node) return { clicked: false, reason: 'no such question card' };
|
|
224
|
-
const field = node.querySelectorAll('.question-field')[index];
|
|
225
|
-
if (!field) return { clicked: false, reason: 'no such question field' };
|
|
226
|
-
for (const option of Array.from(field.querySelectorAll('.question-option'))) {
|
|
227
|
-
const text = option.querySelector('.question-option-label');
|
|
228
|
-
if (((text && text.textContent) || '').trim() === label) {
|
|
229
|
-
const input = option.querySelector('input');
|
|
230
|
-
if (!input) return { clicked: false, reason: 'the option has no input' };
|
|
231
|
-
input.click();
|
|
232
|
-
return { clicked: true, checked: input.checked === true, inputType: input.type };
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return { clicked: false, reason: 'no option with that label' };
|
|
236
|
-
})()`);
|
|
237
|
-
if (!result.clicked) throw new Error(`the radio option could not be selected: ${result.reason || 'unknown'}`);
|
|
238
|
-
return result;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// Tick the checkboxes of a multi-select question by their visible labels.
|
|
242
|
-
async function selectCheckboxOptions(browser, requestId, fieldIndex, optionLabels) {
|
|
243
|
-
const labels = Array.isArray(optionLabels) ? optionLabels : [optionLabels];
|
|
244
|
-
const result = await browser.evaluate(`(() => {
|
|
245
|
-
const id = ${JSON.stringify(requestId)};
|
|
246
|
-
const index = ${Number(fieldIndex)};
|
|
247
|
-
const labels = ${JSON.stringify(labels)};
|
|
248
|
-
const node = document.querySelector('.perm.question-card[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]');
|
|
249
|
-
if (!node) return { clicked: false, reason: 'no such question card' };
|
|
250
|
-
const field = node.querySelectorAll('.question-field')[index];
|
|
251
|
-
if (!field) return { clicked: false, reason: 'no such question field' };
|
|
252
|
-
const picked = [];
|
|
253
|
-
for (const label of labels) {
|
|
254
|
-
let hit = null;
|
|
255
|
-
for (const option of Array.from(field.querySelectorAll('.question-option'))) {
|
|
256
|
-
const text = option.querySelector('.question-option-label');
|
|
257
|
-
if (((text && text.textContent) || '').trim() === label) { hit = option; break; }
|
|
258
|
-
}
|
|
259
|
-
if (!hit) return { clicked: false, reason: 'no option with label ' + label };
|
|
260
|
-
const input = hit.querySelector('input');
|
|
261
|
-
if (!input) return { clicked: false, reason: 'the option has no input' };
|
|
262
|
-
input.click();
|
|
263
|
-
picked.push({ label, checked: input.checked === true });
|
|
264
|
-
}
|
|
265
|
-
return { clicked: true, picked };
|
|
266
|
-
})()`);
|
|
267
|
-
if (!result.clicked) throw new Error(`the checkbox options could not be selected: ${result.reason || 'unknown'}`);
|
|
268
|
-
return result;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// Type a custom answer into the product's own custom input of a question.
|
|
272
|
-
async function typeCustomAnswer(browser, requestId, fieldIndex, text) {
|
|
273
|
-
const result = await browser.evaluate(`(() => {
|
|
274
|
-
const id = ${JSON.stringify(requestId)};
|
|
275
|
-
const index = ${Number(fieldIndex)};
|
|
276
|
-
const value = ${JSON.stringify(text)};
|
|
277
|
-
const node = document.querySelector('.perm.question-card[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]');
|
|
278
|
-
if (!node) return { typed: false, reason: 'no such question card' };
|
|
279
|
-
const field = node.querySelectorAll('.question-field')[index];
|
|
280
|
-
if (!field) return { typed: false, reason: 'no such question field' };
|
|
281
|
-
const custom = field.querySelector('input.question-custom');
|
|
282
|
-
if (!custom) return { typed: false, reason: 'the question has no custom input' };
|
|
283
|
-
custom.focus();
|
|
284
|
-
custom.value = value;
|
|
285
|
-
custom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
286
|
-
return { typed: true, value: custom.value, type: custom.type };
|
|
287
|
-
})()`);
|
|
288
|
-
if (!result.typed) throw new Error(`the custom answer could not be typed: ${result.reason || 'unknown'}`);
|
|
289
|
-
return result;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// The product's own 提交答案 button.
|
|
293
|
-
async function clickSubmitAnswer(browser, requestId) {
|
|
294
|
-
const result = await browser.evaluate(`(() => {
|
|
295
|
-
const id = ${JSON.stringify(requestId)};
|
|
296
|
-
const node = document.querySelector('.perm.question-card[data-perm-id="' + id.replace(/"/g, '\\\\"') + '"]');
|
|
297
|
-
if (!node) return { clicked: false, reason: 'no such question card' };
|
|
298
|
-
const submit = node.querySelector('.question-submit');
|
|
299
|
-
if (!submit) return { clicked: false, reason: 'the card has no 提交答案 button' };
|
|
300
|
-
const wasDisabled = submit.disabled === true;
|
|
301
|
-
submit.click();
|
|
302
|
-
return { clicked: true, wasDisabled };
|
|
303
|
-
})()`);
|
|
304
|
-
if (!result.clicked) throw new Error(`the 提交答案 button could not be clicked: ${result.reason || 'unknown'}`);
|
|
305
|
-
return result;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// --- the product's own permission-mode menu ---------------------------------
|
|
309
|
-
|
|
310
|
-
// The product renders the permission modes in its own menu (默认防护 /
|
|
311
|
-
// 接受编辑 / 计划模式 / 完全访问). Selecting 完全访问 is the product's own
|
|
312
|
-
// bypass control; the lane uses it to prove that the bypass does not release
|
|
313
|
-
// a pending question.
|
|
314
|
-
async function selectPermissionMode(browser, label) {
|
|
315
|
-
const opened = await browser.evaluate("(() => { const button = document.getElementById('btn-mode'); if (!button) return { opened: false, reason: 'no mode button' }; button.click(); const pop = document.getElementById('pop-mode'); return { opened: Boolean(pop) && pop.hidden === false, items: pop ? Array.from(pop.querySelectorAll('.pop-item')).map(item => ((item.querySelector('.grow') || item).textContent || '').trim()) : [] }; })()");
|
|
316
|
-
if (!opened.opened) throw new Error(`the permission-mode menu did not open: ${opened.reason || 'unknown'}`);
|
|
317
|
-
const clicked = await browser.evaluate(`(() => {
|
|
318
|
-
const label = ${JSON.stringify(label)};
|
|
319
|
-
const pop = document.getElementById('pop-mode');
|
|
320
|
-
for (const item of Array.from(pop.querySelectorAll('.pop-item'))) {
|
|
321
|
-
const text = ((item.querySelector('.grow') || item).textContent || '').trim();
|
|
322
|
-
if (text === label) { item.click(); return { clicked: true, label: text }; }
|
|
323
|
-
}
|
|
324
|
-
return { clicked: false, items: Array.from(pop.querySelectorAll('.pop-item')).map(item => ((item.querySelector('.grow') || item).textContent || '').trim()) };
|
|
325
|
-
})()`);
|
|
326
|
-
if (!clicked.clicked) throw new Error(`the permission mode ${label} is not in the product's menu: ${JSON.stringify(clicked.items)}`);
|
|
327
|
-
return clicked;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
module.exports = {
|
|
331
|
-
wait,
|
|
332
|
-
waitUntil,
|
|
333
|
-
readToolPermissionCards,
|
|
334
|
-
findToolCard,
|
|
335
|
-
readPageStreams,
|
|
336
|
-
readPageEvents,
|
|
337
|
-
readDomDiagnostics,
|
|
338
|
-
clickDeny,
|
|
339
|
-
clickAllow,
|
|
340
|
-
readSettledCard,
|
|
341
|
-
readQuestionCards,
|
|
342
|
-
selectRadioOption,
|
|
343
|
-
selectCheckboxOptions,
|
|
344
|
-
typeCustomAnswer,
|
|
345
|
-
clickSubmitAnswer,
|
|
346
|
-
selectPermissionMode,
|
|
347
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// P-ENGINE-OFFLINE-AUDIT-R45 lane harness (ENG-007 offline compensation
|
|
4
|
-
// boundary audit). Wraps the audited P-ENG-FINAL harness READ-ONLY: this file
|
|
5
|
-
// adds nothing but (1) driver-process environment isolation applied BEFORE the
|
|
6
|
-
// wrapped harness is required, and (2) a post-commit hook variant whose real
|
|
7
|
-
// bridge CLI is reachable but whose bridge home is an unwritable destination
|
|
8
|
-
// ("hook 不可达" fault: the CLI runs and fails, the journal never hears about
|
|
9
|
-
// the commit, Git itself is not blocked).
|
|
10
|
-
//
|
|
11
|
-
// Portability: no hardcoded drive letters. Temp/evidence roots resolve from
|
|
12
|
-
// R45_TEMP_ROOT / R45_EVIDENCE_ROOT when set, otherwise the OS temp dir and
|
|
13
|
-
// the repo-relative ignored artifacts dir. The wrapped harness additionally
|
|
14
|
-
// refuses temp roots inside the repository.
|
|
15
|
-
|
|
16
|
-
const fs = require('node:fs');
|
|
17
|
-
const os = require('node:os');
|
|
18
|
-
const path = require('node:path');
|
|
19
|
-
|
|
20
|
-
const REPO_ROOT = path.resolve(__dirname, '..', '..', '..');
|
|
21
|
-
|
|
22
|
-
// ---------- step 1: isolate the driver process environment ----------
|
|
23
|
-
const TEMP_ROOT = path.resolve(process.env.R45_TEMP_ROOT || process.env.PK_TEST_TEMP_ROOT || path.join(os.tmpdir(), 'r45-engine-offline'));
|
|
24
|
-
const EVIDENCE_ROOT = path.resolve(process.env.R45_EVIDENCE_ROOT || path.join(REPO_ROOT, 'qa-autopilot', 'artifacts', 'parallel-20261023', 'engine-offline-audit-r45', 'evidence'));
|
|
25
|
-
|
|
26
|
-
if (TEMP_ROOT === REPO_ROOT || TEMP_ROOT.startsWith(REPO_ROOT + path.sep)) {
|
|
27
|
-
throw new Error(`R45 temp root must live outside the repository (got ${TEMP_ROOT})`);
|
|
28
|
-
}
|
|
29
|
-
fs.mkdirSync(TEMP_ROOT, { recursive: true });
|
|
30
|
-
fs.mkdirSync(EVIDENCE_ROOT, { recursive: true });
|
|
31
|
-
|
|
32
|
-
const ISO = path.join(TEMP_ROOT, 'iso');
|
|
33
|
-
for (const dir of ['home', 'appdata', 'localappdata', 'tmp', 'codex', 'claude', 'workbench', 'bridge', 'kb-data', 'kb-knowledge']) {
|
|
34
|
-
fs.mkdirSync(path.join(ISO, dir, Math.random().toString(36).slice(2)), { recursive: true });
|
|
35
|
-
}
|
|
36
|
-
function oneOf(name) {
|
|
37
|
-
const dir = path.join(ISO, name);
|
|
38
|
-
return fs.readdirSync(dir)[0] ? path.join(dir, fs.readdirSync(dir)[0]) : dir;
|
|
39
|
-
}
|
|
40
|
-
const envIsolation = {
|
|
41
|
-
HOME: oneOf('home'), USERPROFILE: oneOf('home'),
|
|
42
|
-
APPDATA: oneOf('appdata'), LOCALAPPDATA: oneOf('localappdata'),
|
|
43
|
-
TEMP: oneOf('tmp'), TMP: oneOf('tmp'),
|
|
44
|
-
CODEX_HOME: oneOf('codex'), CLAUDE_CONFIG_DIR: oneOf('claude'),
|
|
45
|
-
CLAUDE_AI_WORKBENCH_DATA_DIR: oneOf('workbench'),
|
|
46
|
-
AI_CODING_EVENT_BRIDGE_HOME: oneOf('bridge'),
|
|
47
|
-
KB_DATA_DIR: oneOf('kb-data'), KB_KNOWLEDGE_DATA_DIR: oneOf('kb-knowledge'),
|
|
48
|
-
PK_TEST_TEMP_ROOT: TEMP_ROOT,
|
|
49
|
-
};
|
|
50
|
-
for (const [name, value] of Object.entries(envIsolation)) process.env[name] = value;
|
|
51
|
-
// resolved-containment assertion for every isolated root
|
|
52
|
-
const resolved = Object.fromEntries(Object.entries(envIsolation).map(([k, v]) => [k, path.resolve(v)]));
|
|
53
|
-
for (const [k, v] of Object.entries(resolved)) {
|
|
54
|
-
const root = path.resolve(TEMP_ROOT);
|
|
55
|
-
if (v !== root && !v.startsWith(root + path.sep)) {
|
|
56
|
-
throw new Error(`containment failure: ${k} -> ${v} escapes ${TEMP_ROOT}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// ---------- step 2: require the audited harness (read-only reuse) ----------
|
|
61
|
-
const FINAL = require('./parallel-engine-final-harness.js');
|
|
62
|
-
|
|
63
|
-
// ---------- step 3: hook variants owned by this lane ----------
|
|
64
|
-
// dead-home: a regular FILE occupies the bridge home path, so the real CLI
|
|
65
|
-
// process starts, cannot create its journal destination, exits non-zero, and
|
|
66
|
-
// the hook propagates that fault. 'ok' matches the audited harness behaviour
|
|
67
|
-
// (real CLI, real home, output silenced) but is installed by this lane so the
|
|
68
|
-
// wrapped installer is never modified.
|
|
69
|
-
function installHookVariant(repoPath, { home, mode }) {
|
|
70
|
-
const hookPath = path.join(repoPath, '.git', 'hooks', 'post-commit');
|
|
71
|
-
const slash = value => value.replace(/\\/g, '/');
|
|
72
|
-
const line = `"${slash(process.execPath)}" "${slash(FINAL.BRIDGE_CLI)}" --home "${slash(home)}" --cwd "${slash(repoPath)}"`;
|
|
73
|
-
const script = mode === 'ok'
|
|
74
|
-
? ['#!/bin/sh', `${line} >/dev/null 2>&1`, 'exit 1', ''].join('\n')
|
|
75
|
-
: ['#!/bin/sh', line, 'exit 1', ''].join('\n');
|
|
76
|
-
fs.mkdirSync(path.dirname(hookPath), { recursive: true });
|
|
77
|
-
fs.writeFileSync(hookPath, script, { mode: 0o755 });
|
|
78
|
-
return { hookPath, mode, content: script };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function makeDeadHome(lane) {
|
|
82
|
-
const dead = path.join(lane, 'dead-bridge-home');
|
|
83
|
-
fs.writeFileSync(dead, 'not a directory: the bridge journal destination is unreachable\n');
|
|
84
|
-
return dead;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
module.exports = {
|
|
88
|
-
...FINAL,
|
|
89
|
-
TEMP_ROOT,
|
|
90
|
-
EVIDENCE_ROOT,
|
|
91
|
-
ENV_ISOLATION_RESOLVED: resolved,
|
|
92
|
-
installHookVariant,
|
|
93
|
-
makeDeadHome,
|
|
94
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// P-LIFECYCLE-EVIDENCE-R48 lane environment helper.
|
|
4
|
-
//
|
|
5
|
-
// Installs the driver-process isolation BEFORE any product/helper module is
|
|
6
|
-
// required: every redirected variable gets an OWN, existing root (never
|
|
7
|
-
// unset) with a resolved-containment assertion against the lane temp root.
|
|
8
|
-
// This deliberately does NOT reuse parallel-engine-final-harness isolatedEnv:
|
|
9
|
-
// that scrubber deletes KB_*/CODEX/CLAUDE* variables, and this lane's driver
|
|
10
|
-
// needs an explicit, valid KB_TERMINAL_URL-style setup where absence of a
|
|
11
|
-
// variable is never mistaken for a set one.
|
|
12
|
-
//
|
|
13
|
-
// Portability: roots come from R48_TEMP_ROOT / R48_EVIDENCE_ROOT when set,
|
|
14
|
-
// otherwise os.tmpdir() and the repo-relative ignored artifacts dir. No
|
|
15
|
-
// hardcoded drive letters; the temp root must live outside the repository.
|
|
16
|
-
|
|
17
|
-
const fs = require('node:fs');
|
|
18
|
-
const os = require('node:os');
|
|
19
|
-
const path = require('node:path');
|
|
20
|
-
|
|
21
|
-
const REPO_ROOT = path.resolve(__dirname, '..', '..', '..');
|
|
22
|
-
const TEMP_ROOT = path.resolve(process.env.R48_TEMP_ROOT || process.env.PK_TEST_TEMP_ROOT || path.join(os.tmpdir(), 'r48-lifecycle-evidence'));
|
|
23
|
-
const EVIDENCE_ROOT = path.resolve(process.env.R48_EVIDENCE_ROOT || path.join(REPO_ROOT, 'qa-autopilot', 'artifacts', 'parallel-20261023', 'lifecycle-evidence-r48', 'evidence'));
|
|
24
|
-
|
|
25
|
-
function installLaneEnv({ caseId } = {}) {
|
|
26
|
-
if (TEMP_ROOT === REPO_ROOT || TEMP_ROOT.startsWith(REPO_ROOT + path.sep)) {
|
|
27
|
-
throw new Error(`R48 temp root must live outside the repository (got ${TEMP_ROOT})`);
|
|
28
|
-
}
|
|
29
|
-
fs.mkdirSync(TEMP_ROOT, { recursive: true });
|
|
30
|
-
const laneTmp = fs.mkdtempSync(path.join(TEMP_ROOT, `r48-${caseId || 'lane'}-`));
|
|
31
|
-
const iso = path.join(laneTmp, 'iso');
|
|
32
|
-
const names = ['home', 'appdata', 'localappdata', 'tmp', 'codex', 'claude', 'workbench', 'bridge', 'kb-data', 'kb-knowledge'];
|
|
33
|
-
const resolved = { R48_TEMP_ROOT: TEMP_ROOT, R48_EVIDENCE_ROOT: EVIDENCE_ROOT };
|
|
34
|
-
for (const name of names) {
|
|
35
|
-
const dir = path.join(iso, name);
|
|
36
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
37
|
-
resolved[name] = dir;
|
|
38
|
-
}
|
|
39
|
-
const assign = {
|
|
40
|
-
HOME: resolved.home, USERPROFILE: resolved.home,
|
|
41
|
-
APPDATA: resolved.appdata, LOCALAPPDATA: resolved.localappdata,
|
|
42
|
-
TEMP: resolved.tmp, TMP: resolved.tmp,
|
|
43
|
-
CODEX_HOME: resolved.codex, CLAUDE_CONFIG_DIR: resolved.claude,
|
|
44
|
-
CLAUDE_AI_WORKBENCH_DATA_DIR: resolved.workbench,
|
|
45
|
-
AI_CODING_EVENT_BRIDGE_HOME: resolved.bridge,
|
|
46
|
-
KB_DATA_DIR: resolved['kb-data'], KB_KNOWLEDGE_DATA_DIR: resolved['kb-knowledge'],
|
|
47
|
-
};
|
|
48
|
-
for (const [name, value] of Object.entries(assign)) process.env[name] = value;
|
|
49
|
-
// Every redirected root must still resolve inside the lane temp root.
|
|
50
|
-
for (const [name, value] of Object.entries(assign)) {
|
|
51
|
-
const absolute = path.resolve(value);
|
|
52
|
-
if (absolute !== laneTmp && !absolute.startsWith(laneTmp + path.sep)) {
|
|
53
|
-
throw new Error(`containment failure: ${name} -> ${absolute} escapes ${laneTmp}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
laneTmp,
|
|
58
|
-
evidenceRoot: EVIDENCE_ROOT,
|
|
59
|
-
envIsolationResolved: Object.fromEntries(Object.entries(assign).map(([k, v]) => [k, path.resolve(v)])),
|
|
60
|
-
cleanup() { try { fs.rmSync(laneTmp, { recursive: true, force: true }); } catch {} },
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
module.exports = { installLaneEnv, TEMP_ROOT, EVIDENCE_ROOT, REPO_ROOT };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
// P-PROFILE-BLANK-REAL-R49 host — modeled on the tracked
|
|
3
|
-
// helpers/parallel-workbench-drafts-r5-host.js pattern (frozen for R5), with
|
|
4
|
-
// the R49 differences the dispatch requires:
|
|
5
|
-
// * NO ProfileStore seeding at all: every profile and every credential
|
|
6
|
-
// enters through the real HTTP surface of the real module server
|
|
7
|
-
// (normal product flows only);
|
|
8
|
-
// * ephemeral port (listen 0 on 127.0.0.1) — no fixed port is touched;
|
|
9
|
-
// * service-wiring env vars (KB_EVENT_BRIDGE_URL, KB_KNOWLEDGE_ENGINE_URL,
|
|
10
|
-
// KB_TERMINAL_URL, KB_VECTOR_HUB_URL, KB_WORKBENCH_RUNTIME_TOKEN) are
|
|
11
|
-
// scrubbed and asserted absent BEFORE createWorkbenchServer so the module
|
|
12
|
-
// cannot wire itself to any real bridge/engine/vector service even if the
|
|
13
|
-
// ambient environment carried one.
|
|
14
|
-
// The module bytes under test are the root's exact-pinned install
|
|
15
|
-
// (node_modules/claude-ai-workbench@0.13.9), required read-only.
|
|
16
|
-
|
|
17
|
-
const path = require('node:path');
|
|
18
|
-
|
|
19
|
-
const moduleRoot = String(process.env.PK_R49_MODULE_ROOT || '').trim();
|
|
20
|
-
const dataDir = String(process.env.PK_R49_DATA_DIR || '').trim();
|
|
21
|
-
const workspace = String(process.env.PK_R49_WORKSPACE || '').trim();
|
|
22
|
-
|
|
23
|
-
if (!moduleRoot || !dataDir || !workspace) {
|
|
24
|
-
console.error('qa-r49-wb-host: PK_R49_MODULE_ROOT, PK_R49_DATA_DIR and PK_R49_WORKSPACE are required');
|
|
25
|
-
process.exit(2);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
for (const name of ['KB_EVENT_BRIDGE_URL', 'KB_KNOWLEDGE_ENGINE_URL', 'KB_TERMINAL_URL', 'KB_VECTOR_HUB_URL', 'KB_WORKBENCH_RUNTIME_TOKEN', 'KB_ENGINE_URL', 'KB_BRIDGE_HOME']) {
|
|
29
|
-
delete process.env[name];
|
|
30
|
-
}
|
|
31
|
-
for (const name of ['KB_EVENT_BRIDGE_URL', 'KB_KNOWLEDGE_ENGINE_URL', 'KB_TERMINAL_URL', 'KB_VECTOR_HUB_URL', 'KB_WORKBENCH_RUNTIME_TOKEN', 'KB_ENGINE_URL', 'KB_BRIDGE_HOME']) {
|
|
32
|
-
if (process.env[name] !== undefined) throw new Error(`qa-r49-wb-host: ${name} survived scrub`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Same contract as the module's own bin: the runtime resolves its data
|
|
36
|
-
// directory from these.
|
|
37
|
-
process.env.CLAUDE_AI_WORKBENCH_DATA_DIR = dataDir;
|
|
38
|
-
process.env.KB_DATA_DIR = dataDir;
|
|
39
|
-
|
|
40
|
-
const { createWorkbenchServer } = require(path.join(moduleRoot, 'packages', 'server'));
|
|
41
|
-
|
|
42
|
-
const app = createWorkbenchServer({ dataDir, workspaces: { 'r49-fixture': workspace } });
|
|
43
|
-
app.server.listen(0, '127.0.0.1', () => {
|
|
44
|
-
const address = app.server.address();
|
|
45
|
-
process.stdout.write(`R49_WB_HOST_READY http://127.0.0.1:${address.port} module=${moduleRoot} data=${dataDir}\n`);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
let stopping = false;
|
|
49
|
-
async function shutdown() {
|
|
50
|
-
if (stopping) return;
|
|
51
|
-
stopping = true;
|
|
52
|
-
setTimeout(() => process.exit(1), 10000).unref();
|
|
53
|
-
try { await app.service.destroy(); } catch { process.exitCode = 1; }
|
|
54
|
-
app.server.closeAllConnections?.();
|
|
55
|
-
app.server.close(() => process.exit(process.exitCode || 0));
|
|
56
|
-
}
|
|
57
|
-
process.on('SIGINT', shutdown);
|
|
58
|
-
process.on('SIGTERM', shutdown);
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// P-LIFECYCLE-NEGATIVE-R51 lane environment helper.
|
|
4
|
-
//
|
|
5
|
-
// Installs driver-process isolation BEFORE any product/helper module is
|
|
6
|
-
// required: every redirected variable gets an OWN, existing root (never
|
|
7
|
-
// unset) with a resolved-containment assertion against the lane temp root.
|
|
8
|
-
// Modeled on the audited R48 pattern; deliberately NOT reusing lanes that
|
|
9
|
-
// scrub KB_*/CODEX/CLAUDE variables — this lane needs explicit owned values
|
|
10
|
-
// where absence must never be mistaken for set.
|
|
11
|
-
//
|
|
12
|
-
// Portability: roots come from R51_TEMP_ROOT / R51_EVIDENCE_ROOT when set,
|
|
13
|
-
// otherwise os.tmpdir() and the repo-relative ignored artifacts dir. No
|
|
14
|
-
// hardcoded drive letters; the temp root must live outside the repository.
|
|
15
|
-
|
|
16
|
-
const fs = require('node:fs');
|
|
17
|
-
const os = require('node:os');
|
|
18
|
-
const path = require('node:path');
|
|
19
|
-
|
|
20
|
-
const REPO_ROOT = path.resolve(__dirname, '..', '..', '..');
|
|
21
|
-
const TEMP_ROOT = path.resolve(process.env.R51_TEMP_ROOT || path.join(os.tmpdir(), 'r51-lifecycle-negative'));
|
|
22
|
-
const EVIDENCE_ROOT = path.resolve(process.env.R51_EVIDENCE_ROOT || path.join(REPO_ROOT, 'qa-autopilot', 'artifacts', 'parallel-20261023', 'lifecycle-negative-r51', 'evidence'));
|
|
23
|
-
|
|
24
|
-
// Resolve the Chrome/Edge binary BEFORE env isolation: find-chrome.cjs reads
|
|
25
|
-
// LOCALAPPDATA/PROGRAMFILES candidates, and the isolated driver must keep its
|
|
26
|
-
// writable roots owned. The absolute executable path is preserved through
|
|
27
|
-
// KB_CHROME_PATH (the first candidate find-chrome checks) so the browser
|
|
28
|
-
// launch stays deterministic while everything writable stays in lane roots.
|
|
29
|
-
function resolveChromeBeforeIsolation() {
|
|
30
|
-
const { findChrome } = require(path.join(REPO_ROOT, '_site', '_test', 'helpers', 'find-chrome.js'));
|
|
31
|
-
return findChrome();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function installLaneEnv({ caseId } = {}) {
|
|
35
|
-
if (TEMP_ROOT === REPO_ROOT || TEMP_ROOT.startsWith(REPO_ROOT + path.sep)) {
|
|
36
|
-
throw new Error(`R51 temp root must live outside the repository (got ${TEMP_ROOT})`);
|
|
37
|
-
}
|
|
38
|
-
fs.mkdirSync(TEMP_ROOT, { recursive: true });
|
|
39
|
-
const laneTmp = fs.mkdtempSync(path.join(TEMP_ROOT, `r51-${caseId || 'lane'}-`));
|
|
40
|
-
const iso = path.join(laneTmp, 'iso');
|
|
41
|
-
const names = ['home', 'appdata', 'localappdata', 'tmp', 'codex', 'claude', 'workbench', 'bridge', 'kb-data', 'kb-knowledge', 'gitcfg'];
|
|
42
|
-
const resolved = { R51_TEMP_ROOT: TEMP_ROOT, R51_EVIDENCE_ROOT: EVIDENCE_ROOT };
|
|
43
|
-
for (const name of names) {
|
|
44
|
-
const dir = path.join(iso, name);
|
|
45
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
46
|
-
resolved[name] = dir;
|
|
47
|
-
}
|
|
48
|
-
const gitGlobal = path.join(resolved.gitcfg, 'gitconfig');
|
|
49
|
-
if (!fs.existsSync(gitGlobal)) fs.writeFileSync(gitGlobal, '', 'utf8');
|
|
50
|
-
const assign = {
|
|
51
|
-
HOME: resolved.home, USERPROFILE: resolved.home,
|
|
52
|
-
APPDATA: resolved.appdata, LOCALAPPDATA: resolved.localappdata,
|
|
53
|
-
TEMP: resolved.tmp, TMP: resolved.tmp,
|
|
54
|
-
CODEX_HOME: resolved.codex, CLAUDE_CONFIG_DIR: resolved.claude,
|
|
55
|
-
CLAUDE_AI_WORKBENCH_DATA_DIR: resolved.workbench,
|
|
56
|
-
AI_CODING_EVENT_BRIDGE_HOME: resolved.bridge,
|
|
57
|
-
KB_DATA_DIR: resolved['kb-data'], KB_KNOWLEDGE_DATA_DIR: resolved['kb-knowledge'],
|
|
58
|
-
// Deterministic git: no machine/global config can leak into fixture repos.
|
|
59
|
-
GIT_CONFIG_GLOBAL: gitGlobal,
|
|
60
|
-
};
|
|
61
|
-
for (const [name, value] of Object.entries(assign)) process.env[name] = value;
|
|
62
|
-
process.env.GIT_CONFIG_NOSYSTEM = '1';
|
|
63
|
-
for (const [name, value] of Object.entries(assign)) {
|
|
64
|
-
const absolute = path.resolve(value);
|
|
65
|
-
if (absolute !== laneTmp && !absolute.startsWith(laneTmp + path.sep)) {
|
|
66
|
-
throw new Error(`containment failure: ${name} -> ${absolute} escapes ${laneTmp}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
laneTmp,
|
|
71
|
-
evidenceRoot: EVIDENCE_ROOT,
|
|
72
|
-
envIsolationResolved: Object.fromEntries(Object.entries(assign).map(([k, v]) => [k, path.resolve(v)])),
|
|
73
|
-
cleanup() { try { fs.rmSync(laneTmp, { recursive: true, force: true }); } catch {} },
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
module.exports = { installLaneEnv, resolveChromeBeforeIsolation, TEMP_ROOT, EVIDENCE_ROOT, REPO_ROOT };
|