@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
package/dist/args.js
CHANGED
|
@@ -7,7 +7,37 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { UsageError } from './errors.js';
|
|
9
9
|
/** Flags that carry no value (bare presence). */
|
|
10
|
-
const BOOLEAN_FLAGS =
|
|
10
|
+
const BOOLEAN_FLAGS = {
|
|
11
|
+
json: true,
|
|
12
|
+
changed: true,
|
|
13
|
+
staged: true,
|
|
14
|
+
help: true,
|
|
15
|
+
version: true,
|
|
16
|
+
confirm: true,
|
|
17
|
+
'confirm-doc-exclusions': true,
|
|
18
|
+
'confirm-cache-exclusions': true,
|
|
19
|
+
blocking: true,
|
|
20
|
+
'no-blocking': true,
|
|
21
|
+
'strict-e2e': true,
|
|
22
|
+
pytest: true,
|
|
23
|
+
'require-e2e': true,
|
|
24
|
+
'pre-commit': true,
|
|
25
|
+
'no-pre-commit': true,
|
|
26
|
+
ci: true,
|
|
27
|
+
'no-ci': true,
|
|
28
|
+
planes: true,
|
|
29
|
+
'no-planes': true,
|
|
30
|
+
'accept-recommended': true,
|
|
31
|
+
'no-scan': true,
|
|
32
|
+
failed: true,
|
|
33
|
+
'result-only': true,
|
|
34
|
+
timing: true,
|
|
35
|
+
'no-cache': true,
|
|
36
|
+
'explain-presets': true,
|
|
37
|
+
'dry-run': true,
|
|
38
|
+
probe: true,
|
|
39
|
+
'strict-preflight': true,
|
|
40
|
+
};
|
|
11
41
|
/**
|
|
12
42
|
* Parses argv (without node/script) into options + positionals.
|
|
13
43
|
*
|
|
@@ -47,7 +77,7 @@ export function parseArgs(argv) {
|
|
|
47
77
|
if (inlineValue !== undefined) {
|
|
48
78
|
value = inlineValue;
|
|
49
79
|
}
|
|
50
|
-
else if (BOOLEAN_FLAGS
|
|
80
|
+
else if (BOOLEAN_FLAGS[name] === true) {
|
|
51
81
|
value = true;
|
|
52
82
|
}
|
|
53
83
|
else {
|
|
@@ -62,6 +92,11 @@ export function parseArgs(argv) {
|
|
|
62
92
|
if (existing === undefined) {
|
|
63
93
|
options[name] = value;
|
|
64
94
|
}
|
|
95
|
+
else if (Array.isArray(existing)) {
|
|
96
|
+
// A third or later repeat appends; stringifying the array would
|
|
97
|
+
// fuse the earlier values into one comma-joined value.
|
|
98
|
+
options[name] = [...existing, String(value)];
|
|
99
|
+
}
|
|
65
100
|
else if (typeof existing === 'string' && typeof value === 'string') {
|
|
66
101
|
options[name] = [existing, value];
|
|
67
102
|
}
|
|
@@ -93,4 +128,26 @@ export function stringFlag(options, name) {
|
|
|
93
128
|
}
|
|
94
129
|
return value;
|
|
95
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Reads a repeatable string flag as a list of values. A single
|
|
133
|
+
* occurrence yields a one-element list; an absent flag yields
|
|
134
|
+
* undefined. Blank values are dropped (an empty selector would never
|
|
135
|
+
* match anything and would silently narrow nothing).
|
|
136
|
+
*
|
|
137
|
+
* Args:
|
|
138
|
+
* options: parsed options.
|
|
139
|
+
* name: flag name.
|
|
140
|
+
*
|
|
141
|
+
* Returns:
|
|
142
|
+
* string[] | undefined: the values in argv order, or undefined when
|
|
143
|
+
* the flag is absent or carries only blank values.
|
|
144
|
+
*/
|
|
145
|
+
export function repeatableStringFlag(options, name) {
|
|
146
|
+
const value = options[name];
|
|
147
|
+
if (value === undefined)
|
|
148
|
+
return undefined;
|
|
149
|
+
const raw = Array.isArray(value) ? value : [value];
|
|
150
|
+
const values = raw.map(String).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
151
|
+
return values.length === 0 ? undefined : values;
|
|
152
|
+
}
|
|
96
153
|
//# sourceMappingURL=args.js.map
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC,iDAAiD;AACjD,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC,iDAAiD;AACjD,MAAM,aAAa,GAAyB;IAC1C,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,wBAAwB,EAAE,IAAI;IAC9B,0BAA0B,EAAE,IAAI;IAChC,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,oBAAoB,EAAE,IAAI;IAC1B,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;IACnB,MAAM,EAAE,IAAI;IACZ,UAAU,EAA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* The one namespace whose cases are graded from the delivery queue
|
|
3
|
+
* itself rather than from an HTTP attempt. The engine's own
|
|
4
|
+
* `queueObserver` is what makes them gradable: absent that block every
|
|
5
|
+
* `task:*` case fails closed as `missing`, so the pack is only ever
|
|
6
|
+
* OFFERED when the repository declares one. It is last in print order
|
|
7
|
+
* for that reason — a repository without an observer never reaches it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TASK_BEHAVIOR_NAMESPACE: "task";
|
|
10
|
+
/** The behavior packs a repository can be asked to enable cases for. */
|
|
11
|
+
export declare const BEHAVIOR_NAMESPACES: readonly ["webhook", "workflow", "auth", "validation", "task"];
|
|
12
|
+
/** One behavior pack namespace. */
|
|
13
|
+
export type BehaviorNamespace = (typeof BEHAVIOR_NAMESPACES)[number];
|
|
14
|
+
/** The bundled plugin each namespace's cases are graded through. */
|
|
15
|
+
export declare const BEHAVIOR_NAMESPACE_PLUGIN: Readonly<Record<BehaviorNamespace, string>>;
|
|
16
|
+
/** One detected behavior pack, with the file that proves it. */
|
|
17
|
+
export interface DetectedBehaviorPack {
|
|
18
|
+
/** The namespace whose cases the pack covers. */
|
|
19
|
+
namespace: BehaviorNamespace;
|
|
20
|
+
/** The repo-relative file the needle was read from. */
|
|
21
|
+
evidenceFile: string;
|
|
22
|
+
/** The needle text that matched, quoted for the printed offer. */
|
|
23
|
+
evidenceNeedle: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parses the value of `--behavior-packs`.
|
|
27
|
+
*
|
|
28
|
+
* Args:
|
|
29
|
+
* value: the raw flag value (comma-separated namespaces).
|
|
30
|
+
*
|
|
31
|
+
* Returns:
|
|
32
|
+
* BehaviorNamespace[]: the requested namespaces, deduplicated in the
|
|
33
|
+
* canonical print order.
|
|
34
|
+
*
|
|
35
|
+
* Throws:
|
|
36
|
+
* Error: an unknown namespace name — the caller turns it into a usage
|
|
37
|
+
* error naming the known set, so an agent can never silently enable the
|
|
38
|
+
* wrong pack.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseBehaviorPacks(value: string): BehaviorNamespace[];
|
|
41
|
+
/**
|
|
42
|
+
* Detects which behavior packs the repository shows, in print order.
|
|
43
|
+
*
|
|
44
|
+
* The `task` namespace is scanned ONLY when the repository's config
|
|
45
|
+
* declares a `queueObserver`: the engine can only grade a delivery case
|
|
46
|
+
* from a queue it reads itself, so offering the pack without one would
|
|
47
|
+
* print a flag whose cases can never be satisfied. Absent the block the
|
|
48
|
+
* scan never looks for those needles, which is what keeps a repository
|
|
49
|
+
* without an observer byte-identical.
|
|
50
|
+
*
|
|
51
|
+
* Args:
|
|
52
|
+
* cwd: absolute repository root.
|
|
53
|
+
* queueObserverConfigured: whether `.gateforge.yml` declares a
|
|
54
|
+
* `queueObserver` block.
|
|
55
|
+
*
|
|
56
|
+
* Returns:
|
|
57
|
+
* DetectedBehaviorPack[]: one entry per detected namespace, each with
|
|
58
|
+
* the first file that proved it. Empty for a repository that shows none
|
|
59
|
+
* — the byte-identical `init` case.
|
|
60
|
+
*/
|
|
61
|
+
export declare function detectBehaviorPacks(cwd: string, queueObserverConfigured: boolean): DetectedBehaviorPack[];
|
|
62
|
+
/** Human sentence naming why a namespace was detected. */
|
|
63
|
+
export declare function behaviorPackEvidence(pack: DetectedBehaviorPack): string;
|
|
64
|
+
/**
|
|
65
|
+
* The commented example cases init writes for the ENABLED namespaces.
|
|
66
|
+
*
|
|
67
|
+
* Every example is commented: the document itself must still parse as a
|
|
68
|
+
* complete-behavior document with no declarations (a scaffold is never
|
|
69
|
+
* approval), and an example cannot be pasted blind — its resource id is
|
|
70
|
+
* the id `gateforge next` prints for the real route.
|
|
71
|
+
*
|
|
72
|
+
* Args:
|
|
73
|
+
* packs: the detected packs, already filtered to the enabled ones.
|
|
74
|
+
*
|
|
75
|
+
* Returns:
|
|
76
|
+
* string: the YAML text to append to the behavior document (may be
|
|
77
|
+
* empty when no namespace is enabled).
|
|
78
|
+
*/
|
|
79
|
+
export declare function behaviorSkeletonExamples(packs: readonly DetectedBehaviorPack[]): string;
|
|
80
|
+
/**
|
|
81
|
+
* The example case for one namespace, as the owner would write it: the
|
|
82
|
+
* entry contract plus its required negative control. Values the engine
|
|
83
|
+
* reads are real (`channel`, `credentialVariant`, `signatureProfile`);
|
|
84
|
+
* values only the owner knows stay visibly placeheld rather than guessed.
|
|
85
|
+
*
|
|
86
|
+
* The `task` namespace is the exception that proves the rule: its case
|
|
87
|
+
* is graded from the queue the ENGINE produced, so it declares a
|
|
88
|
+
* `deliver` action on the `engine-task` channel and an `attempts` state
|
|
89
|
+
* rule — never an HTTP request, which could never settle a delivery.
|
|
90
|
+
*
|
|
91
|
+
* Args:
|
|
92
|
+
* namespace: the behavior namespace.
|
|
93
|
+
*
|
|
94
|
+
* Returns:
|
|
95
|
+
* string: the YAML case list for one endpoint or task resource.
|
|
96
|
+
*/
|
|
97
|
+
export declare function behaviorExampleCase(namespace: BehaviorNamespace): string;
|
|
98
|
+
/** One adapter-backed entity a case's expectation is graded against. */
|
|
99
|
+
export interface BehaviorEffectFacts {
|
|
100
|
+
/** The effect id, which is also the scope name the observer returns. */
|
|
101
|
+
id: string;
|
|
102
|
+
/** The classified resource id of the entity. */
|
|
103
|
+
resourceId: string;
|
|
104
|
+
/** The reviewed adapter bound to the entity. */
|
|
105
|
+
adapter: string;
|
|
106
|
+
/** The entity's ordered identity columns. */
|
|
107
|
+
identityFields: readonly string[];
|
|
108
|
+
/** The entity's writable columns. */
|
|
109
|
+
fields: readonly string[];
|
|
110
|
+
}
|
|
111
|
+
/** The facts about one discovered endpoint a declaration needs. */
|
|
112
|
+
export interface BehaviorEndpointFacts {
|
|
113
|
+
/** The classified resource id of the endpoint. */
|
|
114
|
+
resourceId: string;
|
|
115
|
+
/** `METHOD /path`, as discovery reports it. */
|
|
116
|
+
routeName: string;
|
|
117
|
+
/** The HTTP method the detector reported. */
|
|
118
|
+
method: string;
|
|
119
|
+
/** The canonical path the detector reported. */
|
|
120
|
+
path: string;
|
|
121
|
+
/** The adapter-backed entities the case may be graded against. */
|
|
122
|
+
effects: readonly BehaviorEffectFacts[];
|
|
123
|
+
}
|
|
124
|
+
/** One declared fixture recipe, as the repository declares it. */
|
|
125
|
+
export interface BehaviorRecipeFacts {
|
|
126
|
+
/** The recipe id a case names in its `fixture:` key. */
|
|
127
|
+
id: string;
|
|
128
|
+
/** The actor the case acts as. */
|
|
129
|
+
actor: string;
|
|
130
|
+
/** The subject key the case's request body is built from. */
|
|
131
|
+
subject: string;
|
|
132
|
+
/**
|
|
133
|
+
* The row a successful delivery is expected to create, as the owner
|
|
134
|
+
* declared it next to the recipe. A mutation contract cannot be proven
|
|
135
|
+
* without it, so its absence is reported, never guessed.
|
|
136
|
+
*/
|
|
137
|
+
creates: Readonly<Record<string, string | number | boolean>> | null;
|
|
138
|
+
}
|
|
139
|
+
/** One printed case: the declaration plus everything keyed by its id. */
|
|
140
|
+
export interface BehaviorCasePrint {
|
|
141
|
+
/** The case id slug inside the endpoint's `cases:` list. */
|
|
142
|
+
id: string;
|
|
143
|
+
/** The contract the case proves. */
|
|
144
|
+
contract: string;
|
|
145
|
+
/** The canonical case id the compiler hashes for this slug. */
|
|
146
|
+
caseId: string;
|
|
147
|
+
/** The obligation id the case compiles into. */
|
|
148
|
+
obligationId: string;
|
|
149
|
+
/** The proof test's title. */
|
|
150
|
+
title: string;
|
|
151
|
+
/** The test-map key for that test. */
|
|
152
|
+
testKey: string;
|
|
153
|
+
}
|
|
154
|
+
/** The complete printed declaration for one endpoint. */
|
|
155
|
+
export interface BehaviorDeclarationPrint {
|
|
156
|
+
/** The `endpoints:` entry, or null when it cannot be completed here. */
|
|
157
|
+
entry: string | null;
|
|
158
|
+
/** One plain line naming why no complete entry could be printed. */
|
|
159
|
+
incompleteReason: string | null;
|
|
160
|
+
/** Every case the entry declares, in declaration order. */
|
|
161
|
+
cases: readonly BehaviorCasePrint[];
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Builds the complete `endpoints:` entry `gateforge next` prints for one
|
|
165
|
+
* discovered route.
|
|
166
|
+
*
|
|
167
|
+
* Everything in the printed text is real: the resource id, the method and
|
|
168
|
+
* path discovery reported, the adapter-backed entity the case is graded
|
|
169
|
+
* against, the recipe the owner declared next to the app, and the case
|
|
170
|
+
* ids the compiler will hash. When a fact is missing the entry is
|
|
171
|
+
* `null` and the reason is printed instead — a declaration that cannot
|
|
172
|
+
* be completed here is never printed as if it could.
|
|
173
|
+
*
|
|
174
|
+
* Args:
|
|
175
|
+
* input: the endpoint's facts, the contracts the policy requires of
|
|
176
|
+
* it, and the fixture recipe the repository declares.
|
|
177
|
+
* caseIdFor: the canonical case-id recipe (`sha256` over domain,
|
|
178
|
+
* resource id and slug), injected so this module stays free of the
|
|
179
|
+
* engine's hashing import.
|
|
180
|
+
*
|
|
181
|
+
* Returns:
|
|
182
|
+
* BehaviorDeclarationPrint: the printable entry and its cases.
|
|
183
|
+
*/
|
|
184
|
+
export declare function buildEndpointDeclaration(input: {
|
|
185
|
+
endpoint: BehaviorEndpointFacts;
|
|
186
|
+
requiredContracts: readonly string[];
|
|
187
|
+
recipe: BehaviorRecipeFacts | null;
|
|
188
|
+
caseIdFor: (resourceId: string, slug: string) => string;
|
|
189
|
+
specFile: string;
|
|
190
|
+
project: string;
|
|
191
|
+
runner: string;
|
|
192
|
+
}): BehaviorDeclarationPrint;
|
|
193
|
+
/**
|
|
194
|
+
* The proof test the printed cases are proven through: one test per case,
|
|
195
|
+
* each naming its canonical case id and asking the ENGINE to drive it.
|
|
196
|
+
* The test body asserts only that the engine sealed a record — clicks and
|
|
197
|
+
* assertions of its own would prove nothing.
|
|
198
|
+
*
|
|
199
|
+
* Args:
|
|
200
|
+
* input: the endpoint id and the printed cases.
|
|
201
|
+
*
|
|
202
|
+
* Returns:
|
|
203
|
+
* string: the complete spec file content.
|
|
204
|
+
*/
|
|
205
|
+
export declare function renderProofSpec(input: {
|
|
206
|
+
resourceId: string;
|
|
207
|
+
cases: readonly BehaviorCasePrint[];
|
|
208
|
+
}): string;
|
|
209
|
+
/**
|
|
210
|
+
* The `.gateforge/test-map.yml` entries that connect each printed case to
|
|
211
|
+
* its proof test. Mapping is intent — only engine-issued case evidence
|
|
212
|
+
* can satisfy the claim — so the entries carry the real case ids.
|
|
213
|
+
*
|
|
214
|
+
* Args:
|
|
215
|
+
* input: the printed cases and the runner identity that keys them.
|
|
216
|
+
*
|
|
217
|
+
* Returns:
|
|
218
|
+
* string: the `tests:` entries, indented for the document.
|
|
219
|
+
*/
|
|
220
|
+
export declare function renderTestMapEntries(input: {
|
|
221
|
+
cases: readonly BehaviorCasePrint[];
|
|
222
|
+
specFile: string;
|
|
223
|
+
project: string;
|
|
224
|
+
runner: string;
|
|
225
|
+
}): string;
|
|
226
|
+
/**
|
|
227
|
+
* Reads the fixture recipes a repository declares. Any YAML document
|
|
228
|
+
* under `fixtures/` that carries a `recipes:` list is read, so an
|
|
229
|
+
* application may keep one shared file or one per namespace.
|
|
230
|
+
*
|
|
231
|
+
* Args:
|
|
232
|
+
* cwd: absolute repository root.
|
|
233
|
+
*
|
|
234
|
+
* Returns:
|
|
235
|
+
* BehaviorRecipeFacts[]: the declared recipes in document order; empty
|
|
236
|
+
* when the repository declares none.
|
|
237
|
+
*/
|
|
238
|
+
export declare function loadBehaviorRecipes(cwd: string): BehaviorRecipeFacts[];
|
|
239
|
+
//# sourceMappingURL=behavior-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-setup.d.ts","sourceRoot":"","sources":["../src/behavior-setup.ts"],"names":[],"mappings":"AAkCA;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAG,MAAe,CAAC;AAEvD,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,gEAAkE,CAAC;AAEnG,mCAAmC;AACnC,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAerE,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,EAAE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