@cortexkit/opencode-magic-context 0.49.23 → 0.49.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +0 -26
  2. package/dist/agents/permissions.d.ts +8 -3
  3. package/dist/agents/permissions.d.ts.map +1 -1
  4. package/dist/auto-search-worker.js +4 -4
  5. package/dist/chunk-embedding-write-worker.js +5 -5
  6. package/dist/{compartment-chunk-embedding-he60aaa2.js → compartment-chunk-embedding-eypvn607.js} +3 -3
  7. package/dist/{conflict-warning-hook-2r32hyx6.js → conflict-warning-hook-a27bhggg.js} +4 -4
  8. package/dist/{context-j7hp43a0.js → context-keb00be8.js} +30 -24
  9. package/dist/{embedding-backfill-dtke6tck.js → embedding-backfill-vddgmem3.js} +5 -5
  10. package/dist/features/magic-context/dreamer/primer-seed.d.ts.map +1 -1
  11. package/dist/features/magic-context/tool-definition-tokens.d.ts +113 -57
  12. package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
  13. package/dist/hooks/magic-context/ask-answer-notice.d.ts +25 -0
  14. package/dist/hooks/magic-context/ask-answer-notice.d.ts.map +1 -0
  15. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +1 -1
  16. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  17. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +12 -4
  18. package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
  19. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  20. package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
  21. package/dist/hooks/magic-context/lkg-replay-fit.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
  23. package/dist/hooks/magic-context/protected-tail-boundary.d.ts +8 -0
  24. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  25. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/read-session-raw.d.ts +10 -0
  27. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/signed-thinking-fit-snapshot.d.ts +42 -0
  30. package/dist/hooks/magic-context/signed-thinking-fit-snapshot.d.ts.map +1 -0
  31. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  32. package/dist/{index-y76rhsnr.js → index-0s8454t2.js} +50 -31
  33. package/dist/{index-1gtfne2c.js → index-2haxh8h3.js} +1 -1
  34. package/dist/{index-m32esgmj.js → index-3d5wnkq7.js} +1 -1
  35. package/dist/{index-jfem3dgz.js → index-7tdtpqrg.js} +5 -1
  36. package/dist/{index-mnnkgq0q.js → index-awcftgmx.js} +7 -49
  37. package/dist/{index-1kbznkft.js → index-axjgxeww.js} +10 -8
  38. package/dist/{index-j32jj2t8.js → index-bhyksfyy.js} +3 -3
  39. package/dist/{index-ksq50rg0.js → index-c9zrgcnt.js} +1 -1
  40. package/dist/index-cfaet9cg.js +405 -0
  41. package/dist/{index-jmq8kfe7.js → index-ebsvmc5s.js} +4 -4
  42. package/dist/{index-66eby7hx.js → index-jcr6pe7z.js} +1 -1
  43. package/dist/{index-syaazvy2.js → index-n18sch77.js} +5 -5
  44. package/dist/{index-a9zvn5fe.js → index-q7ywt6xt.js} +3 -3
  45. package/dist/{index-x6cbrv9h.js → index-szf8r0ba.js} +1 -1
  46. package/dist/{index-rxqr723x.js → index-t6j3qxnd.js} +1 -1
  47. package/dist/{index-11gzxvf4.js → index-y6xpzjzr.js} +98 -48
  48. package/dist/{index-mnhcdfxg.js → index-yrrsp47d.js} +91 -17
  49. package/dist/{index-zy67whjr.js → index-z05n7702.js} +1 -1
  50. package/dist/{index-3svaejkh.js → index-z928hmnp.js} +1 -1
  51. package/dist/{index-ffzhwfzy.js → index-zzrzjnx5.js} +3 -3
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +43 -38
  54. package/dist/{message-fts-rowid-map-e79b7b6x.js → message-fts-rowid-map-9e1getgs.js} +2 -2
  55. package/dist/{message-index-4q8ek2fc.js → message-index-3g966xn7.js} +7 -7
  56. package/dist/{message-index-bounded-rydsg9r5.js → message-index-bounded-vaeqhp9w.js} +7 -7
  57. package/dist/migration-worker.js +4 -4
  58. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  59. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  60. package/dist/{project-embedding-registry-hn529988.js → project-embedding-registry-rstzmb60.js} +4 -4
  61. package/dist/raw-ordinal-warmup-worker.js +6 -6
  62. package/dist/{read-session-chunk-t039f0m5.js → read-session-chunk-z5gnc0zb.js} +4 -4
  63. package/dist/{read-session-raw-aw6jgvwg.js → read-session-raw-s4amywnh.js} +3 -1
  64. package/dist/{recomp-orchestrator-hbm53jj5.js → recomp-orchestrator-qwqeskhq.js} +14 -14
  65. package/dist/{search-hea079d7.js → search-84zfqeky.js} +11 -11
  66. package/dist/{search-archive-weh164mh.js → search-archive-mfabzyn2.js} +5 -5
  67. package/dist/{send-session-notification-gqzkz7da.js → send-session-notification-ygj4mja0.js} +3 -3
  68. package/dist/shared/slow-test.d.ts +7 -0
  69. package/dist/shared/slow-test.d.ts.map +1 -0
  70. package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
  71. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  72. package/dist/tools/parameter-descriptions.d.ts +6 -6
  73. package/dist/tools/parameter-descriptions.d.ts.map +1 -1
  74. package/dist/{transform-postprocess-phase-0b04tm1p.js → transform-postprocess-phase-hr1ntmjj.js} +14 -14
  75. package/dist/v2/auto-search-worker.js +4 -4
  76. package/dist/v2/chunk-embedding-write-worker.js +5 -5
  77. package/dist/v2/{compartment-chunk-embedding-8jjmcgeg.js → compartment-chunk-embedding-tk6g4q80.js} +3 -3
  78. package/dist/v2/{context-ea3x7smm.js → context-y7wfvdve.js} +106 -50
  79. package/dist/v2/{embedding-backfill-5e74ae0m.js → embedding-backfill-w5qp7t28.js} +5 -5
  80. package/dist/v2/hooks/context.d.ts +4 -0
  81. package/dist/v2/hooks/context.d.ts.map +1 -1
  82. package/dist/v2/{message-fts-rowid-map-n8fdg2ja.js → message-fts-rowid-map-pqk3a55v.js} +2 -2
  83. package/dist/v2/{message-index-bounded-8rcd7qq9.js → message-index-bounded-te303atj.js} +6 -6
  84. package/dist/v2/{message-index-qz9wdp82.js → message-index-fz6b4jeh.js} +6 -6
  85. package/dist/v2/migration-worker.js +4 -4
  86. package/dist/v2/{project-embedding-registry-v38q4xd5.js → project-embedding-registry-e7zftfvj.js} +4 -4
  87. package/dist/v2/raw-ordinal-warmup-worker.js +6 -6
  88. package/dist/v2/{read-session-chunk-wazfyxcg.js → read-session-chunk-knvkq1hf.js} +3 -3
  89. package/dist/v2/{read-session-raw-b70cpwzj.js → read-session-raw-ppjxnqk4.js} +3 -1
  90. package/dist/v2/{recomp-orchestrator-b12zaptj.js → recomp-orchestrator-e8a4jpvr.js} +11 -11
  91. package/dist/v2/{search-archive-x64rtz1z.js → search-archive-vrwgxv6z.js} +4 -4
  92. package/dist/v2/{search-hza9x72a.js → search-hav4dggf.js} +10 -10
  93. package/dist/v2/{send-session-notification-8eqe259v.js → send-session-notification-f8scq6ae.js} +1 -1
  94. package/dist/v2/{server-m4bfaevz.js → server-5brp2rfn.js} +90 -16
  95. package/dist/v2/{server-ppcd1qxh.js → server-6a8pxpxg.js} +7 -49
  96. package/dist/v2/server-7d6m1p2b.js +361 -0
  97. package/dist/v2/{server-zg5y109h.js → server-7weh65vd.js} +45 -27
  98. package/dist/v2/{server-qteg2kt9.js → server-8j2e7t31.js} +1 -1
  99. package/dist/v2/{server-d48x3m4x.js → server-9xbbaekh.js} +1 -1
  100. package/dist/v2/{server-j8h7bsca.js → server-e75vag9d.js} +3 -3
  101. package/dist/v2/{server-132h8twc.js → server-m6yyn961.js} +2 -2
  102. package/dist/v2/{server-62g58aaz.js → server-pw21ypwb.js} +1 -1
  103. package/dist/v2/{server-ad18djzs.js → server-q5z0gag0.js} +1 -1
  104. package/dist/v2/{server-4kjmrjn4.js → server-swvhxhxz.js} +5 -1
  105. package/dist/v2/{server-33nqbqkw.js → server-tfawsj08.js} +5 -5
  106. package/dist/v2/{server-dtp8hcjh.js → server-wxrdher8.js} +1 -1
  107. package/dist/v2/server.js +5 -5
  108. package/dist/v2/{wrapup-orchestrator-3ssd5yy1.js → wrapup-orchestrator-ycs8y6n4.js} +11 -11
  109. package/dist/{wrapup-orchestrator-5vpcd1zx.js → wrapup-orchestrator-f642w8n3.js} +15 -15
  110. package/package.json +4 -4
  111. package/src/agents/permissions.ts +22 -6
  112. package/src/agents/smart-notes-dreamer-gate.golden.json +241 -241
  113. package/src/agents/smart-notes-on.golden.json +4 -4
  114. package/src/config/compaction-accessor-guard.test.ts +0 -5
  115. package/src/config/removed-config-keys.test.ts +12 -26
  116. package/src/shared/announcement.test.ts +55 -59
  117. package/src/shared/prompt-surface-a1-golden.md +6 -7
  118. package/src/shared/slow-test.ts +24 -0
  119. package/src/shared/stable-json-linear.test.ts +18 -10
  120. package/dist/index-j76ah6d7.js +0 -120
  121. package/dist/v2/server-d1dzgvwd.js +0 -120
  122. package/src/config/latch-permanence-guard.test.ts +0 -258
@@ -22,7 +22,7 @@ import {
22
22
  loadCompartmentChunkEmbeddingsForSearch2,
23
23
  peekCompartmentChunkSearchPool2,
24
24
  warmCompartmentChunkSearchPool2
25
- } from "./server-62g58aaz.js";
25
+ } from "./server-pw21ypwb.js";
26
26
  import {
27
27
  recordEmbeddingMeasurement,
28
28
  saveCommitEmbedding,
@@ -39,7 +39,7 @@ import {
39
39
  enqueueShadowEmbeddingItems2,
40
40
  getProjectEmbeddingSnapshot2,
41
41
  embedItemsForProject2
42
- } from "./server-ad18djzs.js";
42
+ } from "./server-q5z0gag0.js";
43
43
  import {
44
44
  getProjectEmbeddings2
45
45
  } from "./server-4dhv7mqz.js";
@@ -48,7 +48,7 @@ import {
48
48
  isEmbeddingEnabled,
49
49
  embedText,
50
50
  ensureMemoryEmbeddings2
51
- } from "./server-qteg2kt9.js";
51
+ } from "./server-8j2e7t31.js";
52
52
  import {
53
53
  ModuleMemoryAuthorityError2,
54
54
  getMemoriesByProject2,
@@ -63,13 +63,13 @@ import {
63
63
  sanitizeFtsQuery,
64
64
  searchMemoriesFTS,
65
65
  searchMemoriesFTSUnion
66
- } from "./server-d48x3m4x.js";
66
+ } from "./server-9xbbaekh.js";
67
67
  import {
68
68
  cleanSearchText,
69
69
  keywordRelevance,
70
70
  matchedSearchSnippet,
71
71
  getIndexedMessageCorpusSize2
72
- } from "./server-ppcd1qxh.js";
72
+ } from "./server-6a8pxpxg.js";
73
73
  import {
74
74
  MESSAGE_FTS_SESSION_FILTER_SQL,
75
75
  withMessageFtsSessionFilter
@@ -5,7 +5,7 @@ import {
5
5
  } from "./server-gzy5w8ya.js";
6
6
  import {
7
7
  runSessionWarmupWorker
8
- } from "./server-4kjmrjn4.js";
8
+ } from "./server-swvhxhxz.js";
9
9
  import {
10
10
  logSlowWriteTransaction
11
11
  } from "./server-gyy4k6mf.js";
package/dist/v2/server.js CHANGED
@@ -7874,7 +7874,7 @@ var require_src2 = __commonJS(function(exports, module) {
7874
7874
  // package.json
7875
7875
  var package_default = {
7876
7876
  name: "@cortexkit/opencode-magic-context",
7877
- version: "0.49.23",
7877
+ version: "0.49.25",
7878
7878
  type: "module",
7879
7879
  description: "OpenCode plugin for Magic Context — cross-session memory and context management",
7880
7880
  main: "dist/index.js",
@@ -7917,8 +7917,8 @@ var package_default = {
7917
7917
  "check:tui-compiled": 'git diff --exit-code -- src/tui-compiled && test -z "$(git status --porcelain -- src/tui-compiled)"',
7918
7918
  "check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
7919
7919
  typecheck: "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
7920
- test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && bun run test:active-session-backfill && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!re-embeds 1600 old chunks)'",
7921
- "test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern '^re-embeds 1600 old chunks' --timeout 120000",
7920
+ test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_SLOW_TESTS=0 MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!.*\\[slow\\] )'",
7921
+ "test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern 're-embeds old chunks' --timeout 120000",
7922
7922
  "test:serial": "bun install --frozen-lockfile && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --timeout 30000",
7923
7923
  "test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
7924
7924
  lint: "bun ../../scripts/check-bun.mjs && biome check .",
@@ -7929,7 +7929,7 @@ var package_default = {
7929
7929
  prepublishOnly: "bun run build && bun run check:tui-compiled"
7930
7930
  },
7931
7931
  "//check:tui-compiled": "Check drift on output already generated by build or build:tui; this check never regenerates files. CI and prepublishOnly build first.",
7932
- "//test": "The strict 50ms active-session backfill latency gate runs alone before the four-worker suite, which excludes only that already-run case. Unrelated workers can deschedule the latency monitor. Test runs also disable JSC's optimizing WebAssembly tier so per-file isolation does not pay its compilation cost on every file; production host options are unchanged.",
7932
+ "//test": "Unit shards run small behavioral fixtures. The nightly/check-branch slow-unit lane runs full scale and latency gates in fresh processes once per mode, not once per shard. JSC's optimizing WebAssembly tier stays disabled in tests; production host options are unchanged.",
7933
7933
  dependencies: {
7934
7934
  "@cortexkit/subc-client": "0.11.1",
7935
7935
  "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
@@ -8195,7 +8195,7 @@ async function setup(context) {
8195
8195
  if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
8196
8196
  log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
8197
8197
  }
8198
- const { registerContext } = await import("./context-ea3x7smm.js");
8198
+ const { registerContext } = await import("./context-y7wfvdve.js");
8199
8199
  setHarness2("opencode2");
8200
8200
  bindStaleBuildNotice({}, import.meta.url, "opencode2");
8201
8201
  const duties = await registerContext(context);
@@ -19,8 +19,8 @@ import {
19
19
  registerActiveCompartmentRun,
20
20
  setRecompStarting2,
21
21
  setRecompTerminal2
22
- } from "./server-zg5y109h.js";
23
- import"./server-ad18djzs.js";
22
+ } from "./server-7weh65vd.js";
23
+ import"./server-q5z0gag0.js";
24
24
  import"./server-3mz2qh5a.js";
25
25
  import"./server-ab1g0wn9.js";
26
26
  import {
@@ -28,10 +28,10 @@ import {
28
28
  } from "./server-gzy5w8ya.js";
29
29
  import"./server-51779zs2.js";
30
30
  import"./server-cpjk5jd2.js";
31
- import"./server-4kjmrjn4.js";
32
- import"./server-dtp8hcjh.js";
33
- import"./server-62g58aaz.js";
34
- import"./server-ppcd1qxh.js";
31
+ import"./server-swvhxhxz.js";
32
+ import"./server-wxrdher8.js";
33
+ import"./server-pw21ypwb.js";
34
+ import"./server-6a8pxpxg.js";
35
35
  import {
36
36
  getWrapupInProgressState,
37
37
  acquireWrapupInProgress,
@@ -40,20 +40,20 @@ import {
40
40
  getHistorianFailureState,
41
41
  clearEmergencyRecovery,
42
42
  prepareRawSessionOrdinals2
43
- } from "./server-m4bfaevz.js";
43
+ } from "./server-5brp2rfn.js";
44
44
  import"./server-rqebawx1.js";
45
- import"./server-j8h7bsca.js";
45
+ import"./server-e75vag9d.js";
46
46
  import"./server-1zx87sdm.js";
47
47
  import"./server-fa7vtp40.js";
48
48
  import"./server-24g8r2d0.js";
49
49
  import"./server-2ra6pwf3.js";
50
50
  import"./server-3vhxy2k5.js";
51
- import"./server-d1dzgvwd.js";
51
+ import"./server-7d6m1p2b.js";
52
52
  import"./server-fr0wbhdn.js";
53
53
  import"./server-wwaw5npa.js";
54
54
  import"./server-qjvk4a9t.js";
55
55
  import"./server-fb3zxn06.js";
56
- import"./server-d48x3m4x.js";
56
+ import"./server-9xbbaekh.js";
57
57
  import {
58
58
  pushNotification2
59
59
  } from "./server-x8a7jmkh.js";
@@ -62,7 +62,7 @@ import"./server-qt1qqasc.js";
62
62
  import"./server-bsgd4dk1.js";
63
63
  import"./server-4dhv7mqz.js";
64
64
  import"./server-vr4szghm.js";
65
- import"./server-qteg2kt9.js";
65
+ import"./server-8j2e7t31.js";
66
66
  import"./server-jjvbk92s.js";
67
67
  import"./server-94wk1ey3.js";
68
68
  import"./server-29qp8nz4.js";
@@ -1,41 +1,41 @@
1
1
  import {
2
2
  runManagedWrapup2
3
- } from "./index-jmq8kfe7.js";
4
- import"./index-ffzhwfzy.js";
5
- import"./index-y76rhsnr.js";
3
+ } from "./index-ebsvmc5s.js";
4
+ import"./index-zzrzjnx5.js";
5
+ import"./index-0s8454t2.js";
6
6
  import"./index-qgh1qwjj.js";
7
- import"./index-3svaejkh.js";
8
- import"./index-mnnkgq0q.js";
7
+ import"./index-z928hmnp.js";
8
+ import"./index-awcftgmx.js";
9
9
  import"./index-sd3egckz.js";
10
- import"./index-rxqr723x.js";
11
- import"./index-zy67whjr.js";
10
+ import"./index-t6j3qxnd.js";
11
+ import"./index-z05n7702.js";
12
12
  import"./index-jjvbk92s.js";
13
13
  import"./index-4dhv7mqz.js";
14
14
  import"./index-spwjbkc7.js";
15
- import"./index-66eby7hx.js";
15
+ import"./index-jcr6pe7z.js";
16
16
  import"./index-qt1qqasc.js";
17
- import"./index-mnhcdfxg.js";
17
+ import"./index-yrrsp47d.js";
18
18
  import"./index-whcgcfrv.js";
19
19
  import"./index-1zx87sdm.js";
20
- import"./index-ksq50rg0.js";
20
+ import"./index-c9zrgcnt.js";
21
21
  import"./index-x8a7jmkh.js";
22
22
  import"./index-rrv26qjz.js";
23
23
  import"./index-51rdvtkz.js";
24
24
  import"./index-nxrsns5x.js";
25
25
  import"./index-kfyb3k6n.js";
26
- import"./index-m32esgmj.js";
26
+ import"./index-3d5wnkq7.js";
27
27
  import"./index-wfybj1dw.js";
28
- import"./index-a9zvn5fe.js";
28
+ import"./index-q7ywt6xt.js";
29
29
  import"./index-fb3zxn06.js";
30
30
  import"./index-9q1g3c5q.js";
31
31
  import"./index-kq5w68dp.js";
32
- import"./index-x6cbrv9h.js";
32
+ import"./index-szf8r0ba.js";
33
33
  import"./index-fr0wbhdn.js";
34
34
  import"./index-c7phnbvk.js";
35
- import"./index-j76ah6d7.js";
35
+ import"./index-cfaet9cg.js";
36
36
  import"./index-x9k3mqrf.js";
37
37
  import"./index-58e3y90n.js";
38
- import"./index-jfem3dgz.js";
38
+ import"./index-7tdtpqrg.js";
39
39
  import"./index-v0p37hm2.js";
40
40
  import"./index-t5pck3ss.js";
41
41
  import"./index-b88dwwrh.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.49.23",
3
+ "version": "0.49.25",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -43,8 +43,8 @@
43
43
  "check:tui-compiled": "git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
44
44
  "check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
45
45
  "typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
46
- "test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && bun run test:active-session-backfill && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!re-embeds 1600 old chunks)'",
47
- "test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern '^re-embeds 1600 old chunks' --timeout 120000",
46
+ "test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_SLOW_TESTS=0 MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!.*\\[slow\\] )'",
47
+ "test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern 're-embeds old chunks' --timeout 120000",
48
48
  "test:serial": "bun install --frozen-lockfile && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --timeout 30000",
49
49
  "test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
50
50
  "lint": "bun ../../scripts/check-bun.mjs && biome check .",
@@ -55,7 +55,7 @@
55
55
  "prepublishOnly": "bun run build && bun run check:tui-compiled"
56
56
  },
57
57
  "//check:tui-compiled": "Check drift on output already generated by build or build:tui; this check never regenerates files. CI and prepublishOnly build first.",
58
- "//test": "The strict 50ms active-session backfill latency gate runs alone before the four-worker suite, which excludes only that already-run case. Unrelated workers can deschedule the latency monitor. Test runs also disable JSC's optimizing WebAssembly tier so per-file isolation does not pay its compilation cost on every file; production host options are unchanged.",
58
+ "//test": "Unit shards run small behavioral fixtures. The nightly/check-branch slow-unit lane runs full scale and latency gates in fresh processes once per mode, not once per shard. JSC's optimizing WebAssembly tier stays disabled in tests; production host options are unchanged.",
59
59
  "dependencies": {
60
60
  "@cortexkit/subc-client": "0.11.1",
61
61
  "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
@@ -112,9 +112,14 @@ function isPermissionMap(value: unknown): value is Record<string, unknown> {
112
112
  * OpenCode accepts either a whole-permission action or a pattern map for
113
113
  * `permission.task`; its visibility evaluator uses the last matching rule.
114
114
  * Normalize the whole-permission form, retain unrelated user rules, then append
115
- * our exact agent-id denies. When the ambient task policy has a wildcard deny,
116
- * re-emit that wildcard after the named denies so the Task tool is hidden rather
117
- * than shown as a callable-but-refused tool.
115
+ * our exact agent-id denies. When the ambient task policy is a wildcard deny
116
+ * whose only companions are our own appended agent-id denies, re-emit that
117
+ * wildcard after the named denies so the Task tool is hidden rather than shown
118
+ * as a callable-but-refused tool. When the wildcard deny sits next to any of
119
+ * the agent's own rules (the deny-by-default-with-exceptions shape), keep the
120
+ * agent's own ordering untouched: OpenCode resolves with the last matching
121
+ * rule, so moving the wildcard to the end there would override every named
122
+ * allow and empty the Task tool (#777).
118
123
  */
119
124
  export function denyTaskRoutingToAgents(
120
125
  permission: unknown,
@@ -133,10 +138,19 @@ export function denyTaskRoutingToAgents(
133
138
  : {};
134
139
  const internalAgentIdSet = new Set(internalAgentIds);
135
140
  const hasAmbientWildcardDeny = configuredTask["*"] === "deny";
141
+ // Only our own appended agent-id denies may accompany the wildcard for the
142
+ // move to stay correct — a user's named allow next to it must keep winning.
143
+ // Excluding internal ids here also keeps re-merging our own output
144
+ // idempotent: that output is exactly internal denies plus the wildcard.
145
+ const movesAmbientWildcardDeny =
146
+ hasAmbientWildcardDeny &&
147
+ Object.keys(configuredTask).every(
148
+ (agentId) => agentId === "*" || internalAgentIdSet.has(agentId),
149
+ );
136
150
  const retainedTask = Object.fromEntries(
137
151
  Object.entries(configuredTask).filter(
138
152
  ([agentId]) =>
139
- !internalAgentIdSet.has(agentId) && (agentId !== "*" || !hasAmbientWildcardDeny),
153
+ !internalAgentIdSet.has(agentId) && (agentId !== "*" || !movesAmbientWildcardDeny),
140
154
  ),
141
155
  );
142
156
 
@@ -147,8 +161,10 @@ export function denyTaskRoutingToAgents(
147
161
  ...Object.fromEntries(internalAgentIds.map((agentId) => [agentId, "deny"])),
148
162
  // OpenCode's Permission.disabled uses findLast. Re-inserting the
149
163
  // ambient wildcard after our named routing denies keeps its whole-tool
150
- // deny as the final match and makes the Task tool invisible.
151
- ...(hasAmbientWildcardDeny ? { "*": "deny" } : {}),
164
+ // deny as the final match and makes the Task tool invisible — but
165
+ // only when it stood alone; with named rules the agent's own
166
+ // ordering must win (#777).
167
+ ...(movesAmbientWildcardDeny ? { "*": "deny" } : {}),
152
168
  },
153
169
  };
154
170
  }