instar 1.3.270 → 1.3.271

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 (51) hide show
  1. package/dashboard/index.html +73 -11
  2. package/dist/commands/server.d.ts.map +1 -1
  3. package/dist/commands/server.js +15 -2
  4. package/dist/commands/server.js.map +1 -1
  5. package/dist/coordination/ReviewExchange.d.ts +135 -0
  6. package/dist/coordination/ReviewExchange.d.ts.map +1 -0
  7. package/dist/coordination/ReviewExchange.js +192 -0
  8. package/dist/coordination/ReviewExchange.js.map +1 -0
  9. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  10. package/dist/core/PostUpdateMigrator.js +33 -1
  11. package/dist/core/PostUpdateMigrator.js.map +1 -1
  12. package/dist/core/SecretStore.d.ts.map +1 -1
  13. package/dist/core/SecretStore.js +10 -1
  14. package/dist/core/SecretStore.js.map +1 -1
  15. package/dist/core/TransferByNickname.d.ts +6 -0
  16. package/dist/core/TransferByNickname.d.ts.map +1 -1
  17. package/dist/core/TransferByNickname.js +18 -6
  18. package/dist/core/TransferByNickname.js.map +1 -1
  19. package/dist/core/seamlessnessConfig.d.ts.map +1 -1
  20. package/dist/core/seamlessnessConfig.js +12 -1
  21. package/dist/core/seamlessnessConfig.js.map +1 -1
  22. package/dist/core/types.d.ts +23 -0
  23. package/dist/core/types.d.ts.map +1 -1
  24. package/dist/core/types.js.map +1 -1
  25. package/dist/scaffold/templates.d.ts.map +1 -1
  26. package/dist/scaffold/templates.js +8 -1
  27. package/dist/scaffold/templates.js.map +1 -1
  28. package/dist/scheduler/MentorAutonomousGuardian.d.ts.map +1 -1
  29. package/dist/scheduler/MentorAutonomousGuardian.js +1 -0
  30. package/dist/scheduler/MentorAutonomousGuardian.js.map +1 -1
  31. package/dist/server/AgentServer.d.ts +5 -0
  32. package/dist/server/AgentServer.d.ts.map +1 -1
  33. package/dist/server/AgentServer.js +9 -1
  34. package/dist/server/AgentServer.js.map +1 -1
  35. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  36. package/dist/server/CapabilityIndex.js +16 -0
  37. package/dist/server/CapabilityIndex.js.map +1 -1
  38. package/dist/server/routes.d.ts +8 -0
  39. package/dist/server/routes.d.ts.map +1 -1
  40. package/dist/server/routes.js +227 -4
  41. package/dist/server/routes.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/data/builtin-manifest.json +64 -64
  44. package/src/scaffold/templates.ts +8 -1
  45. package/upgrades/1.3.271.md +154 -0
  46. package/upgrades/autoloop-gate-compliance.eli16.md +11 -0
  47. package/upgrades/side-effects/autoloop-gate-compliance.md +43 -0
  48. package/upgrades/side-effects/dashboard-pool-sessions.md +103 -0
  49. package/upgrades/side-effects/review-exchange-protocol.md +60 -0
  50. package/upgrades/side-effects/secret-drop-store-first.md +117 -0
  51. package/upgrades/side-effects/transfer-idempotency-exactly-once.md +105 -0
@@ -0,0 +1,135 @@
1
+ /**
2
+ * ReviewExchange — the autonomous code-review protocol (spec §7 G2.3).
3
+ *
4
+ * A ReviewExchange is one mutual, mandate-gated sign-off of a review artifact
5
+ * between the two agents named in a Coordination Mandate. It is how Phase-1's
6
+ * "code-owner review" happens WITHOUT the human relaying: the owner agent delivers
7
+ * a review package over Threadline, the peer reviews and returns an authenticated
8
+ * verdict, and BOTH sign-offs are checked against the mandate's `sign-code-review`
9
+ * authority (bounds e.g. `{ artifact: 'migration-port', mutual: true }`) before
10
+ * they are accepted. Every accepted signature carries the audit hash of the gate
11
+ * decision that authorized it — the trail Justin reviews.
12
+ *
13
+ * Asymmetry, stated honestly: the peer's instance may not run this engine yet, so
14
+ * the peer's "signature" is their authenticated Threadline verdict message
15
+ * (Ed25519-authenticated sender → fingerprint), recorded verbatim by reference —
16
+ * kind 'authenticated-peer-verdict'. The local agent's signature goes through the
17
+ * local gate — kind 'mandate-gated-local'. BOTH are gate-evaluated here (named
18
+ * party, bounds, expiry, revocation), so a stranger's verdict or an out-of-bounds
19
+ * artifact is refused identically.
20
+ *
21
+ * State machine (linear, no skips):
22
+ * proposed → delivered → verdict-recorded → complete
23
+ * ↘ changes-requested (terminal: rework = a NEW exchange)
24
+ *
25
+ * The review package is content-addressed: `packageSha256` is fixed at creation
26
+ * and signatures bind to the record that carries it — a different package is a
27
+ * different exchange. Deny-by-default is inherited: with no mandate issued, every
28
+ * sign/verdict path denies.
29
+ */
30
+ import type { MandateGate } from './MandateGate.js';
31
+ export type ReviewExchangeState = 'proposed' | 'delivered' | 'verdict-recorded' | 'complete' | 'changes-requested';
32
+ export interface ReviewSignature {
33
+ /** The signing agent's routing fingerprint (a named party of the mandate). */
34
+ agentFp: string;
35
+ signedAt: string;
36
+ /** 'mandate-gated-local' = this server's own agent, allowed by the local gate;
37
+ * 'authenticated-peer-verdict' = the peer's sign-off, carried by their
38
+ * authenticated Threadline verdict message (recorded by reference). */
39
+ kind: 'mandate-gated-local' | 'authenticated-peer-verdict';
40
+ /** Hash of the audit entry for the gate decision that authorized this signature. */
41
+ auditHash: string;
42
+ /** Evidence reference — e.g. a Threadline message/thread ref for peer signatures. */
43
+ evidence: string | null;
44
+ }
45
+ export interface PeerVerdict {
46
+ verdict: 'approve' | 'request-changes';
47
+ summary: string;
48
+ /** Authenticated-source reference (Threadline message/thread id). */
49
+ evidence: string;
50
+ recordedAt: string;
51
+ }
52
+ export interface ReviewExchangeRecord {
53
+ id: string;
54
+ /** The mandate whose `sign-code-review` authority governs this exchange. */
55
+ mandateId: string;
56
+ /** The artifact under review — must match the authority's bounds (e.g. 'migration-port'). */
57
+ artifact: string;
58
+ /** Human-readable pointer to the review package (repo path or URL). */
59
+ packageRef: string;
60
+ /** sha256 of the package content — what the signatures bind to. Immutable. */
61
+ packageSha256: string;
62
+ /** [ownerFp, peerFp] — owner delivers, peer reviews. Both must be mandate parties. */
63
+ parties: [string, string];
64
+ state: ReviewExchangeState;
65
+ /** Delivery evidence (e.g. Threadline message id), set by markDelivered. */
66
+ deliveredEvidence: string | null;
67
+ peerVerdict: PeerVerdict | null;
68
+ signatures: ReviewSignature[];
69
+ createdAt: string;
70
+ updatedAt: string;
71
+ }
72
+ /** Uniform method result — gate denials and state errors come back as data, not throws. */
73
+ export type ExchangeResult = {
74
+ ok: true;
75
+ record: ReviewExchangeRecord;
76
+ } | {
77
+ ok: false;
78
+ reason: string;
79
+ };
80
+ export interface ReviewExchangeEngineDeps {
81
+ /** Absolute path to the exchanges JSON file. */
82
+ filePath: string;
83
+ /** The mandate gate — EVERY sign-off is evaluated through it. */
84
+ gate: MandateGate;
85
+ now?: () => number;
86
+ /** Exchange id generator (default: random). Injected for deterministic tests. */
87
+ genId?: () => string;
88
+ }
89
+ export interface CreateExchangeInput {
90
+ mandateId: string;
91
+ artifact: string;
92
+ packageRef: string;
93
+ packageSha256: string;
94
+ parties: [string, string];
95
+ id?: string;
96
+ }
97
+ export declare class ReviewExchangeEngine {
98
+ private readonly d;
99
+ constructor(deps: ReviewExchangeEngineDeps);
100
+ private nowIso;
101
+ private readAll;
102
+ private writeAll;
103
+ private save;
104
+ /** Evaluate `sign-code-review` for one party through the mandate gate. */
105
+ private gateSignOff;
106
+ /** Create a new exchange in `proposed`. Validation only — no gate call yet
107
+ * (creating a record delegates nothing; the sign-offs are what the mandate governs). */
108
+ create(input: CreateExchangeInput): ExchangeResult;
109
+ /** proposed → delivered. Records the delivery evidence (Threadline message ref). */
110
+ markDelivered(id: string, evidence: string): ExchangeResult;
111
+ /**
112
+ * delivered → verdict-recorded | changes-requested.
113
+ *
114
+ * Records the PEER's authenticated verdict. An 'approve' verdict IS the peer's
115
+ * sign-off, so it is MANDATE-GATED for the peer's fingerprint (named party,
116
+ * bounds, expiry, revocation — a deny refuses the verdict). A 'request-changes'
117
+ * verdict delegates nothing (it is a refusal), so it is recorded ungated — but
118
+ * only from the exchange's named peer.
119
+ */
120
+ recordPeerVerdict(id: string, input: {
121
+ verdict: 'approve' | 'request-changes';
122
+ summary: string;
123
+ evidence: string;
124
+ peerFp: string;
125
+ }): ExchangeResult;
126
+ /**
127
+ * verdict-recorded → complete. The OWNER's countersignature, mandate-gated for
128
+ * the owner's fingerprint. Completion requires the mutual pair: the peer's
129
+ * approve-signature already present + this one.
130
+ */
131
+ sign(id: string, agentFp: string): ExchangeResult;
132
+ get(id: string): ReviewExchangeRecord | undefined;
133
+ list(): ReviewExchangeRecord[];
134
+ }
135
+ //# sourceMappingURL=ReviewExchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewExchange.d.ts","sourceRoot":"","sources":["../../src/coordination/ReviewExchange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,UAAU,GACV,mBAAmB,CAAC;AAExB,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB;;4EAEwE;IACxE,IAAI,EAAE,qBAAqB,GAAG,4BAA4B,CAAC;IAC3D,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB,6FAA6F;IAC7F,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,aAAa,EAAE,MAAM,CAAC;IACt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,EAAE,mBAAmB,GAAG,cAAc;IAuBlD,oFAAoF;IACpF,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc;IAY3D;;;;;;;;OAQG;IACH,iBAAiB,CACf,EAAE,EAAE,MAAM,EACV,KAAK,EAAE;QAAE,OAAO,EAAE,SAAS,GAAG,iBAAiB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACnG,cAAc;IAoCjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc;IA0BjD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAIjD,IAAI,IAAI,oBAAoB,EAAE;CAG/B"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * ReviewExchange — the autonomous code-review protocol (spec §7 G2.3).
3
+ *
4
+ * A ReviewExchange is one mutual, mandate-gated sign-off of a review artifact
5
+ * between the two agents named in a Coordination Mandate. It is how Phase-1's
6
+ * "code-owner review" happens WITHOUT the human relaying: the owner agent delivers
7
+ * a review package over Threadline, the peer reviews and returns an authenticated
8
+ * verdict, and BOTH sign-offs are checked against the mandate's `sign-code-review`
9
+ * authority (bounds e.g. `{ artifact: 'migration-port', mutual: true }`) before
10
+ * they are accepted. Every accepted signature carries the audit hash of the gate
11
+ * decision that authorized it — the trail Justin reviews.
12
+ *
13
+ * Asymmetry, stated honestly: the peer's instance may not run this engine yet, so
14
+ * the peer's "signature" is their authenticated Threadline verdict message
15
+ * (Ed25519-authenticated sender → fingerprint), recorded verbatim by reference —
16
+ * kind 'authenticated-peer-verdict'. The local agent's signature goes through the
17
+ * local gate — kind 'mandate-gated-local'. BOTH are gate-evaluated here (named
18
+ * party, bounds, expiry, revocation), so a stranger's verdict or an out-of-bounds
19
+ * artifact is refused identically.
20
+ *
21
+ * State machine (linear, no skips):
22
+ * proposed → delivered → verdict-recorded → complete
23
+ * ↘ changes-requested (terminal: rework = a NEW exchange)
24
+ *
25
+ * The review package is content-addressed: `packageSha256` is fixed at creation
26
+ * and signatures bind to the record that carries it — a different package is a
27
+ * different exchange. Deny-by-default is inherited: with no mandate issued, every
28
+ * sign/verdict path denies.
29
+ */
30
+ import fs from 'node:fs';
31
+ import path from 'node:path';
32
+ const SHA256_HEX = /^[0-9a-f]{64}$/;
33
+ export class ReviewExchangeEngine {
34
+ d;
35
+ constructor(deps) {
36
+ this.d = deps;
37
+ }
38
+ nowIso() {
39
+ return new Date(this.d.now ? this.d.now() : Date.now()).toISOString();
40
+ }
41
+ readAll() {
42
+ try {
43
+ const raw = JSON.parse(fs.readFileSync(this.d.filePath, 'utf8'));
44
+ return Array.isArray(raw) ? raw : [];
45
+ }
46
+ catch { /* @silent-fallback-ok — exchanges file may not exist yet; an empty list is the safe initial state */
47
+ return [];
48
+ }
49
+ }
50
+ writeAll(records) {
51
+ fs.mkdirSync(path.dirname(this.d.filePath), { recursive: true });
52
+ fs.writeFileSync(this.d.filePath, JSON.stringify(records, null, 2));
53
+ }
54
+ save(record) {
55
+ record.updatedAt = this.nowIso();
56
+ const all = this.readAll().filter((r) => r.id !== record.id);
57
+ all.push(record);
58
+ this.writeAll(all);
59
+ return record;
60
+ }
61
+ /** Evaluate `sign-code-review` for one party through the mandate gate. */
62
+ gateSignOff(record, agentFp) {
63
+ return this.d.gate.evaluate({
64
+ action: 'sign-code-review',
65
+ params: { artifact: record.artifact, mutual: true },
66
+ agentFp,
67
+ mandateId: record.mandateId,
68
+ });
69
+ }
70
+ /** Create a new exchange in `proposed`. Validation only — no gate call yet
71
+ * (creating a record delegates nothing; the sign-offs are what the mandate governs). */
72
+ create(input) {
73
+ if (!SHA256_HEX.test(input.packageSha256)) {
74
+ return { ok: false, reason: 'packageSha256 must be a 64-char lowercase sha256 hex digest' };
75
+ }
76
+ if (!input.artifact || !input.packageRef || !input.mandateId) {
77
+ return { ok: false, reason: 'mandateId, artifact, and packageRef are required' };
78
+ }
79
+ if (!Array.isArray(input.parties) || input.parties.length !== 2 || input.parties[0] === input.parties[1]) {
80
+ return { ok: false, reason: 'parties must be two DISTINCT agent fingerprints [ownerFp, peerFp]' };
81
+ }
82
+ const id = input.id ?? (this.d.genId ? this.d.genId() : `rex-${Math.random().toString(36).slice(2, 10)}`);
83
+ if (this.get(id))
84
+ return { ok: false, reason: `exchange "${id}" already exists` };
85
+ const now = this.nowIso();
86
+ const record = {
87
+ id, mandateId: input.mandateId, artifact: input.artifact,
88
+ packageRef: input.packageRef, packageSha256: input.packageSha256,
89
+ parties: input.parties, state: 'proposed',
90
+ deliveredEvidence: null, peerVerdict: null, signatures: [],
91
+ createdAt: now, updatedAt: now,
92
+ };
93
+ return { ok: true, record: this.save(record) };
94
+ }
95
+ /** proposed → delivered. Records the delivery evidence (Threadline message ref). */
96
+ markDelivered(id, evidence) {
97
+ const record = this.get(id);
98
+ if (!record)
99
+ return { ok: false, reason: `exchange "${id}" not found` };
100
+ if (record.state !== 'proposed') {
101
+ return { ok: false, reason: `cannot mark delivered from state "${record.state}" (must be "proposed")` };
102
+ }
103
+ if (!evidence)
104
+ return { ok: false, reason: 'delivery evidence is required' };
105
+ record.state = 'delivered';
106
+ record.deliveredEvidence = evidence;
107
+ return { ok: true, record: this.save(record) };
108
+ }
109
+ /**
110
+ * delivered → verdict-recorded | changes-requested.
111
+ *
112
+ * Records the PEER's authenticated verdict. An 'approve' verdict IS the peer's
113
+ * sign-off, so it is MANDATE-GATED for the peer's fingerprint (named party,
114
+ * bounds, expiry, revocation — a deny refuses the verdict). A 'request-changes'
115
+ * verdict delegates nothing (it is a refusal), so it is recorded ungated — but
116
+ * only from the exchange's named peer.
117
+ */
118
+ recordPeerVerdict(id, input) {
119
+ const record = this.get(id);
120
+ if (!record)
121
+ return { ok: false, reason: `exchange "${id}" not found` };
122
+ if (record.state !== 'delivered') {
123
+ return { ok: false, reason: `cannot record a verdict from state "${record.state}" (must be "delivered")` };
124
+ }
125
+ if (input.peerFp !== record.parties[1]) {
126
+ return { ok: false, reason: `agent ${input.peerFp} is not the named peer reviewer of this exchange` };
127
+ }
128
+ if (!input.evidence || !input.summary) {
129
+ return { ok: false, reason: 'verdict summary and authenticated evidence ref are required' };
130
+ }
131
+ const verdict = {
132
+ verdict: input.verdict, summary: input.summary,
133
+ evidence: input.evidence, recordedAt: this.nowIso(),
134
+ };
135
+ if (input.verdict === 'request-changes') {
136
+ record.state = 'changes-requested';
137
+ record.peerVerdict = verdict;
138
+ return { ok: true, record: this.save(record) };
139
+ }
140
+ // approve = the peer's sign-off → through the mandate gate.
141
+ const decision = this.gateSignOff(record, input.peerFp);
142
+ if (decision.decision === 'deny') {
143
+ return { ok: false, reason: `mandate denied the peer sign-off: ${decision.reason}` };
144
+ }
145
+ record.state = 'verdict-recorded';
146
+ record.peerVerdict = verdict;
147
+ record.signatures.push({
148
+ agentFp: input.peerFp, signedAt: this.nowIso(),
149
+ kind: 'authenticated-peer-verdict', auditHash: decision.audit.hash,
150
+ evidence: input.evidence,
151
+ });
152
+ return { ok: true, record: this.save(record) };
153
+ }
154
+ /**
155
+ * verdict-recorded → complete. The OWNER's countersignature, mandate-gated for
156
+ * the owner's fingerprint. Completion requires the mutual pair: the peer's
157
+ * approve-signature already present + this one.
158
+ */
159
+ sign(id, agentFp) {
160
+ const record = this.get(id);
161
+ if (!record)
162
+ return { ok: false, reason: `exchange "${id}" not found` };
163
+ if (record.state !== 'verdict-recorded') {
164
+ return { ok: false, reason: `cannot sign from state "${record.state}" (must be "verdict-recorded")` };
165
+ }
166
+ if (agentFp !== record.parties[0]) {
167
+ return { ok: false, reason: `agent ${agentFp} is not the named owner of this exchange` };
168
+ }
169
+ if (record.signatures.some((s) => s.agentFp === agentFp)) {
170
+ return { ok: false, reason: 'owner has already signed this exchange' };
171
+ }
172
+ const decision = this.gateSignOff(record, agentFp);
173
+ if (decision.decision === 'deny') {
174
+ return { ok: false, reason: `mandate denied the owner sign-off: ${decision.reason}` };
175
+ }
176
+ record.signatures.push({
177
+ agentFp, signedAt: this.nowIso(),
178
+ kind: 'mandate-gated-local', auditHash: decision.audit.hash,
179
+ evidence: null,
180
+ });
181
+ // Mutual bound satisfied: both named parties have gate-authorized signatures.
182
+ record.state = 'complete';
183
+ return { ok: true, record: this.save(record) };
184
+ }
185
+ get(id) {
186
+ return this.readAll().find((r) => r.id === id);
187
+ }
188
+ list() {
189
+ return this.readAll();
190
+ }
191
+ }
192
+ //# sourceMappingURL=ReviewExchange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReviewExchange.js","sourceRoot":"","sources":["../../src/coordination/ReviewExchange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AA6E7B,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC,MAAM,OAAO,oBAAoB;IACd,CAAC,CAA2B;IAC7C,YAAY,IAA8B;QACxC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAChB,CAAC;IAEO,MAAM;QACZ,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACxE,CAAC;IAEO,OAAO;QACb,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;YACjE,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAA8B,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,CAAC;QAAC,MAAM,CA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the one-awake-machine model: with the pool enabled I run conversations across ALL my machines at once and can MOVE a conversation between them. Ships DARK behind \`multiMachine.sessionPool.stage\` (default 'dark'); a single-machine agent is a no-op.
2995
2995
 
2996
2996
  - **See the pool:** the **Machines tab** in the dashboard, or \`GET /pool\` (Bearer-auth) → which machine is the router ("dispatcher") + every machine's nickname, hardware, online status, load, and clock-skew status.
2997
+ - **Every session, every machine:** the dashboard sessions list shows ALL sessions across the pool, each tagged with the machine it runs on. API: \`GET /sessions?scope=pool\` → \`{ sessions: [...each with machineId/machineNickname...], pool: { peersOk, failed } }\`. An unreachable peer degrades to a \`failed\` entry — local sessions always answer.
2997
2998
  - **Machine nicknames** are the user-facing handle (auto-assigned, editable). Rename via \`PATCH /pool/machines/:machineId\` with \`{"nickname":"the mini"}\`, or inline on the Machines tab.
2998
2999
  - **Which machine + WHY (never guess):** \`GET /pool/placement?topic=N\` → the owning machine + nickname, the **reason** (\`pinned\` = a deliberate move vs \`placed\` = load-balanced vs \`unowned\`), and the lease-holder. Answerable from ANY machine (a standby proxies to the holder). Running ON a machine does NOT mean a topic was deliberately moved there — read this instead of inferring.
2999
3000
  - **Reliable transfer (phrasing-independent):** \`POST /pool/transfer\` with \`{"topic":N,"to":"<nickname|machineId>"}\` runs the same validated planner as "move this to <nickname>" but deterministically. 404 unknown · 409 rate-limited · 409 \`needsConfirmation\` for an offline target (re-send with \`"confirm":true\`). The lever to call directly when a natural-language move didn't catch.
@@ -3018,6 +3019,18 @@ Beyond the one-awake-machine model: with the pool enabled I run conversations ac
3018
3019
  patched = true;
3019
3020
  result.upgraded.push('CLAUDE.md: added pool placement/transfer robustness lines');
3020
3021
  }
3022
+ // Pool-wide session visibility (2026-06-05): agents that ALREADY have the pool
3023
+ // section predate GET /sessions?scope=pool (every session, every machine, each
3024
+ // tagged with its machine — the dashboard cross-machine sessions list). Append
3025
+ // the line so deployed agents can answer "what's running across my machines?"
3026
+ // from the API. Idempotent via the unique `scope=pool` marker.
3027
+ if (content.includes('Multi-Machine Session Pool (active-active') && !content.includes('scope=pool')) {
3028
+ const poolSessions = `
3029
+ - **Every session, every machine:** the dashboard sessions list shows ALL sessions across the pool, each tagged with the machine it runs on. API: \`GET /sessions?scope=pool\` → \`{ sessions: [...each with machineId/machineNickname...], pool: { peersOk, failed } }\`. An unreachable peer degrades to a \`failed\` entry — local sessions always answer.`;
3030
+ content += '\n' + poolSessions + '\n';
3031
+ patched = true;
3032
+ result.upgraded.push('CLAUDE.md: added pool-wide session visibility line');
3033
+ }
3021
3034
  // Cross-Machine Secret Sync (spec Phase 4, 2026-06-04): deployed agents don't know
3022
3035
  // a secret can now follow them across machines, nor the two routes. Append the section
3023
3036
  // so an agent surfaces "drop once, usable everywhere" instead of asking the user to
@@ -3418,7 +3431,7 @@ Strip the \`[telegram:N]\` prefix before interpreting the message. Respond natur
3418
3431
  - **Retrieve the secret (HARDENED — required)**: \`node .instar/scripts/secret-drop-retrieve.mjs TOKEN field-name\` — streams the field VALUE to stdout, prints field NAMES + lengths to stderr, NEVER prints the response body. Discover available fields with \`... TOKEN --names\`.
3419
3432
  - **NEVER use \`curl /secrets/retrieve\` directly** — the raw curl pattern dumps the full JSON response (including the secret value) into the Bash tool transcript.
3420
3433
  - List pending: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/secrets/pending\`
3421
- - **Security**: One-time use, expires after 15 minutes, in-memory only (never written to disk), CSRF-protected.
3434
+ - **Security**: One-time link, expires after 15 minutes, CSRF-protected. The moment a secret is SUBMITTED it is also persisted store-first to the durable AES-256-GCM encrypted SecretStore — so it survives session restarts, compaction, and cross-machine handoff instead of evaporating with the in-memory copy. Retrieval transparently falls back to the durable copy, and a successful consume deletes both. (Opt out with \`secrets.persistDrops: false\` in \`.instar/config.json\`.)
3422
3435
  - **When to use** (PROACTIVE — this is the trigger): the moment a user offers to give you a credential (API key, password, token) or you realize you need one, use Secret Drop. It is the ONLY correct way to collect a secret. NEVER accept it pasted into Telegram or chat, and NEVER create a local file (e.g. \`.instar/secrets/foo.env\`) and ask the user to edit/paste into it — that defeats the one-time, in-memory, never-on-disk guarantee and asks the user to edit files (which you must never do). Always issue a Secret Drop one-time link instead.
3423
3436
  `;
3424
3437
  const tunnelIdx = content.indexOf('**Cloudflare Tunnel**');
@@ -3927,6 +3940,25 @@ The user has been talking to you (possibly for days). A generic greeting like "H
3927
3940
  result.upgraded.push('CLAUDE.md: added Secret Drop --run atomic use-and-consume guidance');
3928
3941
  }
3929
3942
  }
3943
+ // Secret Drop store-first durability (2026-06-04). Existing agents'
3944
+ // Security bullet still claims submissions are "in-memory only (never
3945
+ // written to disk)" — no longer true: submissions are persisted store-first
3946
+ // to the encrypted SecretStore so they survive session churn. Rewrite the
3947
+ // stale bullet so agents stop treating an un-consumed drop as a
3948
+ // race-against-the-TTL. Idempotent: anchors on the old wording; skips when
3949
+ // the durable wording is already present.
3950
+ {
3951
+ const oldSecurityLine = '- **Security**: One-time use, expires after 15 minutes, in-memory only (never written to disk), CSRF-protected.';
3952
+ const newSecurityLine = '- **Security**: One-time link, expires after 15 minutes, CSRF-protected. The moment a secret is SUBMITTED it is also persisted store-first to the durable AES-256-GCM encrypted SecretStore — so it survives session restarts, compaction, and cross-machine handoff instead of evaporating with the in-memory copy. Retrieval transparently falls back to the durable copy, and a successful consume deletes both. (Opt out with `secrets.persistDrops: false` in `.instar/config.json`.)';
3953
+ if (content.includes(oldSecurityLine)) {
3954
+ content = content.replace(oldSecurityLine, newSecurityLine);
3955
+ patched = true;
3956
+ result.upgraded.push('CLAUDE.md: Secret Drop Security bullet updated for store-first durable persistence');
3957
+ }
3958
+ else if (content.includes('persisted store-first to the durable')) {
3959
+ result.skipped.push('CLAUDE.md: Secret Drop store-first durability already documented');
3960
+ }
3961
+ }
3930
3962
  // Worktree Convention section (Migration Parity Standard backfill for
3931
3963
  // Layer 2 of the agent worktree convention — fresh inits get this via
3932
3964
  // generateClaudeMd; existing agents get it here on update).