instar 1.3.489 → 1.3.491

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 (175) hide show
  1. package/dashboard/index.html +30 -0
  2. package/dist/commands/server.d.ts.map +1 -1
  3. package/dist/commands/server.js +1124 -28
  4. package/dist/commands/server.js.map +1 -1
  5. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  6. package/dist/config/ConfigDefaults.js +23 -0
  7. package/dist/config/ConfigDefaults.js.map +1 -1
  8. package/dist/core/CodexResumeMap.d.ts +95 -0
  9. package/dist/core/CodexResumeMap.d.ts.map +1 -0
  10. package/dist/core/CodexResumeMap.js +283 -0
  11. package/dist/core/CodexResumeMap.js.map +1 -0
  12. package/dist/core/GuardPostureStore.d.ts +38 -0
  13. package/dist/core/GuardPostureStore.d.ts.map +1 -0
  14. package/dist/core/GuardPostureStore.js +87 -0
  15. package/dist/core/GuardPostureStore.js.map +1 -0
  16. package/dist/core/MachinePoolRegistry.d.ts +16 -0
  17. package/dist/core/MachinePoolRegistry.d.ts.map +1 -1
  18. package/dist/core/MachinePoolRegistry.js +24 -1
  19. package/dist/core/MachinePoolRegistry.js.map +1 -1
  20. package/dist/core/MeshRpc.d.ts +3 -0
  21. package/dist/core/MeshRpc.d.ts.map +1 -1
  22. package/dist/core/MeshRpc.js +5 -0
  23. package/dist/core/MeshRpc.js.map +1 -1
  24. package/dist/core/ModelSwapService.d.ts +26 -11
  25. package/dist/core/ModelSwapService.d.ts.map +1 -1
  26. package/dist/core/ModelSwapService.js +59 -21
  27. package/dist/core/ModelSwapService.js.map +1 -1
  28. package/dist/core/PeerPresencePuller.d.ts +9 -0
  29. package/dist/core/PeerPresencePuller.d.ts.map +1 -1
  30. package/dist/core/PeerPresencePuller.js +1 -1
  31. package/dist/core/PeerPresencePuller.js.map +1 -1
  32. package/dist/core/PostUpdateMigrator.d.ts +16 -0
  33. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  34. package/dist/core/PostUpdateMigrator.js +92 -4
  35. package/dist/core/PostUpdateMigrator.js.map +1 -1
  36. package/dist/core/SessionManager.d.ts +4 -0
  37. package/dist/core/SessionManager.d.ts.map +1 -1
  38. package/dist/core/SessionManager.js +3 -0
  39. package/dist/core/SessionManager.js.map +1 -1
  40. package/dist/core/SessionRefresh.d.ts +36 -7
  41. package/dist/core/SessionRefresh.d.ts.map +1 -1
  42. package/dist/core/SessionRefresh.js +90 -29
  43. package/dist/core/SessionRefresh.js.map +1 -1
  44. package/dist/core/TopicProfileOrchestrator.d.ts +480 -0
  45. package/dist/core/TopicProfileOrchestrator.d.ts.map +1 -0
  46. package/dist/core/TopicProfileOrchestrator.js +1404 -0
  47. package/dist/core/TopicProfileOrchestrator.js.map +1 -0
  48. package/dist/core/TopicProfileResolver.d.ts +104 -0
  49. package/dist/core/TopicProfileResolver.d.ts.map +1 -0
  50. package/dist/core/TopicProfileResolver.js +231 -0
  51. package/dist/core/TopicProfileResolver.js.map +1 -0
  52. package/dist/core/TopicProfileStore.d.ts +308 -0
  53. package/dist/core/TopicProfileStore.d.ts.map +1 -0
  54. package/dist/core/TopicProfileStore.js +781 -0
  55. package/dist/core/TopicProfileStore.js.map +1 -0
  56. package/dist/core/TopicProfileTransferCarrier.d.ts +227 -0
  57. package/dist/core/TopicProfileTransferCarrier.d.ts.map +1 -0
  58. package/dist/core/TopicProfileTransferCarrier.js +533 -0
  59. package/dist/core/TopicProfileTransferCarrier.js.map +1 -0
  60. package/dist/core/TopicResumeMap.d.ts +67 -1
  61. package/dist/core/TopicResumeMap.d.ts.map +1 -1
  62. package/dist/core/TopicResumeMap.js +114 -1
  63. package/dist/core/TopicResumeMap.js.map +1 -1
  64. package/dist/core/classifyProfileChange.d.ts +83 -0
  65. package/dist/core/classifyProfileChange.d.ts.map +1 -0
  66. package/dist/core/classifyProfileChange.js +274 -0
  67. package/dist/core/classifyProfileChange.js.map +1 -0
  68. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  69. package/dist/core/devGatedFeatures.js +6 -0
  70. package/dist/core/devGatedFeatures.js.map +1 -1
  71. package/dist/core/frameworkSessionLaunch.d.ts +26 -0
  72. package/dist/core/frameworkSessionLaunch.d.ts.map +1 -1
  73. package/dist/core/frameworkSessionLaunch.js +58 -0
  74. package/dist/core/frameworkSessionLaunch.js.map +1 -1
  75. package/dist/core/slackRefreshBinding.d.ts +83 -0
  76. package/dist/core/slackRefreshBinding.d.ts.map +1 -0
  77. package/dist/core/slackRefreshBinding.js +54 -0
  78. package/dist/core/slackRefreshBinding.js.map +1 -0
  79. package/dist/core/topicProfileIngress.d.ts +128 -0
  80. package/dist/core/topicProfileIngress.d.ts.map +1 -0
  81. package/dist/core/topicProfileIngress.js +249 -0
  82. package/dist/core/topicProfileIngress.js.map +1 -0
  83. package/dist/core/topicProfileValidation.d.ts +109 -0
  84. package/dist/core/topicProfileValidation.d.ts.map +1 -0
  85. package/dist/core/topicProfileValidation.js +247 -0
  86. package/dist/core/topicProfileValidation.js.map +1 -0
  87. package/dist/core/topicProfileWriteSurface.d.ts +222 -0
  88. package/dist/core/topicProfileWriteSurface.d.ts.map +1 -0
  89. package/dist/core/topicProfileWriteSurface.js +631 -0
  90. package/dist/core/topicProfileWriteSurface.js.map +1 -0
  91. package/dist/core/types.d.ts +66 -0
  92. package/dist/core/types.d.ts.map +1 -1
  93. package/dist/core/types.js.map +1 -1
  94. package/dist/lifeline/TelegramLifeline.d.ts.map +1 -1
  95. package/dist/lifeline/TelegramLifeline.js +6 -0
  96. package/dist/lifeline/TelegramLifeline.js.map +1 -1
  97. package/dist/messaging/TelegramAdapter.d.ts +10 -1
  98. package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
  99. package/dist/messaging/TelegramAdapter.js +41 -1
  100. package/dist/messaging/TelegramAdapter.js.map +1 -1
  101. package/dist/monitoring/ActiveWorkSilenceSentinel.d.ts +8 -0
  102. package/dist/monitoring/ActiveWorkSilenceSentinel.d.ts.map +1 -1
  103. package/dist/monitoring/ActiveWorkSilenceSentinel.js +8 -0
  104. package/dist/monitoring/ActiveWorkSilenceSentinel.js.map +1 -1
  105. package/dist/monitoring/ContextWedgeSentinel.d.ts +8 -0
  106. package/dist/monitoring/ContextWedgeSentinel.d.ts.map +1 -1
  107. package/dist/monitoring/ContextWedgeSentinel.js +8 -0
  108. package/dist/monitoring/ContextWedgeSentinel.js.map +1 -1
  109. package/dist/monitoring/GuardPostureTripwire.d.ts +3 -27
  110. package/dist/monitoring/GuardPostureTripwire.d.ts.map +1 -1
  111. package/dist/monitoring/GuardPostureTripwire.js +8 -76
  112. package/dist/monitoring/GuardPostureTripwire.js.map +1 -1
  113. package/dist/monitoring/GuardRegistry.d.ts +48 -0
  114. package/dist/monitoring/GuardRegistry.d.ts.map +1 -0
  115. package/dist/monitoring/GuardRegistry.js +49 -0
  116. package/dist/monitoring/GuardRegistry.js.map +1 -0
  117. package/dist/monitoring/SessionReaper.d.ts +7 -0
  118. package/dist/monitoring/SessionReaper.d.ts.map +1 -1
  119. package/dist/monitoring/SessionReaper.js +9 -0
  120. package/dist/monitoring/SessionReaper.js.map +1 -1
  121. package/dist/monitoring/SessionWatchdog.d.ts +8 -0
  122. package/dist/monitoring/SessionWatchdog.d.ts.map +1 -1
  123. package/dist/monitoring/SessionWatchdog.js +8 -0
  124. package/dist/monitoring/SessionWatchdog.js.map +1 -1
  125. package/dist/monitoring/SocketDisconnectSentinel.d.ts +8 -0
  126. package/dist/monitoring/SocketDisconnectSentinel.d.ts.map +1 -1
  127. package/dist/monitoring/SocketDisconnectSentinel.js +8 -0
  128. package/dist/monitoring/SocketDisconnectSentinel.js.map +1 -1
  129. package/dist/monitoring/guardManifest.d.ts +67 -0
  130. package/dist/monitoring/guardManifest.d.ts.map +1 -0
  131. package/dist/monitoring/guardManifest.js +536 -0
  132. package/dist/monitoring/guardManifest.js.map +1 -0
  133. package/dist/monitoring/guardPosture.d.ts +77 -0
  134. package/dist/monitoring/guardPosture.d.ts.map +1 -0
  135. package/dist/monitoring/guardPosture.js +198 -0
  136. package/dist/monitoring/guardPosture.js.map +1 -0
  137. package/dist/monitoring/guardPostureView.d.ts +100 -0
  138. package/dist/monitoring/guardPostureView.d.ts.map +1 -0
  139. package/dist/monitoring/guardPostureView.js +294 -0
  140. package/dist/monitoring/guardPostureView.js.map +1 -0
  141. package/dist/monitoring/probes/GuardPostureProbe.d.ts +82 -0
  142. package/dist/monitoring/probes/GuardPostureProbe.d.ts.map +1 -0
  143. package/dist/monitoring/probes/GuardPostureProbe.js +384 -0
  144. package/dist/monitoring/probes/GuardPostureProbe.js.map +1 -0
  145. package/dist/scaffold/templates.d.ts.map +1 -1
  146. package/dist/scaffold/templates.js +18 -0
  147. package/dist/scaffold/templates.js.map +1 -1
  148. package/dist/scheduler/JobScheduler.d.ts +10 -0
  149. package/dist/scheduler/JobScheduler.d.ts.map +1 -1
  150. package/dist/scheduler/JobScheduler.js +12 -0
  151. package/dist/scheduler/JobScheduler.js.map +1 -1
  152. package/dist/server/AgentServer.d.ts +40 -0
  153. package/dist/server/AgentServer.d.ts.map +1 -1
  154. package/dist/server/AgentServer.js +54 -3
  155. package/dist/server/AgentServer.js.map +1 -1
  156. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  157. package/dist/server/CapabilityIndex.js +12 -0
  158. package/dist/server/CapabilityIndex.js.map +1 -1
  159. package/dist/server/peerUrlGuard.d.ts +35 -0
  160. package/dist/server/peerUrlGuard.d.ts.map +1 -0
  161. package/dist/server/peerUrlGuard.js +93 -0
  162. package/dist/server/peerUrlGuard.js.map +1 -0
  163. package/dist/server/routes.d.ts +31 -0
  164. package/dist/server/routes.d.ts.map +1 -1
  165. package/dist/server/routes.js +407 -1
  166. package/dist/server/routes.js.map +1 -1
  167. package/package.json +3 -2
  168. package/scripts/lint-guard-manifest.js +264 -0
  169. package/src/data/builtin-manifest.json +67 -67
  170. package/src/data/state-coherence-registry.json +54 -18
  171. package/src/scaffold/templates.ts +18 -0
  172. package/upgrades/1.3.490.md +34 -0
  173. package/upgrades/1.3.491.md +37 -0
  174. package/upgrades/side-effects/guard-posture-endpoint.md +101 -0
  175. package/upgrades/side-effects/topic-profile.md +142 -0
@@ -0,0 +1,480 @@
1
+ /**
2
+ * TopicProfileOrchestrator — the §8 orchestration core of TOPIC-PROFILE-SPEC:
3
+ * the debounce / idle-confirmation / kill-respawn machinery that applies a
4
+ * profile change SAFELY, plus the §10.4 spawn-failure circuit breaker and the
5
+ * §14 dry-run shadow regime.
6
+ *
7
+ * Spec clauses owned here (each enforced in code, not prose):
8
+ *
9
+ * §8 two-phase lock — the per-topic store lock is held in TWO SHORT PHASES,
10
+ * never across the debounce window: WRITE (mutate → arm/extend debounce →
11
+ * release) and RESPAWN (re-acquire → re-resolve AT THIS MOMENT → re-confirm
12
+ * idle → [kill → respawn] → release). Re-resolution + idle re-confirm +
13
+ * net-unchanged skip run at DEQUEUE time inside the lock (round-4).
14
+ *
15
+ * Debounce slots — per-topic pending slot + trailing-edge timer; the store
16
+ * write is immediate, only the RESPAWN is debounced. N changes in the
17
+ * window collapse to ONE respawn against the final resolved profile; a
18
+ * net-unchanged sequence fires ZERO respawns and closes its loop out loud.
19
+ * The framework-switch arm carries the heavier window.
20
+ *
21
+ * Idle is a precondition re-checked at kill time, never a value carried from
22
+ * classification (round-2 TOCTOU). The read is three-valued; at kill time
23
+ * UNCONFIRMED IS BUSY (defer) — never permission to kill. Pane-idle is not
24
+ * task-done: the autonomous-session registry is consulted, and an active
25
+ * autonomous/time-boxed run is busy until it completes (only the explicit
26
+ * "switch now" confirm overrides). PROTECTED SESSIONS ARE NEVER
27
+ * PROFILE-KILLED — and "switch now" never overrides protection (round-5).
28
+ *
29
+ * Kill-path precision — a same-framework resume respawn kills via the
30
+ * resume-saving path (the re-save is wanted); a FRESH respawn PARKS (never
31
+ * deletes) BOTH resume stores' entries before the kill and sets a
32
+ * topic-scoped, time-bounded durable suppression marker so no writer
33
+ * (heartbeat, post-spawn save, kill listener, shutdown save) can re-persist
34
+ * a stale id during the window — the gates are installed at the resume-map
35
+ * chokepoints via claudeResumeWriteGate()/codexResumeWriteGate().
36
+ *
37
+ * Disclosure-of-record — EVERY accepted write discloses; writes inside the
38
+ * active debounce window coalesce into ONE delta-carrying disclosure
39
+ * ("was: <pre-burst> → now: <final> (N changes)"); a per-topic rate cap
40
+ * backstops outside the window with a delta-carrying overflow summary; the
41
+ * undo snapshot (store.mutate shiftPrevious) moves once per disclosed
42
+ * burst — undo always restores the profile the operator last saw disclosed
43
+ * (R7-4). Disclosures carry the audit seq and set the relay dedup bypass.
44
+ *
45
+ * Global stagger — profile-triggered respawns share a global concurrency cap
46
+ * (max K in flight, FIFO queue); same-cwd codex spawns are serialized so
47
+ * two codex sessions never spawn inside the same capture fence window
48
+ * (bounded wait: prior fence resolves or the RESPAWN-phase TTL, round-7).
49
+ *
50
+ * §9 interplay — only operator pin writes arm the respawn debounce;
51
+ * escalation consults read-only and serializes through runExclusive().
52
+ * Any profile-triggered kill clears the topic's escalation marker and
53
+ * releases its lease BEFORE computing expected-live; expected-live =
54
+ * resolved baseline ⊕ any active escalation marker (no controller
55
+ * ping-pong).
56
+ *
57
+ * §10.4 breaker — LIVE in every regime (exempt from BOTH `enabled` and
58
+ * `dryRun`; legacy-path failures count when attributable). Attribution is
59
+ * an ALLOWLIST (cli-not-found / launch-arg-rejected /
60
+ * model-rejected-by-account); ambient classes never increment; the counter
61
+ * resets on any successful spawn. A trip parks the profile
62
+ * intended-but-unhealthy, reverts to last-known-good (or default),
63
+ * un-parks the matching-framework resume entry (none-loss when the
64
+ * transcript survives), notifies the operator, audits
65
+ * system:circuit-breaker, and respawns IMMEDIATELY (the one keep-working
66
+ * exception to regime gating). Re-apply of the same recently-tripped
67
+ * profile requires an explicit cooldown confirm; switch-now,
68
+ * propose-confirm and the cooldown confirm share ONE armed slot per topic.
69
+ *
70
+ * §14 dry-run shadow — under `enabled && dryRun`, NEW-axis writes persist to
71
+ * the shadow intendedProfile field that resolution ignores ([dry-run]
72
+ * notice); the true→false flip CLEARS every shadow (never promotes) with
73
+ * one coalesced expired-intents notice; exempted framework writes and the
74
+ * recovery writes (re-apply / clear) are always LIVE store writes in every
75
+ * regime, with the recovery writes' APPLICATION arm regime-governed (no
76
+ * profile-triggered kill outside fully-live; told out loud).
77
+ *
78
+ * Dependency-injected throughout (ModelSwapService house style): every
79
+ * side-effecting surface is a constructor dep; pure logic
80
+ * (classifyProfileChange, profilesEqual) is imported directly.
81
+ */
82
+ import { type IdleReading, type SwapMethod } from './classifyProfileChange.js';
83
+ import { type TopicProfileStore } from './TopicProfileStore.js';
84
+ import type { ResolvedTopicProfile } from './TopicProfileResolver.js';
85
+ import type { ProfileModelTier, ThinkingMode, ValidatedProfilePatch } from './topicProfileValidation.js';
86
+ import type { CodexSpawnFence, FenceCaptureResult } from './CodexResumeMap.js';
87
+ import type { IntelligenceFramework } from './intelligenceProviderFactory.js';
88
+ export type ProfileWriteOrigin = 'conversational' | 'slash' | 'http' | 'transfer' | 'system';
89
+ /**
90
+ * §10.4 failure classes. ONLY the allowlist counts toward the breaker —
91
+ * ambient classes (conditions that would fail ANY profile) never increment,
92
+ * and resume-id-mismatch is the resume map's failure, not the profile's.
93
+ */
94
+ export type ProfileSpawnFailureClass = 'cli-not-found' | 'launch-arg-rejected' | 'model-rejected-by-account' | 'resume-id-mismatch' | 'quota' | 'tmux' | 'disk' | 'unknown';
95
+ /** The launch characteristics actually applied to a live session at spawn. */
96
+ export interface AppliedProfile {
97
+ framework: IntelligenceFramework;
98
+ /** Concrete model id, or null for the account default. */
99
+ model: string | null;
100
+ /** Tier shape of the pin that produced the model, when tier-shaped. */
101
+ modelTier: ProfileModelTier | null;
102
+ thinkingMode: ThinkingMode | null;
103
+ }
104
+ export interface OrchTopicSession {
105
+ sessionName: string;
106
+ cwd: string;
107
+ }
108
+ export interface RespawnSpawnOutcome {
109
+ ok: boolean;
110
+ failureClass?: ProfileSpawnFailureClass;
111
+ }
112
+ /** The narrow session surface the orchestrator is allowed to touch. */
113
+ export interface OrchestratorSessionPort {
114
+ getSessionForTopic(topicKey: string): OrchTopicSession | null;
115
+ /** All live topic-bound sessions (boot reconcile sweep). */
116
+ listTopicSessions(): Array<{
117
+ topicKey: string;
118
+ sessionName: string;
119
+ }>;
120
+ /** FABLE capture-pane idle confirmation — three-valued (§8). */
121
+ readIdle(sessionName: string): IdleReading;
122
+ /**
123
+ * Kill via SessionManager.killSession — fires beforeSessionKill, so the
124
+ * resume re-save happens (WANTED for a same-framework resume respawn).
125
+ */
126
+ killForResume(sessionName: string): Promise<boolean>;
127
+ /**
128
+ * Fresh-respawn kill: direct tmux path or suppression-set kill — NO resume
129
+ * re-save may fire (the §8 symmetric-poisoning rule; the durable
130
+ * suppression marker backstops writers that fire anyway).
131
+ */
132
+ killFresh(sessionName: string): Promise<boolean>;
133
+ /** Spawn the topic's session with the resolved profile. */
134
+ spawn(topicKey: string, resolved: ResolvedTopicProfile, directive: {
135
+ method: SwapMethod;
136
+ resumeId?: string;
137
+ }): Promise<RespawnSpawnOutcome>;
138
+ }
139
+ export interface ClaudeResumePort {
140
+ /** §8 pre-kill predicate: hook-provenance resume readiness. */
141
+ ready(topicKey: string): boolean;
142
+ resumeId(topicKey: string): string | null;
143
+ park(topicKey: string, reason: string): void;
144
+ unpark(topicKey: string): boolean;
145
+ }
146
+ export interface CodexResumePort {
147
+ get(topicKey: string): string | null;
148
+ captureAtKill(topicKey: string, sessionName: string, fence: CodexSpawnFence): Promise<FenceCaptureResult>;
149
+ park(topicKey: string, reason: string): void;
150
+ unpark(topicKey: string): boolean;
151
+ }
152
+ /** §9 — FABLE's ephemeral last-applied-tier marker, read-only + clear. */
153
+ export interface EscalationPort {
154
+ /** The active escalation marker for a topic (escalated model id), or null. */
155
+ activeMarker(topicKey: string): {
156
+ model: string;
157
+ } | null;
158
+ /** All topics holding markers (boot-sweep stale-marker clear). */
159
+ listMarkerTopics(): string[];
160
+ /** Profile-triggered kill / stale sweep: clear marker + release the lease. */
161
+ clearMarkerAndReleaseLease(topicKey: string): void;
162
+ }
163
+ /** The §7 in-flight row — the FABLE model-swap route (tier only, never an id). */
164
+ export interface InFlightSwapPort {
165
+ swap(sessionName: string, tier: 'default' | 'escalated'): Promise<{
166
+ status: 'swapped' | 'unconfirmed' | 'dry-run' | 'noop' | 'refused';
167
+ reason?: string;
168
+ }>;
169
+ }
170
+ /** §6/§14 verification markers feeding the classifier's contingency flags. */
171
+ export interface ProfileVerificationFlags {
172
+ inFlightSwapConfirmedRecently: boolean;
173
+ thinkingOffOnResumeVerified: boolean;
174
+ thinkingLevelResumeVerified: boolean;
175
+ crossModelResumeVerified: boolean;
176
+ claudeThinkingControlAvailable: boolean;
177
+ }
178
+ export interface OrchestratorConfig {
179
+ /** RESOLVED gate value (DEV_GATED_FEATURES / operator override). */
180
+ enabled: boolean;
181
+ dryRun: boolean;
182
+ respawnDebounceMs: number;
183
+ frameworkSwitchDebounceMs: number;
184
+ maxConcurrentProfileRespawns: number;
185
+ spawnFailureBreakerThreshold: number;
186
+ switchNowConfirmTtlMs: number;
187
+ }
188
+ export interface DisclosureMeta {
189
+ /** Relay exact-duplicate suppression bypass (§8 — disclosure-of-record). */
190
+ allowDuplicate: true;
191
+ auditSeq: number;
192
+ }
193
+ export interface TopicProfileOrchestratorDeps {
194
+ store: TopicProfileStore;
195
+ /** The §5.2 single resolution point (in-memory, O(1)). */
196
+ resolveProfile: (topicKey: string) => ResolvedTopicProfile;
197
+ sessions: OrchestratorSessionPort;
198
+ claudeResume: ClaudeResumePort;
199
+ codexResume: CodexResumePort;
200
+ escalation: EscalationPort;
201
+ inFlightSwap: InFlightSwapPort;
202
+ /** §8 — an active autonomous/time-boxed session is busy until it completes. */
203
+ autonomousActive: (topicKey: string) => boolean;
204
+ isProtectedSession: (sessionName: string) => boolean;
205
+ /** The codex spawn fence recorded at launch for a topic (§7), or null. */
206
+ codexFence: (topicKey: string) => CodexSpawnFence | null;
207
+ verification: () => ProfileVerificationFlags;
208
+ getConfig: () => OrchestratorConfig;
209
+ /** Platform-routed disclosure to the topic's owning conversation (§10.5). */
210
+ disclose: (topicKey: string, text: string, meta: DisclosureMeta) => void;
211
+ /** Structured audit sink → logs/topic-profile-changes.jsonl (§10.3). */
212
+ audit: (event: Record<string, unknown>) => void;
213
+ /** Durable orchestrator side-state (lastApplied / suppressions / trips). */
214
+ stateFilePath: string;
215
+ now?: () => number;
216
+ }
217
+ export interface ProfileWriteAttribution {
218
+ /** Server-verified principal (or 'api-token' / 'system:*') — never body-supplied. */
219
+ updatedBy: string;
220
+ origin: ProfileWriteOrigin;
221
+ }
222
+ export type ProfileWriteOutcome = {
223
+ outcome: 'applied';
224
+ reply: string;
225
+ auditSeq: number;
226
+ supersededParked: boolean;
227
+ } | {
228
+ outcome: 'shadow-recorded';
229
+ reply: string;
230
+ auditSeq: number;
231
+ } | {
232
+ outcome: 'no-change';
233
+ reply: string;
234
+ } | {
235
+ outcome: 'refused';
236
+ reply: string;
237
+ reason: string;
238
+ };
239
+ export type RecoveryWriteOutcome = {
240
+ outcome: 'applied';
241
+ reply: string;
242
+ } | {
243
+ outcome: 'confirm-required';
244
+ reply: string;
245
+ } | {
246
+ outcome: 'refused';
247
+ reply: string;
248
+ reason: string;
249
+ };
250
+ type ConfirmKind = 'switch-now' | 'cooldown-reapply' | 'propose';
251
+ export declare class TopicProfileOrchestrator {
252
+ private readonly deps;
253
+ private readonly now;
254
+ private readonly pendingSlots;
255
+ private readonly confirmSlots;
256
+ private readonly confirmArmTimes;
257
+ private confirmArmCooldownUntil;
258
+ /** FIFO respawn queue + global stagger cap (§8). */
259
+ private readonly respawnQueue;
260
+ private inFlightRespawns;
261
+ private readonly activeRespawnTopics;
262
+ private drainWakeTimer;
263
+ /** Same-cwd codex fence windows (cwd → until epoch ms). */
264
+ private readonly codexFenceWindows;
265
+ /** Per-topic immediate-disclosure timestamps + overflow accumulation. */
266
+ private readonly disclosureTimes;
267
+ private readonly overflow;
268
+ private durable;
269
+ private auditSeq;
270
+ private lastSeenDryRun;
271
+ constructor(deps: TopicProfileOrchestratorDeps);
272
+ /**
273
+ * Apply a validated NEW-axis profile patch under the current regime.
274
+ * - fully-live (`enabled && !dryRun`): live mutate + debounce-armed respawn.
275
+ * - `enabled && dryRun`: shadow intendedProfile write, `[dry-run]` notice —
276
+ * resolution never reads it, the flip never promotes it (§14).
277
+ * - `!enabled`: REFUSED (existing pins stay honored on read) — EXCEPT a
278
+ * clear-only patch, which is a §5.2(b) recovery write, live everywhere.
279
+ * The caller has already run §10.1 identity + §10.2 validation; this method
280
+ * re-enforces the store-side invariants regardless (defense in depth).
281
+ */
282
+ requestProfileChange(topicKey: number | string, patch: ValidatedProfilePatch, attribution: ProfileWriteAttribution): Promise<ProfileWriteOutcome>;
283
+ /**
284
+ * §5.2(d) — an exempted framework-arm write (the legacy `/route` lane):
285
+ * ALWAYS a live store write regardless of `enabled`/`dryRun`. The legacy
286
+ * path performs its own immediate respawn; NO §8 machinery is engaged here
287
+ * — but under `enabled && dryRun` the §8 orchestration runs in SHADOW,
288
+ * logging the `[dry-run]` decisions it WOULD have made (audit-only, never
289
+ * operator-facing). Returns the disclosure-of-record metadata the legacy
290
+ * reply must carry (audit stamp + dedup bypass + parked-supersession name).
291
+ */
292
+ applyExemptFrameworkWrite(topicKey: number | string, framework: IntelligenceFramework, attribution: ProfileWriteAttribution): Promise<{
293
+ changed: boolean;
294
+ auditSeq: number;
295
+ supersededParked: boolean;
296
+ /** Append to the legacy reply when non-null (R10-3/R13). */
297
+ supersessionNote: string | null;
298
+ /** Stamp + dedup-bypass the legacy reply with these (R13). */
299
+ meta: DisclosureMeta;
300
+ }>;
301
+ /**
302
+ * §5.2(b) recovery writes — re-apply a §10.4 parked pin, or clear. LIVE in
303
+ * every regime (never refused as a new pin, never shadowed). The
304
+ * APPLICATION arm is regime-governed: outside fully-live there is NO
305
+ * profile-triggered kill — the write applies at the next natural spawn /
306
+ * boot sweep, and the confirmation says so out loud.
307
+ */
308
+ requestRecoveryWrite(topicKey: number | string, action: 'reapply' | 'clear', attribution: ProfileWriteAttribution, opts?: {
309
+ confirmed?: boolean;
310
+ }): Promise<RecoveryWriteOutcome>;
311
+ private applyLiveWrite;
312
+ /**
313
+ * §8 write-surface seam (ProfileOrchestratorLike). Called by the write
314
+ * surface AFTER it has performed the live store write in the fully-live
315
+ * regime — the surface owns the mutate, the orchestrator owns the debounced,
316
+ * idle-gated respawn. Re-resolves nothing here: it arms the per-topic
317
+ * debounce window (heavier window when the framework axis changed) and the
318
+ * trailing-edge fire enqueues the §8 respawn. A no-op when the orchestrator
319
+ * is not in the fully-live regime (the surface only calls this when fully-live,
320
+ * but the guard keeps the seam safe under a regime flip mid-burst).
321
+ */
322
+ onProfileWrite(topicKey: number | string, info: {
323
+ frameworkChanged: boolean;
324
+ origin: string;
325
+ }): void;
326
+ private armRespawn;
327
+ private onDebounceFire;
328
+ private enqueueRespawn;
329
+ /** Global stagger: max K respawns in flight; FIFO; codex same-cwd serialized. */
330
+ private drainQueue;
331
+ private codexBlockedUntil;
332
+ private scheduleDrainWake;
333
+ /**
334
+ * RESPAWN phase — re-acquire the per-topic lock, re-resolve AT THIS MOMENT,
335
+ * re-confirm idle, then [kill → respawn]. TTL-bounded: a wedged kill/spawn
336
+ * aborts the phase and leaves the divergence to the reconcile sweep.
337
+ */
338
+ private executeRespawn;
339
+ private respawnPhase;
340
+ private deferSlot;
341
+ private teardownSlot;
342
+ /** Terminal disclosure: coalesced burst delta + the honest swap line. */
343
+ private discloseTerminal;
344
+ /**
345
+ * Arm a confirm. All three confirm surfaces (switch-now, propose-confirm,
346
+ * cooldown-reapply) share THIS one slot per topic: arming supersedes the
347
+ * prior armed confirm (the §10.1(c) re-echo discipline — a bare "yes" can
348
+ * only ever fire the most-recently-echoed confirm). Re-proposals are
349
+ * rate-bounded; churn past the bound tears the slot down for a cooldown
350
+ * and is audited as a suspicion signal.
351
+ */
352
+ armConfirm(topicKey: number | string, kind: ConfirmKind, echo: string, run: () => Promise<string>): boolean;
353
+ /** Record the platform message id of the rendered echo (§10.1 ordering). */
354
+ attachConfirmEchoMessageId(topicKey: number | string, messageId: number): void;
355
+ /**
356
+ * Fire the armed confirm. The caller (server-side ingress parse) has
357
+ * already established first-party origin + forward-metadata exclusion;
358
+ * this enforces TTL, supersession, and the platform-message-id ordering
359
+ * when ids are available (a confirm answering a superseded/older echo is
360
+ * refused toward re-echo).
361
+ */
362
+ fireConfirm(topicKey: number | string, opts?: {
363
+ messageId?: number;
364
+ }): Promise<{
365
+ fired: boolean;
366
+ reply: string;
367
+ }>;
368
+ /** The currently-armed confirm echo (readout / re-echo surfaces). */
369
+ armedConfirm(topicKey: number | string): {
370
+ kind: ConfirmKind;
371
+ echo: string;
372
+ } | null;
373
+ /**
374
+ * Operator's "switch now" — overrides busy/autonomous deferral for the
375
+ * SPECIFIC pending change that armed it. NEVER overrides protection.
376
+ * With no armed pending switch this is a no-op with a plain reply.
377
+ */
378
+ handleSwitchNow(topicKey: number | string): Promise<{
379
+ fired: boolean;
380
+ reply: string;
381
+ }>;
382
+ private executeSwitchNow;
383
+ /**
384
+ * Called at EVERY successful spawn (natural, sentinel, or profile-triggered;
385
+ * wiring obligation on the spawn path): records the last-applied-profile
386
+ * marker (durable — the boot sweep compares against it across restarts),
387
+ * resets the breaker counter, clears any suppression, and registers the
388
+ * codex fence window for same-cwd serialization.
389
+ */
390
+ recordSpawnSuccess(topicKey: number | string, applied: AppliedProfile, opts?: {
391
+ cwd?: string;
392
+ }): void;
393
+ /**
394
+ * Called on a failed spawn attempt for a topic, from ANY path — including
395
+ * the legacy `/route` respawn (§10.4: legacy-path failures count when
396
+ * attributable; the breaker is never dormant).
397
+ */
398
+ recordSpawnFailure(topicKey: number | string, failureClass: ProfileSpawnFailureClass): void;
399
+ private recordSpawnFailureInternal;
400
+ /**
401
+ * §10.4 trip: park the failing profile intended-but-unhealthy, revert to
402
+ * last-known-good (or the global default), un-park the matching-framework
403
+ * resume entry (the revert is none-loss when the transcript survives),
404
+ * notify, audit system:circuit-breaker, and respawn IMMEDIATELY — the one
405
+ * keep-working exception, live in EVERY regime.
406
+ */
407
+ private tripBreaker;
408
+ /** Marks a topic's codex capture fence resolved (rollout observed). */
409
+ markCodexFenceResolved(cwd: string): void;
410
+ /**
411
+ * Piggybacks an existing periodic cadence (reaper/watchdog — no per-topic
412
+ * pollers): retries deferred (busy-abort) swaps and re-checks the dry-run
413
+ * flip lever.
414
+ */
415
+ tick(): void;
416
+ /**
417
+ * Boot-time reconcile sweep (§8 round-3): the pending slot is
418
+ * process-local, but tmux sessions and the store survive a restart
419
+ * mid-debounce. Compares each live topic-bound session's last-applied
420
+ * profile against the store (⊕ escalation marker) and arms the normal
421
+ * debounced, idle-gated respawn on divergence — in the fully-live regime.
422
+ * In gated regimes divergence is audited and left to the next natural
423
+ * spawn (no profile-triggered kill outside fully-live, §5.2(b)).
424
+ * Stale escalation markers (session gone) are cleared FIRST.
425
+ */
426
+ bootReconcileSweep(): void;
427
+ /**
428
+ * §14 — the dryRun true→false flip clears EVERY topic's shadow (intents
429
+ * are NEVER promoted, at the flip or ever) and surfaces the expired
430
+ * would-be intents ONCE as a single coalesced notice.
431
+ */
432
+ checkDryRunFlip(): void;
433
+ /**
434
+ * Lock pass-through for the escalation authority (§5.1/§9): an escalation
435
+ * swap serializes its live-session mutation through the SAME per-topic
436
+ * lock — ordering, not shared fields (it writes only its own marker and
437
+ * NEVER arms the respawn debounce).
438
+ */
439
+ runExclusive<T>(topicKey: number | string, fn: () => Promise<T> | T): Promise<T>;
440
+ /**
441
+ * §8 resume-writer gates — install via TopicResumeMap.setWriteGate /
442
+ * the codex map's wiring. A writer may persist a Claude UUID only for a
443
+ * topic whose resolved framework IS claude-code and that is not
444
+ * mid-framework-switch (the durable suppression marker).
445
+ */
446
+ claudeResumeWriteGate(topicId: number | string): {
447
+ allowed: boolean;
448
+ reason?: string;
449
+ };
450
+ codexResumeWriteGate(topicId: number | string): {
451
+ allowed: boolean;
452
+ reason?: string;
453
+ };
454
+ /** Introspection (readout / tests). */
455
+ pendingFor(topicKey: number | string): {
456
+ deferred: boolean;
457
+ changeCount: number;
458
+ } | null;
459
+ suppressionActive(topicKey: number | string): boolean;
460
+ /** Clear timers (tests / shutdown). */
461
+ dispose(): void;
462
+ private shadowObserveSwitch;
463
+ private discloseWrite;
464
+ private flushOverflow;
465
+ private cfg;
466
+ private stamp;
467
+ private audit_;
468
+ private sessionState;
469
+ private matchesExpectedLive;
470
+ private pseudoEquals;
471
+ private recordApplied;
472
+ private setSuppression;
473
+ private clearSuppression;
474
+ private loadDurable;
475
+ private saveDurable;
476
+ }
477
+ /** The characteristics a spawn against this resolution applies. */
478
+ export declare function resolvedToApplied(resolved: ResolvedTopicProfile): AppliedProfile;
479
+ export {};
480
+ //# sourceMappingURL=TopicProfileOrchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TopicProfileOrchestrator.d.ts","sourceRoot":"","sources":["../../src/core/TopicProfileOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AAIH,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,UAAU,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAS9E,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,CAAC;AAEb;;;;GAIG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