instar 1.3.819 → 1.3.821
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +498 -3
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +69 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/BackupManager.d.ts +10 -0
- package/dist/core/BackupManager.d.ts.map +1 -1
- package/dist/core/BackupManager.js +16 -0
- package/dist/core/BackupManager.js.map +1 -1
- package/dist/core/BoundedJsonlAudit.d.ts +37 -0
- package/dist/core/BoundedJsonlAudit.d.ts.map +1 -0
- package/dist/core/BoundedJsonlAudit.js +87 -0
- package/dist/core/BoundedJsonlAudit.js.map +1 -0
- package/dist/core/JudgmentProvenanceLog.d.ts +144 -0
- package/dist/core/JudgmentProvenanceLog.d.ts.map +1 -0
- package/dist/core/JudgmentProvenanceLog.js +301 -0
- package/dist/core/JudgmentProvenanceLog.js.map +1 -0
- package/dist/core/MachineIdentity.d.ts.map +1 -1
- package/dist/core/MachineIdentity.js +2 -0
- package/dist/core/MachineIdentity.js.map +1 -1
- package/dist/core/OwnerDarkLadder.d.ts +108 -0
- package/dist/core/OwnerDarkLadder.d.ts.map +1 -0
- package/dist/core/OwnerDarkLadder.js +229 -0
- package/dist/core/OwnerDarkLadder.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts +10 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +106 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SpawnAdmission.d.ts +218 -0
- package/dist/core/SpawnAdmission.d.ts.map +1 -0
- package/dist/core/SpawnAdmission.js +440 -0
- package/dist/core/SpawnAdmission.js.map +1 -0
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +24 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/machineCoherenceManifest.d.ts.map +1 -1
- package/dist/core/machineCoherenceManifest.js +30 -0
- package/dist/core/machineCoherenceManifest.js.map +1 -1
- package/dist/core/types.d.ts +87 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/monitoring/DuplicateSessionReconciler.d.ts +225 -0
- package/dist/monitoring/DuplicateSessionReconciler.d.ts.map +1 -0
- package/dist/monitoring/DuplicateSessionReconciler.js +544 -0
- package/dist/monitoring/DuplicateSessionReconciler.js.map +1 -0
- package/dist/monitoring/FailureAnalyzer.d.ts.map +1 -1
- package/dist/monitoring/FailureAnalyzer.js +40 -1
- package/dist/monitoring/FailureAnalyzer.js.map +1 -1
- package/dist/monitoring/FailureLedger.d.ts +9 -0
- package/dist/monitoring/FailureLedger.d.ts.map +1 -1
- package/dist/monitoring/FailureLedger.js +21 -4
- package/dist/monitoring/FailureLedger.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +2 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts +5 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +4 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +9 -0
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/fileRoutes.d.ts +16 -0
- package/dist/server/fileRoutes.d.ts.map +1 -1
- package/dist/server/fileRoutes.js +46 -0
- package/dist/server/fileRoutes.js.map +1 -1
- package/dist/server/routes.d.ts +7 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +99 -0
- package/dist/server/routes.js.map +1 -1
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +89 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/package.json +1 -1
- package/scripts/lib/self-action-detect.mjs +2 -0
- package/skills/instar-dev/templates/side-effects-artifact.md +8 -0
- package/skills/spec-converge/SKILL.md +1 -0
- package/skills/spec-converge/scripts/write-convergence-tag.mjs +71 -0
- package/src/data/builtin-manifest.json +65 -65
- package/src/scaffold/templates.ts +2 -1
- package/upgrades/1.3.820.md +25 -0
- package/upgrades/1.3.821.md +22 -0
- package/upgrades/side-effects/ownership-gated-spawn-increment-1.md +166 -0
- package/upgrades/side-effects/two-node-harness-increment2-entry-gate.md +64 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OwnerDarkLadder — Layer A's `other-dark` arm (ownership-gated-spawn-and-
|
|
3
|
+
* judgment-within-floors spec §3.3): what happens to a conversation whose
|
|
4
|
+
* owning machine is temporarily dark, instead of the legacy bootleg local
|
|
5
|
+
* spawn (the 2026-07-10 incident) or silence.
|
|
6
|
+
*
|
|
7
|
+
* The ladder's rungs:
|
|
8
|
+
* 1. HOLD — lives in the inbound queue's hold-for-stability policy (upstream
|
|
9
|
+
* of this module; trails the queue by one rollout stage by that spec's own
|
|
10
|
+
* design). Not re-implemented here.
|
|
11
|
+
* 2. CLAIM-THEN-SPAWN — the stale-owner-release evidence bar + single CAS
|
|
12
|
+
* funnel (StaleOwnerReleaseEngine). INERT while that engine is dryRun —
|
|
13
|
+
* this module only records that the rung was consulted (G3 honesty:
|
|
14
|
+
* a dark dependency is disclosed, never silently assumed).
|
|
15
|
+
* 3. QUEUE + HONEST NOTICE — durable-queue custody where live; where dark,
|
|
16
|
+
* the deterministic floor is the state-accurate resend notice (FD9),
|
|
17
|
+
* delivered on the deterministic G1 path (`telegram.sendToTopic`) with a
|
|
18
|
+
* DECLARED exception to speaker election (election rule 1 is
|
|
19
|
+
* owner-liveness-blind and would structurally silence the notice).
|
|
20
|
+
*
|
|
21
|
+
* Increment 1 posture: dryRun-gated with the SpawnAdmission seam — every
|
|
22
|
+
* decision is journaled (would-notice), nothing sends until enforce mode,
|
|
23
|
+
* which itself requires durable custody (§3.1 item 6).
|
|
24
|
+
*
|
|
25
|
+
* Notice guards (all deterministic):
|
|
26
|
+
* - final owner-liveness re-check immediately before the send (a
|
|
27
|
+
* just-recovered owner answering normally suppresses the notice);
|
|
28
|
+
* - topic-scoped suppression (a recent identical notice visible in the
|
|
29
|
+
* topic's send history — episode dedupe is machine-scoped, so under
|
|
30
|
+
* split-brain two front doors could otherwise each notice);
|
|
31
|
+
* - ONE notice per (topic, outage-episode);
|
|
32
|
+
* - per-topic cooldown (default 30 min).
|
|
33
|
+
*/
|
|
34
|
+
import type { BoundedJsonlAudit } from './BoundedJsonlAudit.js';
|
|
35
|
+
/** FD9 — the two state-accurate notice wordings (the shipping text). */
|
|
36
|
+
export declare const OWNER_DARK_NOTICE_QUEUE_DARK: string;
|
|
37
|
+
export declare const OWNER_DARK_NOTICE_QUEUE_LIVE: string;
|
|
38
|
+
export type LadderMode = 'dry-run' | 'enforce';
|
|
39
|
+
export type LadderAction = 'would-notice' | 'noticed' | 'queue-custody-noticed' | 'suppressed-owner-recovered' | 'suppressed-episode-dedupe' | 'suppressed-cooldown' | 'suppressed-topic-history' | 'notice-send-failed';
|
|
40
|
+
export interface OwnerDarkLadderConfigView {
|
|
41
|
+
/** Silence ceiling (§3.3): episode first held/refused message → answer or notice. */
|
|
42
|
+
maxUserSilenceMs: number;
|
|
43
|
+
/** Per-topic cooldown between notices. */
|
|
44
|
+
noticeCooldownMs: number;
|
|
45
|
+
}
|
|
46
|
+
export interface OwnerDarkLadderDeps {
|
|
47
|
+
/** Live owner-liveness input (heartbeat view) — the pre-send re-check. */
|
|
48
|
+
isMachineAlive: (machineId: string) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The deterministic G1 send path (`telegram.sendToTopic` — never the LLM
|
|
51
|
+
* tone gate). Returns true when the platform accepted the send.
|
|
52
|
+
*/
|
|
53
|
+
sendNotice: (topicId: number, text: string) => Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Topic-scoped suppression: does the topic's recent send history already
|
|
56
|
+
* show an owner-dark notice (from ANY machine)? Split-brain guard.
|
|
57
|
+
*/
|
|
58
|
+
topicHistoryHasRecentNotice: (topicId: number) => Promise<boolean> | boolean;
|
|
59
|
+
/** logs/owner-dark-ladder.jsonl (shared with the SpawnAdmission error arm). */
|
|
60
|
+
journal: BoundedJsonlAudit;
|
|
61
|
+
log: (msg: string) => void;
|
|
62
|
+
now?: () => number;
|
|
63
|
+
}
|
|
64
|
+
export interface OwnerDarkLadderStatus {
|
|
65
|
+
openEpisodes: Array<{
|
|
66
|
+
episodeId: string;
|
|
67
|
+
ownerMachineId: string;
|
|
68
|
+
openedAt: string;
|
|
69
|
+
topicsRefused: number;
|
|
70
|
+
topicsNoticed: number;
|
|
71
|
+
}>;
|
|
72
|
+
counters: Record<string, number>;
|
|
73
|
+
config: OwnerDarkLadderConfigView;
|
|
74
|
+
}
|
|
75
|
+
export declare class OwnerDarkLadder {
|
|
76
|
+
private readonly deps;
|
|
77
|
+
private readonly cfg;
|
|
78
|
+
private readonly nowFn;
|
|
79
|
+
/** One open episode per owner machine. */
|
|
80
|
+
private episodes;
|
|
81
|
+
/** Per-topic cooldown across episodes (machine-scoped). */
|
|
82
|
+
private lastNoticeAtByTopic;
|
|
83
|
+
private counters;
|
|
84
|
+
constructor(cfg: Partial<OwnerDarkLadderConfigView> | undefined, deps: OwnerDarkLadderDeps);
|
|
85
|
+
/**
|
|
86
|
+
* The `other-dark` arm entry point — called by the SpawnAdmission wiring
|
|
87
|
+
* when the seam's row (c) fires (dry-run: journal-only; enforce: rung 3).
|
|
88
|
+
* `custodyLive` = the durable inbound queue holds this message (queue-live
|
|
89
|
+
* wording); false = the honest resend wording.
|
|
90
|
+
*/
|
|
91
|
+
handleOwnerDark(input: {
|
|
92
|
+
sessionKey: string;
|
|
93
|
+
topicId: number | null;
|
|
94
|
+
ownerMachineId: string;
|
|
95
|
+
mode: LadderMode;
|
|
96
|
+
custodyLive: boolean;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
episodeId: string;
|
|
99
|
+
action: LadderAction;
|
|
100
|
+
}>;
|
|
101
|
+
/** Owner recovery closes the episode (§3.3 — episode-scoped dedupe resets). */
|
|
102
|
+
ownerRecovered(ownerMachineId: string): void;
|
|
103
|
+
/** Sweep: close episodes whose owner is alive again (rides any caller's tick). */
|
|
104
|
+
sweepRecovered(): void;
|
|
105
|
+
status(): OwnerDarkLadderStatus;
|
|
106
|
+
private openOrGetEpisode;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=OwnerDarkLadder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnerDarkLadder.d.ts","sourceRoot":"","sources":["../../src/core/OwnerDarkLadder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,wEAAwE;AACxE,eAAO,MAAM,4BAA4B,QAG6B,CAAC;AACvE,eAAO,MAAM,4BAA4B,QAEoC,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,SAAS,GACT,uBAAuB,GACvB,4BAA4B,GAC5B,2BAA2B,GAC3B,qBAAqB,GACrB,0BAA0B,GAC1B,oBAAoB,CAAC;AAEzB,MAAM,WAAW,yBAAyB;IACxC,qFAAqF;IACrF,gBAAgB,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C;;;OAGG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CA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AAC,MAAM,EAAE,YAAY,CAAA;KAAE,CAAC;IAgGxD,+EAA+E;IAC/E,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAgB5C,kFAAkF;IAClF,cAAc,IAAI,IAAI;IAUtB,MAAM,IAAI,qBAAqB;IAc/B,OAAO,CAAC,gBAAgB;CAmBzB"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OwnerDarkLadder — Layer A's `other-dark` arm (ownership-gated-spawn-and-
|
|
3
|
+
* judgment-within-floors spec §3.3): what happens to a conversation whose
|
|
4
|
+
* owning machine is temporarily dark, instead of the legacy bootleg local
|
|
5
|
+
* spawn (the 2026-07-10 incident) or silence.
|
|
6
|
+
*
|
|
7
|
+
* The ladder's rungs:
|
|
8
|
+
* 1. HOLD — lives in the inbound queue's hold-for-stability policy (upstream
|
|
9
|
+
* of this module; trails the queue by one rollout stage by that spec's own
|
|
10
|
+
* design). Not re-implemented here.
|
|
11
|
+
* 2. CLAIM-THEN-SPAWN — the stale-owner-release evidence bar + single CAS
|
|
12
|
+
* funnel (StaleOwnerReleaseEngine). INERT while that engine is dryRun —
|
|
13
|
+
* this module only records that the rung was consulted (G3 honesty:
|
|
14
|
+
* a dark dependency is disclosed, never silently assumed).
|
|
15
|
+
* 3. QUEUE + HONEST NOTICE — durable-queue custody where live; where dark,
|
|
16
|
+
* the deterministic floor is the state-accurate resend notice (FD9),
|
|
17
|
+
* delivered on the deterministic G1 path (`telegram.sendToTopic`) with a
|
|
18
|
+
* DECLARED exception to speaker election (election rule 1 is
|
|
19
|
+
* owner-liveness-blind and would structurally silence the notice).
|
|
20
|
+
*
|
|
21
|
+
* Increment 1 posture: dryRun-gated with the SpawnAdmission seam — every
|
|
22
|
+
* decision is journaled (would-notice), nothing sends until enforce mode,
|
|
23
|
+
* which itself requires durable custody (§3.1 item 6).
|
|
24
|
+
*
|
|
25
|
+
* Notice guards (all deterministic):
|
|
26
|
+
* - final owner-liveness re-check immediately before the send (a
|
|
27
|
+
* just-recovered owner answering normally suppresses the notice);
|
|
28
|
+
* - topic-scoped suppression (a recent identical notice visible in the
|
|
29
|
+
* topic's send history — episode dedupe is machine-scoped, so under
|
|
30
|
+
* split-brain two front doors could otherwise each notice);
|
|
31
|
+
* - ONE notice per (topic, outage-episode);
|
|
32
|
+
* - per-topic cooldown (default 30 min).
|
|
33
|
+
*/
|
|
34
|
+
/** FD9 — the two state-accurate notice wordings (the shipping text). */
|
|
35
|
+
export const OWNER_DARK_NOTICE_QUEUE_DARK = "That conversation's machine is temporarily unreachable (it may be restarting). " +
|
|
36
|
+
"I can't safely answer from here, and I'm not holding your message — please resend " +
|
|
37
|
+
'in a few minutes, or send it to my Lifeline topic if it\'s urgent.';
|
|
38
|
+
export const OWNER_DARK_NOTICE_QUEUE_LIVE = "That conversation's machine is temporarily unreachable (it may be restarting). " +
|
|
39
|
+
'Your message is saved and will be answered automatically when it returns.';
|
|
40
|
+
export class OwnerDarkLadder {
|
|
41
|
+
deps;
|
|
42
|
+
cfg;
|
|
43
|
+
nowFn;
|
|
44
|
+
/** One open episode per owner machine. */
|
|
45
|
+
episodes = new Map();
|
|
46
|
+
/** Per-topic cooldown across episodes (machine-scoped). */
|
|
47
|
+
lastNoticeAtByTopic = new Map();
|
|
48
|
+
counters = {
|
|
49
|
+
encounters: 0,
|
|
50
|
+
wouldNotice: 0,
|
|
51
|
+
noticed: 0,
|
|
52
|
+
queueCustodyNoticed: 0,
|
|
53
|
+
suppressedOwnerRecovered: 0,
|
|
54
|
+
suppressedEpisodeDedupe: 0,
|
|
55
|
+
suppressedCooldown: 0,
|
|
56
|
+
suppressedTopicHistory: 0,
|
|
57
|
+
sendFailed: 0,
|
|
58
|
+
episodesClosed: 0,
|
|
59
|
+
};
|
|
60
|
+
constructor(cfg, deps) {
|
|
61
|
+
this.cfg = {
|
|
62
|
+
maxUserSilenceMs: cfg?.maxUserSilenceMs ?? 600_000,
|
|
63
|
+
noticeCooldownMs: cfg?.noticeCooldownMs ?? 1_800_000,
|
|
64
|
+
};
|
|
65
|
+
this.deps = deps;
|
|
66
|
+
this.nowFn = deps.now ?? (() => Date.now());
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The `other-dark` arm entry point — called by the SpawnAdmission wiring
|
|
70
|
+
* when the seam's row (c) fires (dry-run: journal-only; enforce: rung 3).
|
|
71
|
+
* `custodyLive` = the durable inbound queue holds this message (queue-live
|
|
72
|
+
* wording); false = the honest resend wording.
|
|
73
|
+
*/
|
|
74
|
+
async handleOwnerDark(input) {
|
|
75
|
+
const now = this.nowFn();
|
|
76
|
+
this.counters.encounters++;
|
|
77
|
+
const ep = this.openOrGetEpisode(input.ownerMachineId, now);
|
|
78
|
+
if (input.topicId !== null && !ep.firstRefusalByTopic.has(input.topicId)) {
|
|
79
|
+
ep.firstRefusalByTopic.set(input.topicId, now);
|
|
80
|
+
}
|
|
81
|
+
const journalBase = {
|
|
82
|
+
ts: new Date(now).toISOString(),
|
|
83
|
+
kind: 'owner-dark-encounter',
|
|
84
|
+
episodeId: ep.episodeId,
|
|
85
|
+
ownerMachineId: input.ownerMachineId,
|
|
86
|
+
sessionKey: input.sessionKey,
|
|
87
|
+
topicId: input.topicId,
|
|
88
|
+
mode: input.mode,
|
|
89
|
+
custodyLive: input.custodyLive,
|
|
90
|
+
// G3 honesty: rung 2 (claim) rides the stale-owner-release engine's own
|
|
91
|
+
// rollout — this ladder never claims; it only records the consult.
|
|
92
|
+
rung2: 'stale-owner-release-owns-claims',
|
|
93
|
+
};
|
|
94
|
+
if (input.topicId === null) {
|
|
95
|
+
this.deps.journal.append({ ...journalBase, action: 'no-topic-no-notice' });
|
|
96
|
+
return { episodeId: ep.episodeId, action: input.mode === 'enforce' ? 'noticed' : 'would-notice' };
|
|
97
|
+
}
|
|
98
|
+
const topicId = input.topicId;
|
|
99
|
+
// ONE notice per (topic, outage-episode).
|
|
100
|
+
if (ep.noticedTopics.has(topicId)) {
|
|
101
|
+
this.counters.suppressedEpisodeDedupe++;
|
|
102
|
+
this.deps.journal.append({ ...journalBase, action: 'suppressed-episode-dedupe' });
|
|
103
|
+
return { episodeId: ep.episodeId, action: 'suppressed-episode-dedupe' };
|
|
104
|
+
}
|
|
105
|
+
// Per-topic cooldown (30 min default).
|
|
106
|
+
const lastAt = this.lastNoticeAtByTopic.get(topicId);
|
|
107
|
+
if (lastAt !== undefined && now - lastAt < this.cfg.noticeCooldownMs) {
|
|
108
|
+
this.counters.suppressedCooldown++;
|
|
109
|
+
this.deps.journal.append({ ...journalBase, action: 'suppressed-cooldown' });
|
|
110
|
+
return { episodeId: ep.episodeId, action: 'suppressed-cooldown' };
|
|
111
|
+
}
|
|
112
|
+
if (input.mode !== 'enforce') {
|
|
113
|
+
// Increment-1 posture: journal the would-notice, send nothing.
|
|
114
|
+
ep.noticedTopics.add(topicId);
|
|
115
|
+
this.counters.wouldNotice++;
|
|
116
|
+
this.deps.journal.append({ ...journalBase, action: 'would-notice' });
|
|
117
|
+
return { episodeId: ep.episodeId, action: 'would-notice' };
|
|
118
|
+
}
|
|
119
|
+
// ── Enforce mode: the rung-3 notice floor ──
|
|
120
|
+
// Final owner-liveness re-check immediately before the send.
|
|
121
|
+
let ownerAlive = false;
|
|
122
|
+
try {
|
|
123
|
+
ownerAlive = this.deps.isMachineAlive(input.ownerMachineId);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
ownerAlive = false;
|
|
127
|
+
}
|
|
128
|
+
if (ownerAlive) {
|
|
129
|
+
this.counters.suppressedOwnerRecovered++;
|
|
130
|
+
this.deps.journal.append({ ...journalBase, action: 'suppressed-owner-recovered' });
|
|
131
|
+
this.ownerRecovered(input.ownerMachineId);
|
|
132
|
+
return { episodeId: ep.episodeId, action: 'suppressed-owner-recovered' };
|
|
133
|
+
}
|
|
134
|
+
// Topic-scoped suppression (split-brain: another front door may have noticed).
|
|
135
|
+
try {
|
|
136
|
+
if (await this.deps.topicHistoryHasRecentNotice(topicId)) {
|
|
137
|
+
this.counters.suppressedTopicHistory++;
|
|
138
|
+
ep.noticedTopics.add(topicId);
|
|
139
|
+
this.deps.journal.append({ ...journalBase, action: 'suppressed-topic-history' });
|
|
140
|
+
return { episodeId: ep.episodeId, action: 'suppressed-topic-history' };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
/* @silent-fallback-ok: history unreadable → fall through to the send (the dedupe layers above still bound it). */
|
|
145
|
+
}
|
|
146
|
+
const text = input.custodyLive ? OWNER_DARK_NOTICE_QUEUE_LIVE : OWNER_DARK_NOTICE_QUEUE_DARK;
|
|
147
|
+
let sent = false;
|
|
148
|
+
try {
|
|
149
|
+
sent = await this.deps.sendNotice(topicId, text);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
this.deps.log(`[OwnerDarkLadder] notice send threw: ${err.message}`);
|
|
153
|
+
}
|
|
154
|
+
if (!sent) {
|
|
155
|
+
this.counters.sendFailed++;
|
|
156
|
+
this.deps.journal.append({ ...journalBase, action: 'notice-send-failed' });
|
|
157
|
+
return { episodeId: ep.episodeId, action: 'notice-send-failed' };
|
|
158
|
+
}
|
|
159
|
+
ep.noticedTopics.add(topicId);
|
|
160
|
+
this.lastNoticeAtByTopic.set(topicId, now);
|
|
161
|
+
const action = input.custodyLive ? 'queue-custody-noticed' : 'noticed';
|
|
162
|
+
this.counters[input.custodyLive ? 'queueCustodyNoticed' : 'noticed']++;
|
|
163
|
+
this.deps.journal.append({ ...journalBase, action, silenceMsAtNotice: now - (ep.firstRefusalByTopic.get(topicId) ?? now) });
|
|
164
|
+
return { episodeId: ep.episodeId, action };
|
|
165
|
+
}
|
|
166
|
+
/** Owner recovery closes the episode (§3.3 — episode-scoped dedupe resets). */
|
|
167
|
+
ownerRecovered(ownerMachineId) {
|
|
168
|
+
const ep = this.episodes.get(ownerMachineId);
|
|
169
|
+
if (!ep)
|
|
170
|
+
return;
|
|
171
|
+
this.episodes.delete(ownerMachineId);
|
|
172
|
+
this.counters.episodesClosed++;
|
|
173
|
+
this.deps.journal.append({
|
|
174
|
+
ts: new Date(this.nowFn()).toISOString(),
|
|
175
|
+
kind: 'owner-dark-episode-closed',
|
|
176
|
+
episodeId: ep.episodeId,
|
|
177
|
+
ownerMachineId,
|
|
178
|
+
durationMs: this.nowFn() - ep.openedAt,
|
|
179
|
+
topicsRefused: ep.firstRefusalByTopic.size,
|
|
180
|
+
topicsNoticed: ep.noticedTopics.size,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/** Sweep: close episodes whose owner is alive again (rides any caller's tick). */
|
|
184
|
+
sweepRecovered() {
|
|
185
|
+
for (const machineId of [...this.episodes.keys()]) {
|
|
186
|
+
try {
|
|
187
|
+
if (this.deps.isMachineAlive(machineId))
|
|
188
|
+
this.ownerRecovered(machineId);
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
/* @silent-fallback-ok: liveness unreadable → keep the episode open (safe direction). */
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
status() {
|
|
196
|
+
return {
|
|
197
|
+
openEpisodes: [...this.episodes.values()].map((ep) => ({
|
|
198
|
+
episodeId: ep.episodeId,
|
|
199
|
+
ownerMachineId: ep.ownerMachineId,
|
|
200
|
+
openedAt: new Date(ep.openedAt).toISOString(),
|
|
201
|
+
topicsRefused: ep.firstRefusalByTopic.size,
|
|
202
|
+
topicsNoticed: ep.noticedTopics.size,
|
|
203
|
+
})),
|
|
204
|
+
counters: { ...this.counters },
|
|
205
|
+
config: { ...this.cfg },
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
openOrGetEpisode(ownerMachineId, now) {
|
|
209
|
+
let ep = this.episodes.get(ownerMachineId);
|
|
210
|
+
if (ep)
|
|
211
|
+
return ep;
|
|
212
|
+
ep = {
|
|
213
|
+
episodeId: `dark-${ownerMachineId.slice(0, 8)}-${now.toString(36)}`,
|
|
214
|
+
ownerMachineId,
|
|
215
|
+
openedAt: now,
|
|
216
|
+
firstRefusalByTopic: new Map(),
|
|
217
|
+
noticedTopics: new Set(),
|
|
218
|
+
};
|
|
219
|
+
this.episodes.set(ownerMachineId, ep);
|
|
220
|
+
this.deps.journal.append({
|
|
221
|
+
ts: new Date(now).toISOString(),
|
|
222
|
+
kind: 'owner-dark-episode-opened',
|
|
223
|
+
episodeId: ep.episodeId,
|
|
224
|
+
ownerMachineId,
|
|
225
|
+
});
|
|
226
|
+
return ep;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=OwnerDarkLadder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnerDarkLadder.js","sourceRoot":"","sources":["../../src/core/OwnerDarkLadder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,wEAAwE;AACxE,MAAM,CAAC,MAAM,4BAA4B,GACvC,iFAAiF;IACjF,oFAAoF;IACpF,oEAAoE,CAAC;AACvE,MAAM,CAAC,MAAM,4BAA4B,GACvC,iFAAiF;IACjF,2EAA2E,CAAC;AA8D9E,MAAM,OAAO,eAAe;IACT,IAAI,CAAsB;IAC1B,GAAG,CAA4B;IAC/B,KAAK,CAAe;IACrC,0CAA0C;IAClC,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;IACpD,2DAA2D;IACnD,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,QAAQ,GAA2B;QACzC,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;QACV,mBAAmB,EAAE,CAAC;QACtB,wBAAwB,EAAE,CAAC;QAC3B,uBAAuB,EAAE,CAAC;QAC1B,kBAAkB,EAAE,CAAC;QACrB,sBAAsB,EAAE,CAAC;QACzB,UAAU,EAAE,CAAC;QACb,cAAc,EAAE,CAAC;KAClB,CAAC;IAEF,YAAY,GAAmD,EAAE,IAAyB;QACxF,IAAI,CAAC,GAAG,GA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;YAC/B,IAAI,EAAE,2BAA2B;YACjC,SAAS,EAAE,EAAE,CAAC,SAAS;YACvB,cAAc;SACf,CAAC,CAAC;QACH,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
|
@@ -65,6 +65,14 @@ export declare function ROUTING_SPEND_MONEY_CLAUDEMD_SECTION(port: number): stri
|
|
|
65
65
|
* the content-sniff marker used by migrateClaudeMd (Migration Parity).
|
|
66
66
|
*/
|
|
67
67
|
export declare function SESSION_LISTING_HYGIENE_CLAUDEMD_SECTION(port: number): string;
|
|
68
|
+
/**
|
|
69
|
+
* CLAUDE.md awareness block for the ownership-gated spawn seam + duplicate
|
|
70
|
+
* reconciler + owner-dark notices + judgment provenance (ownership-gated-
|
|
71
|
+
* spawn-and-judgment-within-floors spec §3.6 — the spec REVERSES the earlier
|
|
72
|
+
* "flag not heal" framing). The unique heading substring
|
|
73
|
+
* `Duplicate-Session Prevention` is the content-sniff marker.
|
|
74
|
+
*/
|
|
75
|
+
export declare function DUPLICATE_RECONCILER_CLAUDEMD_SECTION(port: number): string;
|
|
68
76
|
export interface MigrationResult {
|
|
69
77
|
/** What was upgraded */
|
|
70
78
|
upgraded: string[];
|
|
@@ -432,6 +440,8 @@ export declare class PostUpdateMigrator {
|
|
|
432
440
|
private migrateCommitmentOwnerBackfill;
|
|
433
441
|
private migratePlaywrightProfilesSeed;
|
|
434
442
|
private migrateMultiMachinePostureReviewDimension;
|
|
443
|
+
private migrateJudgmentWithinFloorsReviewQuestions;
|
|
444
|
+
private migrateJudgmentProvenanceGitignore;
|
|
435
445
|
private migrateThreeStandardsReviewChecks;
|
|
436
446
|
private migrateSpecConvergeAnthropicReviewerDisclosure;
|
|
437
447
|
private migrateCartographerDevGate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostUpdateMigrator.d.ts","sourceRoot":"","sources":["../../src/core/PostUpdateMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA0CH,O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AO,CAAC,oBAAoB;IAgG5B,OAAO,CAAC,qBAAqB;IA8H7B,OAAO,CAAC,2BAA2B;IAoHnC,OAAO,CAAC,iCAAiC;IA6DzC,OAAO,CAAC,+BAA+B;IAkFvC,OAAO,CAAC,iCAAiC;IAkFzC,OAAO,CAAC,uBAAuB;IA0F/B,OAAO,CAAC,uBAAuB;IAgL/B,OAAO,CAAC,4BAA4B;IAuNpC;;;;;;;;;;OAUG;IACH;;;;;;;;;;;OAWG;IAEH,gBAAuB,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAAC,CAsD1E;IAEH;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,8BAA8B;IAiHtC,OAAO,CAAC,uBAAuB;IAwD/B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,8BAA8B;IA6HtC,OAAO,CAAC,+BAA+B;IAuKvC,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,qBAAqB;IAqO7B,OAAO,CAAC,qBAAqB;IAwI7B,OAAO,CAAC,qBAAqB;IAyV7B,OAAO,CAAC,6BAA6B;IAkLrC,OAAO,CAAC,0BAA0B;IAiClC,OAAO,CAAC,0BAA0B;IA8ElC,OAAO,CAAC,0BAA0B;IA8IlC,OAAO,CAAC,gBAAgB;IAmJxB,OAAO,CAAC,6BAA6B;CAoCtC"}
|
|
@@ -211,6 +211,22 @@ export function SESSION_LISTING_HYGIENE_CLAUDEMD_SECTION(port) {
|
|
|
211
211
|
- **When to use** (PROACTIVE — these are the triggers): user asks "why do I see duplicate sessions across my machines?" → read \`pool.duplicateTopics\` first — an EMPTY array means there is no genuine duplicate (matching job names per machine are each machine's own scheduled copy; finished records are excluded by default). "Where did the finished runs go?" → \`?include=all\` (bounded retention prunes older ones). Do NOT count sessions from an \`include=all\` listing when answering "what is running?" — the default view IS the running view.
|
|
212
212
|
`;
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* CLAUDE.md awareness block for the ownership-gated spawn seam + duplicate
|
|
216
|
+
* reconciler + owner-dark notices + judgment provenance (ownership-gated-
|
|
217
|
+
* spawn-and-judgment-within-floors spec §3.6 — the spec REVERSES the earlier
|
|
218
|
+
* "flag not heal" framing). The unique heading substring
|
|
219
|
+
* `Duplicate-Session Prevention` is the content-sniff marker.
|
|
220
|
+
*/
|
|
221
|
+
export function DUPLICATE_RECONCILER_CLAUDEMD_SECTION(port) {
|
|
222
|
+
return `\n### Duplicate-Session Prevention & Auto-Heal (⚗️ ownership-gated spawn — observe-only for now)
|
|
223
|
+
|
|
224
|
+
The 2026-07-10 fix for the same conversation running live on two machines at once. Three layers, all shipping dark/dry-run first (dev-gated; single-machine agents are a strict no-op): a **SpawnAdmission checkpoint** at every session-creating callsite makes the routing verdict BINDING (only the machine that owns a conversation may spawn for it — the router's verdict is consumed, never re-derived); a **duplicate reconciler** on the serving-lease holder detects the same conversation live on ≥2 machines, determines the rightful owner from evidence (deliberate pin → strongest ownership record → registered live run — never "who got the last message"), converges the ownership RECORD, and lets the existing gated closeout close the spare copy; and an **owner-dark honest notice** ("that machine is restarting — resend in a few minutes" / "your message is saved") replaces both silence and bootleg wrong-machine answers when a conversation's home machine is briefly down.
|
|
225
|
+
- **The one status surface:** \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/pool/duplicate-reconciler\` → the reconciler (substrate readiness, per-tick counters, per-topic breaker states, open episodes), the owner-dark ladder (open outage episodes, notice counters), and the spawn checkpoint (mode, error-arm breaker) in one read. 503 = the layer isn't constructed here (single-machine / pool dark) — say so honestly.
|
|
226
|
+
- **Judgment provenance:** every ownership decision the checkpoint/reconciler makes is durably logged (full context machine-local under \`state/judgment-provenance/\`, 14-day retention, never HTTP-served raw). The redacted read: \`curl -H "Authorization: Bearer $AUTH" "http://localhost:${port}/judgment-provenance?limit=50"\` (\`?scope=pool\` merges peers' redacted rows).
|
|
227
|
+
- **When to use** (PROACTIVE — these are the triggers): user asks "why do I see duplicate sessions across machines?" → \`GET /pool/duplicate-reconciler\` (open episodes + breaker) BEFORE guessing; "why did I get a 'machine is restarting — resend' notice?" → the owner-dark ladder's rung-3 honest notice (one per outage per topic, 30-min cooldown); "why didn't a duplicate self-heal?" → read the reconciler's escalations — ambiguous evidence (both copies doing real work, contradictory records) escalates to the ⚠️ Attention topic for YOUR call, never a guess. Audit trails: \`logs/duplicate-reconciler.jsonl\`, \`logs/owner-dark-ladder.jsonl\`.
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
214
230
|
/**
|
|
215
231
|
* CLAUDE.md note for the second wedge-signature family (2026-06-05 EXO
|
|
216
232
|
* incident) + the API fresh-respawn lever. Appended to NEW installs as part of
|
|
@@ -1004,6 +1020,8 @@ export class PostUpdateMigrator {
|
|
|
1004
1020
|
this.migratePlaywrightProfilesSeed(result);
|
|
1005
1021
|
this.migrateMultiMachinePostureReviewDimension(result);
|
|
1006
1022
|
this.migrateConformanceGateAutoInvoke(result);
|
|
1023
|
+
this.migrateJudgmentWithinFloorsReviewQuestions(result);
|
|
1024
|
+
this.migrateJudgmentProvenanceGitignore(result);
|
|
1007
1025
|
this.migrateHonestProgressMessagingDefaults(result);
|
|
1008
1026
|
this.migrateAutonomousHeartbeatDefaults(result);
|
|
1009
1027
|
this.migrateFixtureIdentityQuarantine(result);
|
|
@@ -1413,6 +1431,84 @@ export class PostUpdateMigrator {
|
|
|
1413
1431
|
}
|
|
1414
1432
|
}
|
|
1415
1433
|
}
|
|
1434
|
+
// ── Judgment Within Floors review questions (ownership-gated-spawn-and-
|
|
1435
|
+
// judgment-within-floors spec §3.6, 2026-07-11) ──
|
|
1436
|
+
//
|
|
1437
|
+
// Two agent-installed skill files gained the ratified standard's structural
|
|
1438
|
+
// questions: the spec-converge SKILL's decision-point-classification check
|
|
1439
|
+
// (FD12 verbatim — enforced by write-convergence-tag.mjs's refusal) and the
|
|
1440
|
+
// instar-dev side-effects template's §4b judgment-point question. Both files
|
|
1441
|
+
// are never overwritten by installBuiltinSkills, so this migration is the
|
|
1442
|
+
// ONLY path deployed agents receive them on (Migration Parity). Same
|
|
1443
|
+
// marker-sniffed / fingerprint-guarded / customized-untouched / idempotent
|
|
1444
|
+
// pattern as migrateMultiMachinePostureReviewDimension.
|
|
1445
|
+
migrateJudgmentWithinFloorsReviewQuestions(result) {
|
|
1446
|
+
const files = [
|
|
1447
|
+
{
|
|
1448
|
+
rel: ['skills', 'spec-converge', 'SKILL.md'],
|
|
1449
|
+
marker: 'Decision-point classification (Judgment Within Floors',
|
|
1450
|
+
fingerprint: '# /spec-converge',
|
|
1451
|
+
label: 'spec-converge SKILL (decision-point classification question)',
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
rel: ['skills', 'instar-dev', 'templates', 'side-effects-artifact.md'],
|
|
1455
|
+
marker: '## 4b. Judgment-point check',
|
|
1456
|
+
fingerprint: '## 5. Interactions',
|
|
1457
|
+
label: 'instar-dev side-effects template (§4b judgment-point question)',
|
|
1458
|
+
},
|
|
1459
|
+
];
|
|
1460
|
+
for (const f of files) {
|
|
1461
|
+
try {
|
|
1462
|
+
const installed = path.join(this.config.projectDir, '.claude', ...f.rel);
|
|
1463
|
+
if (!fs.existsSync(installed))
|
|
1464
|
+
continue; // fresh installs get the bundled copy
|
|
1465
|
+
const current = fs.readFileSync(installed, 'utf8');
|
|
1466
|
+
if (current.includes(f.marker))
|
|
1467
|
+
continue; // already updated — idempotent
|
|
1468
|
+
if (!current.includes(f.fingerprint)) {
|
|
1469
|
+
result.skipped.push(`${f.label}: customized — left untouched`);
|
|
1470
|
+
continue;
|
|
1471
|
+
}
|
|
1472
|
+
const bundled = path.join(__dirname, '..', '..', ...f.rel);
|
|
1473
|
+
if (!fs.existsSync(bundled))
|
|
1474
|
+
continue;
|
|
1475
|
+
const next = fs.readFileSync(bundled, 'utf8');
|
|
1476
|
+
if (next.includes(f.marker)) {
|
|
1477
|
+
fs.writeFileSync(installed, next);
|
|
1478
|
+
result.upgraded.push(f.label);
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
catch (err) {
|
|
1482
|
+
result.errors.push(`${f.label}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
// ── Judgment-provenance gitignore (same spec §3.5) ──
|
|
1487
|
+
//
|
|
1488
|
+
// `state/judgment-provenance/` holds machine-local decision-context rows;
|
|
1489
|
+
// agent homes are git repos and `state/` is untracked-but-not-ignored, so
|
|
1490
|
+
// without this a broad `git add` would commit provenance rows cross-machine.
|
|
1491
|
+
// Fresh installs get the entry via ensureGitignore (GITIGNORE_ENTRIES);
|
|
1492
|
+
// existing agents get it here (the `.worktrees/` precedent — regex existence
|
|
1493
|
+
// check, idempotent append).
|
|
1494
|
+
migrateJudgmentProvenanceGitignore(result) {
|
|
1495
|
+
try {
|
|
1496
|
+
const gitignorePath = path.join(this.config.projectDir, '.gitignore');
|
|
1497
|
+
if (!fs.existsSync(gitignorePath))
|
|
1498
|
+
return; // not a git-managed home — nothing to protect
|
|
1499
|
+
const content = fs.readFileSync(gitignorePath, 'utf8');
|
|
1500
|
+
if (/^\s*state\/judgment-provenance\/?\s*$/m.test(content))
|
|
1501
|
+
return; // idempotent
|
|
1502
|
+
const block = (content.endsWith('\n') ? '' : '\n') +
|
|
1503
|
+
'\n# Judgment-call provenance rows (machine-local decision context — never commit)\n' +
|
|
1504
|
+
'state/judgment-provenance/\n';
|
|
1505
|
+
fs.writeFileSync(gitignorePath, content + block);
|
|
1506
|
+
result.upgraded.push('gitignore: state/judgment-provenance/ (machine-local provenance rows)');
|
|
1507
|
+
}
|
|
1508
|
+
catch (err) {
|
|
1509
|
+
result.errors.push(`judgment-provenance gitignore: ${err instanceof Error ? err.message : String(err)}`);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1416
1512
|
// ── Three-standards review-checks (Standards A + B enforcement,
|
|
1417
1513
|
// three-standards-enforcement spec, 2026-07-03) ──
|
|
1418
1514
|
//
|
|
@@ -4718,6 +4814,16 @@ setTimeout(() => process.exit(0), 2000);
|
|
|
4718
4814
|
patched = true;
|
|
4719
4815
|
result.upgraded.push('CLAUDE.md: added Session Listing Hygiene section');
|
|
4720
4816
|
}
|
|
4817
|
+
// Duplicate-Session Prevention & Auto-Heal (ownership-gated-spawn §3.6) —
|
|
4818
|
+
// Agent Awareness Standard + Migration Parity item 3: existing agents learn
|
|
4819
|
+
// the spawn checkpoint, the reconciler + its one status surface, the
|
|
4820
|
+
// owner-dark honest notice, and the judgment-provenance read. Honestly
|
|
4821
|
+
// tagged observe-only (Maturity Honesty). Content-sniffed on the heading.
|
|
4822
|
+
if (!content.includes('Duplicate-Session Prevention')) {
|
|
4823
|
+
content += DUPLICATE_RECONCILER_CLAUDEMD_SECTION(port);
|
|
4824
|
+
patched = true;
|
|
4825
|
+
result.upgraded.push('CLAUDE.md: added Duplicate-Session Prevention & Auto-Heal section');
|
|
4826
|
+
}
|
|
4721
4827
|
// Mesh Self-Healing (U4.2 stale-owner release + U4.4 lease hand-back —
|
|
4722
4828
|
// docs/specs/u4-2-stale-owner-release.md §5 + u4-4-lease-handback.md §5) —
|
|
4723
4829
|
// Agent Awareness Standard + Migration Parity item 3: existing agents learn
|