@gate-forge/cli 0.22.1 → 0.23.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.23.0
4
+
5
+ - **Added: `typeof` URL guards fold.** A URL written
6
+ `typeof x === 'function' ? x(args) : x` resolves to `x` when the scan
7
+ proves every value of `x` is a string target with no unproven hole;
8
+ an arrow, an unresolvable name or an unproven hole keeps the guard
9
+ fail-closed as before.
10
+ - **Changed: `client[key](...)` calls are scanned.** A parameter or any
11
+ declaration in the enclosing function (including a hoisted `var`) no
12
+ longer resolves to a same-named outer constant, a `const` no longer
13
+ resolves outside the block or loop that declares it, and a module
14
+ `let`/`var` (imported or same-file) no longer resolves to its
15
+ initializer. Repositories with such code can see new blocking
16
+ findings (fail closed).
17
+
3
18
  ## 0.22.1
4
19
 
5
20
  - **Fixed: `test-gates --scope changed` refuses with exit 2 when the change
@@ -24,11 +24,11 @@ Example for a React frontend, FastAPI backend, and SQLAlchemy data layer:
24
24
 
25
25
  ```sh
26
26
  npm i -D \
27
- @gate-forge/cli@0.22.1 \
28
- @gate-forge/pack-playwright@0.22.1 \
29
- @gate-forge/pack-http@0.22.1 \
30
- @gate-forge/pack-fastapi@0.22.1 \
31
- @gate-forge/pack-sqlalchemy@0.22.1
27
+ @gate-forge/cli@0.23.0 \
28
+ @gate-forge/pack-playwright@0.23.0 \
29
+ @gate-forge/pack-http@0.23.0 \
30
+ @gate-forge/pack-fastapi@0.23.0 \
31
+ @gate-forge/pack-sqlalchemy@0.23.0
32
32
  ```
33
33
 
34
34
  Use the project-local `gateforge` binary from your npm script or add `node_modules/.bin` to your shell `PATH`. If the scan recommends other packs, add only the ones your code uses, at the same version. A mismatched Gateforge package contract can stop the CLI with exit code 2 and `GATEFORGE_PACKAGE_INCOMPATIBLE`.
@@ -2217,6 +2217,30 @@ direct call sites:
2217
2217
  method: POST
2218
2218
  methodOption: options
2219
2219
  ```
2220
+ - **`typeof` URL guards.** A URL written
2221
+ `typeof x === 'function' ? x(args) : x` takes `x` as the target only
2222
+ when the scan proves every value of `x` is a string target with no
2223
+ unproven hole. An arrow function, an unresolvable name, a parameter,
2224
+ or a template with an unproven hole keeps the guard unproven — fail
2225
+ closed, exactly as before. The same shadowing rules the whole client
2226
+ scan applies hold here: a parameter, or any declaration in the
2227
+ enclosing function (a function, class, `var`, `let` or `const`, a
2228
+ destructured local, a hoisted `var` after the use), never resolves to
2229
+ an outer constant; a `const` resolves only inside the block or loop
2230
+ that declares it; and a module `let`/`var`, imported or not, never
2231
+ resolves to its initializer.
2232
+ - **Element-access client calls.** A call through `client[key](...)`
2233
+ on an identifier receiver (a configured client symbol, or `axios`)
2234
+ is read like the property call `client.<key>(...)`: a literal key, or
2235
+ a constant the scan resolves to one — a parameter never resolves — is
2236
+ the verb, and so is a declared `methodOption` wrapper's `method` when
2237
+ the key is destructured from the option parameter and only the key's
2238
+ own binding is a plain `const { method } = options` element (a
2239
+ `...rest` sibling is allowed); the call-site verb then applies. Any
2240
+ other key is a blocking finding: `HTTP_METHOD_DYNAMIC` on the direct
2241
+ call, `FRONTEND_CALL_TARGET_UNRESOLVED` at the call site of a
2242
+ declared wrapper. A function containing such a call counts as a
2243
+ client wrapper.
2220
2244
 
2221
2245
  ## Migrating to 0.11
2222
2246
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gate-forge/cli",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "gateforgeCompatibility": {
5
5
  "supervisedFixtureProtocol": "gateforge.supervised-playwright.v1"
6
6
  },
@@ -33,16 +33,16 @@
33
33
  "test": "vitest run"
34
34
  },
35
35
  "dependencies": {
36
- "@gate-forge/core": "^0.22.1",
37
- "@gate-forge/http-contract": "^0.22.1",
38
- "@gate-forge/pack-alembic": "^0.22.1",
39
- "@gate-forge/pack-fastapi": "^0.22.1",
40
- "@gate-forge/pack-http": "^0.22.1",
41
- "@gate-forge/pack-playwright": "^0.22.1",
42
- "@gate-forge/pack-react-router": "^0.22.1",
43
- "@gate-forge/pack-sqlalchemy": "^0.22.1",
44
- "@gate-forge/pack-task": "^0.22.1",
45
- "@gate-forge/plugin-protocol": "^0.22.1",
36
+ "@gate-forge/core": "^0.23.0",
37
+ "@gate-forge/http-contract": "^0.23.0",
38
+ "@gate-forge/pack-alembic": "^0.23.0",
39
+ "@gate-forge/pack-fastapi": "^0.23.0",
40
+ "@gate-forge/pack-http": "^0.23.0",
41
+ "@gate-forge/pack-playwright": "^0.23.0",
42
+ "@gate-forge/pack-react-router": "^0.23.0",
43
+ "@gate-forge/pack-sqlalchemy": "^0.23.0",
44
+ "@gate-forge/pack-task": "^0.23.0",
45
+ "@gate-forge/plugin-protocol": "^0.23.0",
46
46
  "picomatch": "^4.0.7",
47
47
  "yaml": "^2.8.1"
48
48
  },