@gate-forge/cli 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +91 -704
  2. package/dist/adapter-audit.d.ts +208 -0
  3. package/dist/adapter-audit.d.ts.map +1 -0
  4. package/dist/adapter-audit.js +579 -0
  5. package/dist/adapter-audit.js.map +1 -0
  6. package/dist/adapter-scaffold.d.ts +91 -0
  7. package/dist/adapter-scaffold.d.ts.map +1 -0
  8. package/dist/adapter-scaffold.js +474 -0
  9. package/dist/adapter-scaffold.js.map +1 -0
  10. package/dist/adopted-baseline.d.ts +10 -0
  11. package/dist/adopted-baseline.d.ts.map +1 -1
  12. package/dist/adopted-baseline.js +18 -1
  13. package/dist/adopted-baseline.js.map +1 -1
  14. package/dist/args.d.ts +15 -0
  15. package/dist/args.d.ts.map +1 -1
  16. package/dist/args.js +61 -2
  17. package/dist/args.js.map +1 -1
  18. package/dist/behavior-setup.d.ts +239 -0
  19. package/dist/behavior-setup.d.ts.map +1 -0
  20. package/dist/behavior-setup.js +751 -0
  21. package/dist/behavior-setup.js.map +1 -0
  22. package/dist/broker.d.ts.map +1 -1
  23. package/dist/broker.js +28 -2
  24. package/dist/broker.js.map +1 -1
  25. package/dist/cache-exclusions.d.ts +45 -0
  26. package/dist/cache-exclusions.d.ts.map +1 -0
  27. package/dist/cache-exclusions.js +205 -0
  28. package/dist/cache-exclusions.js.map +1 -0
  29. package/dist/candidate-tree.d.ts +86 -14
  30. package/dist/candidate-tree.d.ts.map +1 -1
  31. package/dist/candidate-tree.js +236 -62
  32. package/dist/candidate-tree.js.map +1 -1
  33. package/dist/ci-witnessed-template.d.ts +43 -0
  34. package/dist/ci-witnessed-template.d.ts.map +1 -0
  35. package/dist/ci-witnessed-template.js +283 -0
  36. package/dist/ci-witnessed-template.js.map +1 -0
  37. package/dist/cli.d.ts +1 -1
  38. package/dist/cli.d.ts.map +1 -1
  39. package/dist/cli.js +31 -4
  40. package/dist/cli.js.map +1 -1
  41. package/dist/commands/adapters.d.ts +15 -0
  42. package/dist/commands/adapters.d.ts.map +1 -0
  43. package/dist/commands/adapters.js +355 -0
  44. package/dist/commands/adapters.js.map +1 -0
  45. package/dist/commands/adopt.d.ts +7 -0
  46. package/dist/commands/adopt.d.ts.map +1 -1
  47. package/dist/commands/adopt.js +44 -2
  48. package/dist/commands/adopt.js.map +1 -1
  49. package/dist/commands/baseline.d.ts.map +1 -1
  50. package/dist/commands/baseline.js +42 -1
  51. package/dist/commands/baseline.js.map +1 -1
  52. package/dist/commands/blocking.d.ts +105 -2
  53. package/dist/commands/blocking.d.ts.map +1 -1
  54. package/dist/commands/blocking.js +395 -53
  55. package/dist/commands/blocking.js.map +1 -1
  56. package/dist/commands/check.d.ts +36 -0
  57. package/dist/commands/check.d.ts.map +1 -1
  58. package/dist/commands/check.js +1068 -64
  59. package/dist/commands/check.js.map +1 -1
  60. package/dist/commands/classify.d.ts +2 -1
  61. package/dist/commands/classify.d.ts.map +1 -1
  62. package/dist/commands/classify.js +188 -5
  63. package/dist/commands/classify.js.map +1 -1
  64. package/dist/commands/enforce.d.ts +4 -4
  65. package/dist/commands/enforce.d.ts.map +1 -1
  66. package/dist/commands/enforce.js +41 -9
  67. package/dist/commands/enforce.js.map +1 -1
  68. package/dist/commands/enforcement.d.ts +13 -1
  69. package/dist/commands/enforcement.d.ts.map +1 -1
  70. package/dist/commands/enforcement.js +880 -33
  71. package/dist/commands/enforcement.js.map +1 -1
  72. package/dist/commands/explain.d.ts +1 -1
  73. package/dist/commands/explain.d.ts.map +1 -1
  74. package/dist/commands/explain.js +162 -3
  75. package/dist/commands/explain.js.map +1 -1
  76. package/dist/commands/history.d.ts +12 -0
  77. package/dist/commands/history.d.ts.map +1 -0
  78. package/dist/commands/history.js +45 -0
  79. package/dist/commands/history.js.map +1 -0
  80. package/dist/commands/init-presets.d.ts +155 -0
  81. package/dist/commands/init-presets.d.ts.map +1 -0
  82. package/dist/commands/init-presets.js +203 -0
  83. package/dist/commands/init-presets.js.map +1 -0
  84. package/dist/commands/init.d.ts +7 -12
  85. package/dist/commands/init.d.ts.map +1 -1
  86. package/dist/commands/init.js +987 -99
  87. package/dist/commands/init.js.map +1 -1
  88. package/dist/commands/keys.d.ts.map +1 -1
  89. package/dist/commands/keys.js +29 -13
  90. package/dist/commands/keys.js.map +1 -1
  91. package/dist/commands/next.d.ts.map +1 -1
  92. package/dist/commands/next.js +846 -19
  93. package/dist/commands/next.js.map +1 -1
  94. package/dist/commands/pre-commit.d.ts +25 -0
  95. package/dist/commands/pre-commit.d.ts.map +1 -1
  96. package/dist/commands/pre-commit.js +91 -6
  97. package/dist/commands/pre-commit.js.map +1 -1
  98. package/dist/commands/quarantine.d.ts +16 -0
  99. package/dist/commands/quarantine.d.ts.map +1 -0
  100. package/dist/commands/quarantine.js +213 -0
  101. package/dist/commands/quarantine.js.map +1 -0
  102. package/dist/commands/run.d.ts +39 -0
  103. package/dist/commands/run.d.ts.map +1 -0
  104. package/dist/commands/run.js +196 -0
  105. package/dist/commands/run.js.map +1 -0
  106. package/dist/commands/test-gates.d.ts +284 -2
  107. package/dist/commands/test-gates.d.ts.map +1 -1
  108. package/dist/commands/test-gates.js +3620 -187
  109. package/dist/commands/test-gates.js.map +1 -1
  110. package/dist/commands/tests.d.ts +1 -1
  111. package/dist/commands/tests.d.ts.map +1 -1
  112. package/dist/commands/tests.js +264 -29
  113. package/dist/commands/tests.js.map +1 -1
  114. package/dist/docs-exclusions.d.ts.map +1 -1
  115. package/dist/docs-exclusions.js +18 -3
  116. package/dist/docs-exclusions.js.map +1 -1
  117. package/dist/endpoint-compiler.d.ts.map +1 -1
  118. package/dist/endpoint-compiler.js +78 -9
  119. package/dist/endpoint-compiler.js.map +1 -1
  120. package/dist/engine-browser.d.ts +183 -0
  121. package/dist/engine-browser.d.ts.map +1 -0
  122. package/dist/engine-browser.js +381 -0
  123. package/dist/engine-browser.js.map +1 -0
  124. package/dist/engine-identity.d.ts +100 -0
  125. package/dist/engine-identity.d.ts.map +1 -0
  126. package/dist/engine-identity.js +182 -0
  127. package/dist/engine-identity.js.map +1 -0
  128. package/dist/evaluate.d.ts +105 -1
  129. package/dist/evaluate.d.ts.map +1 -1
  130. package/dist/evaluate.js +149 -18
  131. package/dist/evaluate.js.map +1 -1
  132. package/dist/execution.d.ts +253 -9
  133. package/dist/execution.d.ts.map +1 -1
  134. package/dist/execution.js +309 -12
  135. package/dist/execution.js.map +1 -1
  136. package/dist/gateforge-owned.d.ts +78 -0
  137. package/dist/gateforge-owned.d.ts.map +1 -0
  138. package/dist/gateforge-owned.js +254 -0
  139. package/dist/gateforge-owned.js.map +1 -0
  140. package/dist/git-hooks.d.ts +35 -0
  141. package/dist/git-hooks.d.ts.map +1 -1
  142. package/dist/git-hooks.js +140 -1
  143. package/dist/git-hooks.js.map +1 -1
  144. package/dist/git-ignored.d.ts +27 -0
  145. package/dist/git-ignored.d.ts.map +1 -0
  146. package/dist/git-ignored.js +102 -0
  147. package/dist/git-ignored.js.map +1 -0
  148. package/dist/git-objects.d.ts +60 -0
  149. package/dist/git-objects.d.ts.map +1 -0
  150. package/dist/git-objects.js +152 -0
  151. package/dist/git-objects.js.map +1 -0
  152. package/dist/glob.d.ts +33 -14
  153. package/dist/glob.d.ts.map +1 -1
  154. package/dist/glob.js +96 -5
  155. package/dist/glob.js.map +1 -1
  156. package/dist/history.d.ts +52 -0
  157. package/dist/history.d.ts.map +1 -0
  158. package/dist/history.js +116 -0
  159. package/dist/history.js.map +1 -0
  160. package/dist/host-load.d.ts +49 -0
  161. package/dist/host-load.d.ts.map +1 -0
  162. package/dist/host-load.js +78 -0
  163. package/dist/host-load.js.map +1 -0
  164. package/dist/index.d.ts +4 -1
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js +2 -1
  167. package/dist/index.js.map +1 -1
  168. package/dist/input-snapshot.d.ts +63 -9
  169. package/dist/input-snapshot.d.ts.map +1 -1
  170. package/dist/input-snapshot.js +195 -17
  171. package/dist/input-snapshot.js.map +1 -1
  172. package/dist/io.d.ts +49 -0
  173. package/dist/io.d.ts.map +1 -1
  174. package/dist/io.js +22 -0
  175. package/dist/io.js.map +1 -1
  176. package/dist/mapping.d.ts +84 -1
  177. package/dist/mapping.d.ts.map +1 -1
  178. package/dist/mapping.js +276 -5
  179. package/dist/mapping.js.map +1 -1
  180. package/dist/native-freeze.d.ts +217 -0
  181. package/dist/native-freeze.d.ts.map +1 -0
  182. package/dist/native-freeze.js +332 -0
  183. package/dist/native-freeze.js.map +1 -0
  184. package/dist/pipeline.d.ts +67 -1
  185. package/dist/pipeline.d.ts.map +1 -1
  186. package/dist/pipeline.js +164 -6
  187. package/dist/pipeline.js.map +1 -1
  188. package/dist/planes-inference.d.ts +12 -5
  189. package/dist/planes-inference.d.ts.map +1 -1
  190. package/dist/planes-inference.js +13 -15
  191. package/dist/planes-inference.js.map +1 -1
  192. package/dist/playwright-browsers.d.ts +210 -0
  193. package/dist/playwright-browsers.d.ts.map +1 -0
  194. package/dist/playwright-browsers.js +364 -0
  195. package/dist/playwright-browsers.js.map +1 -0
  196. package/dist/plugins.d.ts +15 -5
  197. package/dist/plugins.d.ts.map +1 -1
  198. package/dist/plugins.js +59 -9
  199. package/dist/plugins.js.map +1 -1
  200. package/dist/progress.d.ts +148 -0
  201. package/dist/progress.d.ts.map +1 -0
  202. package/dist/progress.js +263 -0
  203. package/dist/progress.js.map +1 -0
  204. package/dist/providers.d.ts +26 -1
  205. package/dist/providers.d.ts.map +1 -1
  206. package/dist/providers.js +39 -0
  207. package/dist/providers.js.map +1 -1
  208. package/dist/receipts.d.ts +1 -0
  209. package/dist/receipts.d.ts.map +1 -1
  210. package/dist/receipts.js +35 -7
  211. package/dist/receipts.js.map +1 -1
  212. package/dist/repo-scan.d.ts +15 -1
  213. package/dist/repo-scan.d.ts.map +1 -1
  214. package/dist/repo-scan.js +329 -34
  215. package/dist/repo-scan.js.map +1 -1
  216. package/dist/reseal-chain.d.ts +184 -0
  217. package/dist/reseal-chain.d.ts.map +1 -0
  218. package/dist/reseal-chain.js +735 -0
  219. package/dist/reseal-chain.js.map +1 -0
  220. package/dist/reseal-evidence.d.ts +241 -0
  221. package/dist/reseal-evidence.d.ts.map +1 -0
  222. package/dist/reseal-evidence.js +319 -0
  223. package/dist/reseal-evidence.js.map +1 -0
  224. package/dist/reseal.d.ts +181 -0
  225. package/dist/reseal.d.ts.map +1 -0
  226. package/dist/reseal.js +1620 -0
  227. package/dist/reseal.js.map +1 -0
  228. package/dist/response-field-guidance.d.ts +82 -0
  229. package/dist/response-field-guidance.d.ts.map +1 -0
  230. package/dist/response-field-guidance.js +184 -0
  231. package/dist/response-field-guidance.js.map +1 -0
  232. package/dist/route-plane-proposals.d.ts +100 -0
  233. package/dist/route-plane-proposals.d.ts.map +1 -0
  234. package/dist/route-plane-proposals.js +213 -0
  235. package/dist/route-plane-proposals.js.map +1 -0
  236. package/dist/run-cache.d.ts +260 -0
  237. package/dist/run-cache.d.ts.map +1 -0
  238. package/dist/run-cache.js +771 -0
  239. package/dist/run-cache.js.map +1 -0
  240. package/dist/run-preflight.d.ts +77 -0
  241. package/dist/run-preflight.d.ts.map +1 -0
  242. package/dist/run-preflight.js +774 -0
  243. package/dist/run-preflight.js.map +1 -0
  244. package/dist/run-recipe.d.ts +107 -0
  245. package/dist/run-recipe.d.ts.map +1 -0
  246. package/dist/run-recipe.js +295 -0
  247. package/dist/run-recipe.js.map +1 -0
  248. package/dist/run-reliability.d.ts +126 -0
  249. package/dist/run-reliability.d.ts.map +1 -0
  250. package/dist/run-reliability.js +221 -0
  251. package/dist/run-reliability.js.map +1 -0
  252. package/dist/runtime.d.ts +15 -0
  253. package/dist/runtime.d.ts.map +1 -1
  254. package/dist/runtime.js +11 -1
  255. package/dist/runtime.js.map +1 -1
  256. package/dist/scope.d.ts +20 -0
  257. package/dist/scope.d.ts.map +1 -1
  258. package/dist/scope.js +26 -5
  259. package/dist/scope.js.map +1 -1
  260. package/dist/secret-guard.d.ts +36 -0
  261. package/dist/secret-guard.d.ts.map +1 -0
  262. package/dist/secret-guard.js +63 -0
  263. package/dist/secret-guard.js.map +1 -0
  264. package/dist/singleton-guidance.d.ts +82 -0
  265. package/dist/singleton-guidance.d.ts.map +1 -0
  266. package/dist/singleton-guidance.js +138 -0
  267. package/dist/singleton-guidance.js.map +1 -0
  268. package/dist/staged-candidate.d.ts +17 -0
  269. package/dist/staged-candidate.d.ts.map +1 -1
  270. package/dist/staged-candidate.js +50 -0
  271. package/dist/staged-candidate.js.map +1 -1
  272. package/dist/state-artifacts.d.ts +70 -0
  273. package/dist/state-artifacts.d.ts.map +1 -0
  274. package/dist/state-artifacts.js +215 -0
  275. package/dist/state-artifacts.js.map +1 -0
  276. package/dist/state.d.ts +170 -2
  277. package/dist/state.d.ts.map +1 -1
  278. package/dist/state.js +248 -8
  279. package/dist/state.js.map +1 -1
  280. package/dist/unmatched-routes.d.ts +60 -0
  281. package/dist/unmatched-routes.d.ts.map +1 -0
  282. package/dist/unmatched-routes.js +131 -0
  283. package/dist/unmatched-routes.js.map +1 -0
  284. package/dist/verifier-keys.d.ts +33 -2
  285. package/dist/verifier-keys.d.ts.map +1 -1
  286. package/dist/verifier-keys.js +95 -9
  287. package/dist/verifier-keys.js.map +1 -1
  288. package/guides/CONNECT-YOUR-PROJECT.md +425 -0
  289. package/guides/QUICKSTART.md +306 -26
  290. package/guides/REFERENCE.md +1710 -0
  291. package/guides/RUNNER-NEUTRAL-EVIDENCE.md +199 -0
  292. package/guides/TEST-ENVIRONMENT.md +1044 -6
  293. package/guides/UPGRADE-0.6-to-0.7.md +3 -3
  294. package/guides/UPGRADE-0.7-to-0.8.md +114 -0
  295. package/guides/UPGRADE-0.8-to-0.9.md +104 -0
  296. package/package.json +10 -9
@@ -0,0 +1,183 @@
1
+ import { type BrowserBuild, type BrowserLaunchProbe } from './playwright-browsers.js';
2
+ /** How the engine's own browser installation was located. */
3
+ export interface EngineBrowserInstall {
4
+ /** Absolute path of the installed engine package's root (realpath). */
5
+ packageRoot: string;
6
+ /** Absolute path of that package's `package.json`. */
7
+ manifest: string;
8
+ /** Absolute path of the pinned `playwright` release's `package.json`. */
9
+ playwrightManifest: string;
10
+ /** The pinned Playwright version, as its manifest states it. */
11
+ playwrightVersion: string;
12
+ /** Absolute path of that release's own install CLI (`cli.js`). */
13
+ installCli: string | null;
14
+ }
15
+ /** Why the engine's browser could not be located. */
16
+ export type EngineBrowserResolution = {
17
+ kind: 'resolved';
18
+ install: EngineBrowserInstall;
19
+ } | {
20
+ kind: 'not-installed';
21
+ } | {
22
+ kind: 'no-pinned-playwright';
23
+ packageRoot: string;
24
+ manifest: string;
25
+ };
26
+ /**
27
+ * Locates the installed engine package and the pinned Playwright release
28
+ * its own browser driver loads.
29
+ *
30
+ * The engine package root is resolved to its REALPATH on purpose: a
31
+ * linked workspace (npm link, a monorepo `file:` install) makes the
32
+ * engine load its sibling `node_modules` beside the real directory, not
33
+ * the consumer's hoisted tree. Reading the link path instead would
34
+ * inspect a release the engine never launches.
35
+ *
36
+ * Args:
37
+ * cwd: repository root.
38
+ *
39
+ * Returns:
40
+ * EngineBrowserResolution: the resolved install, or the honest reason
41
+ * there is none. Never a guess.
42
+ */
43
+ export declare function resolveEngineBrowserInstall(cwd: string): EngineBrowserResolution;
44
+ /** The engine-owned build readiness against the cache the run will read. */
45
+ export interface EngineBrowserReadiness {
46
+ /** The resolved install the facts came from (null when unresolved). */
47
+ install: EngineBrowserInstall | null;
48
+ /** Browser cache path from the operator environment or default cache. */
49
+ browsersPath: string;
50
+ /** Builds the engine-owned launcher opens. */
51
+ required: BrowserBuild[];
52
+ /** The subset installed in the cache. */
53
+ installed: BrowserBuild[];
54
+ /** The subset missing: the engine browser cannot open these. */
55
+ missing: BrowserBuild[];
56
+ /** Installed builds this machine cannot start. */
57
+ unlaunchable: BrowserLaunchProbe[];
58
+ }
59
+ /**
60
+ * Inspects whether the engine-owned Chromium builds are installed in the
61
+ * cache and can start on this machine.
62
+ *
63
+ * Reads `PLAYWRIGHT_BROWSERS_PATH` when configured, otherwise the default
64
+ * browser cache. The supervised witness receives that variable explicitly.
65
+ *
66
+ * Args:
67
+ * install: the resolved engine install.
68
+ * env: operator environment (`PLAYWRIGHT_BROWSERS_PATH`).
69
+ *
70
+ * Returns:
71
+ * EngineBrowserReadiness: required, installed, missing and unlaunchable
72
+ * builds. An empty `required` means the pinned release ships no
73
+ * readable registry — the caller keeps its historical wording rather
74
+ * than inventing revisions.
75
+ */
76
+ export declare function inspectEngineBrowserBuilds(install: EngineBrowserInstall, env?: NodeJS.ProcessEnv): EngineBrowserReadiness;
77
+ /**
78
+ * The install command for the engine's OWN pinned release, by absolute
79
+ * path.
80
+ *
81
+ * `npx playwright install chromium` is wrong here and the operator must
82
+ * not be told it: `npx` resolves the Playwright the command's directory
83
+ * reaches — the CONSUMER's release — so it installs the revision the
84
+ * cache already holds and the engine browser stays exactly as broken.
85
+ * Naming the engine's own resolved `cli.js` installs the release the
86
+ * engine actually launches.
87
+ *
88
+ * Two variables ride along, and both are load-bearing:
89
+ *
90
+ * - `PLAYWRIGHT_BROWSERS_PATH` writes into the cache this inspection
91
+ * actually read, so the operator never ends up with the build in one
92
+ * directory and the run looking in another.
93
+ * - `PLAYWRIGHT_SKIP_BROWSER_GC=1` is not optional. Playwright's
94
+ * installer garbage-collects every build its OWN registry does not
95
+ * list, so without it the engine's `install` DELETES the consumer's
96
+ * Chromium 1234 out of the shared default cache and the remedy trades
97
+ * one broken run for another. This was observed, not assumed: running
98
+ * the command without the guard printed
99
+ * `Removing unused browser at <cache>/chromium-1234` and left the
100
+ * consumer's `runner` line failing.
101
+ *
102
+ * Args:
103
+ * install: the resolved engine install.
104
+ * arguments: the install arguments (browser names).
105
+ * browsersPath: the cache the install must write into.
106
+ *
107
+ * Returns:
108
+ * string: the exact command, or '' when the pinned release ships no
109
+ * install CLI to name.
110
+ */
111
+ export declare function engineInstallCommand(install: EngineBrowserInstall, arguments_: string, browsersPath: string): string;
112
+ /**
113
+ * The `install-deps` command for the engine's own release: the system
114
+ * libraries a bare Linux image lacks.
115
+ *
116
+ * Args:
117
+ * install: the resolved engine install.
118
+ * arguments: the install arguments (browser names).
119
+ *
120
+ * Returns:
121
+ * string: the exact command, or '' when the pinned release ships no
122
+ * install CLI to name.
123
+ */
124
+ export declare function engineInstallDepsCommand(install: EngineBrowserInstall, arguments_: string): string;
125
+ /**
126
+ * The one-line summary for an engine-owned browser that is missing or
127
+ * cannot start, naming the EXACT engine install command.
128
+ *
129
+ * It is deliberately explicit about whose browser it is: the sentence
130
+ * leads with the engine's pinned release, because the consumer's runner
131
+ * line already reported its own builds as installed and the operator
132
+ * would otherwise conclude nothing is wrong.
133
+ *
134
+ * Args:
135
+ * readiness: the engine-owned inspection result.
136
+ *
137
+ * Returns:
138
+ * string: the sentence for the readiness line; '' when nothing was
139
+ * observed, or when the pinned release ships no readable registry.
140
+ */
141
+ export declare function engineBrowserSummary(readiness: EngineBrowserReadiness): string;
142
+ /**
143
+ * Whether the repository requires ENGINE-controlled browser evidence.
144
+ *
145
+ * Two producers exist, and both are explicit — never inferred from
146
+ * "this project has a browser somewhere":
147
+ *
148
+ * - the CONFIGURED RUNNER is `playwright`. Its evidence primitives
149
+ * (`evidence.ui.action`, `evidence.visible.confirm`,
150
+ * `evidence.persistence.verify`) are Playwright-only — they take the
151
+ * suite's own `Page` — and the witness serves every one of them by
152
+ * driving the ENGINE's Chromium through `EngineBrowserManager`. That
153
+ * is the real consumer this check exists for: a witnessed Playwright
154
+ * suite with no behavior policy at all still opens the engine browser
155
+ * the moment it confirms a receipt.
156
+ * - the behavior policy declares a case on the `engine-browser` channel.
157
+ * That channel is runner-neutral, so a pytest / vitest / cypress
158
+ * repository with a surface case needs the engine browser too.
159
+ *
160
+ * Everything else needs nothing: a pytest or API-only repository, a
161
+ * non-playwright repository whose policy drives only `engine-http` /
162
+ * `engine-task`, and a repository with no policy at all are reported as
163
+ * not requiring it. None of them is ever told to install a Chromium it
164
+ * will never launch.
165
+ *
166
+ * A policy that cannot be read or parsed never manufactures a
167
+ * requirement on its own: the `behavior-profile` doctor line already
168
+ * fails such a document closed.
169
+ *
170
+ * Args:
171
+ * cwd: repository root.
172
+ * runner: the configured runner (`playwright`, `pytest`, …).
173
+ * behaviorPolicy: the configured policy path (undefined when unset).
174
+ *
175
+ * Returns:
176
+ * {required, reason}: whether engine-controlled browser evidence is
177
+ * required, and the honest sentence either way.
178
+ */
179
+ export declare function engineBrowserRequirement(cwd: string, runner: string, behaviorPolicy: string | undefined): {
180
+ required: boolean;
181
+ reason: string;
182
+ };
183
+ //# sourceMappingURL=engine-browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-browser.d.ts","sourceRoot":"","sources":["../src/engine-browser.ts"],"names":[],"mappings":"AAiDA,OAAO,EAQL,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAkBlC,6DAA6D;AAC7D,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,qDAAqD;AACrD,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAkB5E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CA8ChF;AAYD,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrC,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,yCAAyC;IACzC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,gEAAgE;IAChE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,kDAAkD;IAClD,YAAY,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,oBAAoB,EAC7B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,sBAAsB,CAwBxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,MAAM,CAMR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGlG;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,sBAAsB,GAAG,MAAM,CAiC9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAyCvC"}
@@ -0,0 +1,381 @@
1
+ /**
2
+ * Engine-owned browser readiness (the engine's OWN Chromium).
3
+ *
4
+ * The consumer's Playwright is not the only browser a supervised run
5
+ * launches. `@gate-forge/pack-playwright` pins its OWN `playwright`
6
+ * dependency, and the engine's browser — the one
7
+ * `EngineBrowserManager` drives for every `engine-browser` channel case,
8
+ * every `ui.action` / `visible.confirm` fixture primitive and every
9
+ * engine surface drive — is that pinned release's Chromium, never the
10
+ * consumer's.
11
+ *
12
+ * A consumer whose Playwright is a DIFFERENT release therefore proves
13
+ * nothing about the engine browser: the consumer's readiness inspection
14
+ * reads the consumer's registry, answers "every pinned build is
15
+ * installed", and the run still dies in the witness with `Executable
16
+ * doesn't exist at .../chromium_headless_shell-<engine-rev>/…`. That is
17
+ * the real consumer this module exists for: `@playwright/test` 1.62.1
18
+ * with Chromium 1234 installed and correct, while the pack's pinned
19
+ * 1.58.2 wants 1208 and the cache never held it. The consumer check said
20
+ * `ok`; the engine check said `Executable doesn't exist`.
21
+ *
22
+ * Two properties this module keeps, both load-bearing:
23
+ *
24
+ * - It NEVER loads the consumer's Playwright. Resolution is a
25
+ * filesystem walk from the INSTALLED engine package (its realpath, so
26
+ * a linked workspace resolves the same release it actually loads at
27
+ * runtime), reading only `package.json` / `browsers.json`. Nothing
28
+ * from the repository is imported into the trusted process.
29
+ * - The remedy is the EXACT installed engine's own CLI, not `npx
30
+ * playwright install`. `npx` resolves whatever Playwright the CWD
31
+ * reaches — the consumer's release — so it installs the very revision
32
+ * the cache already holds and the engine stays broken. The command
33
+ * names the engine's resolved `cli.js` by absolute path instead.
34
+ *
35
+ * The engine's browser requirement is CONSERVATIVE and explicit, and has
36
+ * exactly two producers: the configured runner is `playwright` (its
37
+ * `ui.action` / `visible.confirm` / `persistence.verify` receipts are all
38
+ * served by the engine's own Chromium), or the behavior policy declares a
39
+ * case on the `engine-browser` channel (runner-neutral, so a pytest
40
+ * surface case needs it too). A pytest / API-only repository, and a
41
+ * non-playwright repository whose cases run on `engine-http` /
42
+ * `engine-task`, never need an engine Chromium and are never told to
43
+ * install one.
44
+ */
45
+ import { BehaviorPolicySchema } from '@gate-forge/core';
46
+ import { parse as parseYaml } from 'yaml';
47
+ import { existsSync, readFileSync, realpathSync } from 'node:fs';
48
+ import { dirname, join, resolve } from 'node:path';
49
+ import { fileURLToPath } from 'node:url';
50
+ import { browserDirectoryName, defaultBrowsersPath, findBrowsersRegistry, installArguments, readBrowserBuilds, requiredBuilds, unlaunchableBuilds, } from './playwright-browsers.js';
51
+ /** The behavior-case channel the witness drives through the engine browser. */
52
+ const ENGINE_BROWSER_CHANNEL = 'engine-browser';
53
+ /** The engine package whose pinned Playwright drives the engine browser. */
54
+ const ENGINE_PACKAGE = '@gate-forge/pack-playwright';
55
+ /** Directory levels the engine-package walk covers (npm hoisting depth). */
56
+ const RESOLUTION_DEPTH = 6;
57
+ /**
58
+ * The browsers the engine-owned launcher opens: Chromium, headless
59
+ * (`EngineBrowserManager` launches `{headless: true}`), so its headless
60
+ * shell is required alongside the full build.
61
+ */
62
+ const ENGINE_BROWSERS = ['chromium'];
63
+ /**
64
+ * Walks up from `start` for `node_modules/<name>/package.json`, the same
65
+ * order Node itself resolves a bare specifier through.
66
+ */
67
+ function findInstalledPackageManifest(start, name) {
68
+ let cursor = start;
69
+ for (let depth = 0; depth < RESOLUTION_DEPTH; depth += 1) {
70
+ const candidate = join(cursor, 'node_modules', name, 'package.json');
71
+ if (existsSync(candidate))
72
+ return candidate;
73
+ const parent = resolve(cursor, '..');
74
+ if (parent === cursor)
75
+ break;
76
+ cursor = parent;
77
+ }
78
+ return null;
79
+ }
80
+ /**
81
+ * Locates the installed engine package and the pinned Playwright release
82
+ * its own browser driver loads.
83
+ *
84
+ * The engine package root is resolved to its REALPATH on purpose: a
85
+ * linked workspace (npm link, a monorepo `file:` install) makes the
86
+ * engine load its sibling `node_modules` beside the real directory, not
87
+ * the consumer's hoisted tree. Reading the link path instead would
88
+ * inspect a release the engine never launches.
89
+ *
90
+ * Args:
91
+ * cwd: repository root.
92
+ *
93
+ * Returns:
94
+ * EngineBrowserResolution: the resolved install, or the honest reason
95
+ * there is none. Never a guess.
96
+ */
97
+ export function resolveEngineBrowserInstall(cwd) {
98
+ // The repository first, then the RUNNING engine's own tree: a global
99
+ // or dev-linked CLI has no copy under the repository, and the pack it
100
+ // actually loaded is the one whose pin matters.
101
+ const manifest = findInstalledPackageManifest(resolve(cwd), ENGINE_PACKAGE) ??
102
+ findInstalledPackageManifest(dirname(fileURLToPath(import.meta.url)), ENGINE_PACKAGE);
103
+ if (manifest === null)
104
+ return { kind: 'not-installed' };
105
+ let packageRoot;
106
+ try {
107
+ packageRoot = realpathSync(dirname(manifest));
108
+ }
109
+ catch {
110
+ return { kind: 'not-installed' };
111
+ }
112
+ const pinned = findInstalledPackageManifest(packageRoot, 'playwright');
113
+ if (pinned === null)
114
+ return { kind: 'no-pinned-playwright', packageRoot, manifest };
115
+ // The pin is read from the manifest the engine actually resolves;
116
+ // `realpathSync` again so a linked Playwright is inspected where it
117
+ // lives, matching what `import { chromium } from 'playwright'` loads.
118
+ let playwrightManifest;
119
+ try {
120
+ playwrightManifest = realpathSync(pinned);
121
+ }
122
+ catch {
123
+ return { kind: 'no-pinned-playwright', packageRoot, manifest };
124
+ }
125
+ // A manifest the engine resolves but that states no readable version
126
+ // never invents a revision: the caller keeps its historical wording.
127
+ let version = null;
128
+ try {
129
+ const parsed = JSON.parse(readFileSync(playwrightManifest, 'utf8'));
130
+ if (typeof parsed.version === 'string')
131
+ version = parsed.version;
132
+ }
133
+ catch {
134
+ version = null;
135
+ }
136
+ if (version === null)
137
+ return { kind: 'no-pinned-playwright', packageRoot, manifest };
138
+ const cli = join(dirname(playwrightManifest), 'cli.js');
139
+ return {
140
+ kind: 'resolved',
141
+ install: {
142
+ packageRoot,
143
+ manifest,
144
+ playwrightManifest,
145
+ playwrightVersion: version,
146
+ installCli: existsSync(cli) ? cli : null,
147
+ },
148
+ };
149
+ }
150
+ /** The engine-owned Chromium builds an inspected release pins. */
151
+ function engineRequiredBuilds(playwrightManifest) {
152
+ const registry = findBrowsersRegistry(playwrightManifest);
153
+ if (registry === null)
154
+ return [];
155
+ // The engine browser is always headless Chromium and never reads a
156
+ // consumer Playwright config, so the consumer's `browserName` /
157
+ // `headless: false` scan never applies here.
158
+ return requiredBuilds(readBrowserBuilds(registry), [...ENGINE_BROWSERS], true);
159
+ }
160
+ /**
161
+ * Inspects whether the engine-owned Chromium builds are installed in the
162
+ * cache and can start on this machine.
163
+ *
164
+ * Reads `PLAYWRIGHT_BROWSERS_PATH` when configured, otherwise the default
165
+ * browser cache. The supervised witness receives that variable explicitly.
166
+ *
167
+ * Args:
168
+ * install: the resolved engine install.
169
+ * env: operator environment (`PLAYWRIGHT_BROWSERS_PATH`).
170
+ *
171
+ * Returns:
172
+ * EngineBrowserReadiness: required, installed, missing and unlaunchable
173
+ * builds. An empty `required` means the pinned release ships no
174
+ * readable registry — the caller keeps its historical wording rather
175
+ * than inventing revisions.
176
+ */
177
+ export function inspectEngineBrowserBuilds(install, env = process.env) {
178
+ const browsersPath = defaultBrowsersPath(env);
179
+ const required = engineRequiredBuilds(install.playwrightManifest);
180
+ const installed = [];
181
+ const missing = [];
182
+ for (const build of required) {
183
+ if (existsSync(join(browsersPath, browserDirectoryName(build))))
184
+ installed.push(build);
185
+ else
186
+ missing.push(build);
187
+ }
188
+ const readiness = {
189
+ registry: findBrowsersRegistry(install.playwrightManifest),
190
+ browsersPath,
191
+ required,
192
+ installed,
193
+ missing,
194
+ };
195
+ return {
196
+ install,
197
+ browsersPath,
198
+ required,
199
+ installed,
200
+ missing,
201
+ unlaunchable: unlaunchableBuilds(readiness),
202
+ };
203
+ }
204
+ /**
205
+ * The install command for the engine's OWN pinned release, by absolute
206
+ * path.
207
+ *
208
+ * `npx playwright install chromium` is wrong here and the operator must
209
+ * not be told it: `npx` resolves the Playwright the command's directory
210
+ * reaches — the CONSUMER's release — so it installs the revision the
211
+ * cache already holds and the engine browser stays exactly as broken.
212
+ * Naming the engine's own resolved `cli.js` installs the release the
213
+ * engine actually launches.
214
+ *
215
+ * Two variables ride along, and both are load-bearing:
216
+ *
217
+ * - `PLAYWRIGHT_BROWSERS_PATH` writes into the cache this inspection
218
+ * actually read, so the operator never ends up with the build in one
219
+ * directory and the run looking in another.
220
+ * - `PLAYWRIGHT_SKIP_BROWSER_GC=1` is not optional. Playwright's
221
+ * installer garbage-collects every build its OWN registry does not
222
+ * list, so without it the engine's `install` DELETES the consumer's
223
+ * Chromium 1234 out of the shared default cache and the remedy trades
224
+ * one broken run for another. This was observed, not assumed: running
225
+ * the command without the guard printed
226
+ * `Removing unused browser at <cache>/chromium-1234` and left the
227
+ * consumer's `runner` line failing.
228
+ *
229
+ * Args:
230
+ * install: the resolved engine install.
231
+ * arguments: the install arguments (browser names).
232
+ * browsersPath: the cache the install must write into.
233
+ *
234
+ * Returns:
235
+ * string: the exact command, or '' when the pinned release ships no
236
+ * install CLI to name.
237
+ */
238
+ export function engineInstallCommand(install, arguments_, browsersPath) {
239
+ if (install.installCli === null)
240
+ return '';
241
+ return (`PLAYWRIGHT_BROWSERS_PATH='${browsersPath}' PLAYWRIGHT_SKIP_BROWSER_GC=1 ` +
242
+ `node '${install.installCli}' install ${arguments_}`);
243
+ }
244
+ /**
245
+ * The `install-deps` command for the engine's own release: the system
246
+ * libraries a bare Linux image lacks.
247
+ *
248
+ * Args:
249
+ * install: the resolved engine install.
250
+ * arguments: the install arguments (browser names).
251
+ *
252
+ * Returns:
253
+ * string: the exact command, or '' when the pinned release ships no
254
+ * install CLI to name.
255
+ */
256
+ export function engineInstallDepsCommand(install, arguments_) {
257
+ if (install.installCli === null)
258
+ return '';
259
+ return `node '${install.installCli}' install-deps ${arguments_}`;
260
+ }
261
+ /**
262
+ * The one-line summary for an engine-owned browser that is missing or
263
+ * cannot start, naming the EXACT engine install command.
264
+ *
265
+ * It is deliberately explicit about whose browser it is: the sentence
266
+ * leads with the engine's pinned release, because the consumer's runner
267
+ * line already reported its own builds as installed and the operator
268
+ * would otherwise conclude nothing is wrong.
269
+ *
270
+ * Args:
271
+ * readiness: the engine-owned inspection result.
272
+ *
273
+ * Returns:
274
+ * string: the sentence for the readiness line; '' when nothing was
275
+ * observed, or when the pinned release ships no readable registry.
276
+ */
277
+ export function engineBrowserSummary(readiness) {
278
+ const install = readiness.install;
279
+ if (install === null)
280
+ return '';
281
+ const who = `the engine-owned browser (playwright ${install.playwrightVersion} pinned by ${ENGINE_PACKAGE})`;
282
+ if (readiness.missing.length > 0) {
283
+ const missing = readiness.missing.map((build) => browserDirectoryName(build)).join(', ');
284
+ const command = engineInstallCommand(install, installArguments(readiness.missing), readiness.browsersPath);
285
+ const remedy = command === ''
286
+ ? `install the ${missing} build(s) of playwright ${install.playwrightVersion} into '${readiness.browsersPath}'`
287
+ : `fix: run \`${command}\``;
288
+ return (`${who} is NOT ready: its pinned builds ${missing} are missing from '${readiness.browsersPath}' — ` +
289
+ `your test runner's own Chromium is a different Playwright release and cannot serve it, so every engine-browser ` +
290
+ `case fails with "Executable doesn't exist"; ${remedy}`);
291
+ }
292
+ const launch = readiness.unlaunchable[0];
293
+ if (launch !== undefined) {
294
+ const command = engineInstallDepsCommand(install, installArguments([launch.build]));
295
+ const reason = launch.reason === '' ? '' : `: ${launch.reason}`;
296
+ const remedy = command === '' ? '' : `; fix: run \`${command}\` (needs root or sudo)`;
297
+ return (`${who} is NOT ready: '${launch.directory}' is installed but cannot start on this machine${reason}${remedy}`);
298
+ }
299
+ if (readiness.required.length === 0) {
300
+ return `${who} ships no readable browser registry (nothing to install)`;
301
+ }
302
+ return (`${who} is ready: ${readiness.required.map((build) => browserDirectoryName(build)).join(', ')} ` +
303
+ `installed under '${readiness.browsersPath}'`);
304
+ }
305
+ /**
306
+ * Whether the repository requires ENGINE-controlled browser evidence.
307
+ *
308
+ * Two producers exist, and both are explicit — never inferred from
309
+ * "this project has a browser somewhere":
310
+ *
311
+ * - the CONFIGURED RUNNER is `playwright`. Its evidence primitives
312
+ * (`evidence.ui.action`, `evidence.visible.confirm`,
313
+ * `evidence.persistence.verify`) are Playwright-only — they take the
314
+ * suite's own `Page` — and the witness serves every one of them by
315
+ * driving the ENGINE's Chromium through `EngineBrowserManager`. That
316
+ * is the real consumer this check exists for: a witnessed Playwright
317
+ * suite with no behavior policy at all still opens the engine browser
318
+ * the moment it confirms a receipt.
319
+ * - the behavior policy declares a case on the `engine-browser` channel.
320
+ * That channel is runner-neutral, so a pytest / vitest / cypress
321
+ * repository with a surface case needs the engine browser too.
322
+ *
323
+ * Everything else needs nothing: a pytest or API-only repository, a
324
+ * non-playwright repository whose policy drives only `engine-http` /
325
+ * `engine-task`, and a repository with no policy at all are reported as
326
+ * not requiring it. None of them is ever told to install a Chromium it
327
+ * will never launch.
328
+ *
329
+ * A policy that cannot be read or parsed never manufactures a
330
+ * requirement on its own: the `behavior-profile` doctor line already
331
+ * fails such a document closed.
332
+ *
333
+ * Args:
334
+ * cwd: repository root.
335
+ * runner: the configured runner (`playwright`, `pytest`, …).
336
+ * behaviorPolicy: the configured policy path (undefined when unset).
337
+ *
338
+ * Returns:
339
+ * {required, reason}: whether engine-controlled browser evidence is
340
+ * required, and the honest sentence either way.
341
+ */
342
+ export function engineBrowserRequirement(cwd, runner, behaviorPolicy) {
343
+ const playwrightReason = `the configured runner 'playwright' serves every ui.action / visible.confirm / persistence.verify ` +
344
+ "receipt through the engine's own browser";
345
+ if (behaviorPolicy !== undefined) {
346
+ try {
347
+ const document = BehaviorPolicySchema.safeParse(JSON.parse(JSON.stringify(parseYaml(readFileSync(resolve(cwd, behaviorPolicy), 'utf8')))));
348
+ if (document.success) {
349
+ const cases = [
350
+ ...document.data.endpoints.flatMap((endpoint) => endpoint.cases),
351
+ ...document.data.resources.flatMap((resource) => resource.cases),
352
+ ];
353
+ const declaring = cases.filter((entry) => entry.channel === ENGINE_BROWSER_CHANNEL).length;
354
+ if (declaring > 0) {
355
+ return {
356
+ required: true,
357
+ reason: `${String(declaring)} declared behavior case(s) drive the 'engine-browser' channel`,
358
+ };
359
+ }
360
+ return {
361
+ required: runner === 'playwright',
362
+ reason: runner === 'playwright'
363
+ ? playwrightReason
364
+ : `no declared behavior case drives the 'engine-browser' channel (${String(cases.length)} case(s) declared) and the configured runner '${runner}' proves its cases without an engine browser`,
365
+ };
366
+ }
367
+ }
368
+ catch {
369
+ // Unreadable YAML: fall through to the runner-based answer, which
370
+ // needs no document at all. The behavior-profile check owns that
371
+ // document's own failure.
372
+ }
373
+ }
374
+ return runner === 'playwright'
375
+ ? { required: true, reason: playwrightReason }
376
+ : {
377
+ required: false,
378
+ reason: `the configured runner '${runner}' proves its cases without an engine browser, and no declared case drives the 'engine-browser' channel`,
379
+ };
380
+ }
381
+ //# sourceMappingURL=engine-browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-browser.js","sourceRoot":"","sources":["../src/engine-browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GAInB,MAAM,0BAA0B,CAAC;AAElC,+EAA+E;AAC/E,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEhD,4EAA4E;AAC5E,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD,4EAA4E;AAC5E,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,UAAU,CAAU,CAAC;AAsB9C;;;GAGG;AACH,SAA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