@coffre/conformance 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -85,7 +85,7 @@ function drainingConfig(server) {
85
85
  }
86
86
  if (import.meta.main) console.log(drainingConfig(resolve(process.argv[2])));
87
87
  //#endregion
88
- //#region ../client/dist/src-CjUBSxZs.js
88
+ //#region ../client/dist/src-BCKSeCER.js
89
89
  /** Two colons or more, in hex: an IPv6 address, as `::1` or `2001:db8::1:443` with its port. */
90
90
  const IPV6 = /[0-9a-f]*:[0-9a-f]*:[0-9a-f:]*/i;
91
91
  const TIMEOUT_OR_REFUSAL = /* @__PURE__ */ new Set([
@@ -481,7 +481,13 @@ set: (member, access) => call("PATCH /access/:member", { member }, access) },
481
481
  }
482
482
  },
483
483
  /** What an escrowed key is checked against: public material, for admins and owners of the whole instance. */
484
- keys: () => call("GET /audit/keys", {})
484
+ keys: () => call("GET /audit/keys", {}),
485
+ /**
486
+ * Accept that entries `from` to `to` are lost for good, as an Owner of
487
+ * the whole instance: the audit watch's finding, inside the range, stays
488
+ * in the log, and its anchor goes on past them.
489
+ */
490
+ acceptLoss: (range) => call("POST /audit/loss", {}, range)
485
491
  }
486
492
  };
487
493
  }
@@ -818,6 +824,7 @@ async function boot(kind, at, options) {
818
824
  PUBLIC_URL: origin,
819
825
  DATABASE_URL: `file:${database}`,
820
826
  VAULT_SOCKET: socket,
827
+ AUDIT_ANCHOR: join(scratch, "anchor.json"),
821
828
  APP_KEY: KEYS.APP_KEY,
822
829
  ALLOW_LOOPBACK_ISSUERS_FOR_DEVELOPMENT: "true",
823
830
  ...github
@@ -3293,13 +3300,15 @@ async function missingCheckpoint(deployment) {
3293
3300
  expect(rows.length > 0, "no checkpoints to remove");
3294
3301
  await sql.exec("DELETE FROM audit_log WHERE action = 'audit.checkpoint'");
3295
3302
  try {
3303
+ await deployment.scheduled({ allowFailure: true });
3296
3304
  await red(deployment);
3297
3305
  } finally {
3298
3306
  for (const row of rows) await insertRow(sql, "audit_log", row);
3299
3307
  }
3300
3308
  }));
3309
+ await deployment.scheduled();
3301
3310
  await until("readiness recovered", async () => (await fetch(`${deployment.origin}/readyz`)).ok, 20);
3302
- return "a recent heartbeat without a checkpoint is red; restoring the checkpoint recovers";
3311
+ return "checkpoints deleted: the next beat finds them gone and readiness is red; restored, the next beat recovers";
3303
3312
  }
3304
3313
  /** A hole before the latest signed prefix must stop the next scheduled checkpoint. */
3305
3314
  async function middleCut(deployment, { admin }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/conformance",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Checks a coffre deployment from outside: what it must never do, whatever code it runs.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,8 +31,8 @@
31
31
  "dependencies": {
32
32
  "jose": "6.2.3",
33
33
  "pg": "8.16.3",
34
- "@coffre/cli": "0.12.0",
35
- "@coffre/db": "0.12.0"
34
+ "@coffre/cli": "0.13.0",
35
+ "@coffre/db": "0.13.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "26.1.1",
@@ -41,7 +41,7 @@
41
41
  "tsdown": "0.23.0",
42
42
  "typescript": "5.9.3",
43
43
  "vite": "8.1.5",
44
- "@coffre/client": "0.12.0"
44
+ "@coffre/client": "0.13.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsdown",
@@ -1,5 +1,6 @@
1
- // Readiness needs both halves of the Cron's work: a recent heartbeat, and a
2
- // checkpoint the vault signed over it. Either missing turns /readyz red.
1
+ // Readiness needs both halves of the Cron's work: a recent anchor, and in it
2
+ // a checkpoint the vault signed over the beat, which the app verified to.
3
+ // Either missing turns /readyz red.
3
4
  import { using } from '../database.ts';
4
5
  import type { Deployment } from '../harness.ts';
5
6
  import { expect, until } from '../report.ts';
@@ -35,13 +36,16 @@ export async function missingCheckpoint(deployment: Deployment): Promise<string>
35
36
  expect(rows.length > 0, 'no checkpoints to remove');
36
37
  await sql.exec("DELETE FROM audit_log WHERE action = 'audit.checkpoint'");
37
38
  try {
39
+ // Readiness vouches for the prefix the anchor holds, which the deletions leave: the next beat finds them gone.
40
+ await deployment.scheduled({ allowFailure: true });
38
41
  await red(deployment);
39
42
  } finally {
40
43
  for (const row of rows) await insertRow(sql, 'audit_log', row);
41
44
  }
42
45
  }));
46
+ await deployment.scheduled();
43
47
  await until('readiness recovered', async () => (await fetch(`${deployment.origin}/readyz`)).ok, 20);
44
- return 'a recent heartbeat without a checkpoint is red; restoring the checkpoint recovers';
48
+ return 'checkpoints deleted: the next beat finds them gone and readiness is red; restored, the next beat recovers';
45
49
  }
46
50
 
47
51
  /** A hole before the latest signed prefix must stop the next scheduled checkpoint. */
package/src/harness.ts CHANGED
@@ -307,6 +307,7 @@ export async function boot(kind: Kind, at: string, options: HarnessOptions): Pro
307
307
  PUBLIC_URL: origin,
308
308
  DATABASE_URL: `file:${database}`,
309
309
  VAULT_SOCKET: socket,
310
+ AUDIT_ANCHOR: join(scratch, 'anchor.json'),
310
311
  APP_KEY: KEYS.APP_KEY,
311
312
  ALLOW_LOOPBACK_ISSUERS_FOR_DEVELOPMENT: 'true',
312
313
  ...github,