@cortexkit/opencode-magic-context 0.49.92 → 0.49.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-search-worker.js +4 -4
- package/dist/chunk-embedding-write-worker.js +3 -3
- package/dist/{compartment-chunk-embedding-rp4asvk0.js → compartment-chunk-embedding-4nn3hsw2.js} +2 -2
- package/dist/{context-e8qd2v00.js → context-h9x9m2p3.js} +192 -68
- package/dist/{embedding-backfill-w0yq71q2.js → embedding-backfill-wdrqkw09.js} +6 -6
- package/dist/embedding-worker.js +3 -3
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts +5 -2
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
- package/dist/features/magic-context/history-gap-recovery.d.ts +42 -0
- package/dist/features/magic-context/history-gap-recovery.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-synapse.d.ts +18 -5
- package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +3 -0
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/message-visibility.d.ts +10 -0
- package/dist/features/magic-context/message-visibility.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts +4 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-decision-calibration.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/history-boundary-repair.d.ts +2 -2
- package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts +1 -0
- package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts +3 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +1 -0
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-replay.d.ts +4 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +1 -0
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-output-count.d.ts +4 -0
- package/dist/hooks/magic-context/tail-hygiene-output-count.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +2 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-stage-logger.d.ts +6 -0
- package/dist/hooks/magic-context/transform-stage-logger.d.ts.map +1 -1
- package/dist/{index-3f3d548g.js → index-2gewejcz.js} +18 -9
- package/dist/{index-n71006wq.js → index-2v9qpmb3.js} +5 -5
- package/dist/{index-zzhcshdk.js → index-3tmbvn0z.js} +9 -9
- package/dist/{index-f25ha337.js → index-3ywyr4zx.js} +1 -1
- package/dist/{index-hbn5g7rt.js → index-47hst5me.js} +1 -1
- package/dist/{index-xg1zjht5.js → index-7dzaamqg.js} +6 -6
- package/dist/{index-5y9w2ax7.js → index-7r11k4xr.js} +2 -2
- package/dist/{index-5pmf4jpj.js → index-7skgrbsg.js} +100 -52
- package/dist/{index-6rk44cer.js → index-c81tggen.js} +1 -1
- package/dist/{index-0twg41mh.js → index-ejgp0z9p.js} +1 -1
- package/dist/{index-hre29c1a.js → index-esacb9d0.js} +1 -1
- package/dist/{index-5a9kwapd.js → index-ewta5h87.js} +4 -4
- package/dist/{index-6r99v53h.js → index-j7n64sg4.js} +162 -60
- package/dist/{index-r3tdqqtq.js → index-jm62g83a.js} +180 -64
- package/dist/{index-anwy2mfb.js → index-pc49a7zt.js} +162 -31
- package/dist/{index-ydhymf0b.js → index-qmm8xpbc.js} +4 -4
- package/dist/{index-3n376ann.js → index-tedck05r.js} +4 -4
- package/dist/{index-j2w79s9r.js → index-tm799pq7.js} +1 -1
- package/dist/{index-01h7tqe3.js → index-tr4ep2ej.js} +21 -6
- package/dist/{index-wvbg9m0h.js → index-wqwjawer.js} +27 -11
- package/dist/index-xe34pwb6.js +119 -0
- package/dist/{index-xn9efn18.js → index-xjaf9g90.js} +13 -6
- package/dist/{index-6nqz8hsz.js → index-y915t3ey.js} +1 -1
- package/dist/{index-41bma6qs.js → index-yzzxb5e1.js} +2 -2
- package/dist/{index-901exj0f.js → index-zk6gtf43.js} +45 -9
- package/dist/index.js +27 -27
- package/dist/{message-index-bounded-f6fc00ze.js → message-index-bounded-d3x8rhpz.js} +4 -4
- package/dist/migration-worker.js +1 -1
- package/dist/{project-embedding-registry-8je0xg18.js → project-embedding-registry-az68q792.js} +5 -5
- package/dist/raw-ordinal-warmup-worker.js +5 -5
- package/dist/{read-session-chunk-y2ew3630.js → read-session-chunk-70r1snq3.js} +3 -3
- package/dist/{recomp-orchestrator-ggtcvb9g.js → recomp-orchestrator-cn4r2gz6.js} +15 -15
- package/dist/{render-q8c6wrq9.js → render-g45k3gts.js} +10 -10
- package/dist/{search-archive-pz1jf655.js → search-archive-s9t3exc1.js} +9 -7
- package/dist/{search-gjyrwapc.js → search-b0cb342r.js} +13 -13
- package/dist/shared/storage-file-mutex.d.ts.map +1 -1
- package/dist/{storage-tags-7raphcw6.js → storage-tags-xvbje7jm.js} +2 -2
- package/dist/{store-yr443ye8.js → store-91kawq9a.js} +2 -2
- package/dist/{store-reader-qbq6q4v0.js → store-reader-dgh3ssxx.js} +1 -1
- package/dist/tools/ctx-expand/search-archive.d.ts +3 -2
- package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts +2 -0
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-pmzdd3s2.js → transform-postprocess-phase-r1xhsjrh.js} +16 -16
- package/dist/v2/auto-search-worker.js +4 -4
- package/dist/v2/chunk-embedding-write-worker.js +3 -3
- package/dist/v2/{compartment-chunk-embedding-w7ht0t9v.js → compartment-chunk-embedding-a7ddvz7v.js} +2 -2
- package/dist/v2/{context-qqbpzk1q.js → context-2hssw26q.js} +351 -111
- package/dist/v2/{embedding-backfill-95m72gxa.js → embedding-backfill-gveter8p.js} +6 -6
- package/dist/v2/embedding-worker.js +3 -3
- package/dist/v2/fold/memory-cache.d.ts +2 -0
- package/dist/v2/fold/memory-cache.d.ts.map +1 -1
- package/dist/v2/fold/native-replay.d.ts +22 -5
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/revert-message-state.d.ts.map +1 -1
- package/dist/v2/hooks/session-project-backfill.d.ts +2 -1
- package/dist/v2/hooks/session-project-backfill.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-70g28hyg.js → message-index-bounded-tbwrff24.js} +4 -4
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/{project-embedding-registry-fcxf4qht.js → project-embedding-registry-2zeycxek.js} +5 -5
- package/dist/v2/raw-ordinal-warmup-worker.js +5 -5
- package/dist/v2/{read-session-chunk-9rf0n9e6.js → read-session-chunk-cvgsfsgr.js} +3 -3
- package/dist/v2/{recomp-orchestrator-cwghhjc9.js → recomp-orchestrator-k4cj62f2.js} +15 -15
- package/dist/v2/{render-e852zmxz.js → render-ys7a3zks.js} +10 -10
- package/dist/v2/{search-archive-tmn6b5w8.js → search-archive-k2yh0jj3.js} +9 -7
- package/dist/v2/{search-jd3vczhn.js → search-x1cac8t6.js} +12 -12
- package/dist/v2/{server-vsqmkvxc.js → server-00adcfjd.js} +1 -1
- package/dist/v2/{server-rkj44mez.js → server-476anw1w.js} +1 -1
- package/dist/v2/{server-barj0mjz.js → server-5016ccyn.js} +1 -1
- package/dist/v2/{server-72k2r3kt.js → server-6aj72z52.js} +4 -4
- package/dist/v2/{server-7x5a46hf.js → server-6nh36020.js} +70 -61
- package/dist/v2/{server-fj3pekz2.js → server-88pjnecb.js} +1 -1
- package/dist/v2/{server-js2v309w.js → server-bfct1yvb.js} +99 -51
- package/dist/v2/{server-6t3asmx8.js → server-cd93xyyx.js} +162 -31
- package/dist/v2/{server-ysjjcatk.js → server-cvm1qrqc.js} +2 -2
- package/dist/v2/{server-rz6g5xne.js → server-e6xneh68.js} +1 -1
- package/dist/v2/{server-d4trxrj3.js → server-gj259dqy.js} +45 -9
- package/dist/v2/{server-8ps3717t.js → server-prrx17q3.js} +4 -4
- package/dist/v2/{server-7e89a2kf.js → server-qy58c11s.js} +13 -6
- package/dist/v2/{server-9011eteb.js → server-s81b3nct.js} +2 -2
- package/dist/v2/{server-p4g021y5.js → server-s8mk882p.js} +27 -11
- package/dist/v2/{server-mgxqfprb.js → server-srtq37nh.js} +1 -1
- package/dist/v2/{server-bvr9xs8h.js → server-vbr1rdkg.js} +6 -6
- package/dist/v2/{server-vtgeyhq6.js → server-vtkbxzw1.js} +21 -6
- package/dist/v2/{server-ps6zrzwj.js → server-xepfjgv5.js} +162 -60
- package/dist/v2/server-y0pd600x.js +119 -0
- package/dist/v2/{server-b4efn08m.js → server-zc8s06gx.js} +1 -1
- package/dist/v2/server.js +4 -4
- package/dist/v2/{storage-tags-wgsemtw1.js → storage-tags-y20j3jdp.js} +2 -2
- package/dist/v2/{store-enef5jcn.js → store-b95snz31.js} +2 -2
- package/dist/v2/{store-reader-jbaqv1yp.js → store-reader-qt2msa8z.js} +1 -1
- package/dist/v2/store-reader.d.ts +1 -1
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{v2-archive-reader-dm1aeqk2.js → v2-archive-reader-q92kwkr5.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-cke368np.js → wrapup-orchestrator-ydqkxkhj.js} +15 -15
- package/dist/{v2-archive-reader-39ye0d3b.js → v2-archive-reader-x62hsr4c.js} +1 -1
- package/dist/{wrapup-orchestrator-ggnk0r4r.js → wrapup-orchestrator-kt81d6et.js} +16 -16
- package/package.json +1 -1
- package/src/config/schema/magic-context.ts +1 -1
- package/src/shared/storage-file-mutex-review.test.ts +110 -0
- package/src/shared/storage-file-mutex.ts +12 -0
- package/dist/index-52x68mj4.js +0 -58
- package/dist/v2/server-52x68mj4.js +0 -58
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveLegacyConfigSources,
|
|
8
8
|
getProtectedTokensTierOverrides,
|
|
9
9
|
loadPluginConfigDetailed
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-00adcfjd.js";
|
|
11
11
|
import {
|
|
12
12
|
getHarness2,
|
|
13
13
|
harnessOwnsOpenCodeStore2
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
94
94
|
DEFAULT_LOCAL_EMBEDDING_MODEL,
|
|
95
95
|
DREAM_TASK_PROMOTION_DEFAULTS
|
|
96
|
-
} from "./server-
|
|
96
|
+
} from "./server-e6xneh68.js";
|
|
97
97
|
import {
|
|
98
98
|
historianRunConfig,
|
|
99
99
|
dreamerRunConfig,
|
|
@@ -246,7 +246,7 @@ import {
|
|
|
246
246
|
startCompartmentAgent,
|
|
247
247
|
setRecompStarting2,
|
|
248
248
|
setRecompTerminal2
|
|
249
|
-
} from "./server-
|
|
249
|
+
} from "./server-6nh36020.js";
|
|
250
250
|
import {
|
|
251
251
|
embedPauseBySession,
|
|
252
252
|
embedRunStateBySession,
|
|
@@ -277,7 +277,7 @@ import {
|
|
|
277
277
|
toSynapseLaneDescriptor,
|
|
278
278
|
formatSynapseLaneDescriptor,
|
|
279
279
|
SynapseEmbeddingProvider
|
|
280
|
-
} from "./server-
|
|
280
|
+
} from "./server-xepfjgv5.js";
|
|
281
281
|
import {
|
|
282
282
|
inRootAsyncContext2,
|
|
283
283
|
getTagIdentityWriteGeneration2,
|
|
@@ -310,11 +310,17 @@ import {
|
|
|
310
310
|
import"./server-ds8vpfkr.js";
|
|
311
311
|
import {
|
|
312
312
|
deleteChunkEmbedBackoffForSession2
|
|
313
|
-
} from "./server-
|
|
313
|
+
} from "./server-5016ccyn.js";
|
|
314
314
|
import {
|
|
315
315
|
acquireCompartmentLease,
|
|
316
316
|
releaseCompartmentLeaseBestEffort,
|
|
317
317
|
isCompartmentLeaseHeld,
|
|
318
|
+
readSummaryCoverage,
|
|
319
|
+
markHistoryGapAfterCoverageChange,
|
|
320
|
+
readHistoryGapMark,
|
|
321
|
+
clearHistoryGapMark,
|
|
322
|
+
claimHistoryGapCheck,
|
|
323
|
+
recordHistoryGapAdmission,
|
|
318
324
|
queueM0Mutation,
|
|
319
325
|
getMaxM0MutationId,
|
|
320
326
|
getLastCompartmentEndMessage,
|
|
@@ -430,12 +436,12 @@ import {
|
|
|
430
436
|
saveSourceContent,
|
|
431
437
|
replaceSourceContent,
|
|
432
438
|
getSourceContents
|
|
433
|
-
} from "./server-
|
|
439
|
+
} from "./server-cd93xyyx.js";
|
|
434
440
|
import {
|
|
435
441
|
cleanSearchText,
|
|
436
442
|
matchedSearchSnippet,
|
|
437
443
|
getLastIndexedOrdinal
|
|
438
|
-
} from "./server-
|
|
444
|
+
} from "./server-srtq37nh.js";
|
|
439
445
|
import {
|
|
440
446
|
ensureSessionMetaRow,
|
|
441
447
|
clearCachedM0M1,
|
|
@@ -503,6 +509,7 @@ import {
|
|
|
503
509
|
resolveCompactionModeRecord,
|
|
504
510
|
getCompactionModeRecord,
|
|
505
511
|
setCompactionModeRecord,
|
|
512
|
+
EMERGENCY_DRAIN_FAILURE_BACKOFF_MS,
|
|
506
513
|
getPersistedReasoningWatermark,
|
|
507
514
|
setPersistedReasoningWatermark,
|
|
508
515
|
clearPersistedReasoningWatermark,
|
|
@@ -534,6 +541,7 @@ import {
|
|
|
534
541
|
setPersistedTodoSyntheticAnchor,
|
|
535
542
|
clearPersistedTodoSyntheticAnchor,
|
|
536
543
|
setNoteLastReadAt,
|
|
544
|
+
getHistorianFailureState,
|
|
537
545
|
clearHistorianFailureState,
|
|
538
546
|
getOverflowState,
|
|
539
547
|
loadTransformPassStateSnapshot,
|
|
@@ -692,7 +700,7 @@ import {
|
|
|
692
700
|
adoptNullOwnerToolTag2,
|
|
693
701
|
getCandidateToolOwners2,
|
|
694
702
|
pickNearestPriorOwner2
|
|
695
|
-
} from "./server-
|
|
703
|
+
} from "./server-gj259dqy.js";
|
|
696
704
|
import {
|
|
697
705
|
BoundedSessionMap,
|
|
698
706
|
getTableColumnNames,
|
|
@@ -791,6 +799,7 @@ import {
|
|
|
791
799
|
cleanUserText2,
|
|
792
800
|
withRawSessionMessageCache2,
|
|
793
801
|
readRawSessionMessages2,
|
|
802
|
+
getRawSessionMessageOrdinalCount2,
|
|
794
803
|
visitRawSessionMessages2,
|
|
795
804
|
visitRawSessionMessagesAsync2,
|
|
796
805
|
prepareRawSessionOrdinals2,
|
|
@@ -805,7 +814,7 @@ import {
|
|
|
805
814
|
readRawSessionMessageOrdinalById2,
|
|
806
815
|
readSessionChunk2,
|
|
807
816
|
readRawSessionSeedTail2
|
|
808
|
-
} from "./server-
|
|
817
|
+
} from "./server-s81b3nct.js";
|
|
809
818
|
import {
|
|
810
819
|
getMessageIndexEpoch,
|
|
811
820
|
isMessageIndexSearchable,
|
|
@@ -831,7 +840,7 @@ import {
|
|
|
831
840
|
resolveMemoriesByIdsForSearch2,
|
|
832
841
|
unifiedSearch2,
|
|
833
842
|
formatSearchResults2
|
|
834
|
-
} from "./server-
|
|
843
|
+
} from "./server-bfct1yvb.js";
|
|
835
844
|
import {
|
|
836
845
|
startBootDeadline,
|
|
837
846
|
getUnconfirmedMigrationHolders,
|
|
@@ -847,7 +856,7 @@ import {
|
|
|
847
856
|
openDatabaseAsync,
|
|
848
857
|
isDatabasePersisted,
|
|
849
858
|
getDatabasePersistenceError
|
|
850
|
-
} from "./server-
|
|
859
|
+
} from "./server-88pjnecb.js";
|
|
851
860
|
import {
|
|
852
861
|
V2_MEMORY_CATEGORIES,
|
|
853
862
|
CATEGORY_PRIORITY
|
|
@@ -866,7 +875,7 @@ import {
|
|
|
866
875
|
RAW_MESSAGE_TYPES2,
|
|
867
876
|
V2StoreReaderPool2,
|
|
868
877
|
V2StoreReader2
|
|
869
|
-
} from "./server-
|
|
878
|
+
} from "./server-vtkbxzw1.js";
|
|
870
879
|
import {
|
|
871
880
|
configureContextDatabasePragmas2
|
|
872
881
|
} from "./server-fb3zxn06.js";
|
|
@@ -929,7 +938,7 @@ import {
|
|
|
929
938
|
embedSessionCompartmentChunks2,
|
|
930
939
|
getEmbeddingCoverageStatus2,
|
|
931
940
|
getAutoEmbeddingSessionCoverage2
|
|
932
|
-
} from "./server-
|
|
941
|
+
} from "./server-6aj72z52.js";
|
|
933
942
|
import {
|
|
934
943
|
GIT_SWEEP_LEASE_RENEWAL_MS,
|
|
935
944
|
acquireGitSweepLease,
|
|
@@ -949,7 +958,7 @@ import {
|
|
|
949
958
|
getCachedLocalEmbeddingPooling,
|
|
950
959
|
preflightLocalEmbeddingPooling,
|
|
951
960
|
getLocalEmbeddingNativeMemoryStats
|
|
952
|
-
} from "./server-
|
|
961
|
+
} from "./server-qy58c11s.js";
|
|
953
962
|
import {
|
|
954
963
|
renderUserFacingFailure,
|
|
955
964
|
userFacingFailureCode,
|
|
@@ -969,8 +978,8 @@ import {
|
|
|
969
978
|
readGitFileChangeTimesSince,
|
|
970
979
|
verificationFileExists,
|
|
971
980
|
normalizeVerificationFiles
|
|
972
|
-
} from "./server-
|
|
973
|
-
import"./server-
|
|
981
|
+
} from "./server-prrx17q3.js";
|
|
982
|
+
import"./server-zc8s06gx.js";
|
|
974
983
|
import {
|
|
975
984
|
computeCueContentHash,
|
|
976
985
|
hasMuralCueColumns,
|
|
@@ -1036,7 +1045,7 @@ import {
|
|
|
1036
1045
|
readV2RawMessagePagesForConversion2,
|
|
1037
1046
|
createV2RawMessageReader2,
|
|
1038
1047
|
createV2RawMessageProvider2
|
|
1039
|
-
} from "./server-
|
|
1048
|
+
} from "./server-476anw1w.js";
|
|
1040
1049
|
import {
|
|
1041
1050
|
resolvePromptContext2
|
|
1042
1051
|
} from "./server-fmsr7v69.js";
|
|
@@ -1044,14 +1053,15 @@ import {
|
|
|
1044
1053
|
renderMessageByOrdinal2,
|
|
1045
1054
|
renderVerboseRangeForTool2,
|
|
1046
1055
|
renderItemByTag2
|
|
1047
|
-
} from "./server-
|
|
1048
|
-
import"./server-
|
|
1056
|
+
} from "./server-cvm1qrqc.js";
|
|
1057
|
+
import"./server-y0pd600x.js";
|
|
1049
1058
|
import {
|
|
1050
1059
|
readV2ArchiveOffThread2
|
|
1051
|
-
} from "./server-
|
|
1060
|
+
} from "./server-vbr1rdkg.js";
|
|
1052
1061
|
import {
|
|
1062
|
+
unresolvedLiveTailRefusal2,
|
|
1053
1063
|
renderSearchArchiveOffThread2
|
|
1054
|
-
} from "./server-
|
|
1064
|
+
} from "./server-s8mk882p.js";
|
|
1055
1065
|
import {
|
|
1056
1066
|
markHostInstructionRow,
|
|
1057
1067
|
hostInstructionRow,
|
|
@@ -2911,14 +2921,12 @@ function writeTransformDecisionRow(dbPath, row) {
|
|
|
2911
2921
|
try {
|
|
2912
2922
|
db.exec("PRAGMA busy_timeout=0");
|
|
2913
2923
|
configureContextDatabasePragmas2(db);
|
|
2914
|
-
writeTransformDecisionRowOnDatabase(db, row
|
|
2924
|
+
writeTransformDecisionRowOnDatabase(db, row);
|
|
2915
2925
|
} finally {
|
|
2916
2926
|
closeQuietly(db);
|
|
2917
2927
|
}
|
|
2918
2928
|
}
|
|
2919
|
-
function writeTransformDecisionRowOnDatabase(db, row
|
|
2920
|
-
if (configureBusyTimeout)
|
|
2921
|
-
db.exec("PRAGMA busy_timeout=0");
|
|
2929
|
+
function writeTransformDecisionRowOnDatabase(db, row) {
|
|
2922
2930
|
const systemHashPrev = row.materialized ? row.systemHashPrev : null;
|
|
2923
2931
|
const systemHashNew = row.materialized ? row.systemHashNew : null;
|
|
2924
2932
|
const m0ModelKeyPrev = row.materialized ? row.m0ModelKeyPrev : null;
|
|
@@ -3367,11 +3375,14 @@ function dropCompartmentsAfter(db, sessionId, anchor, holderId, activeBranch = f
|
|
|
3367
3375
|
return null;
|
|
3368
3376
|
}
|
|
3369
3377
|
const dropped = db.prepare("SELECT id, sequence FROM compartments WHERE session_id = ? AND sequence > ? ORDER BY sequence").all(sessionId, anchor?.sequence ?? -1);
|
|
3370
|
-
|
|
3378
|
+
const previousCoverage = readSummaryCoverage(db, sessionId);
|
|
3379
|
+
const hostQueuedRecovery = onRetire?.() === true;
|
|
3371
3380
|
const deleteEmbeddings = db.prepare("DELETE FROM compartment_chunk_embeddings WHERE compartment_id = ?");
|
|
3372
3381
|
for (const row of dropped)
|
|
3373
3382
|
deleteEmbeddings.run(row.id);
|
|
3374
3383
|
db.prepare("DELETE FROM compartments WHERE session_id = ? AND sequence > ?").run(sessionId, anchor?.sequence ?? -1);
|
|
3384
|
+
if (!hostQueuedRecovery)
|
|
3385
|
+
markHistoryGapAfterCoverageChange(db, sessionId, previousCoverage);
|
|
3375
3386
|
db.prepare("DELETE FROM compression_depth WHERE session_id = ? AND message_ordinal > ?").run(sessionId, anchor?.endMessage ?? 0);
|
|
3376
3387
|
if (activeBranch) {
|
|
3377
3388
|
db.prepare("UPDATE session_meta SET prior_boundary_ordinal = ? WHERE session_id = ?").run((anchor?.endMessage ?? 0) + 1, sessionId);
|
|
@@ -6628,7 +6639,11 @@ function getUnsummarizedTailInfo(db, sessionId, triggerBudget, usage, executeThr
|
|
|
6628
6639
|
}
|
|
6629
6640
|
const rawEligibility = getRawHistoryEligibility(db, sessionId);
|
|
6630
6641
|
if (!rawEligibility.hasRawBeyondLastCompartment) {
|
|
6631
|
-
return {
|
|
6642
|
+
return {
|
|
6643
|
+
...TAIL_INFO_DEFAULTS,
|
|
6644
|
+
nextStartOrdinal: rawEligibility.offset,
|
|
6645
|
+
noRawBeyondSummary: true
|
|
6646
|
+
};
|
|
6632
6647
|
}
|
|
6633
6648
|
const boundary = resolveOpenCodeProtectedTailBoundary({
|
|
6634
6649
|
db,
|
|
@@ -6688,6 +6703,12 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
6688
6703
|
executeThresholdPercentage
|
|
6689
6704
|
}))
|
|
6690
6705
|
return { shouldFire: false };
|
|
6706
|
+
let historyGapMark = readHistoryGapMark(db, sessionId);
|
|
6707
|
+
const gapCoverageEnd = historyGapMark ? getLastCompartmentEndMessage(db, sessionId) : -1;
|
|
6708
|
+
if (historyGapMark && gapCoverageEnd > historyGapMark.endOrdinal) {
|
|
6709
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
6710
|
+
historyGapMark = null;
|
|
6711
|
+
}
|
|
6691
6712
|
const lazyInMemoryTail = typeof inMemoryTail === "function" ? inMemoryTail : undefined;
|
|
6692
6713
|
let resolvedInMemoryTail = typeof inMemoryTail === "function" ? undefined : inMemoryTail;
|
|
6693
6714
|
if (resolvedInMemoryTail) {
|
|
@@ -6701,6 +6722,7 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
6701
6722
|
}
|
|
6702
6723
|
const taggerFloor = taggerFloorOverride !== undefined && taggerFloorOverride > 0 ? taggerFloorOverride : resolvedInMemoryTail ? deriveTagLoadFloor2(db, sessionId, resolvedInMemoryTail.messages.map((m) => m.id)) : 0;
|
|
6703
6724
|
const proactiveFloorForGate = getProactiveCompartmentTriggerPercentage(executeThresholdPercentage);
|
|
6725
|
+
let cheapSkip;
|
|
6704
6726
|
if (usage.percentage < proactiveFloorForGate) {
|
|
6705
6727
|
try {
|
|
6706
6728
|
const boundFloor = resolvedInMemoryTail || lazyInMemoryTail ? taggerFloor : 0;
|
|
@@ -6710,15 +6732,53 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
6710
6732
|
const seed = sessionDecisionCalibration(db, sessionId);
|
|
6711
6733
|
const eligibleUpperBound = Math.ceil((persistedBound + untaggedUpperBound) * Math.max(1, seed.proseRatio, seed.toolsRatio, seed.systemRatio));
|
|
6712
6734
|
if (eligibleUpperBound < triggerBudget) {
|
|
6713
|
-
|
|
6714
|
-
sessionLog2(sessionId, `compartment trigger: cheap-skip at ${usage.percentage.toFixed(1)}% (below proactive floor ${proactiveFloorForGate}%) — live-tail upper bound ${eligibleUpperBound}${memorySuffix} < triggerBudget ${triggerBudget}; no size trigger possible, skipped full raw read`);
|
|
6715
|
-
return { shouldFire: false };
|
|
6735
|
+
cheapSkip = { eligibleUpperBound, persistedBound, untaggedUpperBound };
|
|
6716
6736
|
}
|
|
6717
6737
|
}
|
|
6718
6738
|
} catch (error) {
|
|
6719
6739
|
sessionLog2(sessionId, `compartment trigger: cheap-gate skipped (falling through to full read): ${error instanceof Error ? error.message : String(error)}`);
|
|
6720
6740
|
}
|
|
6721
6741
|
}
|
|
6742
|
+
const forceMaterializationPercentage = escalationBands(executeThresholdPercentage).forceMaterializationPercentage;
|
|
6743
|
+
let historyGapAdmission;
|
|
6744
|
+
if (historyGapMark && usage.percentage < forceMaterializationPercentage) {
|
|
6745
|
+
const now = Date.now();
|
|
6746
|
+
const checkedAt = historyGapMark.checkedAt;
|
|
6747
|
+
if (checkedAt === undefined || checkedAt > now || now - checkedAt >= EMERGENCY_DRAIN_FAILURE_BACKOFF_MS) {
|
|
6748
|
+
const { failureCount, lastFailureAt } = getHistorianFailureState(db, sessionId);
|
|
6749
|
+
const failedAt = lastFailureAt ?? 0;
|
|
6750
|
+
const admittedRuns = historyGapMark.admittedRuns ?? 0;
|
|
6751
|
+
const previousRunFailed = failureCount > (historyGapMark.failureCountAtAdmission ?? failureCount);
|
|
6752
|
+
if (previousRunFailed && admittedRuns >= 2) {
|
|
6753
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
6754
|
+
historyGapMark = null;
|
|
6755
|
+
} else if (failedAt <= 0 || failedAt > now || now - failedAt >= EMERGENCY_DRAIN_FAILURE_BACKOFF_MS) {
|
|
6756
|
+
const count = resolvedInMemoryTail?.absoluteMessageCount ?? getRawSessionMessageOrdinalCount2(sessionId);
|
|
6757
|
+
if (count <= Math.max(0, gapCoverageEnd)) {
|
|
6758
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
6759
|
+
} else {
|
|
6760
|
+
const inspectedCount = historyGapMark.inspectedCount ?? 0;
|
|
6761
|
+
const canAdmit = admittedRuns < 2 && (admittedRuns === 0 || previousRunFailed);
|
|
6762
|
+
const shouldInspect = canAdmit && count > inspectedCount;
|
|
6763
|
+
const nextFrontier = shouldInspect || count < inspectedCount ? count : inspectedCount;
|
|
6764
|
+
if (claimHistoryGapCheck(db, sessionId, historyGapMark, now, nextFrontier) && shouldInspect) {
|
|
6765
|
+
historyGapAdmission = {
|
|
6766
|
+
id: historyGapMark.id,
|
|
6767
|
+
checkedAt: now,
|
|
6768
|
+
admittedRuns: admittedRuns + 1,
|
|
6769
|
+
failureCount
|
|
6770
|
+
};
|
|
6771
|
+
}
|
|
6772
|
+
}
|
|
6773
|
+
}
|
|
6774
|
+
}
|
|
6775
|
+
}
|
|
6776
|
+
if (cheapSkip && !historyGapAdmission) {
|
|
6777
|
+
const { eligibleUpperBound, persistedBound, untaggedUpperBound } = cheapSkip;
|
|
6778
|
+
const memorySuffix = resolvedInMemoryTail ? ` (persisted=${persistedBound}, untagged-memory≤${untaggedUpperBound})` : "";
|
|
6779
|
+
sessionLog2(sessionId, `compartment trigger: cheap-skip at ${usage.percentage.toFixed(1)}% (below proactive floor ${proactiveFloorForGate}%) — live-tail upper bound ${eligibleUpperBound}${memorySuffix} < triggerBudget ${triggerBudget}; no size trigger possible, skipped full raw read`);
|
|
6780
|
+
return { shouldFire: false };
|
|
6781
|
+
}
|
|
6722
6782
|
if (lazyInMemoryTail) {
|
|
6723
6783
|
try {
|
|
6724
6784
|
const policyVersion = loadProtectedTailMeta(db, sessionId).protectedTailPolicyVersion;
|
|
@@ -6745,6 +6805,8 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
6745
6805
|
}
|
|
6746
6806
|
}
|
|
6747
6807
|
if (!tailInfo.hasNewRawHistory) {
|
|
6808
|
+
if (historyGapMark && tailInfo.noRawBeyondSummary)
|
|
6809
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
6748
6810
|
try {
|
|
6749
6811
|
const lastCompartmentEnd = getLastCompartmentEndMessage(db, sessionId);
|
|
6750
6812
|
sessionLog2(sessionId, `compartment trigger: skipped — no new raw history (usage=${usage.percentage.toFixed(1)}% nextStartOrdinal=${tailInfo.nextStartOrdinal} lastCompartmentEnd=${lastCompartmentEnd})`);
|
|
@@ -6764,13 +6826,19 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
6764
6826
|
sessionLog2(sessionId, "compartment trigger: waiting for new history after no forward progress");
|
|
6765
6827
|
return { shouldFire: false };
|
|
6766
6828
|
}
|
|
6829
|
+
if (historyGapAdmission && tailInfo.boundarySnapshot && hasRunnableCompartmentWindow(tailInfo.boundarySnapshot) && recordHistoryGapAdmission(db, sessionId, historyGapAdmission)) {
|
|
6830
|
+
return {
|
|
6831
|
+
shouldFire: true,
|
|
6832
|
+
reason: "history_gap",
|
|
6833
|
+
boundarySnapshot: tailInfo.boundarySnapshot
|
|
6834
|
+
};
|
|
6835
|
+
}
|
|
6767
6836
|
const canClearReasoning = reasoningProjection?.canClearReasoning ?? modelAcceptsEmptyContent(reasoningProjection?.providerID);
|
|
6768
6837
|
const projectedPostDropPercentage = estimateProjectedPostDropPercentage(db, sessionId, usage, preloadedActiveTags ?? getActiveTagsBySession2(db, sessionId), keepReasoningTokens, sessionMeta.clearedReasoningThroughTag, canClearReasoning, reasoningProjection?.budgetCutoff, eligiblePendingDropTagIds);
|
|
6769
6838
|
const relativePostDropTarget = executeThresholdPercentage * POST_DROP_TARGET_RATIO;
|
|
6770
6839
|
const ridePermitted = reclaimRide !== undefined && (reclaimRide.permission ? reclaimRidePermitted(reclaimRide, reclaimRide.permission) : hasReclaimRide(reclaimRide));
|
|
6771
6840
|
const rideLabel = reclaimRide ? reclaimRideLabel(reclaimRide) : "ride=none";
|
|
6772
6841
|
const dropsCanLand = ridePermitted;
|
|
6773
|
-
const forceMaterializationPercentage = escalationBands(executeThresholdPercentage).forceMaterializationPercentage;
|
|
6774
6842
|
if (usage.percentage >= forceMaterializationPercentage) {
|
|
6775
6843
|
if (dropsCanLand && projectedPostDropPercentage !== null && projectedPostDropPercentage <= relativePostDropTarget) {
|
|
6776
6844
|
sessionLog2(sessionId, `historian redundancy skip: summarizer not needed this pass — force band is ${forceMaterializationPercentage}%; queued/automatic drops are projected to reclaim to ${projectedPostDropPercentage.toFixed(1)}% (target ${relativePostDropTarget.toFixed(1)}%) on this pass (${rideLabel})`);
|
|
@@ -26563,7 +26631,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26563
26631
|
const db = readDatabase();
|
|
26564
26632
|
if (!db)
|
|
26565
26633
|
return { ok: false, error: "db unavailable" };
|
|
26566
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
26634
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-k4cj62f2.js"));
|
|
26567
26635
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-v69y04f5.js"));
|
|
26568
26636
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
26569
26637
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -26648,7 +26716,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26648
26716
|
const db = readDatabase();
|
|
26649
26717
|
if (!db)
|
|
26650
26718
|
return { ok: false, error: "db unavailable" };
|
|
26651
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
26719
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-ydqkxkhj.js"));
|
|
26652
26720
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
26653
26721
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
26654
26722
|
if (!window)
|
|
@@ -28287,6 +28355,9 @@ class NativeFoldCache {
|
|
|
28287
28355
|
const kept = this.nativeRows.get(sessionID);
|
|
28288
28356
|
return ids.every((id) => kept?.has(id));
|
|
28289
28357
|
}
|
|
28358
|
+
holdsState(sessionID) {
|
|
28359
|
+
return this.tails.has(sessionID) || (this.nativeRows.get(sessionID)?.size ?? 0) > 0;
|
|
28360
|
+
}
|
|
28290
28361
|
rows(sessionID, after, through) {
|
|
28291
28362
|
if (this.retention.has(sessionID))
|
|
28292
28363
|
this.touch(sessionID);
|
|
@@ -29187,8 +29258,11 @@ class NativeFoldReplay {
|
|
|
29187
29258
|
stampMRU;
|
|
29188
29259
|
loaded = new Map;
|
|
29189
29260
|
sources = new Map;
|
|
29261
|
+
memorySources = new Map;
|
|
29190
29262
|
staleHeads = new Set;
|
|
29191
29263
|
unprovenControls = new Set;
|
|
29264
|
+
reportedCaptureReplacements = new Set;
|
|
29265
|
+
reportedForeignRefreshes = new Set;
|
|
29192
29266
|
editedAdmissions = new Map;
|
|
29193
29267
|
legacyUpgrades = new Map;
|
|
29194
29268
|
constructor(storage, openReader, admissions, options = {}) {
|
|
@@ -29212,6 +29286,7 @@ class NativeFoldReplay {
|
|
|
29212
29286
|
await this.forget(sessionID);
|
|
29213
29287
|
this.sources.set(sessionID, source);
|
|
29214
29288
|
this.account(sessionID);
|
|
29289
|
+
return source;
|
|
29215
29290
|
}
|
|
29216
29291
|
onEvent(event) {
|
|
29217
29292
|
const sessionID = event.data?.sessionID;
|
|
@@ -29284,6 +29359,18 @@ class NativeFoldReplay {
|
|
|
29284
29359
|
this.options.log?.(sessionID, `v3 host fold: ${reason}`);
|
|
29285
29360
|
} catch {}
|
|
29286
29361
|
}
|
|
29362
|
+
reportOnce(sessionID, reported, message) {
|
|
29363
|
+
if (reported.has(sessionID))
|
|
29364
|
+
return;
|
|
29365
|
+
reported.add(sessionID);
|
|
29366
|
+
const sessionLog = this.options.log;
|
|
29367
|
+
try {
|
|
29368
|
+
sessionLog?.(sessionID, message);
|
|
29369
|
+
} catch {}
|
|
29370
|
+
}
|
|
29371
|
+
reportCaptureReplacement(sessionID) {
|
|
29372
|
+
this.reportOnce(sessionID, this.reportedCaptureReplacements, "v3 host fold: capture skipped: host database file changed between readers");
|
|
29373
|
+
}
|
|
29287
29374
|
historyCoverage(sessionID, reader) {
|
|
29288
29375
|
if (!this.options.rendersHistory?.(sessionID))
|
|
29289
29376
|
return;
|
|
@@ -29300,13 +29387,15 @@ class NativeFoldReplay {
|
|
|
29300
29387
|
return false;
|
|
29301
29388
|
}
|
|
29302
29389
|
async floorState(sessionID, reader, boundary, served, preferCapture = false) {
|
|
29390
|
+
const source = reader.hostIdentity();
|
|
29391
|
+
await this.fenceMemory(sessionID, source);
|
|
29303
29392
|
const coverage = this.historyCoverage(sessionID, reader);
|
|
29304
29393
|
const retained = this.tail(sessionID)?.replay;
|
|
29305
29394
|
const controlsKnown = (replay) => replay.controls.every((control) => !control.after || reader.sequenceForId(sessionID, control.after) !== undefined);
|
|
29306
29395
|
const memory = retained && validReplayState(retained) && controlsKnown(retained) && validFloor(reader, sessionID, retained.floor) && this.floorCovered(sessionID, retained.floor, coverage, retained) ? retained : undefined;
|
|
29307
29396
|
const cut = reader.latestCompaction(sessionID);
|
|
29308
29397
|
const saved = await this.readV3(sessionID);
|
|
29309
|
-
const durable = saved && saved.proof.sourceDigest === foldDigest(
|
|
29398
|
+
const durable = saved && saved.proof.sourceDigest === foldDigest(source) && (!cut || saved.proof.admissionID === cut.id) && controlsKnown(saved.replay) && validFloor(reader, sessionID, saved.replay.floor) && this.floorCovered(sessionID, saved.replay.floor, coverage, saved.replay) ? saved.replay : undefined;
|
|
29310
29399
|
const marker = importedFloor(reader, sessionID, cut?.seq);
|
|
29311
29400
|
const imported = marker && this.floorCovered(sessionID, marker, coverage) ? marker : undefined;
|
|
29312
29401
|
const capturedRecord = await this.readCapturedReplay(sessionID, reader);
|
|
@@ -29366,11 +29455,11 @@ class NativeFoldReplay {
|
|
|
29366
29455
|
return;
|
|
29367
29456
|
}
|
|
29368
29457
|
}
|
|
29369
|
-
async saveCapturedReplay(sessionID, replay, reader) {
|
|
29458
|
+
async saveCapturedReplay(sessionID, replay, reader, sourceDigest) {
|
|
29370
29459
|
const value = {
|
|
29371
29460
|
version: 3,
|
|
29372
29461
|
sessionID,
|
|
29373
|
-
sourceDigest
|
|
29462
|
+
sourceDigest,
|
|
29374
29463
|
through: reader.latestSequence(sessionID),
|
|
29375
29464
|
replay
|
|
29376
29465
|
};
|
|
@@ -29400,11 +29489,33 @@ class NativeFoldReplay {
|
|
|
29400
29489
|
${cached}
|
|
29401
29490
|
</summary>`)))) ? cached : undefined;
|
|
29402
29491
|
}
|
|
29403
|
-
async retainReplay(sessionID, replay, model, sourceSeq) {
|
|
29492
|
+
async retainReplay(sessionID, replay, model, sourceSeq, source) {
|
|
29493
|
+
await this.fenceMemory(sessionID, source);
|
|
29404
29494
|
const tail = this.tail(sessionID) ?? { model, sourceSeq };
|
|
29405
29495
|
await this.storage.saveTail(sessionID, JSON.stringify({ ...tail, replay }), []);
|
|
29406
29496
|
if (!this.storage.tail(sessionID))
|
|
29407
29497
|
await this.storage.saveTail(sessionID, JSON.stringify({ model, sourceSeq, replay }), []);
|
|
29498
|
+
this.memorySources.set(sessionID, source);
|
|
29499
|
+
}
|
|
29500
|
+
async fenceMemory(sessionID, source) {
|
|
29501
|
+
const recorded = this.memorySources.get(sessionID);
|
|
29502
|
+
if (recorded === source)
|
|
29503
|
+
return;
|
|
29504
|
+
if (recorded === undefined && !this.storage.holdsState(sessionID) && !this.metadata.has(sessionID))
|
|
29505
|
+
return;
|
|
29506
|
+
await this.discardCapture(sessionID);
|
|
29507
|
+
this.reportCaptureReplacement(sessionID);
|
|
29508
|
+
}
|
|
29509
|
+
async discardCapture(sessionID) {
|
|
29510
|
+
if (this.stampMRU?.sessionID === sessionID)
|
|
29511
|
+
this.stampMRU = undefined;
|
|
29512
|
+
const source = this.sources.get(sessionID);
|
|
29513
|
+
const forgotten = this.storage.forget(sessionID);
|
|
29514
|
+
if (source !== undefined) {
|
|
29515
|
+
this.sources.set(sessionID, source);
|
|
29516
|
+
this.account(sessionID);
|
|
29517
|
+
}
|
|
29518
|
+
await forgotten;
|
|
29408
29519
|
}
|
|
29409
29520
|
async canFold(sessionID, reader) {
|
|
29410
29521
|
if (this.options.protocol !== 3) {
|
|
@@ -29505,7 +29616,7 @@ ${cached}
|
|
|
29505
29616
|
}
|
|
29506
29617
|
};
|
|
29507
29618
|
this.legacyUpgrades.set(draft.sessionID, { value, rows, started });
|
|
29508
|
-
await this.retainReplay(draft.sessionID, replay, `${draft.model.providerID}/${draft.model.id}`, cut.seq - 1);
|
|
29619
|
+
await this.retainReplay(draft.sessionID, replay, `${draft.model.providerID}/${draft.model.id}`, cut.seq - 1, reader.hostIdentity());
|
|
29509
29620
|
return true;
|
|
29510
29621
|
}
|
|
29511
29622
|
legacyUpgradeInput(sessionID, model) {
|
|
@@ -29513,8 +29624,16 @@ ${cached}
|
|
|
29513
29624
|
if (!pending)
|
|
29514
29625
|
return;
|
|
29515
29626
|
let reader;
|
|
29627
|
+
const open = () => {
|
|
29628
|
+
const opened = this.openReader(sessionID);
|
|
29629
|
+
if (foldDigest(opened.hostIdentity()) !== pending.value.proof.sourceDigest) {
|
|
29630
|
+
opened.close();
|
|
29631
|
+
throw new NativeReplayUnavailable("Host database file changed during upgrade");
|
|
29632
|
+
}
|
|
29633
|
+
return opened;
|
|
29634
|
+
};
|
|
29516
29635
|
const blobs = {
|
|
29517
|
-
mediaBlob: (hash) => (reader ??=
|
|
29636
|
+
mediaBlob: (hash) => (reader ??= open()).mediaBlob(hash)
|
|
29518
29637
|
};
|
|
29519
29638
|
try {
|
|
29520
29639
|
return pending.rows.filter((row) => row.seq > pending.value.replay.floor.after).flatMap((row) => {
|
|
@@ -29534,6 +29653,11 @@ ${cached}
|
|
|
29534
29653
|
const admissions = this.admissions;
|
|
29535
29654
|
if (!pending || !admissions)
|
|
29536
29655
|
return false;
|
|
29656
|
+
const recorded = this.memorySources.get(sessionID);
|
|
29657
|
+
if (recorded === undefined ? this.storage.holdsState(sessionID) || this.metadata.has(sessionID) : foldDigest(recorded) !== pending.value.proof.sourceDigest) {
|
|
29658
|
+
await this.discardCapture(sessionID);
|
|
29659
|
+
this.reportCaptureReplacement(sessionID);
|
|
29660
|
+
}
|
|
29537
29661
|
const replay = this.tail(sessionID)?.replay ?? pending.value.replay;
|
|
29538
29662
|
if (replay.blocked)
|
|
29539
29663
|
return false;
|
|
@@ -29571,13 +29695,16 @@ ${cached}
|
|
|
29571
29695
|
stripCheckpointRecentContext(rendered, row.data.summary ?? "");
|
|
29572
29696
|
return { row, rendered, submitted: row.data.summary ?? "" };
|
|
29573
29697
|
}
|
|
29574
|
-
async checkpointCovered(sessionID, checkpointID) {
|
|
29698
|
+
async checkpointCovered(sessionID, checkpointID, sourceIdentity) {
|
|
29575
29699
|
const admissions = this.admissions;
|
|
29576
29700
|
if (!admissions)
|
|
29577
29701
|
return;
|
|
29702
|
+
await this.fenceMemory(sessionID, sourceIdentity);
|
|
29578
29703
|
const pending = this.legacyUpgrades.get(sessionID);
|
|
29579
|
-
const
|
|
29580
|
-
|
|
29704
|
+
const sourceDigest = foldDigest(sourceIdentity);
|
|
29705
|
+
const saved = await this.readV3(sessionID);
|
|
29706
|
+
const value = saved?.proof.sourceDigest === sourceDigest ? saved : pending?.value;
|
|
29707
|
+
if (value?.proof.sourceDigest !== sourceDigest || value.replay.floor.kind !== "host-checkpoint" || value.replay.floor.id !== checkpointID || value.replay.withoutRecentContext)
|
|
29581
29708
|
return;
|
|
29582
29709
|
value.replay.withoutRecentContext = true;
|
|
29583
29710
|
const payload = encodeAdmissionV3(value);
|
|
@@ -29588,7 +29715,7 @@ ${cached}
|
|
|
29588
29715
|
});
|
|
29589
29716
|
const tail = this.tail(sessionID);
|
|
29590
29717
|
if (tail)
|
|
29591
|
-
await this.retainReplay(sessionID, value.replay, tail.model, tail.sourceSeq);
|
|
29718
|
+
await this.retainReplay(sessionID, value.replay, tail.model, tail.sourceSeq, sourceIdentity);
|
|
29592
29719
|
}
|
|
29593
29720
|
async removeAdmission(key) {
|
|
29594
29721
|
if (this.admissions?.remove)
|
|
@@ -29606,7 +29733,8 @@ ${cached}
|
|
|
29606
29733
|
if (!saved || !isLocalCheckpoint(cut) || cut.session_id !== sessionID)
|
|
29607
29734
|
return false;
|
|
29608
29735
|
const proof = saved.proof;
|
|
29609
|
-
|
|
29736
|
+
const source = reader.hostIdentity();
|
|
29737
|
+
if (proof.sourceDigest !== foldDigest(source) || proof.admissionID !== cut.id || proof.summaryDigest !== foldDigest(cut.data.summary ?? "")) {
|
|
29610
29738
|
this.report(sessionID, "replay refused: invalid checkpoint floor or provenance");
|
|
29611
29739
|
return false;
|
|
29612
29740
|
}
|
|
@@ -29622,17 +29750,17 @@ ${cached}
|
|
|
29622
29750
|
this.editedAdmissions.set(sessionID, { original: saved, replay });
|
|
29623
29751
|
this.staleHeads.add(sessionID);
|
|
29624
29752
|
this.invalidate(sessionID);
|
|
29625
|
-
await this.retainReplay(sessionID, replay, this.tail(sessionID)?.model ?? "", cut.seq - 1);
|
|
29753
|
+
await this.retainReplay(sessionID, replay, this.tail(sessionID)?.model ?? "", cut.seq - 1, source);
|
|
29626
29754
|
return false;
|
|
29627
29755
|
}
|
|
29628
29756
|
if (!this.floorCovered(sessionID, replay.floor, this.historyCoverage(sessionID, reader), replay))
|
|
29629
29757
|
return false;
|
|
29630
|
-
await this.retainReplay(sessionID, saved.replay, this.tail(sessionID)?.model ?? "", cut.seq - 1);
|
|
29758
|
+
await this.retainReplay(sessionID, saved.replay, this.tail(sessionID)?.model ?? "", cut.seq - 1, source);
|
|
29631
29759
|
if (proof.historyDigest !== historyDigest(reader, sessionID, cut.seq - 1, saved.replay.floor.after)) {
|
|
29632
29760
|
this.staleHeads.add(sessionID);
|
|
29633
29761
|
this.invalidate(sessionID);
|
|
29634
29762
|
this.editedAdmissions.set(sessionID, { original: saved, replay });
|
|
29635
|
-
await this.retainReplay(sessionID, saved.replay, this.tail(sessionID)?.model ?? "", cut.seq - 1);
|
|
29763
|
+
await this.retainReplay(sessionID, saved.replay, this.tail(sessionID)?.model ?? "", cut.seq - 1, source);
|
|
29636
29764
|
return false;
|
|
29637
29765
|
}
|
|
29638
29766
|
await this.storage.supply(sessionID, cut.id, JSON.stringify({
|
|
@@ -29684,6 +29812,7 @@ ${cached}
|
|
|
29684
29812
|
return false;
|
|
29685
29813
|
const reader = this.openReader(sessionID);
|
|
29686
29814
|
try {
|
|
29815
|
+
await this.fenceMemory(sessionID, reader.hostIdentity());
|
|
29687
29816
|
const cut = reader.latestCompaction(sessionID);
|
|
29688
29817
|
const proof = pending.original.proof;
|
|
29689
29818
|
const replay = this.tail(sessionID)?.replay ?? pending.replay;
|
|
@@ -29888,14 +30017,23 @@ ${cached}
|
|
|
29888
30017
|
}
|
|
29889
30018
|
return [...grouped].map(([row, messages]) => this.record(row, messages));
|
|
29890
30019
|
}
|
|
29891
|
-
async capture(draft, native, boundary, restoredFirstRow) {
|
|
30020
|
+
async capture(draft, native, draftSourceIdentity, boundary, restoredFirstRow) {
|
|
29892
30021
|
const release = this.storage.hold(draft.sessionID);
|
|
29893
30022
|
let replay;
|
|
30023
|
+
let capturedIdentity;
|
|
29894
30024
|
let sourceSeq = -1;
|
|
29895
30025
|
try {
|
|
29896
30026
|
rememberHostMedia(native);
|
|
29897
30027
|
const reader = this.openReader(draft.sessionID);
|
|
29898
30028
|
try {
|
|
30029
|
+
capturedIdentity = reader.hostIdentity();
|
|
30030
|
+
if (capturedIdentity !== draftSourceIdentity) {
|
|
30031
|
+
await this.discardCapture(draft.sessionID);
|
|
30032
|
+
this.reportCaptureReplacement(draft.sessionID);
|
|
30033
|
+
return;
|
|
30034
|
+
}
|
|
30035
|
+
await this.fenceMemory(draft.sessionID, capturedIdentity);
|
|
30036
|
+
this.memorySources.set(draft.sessionID, capturedIdentity);
|
|
29899
30037
|
if (this.options.protocol === 3) {
|
|
29900
30038
|
replay = await this.floorState(draft.sessionID, reader, boundary, draft);
|
|
29901
30039
|
if (!replay && restoredFirstRow) {
|
|
@@ -29945,6 +30083,7 @@ ${cached}
|
|
|
29945
30083
|
};
|
|
29946
30084
|
await this.storage.saveTail(draft.sessionID, JSON.stringify(tail), rows);
|
|
29947
30085
|
this.storage.truncate(draft.sessionID, through);
|
|
30086
|
+
this.memorySources.set(draft.sessionID, capturedIdentity);
|
|
29948
30087
|
this.loaded.set(draft.sessionID, through);
|
|
29949
30088
|
this.unavailable.delete(draft.sessionID);
|
|
29950
30089
|
this.changed.delete(draft.sessionID);
|
|
@@ -29960,17 +30099,31 @@ ${cached}
|
|
|
29960
30099
|
if (this.options.protocol === 3)
|
|
29961
30100
|
this.report(draft.sessionID, `capture unavailable: ${String(error)}`);
|
|
29962
30101
|
} finally {
|
|
29963
|
-
|
|
29964
|
-
|
|
30102
|
+
try {
|
|
30103
|
+
this.account(draft.sessionID);
|
|
30104
|
+
} finally {
|
|
30105
|
+
release();
|
|
30106
|
+
}
|
|
29965
30107
|
}
|
|
29966
30108
|
if (replay) {
|
|
29967
|
-
await this.retainReplay(draft.sessionID, replay, `${draft.model.providerID}/${draft.model.id}`, sourceSeq);
|
|
30109
|
+
await this.retainReplay(draft.sessionID, replay, `${draft.model.providerID}/${draft.model.id}`, sourceSeq, draftSourceIdentity);
|
|
29968
30110
|
const reader = this.openReader(draft.sessionID);
|
|
29969
30111
|
try {
|
|
29970
|
-
|
|
30112
|
+
const identity = reader.hostIdentity();
|
|
30113
|
+
if (identity !== capturedIdentity) {
|
|
30114
|
+
await this.discardCapture(draft.sessionID);
|
|
30115
|
+
this.reportCaptureReplacement(draft.sessionID);
|
|
30116
|
+
return;
|
|
30117
|
+
}
|
|
30118
|
+
const sourceDigest = foldDigest(identity);
|
|
30119
|
+
await this.saveCapturedReplay(draft.sessionID, replay, reader, sourceDigest);
|
|
29971
30120
|
const saved = await this.readV3(draft.sessionID);
|
|
29972
30121
|
const cut = reader.latestCompaction(draft.sessionID);
|
|
29973
30122
|
if (saved && !this.editedAdmissions.has(draft.sessionID) && cut?.id === saved.proof.admissionID && (replay.floor.after > saved.replay.floor.after || !this.floorCovered(draft.sessionID, saved.replay.floor, this.historyCoverage(draft.sessionID, reader), saved.replay)) && (boundary && this.servedBaseline(draft) === boundary.summary || replay.floor.kind === "start" && restoredFirstRow === replay.floor.id)) {
|
|
30123
|
+
if (saved.proof.sourceDigest !== sourceDigest) {
|
|
30124
|
+
this.reportOnce(draft.sessionID, this.reportedForeignRefreshes, "v3 host fold: admission refresh skipped: admission belongs to a different host database file");
|
|
30125
|
+
return;
|
|
30126
|
+
}
|
|
29974
30127
|
const value = {
|
|
29975
30128
|
...saved,
|
|
29976
30129
|
replay: {
|
|
@@ -30003,13 +30156,18 @@ ${cached}
|
|
|
30003
30156
|
try {
|
|
30004
30157
|
return await this.supplyHeld(args);
|
|
30005
30158
|
} finally {
|
|
30006
|
-
|
|
30007
|
-
|
|
30159
|
+
try {
|
|
30160
|
+
this.account(args.draft.sessionID);
|
|
30161
|
+
} finally {
|
|
30162
|
+
release();
|
|
30163
|
+
}
|
|
30008
30164
|
}
|
|
30009
30165
|
}
|
|
30010
30166
|
async supplyHeld(args) {
|
|
30011
30167
|
const { draft, reader, summary } = args;
|
|
30012
30168
|
const stored = args.checkpointText ?? summary;
|
|
30169
|
+
const source = reader.hostIdentity();
|
|
30170
|
+
await this.fenceMemory(draft.sessionID, source);
|
|
30013
30171
|
if (this.options.protocol === 3) {
|
|
30014
30172
|
if (this.unprovenControls.has(draft.sessionID))
|
|
30015
30173
|
return false;
|
|
@@ -30034,7 +30192,7 @@ ${cached}
|
|
|
30034
30192
|
if (!args.manual && this.tail(draft.sessionID)?.model !== model)
|
|
30035
30193
|
this.storage.replaceRows(draft.sessionID, reader.latestSequence(draft.sessionID), []);
|
|
30036
30194
|
if (!args.manual)
|
|
30037
|
-
await this.retainReplay(draft.sessionID, replay, model, reader.latestSequence(draft.sessionID));
|
|
30195
|
+
await this.retainReplay(draft.sessionID, replay, model, reader.latestSequence(draft.sessionID), source);
|
|
30038
30196
|
if (!args.manual)
|
|
30039
30197
|
await this.storage.supply(draft.sessionID, running.id, JSON.stringify({
|
|
30040
30198
|
source: this.storage.sourceID,
|
|
@@ -30096,7 +30254,7 @@ ${cached}
|
|
|
30096
30254
|
this.invalidate(draft.sessionID);
|
|
30097
30255
|
this.cancelLegacyUpgrade(draft.sessionID);
|
|
30098
30256
|
this.cancelEditedAdmission(draft.sessionID);
|
|
30099
|
-
await this.retainReplay(draft.sessionID, replay, model, running.seq - 1);
|
|
30257
|
+
await this.retainReplay(draft.sessionID, replay, model, running.seq - 1, source);
|
|
30100
30258
|
await this.storage.supply(draft.sessionID, running.id, JSON.stringify({
|
|
30101
30259
|
source: this.storage.sourceID,
|
|
30102
30260
|
sessionID: draft.sessionID,
|
|
@@ -30129,6 +30287,7 @@ ${cached}
|
|
|
30129
30287
|
baseline: tail?.baseline ?? summary,
|
|
30130
30288
|
sourceSeq: Math.max(tail?.sourceSeq ?? through, ...fresh.map((row) => row.seq))
|
|
30131
30289
|
}), records);
|
|
30290
|
+
this.memorySources.set(draft.sessionID, source);
|
|
30132
30291
|
this.dirty.delete(draft.sessionID);
|
|
30133
30292
|
this.metadata.delete(draft.sessionID);
|
|
30134
30293
|
this.metadataThrough.delete(draft.sessionID);
|
|
@@ -30157,13 +30316,16 @@ ${cached}
|
|
|
30157
30316
|
}
|
|
30158
30317
|
return true;
|
|
30159
30318
|
}
|
|
30160
|
-
async restore(sessionID, cut, model, options = {}) {
|
|
30319
|
+
async restore(sessionID, cut, model, passSource, options = {}) {
|
|
30161
30320
|
let replay;
|
|
30162
30321
|
let controls = [];
|
|
30163
30322
|
let after;
|
|
30323
|
+
await this.fenceMemory(sessionID, passSource);
|
|
30164
30324
|
if (this.options.protocol === 3) {
|
|
30165
30325
|
const reader = this.openReader(sessionID);
|
|
30166
30326
|
try {
|
|
30327
|
+
if (reader.hostIdentity() !== passSource)
|
|
30328
|
+
throw new NativeReplayUnavailable("Host database file changed during restore");
|
|
30167
30329
|
replay = await this.floorState(sessionID, reader);
|
|
30168
30330
|
if (replay) {
|
|
30169
30331
|
controls = controlsThrough(replay.controls, reader, sessionID, cut.seq - 1);
|
|
@@ -30187,20 +30349,32 @@ ${cached}
|
|
|
30187
30349
|
const release = this.storage.hold(sessionID);
|
|
30188
30350
|
let result;
|
|
30189
30351
|
try {
|
|
30190
|
-
result = await this.restoreHeld(sessionID, cut, model, options);
|
|
30352
|
+
result = await this.restoreHeld(sessionID, cut, model, options, passSource);
|
|
30191
30353
|
} finally {
|
|
30192
|
-
|
|
30193
|
-
|
|
30354
|
+
try {
|
|
30355
|
+
this.account(sessionID);
|
|
30356
|
+
} finally {
|
|
30357
|
+
release();
|
|
30358
|
+
}
|
|
30194
30359
|
}
|
|
30195
30360
|
if (replay) {
|
|
30196
|
-
await this.retainReplay(sessionID, replay, model, cut.seq - 1);
|
|
30361
|
+
await this.retainReplay(sessionID, replay, model, cut.seq - 1, passSource);
|
|
30197
30362
|
return result && insertControls(result, controls, nativeRowID);
|
|
30198
30363
|
}
|
|
30199
30364
|
return result;
|
|
30200
30365
|
}
|
|
30201
|
-
async restoreHeld(sessionID, cut, model, options) {
|
|
30366
|
+
async restoreHeld(sessionID, cut, model, options, expected) {
|
|
30202
30367
|
if (!isLocalCheckpoint(cut))
|
|
30203
30368
|
return;
|
|
30369
|
+
const open = () => {
|
|
30370
|
+
const opened = this.openReader(sessionID);
|
|
30371
|
+
if (opened.hostIdentity() !== expected) {
|
|
30372
|
+
opened.close();
|
|
30373
|
+
throw new NativeReplayUnavailable("Host database file changed during restore");
|
|
30374
|
+
}
|
|
30375
|
+
this.memorySources.set(sessionID, expected);
|
|
30376
|
+
return opened;
|
|
30377
|
+
};
|
|
30204
30378
|
const resolvedModel = {
|
|
30205
30379
|
providerID: model.slice(0, model.indexOf("/")),
|
|
30206
30380
|
id: model.slice(model.indexOf("/") + 1)
|
|
@@ -30216,13 +30390,13 @@ ${cached}
|
|
|
30216
30390
|
const max = this.storage.db.prepare("SELECT COALESCE(MAX(id),0) AS id FROM m0_mutation_log WHERE session_id=?").get(sessionID);
|
|
30217
30391
|
const boundary = this.storage.db.prepare("SELECT cached_m0_last_baseline_end_message_id AS id FROM session_meta WHERE session_id=?").get(sessionID)?.id;
|
|
30218
30392
|
if (max.id <= (state.cachedM0MaxMutationId ?? 0) && boundary) {
|
|
30219
|
-
after = this.storage.sequenceForID(sessionID, boundary) ?? (reader =
|
|
30393
|
+
after = this.storage.sequenceForID(sessionID, boundary) ?? (reader = open()).sequenceForId(sessionID, boundary) ?? -1;
|
|
30220
30394
|
}
|
|
30221
30395
|
}
|
|
30222
30396
|
const through = cut.seq - 1;
|
|
30223
30397
|
let metadata = this.metadata.get(sessionID);
|
|
30224
30398
|
if (!metadata || (this.metadataThrough.get(sessionID) ?? -1) < through || this.options.protocol === 3 && this.options.rendersHistory?.(sessionID) && (this.metadataAfter.get(sessionID) ?? -1) > after) {
|
|
30225
|
-
reader ??=
|
|
30399
|
+
reader ??= open();
|
|
30226
30400
|
metadata = reader.rowStampsThrough(sessionID, through, this.options.protocol === 3 ? after : undefined).filter(conversational);
|
|
30227
30401
|
this.metadata.set(sessionID, metadata);
|
|
30228
30402
|
this.metadataThrough.set(sessionID, through);
|
|
@@ -30230,7 +30404,7 @@ ${cached}
|
|
|
30230
30404
|
}
|
|
30231
30405
|
const required = metadata.filter((row) => row.seq > after && row.seq <= through);
|
|
30232
30406
|
if (this.dirty.has(sessionID) || !tail || (this.loaded.get(sessionID) ?? -1) < through && !this.storage.admission(sessionID, cut.id) || !this.storage.containsRows(sessionID, required.map((row) => row.id))) {
|
|
30233
|
-
const source = reader ??=
|
|
30407
|
+
const source = reader ??= open();
|
|
30234
30408
|
const fresh = source.range(sessionID, after, through).filter(conversational);
|
|
30235
30409
|
const records = fresh.map((row) => this.record(row, this.rendered(row, resolvedModel, source)));
|
|
30236
30410
|
const restored = new Set(records.map((row) => row.id));
|
|
@@ -30260,9 +30434,11 @@ ${cached}
|
|
|
30260
30434
|
}
|
|
30261
30435
|
return messages;
|
|
30262
30436
|
}
|
|
30263
|
-
async restoreRead(sessionID, cut, model) {
|
|
30437
|
+
async restoreRead(sessionID, cut, model, passSource) {
|
|
30264
30438
|
const reader = this.openReader(sessionID);
|
|
30265
30439
|
try {
|
|
30440
|
+
if (reader.hostIdentity() !== passSource)
|
|
30441
|
+
throw new NativeReplayUnavailable("Host checkpoint replay boundary is unavailable");
|
|
30266
30442
|
const replay = this.options.protocol === 3 ? await this.floorState(sessionID, reader) : undefined;
|
|
30267
30443
|
if (this.options.protocol === 3 && !replay) {
|
|
30268
30444
|
this.report(sessionID, "replay refused: missing usable checkpoint boundary");
|
|
@@ -30289,6 +30465,7 @@ ${cached}
|
|
|
30289
30465
|
}
|
|
30290
30466
|
clear(sessionID) {
|
|
30291
30467
|
this.sources.delete(sessionID);
|
|
30468
|
+
this.memorySources.delete(sessionID);
|
|
30292
30469
|
this.metadata.delete(sessionID);
|
|
30293
30470
|
this.metadataThrough.delete(sessionID);
|
|
30294
30471
|
this.metadataAfter.delete(sessionID);
|
|
@@ -30303,6 +30480,8 @@ ${cached}
|
|
|
30303
30480
|
if (this.stampMRU?.sessionID === sessionID)
|
|
30304
30481
|
this.stampMRU = undefined;
|
|
30305
30482
|
this.unprovenControls.delete(sessionID);
|
|
30483
|
+
this.reportedCaptureReplacements.delete(sessionID);
|
|
30484
|
+
this.reportedForeignRefreshes.delete(sessionID);
|
|
30306
30485
|
this.cancelLegacyUpgrade(sessionID);
|
|
30307
30486
|
this.cancelEditedAdmission(sessionID);
|
|
30308
30487
|
if (this.admissions)
|
|
@@ -34705,15 +34884,39 @@ function hasCurrentDocsProposal(projectDir) {
|
|
|
34705
34884
|
const hashes = docsBaseHashes(projectDir);
|
|
34706
34885
|
return listPendingDocsProposals(projectDir).some((path) => Object.entries(hashes).every(([name, value]) => readFileSync6(path, "utf8").includes(`Base SHA-256 ${name}: ${value}`)));
|
|
34707
34886
|
}
|
|
34708
|
-
function git(projectDir, args) {
|
|
34887
|
+
function git(projectDir, args, options) {
|
|
34709
34888
|
return execFileSync("git", args, {
|
|
34710
34889
|
windowsHide: true,
|
|
34711
34890
|
cwd: projectDir,
|
|
34712
34891
|
encoding: "utf8",
|
|
34713
34892
|
timeout: 1e4,
|
|
34714
|
-
maxBuffer: 2000000
|
|
34893
|
+
maxBuffer: 2000000,
|
|
34894
|
+
...options
|
|
34715
34895
|
}).trim();
|
|
34716
34896
|
}
|
|
34897
|
+
function gitExitStatus(error) {
|
|
34898
|
+
if (!error || typeof error !== "object")
|
|
34899
|
+
return;
|
|
34900
|
+
const { status, code, signal } = error;
|
|
34901
|
+
return typeof status === "number" && !code && !signal ? status : undefined;
|
|
34902
|
+
}
|
|
34903
|
+
function isCheckpointCommit(projectDir, anchor) {
|
|
34904
|
+
if (typeof anchor !== "string" || !/^[a-f0-9]{40}$/.test(anchor))
|
|
34905
|
+
return false;
|
|
34906
|
+
try {
|
|
34907
|
+
return git(projectDir, ["cat-file", "-t", anchor], { stdio: "pipe" }) === "commit";
|
|
34908
|
+
} catch (error) {
|
|
34909
|
+
if (gitExitStatus(error) === undefined)
|
|
34910
|
+
throw error;
|
|
34911
|
+
try {
|
|
34912
|
+
git(projectDir, ["cat-file", "-e", anchor], { stdio: "pipe" });
|
|
34913
|
+
} catch (existenceError) {
|
|
34914
|
+
if (gitExitStatus(existenceError) === 1)
|
|
34915
|
+
return false;
|
|
34916
|
+
}
|
|
34917
|
+
throw error;
|
|
34918
|
+
}
|
|
34919
|
+
}
|
|
34717
34920
|
function gitOutputPrefix(projectDir, args) {
|
|
34718
34921
|
try {
|
|
34719
34922
|
return git(projectDir, args);
|
|
@@ -34734,14 +34937,16 @@ function docsChangeSet(projectDir, storedAnchor) {
|
|
|
34734
34937
|
if (realpathSync(git(projectDir, ["rev-parse", "--show-toplevel"])) !== realpathSync(projectDir))
|
|
34735
34938
|
return null;
|
|
34736
34939
|
const head = git(projectDir, ["rev-parse", "HEAD"]);
|
|
34737
|
-
const recorded = Boolean(storedAnchor);
|
|
34738
34940
|
let anchor = storedAnchor;
|
|
34739
|
-
|
|
34740
|
-
|
|
34941
|
+
const recovered = anchor != null && !isCheckpointCommit(projectDir, anchor);
|
|
34942
|
+
if (recovered)
|
|
34943
|
+
anchor = undefined;
|
|
34944
|
+
const recorded = Boolean(anchor);
|
|
34741
34945
|
if (!anchor)
|
|
34742
34946
|
anchor = git(projectDir, ["log", "-1", "--format=%H", "--", ...FILES]);
|
|
34947
|
+
const emptyRecovery = recovered ? { head, text: "", unchanged: false, relevant: false, recoveredAnchor: anchor || null } : null;
|
|
34743
34948
|
if (!anchor)
|
|
34744
|
-
return
|
|
34949
|
+
return emptyRecovery;
|
|
34745
34950
|
if (recorded && anchor === head)
|
|
34746
34951
|
return { head, text: "", unchanged: true, relevant: false };
|
|
34747
34952
|
if (recorded) {
|
|
@@ -34843,7 +35048,7 @@ ${stat}`
|
|
|
34843
35048
|
...excluded.map((path) => `:(exclude)${path}`)
|
|
34844
35049
|
]);
|
|
34845
35050
|
if (!raw)
|
|
34846
|
-
return
|
|
35051
|
+
return emptyRecovery;
|
|
34847
35052
|
const commits = raw.split(/^commit /m);
|
|
34848
35053
|
const text = raw.slice(0, 24000);
|
|
34849
35054
|
return {
|
|
@@ -34852,7 +35057,8 @@ ${stat}`
|
|
|
34852
35057
|
relevant: true,
|
|
34853
35058
|
text: `${text}${raw.length > text.length ? `
|
|
34854
35059
|
[cut ${raw.length - text.length} bytes]` : ""}${commits.length > 201 ? `
|
|
34855
|
-
[cut commits beyond newest 200]` : ""}
|
|
35060
|
+
[cut commits beyond newest 200]` : ""}`,
|
|
35061
|
+
...recovered ? { recoveredAnchor: anchor } : {}
|
|
34856
35062
|
};
|
|
34857
35063
|
} catch (error) {
|
|
34858
35064
|
if (storedAnchor)
|
|
@@ -40700,6 +40906,9 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
40700
40906
|
anchor = JSON.parse(storedAnchor ?? "null")?.head;
|
|
40701
40907
|
} catch {}
|
|
40702
40908
|
const changes = task === "maintain-docs" ? docsChangeSet(docsDir, anchor) : null;
|
|
40909
|
+
if (changes?.recoveredAnchor !== undefined) {
|
|
40910
|
+
log2("[dreamer] maintain-docs: stored checkpoint was no longer a commit; restarted from the docs files' last commit, if any");
|
|
40911
|
+
}
|
|
40703
40912
|
const existingDocs = task === "maintain-docs" ? {
|
|
40704
40913
|
architecture: existsSync7(`${docsDir}/ARCHITECTURE.md`),
|
|
40705
40914
|
structure: existsSync7(`${docsDir}/STRUCTURE.md`)
|
|
@@ -40769,7 +40978,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
40769
40978
|
return { status: "completed", detail: reason };
|
|
40770
40979
|
}
|
|
40771
40980
|
if (task === "maintain-docs" && changes && (changes.unchanged || !changes.relevant)) {
|
|
40772
|
-
const reason = changes.unchanged ? "no commits since last run" : "diff does not describe a documented area";
|
|
40981
|
+
const reason = changes.unchanged ? "no commits since last run" : changes.recoveredAnchor !== undefined ? "no relevant commits or no git repository" : "diff does not describe a documented area";
|
|
40773
40982
|
helpers.recordRun("completed", null, { progress: reason });
|
|
40774
40983
|
return {
|
|
40775
40984
|
status: "completed",
|
|
@@ -40780,7 +40989,15 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
40780
40989
|
if (task === "maintain-docs" && hasCurrentDocsProposal(docsDir)) {
|
|
40781
40990
|
const reason = "pending proposal matches current docs";
|
|
40782
40991
|
helpers.recordRun("completed", null, { progress: reason });
|
|
40783
|
-
return {
|
|
40992
|
+
return {
|
|
40993
|
+
status: "completed",
|
|
40994
|
+
detail: reason,
|
|
40995
|
+
...changes?.recoveredAnchor ? {
|
|
40996
|
+
schedulePatch: {
|
|
40997
|
+
taskStateJson: JSON.stringify({ head: changes.recoveredAnchor })
|
|
40998
|
+
}
|
|
40999
|
+
} : {}
|
|
41000
|
+
};
|
|
40784
41001
|
}
|
|
40785
41002
|
const curateChunks = curateMemories ? chunkCurateMemories(curateMemories, Math.max(4000, Math.floor(resolveRetrospectiveUsableInputTokens(config, deps) * 2))) : [];
|
|
40786
41003
|
const batches = task === "curate" ? curateChunks : [{ memories: [], crossChunkCandidates: [] }];
|
|
@@ -42939,7 +43156,10 @@ class V2RevertMessageCleanup {
|
|
|
42939
43156
|
sessionId: sessionID,
|
|
42940
43157
|
isInHostStore: (id) => source.sequenceForId(sessionID, id) !== undefined,
|
|
42941
43158
|
removedByCommittedRevert: removed,
|
|
42942
|
-
onRetire: () =>
|
|
43159
|
+
onRetire: () => {
|
|
43160
|
+
clearRecompStaging(db, sessionID);
|
|
43161
|
+
return;
|
|
43162
|
+
}
|
|
42943
43163
|
});
|
|
42944
43164
|
if (result.kind !== "unresolved") {
|
|
42945
43165
|
this.pendingHistory = this.pendingHistory.filter((proof) => proof.sessionID !== sessionID);
|
|
@@ -43233,6 +43453,7 @@ function hasRequiredSessionAPI(session) {
|
|
|
43233
43453
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
43234
43454
|
import { existsSync as existsSync8 } from "node:fs";
|
|
43235
43455
|
var LEASE_TTL_MS = 10 * 60 * 1000;
|
|
43456
|
+
var DEAD_DIRECTORY_RECHECK_MS = 24 * 60 * 60 * 1000;
|
|
43236
43457
|
var SESSION_PAGE_SIZE = 100;
|
|
43237
43458
|
var SESSION_QUERY_CHUNK_SIZE = 250;
|
|
43238
43459
|
var YIELD_EVERY_PROCESSED_SESSIONS = 25;
|
|
@@ -43276,13 +43497,27 @@ function withImmediateTransaction(db, fn) {
|
|
|
43276
43497
|
function defaultYieldFn() {
|
|
43277
43498
|
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
43278
43499
|
}
|
|
43500
|
+
function readBackfillLease(db, harness) {
|
|
43501
|
+
return db.prepare(`SELECT status, lease_expires_at
|
|
43502
|
+
FROM session_project_backfill_state
|
|
43503
|
+
WHERE harness = ?`).get(harness);
|
|
43504
|
+
}
|
|
43505
|
+
function isCompletedAndNotDue(lease, now) {
|
|
43506
|
+
return lease?.status === "completed" && (lease.lease_expires_at === null || lease.lease_expires_at > now);
|
|
43507
|
+
}
|
|
43279
43508
|
function acquireBackfillLease(db, harness, holderId, now) {
|
|
43509
|
+
try {
|
|
43510
|
+
if (isCompletedAndNotDue(readBackfillLease(db, harness), now))
|
|
43511
|
+
return "already_completed";
|
|
43512
|
+
} catch (error) {
|
|
43513
|
+
if (!(error instanceof Error) || error.message !== "no such table: session_project_backfill_state") {
|
|
43514
|
+
throw error;
|
|
43515
|
+
}
|
|
43516
|
+
}
|
|
43280
43517
|
ensureBackfillStateTable(db);
|
|
43281
43518
|
return withImmediateTransaction(db, () => {
|
|
43282
|
-
const current = db
|
|
43283
|
-
|
|
43284
|
-
WHERE harness = ?`).get(harness);
|
|
43285
|
-
if (current?.status === "completed")
|
|
43519
|
+
const current = readBackfillLease(db, harness);
|
|
43520
|
+
if (isCompletedAndNotDue(current, now))
|
|
43286
43521
|
return "already_completed";
|
|
43287
43522
|
if (current?.status === "running" && current.lease_expires_at !== null && current.lease_expires_at > now) {
|
|
43288
43523
|
return "blocked_by_lease";
|
|
@@ -43311,11 +43546,11 @@ function renewBackfillLease(db, harness, holderId, now) {
|
|
|
43311
43546
|
SET lease_expires_at = ?
|
|
43312
43547
|
WHERE harness = ? AND status = 'running' AND holder_id = ?`).run(now + LEASE_TTL_MS, harness, holderId).changes === 1;
|
|
43313
43548
|
}
|
|
43314
|
-
function markBackfillCompleted(db, harness, holderId, now) {
|
|
43549
|
+
function markBackfillCompleted(db, harness, holderId, now, recheckAt) {
|
|
43315
43550
|
ensureBackfillStateTable(db);
|
|
43316
43551
|
return db.prepare(`UPDATE session_project_backfill_state
|
|
43317
|
-
SET status = 'completed', lease_expires_at =
|
|
43318
|
-
WHERE harness = ? AND status = 'running' AND holder_id = ?`).run(now, harness, holderId).changes === 1;
|
|
43552
|
+
SET status = 'completed', lease_expires_at = ?, completed_at = ?
|
|
43553
|
+
WHERE harness = ? AND status = 'running' AND holder_id = ?`).run(recheckAt, now, harness, holderId).changes === 1;
|
|
43319
43554
|
}
|
|
43320
43555
|
function markBackfillRetryPending(db, harness, holderId, now) {
|
|
43321
43556
|
ensureBackfillStateTable(db);
|
|
@@ -43358,9 +43593,10 @@ function createPageReader(source) {
|
|
|
43358
43593
|
if (typeof source === "function") {
|
|
43359
43594
|
return async (afterSessionId, limit) => source(afterSessionId, limit);
|
|
43360
43595
|
}
|
|
43361
|
-
|
|
43596
|
+
let sessions;
|
|
43362
43597
|
let offset = 0;
|
|
43363
43598
|
return async (_afterSessionId, limit) => {
|
|
43599
|
+
sessions ??= dedupeSessions(source);
|
|
43364
43600
|
const page = sessions.slice(offset, offset + limit);
|
|
43365
43601
|
offset += page.length;
|
|
43366
43602
|
return page;
|
|
@@ -43376,7 +43612,6 @@ async function runSessionProjectBackfillPass(db, source, options = {}) {
|
|
|
43376
43612
|
const resolveIdentity = options.resolveIdentity ?? ((directory) => resolveProjectIdentityForSession(directory, options.allowHomeProject));
|
|
43377
43613
|
const yieldFn = options.yieldFn ?? defaultYieldFn;
|
|
43378
43614
|
const holderId = options.holderId ?? randomUUID6();
|
|
43379
|
-
const readPage = createPageReader(source);
|
|
43380
43615
|
const result = {
|
|
43381
43616
|
status: "completed",
|
|
43382
43617
|
totalSessions: 0,
|
|
@@ -43387,13 +43622,15 @@ async function runSessionProjectBackfillPass(db, source, options = {}) {
|
|
|
43387
43622
|
skippedEmptyDirectories: 0,
|
|
43388
43623
|
durationMs: 0
|
|
43389
43624
|
};
|
|
43390
|
-
const
|
|
43625
|
+
const baseLeaseKey = options.leaseKey ?? harness;
|
|
43626
|
+
const leaseKey = options.allowHomeProject ? `${baseLeaseKey}:allow-home-project` : baseLeaseKey;
|
|
43391
43627
|
const leaseStatus = acquireBackfillLease(db, leaseKey, holderId, now());
|
|
43392
43628
|
if (leaseStatus !== "acquired") {
|
|
43393
43629
|
result.status = leaseStatus;
|
|
43394
43630
|
result.durationMs = performance.now() - startedAt;
|
|
43395
43631
|
return result;
|
|
43396
43632
|
}
|
|
43633
|
+
const readPage = createPageReader(source);
|
|
43397
43634
|
const finishWithLostLease = () => {
|
|
43398
43635
|
result.status = "lost_lease";
|
|
43399
43636
|
result.durationMs = performance.now() - startedAt;
|
|
@@ -43485,13 +43722,9 @@ async function runSessionProjectBackfillPass(db, source, options = {}) {
|
|
|
43485
43722
|
if (sourcePage.length < SESSION_PAGE_SIZE)
|
|
43486
43723
|
break;
|
|
43487
43724
|
}
|
|
43488
|
-
const
|
|
43489
|
-
|
|
43490
|
-
|
|
43491
|
-
return finishWithLostLease();
|
|
43492
|
-
}
|
|
43493
|
-
result.status = "retry_pending";
|
|
43494
|
-
} else if (!markBackfillCompleted(db, leaseKey, holderId, now())) {
|
|
43725
|
+
const completedAt = now();
|
|
43726
|
+
const recheckAt = result.skippedDeadDirectories > 0 ? completedAt + DEAD_DIRECTORY_RECHECK_MS : null;
|
|
43727
|
+
if (!markBackfillCompleted(db, leaseKey, holderId, completedAt, recheckAt)) {
|
|
43495
43728
|
return finishWithLostLease();
|
|
43496
43729
|
}
|
|
43497
43730
|
result.durationMs = performance.now() - startedAt;
|
|
@@ -55465,10 +55698,11 @@ function createCtxExpandTool(deps) {
|
|
|
55465
55698
|
}
|
|
55466
55699
|
const { start, end, verbose } = mode;
|
|
55467
55700
|
const lastCompartmentEnd = getLastCompartmentEndMessage(deps.db, sessionId);
|
|
55468
|
-
|
|
55469
|
-
|
|
55470
|
-
|
|
55471
|
-
const
|
|
55701
|
+
const refusal = unresolvedLiveTailRefusal2(deps.db, sessionId, start, end, lastCompartmentEnd);
|
|
55702
|
+
if (refusal)
|
|
55703
|
+
return refusal;
|
|
55704
|
+
const liveTailAfter = lastCompartmentEnd >= 0 && start > lastCompartmentEnd ? lastCompartmentEnd : undefined;
|
|
55705
|
+
const effectiveEnd = lastCompartmentEnd >= start ? Math.min(end, lastCompartmentEnd) : end;
|
|
55472
55706
|
if (verbose && source) {
|
|
55473
55707
|
if (!path)
|
|
55474
55708
|
throw new Error("Search archive worker unavailable: private archive has no off-thread source");
|
|
@@ -55477,13 +55711,14 @@ function createCtxExpandTool(deps) {
|
|
|
55477
55711
|
start,
|
|
55478
55712
|
end: effectiveEnd,
|
|
55479
55713
|
tokenBudget: CTX_EXPAND_TOKEN_BUDGET,
|
|
55480
|
-
expandTools: deps.expandTools
|
|
55714
|
+
expandTools: deps.expandTools,
|
|
55715
|
+
liveTailAfter
|
|
55481
55716
|
});
|
|
55482
55717
|
if (text === null)
|
|
55483
55718
|
throw new Error("Search archive worker unavailable: unexpected verbose reply");
|
|
55484
55719
|
return text;
|
|
55485
55720
|
}
|
|
55486
|
-
const archived = await renderSearchArchiveOffThread2(deps.db, sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET);
|
|
55721
|
+
const archived = await renderSearchArchiveOffThread2(deps.db, sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET, false, liveTailAfter);
|
|
55487
55722
|
if (archived)
|
|
55488
55723
|
return archived;
|
|
55489
55724
|
if (verbose) {
|
|
@@ -57272,8 +57507,7 @@ function createCtxSearchTool(deps) {
|
|
|
57272
57507
|
return `Error: ${error.message}`;
|
|
57273
57508
|
throw error;
|
|
57274
57509
|
}
|
|
57275
|
-
const
|
|
57276
|
-
const messageOrdinalCutoff = lastCompartmentEnd >= 0 ? lastCompartmentEnd : 0;
|
|
57510
|
+
const messageOrdinalCutoff = Math.max(0, getLastCompartmentEndMessage(deps.db, toolContext.sessionID));
|
|
57277
57511
|
const visibleMemoryIds = getVisibleMemoryIds(deps.db, toolContext.sessionID);
|
|
57278
57512
|
const diagnostics = createUnifiedSearchDiagnostics2();
|
|
57279
57513
|
const projectPath = deps.resolveProjectPath(toolContext.directory);
|
|
@@ -57309,6 +57543,7 @@ function createCtxSearchTool(deps) {
|
|
|
57309
57543
|
isEmbeddingRuntimeEnabled: () => embeddingEnabled === true,
|
|
57310
57544
|
readMessages: deps.readMessages,
|
|
57311
57545
|
maxMessageOrdinal: messageOrdinalCutoff,
|
|
57546
|
+
includeDroppedTailMessages: true,
|
|
57312
57547
|
gitCommitsEnabled,
|
|
57313
57548
|
sources: normalizeSources(args.sources),
|
|
57314
57549
|
visibleMemoryIds,
|
|
@@ -57916,7 +58151,10 @@ function checkHistoryBoundary(db, reader, sessionID) {
|
|
|
57916
58151
|
db,
|
|
57917
58152
|
sessionId: sessionID,
|
|
57918
58153
|
isInHostStore: (messageId) => storeHasSession ? reader.sequenceForId(sessionID, messageId) !== undefined : null,
|
|
57919
|
-
onRetire: () =>
|
|
58154
|
+
onRetire: () => {
|
|
58155
|
+
clearRecompStaging(db, sessionID);
|
|
58156
|
+
return;
|
|
58157
|
+
}
|
|
57920
58158
|
});
|
|
57921
58159
|
} catch (error) {
|
|
57922
58160
|
sessionLog2(sessionID, "history boundary check failed; continuing without repair", error);
|
|
@@ -59650,11 +59888,12 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59650
59888
|
let recordedHead;
|
|
59651
59889
|
let upgradeCheckpointSequence;
|
|
59652
59890
|
let restoredFirstRow;
|
|
59891
|
+
let draftSourceIdentity;
|
|
59653
59892
|
try {
|
|
59654
59893
|
syntheticIDs = await readSyntheticProvenance(reader, draft.messages);
|
|
59655
59894
|
const cut = reader.latestCompaction(draft.sessionID);
|
|
59656
59895
|
if (nativeFoldReplay)
|
|
59657
|
-
await nativeFoldReplay.observeSource(draft.sessionID, reader);
|
|
59896
|
+
draftSourceIdentity = await nativeFoldReplay.observeSource(draft.sessionID, reader);
|
|
59658
59897
|
const boundaryRepair = !rustModeModuleClient && db && !compactionOff ? revertMessageCleanup.retireProvenHistory(db, draft.sessionID, reader) ?? checkHistoryBoundary(db, reader, draft.sessionID) : undefined;
|
|
59659
59898
|
if (boundaryRepair?.kind === "repaired" || boundaryRepair?.kind === "baseline-reset") {
|
|
59660
59899
|
historyRefreshSessions.add(draft.sessionID);
|
|
@@ -59694,13 +59933,14 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59694
59933
|
}
|
|
59695
59934
|
}
|
|
59696
59935
|
let nativeRestored = localCut ? nativeFoldReplay?.legacyUpgradeInput(draft.sessionID, draft.model) : undefined;
|
|
59697
|
-
if (nativeRestored === undefined && cut && nativeFoldReplay && await nativeFoldReplay.admits(draft.sessionID, cut, reader)) {
|
|
59936
|
+
if (nativeRestored === undefined && cut && nativeFoldReplay && draftSourceIdentity !== undefined && await nativeFoldReplay.admits(draft.sessionID, cut, reader)) {
|
|
59937
|
+
const passSource = draftSourceIdentity;
|
|
59698
59938
|
try {
|
|
59699
|
-
nativeRestored = await nativeFoldReplay.restore(draft.sessionID, cut, `${draft.model.providerID}/${draft.model.id}`, { bounded: !rustModeModuleClient });
|
|
59939
|
+
nativeRestored = await nativeFoldReplay.restore(draft.sessionID, cut, `${draft.model.providerID}/${draft.model.id}`, passSource, { bounded: !rustModeModuleClient });
|
|
59700
59940
|
} catch (error) {
|
|
59701
59941
|
nativeFoldReplay.invalidate(draft.sessionID, true);
|
|
59702
59942
|
sessionLog2(draft.sessionID, "v2 host fold: cache unavailable; restoring host rows", error);
|
|
59703
|
-
nativeRestored = await nativeFoldReplay.restoreRead(draft.sessionID, cut, draft.model);
|
|
59943
|
+
nativeRestored = await nativeFoldReplay.restoreRead(draft.sessionID, cut, draft.model, passSource);
|
|
59704
59944
|
}
|
|
59705
59945
|
if (nativeRestored)
|
|
59706
59946
|
pass.nativeReplayCheckpointID = cut.id;
|
|
@@ -59849,8 +60089,8 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59849
60089
|
const stripped = await folds.stripRecentContext(draft.sessionID, checkpointID);
|
|
59850
60090
|
if (stripped?.rendered) {
|
|
59851
60091
|
checkpoint = structuredClone(stripped.rendered);
|
|
59852
|
-
if (upgradeCheckpointSequence !== undefined)
|
|
59853
|
-
await nativeFoldReplay?.checkpointCovered(draft.sessionID, checkpointID);
|
|
60092
|
+
if (upgradeCheckpointSequence !== undefined && draftSourceIdentity !== undefined)
|
|
60093
|
+
await nativeFoldReplay?.checkpointCovered(draft.sessionID, checkpointID, draftSourceIdentity);
|
|
59854
60094
|
}
|
|
59855
60095
|
}
|
|
59856
60096
|
}
|
|
@@ -59868,11 +60108,11 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59868
60108
|
} : null;
|
|
59869
60109
|
const servedHead = head && structuredClone(head);
|
|
59870
60110
|
const headApplied = head ? applyCheckpointHead(draft, head) : false;
|
|
59871
|
-
if (nativeMessages && (!checkpoint || upgradeCheckpointSequence !== undefined)) {
|
|
60111
|
+
if (nativeMessages && draftSourceIdentity !== undefined && (!checkpoint || upgradeCheckpointSequence !== undefined)) {
|
|
59872
60112
|
try {
|
|
59873
60113
|
const state = db && getOrCreateSessionMeta(db, draft.sessionID);
|
|
59874
60114
|
const boundary = db?.prepare("SELECT cached_m0_last_baseline_end_message_id AS id FROM session_meta WHERE session_id=?").get(draft.sessionID);
|
|
59875
|
-
await nativeFoldReplay?.capture(draft, nativeMessages, boundary?.id && state?.cachedM0Bytes ? { id: boundary.id, summary: state.cachedM0Bytes.toString("utf8") } : undefined, restoredFirstRow);
|
|
60115
|
+
await nativeFoldReplay?.capture(draft, nativeMessages, draftSourceIdentity, boundary?.id && state?.cachedM0Bytes ? { id: boundary.id, summary: state.cachedM0Bytes.toString("utf8") } : undefined, restoredFirstRow);
|
|
59876
60116
|
} catch (error) {
|
|
59877
60117
|
nativeFoldReplay?.invalidate(draft.sessionID, true);
|
|
59878
60118
|
sessionLog2(draft.sessionID, "v2 host fold: optional capture unavailable", error);
|