@intentius/chant 0.124.14 → 0.124.16
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 +6 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -0
- package/dist/change-set.d.ts +24 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +50 -1
- package/dist/ci-jobs.d.ts +227 -0
- package/dist/ci-jobs.d.ts.map +1 -0
- package/dist/ci-jobs.js +448 -0
- package/dist/cli/flush.d.ts +16 -0
- package/dist/cli/flush.d.ts.map +1 -0
- package/dist/cli/flush.js +42 -0
- package/dist/cli/handlers/approve.d.ts +98 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -0
- package/dist/cli/handlers/approve.js +495 -0
- package/dist/cli/handlers/operator.d.ts +1 -95
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/operator.js +4 -488
- package/dist/cli/handlers/override-approve.js +1 -1
- package/dist/cli/main.d.ts +4 -15
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +4 -1062
- package/dist/cli/parse-args.d.ts +6 -0
- package/dist/cli/parse-args.d.ts.map +1 -0
- package/dist/cli/parse-args.js +1028 -0
- package/dist/components/fan-out-record.d.ts +1 -1
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +3 -7
- package/dist/components/fan-out-run.d.ts +5 -3
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +7 -5
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +3 -2
- package/dist/composite.d.ts +10 -2
- package/dist/composite.d.ts.map +1 -1
- package/dist/composite.js +8 -0
- package/dist/discovery/collect.d.ts +2 -1
- package/dist/discovery/collect.d.ts.map +1 -1
- package/dist/discovery/collect.js +16 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +2 -107
- package/dist/discovery/host-composite.d.ts +35 -0
- package/dist/discovery/host-composite.d.ts.map +1 -0
- package/dist/discovery/host-composite.js +93 -0
- package/dist/discovery/index.d.ts +9 -0
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +1 -1
- package/dist/gate-decision.d.ts +20 -9
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +72 -19
- package/dist/gated-waves.d.ts +25 -6
- package/dist/gated-waves.d.ts.map +1 -1
- package/dist/gated-waves.js +21 -6
- package/dist/lifecycle/gate-audit.d.ts +69 -2
- package/dist/lifecycle/gate-audit.d.ts.map +1 -1
- package/dist/lifecycle/gate-audit.js +76 -2
- package/dist/lifecycle/gate-ledger.d.ts +24 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +9 -1
- package/dist/op/activities/activity-contracts.d.ts +5 -5
- package/dist/op/activities/activity-contracts.js +1 -1
- package/dist/op/activities/change-set.d.ts +8 -3
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +5 -2
- package/dist/op/activities/reconcile.d.ts +28 -16
- package/dist/op/activities/reconcile.d.ts.map +1 -1
- package/dist/op/activities/reconcile.js +34 -20
- package/dist/op/builders.d.ts +1 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +1 -1
- package/dist/op/op-waves-run.d.ts +2 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +8 -9
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +4 -8
- package/dist/package-version.d.ts +2 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +10 -0
- package/dist/wave-engine.d.ts +62 -0
- package/dist/wave-engine.d.ts.map +1 -0
- package/dist/wave-engine.js +59 -0
- package/dist/wave-layout.d.ts +29 -0
- package/dist/wave-layout.d.ts.map +1 -0
- package/dist/wave-layout.js +41 -0
- package/dist/wave-runtime.d.ts +29 -0
- package/dist/wave-runtime.d.ts.map +1 -0
- package/dist/wave-runtime.js +103 -0
- package/dist/wave-runtime.mjs +331 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts +7 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.js +17 -1
- package/dist/workspace/__fixtures__/sessions.d.ts +1 -1
- package/dist/workspace/__fixtures__/sessions.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/sessions.js +3 -3
- package/dist/workspace/ajv2020.d.ts +5 -0
- package/dist/workspace/ajv2020.d.ts.map +1 -0
- package/dist/workspace/ajv2020.js +14 -0
- package/dist/workspace/change-set.schema.json +5 -3
- package/dist/workspace/ci-green-workflow.d.ts +3 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +5 -2
- package/dist/workspace/class-data.d.ts +84 -0
- package/dist/workspace/class-data.d.ts.map +1 -0
- package/dist/workspace/class-data.js +238 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +4 -8
- package/dist/workspace/kinds.d.ts +3 -7
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +8 -45
- package/dist/workspace/points.d.ts.map +1 -1
- package/dist/workspace/points.js +2 -5
- package/dist/workspace/principal-classes.d.ts +4 -11
- package/dist/workspace/principal-classes.d.ts.map +1 -1
- package/dist/workspace/principal-classes.js +13 -99
- package/package.json +5 -3
- package/src/build.ts +8 -0
- package/src/change-set.test.ts +48 -0
- package/src/change-set.ts +52 -2
- package/src/ci-jobs.test.ts +49 -0
- package/src/ci-jobs.ts +515 -0
- package/src/cli/flush.ts +44 -0
- package/src/cli/handlers/approve.ts +618 -0
- package/src/cli/handlers/operator.ts +10 -608
- package/src/cli/handlers/override-approve.test.ts +1 -1
- package/src/cli/handlers/override-approve.ts +1 -1
- package/src/cli/main.ts +5 -816
- package/src/cli/parse-args.ts +781 -0
- package/src/components/fan-out-record.ts +3 -7
- package/src/components/fan-out-run.ts +7 -5
- package/src/components/pr-pipeline.ts +3 -2
- package/src/composite.ts +15 -3
- package/src/discovery/collect.ts +15 -1
- package/src/discovery/fold-build-parity.test.ts +71 -0
- package/src/discovery/fold-import.ts +2 -113
- package/src/discovery/fold-project-provenance.test.ts +21 -4
- package/src/discovery/host-composite.ts +101 -0
- package/src/discovery/index.ts +11 -1
- package/src/gate-decision-bundle.test.ts +6 -4
- package/src/gate-decision-identity.test.ts +59 -6
- package/src/gate-decision.ts +81 -21
- package/src/gated-waves.ts +28 -6
- package/src/lifecycle/gate-audit.test.ts +55 -1
- package/src/lifecycle/gate-audit.ts +116 -3
- package/src/lifecycle/gate-ledger.test.ts +20 -1
- package/src/lifecycle/gate-ledger.ts +33 -1
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +11 -3
- package/src/op/activities/lexicon-upgrade.test.ts +2 -0
- package/src/op/activities/reconcile.test.ts +62 -2
- package/src/op/activities/reconcile.ts +46 -22
- package/src/op/builders.ts +1 -1
- package/src/op/op-waves-run.ts +9 -9
- package/src/op/op-waves.test.ts +2 -0
- package/src/op/op-waves.ts +4 -8
- package/src/op/work-lease-run.test.ts +12 -4
- package/src/package-version.ts +11 -0
- package/src/wave-engine.test.ts +107 -0
- package/src/wave-engine.ts +98 -0
- package/src/wave-layout.ts +44 -0
- package/src/wave-runtime-bundle.test.ts +70 -0
- package/src/wave-runtime.e2e.test.ts +177 -0
- package/src/wave-runtime.ts +104 -0
- package/src/workspace/__fixtures__/contract-repo.ts +17 -1
- package/src/workspace/__fixtures__/sessions.ts +3 -3
- package/src/workspace/ajv2020.ts +17 -0
- package/src/workspace/change-set.schema.json +5 -3
- package/src/workspace/ci-green-workflow.test.ts +4 -4
- package/src/workspace/ci-green-workflow.ts +5 -2
- package/src/workspace/class-data.test.ts +64 -0
- package/src/workspace/class-data.ts +236 -0
- package/src/workspace/declaration.ts +4 -10
- package/src/workspace/kinds.ts +8 -40
- package/src/workspace/points.ts +2 -5
- package/src/workspace/principal-classes.ts +13 -99
- package/src/workspace/records-formats.test.ts +7 -2
- package/src/workspace/records-sessions-write.test.ts +3 -3
- package/src/workspace/status-contract.e2e.test.ts +37 -0
- package/src/workspace/status-contract.test.ts +23 -21
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { cpSync, readFileSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { afterAll, describe, expect, test } from "vitest";
|
|
15
|
-
import { cleanScratch, commitAll, contract, git, REPO, scratchDir } from "./__fixtures__/contract-repo";
|
|
15
|
+
import { cleanScratch, commitAll, contract, git, REPO, repoFixture, scratchDir } from "./__fixtures__/contract-repo";
|
|
16
16
|
import { declareSessions, DECISIONS_KIND, newSessionFields, sessionsRepo, SESSIONS_KIND } from "./__fixtures__/sessions";
|
|
17
17
|
import { sessionSeal } from "./record-sessions";
|
|
18
18
|
import { parseFrontMatter, recordTextDigest } from "./records";
|
|
@@ -36,12 +36,12 @@ const code = (doc: object) => ("error" in doc ? (doc as { error: { code: string
|
|
|
36
36
|
const HEX = /^[0-9a-f]{40}$/;
|
|
37
37
|
|
|
38
38
|
/** The reference fixture with a declaration, committed. */
|
|
39
|
-
|
|
39
|
+
const declared = repoFixture(() => {
|
|
40
40
|
const root = sessionsRepo();
|
|
41
41
|
declareSessions(root);
|
|
42
42
|
commitAll(root, "declare");
|
|
43
43
|
return root;
|
|
44
|
-
}
|
|
44
|
+
});
|
|
45
45
|
|
|
46
46
|
function front(root: string, path: string): Record<string, unknown> {
|
|
47
47
|
const fm = parseFrontMatter(readFileSync(join(root, path), "utf-8"));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chant repo's own workspace declaration reads through
|
|
3
|
+
* `chant workspace status` and validates against the output schema (#2557).
|
|
4
|
+
* It reads the real checkout, 28 members and a git call or more for each,
|
|
5
|
+
* which is 5 to 9 s: split from status-contract.test.ts so the unit budget
|
|
6
|
+
* keeps to fixtures built here (#3880).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import Ajv2020 from "ajv/dist/2020";
|
|
11
|
+
import { describe, expect, test } from "vitest";
|
|
12
|
+
import { listWorkspace } from "./ls";
|
|
13
|
+
import { workspaceStatus, type StatusDocument } from "./status";
|
|
14
|
+
import schema from "./status.schema.json";
|
|
15
|
+
|
|
16
|
+
const REPO = join(import.meta.dirname, "..", "..", "..", "..");
|
|
17
|
+
const validate = new Ajv2020({ strict: true, allErrors: true }).compile(schema);
|
|
18
|
+
|
|
19
|
+
function expectValid(doc: StatusDocument): void {
|
|
20
|
+
expect(validate(doc), JSON.stringify(validate.errors, null, 2)).toBe(true);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function result(doc: StatusDocument): Extract<StatusDocument, { members: unknown }> {
|
|
24
|
+
if ("error" in doc) throw new Error(`${doc.error.code}: ${doc.error.message}`);
|
|
25
|
+
return doc;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe("the chant repo's own declaration", () => {
|
|
29
|
+
test("validates and lists every declared member", async () => {
|
|
30
|
+
const doc = result(await workspaceStatus({ cwd: join(REPO, "packages", "core"), env: "prod", compareTo: "staging" }));
|
|
31
|
+
expectValid(doc);
|
|
32
|
+
expect(doc.workspace).toMatchObject({ name: "chant", root: ".", file: "chant.workspace.json" });
|
|
33
|
+
const ls = listWorkspace({ cwd: REPO });
|
|
34
|
+
if ("error" in ls) throw new Error(ls.error.message);
|
|
35
|
+
expect(doc.members.map((m) => m.name)).toEqual(ls.members.map((m) => m.name));
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { execFileSync } from "node:child_process";
|
|
10
|
-
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
10
|
+
import { cpSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { tmpdir } from "node:os";
|
|
12
12
|
import { dirname, join } from "node:path";
|
|
13
13
|
import Ajv2020 from "ajv/dist/2020";
|
|
14
14
|
import { afterAll, describe, expect, test, vi } from "vitest";
|
|
15
15
|
import type { CommandContext } from "../cli/registry";
|
|
16
|
-
import { listWorkspace } from "./ls";
|
|
17
16
|
import {
|
|
18
17
|
formatStatus,
|
|
19
18
|
runWorkspaceStatus,
|
|
@@ -35,8 +34,6 @@ import { runOpLocally } from "../op/local-executor";
|
|
|
35
34
|
import { shellCmd } from "../op/activities/shell";
|
|
36
35
|
import type { OpConfig } from "../op/types";
|
|
37
36
|
|
|
38
|
-
const REPO = join(import.meta.dirname, "..", "..", "..", "..");
|
|
39
|
-
|
|
40
37
|
const ajv = new Ajv2020({ strict: true, allErrors: true });
|
|
41
38
|
const validate = ajv.compile(schema);
|
|
42
39
|
|
|
@@ -98,6 +95,22 @@ function lifecycle(root: string, files: Record<string, string>): string {
|
|
|
98
95
|
return commit;
|
|
99
96
|
}
|
|
100
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Build a fixture repository once and hand each caller its own copy. A repo
|
|
100
|
+
* costs a dozen git processes; a file copy costs none, and a test may write
|
|
101
|
+
* to its copy without touching the next test's.
|
|
102
|
+
*/
|
|
103
|
+
function fixture(build: () => string): () => string {
|
|
104
|
+
let template: string | undefined;
|
|
105
|
+
return () => {
|
|
106
|
+
template ??= build();
|
|
107
|
+
const root = realpathSync(mkdtempSync(join(tmpdir(), "chant-status-")));
|
|
108
|
+
scratch.push(root);
|
|
109
|
+
cpSync(template, root, { recursive: true });
|
|
110
|
+
return root;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
101
114
|
let n = 0;
|
|
102
115
|
/** One ledger line. */
|
|
103
116
|
function release(component: string, env: string, digest: string, gitSha: string, extra: Record<string, string> = {}): string {
|
|
@@ -121,7 +134,7 @@ const D = (c: string) => `sha256:${c.repeat(64)}`;
|
|
|
121
134
|
const declaration = (members: unknown[]) => JSON.stringify({ name: "acme", schema: 1, members }, null, 2);
|
|
122
135
|
|
|
123
136
|
/** web has moved to _members/ (#2538); api and the root member still read the flat ledger. */
|
|
124
|
-
|
|
137
|
+
const twoLayouts = fixture(() => {
|
|
125
138
|
const root = repo({
|
|
126
139
|
"chant.workspace.json": declaration([
|
|
127
140
|
{ name: "site", dir: ".", kind: "other", because: "the root project" },
|
|
@@ -142,7 +155,7 @@ function twoLayouts(): string {
|
|
|
142
155
|
"prod/releases.jsonl": jsonl(release("api", "prod", D("c"), "c".repeat(40))),
|
|
143
156
|
});
|
|
144
157
|
return root;
|
|
145
|
-
}
|
|
158
|
+
});
|
|
146
159
|
|
|
147
160
|
describe("status output schema", () => {
|
|
148
161
|
test("is a valid draft 2020-12 document with the published $id", () => {
|
|
@@ -412,7 +425,7 @@ const NOW = "2026-09-24T00:00:00.000Z";
|
|
|
412
425
|
* Each gate is in one state: approved, pending with part of a quorum,
|
|
413
426
|
* expired, superseded, and an Op gate that records no environment.
|
|
414
427
|
*/
|
|
415
|
-
|
|
428
|
+
const gated = fixture(() => {
|
|
416
429
|
const root = twoLayouts();
|
|
417
430
|
lifecycle(root, {
|
|
418
431
|
"_members/web/staging/releases.jsonl": jsonl(release("web", "staging", D("a"), "a".repeat(40))),
|
|
@@ -437,7 +450,7 @@ function gated(): string {
|
|
|
437
450
|
"_gates/nightly.jsonl": jsonl(pending("nightly", "confirm", "2026-09-23T00:00:00.000Z"), approval("nightly", "confirm", "dave", "2026-09-23T01:00:00.000Z")),
|
|
438
451
|
});
|
|
439
452
|
return root;
|
|
440
|
-
}
|
|
453
|
+
});
|
|
441
454
|
|
|
442
455
|
describe("gate state in chant workspace status --json (#2674)", () => {
|
|
443
456
|
test("each member lists its gates with state, approvals, quorum and the approve line", async () => {
|
|
@@ -570,7 +583,7 @@ describe("stewards in chant workspace status --json (#2731)", () => {
|
|
|
570
583
|
});
|
|
571
584
|
|
|
572
585
|
/** A box member declaring one steward, local by default and fountain on fountain-k3d. */
|
|
573
|
-
|
|
586
|
+
const stewarded = fixture(() => {
|
|
574
587
|
const steward = {
|
|
575
588
|
kind: "Chant::Steward",
|
|
576
589
|
name: "box-steward",
|
|
@@ -594,7 +607,7 @@ describe("stewards in chant workspace status --json (#2731)", () => {
|
|
|
594
607
|
});
|
|
595
608
|
lifecycle(root, { "README": "ledger\n" });
|
|
596
609
|
return root;
|
|
597
|
-
}
|
|
610
|
+
});
|
|
598
611
|
|
|
599
612
|
test("names the steward, its form in the environment asked for, its Ops, schedules, last runs and lease", async () => {
|
|
600
613
|
const root = stewarded();
|
|
@@ -754,14 +767,3 @@ describe("stewards in chant workspace status --json (#2731)", () => {
|
|
|
754
767
|
expect(doc.members[0].stewardReasons.map((r) => r.code)).toEqual(["stewards-unreadable"]);
|
|
755
768
|
});
|
|
756
769
|
});
|
|
757
|
-
|
|
758
|
-
describe("chant workspace status on the chant repo (#2557)", () => {
|
|
759
|
-
test("validates and lists every declared member", async () => {
|
|
760
|
-
const doc = result(await workspaceStatus({ cwd: join(REPO, "packages", "core"), env: "prod", compareTo: "staging" }));
|
|
761
|
-
expectValid(doc);
|
|
762
|
-
expect(doc.workspace).toMatchObject({ name: "chant", root: ".", file: "chant.workspace.json" });
|
|
763
|
-
const ls = listWorkspace({ cwd: REPO });
|
|
764
|
-
if ("error" in ls) throw new Error(ls.error.message);
|
|
765
|
-
expect(doc.members.map((m) => m.name)).toEqual(ls.members.map((m) => m.name));
|
|
766
|
-
});
|
|
767
|
-
});
|