@ornexus/neocortex 4.60.73 → 4.60.74

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 (241) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1216 -1210
  3. package/install.ps1 +1 -1
  4. package/install.sh +1 -1
  5. package/package.json +2 -2
  6. package/packages/client/dist/adapters/adapter-registry.js +1 -108
  7. package/packages/client/dist/adapters/antigravity-adapter.js +2 -77
  8. package/packages/client/dist/adapters/claude-code-adapter.js +3 -79
  9. package/packages/client/dist/adapters/codex-adapter.js +2 -80
  10. package/packages/client/dist/adapters/cursor-adapter.js +4 -115
  11. package/packages/client/dist/adapters/gemini-adapter.js +2 -71
  12. package/packages/client/dist/adapters/grok-adapter.js +2 -42
  13. package/packages/client/dist/adapters/index.js +1 -22
  14. package/packages/client/dist/adapters/platform-detector.js +1 -212
  15. package/packages/client/dist/adapters/target-adapter.js +0 -12
  16. package/packages/client/dist/adapters/vscode-adapter.js +2 -72
  17. package/packages/client/dist/agent/refresh-stubs.js +2 -417
  18. package/packages/client/dist/agent/update-agent-yaml.js +1 -102
  19. package/packages/client/dist/agent/update-description.js +1 -251
  20. package/packages/client/dist/cache/crypto-utils.js +1 -78
  21. package/packages/client/dist/cache/encrypted-cache.js +1 -108
  22. package/packages/client/dist/cache/in-memory-asset-cache.js +1 -73
  23. package/packages/client/dist/cache/index.js +1 -13
  24. package/packages/client/dist/cache/protected-pi-boundary.js +1 -44
  25. package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -127
  26. package/packages/client/dist/checkpoint/index.js +1 -11
  27. package/packages/client/dist/checkpoint/shared-checkpoint-types.js +1 -32
  28. package/packages/client/dist/cli.js +5 -358
  29. package/packages/client/dist/commands/activate.js +8 -394
  30. package/packages/client/dist/commands/architecture-answers.js +7 -274
  31. package/packages/client/dist/commands/architecture-memory-terminal.js +4 -253
  32. package/packages/client/dist/commands/architecture-non-ui-continuation.js +1 -100
  33. package/packages/client/dist/commands/architecture-root-binding.js +1 -51
  34. package/packages/client/dist/commands/cache-status.js +2 -112
  35. package/packages/client/dist/commands/config.js +1 -88
  36. package/packages/client/dist/commands/doctor.js +2 -635
  37. package/packages/client/dist/commands/invoke.js +143 -7200
  38. package/packages/client/dist/commands/legacy-epic-terminal.js +1 -71
  39. package/packages/client/dist/commands/legacy-story-branch.js +1 -96
  40. package/packages/client/dist/commands/legacy-story-pr.js +1 -276
  41. package/packages/client/dist/commands/mutation-qa-checkpoint.js +5 -285
  42. package/packages/client/dist/commands/mutation-qa-gate.js +1 -54
  43. package/packages/client/dist/commands/mutation-qa-git.js +1 -41
  44. package/packages/client/dist/commands/mutation-qa-policy.js +1 -102
  45. package/packages/client/dist/commands/mutation-qa-run.js +3 -219
  46. package/packages/client/dist/commands/mutation-qa-verdict.js +1 -149
  47. package/packages/client/dist/commands/mutation-qa.js +1 -220
  48. package/packages/client/dist/commands/native-agent.js +2 -136
  49. package/packages/client/dist/commands/planning-diagnosis.js +1 -43
  50. package/packages/client/dist/commands/planning-generation.js +1 -53
  51. package/packages/client/dist/commands/planning-memory.js +1 -40
  52. package/packages/client/dist/commands/planning-research.js +1 -42
  53. package/packages/client/dist/commands/private-session.js +1 -75
  54. package/packages/client/dist/commands/property-qa.js +1 -139
  55. package/packages/client/dist/commands/qa-control.js +1 -16
  56. package/packages/client/dist/commands/qa-scan-browser-launch.js +1 -55
  57. package/packages/client/dist/commands/qa-scan-browser-route.js +1 -28
  58. package/packages/client/dist/commands/qa-scan-capture.js +5 -663
  59. package/packages/client/dist/commands/qa-scan-discovery.js +3 -376
  60. package/packages/client/dist/commands/qa-scan-review.js +5 -826
  61. package/packages/client/dist/commands/qa-synthetic-backend-capture.js +1 -266
  62. package/packages/client/dist/commands/qa-synthetic-backend-review.js +1 -297
  63. package/packages/client/dist/commands/qa-synthetic-backend.js +2 -340
  64. package/packages/client/dist/commands/qa-synthetic-broker-port.js +1 -85
  65. package/packages/client/dist/commands/qa-synthetic-browser.js +1 -39
  66. package/packages/client/dist/commands/refactor-characterization.js +21 -671
  67. package/packages/client/dist/commands/refactor-commit.js +13 -399
  68. package/packages/client/dist/commands/refactor-control.js +3 -142
  69. package/packages/client/dist/commands/refactor-cpp-assertions.js +3 -93
  70. package/packages/client/dist/commands/refactor-review.js +5 -283
  71. package/packages/client/dist/commands/refactor-root.js +7 -588
  72. package/packages/client/dist/commands/refresh-memory.js +3 -156
  73. package/packages/client/dist/commands/shared-architecture-non-ui.js +1 -24
  74. package/packages/client/dist/commands/story-checkpoint.js +1 -171
  75. package/packages/client/dist/config/profile-directory.js +1 -13
  76. package/packages/client/dist/config/resolver-selection.js +1 -278
  77. package/packages/client/dist/config/secure-config.js +12 -281
  78. package/packages/client/dist/config.js +2 -223
  79. package/packages/client/dist/constants.js +1 -25
  80. package/packages/client/dist/context/context-collector.js +2 -222
  81. package/packages/client/dist/context/context-sanitizer.js +1 -145
  82. package/packages/client/dist/continuity/autonomous-governance.js +1 -285
  83. package/packages/client/dist/continuity/continuity-client-state-store.js +1 -1587
  84. package/packages/client/dist/continuity/invoke-hooks.js +1 -129
  85. package/packages/client/dist/continuity/migrations/001-initial-schema.js +2 -12
  86. package/packages/client/dist/continuity/migrations/002-processing-output-summary-indexes.js +2 -12
  87. package/packages/client/dist/continuity/migrations/003-headless-execution-attempts.js +2 -12
  88. package/packages/client/dist/continuity/migrations/004-outbox-delivery-state.js +2 -12
  89. package/packages/client/dist/continuity/migrations/005-bounded-headless-queue.js +2 -12
  90. package/packages/client/dist/continuity/migrations/006-native-agent-dispatches.js +2 -10
  91. package/packages/client/dist/continuity/native-agent-store.js +1 -69
  92. package/packages/client/dist/continuity/native-agent-types.js +1 -90
  93. package/packages/client/dist/continuity/outbox.js +1 -117
  94. package/packages/client/dist/continuity/runner-bootstrap-policy.js +1 -172
  95. package/packages/client/dist/continuity/sqlite-store.js +81 -2612
  96. package/packages/client/dist/effects/invoke-effect-gateways.js +1 -62
  97. package/packages/client/dist/errors/error-messages.js +2 -228
  98. package/packages/client/dist/errors/frontmatter-diagnostics.js +1 -125
  99. package/packages/client/dist/evidence/collector.js +1 -347
  100. package/packages/client/dist/evidence/index.js +1 -1
  101. package/packages/client/dist/evidence/types.js +0 -2
  102. package/packages/client/dist/fs/atomic-state-replace.js +1 -152
  103. package/packages/client/dist/generated/command-registry.generated.js +1 -4076
  104. package/packages/client/dist/generated/public-projections.generated.js +1 -149
  105. package/packages/client/dist/git/direct-yolo-c01-retry.js +4 -138
  106. package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -1234
  107. package/packages/client/dist/git/epic-operational-state.js +2 -672
  108. package/packages/client/dist/git/git-lifecycle-step-ids.js +1 -14
  109. package/packages/client/dist/git/git-lifecycle-store.d.ts +23 -0
  110. package/packages/client/dist/git/git-lifecycle-store.js +10 -1981
  111. package/packages/client/dist/git/legacy-story-branch-checkpoint.js +9 -259
  112. package/packages/client/dist/git/legacy-story-branch-setup.js +4 -348
  113. package/packages/client/dist/git/legacy-story-pr.js +70 -3538
  114. package/packages/client/dist/git/secure-filesystem-boundary.js +5 -182
  115. package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -284
  116. package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -237
  117. package/packages/client/dist/i18n/first-run.js +2 -60
  118. package/packages/client/dist/index.js +1 -47
  119. package/packages/client/dist/invocation/invoke-input.js +1 -24
  120. package/packages/client/dist/license/index.js +1 -5
  121. package/packages/client/dist/license/license-client.js +1 -304
  122. package/packages/client/dist/machine/fingerprint.js +2 -163
  123. package/packages/client/dist/machine/index.js +1 -5
  124. package/packages/client/dist/memory/project-memory-path-scope.js +1 -62
  125. package/packages/client/dist/memory/project-memory-writer.js +40 -1007
  126. package/packages/client/dist/memory/shared-project-memory-types.js +2 -253
  127. package/packages/client/dist/migrations/epic-lifecycle-backfill.js +3 -1060
  128. package/packages/client/dist/migrations/project-identity-capability.js +1 -50
  129. package/packages/client/dist/migrations/project-identity.js +7 -493
  130. package/packages/client/dist/migrations/state-json.js +4 -393
  131. package/packages/client/dist/policy/architecture-policy.js +2 -184
  132. package/packages/client/dist/policy/index.js +1 -7
  133. package/packages/client/dist/policy/shared-policy-types.js +0 -38
  134. package/packages/client/dist/policy/subagent-approval-policy.js +1 -55
  135. package/packages/client/dist/private-execution/clean-baseline.js +2 -279
  136. package/packages/client/dist/private-execution/codex-executor.js +4 -574
  137. package/packages/client/dist/private-execution/codex-host-runtime.js +1 -137
  138. package/packages/client/dist/private-execution/codex-lifecycle-guard.js +1 -97
  139. package/packages/client/dist/private-execution/codex-scoped-permissions.js +1 -128
  140. package/packages/client/dist/private-execution/delivery.js +13 -410
  141. package/packages/client/dist/private-execution/diagnosis-root-review.js +2 -294
  142. package/packages/client/dist/private-execution/frozen-handoff.js +6 -19
  143. package/packages/client/dist/private-execution/implementation-validation.js +2 -106
  144. package/packages/client/dist/private-execution/isolated-admission.js +23 -1432
  145. package/packages/client/dist/private-execution/isolated-session.js +5 -725
  146. package/packages/client/dist/private-execution/isolated-workspace.js +1 -122
  147. package/packages/client/dist/private-execution/pact-consumer-runtime.js +3 -409
  148. package/packages/client/dist/private-execution/pact-test-source.js +1 -258
  149. package/packages/client/dist/private-execution/pact-toolchain.js +3 -290
  150. package/packages/client/dist/private-execution/pact-write-set.js +1 -172
  151. package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +5 -406
  152. package/packages/client/dist/private-execution/planning-generation-checkpoint.js +5 -462
  153. package/packages/client/dist/private-execution/planning-memory-checkpoint.js +3 -139
  154. package/packages/client/dist/private-execution/planning-research-checkpoint.js +4 -325
  155. package/packages/client/dist/private-execution/private-report-store.js +1 -42
  156. package/packages/client/dist/private-execution/property-test-candidate.js +1 -103
  157. package/packages/client/dist/private-execution/property-test-choices.js +3 -147
  158. package/packages/client/dist/private-execution/property-test-plan.js +7 -271
  159. package/packages/client/dist/private-execution/property-test-review.js +4 -258
  160. package/packages/client/dist/private-execution/property-test-runtime.js +9 -372
  161. package/packages/client/dist/private-execution/property-test-source.js +1 -139
  162. package/packages/client/dist/private-execution/root-checkpoint.js +1 -80
  163. package/packages/client/dist/private-execution/root-memory-git-evidence.js +3 -135
  164. package/packages/client/dist/private-execution/root-memory-recovery.js +1 -93
  165. package/packages/client/dist/private-execution/root-memory-request.js +1 -29
  166. package/packages/client/dist/private-execution/root-memory-scope.js +1 -178
  167. package/packages/client/dist/private-execution/root-memory-writer.js +1 -102
  168. package/packages/client/dist/private-execution/session-lease.js +1 -63
  169. package/packages/client/dist/private-execution/shared-private-admission-types.js +1 -50
  170. package/packages/client/dist/private-execution/shared-project-validation.js +1 -66
  171. package/packages/client/dist/private-execution/shared-root-memory-types.js +1 -61
  172. package/packages/client/dist/private-execution/ux-source-validation.js +1 -372
  173. package/packages/client/dist/private-execution/ux-write-set.js +2 -191
  174. package/packages/client/dist/registry/registry-reconciliation.js +1 -234
  175. package/packages/client/dist/resilience/circuit-breaker.js +1 -170
  176. package/packages/client/dist/resilience/degradation-manager.js +1 -164
  177. package/packages/client/dist/resilience/freshness-indicator.js +1 -100
  178. package/packages/client/dist/resilience/index.js +1 -8
  179. package/packages/client/dist/resilience/recovery-detector.js +1 -74
  180. package/packages/client/dist/resolvers/asset-resolver.js +0 -13
  181. package/packages/client/dist/resolvers/local-resolver.js +8 -255
  182. package/packages/client/dist/resolvers/remote-resolver.js +1 -233
  183. package/packages/client/dist/runner/binary.js +1 -404
  184. package/packages/client/dist/runner/cli.js +17 -1571
  185. package/packages/client/dist/runner/headless/adapters.js +1 -49
  186. package/packages/client/dist/runner/headless/claude-code-adapter.js +1 -79
  187. package/packages/client/dist/runner/headless/continuous-story-workspace.js +11 -1628
  188. package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +1 -69
  189. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.d.ts +1 -1
  190. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +2 -110
  191. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +2 -0
  192. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +10 -1236
  193. package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +18 -2
  194. package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -318
  195. package/packages/client/dist/runner/headless/fake-adapter.js +1 -62
  196. package/packages/client/dist/runner/headless/managed-profile.js +1 -132
  197. package/packages/client/dist/runner/headless/opencode-adapter.js +2 -145
  198. package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -43
  199. package/packages/client/dist/runner/headless/resolver.js +1 -231
  200. package/packages/client/dist/runner/headless/run-yolo.js +1 -885
  201. package/packages/client/dist/runner/headless/run-yoloop.d.ts +1 -0
  202. package/packages/client/dist/runner/headless/run-yoloop.js +2 -2574
  203. package/packages/client/dist/runner/headless/types.js +2 -574
  204. package/packages/client/dist/runner/local-console.js +13 -396
  205. package/packages/client/dist/runner/portal-sync-worker.js +1 -1487
  206. package/packages/client/dist/runner/project-identity.js +1 -106
  207. package/packages/client/dist/runner/scheduler.js +7 -995
  208. package/packages/client/dist/runner-cli.js +2 -18
  209. package/packages/client/dist/state/invocation-shape.js +1 -13
  210. package/packages/client/dist/state/project-state-snapshot.js +1 -1731
  211. package/packages/client/dist/state/state-json-repair.js +3 -785
  212. package/packages/client/dist/state/structural-dag-projection.js +1 -118
  213. package/packages/client/dist/telemetry/index.js +1 -5
  214. package/packages/client/dist/telemetry/offline-queue.js +1 -131
  215. package/packages/client/dist/tier/index.js +1 -5
  216. package/packages/client/dist/tier/tier-aware-client.js +1 -405
  217. package/packages/client/dist/types/index.js +1 -38
  218. package/packages/client/dist/version.js +1 -27
  219. package/packages/client/dist/yolo/change-evidence-collector.js +1 -126
  220. package/packages/client/dist/yolo/invoke-envelope-capability.js +1 -62
  221. package/packages/client/dist/yolo/spec-envelope-collector.js +5 -184
  222. package/packages/client/dist/yoloop/discovery-hook.js +2 -300
  223. package/packages/client/dist/yoloop/index.js +1 -8
  224. package/packages/client/dist/yoloop/invoke-hooks.js +12 -669
  225. package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1007
  226. package/packages/client/dist/yoloop/shared-yoloop-types.js +1 -33
  227. package/packages/client/dist/yoloop/target-normalization.js +1 -180
  228. package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -1920
  229. package/packages/shared/dist/yolo/change-evidence.js +1 -1
  230. package/packages/shared/dist/yoloop/epic-terminal-git.js +144 -2
  231. package/targets-stubs/antigravity/gemini.md +1 -1
  232. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  233. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  234. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  235. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  236. package/targets-stubs/claude-code/neocortex.md +2 -2
  237. package/targets-stubs/codex/AGENTS.md +1 -1
  238. package/targets-stubs/cursor/agent.md +2 -2
  239. package/targets-stubs/gemini-cli/agent.md +2 -2
  240. package/targets-stubs/opencode/neocortex-root.md +1 -1
  241. package/targets-stubs/vscode/neocortex.agent.md +2 -2
@@ -1,376 +1,3 @@
1
- /** Root-owned, synthetic-loopback Q01 reachable-link inventory and bound Q01–Q03 evidence. */
2
- import { createHash } from 'node:crypto';
3
- import { performance } from 'node:perf_hooks';
4
- import { closeSync, constants, fstatSync, fsyncSync, openSync, readFileSync, writeFileSync } from 'node:fs';
5
- import { dirname, join, resolve } from 'node:path';
6
- import { aggregateRootQaScanReviews, planRootQaScan, rootQaScanEvidenceDirectory } from './qa-scan-review.js';
7
- import { routeRootQaScanRequest } from './qa-scan-browser-route.js';
8
- import { launchRootQaBrowser } from './qa-scan-browser-launch.js';
9
- import { launchSyntheticBackendBrowser } from './qa-synthetic-browser.js';
10
- import { openSyntheticBackendSession } from './qa-synthetic-backend.js';
11
- const SHA256 = /^[a-f0-9]{64}$/;
12
- const MAX_TARGETS = 16;
13
- const MAX_URL_BYTES = 1024;
14
- const MAX_RECORD_BYTES = 32_768;
15
- const MAX_AGE_MS = 60 * 60_000;
16
- // A load event can precede SPA hydration. Observe a bounded quiet window
17
- // before treating rendered links as the Q01 inventory; never claim that an
18
- // indefinitely changing page has a complete route set.
19
- const LINK_QUIET_MS = 500;
20
- const LINK_SETTLE_LIMIT_MS = 2_000;
21
- const LINK_POLL_MS = 50;
22
- function sha(value) {
23
- return createHash('sha256').update(value).digest('hex');
24
- }
25
- function object(value) {
26
- return value !== null && typeof value === 'object' && !Array.isArray(value);
27
- }
28
- function exact(value, keys) {
29
- return object(value) && Object.keys(value).sort().join('\0') === [...keys].sort().join('\0');
30
- }
31
- function privateRecord(root, prefix, id) {
32
- if (!SHA256.test(id))
33
- throw new Error('qa-scan-discovery-unverified');
34
- return join(rootQaScanEvidenceDirectory(root), `${prefix}-${id}.json`);
35
- }
36
- function saveImmutable(path, value) {
37
- const bytes = Buffer.from(`${JSON.stringify(value)}\n`);
38
- const handle = openSync(path, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL
39
- | (constants.O_NOFOLLOW ?? 0), 0o600);
40
- try {
41
- writeFileSync(handle, bytes);
42
- fsyncSync(handle);
43
- }
44
- finally {
45
- closeSync(handle);
46
- }
47
- const directoryHandle = openSync(dirname(path), constants.O_RDONLY | (constants.O_DIRECTORY ?? 0));
48
- try {
49
- fsyncSync(directoryHandle);
50
- }
51
- finally {
52
- closeSync(directoryHandle);
53
- }
54
- }
55
- function readImmutable(path, maxBytes) {
56
- const handle = openSync(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
57
- let raw;
58
- let expectedSize;
59
- try {
60
- const stat = fstatSync(handle);
61
- if (!stat.isFile() || stat.uid !== process.getuid?.()
62
- || (stat.mode & 0o077) !== 0 || stat.size < 1 || stat.size > maxBytes) {
63
- throw new Error('qa-scan-discovery-unverified');
64
- }
65
- expectedSize = stat.size;
66
- raw = readFileSync(handle);
67
- }
68
- finally {
69
- closeSync(handle);
70
- }
71
- if (raw.length !== expectedSize || raw.length > maxBytes)
72
- throw new Error('qa-scan-discovery-unverified');
73
- const parsed = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(raw));
74
- if (!raw.equals(Buffer.from(`${JSON.stringify(parsed)}\n`))) {
75
- throw new Error('qa-scan-discovery-unverified');
76
- }
77
- return parsed;
78
- }
79
- function discoveryReceipt(body, discoverySha256) {
80
- return Object.freeze({ schemaVersion: 2, kind: 'root-qa-scan-link-discovery',
81
- sourceHead: body.sourceHead, seedSha256: body.seedSha256, discoverySha256,
82
- targetCount: body.targetUrls.length, inventoryScope: 'reachable-rendered-same-origin-links',
83
- qaAccepted: false, workflowContinuationAuthorized: false,
84
- localOnly: true, publicSafe: true });
85
- }
86
- async function settledRenderedLinks(page) {
87
- let previous;
88
- let quietSince = performance.now();
89
- const deadline = quietSince + LINK_SETTLE_LIMIT_MS;
90
- while (performance.now() <= deadline) {
91
- const links = await page.locator('a[href]').evaluateAll((anchors) => anchors.map((anchor) => anchor.href));
92
- const serialized = JSON.stringify(links);
93
- if (serialized !== previous) {
94
- previous = serialized;
95
- quietSince = performance.now();
96
- }
97
- else if (performance.now() - quietSince >= LINK_QUIET_MS) {
98
- return links;
99
- }
100
- await page.waitForTimeout(LINK_POLL_MS);
101
- }
102
- throw new Error('qa-scan-discovery-scope-unverified');
103
- }
104
- /** Navigation itself may have application-defined GET effects. Opt in only
105
- * for a purpose-built synthetic app; never borrow a browser profile/cookies. */
106
- export async function discoverRootQaScanLinks(options) {
107
- if (!options.authorizeDiscovery)
108
- throw new Error('qa-scan-discovery-authorization-required');
109
- const root = resolve(options.projectRoot);
110
- const plan = planRootQaScan(root, 'discovery', options.seedUrl);
111
- const seed = new URL(options.seedUrl);
112
- if (Buffer.byteLength(seed.href) > MAX_URL_BYTES) {
113
- throw new Error('qa-scan-discovery-scope-too-large');
114
- }
115
- let browser;
116
- const backend = options.syntheticBackend ? await openSyntheticBackendSession({ projectRoot: root,
117
- surface: 'discovery', targetUrl: options.seedUrl, ...options.syntheticBackend }) : undefined;
118
- try {
119
- browser = backend ? await launchSyntheticBackendBrowser() : await launchRootQaBrowser();
120
- }
121
- catch {
122
- throw new Error('qa-scan-discovery-browser-unavailable');
123
- }
124
- try {
125
- const context = await browser.newContext({ serviceWorkers: 'block', acceptDownloads: false,
126
- permissions: [], ignoreHTTPSErrors: false });
127
- let denied = 0;
128
- let failed = 0;
129
- let navigations = 0;
130
- let popups = 0;
131
- await context.route('**/*', async (route) => {
132
- let allowed = false;
133
- try {
134
- const request = route.request();
135
- const url = new URL(request.url());
136
- allowed = url.protocol === 'http:' && url.origin === seed.origin
137
- && (request.method() === 'GET' || request.method() === 'HEAD');
138
- }
139
- catch { /* Refuse malformed and opaque browser requests. */ }
140
- if (backend) {
141
- try {
142
- if (!allowed)
143
- throw new Error('denied');
144
- const request = route.request();
145
- const response = await backend.request(request.url(), request.method(), request.postData(), await request.allHeaders());
146
- await route.fulfill({ status: response.status, body: response.body,
147
- headers: { 'content-type': response.contentType, 'cache-control': 'no-store' } });
148
- }
149
- catch {
150
- denied++;
151
- await route.abort('blockedbyclient').catch(() => undefined);
152
- }
153
- }
154
- else
155
- await routeRootQaScanRequest(route, allowed, () => { denied++; });
156
- });
157
- await context.routeWebSocket(/.*/, async (socket) => {
158
- denied++;
159
- await socket.close({ code: 1008, reason: 'blocked' });
160
- });
161
- const page = await context.newPage();
162
- context.on('page', (opened) => { if (opened !== page) {
163
- popups++;
164
- void opened.close();
165
- } });
166
- page.on('framenavigated', (frame) => {
167
- if (frame === page.mainFrame() && frame.url() !== 'about:blank')
168
- navigations++;
169
- });
170
- page.on('requestfailed', () => { failed++; });
171
- page.on('response', (response) => { if (response.status() >= 400)
172
- failed++; });
173
- const targets = new Set([seed.href]);
174
- const visited = new Set();
175
- let anchorCount = 0;
176
- while (visited.size < targets.size) {
177
- const next = [...targets].filter((url) => !visited.has(url))
178
- .sort((a, b) => Buffer.from(a).compare(Buffer.from(b)))[0];
179
- if (!next || targets.size > MAX_TARGETS)
180
- throw new Error('qa-scan-discovery-scope-too-large');
181
- let response;
182
- try {
183
- response = await page.goto(next, { waitUntil: 'load', timeout: 15_000 });
184
- }
185
- catch {
186
- throw new Error('qa-scan-discovery-target-unavailable');
187
- }
188
- if (!response || response.status() >= 400 || page.url() !== next
189
- || navigations !== visited.size + 1 || denied !== 0 || failed !== 0 || popups !== 0) {
190
- throw new Error('qa-scan-discovery-target-unavailable');
191
- }
192
- const hrefs = await settledRenderedLinks(page);
193
- anchorCount += hrefs.length;
194
- if (anchorCount > 256)
195
- throw new Error('qa-scan-discovery-scope-too-large');
196
- for (const href of hrefs) {
197
- if (typeof href !== 'string' || Buffer.byteLength(href) > MAX_URL_BYTES) {
198
- throw new Error('qa-scan-discovery-scope-too-large');
199
- }
200
- let url;
201
- try {
202
- url = new URL(href);
203
- }
204
- catch {
205
- throw new Error('qa-scan-discovery-target-unavailable');
206
- }
207
- if (url.origin !== seed.origin || url.protocol !== 'http:')
208
- continue;
209
- if (url.username || url.password || url.search || url.hash) {
210
- throw new Error('qa-scan-discovery-target-unavailable');
211
- }
212
- targets.add(url.href);
213
- if (targets.size > MAX_TARGETS)
214
- throw new Error('qa-scan-discovery-scope-too-large');
215
- }
216
- const finalHrefs = await page.locator('a[href]').evaluateAll((anchors) => anchors.map((anchor) => anchor.href));
217
- if (JSON.stringify(finalHrefs) !== JSON.stringify(hrefs)
218
- || page.url() !== next || navigations !== visited.size + 1
219
- || denied !== 0 || failed !== 0 || popups !== 0) {
220
- throw new Error('qa-scan-discovery-scope-unverified');
221
- }
222
- visited.add(next);
223
- }
224
- const targetUrls = [...targets].sort((a, b) => Buffer.from(a).compare(Buffer.from(b)));
225
- if (targetUrls.length < 1 || targetUrls.length > MAX_TARGETS
226
- || visited.size !== targets.size || navigations !== visited.size
227
- || denied !== 0 || failed !== 0 || popups !== 0) {
228
- throw new Error('qa-scan-discovery-scope-unverified');
229
- }
230
- const fresh = planRootQaScan(root, 'discovery', options.seedUrl);
231
- if (backend)
232
- await backend.verify();
233
- if (fresh.planSha256 !== plan.planSha256)
234
- throw new Error('qa-scan-discovery-source-drift');
235
- const body = { schemaVersion: 2, sourceHead: plan.sourceHead,
236
- seedUrl: seed.href, seedSha256: plan.targetSha256,
237
- capturedAt: new Date().toISOString(), targetUrls, pageCount: visited.size };
238
- const discoverySha256 = sha(JSON.stringify(body));
239
- const path = privateRecord(root, 'discovery', discoverySha256);
240
- if (Buffer.byteLength(JSON.stringify({ ...body, discoverySha256 })) + 1 > MAX_RECORD_BYTES) {
241
- throw new Error('qa-scan-discovery-scope-too-large');
242
- }
243
- saveImmutable(path, { ...body, discoverySha256 });
244
- return discoveryReceipt(body, discoverySha256);
245
- }
246
- catch (error) {
247
- if (error instanceof Error && error.message.startsWith('qa-scan-discovery-'))
248
- throw error;
249
- throw new Error('qa-scan-discovery-unverified');
250
- }
251
- finally {
252
- await browser.close().catch(() => undefined);
253
- }
254
- }
255
- function readDiscovery(root, id) {
256
- const value = readImmutable(privateRecord(root, 'discovery', id), MAX_RECORD_BYTES);
257
- if (!exact(value, ['schemaVersion', 'sourceHead', 'seedUrl', 'seedSha256',
258
- 'capturedAt', 'targetUrls', 'pageCount', 'discoverySha256']) || value.schemaVersion !== 2
259
- || value.discoverySha256 !== id || typeof value.seedUrl !== 'string'
260
- || typeof value.sourceHead !== 'string' || typeof value.seedSha256 !== 'string'
261
- || Buffer.byteLength(value.seedUrl) > MAX_URL_BYTES
262
- || !SHA256.test(value.seedSha256) || !Array.isArray(value.targetUrls)
263
- || value.targetUrls.length < 1 || value.targetUrls.length > MAX_TARGETS
264
- || value.pageCount !== value.targetUrls.length
265
- || typeof value.capturedAt !== 'string')
266
- throw new Error('qa-scan-discovery-unverified');
267
- const age = Date.now() - Date.parse(value.capturedAt);
268
- if (!Number.isFinite(age) || new Date(value.capturedAt).toISOString() !== value.capturedAt
269
- || age < -5 * 60_000 || age > MAX_AGE_MS) {
270
- throw new Error('qa-scan-discovery-unverified');
271
- }
272
- const plan = planRootQaScan(root, 'discovery', value.seedUrl);
273
- if (value.sourceHead !== plan.sourceHead || value.seedSha256 !== plan.targetSha256) {
274
- throw new Error('qa-scan-discovery-unverified');
275
- }
276
- const seed = new URL(value.seedUrl);
277
- const urls = value.targetUrls;
278
- if (!urls.every((item) => typeof item === 'string' && Buffer.byteLength(item) <= MAX_URL_BYTES && (() => {
279
- try {
280
- const url = new URL(item);
281
- return url.origin === seed.origin && url.protocol === 'http:'
282
- && !url.username && !url.password && !url.search && !url.hash && url.href === item;
283
- }
284
- catch {
285
- return false;
286
- }
287
- })()) || !urls.includes(seed.href)
288
- || JSON.stringify(urls) !== JSON.stringify([...new Set(urls)].sort((a, b) => Buffer.from(String(a)).compare(Buffer.from(String(b)))))) {
289
- throw new Error('qa-scan-discovery-unverified');
290
- }
291
- const { discoverySha256: _digest, ...body } = value;
292
- if (sha(JSON.stringify(body)) !== id)
293
- throw new Error('qa-scan-discovery-unverified');
294
- return body;
295
- }
296
- export function readRootQaScanDiscovery(projectRoot, id) {
297
- try {
298
- return discoveryReceipt(readDiscovery(resolve(projectRoot), id), id);
299
- }
300
- catch {
301
- throw new Error('qa-scan-discovery-unverified');
302
- }
303
- }
304
- /** Root/worker evidence verification only; reopening validates source and the complete inventory. */
305
- export function readRootQaScanDiscoveryTargets(projectRoot, id) {
306
- try {
307
- return Object.freeze([...readDiscovery(resolve(projectRoot), id).targetUrls]);
308
- }
309
- catch {
310
- throw new Error('qa-scan-discovery-unverified');
311
- }
312
- }
313
- function discoveredPhase(root, id, input) {
314
- if (!exact(input, ['schemaVersion', 'targets']) || input.schemaVersion !== 1
315
- || !Array.isArray(input.targets))
316
- throw new Error('qa-scan-discovery-phase-unverified');
317
- const discovery = readDiscovery(root, id);
318
- const targetUrls = input.targets.map((target) => {
319
- if (!exact(target, ['surface', 'targetUrl']) || typeof target.targetUrl !== 'string') {
320
- throw new Error('qa-scan-discovery-phase-unverified');
321
- }
322
- return target.targetUrl;
323
- }).sort((a, b) => Buffer.from(a).compare(Buffer.from(b)));
324
- if (JSON.stringify(targetUrls) !== JSON.stringify(discovery.targetUrls)) {
325
- throw new Error('qa-scan-discovery-phase-unverified');
326
- }
327
- const aggregate = aggregateRootQaScanReviews(root, input);
328
- if (aggregate.sourceHead !== discovery.sourceHead
329
- || (aggregate.qaAccepted && (aggregate.verdict !== 'approved' || aggregate.issueCount !== 0))
330
- || (!aggregate.qaAccepted && (aggregate.verdict !== 'issues-found' || aggregate.issueCount < 1))) {
331
- throw new Error('qa-scan-discovery-phase-unverified');
332
- }
333
- return Object.freeze({ schemaVersion: 2, kind: 'root-qa-scan-discovered-phase-checkpoint',
334
- sourceHead: discovery.sourceHead, discoverySha256: id,
335
- aggregateSha256: aggregate.aggregateSha256, surfaceCount: aggregate.surfaceCount,
336
- inventoryScope: 'reachable-rendered-same-origin-links', qaAccepted: aggregate.qaAccepted,
337
- workflowContinuationAuthorized: false, localOnly: true, publicSafe: true });
338
- }
339
- export function acceptRootQaScanDiscoveredPhase(projectRoot, id, input) {
340
- try {
341
- const root = resolve(projectRoot);
342
- const receipt = discoveredPhase(root, id, input);
343
- const record = { receipt, checksumSha256: sha(`qa-scan-discovered-phase-v2\0${JSON.stringify(receipt)}`) };
344
- const path = privateRecord(root, 'discovered-phase', sha(`${id}\0${receipt.aggregateSha256}`));
345
- try {
346
- saveImmutable(path, record);
347
- }
348
- catch (error) {
349
- if (error.code !== 'EEXIST')
350
- throw error;
351
- }
352
- if (JSON.stringify(readRootQaScanDiscoveredPhase(root, id, input)) !== JSON.stringify(receipt)) {
353
- throw new Error('qa-scan-discovery-phase-unverified');
354
- }
355
- return receipt;
356
- }
357
- catch {
358
- throw new Error('qa-scan-discovery-phase-unverified');
359
- }
360
- }
361
- export function readRootQaScanDiscoveredPhase(projectRoot, id, input) {
362
- try {
363
- const root = resolve(projectRoot);
364
- const expected = discoveredPhase(root, id, input);
365
- const value = readImmutable(privateRecord(root, 'discovered-phase', sha(`${id}\0${expected.aggregateSha256}`)), 4096);
366
- if (!exact(value, ['receipt', 'checksumSha256'])
367
- || value.checksumSha256 !== sha(`qa-scan-discovered-phase-v2\0${JSON.stringify(value.receipt)}`)
368
- || JSON.stringify(value.receipt) !== JSON.stringify(expected)) {
369
- throw new Error('qa-scan-discovery-phase-unverified');
370
- }
371
- return expected;
372
- }
373
- catch {
374
- throw new Error('qa-scan-discovery-phase-unverified');
375
- }
376
- }
1
+ import{createHash as F}from"node:crypto";import{performance as U}from"node:perf_hooks";import{closeSync as k,constants as S,fstatSync as V,fsyncSync as J,openSync as z,readFileSync as P,writeFileSync as W}from"node:fs";import{dirname as X,join as Y,resolve as E}from"node:path";import{aggregateRootQaScanReviews as G,planRootQaScan as B,rootQaScanEvidenceDirectory as K}from"./qa-scan-review.js";import{routeRootQaScanRequest as Z}from"./qa-scan-browser-route.js";import{launchRootQaBrowser as ee}from"./qa-scan-browser-launch.js";import{launchSyntheticBackendBrowser as re}from"./qa-synthetic-browser.js";import{openSyntheticBackendSession as te}from"./qa-synthetic-backend.js";const T=/^[a-f0-9]{64}$/,R=16,A=1024,C=32768,oe=60*6e4,ae=500,se=2e3,ne=50;function q(r){return F("sha256").update(r).digest("hex")}function ce(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function L(r,t){return ce(r)&&Object.keys(r).sort().join("\0")===[...t].sort().join("\0")}function N(r,t,e){if(!T.test(e))throw new Error("qa-scan-discovery-unverified");return Y(K(r),`${t}-${e}.json`)}function j(r,t){const e=Buffer.from(`${JSON.stringify(t)}
2
+ `),o=z(r,S.O_WRONLY|S.O_CREAT|S.O_EXCL|(S.O_NOFOLLOW??0),384);try{W(o,e),J(o)}finally{k(o)}const n=z(X(r),S.O_RDONLY|(S.O_DIRECTORY??0));try{J(n)}finally{k(n)}}function x(r,t){const e=z(r,S.O_RDONLY|(S.O_NOFOLLOW??0));let o,n;try{const s=V(e);if(!s.isFile()||s.uid!==process.getuid?.()||(s.mode&63)!==0||s.size<1||s.size>t)throw new Error("qa-scan-discovery-unverified");n=s.size,o=P(e)}finally{k(e)}if(o.length!==n||o.length>t)throw new Error("qa-scan-discovery-unverified");const a=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(o));if(!o.equals(Buffer.from(`${JSON.stringify(a)}
3
+ `)))throw new Error("qa-scan-discovery-unverified");return a}function I(r,t){return Object.freeze({schemaVersion:2,kind:"root-qa-scan-link-discovery",sourceHead:r.sourceHead,seedSha256:r.seedSha256,discoverySha256:t,targetCount:r.targetUrls.length,inventoryScope:"reachable-rendered-same-origin-links",qaAccepted:!1,workflowContinuationAuthorized:!1,localOnly:!0,publicSafe:!0})}async function ie(r){let t,e=U.now();const o=e+se;for(;U.now()<=o;){const n=await r.locator("a[href]").evaluateAll(s=>s.map(i=>i.href)),a=JSON.stringify(n);if(a!==t)t=a,e=U.now();else if(U.now()-e>=ae)return n;await r.waitForTimeout(ne)}throw new Error("qa-scan-discovery-scope-unverified")}async function Se(r){if(!r.authorizeDiscovery)throw new Error("qa-scan-discovery-authorization-required");const t=E(r.projectRoot),e=B(t,"discovery",r.seedUrl),o=new URL(r.seedUrl);if(Buffer.byteLength(o.href)>A)throw new Error("qa-scan-discovery-scope-too-large");let n;const a=r.syntheticBackend?await te({projectRoot:t,surface:"discovery",targetUrl:r.seedUrl,...r.syntheticBackend}):void 0;try{n=a?await re():await ee()}catch{throw new Error("qa-scan-discovery-browser-unavailable")}try{const s=await n.newContext({serviceWorkers:"block",acceptDownloads:!1,permissions:[],ignoreHTTPSErrors:!1});let i=0,g=0,u=0,d=0;await s.route("**/*",async c=>{let y=!1;try{const f=c.request(),p=new URL(f.url());y=p.protocol==="http:"&&p.origin===o.origin&&(f.method()==="GET"||f.method()==="HEAD")}catch{}if(a)try{if(!y)throw new Error("denied");const f=c.request(),p=await a.request(f.url(),f.method(),f.postData(),await f.allHeaders());await c.fulfill({status:p.status,body:p.body,headers:{"content-type":p.contentType,"cache-control":"no-store"}})}catch{i++,await c.abort("blockedbyclient").catch(()=>{})}else await Z(c,y,()=>{i++})}),await s.routeWebSocket(/.*/,async c=>{i++,await c.close({code:1008,reason:"blocked"})});const l=await s.newPage();s.on("page",c=>{c!==l&&(d++,c.close())}),l.on("framenavigated",c=>{c===l.mainFrame()&&c.url()!=="about:blank"&&u++}),l.on("requestfailed",()=>{g++}),l.on("response",c=>{c.status()>=400&&g++});const m=new Set([o.href]),v=new Set;let H=0;for(;v.size<m.size;){const c=[...m].filter(w=>!v.has(w)).sort((w,h)=>Buffer.from(w).compare(Buffer.from(h)))[0];if(!c||m.size>R)throw new Error("qa-scan-discovery-scope-too-large");let y;try{y=await l.goto(c,{waitUntil:"load",timeout:15e3})}catch{throw new Error("qa-scan-discovery-target-unavailable")}if(!y||y.status()>=400||l.url()!==c||u!==v.size+1||i!==0||g!==0||d!==0)throw new Error("qa-scan-discovery-target-unavailable");const f=await ie(l);if(H+=f.length,H>256)throw new Error("qa-scan-discovery-scope-too-large");for(const w of f){if(typeof w!="string"||Buffer.byteLength(w)>A)throw new Error("qa-scan-discovery-scope-too-large");let h;try{h=new URL(w)}catch{throw new Error("qa-scan-discovery-target-unavailable")}if(!(h.origin!==o.origin||h.protocol!=="http:")){if(h.username||h.password||h.search||h.hash)throw new Error("qa-scan-discovery-target-unavailable");if(m.add(h.href),m.size>R)throw new Error("qa-scan-discovery-scope-too-large")}}const p=await l.locator("a[href]").evaluateAll(w=>w.map(h=>h.href));if(JSON.stringify(p)!==JSON.stringify(f)||l.url()!==c||u!==v.size+1||i!==0||g!==0||d!==0)throw new Error("qa-scan-discovery-scope-unverified");v.add(c)}const _=[...m].sort((c,y)=>Buffer.from(c).compare(Buffer.from(y)));if(_.length<1||_.length>R||v.size!==m.size||u!==v.size||i!==0||g!==0||d!==0)throw new Error("qa-scan-discovery-scope-unverified");const $=B(t,"discovery",r.seedUrl);if(a&&await a.verify(),$.planSha256!==e.planSha256)throw new Error("qa-scan-discovery-source-drift");const O={schemaVersion:2,sourceHead:e.sourceHead,seedUrl:o.href,seedSha256:e.targetSha256,capturedAt:new Date().toISOString(),targetUrls:_,pageCount:v.size},b=q(JSON.stringify(O)),M=N(t,"discovery",b);if(Buffer.byteLength(JSON.stringify({...O,discoverySha256:b}))+1>C)throw new Error("qa-scan-discovery-scope-too-large");return j(M,{...O,discoverySha256:b}),I(O,b)}catch(s){throw s instanceof Error&&s.message.startsWith("qa-scan-discovery-")?s:new Error("qa-scan-discovery-unverified")}finally{await n.close().catch(()=>{})}}function D(r,t){const e=x(N(r,"discovery",t),C);if(!L(e,["schemaVersion","sourceHead","seedUrl","seedSha256","capturedAt","targetUrls","pageCount","discoverySha256"])||e.schemaVersion!==2||e.discoverySha256!==t||typeof e.seedUrl!="string"||typeof e.sourceHead!="string"||typeof e.seedSha256!="string"||Buffer.byteLength(e.seedUrl)>A||!T.test(e.seedSha256)||!Array.isArray(e.targetUrls)||e.targetUrls.length<1||e.targetUrls.length>R||e.pageCount!==e.targetUrls.length||typeof e.capturedAt!="string")throw new Error("qa-scan-discovery-unverified");const o=Date.now()-Date.parse(e.capturedAt);if(!Number.isFinite(o)||new Date(e.capturedAt).toISOString()!==e.capturedAt||o<-5*6e4||o>oe)throw new Error("qa-scan-discovery-unverified");const n=B(r,"discovery",e.seedUrl);if(e.sourceHead!==n.sourceHead||e.seedSha256!==n.targetSha256)throw new Error("qa-scan-discovery-unverified");const a=new URL(e.seedUrl),s=e.targetUrls;if(!s.every(u=>typeof u=="string"&&Buffer.byteLength(u)<=A&&(()=>{try{const d=new URL(u);return d.origin===a.origin&&d.protocol==="http:"&&!d.username&&!d.password&&!d.search&&!d.hash&&d.href===u}catch{return!1}})())||!s.includes(a.href)||JSON.stringify(s)!==JSON.stringify([...new Set(s)].sort((u,d)=>Buffer.from(String(u)).compare(Buffer.from(String(d))))))throw new Error("qa-scan-discovery-unverified");const{discoverySha256:i,...g}=e;if(q(JSON.stringify(g))!==t)throw new Error("qa-scan-discovery-unverified");return g}function me(r,t){try{return I(D(E(r),t),t)}catch{throw new Error("qa-scan-discovery-unverified")}}function qe(r,t){try{return Object.freeze([...D(E(r),t).targetUrls])}catch{throw new Error("qa-scan-discovery-unverified")}}function Q(r,t,e){if(!L(e,["schemaVersion","targets"])||e.schemaVersion!==1||!Array.isArray(e.targets))throw new Error("qa-scan-discovery-phase-unverified");const o=D(r,t),n=e.targets.map(s=>{if(!L(s,["surface","targetUrl"])||typeof s.targetUrl!="string")throw new Error("qa-scan-discovery-phase-unverified");return s.targetUrl}).sort((s,i)=>Buffer.from(s).compare(Buffer.from(i)));if(JSON.stringify(n)!==JSON.stringify(o.targetUrls))throw new Error("qa-scan-discovery-phase-unverified");const a=G(r,e);if(a.sourceHead!==o.sourceHead||a.qaAccepted&&(a.verdict!=="approved"||a.issueCount!==0)||!a.qaAccepted&&(a.verdict!=="issues-found"||a.issueCount<1))throw new Error("qa-scan-discovery-phase-unverified");return Object.freeze({schemaVersion:2,kind:"root-qa-scan-discovered-phase-checkpoint",sourceHead:o.sourceHead,discoverySha256:t,aggregateSha256:a.aggregateSha256,surfaceCount:a.surfaceCount,inventoryScope:"reachable-rendered-same-origin-links",qaAccepted:a.qaAccepted,workflowContinuationAuthorized:!1,localOnly:!0,publicSafe:!0})}function Ee(r,t,e){try{const o=E(r),n=Q(o,t,e),a={receipt:n,checksumSha256:q(`qa-scan-discovered-phase-v2\0${JSON.stringify(n)}`)},s=N(o,"discovered-phase",q(`${t}\0${n.aggregateSha256}`));try{j(s,a)}catch(i){if(i.code!=="EEXIST")throw i}if(JSON.stringify(de(o,t,e))!==JSON.stringify(n))throw new Error("qa-scan-discovery-phase-unverified");return n}catch{throw new Error("qa-scan-discovery-phase-unverified")}}function de(r,t,e){try{const o=E(r),n=Q(o,t,e),a=x(N(o,"discovered-phase",q(`${t}\0${n.aggregateSha256}`)),4096);if(!L(a,["receipt","checksumSha256"])||a.checksumSha256!==q(`qa-scan-discovered-phase-v2\0${JSON.stringify(a.receipt)}`)||JSON.stringify(a.receipt)!==JSON.stringify(n))throw new Error("qa-scan-discovery-phase-unverified");return n}catch{throw new Error("qa-scan-discovery-phase-unverified")}}export{Ee as acceptRootQaScanDiscoveredPhase,Se as discoverRootQaScanLinks,de as readRootQaScanDiscoveredPhase,me as readRootQaScanDiscovery,qe as readRootQaScanDiscoveryTargets};