@gate-forge/cli 0.7.0 → 0.8.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 +511 -51
- package/dist/adapter-audit.d.ts +154 -0
- package/dist/adapter-audit.d.ts.map +1 -0
- package/dist/adapter-audit.js +531 -0
- package/dist/adapter-audit.js.map +1 -0
- package/dist/adapter-scaffold.d.ts +66 -0
- package/dist/adapter-scaffold.d.ts.map +1 -0
- package/dist/adapter-scaffold.js +353 -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 +59 -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 +738 -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 +284 -0
- package/dist/commands/adapters.js.map +1 -0
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +9 -1
- 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 +81 -2
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +336 -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 +1008 -62
- 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 +143 -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 +800 -30
- package/dist/commands/enforcement.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 +148 -0
- package/dist/commands/init-presets.d.ts.map +1 -0
- package/dist/commands/init-presets.js +194 -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 +610 -69
- 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 +744 -15
- 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 +3619 -186
- 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 +225 -22
- package/dist/commands/tests.js.map +1 -1
- package/dist/endpoint-compiler.d.ts.map +1 -1
- package/dist/endpoint-compiler.js +29 -8
- 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 +89 -0
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +137 -16
- 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/git-hooks.d.ts +17 -0
- package/dist/git-hooks.d.ts.map +1 -1
- package/dist/git-hooks.js +119 -0
- package/dist/git-hooks.js.map +1 -1
- 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/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/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 +36 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +21 -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 +52 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +141 -3
- package/dist/pipeline.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 +8 -1
- package/dist/repo-scan.d.ts.map +1 -1
- package/dist/repo-scan.js +221 -27
- 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/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/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 +73 -0
- package/dist/singleton-guidance.d.ts.map +1 -0
- package/dist/singleton-guidance.js +118 -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/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 +367 -0
- package/guides/QUICKSTART.md +404 -0
- package/guides/RUNNER-NEUTRAL-EVIDENCE.md +199 -0
- package/guides/TEST-ENVIRONMENT.md +1226 -0
- package/guides/UPGRADE-0.6-to-0.7.md +65 -0
- package/guides/UPGRADE-0.7-to-0.8.md +114 -0
- package/package.json +12 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-browsers.js","sourceRoot":"","sources":["../src/playwright-browsers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAwB1C,wEAAwE;AACxE,MAAM,iBAAiB,GAAG,CAAC,iBAAiB,EAAE,YAAY,EAAE,kBAAkB,CAAU,CAAC;AAEzF,wEAAwE;AACxE,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC,wEAAwE;AACxE,MAAM,UAAU,mBAAmB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACtE,OAAO,GAAG,CAAC,0BAA0B,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;AACvF,CAAC;AAED;;;;;;;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QACnC,OAAO,CACL,uEAAuE;YACvE,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,SAAS,CAAC,YAAY,GAAG,CACnH,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzF,OAAO,CACL,6EAA6E,OAAO,qBAAqB;QACzG,oGAAoG;QACpG,qCAAqC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,UAAU,GAAG,CAChG,CAAC;AACJ,CAAC"}
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type ConfigPlugin, type DetectorOutput, type PluginRegistration } from '@gate-forge/core';
|
|
2
|
-
|
|
2
|
+
import { type CacheControl, type CacheCounts } from './run-cache.js';
|
|
3
|
+
/** One plugin run: detector contributions + pinned registrations + cache accounting. */
|
|
3
4
|
export interface PluginRunResult {
|
|
4
5
|
contributions: DetectorOutput[];
|
|
5
6
|
registrations: PluginRegistration[];
|
|
7
|
+
/** Cache accounting for this run (0/0 when the cache is disabled). */
|
|
8
|
+
cache: CacheCounts;
|
|
6
9
|
}
|
|
7
10
|
/** Default export shape every in-process plugin must provide. */
|
|
8
11
|
export interface InProcessPluginModule {
|
|
@@ -19,21 +22,28 @@ export interface InProcessPluginModule {
|
|
|
19
22
|
};
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
|
-
* Runs every configured plugin over the same path list
|
|
25
|
+
* Runs every configured plugin over the same path list, reusing cached
|
|
26
|
+
* discovery results when a cache control is provided and every key input
|
|
27
|
+
* (plugin config, module bytes, input bytes, interpreter identity) is
|
|
28
|
+
* unchanged. A cache miss runs the plugin exactly as before and stores
|
|
29
|
+
* the validated result; any doubt (unreadable input, unprobeable
|
|
30
|
+
* interpreter, corrupt entry) runs fresh — the cache only ever skips
|
|
31
|
+
* work whose inputs are byte-identical.
|
|
23
32
|
*
|
|
24
33
|
* Args:
|
|
25
34
|
* plugins: plugin entries from `.gateforge.yml` (config order).
|
|
26
35
|
* paths: expanded repo-relative include paths (possibly empty).
|
|
27
36
|
* cwd: repo root; subprocess cwd and in-process module base.
|
|
37
|
+
* cache: cache control; omitted or disabled means a full scan.
|
|
28
38
|
*
|
|
29
39
|
* Returns:
|
|
30
|
-
* PluginRunResult: one validated contribution per plugin,
|
|
31
|
-
*
|
|
40
|
+
* PluginRunResult: one validated contribution per plugin, the pinned
|
|
41
|
+
* registrations for the run manifest, and the cache hit/miss counts.
|
|
32
42
|
*
|
|
33
43
|
* Throws:
|
|
34
44
|
* UsageError (exit 2): config/usage problems — spawn failures,
|
|
35
45
|
* GPP/2 protocol violations, import failures, invalid discovery
|
|
36
46
|
* documents. A failed plugin never yields a partial contribution.
|
|
37
47
|
*/
|
|
38
|
-
export declare function runPlugins(plugins: readonly ConfigPlugin[], paths: readonly string[], cwd: string): Promise<PluginRunResult>;
|
|
48
|
+
export declare function runPlugins(plugins: readonly ConfigPlugin[], paths: readonly string[], cwd: string, cache?: CacheControl): Promise<PluginRunResult>;
|
|
39
49
|
//# sourceMappingURL=plugins.d.ts.map
|
package/dist/plugins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAoCA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAoCA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAExB,wFAAwF;AACxF,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,sEAAsE;IACtE,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CACN,KAAK,EAAE,SAAS,MAAM,EAAE,GAEtB,OAAO,CAAC;QACN,SAAS,EAAE,OAAO,EAAE,CAAC;QACrB,UAAU,EAAE,OAAO,EAAE,CAAC;QACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,qBAAqB,EAAE,OAAO,EAAE,CAAC;KAClC,CAAC,GACF;QACE,SAAS,EAAE,OAAO,EAAE,CAAC;QACrB,UAAU,EAAE,OAAO,EAAE,CAAC;QACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,qBAAqB,EAAE,OAAO,EAAE,CAAC;KAClC,CAAC;CACP;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,YAAY,GACnB,OAAO,CAAC,eAAe,CAAC,CA8B1B"}
|
package/dist/plugins.js
CHANGED
|
@@ -37,36 +37,60 @@ import { join } from 'node:path';
|
|
|
37
37
|
import { DetectorOutputSchema, } from '@gate-forge/core';
|
|
38
38
|
import { PluginSession } from '@gate-forge/plugin-protocol';
|
|
39
39
|
import { UsageError } from './errors.js';
|
|
40
|
+
import { digestPathListInputs, lookupPluginCache, storePluginResult, } from './run-cache.js';
|
|
40
41
|
/**
|
|
41
|
-
* Runs every configured plugin over the same path list
|
|
42
|
+
* Runs every configured plugin over the same path list, reusing cached
|
|
43
|
+
* discovery results when a cache control is provided and every key input
|
|
44
|
+
* (plugin config, module bytes, input bytes, interpreter identity) is
|
|
45
|
+
* unchanged. A cache miss runs the plugin exactly as before and stores
|
|
46
|
+
* the validated result; any doubt (unreadable input, unprobeable
|
|
47
|
+
* interpreter, corrupt entry) runs fresh — the cache only ever skips
|
|
48
|
+
* work whose inputs are byte-identical.
|
|
42
49
|
*
|
|
43
50
|
* Args:
|
|
44
51
|
* plugins: plugin entries from `.gateforge.yml` (config order).
|
|
45
52
|
* paths: expanded repo-relative include paths (possibly empty).
|
|
46
53
|
* cwd: repo root; subprocess cwd and in-process module base.
|
|
54
|
+
* cache: cache control; omitted or disabled means a full scan.
|
|
47
55
|
*
|
|
48
56
|
* Returns:
|
|
49
|
-
* PluginRunResult: one validated contribution per plugin,
|
|
50
|
-
*
|
|
57
|
+
* PluginRunResult: one validated contribution per plugin, the pinned
|
|
58
|
+
* registrations for the run manifest, and the cache hit/miss counts.
|
|
51
59
|
*
|
|
52
60
|
* Throws:
|
|
53
61
|
* UsageError (exit 2): config/usage problems — spawn failures,
|
|
54
62
|
* GPP/2 protocol violations, import failures, invalid discovery
|
|
55
63
|
* documents. A failed plugin never yields a partial contribution.
|
|
56
64
|
*/
|
|
57
|
-
export async function runPlugins(plugins, paths, cwd) {
|
|
65
|
+
export async function runPlugins(plugins, paths, cwd, cache) {
|
|
58
66
|
const contributions = [];
|
|
59
67
|
const registrations = [];
|
|
68
|
+
const cacheCounts = { hits: 0, misses: 0 };
|
|
69
|
+
const cacheActive = cache !== undefined && !cache.disabled;
|
|
70
|
+
const inputsDigest = cacheActive ? digestPathListInputs(cwd, paths) : null;
|
|
60
71
|
for (const plugin of plugins) {
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
const cached = cacheActive && inputsDigest !== null
|
|
73
|
+
? lookupPluginCache(cache.stateDir, plugin, inputsDigest, cwd, process.env)
|
|
74
|
+
: null;
|
|
75
|
+
if (cached !== null) {
|
|
76
|
+
contributions.push(cached);
|
|
77
|
+
cacheCounts.hits += 1;
|
|
63
78
|
}
|
|
64
79
|
else {
|
|
65
|
-
|
|
80
|
+
const fresh = plugin.transport === 'subprocess'
|
|
81
|
+
? await runSubprocessPlugin(plugin, paths, cwd)
|
|
82
|
+
: await runInProcessPlugin(plugin, paths, cwd);
|
|
83
|
+
contributions.push(fresh);
|
|
84
|
+
if (cacheActive) {
|
|
85
|
+
cacheCounts.misses += 1;
|
|
86
|
+
if (inputsDigest !== null) {
|
|
87
|
+
storePluginResult(cache.stateDir, plugin, inputsDigest, cwd, process.env, fresh);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
66
90
|
}
|
|
67
91
|
registrations.push({ id: plugin.id, version: plugin.version, transport: plugin.transport });
|
|
68
92
|
}
|
|
69
|
-
return { contributions, registrations };
|
|
93
|
+
return { contributions, registrations, cache: cacheCounts };
|
|
70
94
|
}
|
|
71
95
|
/** Drives one GPP/3 subprocess plugin session over the path list. */
|
|
72
96
|
async function runSubprocessPlugin(plugin, paths, cwd) {
|
|
@@ -107,6 +131,31 @@ async function runSubprocessPlugin(plugin, paths, cwd) {
|
|
|
107
131
|
await session.dispose();
|
|
108
132
|
}
|
|
109
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* The remedy for a plugin whose declared `version:` does not match the
|
|
136
|
+
* detector the module reports. Copying a sibling entry's version is the
|
|
137
|
+
* ordinary mistake, and the contract error alone names neither the field
|
|
138
|
+
* nor the fix, so the boundary says both: the field to edit, the value
|
|
139
|
+
* the detector declares, and the command that writes it.
|
|
140
|
+
*
|
|
141
|
+
* Args:
|
|
142
|
+
* plugin: the pinned plugin config entry.
|
|
143
|
+
* detector: the identity the signal claimed.
|
|
144
|
+
*
|
|
145
|
+
* Returns:
|
|
146
|
+
* string: the fix sentence (empty when the id, not the version, is
|
|
147
|
+
* what mismatched — a foreign id is never repaired by a version edit).
|
|
148
|
+
*/
|
|
149
|
+
function signalIdentityFix(plugin, detector) {
|
|
150
|
+
if (detector.id !== plugin.id) {
|
|
151
|
+
return (`the signal claims a different detector id ('${detector.id}'), which no ` +
|
|
152
|
+
`plugins[].version edit can repair — a plugin may only signal under its own id`);
|
|
153
|
+
}
|
|
154
|
+
return (`the signal's version ('${detector.version}') is the version the pack's detector declares, ` +
|
|
155
|
+
`not the pack's npm version; fix: set version: '${detector.version}' on the ` +
|
|
156
|
+
`'${plugin.id}' entry in .gateforge.yml, or run \`gateforge init --plugins ${plugin.id}\` ` +
|
|
157
|
+
'to write the pin the installed pack declares');
|
|
158
|
+
}
|
|
110
159
|
/** Loads and drives one in-process plugin module. */
|
|
111
160
|
async function runInProcessPlugin(plugin, paths, cwd) {
|
|
112
161
|
const moduleSpecifier = plugin.module;
|
|
@@ -174,7 +223,8 @@ async function runInProcessPlugin(plugin, paths, cwd) {
|
|
|
174
223
|
throw new UsageError(`in-process plugin '${plugin.id}'@'${plugin.version}' returned a classification signal ` +
|
|
175
224
|
`claiming detector ${JSON.stringify(signal.detector.id)}@` +
|
|
176
225
|
`${JSON.stringify(signal.detector.version)}; signal identity must equal the pinned ` +
|
|
177
|
-
`plugin identity (suppressive authority is engine-issued, never plugin-issued)`
|
|
226
|
+
`plugin identity (suppressive authority is engine-issued, never plugin-issued); ` +
|
|
227
|
+
signalIdentityFix(plugin, signal.detector));
|
|
178
228
|
}
|
|
179
229
|
}
|
|
180
230
|
return parsed.data;
|
package/dist/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,oBAAoB,GAIrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EA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CAAC,CAC7C,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** Where the stream writes. `null` means the stream is off. */
|
|
2
|
+
export type ProgressTarget = {
|
|
3
|
+
kind: 'stderr';
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'file';
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
/** The run shapes a start line can name. */
|
|
9
|
+
export type ProgressScope = 'full' | 'changed' | 'named';
|
|
10
|
+
/** The outcome vocabulary every runner adapter normalizes to. */
|
|
11
|
+
export type ProgressOutcome = 'passed' | 'failed' | 'skipped';
|
|
12
|
+
/** One finished test, as the drain observed it. */
|
|
13
|
+
export interface ProgressTestOutcome {
|
|
14
|
+
/** The run's own test identity (`<file>#<title path>`). */
|
|
15
|
+
logicalKey: string;
|
|
16
|
+
/** The catalog title as declared in the committed test file. */
|
|
17
|
+
title: string;
|
|
18
|
+
/** The observed outcome. */
|
|
19
|
+
outcome: ProgressOutcome;
|
|
20
|
+
/** testEnd only: the runner's own error message (guarded before use). */
|
|
21
|
+
message?: string;
|
|
22
|
+
/** testEnd only: short `file:line` frames (deduplicated, at most five). */
|
|
23
|
+
stackFrames?: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/** One failure kept for the Gateforge-owned artifact. */
|
|
26
|
+
export interface ProgressFailure {
|
|
27
|
+
/** The run's own test identity. */
|
|
28
|
+
logicalKey: string;
|
|
29
|
+
/** The catalog title as declared in the committed test file. */
|
|
30
|
+
title: string;
|
|
31
|
+
/** The guarded error message (whole text, never a fragment of a secret). */
|
|
32
|
+
message: string;
|
|
33
|
+
/** The short `file:line` frames, at most five. */
|
|
34
|
+
stackFrames: string[];
|
|
35
|
+
}
|
|
36
|
+
/** How long a run may be quiet before the stream says it is alive. */
|
|
37
|
+
export declare const ALIVE_INTERVAL_MS = 60000;
|
|
38
|
+
/** The longest title or first message line the stream prints in full. */
|
|
39
|
+
export declare const MAX_STREAM_TEXT = 200;
|
|
40
|
+
/** Resolves the `--progress` flag, the `run.progress` config key, and `CI`.
|
|
41
|
+
*
|
|
42
|
+
* Precedence is flag → config → auto, and `auto` means stderr under CI
|
|
43
|
+
* and OFF everywhere else, so a local run's bytes are unchanged. An
|
|
44
|
+
* unusable target is a usage error, never a silently dropped stream: a
|
|
45
|
+
* CI job that asked for progress and got none is a job that looks hung.
|
|
46
|
+
*
|
|
47
|
+
* Args:
|
|
48
|
+
* flag: the `--progress` value, when the operator passed one.
|
|
49
|
+
* config: the `run.progress` config value, when the file sets one.
|
|
50
|
+
* env: process environment (only `CI` is consulted).
|
|
51
|
+
*
|
|
52
|
+
* Returns:
|
|
53
|
+
* ProgressTarget | null: where to write, or null when the stream is off.
|
|
54
|
+
* @throws UsageError naming `--progress` for an unusable target (exit 2).
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveProgressTarget(flag: string | undefined, config: string | undefined, env: NodeJS.ProcessEnv): ProgressTarget | null;
|
|
57
|
+
/** Construction options for one {@link ProgressStream}. */
|
|
58
|
+
export interface ProgressStreamOptions {
|
|
59
|
+
/** Where lines go; `null` keeps the stream completely silent. */
|
|
60
|
+
writer: ProgressTarget | null;
|
|
61
|
+
/** The runner name (from the trusted config, never from the suite). */
|
|
62
|
+
runner: string;
|
|
63
|
+
/** The scope the run actually grades. */
|
|
64
|
+
scope: ProgressScope;
|
|
65
|
+
/** The registered expected-set size — the `M` in `N/M`. */
|
|
66
|
+
expected: number;
|
|
67
|
+
/** Millisecond clock (tests inject a fake one; no real waiting). */
|
|
68
|
+
now?: () => number;
|
|
69
|
+
/** Timer arming (tests inject a fake one; no real waiting). */
|
|
70
|
+
setTimer?: (fn: () => void, ms: number) => unknown;
|
|
71
|
+
/** Timer disarming. */
|
|
72
|
+
clearTimer?: (handle: unknown) => void;
|
|
73
|
+
/** The stderr sink (never used by a file target). */
|
|
74
|
+
writeLine: (line: string) => void;
|
|
75
|
+
/** Where the one "the stream is gone" warning goes. */
|
|
76
|
+
warn?: (line: string) => void;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The progress stream of one supervised run.
|
|
80
|
+
*
|
|
81
|
+
* Every line is a pure function of witness-side facts, so the stream
|
|
82
|
+
* cannot carry a secret that a filter would have had to recognize: a
|
|
83
|
+
* title is committed code (and a title that itself looks like a secret
|
|
84
|
+
* is replaced by its digest), a message is matched against the credential
|
|
85
|
+
* shapes and replaced wholesale.
|
|
86
|
+
*/
|
|
87
|
+
export declare class ProgressStream {
|
|
88
|
+
private readonly options;
|
|
89
|
+
private readonly failureRecords;
|
|
90
|
+
private readonly running;
|
|
91
|
+
private done;
|
|
92
|
+
private passed;
|
|
93
|
+
private failed;
|
|
94
|
+
private skipped;
|
|
95
|
+
private startedAt;
|
|
96
|
+
private lastEventAt;
|
|
97
|
+
private timer;
|
|
98
|
+
private broken;
|
|
99
|
+
private finished;
|
|
100
|
+
/** Every failure this run observed, for the Gateforge-owned artifact. */
|
|
101
|
+
get failures(): readonly ProgressFailure[];
|
|
102
|
+
/** How many tests have reported an outcome so far. */
|
|
103
|
+
get completed(): number;
|
|
104
|
+
/**
|
|
105
|
+
* @param options: target, run facts, clock and sinks (see {@link ProgressStreamOptions}).
|
|
106
|
+
*/
|
|
107
|
+
constructor(options: ProgressStreamOptions);
|
|
108
|
+
/** Prints the start line and arms the alive ticker. */
|
|
109
|
+
start(): void;
|
|
110
|
+
/** Records that a test started (it counts as running for the alive line). */
|
|
111
|
+
beginTest(title: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* An event happened: it restarts the QUIET clock, so an alive line
|
|
114
|
+
* only ever reports a run that has genuinely been silent for a whole
|
|
115
|
+
* minute (a busy run is already reporting itself).
|
|
116
|
+
*/
|
|
117
|
+
private quiet;
|
|
118
|
+
/**
|
|
119
|
+
* Records one finished test: prints its line, counts the outcome, and
|
|
120
|
+
* keeps the guarded diagnosis of a failure for the artifact.
|
|
121
|
+
*
|
|
122
|
+
* @param outcome: the drain's observation of one finished test.
|
|
123
|
+
*/
|
|
124
|
+
endTest(outcome: ProgressTestOutcome): void;
|
|
125
|
+
/** Prints the finish line and stops the ticker. */
|
|
126
|
+
finish(): void;
|
|
127
|
+
/** The current millisecond reading. */
|
|
128
|
+
private clock;
|
|
129
|
+
/**
|
|
130
|
+
* The periodic quiet-interval tick: an alive line is printed only when
|
|
131
|
+
* a WHOLE interval passed with no event at all, then the tick re-arms
|
|
132
|
+
* itself until the run finishes. The elapsed time is read from the
|
|
133
|
+
* injected clock, never from the timer, so a test proves the rule
|
|
134
|
+
* without waiting a real minute.
|
|
135
|
+
*/
|
|
136
|
+
private alive;
|
|
137
|
+
/** Arms the next quiet-interval tick (fake clock and timer in tests). */
|
|
138
|
+
private arm;
|
|
139
|
+
/** Disarms the alive timer when one is armed. */
|
|
140
|
+
private disarm;
|
|
141
|
+
/**
|
|
142
|
+
* Writes one line, or gives up after warning exactly once: a closed
|
|
143
|
+
* pipe or an unwritable file must never fail a run, and a stream that
|
|
144
|
+
* warns repeatedly is noise.
|
|
145
|
+
*/
|
|
146
|
+
private line;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AA4BA,+DAA+D;AAC/D,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzD,iEAAiE;AACjE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D,mDAAmD;AACnD,MAAM,WAAW,mBAAmB;IAClC,2DA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kBb"}
|
package/dist/progress.js
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CI progress stream (CI visibility plan, sections 1 and 5).
|
|
3
|
+
*
|
|
4
|
+
* A long witnessed run used to be a blank CI screen: the consumer's job
|
|
5
|
+
* redirects the whole runner log to a private file because the runner
|
|
6
|
+
* log carries secrets, and Gateforge itself printed nothing until the
|
|
7
|
+
* gate line. This module is the replacement — and it is secret-free BY
|
|
8
|
+
* CONSTRUCTION rather than by filtering: every line is built from facts
|
|
9
|
+
* the supervisor already holds (how many tests were registered, which
|
|
10
|
+
* test is running, its catalog title, its outcome), never from runner
|
|
11
|
+
* output, a response body, an env value, or a stack trace.
|
|
12
|
+
*
|
|
13
|
+
* The one runtime value it does carry — the failing test's first error
|
|
14
|
+
* line, added by §5 — passes {@link looksLikeSecret} and is REPLACED
|
|
15
|
+
* wholesale when it matches; nothing is trimmed, masked, or partially
|
|
16
|
+
* quoted (a prefix of a secret is a secret).
|
|
17
|
+
*
|
|
18
|
+
* The stream decides NOTHING: it is not evidence, no gate reads it, and
|
|
19
|
+
* a write failure (a closed pipe, an unwritable file) is reported once
|
|
20
|
+
* and then ignored, because a progress line must never fail a run.
|
|
21
|
+
*/
|
|
22
|
+
import { createHash } from 'node:crypto';
|
|
23
|
+
import { appendFileSync, mkdirSync } from 'node:fs';
|
|
24
|
+
import { dirname } from 'node:path';
|
|
25
|
+
import { UsageError } from './errors.js';
|
|
26
|
+
import { looksLikeSecret } from './secret-guard.js';
|
|
27
|
+
/** How long a run may be quiet before the stream says it is alive. */
|
|
28
|
+
export const ALIVE_INTERVAL_MS = 60_000;
|
|
29
|
+
/** The longest title or first message line the stream prints in full. */
|
|
30
|
+
export const MAX_STREAM_TEXT = 200;
|
|
31
|
+
/** The most stack frames a failure record keeps. */
|
|
32
|
+
const MAX_STACK_FRAMES = 5;
|
|
33
|
+
/** What a title looks like when it is replaced by its own digest. */
|
|
34
|
+
function safeTitle(title) {
|
|
35
|
+
if (!looksLikeSecret(title))
|
|
36
|
+
return title;
|
|
37
|
+
return `(secretsafe title ${createHash('sha256').update(title).digest('hex').slice(0, 12)})`;
|
|
38
|
+
}
|
|
39
|
+
/** A bounded title: the allowlist value, truncated at the stream's limit. */
|
|
40
|
+
function displayTitle(title) {
|
|
41
|
+
const safe = safeTitle(title);
|
|
42
|
+
return safe.length > MAX_STREAM_TEXT ? `${safe.slice(0, MAX_STREAM_TEXT)}…` : safe;
|
|
43
|
+
}
|
|
44
|
+
/** The first line of a message, truncated — or the withheld marker. */
|
|
45
|
+
function displayMessageLine(message) {
|
|
46
|
+
const first = message.split('\n', 1)[0] ?? '';
|
|
47
|
+
if (looksLikeSecret(first))
|
|
48
|
+
return '(message withheld: looks like a secret)';
|
|
49
|
+
return first.length > MAX_STREAM_TEXT ? `${first.slice(0, MAX_STREAM_TEXT)}…` : first;
|
|
50
|
+
}
|
|
51
|
+
/** A whole message, guarded: a secret-shaped one is never stored. */
|
|
52
|
+
function guardedMessage(message) {
|
|
53
|
+
return looksLikeSecret(message) ? '(message withheld: looks like a secret)' : message;
|
|
54
|
+
}
|
|
55
|
+
/** `7m12s` from a millisecond duration (minutes always printed). */
|
|
56
|
+
function elapsedLabel(ms) {
|
|
57
|
+
const totalSeconds = Math.max(0, Math.floor(ms / 1000));
|
|
58
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
59
|
+
const seconds = totalSeconds % 60;
|
|
60
|
+
return `${String(minutes)}m${String(seconds).padStart(2, '0')}s`;
|
|
61
|
+
}
|
|
62
|
+
/** Resolves the `--progress` flag, the `run.progress` config key, and `CI`.
|
|
63
|
+
*
|
|
64
|
+
* Precedence is flag → config → auto, and `auto` means stderr under CI
|
|
65
|
+
* and OFF everywhere else, so a local run's bytes are unchanged. An
|
|
66
|
+
* unusable target is a usage error, never a silently dropped stream: a
|
|
67
|
+
* CI job that asked for progress and got none is a job that looks hung.
|
|
68
|
+
*
|
|
69
|
+
* Args:
|
|
70
|
+
* flag: the `--progress` value, when the operator passed one.
|
|
71
|
+
* config: the `run.progress` config value, when the file sets one.
|
|
72
|
+
* env: process environment (only `CI` is consulted).
|
|
73
|
+
*
|
|
74
|
+
* Returns:
|
|
75
|
+
* ProgressTarget | null: where to write, or null when the stream is off.
|
|
76
|
+
* @throws UsageError naming `--progress` for an unusable target (exit 2).
|
|
77
|
+
*/
|
|
78
|
+
export function resolveProgressTarget(flag, config, env) {
|
|
79
|
+
const raw = flag ?? config ?? 'auto';
|
|
80
|
+
if (raw === 'off')
|
|
81
|
+
return null;
|
|
82
|
+
if (raw === 'stderr')
|
|
83
|
+
return { kind: 'stderr' };
|
|
84
|
+
if (raw.startsWith('file:')) {
|
|
85
|
+
const path = raw.slice('file:'.length);
|
|
86
|
+
if (path.length > 0)
|
|
87
|
+
return { kind: 'file', path };
|
|
88
|
+
}
|
|
89
|
+
if (raw === 'auto')
|
|
90
|
+
return env['CI'] === 'true' ? { kind: 'stderr' } : null;
|
|
91
|
+
throw new UsageError(`test-gates: --progress must be 'off', 'stderr', 'file:<path>', or 'auto' (got '${raw}')`);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The progress stream of one supervised run.
|
|
95
|
+
*
|
|
96
|
+
* Every line is a pure function of witness-side facts, so the stream
|
|
97
|
+
* cannot carry a secret that a filter would have had to recognize: a
|
|
98
|
+
* title is committed code (and a title that itself looks like a secret
|
|
99
|
+
* is replaced by its digest), a message is matched against the credential
|
|
100
|
+
* shapes and replaced wholesale.
|
|
101
|
+
*/
|
|
102
|
+
export class ProgressStream {
|
|
103
|
+
options;
|
|
104
|
+
failureRecords = [];
|
|
105
|
+
running = new Set();
|
|
106
|
+
done = 0;
|
|
107
|
+
passed = 0;
|
|
108
|
+
failed = 0;
|
|
109
|
+
skipped = 0;
|
|
110
|
+
startedAt = 0;
|
|
111
|
+
lastEventAt = 0;
|
|
112
|
+
timer = null;
|
|
113
|
+
broken = false;
|
|
114
|
+
finished = false;
|
|
115
|
+
/** Every failure this run observed, for the Gateforge-owned artifact. */
|
|
116
|
+
get failures() {
|
|
117
|
+
return this.failureRecords;
|
|
118
|
+
}
|
|
119
|
+
/** How many tests have reported an outcome so far. */
|
|
120
|
+
get completed() {
|
|
121
|
+
return this.done;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @param options: target, run facts, clock and sinks (see {@link ProgressStreamOptions}).
|
|
125
|
+
*/
|
|
126
|
+
constructor(options) {
|
|
127
|
+
this.options = options;
|
|
128
|
+
}
|
|
129
|
+
/** Prints the start line and arms the alive ticker. */
|
|
130
|
+
start() {
|
|
131
|
+
if (this.finished)
|
|
132
|
+
return;
|
|
133
|
+
this.startedAt = this.clock();
|
|
134
|
+
this.lastEventAt = this.startedAt;
|
|
135
|
+
this.line(`gateforge: run started — ${String(this.options.expected)} tests expected ` +
|
|
136
|
+
`(runner ${this.options.runner}, scope ${this.options.scope})`);
|
|
137
|
+
this.arm();
|
|
138
|
+
}
|
|
139
|
+
/** Records that a test started (it counts as running for the alive line). */
|
|
140
|
+
beginTest(title) {
|
|
141
|
+
if (this.finished)
|
|
142
|
+
return;
|
|
143
|
+
this.running.add(title);
|
|
144
|
+
this.quiet();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* An event happened: it restarts the QUIET clock, so an alive line
|
|
148
|
+
* only ever reports a run that has genuinely been silent for a whole
|
|
149
|
+
* minute (a busy run is already reporting itself).
|
|
150
|
+
*/
|
|
151
|
+
quiet() {
|
|
152
|
+
this.lastEventAt = this.clock();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Records one finished test: prints its line, counts the outcome, and
|
|
156
|
+
* keeps the guarded diagnosis of a failure for the artifact.
|
|
157
|
+
*
|
|
158
|
+
* @param outcome: the drain's observation of one finished test.
|
|
159
|
+
*/
|
|
160
|
+
endTest(outcome) {
|
|
161
|
+
if (this.finished)
|
|
162
|
+
return;
|
|
163
|
+
this.running.delete(outcome.title);
|
|
164
|
+
this.quiet();
|
|
165
|
+
this.done += 1;
|
|
166
|
+
const counter = `${String(this.done)}/${String(this.options.expected)}`;
|
|
167
|
+
if (outcome.outcome === 'passed') {
|
|
168
|
+
this.passed += 1;
|
|
169
|
+
this.line(`gateforge: ✓ ${counter} ${displayTitle(outcome.title)}`);
|
|
170
|
+
}
|
|
171
|
+
else if (outcome.outcome === 'skipped') {
|
|
172
|
+
this.skipped += 1;
|
|
173
|
+
this.line(`gateforge: – ${counter} ${displayTitle(outcome.title)} (skipped)`);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.failed += 1;
|
|
177
|
+
const detail = outcome.message === undefined || outcome.message.length === 0
|
|
178
|
+
? ''
|
|
179
|
+
: ` — ${displayMessageLine(outcome.message)}`;
|
|
180
|
+
this.line(`gateforge: ✘ ${counter} ${displayTitle(outcome.title)}${detail}`);
|
|
181
|
+
this.failureRecords.push({
|
|
182
|
+
logicalKey: outcome.logicalKey,
|
|
183
|
+
title: safeTitle(outcome.title),
|
|
184
|
+
message: outcome.message === undefined ? '' : guardedMessage(outcome.message),
|
|
185
|
+
stackFrames: dedupeFrames(outcome.stackFrames ?? []),
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/** Prints the finish line and stops the ticker. */
|
|
190
|
+
finish() {
|
|
191
|
+
if (this.finished)
|
|
192
|
+
return;
|
|
193
|
+
this.finished = true;
|
|
194
|
+
this.disarm();
|
|
195
|
+
this.line(`gateforge: run finished — ${String(this.passed)} passed, ${String(this.failed)} failed, ` +
|
|
196
|
+
`${String(this.skipped)} skipped in ${elapsedLabel(this.clock() - this.startedAt)}; grading…`);
|
|
197
|
+
}
|
|
198
|
+
/** The current millisecond reading. */
|
|
199
|
+
clock() {
|
|
200
|
+
return (this.options.now ?? Date.now)();
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The periodic quiet-interval tick: an alive line is printed only when
|
|
204
|
+
* a WHOLE interval passed with no event at all, then the tick re-arms
|
|
205
|
+
* itself until the run finishes. The elapsed time is read from the
|
|
206
|
+
* injected clock, never from the timer, so a test proves the rule
|
|
207
|
+
* without waiting a real minute.
|
|
208
|
+
*/
|
|
209
|
+
alive() {
|
|
210
|
+
this.timer = null;
|
|
211
|
+
if (this.finished)
|
|
212
|
+
return;
|
|
213
|
+
if (this.clock() - this.lastEventAt >= ALIVE_INTERVAL_MS) {
|
|
214
|
+
this.line(`gateforge: alive — ${String(this.done)}/${String(this.options.expected)} done, ` +
|
|
215
|
+
`${String(this.running.size)} running, ${elapsedLabel(this.clock() - this.startedAt)} elapsed`);
|
|
216
|
+
this.lastEventAt = this.clock();
|
|
217
|
+
}
|
|
218
|
+
this.arm();
|
|
219
|
+
}
|
|
220
|
+
/** Arms the next quiet-interval tick (fake clock and timer in tests). */
|
|
221
|
+
arm() {
|
|
222
|
+
const arm = this.options.setTimer ?? ((fn, ms) => setTimeout(fn, ms));
|
|
223
|
+
this.timer = arm(() => {
|
|
224
|
+
this.alive();
|
|
225
|
+
}, ALIVE_INTERVAL_MS);
|
|
226
|
+
}
|
|
227
|
+
/** Disarms the alive timer when one is armed. */
|
|
228
|
+
disarm() {
|
|
229
|
+
if (this.timer === null)
|
|
230
|
+
return;
|
|
231
|
+
const clear = this.options.clearTimer ?? ((handle) => clearTimeout(handle));
|
|
232
|
+
clear(this.timer);
|
|
233
|
+
this.timer = null;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Writes one line, or gives up after warning exactly once: a closed
|
|
237
|
+
* pipe or an unwritable file must never fail a run, and a stream that
|
|
238
|
+
* warns repeatedly is noise.
|
|
239
|
+
*/
|
|
240
|
+
line(text) {
|
|
241
|
+
const target = this.options.writer;
|
|
242
|
+
if (target === null || this.broken)
|
|
243
|
+
return;
|
|
244
|
+
try {
|
|
245
|
+
if (target.kind === 'stderr') {
|
|
246
|
+
this.options.writeLine(text);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
mkdirSync(dirname(target.path), { recursive: true });
|
|
250
|
+
appendFileSync(target.path, `${text}\n`, 'utf8');
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
this.broken = true;
|
|
254
|
+
this.options.warn?.(`warning: progress stream unavailable (${target.kind === 'file' ? target.path : 'stderr'}) — ` +
|
|
255
|
+
'the run continues without it; the stream is never evidence');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/** Frames in first-seen order, at most five (a repeated frame says nothing). */
|
|
260
|
+
function dedupeFrames(frames) {
|
|
261
|
+
return [...new Set(frames)].slice(0, MAX_STACK_FRAMES);
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAuCpD,sEAAsE;AACtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,oDAAoD;AACpD,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,qEAAqE;AACrE,SAAS,SAAS,CAAC,KAAa;IAC9B,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,OAAO,qBAAqB,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAA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