instar 1.3.747 → 1.3.749
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 +136 -2
- package/dist/commands/server.js.map +1 -1
- package/dist/core/HttpLeaseTransport.d.ts +22 -0
- package/dist/core/HttpLeaseTransport.d.ts.map +1 -1
- package/dist/core/HttpLeaseTransport.js +37 -3
- package/dist/core/HttpLeaseTransport.js.map +1 -1
- package/dist/core/LeaseCoordinator.d.ts +22 -0
- package/dist/core/LeaseCoordinator.d.ts.map +1 -1
- package/dist/core/LeaseCoordinator.js +11 -0
- package/dist/core/LeaseCoordinator.js.map +1 -1
- package/dist/core/MachinePoolRegistry.d.ts +11 -0
- package/dist/core/MachinePoolRegistry.d.ts.map +1 -1
- package/dist/core/MachinePoolRegistry.js +29 -1
- package/dist/core/MachinePoolRegistry.js.map +1 -1
- package/dist/core/PeerPresencePuller.d.ts +26 -1
- package/dist/core/PeerPresencePuller.d.ts.map +1 -1
- package/dist/core/PeerPresencePuller.js +15 -1
- package/dist/core/PeerPresencePuller.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +16 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +80 -5
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +16 -0
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/conversationBindGate.d.ts +62 -0
- package/dist/core/conversationBindGate.d.ts.map +1 -0
- package/dist/core/conversationBindGate.js +83 -0
- package/dist/core/conversationBindGate.js.map +1 -0
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +12 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/machineCoherenceAdvert.d.ts +108 -0
- package/dist/core/machineCoherenceAdvert.d.ts.map +1 -0
- package/dist/core/machineCoherenceAdvert.js +160 -0
- package/dist/core/machineCoherenceAdvert.js.map +1 -0
- package/dist/core/machineCoherenceManifest.d.ts +133 -0
- package/dist/core/machineCoherenceManifest.d.ts.map +1 -0
- package/dist/core/machineCoherenceManifest.js +293 -0
- package/dist/core/machineCoherenceManifest.js.map +1 -0
- package/dist/core/types.d.ts +21 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/monitoring/CommitmentTracker.d.ts.map +1 -1
- package/dist/monitoring/CommitmentTracker.js +4 -1
- package/dist/monitoring/CommitmentTracker.js.map +1 -1
- package/dist/monitoring/MachineCoherenceSentinel.d.ts +240 -0
- package/dist/monitoring/MachineCoherenceSentinel.d.ts.map +1 -0
- package/dist/monitoring/MachineCoherenceSentinel.js +336 -0
- package/dist/monitoring/MachineCoherenceSentinel.js.map +1 -0
- package/dist/monitoring/guardManifest.d.ts.map +1 -1
- package/dist/monitoring/guardManifest.js +25 -0
- package/dist/monitoring/guardManifest.js.map +1 -1
- package/dist/monitoring/machineCoherenceEpisode.d.ts +152 -0
- package/dist/monitoring/machineCoherenceEpisode.d.ts.map +1 -0
- package/dist/monitoring/machineCoherenceEpisode.js +92 -0
- package/dist/monitoring/machineCoherenceEpisode.js.map +1 -0
- package/dist/monitoring/machineCoherenceEpisodeManager.d.ts +210 -0
- package/dist/monitoring/machineCoherenceEpisodeManager.d.ts.map +1 -0
- package/dist/monitoring/machineCoherenceEpisodeManager.js +724 -0
- package/dist/monitoring/machineCoherenceEpisodeManager.js.map +1 -0
- package/dist/monitoring/machineCoherenceEvaluate.d.ts +129 -0
- package/dist/monitoring/machineCoherenceEvaluate.d.ts.map +1 -0
- package/dist/monitoring/machineCoherenceEvaluate.js +183 -0
- package/dist/monitoring/machineCoherenceEvaluate.js.map +1 -0
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +7 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts +1 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +1 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/routes.d.ts +2 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +141 -88
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +65 -65
- package/src/scaffold/templates.ts +7 -1
- package/upgrades/{1.3.747.md → 1.3.748.md} +16 -0
- package/upgrades/1.3.749.md +35 -0
- package/upgrades/side-effects/action-claim-dryrun-audit-mkdir-fix.md +45 -0
- package/upgrades/side-effects/machine-coherence-guard.md +229 -0
- package/upgrades/side-effects/slack-followthrough-generalization.md +49 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Machine-coherence episode — the DURABLE state layer (machine-coherence-guard
|
|
3
|
+
* §4.1 + §4.6). Pure types + the persistence primitives only: episodeId
|
|
4
|
+
* minting, the atomic transition-write, and the read that distinguishes
|
|
5
|
+
* absent / ok / corrupt so the caller can re-baseline (N3/N4). The episode
|
|
6
|
+
* STATE MACHINE — open / join / suspend / resume / reopen / close / the
|
|
7
|
+
* pendingFix lifecycle / the recurrence damper (§4.2–§4.5) — is the CONSUMER
|
|
8
|
+
* of this layer and lands in the next sub-unit; nothing here raises, alarms,
|
|
9
|
+
* or transitions anything.
|
|
10
|
+
*
|
|
11
|
+
* Why a durable layer at all (§4.1): a server restart mid-episode must neither
|
|
12
|
+
* re-alarm nor forget. The file is written on state TRANSITIONS only (never
|
|
13
|
+
* per tick — confirm/resolve/verify COUNTERS stay in-memory, warm-up-absorbed,
|
|
14
|
+
* R2-N3); the recurrence block OUTLIVES episode close so the reopen window has
|
|
15
|
+
* memory (R2-N2).
|
|
16
|
+
*
|
|
17
|
+
* N7: `stateDir` is the per-agent state root — never a shared/global path.
|
|
18
|
+
* Supervision tier (N6): Tier 0 — deterministic file I/O, no LLM anywhere.
|
|
19
|
+
*/
|
|
20
|
+
import type { SkewDimension } from './machineCoherenceEvaluate.js';
|
|
21
|
+
/** The pendingFix three-state lifecycle (§4.2.1-i, R3-M6 / R4-M2). */
|
|
22
|
+
export type PendingFixState = 'proposed' | 'approved-holding' | 'executing-verifying';
|
|
23
|
+
/**
|
|
24
|
+
* A single approved-or-proposed fix bound to ONE proposal (§4.2.1-i cardinality
|
|
25
|
+
* — at most one per episode). The proposal hash + message id is the AUTHORITY:
|
|
26
|
+
* a reply confirms ONLY the exact recorded proposal (display-integrity).
|
|
27
|
+
*/
|
|
28
|
+
export interface PendingFix {
|
|
29
|
+
state: PendingFixState;
|
|
30
|
+
/** The N1 skew-row identity this fix targets. */
|
|
31
|
+
rowIdentity: string;
|
|
32
|
+
/** The manifest flag / dimension key being equalized. */
|
|
33
|
+
key: string;
|
|
34
|
+
dimension: SkewDimension;
|
|
35
|
+
/** The divergent machine whose local config the fix rewrites (§4.2.1-iv). */
|
|
36
|
+
targetMachineId: string;
|
|
37
|
+
/** The concrete effective value the write yields (§4.2.1-ii direction). */
|
|
38
|
+
targetValue: string;
|
|
39
|
+
/** The server-authored proposal message id the reply chains to (§4.2.1-i). */
|
|
40
|
+
proposalMessageId?: string;
|
|
41
|
+
/** Hash over (episodeId|key|targetMachine|targetValue|proposalMessageId) — the
|
|
42
|
+
* reply-recognition authority; nothing executes without matching it. */
|
|
43
|
+
proposalHash: string;
|
|
44
|
+
/** Approval anchor (executing-verifying verify-clock start, R5-L1). */
|
|
45
|
+
approvedAtMs?: number;
|
|
46
|
+
/** First post-restart beat from the divergent machine (verify-clock anchor). */
|
|
47
|
+
postRestartBeatAtMs?: number;
|
|
48
|
+
/** Accumulated suspended time excluded from the executing-verifying clocks
|
|
49
|
+
* (§4.2.1-v; transition-written — suspend-start/resume-end are its writers). */
|
|
50
|
+
accumulatedSuspendedMs?: number;
|
|
51
|
+
/** Set while an executing-verifying fix is inside a suspension (pause anchor). */
|
|
52
|
+
suspendStartedAtMs?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The §4.5 recurrence bookkeeping — a sibling block that OUTLIVES episode close
|
|
56
|
+
* (R2-N2) so the reopen window has memory. All brakes on a budget-exempt HIGH
|
|
57
|
+
* path (M2) live here durably; an in-memory implementation would reset the
|
|
58
|
+
* brake at exactly the restart-heavy moment a boot-flag flap needs it.
|
|
59
|
+
*/
|
|
60
|
+
export interface RecurrenceBlock {
|
|
61
|
+
/** Rolling new-item open timestamps for the per-day cap (maxEpisodeItemsPerDay). */
|
|
62
|
+
newItemTimestamps: number[];
|
|
63
|
+
/** Recently-closed row-identity sets (+ the item id, so a reopen reuses the
|
|
64
|
+
* SAME item/topic) — the reopenWindowMs memory. */
|
|
65
|
+
recentlyClosed: Array<{
|
|
66
|
+
rowIdentities: string[];
|
|
67
|
+
closedAtMs: number;
|
|
68
|
+
itemId?: string;
|
|
69
|
+
}>;
|
|
70
|
+
/** Episode-reopen flapping latch (flappingLatchReopens within the window). */
|
|
71
|
+
reopenLatch?: {
|
|
72
|
+
latched: boolean;
|
|
73
|
+
reopenCount: number;
|
|
74
|
+
windowStartMs: number;
|
|
75
|
+
};
|
|
76
|
+
/** Shared per-episode append budget (episodeAppendBudget within the window);
|
|
77
|
+
* reservedSuspendResumeAtMs guarantees ONE slot per window for the first
|
|
78
|
+
* suspend/resume transition (R4-L6). */
|
|
79
|
+
appendBudget?: {
|
|
80
|
+
appendTimestamps: number[];
|
|
81
|
+
latched: boolean;
|
|
82
|
+
reservedSuspendResumeAtMs?: number;
|
|
83
|
+
};
|
|
84
|
+
/** When the per-day-cap give-up note last fired (once per rolling 24 h). */
|
|
85
|
+
capGiveupAtMs?: number;
|
|
86
|
+
}
|
|
87
|
+
/** A §4.3 close reason — only `restored` may ever claim restoration. */
|
|
88
|
+
export type EpisodeCloseReason = 'restored' | 'suspended-peer-offline' | 'suspended-peer-unverifiable' | 'expired-peer-gone' | 'superseded-by-takeover' | 'resolved-after-reenable' | 'manifest-changed' | 'state-rebaselined';
|
|
89
|
+
/** The durable episode state (§4.1). `mc-<openedAtEpochMs>` id (N4). */
|
|
90
|
+
export interface EpisodeState {
|
|
91
|
+
/** `mc-<openedAtMs>` — machine-local view id, minted per §4.1. */
|
|
92
|
+
episodeId: string;
|
|
93
|
+
openedAtMs: number;
|
|
94
|
+
/** The N1 skew-row identity set this episode covers (§3.4 match key). */
|
|
95
|
+
skewRowIdentities: string[];
|
|
96
|
+
/** When the ONE attention item was raised (R4-M1); absent until raised. */
|
|
97
|
+
itemRaisedAt?: number;
|
|
98
|
+
/** The item id (`machine-coherence:<episodeId>`), once raised. */
|
|
99
|
+
attentionItemId?: string;
|
|
100
|
+
/** Predecessor episode id cross-referenced on a §3.4 takeover (R2-M2). */
|
|
101
|
+
predecessorEpisodeId?: string;
|
|
102
|
+
/** Durable suspended flag (§4.3; stale-until-latch-exit per R4-N5). */
|
|
103
|
+
suspended?: boolean;
|
|
104
|
+
suspendReason?: 'peer-offline' | 'peer-unverifiable';
|
|
105
|
+
/** The durable operator "leave it" ack (R4-N2) — suppresses §4.4 escalation. */
|
|
106
|
+
operatorAck?: boolean;
|
|
107
|
+
/** The single in-flight fix (§4.2.1 cardinality — one per episode). */
|
|
108
|
+
pendingFix?: PendingFix;
|
|
109
|
+
/** The §4.4 escalation-append latch fired flag (one per episode). */
|
|
110
|
+
escalationAppended?: boolean;
|
|
111
|
+
/** Re-open count carried on the episode (§4.5 damper). */
|
|
112
|
+
reopenCount?: number;
|
|
113
|
+
recurrence: RecurrenceBlock;
|
|
114
|
+
}
|
|
115
|
+
/** The on-disk file shape: the open episode (or null) + the outliving recurrence. */
|
|
116
|
+
export interface EpisodeFile {
|
|
117
|
+
version: 1;
|
|
118
|
+
/** The currently-open episode, or null between episodes (recurrence persists). */
|
|
119
|
+
episode: EpisodeState | null;
|
|
120
|
+
/** Outlives episode close — the reopen window's memory (R2-N2). */
|
|
121
|
+
recurrence: RecurrenceBlock;
|
|
122
|
+
}
|
|
123
|
+
/** The result of a durable read — absent / ok / corrupt (§4.6 re-baseline gate). */
|
|
124
|
+
export type EpisodeReadResult = {
|
|
125
|
+
status: 'absent';
|
|
126
|
+
} | {
|
|
127
|
+
status: 'ok';
|
|
128
|
+
file: EpisodeFile;
|
|
129
|
+
} | {
|
|
130
|
+
status: 'corrupt';
|
|
131
|
+
reason: string;
|
|
132
|
+
};
|
|
133
|
+
/** Mint a machine-local episode id (§4.1, N4): `mc-<openedAtEpochMs>`. */
|
|
134
|
+
export declare function mintEpisodeId(openedAtMs: number): string;
|
|
135
|
+
/** The durable file path (N7 — per-agent `state/` subdir, never global). */
|
|
136
|
+
export declare function episodeStatePath(stateDir: string): string;
|
|
137
|
+
/** An empty recurrence block (fresh baseline / no prior memory). */
|
|
138
|
+
export declare function emptyRecurrence(): RecurrenceBlock;
|
|
139
|
+
/**
|
|
140
|
+
* Read the durable episode file, distinguishing absent / ok / corrupt so the
|
|
141
|
+
* caller can re-baseline WITHOUT crashing (§4.6, the GuardPostureProbe pattern).
|
|
142
|
+
* A structurally-invalid file (bad JSON, wrong version, missing required shape)
|
|
143
|
+
* returns `corrupt` with a named reason — never a throw, never a silent {}.
|
|
144
|
+
*/
|
|
145
|
+
export declare function readEpisodeFile(stateDir: string): EpisodeReadResult;
|
|
146
|
+
/**
|
|
147
|
+
* Atomically write the durable episode file (§4.1 transition-write; mirrors
|
|
148
|
+
* `writeConfigAtomic`'s tmp+rename). The `state/` subdir is created if absent.
|
|
149
|
+
* Callers write on TRANSITIONS only — never per tick.
|
|
150
|
+
*/
|
|
151
|
+
export declare function writeEpisodeFile(stateDir: string, file: EpisodeFile): void;
|
|
152
|
+
//# sourceMappingURL=machineCoherenceEpisode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machineCoherenceEpisode.d.ts","sourceRoot":"","sources":["../../src/monitoring/machineCoherenceEpisode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MA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AAW,CAAA;CAAE,GACnC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,oEAAoE;AACpE,wBAAgB,eAAe,IAAI,eAAe,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAgCnE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAM1E"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Machine-coherence episode — the DURABLE state layer (machine-coherence-guard
|
|
3
|
+
* §4.1 + §4.6). Pure types + the persistence primitives only: episodeId
|
|
4
|
+
* minting, the atomic transition-write, and the read that distinguishes
|
|
5
|
+
* absent / ok / corrupt so the caller can re-baseline (N3/N4). The episode
|
|
6
|
+
* STATE MACHINE — open / join / suspend / resume / reopen / close / the
|
|
7
|
+
* pendingFix lifecycle / the recurrence damper (§4.2–§4.5) — is the CONSUMER
|
|
8
|
+
* of this layer and lands in the next sub-unit; nothing here raises, alarms,
|
|
9
|
+
* or transitions anything.
|
|
10
|
+
*
|
|
11
|
+
* Why a durable layer at all (§4.1): a server restart mid-episode must neither
|
|
12
|
+
* re-alarm nor forget. The file is written on state TRANSITIONS only (never
|
|
13
|
+
* per tick — confirm/resolve/verify COUNTERS stay in-memory, warm-up-absorbed,
|
|
14
|
+
* R2-N3); the recurrence block OUTLIVES episode close so the reopen window has
|
|
15
|
+
* memory (R2-N2).
|
|
16
|
+
*
|
|
17
|
+
* N7: `stateDir` is the per-agent state root — never a shared/global path.
|
|
18
|
+
* Supervision tier (N6): Tier 0 — deterministic file I/O, no LLM anywhere.
|
|
19
|
+
*/
|
|
20
|
+
import fs from 'node:fs';
|
|
21
|
+
import path from 'node:path';
|
|
22
|
+
/** Mint a machine-local episode id (§4.1, N4): `mc-<openedAtEpochMs>`. */
|
|
23
|
+
export function mintEpisodeId(openedAtMs) {
|
|
24
|
+
return `mc-${openedAtMs}`;
|
|
25
|
+
}
|
|
26
|
+
/** The durable file path (N7 — per-agent `state/` subdir, never global). */
|
|
27
|
+
export function episodeStatePath(stateDir) {
|
|
28
|
+
return path.join(stateDir, 'state', 'machine-coherence-episode.json');
|
|
29
|
+
}
|
|
30
|
+
/** An empty recurrence block (fresh baseline / no prior memory). */
|
|
31
|
+
export function emptyRecurrence() {
|
|
32
|
+
return { newItemTimestamps: [], recentlyClosed: [] };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read the durable episode file, distinguishing absent / ok / corrupt so the
|
|
36
|
+
* caller can re-baseline WITHOUT crashing (§4.6, the GuardPostureProbe pattern).
|
|
37
|
+
* A structurally-invalid file (bad JSON, wrong version, missing required shape)
|
|
38
|
+
* returns `corrupt` with a named reason — never a throw, never a silent {}.
|
|
39
|
+
*/
|
|
40
|
+
export function readEpisodeFile(stateDir) {
|
|
41
|
+
const p = episodeStatePath(stateDir);
|
|
42
|
+
let raw;
|
|
43
|
+
try {
|
|
44
|
+
if (!fs.existsSync(p))
|
|
45
|
+
return { status: 'absent' };
|
|
46
|
+
raw = fs.readFileSync(p, 'utf8');
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
return { status: 'corrupt', reason: `read-failed: ${e.message}` };
|
|
50
|
+
}
|
|
51
|
+
let parsed;
|
|
52
|
+
try {
|
|
53
|
+
parsed = JSON.parse(raw);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return { status: 'corrupt', reason: 'invalid-json' };
|
|
57
|
+
}
|
|
58
|
+
if (!parsed || typeof parsed !== 'object')
|
|
59
|
+
return { status: 'corrupt', reason: 'not-an-object' };
|
|
60
|
+
const obj = parsed;
|
|
61
|
+
if (obj.version !== 1)
|
|
62
|
+
return { status: 'corrupt', reason: `bad-version:${String(obj.version)}` };
|
|
63
|
+
if (!obj.recurrence || typeof obj.recurrence !== 'object')
|
|
64
|
+
return { status: 'corrupt', reason: 'missing-recurrence' };
|
|
65
|
+
const ep = obj.episode;
|
|
66
|
+
if (ep !== null && ep !== undefined) {
|
|
67
|
+
if (typeof ep !== 'object')
|
|
68
|
+
return { status: 'corrupt', reason: 'episode-not-object' };
|
|
69
|
+
const e = ep;
|
|
70
|
+
if (typeof e.episodeId !== 'string' || typeof e.openedAtMs !== 'number' || !Array.isArray(e.skewRowIdentities)) {
|
|
71
|
+
return { status: 'corrupt', reason: 'episode-shape' };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const rec = obj.recurrence;
|
|
75
|
+
if (!Array.isArray(rec.newItemTimestamps) || !Array.isArray(rec.recentlyClosed)) {
|
|
76
|
+
return { status: 'corrupt', reason: 'recurrence-shape' };
|
|
77
|
+
}
|
|
78
|
+
return { status: 'ok', file: obj };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Atomically write the durable episode file (§4.1 transition-write; mirrors
|
|
82
|
+
* `writeConfigAtomic`'s tmp+rename). The `state/` subdir is created if absent.
|
|
83
|
+
* Callers write on TRANSITIONS only — never per tick.
|
|
84
|
+
*/
|
|
85
|
+
export function writeEpisodeFile(stateDir, file) {
|
|
86
|
+
const p = episodeStatePath(stateDir);
|
|
87
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
88
|
+
const tmp = `${p}.tmp.${process.pid}.${Date.now()}`;
|
|
89
|
+
fs.writeFileSync(tmp, JSON.stringify(file, null, 2) + '\n');
|
|
90
|
+
fs.renameSync(tmp, p);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=machineCoherenceEpisode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAA6B,EAAE,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,IAAiB;IAClE,MAAM,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IACpD,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5D,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MachineCoherenceEpisodeManager — the §4 episode STATE MACHINE
|
|
3
|
+
* (machine-coherence-guard §4.1–§4.4, §4.6). Consumes the durable state layer
|
|
4
|
+
* (`machineCoherenceEpisode.ts`) and the confirmed skew rows from the sentinel's
|
|
5
|
+
* §3.3 confirmation engine, and drives the ONE-item, honest-lifecycle,
|
|
6
|
+
* bounded-recurrence episode contract.
|
|
7
|
+
*
|
|
8
|
+
* SLICE STATUS (C₁b-iii-b lands in sub-units — see the side-effects artifact):
|
|
9
|
+
* - THIS FILE (b1): open / join / suspend / resume / close taxonomy (§4.3:
|
|
10
|
+
* restored / suspended-peer-offline|unverifiable / expired-peer-gone /
|
|
11
|
+
* manifest-changed) + §4.4 single escalation + the operator "leave it" ack +
|
|
12
|
+
* the §4.2 VERBATIM attention-item body render. Durable file owned here
|
|
13
|
+
* (§4.6 corrupt → re-baseline). Emits EFFECTS the sentinel executes; the
|
|
14
|
+
* raise/append/resolve effects are gated on selfIsRaiser && live posture
|
|
15
|
+
* (dry-run + non-raiser run the machine + jsonl, never speak).
|
|
16
|
+
* - NOT YET (b2): §4.5 recurrence damper + per-day cap + the R3-M5 SHARED
|
|
17
|
+
* per-episode append budget (this slice's appends are unbudgeted).
|
|
18
|
+
* - NOT YET (b3): the §4.2.1 pendingFix reply-recognition flow.
|
|
19
|
+
*
|
|
20
|
+
* Supervision tier (N6): Tier 0 — deterministic; no LLM anywhere in this path
|
|
21
|
+
* (reply recognition, when it lands in b3, lives in the CONVERSATIONAL agent,
|
|
22
|
+
* never here — D17 intact).
|
|
23
|
+
*/
|
|
24
|
+
import type { SkewRow } from './machineCoherenceEvaluate.js';
|
|
25
|
+
import type { MachineCoherenceResolvedConfig } from './MachineCoherenceSentinel.js';
|
|
26
|
+
import { type EpisodeCloseReason, type EpisodeState, type PendingFixState } from './machineCoherenceEpisode.js';
|
|
27
|
+
/** One effect the sentinel/server executes (the manager never does I/O beyond
|
|
28
|
+
* its own durable file + jsonl — telegram effects are the caller's). */
|
|
29
|
+
export type EpisodeEffect = {
|
|
30
|
+
kind: 'raise';
|
|
31
|
+
itemId: string;
|
|
32
|
+
title: string;
|
|
33
|
+
summary: string;
|
|
34
|
+
description: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'append';
|
|
37
|
+
itemId: string;
|
|
38
|
+
text: string;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'resolve';
|
|
41
|
+
itemId: string;
|
|
42
|
+
note: string;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'execute-fix';
|
|
45
|
+
itemId: string;
|
|
46
|
+
key: string;
|
|
47
|
+
configPath: string;
|
|
48
|
+
targetValue: string;
|
|
49
|
+
};
|
|
50
|
+
/** The result of an operator approval attempt (§4.2.1-i). */
|
|
51
|
+
export interface FixApprovalResult {
|
|
52
|
+
ok: boolean;
|
|
53
|
+
/** Why an approval was refused (lapsed / not-verified / in-flight / no-fix). */
|
|
54
|
+
reason?: string;
|
|
55
|
+
/** The pendingFix state AFTER a successful transition. */
|
|
56
|
+
state?: PendingFixState;
|
|
57
|
+
}
|
|
58
|
+
/** Per-reconcile inputs the sentinel assembles from its classification pass. */
|
|
59
|
+
export interface EpisodeReconcileInput {
|
|
60
|
+
/** The currently-CONFIRMED skew rows (§3.3 confirmation engine output). */
|
|
61
|
+
confirmedRows: SkewRow[];
|
|
62
|
+
/** Machine ids currently in the `compared` (fresh + clamp-passed) set. */
|
|
63
|
+
comparedMachineIds: Set<string>;
|
|
64
|
+
/** Machine ids currently registered ONLINE (compared ∪ unknown ∪ stale ∪ rejected). */
|
|
65
|
+
onlineMachineIds: Set<string>;
|
|
66
|
+
/** This machine's id. */
|
|
67
|
+
selfMachineId: string;
|
|
68
|
+
/** The §3.4 elected raiser (may be self, a peer, or null). */
|
|
69
|
+
raiserMachineId: string | null;
|
|
70
|
+
/** The serving-lease holder (direction tiebreak; restart-honesty clause). */
|
|
71
|
+
leaseHolderMachineId: string | null;
|
|
72
|
+
/** machineId → operator-facing nickname (registry display label; escaped at render). */
|
|
73
|
+
nicknameOf: (machineId: string) => string;
|
|
74
|
+
now: number;
|
|
75
|
+
}
|
|
76
|
+
/** Observability counters (surfaced on the sentinel status snapshot / route). */
|
|
77
|
+
export interface EpisodeManagerCounters {
|
|
78
|
+
episodesOpened: number;
|
|
79
|
+
wouldRaise: number;
|
|
80
|
+
itemsRaised: number;
|
|
81
|
+
suspends: number;
|
|
82
|
+
resumes: number;
|
|
83
|
+
closes: Record<EpisodeCloseReason, number> | Record<string, number>;
|
|
84
|
+
escalations: number;
|
|
85
|
+
}
|
|
86
|
+
export declare class MachineCoherenceEpisodeManager {
|
|
87
|
+
private readonly stateDir;
|
|
88
|
+
private readonly cfg;
|
|
89
|
+
private file;
|
|
90
|
+
/** In-memory tick counters (R2-N3 — never persisted; warm-up-absorbed on restart). */
|
|
91
|
+
private resolveCleanTicks;
|
|
92
|
+
/** The last self machine id seen on reconcile (for approveFix's raiser==divergent check). */
|
|
93
|
+
private lastSelfMachineId;
|
|
94
|
+
/** The last nickname resolver seen on reconcile (for out-of-tick approveFix notes). */
|
|
95
|
+
private lastNicknameOf?;
|
|
96
|
+
/** In-memory verify-tick counter for an executing-verifying fix (§4.2.1-v). */
|
|
97
|
+
private fixVerifyTicks;
|
|
98
|
+
private counters;
|
|
99
|
+
private readonly logPath;
|
|
100
|
+
constructor(stateDir: string, cfg: MachineCoherenceResolvedConfig);
|
|
101
|
+
/** The item id for an episode (§4.2 — idempotent on the createAttentionItem chokepoint). */
|
|
102
|
+
private itemId;
|
|
103
|
+
/** Only the elected raiser on a LIVE (enabled && !dryRun) guard actually speaks. */
|
|
104
|
+
private speaks;
|
|
105
|
+
/**
|
|
106
|
+
* One reconcile pass (rides the sentinel tick, AFTER confirmation). Returns
|
|
107
|
+
* the effects the caller executes; the durable file + jsonl are written here.
|
|
108
|
+
*/
|
|
109
|
+
reconcile(input: EpisodeReconcileInput): EpisodeEffect[];
|
|
110
|
+
private episodeParticipants;
|
|
111
|
+
/** A row's manifest key retired from the intersection (only meaningful for flag rows). */
|
|
112
|
+
private rowKeyRetired;
|
|
113
|
+
private anyEpisodeKeyStillCompared;
|
|
114
|
+
private openEpisode;
|
|
115
|
+
/** §4.5 reopen: a newly-confirmed skew intersecting a recently-closed episode
|
|
116
|
+
* re-opens it — SAME item un-resolved + one short append, no new item (reopens
|
|
117
|
+
* don't count toward the per-day cap). Latched-flapping bounds the appends. */
|
|
118
|
+
private reopenEpisode;
|
|
119
|
+
private maybeCapGiveup;
|
|
120
|
+
private joinRows;
|
|
121
|
+
private applySuspend;
|
|
122
|
+
/** Record the FIRST auto-proposable row as a `proposed` pendingFix (§4.2.1). A
|
|
123
|
+
* version/manifest/protocol row (no config override to write) and the two
|
|
124
|
+
* excluded flag classes (§4.2.1-iii) are NEVER auto-proposed. */
|
|
125
|
+
private maybeProposeFix;
|
|
126
|
+
/** Only FLAG rows carry a config override to equalize; the two §4.2.1-iii root
|
|
127
|
+
* classes are excluded (manual decision block instead). */
|
|
128
|
+
private isAutoProposable;
|
|
129
|
+
/**
|
|
130
|
+
* Operator approval of the recorded proposal (§4.2.1-i). The caller (the
|
|
131
|
+
* conversational reply path) has ALREADY verified the sender is the topic's
|
|
132
|
+
* verified operator (Know Your Principal) and passes `verifiedOperator`; the
|
|
133
|
+
* `proposalHash` is the display-integrity authority (a reply confirms ONLY the
|
|
134
|
+
* exact recorded proposal). Returns the transition + (for divergent==raiser)
|
|
135
|
+
* an `execute-fix` effect the caller runs through the atomic config funnel.
|
|
136
|
+
*/
|
|
137
|
+
approveFix(args: {
|
|
138
|
+
proposalHash: string;
|
|
139
|
+
verifiedOperator: boolean;
|
|
140
|
+
now: number;
|
|
141
|
+
}): {
|
|
142
|
+
result: FixApprovalResult;
|
|
143
|
+
effects: EpisodeEffect[];
|
|
144
|
+
};
|
|
145
|
+
/** Invalidate a NOT-YET-EXECUTED pendingFix (§4.2.1-i). An executing-verifying
|
|
146
|
+
* fix is exempt (its durable write already happened — R5-N2). */
|
|
147
|
+
private invalidatePendingFix;
|
|
148
|
+
/** §4.2.1-v verify: an executing-verifying fix whose row hasn't cleared within
|
|
149
|
+
* fixVerifyTicks fires ONE loud failure append + clears (episode stays open). */
|
|
150
|
+
private verifyPendingFix;
|
|
151
|
+
private nick;
|
|
152
|
+
/**
|
|
153
|
+
* §4.5 SHARED per-episode append budget (R3-M5): all intra-episode FLAP-class
|
|
154
|
+
* appends (row-join, suspend/resume, takeover re-arm) share one rolling budget
|
|
155
|
+
* (`episodeAppendBudget` per `episodeAppendWindowMs`). ONE slot is RESERVED per
|
|
156
|
+
* window for the first suspend/resume transition (R4-L6 — the clock-changing
|
|
157
|
+
* note is never crowded out). Past the budget the episode enters latched
|
|
158
|
+
* flapping: ONE "flapping — recording silently" note, then jsonl-only until the
|
|
159
|
+
* rolling count falls back below budget (R4-N3/L7). Structural appends
|
|
160
|
+
* (escalation, cap give-up) do NOT ride this budget.
|
|
161
|
+
*/
|
|
162
|
+
private pushFlapAppend;
|
|
163
|
+
/** Lazy rolling-window eviction (R3-L2 — never triggers a write on its own). */
|
|
164
|
+
private pruneRecurrence;
|
|
165
|
+
private findReopenTarget;
|
|
166
|
+
private applyResume;
|
|
167
|
+
private maybeEscalate;
|
|
168
|
+
private closeEpisode;
|
|
169
|
+
private closeNote;
|
|
170
|
+
/**
|
|
171
|
+
* Set (or clear) the durable operator "leave it" ack (§4.2 / R4-N2). Called by
|
|
172
|
+
* the conversational reply path. Suppresses the §4.4 escalation for this
|
|
173
|
+
* episode; cleared on a genuine §4.5 recurrence re-open (b2).
|
|
174
|
+
*/
|
|
175
|
+
setOperatorAck(ack: boolean): void;
|
|
176
|
+
/** A suspended episode past the expiry closes `expired-peer-gone` (§4.3). Called each tick by the sentinel. */
|
|
177
|
+
expireIfStale(now: number, nicknameOf: (m: string) => string): EpisodeEffect[];
|
|
178
|
+
status(): {
|
|
179
|
+
openEpisode: {
|
|
180
|
+
episodeId: string;
|
|
181
|
+
rows: number;
|
|
182
|
+
suspended: boolean;
|
|
183
|
+
itemRaisedAt: string | null;
|
|
184
|
+
pendingFix: {
|
|
185
|
+
state: PendingFixState;
|
|
186
|
+
key: string;
|
|
187
|
+
targetMachineId: string;
|
|
188
|
+
targetValue: string;
|
|
189
|
+
proposalHash: string;
|
|
190
|
+
} | null;
|
|
191
|
+
} | null;
|
|
192
|
+
counters: EpisodeManagerCounters;
|
|
193
|
+
};
|
|
194
|
+
/** The current proposal's hash (the reply-recognition authority), or null. */
|
|
195
|
+
currentProposalHash(): string | null;
|
|
196
|
+
private persist;
|
|
197
|
+
private log;
|
|
198
|
+
/**
|
|
199
|
+
* Render the §4.2 attention-item body VERBATIM (M9 — impact first, plain
|
|
200
|
+
* language; a fix the agent performs on approval; technical detail last). The
|
|
201
|
+
* peer-influenced strings (nicknames, effective values) are clamp-bounded
|
|
202
|
+
* upstream (§4.2 exposure invariant) — rendered as data, never instructions.
|
|
203
|
+
*/
|
|
204
|
+
renderBody(input: EpisodeReconcileInput, ep: EpisodeState): {
|
|
205
|
+
title: string;
|
|
206
|
+
summary: string;
|
|
207
|
+
description: string;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=machineCoherenceEpisodeManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machineCoherenceEpisodeManager.d.ts","sourceRoot":"","sources":["../../src/monitoring/machineCoherenceEpisodeManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAM7D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAML,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EAEjB,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AAEtC;yEACyE;AACzE,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACtF;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAIjD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AASl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