@intentius/chant 0.124.48 → 0.124.50
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/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +20 -12
- package/dist/cli/handlers/graph-reader.d.ts +26 -0
- package/dist/cli/handlers/graph-reader.d.ts.map +1 -0
- package/dist/cli/handlers/graph-reader.js +41 -0
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +14 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +40 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +22 -0
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +11 -0
- package/dist/cli/registry.d.ts +8 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/pr-run.d.ts +3 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -0
- package/dist/gate-decision.d.ts +9 -0
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +22 -7
- package/dist/lexicon.d.ts +23 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +4 -4
- package/dist/op/gate-approval-base.d.ts +25 -0
- package/dist/op/gate-approval-base.d.ts.map +1 -0
- package/dist/op/gate-approval-base.js +71 -0
- package/dist/op/gate-approval.d.ts +7 -4
- package/dist/op/gate-approval.d.ts.map +1 -1
- package/dist/op/gate-approval.js +2 -25
- package/dist/op/gate-name.d.ts +13 -0
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-name.js +14 -1
- package/dist/op/gate.d.ts +4 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/local-executor.d.ts +9 -2
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +24 -5
- package/dist/pr-loop.d.ts +10 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -0
- package/dist/pr-migrations.d.ts +62 -0
- package/dist/pr-migrations.d.ts.map +1 -0
- package/dist/pr-migrations.js +50 -0
- package/dist/pr-post.js +1 -1
- package/dist/wave-runtime.mjs +219 -218
- package/dist/workspace/check.schema.json +4 -2
- package/dist/workspace/checks/gate-approval.d.ts +58 -0
- package/dist/workspace/checks/gate-approval.d.ts.map +1 -0
- package/dist/workspace/checks/gate-approval.js +103 -0
- package/dist/workspace/checks.d.ts +1 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +4 -0
- package/dist/workspace/declaration.d.ts +7 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +13 -1
- package/dist/workspace/declaration.schema.json +33 -0
- package/dist/workspace/exit-cli.d.ts +44 -0
- package/dist/workspace/exit-cli.d.ts.map +1 -0
- package/dist/workspace/exit-cli.js +198 -0
- package/dist/workspace/exit.d.ts +159 -0
- package/dist/workspace/exit.d.ts.map +1 -0
- package/dist/workspace/exit.js +480 -0
- package/dist/workspace/exit.schema.json +257 -0
- package/dist/workspace/graph-cache.d.ts +3 -1
- package/dist/workspace/graph-cache.d.ts.map +1 -1
- package/dist/workspace/graph-cache.js +12 -1
- package/dist/workspace/import-fetch.d.ts +38 -0
- package/dist/workspace/import-fetch.d.ts.map +1 -0
- package/dist/workspace/import-fetch.js +99 -0
- package/dist/workspace/import-init.d.ts +26 -0
- package/dist/workspace/import-init.d.ts.map +1 -0
- package/dist/workspace/import-init.js +130 -0
- package/dist/workspace/import-source.d.ts +147 -0
- package/dist/workspace/import-source.d.ts.map +1 -0
- package/dist/workspace/import-source.js +370 -0
- package/dist/workspace/init.d.ts +4 -0
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +70 -3
- package/dist/workspace/kind-readers.d.ts +6 -0
- package/dist/workspace/kind-readers.d.ts.map +1 -1
- package/dist/workspace/kind-readers.js +18 -0
- package/dist/workspace/kinds.d.ts +24 -1
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +64 -4
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.js +13 -4
- package/dist/workspace/new-migrations.d.ts +47 -0
- package/dist/workspace/new-migrations.d.ts.map +1 -0
- package/dist/workspace/new-migrations.js +91 -0
- package/dist/workspace/pr-report.schema.json +46 -0
- package/dist/workspace/promote.d.ts +96 -0
- package/dist/workspace/promote.d.ts.map +1 -0
- package/dist/workspace/promote.js +263 -0
- package/dist/workspace/reason-codes.d.ts +13 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +14 -0
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/workspace-kinds.schema.json +50 -7
- package/package.json +1 -1
- package/src/cli/handlers/approve.ts +10 -2
- package/src/cli/handlers/graph-reader.test.ts +31 -0
- package/src/cli/handlers/graph-reader.ts +51 -0
- package/src/cli/handlers/graph.ts +14 -0
- package/src/cli/handlers/pr.ts +38 -1
- package/src/cli/main.test.ts +2 -0
- package/src/cli/main.ts +22 -0
- package/src/cli/parse-args.ts +8 -0
- package/src/cli/registry.ts +8 -0
- package/src/components/pr-env-run-bundle.test.ts +1 -0
- package/src/components/pr-run.ts +4 -0
- package/src/config.ts +16 -0
- package/src/gate-decision-bundle.test.ts +4 -2
- package/src/gate-decision-identity.test.ts +11 -0
- package/src/gate-decision.ts +26 -6
- package/src/lexicon.ts +24 -0
- package/src/op/gate-approval-at-base.test.ts +97 -0
- package/src/op/gate-approval-base.ts +72 -0
- package/src/op/gate-approval.ts +10 -21
- package/src/op/gate-name.ts +16 -1
- package/src/op/gate.ts +4 -3
- package/src/op/local-executor.ts +25 -5
- package/src/pr-loop-bundle.test.ts +3 -2
- package/src/pr-loop.test.ts +52 -0
- package/src/pr-loop.ts +12 -0
- package/src/pr-migrations.ts +97 -0
- package/src/pr-post.ts +1 -1
- package/src/workspace/__fixtures__/import/spacelift.json +9 -0
- package/src/workspace/__fixtures__/import/tfc.json +13 -0
- package/src/workspace/behold-kinds.test.ts +1 -0
- package/src/workspace/check-contract.test.ts +3 -2
- package/src/workspace/check.schema.json +4 -2
- package/src/workspace/checks/gate-approval.test.ts +77 -0
- package/src/workspace/checks/gate-approval.ts +121 -0
- package/src/workspace/checks.ts +4 -0
- package/src/workspace/declaration.schema.json +33 -0
- package/src/workspace/declaration.ts +19 -2
- package/src/workspace/exit-cli.ts +219 -0
- package/src/workspace/exit.schema.json +257 -0
- package/src/workspace/exit.test.ts +185 -0
- package/src/workspace/exit.ts +560 -0
- package/src/workspace/graph-cache.ts +12 -2
- package/src/workspace/identity.test.ts +18 -3
- package/src/workspace/import-fetch.ts +151 -0
- package/src/workspace/import-init.ts +147 -0
- package/src/workspace/import-source.test.ts +183 -0
- package/src/workspace/import-source.ts +462 -0
- package/src/workspace/init.test.ts +55 -1
- package/src/workspace/init.ts +66 -4
- package/src/workspace/kind-readers.test.ts +36 -0
- package/src/workspace/kind-readers.ts +18 -1
- package/src/workspace/kinds.test.ts +23 -0
- package/src/workspace/kinds.ts +81 -5
- package/src/workspace/lineage-upgrade.test.ts +20 -0
- package/src/workspace/lineage-upgrade.ts +16 -7
- package/src/workspace/new-migrations.test.ts +98 -0
- package/src/workspace/new-migrations.ts +109 -0
- package/src/workspace/pr-report.schema.json +46 -0
- package/src/workspace/promote.test.ts +114 -0
- package/src/workspace/promote.ts +302 -0
- package/src/workspace/reason-codes.test.ts +4 -0
- package/src/workspace/reason-codes.ts +14 -0
- package/src/workspace/workspace-kinds.schema.json +50 -7
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace promote <member>` (#3178): move one member one rung up the
|
|
3
|
+
* kind ladder, `other` or `terraform`, then `choudoufu`, then `chant`.
|
|
4
|
+
*
|
|
5
|
+
* The change is staged the way `workspace upgrade` stages one (#2550): in a
|
|
6
|
+
* git worktree at HEAD, so the tree is never touched until the gate passes.
|
|
7
|
+
* The gate is `workspace-promote/<member>` on the gate ledger and binds the
|
|
8
|
+
* digest of the patch the staging produced. The first run records a pending
|
|
9
|
+
* fact and exits 3. After `chant approve workspace-promote <member>`, the same
|
|
10
|
+
* command stages again, finds the approval for the same digest, applies the
|
|
11
|
+
* patch, and runs the rung's follow-up (for `choudoufu`, stamping the
|
|
12
|
+
* ownership markers with `live-import -approve`).
|
|
13
|
+
*
|
|
14
|
+
* Rungs:
|
|
15
|
+
*
|
|
16
|
+
* - `terraform` to `choudoufu`: `choudoufu live-check` in the member's
|
|
17
|
+
* directory must pass, then `choudoufu live-import -state=<--state>
|
|
18
|
+
* -estate=<member>` prints its ratification report (read-only: it stamps
|
|
19
|
+
* nothing without `-approve`). The patch changes the member's kind.
|
|
20
|
+
* - `choudoufu` or `other` to `chant`: `chant import` writes TypeScript into
|
|
21
|
+
* the member's directory. The patch holds those files and the kind change.
|
|
22
|
+
*
|
|
23
|
+
* Commands run through an injectable runner, so a test never starts a binary.
|
|
24
|
+
*/
|
|
25
|
+
import { execFileSync, spawn } from "node:child_process";
|
|
26
|
+
import { existsSync, mkdirSync, realpathSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
27
|
+
import { tmpdir } from "node:os";
|
|
28
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
29
|
+
import { formatError, formatInfo, formatSuccess, formatWarning } from "../cli/format.js";
|
|
30
|
+
import { computePlanDigest } from "../lifecycle/plan-digest.js";
|
|
31
|
+
import { LIFECYCLE_LOCAL_NOTE, isLifecycleLocalNote } from "../lifecycle/local-note.js";
|
|
32
|
+
import { approveCommand, describeGateMismatch, evaluateGate, gateIsSealed, gitGateLedgerPort } from "../op/gate.js";
|
|
33
|
+
import { WORKSPACE_PROMOTE_GATE_OP } from "../op/gate-name.js";
|
|
34
|
+
import { DECLARATION_FILES, readDeclaration } from "./declaration.js";
|
|
35
|
+
import { setProperty } from "./json-edit.js";
|
|
36
|
+
import { workingTree } from "./tree.js";
|
|
37
|
+
export const PROMOTE_PLAN_KIND = "workspace-promote";
|
|
38
|
+
export const PROMOTE_GATED_EXIT = 3;
|
|
39
|
+
const USAGE = "chant workspace promote <member> [--state <terraform.tfstate>] [--lexicon <lexicon>] [--dry-run] [--output <patch file>] [--json]";
|
|
40
|
+
export class PromoteError extends Error {
|
|
41
|
+
}
|
|
42
|
+
/** The ladder, lowest rung first. `other` and `terraform` share the bottom rung. */
|
|
43
|
+
export const LADDER = ["terraform", "choudoufu", "chant"];
|
|
44
|
+
/** The next rung for a member of `kind`, or undefined at the top or off the ladder. */
|
|
45
|
+
export function nextRung(kind) {
|
|
46
|
+
if (kind === "terraform")
|
|
47
|
+
return { from: kind, to: "choudoufu" };
|
|
48
|
+
if (kind === "choudoufu" || kind === "other")
|
|
49
|
+
return { from: kind, to: "chant" };
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
export const spawnRunner = (argv, cwd) => new Promise((done) => {
|
|
53
|
+
const [bin, ...rest] = argv;
|
|
54
|
+
const child = spawn(bin, rest, { cwd, stdio: ["ignore", "pipe", "pipe"], env: process.env });
|
|
55
|
+
const out = [];
|
|
56
|
+
child.stdout.on("data", (c) => out.push(c));
|
|
57
|
+
child.stderr.on("data", (c) => out.push(c));
|
|
58
|
+
child.on("error", (e) => done({ exitCode: 127, output: String(e.message) }));
|
|
59
|
+
child.on("close", (code) => done({ exitCode: code ?? 1, output: Buffer.concat(out).toString("utf-8") }));
|
|
60
|
+
});
|
|
61
|
+
/** The commands the rung runs in the staging worktree. */
|
|
62
|
+
export function stagingRuns(rung, member, opts) {
|
|
63
|
+
if (rung.to === "choudoufu") {
|
|
64
|
+
if (!opts.state)
|
|
65
|
+
throw new PromoteError(`promoting ${member.name} to choudoufu reads its state for the adoption report: pass --state <terraform.tfstate>`);
|
|
66
|
+
return [
|
|
67
|
+
{ label: "choudoufu live-check", argv: ["choudoufu", "live-check"], cwd: member.dir },
|
|
68
|
+
{ label: "choudoufu live-import (report)", argv: ["choudoufu", "live-import", `-state=${opts.state}`, `-estate=${member.name}`], cwd: member.dir },
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
const lexicon = opts.lexicon ?? (rung.from === "choudoufu" ? "terraform" : undefined);
|
|
72
|
+
if (!lexicon)
|
|
73
|
+
throw new PromoteError(`promoting ${member.name} (kind other) to chant needs --lexicon <lexicon>: what chant import should read it as`);
|
|
74
|
+
return [{ label: "chant import", argv: ["chant", "import", ".", "--lexicon", lexicon, "--output", "src/"], cwd: member.dir }];
|
|
75
|
+
}
|
|
76
|
+
/** After the approved patch is applied: stamping ownership markers on the live resources. */
|
|
77
|
+
export function followUpRuns(rung, member, opts) {
|
|
78
|
+
if (rung.to !== "choudoufu")
|
|
79
|
+
return [];
|
|
80
|
+
return [{ label: "choudoufu live-import -approve", argv: ["choudoufu", "live-import", `-state=${opts.state}`, `-estate=${member.name}`, "-approve"], cwd: member.dir }];
|
|
81
|
+
}
|
|
82
|
+
function git(cwd, args) {
|
|
83
|
+
return execFileSync("git", args, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"], maxBuffer: 256 * 1024 * 1024 });
|
|
84
|
+
}
|
|
85
|
+
function declarationFile(root) {
|
|
86
|
+
const f = DECLARATION_FILES.find((n) => existsSync(join(root, n)));
|
|
87
|
+
if (!f)
|
|
88
|
+
throw new PromoteError(`no ${DECLARATION_FILES.join(" or ")} in ${root}`);
|
|
89
|
+
return f;
|
|
90
|
+
}
|
|
91
|
+
/** Rewrite the member's `kind` in the declaration text. */
|
|
92
|
+
export function setMemberKind(text, file, member, kind) {
|
|
93
|
+
const raw = (file.endsWith(".jsonc") ? text.replace(/^\s*\/\/.*$/gm, "") : text);
|
|
94
|
+
const parsed = JSON.parse(raw);
|
|
95
|
+
const i = (parsed.members ?? []).findIndex((m) => m.name === member);
|
|
96
|
+
if (i < 0)
|
|
97
|
+
throw new PromoteError(`the declaration has no member "${member}"`);
|
|
98
|
+
return setProperty(text, file.endsWith(".jsonc"), `/members/${i}`, "kind", kind);
|
|
99
|
+
}
|
|
100
|
+
export async function promoteCommand(opts) {
|
|
101
|
+
const root = realpathSync(resolve(opts.root));
|
|
102
|
+
const run = opts.runner ?? spawnRunner;
|
|
103
|
+
const decl = readDeclaration(workingTree(root));
|
|
104
|
+
const found = decl.members.find((m) => m.name === opts.member);
|
|
105
|
+
if (!found)
|
|
106
|
+
throw new PromoteError(`the declaration has no member "${opts.member}"; chant workspace ls lists them`);
|
|
107
|
+
const say = (m) => {
|
|
108
|
+
if (!opts.json)
|
|
109
|
+
console.error(m);
|
|
110
|
+
};
|
|
111
|
+
const rung = nextRung(found.kind);
|
|
112
|
+
if (!rung) {
|
|
113
|
+
say(formatInfo(`${found.name} is kind ${found.kind}, which has no rung above it on the ladder (terraform or other, choudoufu, chant)`));
|
|
114
|
+
return { outcome: "top-of-ladder", exitCode: 0, member: found.name, from: found.kind };
|
|
115
|
+
}
|
|
116
|
+
const member = { name: found.name, dir: found.dir === "." ? "" : found.dir };
|
|
117
|
+
const staging = stagingRuns(rung, member, opts);
|
|
118
|
+
let repo;
|
|
119
|
+
let head;
|
|
120
|
+
try {
|
|
121
|
+
repo = git(root, ["rev-parse", "--show-toplevel"]).trim();
|
|
122
|
+
head = git(root, ["rev-parse", "HEAD"]).trim();
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
throw new PromoteError("chant workspace promote stages its change in a git worktree, so the project must be in a git repository with at least one commit");
|
|
126
|
+
}
|
|
127
|
+
const projectRel = relative(repo, root).split(sep).join("/");
|
|
128
|
+
const declFile = declarationFile(root);
|
|
129
|
+
const watched = [declFile, member.dir].filter(Boolean).map((p) => [projectRel, p].filter(Boolean).join("/"));
|
|
130
|
+
const dirty = git(repo, ["status", "--porcelain", "--untracked-files=all", "--", ...watched]).split("\n").filter(Boolean);
|
|
131
|
+
if (dirty.length > 0) {
|
|
132
|
+
throw new PromoteError(`${found.name} has uncommitted changes (${dirty.slice(0, 5).map((l) => l.slice(3)).join(", ")}). Commit them: promote stages from HEAD and applies its patch to the tree.`);
|
|
133
|
+
}
|
|
134
|
+
const holder = mkdtempSync(join(tmpdir(), "chant-promote-"));
|
|
135
|
+
const worktree = join(holder, "wt");
|
|
136
|
+
const dispose = () => {
|
|
137
|
+
try {
|
|
138
|
+
git(repo, ["worktree", "remove", "--force", worktree]);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// Fall through to the directory removal and a prune.
|
|
142
|
+
}
|
|
143
|
+
rmSync(holder, { recursive: true, force: true });
|
|
144
|
+
try {
|
|
145
|
+
git(repo, ["worktree", "prune"]);
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// Nothing to prune.
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
git(repo, ["worktree", "add", "-q", "--detach", worktree, head]);
|
|
153
|
+
const project = projectRel ? join(worktree, projectRel) : worktree;
|
|
154
|
+
const ran = [];
|
|
155
|
+
for (const step of staging) {
|
|
156
|
+
const cwd = join(project, step.cwd);
|
|
157
|
+
mkdirSync(cwd, { recursive: true });
|
|
158
|
+
const result = await run(step.argv, cwd);
|
|
159
|
+
ran.push({ label: step.label, exitCode: result.exitCode });
|
|
160
|
+
if (!opts.json)
|
|
161
|
+
say(formatInfo(`${step.label}: exit ${result.exitCode}`));
|
|
162
|
+
if (result.exitCode !== 0) {
|
|
163
|
+
say(formatError({ message: `${step.label} failed in the staging worktree`, hint: result.output.trimEnd().split("\n").slice(-20).join("\n") }));
|
|
164
|
+
say(formatError({ message: "the promotion was not gated: its checks must pass first. The tree is unchanged." }));
|
|
165
|
+
if (opts.json)
|
|
166
|
+
console.log(JSON.stringify({ outcome: "checks-failed", member: found.name, ran }, null, 2));
|
|
167
|
+
return { outcome: "checks-failed", exitCode: 1, member: found.name, from: rung.from, to: rung.to, ran };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const declPath = join(project, declFile);
|
|
171
|
+
writeFileSync(declPath, setMemberKind(readFileSync(declPath, "utf-8"), declFile, found.name, rung.to));
|
|
172
|
+
git(worktree, ["add", "-A"]);
|
|
173
|
+
const patch = git(worktree, ["diff", "--cached", "--binary", "HEAD"]);
|
|
174
|
+
const digest = computePlanDigest(PROMOTE_PLAN_KIND, { member: found.name, from: rung.from, to: rung.to, patch });
|
|
175
|
+
const base = { outcome: "dry-run", exitCode: 0, member: found.name, from: rung.from, to: rung.to, digest, patch, ran };
|
|
176
|
+
const report = (outcome, exitCode, extra = {}) => {
|
|
177
|
+
if (opts.json)
|
|
178
|
+
console.log(JSON.stringify({ outcome, member: found.name, from: rung.from, to: rung.to, digest, ran, ...extra }, null, 2));
|
|
179
|
+
return { ...base, outcome, exitCode };
|
|
180
|
+
};
|
|
181
|
+
say(formatInfo(`${found.name}: ${rung.from} to ${rung.to}, patch ${digest}`));
|
|
182
|
+
if (opts.output)
|
|
183
|
+
writeFileSync(resolve(opts.output), patch);
|
|
184
|
+
if (opts.dryRun) {
|
|
185
|
+
say(formatInfo("--dry-run: staged and checked; no gate recorded, the tree is unchanged"));
|
|
186
|
+
return report("dry-run", 0);
|
|
187
|
+
}
|
|
188
|
+
const check = await evaluateGate(opts.ledger ?? gitGateLedgerPort({ cwd: repo }), {
|
|
189
|
+
op: WORKSPACE_PROMOTE_GATE_OP,
|
|
190
|
+
gate: found.name,
|
|
191
|
+
description: `promote ${found.name} from ${rung.from} to ${rung.to}`,
|
|
192
|
+
planDigest: digest,
|
|
193
|
+
...(opts.now ? { now: opts.now } : {}),
|
|
194
|
+
});
|
|
195
|
+
if (!check.satisfied) {
|
|
196
|
+
if (!opts.json) {
|
|
197
|
+
const sealed = await gateIsSealed(found.name);
|
|
198
|
+
if (check.mismatch)
|
|
199
|
+
console.error(formatWarning({ message: describeGateMismatch(WORKSPACE_PROMOTE_GATE_OP, found.name, check.mismatch, sealed) }));
|
|
200
|
+
if (isLifecycleLocalNote(check.pushWarning))
|
|
201
|
+
console.error(formatInfo(LIFECYCLE_LOCAL_NOTE));
|
|
202
|
+
else if (check.pushWarning)
|
|
203
|
+
console.error(formatWarning({ message: check.pushWarning }));
|
|
204
|
+
console.error(formatInfo(`Gated: the patch ${digest} waits for approval. Review it (--output <file> writes it), then run \`${approveCommand(WORKSPACE_PROMOTE_GATE_OP, found.name, undefined, undefined, sealed)}\` and repeat this command to apply it.`));
|
|
205
|
+
}
|
|
206
|
+
return report("gated", PROMOTE_GATED_EXIT, { pending: check.pending });
|
|
207
|
+
}
|
|
208
|
+
const patchDir = mkdtempSync(join(tmpdir(), "chant-promote-patch-"));
|
|
209
|
+
try {
|
|
210
|
+
const file = join(patchDir, "promote.patch");
|
|
211
|
+
writeFileSync(file, patch);
|
|
212
|
+
try {
|
|
213
|
+
git(repo, ["apply", "--binary", "--whitespace=nowarn", file]);
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
const stderr = err.stderr?.toString().trim();
|
|
217
|
+
throw new PromoteError(`the approved patch no longer applies to the tree${stderr ? `: ${stderr}` : ""}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
rmSync(patchDir, { recursive: true, force: true });
|
|
222
|
+
}
|
|
223
|
+
for (const step of followUpRuns(rung, member, opts)) {
|
|
224
|
+
const result = await run(step.argv, join(root, step.cwd));
|
|
225
|
+
ran.push({ label: step.label, exitCode: result.exitCode });
|
|
226
|
+
if (result.exitCode !== 0) {
|
|
227
|
+
say(formatError({ message: `${step.label} failed after the patch was applied`, hint: result.output.trimEnd().split("\n").slice(-20).join("\n") }));
|
|
228
|
+
return report("applied", 1, { followUpFailed: step.label });
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
say(formatSuccess(`applied the approved promotion of "${found.name}" to ${rung.to} (${digest}). Review and commit it.`));
|
|
232
|
+
return report("applied", 0);
|
|
233
|
+
}
|
|
234
|
+
finally {
|
|
235
|
+
dispose();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
export async function runWorkspacePromote(ctx) {
|
|
239
|
+
const { args } = ctx;
|
|
240
|
+
if (!args.extraPositional || args.extraPositional2) {
|
|
241
|
+
console.error(formatError({ message: "promote takes exactly one member", hint: USAGE }));
|
|
242
|
+
return 1;
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
const result = await promoteCommand({
|
|
246
|
+
root: process.cwd(),
|
|
247
|
+
member: args.extraPositional,
|
|
248
|
+
state: args.statePath,
|
|
249
|
+
lexicon: args.lexicon,
|
|
250
|
+
dryRun: args.dryRun,
|
|
251
|
+
output: args.output,
|
|
252
|
+
json: args.json,
|
|
253
|
+
});
|
|
254
|
+
return result.exitCode;
|
|
255
|
+
}
|
|
256
|
+
catch (err) {
|
|
257
|
+
if (err instanceof PromoteError) {
|
|
258
|
+
console.error(formatError({ message: err.message, hint: USAGE }));
|
|
259
|
+
return 1;
|
|
260
|
+
}
|
|
261
|
+
throw err;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
@@ -231,6 +231,7 @@ export declare const REASONS: {
|
|
|
231
231
|
readonly "ci-workflow-pipeline-missing": "Under ci.workflow, no pipeline file runs the plan job, the merge job or chant ci tick.";
|
|
232
232
|
readonly "ci-workflow-pipeline-differs": "Under ci.workflow, the pipeline does not match the workflow: it applies on merge under trunk-curated, records under trunk-curated+apply-on-merge, or applies before merge, or fails to, against apply-before-merge.";
|
|
233
233
|
readonly "ci-workflow-publish-missing": "Under ci.workflow, no pipeline file runs chant release publish.";
|
|
234
|
+
readonly "gate-approval-unbased": "An Op gate's approval block sets a quorum, policy, mode or context that identity.gates does not set at base, so the change being run can edit it.";
|
|
234
235
|
readonly "ci-branch-route-differs": "A member's generated pull-request pipeline targets a branch other than the one ci.branches routes the member to.";
|
|
235
236
|
readonly "box-credential-declared": "A file in a box member's directory carries a literal secret: a credential's shape, or a literal where a credential goes. A variable or secret-manager reference is not one.";
|
|
236
237
|
readonly "box-capability-unbrokered": "A capability in a member's box block names no broker, so the box would hold its credential.";
|
|
@@ -311,6 +312,18 @@ export declare const REASONS: {
|
|
|
311
312
|
readonly "runner-key-unlisted": "The policy at base lists no runner with the key given to evidence sign or runs sign.";
|
|
312
313
|
readonly "lock-invalid": "The lineage lock can't be read.";
|
|
313
314
|
readonly "manual-step-open": "A scope in the lineage lock has an open manual step.";
|
|
315
|
+
readonly "missing-dir": "The chant member's directory does not exist, so there is nothing to build.";
|
|
316
|
+
readonly "no-lexicon": "No lexicon is named in the member's chant.config.* or package.json, so there is nothing to build.";
|
|
317
|
+
readonly "lexicon-unsupported": "A lexicon the member uses has no native target in workspace exit.";
|
|
318
|
+
readonly "exit-failed": "The member's exit did not finish: its build failed, or it was refused.";
|
|
319
|
+
readonly "choudoufu-steps-missing": "A choudoufu member's exit listed no roundtrip steps.";
|
|
320
|
+
readonly "native-missing": "A native file the exit wrote is missing or empty.";
|
|
321
|
+
readonly "native-unreadable": "A native file the exit wrote is not valid JSON, or has no content.";
|
|
322
|
+
readonly "no-deploy-command": "A native file that can be deployed has no stock deploy command.";
|
|
323
|
+
readonly "chant-config-left": "A chant.config.* file is still in the exited member.";
|
|
324
|
+
readonly "chant-dependency": "The member's package.json still has a chant dependency, or a script that calls chant.";
|
|
325
|
+
readonly "chant-in-ci": "A CI file of the exited member still calls chant.";
|
|
326
|
+
readonly "declaration-not-other": "The declaration still gives the exited member a kind other than other.";
|
|
314
327
|
};
|
|
315
328
|
export type ReasonCode = keyof typeof REASONS;
|
|
316
329
|
/** Every code, in the order of {@link REASONS}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/workspace/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sHAAsH;AACtH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,uHAAu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EAAE,mGAAmG;aACjH,qBAAqB,EAAE,mEAAmE;aAC1F,aAAa,EAAE,wEAAwE;aACvF,yBAAyB,EAAE,sDAAsD;aACjF,gBAAgB,EAAE,mDAAmD;aACrE,mBAAmB,EAAE,oEAAoE;aACzF,mBAAmB,EAAE,iEAAiE;aACtF,mBAAmB,EAAE,sDAAsD;aAC3E,kBAAkB,EAAE,uFAAuF;aAC3G,aAAa,EAAE,mDAAmD;aAClE,uBAAuB,EAAE,wEAAwE;CACzF,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC;AAE9C,mDAAmD;AACnD,eAAO,MAAM,YAAY,EAA2B,UAAU,EAAE,CAAC;AAEjE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,MAAM,IAAI,MAAM,EAAE,CAAC;AAEtD,eAAO,MAAM,WAAW,QAAkD,CAAC;AAE3E,2HAA2H;AAC3H,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAI/E"}
|
|
@@ -272,6 +272,7 @@ export const REASONS = {
|
|
|
272
272
|
"ci-workflow-pipeline-missing": "Under ci.workflow, no pipeline file runs the plan job, the merge job or chant ci tick.",
|
|
273
273
|
"ci-workflow-pipeline-differs": "Under ci.workflow, the pipeline does not match the workflow: it applies on merge under trunk-curated, records under trunk-curated+apply-on-merge, or applies before merge, or fails to, against apply-before-merge.",
|
|
274
274
|
"ci-workflow-publish-missing": "Under ci.workflow, no pipeline file runs chant release publish.",
|
|
275
|
+
"gate-approval-unbased": "An Op gate's approval block sets a quorum, policy, mode or context that identity.gates does not set at base, so the change being run can edit it.",
|
|
275
276
|
"ci-branch-route-differs": "A member's generated pull-request pipeline targets a branch other than the one ci.branches routes the member to.",
|
|
276
277
|
// A box that holds a credential (check, #2726). Each is also a WSP finding.
|
|
277
278
|
"box-credential-declared": "A file in a box member's directory carries a literal secret: a credential's shape, or a literal where a credential goes. A variable or secret-manager reference is not one.",
|
|
@@ -373,6 +374,19 @@ export const REASONS = {
|
|
|
373
374
|
// The lineage lock (check).
|
|
374
375
|
"lock-invalid": "The lineage lock can't be read.",
|
|
375
376
|
"manual-step-open": "A scope in the lineage lock has an open manual step.",
|
|
377
|
+
// workspace exit (#3177): why a member can't be exited, and what the exit drill finds wrong with one that was.
|
|
378
|
+
"missing-dir": "The chant member's directory does not exist, so there is nothing to build.",
|
|
379
|
+
"no-lexicon": "No lexicon is named in the member's chant.config.* or package.json, so there is nothing to build.",
|
|
380
|
+
"lexicon-unsupported": "A lexicon the member uses has no native target in workspace exit.",
|
|
381
|
+
"exit-failed": "The member's exit did not finish: its build failed, or it was refused.",
|
|
382
|
+
"choudoufu-steps-missing": "A choudoufu member's exit listed no roundtrip steps.",
|
|
383
|
+
"native-missing": "A native file the exit wrote is missing or empty.",
|
|
384
|
+
"native-unreadable": "A native file the exit wrote is not valid JSON, or has no content.",
|
|
385
|
+
"no-deploy-command": "A native file that can be deployed has no stock deploy command.",
|
|
386
|
+
"chant-config-left": "A chant.config.* file is still in the exited member.",
|
|
387
|
+
"chant-dependency": "The member's package.json still has a chant dependency, or a script that calls chant.",
|
|
388
|
+
"chant-in-ci": "A CI file of the exited member still calls chant.",
|
|
389
|
+
"declaration-not-other": "The declaration still gives the exited member a kind other than other.",
|
|
376
390
|
};
|
|
377
391
|
/** Every code, in the order of {@link REASONS}. */
|
|
378
392
|
export const REASON_CODES = Object.keys(REASONS);
|
|
@@ -29,7 +29,7 @@ export type SearchErrorCode = (typeof SEARCH_ERROR_CODES)[number];
|
|
|
29
29
|
export declare const WORKSPACE_SEARCH_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown", "live-at-revision", "snapshot-at-revision", "query-invalid", "usage-invalid"];
|
|
30
30
|
export type WorkspaceSearchErrorCode = (typeof WORKSPACE_SEARCH_ERROR_CODES)[number];
|
|
31
31
|
/** Every `error.code` a `search` document can carry, in either form. */
|
|
32
|
-
export declare const SEARCH_DOCUMENT_ERROR_CODES: ("agent-unknown" | "amend-id-immutable" | "amend-supersede-instead" | "answer-field-unsupported" | "answer-in-steward-turn" | "answer-never-over-mcp" | "answer-not-answered" | "answer-not-candidate" | "answer-point-changed" | "answer-point-unknown" | "answer-points-unreadable" | "asset-drift" | "asset-missing" | "asset-stale" | "box-capability-unbrokered" | "box-credential-declared" | "box-fountain-callback-undeclared" | "box-intent-unconstrained" | "box-intent-unknown" | "box-isolation-collision" | "box-isolation-literal" | "box-none" | "box-several" | "build-failed" | "capability-not-derivable" | "change-out-of-scope" | "change-uncovered" | "ci-branch-route-differs" | "ci-branch-unknown" | "ci-green-undeclared" | "ci-workflow-apply-in-green" | "ci-workflow-green-undeclared" | "ci-workflow-no-components" | "ci-workflow-no-environments" | "ci-workflow-no-pre-merge" | "ci-workflow-pipeline-differs" | "ci-workflow-pipeline-missing" | "ci-workflow-publish-missing" | "ci-workflow-ungated-env" | "command-failed" | "commit-unlinked" | "commit-wrongly-linked" | "composites-no-chant-member" | "composites-no-component" | "composites-none-declared" | "declaration-ambiguous" | "declaration-invalid" | "declaration-missing" | "declaration-unparseable" | "diagram-render-drift" | "diagram-render-missing" | "diagram-source-missing" | "dir-missing" | "envelope-invalid" | "envelope-unreadable" | "envelope-untrusted" | "environment-invalid" | "environment-unknown" | "environments-component-undeclared" | "environments-ledger-undeclared" | "environments-ledger-unreadable" | "environments-none-declared" | "evidence-payload-type" | "evidence-runner-mismatch" | "evidence-statement-invalid" | "executor-config-unreadable" | "executor-none-declared" | "factory-box-missing" | "factory-member-unknown" | "filter-invalid" | "flag-stale" | "flag-work-unknown" | "gates-ledger-unreadable" | "gates-no-gate-ledger" | "gates-no-ledger" | "intent-artifact-unpinned" | "intent-commit-bare" | "intent-commit-join-conflict" | "intent-commit-undecided" | "intent-constraint-coarse" | "intent-constraint-lost" | "intent-decision-contested" | "intent-decision-provisional" | "intent-decision-superseded-live" | "intent-decision-unimplemented" | "intent-evidence-unpinned" | "intent-history-shallow" | "intent-pin-drifted" | "intent-pin-missing" | "intent-pin-stale" | "intent-plugin-failed" | "intent-record-unknown" | "intent-region-invalid" | "intent-region-unconstrained" | "intent-symbol-ambiguous" | "intent-symbol-unknown" | "intent-symbol-unsupported" | "intent-trailer-unverified" | "intent-why-no-decision" | "intent-why-no-run" | "intent-why-run-ambiguous" | "intent-why-uncommitted" | "intent-work-blocked" | "intent-work-open-decided-code" | "ir-version-unsupported" | "kind-invalid" | "kind-not-run" | "kind-probe-failed" | "kind-unreadable" | "lease-held" | "lease-not-held" | "lease-push-rejected" | "lease-race" | "lease-token-mismatch" | "ledger-malformed" | "ledger-unreadable" | "lexicon-has-no-mapping" | "lexicon-not-loaded" | "listing-box-missing" | "listing-cover-invalid" | "listing-member-unknown" | "live-at-revision" | "location-missing" | "lock-invalid" | "manual-step-open" | "member-chant-too-old" | "member-exists" | "member-unknown" | "no-matches" | "not-a-git-repository" | "output-unreadable" | "patch-path-invalid" | "placement-invalid" | "point-candidates-invalid" | "point-decider-failed" | "point-inputs-invalid" | "point-unknown" | "points-invalid" | "points-undeclared" | "principal-unidentified" | "publish-answer-invalid" | "publish-failed" | "publish-member-unknown" | "publish-none" | "publish-refused" | "publish-unrecorded" | "query-invalid" | "quorum-not-met" | "ratify-quorum-not-met" | "reader-too-old" | "record-closed" | "record-conflict" | "record-id-duplicate" | "record-id-taken" | "record-id-unallocatable" | "record-no-evidence" | "record-not-found" | "record-path-unmatched" | "record-ratified-below-quorum" | "record-remediates-not-closed" | "record-remediates-unknown" | "record-schema-invalid" | "record-seal-mismatch" | "record-sign-failed" | "record-state-not-initial" | "record-supersedes-conflict" | "record-supersedes-pending" | "record-supersedes-unknown" | "record-unattested" | "record-unparseable" | "review-agent" | "review-decider" | "review-duplicate" | "review-note-required" | "review-older-digest" | "review-sign-failed" | "review-unattested" | "review-undigested" | "review-unsupported" | "revision-unknown" | "root-chant-required" | "rotation-first-version" | "rotation-invalid" | "rotation-missing" | "rotation-previous-mismatch" | "rotation-threshold-not-met" | "rotation-threshold-unsatisfiable" | "rotation-unparseable" | "rotation-version-skew" | "run-ended" | "run-exists" | "run-not-ended" | "run-statement-invalid" | "run-statement-mismatch" | "run-statement-signer-mismatch" | "run-unknown" | "runner-exists" | "runner-key-invalid" | "runner-key-is-signer" | "runner-key-unlisted" | "runner-unknown" | "runs-ledger-malformed" | "runs-no-ledger" | "runtimes-config-unreadable" | "runtimes-lexicon-unreadable" | "schema-id-mismatch" | "schema-invalid" | "schema-unreadable" | "seal-missing" | "seal-signature-invalid" | "seal-signer-unlisted" | "seal-unverifiable" | "security-attribution-any" | "security-component-no-sbom" | "security-component-no-verify" | "security-gate-unsigned" | "security-publish-allows-unsigned" | "security-publish-no-provenance" | "security-release-gate-missing" | "security-review-not-required" | "security-runner-start-no-key" | "security-runner-start-no-role" | "security-runner-untrusted" | "security-sbom-disabled" | "security-sbom-unsourced" | "security-signed-since-unset" | "security-signers-missing" | "security-tick-no-key" | "security-trust-unreadable" | "session-not-open" | "session-seal-mismatch" | "session-unknown" | "session-verdict-unknown-record" | "signers-file-missing" | "signers-removed" | "since-rev-unknown" | "since-session-open" | "since-session-unknown" | "snapshot-at-revision" | "snapshot-unavailable" | "source-harvest-not-proposed" | "source-transcript-drift" | "squash-unfollowed" | "steward-runs-unreadable" | "stewards-conflict" | "stewards-unreadable" | "table-unknown" | "trust-config-invalid" | "trust-conflict" | "trust-policy-unreadable" | "unknown-kind" | "usage-invalid" | "wip-branch-other" | "wip-no-branch" | "wip-none" | "wip-policy-none" | "wip-race" | "wip-remote-unknown" | "wip-snapshot-unknown" | "work-acceptance-self-verified" | "work-acceptance-unmet" | "work-closed-without-date" | "work-contract-undecided" | "work-contract-unknown" | "work-criterion-unknown" | "work-done-gap-open" | "work-done-unpinned" | "work-evidence-ops-mismatch" | "work-evidence-ops-missing" | "work-evidence-ops-unfinished" | "work-implements-undecided" | "work-implements-unknown" | "work-item-closed" | "work-item-unknown" | "work-kind-ambiguous" | "work-kind-missing" | "work-needs-cycle" | "work-needs-unknown" | "work-tier-unknown" | "write-input-invalid" | "write-lock-not-held" | "write-lock-timeout" | "write-scope-class-unknown" | "write-scope-kind" | "write-scope-member" | "write-scope-protected" | "write-usage-invalid")[];
|
|
32
|
+
export declare const SEARCH_DOCUMENT_ERROR_CODES: ("agent-unknown" | "amend-id-immutable" | "amend-supersede-instead" | "answer-field-unsupported" | "answer-in-steward-turn" | "answer-never-over-mcp" | "answer-not-answered" | "answer-not-candidate" | "answer-point-changed" | "answer-point-unknown" | "answer-points-unreadable" | "asset-drift" | "asset-missing" | "asset-stale" | "box-capability-unbrokered" | "box-credential-declared" | "box-fountain-callback-undeclared" | "box-intent-unconstrained" | "box-intent-unknown" | "box-isolation-collision" | "box-isolation-literal" | "box-none" | "box-several" | "build-failed" | "capability-not-derivable" | "change-out-of-scope" | "change-uncovered" | "chant-config-left" | "chant-dependency" | "chant-in-ci" | "choudoufu-steps-missing" | "ci-branch-route-differs" | "ci-branch-unknown" | "ci-green-undeclared" | "ci-workflow-apply-in-green" | "ci-workflow-green-undeclared" | "ci-workflow-no-components" | "ci-workflow-no-environments" | "ci-workflow-no-pre-merge" | "ci-workflow-pipeline-differs" | "ci-workflow-pipeline-missing" | "ci-workflow-publish-missing" | "ci-workflow-ungated-env" | "command-failed" | "commit-unlinked" | "commit-wrongly-linked" | "composites-no-chant-member" | "composites-no-component" | "composites-none-declared" | "declaration-ambiguous" | "declaration-invalid" | "declaration-missing" | "declaration-not-other" | "declaration-unparseable" | "diagram-render-drift" | "diagram-render-missing" | "diagram-source-missing" | "dir-missing" | "envelope-invalid" | "envelope-unreadable" | "envelope-untrusted" | "environment-invalid" | "environment-unknown" | "environments-component-undeclared" | "environments-ledger-undeclared" | "environments-ledger-unreadable" | "environments-none-declared" | "evidence-payload-type" | "evidence-runner-mismatch" | "evidence-statement-invalid" | "executor-config-unreadable" | "executor-none-declared" | "exit-failed" | "factory-box-missing" | "factory-member-unknown" | "filter-invalid" | "flag-stale" | "flag-work-unknown" | "gate-approval-unbased" | "gates-ledger-unreadable" | "gates-no-gate-ledger" | "gates-no-ledger" | "intent-artifact-unpinned" | "intent-commit-bare" | "intent-commit-join-conflict" | "intent-commit-undecided" | "intent-constraint-coarse" | "intent-constraint-lost" | "intent-decision-contested" | "intent-decision-provisional" | "intent-decision-superseded-live" | "intent-decision-unimplemented" | "intent-evidence-unpinned" | "intent-history-shallow" | "intent-pin-drifted" | "intent-pin-missing" | "intent-pin-stale" | "intent-plugin-failed" | "intent-record-unknown" | "intent-region-invalid" | "intent-region-unconstrained" | "intent-symbol-ambiguous" | "intent-symbol-unknown" | "intent-symbol-unsupported" | "intent-trailer-unverified" | "intent-why-no-decision" | "intent-why-no-run" | "intent-why-run-ambiguous" | "intent-why-uncommitted" | "intent-work-blocked" | "intent-work-open-decided-code" | "ir-version-unsupported" | "kind-invalid" | "kind-not-run" | "kind-probe-failed" | "kind-unreadable" | "lease-held" | "lease-not-held" | "lease-push-rejected" | "lease-race" | "lease-token-mismatch" | "ledger-malformed" | "ledger-unreadable" | "lexicon-has-no-mapping" | "lexicon-not-loaded" | "lexicon-unsupported" | "listing-box-missing" | "listing-cover-invalid" | "listing-member-unknown" | "live-at-revision" | "location-missing" | "lock-invalid" | "manual-step-open" | "member-chant-too-old" | "member-exists" | "member-unknown" | "missing-dir" | "native-missing" | "native-unreadable" | "no-deploy-command" | "no-lexicon" | "no-matches" | "not-a-git-repository" | "output-unreadable" | "patch-path-invalid" | "placement-invalid" | "point-candidates-invalid" | "point-decider-failed" | "point-inputs-invalid" | "point-unknown" | "points-invalid" | "points-undeclared" | "principal-unidentified" | "publish-answer-invalid" | "publish-failed" | "publish-member-unknown" | "publish-none" | "publish-refused" | "publish-unrecorded" | "query-invalid" | "quorum-not-met" | "ratify-quorum-not-met" | "reader-too-old" | "record-closed" | "record-conflict" | "record-id-duplicate" | "record-id-taken" | "record-id-unallocatable" | "record-no-evidence" | "record-not-found" | "record-path-unmatched" | "record-ratified-below-quorum" | "record-remediates-not-closed" | "record-remediates-unknown" | "record-schema-invalid" | "record-seal-mismatch" | "record-sign-failed" | "record-state-not-initial" | "record-supersedes-conflict" | "record-supersedes-pending" | "record-supersedes-unknown" | "record-unattested" | "record-unparseable" | "review-agent" | "review-decider" | "review-duplicate" | "review-note-required" | "review-older-digest" | "review-sign-failed" | "review-unattested" | "review-undigested" | "review-unsupported" | "revision-unknown" | "root-chant-required" | "rotation-first-version" | "rotation-invalid" | "rotation-missing" | "rotation-previous-mismatch" | "rotation-threshold-not-met" | "rotation-threshold-unsatisfiable" | "rotation-unparseable" | "rotation-version-skew" | "run-ended" | "run-exists" | "run-not-ended" | "run-statement-invalid" | "run-statement-mismatch" | "run-statement-signer-mismatch" | "run-unknown" | "runner-exists" | "runner-key-invalid" | "runner-key-is-signer" | "runner-key-unlisted" | "runner-unknown" | "runs-ledger-malformed" | "runs-no-ledger" | "runtimes-config-unreadable" | "runtimes-lexicon-unreadable" | "schema-id-mismatch" | "schema-invalid" | "schema-unreadable" | "seal-missing" | "seal-signature-invalid" | "seal-signer-unlisted" | "seal-unverifiable" | "security-attribution-any" | "security-component-no-sbom" | "security-component-no-verify" | "security-gate-unsigned" | "security-publish-allows-unsigned" | "security-publish-no-provenance" | "security-release-gate-missing" | "security-review-not-required" | "security-runner-start-no-key" | "security-runner-start-no-role" | "security-runner-untrusted" | "security-sbom-disabled" | "security-sbom-unsourced" | "security-signed-since-unset" | "security-signers-missing" | "security-tick-no-key" | "security-trust-unreadable" | "session-not-open" | "session-seal-mismatch" | "session-unknown" | "session-verdict-unknown-record" | "signers-file-missing" | "signers-removed" | "since-rev-unknown" | "since-session-open" | "since-session-unknown" | "snapshot-at-revision" | "snapshot-unavailable" | "source-harvest-not-proposed" | "source-transcript-drift" | "squash-unfollowed" | "steward-runs-unreadable" | "stewards-conflict" | "stewards-unreadable" | "table-unknown" | "trust-config-invalid" | "trust-conflict" | "trust-policy-unreadable" | "unknown-kind" | "usage-invalid" | "wip-branch-other" | "wip-no-branch" | "wip-none" | "wip-policy-none" | "wip-race" | "wip-remote-unknown" | "wip-snapshot-unknown" | "work-acceptance-self-verified" | "work-acceptance-unmet" | "work-closed-without-date" | "work-contract-undecided" | "work-contract-unknown" | "work-criterion-unknown" | "work-done-gap-open" | "work-done-unpinned" | "work-evidence-ops-mismatch" | "work-evidence-ops-missing" | "work-evidence-ops-unfinished" | "work-implements-undecided" | "work-implements-unknown" | "work-item-closed" | "work-item-unknown" | "work-kind-ambiguous" | "work-kind-missing" | "work-needs-cycle" | "work-needs-unknown" | "work-tier-unknown" | "write-input-invalid" | "write-lock-not-held" | "write-lock-timeout" | "write-scope-class-unknown" | "write-scope-kind" | "write-scope-member" | "write-scope-protected" | "write-usage-invalid")[];
|
|
33
33
|
/**
|
|
34
34
|
* Why a member of `chant workspace search` has no answer. A member that ran
|
|
35
35
|
* and refused carries its own {@link SEARCH_ERROR_CODES} code; the rest are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-contract.d.ts","sourceRoot":"","sources":["../../src/workspace/search-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,8EAA8E,CAAC;AAEnH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,4GAWW,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,qSAcC,CAAC;AAC3C,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"search-contract.d.ts","sourceRoot":"","sources":["../../src/workspace/search-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,8EAA8E,CAAC;AAEnH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,4GAWW,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,qSAcC,CAAC;AAC3C,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,mxOAAqF,CAAC;AAE9H;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,+OASG,CAAC;AAC3C,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,uBAAuB,CAAC;IACxC,QAAQ,EAAE,OAAO,uBAAuB,CAAC;IACzC,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yGAAyG;AACzG,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD"}
|
|
@@ -190,6 +190,45 @@
|
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
"additionalProperties": false
|
|
193
|
+
},
|
|
194
|
+
"anyDocument": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"description": "The directory passes when a file directly in it, whose name matches one of in, parses as YAML or JSON and one of its documents satisfies an entry of match (#3179). An entry maps JSON Pointers to the values allowed there, all of which must hold; a * in a value matches any run of characters, so [\"*\"] means the pointer has a value. A file that does not parse is no evidence either way.",
|
|
197
|
+
"required": [
|
|
198
|
+
"in",
|
|
199
|
+
"match"
|
|
200
|
+
],
|
|
201
|
+
"properties": {
|
|
202
|
+
"in": {
|
|
203
|
+
"type": "array",
|
|
204
|
+
"minItems": 1,
|
|
205
|
+
"uniqueItems": true,
|
|
206
|
+
"items": {
|
|
207
|
+
"$ref": "#/$defs/fileName"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"match": {
|
|
211
|
+
"type": "array",
|
|
212
|
+
"minItems": 1,
|
|
213
|
+
"items": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"minProperties": 1,
|
|
216
|
+
"propertyNames": {
|
|
217
|
+
"pattern": "^(/[^/]+)+$"
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": {
|
|
220
|
+
"type": "array",
|
|
221
|
+
"minItems": 1,
|
|
222
|
+
"uniqueItems": true,
|
|
223
|
+
"items": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"minLength": 1
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"additionalProperties": false
|
|
193
232
|
}
|
|
194
233
|
},
|
|
195
234
|
"additionalProperties": false
|
|
@@ -201,22 +240,26 @@
|
|
|
201
240
|
},
|
|
202
241
|
"graph": {
|
|
203
242
|
"type": "object",
|
|
204
|
-
"description": "How chant workspace graph reads a member of this kind (#2874). chant writes a reader project of its own outside the workspace
|
|
205
|
-
"required": [
|
|
206
|
-
"lexicon",
|
|
207
|
-
"config"
|
|
208
|
-
],
|
|
243
|
+
"description": "How chant workspace graph reads a member of this kind (#2874, #4413). chant writes a reader project of its own outside the workspace and runs the member's chant graph there. The project either declares a lexicon and puts config under that lexicon's key (lexicon), or names a graph reader module the supplying package ships (reader). In every string key and value of config, {member} becomes the member's name, {dir} its absolute directory and {workspace} the absolute workspace root. Without this field a member of the kind is listed with kind-not-run.",
|
|
209
244
|
"properties": {
|
|
210
245
|
"lexicon": {
|
|
211
246
|
"type": "string",
|
|
212
247
|
"pattern": "^[a-z][a-z0-9-]{0,39}$",
|
|
213
|
-
"description": "The lexicon that reads the member, by name. The package that supplies the kind must be @intentius/chant-lexicon-<lexicon>, so the lexicon chant loads is the one the declaration pins."
|
|
248
|
+
"description": "The lexicon that reads the member, by name. The package that supplies the kind must be @intentius/chant-lexicon-<lexicon>, so the lexicon chant loads is the one the declaration pins. Not with reader."
|
|
249
|
+
},
|
|
250
|
+
"reader": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"pattern": "^(?!/)(?!.*\\.\\.)(?!.*\\\\)[^\\u0000-\\u001f]+$",
|
|
253
|
+
"description": "A graph reader module, as a path inside the supplying package (#4413): an ES module whose default export is (input: { dir, config }) => GraphIR. The member's own chant graph loads it in the reader project, so it runs under the member's toolchain, and it must only read files. Any package may supply it, not only a lexicon. Not with lexicon. A chant older than this field can't read a kinds file that uses it."
|
|
214
254
|
},
|
|
215
255
|
"config": {
|
|
216
256
|
"type": "object",
|
|
217
|
-
"description": "
|
|
257
|
+
"description": "With lexicon, the lexicon's config namespace for the reader project, such as terraform's roots. With reader, the config object the module is called with (optional). Placeholders are substituted; nothing else is interpreted."
|
|
218
258
|
}
|
|
219
259
|
},
|
|
260
|
+
"if": { "properties": { "reader": true }, "required": ["reader"] },
|
|
261
|
+
"then": { "not": { "properties": { "lexicon": true }, "required": ["lexicon"] } },
|
|
262
|
+
"else": { "properties": { "lexicon": true, "config": true }, "required": ["lexicon", "config"] },
|
|
220
263
|
"patternProperties": {
|
|
221
264
|
"^x-": true
|
|
222
265
|
},
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "../../op/gate-approval";
|
|
23
23
|
import { approverOf, humanQuorumSince, tallyGateApprovals } from "../../op/gate";
|
|
24
24
|
import { quorumRuleLine, quorumRules, trustQuorumJudge, UNPROVEN_JUDGE, type GateQuorumJudge } from "../../op/gate-quorum";
|
|
25
|
-
import { FAN_OUT_GATE_OP, OVERRIDE_GATE_OP, RELEASE_GATE_OP, WORKSPACE_UPGRADE_GATE_OP } from "../../op/gate-name";
|
|
25
|
+
import { FAN_OUT_GATE_OP, OVERRIDE_GATE_OP, RELEASE_GATE_OP, WORKSPACE_EXIT_GATE_OP, WORKSPACE_PROMOTE_GATE_OP, WORKSPACE_UPGRADE_GATE_OP } from "../../op/gate-name";
|
|
26
26
|
import { PR_GATE_OP } from "../../pr-loop";
|
|
27
27
|
import { pushLifecycleReport, requireLifecycleLedger } from "../../lifecycle/git";
|
|
28
28
|
import { LIFECYCLE_LOCAL_NOTE, isLifecycleLocalNote } from "../../lifecycle/local-note";
|
|
@@ -128,8 +128,12 @@ export async function runApprove(ctx: CommandContext): Promise<number> {
|
|
|
128
128
|
? `The next \`chant components fan-out\` decides this gate from scratch and records a fresh pending fact.`
|
|
129
129
|
: PR_GATE_OP.test(opName)
|
|
130
130
|
? `The next \`chant components pr-apply\` decides this gate from scratch and records a fresh pending fact.`
|
|
131
|
+
: opName === WORKSPACE_PROMOTE_GATE_OP
|
|
132
|
+
? `The next \`chant workspace promote ${gate}\` decides this gate from scratch and records a fresh pending fact.`
|
|
131
133
|
: opName === WORKSPACE_UPGRADE_GATE_OP
|
|
132
134
|
? `The next \`chant workspace upgrade ${gate}\` decides this gate from scratch and records a fresh pending fact.`
|
|
135
|
+
: opName === WORKSPACE_EXIT_GATE_OP
|
|
136
|
+
? `The next \`chant workspace exit\` decides this gate from scratch and records a fresh pending fact.`
|
|
133
137
|
: opName === RELEASE_GATE_OP
|
|
134
138
|
? `The next \`chant components promote --release\` decides this gate from scratch and records a fresh pending fact.`
|
|
135
139
|
: `The next \`chant run ${opName}\` decides this gate from scratch and records a fresh pending fact.`,
|
|
@@ -180,8 +184,12 @@ export async function runApprove(ctx: CommandContext): Promise<number> {
|
|
|
180
184
|
? `Repeat the \`chant components fan-out\` command and it walks through gate "${gate}".`
|
|
181
185
|
: PR_GATE_OP.test(opName)
|
|
182
186
|
? `The pull request's apply (\`chant components pr-apply\`) walks through gate "${gate}" when it plans this same digest.`
|
|
187
|
+
: opName === WORKSPACE_PROMOTE_GATE_OP
|
|
188
|
+
? `Repeat \`chant workspace promote ${gate}\`, and it applies the patch this approval names.`
|
|
183
189
|
: opName === WORKSPACE_UPGRADE_GATE_OP
|
|
184
190
|
? `Repeat \`chant workspace upgrade ${gate}\` with the same target, and it applies the patch this approval names.`
|
|
191
|
+
: opName === WORKSPACE_EXIT_GATE_OP
|
|
192
|
+
? `Repeat \`chant workspace exit\` with the same members, and it applies the patch this approval names.`
|
|
185
193
|
: opName === RELEASE_GATE_OP
|
|
186
194
|
? `Repeat the same \`chant components promote --release\`, and it walks through gate "${gate}" when it plans this same change set for this release.`
|
|
187
195
|
: `Run \`chant run ${opName}\` and it walks through gate "${gate}".`),
|
|
@@ -330,7 +338,7 @@ export async function recordGateApproval(
|
|
|
330
338
|
// so there is no `*.op.ts` to find and nothing is wrong when none is there.
|
|
331
339
|
// #3949: a gate that lists this one as an alias, after an Op was restructured.
|
|
332
340
|
const successor = aliasingGate([...ops.values()].map((o) => o.config), opName, gate);
|
|
333
|
-
if (!successor && !ops.has(opName) && opName !== FAN_OUT_GATE_OP && opName !== WORKSPACE_UPGRADE_GATE_OP && opName !== OVERRIDE_GATE_OP && opName !== RELEASE_GATE_OP) {
|
|
341
|
+
if (!successor && !ops.has(opName) && opName !== FAN_OUT_GATE_OP && opName !== WORKSPACE_UPGRADE_GATE_OP && opName !== WORKSPACE_EXIT_GATE_OP && opName !== WORKSPACE_PROMOTE_GATE_OP && opName !== OVERRIDE_GATE_OP && opName !== RELEASE_GATE_OP) {
|
|
334
342
|
console.error(formatWarning({
|
|
335
343
|
message: `Op "${opName}" was not found among discovered *.op.ts declarations — recording the resolution anyway`,
|
|
336
344
|
}));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { afterAll, describe, expect, test } from "vitest";
|
|
5
|
+
import { readGraphWithModule } from "./graph-reader";
|
|
6
|
+
|
|
7
|
+
const scratch = mkdtempSync(join(tmpdir(), "chant-graph-reader-"));
|
|
8
|
+
afterAll(() => rmSync(scratch, { recursive: true, force: true }));
|
|
9
|
+
|
|
10
|
+
function mod(name: string, text: string): string {
|
|
11
|
+
const file = join(scratch, name);
|
|
12
|
+
writeFileSync(file, text);
|
|
13
|
+
return file;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe("readGraphWithModule (#4413)", () => {
|
|
17
|
+
test("calls the default export with dir and config, and fills in groups", async () => {
|
|
18
|
+
const file = mod("ok.mjs", "export default async ({ dir, config }) => ({ nodes: [{ id: 'a', kind: 'K', lexicon: 'x', attrs: { dir, n: config.n } }], edges: [] });\n");
|
|
19
|
+
const read = await readGraphWithModule(file, { dir: "/m", n: 2 }, "/p");
|
|
20
|
+
expect(read).toEqual({ ir: { nodes: [{ id: "a", kind: "K", lexicon: "x", attrs: { dir: "/m", n: 2 } }], edges: [], groups: {} } });
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("says why when the module is missing, has no function, throws or returns no graph", async () => {
|
|
24
|
+
const msg = async (p: string) => ("error" in (await readGraphWithModule(p, {}, "/p")) ? ((await readGraphWithModule(p, {}, "/p")) as { error: string }).error : "");
|
|
25
|
+
expect(await msg(join(scratch, "nope.mjs"))).toMatch(/could not be loaded/);
|
|
26
|
+
expect(await msg(mod("nofn.mjs", "export default 3;\n"))).toMatch(/no default export function/);
|
|
27
|
+
expect(await msg(mod("throws.mjs", "export default () => { throw new Error('boom'); };\n"))).toMatch(/failed: boom/);
|
|
28
|
+
expect(await msg(mod("bad.mjs", "export default () => ({});\n"))).toMatch(/no nodes and edges/);
|
|
29
|
+
expect(await msg("rel.mjs")).toMatch(/absolute/);
|
|
30
|
+
});
|
|
31
|
+
});
|