@cotal-ai/delivery 0.35.0 → 0.37.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.
@@ -1 +1 @@
1
- {"version":3,"file":"feedback-intake.js","sourceRoot":"","sources":["../src/feedback-intake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAE/G,uFAAuF;AACvF,MAAM,CAAC,GAAG;IACR,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS;IACxC,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS;IACzC,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC1C,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;CAC1C,CAAC;AAmCF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AACpF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AACxE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAE5D,MAAM,SAAU,SAAQ,KAAK;IACN;IAArB,YAAqB,MAAc,EAAE,OAAe;QACl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AC,CAAC;IACjD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,IAAI,CAAC,GAAmB,EAAE,MAAc,EAAE,IAAa;IAC9D,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC9D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { DELIVERY_CREDS_KEY, runDelivery } from "./delivery.js";
1
+ import { DELIVERY_CREDS_KIND, deliveryCredsKey, runDelivery } from "./delivery.js";
2
2
  import { runFeedbackIntake } from "./feedback-intake.js";
3
- export { DELIVERY_CREDS_KEY, runDelivery };
3
+ export { DELIVERY_CREDS_KIND, deliveryCredsKey, runDelivery };
4
4
  export { runFeedbackIntake };
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA4CzD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA4CzD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * `@cotal-ai/manager` or `@cotal-ai/cli` (one-way tiering).
7
7
  */
8
8
  import { registry } from "@cotal-ai/core";
9
- import { DELIVERY_CREDS_KEY, runDelivery } from "./delivery.js";
9
+ import { DELIVERY_CREDS_KIND, deliveryCredsKey, runDelivery } from "./delivery.js";
10
10
  import { runFeedbackIntake } from "./feedback-intake.js";
11
11
  const deliveryCommands = [
12
12
  {
@@ -46,6 +46,6 @@ const deliveryCommands = [
46
46
  },
47
47
  ];
48
48
  registry.register(...deliveryCommands);
49
- export { DELIVERY_CREDS_KEY, runDelivery };
49
+ export { DELIVERY_CREDS_KIND, deliveryCredsKey, runDelivery };
50
50
  export { runFeedbackIntake };
51
51
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAgB,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,gBAAgB,GAAc;IAClC;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,OAAO,EACL,0IAA0I;QAC5I,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,8DAA8D,EAAE;YAC5H,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,sCAAsC,EAAE;YACvG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,oEAAoE,EAAE;YACnH,EAAE,IAAI,EA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OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,+DAA+D,EAAE;YAChI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,0DAA0D,EAAE;YACxH,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,sDAAsD,EAAE;YACzH,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,sCAAsC,EAAE;YACvG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE;YAC9G,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,iDAAiD,EAAE;YACnH,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,kDAAkD,EAAE;SACtH;QACD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC;KACvC;CACF,CAAC;AAEF,QAAQ,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,22 +1,21 @@
1
1
  import { type MembershipFeedHandle, type SecretStore } from "@cotal-ai/core";
2
2
  /**
3
- * The delivery daemon's thin composition root for the broker-sourced graph-membership feed. It loads the
4
- * DATA account id + the SYSTEM-account observer cred from `.cotal/` (written by `cotal up`; the daemon
5
- * never holds the signer) and reads the DATA-account rw cred through the {@link SecretStore} seam the
6
- * SAME seam the renewal owner (the manager) re-signs into so a hosted composition can renew the feed's
7
- * writer end-to-end (KMS/Vault) without a daemon restart. `store` is that hosted injection point; with
8
- * none, the workstation FS store (keys = the filenames under `.cotal/`) is used, so a local `cotal up`
9
- * is byte-for-byte unchanged. It hands the two creds + the account id to the core feed engine
10
- * ({@link startMembershipFeed}, which owns the two connections + the poll loop + the rw 75% renewal).
3
+ * The delivery daemon's thin composition root for the broker-sourced graph-membership feed. Every
4
+ * credential it needs the DATA-account rw cred AND the SYSTEM-account observer now resolves
5
+ * through the {@link SecretStore} seam, so a hosted composition can supply all of them with no file
6
+ * on disk. `store` is that injection point; with none, the workstation FS store is used (keys = the
7
+ * filenames under `.cotal/`), so a local `cotal up` is byte-for-byte unchanged. It hands the two
8
+ * creds + the account id to the core feed engine ({@link startMembershipFeed}, which owns the two
9
+ * connections + the poll loop + the rw 75% renewal).
11
10
  *
12
- * Deliberately ISOLATED from Plane-3: a separate module, separate connections, and a fail-soft contract
13
- * if the creds aren't provisioned (a pre-feature space) or the feed can't start, it logs and returns
14
- * `undefined`; the graph degrades to traffic-only and delivery is untouched.
11
+ * The ACCOUNT ID is no longer read from `.cotal/membership.json`. It arrives as `opts.accountId`
12
+ * the account the daemon's own delivery cred authenticates as, pinned once at start and the
13
+ * observer is checked against it intrinsically (see `sys-creds.ts`). That file was never an
14
+ * independent source: it sat in the same directory as the creds, so a wrong root was wrong for both.
15
15
  *
16
- * Residual (deferred, non-blocking): the observer cred + `membership.json` (the account id) are still
17
- * read from `.cotal/` files, so a fully hosted feed on an injected store also needs those two threaded.
18
- * They are a static $SYS cred and non-secret config, respectively the renewable rw kind is what 3b
19
- * migrates; the manager re-signs only it.
16
+ * Deliberately ISOLATED from Plane-3: a separate module, separate connections, and a fail-soft
17
+ * contract if the creds aren't provisioned (a pre-feature space) or the feed can't start, it logs
18
+ * and returns `{ down }`; the graph degrades to traffic-only and delivery is untouched.
20
19
  */
21
20
  /** Why the feed is, or is not, running. `down` carries the DIAGNOSIS to the caller, because the
22
21
  * daemon's log line is not the only place it is needed: an adoption reply that says only "the feed is
@@ -32,5 +31,6 @@ export type MembershipStart = {
32
31
  export declare function startMembership(opts: {
33
32
  space: string;
34
33
  server: string;
34
+ accountId: string;
35
35
  }, store?: SecretStore): Promise<MembershipStart>;
36
36
  //# sourceMappingURL=membership.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../src/membership.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuD,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlI;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;+FAG+F;AAC/F,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,oBAAoB,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExH,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAqG5H"}
1
+ {"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../src/membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIrH;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;+FAG+F;AAC/F,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,oBAAoB,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExH,wBAAsB,eAAe,CACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAC1D,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,CAAC,CA8G1B"}
@@ -1,78 +1,85 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { credsClaims, inspectCredHealth, startMembershipFeed } from "@cotal-ai/core";
4
- import { findCotalRoot, MEMBERSHIP_RW_CREDS_KEY, workspaceSecretStore } from "@cotal-ai/workspace";
1
+ import { inspectCredHealth, startMembershipFeed } from "@cotal-ai/core";
2
+ import { CONNECTION_EVICTOR_CREDS_KIND, findCotalRoot, membershipRwCredsKey, MEMBERSHIP_OBSERVER_CREDS_KIND, MEMBERSHIP_RW_CREDS_KIND, workspaceSecretStore } from "@cotal-ai/workspace";
3
+ import { loadSysPair, observerTenancyProblem, repairAdvice, tornRotationProblem } from "./sys-creds.js";
5
4
  export async function startMembership(opts, store) {
6
- const root = findCotalRoot();
7
- const dir = join(root, ".cotal");
8
- const obsPath = join(dir, "membership-observer.creds");
9
- const cfgPath = join(dir, "membership.json");
10
- const secrets = store ?? workspaceSecretStore(root);
11
- const rw = await secrets.get(MEMBERSHIP_RW_CREDS_KEY);
5
+ // `injected` is the composition root's own fact, decided here before any I/O — never inferred by
6
+ // probing the store or sniffing `.cotal/`, which would report "workstation" for a hosted daemon
7
+ // and emit a CLI repair the host cannot run (design §4.1). The workstation arm carries the root
8
+ // it resolved, because that is what lets `repairAdvice` ask whether the command it would name is
9
+ // one this root can actually run; a hosted composition has no root and names no command.
10
+ // Spelled as a branch, not a `??`, so the root is still resolved ONLY when no store was injected.
11
+ let source;
12
+ if (store === undefined) {
13
+ const root = findCotalRoot();
14
+ source = { secrets: workspaceSecretStore(root), space: opts.space, injected: false, root };
15
+ }
16
+ else {
17
+ source = { secrets: store, space: opts.space, injected: true };
18
+ }
19
+ // Through the per-kind resolver (P7 §2 rule 1) — the source's arms ARE the composition it takes.
20
+ // The rw cred is absent-means-MINT on the `up` side, so reading the canonical location past an
21
+ // unmigrated copy would report the bundle incomplete and let the next `up` mint a second one.
22
+ const rwKey = membershipRwCredsKey(opts.space, source);
23
+ const rw = await source.secrets.get(rwKey);
24
+ // Ask for both $SYS creds: the observer is REQUIRED, the evictor only feeds the torn-rotation
25
+ // check below. A space with no evictor still runs a perfectly good feed (eviction refuses on its
26
+ // own path, loudly), so its absence must not take the feed down.
27
+ const sys = await loadSysPair(source, "both");
12
28
  const missing = [
13
- rw === undefined ? MEMBERSHIP_RW_CREDS_KEY : undefined,
14
- existsSync(obsPath) ? undefined : "membership-observer.creds",
15
- existsSync(cfgPath) ? undefined : "membership.json",
29
+ rw === undefined ? MEMBERSHIP_RW_CREDS_KIND : undefined,
30
+ ...sys.missing.filter((k) => k !== CONNECTION_EVICTOR_CREDS_KIND),
16
31
  ].filter((f) => f !== undefined);
17
32
  if (missing.length) {
18
33
  // Name the missing piece AND a repair that reaches it. The bundle has two halves with two
19
34
  // different repairs, and naming the wrong one costs an operator a full mesh stop for nothing.
20
35
  // The $SYS-signed half (observer, evictor) can only be minted while the never-persisted system
21
- // signing seed is in memory, so it takes a rotation. The DATA half (rw cred, account id) is
22
- // signed by the data account, whose seed IS persisted, so a plain `cotal up` heals it — that is
23
- // what `healMembershipDataCreds` in `up` does, on every path rather than only a fresh space.
24
- const down = missing.length === 1 && missing[0] === "membership-observer.creds"
25
- ? "the $SYS observer cred is missing - re-mint it with `cotal down` then `cotal up --rotate-sys`"
26
- // Name the remedy that matches the MISSING piece, because the two halves are repaired by
27
- // different acts. The data half (`membership-rw.creds`, `membership.json`) is signed by the
28
- // data account, whose seed is persisted, so a plain `cotal up` mints it. The $SYS half
29
- // (observer, evictor) can only be re-minted while the never-persisted $SYS seed is in
30
- // memory, which is a system-account rotation. Telling an operator to rotate when a plain
31
- // `up` would do it sends them through a full mesh stop for nothing.
32
- : `the membership bundle is incomplete here (missing ${missing.join(", ")}) - ${missing.every((m) => m === MEMBERSHIP_RW_CREDS_KEY || m === "membership.json")
33
- ? "run `cotal up` to provision the data-account half (no rotation needed)"
34
- : "the $SYS-signed creds can only be re-minted while the system account is being provisioned: `cotal down` then `cotal up --rotate-sys`"}`;
36
+ // signing seed is in memory, so it takes a rotation. The DATA half (the rw cred) is signed by
37
+ // the data account, whose seed IS persisted, so a plain `cotal up` heals it — that is what
38
+ // `healMembershipDataCreds` in `up` does, on every path rather than only a fresh space.
39
+ // Only the REPAIR tail forks on `injected`; this diagnosis half is identical in both.
40
+ const sysMissing = missing.filter((m) => m === MEMBERSHIP_OBSERVER_CREDS_KIND);
41
+ const down = missing.length === 1 && missing[0] === MEMBERSHIP_OBSERVER_CREDS_KIND
42
+ ? `the $SYS observer cred is missing (kind "${MEMBERSHIP_OBSERVER_CREDS_KIND}") - ${repairAdvice(source, sysMissing)}`
43
+ : `the membership bundle is incomplete here (missing ${missing.join(", ")}) - ${sysMissing.length === 0
44
+ ? source.injected
45
+ ? `re-sign the data-account half into the store under ${rwKey} (no rotation needed)`
46
+ : "run `cotal up` to provision the data-account half (no rotation needed)"
47
+ : `the $SYS-signed creds can only be re-minted while the system account is being provisioned: ${repairAdvice(source, sysMissing)}`}`;
35
48
  console.error(`• membership: ${down}. The graph falls back to traffic-only; delivery is unaffected.`);
36
49
  return { down };
37
50
  }
38
- const accountId = JSON.parse(readFileSync(cfgPath, "utf8")).accountId;
39
- if (!accountId) {
40
- const down = ".cotal/membership.json has no accountId";
41
- console.error(`• membership: ${down}; membership disabled (delivery unaffected)`);
42
- return { down };
51
+ const obsCreds = sys.observer; // required above; absence already returned
52
+ // TENANCY, before connecting. The observer names its own DATA account in its CONNZ permission, so
53
+ // it can be checked against the account this daemon's own cred authenticates as with no adjacent
54
+ // file at all. The broker enforces the same scoping independently — this local read buys the
55
+ // DIAGNOSIS (a line naming both accounts) rather than the guarantee.
56
+ const tenancy = observerTenancyProblem(obsCreds, opts.accountId);
57
+ if (tenancy) {
58
+ console.error(`! membership: ${tenancy}; graph membership degraded, delivery unaffected`);
59
+ return { down: tenancy };
60
+ }
61
+ // A TORN rotation is the other way this cred goes broker-dead without a byte of its own changing:
62
+ // `rotateSystemCreds` commits the trust record, then writes both $SYS creds, so a crash between the
63
+ // two leaves one on the retired system account, and the broker answers the same bare
64
+ // "Authorization Violation" either way. Shared with the eviction path as of this change — it used
65
+ // to live only here, which left eviction opening a half-rotated pair blind.
66
+ if (sys.evictor !== undefined) {
67
+ const torn = tornRotationProblem(obsCreds, sys.evictor, () => repairAdvice(source, [MEMBERSHIP_OBSERVER_CREDS_KIND, CONNECTION_EVICTOR_CREDS_KIND]));
68
+ if (torn) {
69
+ console.error(`! membership: ${torn}; graph membership degraded, delivery unaffected`);
70
+ return { down: torn };
71
+ }
43
72
  }
44
73
  // Check the OBSERVER's own expiry before connecting. It is `rotation-renewed`, so unlike every
45
74
  // renewable cred here nothing re-signs it: at its 30-day horizon the broker simply answers
46
75
  // "Authorization Violation", which names neither the credential nor the repair. Reading the JWT
47
76
  // costs nothing and turns the daemon's one loud line into the actual diagnosis: the difference
48
77
  // between an operator finding this in minutes and finding it in a support thread.
49
- const obsCreds = readFileSync(obsPath, "utf8");
50
- // A TORN rotation is the other way this cred goes broker-dead without a byte of its own changing:
51
- // `rotateSystemCreds` commits the trust record, then writes both $SYS creds, so a crash between the
52
- // two leaves one file on the retired system account. The broker answers the same bare
53
- // "Authorization Violation" either way. The daemon cannot ask the trust record which account is
54
- // current (it deliberately never loads the signer), but it does not need to: the pair is written
55
- // by one rotation, so two DIFFERENT issuers prove one of them is stale, with no signer read at all.
56
- // (`doctor auth`, which legitimately holds the record, checks each file against it directly.)
57
- const evPath = join(dir, "connection-evictor.creds");
58
- if (existsSync(evPath)) {
59
- let obsIss, evIss;
60
- try {
61
- obsIss = credsClaims(obsCreds).iss;
62
- evIss = credsClaims(readFileSync(evPath, "utf8")).iss;
63
- }
64
- catch { /* an unreadable file is the health check's case just below */ }
65
- if (obsIss !== undefined && evIss !== undefined && obsIss !== evIss) {
66
- const down = `the two $SYS creds are signed by DIFFERENT system accounts (observer ${obsIss.slice(0, 12)}…, evictor ${evIss.slice(0, 12)}…) - a system-account rotation did not finish, so one of them is broker-dead: re-run \`cotal down\` then \`cotal up --rotate-sys\` to land a complete generation`;
67
- console.error(`! membership: ${down}; graph membership degraded, delivery unaffected`);
68
- return { down };
69
- }
70
- }
71
78
  const obs = inspectCredHealth(obsCreds);
72
79
  if (obs.state === "expired" || obs.state === "unreadable") {
73
80
  const down = obs.state === "expired"
74
- ? `the $SYS observer cred (${obsPath}) EXPIRED ${new Date((obs.exp ?? 0) * 1000).toISOString()} and the broker denies it - it is rotation-renewed, so nothing re-signs it: run \`cotal down\` then \`cotal up --rotate-sys\` (agents, creds and data are untouched)`
75
- : `the $SYS observer cred (${obsPath}) is unreadable (${obs.error})`;
81
+ ? `the $SYS observer cred (kind "${MEMBERSHIP_OBSERVER_CREDS_KIND}") EXPIRED ${new Date((obs.exp ?? 0) * 1000).toISOString()} and the broker denies it - it is rotation-renewed, so nothing re-signs it: ${repairAdvice(source, [MEMBERSHIP_OBSERVER_CREDS_KIND])} (agents, creds and data are untouched)`
82
+ : `the $SYS observer cred (kind "${MEMBERSHIP_OBSERVER_CREDS_KIND}") is unreadable (${obs.error})`;
76
83
  console.error(`! membership: ${down}; graph membership degraded, delivery unaffected`);
77
84
  return { down };
78
85
  }
@@ -80,16 +87,16 @@ export async function startMembership(opts, store) {
80
87
  const handle = await startMembershipFeed({
81
88
  servers: opts.server,
82
89
  space: opts.space,
83
- accountId,
90
+ accountId: opts.accountId,
84
91
  // Observer is rotation-renewed ($SYS): a static read — its renewal is a system rotation + restart.
85
92
  observerCreds: obsCreds,
86
93
  // rw is class-2 standing-renewable: read through the store seam and renewed on a 75% timer that
87
94
  // preflight-proves each candidate the manager re-signs into the store (D5 slice 5). The daemon
88
95
  // never sees the signer; the manager owns the re-sign.
89
96
  rwCreds: async () => {
90
- const cur = await secrets.get(MEMBERSHIP_RW_CREDS_KEY);
97
+ const cur = await source.secrets.get(rwKey);
91
98
  if (cur === undefined)
92
- throw new Error(`membership: the scoped rw cred is gone (key "${MEMBERSHIP_RW_CREDS_KEY}") — restore it (locally: re-run \`cotal up\`) before the current JWT expires`);
99
+ throw new Error(`membership: the scoped rw cred is gone (kind "${MEMBERSHIP_RW_CREDS_KIND}") — restore it (locally: re-run \`cotal up\`) before the current JWT expires`);
93
100
  return cur;
94
101
  },
95
102
  intervalMs,
@@ -1 +1 @@
1
- {"version":3,"file":"membership.js","sourceRoot":"","sources":["../src/membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAA+C,MAAM,gBAAgB,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AA4BnG,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAuC,EAAE,KAAmB;IAChG,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAEpD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG;QACd,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS;QACtD,UAA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G,CAAC,4BAA4B,CAAC,IAAI,SAAS,CAAC,CAAC,oBAAoB;IACtG,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC;QACvC,OAAO,EAAE,IAAI,CAAC,MAAM;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,mGAAmG;QACnG,aAAa,EAAE,QAAQ;QACvB,gGAAgG;QAChG,+FAA+F;QAC/F,uDAAuD;QACvD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC5C,IAAI,GAAG,KAAK,SAAS;gBACnB,MAAM,IAAI,KAAK,CAAC,iDAAiD,wBAAwB,+EAA+E,CAAC,CAAC;YAC5K,OAAO,GAAG,CAAC;QACb,CAAC;QACD,UAAU;KACX,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,oEAAoE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC9F,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,139 @@
1
+ import { type SecretStore } from "@cotal-ai/core";
2
+ /**
3
+ * THE `$SYS` PAIR, read through the {@link SecretStore} seam and checked before it is used.
4
+ *
5
+ * Both consumers of the observer/evictor creds — the graph feed (`membership.ts`) and the
6
+ * eviction/liveness executors (`evict-exec.ts`) — resolve them here so the three checks that make a
7
+ * `$SYS` cred trustworthy cannot drift apart or exist on only one path:
8
+ *
9
+ * 1. TENANCY (the observer names its own account — {@link observerTenancyProblem});
10
+ * 2. TORN ROTATION (the pair was signed by ONE system account — {@link tornRotationProblem});
11
+ * 3. STORE-AWARE REPAIR (the advice names something the reader can actually do —
12
+ * {@link repairAdvice}).
13
+ *
14
+ * Check 2 previously existed ONLY in the feed path, so the eviction path could open a half-rotated
15
+ * pair and get a bare "Authorization Violation" from the broker. Sharing it is the point of this
16
+ * module, not a side effect of it.
17
+ *
18
+ * This module DECIDES NOTHING ABOUT POSTURE. It reports problems as strings and absence as a list
19
+ * of missing keys; whether that is a fail-soft `down` (the feed) or a loud throw (eviction) belongs
20
+ * to the caller, because the two postures are deliberately different and flattening them here is
21
+ * exactly the refactor `docs/design/u3-membership-sys-injection.md` §4 exists to prevent.
22
+ */
23
+ /** The `$SYS` creds' source: the store to read them from, the SPACE they are scoped to, and whether
24
+ * that store was INJECTED. `injected` is the composition root's own fact (`store !== undefined` at
25
+ * the runner) — never inferred by probing the store or sniffing `.cotal/`, both of which report
26
+ * "workstation" for a hosted daemon and would emit CLI advice a host cannot run (design §4.1).
27
+ *
28
+ * A UNION rather than a flag plus an optional root, because the workstation arm cannot do its job
29
+ * without a root and the hosted arm has none: {@link repairAdvice} must ASK the root whether the
30
+ * command it is about to name would run, and a `root?: string` would let a composition build a
31
+ * workstation source with no root and silently fall back to advice nobody checked. Same idiom as
32
+ * the rest of this module — the unsound call is made impossible to express rather than guarded
33
+ * against at runtime. The two arms are exactly workspace's `SpaceMaterialComposition`, which is
34
+ * what {@link loadSysPair} hands the per-kind resolvers.
35
+ *
36
+ * `space` joined it in P7: the pair is per-space material now, so a source that named only a store
37
+ * and a root no longer names a location. It is on BOTH arms because both need it — the workstation
38
+ * arm to migrate and read, the hosted arm to build the key it tells an operator to `put` under. */
39
+ export type SysCredsSource = {
40
+ secrets: SecretStore;
41
+ space: string;
42
+ injected: true;
43
+ root?: undefined;
44
+ } | {
45
+ secrets: SecretStore;
46
+ space: string;
47
+ injected: false;
48
+ root: string;
49
+ };
50
+ /** Repair advice for missing/unusable `$SYS` material, in the reader's own idiom.
51
+ *
52
+ * The DIAGNOSIS half (which key, which account) is identical in both compositions and is built by
53
+ * the caller; only this repair TAIL forks. On a workstation the repair is a real command; against a
54
+ * hosted store it is the mint window plus the key to `put` under, because `cotal up --rotate-sys`
55
+ * is unactionable there — and emitting it into a hosted log degrades the diagnosis even when the
56
+ * failure semantics are right. Both halves say the same true thing: the `$SYS` pair can only be
57
+ * minted while the never-persisted system signing seed is in memory.
58
+ *
59
+ * THERE IS A THIRD CASE, and until now this function could not see it: on a root hosting several
60
+ * spaces the workstation advice names two verbs that BOTH refuse. `cotal up --rotate-sys` and
61
+ * `cotal down` are broker-wide and `assertSingleSpaceBroker` turns them away naming the tenants,
62
+ * so the operator whose observer is missing is handed a command, runs it, and is refused — with
63
+ * the refusal itself explaining that the remedy does not exist yet. That is advice which cannot
64
+ * succeed, the same defect `healMembershipDataCreds`'s own comment records, and it was reachable
65
+ * on a real root (`docs/design/space-segmentation-p7-p1.md` §6, probe-executed).
66
+ *
67
+ * So the workstation arm consults the guard before naming its command, and where the guard would
68
+ * refuse it states the truth instead: the guard's own words, then the reason no other command can
69
+ * substitute. NAMING NOTHING IS THE POINT — there is no verb to offer here, and inventing a
70
+ * gentler-sounding one would restore the defect.
71
+ *
72
+ * This makes the function read the filesystem on the workstation arm, which is why the callers
73
+ * pass it as a THUNK: it is built only on a path that has already failed, never on a healthy one. */
74
+ export declare function repairAdvice(source: SysCredsSource, kinds: readonly string[]): string;
75
+ /** The DATA account an observer cred is scoped to, read out of its own `$SYS.REQ.ACCOUNT.<id>.CONNZ`
76
+ * publish permission, or `undefined` if it carries none.
77
+ *
78
+ * This is a LOCAL read of a signed document, and it buys the DIAGNOSIS, not the guarantee: the
79
+ * broker independently refuses a CONNZ request for any other account, because the permission is in
80
+ * the JWT it validates. Doing it here, before connecting, is what turns that refusal from a bare
81
+ * "Authorization Violation" into a line naming both accounts (design §4.3). */
82
+ export declare function connzAccountOf(observerCreds: string): string | undefined;
83
+ /**
84
+ * THE TENANCY CHECK — the guard that replaces the eliminated `membership.json` cross-check.
85
+ *
86
+ * Every sweep below resolves an ACCOUNT, and a complete, well-formed sweep of the WRONG account is
87
+ * indistinguishable from "the principal is gone": a healthy-looking answer that authorizes eviction.
88
+ * Note the asymmetry that makes this necessary — an observer scoped to A used with accountId B
89
+ * under-reports (broker-denied → `unknown`, safe), but observer A used with accountId A while the
90
+ * GATE lives on B is internally consistent and answers a confident, WRONG `gone`.
91
+ *
92
+ * Checking the observer against the account the daemon's OWN cred authenticates as is strictly
93
+ * stronger than the file it replaces: the file sat in the same `.cotal/` dir as the creds, so a root
94
+ * that was wrong was wrong for both, and its independence came from `expectedAccount` being derived
95
+ * from the cred anyway. The cred was always the real authority; the file was the thing being checked.
96
+ *
97
+ * An observer carrying NO CONNZ permission is refused rather than trusted: it cannot do the job, and
98
+ * treating "no account named" as "any account" is the exact failure this guard exists to stop.
99
+ */
100
+ export declare function observerTenancyProblem(observerCreds: string, expectedAccount: string): string | undefined;
101
+ /**
102
+ * THE TORN-ROTATION CHECK — two `$SYS` creds signed by DIFFERENT system accounts.
103
+ *
104
+ * `rotateSystemCreds` commits the trust record, then writes both creds, so a crash between the two
105
+ * leaves one of them on the RETIRED system account. The broker answers the same bare "Authorization
106
+ * Violation" either way, and the daemon cannot ask the trust record which account is current (it
107
+ * deliberately never loads the signer) — but it does not need to: the pair is written by ONE
108
+ * rotation, so two different issuers prove one of them is stale, with no signer read at all.
109
+ *
110
+ * Shared by both paths as of this change. It previously lived only in the feed, which left eviction
111
+ * — the path that actually kills connections — opening a half-rotated pair blind.
112
+ *
113
+ * `advice` is a THUNK because {@link repairAdvice} now reads the root's tenant list: both call sites
114
+ * sit on a healthy path (`loadCheckedSys` runs per eviction), and eagerly building advice nobody
115
+ * will read would put a directory listing on every successful call.
116
+ */
117
+ export declare function tornRotationProblem(observerCreds: string, evictorCreds: string, advice: () => string): string | undefined;
118
+ /** What {@link loadSysPair} was asked for. The liveness verbs are READ-ONLY and must not even read
119
+ * the KICK cred — least privilege is not only about what a connection may do, but about what the
120
+ * process reads into memory on a path that never needs it. */
121
+ export type SysCredsNeed = "observer" | "both";
122
+ export interface SysPair {
123
+ observer?: string;
124
+ evictor?: string;
125
+ /** Keys the store returned `undefined` for — ABSENCE, per the `SecretStore` contract. A `get()`
126
+ * that THROWS is a refusal, not an absence, and propagates out of {@link loadSysPair}. */
127
+ missing: string[];
128
+ }
129
+ /** Read the `$SYS` pair through the store. Absence is reported; every other failure propagates.
130
+ *
131
+ * The distinction is load-bearing: `undefined` means "not provisioned here", which each caller
132
+ * answers in its own posture, whereas a KMS timeout or a revoked role is a REFUSAL that must not be
133
+ * mistaken for an unprovisioned space and quietly degraded into deny-new-only.
134
+ *
135
+ * Reading per call (rather than once at start) is strictly better than the `readFileSync` it
136
+ * replaces: a hosted store re-keyed by a rotation is picked up on the next eviction with no daemon
137
+ * restart. No renewal timer is added, and none is wanted — these stay `rotation-renewed`. */
138
+ export declare function loadSysPair(source: SysCredsSource, need: SysCredsNeed): Promise<SysPair>;
139
+ //# sourceMappingURL=sys-creds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sys-creds.d.ts","sourceRoot":"","sources":["../src/sys-creds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM/D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;;;;oGAeoG;AACpG,MAAM,MAAM,cAAc,GACtB;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GACzE;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAsB3E;;;;;;;;;;;;;;;;;;;;;;;sGAuBsG;AACtG,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAgBrF;AAED;;;;;;gFAMgF;AAChF,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMxE;AAED;;;;;;;;;;;;;;;;GAg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