@intentius/chant 0.25.0 → 0.27.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/dist/build.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts +6 -5
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/config.d.ts +13 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/discovery/entity-wire-codec.d.ts +14 -9
- package/dist/discovery/entity-wire-codec.d.ts.map +1 -1
- package/dist/discovery/graph.d.ts.map +1 -1
- package/dist/discovery/sandbox/config-wire.d.ts +16 -0
- package/dist/discovery/sandbox/config-wire.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.d.ts +29 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/fork.d.ts +18 -0
- package/dist/discovery/sandbox/fork.d.ts.map +1 -1
- package/dist/discovery/sandbox/policy-run.d.ts +33 -0
- package/dist/discovery/sandbox/policy-run.d.ts.map +1 -0
- package/dist/discovery/sandbox/policy-wire.d.ts +177 -0
- package/dist/discovery/sandbox/policy-wire.d.ts.map +1 -0
- package/dist/intrinsic-interpolation.d.ts.map +1 -1
- package/dist/lexicon-output.d.ts.map +1 -1
- package/dist/lint/policy-import.d.ts +50 -0
- package/dist/lint/policy-import.d.ts.map +1 -0
- package/dist/lint/policy-sandbox.d.ts +89 -0
- package/dist/lint/policy-sandbox.d.ts.map +1 -0
- package/dist/lint/policy.d.ts +12 -1
- package/dist/lint/policy.d.ts.map +1 -1
- package/dist/stack-output.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/build.test.ts +77 -1
- package/src/build.ts +15 -2
- package/src/cli/commands/build.test.ts +16 -2
- package/src/cli/commands/build.ts +42 -13
- package/src/cli/main.test.ts +99 -17
- package/src/cli/main.ts +111 -13
- package/src/config.test.ts +28 -1
- package/src/config.ts +16 -12
- package/src/discovery/entity-wire-codec.ts +14 -9
- package/src/discovery/graph.test.ts +40 -1
- package/src/discovery/graph.ts +8 -2
- package/src/discovery/sandbox/config-wire.ts +21 -0
- package/src/discovery/sandbox/driver.ts +132 -0
- package/src/discovery/sandbox/fork.ts +39 -1
- package/src/discovery/sandbox/policy-boundary.test.ts +325 -0
- package/src/discovery/sandbox/policy-run.ts +180 -0
- package/src/discovery/sandbox/policy-wire.test.ts +310 -0
- package/src/discovery/sandbox/policy-wire.ts +277 -0
- package/src/intrinsic-interpolation.test.ts +27 -1
- package/src/intrinsic-interpolation.ts +10 -2
- package/src/lexicon-output.test.ts +36 -0
- package/src/lexicon-output.ts +12 -2
- package/src/lint/policy-import.ts +70 -0
- package/src/lint/policy-sandbox.ts +123 -0
- package/src/lint/policy.ts +20 -2
- package/src/stack-output.test.ts +118 -0
- package/src/stack-output.ts +21 -5
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAsB,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,cAAc,EAAiC,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,aAAa,EAAmB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,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QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAChC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CActC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAChC,aAAa,EAAE,CAuEjB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAChC,aAAa,EAAE,CA+FjB;AA6ED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CACzB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,UAAU,EAAE,EACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAWtB;AA0KD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,sBAAsB,EAC5B,WAAW,EAAE,UAAU,EAAE,EACzB,KAAK,SAAsB,EAC3B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAgBtB"}
|
|
@@ -23,11 +23,12 @@ export interface BuildOptions {
|
|
|
23
23
|
*/
|
|
24
24
|
env?: string;
|
|
25
25
|
/**
|
|
26
|
-
* chant #1022 (epic #1019) —
|
|
27
|
-
*
|
|
28
|
-
* run per-file for anything the folder can't represent.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* chant #1022/#1134 (epic #1019) — fold source modules statically instead
|
|
27
|
+
* of importing/running them; the DEFAULT build path since #1134. Falls
|
|
28
|
+
* back to run per-file for anything the folder can't represent. Tri-state:
|
|
29
|
+
* `--fold` → true, `--no-fold` → false, unset → the project config /
|
|
30
|
+
* default via {@link resolveFoldEnabled}. An explicit flag always wins for
|
|
31
|
+
* the invocation, in either direction.
|
|
31
32
|
*/
|
|
32
33
|
fold?: boolean;
|
|
33
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAUnD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,2CAA2C;IAC3C,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB;IAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAoB/C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2JAA2J;IAC3J,WAAW,CAAC,EAAE,OAAO,kBAAkB,EAAE,oBAAoB,EAAE,CAAC;CACjE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA+Y9E;AAiDD;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAIlD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAItD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,EACrB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GACxC,MAAM,IAAI,CAmCZ"}
|
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAqE9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAwQpD;AA8aD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
|
package/dist/config.d.ts
CHANGED
|
@@ -147,12 +147,12 @@ export interface ChantConfig {
|
|
|
147
147
|
*/
|
|
148
148
|
build?: {
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
150
|
+
* Fold source modules statically instead of importing/running them,
|
|
151
|
+
* falling back to run per-file for anything the folder can't represent.
|
|
152
|
+
* DEFAULT `true` since chant #1134 — set `false` to make this project
|
|
153
|
+
* run every module (the pre-#1134 behavior). The `--fold`/`--no-fold`
|
|
154
|
+
* CLI flags override this per-invocation in either direction. See
|
|
155
|
+
* {@link resolveFoldEnabled}.
|
|
156
156
|
*/
|
|
157
157
|
fold?: boolean;
|
|
158
158
|
/**
|
|
@@ -322,10 +322,13 @@ export declare function resolveOwnershipMarker(config: ChantConfig): OwnershipMa
|
|
|
322
322
|
export declare function resolveAutoReleaseDisabled(config: ChantConfig, cliFlag?: boolean): boolean;
|
|
323
323
|
/**
|
|
324
324
|
* Whether `chant build` should use the fold path (#1022, epic #1019)
|
|
325
|
-
* instead of running each source module.
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
325
|
+
* instead of running each source module. DEFAULT-ON since chant #1134: fold
|
|
326
|
+
* is the build path unless something turns it off. Precedence, most specific
|
|
327
|
+
* wins: an explicit CLI flag (`--fold` → true, `--no-fold` → false, arriving
|
|
328
|
+
* here as `cliFlag`), then the project config's `build.fold`, then the
|
|
329
|
+
* default of `true`. The epic's evidence base for the flip — coverage,
|
|
330
|
+
* byte-identity, and the sandbox execution boundary — is recorded on #1134
|
|
331
|
+
* and #1090.
|
|
329
332
|
*/
|
|
330
333
|
export declare function resolveFoldEnabled(config: ChantConfig, cliFlag?: boolean): boolean;
|
|
331
334
|
/**
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDd,CAAC;AAEjB;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,0EAA0E;QAC1E,IAAI,EAAE,MAAM,CAAC;QACb,8EAA8E;QAC9E,GAAG,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IAEH,8DAA8D;IAC9D,IAAI,CAAC,EAAE,UAAU,C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AAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,uBAAuB,CAanF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAW1E"}
|
|
@@ -23,20 +23,25 @@
|
|
|
23
23
|
* value) becomes a name-keyed marker instead. {@link decodeEntitySet} is the
|
|
24
24
|
* inverse — it rebuilds a live `Map<string, Declarable>` whose entities are
|
|
25
25
|
* BEHAVIORALLY indistinguishable from what `discover()` would have produced
|
|
26
|
-
* in-process: real `AttrRef` instances
|
|
27
|
-
* `
|
|
26
|
+
* in-process: real `AttrRef` instances, not a duck-typed `{__attrRef}`
|
|
27
|
+
* envelope alone. `new AttrRef(...)` here is plain, direct construction from
|
|
28
|
+
* this module's own class — this codec runs inside the same module graph as
|
|
29
|
+
* every downstream reader (`intrinsic-interpolation.ts`'s
|
|
28
30
|
* `defaultInterpolationSerializer`, `discovery/graph.ts`'s
|
|
29
31
|
* `buildDependencyGraph`, `build.ts`'s `detectCrossLexiconRefs`/
|
|
30
|
-
* `computeStackGraph
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* `computeStackGraph`, all converted to `isAttrRefLike` duck-typing by chant
|
|
33
|
+
* #1137 for the OTHER hazard, a separately-loaded lexicon copy) — so there is
|
|
34
|
+
* no dual-package boundary to duck-type across here, and building the real
|
|
35
|
+
* class is simply less code than hand-assembling a shape-alike stand-in with
|
|
36
|
+
* matching methods, and whole-entity embeds restored to the SAME object
|
|
37
|
+
* reference (not a structurally-equal clone), so `entityNames.get(decl)`
|
|
38
|
+
* keeps working by identity exactly as it does today.
|
|
34
39
|
*
|
|
35
40
|
* `serializer-walker.ts`'s `walkValue` needs NO changes for this: it already
|
|
36
41
|
* falls back to reading a plain `{__attrRef}` envelope (added for intrinsics
|
|
37
42
|
* whose own `toJSON()` embeds one). `decodeEntitySet` goes further and
|
|
38
|
-
* reconstructs the real class
|
|
39
|
-
*
|
|
43
|
+
* reconstructs the real class, both simpler here and a belt-and-suspenders
|
|
44
|
+
* match for any call site that still checks `instanceof AttrRef` directly.
|
|
40
45
|
*
|
|
41
46
|
* Naming happens exactly once, inside the boundary — `resolveAttrRefs`
|
|
42
47
|
* (./resolve.ts) runs as part of `discover()`, before `encodeEntitySet` is
|
|
@@ -78,7 +83,7 @@ import { type Declarable } from "../declarable.js";
|
|
|
78
83
|
* form. `refs` additionally captures any `AttrRef`/whole-entity reference
|
|
79
84
|
* found while walking the intrinsic's OWN fields (not through `toJSON()`)
|
|
80
85
|
* — `buildDependencyGraph` and `detectCrossLexiconRefs`/`computeStackGraph`
|
|
81
|
-
* walk raw entity property trees looking for `
|
|
86
|
+
* walk raw entity property trees looking for an `AttrRef`-like value/a
|
|
82
87
|
* tracked `Declarable`, not through `toJSON()`, so a ref nested inside e.g.
|
|
83
88
|
* a `Sub` template needs to still be discoverable post-decode for
|
|
84
89
|
* cross-lexicon output auto-detection and dependency ordering to keep
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-wire-codec.d.ts","sourceRoot":"","sources":["../../src/discovery/entity-wire-codec.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"entity-wire-codec.d.ts","sourceRoot":"","sources":["../../src/discovery/entity-wire-codec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAOzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,EAAE,GACX;IAAE,SAAS,EAAE;QAAE,MAAM,E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EAAE,CAAC;CACxB;AA0KD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,aAAa,CAoBhF;AAuGD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CA0C5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/discovery/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/discovery/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAChC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAuB1B"}
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
* the project code it is inspecting — so it must not import anything, and must
|
|
19
19
|
* not touch the filesystem, the environment or the process.
|
|
20
20
|
*
|
|
21
|
+
* chant #1131 reuses the same walk for the OTHER direction: a `lint.policies`
|
|
22
|
+
* check runs inside a sandboxed child and its `PostSynthDiagnostic[]` has to
|
|
23
|
+
* come back as data (`./policy-wire.ts`). That is the same "JSON is lossy
|
|
24
|
+
* without complaining" problem with a different root value, so the walk is
|
|
25
|
+
* exported as {@link scanValueWireSafety} rather than copied.
|
|
26
|
+
*
|
|
21
27
|
* ## What `ChantConfig` legally holds
|
|
22
28
|
*
|
|
23
29
|
* Every field of `ChantConfig` (`../../config.ts`) is JSON data: string arrays
|
|
@@ -52,6 +58,16 @@ export interface ConfigWireOffender {
|
|
|
52
58
|
/** What was found there, phrased for an error message (e.g. `a function`, `a Date`). */
|
|
53
59
|
found: string;
|
|
54
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* chant #1131 — report every value ANYWHERE in `value` that cannot cross the
|
|
63
|
+
* sandbox boundary as JSON, with paths rooted at `rootPath`.
|
|
64
|
+
*
|
|
65
|
+
* {@link scanConfigWireSafety} is the config-shaped entry point (it tolerates a
|
|
66
|
+
* module namespace object at the root); this one takes the value as given, so
|
|
67
|
+
* an array root (`diagnostics`) or a plain object root both work. Same rules,
|
|
68
|
+
* same `undefined`-object-property allowance — see the module doc.
|
|
69
|
+
*/
|
|
70
|
+
export declare function scanValueWireSafety(value: unknown, rootPath?: string): ConfigWireOffender[];
|
|
55
71
|
/**
|
|
56
72
|
* Report every value in `config` that cannot cross the sandbox boundary as
|
|
57
73
|
* JSON. An empty array means a `JSON.parse(JSON.stringify(config))` round-trip
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-wire.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/config-wire.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config-wire.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/config-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;CACf;AAiFD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,kBAAkB,EAAE,CAIvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAe1E;AAED,2IAA2I;AAC3I,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACvC,MAAM,CAOR"}
|
|
@@ -30,4 +30,33 @@ export declare function generateDriverSource(options: GenerateDriverOptions): st
|
|
|
30
30
|
* interpreted.
|
|
31
31
|
*/
|
|
32
32
|
export declare function generateConfigDriverSource(configPath: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* chant #1131 — generate the driver module that imports a project's
|
|
35
|
+
* `lint.policies` modules INSIDE the sandboxed child, runs their checks over
|
|
36
|
+
* the build result the parent hands it, and sends back plain
|
|
37
|
+
* `PostSynthDiagnostic`s.
|
|
38
|
+
*
|
|
39
|
+
* Same machinery again: literal-specifier dynamic `import()`s esbuild can trace
|
|
40
|
+
* and inline, `./child-errors.ts` for classification so a permission denial
|
|
41
|
+
* names the policy file, one IPC message back. Two things are specific to this
|
|
42
|
+
* one:
|
|
43
|
+
*
|
|
44
|
+
* - **It receives before it sends.** The run and config drivers are fully
|
|
45
|
+
* parameterized by their generated source; a policy check needs the finished
|
|
46
|
+
* build result, which is neither known at bundle time nor something to bake
|
|
47
|
+
* into a source literal. It arrives as one IPC message (see `./fork.ts`'s
|
|
48
|
+
* `send`). The `process.on("message", …)` registration is top-level and
|
|
49
|
+
* synchronous, so it is in place before the event loop can deliver anything
|
|
50
|
+
* — a message the parent sent before the child finished booting is queued on
|
|
51
|
+
* the channel, not lost.
|
|
52
|
+
* - **Checks run wrapped, not raw.** `runPostSynthChecks` (chant's own, from
|
|
53
|
+
* `../../lint/post-synth.ts`) is invoked ONCE over every check from every
|
|
54
|
+
* policy module, exactly as `cli/commands/build.ts` invokes it in-process —
|
|
55
|
+
* so the checks share one `PostSynthContext` and run in one order, and the
|
|
56
|
+
* diagnostics come back in the same sequence. The wrapper around each check
|
|
57
|
+
* is what makes a bad return value attributable: it scans that check's own
|
|
58
|
+
* output and throws a `PolicyWireError` naming the module the check was
|
|
59
|
+
* loaded from, rather than reporting an offending index in a merged array.
|
|
60
|
+
*/
|
|
61
|
+
export declare function generatePolicyDriverSource(policyPaths: readonly string[]): string;
|
|
33
62
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/driver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/driver.ts"],"names":[],"mappings":"AAiDA,MAAM,WAAW,qBAAqB;IACpC,qIAAqI;IACrI,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,oNAAoN;IACpN,SAAS,EAAE,MAAM,CAAC;CACnB;AAOD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAqF3E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA6CrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAmGjF"}
|
|
@@ -42,6 +42,24 @@ export interface SandboxForkOptions {
|
|
|
42
42
|
timeoutMs: number;
|
|
43
43
|
/** What timed out / exited early, for the error message (e.g. `"sandboxed run"`). */
|
|
44
44
|
label: string;
|
|
45
|
+
/**
|
|
46
|
+
* chant #1131 — an optional payload sent to the child over the SAME IPC
|
|
47
|
+
* channel its response comes back on, immediately after the fork.
|
|
48
|
+
*
|
|
49
|
+
* The run and config children are fully described by their generated driver
|
|
50
|
+
* source, so they need nothing inbound. The policy child does: its input is
|
|
51
|
+
* the finished build result, which exists only after the parent has merged
|
|
52
|
+
* and serialized, long after the bundle was built. Sending it rather than
|
|
53
|
+
* baking it into a source literal keeps the bundle small (esbuild would
|
|
54
|
+
* otherwise parse a multi-megabyte literal) and keeps it off disk.
|
|
55
|
+
*
|
|
56
|
+
* Safe to send before the child has booted: `child.send` writes to the IPC
|
|
57
|
+
* pipe and Node queues the message until the child's channel is read, and
|
|
58
|
+
* the driver registers its `process.on("message", …)` synchronously at module
|
|
59
|
+
* top level — before the event loop can deliver anything. This is NOT a
|
|
60
|
+
* second protocol: same channel, same JSON, same one-message-back response.
|
|
61
|
+
*/
|
|
62
|
+
send?: Record<string, unknown>;
|
|
45
63
|
}
|
|
46
64
|
/**
|
|
47
65
|
* Fork `bundlePath` under `--permission` with a scrubbed environment, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fork.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/fork.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;IACxB,6IAA6I;IAC7I,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"fork.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/fork.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;IACxB,6IAA6I;IAC7I,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,GACzC,OAAO,CAAC,CAAC,CAAC,CAwEZ"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PostSynthDiagnostic } from "../../lint/post-synth.js";
|
|
2
|
+
import { type EncodablePolicyBuildResult } from "./policy-wire.js";
|
|
3
|
+
export interface SandboxPolicyResult {
|
|
4
|
+
/** What the policy pack reported — plain data, validated inside the child before it crossed (see `./policy-wire.ts`'s `scanPolicyDiagnostics`). */
|
|
5
|
+
diagnostics: PostSynthDiagnostic[];
|
|
6
|
+
/** esbuild bundling wall-clock time. */
|
|
7
|
+
bundleMs: number;
|
|
8
|
+
/** Bundle size in bytes. */
|
|
9
|
+
bundleBytes: number;
|
|
10
|
+
/** Encoded build-result payload size in bytes — what crossed the IPC channel. */
|
|
11
|
+
payloadBytes: number;
|
|
12
|
+
}
|
|
13
|
+
export interface SandboxPolicyOptions {
|
|
14
|
+
/** Absolute paths to the project's `lint.policies` modules, in declaration order. */
|
|
15
|
+
policyPaths: readonly string[];
|
|
16
|
+
/** The merged, serialized build result the checks run over. */
|
|
17
|
+
buildResult: EncodablePolicyBuildResult;
|
|
18
|
+
/** The environment/stack this build was evaluated for (`--env`, else `ownership.env`) — becomes `ctx.env`. */
|
|
19
|
+
env?: string;
|
|
20
|
+
/** Directory the child is granted `--allow-fs-read` for: the project root (the `chant.config.*` directory, which `lint.policies` paths are resolved against). */
|
|
21
|
+
projectRoot: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Evaluate `policyPaths` against `buildResult` inside a sandboxed child.
|
|
25
|
+
*
|
|
26
|
+
* Throws — rather than degrading to an in-process run — when the policies
|
|
27
|
+
* cannot be evaluated inside the boundary or their diagnostics cannot cross it
|
|
28
|
+
* as JSON. Under `--sandbox` a policy pack that "almost" ran is not a safe
|
|
29
|
+
* thing to proceed with, and quietly falling back would give away the property
|
|
30
|
+
* the flag exists to provide.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runPoliciesSandboxed(options: SandboxPolicyOptions): Promise<SandboxPolicyResult>;
|
|
33
|
+
//# sourceMappingURL=policy-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-run.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/policy-run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAIjE,OAAO,EAGL,KAAK,0BAA0B,EAEhC,MAAM,eAAe,CAAC;AA+EvB,MAAM,WAAW,mBAAmB;IAClC,mJAAmJ;IACnJ,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,qFAAqF;IACrF,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,+DAA+D;IAC/D,WAAW,EAAE,0BAA0B,CAAC;IACxC,8GAA8G;IAC9G,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iKAAiK;IACjK,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA0DtG"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { Declarable } from "../../declarable.js";
|
|
2
|
+
import type { SerializerResult } from "../../serializer.js";
|
|
3
|
+
import type { PostSynthContext } from "../../lint/post-synth.js";
|
|
4
|
+
import { type EntitySetWire } from "../entity-wire-codec.js";
|
|
5
|
+
import { type ConfigWireOffender } from "./config-wire.js";
|
|
6
|
+
/**
|
|
7
|
+
* chant #1131 — what a build result looks like on its way INTO the sandboxed
|
|
8
|
+
* policy child, and what a `PostSynthDiagnostic` must look like on its way back
|
|
9
|
+
* out.
|
|
10
|
+
*
|
|
11
|
+
* A project's `lint.policies` checks are project-authored functions chant calls
|
|
12
|
+
* over the finished build. #1113 put `chant.config.ts` behind the `--sandbox`
|
|
13
|
+
* boundary but could not take the policies with it, because the config declares
|
|
14
|
+
* them as *paths*: the modules were still imported and their `check` functions
|
|
15
|
+
* still invoked in the CLI's own process, with the CLI's filesystem, network,
|
|
16
|
+
* environment and process-spawn access, after discovery was over.
|
|
17
|
+
*
|
|
18
|
+
* The shape of the fix is forced by what a policy is. It is not data that can
|
|
19
|
+
* be evaluated somewhere and carried back — it is a callback over the resolved
|
|
20
|
+
* resources, so it has to run somewhere it can see them. It also cannot run in
|
|
21
|
+
* the #1045 discovery child, because that child only ever sees the run-fallback
|
|
22
|
+
* *subset*: folded files are collected in the parent, and serialization happens
|
|
23
|
+
* in the parent, so no complete view of the build exists on that side. What
|
|
24
|
+
* does exist, after the parent has merged and serialized, is a build result
|
|
25
|
+
* that is *nearly* data already — which is what this module makes explicit.
|
|
26
|
+
*
|
|
27
|
+
* So: one more child, after the merge, handed the encoded build result,
|
|
28
|
+
* importing the policy modules inside the boundary and returning plain
|
|
29
|
+
* diagnostics. Same bundling (`./bundle.ts`), same spawn and `--permission`
|
|
30
|
+
* profile (`./fork.ts`), same error classification (`./child-errors.ts`), same
|
|
31
|
+
* "only JSON crosses, and anything else is named, never dropped" contract
|
|
32
|
+
* (`./config-wire.ts`, whose walk is reused directly).
|
|
33
|
+
*
|
|
34
|
+
* ## What crosses, and what that costs
|
|
35
|
+
*
|
|
36
|
+
* `PostSynthContext` gives a check five things. Four of them are already data:
|
|
37
|
+
* `outputs` (each lexicon's serialized text), `warnings`, `errors`,
|
|
38
|
+
* `sourceFileCount`. The fifth, `entities`, is a live `Map<string, Declarable>`
|
|
39
|
+
* whose cross-entity references are object identity and `WeakRef`s — the exact
|
|
40
|
+
* problem chant #1045 Phase 1 solved for discovery, so this reuses that codec
|
|
41
|
+
* (`../entity-wire-codec.ts`) rather than inventing a second one.
|
|
42
|
+
*
|
|
43
|
+
* That reuse is what makes the round trip cheap AND what defines its limits.
|
|
44
|
+
* `encodeEntitySet`/`decodeEntitySet` is documented as producing entities
|
|
45
|
+
* "behaviorally indistinguishable" from the in-process ones for chant's own
|
|
46
|
+
* consumers (serializers, the dependency graph, cross-lexicon detection), and
|
|
47
|
+
* a policy is a consumer of the same shape. Where it is NOT identical is
|
|
48
|
+
* written down in `docs/.../architecture/sandbox.mdx` and pinned by
|
|
49
|
+
* `./policy-wire.test.ts`:
|
|
50
|
+
*
|
|
51
|
+
* - An intrinsic (`Sub`, `Ref`, gitlab's `!reference`, …) decodes to a
|
|
52
|
+
* marker-bearing wrapper exposing `toJSON()`/`toYAML()`, not to an instance
|
|
53
|
+
* of the lexicon's own intrinsic class.
|
|
54
|
+
* - A decoded entity is a plain marker-bearing object, not an instance of the
|
|
55
|
+
* lexicon's resource class, and its `lexicon`/`entityType`/`kind`/`props`/
|
|
56
|
+
* `attributes` are non-enumerable (so `Object.keys(entity)` sees only the
|
|
57
|
+
* per-attribute/extra fields). Reads — `entity.props`, `entity.entityType`,
|
|
58
|
+
* `isDeclarable(entity)`, `instanceof AttrRef` — all still work.
|
|
59
|
+
* - A `ChildProjectInstance` (`nestedStack()`) has no wire form at all;
|
|
60
|
+
* `encodeEntitySet` throws rather than mis-encoding it, so a `--sandbox`
|
|
61
|
+
* build that both uses `nestedStack()` and declares `lint.policies` fails
|
|
62
|
+
* loudly. (No corpus entry uses `nestedStack()`.)
|
|
63
|
+
* - `errors` cross as the plain objects `DiscoveryError`/`BuildError`'s own
|
|
64
|
+
* `toJSON()` produces, not as `Error` instances. In practice this is never
|
|
65
|
+
* observable: `chant build` runs policies only when the build produced no
|
|
66
|
+
* errors at all, so the array is always empty at that point.
|
|
67
|
+
*
|
|
68
|
+
* Crucially, the first two are NOT new under `--sandbox`: a sandboxed build
|
|
69
|
+
* already merges decoded entities for every run-fallback file (`./run.ts`), so
|
|
70
|
+
* a policy running in-process on a `--sandbox` build is already looking at
|
|
71
|
+
* decoded entities for part of the set. Encoding is idempotent over a decoded
|
|
72
|
+
* entity (verified in `./policy-wire.test.ts`), so this child widens that from
|
|
73
|
+
* "the run-fallback subset" to "all of them" and changes nothing else.
|
|
74
|
+
*/
|
|
75
|
+
/** Wire form of one lexicon's serialized output — already data on both sides; carried as-is. */
|
|
76
|
+
export type PolicyOutputWire = string | {
|
|
77
|
+
primary: string;
|
|
78
|
+
files?: Record<string, string>;
|
|
79
|
+
warnings?: string[];
|
|
80
|
+
};
|
|
81
|
+
/** A build result as pure JSON, for the sandboxed policy child. */
|
|
82
|
+
export interface PolicyBuildResultWire {
|
|
83
|
+
/** `../entity-wire-codec.ts`'s format — the same one the #1045 discovery child returns. */
|
|
84
|
+
entities: EntitySetWire;
|
|
85
|
+
/** `Map` entries as pairs; a `Map` itself JSON-stringifies to `{}`. */
|
|
86
|
+
outputs: Array<[string, PolicyOutputWire]>;
|
|
87
|
+
warnings: string[];
|
|
88
|
+
/** `DiscoveryError`/`BuildError`'s own `toJSON()` output. Always empty in practice — see the module doc. */
|
|
89
|
+
errors: Array<Record<string, unknown>>;
|
|
90
|
+
sourceFileCount: number;
|
|
91
|
+
/** `BuildResult.dependencies` (`Map<string, Set<string>>`) as pairs of arrays. Not part of `PostSynthContext`'s declared surface; carried so `ctx.buildResult` is not silently narrower than the object the in-process path passes. */
|
|
92
|
+
dependencies: Array<[string, string[]]>;
|
|
93
|
+
/** `BuildResult.manifest` — plain data (lexicons, cross-lexicon outputs, deploy order, stack graph). Same "not declared, still carried" reasoning as {@link dependencies}. */
|
|
94
|
+
manifest?: unknown;
|
|
95
|
+
/** `BuildResult.foldDecisions` — plain data. */
|
|
96
|
+
foldDecisions?: unknown[];
|
|
97
|
+
/** `BuildResult.buildParams` — plain data (#1064 provenance records). */
|
|
98
|
+
buildParams?: unknown[];
|
|
99
|
+
}
|
|
100
|
+
/** The subset of `BuildResult` this module knows how to carry. Structurally satisfied by `../../build.ts`'s `BuildResult`. */
|
|
101
|
+
export interface EncodablePolicyBuildResult {
|
|
102
|
+
outputs: Map<string, string | SerializerResult>;
|
|
103
|
+
entities: Map<string, Declarable>;
|
|
104
|
+
warnings: string[];
|
|
105
|
+
errors: ReadonlyArray<{
|
|
106
|
+
name: string;
|
|
107
|
+
message: string;
|
|
108
|
+
toJSON?: () => unknown;
|
|
109
|
+
}>;
|
|
110
|
+
sourceFileCount: number;
|
|
111
|
+
dependencies?: Map<string, Set<string>>;
|
|
112
|
+
manifest?: unknown;
|
|
113
|
+
foldDecisions?: unknown[];
|
|
114
|
+
buildParams?: unknown[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Encode a merged, serialized build result for the policy child.
|
|
118
|
+
*
|
|
119
|
+
* Runs in the PARENT. Throws — never drops — when the result holds something
|
|
120
|
+
* the wire cannot represent: `encodeEntitySet`'s own refusals (a `nestedStack()`
|
|
121
|
+
* child project, an `AttrRef` that never got a logical name) propagate, and the
|
|
122
|
+
* finished payload is walked by `./config-wire.ts`'s scan so a serializer that
|
|
123
|
+
* somehow produced a non-data output is named by key path rather than silently
|
|
124
|
+
* mangled by `JSON.stringify`.
|
|
125
|
+
*/
|
|
126
|
+
export declare function encodePolicyBuildResult(result: EncodablePolicyBuildResult): PolicyBuildResultWire;
|
|
127
|
+
/**
|
|
128
|
+
* Rebuild the `PostSynthContext["buildResult"]` a check expects, from the wire.
|
|
129
|
+
*
|
|
130
|
+
* Runs INSIDE the child. The maps and the live entity graph are reconstructed
|
|
131
|
+
* here (`decodeEntitySet`), so a check sees the same kind of object it sees
|
|
132
|
+
* in-process — `ctx.entities` is a real `Map`, its values are real
|
|
133
|
+
* `Declarable`s, and an `AttrRef` between two of them is a real `AttrRef`
|
|
134
|
+
* carrying its resolved logical name.
|
|
135
|
+
*/
|
|
136
|
+
export declare function decodePolicyBuildResult(wire: PolicyBuildResultWire): PostSynthContext["buildResult"];
|
|
137
|
+
/** One thing a policy returned that cannot cross back, with the policy module it came from. */
|
|
138
|
+
export interface PolicyDiagnosticOffender extends ConfigWireOffender {
|
|
139
|
+
/** Absolute path of the `lint.policies` module whose check returned it. */
|
|
140
|
+
policy: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Validate what one policy module's checks returned, INSIDE the child, before
|
|
144
|
+
* it goes anywhere near the IPC channel.
|
|
145
|
+
*
|
|
146
|
+
* Two separate questions, both answered here rather than by hoping
|
|
147
|
+
* `JSON.stringify` behaves:
|
|
148
|
+
*
|
|
149
|
+
* 1. Is it data? A `PostSynthDiagnostic` is declared as five plain fields, but
|
|
150
|
+
* a check is arbitrary project code and can return anything. A function, a
|
|
151
|
+
* `Date`, a class instance, a circular reference — `JSON.stringify` would
|
|
152
|
+
* drop or rewrite each of them without a word, and the CLI would print a
|
|
153
|
+
* diagnostic that is not the one the policy produced.
|
|
154
|
+
* 2. Is it a diagnostic? A missing `checkId`, or a `severity` outside
|
|
155
|
+
* `error`/`warning`/`info`, is reported here instead of turning into an
|
|
156
|
+
* undefined-shaped line in the build's error list.
|
|
157
|
+
*/
|
|
158
|
+
export declare function scanPolicyDiagnostics(diagnostics: unknown, policyPath: string): PolicyDiagnosticOffender[];
|
|
159
|
+
/**
|
|
160
|
+
* Thrown INSIDE the child by the per-check wrapper `./driver.ts` generates,
|
|
161
|
+
* when a check returns something that cannot cross back. Carries the offenders
|
|
162
|
+
* so the driver can report them as data rather than as a message string it
|
|
163
|
+
* would then have to parse.
|
|
164
|
+
*
|
|
165
|
+
* A class rather than a tagged object because the driver tests it with
|
|
166
|
+
* `instanceof`: both halves come from this one module, bundled once, so there
|
|
167
|
+
* is exactly one class identity inside the child.
|
|
168
|
+
*/
|
|
169
|
+
export declare class PolicyWireError extends Error {
|
|
170
|
+
readonly offenders: PolicyDiagnosticOffender[];
|
|
171
|
+
constructor(offenders: PolicyDiagnosticOffender[]);
|
|
172
|
+
}
|
|
173
|
+
/** Render offenders as the body of a build error — one line each, naming the policy module. */
|
|
174
|
+
export declare function formatPolicyWireOffenders(subject: string, offenders: ReadonlyArray<ConfigWireOffender & {
|
|
175
|
+
policy?: string;
|
|
176
|
+
}>): string;
|
|
177
|
+
//# sourceMappingURL=policy-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-wire.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/policy-wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEjH,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACpC,2FAA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G,qBAAqB,CAsBjG;AAUD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAapG;AAED,+FAA+F;AAC/F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,OAAO,EACpB,UAAU,EAAE,MAAM,GACjB,wBAAwB,EAAE,CA8B5B;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,EAAE,CAAC;gBAEnC,SAAS,EAAE,wBAAwB,EAAE;CAKlD;AASD,+FAA+F;AAC/F,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,aAAa,CAAC,kBAAkB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACjE,MAAM,CAUR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intrinsic-interpolation.d.ts","sourceRoot":"","sources":["../src/intrinsic-interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"intrinsic-interpolation.d.ts","sourceRoot":"","sources":["../src/intrinsic-interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;AAEtE;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,EACpE,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GACxC,4BAA4B,CAkD9B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,MAAM,EAAE,SAAS,OAAO,EAAE,EAC1B,cAAc,EAAE,4BAA4B,GAC3C,MAAM,CASR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon-output.d.ts","sourceRoot":"","sources":["../src/lexicon-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"lexicon-output.d.ts","sourceRoot":"","sources":["../src/lexicon-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;0CAE0C;AAC1C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,eAAoC,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAW5D;AAED;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAG,IAAI,CAAU;IAC5C;;uCAEmC;IACnC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,EAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC;IACtC;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,EAAE,oBAAoB,GAAG,IAAI,CAAC;gBAExC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,oBAAoB,EAAE,IAAI,EAAE,MAAM;IAwEzE;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIpC;;;;;OAKG;IACH,cAAc,IAAI,OAAO;IAUzB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa;IAO5D,MAAM,IAAI;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE;CAGtC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,oBAAoB,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAEnG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAOtE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single place chant imports a project's `lint.policies` module **in the
|
|
3
|
+
* CLI's own process** — and the flag that says it may not.
|
|
4
|
+
*
|
|
5
|
+
* The third member of the same family as `../discovery/import.ts`'s
|
|
6
|
+
* `importModule` (project source) and `../config-import.ts`'s
|
|
7
|
+
* `importConfigModule` (`chant.config.ts`): one narrow module whose only job is
|
|
8
|
+
* "execute project-authored code here", so that "did any project code run in
|
|
9
|
+
* this process?" has one place to look and one place to instrument — see
|
|
10
|
+
* `examples/sandbox-execution-boundary.test.ts`, which spies on all three.
|
|
11
|
+
*
|
|
12
|
+
* Before chant #1131 `./policy.ts` called `await import(resolved)` inline,
|
|
13
|
+
* which is why the corpus boundary gate could not see it even after #1113 put
|
|
14
|
+
* the config behind the boundary: there was nothing named to wrap.
|
|
15
|
+
*
|
|
16
|
+
* The armed flag lives here rather than in `./policy-sandbox.ts` (which owns
|
|
17
|
+
* the *decision* and documents the reasoning, and re-exports these three
|
|
18
|
+
* functions as its public surface) for one structural reason: `./policy.ts`
|
|
19
|
+
* needs to consult it, `./policy-sandbox.ts` needs to call `./policy.ts`, and a
|
|
20
|
+
* flag on a leaf module with no imports of its own breaks what would otherwise
|
|
21
|
+
* be an import cycle. It also puts the check on the narrowest possible thing —
|
|
22
|
+
* the function that actually executes project code — rather than on a caller
|
|
23
|
+
* that might forget to ask.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Arm sandboxed policy execution for the rest of this process. See
|
|
27
|
+
* `./policy-sandbox.ts` for what arms it and why it is a process mode rather
|
|
28
|
+
* than a threaded option. Idempotent; there is deliberately no disarm.
|
|
29
|
+
*/
|
|
30
|
+
export declare function armSandboxPolicyExecution(): void;
|
|
31
|
+
/** Whether {@link armSandboxPolicyExecution} has been called. */
|
|
32
|
+
export declare function isSandboxPolicyExecutionArmed(): boolean;
|
|
33
|
+
/** Test-only reset — vitest gives each test file its own module registry, so this exists for suites that arm and disarm within one file. */
|
|
34
|
+
export declare function resetSandboxPolicyExecutionForTests(): void;
|
|
35
|
+
/** The shape a policy module evaluates to — chant reads its exported values and keeps the `PostSynthCheck`-shaped ones. */
|
|
36
|
+
export type PolicyModuleNamespace = Record<string, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Import a policy module into THIS process and return its module namespace.
|
|
39
|
+
* Node's ESM registry caches it, so repeated loads within one CLI invocation
|
|
40
|
+
* evaluate the file once.
|
|
41
|
+
*
|
|
42
|
+
* Refuses while armed. Under `--sandbox` the policy modules are imported inside
|
|
43
|
+
* a child process (`../discovery/sandbox/policy-run.ts`); arriving here anyway
|
|
44
|
+
* means something is about to execute project-authored code in the CLI's own
|
|
45
|
+
* process, which is exactly what the flag promises does not happen. Falling
|
|
46
|
+
* through would make `--sandbox` mean less than it says with nothing visible to
|
|
47
|
+
* notice, so this throws instead.
|
|
48
|
+
*/
|
|
49
|
+
export declare function importPolicyModule(policyPath: string): Promise<PolicyModuleNamespace>;
|
|
50
|
+
//# sourceMappingURL=policy-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-import.d.ts","sourceRoot":"","sources":["../../src/lint/policy-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED,iEAAiE;AACjE,wBAAgB,6BAA6B,IAAI,OAAO,CAEvD;AAED,4IAA4I;AAC5I,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAED,2HAA2H;AAC3H,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAO3F"}
|