@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.
- package/README.md +91 -704
- package/dist/adapter-audit.d.ts +208 -0
- package/dist/adapter-audit.d.ts.map +1 -0
- package/dist/adapter-audit.js +579 -0
- package/dist/adapter-audit.js.map +1 -0
- package/dist/adapter-scaffold.d.ts +91 -0
- package/dist/adapter-scaffold.d.ts.map +1 -0
- package/dist/adapter-scaffold.js +474 -0
- package/dist/adapter-scaffold.js.map +1 -0
- package/dist/adopted-baseline.d.ts +10 -0
- package/dist/adopted-baseline.d.ts.map +1 -1
- package/dist/adopted-baseline.js +18 -1
- package/dist/adopted-baseline.js.map +1 -1
- package/dist/args.d.ts +15 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +61 -2
- package/dist/args.js.map +1 -1
- package/dist/behavior-setup.d.ts +239 -0
- package/dist/behavior-setup.d.ts.map +1 -0
- package/dist/behavior-setup.js +751 -0
- package/dist/behavior-setup.js.map +1 -0
- package/dist/broker.d.ts.map +1 -1
- package/dist/broker.js +28 -2
- package/dist/broker.js.map +1 -1
- package/dist/cache-exclusions.d.ts +45 -0
- package/dist/cache-exclusions.d.ts.map +1 -0
- package/dist/cache-exclusions.js +205 -0
- package/dist/cache-exclusions.js.map +1 -0
- package/dist/candidate-tree.d.ts +86 -14
- package/dist/candidate-tree.d.ts.map +1 -1
- package/dist/candidate-tree.js +236 -62
- package/dist/candidate-tree.js.map +1 -1
- package/dist/ci-witnessed-template.d.ts +43 -0
- package/dist/ci-witnessed-template.d.ts.map +1 -0
- package/dist/ci-witnessed-template.js +283 -0
- package/dist/ci-witnessed-template.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +31 -4
- package/dist/cli.js.map +1 -1
- package/dist/commands/adapters.d.ts +15 -0
- package/dist/commands/adapters.d.ts.map +1 -0
- package/dist/commands/adapters.js +355 -0
- package/dist/commands/adapters.js.map +1 -0
- package/dist/commands/adopt.d.ts +7 -0
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +44 -2
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/baseline.js +42 -1
- package/dist/commands/baseline.js.map +1 -1
- package/dist/commands/blocking.d.ts +105 -2
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +395 -53
- package/dist/commands/blocking.js.map +1 -1
- package/dist/commands/check.d.ts +36 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +1068 -64
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/classify.d.ts +2 -1
- package/dist/commands/classify.d.ts.map +1 -1
- package/dist/commands/classify.js +188 -5
- package/dist/commands/classify.js.map +1 -1
- package/dist/commands/enforce.d.ts +4 -4
- package/dist/commands/enforce.d.ts.map +1 -1
- package/dist/commands/enforce.js +41 -9
- package/dist/commands/enforce.js.map +1 -1
- package/dist/commands/enforcement.d.ts +13 -1
- package/dist/commands/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +880 -33
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/explain.d.ts +1 -1
- package/dist/commands/explain.d.ts.map +1 -1
- package/dist/commands/explain.js +162 -3
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/history.d.ts +12 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +45 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/init-presets.d.ts +155 -0
- package/dist/commands/init-presets.d.ts.map +1 -0
- package/dist/commands/init-presets.js +203 -0
- package/dist/commands/init-presets.js.map +1 -0
- package/dist/commands/init.d.ts +7 -12
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +987 -99
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.js +29 -13
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/next.d.ts.map +1 -1
- package/dist/commands/next.js +846 -19
- package/dist/commands/next.js.map +1 -1
- package/dist/commands/pre-commit.d.ts +25 -0
- package/dist/commands/pre-commit.d.ts.map +1 -1
- package/dist/commands/pre-commit.js +91 -6
- package/dist/commands/pre-commit.js.map +1 -1
- package/dist/commands/quarantine.d.ts +16 -0
- package/dist/commands/quarantine.d.ts.map +1 -0
- package/dist/commands/quarantine.js +213 -0
- package/dist/commands/quarantine.js.map +1 -0
- package/dist/commands/run.d.ts +39 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +196 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/test-gates.d.ts +284 -2
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +3620 -187
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/commands/tests.d.ts +1 -1
- package/dist/commands/tests.d.ts.map +1 -1
- package/dist/commands/tests.js +264 -29
- package/dist/commands/tests.js.map +1 -1
- package/dist/docs-exclusions.d.ts.map +1 -1
- package/dist/docs-exclusions.js +18 -3
- package/dist/docs-exclusions.js.map +1 -1
- package/dist/endpoint-compiler.d.ts.map +1 -1
- package/dist/endpoint-compiler.js +78 -9
- package/dist/endpoint-compiler.js.map +1 -1
- package/dist/engine-browser.d.ts +183 -0
- package/dist/engine-browser.d.ts.map +1 -0
- package/dist/engine-browser.js +381 -0
- package/dist/engine-browser.js.map +1 -0
- package/dist/engine-identity.d.ts +100 -0
- package/dist/engine-identity.d.ts.map +1 -0
- package/dist/engine-identity.js +182 -0
- package/dist/engine-identity.js.map +1 -0
- package/dist/evaluate.d.ts +105 -1
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +149 -18
- package/dist/evaluate.js.map +1 -1
- package/dist/execution.d.ts +253 -9
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +309 -12
- package/dist/execution.js.map +1 -1
- package/dist/gateforge-owned.d.ts +78 -0
- package/dist/gateforge-owned.d.ts.map +1 -0
- package/dist/gateforge-owned.js +254 -0
- package/dist/gateforge-owned.js.map +1 -0
- package/dist/git-hooks.d.ts +35 -0
- package/dist/git-hooks.d.ts.map +1 -1
- package/dist/git-hooks.js +140 -1
- package/dist/git-hooks.js.map +1 -1
- package/dist/git-ignored.d.ts +27 -0
- package/dist/git-ignored.d.ts.map +1 -0
- package/dist/git-ignored.js +102 -0
- package/dist/git-ignored.js.map +1 -0
- package/dist/git-objects.d.ts +60 -0
- package/dist/git-objects.d.ts.map +1 -0
- package/dist/git-objects.js +152 -0
- package/dist/git-objects.js.map +1 -0
- package/dist/glob.d.ts +33 -14
- package/dist/glob.d.ts.map +1 -1
- package/dist/glob.js +96 -5
- package/dist/glob.js.map +1 -1
- package/dist/history.d.ts +52 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +116 -0
- package/dist/history.js.map +1 -0
- package/dist/host-load.d.ts +49 -0
- package/dist/host-load.d.ts.map +1 -0
- package/dist/host-load.js +78 -0
- package/dist/host-load.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/input-snapshot.d.ts +63 -9
- package/dist/input-snapshot.d.ts.map +1 -1
- package/dist/input-snapshot.js +195 -17
- package/dist/input-snapshot.js.map +1 -1
- package/dist/io.d.ts +49 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +22 -0
- package/dist/io.js.map +1 -1
- package/dist/mapping.d.ts +84 -1
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +276 -5
- package/dist/mapping.js.map +1 -1
- package/dist/native-freeze.d.ts +217 -0
- package/dist/native-freeze.d.ts.map +1 -0
- package/dist/native-freeze.js +332 -0
- package/dist/native-freeze.js.map +1 -0
- package/dist/pipeline.d.ts +67 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +164 -6
- package/dist/pipeline.js.map +1 -1
- package/dist/planes-inference.d.ts +12 -5
- package/dist/planes-inference.d.ts.map +1 -1
- package/dist/planes-inference.js +13 -15
- package/dist/planes-inference.js.map +1 -1
- package/dist/playwright-browsers.d.ts +210 -0
- package/dist/playwright-browsers.d.ts.map +1 -0
- package/dist/playwright-browsers.js +364 -0
- package/dist/playwright-browsers.js.map +1 -0
- package/dist/plugins.d.ts +15 -5
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +59 -9
- package/dist/plugins.js.map +1 -1
- package/dist/progress.d.ts +148 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +263 -0
- package/dist/progress.js.map +1 -0
- package/dist/providers.d.ts +26 -1
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +39 -0
- package/dist/providers.js.map +1 -1
- package/dist/receipts.d.ts +1 -0
- package/dist/receipts.d.ts.map +1 -1
- package/dist/receipts.js +35 -7
- package/dist/receipts.js.map +1 -1
- package/dist/repo-scan.d.ts +15 -1
- package/dist/repo-scan.d.ts.map +1 -1
- package/dist/repo-scan.js +329 -34
- package/dist/repo-scan.js.map +1 -1
- package/dist/reseal-chain.d.ts +184 -0
- package/dist/reseal-chain.d.ts.map +1 -0
- package/dist/reseal-chain.js +735 -0
- package/dist/reseal-chain.js.map +1 -0
- package/dist/reseal-evidence.d.ts +241 -0
- package/dist/reseal-evidence.d.ts.map +1 -0
- package/dist/reseal-evidence.js +319 -0
- package/dist/reseal-evidence.js.map +1 -0
- package/dist/reseal.d.ts +181 -0
- package/dist/reseal.d.ts.map +1 -0
- package/dist/reseal.js +1620 -0
- package/dist/reseal.js.map +1 -0
- package/dist/response-field-guidance.d.ts +82 -0
- package/dist/response-field-guidance.d.ts.map +1 -0
- package/dist/response-field-guidance.js +184 -0
- package/dist/response-field-guidance.js.map +1 -0
- package/dist/route-plane-proposals.d.ts +100 -0
- package/dist/route-plane-proposals.d.ts.map +1 -0
- package/dist/route-plane-proposals.js +213 -0
- package/dist/route-plane-proposals.js.map +1 -0
- package/dist/run-cache.d.ts +260 -0
- package/dist/run-cache.d.ts.map +1 -0
- package/dist/run-cache.js +771 -0
- package/dist/run-cache.js.map +1 -0
- package/dist/run-preflight.d.ts +77 -0
- package/dist/run-preflight.d.ts.map +1 -0
- package/dist/run-preflight.js +774 -0
- package/dist/run-preflight.js.map +1 -0
- package/dist/run-recipe.d.ts +107 -0
- package/dist/run-recipe.d.ts.map +1 -0
- package/dist/run-recipe.js +295 -0
- package/dist/run-recipe.js.map +1 -0
- package/dist/run-reliability.d.ts +126 -0
- package/dist/run-reliability.d.ts.map +1 -0
- package/dist/run-reliability.js +221 -0
- package/dist/run-reliability.js.map +1 -0
- package/dist/runtime.d.ts +15 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +11 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scope.d.ts +20 -0
- package/dist/scope.d.ts.map +1 -1
- package/dist/scope.js +26 -5
- package/dist/scope.js.map +1 -1
- package/dist/secret-guard.d.ts +36 -0
- package/dist/secret-guard.d.ts.map +1 -0
- package/dist/secret-guard.js +63 -0
- package/dist/secret-guard.js.map +1 -0
- package/dist/singleton-guidance.d.ts +82 -0
- package/dist/singleton-guidance.d.ts.map +1 -0
- package/dist/singleton-guidance.js +138 -0
- package/dist/singleton-guidance.js.map +1 -0
- package/dist/staged-candidate.d.ts +17 -0
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +50 -0
- package/dist/staged-candidate.js.map +1 -1
- package/dist/state-artifacts.d.ts +70 -0
- package/dist/state-artifacts.d.ts.map +1 -0
- package/dist/state-artifacts.js +215 -0
- package/dist/state-artifacts.js.map +1 -0
- package/dist/state.d.ts +170 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +248 -8
- package/dist/state.js.map +1 -1
- package/dist/unmatched-routes.d.ts +60 -0
- package/dist/unmatched-routes.d.ts.map +1 -0
- package/dist/unmatched-routes.js +131 -0
- package/dist/unmatched-routes.js.map +1 -0
- package/dist/verifier-keys.d.ts +33 -2
- package/dist/verifier-keys.d.ts.map +1 -1
- package/dist/verifier-keys.js +95 -9
- package/dist/verifier-keys.js.map +1 -1
- package/guides/CONNECT-YOUR-PROJECT.md +425 -0
- package/guides/QUICKSTART.md +306 -26
- package/guides/REFERENCE.md +1710 -0
- package/guides/RUNNER-NEUTRAL-EVIDENCE.md +199 -0
- package/guides/TEST-ENVIRONMENT.md +1044 -6
- package/guides/UPGRADE-0.6-to-0.7.md +3 -3
- package/guides/UPGRADE-0.7-to-0.8.md +114 -0
- package/guides/UPGRADE-0.8-to-0.9.md +104 -0
- package/package.json +10 -9
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** Public identity of the engine installation that produced a report. */
|
|
2
|
+
export interface EngineIdentity {
|
|
3
|
+
/** Package version. */
|
|
4
|
+
version: string;
|
|
5
|
+
/** Registry package or the local package path. */
|
|
6
|
+
source: string;
|
|
7
|
+
/** True when CI will not install the local workspace code automatically. */
|
|
8
|
+
unpublished: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* How the installed engine reached `node_modules`, as far as npm's own
|
|
12
|
+
* install metadata can prove it.
|
|
13
|
+
*
|
|
14
|
+
* - `registry`: the hidden lockfile resolves the package to a registry URL.
|
|
15
|
+
* - `file`: a tarball/directory (`file:`) specifier — an install npm
|
|
16
|
+
* performed from bytes on disk, which a CI `npm install
|
|
17
|
+
* @gate-forge/cli@<version>` would NOT reproduce.
|
|
18
|
+
* - `local-path`: a checkout used directly (no `node_modules` install).
|
|
19
|
+
* - `unknown`: installed, but no install metadata is readable (a package
|
|
20
|
+
* manager that writes no hidden lockfile, a pruned install).
|
|
21
|
+
*/
|
|
22
|
+
export type EngineInstallKind = 'registry' | 'file' | 'local-path' | 'unknown';
|
|
23
|
+
/** Provenance of the installed engine, with the specifier that proves it. */
|
|
24
|
+
export interface EngineInstallProvenance {
|
|
25
|
+
kind: EngineInstallKind;
|
|
26
|
+
specifier: string | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Reads npm's install metadata for the installed engine package.
|
|
30
|
+
*
|
|
31
|
+
* Two sources, in npm's own order of reliability: the hidden
|
|
32
|
+
* `node_modules/.package-lock.json` of the OWNING `node_modules`
|
|
33
|
+
* directory (the one whose key path is this package), then the legacy
|
|
34
|
+
* `_resolved`/`_from` keys npm writes into the installed manifest. No
|
|
35
|
+
* metadata means `unknown`, never an assumed registry.
|
|
36
|
+
*
|
|
37
|
+
* Args:
|
|
38
|
+
* packageRoot: absolute path of the installed `@gate-forge/cli`.
|
|
39
|
+
*
|
|
40
|
+
* Returns:
|
|
41
|
+
* EngineInstallProvenance: the install kind and the proving specifier.
|
|
42
|
+
*/
|
|
43
|
+
export declare function engineInstallProvenance(packageRoot: string | null): EngineInstallProvenance;
|
|
44
|
+
/**
|
|
45
|
+
* Formats the doctor's one engine line, adding ONLY what the install
|
|
46
|
+
* metadata can prove. The receipt's `engine.source` is receipt-bound
|
|
47
|
+
* (a receipt is only valid for the engine that sealed it), so its
|
|
48
|
+
* meaning is unchanged; this is the human-readable line.
|
|
49
|
+
*
|
|
50
|
+
* Args:
|
|
51
|
+
* identity: the receipt-bound engine identity.
|
|
52
|
+
* provenance: the install provenance read from npm's metadata.
|
|
53
|
+
*
|
|
54
|
+
* Returns:
|
|
55
|
+
* string: the printed line.
|
|
56
|
+
*/
|
|
57
|
+
export declare function engineSourceLine(identity: EngineIdentity, provenance: EngineInstallProvenance): string;
|
|
58
|
+
/**
|
|
59
|
+
* Locates the installed engine's package root by walking up from this
|
|
60
|
+
* module to the nearest `@gate-forge/cli` manifest.
|
|
61
|
+
*
|
|
62
|
+
* Args:
|
|
63
|
+
* none.
|
|
64
|
+
*
|
|
65
|
+
* Returns:
|
|
66
|
+
* string | null: the resolved package root, or null when no manifest
|
|
67
|
+
* identifies it.
|
|
68
|
+
*/
|
|
69
|
+
export declare function enginePackageRoot(): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Identifies the installed engine without executing package code from the project.
|
|
72
|
+
*
|
|
73
|
+
* `source` is receipt-bound (a receipt is only valid for the engine
|
|
74
|
+
* that sealed it) and keeps its exact meaning: a `node_modules`
|
|
75
|
+
* install reads `registry` whether npm fetched it from the registry or
|
|
76
|
+
* unpacked a tarball. The install provenance npm's metadata can prove
|
|
77
|
+
* is reported separately by {@link engineInstallProvenance} and
|
|
78
|
+
* {@link engineSourceLine}.
|
|
79
|
+
*
|
|
80
|
+
* Args:
|
|
81
|
+
* none.
|
|
82
|
+
*
|
|
83
|
+
* Returns:
|
|
84
|
+
* EngineIdentity: version, source, and whether the engine is unpublished.
|
|
85
|
+
*/
|
|
86
|
+
export declare function engineIdentity(): EngineIdentity;
|
|
87
|
+
/**
|
|
88
|
+
* The engine line a human-readable REPORT prints: the same provenance
|
|
89
|
+
* the enforcement doctor's engine line uses, so one install never
|
|
90
|
+
* produces two contradictory claims. The receipt-bound
|
|
91
|
+
* `engine.source` keeps its exact meaning and is untouched.
|
|
92
|
+
*
|
|
93
|
+
* Args:
|
|
94
|
+
* none.
|
|
95
|
+
*
|
|
96
|
+
* Returns:
|
|
97
|
+
* string: the printed line.
|
|
98
|
+
*/
|
|
99
|
+
export declare function reportEngineLine(): string;
|
|
100
|
+
//# sourceMappingURL=engine-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-identity.d.ts","sourceRoot":"","sources":["../src/engine-identity.ts"],"names":[],"mappings":"AAKA,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;AAE/E,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAsBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,uBAAuB,CA0C3F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,uBAAuB,GAAG,MAAM,CAoBtG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAkBjD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,IAAI,cAAc,CAU/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { VERSION } from './commands/common.js';
|
|
5
|
+
/**
|
|
6
|
+
* Classifies one npm `resolved` specifier: a registry URL is the
|
|
7
|
+
* registry, everything else that names a local artifact is a file
|
|
8
|
+
* install.
|
|
9
|
+
*
|
|
10
|
+
* Args:
|
|
11
|
+
* resolved: the `resolved` string from the install metadata.
|
|
12
|
+
*
|
|
13
|
+
* Returns:
|
|
14
|
+
* EngineInstallKind: `registry` or `file`.
|
|
15
|
+
*/
|
|
16
|
+
function kindOfResolved(resolved) {
|
|
17
|
+
return /^https?:\/\/registry\./.test(resolved) ? 'registry' : 'file';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads npm's install metadata for the installed engine package.
|
|
21
|
+
*
|
|
22
|
+
* Two sources, in npm's own order of reliability: the hidden
|
|
23
|
+
* `node_modules/.package-lock.json` of the OWNING `node_modules`
|
|
24
|
+
* directory (the one whose key path is this package), then the legacy
|
|
25
|
+
* `_resolved`/`_from` keys npm writes into the installed manifest. No
|
|
26
|
+
* metadata means `unknown`, never an assumed registry.
|
|
27
|
+
*
|
|
28
|
+
* Args:
|
|
29
|
+
* packageRoot: absolute path of the installed `@gate-forge/cli`.
|
|
30
|
+
*
|
|
31
|
+
* Returns:
|
|
32
|
+
* EngineInstallProvenance: the install kind and the proving specifier.
|
|
33
|
+
*/
|
|
34
|
+
export function engineInstallProvenance(packageRoot) {
|
|
35
|
+
if (packageRoot === null || !packageRoot.split('\\').join('/').includes('/node_modules/')) {
|
|
36
|
+
return { kind: 'local-path', specifier: null };
|
|
37
|
+
}
|
|
38
|
+
// The hidden lockfile lives in the `node_modules` that OWNS the
|
|
39
|
+
// package: `<...>/node_modules/@gate-forge/cli` is described by
|
|
40
|
+
// `<...>/node_modules/.package-lock.json`. Walk up through nested
|
|
41
|
+
// installs and read the first lockfile that describes this package.
|
|
42
|
+
const normalized = packageRoot.split('\\').join('/');
|
|
43
|
+
const packageKey = normalized.slice(normalized.lastIndexOf('node_modules/') + 'node_modules/'.length);
|
|
44
|
+
for (let current = dirname(packageRoot);; current = dirname(current)) {
|
|
45
|
+
if (basename(current) === 'node_modules') {
|
|
46
|
+
const lock = join(current, '.package-lock.json');
|
|
47
|
+
if (existsSync(lock)) {
|
|
48
|
+
try {
|
|
49
|
+
const parsed = JSON.parse(readFileSync(lock, 'utf8'));
|
|
50
|
+
const packages = parsed.packages ?? {};
|
|
51
|
+
const entry = packages[packageKey] ?? Object.entries(packages).find(([key]) => key.endsWith(packageKey))?.[1];
|
|
52
|
+
if (typeof entry?.resolved === 'string' && entry.resolved !== '') {
|
|
53
|
+
return { kind: kindOfResolved(entry.resolved), specifier: entry.resolved };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// Unreadable or foreign lockfile: fall through to the manifest.
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const parent = dirname(current);
|
|
62
|
+
if (parent === current)
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
const manifest = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
|
|
67
|
+
const declared = typeof manifest._resolved === 'string' ? manifest._resolved : manifest._from;
|
|
68
|
+
if (typeof declared === 'string' && declared !== '') {
|
|
69
|
+
return { kind: kindOfResolved(declared), specifier: declared };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// No readable manifest metadata: provenance stays unproven.
|
|
74
|
+
}
|
|
75
|
+
return { kind: 'unknown', specifier: null };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Formats the doctor's one engine line, adding ONLY what the install
|
|
79
|
+
* metadata can prove. The receipt's `engine.source` is receipt-bound
|
|
80
|
+
* (a receipt is only valid for the engine that sealed it), so its
|
|
81
|
+
* meaning is unchanged; this is the human-readable line.
|
|
82
|
+
*
|
|
83
|
+
* Args:
|
|
84
|
+
* identity: the receipt-bound engine identity.
|
|
85
|
+
* provenance: the install provenance read from npm's metadata.
|
|
86
|
+
*
|
|
87
|
+
* Returns:
|
|
88
|
+
* string: the printed line.
|
|
89
|
+
*/
|
|
90
|
+
export function engineSourceLine(identity, provenance) {
|
|
91
|
+
// A `node_modules` install is the only case where the receipt-bound
|
|
92
|
+
// `source` says less than the truth: npm unpacks a tarball exactly
|
|
93
|
+
// where it unpacks a registry release, so the line names the
|
|
94
|
+
// directory and lets the install metadata supply the provenance.
|
|
95
|
+
const base = provenance.kind === 'file' || (provenance.kind === 'unknown' && identity.source === 'registry')
|
|
96
|
+
? `engine: ${identity.version} from node_modules`
|
|
97
|
+
: `engine: ${identity.version} from ${identity.source}`;
|
|
98
|
+
if (provenance.kind === 'file') {
|
|
99
|
+
return (`${base} (tarball or directory install: ${provenance.specifier ?? 'file source'} — not the ` +
|
|
100
|
+
`published registry release, so CI installing @gate-forge/cli@${identity.version} would NOT run ` +
|
|
101
|
+
'this code)');
|
|
102
|
+
}
|
|
103
|
+
if (provenance.kind === 'unknown') {
|
|
104
|
+
return `${base} (registry or tarball install — no install metadata found, so the provenance is unproven)`;
|
|
105
|
+
}
|
|
106
|
+
return base;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Locates the installed engine's package root by walking up from this
|
|
110
|
+
* module to the nearest `@gate-forge/cli` manifest.
|
|
111
|
+
*
|
|
112
|
+
* Args:
|
|
113
|
+
* none.
|
|
114
|
+
*
|
|
115
|
+
* Returns:
|
|
116
|
+
* string | null: the resolved package root, or null when no manifest
|
|
117
|
+
* identifies it.
|
|
118
|
+
*/
|
|
119
|
+
export function enginePackageRoot() {
|
|
120
|
+
let current = dirname(fileURLToPath(import.meta.url));
|
|
121
|
+
while (true) {
|
|
122
|
+
const manifest = join(current, 'package.json');
|
|
123
|
+
if (existsSync(manifest)) {
|
|
124
|
+
try {
|
|
125
|
+
const value = JSON.parse(readFileSync(manifest, 'utf8'));
|
|
126
|
+
if (value.name === '@gate-forge/cli') {
|
|
127
|
+
return realpathSync(current);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
// Continue upward; a malformed unrelated manifest is not this package's identity.
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const parent = dirname(current);
|
|
135
|
+
if (parent === current)
|
|
136
|
+
return null;
|
|
137
|
+
current = parent;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Identifies the installed engine without executing package code from the project.
|
|
142
|
+
*
|
|
143
|
+
* `source` is receipt-bound (a receipt is only valid for the engine
|
|
144
|
+
* that sealed it) and keeps its exact meaning: a `node_modules`
|
|
145
|
+
* install reads `registry` whether npm fetched it from the registry or
|
|
146
|
+
* unpacked a tarball. The install provenance npm's metadata can prove
|
|
147
|
+
* is reported separately by {@link engineInstallProvenance} and
|
|
148
|
+
* {@link engineSourceLine}.
|
|
149
|
+
*
|
|
150
|
+
* Args:
|
|
151
|
+
* none.
|
|
152
|
+
*
|
|
153
|
+
* Returns:
|
|
154
|
+
* EngineIdentity: version, source, and whether the engine is unpublished.
|
|
155
|
+
*/
|
|
156
|
+
export function engineIdentity() {
|
|
157
|
+
const packageRoot = enginePackageRoot();
|
|
158
|
+
if (packageRoot === null) {
|
|
159
|
+
return { version: VERSION, source: 'registry', unpublished: false };
|
|
160
|
+
}
|
|
161
|
+
const normalized = packageRoot.split('\\').join('/');
|
|
162
|
+
const fromRegistry = normalized.includes('/node_modules/');
|
|
163
|
+
return fromRegistry
|
|
164
|
+
? { version: VERSION, source: 'registry', unpublished: false }
|
|
165
|
+
: { version: VERSION, source: `local path ${packageRoot}`, unpublished: true };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The engine line a human-readable REPORT prints: the same provenance
|
|
169
|
+
* the enforcement doctor's engine line uses, so one install never
|
|
170
|
+
* produces two contradictory claims. The receipt-bound
|
|
171
|
+
* `engine.source` keeps its exact meaning and is untouched.
|
|
172
|
+
*
|
|
173
|
+
* Args:
|
|
174
|
+
* none.
|
|
175
|
+
*
|
|
176
|
+
* Returns:
|
|
177
|
+
* string: the printed line.
|
|
178
|
+
*/
|
|
179
|
+
export function reportEngineLine() {
|
|
180
|
+
return engineSourceLine(engineIdentity(), engineInstallProvenance(enginePackageRoot()));
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=engine-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-identity.js","sourceRoot":"","sources":["../src/engine-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAqC/C;;;;;;;;;;GAUG;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C,OAAO,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,kFAAkF;YACpF,CAAC;QACH,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,WAAW,GAAG,iBAAiB,EAAE,CAAC;IACxC,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;QACzB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IACtE,CAAC;IACD,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAC3D,OAAO,YAAY;QACjB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE;QAC9D,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,WAAW,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AACnF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,gBAAgB,CAAC,cAAc,EAAE,EAAE,uBAAuB,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;AAC1F,CAAC"}
|
package/dist/evaluate.d.ts
CHANGED
|
@@ -60,6 +60,15 @@ export interface EvaluateInput {
|
|
|
60
60
|
* This keeps partial or stale `claims.json` from defining the inventory.
|
|
61
61
|
*/
|
|
62
62
|
claimInventory?: readonly Claim[];
|
|
63
|
+
/**
|
|
64
|
+
* Framework test ids whose evidence may never be used (owner
|
|
65
|
+
* quarantine). A quarantined test proves
|
|
66
|
+
* nothing: its claims are dropped and its evidence records are
|
|
67
|
+
* discarded before grading, so an obligation only it covered stays
|
|
68
|
+
* `missing` — the quarantine forgives nothing. Unknown ids here are
|
|
69
|
+
* harmless (nothing to drop); this is a restriction, never a grant.
|
|
70
|
+
*/
|
|
71
|
+
excludedTestIds?: readonly string[];
|
|
63
72
|
/**
|
|
64
73
|
* Coverage facts derived from resolved test mappings (plan §3.6,
|
|
65
74
|
* Phase 3): browser-e2e-declared bindings for CRUD-contract
|
|
@@ -77,7 +86,45 @@ export interface EvaluateInput {
|
|
|
77
86
|
* issuance.
|
|
78
87
|
*/
|
|
79
88
|
witnessVerifierKey?: string | null;
|
|
89
|
+
/**
|
|
90
|
+
* The CARRIED evidence of a test-only re-seal: one channel per run
|
|
91
|
+
* that contributed to the retained evidence union, the parent first.
|
|
92
|
+
* A chain of re-seals carries records several runs witnessed, each
|
|
93
|
+
* under its own run identity and input digest, and a record is
|
|
94
|
+
* authorized ONLY by the envelope of the run that issued it — one
|
|
95
|
+
* envelope for the whole union would either vouch for records it
|
|
96
|
+
* never issued or vouch for none of them.
|
|
97
|
+
*
|
|
98
|
+
* A re-seal carries a test's outcomes AND the evidence those
|
|
99
|
+
* outcomes were witnessed with, and that evidence was witnessed
|
|
100
|
+
* under the CONTRIBUTOR's input digest — which is exactly what this
|
|
101
|
+
* re-computation proved may differ from the current one. Every
|
|
102
|
+
* envelope is authenticated here with the same witness verifier
|
|
103
|
+
* keys as any other, and only the records it names keep their
|
|
104
|
+
* witnessed trust; every other record grades as it does today. The
|
|
105
|
+
* consumer's own recomputation (`resealChainBlocking`) is what
|
|
106
|
+
* proves each envelope belongs to the verified document that binds
|
|
107
|
+
* it.
|
|
108
|
+
*/
|
|
109
|
+
carriedEvidence?: readonly {
|
|
110
|
+
attestation: unknown;
|
|
111
|
+
runId: string;
|
|
112
|
+
inputDigest: string;
|
|
113
|
+
recordIds: readonly string[];
|
|
114
|
+
}[] | null;
|
|
80
115
|
/** Active and retained keys used to verify older witnessed envelopes. */
|
|
116
|
+
/**
|
|
117
|
+
* Engine-issued Alembic witness records from this process. Never read
|
|
118
|
+
* from suite-writable state. Absent leaves `alembic:*` unproven.
|
|
119
|
+
*/
|
|
120
|
+
engineAlembicRecords?: readonly {
|
|
121
|
+
obligationId: string;
|
|
122
|
+
kind: string;
|
|
123
|
+
trust?: string;
|
|
124
|
+
origin?: string;
|
|
125
|
+
payload?: unknown;
|
|
126
|
+
recordId?: string;
|
|
127
|
+
}[];
|
|
81
128
|
witnessVerifierKeys?: readonly string[];
|
|
82
129
|
/**
|
|
83
130
|
* Live v2 attestation envelope fetched by `test-gates` while a wired
|
|
@@ -107,6 +154,25 @@ export interface EvaluateInput {
|
|
|
107
154
|
/** True when the test-gates run mutated its own inputs post-suite. */
|
|
108
155
|
changedInputs?: boolean;
|
|
109
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* Named-run selection: the obligations the
|
|
159
|
+
* selected tests DECLARE through the trusted mapping resolution
|
|
160
|
+
* (sidecar or native bindings). When present (non-null), the
|
|
161
|
+
* evaluation grades ONLY those — an obligation no selected test
|
|
162
|
+
* claims was never observed by this run, so it is reported in the
|
|
163
|
+
* repository debt and blocks nothing here. The caller resolves the
|
|
164
|
+
* declarations, so a channel that mints evidence without writing a
|
|
165
|
+
* claim row is graded exactly like every other one. Repository-wide
|
|
166
|
+
* findings (policy, mapping, inventory, the coverage policy) are
|
|
167
|
+
* findings about the REPOSITORY,
|
|
168
|
+
* not about the selection, so they stay out of a named run's blocking
|
|
169
|
+
* set. Evidence-context findings (unauthenticated evidence, changed
|
|
170
|
+
* inputs, the strict preflight) and every caller-projected
|
|
171
|
+
* run-execution finding (supervision, lifecycle, intent) still
|
|
172
|
+
* block: a hand-picked selection never forgives a broken run. Null or
|
|
173
|
+
* absent grades the whole repository exactly as before.
|
|
174
|
+
*/
|
|
175
|
+
namedObligationIds?: readonly string[] | null;
|
|
110
176
|
/**
|
|
111
177
|
* Adoption-baseline forgiveness (phase 8 C): the fingerprint set of
|
|
112
178
|
* the ADOPTED baseline. Deliberately caller-provided, never loaded
|
|
@@ -128,6 +194,14 @@ export interface EvaluateInput {
|
|
|
128
194
|
*/
|
|
129
195
|
classificationBlocked?: ReadonlySet<string>;
|
|
130
196
|
} | null;
|
|
197
|
+
/**
|
|
198
|
+
* 0.9.0 D2: keep the ADOPTED baseline's forgiveness through the strict-E2E
|
|
199
|
+
* re-grade. Set only by a caller that proved the change set contains no
|
|
200
|
+
* product, test, manifest or dependency input — only Gateforge-owned
|
|
201
|
+
* policy inputs, whose integrity the owner-approved policy digest
|
|
202
|
+
* governs. Owner waivers are never included: a waiver is not proof.
|
|
203
|
+
*/
|
|
204
|
+
adoptedBaselineSurvivesStrictE2E?: boolean;
|
|
131
205
|
}
|
|
132
206
|
/** The evaluated run. */
|
|
133
207
|
export interface EvaluateResult {
|
|
@@ -139,6 +213,13 @@ export interface EvaluateResult {
|
|
|
139
213
|
waiverCounts: WaiverCounts;
|
|
140
214
|
/** Whether any blocking verdict or blocking entry exists. */
|
|
141
215
|
blockingRun: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Obligations this evaluation deliberately did not grade because a
|
|
218
|
+
* named run observed only its own selection (0 for every other run).
|
|
219
|
+
* Descriptive: it says how much of the repository a hand-picked
|
|
220
|
+
* selection said nothing about.
|
|
221
|
+
*/
|
|
222
|
+
notGradedObligations: number;
|
|
142
223
|
/**
|
|
143
224
|
* Adoption-baseline forgiveness counts (phase 8 C) — kept LOUD: the
|
|
144
225
|
* report prints them on every run so baselined debt is never silently
|
|
@@ -147,6 +228,7 @@ export interface EvaluateResult {
|
|
|
147
228
|
baselined: {
|
|
148
229
|
obligations: number;
|
|
149
230
|
blockingEntries: number;
|
|
231
|
+
neverWitnessed: number;
|
|
150
232
|
/**
|
|
151
233
|
* Blocking entries waived via the adopted classification set.
|
|
152
234
|
* Undefined when the receipt carries NO classification layer at all
|
|
@@ -156,6 +238,21 @@ export interface EvaluateResult {
|
|
|
156
238
|
classificationBlocked: number | undefined;
|
|
157
239
|
} | null;
|
|
158
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Keeps only blocking entries plausibly tied to a changed file. Exported
|
|
243
|
+
* so the `mode: changed` gate decision can reuse the EXACT same
|
|
244
|
+
* attribution rule the evaluator grades with — a second, looser copy
|
|
245
|
+
* would let the gate hide debt the report shows.
|
|
246
|
+
*
|
|
247
|
+
* Args:
|
|
248
|
+
* blocking: the blocking entries the evaluator produced.
|
|
249
|
+
* changed: the resolved changed-file set.
|
|
250
|
+
* multiSources: the join-aware source map (backend + frontend calls).
|
|
251
|
+
*
|
|
252
|
+
* Returns:
|
|
253
|
+
* BlockingEntry[]: the entries a change can be held responsible for.
|
|
254
|
+
*/
|
|
255
|
+
export declare function scopeBlocking(blocking: readonly BlockingEntry[], changed: ReadonlySet<string>, multiSources: Map<string, string[]>): BlockingEntry[];
|
|
159
256
|
/**
|
|
160
257
|
* Derives the closed-world coverage inventory from the built graph (plan
|
|
161
258
|
* 2026-09-13 §3.6): every RESOLVED, USER-FACING business table. HTTP
|
|
@@ -229,12 +326,19 @@ export declare function strictPreflightBlocking(obligations: readonly Obligation
|
|
|
229
326
|
*
|
|
230
327
|
* Args:
|
|
231
328
|
* verdicts: the evaluated verdicts (sorted).
|
|
329
|
+
* options: `keepBaselineForgiveness` (0.9.0 D2) leaves ADOPTED-baseline
|
|
330
|
+
* verdicts waived when the caller proved the change set holds no
|
|
331
|
+
* product, test or dependency input — only Gateforge-owned policy
|
|
332
|
+
* inputs whose integrity the owner-approved policy digest governs.
|
|
333
|
+
* Owner waivers are unaffected: a waiver is still not proof.
|
|
232
334
|
*
|
|
233
335
|
* Returns:
|
|
234
336
|
* ObligationVerdict[]: identical unless strict mode converted waived
|
|
235
337
|
* entries to blocking ones (order and determinism preserved).
|
|
236
338
|
*/
|
|
237
|
-
export declare function applyStrictE2E(verdicts: readonly ObligationVerdict[]
|
|
339
|
+
export declare function applyStrictE2E(verdicts: readonly ObligationVerdict[], options?: {
|
|
340
|
+
keepBaselineForgiveness?: boolean;
|
|
341
|
+
}): ObligationVerdict[];
|
|
238
342
|
/**
|
|
239
343
|
* Evaluates obligations and blocks per the run inputs.
|
|
240
344
|
*
|
package/dist/evaluate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAUL,KAAK,cAAc,EAOnB,KAAK,aAAa,EAElB,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAO1B;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAEpE;AAID,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,wEAAwE;IACxE,KAAK,EAAE,aAAa,CAAC;IACrB,6CAA6C;IAC7C,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IACnC;;;OAGG;IACH,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACx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