@intentius/chant 0.124.30 → 0.124.31

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.
Files changed (72) hide show
  1. package/dist/cli/main.d.ts.map +1 -1
  2. package/dist/cli/main.js +38 -4
  3. package/dist/cli/parse-args.d.ts.map +1 -1
  4. package/dist/cli/parse-args.js +50 -0
  5. package/dist/cli/registry.d.ts +18 -0
  6. package/dist/cli/registry.d.ts.map +1 -1
  7. package/dist/op/local-executor.d.ts +12 -0
  8. package/dist/op/local-executor.d.ts.map +1 -1
  9. package/dist/op/local-executor.js +22 -3
  10. package/dist/op/redact.d.ts +34 -0
  11. package/dist/op/redact.d.ts.map +1 -0
  12. package/dist/op/redact.js +94 -0
  13. package/dist/op/step-console.d.ts +2 -0
  14. package/dist/op/step-console.d.ts.map +1 -1
  15. package/dist/op/step-console.js +5 -2
  16. package/dist/pr-forge.d.ts +17 -0
  17. package/dist/pr-forge.d.ts.map +1 -1
  18. package/dist/pr-forge.js +12 -6
  19. package/dist/pr-report-url.d.ts +8 -0
  20. package/dist/pr-report-url.d.ts.map +1 -1
  21. package/dist/pr-report-url.js +47 -1
  22. package/dist/wave-runtime.mjs +159 -159
  23. package/dist/workspace/ci-run-index.d.ts +96 -0
  24. package/dist/workspace/ci-run-index.d.ts.map +1 -0
  25. package/dist/workspace/ci-run-index.js +162 -0
  26. package/dist/workspace/ci-run-index.schema.json +50 -0
  27. package/dist/workspace/ci-run.d.ts +84 -7
  28. package/dist/workspace/ci-run.d.ts.map +1 -1
  29. package/dist/workspace/ci-run.js +241 -14
  30. package/dist/workspace/ci-runner-key.d.ts +120 -0
  31. package/dist/workspace/ci-runner-key.d.ts.map +1 -0
  32. package/dist/workspace/ci-runner-key.js +217 -0
  33. package/dist/workspace/ci-secrets.d.ts +65 -0
  34. package/dist/workspace/ci-secrets.d.ts.map +1 -0
  35. package/dist/workspace/ci-secrets.js +211 -0
  36. package/dist/workspace/ci-serve.d.ts +13 -0
  37. package/dist/workspace/ci-serve.d.ts.map +1 -1
  38. package/dist/workspace/ci-serve.js +69 -13
  39. package/dist/workspace/reason-codes.d.ts +6 -2
  40. package/dist/workspace/reason-codes.d.ts.map +1 -1
  41. package/dist/workspace/reason-codes.js +7 -2
  42. package/dist/workspace/trust/trust-write.d.ts +109 -0
  43. package/dist/workspace/trust/trust-write.d.ts.map +1 -0
  44. package/dist/workspace/trust/trust-write.js +320 -0
  45. package/dist/workspace/trust-write.schema.json +265 -0
  46. package/package.json +1 -1
  47. package/src/cli/main.test.ts +1 -0
  48. package/src/cli/main.ts +38 -4
  49. package/src/cli/parse-args.ts +36 -0
  50. package/src/cli/registry.ts +18 -0
  51. package/src/op/local-executor.ts +31 -3
  52. package/src/op/redact.ts +93 -0
  53. package/src/op/step-console.ts +7 -2
  54. package/src/pr-forge.test.ts +29 -0
  55. package/src/pr-forge.ts +30 -6
  56. package/src/pr-report-url.ts +53 -1
  57. package/src/workspace/ci-run-index.schema.json +50 -0
  58. package/src/workspace/ci-run-index.test.ts +353 -0
  59. package/src/workspace/ci-run-index.ts +192 -0
  60. package/src/workspace/ci-run.test.ts +337 -37
  61. package/src/workspace/ci-run.ts +277 -15
  62. package/src/workspace/ci-runner-key.test.ts +166 -0
  63. package/src/workspace/ci-runner-key.ts +250 -0
  64. package/src/workspace/ci-secrets.test.ts +106 -0
  65. package/src/workspace/ci-secrets.ts +213 -0
  66. package/src/workspace/ci-serve.test.ts +136 -37
  67. package/src/workspace/ci-serve.ts +66 -13
  68. package/src/workspace/reason-codes.test.ts +2 -0
  69. package/src/workspace/reason-codes.ts +7 -2
  70. package/src/workspace/trust/trust-write.test.ts +179 -0
  71. package/src/workspace/trust/trust-write.ts +377 -0
  72. package/src/workspace/trust-write.schema.json +265 -0
@@ -15,6 +15,10 @@
15
15
  * the one `chant operator` holds) named for `prApplyGroup`, renews it while
16
16
  * it runs and releases it after. An apply that finds it held waits for a
17
17
  * later poll, as a forge's concurrency group queues it.
18
+ * - Merged pull request. An apply asks the forge for the pull request whose
19
+ * merge commit the new head is (`pullRequestFor`, as pr-apply does) and
20
+ * passes it as `--pr`, so its commit status link and run index use
21
+ * `<pr>/<commit>`. With none found it runs without `--pr`.
18
22
  * - Resume records. Each apply gets `<state>/resume/<prApplyRecordKey>.json`
19
23
  * as its `--resume` record, so a re-run of a failed apply at the same
20
24
  * commit finishes under the approval it has. This replaces the forge's CI
@@ -33,15 +37,16 @@
33
37
  */
34
38
  import { execFileSync } from "node:child_process";
35
39
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
36
- import { isAbsolute, join, resolve } from "node:path";
40
+ import { join, resolve } from "node:path";
37
41
  import { prApplyGroup, prApplyRecordKey } from "../components/pr-pipeline.js";
38
42
  import { forgeFromEnv } from "../pr-forge.js";
39
43
  import { formatError, formatWarning } from "../cli/format.js";
40
44
  import { acquireLease, currentHolderId, releaseLease, DEFAULT_LEASE_TTL_MS } from "../lifecycle/lease.js";
41
45
  import { parseDuration } from "../op/duration.js";
42
- import { CI_JOB_OPS, ciJobPlace, ciRun, CiRunError } from "./ci-run.js";
46
+ import { CI_JOB_OPS, ciJobPlace, ciSecretsOf, ciRun, ciStatusFromEnv, CiRunError } from "./ci-run.js";
43
47
  import { RUNNER_KEY_ENV } from "./ci-green.js";
44
48
  import { gitTop } from "./tree.js";
49
+ import { ciServeRunnerKey, formatRunnerKeySetup, setupRunnerKey } from "./ci-runner-key.js";
45
50
  export const newCiServeRuntime = () => ({ inflight: new Map() });
46
51
  /** The state key of a job. */
47
52
  export function ciServeKey(t) {
@@ -238,10 +243,14 @@ async function runJob(opts, place, t, paths, held) {
238
243
  }, Math.max(1000, Math.floor(held.ttlMs / 3)))
239
244
  : undefined;
240
245
  renew?.unref?.();
246
+ let merged;
241
247
  try {
242
248
  // The pull request's head is on the forge's refs/pull/<n>/head, the target's on the branch.
243
249
  tryGit(place.top, ["fetch", "--quiet", "--no-tags", "origin", t.job === "plan" ? `refs/pull/${t.pr}/head` : place.branch]);
244
250
  const hostEnv = { ...(opts.job?.hostEnv ?? process.env), GITHUB_REPOSITORY: opts.repo };
251
+ // An apply is for a merge: pass the pull request whose merge commit it is, so the commit status link and the run index use `<pr>/<commit>`. None found, or a forge that errs, is today's behaviour.
252
+ if (t.job === "apply" && opts.client.pullRequestFor)
253
+ merged = (await opts.client.pullRequestFor(t.commit).catch(() => null)) ?? undefined;
245
254
  const run = opts.run ?? ciRun;
246
255
  const r = await run({
247
256
  ...opts.job,
@@ -251,17 +260,17 @@ async function runJob(opts, place, t, paths, held) {
251
260
  env: opts.env,
252
261
  forge: opts.forge,
253
262
  base: t.base,
254
- ...(t.job === "plan" ? { pr: t.pr } : {}),
263
+ ...(t.job === "plan" ? { pr: t.pr } : merged !== undefined ? { pr: merged } : {}),
255
264
  commit: t.commit,
256
265
  output: paths.report,
257
266
  runId: paths.runId,
258
267
  ...(paths.resume ? { resumeRecord: paths.resume } : {}),
259
268
  });
260
269
  const why = r.record.failure ? `${r.record.failure.code}: ${r.record.failure.reason}` : r.failure ? `${r.failure.phase}: ${r.failure.error.split("\n")[0]}` : undefined;
261
- return { status: r.status === "ok" ? "ok" : "fail", ...(why && r.status !== "ok" ? { failure: why } : {}), ...(r.report ? { report: r.report } : {}) };
270
+ return { status: r.status === "ok" ? "ok" : "fail", ...(merged !== undefined ? { pr: merged } : {}), ...(why && r.status !== "ok" ? { failure: why } : {}), ...(r.report ? { report: r.report } : {}) };
262
271
  }
263
272
  catch (err) {
264
- return { status: "fail", failure: message(err) };
273
+ return { status: "fail", ...(merged !== undefined ? { pr: merged } : {}), failure: message(err) };
265
274
  }
266
275
  finally {
267
276
  if (renew)
@@ -324,9 +333,37 @@ export function formatCiServeEvent(e) {
324
333
  }
325
334
  }
326
335
  // ── The command ──────────────────────────────────────────────────────────────
327
- const USAGE = "chant ci serve --forge forgejo|github --repo <owner/repo> --env <env> [--interval <s>] [--max-jobs <n>] [--state <dir>] " +
328
- "[--author <login>]... [--once] [--rerun-failed] [--gate <name>] [--branch <name>] [--events-json] [--report-url <url>] " +
329
- "[--image <image>] [--before-script <line>]... [--pr-build] [--pr-build-command <line>] [--chant <command>] [--pass-env <NAME>]... [--key <runner key.pem>]";
336
+ /**
337
+ * `chant ci serve|run --setup-key [--trust [--principal <name>]] [--state <dir>] [--branch <name>]` (#4099):
338
+ * make the host's runner key when there is none, print its public half on
339
+ * stdout, and say whether the target's head lists it. With --trust, commit
340
+ * the runner entry on a branch of its own and push it for review.
341
+ */
342
+ export function runnerKeySetupCommand(ctx) {
343
+ const { args } = ctx;
344
+ const cwd = process.cwd();
345
+ const top = gitTop(cwd);
346
+ if (!top)
347
+ throw new CiRunError("the runner key is kept in the repository's git directory, and this directory is not in a git repository");
348
+ if (args.ciPrincipal !== undefined && !args.trustKey)
349
+ throw new CiRunError("--principal names who --trust lists the key for; give --trust with it");
350
+ const branch = args.branch ?? "main";
351
+ const setup = setupRunnerKey({
352
+ top,
353
+ stateDir: args.statePath ? resolve(args.statePath) : defaultCiServeStateDir(cwd),
354
+ branch,
355
+ ...(args.ciPrincipal ? { principal: args.ciPrincipal } : {}),
356
+ ...(args.trustKey ? { trust: true } : {}),
357
+ ...(args.by ? { by: args.by } : {}),
358
+ });
359
+ console.log(setup.key.publicKey);
360
+ console.error(formatRunnerKeySetup(setup, branch));
361
+ return 0;
362
+ }
363
+ const USAGE = "chant ci serve --setup-key [--trust [--principal <name>]] [--state <dir>] [--branch <name>] | " +
364
+ "chant ci serve --forge forgejo|github --repo <owner/repo> --env <env> [--interval <s>] [--max-jobs <n>] [--state <dir>] " +
365
+ "[--author <login>]... [--once] [--rerun-failed] [--gate <name>] [--branch <name>] [--events-json] [--report-url <url>] [--no-status] [--status-url <url template>] " +
366
+ "[--image <image>] [--before-script <line>]... [--pr-build] [--pr-build-command <line>] [--chant <command>] [--pass-env <NAME>]... [--secrets <file>] [--key <runner key.pem>] [--unsigned]";
330
367
  const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
331
368
  /** `--interval`: seconds, or a duration such as `30s` or `2m`. Default 30 seconds. */
332
369
  export function ciServeInterval(value) {
@@ -341,6 +378,8 @@ export function ciServeInterval(value) {
341
378
  export async function runCiServe(ctx) {
342
379
  const { args } = ctx;
343
380
  try {
381
+ if (args.setupKey)
382
+ return runnerKeySetupCommand(ctx);
344
383
  const forge = args.forge;
345
384
  if (forge !== "forgejo" && forge !== "github")
346
385
  throw new CiRunError(`--forge names the forge ci serve polls: --forge forgejo|github${forge ? `, not ${JSON.stringify(forge)}` : ""}`);
@@ -352,19 +391,33 @@ export async function runCiServe(ctx) {
352
391
  if (!ENV_NAME.test(name))
353
392
  throw new CiRunError(`--pass-env takes a variable's name, not ${JSON.stringify(name)}`);
354
393
  const intervalMs = ciServeInterval(args.interval);
355
- const fromFlag = args.key !== undefined;
356
- const runnerKey = fromFlag ? readFileSync(resolve(args.key), "utf-8") : process.env[RUNNER_KEY_ENV] || undefined;
394
+ const cwd = process.cwd();
395
+ const top = gitTop(cwd);
396
+ if (!top)
397
+ throw new CiRunError("ci serve runs in a clone of the repository it serves, and this directory is not in a git repository");
398
+ const stateDir = args.statePath ? resolve(args.statePath) : defaultCiServeStateDir(cwd);
399
+ const branch = args.branch ?? "main";
400
+ // #4099: the host's key, checked against .chant/trust.json at the target's head before the first poll.
401
+ const keyed = ciServeRunnerKey({ top, stateDir, branch, ...(args.key !== undefined ? { keyFile: resolve(args.key) } : {}), envKey: process.env[RUNNER_KEY_ENV] || undefined, unsigned: args.unsigned });
402
+ const fromFlag = keyed.fromFlag;
403
+ const runnerKey = keyed.pem;
404
+ console.error(`ci serve: ${runnerKey === undefined ? "runs are not signed (--unsigned)" : `signing runs with the runner key from ${keyed.source}`}`);
405
+ // #4096: read once, so a loose or broken secrets file stops the serve before its first poll.
406
+ const secrets = ciSecretsOf(args.ciSecrets);
357
407
  const hostEnv = { ...process.env, GITHUB_REPOSITORY: args.ciRepo };
358
408
  const client = forgeFromEnv(forge, hostEnv);
409
+ const { status, warning } = ciStatusFromEnv({ forge, hostEnv, noStatus: args.noStatus, statusUrl: args.statusUrl });
410
+ if (warning)
411
+ console.error(formatWarning({ message: warning }));
359
412
  if (!client.openPullRequests || !client.branchHead)
360
413
  throw new CiRunError(`the ${forge} client cannot list pull requests`);
361
414
  const opts = {
362
- cwd: process.cwd(),
415
+ cwd,
363
416
  forge,
364
417
  repo: args.ciRepo,
365
418
  env: args.env,
366
- client: { openPullRequests: client.openPullRequests.bind(client), branchHead: client.branchHead.bind(client) },
367
- ...(args.statePath ? { stateDir: isAbsolute(args.statePath) ? args.statePath : resolve(args.statePath) } : {}),
419
+ client: { openPullRequests: client.openPullRequests.bind(client), branchHead: client.branchHead.bind(client), pullRequestFor: client.pullRequestFor.bind(client) },
420
+ stateDir,
368
421
  ...(args.maxJobs ? { maxJobs: args.maxJobs } : {}),
369
422
  ...(args.ciAuthors?.length ? { authors: args.ciAuthors } : {}),
370
423
  ...(args.rerunFailed ? { rerunFailed: true } : {}),
@@ -377,10 +430,13 @@ export async function runCiServe(ctx) {
377
430
  ...(args.prBuild ? { build: true } : {}),
378
431
  ...(args.prBuildCommand ? { buildCommand: args.prBuildCommand } : {}),
379
432
  },
433
+ ...(args.runIndexLimit ? { runIndexLimit: args.runIndexLimit } : {}),
380
434
  ...(args.image ? { image: args.image } : {}),
381
435
  ...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
382
436
  ...(args.ciChant ? { chant: args.ciChant } : {}),
383
437
  ...(args.passEnv?.length ? { passEnv: args.passEnv } : {}),
438
+ ...(status ? { status } : {}),
439
+ ...(secrets ? { secrets } : {}),
384
440
  ...(runnerKey !== undefined ? { runnerKey, runnerKeyFromEnv: !fromFlag } : {}),
385
441
  ...(args.eventsJson ? { runEvents: (line) => void process.stdout.write(line) } : {}),
386
442
  hostEnv,
@@ -222,6 +222,10 @@ export declare const REASONS: {
222
222
  readonly "listing-cover-invalid": "The cover can't be read, is not a PNG, JPEG or WebP picture, is larger than 5 MiB, has a path outside the workspace, or has an extension other than its picture format's.";
223
223
  readonly "member-exists": "member add names a member the declaration already has, with an entry other than the one given.";
224
224
  readonly "member-unknown": "member remove names a member the declaration does not declare.";
225
+ readonly "trust-config-invalid": ".chant/trust.json in the working tree is not JSON or does not match its schema, or the write would make it so.";
226
+ readonly "trust-conflict": "--expect named a digest .chant/trust.json no longer has: another write changed it after the caller read it. The refusal names the digest it has now.";
227
+ readonly "runner-exists": "trust runner add names a principal .chant/trust.json already lists with another key or class, or gives a key it lists for another principal.";
228
+ readonly "runner-unknown": "trust runner remove names a principal .chant/trust.json lists no runner for.";
225
229
  readonly "factory-member-unknown": "box factory set names a member the declaration does not declare.";
226
230
  readonly "factory-box-missing": "box factory set names a member whose entry declares no box block, so it has no factory.";
227
231
  readonly "publish-member-unknown": "box publish names a member the declaration does not declare.";
@@ -258,8 +262,8 @@ export declare const REASONS: {
258
262
  readonly "evidence-payload-type": "The envelope's payload type is not application/vnd.in-toto+json.";
259
263
  readonly "evidence-statement-invalid": "The payload is not an in-toto Statement v1 with chant's runner-evidence predicate, or has a field the predicate does not define.";
260
264
  readonly "evidence-runner-mismatch": "The statement names a runner other than the one whose key signed it.";
261
- readonly "runner-key-invalid": "The key given to evidence sign or runs sign is not an Ed25519 private key in PEM.";
262
- readonly "runner-key-is-signer": "The key given to evidence sign or runs sign is a person's key in the signers file. Evidence and run statements are signed by a service or CI identity.";
265
+ readonly "runner-key-invalid": "The key given to evidence sign or runs sign is not an Ed25519 private key in PEM, or the key given to trust runner add is not an ssh-ed25519 public key or an Ed25519 key in PEM.";
266
+ readonly "runner-key-is-signer": "The key given to evidence sign, runs sign or trust runner add is a person's key in the signers file, or trust runner add names a signer. Evidence and run statements are signed by a service or CI identity.";
263
267
  readonly "runner-key-unlisted": "The policy at base lists no runner with the key given to evidence sign or runs sign.";
264
268
  readonly "lock-invalid": "The lineage lock can't be read.";
265
269
  readonly "manual-step-open": "A scope in the lineage lock has an open manual step.";
@@ -1 +1 @@
1
- {"version":3,"file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qB,EAAE,oDAAoD;aAC3E,kBAAkB,EAAE,+GAA+G;aACnI,oBAAoB,EAAE,sFAAsF;aAC5G,uBAAuB,EAAE,kEAAkE;aAC3F,4BAA4B,EAAE,kIAAkI;aAChK,0BAA0B,EAAE,sEAAsE;aAClG,oBAAoB,EAAE,mLAAmL;aACzM,sBAAsB,EAAE,8MAA8M;aACtO,qBAAqB,EAAE,sFAAsF;aAE7G,cAAc,EAAE,iCAAiC;aACjD,kBAAkB,EAAE,sDAAsD;CAClE,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"}
@@ -268,6 +268,11 @@ export const REASONS = {
268
268
  // A declaration's members and hosts written through chant (member add|remove, host set, #3596): why the write was refused. Nothing is written.
269
269
  "member-exists": "member add names a member the declaration already has, with an entry other than the one given.",
270
270
  "member-unknown": "member remove names a member the declaration does not declare.",
271
+ // A runner entry of .chant/trust.json written through chant (trust runner add|remove, #3510): why the write was refused. Nothing is written.
272
+ "trust-config-invalid": ".chant/trust.json in the working tree is not JSON or does not match its schema, or the write would make it so.",
273
+ "trust-conflict": "--expect named a digest .chant/trust.json no longer has: another write changed it after the caller read it. The refusal names the digest it has now.",
274
+ "runner-exists": "trust runner add names a principal .chant/trust.json already lists with another key or class, or gives a key it lists for another principal.",
275
+ "runner-unknown": "trust runner remove names a principal .chant/trust.json lists no runner for.",
271
276
  // A box's factory written through chant (box factory set, #3600): why the write was refused. Nothing is written.
272
277
  "factory-member-unknown": "box factory set names a member the declaration does not declare.",
273
278
  "factory-box-missing": "box factory set names a member whose entry declares no box block, so it has no factory.",
@@ -311,8 +316,8 @@ export const REASONS = {
311
316
  "evidence-payload-type": "The envelope's payload type is not application/vnd.in-toto+json.",
312
317
  "evidence-statement-invalid": "The payload is not an in-toto Statement v1 with chant's runner-evidence predicate, or has a field the predicate does not define.",
313
318
  "evidence-runner-mismatch": "The statement names a runner other than the one whose key signed it.",
314
- "runner-key-invalid": "The key given to evidence sign or runs sign is not an Ed25519 private key in PEM.",
315
- "runner-key-is-signer": "The key given to evidence sign or runs sign is a person's key in the signers file. Evidence and run statements are signed by a service or CI identity.",
319
+ "runner-key-invalid": "The key given to evidence sign or runs sign is not an Ed25519 private key in PEM, or the key given to trust runner add is not an ssh-ed25519 public key or an Ed25519 key in PEM.",
320
+ "runner-key-is-signer": "The key given to evidence sign, runs sign or trust runner add is a person's key in the signers file, or trust runner add names a signer. Evidence and run statements are signed by a service or CI identity.",
316
321
  "runner-key-unlisted": "The policy at base lists no runner with the key given to evidence sign or runs sign.",
317
322
  // The lineage lock (check).
318
323
  "lock-invalid": "The lineage lock can't be read.",
@@ -0,0 +1,109 @@
1
+ /**
2
+ * `chant workspace trust runner add <principal> --key <key>` and `chant
3
+ * workspace trust runner remove <principal>` (#3510): a runner entry of
4
+ * `.chant/trust.json`, written through chant.
5
+ *
6
+ * ws-074 lets a tool write the repo only through chant. A lobby that signs
7
+ * agent-run statements, a CI job that signs Op runs and ci tags, and a host
8
+ * running `chant ci serve` each need their key under `runners`, and before
9
+ * this write a box repo added that entry by hand. `add` lists the key for the
10
+ * principal and, for class `runner`, grants the principal the `runner` role
11
+ * that `ci tick`, `ci run` and `chant run --key` require. `remove` takes both
12
+ * away. The file is edited in place, so its formatting and key order stay as
13
+ * they were.
14
+ *
15
+ * The write is a working-tree write like `member add`: it holds the write
16
+ * lock (#3173, ws-089), is judged by the write scope at base, notes who wrote
17
+ * the file in the write journal, and never commits. Changing the trust
18
+ * config is a protected write, so the commit that carries it is checked by
19
+ * `chant workspace verify` against the policy at base. `--expect <digest>`
20
+ * refuses the write when the file has changed since the caller read it: the
21
+ * digest is the SHA-256 of the file's bytes, and of empty text when there is
22
+ * no file. Each write prints one JSON document (`trust-write.schema.json`)
23
+ * with the digest after the write, to pass as `--expect` to the next one.
24
+ */
25
+ import type { CommandContext } from "../../cli/registry.js";
26
+ import { type LastWrite } from "../write-lock.js";
27
+ import { type RunnerKey } from "./policy.js";
28
+ /** The version of the document these writes print. */
29
+ export declare const TRUST_WRITE_CONTRACT_VERSION = 1;
30
+ /** `$id` of the JSON Schema for what the trust writes print, shipped in `workspace/`. */
31
+ export declare const TRUST_WRITE_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/trust-write/v1/trust-write.schema.json";
32
+ export declare const TRUST_WRITE_ACTIONS: readonly ["runner add", "runner remove"];
33
+ export type TrustWriteAction = (typeof TRUST_WRITE_ACTIONS)[number];
34
+ /** Why a trust write wrote nothing. Closed. */
35
+ export declare const TRUST_WRITE_ERROR_CODES: readonly ["not-a-git-repository", "write-usage-invalid", "trust-config-invalid", "trust-conflict", "runner-key-invalid", "runner-key-is-signer", "runner-exists", "runner-unknown", "write-scope-member", "write-scope-protected", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "write-lock-timeout", "write-lock-not-held"];
36
+ export type TrustWriteErrorCode = (typeof TRUST_WRITE_ERROR_CODES)[number];
37
+ type Head = {
38
+ $schema: string;
39
+ contract: number;
40
+ chant: string;
41
+ action: TrustWriteAction;
42
+ name: string | null;
43
+ };
44
+ /** What `--expect` disagreed with: the digest the file has now, and its last chant write when the journal knows it. */
45
+ export interface TrustConflict {
46
+ path: string;
47
+ expected: string;
48
+ digest: string;
49
+ lastWrite: LastWrite | null;
50
+ }
51
+ /** What `trust runner add` and `trust runner remove` print. */
52
+ export type TrustWriteDocument = (Head & {
53
+ name: string;
54
+ /** `.chant/trust.json`, from the repository root. */
55
+ path: string;
56
+ /** The SHA-256 of the file's bytes after the write (or as they would be, with dryRun): the next write's `--expect`. */
57
+ digest: string;
58
+ /** The SHA-256 of the file's bytes before the write; of empty text when there was no file. */
59
+ previousDigest: string;
60
+ /** The file, when the write changed it; else empty. */
61
+ paths: string[];
62
+ changed: boolean;
63
+ dryRun: boolean;
64
+ /** The runner entry before the write, or null when there was none. */
65
+ previous: RunnerKey | null;
66
+ /** The runner entry after the write, or null after a remove. */
67
+ entry: RunnerKey | null;
68
+ /** Whether the principal holds the `runner` role after the write. */
69
+ runnerRole: boolean;
70
+ }) | (Head & {
71
+ error: {
72
+ code: TrustWriteErrorCode;
73
+ message: string;
74
+ };
75
+ conflict?: TrustConflict;
76
+ });
77
+ export interface TrustWriteRequest {
78
+ cwd: string;
79
+ action: TrustWriteAction;
80
+ /** The runner's principal. */
81
+ name: string;
82
+ /** For `runner add`: the public key, as an `ssh-ed25519` line or a file holding one or an Ed25519 PEM. */
83
+ key?: string;
84
+ /** For `runner add`: `runner` (the default) or `service`. */
85
+ runnerClass?: string;
86
+ /** Who is writing (`--by`). */
87
+ by?: string;
88
+ /** The agent session (`CHANT_AGENT`). */
89
+ agent?: string;
90
+ /** The file's digest the caller last read (`--expect`). */
91
+ expect?: string;
92
+ dryRun?: boolean;
93
+ }
94
+ /** The digest `--expect` compares: the SHA-256 of the file's text, of empty text when there is none. */
95
+ export declare function trustDigest(text: string | null): string;
96
+ /**
97
+ * The `ssh-ed25519 <base64>` line, with no comment, for what `--key` gives:
98
+ * the line itself (a comment after it is dropped), or a file holding such a
99
+ * line or an Ed25519 key in PEM, public or private, whose public half is
100
+ * used. Throws `runner-key-invalid` for anything else, so only a key the
101
+ * readers can verify is ever listed.
102
+ */
103
+ export declare function runnerPublicKey(given: string, cwd: string): string;
104
+ /** Run the write and build the document it prints. Never throws for a refusal. */
105
+ export declare function trustWrite(req: TrustWriteRequest): TrustWriteDocument;
106
+ /** `chant workspace trust runner add|remove <principal>`. */
107
+ export declare function runWorkspaceTrust(ctx: CommandContext): number;
108
+ export {};
109
+ //# sourceMappingURL=trust-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust-write.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/trust-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAQzD,OAAO,EAAiH,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAG9J,OAAO,EAAmF,KAAK,SAAS,EAAoB,MAAM,UAAU,CAAC;AAE7I,sDAAsD;AACtD,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,wFAAwF,CAAC;AAE3H,eAAO,MAAM,mBAAmB,YAAI,YAAY,EAAE,eAAe,CAAU,CAAC;AAC5E,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,+CAA+C;AAC/C,eAAO,MAAM,uBAAuB,yVAeM,CAAC;AAC3C,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,KAAK,IAAI,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEhH,uHAAuH;AACvH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B;AAED,+DAA+D;AAC/D,MAAM,MAAM,k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