@gate-forge/cli 0.5.0 → 0.6.1
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 +51 -6
- package/dist/args.js +1 -1
- package/dist/args.js.map +1 -1
- package/dist/broker.d.ts.map +1 -1
- package/dist/broker.js +10 -14
- package/dist/broker.js.map +1 -1
- package/dist/cli.d.ts +2 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/blocking.d.ts +3 -0
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +38 -2
- package/dist/commands/blocking.js.map +1 -1
- package/dist/commands/check.d.ts +40 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +37 -4
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +54 -97
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pre-commit.d.ts +5 -0
- package/dist/commands/pre-commit.d.ts.map +1 -0
- package/dist/commands/pre-commit.js +213 -0
- package/dist/commands/pre-commit.js.map +1 -0
- package/dist/commands/test-gates.d.ts +51 -0
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +32 -22
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/execution.d.ts +1 -0
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +9 -0
- package/dist/execution.js.map +1 -1
- package/dist/git-hooks.d.ts +7 -2
- package/dist/git-hooks.d.ts.map +1 -1
- package/dist/git-hooks.js +48 -12
- package/dist/git-hooks.js.map +1 -1
- package/dist/input-snapshot.d.ts +5 -1
- package/dist/input-snapshot.d.ts.map +1 -1
- package/dist/input-snapshot.js +6 -3
- package/dist/input-snapshot.js.map +1 -1
- package/dist/io.d.ts +0 -3
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js.map +1 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +29 -7
- package/dist/pipeline.js.map +1 -1
- package/dist/runtime.d.ts +114 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +682 -0
- package/dist/runtime.js.map +1 -0
- package/dist/staged-candidate.d.ts +1 -1
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +5 -4
- package/dist/staged-candidate.js.map +1 -1
- package/package.json +9 -9
- package/dist/commands/controller.d.ts +0 -43
- package/dist/commands/controller.d.ts.map +0 -1
- package/dist/commands/controller.js +0 -110
- package/dist/commands/controller.js.map +0 -1
- package/dist/isolation.d.ts +0 -104
- package/dist/isolation.d.ts.map +0 -1
- package/dist/isolation.js +0 -353
- package/dist/isolation.js.map +0 -1
- package/dist/podman-bootstrap.d.ts +0 -59
- package/dist/podman-bootstrap.d.ts.map +0 -1
- package/dist/podman-bootstrap.js +0 -123
- package/dist/podman-bootstrap.js.map +0 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ never rewrite existing journeys, never `tests mark` as proof.
|
|
|
32
32
|
|
|
33
33
|
| Command | Purpose | Exit codes |
|
|
34
34
|
| --- | --- | --- |
|
|
35
|
-
| `gateforge init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan] [--proof overlay\|observe] [--blocking] [--strict-e2e]
|
|
35
|
+
| `gateforge init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan] [--proof overlay\|observe] [--blocking] [--strict-e2e]` | Scan the repo (heuristics, no network), print the recommended install (plugins, persistence-only policy, overlay proof), and write `.gateforge.yml`, `.gateforge/policies.yml`, `.gateforge/classification-policy.yml`, `.gateforge/baselines/obligations.json`, `GATEFORGE.md`, and (overlay proof only) `tests/e2e/gateforge/README.md`. Idempotent — never overwrites existing files. `pack-task` is opt-in only (`--plugins`); `--proof observe` skips the overlay scaffold and prints the observe wiring checklist instead. Default language: `python`. `--strict-e2e` writes the `enforcement` block and refuses unavailable required proof channels. | 0/1/2 |
|
|
36
36
|
| `gateforge next [--changed] [--json]` | Print the ONE blocking next action (`next`/`cause`/`why`/`do`; `--json` adds `remainingBlocking`). Navigation, not the gate: never requires an E2E receipt. Exit 0 clean, 1 next action, 2 config/usage. | 0/1/2 |
|
|
37
37
|
| `gateforge discover [--json]` | Run every configured detector over the expanded `project.paths` and dump the resource graph (default: human listing; `--json`: GF-canonical JSON). | 0 |
|
|
38
38
|
| `gateforge classify [--json] [--write-snapshot <path>]` | Recompute effective classifications from detector signals and print decisions, traces, and typed blocks. Snapshots are derived review artifacts and never pipeline input. | 0/1/2 |
|
|
@@ -46,6 +46,7 @@ never rewrite existing journeys, never `tests mark` as proof.
|
|
|
46
46
|
| `gateforge check [--changed] [--staged] [--require-e2e] [--format text\|json\|sarif]` | The full gate: discover → classify → obligations → claims → verdicts → report. `--changed` evaluates one effective scope: only obligations/blockers tied to files the resolved diff provider reports — unless the diff touches a gate-defining input (`.gateforge.yml`, configured policy/classification paths, planes/http-clients/fastapi configs, adapters, waivers, repo-local plugin modules, dependency manifests/lockfiles, ignore controls), a test file or helper, the runner configuration, or the mapping sidecar, which expands the run to all obligations (reported as `scope` metadata with `expandedBecause` reasons). `--staged` gates the EXACT staged candidate (frozen index checkout, never the worktree; mutually exclusive with `--changed`). `--require-e2e` blocks without a valid, non-stale gate receipt (see Enforcement). `--format` default `text`. Verifier key via `GATEFORGE_WITNESS_VERIFIER_KEY` env (see trust model). | 0 clean/waived, 1 unresolved, 2 config/usage |
|
|
47
47
|
| `gateforge test-gates [--changed] [--scope full\|changed] [--suite <cmd>] [--out <dir>] [--format F] [--witness-url <url>] [--run-token <token>]` | Two modes. Supervised `--changed`: trusted runner supervision over the obligations — resolves catalog + mappings, fixes the expected test set, executes the configured Playwright suite through the adapter, enforces planned-vs-executed completeness, and seals an authenticated gate receipt ONLY after complete success. `--scope changed` (supervised only, opt-in): plan, execute, and seal only the slice of tests whose files claim obligations affected by the resolved changed-file set — an affected obligation with no testable declared mapping blocks (`EVIDENCE_SCOPE_INCOMPLETE`), an empty slice seals nothing, and `check --require-e2e` accepts a slice receipt only when it covers every obligation arising from the currently-changed files. Without the flag behavior is unchanged (full suite, whole-repo receipt). Legacy `--suite`: the orchestration escape hatch (cannot be combined with `--changed`, and can never redefine the strict gate's expected cases). A nonzero suite exit fails the run. Verifier key via `GATEFORGE_WITNESS_VERIFIER_KEY` env. | 0/1/2 (suite failure forces 1) |
|
|
48
48
|
| `gateforge broker commit --workspace <dir> --message <msg> [--receipt <path>] [--ref <ref>]` | Managed-mode commit broker (MECHANISM, not deployment): snapshots the workspace bytes into a throwaway index, recomputes the input + trusted-policy digests, verifies a valid non-stale gate receipt for EXACTLY those bytes, then creates the commit via compare-and-swap `git update-ref`. Typed rejections (`ENFORCEMENT_UNTRUSTED` / `EVIDENCE_STALE` / `RUN_INCOMPLETE` / `BROKER_CAS_MISMATCH` / `BROKER_UNSAFE_MESSAGE`); symlinks/submodules are typed rejections. Verifier key via env; runs with cwd = the AUTHORITATIVE repository. | 0/2 |
|
|
49
|
+
| `gateforge pre-commit --scope staged\|full` | The witnessed commit gate: freezes the Git index, materializes it into a scratch checkout, prepares the candidate's staged runtime (`.gateforge/runtime.yml` — below), runs the supervised witness gate INSIDE that checkout (`staged`: only tests mapped to obligations affected by the staged paths, `EVIDENCE_SCOPE_INCOMPLETE` blocks an unmapped affected obligation; `full`: the complete relevant mapped suite), validates the fresh receipt against the same checkout, rechecks the original index/HEAD/MERGE_HEAD, and copies only Gateforge audit artifacts (run state incl. runtime logs) back. Runtime preparation/readiness failures are typed (`RUNTIME_PREPARATION_FAILED` / `RUNTIME_READINESS_FAILED`); child process groups are cleaned up on every exit path. Install via `gateforge init --blocking --witnessed staged\|full`. | 0/1/2 |
|
|
49
50
|
| `gateforge enforcement doctor [--json]` | Honest enforcement diagnostics: config, hook presence + ACTIVATION, runner readiness, observer capability, trusted binary/policy ownership, snapshot mode, and the standard/managed boundary. Detecting a hook NEVER counts as managed protection. Diagnostic only: exit 0 whenever it runs. | 0/2 |
|
|
50
51
|
| `gateforge baseline update <fp...>` | Shrink the baseline to a strict subset (invariant 4). | 0/2 |
|
|
51
52
|
|
|
@@ -54,6 +55,55 @@ Global flags: `--help`, `--version`. Exit codes per architecture contract 4:
|
|
|
54
55
|
run), `2` config/usage error. `tests diagnose` has its own advisory contract
|
|
55
56
|
(0/1/2 above).
|
|
56
57
|
|
|
58
|
+
## Staged runtime (`.gateforge/runtime.yml`)
|
|
59
|
+
|
|
60
|
+
`gateforge pre-commit` executes the candidate inside a materialized checkout
|
|
61
|
+
that contains TRACKED bytes only — no installed dependencies, no built
|
|
62
|
+
assets, no application processes. The owner-reviewed staged-runtime document
|
|
63
|
+
declares how that checkout becomes a runnable candidate. It is
|
|
64
|
+
security-sensitive: its bytes are hashed into the trusted policy digest and
|
|
65
|
+
the authenticated input snapshot, so a candidate that edits its own runtime
|
|
66
|
+
commands cannot approve the edit in the same commit.
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
schemaVersion: 1
|
|
70
|
+
prepare:
|
|
71
|
+
command: npm ci --offline # or pnpm/bun/uv — frozen install, build steps
|
|
72
|
+
reuse: [node_modules] # dependency dirs EXPLICITLY allowed to link from the user repo
|
|
73
|
+
timeoutSeconds: 600
|
|
74
|
+
services: # candidate-owned app/database/worker processes
|
|
75
|
+
- id: app
|
|
76
|
+
command: node server.js --port ${service:app:port}
|
|
77
|
+
attested: true # fronted by the gate's attestation proxy
|
|
78
|
+
fingerprint: prod-v1 # GF-13 marker (reviewed adapters must declare the same)
|
|
79
|
+
target: true # this proxy URL becomes the run's attested target
|
|
80
|
+
ready: { log: 'listening on', timeoutSeconds: 60 } # or http: <url>
|
|
81
|
+
envAllowlist: [DATABASE_URL] # operator env names allowed through to children
|
|
82
|
+
executionTimeoutSeconds: 1800 # whole-run budget handed to the supervised gate
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Contract highlights:
|
|
86
|
+
|
|
87
|
+
- Services start from the CHECKOUT bytes (never the worktree) in their own
|
|
88
|
+
process groups; readiness (`log` regex or `http` 2xx), startup, and
|
|
89
|
+
execution timeouts are bounded; stdout/stderr are captured to
|
|
90
|
+
`<run-state>/runtime/<id>.log`; teardown happens on success, failure,
|
|
91
|
+
timeout, and interruption (SIGINT/SIGTERM kill the whole groups).
|
|
92
|
+
- Every `prepare.reuse` tree is constrained to a normalized repository-relative
|
|
93
|
+
path. Its reachable dependency bytes are hashed into the authenticated
|
|
94
|
+
input identity, so changing an ignored reused dependency invalidates the
|
|
95
|
+
receipt even though the checkout uses a link.
|
|
96
|
+
- `${service:<id>:port}` / `${service:<id>:url}` placeholders are
|
|
97
|
+
substituted by the supervisor and injected into every service's
|
|
98
|
+
environment (`GATEFORGE_SERVICE_PORT_<ID>` / `GATEFORGE_SERVICE_URL_<ID>`).
|
|
99
|
+
- The attested target is the process THE GATE started from the frozen
|
|
100
|
+
candidate — a bare target URL proves nothing. The receipt binds the raw-
|
|
101
|
+
ingested tree of the prepared checkout (`targetArtifactDigest`), and the
|
|
102
|
+
user's index is rechecked before authorization.
|
|
103
|
+
- ABSENT document = no bridge, no services (fail closed): discovery that
|
|
104
|
+
needs installed dependencies blocks honestly instead of silently reusing
|
|
105
|
+
the worktree's environment.
|
|
106
|
+
|
|
57
107
|
## Existing-test reuse (`gateforge tests`)
|
|
58
108
|
|
|
59
109
|
The reuse-first workflow: inspect what exists, declare what is unclear, run
|
|
@@ -598,11 +648,6 @@ expected context, every witnessed record demotes to claimed-tier
|
|
|
598
648
|
owner actions — the complete template and settings list ship from
|
|
599
649
|
`init --blocking`, but a local simulation does not complete a server
|
|
600
650
|
rollout (`docs/plans/immediate/20260913_consumer_migration_record.md`).
|
|
601
|
-
- Managed mode ships the broker mechanism plus rootless-Podman reference
|
|
602
|
-
deployment assets under `deploy/managed/`; those assets do not provision
|
|
603
|
-
the authoritative Git directory, credentials, protected refs, or external
|
|
604
|
-
app/worker services. The current managed backend supports Linux rootless
|
|
605
|
-
Podman only and rejects other platforms rather than guessing.
|
|
606
651
|
|
|
607
652
|
## Development
|
|
608
653
|
|
package/dist/args.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { UsageError } from './errors.js';
|
|
9
9
|
/** Flags that carry no value (bare presence). */
|
|
10
|
-
const BOOLEAN_FLAGS = new Set(['json', 'changed', 'staged', 'help', 'version', 'blocking', 'no-blocking', 'strict-e2e', '
|
|
10
|
+
const BOOLEAN_FLAGS = new Set(['json', 'changed', 'staged', 'help', 'version', 'blocking', 'no-blocking', 'strict-e2e', 'pytest', 'require-e2e', 'pre-commit', 'no-pre-commit', 'ci', 'no-ci', 'planes', 'no-planes', 'accept-recommended', 'no-scan']);
|
|
11
11
|
/**
|
|
12
12
|
* Parses argv (without node/script) into options + positionals.
|
|
13
13
|
*
|
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,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,
|
|
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,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EA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K,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,UAAU,CAAC,WAAW,IAAI,0BAA0B,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/broker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker.d.ts","sourceRoot":"","sources":["../src/broker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"broker.d.ts","sourceRoot":"","sources":["../src/broker.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAOlC,eAAO,MAAM,YAAY,QAOgC,CAAC;AAE1D,wDAAwD;AACxD,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;gBACS,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAK9C;AAwED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2M1F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAWpF"}
|
package/dist/broker.js
CHANGED
|
@@ -46,7 +46,6 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
46
46
|
import { spawnSync } from 'node:child_process';
|
|
47
47
|
import { join, resolve } from 'node:path';
|
|
48
48
|
import { loadConfig, verifyGateReceipt, executionBoundaryDigestOf } from '@gate-forge/core';
|
|
49
|
-
import { isolationProfileForEnvironment } from './isolation.js';
|
|
50
49
|
import { parseArgs } from './args.js';
|
|
51
50
|
import { trustedPolicyDigestForConfig, SUPERVISED_INVOCATION } from './execution.js';
|
|
52
51
|
import { UsageError } from './errors.js';
|
|
@@ -104,20 +103,18 @@ function authorityGit(cwd, env, args, extraEnv = {}) {
|
|
|
104
103
|
};
|
|
105
104
|
}
|
|
106
105
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
106
|
+
* Returns the owner-controlled boundary label used to bind broker receipts.
|
|
107
|
+
*
|
|
108
|
+
* Args:
|
|
109
|
+
* env: owner-controlled broker environment.
|
|
110
|
+
*
|
|
111
|
+
* Returns:
|
|
112
|
+
* string: configured boundary label or the honest local default.
|
|
109
113
|
*/
|
|
110
114
|
function authorityBoundaryLabel(env) {
|
|
111
115
|
const raw = env['GATEFORGE_AUTHORITY_BOUNDARY'];
|
|
112
116
|
return typeof raw === 'string' && raw.length > 0 ? raw : 'local-unisolated';
|
|
113
117
|
}
|
|
114
|
-
/**
|
|
115
|
-
* Normalized execution-boundary profile accepted by this authority.
|
|
116
|
-
* Managed-authoritative is an authority label, not a receipt profile.
|
|
117
|
-
*/
|
|
118
|
-
function authorityBoundaryProfile(env) {
|
|
119
|
-
return isolationProfileForEnvironment(env);
|
|
120
|
-
}
|
|
121
118
|
/**
|
|
122
119
|
* Recomputes the workspace candidate's trusted digests from RAW file
|
|
123
120
|
* bytes only: the resolved config (pure YAML parse — no plugin import,
|
|
@@ -246,7 +243,7 @@ export async function brokerCommitCommand(io, argv) {
|
|
|
246
243
|
if (verifierKey === undefined || verifierKey.length === 0) {
|
|
247
244
|
throw new BrokerRejection('ENFORCEMENT_UNTRUSTED', 'no witness verifier key in the broker environment; the receipt cannot be authenticated (fail closed)');
|
|
248
245
|
}
|
|
249
|
-
const expectedBoundary = executionBoundaryDigestOf(
|
|
246
|
+
const expectedBoundary = executionBoundaryDigestOf(authorityBoundaryLabel(io.env));
|
|
250
247
|
const verified = verifyGateReceipt(verifierKey, receiptRaw, {
|
|
251
248
|
candidateTreeId: treeId,
|
|
252
249
|
trustedPolicyDigest: digests.trustedPolicyDigest,
|
|
@@ -262,8 +259,7 @@ export async function brokerCommitCommand(io, argv) {
|
|
|
262
259
|
}
|
|
263
260
|
if (verified.rejection === 'boundary-mismatch') {
|
|
264
261
|
throw new BrokerRejection('ENFORCEMENT_UNTRUSTED', `broker: ${verified.detail} — this authority requires execution-boundary ` +
|
|
265
|
-
`'${
|
|
266
|
-
'managed acceptance (fail closed)');
|
|
262
|
+
`'${authorityBoundaryLabel(io.env)}'; a '${'local-unisolated'}' receipt cannot authorize managed acceptance (fail closed)`);
|
|
267
263
|
}
|
|
268
264
|
throw new BrokerRejection('ENFORCEMENT_UNTRUSTED', `broker: ${verified.detail}`);
|
|
269
265
|
}
|
|
@@ -315,7 +311,7 @@ export async function brokerCommitCommand(io, argv) {
|
|
|
315
311
|
throw new BrokerRejection('BROKER_CAS_MISMATCH', `the authoritative ref '${ref}' moved during the commit (compare-and-swap rejected; expected parent ` +
|
|
316
312
|
`'${parentSha ?? 'unborn'}'); no commit was accepted`);
|
|
317
313
|
}
|
|
318
|
-
writeLine(io.stdout, `broker: committed ${newSha} on ${ref} (tree ${treeId}, receipt ${receipt.receiptId}, boundary ${authorityBoundaryLabel(io.env)}
|
|
314
|
+
writeLine(io.stdout, `broker: committed ${newSha} on ${ref} (tree ${treeId}, receipt ${receipt.receiptId}, boundary ${authorityBoundaryLabel(io.env)})`);
|
|
319
315
|
writeLine(io.stdout, 'managed-mode note: this guarantee holds only while the broker (Git dir, engine, verifier key) stays outside the agent boundary (ADR 0005 D1)');
|
|
320
316
|
return 0;
|
|
321
317
|
}
|
package/dist/broker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker.js","sourceRoot":"","sources":["../src/broker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACnC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,MAAM,IAAI,UAAU,CAAC,8BAA8B,GAAG,0BAA0B,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import type { Io } from './io.js';
|
|
2
|
-
import { type ControllerRuntime } from './commands/controller.js';
|
|
3
|
-
/** Optional runtime seams used by the controller lifecycle tests. */
|
|
4
|
-
export interface MainDependencies {
|
|
5
|
-
controller?: ControllerRuntime;
|
|
6
|
-
}
|
|
7
2
|
/** The top-level usage text (also printed for `--help`). */
|
|
8
|
-
export declare const USAGE = "usage: gateforge <command> [options]\n\ncommands:\n init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]\n [--proof overlay|observe] [--blocking] [--strict-e2e] [--
|
|
3
|
+
export declare const USAGE = "usage: gateforge <command> [options]\n\ncommands:\n init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]\n [--proof overlay|observe] [--blocking] [--strict-e2e] [--witnessed staged|full]\n scan the repo, print the recommended install, and write\n .gateforge.yml + skeleton + GATEFORGE.md + overlay README\n (idempotent; --blocking installs AND verifies an active\n pre-commit hook + CI wiring)\n enforce wire the blocking pre-commit + CI gate into an initialized repo (idempotent)\n adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate\n discover [--json] run detectors and dump the resource graph\n classify [--json] [--write-snapshot P] inspect effective classifications + typed blocks\n explain <resourceId> [--json] full signal/rule/obligation trace for one resource\n tests discover [--json] [--pytest] inventory existing tests into the run-state catalog\n tests suggest [--changed] [--json] suggest existing tests for uncovered obligations (inspection, never a gate)\n tests mark --test K --kind K [--category C]...\n --obligation ID... --reason \"T\" declare an existing test in .gateforge/test-map.yml (atomic, idempotent)\n tests explain --test K [--json] requirements/mapping/next action for one existing test\n tests diagnose [--suite N] [--json] run the configured pytest diagnostic suites (advisory; exit 0/1/2)\n obligations [--json] evaluate policies and dump obligations\n check [--changed] [--staged] run the full gate and report (F: text|json|sarif). --staged gates the\n [--require-e2e] [--format F] EXACT staged candidate (frozen index checkout, never the worktree);\n --require-e2e blocks without a valid, non-stale gate receipt\n next [--changed] [--json] print the ONE blocking next action (navigation, not the gate)\n test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the\n [--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success\n [--witness-url URL]\n pre-commit --scope staged|full freeze the Git index, run the witnessed gate against those exact\n bytes, validate the new receipt, and recheck the index before success\n broker commit --workspace DIR commit broker (MECHANISM, not deployment): verifies a gate\n --message MSG [--receipt P] receipt for the exact workspace bytes, then commits via compare-and-swap\n [--ref REF] ref update. Guaranteed only when the broker runs outside the agent's\n write/process boundary (ADR 0005 D1)\n enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,\n trusted binary/policy ownership, snapshot mode, standard/managed boundary\n baseline update <fp...> shrink the baseline to a strict subset (invariant 4)\n waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation\n --owner N --approver N (GF-15: all fields mandatory; justification URL required;\n --justification-url U --expires D no --force \u2014 renewal is a hand-edit of the written file)\n --version print the version\n --help show this help\n\nexit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error";
|
|
9
4
|
/**
|
|
10
5
|
* Runs the gateforge CLI.
|
|
11
6
|
*
|
|
12
7
|
* Args:
|
|
13
8
|
* argv: arguments after `gateforge` (node/script already stripped).
|
|
14
9
|
* io: process context (defaults to the live process).
|
|
15
|
-
* dependencies: optional lifecycle seams for controller tests.
|
|
16
10
|
*
|
|
17
11
|
* Returns:
|
|
18
12
|
* Promise<number>: the process exit code.
|
|
19
13
|
*/
|
|
20
|
-
export declare function main(argv: readonly string[], io?: Io
|
|
14
|
+
export declare function main(argv: readonly string[], io?: Io): Promise<number>;
|
|
21
15
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAoBlC,4DAA4D;AAC5D,eAAO,MAAM,KAAK,80HA4CyD,CAAC;AAE5E;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,EAAgB,GACnB,OAAO,CAAC,MAAM,CAAC,CA0DjB"}
|
package/dist/cli.js
CHANGED
|
@@ -19,13 +19,13 @@ import { obligationsCommand } from './commands/obligations.js';
|
|
|
19
19
|
import { checkCommand } from './commands/check.js';
|
|
20
20
|
import { nextCommand } from './commands/next.js';
|
|
21
21
|
import { testGatesCommand } from './commands/test-gates.js';
|
|
22
|
+
import { preCommitCommand } from './commands/pre-commit.js';
|
|
22
23
|
import { baselineCommand } from './commands/baseline.js';
|
|
23
24
|
import { waiveCommand } from './commands/waive.js';
|
|
24
25
|
import { classifyCommand } from './commands/classify.js';
|
|
25
26
|
import { explainCommand } from './commands/explain.js';
|
|
26
27
|
import { testsCommand } from './commands/tests.js';
|
|
27
28
|
import { enforcementCommand } from './commands/enforcement.js';
|
|
28
|
-
import { controllerCommand } from './commands/controller.js';
|
|
29
29
|
import { brokerCommand } from './broker.js';
|
|
30
30
|
/** The top-level usage text (also printed for `--help`). */
|
|
31
31
|
export const USAGE = `\
|
|
@@ -33,12 +33,11 @@ usage: gateforge <command> [options]
|
|
|
33
33
|
|
|
34
34
|
commands:
|
|
35
35
|
init [--languages <comma,list>] [--plugins <comma,list>] [--accept-recommended] [--no-scan]
|
|
36
|
-
[--proof overlay|observe] [--blocking] [--strict-e2e] [--
|
|
36
|
+
[--proof overlay|observe] [--blocking] [--strict-e2e] [--witnessed staged|full]
|
|
37
37
|
scan the repo, print the recommended install, and write
|
|
38
38
|
.gateforge.yml + skeleton + GATEFORGE.md + overlay README
|
|
39
39
|
(idempotent; --blocking installs AND verifies an active
|
|
40
|
-
pre-commit hook + CI wiring
|
|
41
|
-
verifies rootless Podman before writing managed config)
|
|
40
|
+
pre-commit hook + CI wiring)
|
|
42
41
|
enforce wire the blocking pre-commit + CI gate into an initialized repo (idempotent)
|
|
43
42
|
adopt adopt enforcement: seed the baseline from current debt (the one bulk-add) + wire the gate
|
|
44
43
|
discover [--json] run detectors and dump the resource graph
|
|
@@ -58,14 +57,15 @@ commands:
|
|
|
58
57
|
test-gates [--changed] [--suite CMD] supervised E2E run over the obligations (--changed) or the
|
|
59
58
|
[--out DIR] [--format F] legacy suite escape hatch; seals a gate receipt on complete success
|
|
60
59
|
[--witness-url URL]
|
|
61
|
-
|
|
60
|
+
pre-commit --scope staged|full freeze the Git index, run the witnessed gate against those exact
|
|
61
|
+
bytes, validate the new receipt, and recheck the index before success
|
|
62
|
+
broker commit --workspace DIR commit broker (MECHANISM, not deployment): verifies a gate
|
|
62
63
|
--message MSG [--receipt P] receipt for the exact workspace bytes, then commits via compare-and-swap
|
|
63
64
|
[--ref REF] ref update. Guaranteed only when the broker runs outside the agent's
|
|
64
65
|
write/process boundary (ADR 0005 D1)
|
|
65
66
|
enforcement doctor [--json] honest enforcement diagnostics: hook activation, runner/observer readiness,
|
|
66
67
|
trusted binary/policy ownership, snapshot mode, standard/managed boundary
|
|
67
68
|
baseline update <fp...> shrink the baseline to a strict subset (invariant 4)
|
|
68
|
-
controller run the managed controller lifecycle
|
|
69
69
|
waive <resourceId:contract> write an expiring, owner-approved waiver for one obligation
|
|
70
70
|
--owner N --approver N (GF-15: all fields mandatory; justification URL required;
|
|
71
71
|
--justification-url U --expires D no --force — renewal is a hand-edit of the written file)
|
|
@@ -79,12 +79,11 @@ exit codes: 0 clean/waived, 1 unresolved obligations, 2 config/usage error`;
|
|
|
79
79
|
* Args:
|
|
80
80
|
* argv: arguments after `gateforge` (node/script already stripped).
|
|
81
81
|
* io: process context (defaults to the live process).
|
|
82
|
-
* dependencies: optional lifecycle seams for controller tests.
|
|
83
82
|
*
|
|
84
83
|
* Returns:
|
|
85
84
|
* Promise<number>: the process exit code.
|
|
86
85
|
*/
|
|
87
|
-
export async function main(argv, io = processIo()
|
|
86
|
+
export async function main(argv, io = processIo()) {
|
|
88
87
|
const first = argv[0];
|
|
89
88
|
if (first === undefined || first === '--help' || first === '-h' || first === 'help') {
|
|
90
89
|
writeLine(io.stdout, USAGE);
|
|
@@ -124,12 +123,12 @@ export async function main(argv, io = processIo(), dependencies = {}) {
|
|
|
124
123
|
return runWithExitCodes(io, () => nextCommand(io, rest));
|
|
125
124
|
case 'test-gates':
|
|
126
125
|
return runWithExitCodes(io, () => testGatesCommand(io, rest));
|
|
126
|
+
case 'pre-commit':
|
|
127
|
+
return runWithExitCodes(io, () => preCommitCommand(io, rest));
|
|
127
128
|
case 'enforcement':
|
|
128
129
|
return runWithExitCodes(io, () => enforcementCommand(io, rest));
|
|
129
130
|
case 'broker':
|
|
130
131
|
return runWithExitCodes(io, () => brokerCommand(io, rest));
|
|
131
|
-
case 'controller':
|
|
132
|
-
return runWithExitCodes(io, () => controllerCommand(io, rest, dependencies.controller));
|
|
133
132
|
case 'baseline':
|
|
134
133
|
return runWithExitCodes(io, () => Promise.resolve(baselineCommand(io, rest)));
|
|
135
134
|
case 'waive':
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,C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E,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAClE,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,KAAK,UAAU;YACb,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAChF,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC5D;YACE,OAAO,gBAAgB,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;gBACrC,sEAAsE;gBACtE,SAAS,CAAC,IAAI,CAAC,CAAC;gBAChB,MAAM,IAAI,UAAU,CAAC,oBAAoB,OAAO,GAAG,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;IACP,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Io } from '../io.js';
|
|
2
|
+
/** Marker boundaries for the Gateforge-owned generated wrapper script. */
|
|
3
|
+
export declare const GENERATED_HOOK_MARKER_BEGIN = "// >>> gateforge generated hook v1 >>>";
|
|
4
|
+
export declare const GENERATED_HOOK_MARKER_END = "// <<< gateforge generated hook v1 <<<";
|
|
2
5
|
/**
|
|
3
6
|
* Resolves the engine root from the live CLI invocation, when gateforge
|
|
4
7
|
* was started as `<engine>/packages/cli/bin/gateforge.js`. Returns null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocking.d.ts","sourceRoot":"","sources":["../../src/commands/blocking.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAIxD;
|
|
1
|
+
{"version":3,"file":"blocking.d.ts","sourceRoot":"","sources":["../../src/commands/blocking.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AACpF,eAAO,MAAM,yBAAyB,2CAA2C,CAAC;AAElF;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAIxD;AAmHD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAY5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,EAAE,EACN,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,GAAE,SAAS,MAAM,EAA2B,GACnD,MAAM,CAwBR;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAchD;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAiBlD;AAED,yFAAyF;AACzF,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,EAAE,EACN,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,GAAE,SAAS,MAAM,EAA2B,GACnD,IAAI,CAKN"}
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
13
13
|
import { join } from 'node:path';
|
|
14
14
|
import { writeLine } from '../io.js';
|
|
15
|
+
/** Marker boundaries for the Gateforge-owned generated wrapper script. */
|
|
16
|
+
export const GENERATED_HOOK_MARKER_BEGIN = '// >>> gateforge generated hook v1 >>>';
|
|
17
|
+
export const GENERATED_HOOK_MARKER_END = '// <<< gateforge generated hook v1 <<<';
|
|
15
18
|
/**
|
|
16
19
|
* Resolves the engine root from the live CLI invocation, when gateforge
|
|
17
20
|
* was started as `<engine>/packages/cli/bin/gateforge.js`. Returns null
|
|
@@ -24,7 +27,8 @@ export function engineRootFromInvocation() {
|
|
|
24
27
|
return null;
|
|
25
28
|
return join(entry, '..', '..', '..', '..');
|
|
26
29
|
}
|
|
27
|
-
const hookScriptTemplate = (gateArgs) =>
|
|
30
|
+
const hookScriptTemplate = (gateArgs) => `${GENERATED_HOOK_MARKER_BEGIN}
|
|
31
|
+
// Cross-platform entry for the blocking static gate (generated by
|
|
28
32
|
// \`gateforge\`). Requires Node, like the CLI.
|
|
29
33
|
//
|
|
30
34
|
// Resolution order:
|
|
@@ -86,7 +90,25 @@ if (process.env.GATEFORGE_CLI) {
|
|
|
86
90
|
|
|
87
91
|
console.error('gateforge: CLI not found (npm install -D @gate-forge/cli, or set GATEFORGE_CLI / .gateforge/engine)');
|
|
88
92
|
process.exit(1);
|
|
93
|
+
${GENERATED_HOOK_MARKER_END}
|
|
89
94
|
`;
|
|
95
|
+
/** Identifies a Gateforge-owned wrapper, including pre-marker versions. */
|
|
96
|
+
function isGeneratedHookScript(body) {
|
|
97
|
+
return ((body.includes(GENERATED_HOOK_MARKER_BEGIN) && body.includes(GENERATED_HOOK_MARKER_END)) ||
|
|
98
|
+
(body.includes('Cross-platform entry for the blocking static gate (generated by') &&
|
|
99
|
+
body.includes('const args = ') &&
|
|
100
|
+
body.includes('node_modules/@gate-forge/cli')));
|
|
101
|
+
}
|
|
102
|
+
/** Replaces only the Gateforge-owned block and preserves surrounding text. */
|
|
103
|
+
function replaceGeneratedHookBlock(body, replacement) {
|
|
104
|
+
const begin = body.indexOf(GENERATED_HOOK_MARKER_BEGIN);
|
|
105
|
+
const end = body.indexOf(GENERATED_HOOK_MARKER_END);
|
|
106
|
+
if (begin < 0 || end < begin)
|
|
107
|
+
return replacement;
|
|
108
|
+
const suffix = body.slice(end + GENERATED_HOOK_MARKER_END.length);
|
|
109
|
+
const joinedReplacement = replacement.endsWith('\n') && suffix.startsWith('\n') ? replacement.slice(0, -1) : replacement;
|
|
110
|
+
return `${body.slice(0, begin)}${joinedReplacement}${suffix}`;
|
|
111
|
+
}
|
|
90
112
|
const PRE_COMMIT_BLOCK = `# --- gateforge (generated): blocking static gate ---------------------
|
|
91
113
|
- repo: local
|
|
92
114
|
hooks:
|
|
@@ -152,7 +174,21 @@ export function ensureHookScript(io, engineRoot, gateArgs = ['check', '--changed
|
|
|
152
174
|
writeLine(io.stdout, `created: ${hookScript}`);
|
|
153
175
|
}
|
|
154
176
|
else {
|
|
155
|
-
|
|
177
|
+
const current = readFileSync(hookScript, 'utf8');
|
|
178
|
+
if (isGeneratedHookScript(current)) {
|
|
179
|
+
const updated = replaceGeneratedHookBlock(current, hookScriptTemplate(gateArgs));
|
|
180
|
+
if (updated !== current) {
|
|
181
|
+
writeFileSync(hookScript, updated, 'utf8');
|
|
182
|
+
chmodSync(hookScript, 0o755);
|
|
183
|
+
writeLine(io.stdout, `updated: ${hookScript} (${gateArgs.join(' ')})`);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
writeLine(io.stdout, `verified: ${hookScript} (${gateArgs.join(' ')})`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
writeLine(io.stdout, `exists, leaving untouched: ${hookScript} (foreign file)`);
|
|
191
|
+
}
|
|
156
192
|
}
|
|
157
193
|
return hookScript;
|
|
158
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocking.js","sourceRoot":"","sources":["../../src/commands/blocking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,E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C,CAAC;IAC7E,CAAC;SAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAC5E,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,kFAAkF,QAAQ,wBAAwB,CAAC,CAAC;IAC3I,CAAC;AACH,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,oBAAoB,CAClC,EAAM,EACN,UAAyB,EACzB,WAA8B,CAAC,OAAO,EAAE,WAAW,CAAC;IAEpD,oBAAoB,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,qBAAqB,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
package/dist/commands/check.d.ts
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import type { Io } from '../io.js';
|
|
2
2
|
export declare const CHECK_USAGE: string;
|
|
3
|
+
/** Options of one gate run (the check body, shared by --changed/--staged). */
|
|
4
|
+
export interface CheckGateOptions {
|
|
5
|
+
/** Restrict evaluation to the changed-file scope. */
|
|
6
|
+
diffScoped: boolean;
|
|
7
|
+
/** Require a valid, non-stale gate receipt (strict saved-state gate). */
|
|
8
|
+
requireE2E: boolean;
|
|
9
|
+
/** Report format. */
|
|
10
|
+
format: 'text' | 'json' | 'sarif';
|
|
11
|
+
/**
|
|
12
|
+
* Owner-approved policy revision digest from `--approved-policy-digest`
|
|
13
|
+
* (an operator channel). The protected `GATEFORGE_APPROVED_POLICY_DIGEST`
|
|
14
|
+
* variable and a `GATEFORGE_TRUSTED_CONFIG` file outside the candidate
|
|
15
|
+
* are resolved as well; see src/trusted-policy.ts. Never taken from
|
|
16
|
+
* candidate-controlled files in strict mode.
|
|
17
|
+
*/
|
|
18
|
+
approvedPolicyDigest?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Phase 5 staged-candidate runs: the fixed changed set computed from
|
|
21
|
+
* the FROZEN index vs base. When present no diff provider runs (the
|
|
22
|
+
* candidate checkout has no diff basis of its own), the manifest stamps
|
|
23
|
+
* the `local-staged` basis identity, and the staged-vs-worktree
|
|
24
|
+
* mismatch diagnostic is skipped (the checkout IS the staged bytes).
|
|
25
|
+
*/
|
|
26
|
+
fixedChangedFiles?: readonly string[];
|
|
27
|
+
/** Digest of dependency bytes reused by the staged candidate runtime. */
|
|
28
|
+
runtimeReuseDigest?: string | null;
|
|
29
|
+
}
|
|
3
30
|
/**
|
|
4
31
|
* Runs the check subcommand.
|
|
5
32
|
*
|
|
@@ -13,4 +40,17 @@ export declare const CHECK_USAGE: string;
|
|
|
13
40
|
* @throws fail-closed errors (exit 2) from config/plugin/pipeline layers.
|
|
14
41
|
*/
|
|
15
42
|
export declare function checkCommand(io: Io, argv: readonly string[]): Promise<number>;
|
|
43
|
+
/**
|
|
44
|
+
* The gate body shared by `check`, `check --changed`, and the Phase 5
|
|
45
|
+
* `check --staged` candidate run (via a scratch checkout cwd).
|
|
46
|
+
*
|
|
47
|
+
* Args:
|
|
48
|
+
* io: process context (cwd = the repository the gate evaluates).
|
|
49
|
+
* options: scope/strictness/format + the optional fixed changed set.
|
|
50
|
+
*
|
|
51
|
+
* Returns:
|
|
52
|
+
* number: exit code — 0 clean/waived, 1 unresolved, 2 config/usage.
|
|
53
|
+
* @throws fail-closed errors (exit 2) from config/plugin/pipeline layers.
|
|
54
|
+
*/
|
|
55
|
+
export declare function runCheckGate(io: Io, options: CheckGateOptions): Promise<number>;
|
|
16
56
|
//# sourceMappingURL=check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AA6CnC,eAAO,MAAM,WAAW,QAK2F,CAAC;AAEpH,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB;IACrB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBnF;AAsKD;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoZrF"}
|