@gate-forge/pack-playwright 0.1.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 (140) hide show
  1. package/LICENSE +202 -0
  2. package/bin/gateforge-witness.js +40 -0
  3. package/dist/attestation/proxy.d.ts +40 -0
  4. package/dist/attestation/proxy.d.ts.map +1 -0
  5. package/dist/attestation/proxy.js +78 -0
  6. package/dist/attestation/proxy.js.map +1 -0
  7. package/dist/constants.d.ts +130 -0
  8. package/dist/constants.d.ts.map +1 -0
  9. package/dist/constants.js +138 -0
  10. package/dist/constants.js.map +1 -0
  11. package/dist/discovery/adapters.d.ts +167 -0
  12. package/dist/discovery/adapters.d.ts.map +1 -0
  13. package/dist/discovery/adapters.js +276 -0
  14. package/dist/discovery/adapters.js.map +1 -0
  15. package/dist/discovery/discover.d.ts +57 -0
  16. package/dist/discovery/discover.d.ts.map +1 -0
  17. package/dist/discovery/discover.js +544 -0
  18. package/dist/discovery/discover.js.map +1 -0
  19. package/dist/discovery/index.d.ts +15 -0
  20. package/dist/discovery/index.d.ts.map +1 -0
  21. package/dist/discovery/index.js +15 -0
  22. package/dist/discovery/index.js.map +1 -0
  23. package/dist/discovery/inference.d.ts +63 -0
  24. package/dist/discovery/inference.d.ts.map +1 -0
  25. package/dist/discovery/inference.js +173 -0
  26. package/dist/discovery/inference.js.map +1 -0
  27. package/dist/discovery/pytest-adapter.d.ts +205 -0
  28. package/dist/discovery/pytest-adapter.d.ts.map +1 -0
  29. package/dist/discovery/pytest-adapter.js +548 -0
  30. package/dist/discovery/pytest-adapter.js.map +1 -0
  31. package/dist/discovery/reconcile.d.ts +106 -0
  32. package/dist/discovery/reconcile.d.ts.map +1 -0
  33. package/dist/discovery/reconcile.js +268 -0
  34. package/dist/discovery/reconcile.js.map +1 -0
  35. package/dist/discovery/runner-env.d.ts +80 -0
  36. package/dist/discovery/runner-env.d.ts.map +1 -0
  37. package/dist/discovery/runner-env.js +139 -0
  38. package/dist/discovery/runner-env.js.map +1 -0
  39. package/dist/discovery/static-discovery.d.ts +121 -0
  40. package/dist/discovery/static-discovery.d.ts.map +1 -0
  41. package/dist/discovery/static-discovery.js +1028 -0
  42. package/dist/discovery/static-discovery.js.map +1 -0
  43. package/dist/discovery/supervised-run.d.ts +110 -0
  44. package/dist/discovery/supervised-run.d.ts.map +1 -0
  45. package/dist/discovery/supervised-run.js +328 -0
  46. package/dist/discovery/supervised-run.js.map +1 -0
  47. package/dist/discovery/trusted-config.d.ts +103 -0
  48. package/dist/discovery/trusted-config.d.ts.map +1 -0
  49. package/dist/discovery/trusted-config.js +117 -0
  50. package/dist/discovery/trusted-config.js.map +1 -0
  51. package/dist/fixture/evidence.d.ts +191 -0
  52. package/dist/fixture/evidence.d.ts.map +1 -0
  53. package/dist/fixture/evidence.js +366 -0
  54. package/dist/fixture/evidence.js.map +1 -0
  55. package/dist/fixture/fixture.d.ts +37 -0
  56. package/dist/fixture/fixture.d.ts.map +1 -0
  57. package/dist/fixture/fixture.js +38 -0
  58. package/dist/fixture/fixture.js.map +1 -0
  59. package/dist/fixture/witness-client.d.ts +164 -0
  60. package/dist/fixture/witness-client.d.ts.map +1 -0
  61. package/dist/fixture/witness-client.js +253 -0
  62. package/dist/fixture/witness-client.js.map +1 -0
  63. package/dist/index.d.ts +64 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +55 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/json.d.ts +16 -0
  68. package/dist/json.d.ts.map +1 -0
  69. package/dist/json.js +21 -0
  70. package/dist/json.js.map +1 -0
  71. package/dist/reporter/ledger.d.ts +105 -0
  72. package/dist/reporter/ledger.d.ts.map +1 -0
  73. package/dist/reporter/ledger.js +197 -0
  74. package/dist/reporter/ledger.js.map +1 -0
  75. package/dist/reporter/reporter.cjs +105 -0
  76. package/dist/reporter/reporter.cjs.map +1 -0
  77. package/dist/reporter/reporter.d.cts +35 -0
  78. package/dist/reporter/reporter.d.cts.map +1 -0
  79. package/dist/reporter/reporter.d.ts +167 -0
  80. package/dist/reporter/reporter.d.ts.map +1 -0
  81. package/dist/reporter/reporter.js +673 -0
  82. package/dist/reporter/reporter.js.map +1 -0
  83. package/dist/setup.d.ts +49 -0
  84. package/dist/setup.d.ts.map +1 -0
  85. package/dist/setup.js +167 -0
  86. package/dist/setup.js.map +1 -0
  87. package/dist/supervisor/client.d.ts +73 -0
  88. package/dist/supervisor/client.d.ts.map +1 -0
  89. package/dist/supervisor/client.js +164 -0
  90. package/dist/supervisor/client.js.map +1 -0
  91. package/dist/supervisor/drain.d.ts +45 -0
  92. package/dist/supervisor/drain.d.ts.map +1 -0
  93. package/dist/supervisor/drain.js +235 -0
  94. package/dist/supervisor/drain.js.map +1 -0
  95. package/dist/supervisor/index.d.ts +16 -0
  96. package/dist/supervisor/index.d.ts.map +1 -0
  97. package/dist/supervisor/index.js +13 -0
  98. package/dist/supervisor/index.js.map +1 -0
  99. package/dist/supervisor/spool.d.ts +137 -0
  100. package/dist/supervisor/spool.d.ts.map +1 -0
  101. package/dist/supervisor/spool.js +263 -0
  102. package/dist/supervisor/spool.js.map +1 -0
  103. package/dist/surface.d.ts +134 -0
  104. package/dist/surface.d.ts.map +1 -0
  105. package/dist/surface.js +139 -0
  106. package/dist/surface.js.map +1 -0
  107. package/dist/witness/adapter-registry.d.ts +38 -0
  108. package/dist/witness/adapter-registry.d.ts.map +1 -0
  109. package/dist/witness/adapter-registry.js +158 -0
  110. package/dist/witness/adapter-registry.js.map +1 -0
  111. package/dist/witness/bin.d.ts +21 -0
  112. package/dist/witness/bin.d.ts.map +1 -0
  113. package/dist/witness/bin.js +172 -0
  114. package/dist/witness/bin.js.map +1 -0
  115. package/dist/witness/browser.d.ts +173 -0
  116. package/dist/witness/browser.d.ts.map +1 -0
  117. package/dist/witness/browser.js +580 -0
  118. package/dist/witness/browser.js.map +1 -0
  119. package/dist/witness/classifications.d.ts +42 -0
  120. package/dist/witness/classifications.d.ts.map +1 -0
  121. package/dist/witness/classifications.js +87 -0
  122. package/dist/witness/classifications.js.map +1 -0
  123. package/dist/witness/env-attestation.d.ts +98 -0
  124. package/dist/witness/env-attestation.d.ts.map +1 -0
  125. package/dist/witness/env-attestation.js +202 -0
  126. package/dist/witness/env-attestation.js.map +1 -0
  127. package/dist/witness/loopback-pins.d.ts +79 -0
  128. package/dist/witness/loopback-pins.d.ts.map +1 -0
  129. package/dist/witness/loopback-pins.js +244 -0
  130. package/dist/witness/loopback-pins.js.map +1 -0
  131. package/dist/witness/server.d.ts +34 -0
  132. package/dist/witness/server.d.ts.map +1 -0
  133. package/dist/witness/server.js +2539 -0
  134. package/dist/witness/server.js.map +1 -0
  135. package/dist/witness/types.d.ts +643 -0
  136. package/dist/witness/types.d.ts.map +1 -0
  137. package/dist/witness/types.js +2 -0
  138. package/dist/witness/types.js.map +1 -0
  139. package/package.json +64 -0
  140. package/python/gateforge_persistence_intents.py +100 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 UKD
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * `gateforge-witness`: engine-side loopback witness service entry point.
4
+ *
5
+ * Thin ESM wrapper over the compiled `dist/witness/bin.js`. Reads its
6
+ * configuration from CLI flags and the environment (see
7
+ * `gateforge-witness --help` or `dist/witness/bin.js`; env surface
8
+ * GATEFORGE_RUN_ID, GATEFORGE_RUN_TOKEN, GATEFORGE_PROXY_TARGET,
9
+ * GATEFORGE_MOUNT_PATH, GATEFORGE_STATE_DIR, GATEFORGE_ADAPTERS_DIR,
10
+ * GATEFORGE_CLASSIFICATIONS, GATEFORGE_TARGET_BASE_URL,
11
+ * GATEFORGE_TARGET_FINGERPRINT, GATEFORGE_ADAPTER_BASE_URL,
12
+ * GATEFORGE_WITNESS_VERIFIER_KEY), prints the OS-assigned URL to stdout
13
+ * (`GATEFORGE_WITNESS_URL=http://…`, plus
14
+ * `GATEFORGE_WITNESS_PROXY_URL=http://…` when an observation proxy is
15
+ * active), and serves until SIGTERM/SIGINT.
16
+ */
17
+ import { main as startWitness } from '../dist/witness/bin.js';
18
+
19
+ const handle = await startWitness(process.argv.slice(2), process.env);
20
+ if (handle.url !== '') {
21
+ process.stdout.write(`GATEFORGE_WITNESS_URL=${handle.url}\n`);
22
+ if (handle.proxyUrl !== null) {
23
+ process.stdout.write(`GATEFORGE_WITNESS_PROXY_URL=${handle.proxyUrl}\n`);
24
+ }
25
+ }
26
+
27
+ let shuttingDown = false;
28
+ async function shutdown(signal) {
29
+ if (shuttingDown) return;
30
+ shuttingDown = true;
31
+ try {
32
+ await handle.stop();
33
+ } finally {
34
+ process.exit(0);
35
+ }
36
+ void signal;
37
+ }
38
+ for (const signal of ['SIGTERM', 'SIGINT']) {
39
+ process.on(signal, () => void shutdown(signal));
40
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Loopback attestation proxy (GF-13 minimal v1, plan invariant 5).
3
+ *
4
+ * A bare disposable app can't positively prove it is disposable. The
5
+ * proxy fronts a loopback app and stamps EVERY response with the
6
+ * environment markers the witness requires:
7
+ *
8
+ * - `x-gateforge-env-fingerprint: <fingerprint>` — the run's attested
9
+ * environment identity (the witness compares adapter reads against
10
+ * it; GF-13).
11
+ * - `x-gateforge-attestation-scope: loopback` — the scope the marker
12
+ * attests (observability; the witness's identity check is the marker).
13
+ *
14
+ * This mirrors the Ryuk label pattern (docs/research/environment_
15
+ * attestation.md §3.1): the signal is created by the same actor that
16
+ * later relies on it — the gateforge runner stamps the environment it
17
+ * created. For real deployments the SUT itself (or its middleware/
18
+ * container labels) presents the same marker.
19
+ */
20
+ import { type IncomingMessage, type Server, type ServerResponse } from 'node:http';
21
+ /** Handle for a running attestation proxy. */
22
+ export interface AttestationProxyHandle {
23
+ /** The proxy's loopback base URL (use this as app/adapter base). */
24
+ url: string;
25
+ stop: () => Promise<void>;
26
+ }
27
+ /**
28
+ * Starts the attestation proxy in front of `targetBaseUrl`.
29
+ *
30
+ * Args:
31
+ * targetBaseUrl: absolute URL of the loopback app to front.
32
+ * fingerprint: marker value to stamp on every response.
33
+ * scope: attestation-scope marker (default 'loopback').
34
+ *
35
+ * Returns:
36
+ * AttestationProxyHandle: {url, stop} once listening.
37
+ */
38
+ export declare function startAttestationProxy(targetBaseUrl: string, fingerprint: string, scope?: string): Promise<AttestationProxyHandle>;
39
+ export type { Server, IncomingMessage, ServerResponse };
40
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/attestation/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAwC,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAIzH,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,KAAK,SAAa,GACjB,OAAO,CAAC,sBAAsB,CAAC,CAgDjC;AAED,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Loopback attestation proxy (GF-13 minimal v1, plan invariant 5).
3
+ *
4
+ * A bare disposable app can't positively prove it is disposable. The
5
+ * proxy fronts a loopback app and stamps EVERY response with the
6
+ * environment markers the witness requires:
7
+ *
8
+ * - `x-gateforge-env-fingerprint: <fingerprint>` — the run's attested
9
+ * environment identity (the witness compares adapter reads against
10
+ * it; GF-13).
11
+ * - `x-gateforge-attestation-scope: loopback` — the scope the marker
12
+ * attests (observability; the witness's identity check is the marker).
13
+ *
14
+ * This mirrors the Ryuk label pattern (docs/research/environment_
15
+ * attestation.md §3.1): the signal is created by the same actor that
16
+ * later relies on it — the gateforge runner stamps the environment it
17
+ * created. For real deployments the SUT itself (or its middleware/
18
+ * container labels) presents the same marker.
19
+ */
20
+ import { createServer, request as httpRequest } from 'node:http';
21
+ import { LOOPBACK_HOSTNAME } from '../constants.js';
22
+ import { ENV_FINGERPRINT_HEADER, ATTESTATION_SCOPE_HEADER } from '../constants.js';
23
+ /**
24
+ * Starts the attestation proxy in front of `targetBaseUrl`.
25
+ *
26
+ * Args:
27
+ * targetBaseUrl: absolute URL of the loopback app to front.
28
+ * fingerprint: marker value to stamp on every response.
29
+ * scope: attestation-scope marker (default 'loopback').
30
+ *
31
+ * Returns:
32
+ * AttestationProxyHandle: {url, stop} once listening.
33
+ */
34
+ export function startAttestationProxy(targetBaseUrl, fingerprint, scope = 'loopback') {
35
+ const target = new URL(targetBaseUrl);
36
+ const server = createServer((req, res) => {
37
+ const proxy = httpRequest({
38
+ host: target.hostname,
39
+ port: target.port === '' ? undefined : Number(target.port),
40
+ method: req.method,
41
+ path: req.url,
42
+ headers: { ...req.headers, host: target.host },
43
+ }, (upstream) => {
44
+ res.writeHead(upstream.statusCode ?? 502, {
45
+ ...upstream.headers,
46
+ [ENV_FINGERPRINT_HEADER]: fingerprint,
47
+ [ATTESTATION_SCOPE_HEADER]: scope,
48
+ });
49
+ upstream.pipe(res);
50
+ });
51
+ proxy.on('error', () => {
52
+ res.writeHead(502, { 'content-type': 'text/plain; charset=utf-8' });
53
+ res.end('attestation proxy: upstream unreachable');
54
+ });
55
+ req.pipe(proxy);
56
+ });
57
+ return new Promise((resolveProxy, rejectProxy) => {
58
+ server.once('error', rejectProxy);
59
+ server.listen(0, LOOPBACK_HOSTNAME, () => {
60
+ server.removeAllListeners('error');
61
+ const address = server.address();
62
+ if (address === null || typeof address === 'string') {
63
+ server.close();
64
+ rejectProxy(new Error('attestation proxy failed to bind an OS-assigned port'));
65
+ return;
66
+ }
67
+ const url = `http://${LOOPBACK_HOSTNAME}:${address.port}`;
68
+ const handle = Object.freeze({
69
+ url,
70
+ stop: () => new Promise((resolveClose) => {
71
+ server.close(() => resolveClose());
72
+ }),
73
+ });
74
+ resolveProxy(handle);
75
+ });
76
+ });
77
+ }
78
+ //# sourceMappingURL=proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/attestation/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,OAAO,IAAI,WAAW,EAA0D,MAAM,WAAW,CAAC;AACzH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AASnF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,aAAqB,EACrB,WAAmB,EACnB,KAAK,GAAG,UAAU;IAElB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,WAAW,CACvB;YACE,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YAC1D,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,IAAI,EAAE,GAAG,CAAC,GAAG;YACb,OAAO,EAAE,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;SAC/C,EACD,CAAC,QAAQ,EAAE,EAAE;YACX,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;gBACxC,GAAI,QAAQ,CAAC,O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,EAAE,CAAC,CAAC;gBACrC,CAAC,CAAC;aACL,CAAC,CAAC;YACH,YAAY,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Shared constants of the Playwright evidence pack (pin #7, plan §5.3).
3
+ *
4
+ * These names are the wire contract between the fixture (test process),
5
+ * the reporter (runner process), and the witness service (engine
6
+ * process). They are also the documented env surface of `gateforge
7
+ * test-gates` (packages/cli/README.md "test-gates protocol") — the CLI
8
+ * already exports GATEFORGE_RUN_ID / GATEFORGE_RUN_TOKEN /
9
+ * GATEFORGE_STATE_DIR / GATEFORGE_OBLIGATIONS / GATEFORGE_WITNESS_URL;
10
+ * the pack augments the target/attestation/adapter surface below.
11
+ */
12
+ /** Claim annotation type: `{type: 'gateforge', description: '<obligation id>'}`. */
13
+ export declare const CLAIM_ANNOTATION_TYPE = "gateforge";
14
+ /** Per-run auth header on every witness call (pin #7). */
15
+ export declare const RUN_HEADER = "x-gateforge-run";
16
+ /**
17
+ * Verifier auth header on the witness attestation surface
18
+ * (`GET /ledger-attestation` and the manifest MAC). Carries the
19
+ * verifier key — a secret the orchestrator shares with the witness and
20
+ * the evaluating CLI but NEVER with the tested suite (the suite's run
21
+ * token authorizes evidence submission; it must not authorize
22
+ * attestation, or a hostile suite could certify its own fabrications).
23
+ */
24
+ export declare const VERIFIER_HEADER = "x-gateforge-verifier";
25
+ /** Marker header the SUT (or its attestation proxy) must present. */
26
+ export declare const ENV_FINGERPRINT_HEADER = "x-gateforge-env-fingerprint";
27
+ /** Marker header the SUT (or its attestation proxy) may present. */
28
+ export declare const ATTESTATION_SCOPE_HEADER = "x-gateforge-attestation-scope";
29
+ /** Evidence kinds the witness /records endpoint accepts (plan §5.3). */
30
+ export declare const UI_ACTION_KIND = "ui.action";
31
+ export declare const UI_VISIBLE_RESULT_KIND = "ui.visible-result";
32
+ export declare const PERSISTENCE_KIND = "persistence.entity";
33
+ export declare const KNOWN_RECORD_KINDS: readonly string[];
34
+ /** Persistence kinds are ONLY issued by the witness (engine-side adapter reads). */
35
+ export declare const KNOWN_PERSISTENCE_KINDS: readonly string[];
36
+ /** Env the CLI test-gates suite already receives (documented contract). */
37
+ export declare const ENV_RUN_ID = "GATEFORGE_RUN_ID";
38
+ export declare const ENV_RUN_TOKEN = "GATEFORGE_RUN_TOKEN";
39
+ export declare const ENV_STATE_DIR = "GATEFORGE_STATE_DIR";
40
+ export declare const ENV_OBLIGATIONS = "GATEFORGE_OBLIGATIONS";
41
+ export declare const ENV_WITNESS_URL = "GATEFORGE_WITNESS_URL";
42
+ /** Pack-extended env surface (documented in this package's README). */
43
+ export declare const ENV_APP_BASE_URL = "GATEFORGE_APP_BASE_URL";
44
+ export declare const ENV_TARGET_BASE_URL = "GATEFORGE_TARGET_BASE_URL";
45
+ export declare const ENV_TARGET_FINGERPRINT = "GATEFORGE_TARGET_FINGERPRINT";
46
+ export declare const ENV_ADAPTERS_DIR = "GATEFORGE_ADAPTERS_DIR";
47
+ export declare const ENV_CLASSIFICATIONS = "GATEFORGE_CLASSIFICATIONS";
48
+ export declare const ENV_ADAPTER_BASE_URL = "GATEFORGE_ADAPTER_BASE_URL";
49
+ /** Observation proxy target (loopback base URL the proxy forwards to). */
50
+ export declare const ENV_PROXY_TARGET = "GATEFORGE_PROXY_TARGET";
51
+ /**
52
+ * Observation-proxy mount prefix (e.g. `/api`): the browser-facing path
53
+ * prefix a frontend dev proxy adds before backend routes. The proxy
54
+ * strips it before forwarding and before recording observations, so
55
+ * records match backend-derived obligation identities.
56
+ */
57
+ export declare const ENV_MOUNT_PATH = "GATEFORGE_MOUNT_PATH";
58
+ /**
59
+ * Verifier key for the witness attestation surface. Environment ONLY —
60
+ * never argv (a process's cmdline is world-readable via /proc), and
61
+ * never exported to the tested suite. Same variable the orchestrating
62
+ * CLI reads (`gateforge test-gates`).
63
+ */
64
+ export declare const ENV_WITNESS_VERIFIER_KEY = "GATEFORGE_WITNESS_VERIFIER_KEY";
65
+ /** Opt-in reporter exit-code semantics (standalone runs only). */
66
+ export declare const ENV_REPORTER_FAIL_RUN = "GATEFORGE_REPORTER_FAIL_RUN";
67
+ /**
68
+ * Absolute path of the runner-outcomes document the gateforge reporter
69
+ * writes for trusted runner supervision (plan Phase 4 item 4, ADR 0005
70
+ * D2): per-instance outcomes, attempts, expected failures, and the
71
+ * run-level fixture/teardown outcome. Set by the supervised adapter
72
+ * (`test-gates --changed`); when absent the reporter writes nothing —
73
+ * supervision then fails closed on the missing outcomes file.
74
+ */
75
+ export declare const ENV_OUTCOMES_FILE = "GATEFORGE_OUTCOMES_FILE";
76
+ /**
77
+ * Run-state file (written by the orchestrating CLI) carrying the mapped
78
+ * obligation claims for sidecar/native-mapped tests, keyed by
79
+ * `<file>#<titlePath.join('>')>` (the reconciliation key). The reporter
80
+ * carries these claims on the session-open path (Phase 4 claim
81
+ * injection) so their evidence lands on the right claims; native
82
+ * annotations keep working unchanged.
83
+ */
84
+ export declare const CLAIM_INJECTIONS_FILE = "claim-injections.json";
85
+ /** Run-state file carrying the sealed supervision execution result. */
86
+ export declare const EXECUTION_RESULT_FILE = "execution-result.json";
87
+ /**
88
+ * Run-state spool directory (enforcement-review fix 3): the runner-side
89
+ * reporter writes test lifecycle events (testBegin/testEnd with outcome)
90
+ * as NUL-safe JSON lines under `<stateDir>/spool/<runId>/`; the trusted
91
+ * CLI drains them and performs the witness supervisor calls (session
92
+ * open/close) with credentials that exist ONLY in the CLI process. The
93
+ * runner child holds no supervisor rights.
94
+ */
95
+ export declare const SPOOL_DIR_NAME = "spool";
96
+ /** The spool's event file (JSON lines; consumed by the CLI drain loop). */
97
+ export declare const SPOOL_EVENTS_FILE = "events.jsonl";
98
+ /**
99
+ * The spool's persistence-claim-intent file (JSON lines; same NUL-safe
100
+ * line protocol as `events.jsonl`): the supervised (UNTRUSTED) test
101
+ * process reports claim INTENTS here — {entity, operation, phase, intent,
102
+ * key, claimId, testId, sequence}. The suite can only write intents; it
103
+ * can NEVER stamp evidence. The trusted CLI's spool drain forwards each
104
+ * intent to the witness over the verifier-key supervisor surface, where
105
+ * the resource's adapter SERVER PROBE runs (witness-side) and — only
106
+ * then — a witnessed `persistence.entity` record stamped
107
+ * `channel: 'server'` may be issued.
108
+ */
109
+ export declare const SPOOL_INTENTS_FILE = "persistence-intents.jsonl";
110
+ /**
111
+ * Payload discriminant the witness stamps on server-probed persistence
112
+ * records (core's verdict engine keys the server-witnessed channel off
113
+ * this + {@link SERVER_E2E_TEST_KIND}).
114
+ */
115
+ export declare const SERVER_CHANNEL = "server";
116
+ /** The mapping kind that unlocks the server-witnessed channel. */
117
+ export declare const SERVER_E2E_TEST_KIND = "server-e2e";
118
+ /** Run-state file carrying the authenticated gate receipt. */
119
+ export declare const GATE_RECEIPT_FILE = "receipt.json";
120
+ /** Run-state diagnostics report (plan §3.5; never witness evidence). */
121
+ export declare const DIAGNOSTICS_REPORT_FILE = "diagnostics.json";
122
+ /** Witness file inside the state dir carrying the spawned URL. */
123
+ export declare const WITNESS_URL_FILE = "witness-url.json";
124
+ /** Default per-witness-call timeout (pin #7: 5s). */
125
+ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 5000;
126
+ /** The loopback hostname the witness, proxy, and fixture servers bind. */
127
+ export declare const LOOPBACK_HOSTNAME = "127.0.0.1";
128
+ /** Loopback-equivalent hostnames the witness accepts as attestation subjects. */
129
+ export declare const LOOPBACK_HOSTS: Record<string, true>;
130
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,0DAA0D;AAC1D,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEt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0BAA0B,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,cAAc,WAAW,CAAC;AAEvC,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,qDAAqD;AACrD,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,iFAAiF;AACjF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAK/C,CAAC"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Shared constants of the Playwright evidence pack (pin #7, plan §5.3).
3
+ *
4
+ * These names are the wire contract between the fixture (test process),
5
+ * the reporter (runner process), and the witness service (engine
6
+ * process). They are also the documented env surface of `gateforge
7
+ * test-gates` (packages/cli/README.md "test-gates protocol") — the CLI
8
+ * already exports GATEFORGE_RUN_ID / GATEFORGE_RUN_TOKEN /
9
+ * GATEFORGE_STATE_DIR / GATEFORGE_OBLIGATIONS / GATEFORGE_WITNESS_URL;
10
+ * the pack augments the target/attestation/adapter surface below.
11
+ */
12
+ /** Claim annotation type: `{type: 'gateforge', description: '<obligation id>'}`. */
13
+ export const CLAIM_ANNOTATION_TYPE = 'gateforge';
14
+ /** Per-run auth header on every witness call (pin #7). */
15
+ export const RUN_HEADER = 'x-gateforge-run';
16
+ /**
17
+ * Verifier auth header on the witness attestation surface
18
+ * (`GET /ledger-attestation` and the manifest MAC). Carries the
19
+ * verifier key — a secret the orchestrator shares with the witness and
20
+ * the evaluating CLI but NEVER with the tested suite (the suite's run
21
+ * token authorizes evidence submission; it must not authorize
22
+ * attestation, or a hostile suite could certify its own fabrications).
23
+ */
24
+ export const VERIFIER_HEADER = 'x-gateforge-verifier';
25
+ /** Marker header the SUT (or its attestation proxy) must present. */
26
+ export const ENV_FINGERPRINT_HEADER = 'x-gateforge-env-fingerprint';
27
+ /** Marker header the SUT (or its attestation proxy) may present. */
28
+ export const ATTESTATION_SCOPE_HEADER = 'x-gateforge-attestation-scope';
29
+ /** Evidence kinds the witness /records endpoint accepts (plan §5.3). */
30
+ export const UI_ACTION_KIND = 'ui.action';
31
+ export const UI_VISIBLE_RESULT_KIND = 'ui.visible-result';
32
+ export const PERSISTENCE_KIND = 'persistence.entity';
33
+ export const KNOWN_RECORD_KINDS = [
34
+ UI_ACTION_KIND,
35
+ UI_VISIBLE_RESULT_KIND,
36
+ ];
37
+ /** Persistence kinds are ONLY issued by the witness (engine-side adapter reads). */
38
+ export const KNOWN_PERSISTENCE_KINDS = [PERSISTENCE_KIND];
39
+ /** Env the CLI test-gates suite already receives (documented contract). */
40
+ export const ENV_RUN_ID = 'GATEFORGE_RUN_ID';
41
+ export const ENV_RUN_TOKEN = 'GATEFORGE_RUN_TOKEN';
42
+ export const ENV_STATE_DIR = 'GATEFORGE_STATE_DIR';
43
+ export const ENV_OBLIGATIONS = 'GATEFORGE_OBLIGATIONS';
44
+ export const ENV_WITNESS_URL = 'GATEFORGE_WITNESS_URL';
45
+ /** Pack-extended env surface (documented in this package's README). */
46
+ export const ENV_APP_BASE_URL = 'GATEFORGE_APP_BASE_URL';
47
+ export const ENV_TARGET_BASE_URL = 'GATEFORGE_TARGET_BASE_URL';
48
+ export const ENV_TARGET_FINGERPRINT = 'GATEFORGE_TARGET_FINGERPRINT';
49
+ export const ENV_ADAPTERS_DIR = 'GATEFORGE_ADAPTERS_DIR';
50
+ export const ENV_CLASSIFICATIONS = 'GATEFORGE_CLASSIFICATIONS';
51
+ export const ENV_ADAPTER_BASE_URL = 'GATEFORGE_ADAPTER_BASE_URL';
52
+ /** Observation proxy target (loopback base URL the proxy forwards to). */
53
+ export const ENV_PROXY_TARGET = 'GATEFORGE_PROXY_TARGET';
54
+ /**
55
+ * Observation-proxy mount prefix (e.g. `/api`): the browser-facing path
56
+ * prefix a frontend dev proxy adds before backend routes. The proxy
57
+ * strips it before forwarding and before recording observations, so
58
+ * records match backend-derived obligation identities.
59
+ */
60
+ export const ENV_MOUNT_PATH = 'GATEFORGE_MOUNT_PATH';
61
+ /**
62
+ * Verifier key for the witness attestation surface. Environment ONLY —
63
+ * never argv (a process's cmdline is world-readable via /proc), and
64
+ * never exported to the tested suite. Same variable the orchestrating
65
+ * CLI reads (`gateforge test-gates`).
66
+ */
67
+ export const ENV_WITNESS_VERIFIER_KEY = 'GATEFORGE_WITNESS_VERIFIER_KEY';
68
+ /** Opt-in reporter exit-code semantics (standalone runs only). */
69
+ export const ENV_REPORTER_FAIL_RUN = 'GATEFORGE_REPORTER_FAIL_RUN';
70
+ /**
71
+ * Absolute path of the runner-outcomes document the gateforge reporter
72
+ * writes for trusted runner supervision (plan Phase 4 item 4, ADR 0005
73
+ * D2): per-instance outcomes, attempts, expected failures, and the
74
+ * run-level fixture/teardown outcome. Set by the supervised adapter
75
+ * (`test-gates --changed`); when absent the reporter writes nothing —
76
+ * supervision then fails closed on the missing outcomes file.
77
+ */
78
+ export const ENV_OUTCOMES_FILE = 'GATEFORGE_OUTCOMES_FILE';
79
+ /**
80
+ * Run-state file (written by the orchestrating CLI) carrying the mapped
81
+ * obligation claims for sidecar/native-mapped tests, keyed by
82
+ * `<file>#<titlePath.join('>')>` (the reconciliation key). The reporter
83
+ * carries these claims on the session-open path (Phase 4 claim
84
+ * injection) so their evidence lands on the right claims; native
85
+ * annotations keep working unchanged.
86
+ */
87
+ export const CLAIM_INJECTIONS_FILE = 'claim-injections.json';
88
+ /** Run-state file carrying the sealed supervision execution result. */
89
+ export const EXECUTION_RESULT_FILE = 'execution-result.json';
90
+ /**
91
+ * Run-state spool directory (enforcement-review fix 3): the runner-side
92
+ * reporter writes test lifecycle events (testBegin/testEnd with outcome)
93
+ * as NUL-safe JSON lines under `<stateDir>/spool/<runId>/`; the trusted
94
+ * CLI drains them and performs the witness supervisor calls (session
95
+ * open/close) with credentials that exist ONLY in the CLI process. The
96
+ * runner child holds no supervisor rights.
97
+ */
98
+ export const SPOOL_DIR_NAME = 'spool';
99
+ /** The spool's event file (JSON lines; consumed by the CLI drain loop). */
100
+ export const SPOOL_EVENTS_FILE = 'events.jsonl';
101
+ /**
102
+ * The spool's persistence-claim-intent file (JSON lines; same NUL-safe
103
+ * line protocol as `events.jsonl`): the supervised (UNTRUSTED) test
104
+ * process reports claim INTENTS here — {entity, operation, phase, intent,
105
+ * key, claimId, testId, sequence}. The suite can only write intents; it
106
+ * can NEVER stamp evidence. The trusted CLI's spool drain forwards each
107
+ * intent to the witness over the verifier-key supervisor surface, where
108
+ * the resource's adapter SERVER PROBE runs (witness-side) and — only
109
+ * then — a witnessed `persistence.entity` record stamped
110
+ * `channel: 'server'` may be issued.
111
+ */
112
+ export const SPOOL_INTENTS_FILE = 'persistence-intents.jsonl';
113
+ /**
114
+ * Payload discriminant the witness stamps on server-probed persistence
115
+ * records (core's verdict engine keys the server-witnessed channel off
116
+ * this + {@link SERVER_E2E_TEST_KIND}).
117
+ */
118
+ export const SERVER_CHANNEL = 'server';
119
+ /** The mapping kind that unlocks the server-witnessed channel. */
120
+ export const SERVER_E2E_TEST_KIND = 'server-e2e';
121
+ /** Run-state file carrying the authenticated gate receipt. */
122
+ export const GATE_RECEIPT_FILE = 'receipt.json';
123
+ /** Run-state diagnostics report (plan §3.5; never witness evidence). */
124
+ export const DIAGNOSTICS_REPORT_FILE = 'diagnostics.json';
125
+ /** Witness file inside the state dir carrying the spawned URL. */
126
+ export const WITNESS_URL_FILE = 'witness-url.json';
127
+ /** Default per-witness-call timeout (pin #7: 5s). */
128
+ export const DEFAULT_REQUEST_TIMEOUT_MS = 5000;
129
+ /** The loopback hostname the witness, proxy, and fixture servers bind. */
130
+ export const LOOPBACK_HOSTNAME = '127.0.0.1';
131
+ /** Loopback-equivalent hostnames the witness accepts as attestation subjects. */
132
+ export const LOOPBACK_HOSTS = {
133
+ localhost: true,
134
+ '[::1]': true,
135
+ '::1': true,
136
+ '127.0.0.1': true,
137
+ };
138
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAEtD,qEAAqE;AACrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEpE,oEAAoE;AACpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AAExE,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,cAAc;IACd,sBAAsB;CACvB,CAAC;AACF,oFAAoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAsB,CAAC,gBAAgB,CAAC,CAAC;AAE7E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,q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