@roll-agent/runtime 0.25.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/engine/agent-session.d.ts +45 -14
  2. package/dist/engine/agent-session.js +1 -1
  3. package/dist/engine/capability-manifest.d.ts +1 -0
  4. package/dist/engine/capability-manifest.js +1 -1
  5. package/dist/engine/compaction-checkpoint.d.ts +619 -174
  6. package/dist/engine/compaction-checkpoint.js +1 -1
  7. package/dist/engine/compaction-media.d.ts +7 -0
  8. package/dist/engine/compaction-media.js +1 -0
  9. package/dist/engine/compaction-semantic-state.d.ts +707 -457
  10. package/dist/engine/compaction-semantic-state.js +1 -1
  11. package/dist/engine/compactor.d.ts +6 -24
  12. package/dist/engine/compactor.js +1 -1
  13. package/dist/engine/conversation-engine.js +1 -1
  14. package/dist/engine/model-request.d.ts +22 -0
  15. package/dist/engine/model-request.js +1 -0
  16. package/dist/engine/request-budget.d.ts +143 -0
  17. package/dist/engine/request-budget.js +1 -0
  18. package/dist/engine/system-prompt.js +1 -1
  19. package/dist/engine/tool-input-activity.d.ts +22 -0
  20. package/dist/engine/tool-input-activity.js +1 -0
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +1 -1
  23. package/dist/server/runtime-protocol-adapter.js +1 -1
  24. package/dist/server/runtime-server.js +1 -1
  25. package/dist/service/runtime-service.d.ts +4 -3
  26. package/dist/service/runtime-service.js +1 -1
  27. package/dist/store/semantic-ledger.d.ts +120 -0
  28. package/dist/store/semantic-ledger.js +1 -0
  29. package/dist/store/thread-store.d.ts +54 -19
  30. package/dist/store/thread-store.js +1 -1
  31. package/dist/store/turn-input.d.ts +161 -0
  32. package/dist/store/turn-input.js +1 -0
  33. package/dist/tool-bridge/build-tools.d.ts +2 -0
  34. package/dist/tool-bridge/build-tools.js +1 -1
  35. package/dist/tool-bridge/file-tools/edit-file-tool.d.ts +2 -2
  36. package/dist/tool-bridge/file-tools/edit-file-tool.js +1 -1
  37. package/dist/tool-bridge/file-tools/file-change-result.d.ts +2 -0
  38. package/dist/tool-bridge/file-tools/file-change-result.js +1 -1
  39. package/dist/tool-bridge/file-tools/file-io.d.ts +2 -0
  40. package/dist/tool-bridge/file-tools/file-io.js +1 -1
  41. package/dist/tool-bridge/file-tools/file-write-state.d.ts +31 -0
  42. package/dist/tool-bridge/file-tools/file-write-state.js +1 -0
  43. package/dist/tool-bridge/file-tools/text-diff.d.ts +7 -15
  44. package/dist/tool-bridge/file-tools/text-diff.js +1 -1
  45. package/dist/tool-bridge/file-tools/write-file-tool.d.ts +2 -1
  46. package/dist/tool-bridge/file-tools/write-file-tool.js +1 -1
  47. package/dist/tool-bridge/invalid-schedule-retry.d.ts +1 -1
  48. package/dist/tool-bridge/invalid-schedule-retry.js +1 -1
  49. package/dist/tool-bridge/session-exec-tool.d.ts +2 -2
  50. package/dist/tool-bridge/transcript-tool.d.ts +29 -4
  51. package/dist/tool-bridge/transcript-tool.js +1 -1
  52. package/dist/types/events.d.ts +14 -1
  53. package/package.json +4 -3
@@ -1,10 +1,7 @@
1
1
  import { z } from "zod";
2
- import { type ToolCancellationExecutionState } from "../tool-bridge/normalize-result.ts";
3
2
  export declare const COMPACTION_SEMANTIC_STATE_VERSION: 1;
4
3
  export declare const COMPACTION_PROVENANCE_KINDS: readonly ["message", "tool_execution", "resource", "running_session", "legacy_snapshot"];
5
4
  export declare const COMPACTION_SEMANTIC_ITEM_KINDS: readonly ["goal", "constraint", "decision", "completed_work", "pending_work", "resource", "running_session", "uncertainty"];
6
- export declare const legacyCompactionTranscriptFragmentsSchema: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
7
- export type LegacyCompactionTranscriptFragments = z.infer<typeof legacyCompactionTranscriptFragmentsSchema>;
8
5
  export declare const compactionSemanticItemIdSchema: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
9
6
  export type CompactionSemanticItemId = z.infer<typeof compactionSemanticItemIdSchema>;
10
7
  /**
@@ -24,11 +21,11 @@ export declare const compactionProvenanceRefSchema: z.ZodReadonly<z.ZodEffects<z
24
21
  }, "strict", z.ZodTypeAny, {
25
22
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
26
23
  sessionId: number | null;
24
+ checkpointId: string | null;
27
25
  messageSequence: number | null;
28
26
  toolExecutionId: string | null;
29
27
  resourceKey: string | null;
30
28
  managerInstanceId: string | null;
31
- checkpointId: string | null;
32
29
  snapshotIndex: number | null;
33
30
  }, {
34
31
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -42,11 +39,11 @@ export declare const compactionProvenanceRefSchema: z.ZodReadonly<z.ZodEffects<z
42
39
  }>, {
43
40
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
44
41
  sessionId: number | null;
42
+ checkpointId: string | null;
45
43
  messageSequence: number | null;
46
44
  toolExecutionId: string | null;
47
45
  resourceKey: string | null;
48
46
  managerInstanceId: string | null;
49
- checkpointId: string | null;
50
47
  snapshotIndex: number | null;
51
48
  }, {
52
49
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -59,288 +56,253 @@ export declare const compactionProvenanceRefSchema: z.ZodReadonly<z.ZodEffects<z
59
56
  snapshotIndex?: number | null | undefined;
60
57
  }>>;
61
58
  export type CompactionProvenanceRef = z.infer<typeof compactionProvenanceRefSchema>;
62
- /**
63
- * Provider-portable structured output contract. All object properties are
64
- * required; goal is explicitly nullable and empty arrays mean "no candidate".
65
- */
66
- export declare const compactionModelDraftSchema: z.ZodReadonly<z.ZodObject<{
67
- startsNewGoalScope: z.ZodBoolean;
68
- goal: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
69
- priorItemId: z.ZodNullable<z.ZodString>;
70
- text: z.ZodString;
71
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
72
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
73
- }, "strict", z.ZodTypeAny, {
74
- text: string;
75
- priorItemId: string | null;
76
- sourceEvidenceIds: string[];
77
- sourceQuotes: string[];
78
- }, {
79
- text: string;
80
- priorItemId: string | null;
81
- sourceEvidenceIds: string[];
82
- sourceQuotes: string[];
83
- }>>>;
84
- constraints: z.ZodArray<z.ZodReadonly<z.ZodObject<{
85
- priorItemId: z.ZodNullable<z.ZodString>;
86
- text: z.ZodString;
87
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
88
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
89
- }, "strict", z.ZodTypeAny, {
90
- text: string;
91
- priorItemId: string | null;
92
- sourceEvidenceIds: string[];
93
- sourceQuotes: string[];
94
- }, {
95
- text: string;
96
- priorItemId: string | null;
97
- sourceEvidenceIds: string[];
98
- sourceQuotes: string[];
99
- }>>, "many">;
100
- decisions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
101
- priorItemId: z.ZodNullable<z.ZodString>;
102
- text: z.ZodString;
103
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
104
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
105
- }, "strict", z.ZodTypeAny, {
106
- text: string;
107
- priorItemId: string | null;
108
- sourceEvidenceIds: string[];
109
- sourceQuotes: string[];
110
- }, {
111
- text: string;
112
- priorItemId: string | null;
113
- sourceEvidenceIds: string[];
114
- sourceQuotes: string[];
115
- }>>, "many">;
116
- completedWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
117
- priorItemId: z.ZodNullable<z.ZodString>;
118
- text: z.ZodString;
119
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
120
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
121
- }, "strict", z.ZodTypeAny, {
122
- text: string;
123
- priorItemId: string | null;
124
- sourceEvidenceIds: string[];
125
- sourceQuotes: string[];
126
- }, {
127
- text: string;
128
- priorItemId: string | null;
129
- sourceEvidenceIds: string[];
130
- sourceQuotes: string[];
131
- }>>, "many">;
132
- pendingWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
133
- priorItemId: z.ZodNullable<z.ZodString>;
134
- text: z.ZodString;
135
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
136
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
59
+ export declare const semanticTextItemSchema: z.ZodReadonly<z.ZodObject<{
60
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
61
+ harnessKey: z.ZodOptional<z.ZodString>;
62
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
63
+ text: z.ZodString;
64
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
65
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
66
+ messageSequence: z.ZodNullable<z.ZodNumber>;
67
+ toolExecutionId: z.ZodNullable<z.ZodString>;
68
+ resourceKey: z.ZodNullable<z.ZodString>;
69
+ managerInstanceId: z.ZodNullable<z.ZodString>;
70
+ sessionId: z.ZodNullable<z.ZodNumber>;
71
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
72
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
137
73
  }, "strict", z.ZodTypeAny, {
138
- text: string;
139
- priorItemId: string | null;
140
- sourceEvidenceIds: string[];
141
- sourceQuotes: string[];
74
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
75
+ sessionId: number | null;
76
+ checkpointId: string | null;
77
+ messageSequence: number | null;
78
+ toolExecutionId: string | null;
79
+ resourceKey: string | null;
80
+ managerInstanceId: string | null;
81
+ snapshotIndex: number | null;
142
82
  }, {
143
- text: string;
144
- priorItemId: string | null;
145
- sourceEvidenceIds: string[];
146
- sourceQuotes: string[];
147
- }>>, "many">;
148
- resources: z.ZodArray<z.ZodReadonly<z.ZodObject<{
149
- priorItemId: z.ZodNullable<z.ZodString>;
150
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
151
- }, "strict", z.ZodTypeAny, {
152
- priorItemId: string | null;
153
- sourceEvidenceIds: string[];
83
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
84
+ sessionId: number | null;
85
+ messageSequence: number | null;
86
+ toolExecutionId: string | null;
87
+ resourceKey: string | null;
88
+ managerInstanceId: string | null;
89
+ checkpointId?: string | null | undefined;
90
+ snapshotIndex?: number | null | undefined;
91
+ }>, {
92
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
93
+ sessionId: number | null;
94
+ checkpointId: string | null;
95
+ messageSequence: number | null;
96
+ toolExecutionId: string | null;
97
+ resourceKey: string | null;
98
+ managerInstanceId: string | null;
99
+ snapshotIndex: number | null;
154
100
  }, {
155
- priorItemId: string | null;
156
- sourceEvidenceIds: string[];
101
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
102
+ sessionId: number | null;
103
+ messageSequence: number | null;
104
+ toolExecutionId: string | null;
105
+ resourceKey: string | null;
106
+ managerInstanceId: string | null;
107
+ checkpointId?: string | null | undefined;
108
+ snapshotIndex?: number | null | undefined;
157
109
  }>>, "many">;
158
- runningSessions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
159
- priorItemId: z.ZodNullable<z.ZodString>;
160
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
110
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
111
+ }, "strict", z.ZodTypeAny, {
112
+ id: string & z.BRAND<"CompactionSemanticItemId">;
113
+ text: string;
114
+ provenance: Readonly<{
115
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
116
+ sessionId: number | null;
117
+ checkpointId: string | null;
118
+ messageSequence: number | null;
119
+ toolExecutionId: string | null;
120
+ resourceKey: string | null;
121
+ managerInstanceId: string | null;
122
+ snapshotIndex: number | null;
123
+ }>[];
124
+ sourceQuotes: string[];
125
+ harnessKey?: string | undefined;
126
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
127
+ }, {
128
+ id: string;
129
+ text: string;
130
+ provenance: Readonly<{
131
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
132
+ sessionId: number | null;
133
+ messageSequence: number | null;
134
+ toolExecutionId: string | null;
135
+ resourceKey: string | null;
136
+ managerInstanceId: string | null;
137
+ checkpointId?: string | null | undefined;
138
+ snapshotIndex?: number | null | undefined;
139
+ }>[];
140
+ harnessKey?: string | undefined;
141
+ relatedItemId?: string | undefined;
142
+ sourceQuotes?: string[] | undefined;
143
+ }>>;
144
+ export declare const semanticResourceSchema: z.ZodReadonly<z.ZodObject<{
145
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
146
+ resourceKey: z.ZodString;
147
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
148
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
149
+ messageSequence: z.ZodNullable<z.ZodNumber>;
150
+ toolExecutionId: z.ZodNullable<z.ZodString>;
151
+ resourceKey: z.ZodNullable<z.ZodString>;
152
+ managerInstanceId: z.ZodNullable<z.ZodString>;
153
+ sessionId: z.ZodNullable<z.ZodNumber>;
154
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
155
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
161
156
  }, "strict", z.ZodTypeAny, {
162
- priorItemId: string | null;
163
- sourceEvidenceIds: string[];
157
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
158
+ sessionId: number | null;
159
+ checkpointId: string | null;
160
+ messageSequence: number | null;
161
+ toolExecutionId: string | null;
162
+ resourceKey: string | null;
163
+ managerInstanceId: string | null;
164
+ snapshotIndex: number | null;
164
165
  }, {
165
- priorItemId: string | null;
166
- sourceEvidenceIds: string[];
167
- }>>, "many">;
168
- uncertainties: z.ZodArray<z.ZodReadonly<z.ZodObject<{
169
- priorItemId: z.ZodNullable<z.ZodString>;
170
- text: z.ZodString;
171
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
172
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
173
- }, "strict", z.ZodTypeAny, {
174
- text: string;
175
- priorItemId: string | null;
176
- sourceEvidenceIds: string[];
177
- sourceQuotes: string[];
166
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
167
+ sessionId: number | null;
168
+ messageSequence: number | null;
169
+ toolExecutionId: string | null;
170
+ resourceKey: string | null;
171
+ managerInstanceId: string | null;
172
+ checkpointId?: string | null | undefined;
173
+ snapshotIndex?: number | null | undefined;
174
+ }>, {
175
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
176
+ sessionId: number | null;
177
+ checkpointId: string | null;
178
+ messageSequence: number | null;
179
+ toolExecutionId: string | null;
180
+ resourceKey: string | null;
181
+ managerInstanceId: string | null;
182
+ snapshotIndex: number | null;
178
183
  }, {
179
- text: string;
180
- priorItemId: string | null;
181
- sourceEvidenceIds: string[];
182
- sourceQuotes: string[];
184
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
185
+ sessionId: number | null;
186
+ messageSequence: number | null;
187
+ toolExecutionId: string | null;
188
+ resourceKey: string | null;
189
+ managerInstanceId: string | null;
190
+ checkpointId?: string | null | undefined;
191
+ snapshotIndex?: number | null | undefined;
183
192
  }>>, "many">;
184
- resolutions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
185
- targetItemId: z.ZodString;
186
- targetCategory: z.ZodEnum<["constraint", "decision", "pending_work", "uncertainty"]>;
187
- action: z.ZodEnum<["cancel", "supersede", "clarify", "revoke"]>;
188
- reason: z.ZodString;
189
- sourceEvidenceIds: z.ZodArray<z.ZodString, "many">;
190
- sourceQuotes: z.ZodArray<z.ZodString, "many">;
193
+ }, "strict", z.ZodTypeAny, {
194
+ id: string & z.BRAND<"CompactionSemanticItemId">;
195
+ resourceKey: string;
196
+ provenance: Readonly<{
197
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
198
+ sessionId: number | null;
199
+ checkpointId: string | null;
200
+ messageSequence: number | null;
201
+ toolExecutionId: string | null;
202
+ resourceKey: string | null;
203
+ managerInstanceId: string | null;
204
+ snapshotIndex: number | null;
205
+ }>[];
206
+ }, {
207
+ id: string;
208
+ resourceKey: string;
209
+ provenance: Readonly<{
210
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
211
+ sessionId: number | null;
212
+ messageSequence: number | null;
213
+ toolExecutionId: string | null;
214
+ resourceKey: string | null;
215
+ managerInstanceId: string | null;
216
+ checkpointId?: string | null | undefined;
217
+ snapshotIndex?: number | null | undefined;
218
+ }>[];
219
+ }>>;
220
+ export declare const semanticRunningSessionSchema: z.ZodReadonly<z.ZodObject<{
221
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
222
+ managerInstanceId: z.ZodString;
223
+ sessionId: z.ZodNumber;
224
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
225
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
226
+ messageSequence: z.ZodNullable<z.ZodNumber>;
227
+ toolExecutionId: z.ZodNullable<z.ZodString>;
228
+ resourceKey: z.ZodNullable<z.ZodString>;
229
+ managerInstanceId: z.ZodNullable<z.ZodString>;
230
+ sessionId: z.ZodNullable<z.ZodNumber>;
231
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
232
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
191
233
  }, "strict", z.ZodTypeAny, {
192
- reason: string;
193
- action: "cancel" | "supersede" | "clarify" | "revoke";
194
- sourceEvidenceIds: string[];
195
- sourceQuotes: string[];
196
- targetItemId: string;
197
- targetCategory: "decision" | "constraint" | "pending_work" | "uncertainty";
234
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
235
+ sessionId: number | null;
236
+ checkpointId: string | null;
237
+ messageSequence: number | null;
238
+ toolExecutionId: string | null;
239
+ resourceKey: string | null;
240
+ managerInstanceId: string | null;
241
+ snapshotIndex: number | null;
198
242
  }, {
199
- reason: string;
200
- action: "cancel" | "supersede" | "clarify" | "revoke";
201
- sourceEvidenceIds: string[];
202
- sourceQuotes: string[];
203
- targetItemId: string;
204
- targetCategory: "decision" | "constraint" | "pending_work" | "uncertainty";
205
- }>>, "many">;
206
- evidenceReviews: z.ZodArray<z.ZodReadonly<z.ZodObject<{
207
- evidenceId: z.ZodString;
208
- disposition: z.ZodEnum<["irrelevant", "uncertain"]>;
209
- reason: z.ZodString;
210
- }, "strict", z.ZodTypeAny, {
211
- reason: string;
212
- evidenceId: string;
213
- disposition: "irrelevant" | "uncertain";
243
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
244
+ sessionId: number | null;
245
+ messageSequence: number | null;
246
+ toolExecutionId: string | null;
247
+ resourceKey: string | null;
248
+ managerInstanceId: string | null;
249
+ checkpointId?: string | null | undefined;
250
+ snapshotIndex?: number | null | undefined;
251
+ }>, {
252
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
253
+ sessionId: number | null;
254
+ checkpointId: string | null;
255
+ messageSequence: number | null;
256
+ toolExecutionId: string | null;
257
+ resourceKey: string | null;
258
+ managerInstanceId: string | null;
259
+ snapshotIndex: number | null;
214
260
  }, {
215
- reason: string;
216
- evidenceId: string;
217
- disposition: "irrelevant" | "uncertain";
261
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
262
+ sessionId: number | null;
263
+ messageSequence: number | null;
264
+ toolExecutionId: string | null;
265
+ resourceKey: string | null;
266
+ managerInstanceId: string | null;
267
+ checkpointId?: string | null | undefined;
268
+ snapshotIndex?: number | null | undefined;
218
269
  }>>, "many">;
219
270
  }, "strict", z.ZodTypeAny, {
220
- resources: Readonly<{
221
- priorItemId: string | null;
222
- sourceEvidenceIds: string[];
223
- }>[];
224
- goal: Readonly<{
225
- text: string;
226
- priorItemId: string | null;
227
- sourceEvidenceIds: string[];
228
- sourceQuotes: string[];
229
- }> | null;
230
- startsNewGoalScope: boolean;
231
- constraints: Readonly<{
232
- text: string;
233
- priorItemId: string | null;
234
- sourceEvidenceIds: string[];
235
- sourceQuotes: string[];
236
- }>[];
237
- decisions: Readonly<{
238
- text: string;
239
- priorItemId: string | null;
240
- sourceEvidenceIds: string[];
241
- sourceQuotes: string[];
242
- }>[];
243
- completedWork: Readonly<{
244
- text: string;
245
- priorItemId: string | null;
246
- sourceEvidenceIds: string[];
247
- sourceQuotes: string[];
248
- }>[];
249
- pendingWork: Readonly<{
250
- text: string;
251
- priorItemId: string | null;
252
- sourceEvidenceIds: string[];
253
- sourceQuotes: string[];
254
- }>[];
255
- runningSessions: Readonly<{
256
- priorItemId: string | null;
257
- sourceEvidenceIds: string[];
258
- }>[];
259
- uncertainties: Readonly<{
260
- text: string;
261
- priorItemId: string | null;
262
- sourceEvidenceIds: string[];
263
- sourceQuotes: string[];
264
- }>[];
265
- resolutions: Readonly<{
266
- reason: string;
267
- action: "cancel" | "supersede" | "clarify" | "revoke";
268
- sourceEvidenceIds: string[];
269
- sourceQuotes: string[];
270
- targetItemId: string;
271
- targetCategory: "decision" | "constraint" | "pending_work" | "uncertainty";
272
- }>[];
273
- evidenceReviews: Readonly<{
274
- reason: string;
275
- evidenceId: string;
276
- disposition: "irrelevant" | "uncertain";
271
+ id: string & z.BRAND<"CompactionSemanticItemId">;
272
+ sessionId: number;
273
+ managerInstanceId: string;
274
+ provenance: Readonly<{
275
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
276
+ sessionId: number | null;
277
+ checkpointId: string | null;
278
+ messageSequence: number | null;
279
+ toolExecutionId: string | null;
280
+ resourceKey: string | null;
281
+ managerInstanceId: string | null;
282
+ snapshotIndex: number | null;
277
283
  }>[];
278
284
  }, {
279
- resources: Readonly<{
280
- priorItemId: string | null;
281
- sourceEvidenceIds: string[];
282
- }>[];
283
- goal: Readonly<{
284
- text: string;
285
- priorItemId: string | null;
286
- sourceEvidenceIds: string[];
287
- sourceQuotes: string[];
288
- }> | null;
289
- startsNewGoalScope: boolean;
290
- constraints: Readonly<{
291
- text: string;
292
- priorItemId: string | null;
293
- sourceEvidenceIds: string[];
294
- sourceQuotes: string[];
295
- }>[];
296
- decisions: Readonly<{
297
- text: string;
298
- priorItemId: string | null;
299
- sourceEvidenceIds: string[];
300
- sourceQuotes: string[];
301
- }>[];
302
- completedWork: Readonly<{
303
- text: string;
304
- priorItemId: string | null;
305
- sourceEvidenceIds: string[];
306
- sourceQuotes: string[];
307
- }>[];
308
- pendingWork: Readonly<{
309
- text: string;
310
- priorItemId: string | null;
311
- sourceEvidenceIds: string[];
312
- sourceQuotes: string[];
313
- }>[];
314
- runningSessions: Readonly<{
315
- priorItemId: string | null;
316
- sourceEvidenceIds: string[];
317
- }>[];
318
- uncertainties: Readonly<{
319
- text: string;
320
- priorItemId: string | null;
321
- sourceEvidenceIds: string[];
322
- sourceQuotes: string[];
323
- }>[];
324
- resolutions: Readonly<{
325
- reason: string;
326
- action: "cancel" | "supersede" | "clarify" | "revoke";
327
- sourceEvidenceIds: string[];
328
- sourceQuotes: string[];
329
- targetItemId: string;
330
- targetCategory: "decision" | "constraint" | "pending_work" | "uncertainty";
331
- }>[];
332
- evidenceReviews: Readonly<{
333
- reason: string;
334
- evidenceId: string;
335
- disposition: "irrelevant" | "uncertain";
285
+ id: string;
286
+ sessionId: number;
287
+ managerInstanceId: string;
288
+ provenance: Readonly<{
289
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
290
+ sessionId: number | null;
291
+ messageSequence: number | null;
292
+ toolExecutionId: string | null;
293
+ resourceKey: string | null;
294
+ managerInstanceId: string | null;
295
+ checkpointId?: string | null | undefined;
296
+ snapshotIndex?: number | null | undefined;
336
297
  }>[];
337
298
  }>>;
338
- export type CompactionModelDraft = z.infer<typeof compactionModelDraftSchema>;
339
- export declare function createEmptyCompactionModelDraft(): CompactionModelDraft;
340
299
  export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
341
300
  version: z.ZodLiteral<1>;
301
+ scopeId: z.ZodOptional<z.ZodString>;
342
302
  goal: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
343
303
  id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
304
+ harnessKey: z.ZodOptional<z.ZodString>;
305
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
344
306
  text: z.ZodString;
345
307
  provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
346
308
  kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
@@ -354,11 +316,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
354
316
  }, "strict", z.ZodTypeAny, {
355
317
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
356
318
  sessionId: number | null;
319
+ checkpointId: string | null;
357
320
  messageSequence: number | null;
358
321
  toolExecutionId: string | null;
359
322
  resourceKey: string | null;
360
323
  managerInstanceId: string | null;
361
- checkpointId: string | null;
362
324
  snapshotIndex: number | null;
363
325
  }, {
364
326
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -372,11 +334,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
372
334
  }>, {
373
335
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
374
336
  sessionId: number | null;
337
+ checkpointId: string | null;
375
338
  messageSequence: number | null;
376
339
  toolExecutionId: string | null;
377
340
  resourceKey: string | null;
378
341
  managerInstanceId: string | null;
379
- checkpointId: string | null;
380
342
  snapshotIndex: number | null;
381
343
  }, {
382
344
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -392,17 +354,19 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
392
354
  }, "strict", z.ZodTypeAny, {
393
355
  id: string & z.BRAND<"CompactionSemanticItemId">;
394
356
  text: string;
395
- sourceQuotes: string[];
396
357
  provenance: Readonly<{
397
358
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
398
359
  sessionId: number | null;
360
+ checkpointId: string | null;
399
361
  messageSequence: number | null;
400
362
  toolExecutionId: string | null;
401
363
  resourceKey: string | null;
402
364
  managerInstanceId: string | null;
403
- checkpointId: string | null;
404
365
  snapshotIndex: number | null;
405
366
  }>[];
367
+ sourceQuotes: string[];
368
+ harnessKey?: string | undefined;
369
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
406
370
  }, {
407
371
  id: string;
408
372
  text: string;
@@ -416,10 +380,14 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
416
380
  checkpointId?: string | null | undefined;
417
381
  snapshotIndex?: number | null | undefined;
418
382
  }>[];
383
+ harnessKey?: string | undefined;
384
+ relatedItemId?: string | undefined;
419
385
  sourceQuotes?: string[] | undefined;
420
386
  }>>>;
421
387
  constraints: z.ZodDefault<z.ZodArray<z.ZodReadonly<z.ZodObject<{
422
388
  id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
389
+ harnessKey: z.ZodOptional<z.ZodString>;
390
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
423
391
  text: z.ZodString;
424
392
  provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
425
393
  kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
@@ -433,11 +401,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
433
401
  }, "strict", z.ZodTypeAny, {
434
402
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
435
403
  sessionId: number | null;
404
+ checkpointId: string | null;
436
405
  messageSequence: number | null;
437
406
  toolExecutionId: string | null;
438
407
  resourceKey: string | null;
439
408
  managerInstanceId: string | null;
440
- checkpointId: string | null;
441
409
  snapshotIndex: number | null;
442
410
  }, {
443
411
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -451,11 +419,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
451
419
  }>, {
452
420
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
453
421
  sessionId: number | null;
422
+ checkpointId: string | null;
454
423
  messageSequence: number | null;
455
424
  toolExecutionId: string | null;
456
425
  resourceKey: string | null;
457
426
  managerInstanceId: string | null;
458
- checkpointId: string | null;
459
427
  snapshotIndex: number | null;
460
428
  }, {
461
429
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -471,17 +439,19 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
471
439
  }, "strict", z.ZodTypeAny, {
472
440
  id: string & z.BRAND<"CompactionSemanticItemId">;
473
441
  text: string;
474
- sourceQuotes: string[];
475
442
  provenance: Readonly<{
476
443
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
477
444
  sessionId: number | null;
445
+ checkpointId: string | null;
478
446
  messageSequence: number | null;
479
447
  toolExecutionId: string | null;
480
448
  resourceKey: string | null;
481
449
  managerInstanceId: string | null;
482
- checkpointId: string | null;
483
450
  snapshotIndex: number | null;
484
451
  }>[];
452
+ sourceQuotes: string[];
453
+ harnessKey?: string | undefined;
454
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
485
455
  }, {
486
456
  id: string;
487
457
  text: string;
@@ -495,10 +465,14 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
495
465
  checkpointId?: string | null | undefined;
496
466
  snapshotIndex?: number | null | undefined;
497
467
  }>[];
468
+ harnessKey?: string | undefined;
469
+ relatedItemId?: string | undefined;
498
470
  sourceQuotes?: string[] | undefined;
499
471
  }>>, "many">>;
500
472
  decisions: z.ZodArray<z.ZodReadonly<z.ZodObject<{
501
473
  id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
474
+ harnessKey: z.ZodOptional<z.ZodString>;
475
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
502
476
  text: z.ZodString;
503
477
  provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
504
478
  kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
@@ -512,11 +486,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
512
486
  }, "strict", z.ZodTypeAny, {
513
487
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
514
488
  sessionId: number | null;
489
+ checkpointId: string | null;
515
490
  messageSequence: number | null;
516
491
  toolExecutionId: string | null;
517
492
  resourceKey: string | null;
518
493
  managerInstanceId: string | null;
519
- checkpointId: string | null;
520
494
  snapshotIndex: number | null;
521
495
  }, {
522
496
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -530,11 +504,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
530
504
  }>, {
531
505
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
532
506
  sessionId: number | null;
507
+ checkpointId: string | null;
533
508
  messageSequence: number | null;
534
509
  toolExecutionId: string | null;
535
510
  resourceKey: string | null;
536
511
  managerInstanceId: string | null;
537
- checkpointId: string | null;
538
512
  snapshotIndex: number | null;
539
513
  }, {
540
514
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -550,17 +524,19 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
550
524
  }, "strict", z.ZodTypeAny, {
551
525
  id: string & z.BRAND<"CompactionSemanticItemId">;
552
526
  text: string;
553
- sourceQuotes: string[];
554
527
  provenance: Readonly<{
555
528
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
556
529
  sessionId: number | null;
530
+ checkpointId: string | null;
557
531
  messageSequence: number | null;
558
532
  toolExecutionId: string | null;
559
533
  resourceKey: string | null;
560
534
  managerInstanceId: string | null;
561
- checkpointId: string | null;
562
535
  snapshotIndex: number | null;
563
536
  }>[];
537
+ sourceQuotes: string[];
538
+ harnessKey?: string | undefined;
539
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
564
540
  }, {
565
541
  id: string;
566
542
  text: string;
@@ -574,10 +550,14 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
574
550
  checkpointId?: string | null | undefined;
575
551
  snapshotIndex?: number | null | undefined;
576
552
  }>[];
553
+ harnessKey?: string | undefined;
554
+ relatedItemId?: string | undefined;
577
555
  sourceQuotes?: string[] | undefined;
578
556
  }>>, "many">;
579
557
  completedWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
580
558
  id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
559
+ harnessKey: z.ZodOptional<z.ZodString>;
560
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
581
561
  text: z.ZodString;
582
562
  provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
583
563
  kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
@@ -591,11 +571,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
591
571
  }, "strict", z.ZodTypeAny, {
592
572
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
593
573
  sessionId: number | null;
574
+ checkpointId: string | null;
594
575
  messageSequence: number | null;
595
576
  toolExecutionId: string | null;
596
577
  resourceKey: string | null;
597
578
  managerInstanceId: string | null;
598
- checkpointId: string | null;
599
579
  snapshotIndex: number | null;
600
580
  }, {
601
581
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -609,11 +589,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
609
589
  }>, {
610
590
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
611
591
  sessionId: number | null;
592
+ checkpointId: string | null;
612
593
  messageSequence: number | null;
613
594
  toolExecutionId: string | null;
614
595
  resourceKey: string | null;
615
596
  managerInstanceId: string | null;
616
- checkpointId: string | null;
617
597
  snapshotIndex: number | null;
618
598
  }, {
619
599
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -629,17 +609,19 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
629
609
  }, "strict", z.ZodTypeAny, {
630
610
  id: string & z.BRAND<"CompactionSemanticItemId">;
631
611
  text: string;
632
- sourceQuotes: string[];
633
612
  provenance: Readonly<{
634
613
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
635
614
  sessionId: number | null;
615
+ checkpointId: string | null;
636
616
  messageSequence: number | null;
637
617
  toolExecutionId: string | null;
638
618
  resourceKey: string | null;
639
619
  managerInstanceId: string | null;
640
- checkpointId: string | null;
641
620
  snapshotIndex: number | null;
642
621
  }>[];
622
+ sourceQuotes: string[];
623
+ harnessKey?: string | undefined;
624
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
643
625
  }, {
644
626
  id: string;
645
627
  text: string;
@@ -653,10 +635,14 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
653
635
  checkpointId?: string | null | undefined;
654
636
  snapshotIndex?: number | null | undefined;
655
637
  }>[];
638
+ harnessKey?: string | undefined;
639
+ relatedItemId?: string | undefined;
656
640
  sourceQuotes?: string[] | undefined;
657
641
  }>>, "many">;
658
642
  pendingWork: z.ZodArray<z.ZodReadonly<z.ZodObject<{
659
643
  id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
644
+ harnessKey: z.ZodOptional<z.ZodString>;
645
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
660
646
  text: z.ZodString;
661
647
  provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
662
648
  kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
@@ -670,11 +656,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
670
656
  }, "strict", z.ZodTypeAny, {
671
657
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
672
658
  sessionId: number | null;
659
+ checkpointId: string | null;
673
660
  messageSequence: number | null;
674
661
  toolExecutionId: string | null;
675
662
  resourceKey: string | null;
676
663
  managerInstanceId: string | null;
677
- checkpointId: string | null;
678
664
  snapshotIndex: number | null;
679
665
  }, {
680
666
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -688,11 +674,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
688
674
  }>, {
689
675
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
690
676
  sessionId: number | null;
677
+ checkpointId: string | null;
691
678
  messageSequence: number | null;
692
679
  toolExecutionId: string | null;
693
680
  resourceKey: string | null;
694
681
  managerInstanceId: string | null;
695
- checkpointId: string | null;
696
682
  snapshotIndex: number | null;
697
683
  }, {
698
684
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -708,17 +694,19 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
708
694
  }, "strict", z.ZodTypeAny, {
709
695
  id: string & z.BRAND<"CompactionSemanticItemId">;
710
696
  text: string;
711
- sourceQuotes: string[];
712
697
  provenance: Readonly<{
713
698
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
714
699
  sessionId: number | null;
700
+ checkpointId: string | null;
715
701
  messageSequence: number | null;
716
702
  toolExecutionId: string | null;
717
703
  resourceKey: string | null;
718
704
  managerInstanceId: string | null;
719
- checkpointId: string | null;
720
705
  snapshotIndex: number | null;
721
706
  }>[];
707
+ sourceQuotes: string[];
708
+ harnessKey?: string | undefined;
709
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
722
710
  }, {
723
711
  id: string;
724
712
  text: string;
@@ -732,6 +720,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
732
720
  checkpointId?: string | null | undefined;
733
721
  snapshotIndex?: number | null | undefined;
734
722
  }>[];
723
+ harnessKey?: string | undefined;
724
+ relatedItemId?: string | undefined;
735
725
  sourceQuotes?: string[] | undefined;
736
726
  }>>, "many">;
737
727
  resources: z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -749,11 +739,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
749
739
  }, "strict", z.ZodTypeAny, {
750
740
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
751
741
  sessionId: number | null;
742
+ checkpointId: string | null;
752
743
  messageSequence: number | null;
753
744
  toolExecutionId: string | null;
754
745
  resourceKey: string | null;
755
746
  managerInstanceId: string | null;
756
- checkpointId: string | null;
757
747
  snapshotIndex: number | null;
758
748
  }, {
759
749
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -767,11 +757,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
767
757
  }>, {
768
758
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
769
759
  sessionId: number | null;
760
+ checkpointId: string | null;
770
761
  messageSequence: number | null;
771
762
  toolExecutionId: string | null;
772
763
  resourceKey: string | null;
773
764
  managerInstanceId: string | null;
774
- checkpointId: string | null;
775
765
  snapshotIndex: number | null;
776
766
  }, {
777
767
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -789,11 +779,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
789
779
  provenance: Readonly<{
790
780
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
791
781
  sessionId: number | null;
782
+ checkpointId: string | null;
792
783
  messageSequence: number | null;
793
784
  toolExecutionId: string | null;
794
785
  resourceKey: string | null;
795
786
  managerInstanceId: string | null;
796
- checkpointId: string | null;
797
787
  snapshotIndex: number | null;
798
788
  }>[];
799
789
  }, {
@@ -826,11 +816,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
826
816
  }, "strict", z.ZodTypeAny, {
827
817
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
828
818
  sessionId: number | null;
819
+ checkpointId: string | null;
829
820
  messageSequence: number | null;
830
821
  toolExecutionId: string | null;
831
822
  resourceKey: string | null;
832
823
  managerInstanceId: string | null;
833
- checkpointId: string | null;
834
824
  snapshotIndex: number | null;
835
825
  }, {
836
826
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -844,11 +834,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
844
834
  }>, {
845
835
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
846
836
  sessionId: number | null;
837
+ checkpointId: string | null;
847
838
  messageSequence: number | null;
848
839
  toolExecutionId: string | null;
849
840
  resourceKey: string | null;
850
841
  managerInstanceId: string | null;
851
- checkpointId: string | null;
852
842
  snapshotIndex: number | null;
853
843
  }, {
854
844
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -867,11 +857,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
867
857
  provenance: Readonly<{
868
858
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
869
859
  sessionId: number | null;
860
+ checkpointId: string | null;
870
861
  messageSequence: number | null;
871
862
  toolExecutionId: string | null;
872
863
  resourceKey: string | null;
873
864
  managerInstanceId: string | null;
874
- checkpointId: string | null;
875
865
  snapshotIndex: number | null;
876
866
  }>[];
877
867
  }, {
@@ -891,6 +881,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
891
881
  }>>, "many">;
892
882
  uncertainties: z.ZodArray<z.ZodReadonly<z.ZodObject<{
893
883
  id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
884
+ harnessKey: z.ZodOptional<z.ZodString>;
885
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
894
886
  text: z.ZodString;
895
887
  provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
896
888
  kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
@@ -904,11 +896,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
904
896
  }, "strict", z.ZodTypeAny, {
905
897
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
906
898
  sessionId: number | null;
899
+ checkpointId: string | null;
907
900
  messageSequence: number | null;
908
901
  toolExecutionId: string | null;
909
902
  resourceKey: string | null;
910
903
  managerInstanceId: string | null;
911
- checkpointId: string | null;
912
904
  snapshotIndex: number | null;
913
905
  }, {
914
906
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -922,11 +914,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
922
914
  }>, {
923
915
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
924
916
  sessionId: number | null;
917
+ checkpointId: string | null;
925
918
  messageSequence: number | null;
926
919
  toolExecutionId: string | null;
927
920
  resourceKey: string | null;
928
921
  managerInstanceId: string | null;
929
- checkpointId: string | null;
930
922
  snapshotIndex: number | null;
931
923
  }, {
932
924
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
@@ -942,17 +934,19 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
942
934
  }, "strict", z.ZodTypeAny, {
943
935
  id: string & z.BRAND<"CompactionSemanticItemId">;
944
936
  text: string;
945
- sourceQuotes: string[];
946
937
  provenance: Readonly<{
947
938
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
948
939
  sessionId: number | null;
940
+ checkpointId: string | null;
949
941
  messageSequence: number | null;
950
942
  toolExecutionId: string | null;
951
943
  resourceKey: string | null;
952
944
  managerInstanceId: string | null;
953
- checkpointId: string | null;
954
945
  snapshotIndex: number | null;
955
946
  }>[];
947
+ sourceQuotes: string[];
948
+ harnessKey?: string | undefined;
949
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
956
950
  }, {
957
951
  id: string;
958
952
  text: string;
@@ -966,6 +960,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
966
960
  checkpointId?: string | null | undefined;
967
961
  snapshotIndex?: number | null | undefined;
968
962
  }>[];
963
+ harnessKey?: string | undefined;
964
+ relatedItemId?: string | undefined;
969
965
  sourceQuotes?: string[] | undefined;
970
966
  }>>, "many">;
971
967
  prunedItemCounts: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
@@ -1001,88 +997,98 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1001
997
  provenance: Readonly<{
1002
998
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1003
999
  sessionId: number | null;
1000
+ checkpointId: string | null;
1004
1001
  messageSequence: number | null;
1005
1002
  toolExecutionId: string | null;
1006
1003
  resourceKey: string | null;
1007
1004
  managerInstanceId: string | null;
1008
- checkpointId: string | null;
1009
1005
  snapshotIndex: number | null;
1010
1006
  }>[];
1011
1007
  }>[];
1012
1008
  goal: Readonly<{
1013
1009
  id: string & z.BRAND<"CompactionSemanticItemId">;
1014
1010
  text: string;
1015
- sourceQuotes: string[];
1016
1011
  provenance: Readonly<{
1017
1012
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1018
1013
  sessionId: number | null;
1014
+ checkpointId: string | null;
1019
1015
  messageSequence: number | null;
1020
1016
  toolExecutionId: string | null;
1021
1017
  resourceKey: string | null;
1022
1018
  managerInstanceId: string | null;
1023
- checkpointId: string | null;
1024
1019
  snapshotIndex: number | null;
1025
1020
  }>[];
1021
+ sourceQuotes: string[];
1022
+ harnessKey?: string | undefined;
1023
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1026
1024
  }> | null;
1027
1025
  constraints: Readonly<{
1028
1026
  id: string & z.BRAND<"CompactionSemanticItemId">;
1029
1027
  text: string;
1030
- sourceQuotes: string[];
1031
1028
  provenance: Readonly<{
1032
1029
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1033
1030
  sessionId: number | null;
1031
+ checkpointId: string | null;
1034
1032
  messageSequence: number | null;
1035
1033
  toolExecutionId: string | null;
1036
1034
  resourceKey: string | null;
1037
1035
  managerInstanceId: string | null;
1038
- checkpointId: string | null;
1039
1036
  snapshotIndex: number | null;
1040
1037
  }>[];
1038
+ sourceQuotes: string[];
1039
+ harnessKey?: string | undefined;
1040
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1041
1041
  }>[];
1042
1042
  decisions: Readonly<{
1043
1043
  id: string & z.BRAND<"CompactionSemanticItemId">;
1044
1044
  text: string;
1045
- sourceQuotes: string[];
1046
1045
  provenance: Readonly<{
1047
1046
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1048
1047
  sessionId: number | null;
1048
+ checkpointId: string | null;
1049
1049
  messageSequence: number | null;
1050
1050
  toolExecutionId: string | null;
1051
1051
  resourceKey: string | null;
1052
1052
  managerInstanceId: string | null;
1053
- checkpointId: string | null;
1054
1053
  snapshotIndex: number | null;
1055
1054
  }>[];
1055
+ sourceQuotes: string[];
1056
+ harnessKey?: string | undefined;
1057
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1056
1058
  }>[];
1057
1059
  completedWork: Readonly<{
1058
1060
  id: string & z.BRAND<"CompactionSemanticItemId">;
1059
1061
  text: string;
1060
- sourceQuotes: string[];
1061
1062
  provenance: Readonly<{
1062
1063
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1063
1064
  sessionId: number | null;
1065
+ checkpointId: string | null;
1064
1066
  messageSequence: number | null;
1065
1067
  toolExecutionId: string | null;
1066
1068
  resourceKey: string | null;
1067
1069
  managerInstanceId: string | null;
1068
- checkpointId: string | null;
1069
1070
  snapshotIndex: number | null;
1070
1071
  }>[];
1072
+ sourceQuotes: string[];
1073
+ harnessKey?: string | undefined;
1074
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1071
1075
  }>[];
1072
1076
  pendingWork: Readonly<{
1073
1077
  id: string & z.BRAND<"CompactionSemanticItemId">;
1074
1078
  text: string;
1075
- sourceQuotes: string[];
1076
1079
  provenance: Readonly<{
1077
1080
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1078
1081
  sessionId: number | null;
1082
+ checkpointId: string | null;
1079
1083
  messageSequence: number | null;
1080
1084
  toolExecutionId: string | null;
1081
1085
  resourceKey: string | null;
1082
1086
  managerInstanceId: string | null;
1083
- checkpointId: string | null;
1084
1087
  snapshotIndex: number | null;
1085
1088
  }>[];
1089
+ sourceQuotes: string[];
1090
+ harnessKey?: string | undefined;
1091
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1086
1092
  }>[];
1087
1093
  runningSessions: Readonly<{
1088
1094
  id: string & z.BRAND<"CompactionSemanticItemId">;
@@ -1091,28 +1097,30 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1091
1097
  provenance: Readonly<{
1092
1098
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1093
1099
  sessionId: number | null;
1100
+ checkpointId: string | null;
1094
1101
  messageSequence: number | null;
1095
1102
  toolExecutionId: string | null;
1096
1103
  resourceKey: string | null;
1097
1104
  managerInstanceId: string | null;
1098
- checkpointId: string | null;
1099
1105
  snapshotIndex: number | null;
1100
1106
  }>[];
1101
1107
  }>[];
1102
1108
  uncertainties: Readonly<{
1103
1109
  id: string & z.BRAND<"CompactionSemanticItemId">;
1104
1110
  text: string;
1105
- sourceQuotes: string[];
1106
1111
  provenance: Readonly<{
1107
1112
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1108
1113
  sessionId: number | null;
1114
+ checkpointId: string | null;
1109
1115
  messageSequence: number | null;
1110
1116
  toolExecutionId: string | null;
1111
1117
  resourceKey: string | null;
1112
1118
  managerInstanceId: string | null;
1113
- checkpointId: string | null;
1114
1119
  snapshotIndex: number | null;
1115
1120
  }>[];
1121
+ sourceQuotes: string[];
1122
+ harnessKey?: string | undefined;
1123
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1116
1124
  }>[];
1117
1125
  prunedItemCounts: Readonly<{
1118
1126
  resource: number;
@@ -1123,6 +1131,7 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1123
1131
  pending_work: number;
1124
1132
  uncertainty: number;
1125
1133
  }>;
1134
+ scopeId?: string | undefined;
1126
1135
  }, {
1127
1136
  version: 1;
1128
1137
  resources: Readonly<{
@@ -1152,6 +1161,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1152
1161
  checkpointId?: string | null | undefined;
1153
1162
  snapshotIndex?: number | null | undefined;
1154
1163
  }>[];
1164
+ harnessKey?: string | undefined;
1165
+ relatedItemId?: string | undefined;
1155
1166
  sourceQuotes?: string[] | undefined;
1156
1167
  }> | null;
1157
1168
  decisions: Readonly<{
@@ -1167,6 +1178,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1167
1178
  checkpointId?: string | null | undefined;
1168
1179
  snapshotIndex?: number | null | undefined;
1169
1180
  }>[];
1181
+ harnessKey?: string | undefined;
1182
+ relatedItemId?: string | undefined;
1170
1183
  sourceQuotes?: string[] | undefined;
1171
1184
  }>[];
1172
1185
  completedWork: Readonly<{
@@ -1182,6 +1195,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1182
1195
  checkpointId?: string | null | undefined;
1183
1196
  snapshotIndex?: number | null | undefined;
1184
1197
  }>[];
1198
+ harnessKey?: string | undefined;
1199
+ relatedItemId?: string | undefined;
1185
1200
  sourceQuotes?: string[] | undefined;
1186
1201
  }>[];
1187
1202
  pendingWork: Readonly<{
@@ -1197,6 +1212,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1197
1212
  checkpointId?: string | null | undefined;
1198
1213
  snapshotIndex?: number | null | undefined;
1199
1214
  }>[];
1215
+ harnessKey?: string | undefined;
1216
+ relatedItemId?: string | undefined;
1200
1217
  sourceQuotes?: string[] | undefined;
1201
1218
  }>[];
1202
1219
  runningSessions: Readonly<{
@@ -1227,8 +1244,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1227
1244
  checkpointId?: string | null | undefined;
1228
1245
  snapshotIndex?: number | null | undefined;
1229
1246
  }>[];
1247
+ harnessKey?: string | undefined;
1248
+ relatedItemId?: string | undefined;
1230
1249
  sourceQuotes?: string[] | undefined;
1231
1250
  }>[];
1251
+ scopeId?: string | undefined;
1232
1252
  constraints?: Readonly<{
1233
1253
  id: string;
1234
1254
  text: string;
@@ -1242,6 +1262,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1242
1262
  checkpointId?: string | null | undefined;
1243
1263
  snapshotIndex?: number | null | undefined;
1244
1264
  }>[];
1265
+ harnessKey?: string | undefined;
1266
+ relatedItemId?: string | undefined;
1245
1267
  sourceQuotes?: string[] | undefined;
1246
1268
  }>[] | undefined;
1247
1269
  prunedItemCounts?: Readonly<{
@@ -1261,88 +1283,98 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1261
1283
  provenance: Readonly<{
1262
1284
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1263
1285
  sessionId: number | null;
1286
+ checkpointId: string | null;
1264
1287
  messageSequence: number | null;
1265
1288
  toolExecutionId: string | null;
1266
1289
  resourceKey: string | null;
1267
1290
  managerInstanceId: string | null;
1268
- checkpointId: string | null;
1269
1291
  snapshotIndex: number | null;
1270
1292
  }>[];
1271
1293
  }>[];
1272
1294
  goal: Readonly<{
1273
1295
  id: string & z.BRAND<"CompactionSemanticItemId">;
1274
1296
  text: string;
1275
- sourceQuotes: string[];
1276
1297
  provenance: Readonly<{
1277
1298
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1278
1299
  sessionId: number | null;
1300
+ checkpointId: string | null;
1279
1301
  messageSequence: number | null;
1280
1302
  toolExecutionId: string | null;
1281
1303
  resourceKey: string | null;
1282
1304
  managerInstanceId: string | null;
1283
- checkpointId: string | null;
1284
1305
  snapshotIndex: number | null;
1285
1306
  }>[];
1307
+ sourceQuotes: string[];
1308
+ harnessKey?: string | undefined;
1309
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1286
1310
  }> | null;
1287
1311
  constraints: Readonly<{
1288
1312
  id: string & z.BRAND<"CompactionSemanticItemId">;
1289
1313
  text: string;
1290
- sourceQuotes: string[];
1291
1314
  provenance: Readonly<{
1292
1315
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1293
1316
  sessionId: number | null;
1317
+ checkpointId: string | null;
1294
1318
  messageSequence: number | null;
1295
1319
  toolExecutionId: string | null;
1296
1320
  resourceKey: string | null;
1297
1321
  managerInstanceId: string | null;
1298
- checkpointId: string | null;
1299
1322
  snapshotIndex: number | null;
1300
1323
  }>[];
1324
+ sourceQuotes: string[];
1325
+ harnessKey?: string | undefined;
1326
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1301
1327
  }>[];
1302
1328
  decisions: Readonly<{
1303
1329
  id: string & z.BRAND<"CompactionSemanticItemId">;
1304
1330
  text: string;
1305
- sourceQuotes: string[];
1306
1331
  provenance: Readonly<{
1307
1332
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1308
1333
  sessionId: number | null;
1334
+ checkpointId: string | null;
1309
1335
  messageSequence: number | null;
1310
1336
  toolExecutionId: string | null;
1311
1337
  resourceKey: string | null;
1312
1338
  managerInstanceId: string | null;
1313
- checkpointId: string | null;
1314
1339
  snapshotIndex: number | null;
1315
1340
  }>[];
1341
+ sourceQuotes: string[];
1342
+ harnessKey?: string | undefined;
1343
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1316
1344
  }>[];
1317
1345
  completedWork: Readonly<{
1318
1346
  id: string & z.BRAND<"CompactionSemanticItemId">;
1319
1347
  text: string;
1320
- sourceQuotes: string[];
1321
1348
  provenance: Readonly<{
1322
1349
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1323
1350
  sessionId: number | null;
1351
+ checkpointId: string | null;
1324
1352
  messageSequence: number | null;
1325
1353
  toolExecutionId: string | null;
1326
1354
  resourceKey: string | null;
1327
1355
  managerInstanceId: string | null;
1328
- checkpointId: string | null;
1329
1356
  snapshotIndex: number | null;
1330
1357
  }>[];
1358
+ sourceQuotes: string[];
1359
+ harnessKey?: string | undefined;
1360
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1331
1361
  }>[];
1332
1362
  pendingWork: Readonly<{
1333
1363
  id: string & z.BRAND<"CompactionSemanticItemId">;
1334
1364
  text: string;
1335
- sourceQuotes: string[];
1336
1365
  provenance: Readonly<{
1337
1366
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1338
1367
  sessionId: number | null;
1368
+ checkpointId: string | null;
1339
1369
  messageSequence: number | null;
1340
1370
  toolExecutionId: string | null;
1341
1371
  resourceKey: string | null;
1342
1372
  managerInstanceId: string | null;
1343
- checkpointId: string | null;
1344
1373
  snapshotIndex: number | null;
1345
1374
  }>[];
1375
+ sourceQuotes: string[];
1376
+ harnessKey?: string | undefined;
1377
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1346
1378
  }>[];
1347
1379
  runningSessions: Readonly<{
1348
1380
  id: string & z.BRAND<"CompactionSemanticItemId">;
@@ -1351,28 +1383,30 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1351
1383
  provenance: Readonly<{
1352
1384
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1353
1385
  sessionId: number | null;
1386
+ checkpointId: string | null;
1354
1387
  messageSequence: number | null;
1355
1388
  toolExecutionId: string | null;
1356
1389
  resourceKey: string | null;
1357
1390
  managerInstanceId: string | null;
1358
- checkpointId: string | null;
1359
1391
  snapshotIndex: number | null;
1360
1392
  }>[];
1361
1393
  }>[];
1362
1394
  uncertainties: Readonly<{
1363
1395
  id: string & z.BRAND<"CompactionSemanticItemId">;
1364
1396
  text: string;
1365
- sourceQuotes: string[];
1366
1397
  provenance: Readonly<{
1367
1398
  kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1368
1399
  sessionId: number | null;
1400
+ checkpointId: string | null;
1369
1401
  messageSequence: number | null;
1370
1402
  toolExecutionId: string | null;
1371
1403
  resourceKey: string | null;
1372
1404
  managerInstanceId: string | null;
1373
- checkpointId: string | null;
1374
1405
  snapshotIndex: number | null;
1375
1406
  }>[];
1407
+ sourceQuotes: string[];
1408
+ harnessKey?: string | undefined;
1409
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1376
1410
  }>[];
1377
1411
  prunedItemCounts: Readonly<{
1378
1412
  resource: number;
@@ -1383,6 +1417,7 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1383
1417
  pending_work: number;
1384
1418
  uncertainty: number;
1385
1419
  }>;
1420
+ scopeId?: string | undefined;
1386
1421
  }, {
1387
1422
  version: 1;
1388
1423
  resources: Readonly<{
@@ -1412,6 +1447,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1412
1447
  checkpointId?: string | null | undefined;
1413
1448
  snapshotIndex?: number | null | undefined;
1414
1449
  }>[];
1450
+ harnessKey?: string | undefined;
1451
+ relatedItemId?: string | undefined;
1415
1452
  sourceQuotes?: string[] | undefined;
1416
1453
  }> | null;
1417
1454
  decisions: Readonly<{
@@ -1427,6 +1464,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1427
1464
  checkpointId?: string | null | undefined;
1428
1465
  snapshotIndex?: number | null | undefined;
1429
1466
  }>[];
1467
+ harnessKey?: string | undefined;
1468
+ relatedItemId?: string | undefined;
1430
1469
  sourceQuotes?: string[] | undefined;
1431
1470
  }>[];
1432
1471
  completedWork: Readonly<{
@@ -1442,6 +1481,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1442
1481
  checkpointId?: string | null | undefined;
1443
1482
  snapshotIndex?: number | null | undefined;
1444
1483
  }>[];
1484
+ harnessKey?: string | undefined;
1485
+ relatedItemId?: string | undefined;
1445
1486
  sourceQuotes?: string[] | undefined;
1446
1487
  }>[];
1447
1488
  pendingWork: Readonly<{
@@ -1457,6 +1498,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1457
1498
  checkpointId?: string | null | undefined;
1458
1499
  snapshotIndex?: number | null | undefined;
1459
1500
  }>[];
1501
+ harnessKey?: string | undefined;
1502
+ relatedItemId?: string | undefined;
1460
1503
  sourceQuotes?: string[] | undefined;
1461
1504
  }>[];
1462
1505
  runningSessions: Readonly<{
@@ -1487,8 +1530,11 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1487
1530
  checkpointId?: string | null | undefined;
1488
1531
  snapshotIndex?: number | null | undefined;
1489
1532
  }>[];
1533
+ harnessKey?: string | undefined;
1534
+ relatedItemId?: string | undefined;
1490
1535
  sourceQuotes?: string[] | undefined;
1491
1536
  }>[];
1537
+ scopeId?: string | undefined;
1492
1538
  constraints?: Readonly<{
1493
1539
  id: string;
1494
1540
  text: string;
@@ -1502,6 +1548,8 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1502
1548
  checkpointId?: string | null | undefined;
1503
1549
  snapshotIndex?: number | null | undefined;
1504
1550
  }>[];
1551
+ harnessKey?: string | undefined;
1552
+ relatedItemId?: string | undefined;
1505
1553
  sourceQuotes?: string[] | undefined;
1506
1554
  }>[] | undefined;
1507
1555
  prunedItemCounts?: Readonly<{
@@ -1516,8 +1564,6 @@ export declare const compactionSemanticStateSchema: z.ZodReadonly<z.ZodEffects<z
1516
1564
  }>>;
1517
1565
  export type CompactionSemanticState = z.infer<typeof compactionSemanticStateSchema>;
1518
1566
  export type CompactionSemanticTextItem = CompactionSemanticState["decisions"][number];
1519
- export type CompactionSemanticResource = CompactionSemanticState["resources"][number];
1520
- export type CompactionSemanticRunningSession = CompactionSemanticState["runningSessions"][number];
1521
1567
  export declare const compactionSemanticReminderProjectionSchema: z.ZodReadonly<z.ZodObject<{
1522
1568
  version: z.ZodLiteral<1>;
1523
1569
  items: z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -1602,130 +1648,342 @@ export declare const compactionSemanticReminderProjectionSchema: z.ZodReadonly<z
1602
1648
  }>;
1603
1649
  }>>;
1604
1650
  export type CompactionSemanticReminderProjection = z.infer<typeof compactionSemanticReminderProjectionSchema>;
1605
- export interface CompactionSemanticResolution {
1606
- readonly targetItemId: CompactionSemanticItemId;
1607
- readonly targetCategory: "constraint" | "decision" | "pending_work" | "uncertainty";
1608
- readonly action: "cancel" | "supersede" | "clarify" | "revoke";
1609
- readonly reason: string;
1610
- readonly provenance: readonly CompactionProvenanceRef[];
1611
- }
1612
- export interface CompactionSemanticMessageEvidence {
1613
- readonly sequence: number;
1614
- readonly role?: string;
1615
- readonly summary: string;
1616
- }
1617
- export interface CompactionSemanticToolEvidence {
1618
- readonly id: string;
1619
- readonly agentName?: string;
1620
- readonly toolName?: string;
1621
- /** Bounded and redacted by the Harness before entering model context. */
1622
- readonly inputSummary?: string;
1623
- /** Bounded and redacted by the Harness before entering model context. */
1624
- readonly resultSummary?: string;
1625
- readonly outcome: {
1626
- readonly kind: string;
1627
- readonly executionState?: ToolCancellationExecutionState;
1628
- };
1629
- }
1630
- export interface CompactionSemanticResourceEvidence {
1631
- readonly key: string;
1632
- readonly mode?: string;
1633
- }
1634
- export interface CompactionSemanticRunningSessionEvidence {
1635
- readonly managerInstanceId: string;
1636
- readonly sessionId: number;
1637
- readonly state?: string;
1638
- }
1639
- export interface BuildCompactionSemanticEvidenceRegistryInput {
1640
- readonly messages: readonly CompactionSemanticMessageEvidence[];
1641
- readonly toolExecutions: readonly CompactionSemanticToolEvidence[];
1642
- readonly resources: readonly CompactionSemanticResourceEvidence[];
1643
- readonly runningSessions: readonly CompactionSemanticRunningSessionEvidence[];
1644
- }
1645
- export interface CompactionSemanticEvidenceRegistryEntry {
1646
- readonly evidenceId: string;
1647
- readonly summary: string;
1648
- readonly provenance: CompactionProvenanceRef;
1649
- readonly messageRole?: string;
1650
- readonly toolOutcomeKind?: string;
1651
- readonly toolCancellationExecutionState?: ToolCancellationExecutionState;
1652
- }
1653
- export type CompactionSemanticEvidenceRegistry = readonly CompactionSemanticEvidenceRegistryEntry[];
1654
- export interface ValidateCompactionModelDraftInput {
1655
- readonly draft: unknown;
1656
- readonly evidenceRegistry: CompactionSemanticEvidenceRegistry;
1657
- readonly presentedEvidenceIds?: readonly string[];
1658
- readonly previousState?: CompactionSemanticState;
1659
- readonly harnessGoal?: {
1660
- readonly verbatimRequest: string;
1661
- readonly sourceSequence: number;
1662
- };
1663
- }
1664
- export interface MergeCompactionSemanticStateOptions {
1665
- /** Computed by the Harness from durable goal sourceSequence, never from model wording or IDs. */
1666
- readonly startsNewGoalScope: boolean;
1667
- }
1668
- export declare const COMPACTION_SEMANTIC_REJECTION_REASONS: readonly ["unknown_provenance", "missing_required_provenance", "completed_work_without_success_evidence", "resource_not_observed", "running_session_not_observed", "unknown_resolution_target", "resolution_target_category_mismatch", "invalid_resolution_action", "unsupported_source_quote", "unknown_evidence_review"];
1669
- export interface CompactionSemanticRejection {
1670
- readonly category: "goal" | "constraint" | "decision" | "completed_work" | "pending_work" | "resource" | "running_session" | "uncertainty" | "resolution" | "evidence_review";
1671
- readonly index: number;
1672
- readonly reason: (typeof COMPACTION_SEMANTIC_REJECTION_REASONS)[number];
1673
- }
1674
- export interface ValidatedCompactionSemanticCandidate {
1675
- readonly state: CompactionSemanticState;
1676
- readonly resolutions: readonly CompactionSemanticResolution[];
1677
- readonly rejections: readonly CompactionSemanticRejection[];
1678
- readonly coveredEvidenceIds: readonly string[];
1679
- readonly startsNewGoalScope: boolean;
1680
- }
1681
- /** Builds opaque model-facing handles backed by exact Harness-owned facts. */
1682
- export declare function buildCompactionSemanticEvidenceRegistry(input: BuildCompactionSemanticEvidenceRegistryInput): CompactionSemanticEvidenceRegistry;
1683
- /** Renders opaque evidence handles in caller-provided priority order with a hard bound. */
1684
- export declare function renderCompactionSemanticEvidenceRegistry(registry: CompactionSemanticEvidenceRegistry, maxChars?: number): string;
1685
- export interface CompactionSemanticModelContext {
1686
- readonly prompt: string;
1687
- readonly includedEvidenceIds: readonly string[];
1688
- }
1689
- /** Returns both the bounded prompt and the exact evidence handles shown to the model. */
1690
- export declare function buildCompactionSemanticModelContext(registry: CompactionSemanticEvidenceRegistry, previousState: CompactionSemanticState | undefined, maxChars?: number): CompactionSemanticModelContext;
1691
- /** Includes prior stable IDs/text so the model can explicitly retain or resolve known items. */
1692
- export declare function renderCompactionSemanticModelContext(registry: CompactionSemanticEvidenceRegistry, previousState: CompactionSemanticState | undefined, maxChars?: number): string;
1693
- /** Only failures in a newly assembled candidate are eligible for draft recovery. */
1694
- export declare class CompactionSemanticCandidateError extends Error {
1695
- constructor(message: string, options?: ErrorOptions);
1696
- }
1697
- type CompactionSemanticItem = CompactionSemanticTextItem | CompactionSemanticResource | CompactionSemanticRunningSession;
1698
- /** Coalesce grounded candidates before limits/uniqueness checks, never persisted state. */
1699
- export declare function normalizeCompactionSemanticItems<T extends CompactionSemanticItem>(items: readonly T[]): T[];
1700
- /**
1701
- * Validates a model-authored semantic candidate against Harness-owned evidence.
1702
- * Invalid individual claims are rejected without turning the remaining grounded
1703
- * candidate into an all-or-nothing failure.
1704
- */
1705
- export declare function validateCompactionModelDraft(input: ValidateCompactionModelDraftInput): ValidatedCompactionSemanticCandidate;
1651
+ export declare const semanticArchiveItemSchema: z.ZodObject<{
1652
+ category: z.ZodEnum<["goal", "constraint", "decision", "completed_work", "pending_work", "resource", "running_session", "uncertainty"]>;
1653
+ item: z.ZodUnion<[z.ZodReadonly<z.ZodObject<{
1654
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
1655
+ harnessKey: z.ZodOptional<z.ZodString>;
1656
+ relatedItemId: z.ZodOptional<z.ZodBranded<z.ZodString, "CompactionSemanticItemId">>;
1657
+ text: z.ZodString;
1658
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
1659
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
1660
+ messageSequence: z.ZodNullable<z.ZodNumber>;
1661
+ toolExecutionId: z.ZodNullable<z.ZodString>;
1662
+ resourceKey: z.ZodNullable<z.ZodString>;
1663
+ managerInstanceId: z.ZodNullable<z.ZodString>;
1664
+ sessionId: z.ZodNullable<z.ZodNumber>;
1665
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1666
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1667
+ }, "strict", z.ZodTypeAny, {
1668
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1669
+ sessionId: number | null;
1670
+ checkpointId: string | null;
1671
+ messageSequence: number | null;
1672
+ toolExecutionId: string | null;
1673
+ resourceKey: string | null;
1674
+ managerInstanceId: string | null;
1675
+ snapshotIndex: number | null;
1676
+ }, {
1677
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1678
+ sessionId: number | null;
1679
+ messageSequence: number | null;
1680
+ toolExecutionId: string | null;
1681
+ resourceKey: string | null;
1682
+ managerInstanceId: string | null;
1683
+ checkpointId?: string | null | undefined;
1684
+ snapshotIndex?: number | null | undefined;
1685
+ }>, {
1686
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1687
+ sessionId: number | null;
1688
+ checkpointId: string | null;
1689
+ messageSequence: number | null;
1690
+ toolExecutionId: string | null;
1691
+ resourceKey: string | null;
1692
+ managerInstanceId: string | null;
1693
+ snapshotIndex: number | null;
1694
+ }, {
1695
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1696
+ sessionId: number | null;
1697
+ messageSequence: number | null;
1698
+ toolExecutionId: string | null;
1699
+ resourceKey: string | null;
1700
+ managerInstanceId: string | null;
1701
+ checkpointId?: string | null | undefined;
1702
+ snapshotIndex?: number | null | undefined;
1703
+ }>>, "many">;
1704
+ sourceQuotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1705
+ }, "strict", z.ZodTypeAny, {
1706
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1707
+ text: string;
1708
+ provenance: Readonly<{
1709
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1710
+ sessionId: number | null;
1711
+ checkpointId: string | null;
1712
+ messageSequence: number | null;
1713
+ toolExecutionId: string | null;
1714
+ resourceKey: string | null;
1715
+ managerInstanceId: string | null;
1716
+ snapshotIndex: number | null;
1717
+ }>[];
1718
+ sourceQuotes: string[];
1719
+ harnessKey?: string | undefined;
1720
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1721
+ }, {
1722
+ id: string;
1723
+ text: string;
1724
+ provenance: Readonly<{
1725
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1726
+ sessionId: number | null;
1727
+ messageSequence: number | null;
1728
+ toolExecutionId: string | null;
1729
+ resourceKey: string | null;
1730
+ managerInstanceId: string | null;
1731
+ checkpointId?: string | null | undefined;
1732
+ snapshotIndex?: number | null | undefined;
1733
+ }>[];
1734
+ harnessKey?: string | undefined;
1735
+ relatedItemId?: string | undefined;
1736
+ sourceQuotes?: string[] | undefined;
1737
+ }>>, z.ZodReadonly<z.ZodObject<{
1738
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
1739
+ resourceKey: z.ZodString;
1740
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
1741
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
1742
+ messageSequence: z.ZodNullable<z.ZodNumber>;
1743
+ toolExecutionId: z.ZodNullable<z.ZodString>;
1744
+ resourceKey: z.ZodNullable<z.ZodString>;
1745
+ managerInstanceId: z.ZodNullable<z.ZodString>;
1746
+ sessionId: z.ZodNullable<z.ZodNumber>;
1747
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1748
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1749
+ }, "strict", z.ZodTypeAny, {
1750
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1751
+ sessionId: number | null;
1752
+ checkpointId: string | null;
1753
+ messageSequence: number | null;
1754
+ toolExecutionId: string | null;
1755
+ resourceKey: string | null;
1756
+ managerInstanceId: string | null;
1757
+ snapshotIndex: number | null;
1758
+ }, {
1759
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1760
+ sessionId: number | null;
1761
+ messageSequence: number | null;
1762
+ toolExecutionId: string | null;
1763
+ resourceKey: string | null;
1764
+ managerInstanceId: string | null;
1765
+ checkpointId?: string | null | undefined;
1766
+ snapshotIndex?: number | null | undefined;
1767
+ }>, {
1768
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1769
+ sessionId: number | null;
1770
+ checkpointId: string | null;
1771
+ messageSequence: number | null;
1772
+ toolExecutionId: string | null;
1773
+ resourceKey: string | null;
1774
+ managerInstanceId: string | null;
1775
+ snapshotIndex: number | null;
1776
+ }, {
1777
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1778
+ sessionId: number | null;
1779
+ messageSequence: number | null;
1780
+ toolExecutionId: string | null;
1781
+ resourceKey: string | null;
1782
+ managerInstanceId: string | null;
1783
+ checkpointId?: string | null | undefined;
1784
+ snapshotIndex?: number | null | undefined;
1785
+ }>>, "many">;
1786
+ }, "strict", z.ZodTypeAny, {
1787
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1788
+ resourceKey: string;
1789
+ provenance: Readonly<{
1790
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1791
+ sessionId: number | null;
1792
+ checkpointId: string | null;
1793
+ messageSequence: number | null;
1794
+ toolExecutionId: string | null;
1795
+ resourceKey: string | null;
1796
+ managerInstanceId: string | null;
1797
+ snapshotIndex: number | null;
1798
+ }>[];
1799
+ }, {
1800
+ id: string;
1801
+ resourceKey: string;
1802
+ provenance: Readonly<{
1803
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1804
+ sessionId: number | null;
1805
+ messageSequence: number | null;
1806
+ toolExecutionId: string | null;
1807
+ resourceKey: string | null;
1808
+ managerInstanceId: string | null;
1809
+ checkpointId?: string | null | undefined;
1810
+ snapshotIndex?: number | null | undefined;
1811
+ }>[];
1812
+ }>>, z.ZodReadonly<z.ZodObject<{
1813
+ id: z.ZodBranded<z.ZodString, "CompactionSemanticItemId">;
1814
+ managerInstanceId: z.ZodString;
1815
+ sessionId: z.ZodNumber;
1816
+ provenance: z.ZodArray<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
1817
+ kind: z.ZodEnum<["message", "tool_execution", "resource", "running_session", "legacy_snapshot"]>;
1818
+ messageSequence: z.ZodNullable<z.ZodNumber>;
1819
+ toolExecutionId: z.ZodNullable<z.ZodString>;
1820
+ resourceKey: z.ZodNullable<z.ZodString>;
1821
+ managerInstanceId: z.ZodNullable<z.ZodString>;
1822
+ sessionId: z.ZodNullable<z.ZodNumber>;
1823
+ checkpointId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1824
+ snapshotIndex: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1825
+ }, "strict", z.ZodTypeAny, {
1826
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1827
+ sessionId: number | null;
1828
+ checkpointId: string | null;
1829
+ messageSequence: number | null;
1830
+ toolExecutionId: string | null;
1831
+ resourceKey: string | null;
1832
+ managerInstanceId: string | null;
1833
+ snapshotIndex: number | null;
1834
+ }, {
1835
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1836
+ sessionId: number | null;
1837
+ messageSequence: number | null;
1838
+ toolExecutionId: string | null;
1839
+ resourceKey: string | null;
1840
+ managerInstanceId: string | null;
1841
+ checkpointId?: string | null | undefined;
1842
+ snapshotIndex?: number | null | undefined;
1843
+ }>, {
1844
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1845
+ sessionId: number | null;
1846
+ checkpointId: string | null;
1847
+ messageSequence: number | null;
1848
+ toolExecutionId: string | null;
1849
+ resourceKey: string | null;
1850
+ managerInstanceId: string | null;
1851
+ snapshotIndex: number | null;
1852
+ }, {
1853
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1854
+ sessionId: number | null;
1855
+ messageSequence: number | null;
1856
+ toolExecutionId: string | null;
1857
+ resourceKey: string | null;
1858
+ managerInstanceId: string | null;
1859
+ checkpointId?: string | null | undefined;
1860
+ snapshotIndex?: number | null | undefined;
1861
+ }>>, "many">;
1862
+ }, "strict", z.ZodTypeAny, {
1863
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1864
+ sessionId: number;
1865
+ managerInstanceId: string;
1866
+ provenance: Readonly<{
1867
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1868
+ sessionId: number | null;
1869
+ checkpointId: string | null;
1870
+ messageSequence: number | null;
1871
+ toolExecutionId: string | null;
1872
+ resourceKey: string | null;
1873
+ managerInstanceId: string | null;
1874
+ snapshotIndex: number | null;
1875
+ }>[];
1876
+ }, {
1877
+ id: string;
1878
+ sessionId: number;
1879
+ managerInstanceId: string;
1880
+ provenance: Readonly<{
1881
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1882
+ sessionId: number | null;
1883
+ messageSequence: number | null;
1884
+ toolExecutionId: string | null;
1885
+ resourceKey: string | null;
1886
+ managerInstanceId: string | null;
1887
+ checkpointId?: string | null | undefined;
1888
+ snapshotIndex?: number | null | undefined;
1889
+ }>[];
1890
+ }>>]>;
1891
+ }, "strict", z.ZodTypeAny, {
1892
+ item: Readonly<{
1893
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1894
+ text: string;
1895
+ provenance: Readonly<{
1896
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1897
+ sessionId: number | null;
1898
+ checkpointId: string | null;
1899
+ messageSequence: number | null;
1900
+ toolExecutionId: string | null;
1901
+ resourceKey: string | null;
1902
+ managerInstanceId: string | null;
1903
+ snapshotIndex: number | null;
1904
+ }>[];
1905
+ sourceQuotes: string[];
1906
+ harnessKey?: string | undefined;
1907
+ relatedItemId?: (string & z.BRAND<"CompactionSemanticItemId">) | undefined;
1908
+ }> | Readonly<{
1909
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1910
+ resourceKey: string;
1911
+ provenance: Readonly<{
1912
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1913
+ sessionId: number | null;
1914
+ checkpointId: string | null;
1915
+ messageSequence: number | null;
1916
+ toolExecutionId: string | null;
1917
+ resourceKey: string | null;
1918
+ managerInstanceId: string | null;
1919
+ snapshotIndex: number | null;
1920
+ }>[];
1921
+ }> | Readonly<{
1922
+ id: string & z.BRAND<"CompactionSemanticItemId">;
1923
+ sessionId: number;
1924
+ managerInstanceId: string;
1925
+ provenance: Readonly<{
1926
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1927
+ sessionId: number | null;
1928
+ checkpointId: string | null;
1929
+ messageSequence: number | null;
1930
+ toolExecutionId: string | null;
1931
+ resourceKey: string | null;
1932
+ managerInstanceId: string | null;
1933
+ snapshotIndex: number | null;
1934
+ }>[];
1935
+ }>;
1936
+ category: "resource" | "decision" | "running_session" | "goal" | "constraint" | "completed_work" | "pending_work" | "uncertainty";
1937
+ }, {
1938
+ item: Readonly<{
1939
+ id: string;
1940
+ text: string;
1941
+ provenance: Readonly<{
1942
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1943
+ sessionId: number | null;
1944
+ messageSequence: number | null;
1945
+ toolExecutionId: string | null;
1946
+ resourceKey: string | null;
1947
+ managerInstanceId: string | null;
1948
+ checkpointId?: string | null | undefined;
1949
+ snapshotIndex?: number | null | undefined;
1950
+ }>[];
1951
+ harnessKey?: string | undefined;
1952
+ relatedItemId?: string | undefined;
1953
+ sourceQuotes?: string[] | undefined;
1954
+ }> | Readonly<{
1955
+ id: string;
1956
+ resourceKey: string;
1957
+ provenance: Readonly<{
1958
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1959
+ sessionId: number | null;
1960
+ messageSequence: number | null;
1961
+ toolExecutionId: string | null;
1962
+ resourceKey: string | null;
1963
+ managerInstanceId: string | null;
1964
+ checkpointId?: string | null | undefined;
1965
+ snapshotIndex?: number | null | undefined;
1966
+ }>[];
1967
+ }> | Readonly<{
1968
+ id: string;
1969
+ sessionId: number;
1970
+ managerInstanceId: string;
1971
+ provenance: Readonly<{
1972
+ kind: "message" | "resource" | "legacy_snapshot" | "tool_execution" | "running_session";
1973
+ sessionId: number | null;
1974
+ messageSequence: number | null;
1975
+ toolExecutionId: string | null;
1976
+ resourceKey: string | null;
1977
+ managerInstanceId: string | null;
1978
+ checkpointId?: string | null | undefined;
1979
+ snapshotIndex?: number | null | undefined;
1980
+ }>[];
1981
+ }>;
1982
+ category: "resource" | "decision" | "running_session" | "goal" | "constraint" | "completed_work" | "pending_work" | "uncertainty";
1983
+ }>;
1984
+ export type SemanticArchiveItem = z.infer<typeof semanticArchiveItemSchema>;
1985
+ export declare function listSemanticArchiveItems(state: CompactionSemanticState): SemanticArchiveItem[];
1706
1986
  export declare function createEmptyCompactionSemanticState(): CompactionSemanticState;
1707
- /** Seeds V1/top-level constraint evidence into the V2 semantic state without language heuristics. */
1708
- export declare function seedCompactionSemanticConstraints(stateInput: CompactionSemanticState | undefined, constraints: readonly {
1709
- readonly quote: string;
1710
- readonly sourceSequence: number;
1711
- }[]): CompactionSemanticState;
1712
- export interface LegacyCompactionSnapshotMigrationResult {
1713
- readonly state: CompactionSemanticState;
1714
- /** Every migrated fragment must remain visible in the first V2 checkpoint reminder. */
1715
- readonly requiredItemIds: readonly CompactionSemanticItemId[];
1716
- /** Exact, redacted fragments that must be archived in transcript when V1 is retired. */
1717
- readonly transcriptFragments: LegacyCompactionTranscriptFragments;
1718
- /** False means at least one legacy snapshot chunk did not fit and its active prefix must stay. */
1719
- readonly complete: boolean;
1720
- }
1721
- /**
1722
- * Migrates an old active snapshot into low-confidence V2 state. It may only become uncertainty:
1723
- * legacy prose is not authoritative user intent or Tool completion evidence.
1724
- */
1725
- export declare function seedLegacyCompactionSnapshotUncertainties(stateInput: CompactionSemanticState, input: {
1726
- readonly checkpointId: string;
1727
- readonly fragments: readonly string[];
1728
- }): LegacyCompactionSnapshotMigrationResult;
1729
1987
  /** Deterministic truncate mode replaces only the constraint slice from verbatim user evidence. */
1730
1988
  export declare function replaceCompactionSemanticConstraints(stateInput: CompactionSemanticState, constraints: readonly {
1731
1989
  readonly quote: string;
@@ -1736,17 +1994,9 @@ export declare function replaceCompactionSemanticGoal(stateInput: CompactionSema
1736
1994
  readonly verbatimRequest: string;
1737
1995
  readonly sourceSequence: number;
1738
1996
  } | undefined): CompactionSemanticState;
1739
- /**
1740
- * Carries grounded state forward. Empty candidate arrays do not erase history;
1741
- * removal requires an evidence-grounded, category-specific explicit resolution.
1742
- */
1743
- export declare function mergeCompactionSemanticState(previousInput: CompactionSemanticState | undefined, candidateInput: ValidatedCompactionSemanticCandidate, options: MergeCompactionSemanticStateOptions): CompactionSemanticState;
1744
1997
  /**
1745
1998
  * Projects the durable semantic state into a bounded, structured prompt reminder.
1746
1999
  * The complete state remains in the checkpoint and can be recovered through the
1747
2000
  * transcript path; omitted counts make prompt truncation explicit to the model.
1748
2001
  */
1749
2002
  export declare function createCompactionSemanticReminderProjection(stateInput: CompactionSemanticState, maxChars?: number): CompactionSemanticReminderProjection;
1750
- /** Renders a deterministic, bounded presentation derived only from grounded state. */
1751
- export declare function renderCompactionSemanticSummary(stateInput: CompactionSemanticState, maxChars?: number): string;
1752
- export {};