@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
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
log2,
|
|
31
31
|
sessionLog2,
|
|
32
32
|
getLoggerDiagnostics2
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-3fhb0j32.js";
|
|
34
34
|
import {
|
|
35
35
|
sanitizeDiagnosticText,
|
|
36
36
|
hasShareabilitySensitiveText
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-dt7cyqfe.js";
|
|
38
38
|
import {
|
|
39
39
|
resolveOpenCodeDbPath,
|
|
40
40
|
assertOpenCodeStoreGeneration,
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
} from "./index-58e3y90n.js";
|
|
49
49
|
import {
|
|
50
50
|
inRootAsyncContext2,
|
|
51
|
+
detectSqliteRuntime2,
|
|
51
52
|
Database2,
|
|
52
53
|
getSqliteDatabasePath2,
|
|
53
54
|
getSqliteMemoryStats2,
|
|
@@ -64,14 +65,14 @@ import {
|
|
|
64
65
|
rpcPortFilePath,
|
|
65
66
|
parseRpcPortFile,
|
|
66
67
|
inspectProcessesAsync
|
|
67
|
-
} from "./index-
|
|
68
|
+
} from "./index-3n4j5rqc.js";
|
|
68
69
|
import {
|
|
69
70
|
shouldEnforcePrivateStoragePermissions,
|
|
70
71
|
ensureStorageDirectorySync,
|
|
71
72
|
writeStorageFileAtomicSync,
|
|
72
73
|
writeStorageFileAsync,
|
|
73
74
|
createStorageWriteStream
|
|
74
|
-
} from "./index-
|
|
75
|
+
} from "./index-6mryx739.js";
|
|
75
76
|
import {
|
|
76
77
|
pruneMissingProjectIdentities,
|
|
77
78
|
shouldSkipHomeProjectMemory,
|
|
@@ -88,7 +89,7 @@ import {
|
|
|
88
89
|
storedPathBelongsToIdentity,
|
|
89
90
|
beginBootQuietPeriod,
|
|
90
91
|
scheduleAfterBootQuiet
|
|
91
|
-
} from "./index-
|
|
92
|
+
} from "./index-hj78hvhm.js";
|
|
92
93
|
import {
|
|
93
94
|
recordSessionProjectIdentity,
|
|
94
95
|
hasRecordedSessionProjectIdentity,
|
|
@@ -98,7 +99,7 @@ import {
|
|
|
98
99
|
markGitSweepSuccessAndRelease,
|
|
99
100
|
parkGitSweepNonIndexable,
|
|
100
101
|
releaseGitSweepLease
|
|
101
|
-
} from "./index-
|
|
102
|
+
} from "./index-7sdns2ww.js";
|
|
102
103
|
import {
|
|
103
104
|
getMagicContextBuiltinCommands,
|
|
104
105
|
formatConfigParseStatusLine,
|
|
@@ -214,7 +215,7 @@ import {
|
|
|
214
215
|
snapRangeToCompartments,
|
|
215
216
|
getActiveCompartmentRun,
|
|
216
217
|
startCompartmentAgent
|
|
217
|
-
} from "./index-
|
|
218
|
+
} from "./index-nqdwpdje.js";
|
|
218
219
|
import {
|
|
219
220
|
formatWindowDerivationLine,
|
|
220
221
|
getSdkWindowGeometry,
|
|
@@ -223,7 +224,7 @@ import {
|
|
|
223
224
|
deriveTriggerBudget2,
|
|
224
225
|
resolveKnownHistorianContextLimit2,
|
|
225
226
|
resolveHistorianProducerLimits2
|
|
226
|
-
} from "./index-
|
|
227
|
+
} from "./index-45qgkg8j.js";
|
|
227
228
|
import {
|
|
228
229
|
resolveModelCalibration,
|
|
229
230
|
calibrateBuckets,
|
|
@@ -238,7 +239,7 @@ import {
|
|
|
238
239
|
estimateTokens,
|
|
239
240
|
estimateFixedPromptTokens,
|
|
240
241
|
normalizeText
|
|
241
|
-
} from "./index-
|
|
242
|
+
} from "./index-zfx7mtqa.js";
|
|
242
243
|
import {
|
|
243
244
|
protectedToolTokenCount,
|
|
244
245
|
peelLeadingMcTagNotation,
|
|
@@ -280,6 +281,7 @@ import {
|
|
|
280
281
|
resolveCompactionModeRecord,
|
|
281
282
|
getCompactionModeRecord,
|
|
282
283
|
setCompactionModeRecord,
|
|
284
|
+
EMERGENCY_DRAIN_FAILURE_BACKOFF_MS,
|
|
283
285
|
clearPersistedReasoningWatermark,
|
|
284
286
|
getEmergencyInputSample,
|
|
285
287
|
clearEmergencyDropSample,
|
|
@@ -303,6 +305,7 @@ import {
|
|
|
303
305
|
setPersistedTodoSyntheticAnchor,
|
|
304
306
|
clearPersistedTodoSyntheticAnchor,
|
|
305
307
|
setNoteLastReadAt,
|
|
308
|
+
getHistorianFailureState,
|
|
306
309
|
clearHistorianFailureState,
|
|
307
310
|
getOverflowState,
|
|
308
311
|
loadTransformPassStateSnapshot,
|
|
@@ -370,14 +373,14 @@ import {
|
|
|
370
373
|
getTagsByNumbers2,
|
|
371
374
|
getDroppedTagsByNumbers2,
|
|
372
375
|
getMaxDroppedTagNumber2
|
|
373
|
-
} from "./index-
|
|
376
|
+
} from "./index-w7n7qkpf.js";
|
|
374
377
|
import {
|
|
375
378
|
BoundedSessionMap,
|
|
376
379
|
observeTemporalDecisions,
|
|
377
380
|
stableStringify,
|
|
378
381
|
getMeasuredToolDefinitionTokens,
|
|
379
382
|
getExactSessionToolDefinitionTokens
|
|
380
|
-
} from "./index-
|
|
383
|
+
} from "./index-cpbr0xvk.js";
|
|
381
384
|
import {
|
|
382
385
|
withContentLanguageDirective,
|
|
383
386
|
string,
|
|
@@ -397,14 +400,14 @@ import {
|
|
|
397
400
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
398
401
|
DEFAULT_LOCAL_EMBEDDING_MODEL,
|
|
399
402
|
DREAM_TASK_PROMOTION_DEFAULTS
|
|
400
|
-
} from "./index-
|
|
403
|
+
} from "./index-r3f85n7y.js";
|
|
401
404
|
import {
|
|
402
405
|
areRustHistorianSyntheticParts2,
|
|
403
406
|
isRawCompactionSummaryInfo2,
|
|
404
407
|
extractInMemoryMessageViews2,
|
|
405
408
|
buildInMemoryTailRawMessages2,
|
|
406
409
|
RawOrdinalsNotReady2
|
|
407
|
-
} from "./index-
|
|
410
|
+
} from "./index-hedgz8an.js";
|
|
408
411
|
import {
|
|
409
412
|
openCodeDbExists,
|
|
410
413
|
withReadOnlySessionDb,
|
|
@@ -412,7 +415,7 @@ import {
|
|
|
412
415
|
latestPersistedMessageForRecovery,
|
|
413
416
|
latestRealUserTurnIdFromOpenCodeDb,
|
|
414
417
|
findLastAssistantModelFromOpenCodeDb
|
|
415
|
-
} from "./index-
|
|
418
|
+
} from "./index-k34hc455.js";
|
|
416
419
|
import {
|
|
417
420
|
askAnswerLines,
|
|
418
421
|
estimateTrueRawMessageTokens,
|
|
@@ -429,6 +432,7 @@ import {
|
|
|
429
432
|
cleanUserText2,
|
|
430
433
|
withRawSessionMessageCache2,
|
|
431
434
|
readRawSessionMessages2,
|
|
435
|
+
getRawSessionMessageOrdinalCount2,
|
|
432
436
|
visitRawSessionMessages2,
|
|
433
437
|
visitRawSessionMessagesAsync2,
|
|
434
438
|
prepareRawSessionOrdinals2,
|
|
@@ -443,7 +447,7 @@ import {
|
|
|
443
447
|
readRawSessionMessageById2,
|
|
444
448
|
readSessionChunk2,
|
|
445
449
|
readRawSessionSeedTail2
|
|
446
|
-
} from "./index-
|
|
450
|
+
} from "./index-hp46xe93.js";
|
|
447
451
|
import {
|
|
448
452
|
buildDreamTaskRuntimeConfigs2,
|
|
449
453
|
userMemoryCollectionEnabled2
|
|
@@ -453,7 +457,7 @@ import {
|
|
|
453
457
|
isFailClosedBlockingError,
|
|
454
458
|
shouldBypassFailClosedBlock,
|
|
455
459
|
resolveAgentNameFromMessages
|
|
456
|
-
} from "./index-
|
|
460
|
+
} from "./index-c205x7xd.js";
|
|
457
461
|
import {
|
|
458
462
|
configureContextDatabasePragmas2
|
|
459
463
|
} from "./index-fb3zxn06.js";
|
|
@@ -467,7 +471,7 @@ import {
|
|
|
467
471
|
runSqliteOptimize,
|
|
468
472
|
openDatabase,
|
|
469
473
|
openCurrentDatabase
|
|
470
|
-
} from "./index-
|
|
474
|
+
} from "./index-zkjx8gq3.js";
|
|
471
475
|
import {
|
|
472
476
|
unescapeXml,
|
|
473
477
|
resolveWorkspaceShareCategories,
|
|
@@ -476,7 +480,7 @@ import {
|
|
|
476
480
|
resolveStoredPathWorkspaceIdentity,
|
|
477
481
|
storedPathBelongsToWorkspace,
|
|
478
482
|
computeWorkspaceEpochFingerprint
|
|
479
|
-
} from "./index-
|
|
483
|
+
} from "./index-dnpcv1rg.js";
|
|
480
484
|
import {
|
|
481
485
|
V2_MEMORY_CATEGORIES,
|
|
482
486
|
CATEGORY_PRIORITY
|
|
@@ -498,8 +502,12 @@ import {
|
|
|
498
502
|
toSynapseLaneDescriptor,
|
|
499
503
|
formatSynapseLaneDescriptor,
|
|
500
504
|
SynapseEmbeddingProvider
|
|
501
|
-
} from "./index-
|
|
505
|
+
} from "./index-fgw241hh.js";
|
|
502
506
|
import {
|
|
507
|
+
readHistoryGapMark,
|
|
508
|
+
clearHistoryGapMark,
|
|
509
|
+
claimHistoryGapCheck,
|
|
510
|
+
recordHistoryGapAdmission,
|
|
503
511
|
getCompartments,
|
|
504
512
|
getLastCompartmentEndMessage,
|
|
505
513
|
getLastCompartmentEndMessageId,
|
|
@@ -582,10 +590,10 @@ import {
|
|
|
582
590
|
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
583
591
|
getProjectState,
|
|
584
592
|
bumpProjectUserProfileVersion
|
|
585
|
-
} from "./index-
|
|
593
|
+
} from "./index-gnrwgvn7.js";
|
|
586
594
|
import {
|
|
587
595
|
getLastIndexedOrdinal
|
|
588
|
-
} from "./index-
|
|
596
|
+
} from "./index-89bkkgcn.js";
|
|
589
597
|
import {
|
|
590
598
|
SESSION_NOTE_CONDITION_ERROR,
|
|
591
599
|
getNoteByIdInScope,
|
|
@@ -611,7 +619,7 @@ import {
|
|
|
611
619
|
createPrimer,
|
|
612
620
|
updatePrimerSupport,
|
|
613
621
|
updatePrimerAnswer
|
|
614
|
-
} from "./index-
|
|
622
|
+
} from "./index-880a24vd.js";
|
|
615
623
|
import {
|
|
616
624
|
registerNotificationSink2,
|
|
617
625
|
pushNotification2,
|
|
@@ -623,7 +631,7 @@ import {
|
|
|
623
631
|
getCachedLocalEmbeddingPooling,
|
|
624
632
|
preflightLocalEmbeddingPooling,
|
|
625
633
|
getLocalEmbeddingNativeMemoryStats
|
|
626
|
-
} from "./index-
|
|
634
|
+
} from "./index-r1d45dsr.js";
|
|
627
635
|
import {
|
|
628
636
|
withQueryEmbeddingDeadline,
|
|
629
637
|
describeShadowBackfillWriteRefusal2,
|
|
@@ -645,7 +653,7 @@ import {
|
|
|
645
653
|
embedSessionCompartmentChunks2,
|
|
646
654
|
getEmbeddingCoverageStatus2,
|
|
647
655
|
getAutoEmbeddingSessionCoverage2
|
|
648
|
-
} from "./index-
|
|
656
|
+
} from "./index-7m2tnk8q.js";
|
|
649
657
|
import {
|
|
650
658
|
saveEmbeddingIfHashMatches,
|
|
651
659
|
invalidateProject2,
|
|
@@ -671,7 +679,7 @@ import {
|
|
|
671
679
|
readGitFileChangeTimesSince,
|
|
672
680
|
verificationFileExists,
|
|
673
681
|
normalizeVerificationFiles
|
|
674
|
-
} from "./index-
|
|
682
|
+
} from "./index-910gahfb.js";
|
|
675
683
|
import {
|
|
676
684
|
computeCueContentHash,
|
|
677
685
|
hasMuralCueColumns,
|
|
@@ -719,13 +727,13 @@ import {
|
|
|
719
727
|
resolveMemoriesByIdsForSearch2,
|
|
720
728
|
unifiedSearch2,
|
|
721
729
|
formatSearchResults2
|
|
722
|
-
} from "./index-
|
|
730
|
+
} from "./index-0sqhg9nf.js";
|
|
723
731
|
import {
|
|
724
732
|
scheduleReconciliation,
|
|
725
733
|
scheduleIncrementalIndex,
|
|
726
734
|
getMessageIndexQueueHeapStats,
|
|
727
735
|
clearSessionTracking
|
|
728
|
-
} from "./index-
|
|
736
|
+
} from "./index-9jvxq5rt.js";
|
|
729
737
|
import {
|
|
730
738
|
resolveModelCacheTtl,
|
|
731
739
|
resolveContextWindowGeometry,
|
|
@@ -824,24 +832,24 @@ import {
|
|
|
824
832
|
abortSessionFailClosed2,
|
|
825
833
|
evaluateEmergencyFailClosed2,
|
|
826
834
|
runPostTransformPhase2
|
|
827
|
-
} from "./index-
|
|
835
|
+
} from "./index-cq8znmyw.js";
|
|
828
836
|
import {
|
|
829
837
|
flushIgnoredMessages2,
|
|
830
838
|
clearIgnoredMessages2,
|
|
831
839
|
observeIgnoredNotificationEvent2,
|
|
832
840
|
sendStatusNotification2
|
|
833
|
-
} from "./index-
|
|
841
|
+
} from "./index-kj4bprep.js";
|
|
834
842
|
import {
|
|
835
843
|
setRecompStarting2,
|
|
836
844
|
setRecompTerminal2
|
|
837
|
-
} from "./index-
|
|
845
|
+
} from "./index-t2e10rag.js";
|
|
838
846
|
import {
|
|
839
847
|
ANNOUNCEMENT_VERSION2,
|
|
840
848
|
ANNOUNCEMENT_FEATURES2,
|
|
841
849
|
ANNOUNCEMENT_FOOTER2,
|
|
842
850
|
markAnnouncementSeen2,
|
|
843
851
|
shouldShowAnnouncement2
|
|
844
|
-
} from "./index-
|
|
852
|
+
} from "./index-dj64gzg5.js";
|
|
845
853
|
import {
|
|
846
854
|
resolvePromptContext2
|
|
847
855
|
} from "./index-fmsr7v69.js";
|
|
@@ -849,13 +857,14 @@ import {
|
|
|
849
857
|
renderMessageByOrdinal2,
|
|
850
858
|
renderVerboseRangeForTool2,
|
|
851
859
|
renderItemByTag2
|
|
852
|
-
} from "./index-
|
|
860
|
+
} from "./index-h7kta6cn.js";
|
|
853
861
|
import {
|
|
854
862
|
readV2ArchiveOffThread2
|
|
855
|
-
} from "./index-
|
|
863
|
+
} from "./index-2afrmgy3.js";
|
|
856
864
|
import {
|
|
865
|
+
unresolvedLiveTailRefusal2,
|
|
857
866
|
renderSearchArchiveOffThread2
|
|
858
|
-
} from "./index-
|
|
867
|
+
} from "./index-fvfnq8n6.js";
|
|
859
868
|
import {
|
|
860
869
|
takeCoveredInstructionRows,
|
|
861
870
|
cloneKeepingCoveredInstructionMarks
|
|
@@ -880,7 +889,7 @@ import {
|
|
|
880
889
|
} from "./index-8ajstryz.js";
|
|
881
890
|
import {
|
|
882
891
|
logSlowWriteTransaction
|
|
883
|
-
} from "./index-
|
|
892
|
+
} from "./index-tqtpgnhr.js";
|
|
884
893
|
import {
|
|
885
894
|
canonicalProjectDirectory
|
|
886
895
|
} from "./index-knvkbfvh.js";
|
|
@@ -1154,6 +1163,7 @@ function buildDreamTaskPrompt(task, args) {
|
|
|
1154
1163
|
import { randomUUID } from "node:crypto";
|
|
1155
1164
|
import { existsSync } from "node:fs";
|
|
1156
1165
|
var LEASE_TTL_MS = 10 * 60 * 1000;
|
|
1166
|
+
var DEAD_DIRECTORY_RECHECK_MS = 24 * 60 * 60 * 1000;
|
|
1157
1167
|
var SESSION_PAGE_SIZE = 100;
|
|
1158
1168
|
var SESSION_QUERY_CHUNK_SIZE = 250;
|
|
1159
1169
|
var YIELD_EVERY_PROCESSED_SESSIONS = 25;
|
|
@@ -1197,13 +1207,27 @@ function withImmediateTransaction(db, fn) {
|
|
|
1197
1207
|
function defaultYieldFn() {
|
|
1198
1208
|
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
1199
1209
|
}
|
|
1210
|
+
function readBackfillLease(db, harness) {
|
|
1211
|
+
return db.prepare(`SELECT status, lease_expires_at
|
|
1212
|
+
FROM session_project_backfill_state
|
|
1213
|
+
WHERE harness = ?`).get(harness);
|
|
1214
|
+
}
|
|
1215
|
+
function isCompletedAndNotDue(lease, now) {
|
|
1216
|
+
return lease?.status === "completed" && (lease.lease_expires_at === null || lease.lease_expires_at > now);
|
|
1217
|
+
}
|
|
1200
1218
|
function acquireBackfillLease(db, harness, holderId, now) {
|
|
1219
|
+
try {
|
|
1220
|
+
if (isCompletedAndNotDue(readBackfillLease(db, harness), now))
|
|
1221
|
+
return "already_completed";
|
|
1222
|
+
} catch (error) {
|
|
1223
|
+
if (!(error instanceof Error) || error.message !== "no such table: session_project_backfill_state") {
|
|
1224
|
+
throw error;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1201
1227
|
ensureBackfillStateTable(db);
|
|
1202
1228
|
return withImmediateTransaction(db, () => {
|
|
1203
|
-
const current = db
|
|
1204
|
-
|
|
1205
|
-
WHERE harness = ?`).get(harness);
|
|
1206
|
-
if (current?.status === "completed")
|
|
1229
|
+
const current = readBackfillLease(db, harness);
|
|
1230
|
+
if (isCompletedAndNotDue(current, now))
|
|
1207
1231
|
return "already_completed";
|
|
1208
1232
|
if (current?.status === "running" && current.lease_expires_at !== null && current.lease_expires_at > now) {
|
|
1209
1233
|
return "blocked_by_lease";
|
|
@@ -1232,11 +1256,11 @@ function renewBackfillLease(db, harness, holderId, now) {
|
|
|
1232
1256
|
SET lease_expires_at = ?
|
|
1233
1257
|
WHERE harness = ? AND status = 'running' AND holder_id = ?`).run(now + LEASE_TTL_MS, harness, holderId).changes === 1;
|
|
1234
1258
|
}
|
|
1235
|
-
function markBackfillCompleted(db, harness, holderId, now) {
|
|
1259
|
+
function markBackfillCompleted(db, harness, holderId, now, recheckAt) {
|
|
1236
1260
|
ensureBackfillStateTable(db);
|
|
1237
1261
|
return db.prepare(`UPDATE session_project_backfill_state
|
|
1238
|
-
SET status = 'completed', lease_expires_at =
|
|
1239
|
-
WHERE harness = ? AND status = 'running' AND holder_id = ?`).run(now, harness, holderId).changes === 1;
|
|
1262
|
+
SET status = 'completed', lease_expires_at = ?, completed_at = ?
|
|
1263
|
+
WHERE harness = ? AND status = 'running' AND holder_id = ?`).run(recheckAt, now, harness, holderId).changes === 1;
|
|
1240
1264
|
}
|
|
1241
1265
|
function markBackfillRetryPending(db, harness, holderId, now) {
|
|
1242
1266
|
ensureBackfillStateTable(db);
|
|
@@ -1279,9 +1303,10 @@ function createPageReader(source) {
|
|
|
1279
1303
|
if (typeof source === "function") {
|
|
1280
1304
|
return async (afterSessionId, limit) => source(afterSessionId, limit);
|
|
1281
1305
|
}
|
|
1282
|
-
|
|
1306
|
+
let sessions;
|
|
1283
1307
|
let offset = 0;
|
|
1284
1308
|
return async (_afterSessionId, limit) => {
|
|
1309
|
+
sessions ??= dedupeSessions(source);
|
|
1285
1310
|
const page = sessions.slice(offset, offset + limit);
|
|
1286
1311
|
offset += page.length;
|
|
1287
1312
|
return page;
|
|
@@ -1297,7 +1322,6 @@ async function runSessionProjectBackfillPass(db, source, options = {}) {
|
|
|
1297
1322
|
const resolveIdentity = options.resolveIdentity ?? ((directory) => resolveProjectIdentityForSession(directory, options.allowHomeProject));
|
|
1298
1323
|
const yieldFn = options.yieldFn ?? defaultYieldFn;
|
|
1299
1324
|
const holderId = options.holderId ?? randomUUID();
|
|
1300
|
-
const readPage = createPageReader(source);
|
|
1301
1325
|
const result = {
|
|
1302
1326
|
status: "completed",
|
|
1303
1327
|
totalSessions: 0,
|
|
@@ -1308,13 +1332,15 @@ async function runSessionProjectBackfillPass(db, source, options = {}) {
|
|
|
1308
1332
|
skippedEmptyDirectories: 0,
|
|
1309
1333
|
durationMs: 0
|
|
1310
1334
|
};
|
|
1311
|
-
const
|
|
1335
|
+
const baseLeaseKey = options.leaseKey ?? harness;
|
|
1336
|
+
const leaseKey = options.allowHomeProject ? `${baseLeaseKey}:allow-home-project` : baseLeaseKey;
|
|
1312
1337
|
const leaseStatus = acquireBackfillLease(db, leaseKey, holderId, now());
|
|
1313
1338
|
if (leaseStatus !== "acquired") {
|
|
1314
1339
|
result.status = leaseStatus;
|
|
1315
1340
|
result.durationMs = performance.now() - startedAt;
|
|
1316
1341
|
return result;
|
|
1317
1342
|
}
|
|
1343
|
+
const readPage = createPageReader(source);
|
|
1318
1344
|
const finishWithLostLease = () => {
|
|
1319
1345
|
result.status = "lost_lease";
|
|
1320
1346
|
result.durationMs = performance.now() - startedAt;
|
|
@@ -1406,13 +1432,9 @@ async function runSessionProjectBackfillPass(db, source, options = {}) {
|
|
|
1406
1432
|
if (sourcePage.length < SESSION_PAGE_SIZE)
|
|
1407
1433
|
break;
|
|
1408
1434
|
}
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
return finishWithLostLease();
|
|
1413
|
-
}
|
|
1414
|
-
result.status = "retry_pending";
|
|
1415
|
-
} else if (!markBackfillCompleted(db, leaseKey, holderId, now())) {
|
|
1435
|
+
const completedAt = now();
|
|
1436
|
+
const recheckAt = result.skippedDeadDirectories > 0 ? completedAt + DEAD_DIRECTORY_RECHECK_MS : null;
|
|
1437
|
+
if (!markBackfillCompleted(db, leaseKey, holderId, completedAt, recheckAt)) {
|
|
1416
1438
|
return finishWithLostLease();
|
|
1417
1439
|
}
|
|
1418
1440
|
result.durationMs = performance.now() - startedAt;
|
|
@@ -4204,15 +4226,39 @@ function hasCurrentDocsProposal(projectDir) {
|
|
|
4204
4226
|
const hashes = docsBaseHashes(projectDir);
|
|
4205
4227
|
return listPendingDocsProposals(projectDir).some((path) => Object.entries(hashes).every(([name, value]) => readFileSync(path, "utf8").includes(`Base SHA-256 ${name}: ${value}`)));
|
|
4206
4228
|
}
|
|
4207
|
-
function git(projectDir, args) {
|
|
4229
|
+
function git(projectDir, args, options) {
|
|
4208
4230
|
return execFileSync("git", args, {
|
|
4209
4231
|
windowsHide: true,
|
|
4210
4232
|
cwd: projectDir,
|
|
4211
4233
|
encoding: "utf8",
|
|
4212
4234
|
timeout: 1e4,
|
|
4213
|
-
maxBuffer: 2000000
|
|
4235
|
+
maxBuffer: 2000000,
|
|
4236
|
+
...options
|
|
4214
4237
|
}).trim();
|
|
4215
4238
|
}
|
|
4239
|
+
function gitExitStatus(error) {
|
|
4240
|
+
if (!error || typeof error !== "object")
|
|
4241
|
+
return;
|
|
4242
|
+
const { status, code, signal } = error;
|
|
4243
|
+
return typeof status === "number" && !code && !signal ? status : undefined;
|
|
4244
|
+
}
|
|
4245
|
+
function isCheckpointCommit(projectDir, anchor) {
|
|
4246
|
+
if (typeof anchor !== "string" || !/^[a-f0-9]{40}$/.test(anchor))
|
|
4247
|
+
return false;
|
|
4248
|
+
try {
|
|
4249
|
+
return git(projectDir, ["cat-file", "-t", anchor], { stdio: "pipe" }) === "commit";
|
|
4250
|
+
} catch (error) {
|
|
4251
|
+
if (gitExitStatus(error) === undefined)
|
|
4252
|
+
throw error;
|
|
4253
|
+
try {
|
|
4254
|
+
git(projectDir, ["cat-file", "-e", anchor], { stdio: "pipe" });
|
|
4255
|
+
} catch (existenceError) {
|
|
4256
|
+
if (gitExitStatus(existenceError) === 1)
|
|
4257
|
+
return false;
|
|
4258
|
+
}
|
|
4259
|
+
throw error;
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4216
4262
|
function gitOutputPrefix(projectDir, args) {
|
|
4217
4263
|
try {
|
|
4218
4264
|
return git(projectDir, args);
|
|
@@ -4233,14 +4279,16 @@ function docsChangeSet(projectDir, storedAnchor) {
|
|
|
4233
4279
|
if (realpathSync(git(projectDir, ["rev-parse", "--show-toplevel"])) !== realpathSync(projectDir))
|
|
4234
4280
|
return null;
|
|
4235
4281
|
const head = git(projectDir, ["rev-parse", "HEAD"]);
|
|
4236
|
-
const recorded = Boolean(storedAnchor);
|
|
4237
4282
|
let anchor = storedAnchor;
|
|
4238
|
-
|
|
4239
|
-
|
|
4283
|
+
const recovered = anchor != null && !isCheckpointCommit(projectDir, anchor);
|
|
4284
|
+
if (recovered)
|
|
4285
|
+
anchor = undefined;
|
|
4286
|
+
const recorded = Boolean(anchor);
|
|
4240
4287
|
if (!anchor)
|
|
4241
4288
|
anchor = git(projectDir, ["log", "-1", "--format=%H", "--", ...FILES]);
|
|
4289
|
+
const emptyRecovery = recovered ? { head, text: "", unchanged: false, relevant: false, recoveredAnchor: anchor || null } : null;
|
|
4242
4290
|
if (!anchor)
|
|
4243
|
-
return
|
|
4291
|
+
return emptyRecovery;
|
|
4244
4292
|
if (recorded && anchor === head)
|
|
4245
4293
|
return { head, text: "", unchanged: true, relevant: false };
|
|
4246
4294
|
if (recorded) {
|
|
@@ -4342,7 +4390,7 @@ ${stat}`
|
|
|
4342
4390
|
...excluded.map((path) => `:(exclude)${path}`)
|
|
4343
4391
|
]);
|
|
4344
4392
|
if (!raw)
|
|
4345
|
-
return
|
|
4393
|
+
return emptyRecovery;
|
|
4346
4394
|
const commits = raw.split(/^commit /m);
|
|
4347
4395
|
const text = raw.slice(0, 24000);
|
|
4348
4396
|
return {
|
|
@@ -4351,7 +4399,8 @@ ${stat}`
|
|
|
4351
4399
|
relevant: true,
|
|
4352
4400
|
text: `${text}${raw.length > text.length ? `
|
|
4353
4401
|
[cut ${raw.length - text.length} bytes]` : ""}${commits.length > 201 ? `
|
|
4354
|
-
[cut commits beyond newest 200]` : ""}
|
|
4402
|
+
[cut commits beyond newest 200]` : ""}`,
|
|
4403
|
+
...recovered ? { recoveredAnchor: anchor } : {}
|
|
4355
4404
|
};
|
|
4356
4405
|
} catch (error) {
|
|
4357
4406
|
if (storedAnchor)
|
|
@@ -11227,6 +11276,9 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11227
11276
|
anchor = JSON.parse(storedAnchor ?? "null")?.head;
|
|
11228
11277
|
} catch {}
|
|
11229
11278
|
const changes = task === "maintain-docs" ? docsChangeSet(docsDir, anchor) : null;
|
|
11279
|
+
if (changes?.recoveredAnchor !== undefined) {
|
|
11280
|
+
log2("[dreamer] maintain-docs: stored checkpoint was no longer a commit; restarted from the docs files' last commit, if any");
|
|
11281
|
+
}
|
|
11230
11282
|
const existingDocs = task === "maintain-docs" ? {
|
|
11231
11283
|
architecture: existsSync5(`${docsDir}/ARCHITECTURE.md`),
|
|
11232
11284
|
structure: existsSync5(`${docsDir}/STRUCTURE.md`)
|
|
@@ -11296,7 +11348,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11296
11348
|
return { status: "completed", detail: reason };
|
|
11297
11349
|
}
|
|
11298
11350
|
if (task === "maintain-docs" && changes && (changes.unchanged || !changes.relevant)) {
|
|
11299
|
-
const reason = changes.unchanged ? "no commits since last run" : "diff does not describe a documented area";
|
|
11351
|
+
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";
|
|
11300
11352
|
helpers.recordRun("completed", null, { progress: reason });
|
|
11301
11353
|
return {
|
|
11302
11354
|
status: "completed",
|
|
@@ -11307,7 +11359,15 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11307
11359
|
if (task === "maintain-docs" && hasCurrentDocsProposal(docsDir)) {
|
|
11308
11360
|
const reason = "pending proposal matches current docs";
|
|
11309
11361
|
helpers.recordRun("completed", null, { progress: reason });
|
|
11310
|
-
return {
|
|
11362
|
+
return {
|
|
11363
|
+
status: "completed",
|
|
11364
|
+
detail: reason,
|
|
11365
|
+
...changes?.recoveredAnchor ? {
|
|
11366
|
+
schedulePatch: {
|
|
11367
|
+
taskStateJson: JSON.stringify({ head: changes.recoveredAnchor })
|
|
11368
|
+
}
|
|
11369
|
+
} : {}
|
|
11370
|
+
};
|
|
11311
11371
|
}
|
|
11312
11372
|
const curateChunks = curateMemories ? chunkCurateMemories(curateMemories, Math.max(4000, Math.floor(resolveRetrospectiveUsableInputTokens(config, deps) * 2))) : [];
|
|
11313
11373
|
const batches = task === "curate" ? curateChunks : [{ memories: [], crossChunkCandidates: [] }];
|
|
@@ -13919,7 +13979,11 @@ function getUnsummarizedTailInfo(db, sessionId, triggerBudget, usage, executeThr
|
|
|
13919
13979
|
}
|
|
13920
13980
|
const rawEligibility = getRawHistoryEligibility(db, sessionId);
|
|
13921
13981
|
if (!rawEligibility.hasRawBeyondLastCompartment) {
|
|
13922
|
-
return {
|
|
13982
|
+
return {
|
|
13983
|
+
...TAIL_INFO_DEFAULTS,
|
|
13984
|
+
nextStartOrdinal: rawEligibility.offset,
|
|
13985
|
+
noRawBeyondSummary: true
|
|
13986
|
+
};
|
|
13923
13987
|
}
|
|
13924
13988
|
const boundary = resolveOpenCodeProtectedTailBoundary({
|
|
13925
13989
|
db,
|
|
@@ -13979,6 +14043,12 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
13979
14043
|
executeThresholdPercentage
|
|
13980
14044
|
}))
|
|
13981
14045
|
return { shouldFire: false };
|
|
14046
|
+
let historyGapMark = readHistoryGapMark(db, sessionId);
|
|
14047
|
+
const gapCoverageEnd = historyGapMark ? getLastCompartmentEndMessage(db, sessionId) : -1;
|
|
14048
|
+
if (historyGapMark && gapCoverageEnd > historyGapMark.endOrdinal) {
|
|
14049
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
14050
|
+
historyGapMark = null;
|
|
14051
|
+
}
|
|
13982
14052
|
const lazyInMemoryTail = typeof inMemoryTail === "function" ? inMemoryTail : undefined;
|
|
13983
14053
|
let resolvedInMemoryTail = typeof inMemoryTail === "function" ? undefined : inMemoryTail;
|
|
13984
14054
|
if (resolvedInMemoryTail) {
|
|
@@ -13992,6 +14062,7 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
13992
14062
|
}
|
|
13993
14063
|
const taggerFloor = taggerFloorOverride !== undefined && taggerFloorOverride > 0 ? taggerFloorOverride : resolvedInMemoryTail ? deriveTagLoadFloor2(db, sessionId, resolvedInMemoryTail.messages.map((m) => m.id)) : 0;
|
|
13994
14064
|
const proactiveFloorForGate = getProactiveCompartmentTriggerPercentage(executeThresholdPercentage);
|
|
14065
|
+
let cheapSkip;
|
|
13995
14066
|
if (usage.percentage < proactiveFloorForGate) {
|
|
13996
14067
|
try {
|
|
13997
14068
|
const boundFloor = resolvedInMemoryTail || lazyInMemoryTail ? taggerFloor : 0;
|
|
@@ -14001,15 +14072,53 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
14001
14072
|
const seed = sessionDecisionCalibration(db, sessionId);
|
|
14002
14073
|
const eligibleUpperBound = Math.ceil((persistedBound + untaggedUpperBound) * Math.max(1, seed.proseRatio, seed.toolsRatio, seed.systemRatio));
|
|
14003
14074
|
if (eligibleUpperBound < triggerBudget) {
|
|
14004
|
-
|
|
14005
|
-
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`);
|
|
14006
|
-
return { shouldFire: false };
|
|
14075
|
+
cheapSkip = { eligibleUpperBound, persistedBound, untaggedUpperBound };
|
|
14007
14076
|
}
|
|
14008
14077
|
}
|
|
14009
14078
|
} catch (error) {
|
|
14010
14079
|
sessionLog2(sessionId, `compartment trigger: cheap-gate skipped (falling through to full read): ${error instanceof Error ? error.message : String(error)}`);
|
|
14011
14080
|
}
|
|
14012
14081
|
}
|
|
14082
|
+
const forceMaterializationPercentage = escalationBands(executeThresholdPercentage).forceMaterializationPercentage;
|
|
14083
|
+
let historyGapAdmission;
|
|
14084
|
+
if (historyGapMark && usage.percentage < forceMaterializationPercentage) {
|
|
14085
|
+
const now = Date.now();
|
|
14086
|
+
const checkedAt = historyGapMark.checkedAt;
|
|
14087
|
+
if (checkedAt === undefined || checkedAt > now || now - checkedAt >= EMERGENCY_DRAIN_FAILURE_BACKOFF_MS) {
|
|
14088
|
+
const { failureCount, lastFailureAt } = getHistorianFailureState(db, sessionId);
|
|
14089
|
+
const failedAt = lastFailureAt ?? 0;
|
|
14090
|
+
const admittedRuns = historyGapMark.admittedRuns ?? 0;
|
|
14091
|
+
const previousRunFailed = failureCount > (historyGapMark.failureCountAtAdmission ?? failureCount);
|
|
14092
|
+
if (previousRunFailed && admittedRuns >= 2) {
|
|
14093
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
14094
|
+
historyGapMark = null;
|
|
14095
|
+
} else if (failedAt <= 0 || failedAt > now || now - failedAt >= EMERGENCY_DRAIN_FAILURE_BACKOFF_MS) {
|
|
14096
|
+
const count = resolvedInMemoryTail?.absoluteMessageCount ?? getRawSessionMessageOrdinalCount2(sessionId);
|
|
14097
|
+
if (count <= Math.max(0, gapCoverageEnd)) {
|
|
14098
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
14099
|
+
} else {
|
|
14100
|
+
const inspectedCount = historyGapMark.inspectedCount ?? 0;
|
|
14101
|
+
const canAdmit = admittedRuns < 2 && (admittedRuns === 0 || previousRunFailed);
|
|
14102
|
+
const shouldInspect = canAdmit && count > inspectedCount;
|
|
14103
|
+
const nextFrontier = shouldInspect || count < inspectedCount ? count : inspectedCount;
|
|
14104
|
+
if (claimHistoryGapCheck(db, sessionId, historyGapMark, now, nextFrontier) && shouldInspect) {
|
|
14105
|
+
historyGapAdmission = {
|
|
14106
|
+
id: historyGapMark.id,
|
|
14107
|
+
checkedAt: now,
|
|
14108
|
+
admittedRuns: admittedRuns + 1,
|
|
14109
|
+
failureCount
|
|
14110
|
+
};
|
|
14111
|
+
}
|
|
14112
|
+
}
|
|
14113
|
+
}
|
|
14114
|
+
}
|
|
14115
|
+
}
|
|
14116
|
+
if (cheapSkip && !historyGapAdmission) {
|
|
14117
|
+
const { eligibleUpperBound, persistedBound, untaggedUpperBound } = cheapSkip;
|
|
14118
|
+
const memorySuffix = resolvedInMemoryTail ? ` (persisted=${persistedBound}, untagged-memory≤${untaggedUpperBound})` : "";
|
|
14119
|
+
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`);
|
|
14120
|
+
return { shouldFire: false };
|
|
14121
|
+
}
|
|
14013
14122
|
if (lazyInMemoryTail) {
|
|
14014
14123
|
try {
|
|
14015
14124
|
const policyVersion = loadProtectedTailMeta(db, sessionId).protectedTailPolicyVersion;
|
|
@@ -14036,6 +14145,8 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
14036
14145
|
}
|
|
14037
14146
|
}
|
|
14038
14147
|
if (!tailInfo.hasNewRawHistory) {
|
|
14148
|
+
if (historyGapMark && tailInfo.noRawBeyondSummary)
|
|
14149
|
+
clearHistoryGapMark(db, sessionId, historyGapMark.id);
|
|
14039
14150
|
try {
|
|
14040
14151
|
const lastCompartmentEnd = getLastCompartmentEndMessage(db, sessionId);
|
|
14041
14152
|
sessionLog2(sessionId, `compartment trigger: skipped — no new raw history (usage=${usage.percentage.toFixed(1)}% nextStartOrdinal=${tailInfo.nextStartOrdinal} lastCompartmentEnd=${lastCompartmentEnd})`);
|
|
@@ -14055,13 +14166,19 @@ function checkCompartmentTrigger(db, sessionId, sessionMeta, usage, _previousPer
|
|
|
14055
14166
|
sessionLog2(sessionId, "compartment trigger: waiting for new history after no forward progress");
|
|
14056
14167
|
return { shouldFire: false };
|
|
14057
14168
|
}
|
|
14169
|
+
if (historyGapAdmission && tailInfo.boundarySnapshot && hasRunnableCompartmentWindow(tailInfo.boundarySnapshot) && recordHistoryGapAdmission(db, sessionId, historyGapAdmission)) {
|
|
14170
|
+
return {
|
|
14171
|
+
shouldFire: true,
|
|
14172
|
+
reason: "history_gap",
|
|
14173
|
+
boundarySnapshot: tailInfo.boundarySnapshot
|
|
14174
|
+
};
|
|
14175
|
+
}
|
|
14058
14176
|
const canClearReasoning = reasoningProjection?.canClearReasoning ?? modelAcceptsEmptyContent(reasoningProjection?.providerID);
|
|
14059
14177
|
const projectedPostDropPercentage = estimateProjectedPostDropPercentage(db, sessionId, usage, preloadedActiveTags ?? getActiveTagsBySession2(db, sessionId), keepReasoningTokens, sessionMeta.clearedReasoningThroughTag, canClearReasoning, reasoningProjection?.budgetCutoff, eligiblePendingDropTagIds);
|
|
14060
14178
|
const relativePostDropTarget = executeThresholdPercentage * POST_DROP_TARGET_RATIO;
|
|
14061
14179
|
const ridePermitted = reclaimRide !== undefined && (reclaimRide.permission ? reclaimRidePermitted(reclaimRide, reclaimRide.permission) : hasReclaimRide(reclaimRide));
|
|
14062
14180
|
const rideLabel = reclaimRide ? reclaimRideLabel(reclaimRide) : "ride=none";
|
|
14063
14181
|
const dropsCanLand = ridePermitted;
|
|
14064
|
-
const forceMaterializationPercentage = escalationBands(executeThresholdPercentage).forceMaterializationPercentage;
|
|
14065
14182
|
if (usage.percentage >= forceMaterializationPercentage) {
|
|
14066
14183
|
if (dropsCanLand && projectedPostDropPercentage !== null && projectedPostDropPercentage <= relativePostDropTarget) {
|
|
14067
14184
|
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})`);
|
|
@@ -16292,7 +16409,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16292
16409
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
16293
16410
|
});
|
|
16294
16411
|
const buildManagedCtx = async (db) => {
|
|
16295
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
16412
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-g1sy72e8.js"));
|
|
16296
16413
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-280gmqvd.js"));
|
|
16297
16414
|
const { userObservationCollectionEnabled, userObservationsRequested } = await importPluginModule(() => import("./task-config-vrebjxyy.js"));
|
|
16298
16415
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -16325,7 +16442,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16325
16442
|
return { ok: false, error: "no session" };
|
|
16326
16443
|
const readDirectory = args.readSessionDirectory;
|
|
16327
16444
|
if (readDirectory) {
|
|
16328
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
16445
|
+
const { handoffHistoryWork } = await import("./history-owner-74826t4n.js");
|
|
16329
16446
|
const handed = await handoffHistoryWork({
|
|
16330
16447
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
16331
16448
|
directory,
|
|
@@ -16344,8 +16461,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16344
16461
|
const db = readDatabase();
|
|
16345
16462
|
if (!db)
|
|
16346
16463
|
return { ok: false, error: "db unavailable" };
|
|
16347
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16348
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
16464
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-d3rbpa59.js"));
|
|
16465
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-gxrj4w1r.js"));
|
|
16349
16466
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16350
16467
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
16351
16468
|
return {
|
|
@@ -16403,7 +16520,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16403
16520
|
rpcServer.handle("wrapup", async (params) => {
|
|
16404
16521
|
const readDirectory = args.readSessionDirectory;
|
|
16405
16522
|
if (readDirectory && params.sessionId) {
|
|
16406
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
16523
|
+
const { handoffHistoryWork } = await import("./history-owner-74826t4n.js");
|
|
16407
16524
|
const sessionId = String(params.sessionId);
|
|
16408
16525
|
const handed = await handoffHistoryWork({
|
|
16409
16526
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
@@ -16429,7 +16546,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16429
16546
|
const db = readDatabase();
|
|
16430
16547
|
if (!db)
|
|
16431
16548
|
return { ok: false, error: "db unavailable" };
|
|
16432
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16549
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-knyac7jp.js"));
|
|
16433
16550
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
16434
16551
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
16435
16552
|
if (!window)
|
|
@@ -16506,6 +16623,28 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16506
16623
|
});
|
|
16507
16624
|
}
|
|
16508
16625
|
|
|
16626
|
+
// src/shared/host-sqlite-runtime.ts
|
|
16627
|
+
var RECORDED = Symbol.for("magic-context.host-sqlite-runtime-recorded");
|
|
16628
|
+
function recordHostSqliteRuntime(db, harness, write = (line) => sessionLog2("global", line)) {
|
|
16629
|
+
const processGlobals = globalThis;
|
|
16630
|
+
if (processGlobals[RECORDED])
|
|
16631
|
+
return;
|
|
16632
|
+
try {
|
|
16633
|
+
const row = db.prepare("SELECT sqlite_version() AS version").get();
|
|
16634
|
+
if (!row?.version)
|
|
16635
|
+
return;
|
|
16636
|
+
const bun = detectSqliteRuntime2() === "Bun";
|
|
16637
|
+
const electron = !bun && process.versions.electron;
|
|
16638
|
+
const runtime = bun ? "Bun" : electron ? "Electron" : "Node.js";
|
|
16639
|
+
const version = bun ? process.versions.bun : electron || process.versions.node;
|
|
16640
|
+
if (!version)
|
|
16641
|
+
return;
|
|
16642
|
+
const binding = bun ? "bun:sqlite" : "node:sqlite";
|
|
16643
|
+
processGlobals[RECORDED] = true;
|
|
16644
|
+
write(`host SQLite runtime harness=${harness} sqlite=${row.version} runtime=${runtime} version=${version} binding=${binding}`);
|
|
16645
|
+
} catch {}
|
|
16646
|
+
}
|
|
16647
|
+
|
|
16509
16648
|
// src/hooks/magic-context/auto-embed-session.ts
|
|
16510
16649
|
function localPoolingPreflightPending(projectIdentity) {
|
|
16511
16650
|
const snapshot = getProjectEmbeddingSnapshot2(projectIdentity);
|
|
@@ -24337,7 +24476,7 @@ async function runCompartmentPhaseImpl(args) {
|
|
|
24337
24476
|
function refreshCompartmentCoverage() {
|
|
24338
24477
|
sessionLog2(args.sessionId, "transform: compartment agent completed, refreshing compartment coverage");
|
|
24339
24478
|
const historyReprepareShouldBust = published && args.deferredHistoryRefreshSessions.has(args.sessionId);
|
|
24340
|
-
pendingCompartmentInjection = prepareCompartmentInjection(args.db, args.resolvedSessionId, args.messages, historyReprepareShouldBust, args.coveredInstructions, args.projectPath, args.injectionBudgetTokens, args.experimentalTemporalAwareness);
|
|
24479
|
+
pendingCompartmentInjection = prepareCompartmentInjection(args.db, args.resolvedSessionId, args.messages, historyReprepareShouldBust, args.coveredInstructions, args.projectPath, args.injectionBudgetTokens, args.experimentalTemporalAwareness, undefined, args.restoredBoundaryDiagnostic);
|
|
24341
24480
|
if (historyReprepareShouldBust) {
|
|
24342
24481
|
rebuiltHistoryThisPass = true;
|
|
24343
24482
|
}
|
|
@@ -25585,6 +25724,8 @@ ${notice}`, notificationParams));
|
|
|
25585
25724
|
logTransformTiming(sessionId, "compartmentTrigger", tTrigger);
|
|
25586
25725
|
}
|
|
25587
25726
|
let pendingCompartmentInjection = null;
|
|
25727
|
+
const restoredAfterId = deps.restoredAfterSummaryBoundary?.(sessionId);
|
|
25728
|
+
const restoredBoundaryDiagnostic = restoredAfterId ? { restoredAfterId, expectedAbsence: false } : undefined;
|
|
25588
25729
|
let rebuiltHistoryFromInitialPrepare = false;
|
|
25589
25730
|
let hiddenMessagesAtCompactionSeam = [];
|
|
25590
25731
|
let trimmedMessagesAtCompactionBoundary = [];
|
|
@@ -25595,7 +25736,7 @@ ${notice}`, notificationParams));
|
|
|
25595
25736
|
hasCachedM0: sessionMeta.cachedM0Bytes !== null,
|
|
25596
25737
|
boundary: sessionMeta.cachedM0TrimBoundaryId,
|
|
25597
25738
|
partial: sessionMeta.cachedM0TrimBoundaryPartial ?? true
|
|
25598
|
-
});
|
|
25739
|
+
}, restoredBoundaryDiagnostic);
|
|
25599
25740
|
if (messagesBeforeInitialPrepare) {
|
|
25600
25741
|
const skippedVisibleMessages = pendingCompartmentInjection?.skippedVisibleMessages ?? 0;
|
|
25601
25742
|
trimmedMessagesAtCompactionBoundary = messagesBeforeInitialPrepare.slice(0, skippedVisibleMessages);
|
|
@@ -25840,6 +25981,7 @@ ${notice}`, notificationParams));
|
|
|
25840
25981
|
messages,
|
|
25841
25982
|
coveredInstructions: coveredHostInstructions,
|
|
25842
25983
|
pendingCompartmentInjection,
|
|
25984
|
+
restoredBoundaryDiagnostic,
|
|
25843
25985
|
fallbackModelId,
|
|
25844
25986
|
projectPath: projectIdentity,
|
|
25845
25987
|
injectionBudgetTokens: deps.memoryConfig?.injectionBudgetTokens,
|
|
@@ -26176,6 +26318,7 @@ ${notice}`, notificationParams));
|
|
|
26176
26318
|
},
|
|
26177
26319
|
deferredHistoryWasPendingAtPassStart,
|
|
26178
26320
|
compartmentInjectionRebuiltFromDb: pendingCompartmentInjection?.rebuiltFromDb === true,
|
|
26321
|
+
expectedAbsentCompartmentBoundary: restoredBoundaryDiagnostic?.expectedAbsence,
|
|
26179
26322
|
rebuiltHistoryFromInitialPrepare,
|
|
26180
26323
|
historyRebuiltThisPass,
|
|
26181
26324
|
canConsumeDeferredLate,
|
|
@@ -28161,10 +28304,11 @@ function createCtxExpandTool(deps) {
|
|
|
28161
28304
|
}
|
|
28162
28305
|
const { start, end, verbose } = mode;
|
|
28163
28306
|
const lastCompartmentEnd = getLastCompartmentEndMessage(deps.db, sessionId);
|
|
28164
|
-
|
|
28165
|
-
|
|
28166
|
-
|
|
28167
|
-
const
|
|
28307
|
+
const refusal = unresolvedLiveTailRefusal2(deps.db, sessionId, start, end, lastCompartmentEnd);
|
|
28308
|
+
if (refusal)
|
|
28309
|
+
return refusal;
|
|
28310
|
+
const liveTailAfter = lastCompartmentEnd >= 0 && start > lastCompartmentEnd ? lastCompartmentEnd : undefined;
|
|
28311
|
+
const effectiveEnd = lastCompartmentEnd >= start ? Math.min(end, lastCompartmentEnd) : end;
|
|
28168
28312
|
if (verbose && source) {
|
|
28169
28313
|
if (!path)
|
|
28170
28314
|
throw new Error("Search archive worker unavailable: private archive has no off-thread source");
|
|
@@ -28173,13 +28317,14 @@ function createCtxExpandTool(deps) {
|
|
|
28173
28317
|
start,
|
|
28174
28318
|
end: effectiveEnd,
|
|
28175
28319
|
tokenBudget: CTX_EXPAND_TOKEN_BUDGET,
|
|
28176
|
-
expandTools: deps.expandTools
|
|
28320
|
+
expandTools: deps.expandTools,
|
|
28321
|
+
liveTailAfter
|
|
28177
28322
|
});
|
|
28178
28323
|
if (text === null)
|
|
28179
28324
|
throw new Error("Search archive worker unavailable: unexpected verbose reply");
|
|
28180
28325
|
return text;
|
|
28181
28326
|
}
|
|
28182
|
-
const archived = await renderSearchArchiveOffThread2(deps.db, sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET);
|
|
28327
|
+
const archived = await renderSearchArchiveOffThread2(deps.db, sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET, false, liveTailAfter);
|
|
28183
28328
|
if (archived)
|
|
28184
28329
|
return archived;
|
|
28185
28330
|
if (verbose) {
|
|
@@ -30001,8 +30146,7 @@ function createCtxSearchTool(deps) {
|
|
|
30001
30146
|
return `Error: ${error.message}`;
|
|
30002
30147
|
throw error;
|
|
30003
30148
|
}
|
|
30004
|
-
const
|
|
30005
|
-
const messageOrdinalCutoff = lastCompartmentEnd >= 0 ? lastCompartmentEnd : 0;
|
|
30149
|
+
const messageOrdinalCutoff = Math.max(0, getLastCompartmentEndMessage(deps.db, toolContext.sessionID));
|
|
30006
30150
|
const visibleMemoryIds = getVisibleMemoryIds(deps.db, toolContext.sessionID);
|
|
30007
30151
|
const diagnostics = createUnifiedSearchDiagnostics2();
|
|
30008
30152
|
const projectPath = deps.resolveProjectPath(toolContext.directory);
|
|
@@ -30038,6 +30182,7 @@ function createCtxSearchTool(deps) {
|
|
|
30038
30182
|
isEmbeddingRuntimeEnabled: () => embeddingEnabled === true,
|
|
30039
30183
|
readMessages: deps.readMessages,
|
|
30040
30184
|
maxMessageOrdinal: messageOrdinalCutoff,
|
|
30185
|
+
includeDroppedTailMessages: true,
|
|
30041
30186
|
gitCommitsEnabled,
|
|
30042
30187
|
sources: normalizeSources(args.sources),
|
|
30043
30188
|
visibleMemoryIds,
|
|
@@ -30600,4 +30745,4 @@ function applyHiddenSubagentTemperature(input, output, log) {
|
|
|
30600
30745
|
output.temperature = temperature;
|
|
30601
30746
|
}
|
|
30602
30747
|
|
|
30603
|
-
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, PROVIDER_OVERFLOW_NOTICE, noteServedRecoveryForOverflowHint, holdOverflowResendHint, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, moduleRawBlockMappings, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, isClearlyOverWindow, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, rendersCompartmentHistory, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|
|
30748
|
+
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, recordHostSqliteRuntime, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, PROVIDER_OVERFLOW_NOTICE, noteServedRecoveryForOverflowHint, holdOverflowResendHint, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, moduleRawBlockMappings, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, isClearlyOverWindow, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, rendersCompartmentHistory, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|