@intentius/chant 0.69.1 → 0.70.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.
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAE9E;AAmCD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyH/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C3E;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmL3E;AAmrBD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwQ3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2L/E;AAsBD;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAgBD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,C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AAsBD;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAgBD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmE7E;AAiCD;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAwF9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA6VpD;AAgbD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,EAkGvC,CAAC;AAgIF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAwF9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA6VpD;AAqbD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,EAkGvC,CAAC;AAgIF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
@@ -458,6 +458,66 @@ export declare function tryFoldFile(file: string, intrinsics?: readonly Intrinsi
458
458
  * the same edge an ordinary named import already gets.
459
459
  */
460
460
  export declare function buildProjectImportEdges(files: readonly string[]): Promise<Map<string, Set<string>>>;
461
- export declare function planFoldTaint(files: readonly string[], wouldFold: ReadonlyMap<string, boolean>, liveSources?: ReadonlyMap<string, ReadonlySet<string>>): Promise<Set<string>>;
461
+ export declare function planFoldTaint(files: readonly string[], wouldFold: ReadonlyMap<string, boolean>, liveSources?: ReadonlyMap<string, ReadonlySet<string>>): Promise<ReadonlySet<string>>;
462
+ /** Which of the two rules put a file on the run path. */
463
+ export type TaintEdgeKind =
464
+ /** A file this one imports, directly or transitively, falls back to run (#1023). */
465
+ "importer"
466
+ /** This file captured the objects of a file that falls back to run (#1044). */
467
+ | "capture";
468
+ export interface TaintPlan {
469
+ /** Every file that must run: the seed, plus everything reachable from it. */
470
+ readonly tainted: ReadonlySet<string>;
471
+ /**
472
+ * For a file the walk reached (never for a seed file), the file whose taint
473
+ * reached it and by which rule. chant#2406: the fallback reason has to name
474
+ * the actual edge — a reverse-tainted file is not imported by anything that
475
+ * runs, and saying it is sends a reader looking for an importer that does
476
+ * not exist.
477
+ */
478
+ readonly reachedBy: ReadonlyMap<string, {
479
+ from: string;
480
+ kind: TaintEdgeKind;
481
+ }>;
482
+ }
483
+ /**
484
+ * {@link planFoldTaint}'s walk, keeping the edge that fired for each file it
485
+ * reaches. Split out for two consumers that need to say *why*: the fallback
486
+ * reason in `discover()`, and {@link foldProject}'s verdicts.
487
+ */
488
+ export declare function planFoldTaintWithEdges(files: readonly string[], wouldFold: ReadonlyMap<string, boolean>, liveSources?: ReadonlyMap<string, ReadonlySet<string>>): Promise<TaintPlan>;
489
+ /** One file's place in a whole-build fold, as {@link foldProject} reports it. */
490
+ export interface FoldProjectVerdict {
491
+ /** What the build does with this file. */
492
+ readonly verdict: "fold" | "run";
493
+ /** What the file's own fold attempt concluded, before the taint walk. */
494
+ readonly tentative: "fold" | "run";
495
+ /** Present when `tentative` is "run": the located reason its own fold gave. */
496
+ readonly reason?: string;
497
+ /** Present when the file would have folded and taint overruled it. */
498
+ readonly taintedBy?: {
499
+ from: string;
500
+ kind: TaintEdgeKind;
501
+ };
502
+ /** The file's complete export namespace, present only when `verdict` is "fold". */
503
+ readonly exports?: ReadonlyMap<string, unknown>;
504
+ }
505
+ /**
506
+ * Fold a whole set of project files and report every file's verdict
507
+ * (chant#2408).
508
+ *
509
+ * `discover()` does this as part of building, and its per-file decisions are
510
+ * not addressable from outside. Anything that wants to *check* the
511
+ * cross-file rules needs the whole picture: the forward rule (#1023) needs an
512
+ * importer, the reverse rule (#1044) needs a capturing sibling, and the
513
+ * fixpoint needs the whole set, so none of the three is observable one file at
514
+ * a time. The conformance suite of the specification is the first such caller
515
+ * (INTENTIUS/typescript-as-data#62).
516
+ *
517
+ * Same session, same memo, same taint walk as a real build — this is not a
518
+ * second implementation of the rules, it is the existing one with its
519
+ * intermediate results kept instead of consumed.
520
+ */
521
+ export declare function foldProject(files: readonly string[], intrinsics?: readonly IntrinsicDef[]): Promise<Map<string, FoldProjectVerdict>>;
462
522
  export {};
463
523
  //# sourceMappingURL=fold-import.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fold-import.d.ts","sourceRoot":"","sources":["../../src/discovery/fold-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAkC,KAAK,iBAAiB,EAAyB,MAAM,cAAc,CAAC;AAuC7G,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;A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;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAE5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAE7B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,8DAA8D;IAC9D,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,qDAAqD;IACrD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mDAAmD;IACnD,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB;;;OAGG;IACH,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAiSjG"}
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export * from "./graph-lens.js";
39
39
  export * from "./detectLexicon.js";
40
40
  export * from "./fold/fold.js";
41
41
  export { findSubsetViolation, checkObjectMember, type SubsetViolation, type SubsetRuleId } from "./fold/subset.js";
42
+ export { foldProject, planFoldTaintWithEdges, type FoldProjectVerdict, type TaintPlan, type TaintEdgeKind, } from "./discovery/fold-import.js";
42
43
  export * from "./lint/parser.js";
43
44
  export * from "./lint/rule.js";
44
45
  export * from "./lint/rules/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAK5B,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAChH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cA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C,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAClE,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5F,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant",
3
- "version": "0.69.1",
3
+ "version": "0.70.1",
4
4
  "description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -916,6 +916,71 @@ describe("runLifecyclePlan", () => {
916
916
  // #2162 — a held property is not an action, so the plan carries it beside
917
917
  // `entries` rather than inside one, attributed to its lexicon the same way
918
918
  // an entry is.
919
+ test("without --deep the pass does not run, and the entries are unchanged (#2405)", async () => {
920
+ // The property that makes `--deep` safe to default off: a held property is
921
+ // never a proposal, so the change set is identical either way and the only
922
+ // thing the flag buys is the HELD section. If that stops being true, this
923
+ // is where it shows.
924
+ const makeBuild = () => {
925
+ const b = makeBuildResult({ k8s: ["web"] });
926
+ b.entities.set("web", {
927
+ lexicon: "k8s",
928
+ entityType: "K8s::Apps::Deployment",
929
+ props: { spec: { replicas: heldElsewhere<number>({ by: "hpa", reason: "the autoscaler owns replicas after the first apply" }) } },
930
+ } as never);
931
+ return b;
932
+ };
933
+ let deepCalls = 0;
934
+ const makePlugins = (): LexiconPlugin[] => {
935
+ const inner = staticDeepObservation({
936
+ web: { type: "K8s::Apps::Deployment", properties: { spec: { replicas: 5 } } },
937
+ });
938
+ return [
939
+ createMockPlugin({
940
+ name: "k8s",
941
+ describeResources: staticObservation({ web: meta({ type: "K8s::Apps::Deployment" }) }),
942
+ // Counting wrapper: the helper's return type is the plugin member's,
943
+ // which is optional, so it is narrowed once here rather than at the
944
+ // call.
945
+ observeResourcesDeep: ((opts: never) => {
946
+ deepCalls += 1;
947
+ return inner!(opts);
948
+ }) as never,
949
+ }),
950
+ ];
951
+ };
952
+
953
+ const run = async (deep: boolean) => {
954
+ stdoutBuf.length = 0;
955
+ buildMock.mockResolvedValue(makeBuild());
956
+ const plugins = makePlugins();
957
+ const exit = await runLifecyclePlan({
958
+ args: makeArgs({ path: "plan", extraPositional: "prod", json: true, ...(deep ? { deep: true } : {}) }),
959
+ plugins,
960
+ serializers: plugins.map((p) => p.serializer),
961
+ } as never);
962
+ expect(exit).toBe(0);
963
+ return JSON.parse(stdoutBuf.join("\n"));
964
+ };
965
+
966
+ deepCalls = 0;
967
+ const shallow = await run(false);
968
+ const callsWithoutDeep = deepCalls;
969
+
970
+ deepCalls = 0;
971
+ const deep = await run(true);
972
+
973
+ // The cost: the pass is not run at all without the flag.
974
+ expect(callsWithoutDeep).toBe(0);
975
+ expect(deepCalls).toBeGreaterThan(0);
976
+
977
+ // The correctness: the same proposals either way, and the held section
978
+ // only when it was asked for.
979
+ expect(shallow.entries).toEqual(deep.entries);
980
+ expect(shallow.held).toBeUndefined();
981
+ expect(deep.held).toBeDefined();
982
+ });
983
+
919
984
  test("--json carries the held set beside entries, attributed to its lexicon", async () => {
920
985
  const build = makeBuildResult({ k8s: ["web"] });
921
986
  build.entities.set("web", {
@@ -934,7 +999,7 @@ describe("runLifecyclePlan", () => {
934
999
  }),
935
1000
  ];
936
1001
  const exit = await runLifecyclePlan({
937
- args: makeArgs({ path: "plan", extraPositional: "prod", json: true }),
1002
+ args: makeArgs({ path: "plan", extraPositional: "prod", json: true, deep: true }),
938
1003
  plugins,
939
1004
  serializers: plugins.map((p) => p.serializer),
940
1005
  });
@@ -971,7 +1036,7 @@ describe("runLifecyclePlan", () => {
971
1036
  }),
972
1037
  ];
973
1038
  const exit = await runLifecyclePlan({
974
- args: makeArgs({ path: "plan", extraPositional: "prod" }),
1039
+ args: makeArgs({ path: "plan", extraPositional: "prod", deep: true }),
975
1040
  plugins,
976
1041
  serializers: plugins.map((p) => p.serializer),
977
1042
  });
@@ -1319,11 +1319,24 @@ export async function runLifecyclePlan(ctx: CommandContext): Promise<number> {
1319
1319
 
1320
1320
  Object.assign(allObservedResources, observed.resources);
1321
1321
 
1322
- // Held properties (#2162): opt-in on the same capability the deep diff
1323
- // path gates on. A held property is never a proposal, so it is
1324
- // computed here (once per lexicon, against this same observation) and
1325
- // carried on the plan beside `entries` rather than folded into one.
1326
- if (plugin.observeResourcesDeep) {
1322
+ // Held properties (#2162), behind `--deep` since #2405.
1323
+ //
1324
+ // A held property is never a proposal: it is computed against this same
1325
+ // observation and carried on the plan beside `entries`, never folded
1326
+ // into one. So the entries a plan proposes are identical whether this
1327
+ // ran or not, and the only thing `--deep` buys is the HELD section.
1328
+ //
1329
+ // It used to run whenever the lexicon could, which made the read's cost
1330
+ // a function of how many resources an estate holds rather than how it is
1331
+ // organised. Measured on 528 resources across 8 stacks: 24 stack-shaped
1332
+ // calls, and 496 from this pass. At ten thousand resources that is
1333
+ // roughly twenty thousand calls against eighty, for a section the caller
1334
+ // did not ask for.
1335
+ //
1336
+ // `--deep` is the flag `lifecycle snapshot` already uses for the same
1337
+ // choice, and `lifecycle diff` still runs the pass unconditionally
1338
+ // because property drift is the question it exists to answer.
1339
+ if (args.deep && plugin.observeResourcesDeep) {
1327
1340
  const deep = await deepDiffForLexicon(plugin, {
1328
1341
  environment,
1329
1342
  buildOutput,
package/src/cli/main.ts CHANGED
@@ -593,6 +593,11 @@ Lifecycle (alias: lc):
593
593
  property-level drift; --update-baseline records
594
594
  what it reports as accepted so it stops alerting)
595
595
  lifecycle plan <env> Typed change set (create/update/delete/adopt) vs live
596
+ --deep: also report properties declared
597
+ heldElsewhere(). Never changes what the plan
598
+ proposes; costs a provider call pair per readable
599
+ resource, so the read's cost becomes a function of
600
+ estate size rather than stack count (#2405)
596
601
  lifecycle affected Stacks a change affects (--base <ref> [--include-dependents])
597
602
  --json: emit the ChangeSet as JSON
598
603
  lifecycle whoami <env> Who chant would act as in each configured lexicon,
@@ -3949,7 +3949,40 @@ export async function planFoldTaint(
3949
3949
  files: readonly string[],
3950
3950
  wouldFold: ReadonlyMap<string, boolean>,
3951
3951
  liveSources?: ReadonlyMap<string, ReadonlySet<string>>,
3952
- ): Promise<Set<string>> {
3952
+ ): Promise<ReadonlySet<string>> {
3953
+ return (await planFoldTaintWithEdges(files, wouldFold, liveSources)).tainted;
3954
+ }
3955
+
3956
+ /** Which of the two rules put a file on the run path. */
3957
+ export type TaintEdgeKind =
3958
+ /** A file this one imports, directly or transitively, falls back to run (#1023). */
3959
+ | "importer"
3960
+ /** This file captured the objects of a file that falls back to run (#1044). */
3961
+ | "capture";
3962
+
3963
+ export interface TaintPlan {
3964
+ /** Every file that must run: the seed, plus everything reachable from it. */
3965
+ readonly tainted: ReadonlySet<string>;
3966
+ /**
3967
+ * For a file the walk reached (never for a seed file), the file whose taint
3968
+ * reached it and by which rule. chant#2406: the fallback reason has to name
3969
+ * the actual edge — a reverse-tainted file is not imported by anything that
3970
+ * runs, and saying it is sends a reader looking for an importer that does
3971
+ * not exist.
3972
+ */
3973
+ readonly reachedBy: ReadonlyMap<string, { from: string; kind: TaintEdgeKind }>;
3974
+ }
3975
+
3976
+ /**
3977
+ * {@link planFoldTaint}'s walk, keeping the edge that fired for each file it
3978
+ * reaches. Split out for two consumers that need to say *why*: the fallback
3979
+ * reason in `discover()`, and {@link foldProject}'s verdicts.
3980
+ */
3981
+ export async function planFoldTaintWithEdges(
3982
+ files: readonly string[],
3983
+ wouldFold: ReadonlyMap<string, boolean>,
3984
+ liveSources?: ReadonlyMap<string, ReadonlySet<string>>,
3985
+ ): Promise<TaintPlan> {
3953
3986
  const fileSet = new Set(files);
3954
3987
 
3955
3988
  // file -> set of OTHER discovered files it relatively imports OR re-exports
@@ -3958,7 +3991,9 @@ export async function planFoldTaint(
3958
3991
 
3959
3992
  // chant #1044 — reverse edges: consumed-file -> the folded files that
3960
3993
  // captured its objects. Same taint set, same fixpoint walk; see this
3961
- // function's doc for the crash this closes.
3994
+ // function's doc for the crash this closes. Kept in their own map as well,
3995
+ // so the walk below can tell which rule an edge belongs to.
3996
+ const reverse = new Map<string, Set<string>>();
3962
3997
  for (const [consumer, sources] of liveSources ?? []) {
3963
3998
  if (!fileSet.has(consumer)) continue;
3964
3999
  for (const source of sources) {
@@ -3969,20 +4004,97 @@ export async function planFoldTaint(
3969
4004
  edges.set(source, back);
3970
4005
  }
3971
4006
  back.add(consumer);
4007
+ let mine = reverse.get(source);
4008
+ if (!mine) {
4009
+ mine = new Set<string>();
4010
+ reverse.set(source, mine);
4011
+ }
4012
+ mine.add(consumer);
3972
4013
  }
3973
4014
  }
3974
4015
 
3975
4016
  const tainted = new Set<string>(files.filter((f) => wouldFold.get(f) !== true));
4017
+ const reachedBy = new Map<string, { from: string; kind: TaintEdgeKind }>();
3976
4018
  const queue = [...tainted];
3977
4019
  while (queue.length > 0) {
3978
4020
  const current = queue.shift()!;
3979
4021
  for (const target of edges.get(current) ?? []) {
3980
4022
  if (!tainted.has(target)) {
3981
4023
  tainted.add(target);
4024
+ // A forward edge means `current` imports `target`; the reverse map is
4025
+ // consulted second so a file reachable both ways is reported as the
4026
+ // importer case, the one a reader can see in its own source.
4027
+ const forward = !reverse.get(current)?.has(target);
4028
+ reachedBy.set(target, { from: current, kind: forward ? "importer" : "capture" });
3982
4029
  queue.push(target);
3983
4030
  }
3984
4031
  }
3985
4032
  }
3986
4033
 
3987
- return tainted;
4034
+ return { tainted, reachedBy };
4035
+ }
4036
+
4037
+ /** One file's place in a whole-build fold, as {@link foldProject} reports it. */
4038
+ export interface FoldProjectVerdict {
4039
+ /** What the build does with this file. */
4040
+ readonly verdict: "fold" | "run";
4041
+ /** What the file's own fold attempt concluded, before the taint walk. */
4042
+ readonly tentative: "fold" | "run";
4043
+ /** Present when `tentative` is "run": the located reason its own fold gave. */
4044
+ readonly reason?: string;
4045
+ /** Present when the file would have folded and taint overruled it. */
4046
+ readonly taintedBy?: { from: string; kind: TaintEdgeKind };
4047
+ /** The file's complete export namespace, present only when `verdict` is "fold". */
4048
+ readonly exports?: ReadonlyMap<string, unknown>;
4049
+ }
4050
+
4051
+ /**
4052
+ * Fold a whole set of project files and report every file's verdict
4053
+ * (chant#2408).
4054
+ *
4055
+ * `discover()` does this as part of building, and its per-file decisions are
4056
+ * not addressable from outside. Anything that wants to *check* the
4057
+ * cross-file rules needs the whole picture: the forward rule (#1023) needs an
4058
+ * importer, the reverse rule (#1044) needs a capturing sibling, and the
4059
+ * fixpoint needs the whole set, so none of the three is observable one file at
4060
+ * a time. The conformance suite of the specification is the first such caller
4061
+ * (INTENTIUS/typescript-as-data#62).
4062
+ *
4063
+ * Same session, same memo, same taint walk as a real build — this is not a
4064
+ * second implementation of the rules, it is the existing one with its
4065
+ * intermediate results kept instead of consumed.
4066
+ */
4067
+ export async function foldProject(
4068
+ files: readonly string[],
4069
+ intrinsics: readonly IntrinsicDef[] = [],
4070
+ ): Promise<Map<string, FoldProjectVerdict>> {
4071
+ const session = createFoldSession(intrinsics);
4072
+ const attempts = new Map<string, FoldFileResult>();
4073
+ for (const file of files) attempts.set(file, await tryFoldFile(file, intrinsics, session));
4074
+
4075
+ const plan = await planFoldTaintWithEdges(
4076
+ files,
4077
+ new Map(files.map((file) => [file, attempts.get(file)?.ok === true])),
4078
+ new Map(files.flatMap((file) => {
4079
+ const attempt = attempts.get(file);
4080
+ return attempt?.ok === true ? [[file, attempt.liveSources] as const] : [];
4081
+ })),
4082
+ );
4083
+
4084
+ const out = new Map<string, FoldProjectVerdict>();
4085
+ for (const file of files) {
4086
+ const attempt = attempts.get(file)!;
4087
+ const tentative = attempt.ok ? "fold" : "run";
4088
+ if (attempt.ok && !plan.tainted.has(file)) {
4089
+ out.set(file, { verdict: "fold", tentative, exports: attempt.exportedValues });
4090
+ continue;
4091
+ }
4092
+ out.set(file, {
4093
+ verdict: "run",
4094
+ tentative,
4095
+ reason: attempt.ok ? undefined : attempt.reason,
4096
+ taintedBy: attempt.ok ? plan.reachedBy.get(file) : undefined,
4097
+ });
4098
+ }
4099
+ return out;
3988
4100
  }
@@ -1,3 +1,4 @@
1
+ import { relative } from "node:path";
1
2
  import type { Declarable } from "../declarable";
2
3
  import type { DiscoveryError } from "../errors";
3
4
  import type { IntrinsicDef } from "../lexicon";
@@ -6,7 +7,7 @@ import { importModule } from "./import";
6
7
  import { collectEntities } from "./collect";
7
8
  import { resolveAttrRefs } from "./resolve";
8
9
  import { buildDependencyGraph } from "./graph";
9
- import { tryFoldFile, planFoldTaint, createFoldSession } from "./fold-import";
10
+ import { tryFoldFile, planFoldTaintWithEdges, createFoldSession } from "./fold-import";
10
11
  import { getProvenance } from "../provenance";
11
12
  import type { BuildParamProvenance } from "../provenance";
12
13
  import { buildParamValues } from "../build-params";
@@ -270,8 +271,8 @@ export async function discover(path: string, options?: DiscoveryOptions): Promis
270
271
  foldAttempts.set(file, await tryFoldFile(file, options.intrinsics, foldSession));
271
272
  }
272
273
  }
273
- const taintedFiles = options?.fold
274
- ? await planFoldTaint(
274
+ const taintPlan = options?.fold
275
+ ? await planFoldTaintWithEdges(
275
276
  files,
276
277
  new Map(files.map((file) => [file, foldAttempts.get(file)?.ok === true])),
277
278
  // chant #1044 — which files' OBJECTS each successful fold captured,
@@ -284,7 +285,8 @@ export async function discover(path: string, options?: DiscoveryOptions): Promis
284
285
  }),
285
286
  ),
286
287
  )
287
- : new Set<string>();
288
+ : { tainted: new Set<string>(), reachedBy: new Map() };
289
+ const taintedFiles = taintPlan.tainted;
288
290
 
289
291
  for (const file of files) {
290
292
  if (options?.fold) {
@@ -307,9 +309,15 @@ export async function discover(path: string, options?: DiscoveryOptions): Promis
307
309
  foldDecisions.push({ file, mode: "fold", resourceCount: folded.entities.length });
308
310
  continue;
309
311
  }
312
+ // chant#2406 — name the edge that actually fired. A reverse-tainted file
313
+ // is not imported by anything that falls back; saying so sends a reader
314
+ // looking for an importer that does not exist.
315
+ const edge = taintPlan.reachedBy.get(file);
310
316
  const reason = !folded.ok
311
317
  ? folded.reason
312
- : `would fold in isolation, but a file that imports it (directly or transitively) falls back to run — folding independently would create a duplicate, non-identical instance`;
318
+ : edge?.kind === "capture"
319
+ ? `would fold in isolation, but it captured objects from ${relative(process.cwd(), edge.from)}, which falls back to run — folding independently would hold an instance the build never collects`
320
+ : `would fold in isolation, but a file that imports it (directly or transitively) falls back to run — folding independently would create a duplicate, non-identical instance`;
313
321
  foldDecisions.push({ file, mode: "run", reason, reverseTainted: folded.ok });
314
322
  }
315
323
 
package/src/index.ts CHANGED
@@ -44,6 +44,18 @@ export * from "./fold/fold";
44
44
  // half of the fold subset a conformance adapter needs that `fold()` alone
45
45
  // does not expose. INTENTIUS/typescript-as-data#11.
46
46
  export { findSubsetViolation, checkObjectMember, type SubsetViolation, type SubsetRuleId } from "./fold/subset";
47
+ // The whole-build fold. `fold()` and `foldModule()` answer one expression and
48
+ // one file; neither cross-file rule is observable at that granularity — the
49
+ // forward rule needs an importer, the reverse rule needs a capturing sibling,
50
+ // and the fixpoint needs the whole set. chant#2408,
51
+ // INTENTIUS/typescript-as-data#62.
52
+ export {
53
+ foldProject,
54
+ planFoldTaintWithEdges,
55
+ type FoldProjectVerdict,
56
+ type TaintPlan,
57
+ type TaintEdgeKind,
58
+ } from "./discovery/fold-import";
47
59
  export * from "./lint/parser";
48
60
  export * from "./lint/rule";
49
61
  export * from "./lint/rules";