@cortexkit/opencode-magic-context 0.49.93 → 0.49.96
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/{announcement-4ynkaf0d.js → announcement-8nj2jd87.js} +5 -5
- package/dist/auto-search-worker.js +5 -5
- package/dist/chunk-embedding-write-worker.js +16 -16
- package/dist/{compaction-marker-candidates-1ndjqh9k.js → compaction-marker-candidates-a4b0anvv.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-rp4asvk0.js → compartment-chunk-embedding-re2cw7y3.js} +8 -8
- package/dist/config/removed-agent-config.d.ts +1 -1
- package/dist/config/removed-agent-config.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +0 -75
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-exf96bpt.js → conflict-warning-hook-wcq55y61.js} +8 -8
- package/dist/{context-jpxthqxg.js → context-gtjdrp8f.js} +237 -140
- package/dist/{derive-budgets-hzzq71rm.js → derive-budgets-g1sy72e8.js} +5 -5
- package/dist/embedding-backfill-pdymqbnh.js +29 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +8 -8
- 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/dreamer/token-budget.d.ts +2 -2
- package/dist/features/magic-context/dreamer/token-budget.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-synapse.d.ts +18 -5
- package/dist/features/magic-context/memory/embedding-synapse.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-rerank.d.ts +2 -2
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- 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/{history-owner-xqfsvf9k.js → history-owner-74826t4n.js} +3 -3
- 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/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +6 -1
- package/dist/hooks/magic-context/inject-compartments.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 +3 -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-compartment-phase.d.ts +2 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.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/hooks/magic-context/transform.d.ts +2 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-5zrzg8r1.js → index-0bjj9yf3.js} +2 -2
- package/dist/{index-g9qtxv87.js → index-0sqhg9nf.js} +132 -64
- package/dist/{index-nxxzeq4y.js → index-0ve29s6f.js} +1 -1
- package/dist/{index-g6y2wk32.js → index-2afrmgy3.js} +6 -6
- package/dist/{index-ywrz4wy2.js → index-3fhb0j32.js} +1 -1
- package/dist/{index-gqf8r04r.js → index-3n4j5rqc.js} +1 -1
- package/dist/{index-xsqw8kbd.js → index-45qgkg8j.js} +2 -2
- package/dist/{index-5df2fw5b.js → index-6mryx739.js} +1 -1
- package/dist/{index-n9kd68vc.js → index-7m2tnk8q.js} +10 -10
- package/dist/{index-r4y0dczp.js → index-7sdns2ww.js} +2 -2
- package/dist/{index-mjy2k9jr.js → index-880a24vd.js} +1 -1
- package/dist/{index-pnawfv4e.js → index-89bkkgcn.js} +4 -4
- package/dist/{index-s32f8y67.js → index-89xg64wb.js} +2 -2
- package/dist/{index-hee64h6k.js → index-8sgv96kq.js} +7 -7
- package/dist/{index-ttdk2w0z.js → index-910gahfb.js} +6 -6
- package/dist/{index-kty5k23y.js → index-9jvxq5rt.js} +4 -4
- package/dist/{index-832w615x.js → index-azkfw78y.js} +1 -1
- package/dist/{index-wh9fxds5.js → index-c205x7xd.js} +1 -1
- package/dist/{index-mg9s2rc3.js → index-cpbr0xvk.js} +2 -2
- package/dist/{index-g5c67kay.js → index-cq8znmyw.js} +17 -17
- package/dist/{index-cr483vx6.js → index-dj64gzg5.js} +2 -2
- package/dist/{index-jba6ny4m.js → index-dnpcv1rg.js} +4 -4
- package/dist/{index-z4p0ry94.js → index-dt7cyqfe.js} +2 -1
- package/dist/{index-j2w79s9r.js → index-e6ay1gez.js} +2 -2
- package/dist/{index-y2vshk67.js → index-f154w8m4.js} +229 -84
- package/dist/{index-6r99v53h.js → index-fgw241hh.js} +164 -62
- package/dist/{index-rz47hf2m.js → index-fvfnq8n6.js} +30 -14
- package/dist/{index-yqha238s.js → index-gnrwgvn7.js} +127 -17
- package/dist/{index-fpjnjxyx.js → index-h7kta6cn.js} +3 -3
- package/dist/{index-q7q6qp1f.js → index-hedgz8an.js} +1 -1
- package/dist/{index-5pgyqgmx.js → index-hj78hvhm.js} +2 -2
- package/dist/{index-dr6bd4c8.js → index-hp46xe93.js} +7 -7
- package/dist/{index-0twg41mh.js → index-j4dcjb8t.js} +4 -4
- package/dist/{index-e6ncz7a6.js → index-jzrvdqb8.js} +1 -1
- package/dist/{index-sp5pvs95.js → index-k34hc455.js} +2 -2
- package/dist/{index-9ffntwyr.js → index-kj4bprep.js} +4 -4
- package/dist/index-mgy7g740.js +119 -0
- package/dist/{index-za1yx1m4.js → index-nqdwpdje.js} +154 -32
- package/dist/{index-hes3k87g.js → index-r1d45dsr.js} +4 -4
- package/dist/{index-y915t3ey.js → index-r3f85n7y.js} +5 -1
- package/dist/{index-1kem0xxx.js → index-t2e10rag.js} +5 -5
- package/dist/{index-m0pwswv9.js → index-tqtpgnhr.js} +1 -1
- package/dist/{index-01h7tqe3.js → index-tr4ep2ej.js} +21 -6
- package/dist/{index-xr1t0fxb.js → index-w7n7qkpf.js} +49 -13
- package/dist/{index-s7460efs.js → index-zfx7mtqa.js} +1 -1
- package/dist/{index-gqfy38m9.js → index-zkjx8gq3.js} +11 -11
- package/dist/{index-et39x9k3.js → index-zmgp0tr6.js} +3 -3
- package/dist/index.js +59 -56
- package/dist/{logger-d7c8akh9.js → logger-nmb2508f.js} +2 -2
- package/dist/{message-fts-rowid-map-0xx8ge09.js → message-fts-rowid-map-vcatdan0.js} +5 -5
- package/dist/{message-index-bounded-vjrnptar.js → message-index-bounded-abhwe610.js} +12 -12
- package/dist/{message-time-backfill-pz5981mf.js → message-time-backfill-zc5rsvhv.js} +3 -3
- package/dist/migration-worker.js +13 -13
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-m8zcmrsg.js → project-embedding-registry-e566q4bg.js} +15 -15
- package/dist/raw-ordinal-warmup-worker.js +9 -9
- package/dist/{read-session-chunk-zkzdc0e5.js → read-session-chunk-sde0wym3.js} +10 -10
- package/dist/{read-session-raw-3sc9231y.js → read-session-raw-trhdgc9z.js} +3 -3
- package/dist/recomp-orchestrator-d3rbpa59.js +69 -0
- package/dist/render-6cf1dgc4.js +43 -0
- package/dist/{safe-notification-target-d21swr3n.js → safe-notification-target-54ns7dv9.js} +3 -3
- package/dist/{search-e9bb9hpx.js → search-11aw8wpq.js} +27 -27
- package/dist/search-archive-s9m5szf0.js +29 -0
- package/dist/{send-session-notification-0779tyd9.js → send-session-notification-gxrj4w1r.js} +6 -6
- package/dist/shared/host-sqlite-runtime.d.ts +3 -0
- package/dist/shared/host-sqlite-runtime.d.ts.map +1 -0
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/storage-file-mutex.d.ts.map +1 -1
- package/dist/{storage-tags-gk7gjkqt.js → storage-tags-jq0c0zsn.js} +7 -7
- package/dist/{store-yr443ye8.js → store-29ksp6vy.js} +4 -4
- 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-neds90e3.js → transform-postprocess-phase-376xn40x.js} +35 -35
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/chunk-embedding-write-worker.js +16 -16
- package/dist/v2/{compaction-marker-candidates-bp1bn579.js → compaction-marker-candidates-6nypmsr3.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-w7ht0t9v.js → compartment-chunk-embedding-jthtfhcd.js} +8 -8
- package/dist/v2/{context-ctsd80vc.js → context-vm09agrs.js} +426 -185
- package/dist/v2/{derive-budgets-hr4qqrnv.js → derive-budgets-wj0q7s7d.js} +6 -6
- package/dist/v2/embedding-backfill-16b16m38.js +29 -0
- package/dist/v2/embedding-worker-process.js +2 -2
- package/dist/v2/embedding-worker.js +8 -8
- 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 +23 -5
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-child-record.d.ts +8 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hidden-run-holder.d.ts +8 -2
- package/dist/v2/hidden-run-holder.d.ts.map +1 -1
- package/dist/v2/{history-owner-260djmv5.js → history-owner-8pd5ax3n.js} +3 -3
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +3 -0
- package/dist/v2/hooks/hidden-child.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/{logger-zyf43np1.js → logger-58jfese9.js} +2 -2
- package/dist/v2/{message-fts-rowid-map-n8mcvcpz.js → message-fts-rowid-map-ax4vk78j.js} +5 -5
- package/dist/v2/{message-index-bounded-1vew9c37.js → message-index-bounded-qh794qxx.js} +12 -12
- package/dist/v2/{message-time-backfill-ynb3vg6r.js → message-time-backfill-yj773saf.js} +3 -3
- package/dist/v2/migration-worker.js +13 -13
- package/dist/v2/{project-embedding-registry-je5jam7y.js → project-embedding-registry-z05xvckg.js} +15 -15
- package/dist/v2/raw-ordinal-warmup-worker.js +9 -9
- package/dist/v2/{read-session-chunk-09sre4xv.js → read-session-chunk-8tn2dbn1.js} +10 -10
- package/dist/v2/{read-session-raw-wg5zc29f.js → read-session-raw-ywebck9q.js} +3 -3
- package/dist/v2/recomp-orchestrator-pfjpzdrb.js +69 -0
- package/dist/v2/render-7t5d7hkv.js +43 -0
- package/dist/v2/{safe-notification-target-y55z2zat.js → safe-notification-target-zrwbh6k7.js} +3 -3
- package/dist/v2/{search-gmye6n25.js → search-35cz80x0.js} +26 -26
- package/dist/v2/search-archive-5dpxv0ck.js +29 -0
- package/dist/v2/{send-session-notification-v69y04f5.js → send-session-notification-8x146x5y.js} +6 -6
- package/dist/v2/{server-z9czv2vb.js → server-11ra1pmx.js} +49 -13
- package/dist/v2/{server-gs2251jr.js → server-2cq3e1c1.js} +4 -4
- package/dist/v2/{server-39bcszk4.js → server-2qvnr3t7.js} +1 -1
- package/dist/v2/{server-jkj1dq6j.js → server-2sare4qg.js} +4 -4
- package/dist/v2/{server-jdfe07mp.js → server-2wz6y46g.js} +1 -1
- package/dist/v2/{server-at0v0z4t.js → server-379fd3n7.js} +1 -1
- package/dist/v2/{server-ds8vpfkr.js → server-40vdz8sf.js} +2 -2
- package/dist/v2/{server-qntmqaca.js → server-4yrvbnnm.js} +2 -2
- package/dist/v2/{server-x69fqsvz.js → server-5t4nzfpt.js} +1 -1
- package/dist/v2/{server-npdey91q.js → server-63ree5ns.js} +1 -1
- package/dist/v2/{server-gqkdfdvw.js → server-6qax5pds.js} +2 -2
- package/dist/v2/{server-qb3s0mnc.js → server-73bqw5c0.js} +1 -1
- package/dist/v2/{server-6chcnnhq.js → server-7h4gwphm.js} +4 -4
- package/dist/v2/{server-rkj44mez.js → server-7tj8yzrv.js} +2 -2
- package/dist/v2/{server-e6xneh68.js → server-arfzfxe8.js} +5 -1
- package/dist/v2/{server-6ash6z8z.js → server-av3p9c8k.js} +1 -1
- package/dist/v2/{server-5hwf5c7r.js → server-bx5k66qc.js} +1 -1
- package/dist/v2/{server-dgsjamm4.js → server-db91dxwc.js} +7 -7
- package/dist/v2/{server-z4p0ry94.js → server-dt7cyqfe.js} +2 -1
- package/dist/v2/{server-k1xc2bw1.js → server-ganavh75.js} +2 -2
- package/dist/v2/{server-6x40bnb7.js → server-gh2w75fn.js} +3 -3
- package/dist/v2/server-j1gxs1gj.js +119 -0
- package/dist/v2/{server-ps6zrzwj.js → server-k3ntgf6n.js} +164 -62
- package/dist/v2/{server-j8376q08.js → server-kzrrdjp5.js} +1 -1
- package/dist/v2/{server-1rrmxhd1.js → server-n33hyq9t.js} +2 -2
- package/dist/v2/{server-0tv6kytx.js → server-n34vzyfm.js} +1 -1
- package/dist/v2/{server-vc5fta6s.js → server-nnh81jqy.js} +6 -6
- package/dist/v2/{server-g53asaqt.js → server-pcq2d1wh.js} +30 -14
- package/dist/v2/{server-bnkc9kph.js → server-ppy2dj7g.js} +6 -6
- package/dist/v2/{server-96nm9vk4.js → server-rr5c0xcg.js} +2 -2
- package/dist/v2/{server-j4jjtdc5.js → server-rt8t6s2a.js} +2 -2
- package/dist/v2/{server-2xm0gxke.js → server-svccj9rd.js} +4 -4
- package/dist/v2/{server-5sbsnpkn.js → server-tq523gj6.js} +1 -1
- package/dist/v2/{server-00adcfjd.js → server-vj0xbbrc.js} +17 -3
- package/dist/v2/{server-4ecpanyn.js → server-vntc961c.js} +127 -17
- package/dist/v2/{server-btgnkr9z.js → server-vsx9tsks.js} +11 -11
- package/dist/v2/{server-vtgeyhq6.js → server-vtkbxzw1.js} +21 -6
- package/dist/v2/{server-cvp9w5gs.js → server-w35ep6wn.js} +192 -84
- package/dist/v2/{server-myp4pc6x.js → server-z2nv8jdv.js} +132 -64
- package/dist/v2/{server-pcarsvj2.js → server-z5cv5wm5.js} +10 -10
- package/dist/v2/{server-barj0mjz.js → server-zemnpv92.js} +4 -4
- package/dist/v2/server.js +9 -9
- package/dist/v2/{storage-tags-nccqr0kr.js → storage-tags-pcenytad.js} +7 -7
- package/dist/v2/{store-enef5jcn.js → store-gx19qc3a.js} +4 -4
- 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-7vmng8q7.js → v2-archive-reader-jqrwz7b8.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-7r4y0bf6.js → wrapup-orchestrator-kcq3cv7y.js} +35 -35
- package/dist/{v2-archive-reader-7s90gfax.js → v2-archive-reader-64h2gtam.js} +1 -1
- package/dist/wrapup-orchestrator-knyac7jp.js +56 -0
- package/package.json +1 -1
- package/src/config/index.test.ts +23 -5
- package/src/config/live-run-config.test.ts +7 -7
- package/src/config/removed-agent-config.ts +14 -1
- package/src/config/schema/magic-context.ts +5 -1
- package/src/shared/host-sqlite-runtime.test.ts +21 -0
- package/src/shared/host-sqlite-runtime.ts +32 -0
- package/src/shared/redaction.test.ts +11 -8
- package/src/shared/redaction.ts +5 -1
- package/src/shared/storage-file-mutex-review.test.ts +110 -0
- package/src/shared/storage-file-mutex.ts +12 -0
- package/dist/embedding-backfill-6wzc4p2n.js +0 -29
- package/dist/index-52x68mj4.js +0 -58
- package/dist/recomp-orchestrator-qb2hymj5.js +0 -69
- package/dist/render-34p0kek8.js +0 -43
- package/dist/search-archive-08ppk0q5.js +0 -27
- package/dist/v2/embedding-backfill-40g0anxh.js +0 -29
- package/dist/v2/recomp-orchestrator-mgcty3we.js +0 -69
- package/dist/v2/render-ygcmyn9x.js +0 -43
- package/dist/v2/search-archive-nrsqqmk5.js +0 -27
- package/dist/v2/server-52x68mj4.js +0 -58
- package/dist/wrapup-orchestrator-m2p89973.js +0 -56
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
getMagicContextHistorianSessionDir,
|
|
7
7
|
log2,
|
|
8
8
|
sessionLog2
|
|
9
|
-
} from "./server-
|
|
9
|
+
} from "./server-kzrrdjp5.js";
|
|
10
10
|
import {
|
|
11
11
|
sanitizeDiagnosticText
|
|
12
|
-
} from "./server-
|
|
12
|
+
} from "./server-dt7cyqfe.js";
|
|
13
13
|
import {
|
|
14
14
|
parseTree,
|
|
15
15
|
parseJsoncRecovering,
|
|
@@ -19,20 +19,20 @@ import {
|
|
|
19
19
|
cortexKitProjectConfigBasePath,
|
|
20
20
|
resolveLegacyConfigSourcesForHarness,
|
|
21
21
|
loadPluginConfigDetailed
|
|
22
|
-
} from "./server-
|
|
22
|
+
} from "./server-vj0xbbrc.js";
|
|
23
23
|
import {
|
|
24
24
|
catalogOutputReserve,
|
|
25
25
|
getSdkContextLimit,
|
|
26
26
|
modelSupportsVision,
|
|
27
27
|
getSdkOutputLimit
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-rr5c0xcg.js";
|
|
29
29
|
import {
|
|
30
30
|
withContentLanguageDirective,
|
|
31
31
|
buildPrimaryLanguageDirective,
|
|
32
32
|
resolvePromptSurface,
|
|
33
33
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
34
34
|
LIVE_RELOAD_CONFIG_PATHS
|
|
35
|
-
} from "./server-
|
|
35
|
+
} from "./server-arfzfxe8.js";
|
|
36
36
|
import {
|
|
37
37
|
inRootAsyncContext2,
|
|
38
38
|
Database2,
|
|
@@ -47,12 +47,7 @@ import {
|
|
|
47
47
|
RawOrdinalsNotReady2,
|
|
48
48
|
dropRawSessionOrdinalCheckpoints2,
|
|
49
49
|
runSessionWarmupWorker
|
|
50
|
-
} from "./server-
|
|
51
|
-
import {
|
|
52
|
-
providerMass,
|
|
53
|
-
calibrationForModelKey,
|
|
54
|
-
historyLocalBudget
|
|
55
|
-
} from "./server-1zx87sdm.js";
|
|
50
|
+
} from "./server-av3p9c8k.js";
|
|
56
51
|
import {
|
|
57
52
|
CACHED_TRIM_PARTIAL_SQL,
|
|
58
53
|
ensureSessionMetaRow,
|
|
@@ -102,15 +97,71 @@ import {
|
|
|
102
97
|
foldShrunkPartTags2,
|
|
103
98
|
getTagNumberByMessageId2,
|
|
104
99
|
getActiveTagsBySession2
|
|
105
|
-
} from "./server-
|
|
100
|
+
} from "./server-11ra1pmx.js";
|
|
101
|
+
import {
|
|
102
|
+
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
103
|
+
getCompartmentLeaseBlocker,
|
|
104
|
+
acquireCompartmentLease,
|
|
105
|
+
renewCompartmentLease,
|
|
106
|
+
releaseCompartmentLease,
|
|
107
|
+
releaseCompartmentLeaseBestEffort,
|
|
108
|
+
isCompartmentLeaseHeld,
|
|
109
|
+
readSummaryCoverage,
|
|
110
|
+
markHistoryGapAfterCoverageChange,
|
|
111
|
+
settleHistoryGapAfterReplacement,
|
|
112
|
+
isNoContentCompartment,
|
|
113
|
+
queueM0Mutation,
|
|
114
|
+
getMaxM0MutationId,
|
|
115
|
+
getCompartments,
|
|
116
|
+
getNewestCompartmentIds,
|
|
117
|
+
getLastCompartmentEndMessage,
|
|
118
|
+
getLastCompartmentEndMessageId,
|
|
119
|
+
cachedHistoryCoversLatestCompartment,
|
|
120
|
+
getCompartmentsByEndMessageId,
|
|
121
|
+
appendCompartments,
|
|
122
|
+
buildCompartmentBlock,
|
|
123
|
+
saveRecompStagingPass,
|
|
124
|
+
getRecompStaging,
|
|
125
|
+
clearRecompStaging,
|
|
126
|
+
getRecompPartialRange,
|
|
127
|
+
setRecompPartialRange,
|
|
128
|
+
escapeXmlAttr,
|
|
129
|
+
escapeXmlContent,
|
|
130
|
+
getUncoveredCompartmentEndsThrough,
|
|
131
|
+
isPartialCompartmentEnd,
|
|
132
|
+
readProjectDocsCanonical,
|
|
133
|
+
updateSessionMeta,
|
|
134
|
+
requestPendingMaterialization,
|
|
135
|
+
dropSlot,
|
|
136
|
+
externalHistorianFailureReason,
|
|
137
|
+
getRecentFailedHistorianRunTimes,
|
|
138
|
+
recordHistorianRun,
|
|
139
|
+
summarizeImportance,
|
|
140
|
+
tallyFactsByCategory,
|
|
141
|
+
MEMORY_VISIBILITY_MUTATION_CATEGORY,
|
|
142
|
+
getMemoryMutationsForRender,
|
|
143
|
+
getMemoryMutationsForRenderByProjects,
|
|
144
|
+
getMaxMemoryMutationId,
|
|
145
|
+
getMaxMemoryMutationIdForProjects,
|
|
146
|
+
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
147
|
+
getProjectState,
|
|
148
|
+
recordSubagentInvocation,
|
|
149
|
+
getLatestHistorianInvocationId
|
|
150
|
+
} from "./server-vntc961c.js";
|
|
151
|
+
import {
|
|
152
|
+
providerMass,
|
|
153
|
+
calibrationForModelKey,
|
|
154
|
+
historyLocalBudget
|
|
155
|
+
} from "./server-1zx87sdm.js";
|
|
106
156
|
import {
|
|
107
157
|
hasMeaningfulUserText2,
|
|
108
158
|
estimateTokens,
|
|
159
|
+
createTokenCountMemo,
|
|
109
160
|
estimateFixedPromptTokens
|
|
110
|
-
} from "./server-
|
|
161
|
+
} from "./server-73bqw5c0.js";
|
|
111
162
|
import {
|
|
112
163
|
BoundedSessionMap
|
|
113
|
-
} from "./server-
|
|
164
|
+
} from "./server-4yrvbnnm.js";
|
|
114
165
|
import {
|
|
115
166
|
resolveOpenCodeDbPath,
|
|
116
167
|
assertOpenCodeStoreGeneration,
|
|
@@ -121,7 +172,7 @@ import {
|
|
|
121
172
|
openCodeDbExists,
|
|
122
173
|
withReadOnlySessionDb,
|
|
123
174
|
getMessageTimesFromOpenCodeDb
|
|
124
|
-
} from "./server-
|
|
175
|
+
} from "./server-bx5k66qc.js";
|
|
125
176
|
import {
|
|
126
177
|
removeUnsupportedCommitHashes,
|
|
127
178
|
completedToolArcCrossesBoundary,
|
|
@@ -157,61 +208,14 @@ import {
|
|
|
157
208
|
getRawSessionTagKeysThrough2,
|
|
158
209
|
getLegacyProtectedTailStartOrdinal2,
|
|
159
210
|
readSessionChunk2
|
|
160
|
-
} from "./server-
|
|
211
|
+
} from "./server-db91dxwc.js";
|
|
161
212
|
import {
|
|
162
213
|
clearCompressionDepth,
|
|
163
214
|
clearCompressionDepthRange,
|
|
164
215
|
toMessageIndexSource,
|
|
165
216
|
clearIndexedMessagesInTransaction,
|
|
166
217
|
indexSourcesAfterOrdinal
|
|
167
|
-
} from "./server-
|
|
168
|
-
import {
|
|
169
|
-
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
170
|
-
getCompartmentLeaseBlocker,
|
|
171
|
-
acquireCompartmentLease,
|
|
172
|
-
renewCompartmentLease,
|
|
173
|
-
releaseCompartmentLease,
|
|
174
|
-
releaseCompartmentLeaseBestEffort,
|
|
175
|
-
isCompartmentLeaseHeld,
|
|
176
|
-
isNoContentCompartment,
|
|
177
|
-
queueM0Mutation,
|
|
178
|
-
getMaxM0MutationId,
|
|
179
|
-
getCompartments,
|
|
180
|
-
getNewestCompartmentIds,
|
|
181
|
-
getLastCompartmentEndMessage,
|
|
182
|
-
getLastCompartmentEndMessageId,
|
|
183
|
-
cachedHistoryCoversLatestCompartment,
|
|
184
|
-
getCompartmentsByEndMessageId,
|
|
185
|
-
appendCompartments,
|
|
186
|
-
buildCompartmentBlock,
|
|
187
|
-
saveRecompStagingPass,
|
|
188
|
-
getRecompStaging,
|
|
189
|
-
clearRecompStaging,
|
|
190
|
-
getRecompPartialRange,
|
|
191
|
-
setRecompPartialRange,
|
|
192
|
-
escapeXmlAttr,
|
|
193
|
-
escapeXmlContent,
|
|
194
|
-
getUncoveredCompartmentEndsThrough,
|
|
195
|
-
isPartialCompartmentEnd,
|
|
196
|
-
readProjectDocsCanonical,
|
|
197
|
-
updateSessionMeta,
|
|
198
|
-
requestPendingMaterialization,
|
|
199
|
-
dropSlot,
|
|
200
|
-
externalHistorianFailureReason,
|
|
201
|
-
getRecentFailedHistorianRunTimes,
|
|
202
|
-
recordHistorianRun,
|
|
203
|
-
summarizeImportance,
|
|
204
|
-
tallyFactsByCategory,
|
|
205
|
-
MEMORY_VISIBILITY_MUTATION_CATEGORY,
|
|
206
|
-
getMemoryMutationsForRender,
|
|
207
|
-
getMemoryMutationsForRenderByProjects,
|
|
208
|
-
getMaxMemoryMutationId,
|
|
209
|
-
getMaxMemoryMutationIdForProjects,
|
|
210
|
-
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
211
|
-
getProjectState,
|
|
212
|
-
recordSubagentInvocation,
|
|
213
|
-
getLatestHistorianInvocationId
|
|
214
|
-
} from "./server-4ecpanyn.js";
|
|
218
|
+
} from "./server-svccj9rd.js";
|
|
215
219
|
import {
|
|
216
220
|
invalidateAutoEmbedSession
|
|
217
221
|
} from "./server-2amn2s73.js";
|
|
@@ -224,7 +228,7 @@ import {
|
|
|
224
228
|
replaceCompartmentChunkEmbeddings2,
|
|
225
229
|
deleteChunkEmbedBackoffForSession2,
|
|
226
230
|
chunkWindowSourceKey2
|
|
227
|
-
} from "./server-
|
|
231
|
+
} from "./server-zemnpv92.js";
|
|
228
232
|
import {
|
|
229
233
|
isMarkerCandidateBasisCurrent2,
|
|
230
234
|
invalidateMarkerCandidateBasis2,
|
|
@@ -235,18 +239,18 @@ import {
|
|
|
235
239
|
certifiedMarkerReferenceFloor2,
|
|
236
240
|
readMarkerReferenceRows2,
|
|
237
241
|
readKnownMarkerReferenceRows2
|
|
238
|
-
} from "./server-
|
|
242
|
+
} from "./server-379fd3n7.js";
|
|
239
243
|
import {
|
|
240
244
|
shouldSkipHomeProjectMemory,
|
|
241
245
|
resolveProjectIdentity
|
|
242
|
-
} from "./server-
|
|
246
|
+
} from "./server-n33hyq9t.js";
|
|
243
247
|
import {
|
|
244
248
|
contentSha2562,
|
|
245
249
|
enqueueShadowEmbeddingItems2,
|
|
246
250
|
getProjectChunkEmbeddingModelId2,
|
|
247
251
|
getProjectEmbeddingMaxInputTokens2,
|
|
248
252
|
embedItemsWindowBounded2
|
|
249
|
-
} from "./server-
|
|
253
|
+
} from "./server-z5cv5wm5.js";
|
|
250
254
|
import {
|
|
251
255
|
V2_MEMORY_CATEGORIES,
|
|
252
256
|
CATEGORY_PRIORITY,
|
|
@@ -257,7 +261,7 @@ import {
|
|
|
257
261
|
userFacingFailureCode,
|
|
258
262
|
promoteSessionFactsDurable,
|
|
259
263
|
embedPromotedFacts
|
|
260
|
-
} from "./server-
|
|
264
|
+
} from "./server-nnh81jqy.js";
|
|
261
265
|
import {
|
|
262
266
|
computeCueContentHash,
|
|
263
267
|
getMuralCueState,
|
|
@@ -271,7 +275,7 @@ import {
|
|
|
271
275
|
LATEST_SUPPORTED_VERSION,
|
|
272
276
|
getPersistedSchemaVersion,
|
|
273
277
|
openDatabase
|
|
274
|
-
} from "./server-
|
|
278
|
+
} from "./server-vsx9tsks.js";
|
|
275
279
|
import {
|
|
276
280
|
parseCompartmentOutput,
|
|
277
281
|
resolveWorkspaceShareCategories,
|
|
@@ -280,15 +284,15 @@ import {
|
|
|
280
284
|
resolveStoredPathWorkspaceIdentity,
|
|
281
285
|
sourceNameForMemory,
|
|
282
286
|
computeWorkspaceEpochFingerprint
|
|
283
|
-
} from "./server-
|
|
287
|
+
} from "./server-2sare4qg.js";
|
|
284
288
|
import {
|
|
285
289
|
FAIL_CLOSED_DOCTOR_COMMAND
|
|
286
|
-
} from "./server-
|
|
290
|
+
} from "./server-2qvnr3t7.js";
|
|
287
291
|
import {
|
|
288
292
|
getSessionNotes,
|
|
289
293
|
getReadySmartNotes,
|
|
290
294
|
insertPrimerCandidates
|
|
291
|
-
} from "./server-
|
|
295
|
+
} from "./server-5t4nzfpt.js";
|
|
292
296
|
import {
|
|
293
297
|
pushNotification2
|
|
294
298
|
} from "./server-y14pawe1.js";
|
|
@@ -296,10 +300,10 @@ import {
|
|
|
296
300
|
deriveTriggerBudget2,
|
|
297
301
|
resolveHistorianProducerLimits2,
|
|
298
302
|
producerSourceLocalBudget2
|
|
299
|
-
} from "./server-
|
|
303
|
+
} from "./server-rt8t6s2a.js";
|
|
300
304
|
import {
|
|
301
305
|
sendStatusNotification2
|
|
302
|
-
} from "./server-
|
|
306
|
+
} from "./server-2cq3e1c1.js";
|
|
303
307
|
import {
|
|
304
308
|
retreatPastHostUnservedRows,
|
|
305
309
|
snapTerminalCompartmentToServedRow,
|
|
@@ -319,7 +323,7 @@ import {
|
|
|
319
323
|
import {
|
|
320
324
|
logSlowWriteTransaction,
|
|
321
325
|
WriteTransactionSteps
|
|
322
|
-
} from "./server-
|
|
326
|
+
} from "./server-tq523gj6.js";
|
|
323
327
|
import {
|
|
324
328
|
sameProjectDirectory
|
|
325
329
|
} from "./server-knvkbfvh.js";
|
|
@@ -1204,6 +1208,7 @@ function* rebaseSteps(args) {
|
|
|
1204
1208
|
outcome.partTagsFolded = fold.foldedTagNumbers.length;
|
|
1205
1209
|
outcome.partTagsRekeyed = fold.rekeyedTagNumbers.length;
|
|
1206
1210
|
outcome.queuedReductionsDiscarded = fold.discardedDropTagNumbers.length;
|
|
1211
|
+
const previousCoverage = readSummaryCoverage(db, sessionId);
|
|
1207
1212
|
const updateCompartment = {
|
|
1208
1213
|
compartments: db.prepare("UPDATE compartments SET start_message = ?, end_message = ?, rebase_status = ?, title = ?, content = ?, p1 = ?, p2 = ?, p3 = ?, p4 = ? WHERE id = ?"),
|
|
1209
1214
|
recomp_compartments: db.prepare("UPDATE recomp_compartments SET start_message = ?, end_message = ?, rebase_status = ?, title = ?, content = ?, p1 = ?, p2 = ?, p3 = ?, p4 = ? WHERE id = ?")
|
|
@@ -1245,6 +1250,7 @@ function* rebaseSteps(args) {
|
|
|
1245
1250
|
outcome.recompCompartmentsUnresolved += unresolved;
|
|
1246
1251
|
}
|
|
1247
1252
|
}
|
|
1253
|
+
markHistoryGapAfterCoverageChange(db, sessionId, previousCoverage, true);
|
|
1248
1254
|
const updateNote = db.prepare("UPDATE notes SET anchor_ordinal = ? WHERE id = ? AND session_id = ?");
|
|
1249
1255
|
for (const plan of movedNotes) {
|
|
1250
1256
|
updateNote.run(plan.ordinal, plan.id, sessionId);
|
|
@@ -1332,9 +1338,11 @@ function recoverUnresolvedCompartments(args) {
|
|
|
1332
1338
|
db.exec("BEGIN IMMEDIATE");
|
|
1333
1339
|
let committed = false;
|
|
1334
1340
|
try {
|
|
1341
|
+
const previousCoverage = readSummaryCoverage(db, sessionId);
|
|
1335
1342
|
for (const plan of changed) {
|
|
1336
1343
|
db.prepare("UPDATE compartments SET start_message = ?, end_message = ?, rebase_status = ? WHERE id = ?").run(plan.start, plan.end, plan.status, plan.id);
|
|
1337
1344
|
}
|
|
1345
|
+
markHistoryGapAfterCoverageChange(db, sessionId, previousCoverage);
|
|
1338
1346
|
const previous = readCoordinateRebaseNotice(db, sessionId);
|
|
1339
1347
|
const generation = previous?.generation ?? readCoordinateGeneration(db, sessionId);
|
|
1340
1348
|
if (generation !== null) {
|
|
@@ -2741,8 +2749,92 @@ function withoutHistorianTailCache(body) {
|
|
|
2741
2749
|
// src/v2/hidden-run-holder.ts
|
|
2742
2750
|
import { createHash as createHash5, randomUUID } from "node:crypto";
|
|
2743
2751
|
import { stat } from "node:fs/promises";
|
|
2752
|
+
|
|
2753
|
+
// src/v2/hidden-child-record.ts
|
|
2754
|
+
function keptUnderRetention(keepSubagents, child) {
|
|
2755
|
+
return keepSubagents && (child.ever_settled === true || child.role === "historian");
|
|
2756
|
+
}
|
|
2757
|
+
function roleTitle(role) {
|
|
2758
|
+
return role === "historian" ? "Magic Context historian" : "Magic Context dreamer";
|
|
2759
|
+
}
|
|
2760
|
+
function roleAgent(role) {
|
|
2761
|
+
if (role === "historian")
|
|
2762
|
+
return HIDDEN_HISTORIAN_AGENT;
|
|
2763
|
+
return role === "dreamer-curate" ? HIDDEN_CURATE_AGENT : HIDDEN_DREAMER_AGENT;
|
|
2764
|
+
}
|
|
2765
|
+
function childCreateInput(identity, role, model) {
|
|
2766
|
+
const agent = hiddenToolLoop(identity) ? hiddenAgentFor(identity) : roleAgent(role);
|
|
2767
|
+
return {
|
|
2768
|
+
title: roleTitle(role),
|
|
2769
|
+
agent,
|
|
2770
|
+
model: {
|
|
2771
|
+
providerID: model.providerID,
|
|
2772
|
+
id: model.modelID,
|
|
2773
|
+
...model.variant ? { variant: model.variant } : {}
|
|
2774
|
+
},
|
|
2775
|
+
location: { directory: identity.directory },
|
|
2776
|
+
metadata: { magic_context: "hidden-run", role },
|
|
2777
|
+
permissions: hiddenChildPermissions(agent, model.providerID)
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
function assistantOutcome(row) {
|
|
2781
|
+
const outcome = row?.data.outcome;
|
|
2782
|
+
return outcome === "succeeded" || outcome === "failed" || outcome === "interrupted" ? outcome : undefined;
|
|
2783
|
+
}
|
|
2784
|
+
function withReader(openReader, read) {
|
|
2785
|
+
const reader = openReader();
|
|
2786
|
+
try {
|
|
2787
|
+
return read(reader);
|
|
2788
|
+
} finally {
|
|
2789
|
+
reader.close?.();
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
function errorText(value) {
|
|
2793
|
+
if (value instanceof Error)
|
|
2794
|
+
return value.message;
|
|
2795
|
+
if (typeof value === "string")
|
|
2796
|
+
return value;
|
|
2797
|
+
try {
|
|
2798
|
+
return JSON.stringify(value);
|
|
2799
|
+
} catch {
|
|
2800
|
+
return String(value);
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
// src/v2/hidden-run-holder.ts
|
|
2744
2805
|
var HOLDER_PREFIX = "ses_mc_bg_";
|
|
2745
2806
|
var HOLDER_CANDIDATES = 3;
|
|
2807
|
+
var HOLDER_ARCHIVE_TIMEOUT_MS = 250;
|
|
2808
|
+
var archivingHolders = new Set;
|
|
2809
|
+
var loggedArchiveFailure = false;
|
|
2810
|
+
function supportsHolderArchive(version) {
|
|
2811
|
+
const release = version?.match(/^2\.(\d+)\.(\d+)$/);
|
|
2812
|
+
return !release || Number(release[1]) > 4 || Number(release[1]) === 4 && Number(release[2]) >= 3;
|
|
2813
|
+
}
|
|
2814
|
+
function archiveBackgroundHolder(id, archive) {
|
|
2815
|
+
if (archivingHolders.has(id))
|
|
2816
|
+
return;
|
|
2817
|
+
archivingHolders.add(id);
|
|
2818
|
+
(async () => {
|
|
2819
|
+
let timer;
|
|
2820
|
+
try {
|
|
2821
|
+
await Promise.race([
|
|
2822
|
+
Promise.resolve().then(() => archive.update({ sessionID: id, archived: true })),
|
|
2823
|
+
new Promise((_, reject) => {
|
|
2824
|
+
timer = setTimeout(() => reject(new Error(`session.update timed out after ${HOLDER_ARCHIVE_TIMEOUT_MS}ms`)), HOLDER_ARCHIVE_TIMEOUT_MS);
|
|
2825
|
+
})
|
|
2826
|
+
]);
|
|
2827
|
+
} catch (error) {
|
|
2828
|
+
if (!loggedArchiveFailure) {
|
|
2829
|
+
loggedArchiveFailure = true;
|
|
2830
|
+
archive.log(`[magic-context] could not archive background holder ${id}: ${errorText(error)}`);
|
|
2831
|
+
}
|
|
2832
|
+
} finally {
|
|
2833
|
+
clearTimeout(timer);
|
|
2834
|
+
archivingHolders.delete(id);
|
|
2835
|
+
}
|
|
2836
|
+
})();
|
|
2837
|
+
}
|
|
2746
2838
|
function isHiddenRunHolder(id) {
|
|
2747
2839
|
return id.startsWith(HOLDER_PREFIX);
|
|
2748
2840
|
}
|
|
@@ -2752,7 +2844,7 @@ function supportsQuietHiddenChildren(version) {
|
|
|
2752
2844
|
function matchesHiddenRunLocation(wanted, returned) {
|
|
2753
2845
|
return sameProjectDirectory(wanted, returned ?? "");
|
|
2754
2846
|
}
|
|
2755
|
-
async function hiddenRunPlacement(createHolder, directory, budget) {
|
|
2847
|
+
async function hiddenRunPlacement(createHolder, directory, budget, archive) {
|
|
2756
2848
|
const work = budget?.work ?? ((start) => start());
|
|
2757
2849
|
budget?.setStage("checking the holder directory");
|
|
2758
2850
|
if (!(await work(() => stat(directory))).isDirectory())
|
|
@@ -2771,6 +2863,8 @@ async function hiddenRunPlacement(createHolder, directory, budget) {
|
|
|
2771
2863
|
if (holder.id !== id || holder.parentID)
|
|
2772
2864
|
throw new Error(`OpenCode did not return the expected background holder ${id}`);
|
|
2773
2865
|
if (holder.metadata?.magic_context === "background-holder" && matchesHiddenRunLocation(directory, holder.location?.directory)) {
|
|
2866
|
+
if (archive && holder.time?.archived == null)
|
|
2867
|
+
archiveBackgroundHolder(id, archive);
|
|
2774
2868
|
return { id: `ses_aut_${randomUUID()}`, parentID: id };
|
|
2775
2869
|
}
|
|
2776
2870
|
displaced.push(id);
|
|
@@ -3218,6 +3312,12 @@ class HiddenChildHook {
|
|
|
3218
3312
|
onBudgetUpdate({ ...selected.budget.snapshot(), sessionId: draft.sessionID });
|
|
3219
3313
|
}
|
|
3220
3314
|
}
|
|
3315
|
+
if (selected.budget) {
|
|
3316
|
+
const count = selected.countRequestText ??= createTokenCountMemo(256, 2 * 1024 * 1024);
|
|
3317
|
+
const messageTokens = draft.messages.reduce((total, message) => total + count(JSON.stringify(message.content ?? message.parts) ?? ""), 0);
|
|
3318
|
+
const toolTokens = Object.values(draft.tools).reduce((total, tool) => total + count(tool.description) + count(JSON.stringify(tool.input) ?? ""), 0);
|
|
3319
|
+
(selected.requestTokenEstimates ??= []).push(count(systemText) + messageTokens + toolTokens);
|
|
3320
|
+
}
|
|
3221
3321
|
selected.observedMessages = draft.messages;
|
|
3222
3322
|
selected.shaped = true;
|
|
3223
3323
|
return true;
|
|
@@ -8232,11 +8332,12 @@ function clearDegradedRebuild(sessionId) {
|
|
|
8232
8332
|
degradedRebuildCountBySession.delete(sessionId);
|
|
8233
8333
|
reAnchorLoggedBySession.delete(sessionId);
|
|
8234
8334
|
}
|
|
8235
|
-
function logReanchorOnce(sessionId, message) {
|
|
8335
|
+
function logReanchorOnce(sessionId, message, quiet) {
|
|
8236
8336
|
if (reAnchorLoggedBySession.get(sessionId))
|
|
8237
8337
|
return;
|
|
8238
8338
|
reAnchorLoggedBySession.set(sessionId, true);
|
|
8239
|
-
|
|
8339
|
+
if (!quiet)
|
|
8340
|
+
sessionLog2(sessionId, message);
|
|
8240
8341
|
}
|
|
8241
8342
|
function findVisibleReanchorIndex(compartments, visibleMessageIds) {
|
|
8242
8343
|
for (let index = compartments.length - 1;index >= 0; index -= 1) {
|
|
@@ -8363,7 +8464,9 @@ function cutCoveredPrefix(messages, count, coveredInstructions) {
|
|
|
8363
8464
|
coveredInstructions.push(message);
|
|
8364
8465
|
}
|
|
8365
8466
|
}
|
|
8366
|
-
function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredInstructions, projectPath, injectionBudgetTokens, temporalAwareness, frozenBaseline) {
|
|
8467
|
+
function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredInstructions, projectPath, injectionBudgetTokens, temporalAwareness, frozenBaseline, restoredBoundaryDiagnostic) {
|
|
8468
|
+
if (restoredBoundaryDiagnostic)
|
|
8469
|
+
restoredBoundaryDiagnostic.expectedAbsence = false;
|
|
8367
8470
|
const cached = injectionCache.get(sessionId);
|
|
8368
8471
|
if (cached && cached.db !== db) {
|
|
8369
8472
|
clearInjectionCache(sessionId);
|
|
@@ -8509,6 +8612,9 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
8509
8612
|
resultEndMessageId = trimEndMessageId;
|
|
8510
8613
|
resultEndMessagePartial = trimEndMessagePartial;
|
|
8511
8614
|
} else {
|
|
8615
|
+
const quiet = restoredBoundaryDiagnostic?.restoredAfterId === trimEndMessageId;
|
|
8616
|
+
if (restoredBoundaryDiagnostic)
|
|
8617
|
+
restoredBoundaryDiagnostic.expectedAbsence = quiet;
|
|
8512
8618
|
const degradedCount = noteDegradedRebuild(sessionId);
|
|
8513
8619
|
if (isCacheBusting) {
|
|
8514
8620
|
reconcileForkOrphanedCompactionMarkers(db, sessionId, isCacheBusting);
|
|
@@ -8531,14 +8637,14 @@ function prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, co
|
|
|
8531
8637
|
resultEndMessage = reAnchorCompartment.endMessage;
|
|
8532
8638
|
resultEndMessageId = reAnchorCompartment.endMessageId;
|
|
8533
8639
|
reAnchored = true;
|
|
8534
|
-
logReanchorOnce(sessionId, `compartment injection re-anchored: natural boundary ${trimEndMessageId} not visible for ${degradedCount} passes; splicing at visible compartment boundary ${resultEndMessageId} (ordinal ${resultEndMessage})
|
|
8640
|
+
logReanchorOnce(sessionId, `compartment injection re-anchored: natural boundary ${trimEndMessageId} not visible for ${degradedCount} passes; splicing at visible compartment boundary ${resultEndMessageId} (ordinal ${resultEndMessage})`, quiet);
|
|
8535
8641
|
}
|
|
8536
8642
|
}
|
|
8537
8643
|
if (!reAnchored) {
|
|
8538
8644
|
needsFreshMaterialization = true;
|
|
8539
|
-
logReanchorOnce(sessionId, `compartment injection degraded: boundary ${trimEndMessageId} not visible for ${degradedCount} passes and no compartment boundary is visible; requesting fresh materialization to re-cut the baseline
|
|
8645
|
+
logReanchorOnce(sessionId, `compartment injection degraded: boundary ${trimEndMessageId} not visible for ${degradedCount} passes and no compartment boundary is visible; requesting fresh materialization to re-cut the baseline`, quiet);
|
|
8540
8646
|
}
|
|
8541
|
-
} else {
|
|
8647
|
+
} else if (!quiet) {
|
|
8542
8648
|
sessionLog2(sessionId, `compartment injection entering degraded mode: boundary ${trimEndMessageId} not in visible messages (consecutive degraded passes: ${degradedCount})`);
|
|
8543
8649
|
}
|
|
8544
8650
|
}
|
|
@@ -15854,10 +15960,12 @@ function promoteRecompStaging(db, sessionId, holderId, stopped, carriedRows) {
|
|
|
15854
15960
|
}
|
|
15855
15961
|
}
|
|
15856
15962
|
const compartments = carried ? [...staging.compartments, ...carried.compartments] : staging.compartments;
|
|
15963
|
+
const previousCoverage = readSummaryCoverage(db, sessionId);
|
|
15857
15964
|
deleteChunkEmbedBackoffForSession2(db, sessionId);
|
|
15858
15965
|
db.prepare("DELETE FROM compartments WHERE session_id = ?").run(sessionId);
|
|
15859
15966
|
db.prepare("DELETE FROM session_facts WHERE session_id = ?").run(sessionId);
|
|
15860
15967
|
insertRecompCompartmentRows(db, sessionId, compartments, now, carried?.rows ?? carriedRows);
|
|
15968
|
+
settleHistoryGapAfterReplacement(db, sessionId, previousCoverage, staging.compartments.some((row) => !isNoContentCompartment(row)));
|
|
15861
15969
|
queueM0Mutation(db, {
|
|
15862
15970
|
sessionId,
|
|
15863
15971
|
mutationType: "recomp_boundary_change",
|
|
@@ -17053,4 +17161,4 @@ ${failure}`;
|
|
|
17053
17161
|
}
|
|
17054
17162
|
}
|
|
17055
17163
|
|
|
17056
|
-
export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, v2ToolDefinitionsHash, v2RequestToolsFingerprint, classifyRequestToolsChange, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, startCompactionMarkerCandidatePreparation, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT,
|
|
17164
|
+
export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, v2ToolDefinitionsHash, v2RequestToolsFingerprint, classifyRequestToolsChange, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, startCompactionMarkerCandidatePreparation, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, keptUnderRetention, roleTitle, childCreateInput, assistantOutcome, withReader, errorText, supportsHolderArchive, supportsQuietHiddenChildren, matchesHiddenRunLocation, hiddenRunPlacement, HIDDEN_CURATE_AGENT, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, noteTimedOutHiddenChild, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, isLatestAssistantLengthCapped, parseProviderModel, modelBodyField, toModelEntry, hiddenModelCooldowns, ModelProducedNoOutputError, promptTransportBudget, notePromptSetupTimeout, noteModelActivityMonitored, noteModelOutputReceived, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, annotateSubagentInvocationError, failedInvocationStatus, emptyTokenTotals, sumTokensFromChildMessages, recordChildInvocation, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, teardownChildSession, runTokenLog, formatRunTokenLog, createChildSessionWithFence, validateStoredCompartments, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, stripMemoryMuralBlock, servedHeadTexts, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, headMessagesForSizing, rawTailAfterNewestCompartment, hasCompleteCachedM0M1, injectM0M1, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, reportProviderRecoveryDrainSkip, isHistorianDrainBudgetSpent, readHistorianFailureStreak, describeHistorianJoinRefusal, shouldWaitForNewHistorianHistory, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, clearNoteNudgeTriggerOnly, noteTransformPassForExactOrdinalReads, nonNarrativeStoredGapRanges, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure2, isRecompSkip2, extractRecompReason2, setRecompStarting2, setRecompNote2, setRecompTerminal2, buildRecompDeps2, runManagedRecomp2 };
|