@cortexkit/opencode-magic-context 0.41.4 → 0.42.1

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 (358) hide show
  1. package/README.md +21 -3
  2. package/dist/agents/hidden-agent-registrations.d.ts +1 -3
  3. package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
  4. package/dist/agents/magic-context-prompt.d.ts +1 -1
  5. package/dist/agents/magic-context-prompt.d.ts.map +1 -1
  6. package/dist/agents/permissions.d.ts +1 -22
  7. package/dist/agents/permissions.d.ts.map +1 -1
  8. package/dist/config/agent-disable.d.ts +0 -5
  9. package/dist/config/agent-disable.d.ts.map +1 -1
  10. package/dist/config/index.d.ts +5 -0
  11. package/dist/config/index.d.ts.map +1 -1
  12. package/dist/config/migrate-config-location.d.ts.map +1 -1
  13. package/dist/config/project-security.d.ts +20 -2
  14. package/dist/config/project-security.d.ts.map +1 -1
  15. package/dist/config/removed-agent-config.d.ts +8 -0
  16. package/dist/config/removed-agent-config.d.ts.map +1 -0
  17. package/dist/config/schema/magic-context.d.ts +43 -201
  18. package/dist/config/schema/magic-context.d.ts.map +1 -1
  19. package/dist/{conflict-warning-hook-ejkc9sjn.js → conflict-warning-hook-6p3xqeac.js} +3 -3
  20. package/dist/{derive-budgets-bc366cz8.js → derive-budgets-s2pgnnm4.js} +1 -1
  21. package/dist/features/builtin-commands/commands.d.ts +0 -4
  22. package/dist/features/builtin-commands/commands.d.ts.map +1 -1
  23. package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
  24. package/dist/features/magic-context/compartment-chunk-embedding.d.ts +15 -4
  25. package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
  26. package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
  27. package/dist/features/magic-context/context-authority.d.ts +31 -4
  28. package/dist/features/magic-context/context-authority.d.ts.map +1 -1
  29. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  30. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
  31. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  32. package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -1
  33. package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
  34. package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +19 -9
  35. package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -1
  36. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
  37. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  38. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +4 -0
  39. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  40. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  41. package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
  42. package/dist/features/magic-context/git-commits/sweep-coordinator.d.ts.map +1 -1
  43. package/dist/features/magic-context/index.d.ts +0 -1
  44. package/dist/features/magic-context/index.d.ts.map +1 -1
  45. package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
  46. package/dist/features/magic-context/memory/embedding-local.d.ts +13 -0
  47. package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
  48. package/dist/features/magic-context/memory/embedding-model-match.d.ts +41 -0
  49. package/dist/features/magic-context/memory/embedding-model-match.d.ts.map +1 -0
  50. package/dist/features/magic-context/memory/embedding-openai.d.ts +7 -20
  51. package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
  52. package/dist/features/magic-context/memory/embedding-provider.d.ts +2 -2
  53. package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -1
  54. package/dist/features/magic-context/memory/embedding-synapse.d.ts +48 -14
  55. package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
  56. package/dist/features/magic-context/memory/embedding.d.ts +1 -1
  57. package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
  58. package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
  59. package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
  60. package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
  61. package/dist/features/magic-context/memory/promotion.d.ts +7 -1
  62. package/dist/features/magic-context/memory/promotion.d.ts.map +1 -1
  63. package/dist/features/magic-context/merged-reasoning-decisions.d.ts +6 -0
  64. package/dist/features/magic-context/merged-reasoning-decisions.d.ts.map +1 -0
  65. package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
  66. package/dist/features/magic-context/message-index-async.d.ts +12 -0
  67. package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
  68. package/dist/features/magic-context/message-index.d.ts.map +1 -1
  69. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  70. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  71. package/dist/features/magic-context/mural/render-trigger.d.ts +6 -0
  72. package/dist/features/magic-context/mural/render-trigger.d.ts.map +1 -1
  73. package/dist/features/magic-context/no-content-compartment.d.ts +12 -0
  74. package/dist/features/magic-context/no-content-compartment.d.ts.map +1 -0
  75. package/dist/features/magic-context/pi-content-decisions.d.ts +9 -0
  76. package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -0
  77. package/dist/features/magic-context/project-docs-hash.d.ts +4 -0
  78. package/dist/features/magic-context/project-docs-hash.d.ts.map +1 -1
  79. package/dist/features/magic-context/project-embedding-registry.d.ts +13 -4
  80. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  81. package/dist/features/magic-context/protection-window.d.ts +79 -0
  82. package/dist/features/magic-context/protection-window.d.ts.map +1 -0
  83. package/dist/features/magic-context/search.d.ts.map +1 -1
  84. package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
  85. package/dist/features/magic-context/shadow-backfill-state.d.ts +26 -0
  86. package/dist/features/magic-context/shadow-backfill-state.d.ts.map +1 -0
  87. package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
  88. package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts +4 -0
  89. package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
  90. package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -1
  91. package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
  92. package/dist/features/magic-context/storage-db.d.ts +1 -1
  93. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  94. package/dist/features/magic-context/storage-embedding-measurements.d.ts +2 -2
  95. package/dist/features/magic-context/storage-embedding-measurements.d.ts.map +1 -1
  96. package/dist/features/magic-context/storage-historian-runs.d.ts +4 -0
  97. package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -1
  98. package/dist/features/magic-context/storage-memory-mutation-log.d.ts +1 -0
  99. package/dist/features/magic-context/storage-memory-mutation-log.d.ts.map +1 -1
  100. package/dist/features/magic-context/storage-meta-persisted.d.ts +79 -13
  101. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  102. package/dist/features/magic-context/storage-meta.d.ts +1 -1
  103. package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
  104. package/dist/features/magic-context/storage-native-replay.d.ts +29 -0
  105. package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -0
  106. package/dist/features/magic-context/storage-notes.d.ts +6 -0
  107. package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
  108. package/dist/features/magic-context/storage-replay-document.d.ts +33 -0
  109. package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -0
  110. package/dist/features/magic-context/storage-subagent-invocations.d.ts +1 -1
  111. package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
  112. package/dist/features/magic-context/storage-tags.d.ts +19 -11
  113. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  114. package/dist/features/magic-context/storage.d.ts +3 -3
  115. package/dist/features/magic-context/storage.d.ts.map +1 -1
  116. package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
  117. package/dist/features/magic-context/tagger.d.ts +13 -0
  118. package/dist/features/magic-context/tagger.d.ts.map +1 -1
  119. package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
  120. package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
  121. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
  122. package/dist/features/magic-context/workspaces.d.ts.map +1 -1
  123. package/dist/hooks/magic-context/apply-operations.d.ts +11 -5
  124. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  125. package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
  126. package/dist/hooks/magic-context/cache-busting-signals.d.ts +9 -1
  127. package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
  128. package/dist/hooks/magic-context/caveman-cleanup.d.ts +1 -1
  129. package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
  130. package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
  131. package/dist/hooks/magic-context/child-session-spawn.d.ts +3 -3
  132. package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -1
  133. package/dist/hooks/magic-context/command-handler.d.ts +1 -10
  134. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  135. package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
  136. package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +10 -21
  137. package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -1
  138. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  139. package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
  140. package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
  141. package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -1
  142. package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
  143. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +26 -2
  144. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
  145. package/dist/hooks/magic-context/decay-render.d.ts.map +1 -1
  146. package/dist/hooks/magic-context/dropped-input-guard.d.ts +9 -0
  147. package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -0
  148. package/dist/hooks/magic-context/embed-session-state.d.ts +1 -1
  149. package/dist/hooks/magic-context/embed-session-state.d.ts.map +1 -1
  150. package/dist/hooks/magic-context/emergency-drop.d.ts +6 -1
  151. package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
  152. package/dist/hooks/magic-context/event-handler.d.ts +0 -1
  153. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  154. package/dist/hooks/magic-context/event-payloads.d.ts +7 -6
  155. package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
  156. package/dist/hooks/magic-context/event-resolvers.d.ts +1 -1
  157. package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
  158. package/dist/hooks/magic-context/execute-status.d.ts +3 -1
  159. package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
  160. package/dist/hooks/magic-context/format-embed-failure.d.ts +2 -1
  161. package/dist/hooks/magic-context/format-embed-failure.d.ts.map +1 -1
  162. package/dist/hooks/magic-context/format-embed-status.d.ts.map +1 -1
  163. package/dist/hooks/magic-context/heuristic-cleanup.d.ts +7 -1
  164. package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
  165. package/dist/hooks/magic-context/hook-handlers.d.ts +3 -1
  166. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  167. package/dist/hooks/magic-context/hook.d.ts +13 -4
  168. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  169. package/dist/hooks/magic-context/inject-compartments.d.ts +14 -1
  170. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  171. package/dist/hooks/magic-context/live-session-state.d.ts +1 -1
  172. package/dist/hooks/magic-context/lkg-slot.d.ts +34 -0
  173. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  174. package/dist/hooks/magic-context/maintenance-authority.d.ts +2 -2
  175. package/dist/hooks/magic-context/maintenance-authority.d.ts.map +1 -1
  176. package/dist/hooks/magic-context/module-state-sync-timing.d.ts +21 -0
  177. package/dist/hooks/magic-context/module-state-sync-timing.d.ts.map +1 -0
  178. package/dist/hooks/magic-context/module-state-sync.d.ts +21 -7
  179. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  180. package/dist/hooks/magic-context/module-transport.d.ts +12 -0
  181. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  182. package/dist/hooks/magic-context/module-wire.d.ts +8 -0
  183. package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
  184. package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
  185. package/dist/hooks/magic-context/persist-filtered-noise.d.ts +5 -0
  186. package/dist/hooks/magic-context/persist-filtered-noise.d.ts.map +1 -0
  187. package/dist/hooks/magic-context/protected-tail-boundary.d.ts +6 -0
  188. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  189. package/dist/hooks/magic-context/read-session-chunk.d.ts +18 -18
  190. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  191. package/dist/hooks/magic-context/read-session-db.d.ts +22 -12
  192. package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
  193. package/dist/hooks/magic-context/read-session-formatting.d.ts +8 -0
  194. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  195. package/dist/hooks/magic-context/read-session-raw.d.ts +10 -1
  196. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  197. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  198. package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -1
  199. package/dist/hooks/magic-context/rust-mode-transform.d.ts +74 -9
  200. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  201. package/dist/hooks/magic-context/send-session-notification.d.ts +11 -10
  202. package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
  203. package/dist/hooks/magic-context/strip-content.d.ts +7 -0
  204. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  205. package/dist/hooks/magic-context/supersession-reclaim.d.ts +13 -0
  206. package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
  207. package/dist/hooks/magic-context/system-prompt-hash.d.ts +2 -3
  208. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  209. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +8 -3
  210. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  211. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  212. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  213. package/dist/hooks/magic-context/transform-context-state.d.ts +7 -1
  214. package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
  215. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +11 -4
  216. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  217. package/dist/hooks/magic-context/transform.d.ts +7 -2
  218. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  219. package/dist/hooks/magic-context/upgrade-reminder.d.ts +7 -9
  220. package/dist/hooks/magic-context/upgrade-reminder.d.ts.map +1 -1
  221. package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
  222. package/dist/index-1974jvn3.js +783 -0
  223. package/dist/{index-0y2mcg5y.js → index-1q9kay7n.js} +18717 -16197
  224. package/dist/{index-4avmwfp5.js → index-36wd1d6k.js} +6 -29
  225. package/dist/{index-fz104x1j.js → index-jmtjh2d3.js} +3 -3
  226. package/dist/{index-q264erdp.js → index-nqgjwfzn.js} +70 -38
  227. package/dist/{index-mjv9je4e.js → index-xdtge3y2.js} +45 -7
  228. package/dist/index.d.ts.map +1 -1
  229. package/dist/index.js +6457 -5190
  230. package/dist/plugin/conflict-warning-hook.d.ts +5 -6
  231. package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
  232. package/dist/plugin/dream-timer.d.ts +1 -0
  233. package/dist/plugin/dream-timer.d.ts.map +1 -1
  234. package/dist/plugin/embedding-bootstrap-helpers.d.ts.map +1 -1
  235. package/dist/plugin/embedding-routing.d.ts +4 -1
  236. package/dist/plugin/embedding-routing.d.ts.map +1 -1
  237. package/dist/plugin/hooks/create-session-hooks.d.ts +16 -2
  238. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  239. package/dist/plugin/rpc-handlers.d.ts +31 -1
  240. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  241. package/dist/plugin/rust-tool-backends.d.ts +1 -0
  242. package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
  243. package/dist/plugin/tool-registry.d.ts.map +1 -1
  244. package/dist/{recomp-orchestrator-q98r6rga.js → recomp-orchestrator-m33b3rk9.js} +5 -5
  245. package/dist/{send-session-notification-hdh02wy9.js → send-session-notification-1qeqkswb.js} +6 -4
  246. package/dist/shared/child-session-teardown.d.ts +34 -0
  247. package/dist/shared/child-session-teardown.d.ts.map +1 -0
  248. package/dist/shared/keep-subagents.d.ts +1 -1
  249. package/dist/shared/keep-subagents.d.ts.map +1 -1
  250. package/dist/shared/model-suggestion-retry.d.ts +1 -1
  251. package/dist/shared/opencode-db-path.d.ts +24 -0
  252. package/dist/shared/opencode-db-path.d.ts.map +1 -0
  253. package/dist/shared/prompt-surface-runtime.d.ts +10 -5
  254. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  255. package/dist/shared/resolve-fallbacks.d.ts +1 -1
  256. package/dist/shared/rpc-types.d.ts +121 -0
  257. package/dist/shared/rpc-types.d.ts.map +1 -1
  258. package/dist/shared/sqlite.d.ts +42 -0
  259. package/dist/shared/sqlite.d.ts.map +1 -1
  260. package/dist/shared/status-detail-text.d.ts +3 -1
  261. package/dist/shared/status-detail-text.d.ts.map +1 -1
  262. package/dist/shared/status-summary.d.ts +30 -0
  263. package/dist/shared/status-summary.d.ts.map +1 -0
  264. package/dist/shared/subagent-runner.d.ts +17 -10
  265. package/dist/shared/subagent-runner.d.ts.map +1 -1
  266. package/dist/shared/tag-transcript.d.ts.map +1 -1
  267. package/dist/shared/tail-hygiene-status.d.ts +1 -0
  268. package/dist/shared/tail-hygiene-status.d.ts.map +1 -1
  269. package/dist/shared/transcript.d.ts +6 -0
  270. package/dist/shared/transcript.d.ts.map +1 -1
  271. package/dist/shared/user-facing-codes.d.ts +191 -0
  272. package/dist/shared/user-facing-codes.d.ts.map +1 -0
  273. package/dist/shared/window-geometry.d.ts +23 -0
  274. package/dist/shared/window-geometry.d.ts.map +1 -1
  275. package/dist/shared/write-transaction-timing.d.ts +1 -1
  276. package/dist/shared/write-transaction-timing.d.ts.map +1 -1
  277. package/dist/{storage-meta-session-dvwfw778.js → storage-meta-session-e6g0mmec.js} +2 -2
  278. package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
  279. package/dist/tools/ctx-memory/verification-recording.d.ts.map +1 -1
  280. package/dist/tools/ctx-note/constants.d.ts +1 -1
  281. package/dist/tools/ctx-note/constants.d.ts.map +1 -1
  282. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  283. package/dist/tools/ctx-note/types.d.ts +1 -0
  284. package/dist/tools/ctx-note/types.d.ts.map +1 -1
  285. package/dist/tools/ctx-reduce/tools.d.ts +10 -1
  286. package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
  287. package/dist/tools/ctx-search/constants.d.ts +1 -1
  288. package/dist/tools/ctx-search/constants.d.ts.map +1 -1
  289. package/dist/tools/light-descriptions.d.ts +2 -2
  290. package/dist/tools/light-descriptions.d.ts.map +1 -1
  291. package/package.json +2 -3
  292. package/src/agents/hidden-agent-registrations.ts +3 -15
  293. package/src/agents/magic-context-prompt.test.ts +7 -5
  294. package/src/agents/magic-context-prompt.ts +22 -30
  295. package/src/agents/permissions.test.ts +1 -42
  296. package/src/agents/permissions.ts +1 -24
  297. package/src/config/agent-disable.ts +5 -22
  298. package/src/config/index.test.ts +126 -15
  299. package/src/config/index.ts +41 -6
  300. package/src/config/latch-permanence-guard.test.ts +4 -0
  301. package/src/config/migrate-config-location.test.ts +39 -6
  302. package/src/config/migrate-config-location.ts +18 -31
  303. package/src/config/profiles.ts +1 -1
  304. package/src/config/project-security.hostile-matrix.test.ts +0 -8
  305. package/src/config/project-security.test.ts +21 -24
  306. package/src/config/project-security.ts +115 -14
  307. package/src/config/protected-tokens.test.ts +235 -0
  308. package/src/config/removed-agent-config.ts +45 -0
  309. package/src/config/removed-agent-source-fence.test.ts +56 -0
  310. package/src/config/schema/magic-context.test.ts +50 -42
  311. package/src/config/schema/magic-context.ts +70 -37
  312. package/src/shared/child-session-teardown.test.ts +218 -0
  313. package/src/shared/child-session-teardown.ts +66 -0
  314. package/src/shared/keep-subagents.ts +9 -14
  315. package/src/shared/model-suggestion-retry.ts +1 -1
  316. package/src/shared/opencode-db-path.test.ts +196 -0
  317. package/src/shared/opencode-db-path.ts +215 -0
  318. package/src/shared/prompt-surface-a1-golden.md +50 -35
  319. package/src/shared/prompt-surface-runtime.test.ts +28 -0
  320. package/src/shared/prompt-surface-runtime.ts +22 -5
  321. package/src/shared/resolve-fallbacks.ts +1 -1
  322. package/src/shared/rpc-types.ts +128 -0
  323. package/src/shared/session-messages-bounded.test.ts +1 -1
  324. package/src/shared/sqlite-import-fence.test.ts +19 -0
  325. package/src/shared/sqlite.test.ts +27 -1
  326. package/src/shared/sqlite.ts +204 -1
  327. package/src/shared/status-detail-text.test.ts +92 -20
  328. package/src/shared/status-detail-text.ts +24 -2
  329. package/src/shared/status-summary.ts +167 -0
  330. package/src/shared/subagent-runner.ts +17 -10
  331. package/src/shared/tag-transcript.ts +33 -21
  332. package/src/shared/tail-hygiene-status.ts +8 -0
  333. package/src/shared/transcript.ts +7 -0
  334. package/src/shared/user-facing-codes.test.ts +140 -0
  335. package/src/shared/user-facing-codes.ts +276 -0
  336. package/src/shared/window-geometry.test.ts +44 -0
  337. package/src/shared/window-geometry.ts +89 -11
  338. package/src/shared/write-transaction-attribution.test.ts +241 -0
  339. package/src/shared/write-transaction-timing.ts +2 -1
  340. package/src/tui/index.tsx +44 -11
  341. package/src/tui/slots/sidebar-content.tsx +12 -7
  342. package/src/tui-compiled/index.tsx +662 -649
  343. package/src/tui-compiled/slots/sidebar-content.tsx +301 -305
  344. package/dist/agents/sidekick.d.ts +0 -2
  345. package/dist/agents/sidekick.d.ts.map +0 -1
  346. package/dist/features/magic-context/defaults.d.ts +0 -2
  347. package/dist/features/magic-context/defaults.d.ts.map +0 -1
  348. package/dist/features/magic-context/sidekick/agent.d.ts +0 -14
  349. package/dist/features/magic-context/sidekick/agent.d.ts.map +0 -1
  350. package/dist/features/magic-context/sidekick/core.d.ts +0 -38
  351. package/dist/features/magic-context/sidekick/core.d.ts.map +0 -1
  352. package/dist/features/magic-context/sidekick/index.d.ts +0 -3
  353. package/dist/features/magic-context/sidekick/index.d.ts.map +0 -1
  354. package/dist/hooks/magic-context/boundary-execution.d.ts +0 -27
  355. package/dist/hooks/magic-context/boundary-execution.d.ts.map +0 -1
  356. package/dist/index-raatkvw5.js +0 -360
  357. package/src/agents/sidekick.ts +0 -1
  358. package/src/features/magic-context/defaults.ts +0 -1
@@ -0,0 +1,241 @@
1
+ import { afterAll, beforeAll, describe, expect, test } from "bun:test";
2
+ import { mkdtempSync, readFileSync, rmSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join, resolve } from "node:path";
5
+
6
+ const repoRoot = resolve(import.meta.dir, "../../../../");
7
+ const beginImmediate = /\b(?:[A-Za-z_$][\w$]*\.)?exec\("BEGIN IMMEDIATE"\)/g;
8
+
9
+ const fencedSources: Array<{ path: string; sites: string[] }> = [
10
+ {
11
+ path: "packages/plugin/src/features/magic-context/smart-notes/storage.ts",
12
+ sites: ["smart_note_commit"],
13
+ },
14
+ {
15
+ path: "packages/plugin/src/hooks/magic-context/inject-compartments.ts",
16
+ sites: ["opencode_materialize_cache", "opencode_soft_refresh_cache"],
17
+ },
18
+ {
19
+ path: "packages/plugin/src/features/magic-context/message-index.ts",
20
+ sites: [
21
+ "message_index_incremental",
22
+ "message_index_reconcile",
23
+ "message_index_orphan_sweep",
24
+ ],
25
+ },
26
+ {
27
+ path: "packages/plugin/src/features/magic-context/storage-meta-persisted.ts",
28
+ sites: [
29
+ "storage_meta_wrapup_expiry_cleanup",
30
+ "storage_meta_wrapup_acquire",
31
+ "storage_meta_wrapup_update",
32
+ "storage_meta_wrapup_release",
33
+ ],
34
+ },
35
+ {
36
+ path: "packages/plugin/src/features/magic-context/context-authority.ts",
37
+ sites: ["authority_marker_capture", "authority_capture_check"],
38
+ },
39
+ {
40
+ path: "packages/plugin/src/features/magic-context/compartment-storage.ts",
41
+ sites: ["compartment_state_replace", "recomp_staging_promote"],
42
+ },
43
+ {
44
+ path: "packages/plugin/src/features/magic-context/project-embedding-registry.ts",
45
+ sites: ["embedding_identity_record", "embedding_stale_gc"],
46
+ },
47
+ {
48
+ path: "packages/plugin/src/features/magic-context/workspaces.ts",
49
+ sites: ["workspace_epoch_bump", "workspace_epoch_bump"],
50
+ },
51
+ {
52
+ // The chokepoint cannot import the logging chain (Node executes it
53
+ // directly), so it reports through the injected reporter instead.
54
+ path: "packages/plugin/src/shared/sqlite.ts",
55
+ sites: ["privileged_writer"],
56
+ reporterCall: "reportSlowPrivilegedWrite?.(",
57
+ },
58
+ {
59
+ path: "packages/plugin/src/features/magic-context/git-commits/sweep-coordinator.ts",
60
+ sites: ["git_sweep_lease"],
61
+ },
62
+ {
63
+ path: "packages/plugin/src/features/magic-context/session-project-backfill.ts",
64
+ sites: ["session_project_backfill"],
65
+ },
66
+ {
67
+ path: "packages/plugin/src/tools/ctx-memory/verification-recording.ts",
68
+ sites: ["ctx_memory_mutation"],
69
+ },
70
+ {
71
+ path: "packages/plugin/src/features/magic-context/storage-clone.ts",
72
+ sites: ["storage_clone_copy"],
73
+ },
74
+ {
75
+ path: "packages/plugin/src/hooks/magic-context/compartment-runner-recomp.ts",
76
+ sites: ["historian-publish:recomp"],
77
+ },
78
+ {
79
+ path: "packages/plugin/src/hooks/magic-context/compartment-runner-incremental.ts",
80
+ sites: ["historian-publish"],
81
+ },
82
+ {
83
+ path: "packages/plugin/src/features/magic-context/dreamer/lease.ts",
84
+ sites: ["lease_dynamic_site"],
85
+ },
86
+ {
87
+ path: "packages/pi-plugin/src/inject-compartments-pi.ts",
88
+ sites: ["pi_materialize_cache", "pi_soft_refresh_cache"],
89
+ },
90
+ {
91
+ path: "packages/pi-plugin/src/pi-historian-runner.ts",
92
+ sites: ["pi_historian_publish"],
93
+ },
94
+ {
95
+ path: "packages/pi-plugin/src/context-handler.ts",
96
+ sites: ["pi_compaction_queue"],
97
+ },
98
+ ];
99
+
100
+ const nonBeginCoveredSites: Array<{ path: string; site: string }> = [
101
+ {
102
+ path: "packages/plugin/src/features/magic-context/message-index.ts",
103
+ site: "message_index_clear",
104
+ },
105
+ {
106
+ path: "packages/plugin/src/features/magic-context/message-fts-rowid-map.ts",
107
+ site: "message_fts_rowid_backfill",
108
+ },
109
+ {
110
+ path: "packages/plugin/src/hooks/magic-context/note-nudger.ts",
111
+ site: "note_nudge_trigger",
112
+ },
113
+ {
114
+ path: "packages/plugin/src/features/magic-context/user-memory/storage-user-memory.ts",
115
+ site: "user_memory_candidate_insert",
116
+ },
117
+ ];
118
+
119
+ let scenarioRoot: string | null = null;
120
+ let scenarioLogPath: string | null = null;
121
+
122
+ const newlyCoveredSites = [
123
+ "opencode_materialize_cache",
124
+ "opencode_soft_refresh_cache",
125
+ "message_index_incremental",
126
+ "message_index_reconcile",
127
+ "message_index_orphan_sweep",
128
+ "message_index_clear",
129
+ "message_fts_rowid_backfill",
130
+ "storage_meta_wrapup_expiry_cleanup",
131
+ "storage_meta_wrapup_acquire",
132
+ "storage_meta_wrapup_update",
133
+ "storage_meta_wrapup_release",
134
+ "authority_marker_capture",
135
+ "authority_capture_check",
136
+ "compartment_state_replace",
137
+ "recomp_staging_promote",
138
+ "embedding_identity_record",
139
+ "embedding_stale_gc",
140
+ "workspace_epoch_bump",
141
+ "privileged_writer",
142
+ "git_sweep_lease",
143
+ "session_project_backfill",
144
+ "ctx_memory_mutation",
145
+ "storage_clone_copy",
146
+ "smart_note_commit",
147
+ "pi_materialize_cache",
148
+ "pi_soft_refresh_cache",
149
+ "pi_historian_publish",
150
+ "pi_compaction_queue",
151
+ "note_nudge_trigger",
152
+ "user_memory_candidate_insert",
153
+ ] as const;
154
+
155
+ function sourceFor(relativePath: string): string {
156
+ return readFileSync(resolve(repoRoot, relativePath), "utf8");
157
+ }
158
+
159
+ function assertCoveredBeginImmediate(
160
+ source: string,
161
+ sites: string[],
162
+ reporterCall = "logSlowWriteTransaction(",
163
+ ): void {
164
+ const matches = [...source.matchAll(beginImmediate)];
165
+ expect(matches).toHaveLength(sites.length);
166
+ for (let index = 0; index < matches.length; index += 1) {
167
+ const match = matches[index];
168
+ const nextBegin = matches[index + 1]?.index ?? source.length;
169
+ const transactionRegion = source.slice(match.index, nextBegin);
170
+ expect(transactionRegion).toContain(reporterCall);
171
+ if (sites[index] === "lease_dynamic_site") {
172
+ expect(transactionRegion).toContain("logSlowWriteTransaction(site");
173
+ } else {
174
+ expect(transactionRegion).toContain(`"${sites[index]}"`);
175
+ }
176
+ }
177
+ }
178
+
179
+ describe("write transaction attribution fences", () => {
180
+ beforeAll(async () => {
181
+ scenarioRoot = mkdtempSync(join(tmpdir(), "magic-context-write-attribution-"));
182
+ scenarioLogPath = join(scenarioRoot, "transactions.log");
183
+ const scenario = `
184
+ const timing = await import(${JSON.stringify(new URL("./write-transaction-timing.ts", import.meta.url).href)});
185
+ const logger = await import(${JSON.stringify(new URL("./logger.ts", import.meta.url).href)});
186
+ for (const site of ${JSON.stringify(newlyCoveredSites)}) {
187
+ timing.logSlowWriteTransaction(site, 1_000, 1_000, 2_100);
188
+ timing.logSlowWriteTransaction(site, 2_000, 1_000, 2_100);
189
+ }
190
+ logger.flushLogger();
191
+ `;
192
+ const child = Bun.spawn({
193
+ cmd: ["bun", "--eval", scenario],
194
+ cwd: import.meta.dir,
195
+ env: {
196
+ ...process.env,
197
+ NODE_ENV: "production",
198
+ MAGIC_CONTEXT_LOG_PATH: scenarioLogPath,
199
+ },
200
+ stdout: "pipe",
201
+ stderr: "pipe",
202
+ });
203
+ const [exitCode, stderr] = await Promise.all([
204
+ child.exited,
205
+ new Response(child.stderr).text(),
206
+ ]);
207
+ expect(exitCode, stderr).toBe(0);
208
+ });
209
+
210
+ afterAll(() => {
211
+ if (scenarioRoot) rmSync(scenarioRoot, { recursive: true, force: true });
212
+ scenarioRoot = null;
213
+ scenarioLogPath = null;
214
+ });
215
+
216
+ test("lists every BEGIN IMMEDIATE writer and requires a covered site", () => {
217
+ for (const fencedSource of fencedSources) {
218
+ assertCoveredBeginImmediate(
219
+ sourceFor(fencedSource.path),
220
+ fencedSource.sites,
221
+ "reporterCall" in fencedSource ? fencedSource.reporterCall : undefined,
222
+ );
223
+ }
224
+ for (const coveredSite of nonBeginCoveredSites) {
225
+ expect(sourceFor(coveredSite.path)).toContain(
226
+ `logSlowWriteTransaction("${coveredSite.site}"`,
227
+ );
228
+ }
229
+ });
230
+
231
+ for (const site of newlyCoveredSites) {
232
+ test(`logs a slow and suppresses a sub-threshold transaction at site=${site}`, () => {
233
+ if (!scenarioLogPath) throw new Error("timing scenario did not start");
234
+ const lines = readFileSync(scenarioLogPath, "utf8")
235
+ .split("\n")
236
+ .filter((line) => line.includes(`site=${site}`));
237
+ expect(lines).toHaveLength(1);
238
+ expect(lines[0]).toContain("held=1100.0ms");
239
+ });
240
+ }
241
+ });
@@ -14,9 +14,10 @@ export function logSlowWriteTransaction(
14
14
  site: string,
15
15
  startedAt: number,
16
16
  thresholdMs = SLOW_WRITE_TRANSACTION_THRESHOLD_MS,
17
+ completedAtMs = performance.now(),
17
18
  ): void {
18
19
  try {
19
- const durationMs = performance.now() - startedAt;
20
+ const durationMs = completedAtMs - startedAt;
20
21
  if (durationMs < thresholdMs) return;
21
22
  log(`[magic-context] slow write transaction: site=${site} held=${durationMs.toFixed(1)}ms`);
22
23
  } catch {
package/src/tui/index.tsx CHANGED
@@ -1,7 +1,9 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
2
  // @ts-nocheck
3
- import { createMemo } from "solid-js"
3
+ import { createMemo, createSignal } from "solid-js"
4
4
  import type { TuiPlugin, TuiPluginApi, TuiThemeCurrent } from "@opencode-ai/plugin/tui"
5
+ import { renderUserStatusSummary, statusSummaryFromDetail } from "../shared/status-summary"
6
+ import { renderUserFacingFailure, userFacingFailureCode } from '../shared/user-facing-codes';
5
7
  import {
6
8
  createSidebarContentSlot,
7
9
  kickRecompProgressRefresh,
@@ -138,10 +140,13 @@ const R = (props: { t: TuiThemeCurrent; l: string; v: string; fg?: string }) =>
138
140
  </box>
139
141
  )
140
142
 
141
- const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
143
+ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail; diagnostics?: boolean }) => {
142
144
  const theme = createMemo(() => (props.api as any).theme.current)
145
+ const [diagnostics, setDiagnostics] = createSignal(props.diagnostics === true)
143
146
  const t = () => theme()
144
147
  const s = () => props.s
148
+ const summaryLines = () =>
149
+ renderUserStatusSummary(statusSummaryFromDetail(s()), "plain").split("\n").slice(1)
145
150
  const compactionOff = () => s().compaction_enabled === false
146
151
 
147
152
  // Prefer the RPC-provided model context limit (what the sidebar shows) so the
@@ -206,7 +211,7 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
206
211
  segs.push({ label: "User Profile", tokens: d.profileTokens, color: COLORS.profile })
207
212
 
208
213
  if (d.conversationTokens > 0)
209
- segs.push({ label: "Conversation*", tokens: d.conversationTokens, color: COLORS.conversation })
214
+ segs.push({ label: "Conversation", tokens: d.conversationTokens, color: COLORS.conversation })
210
215
  if (d.toolCallTokens > 0)
211
216
  segs.push({ label: "Tool Calls", tokens: d.toolCallTokens, color: COLORS.toolCalls })
212
217
  if (d.toolDefinitionTokens > 0)
@@ -230,6 +235,21 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
230
235
  <text fg={t().textMuted}>v{packageJson.version}</text>
231
236
  </box>
232
237
 
238
+ <box
239
+ width="100%"
240
+ justifyContent="flex-end"
241
+ onMouseDown={() => setDiagnostics(!diagnostics())}
242
+ >
243
+ <text fg={diagnostics() ? t().accent : t().textMuted}>
244
+ {diagnostics() ? "[x]" : "[ ]"} Diagnostics
245
+ </text>
246
+ </box>
247
+
248
+ {!diagnostics() ? (
249
+ <box flexDirection="column" width="100%">
250
+ {summaryLines().map((line) => <text>{line}</text>)}
251
+ </box>
252
+ ) : (<>
233
253
  {s().configParseFailures.map((failure) => (
234
254
  <text fg={t().error}>{formatConfigParseStatusLine(failure)}</text>
235
255
  ))}
@@ -279,7 +299,7 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
279
299
  </box>
280
300
  )
281
301
  })}
282
- <text fg={t().textMuted}>* Conversation includes Reasoning; hygiene excludes it</text>
302
+ <text fg={t().textMuted}>Conversation includes reasoning; hygiene excludes it</text>
283
303
  {s().tailHygiene !== undefined && (
284
304
  <R
285
305
  t={t()}
@@ -438,7 +458,7 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
438
458
  {/* Error (full width, conditional) */}
439
459
  {s().lastTransformError && (
440
460
  <box marginTop={1} width="100%">
441
- <text fg={t().error}>⚠ {s().lastTransformError}</text>
461
+ <text fg={t().error}>{renderUserFacingFailure("transform_update_failed")}</text>
442
462
  </box>
443
463
  )}
444
464
 
@@ -451,12 +471,13 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
451
471
  fg={(s().loggerDiagnostics?.swallowedWriteCount ?? 0) > 0 ? t().error : t().textMuted}
452
472
  />
453
473
  {s().loggerDiagnostics?.lastErrorMessage && (
454
- <R t={t()} l="Last error" v={s().loggerDiagnostics.lastErrorMessage} fg={t().error} />
474
+ <R t={t()} l="Warning" v={renderUserFacingFailure("status_unavailable")} fg={t().error} />
455
475
  )}
456
476
  {s().loggerDiagnostics?.lastErrorTime && (
457
477
  <R t={t()} l="Last error time" v={s().loggerDiagnostics.lastErrorTime} fg={t().textMuted} />
458
478
  )}
459
479
  </box>
480
+ </>)}
460
481
 
461
482
  {/* Footer */}
462
483
  <box marginTop={1} justifyContent="flex-end" width="100%">
@@ -515,7 +536,7 @@ async function showRecompDialog(api: TuiPluginApi, targetSessionId = getSessionI
515
536
  ? "This session has no compartments yet — recomp will build them from raw history."
516
537
  : `You have ${count} compartments.`,
517
538
  "",
518
- "Recomp will regenerate all compartments and facts from raw history.",
539
+ "Recomp will rebuild the compressed history from raw history. Saved memories are not changed.",
519
540
  "This may take a long time and consume significant tokens.",
520
541
  "",
521
542
  "Proceed?",
@@ -617,7 +638,11 @@ function showUpgradeDialog(
617
638
  return true
618
639
  }
619
640
 
620
- async function showStatusDialog(api: TuiPluginApi, targetSessionId = getSessionId(api)): Promise<boolean> {
641
+ async function showStatusDialog(
642
+ api: TuiPluginApi,
643
+ targetSessionId = getSessionId(api),
644
+ initialDiagnostics = false,
645
+ ): Promise<boolean> {
621
646
  const sessionId = targetSessionId
622
647
  if (!sessionId) {
623
648
  showToast(api, { message: "No active session", variant: "warning" })
@@ -629,14 +654,19 @@ async function showStatusDialog(api: TuiPluginApi, targetSessionId = getSessionI
629
654
  const result = await loadStatusDetail(sessionId, directory, modelKey)
630
655
  if (getSessionId(api) !== sessionId) return false
631
656
  if (!result.ok) {
657
+ console.error(
658
+ `[magic-context] status unavailable code=${userFacingFailureCode("status_unavailable")}: ${result.error}`,
659
+ )
632
660
  showToast(api, {
633
- message: `Status unavailable: ${result.error}`,
661
+ message: renderUserFacingFailure("status_unavailable"),
634
662
  variant: "warning",
635
663
  })
636
664
  return false
637
665
  }
638
666
 
639
- api.ui.dialog.replace(() => <StatusDialog api={api} s={result.detail} />)
667
+ api.ui.dialog.replace(() => (
668
+ <StatusDialog api={api} s={result.detail} diagnostics={initialDiagnostics} />
669
+ ))
640
670
  return true
641
671
  }
642
672
 
@@ -1125,7 +1155,10 @@ const tui: TuiPlugin = async (api, _options, meta) => {
1125
1155
  const stillActive = () =>
1126
1156
  getRpcGeneration() === generation && getSessionId(api) === requestedSessionId
1127
1157
  if (action === "show-status-dialog") {
1128
- return stillActive() && (await showStatusDialog(api, requestedSessionId))
1158
+ return (
1159
+ stillActive() &&
1160
+ (await showStatusDialog(api, requestedSessionId, n.payload?.diagnostics === true))
1161
+ )
1129
1162
  }
1130
1163
  if (action === "show-recomp-dialog") {
1131
1164
  return stillActive() && (await showRecompDialog(api, requestedSessionId))
@@ -5,7 +5,6 @@ import packageJson from "../../../package.json"
5
5
  import { badgeTextColor } from '../badge-contrast';
6
6
  import { loadSidebarSnapshot, type SidebarSnapshot } from "../data/context-db"
7
7
  import { formatThresholdPercent } from "../../shared/format-threshold"
8
- import { formatTailHygiene } from "../../shared/tail-hygiene-status"
9
8
  import { compactionOffSidebarRows, nativeCompactionContextLabel } from "../compaction-off"
10
9
  import {
11
10
  computeEffectiveOrder,
@@ -106,6 +105,16 @@ function compactTokens(value: number): string {
106
105
  return String(value)
107
106
  }
108
107
 
108
+ /**
109
+ * Sidebar form of the tail-hygiene reading: the reclaimable share and the
110
+ * two masses it is computed from, in the same compact token unit as the
111
+ * breakdown rows so the value fits beside its label at sidebar width. The
112
+ * long, unit-spelled form stays in the status dialog.
113
+ */
114
+ function hygieneValue(status: { severity: number; u: number; t: number }): string {
115
+ return `${(status.severity * 100).toFixed(1)}% · ${compactTokens(status.u)}/${compactTokens(status.t)}`
116
+ }
117
+
109
118
  function relativeTime(ms: number): string {
110
119
  const diff = Date.now() - ms
111
120
  if (diff < 60_000) return "just now"
@@ -240,7 +249,7 @@ const TokenBreakdown = (props: {
240
249
  key: "conv",
241
250
  tokens: s.conversationTokens,
242
251
  color: COLORS.conversation,
243
- label: "Conversation*",
252
+ label: "Conversation",
244
253
  })
245
254
 
246
255
  // Tool Calls = tool_use/tool_result/tool/tool-invocation parts in messages
@@ -321,7 +330,6 @@ const TokenBreakdown = (props: {
321
330
  </box>
322
331
  )
323
332
  })}
324
- <text fg={props.theme.textMuted}>* includes Reasoning; hygiene excludes it</text>
325
333
  </box>
326
334
  )}
327
335
  </box>
@@ -798,14 +806,11 @@ const SidebarContent = (props: {
798
806
  </box>
799
807
  )}
800
808
  <TokenBreakdown theme={props.theme} snapshot={s()!} collapsed={collapsed()} />
801
- {!collapsed() && (
802
- <text fg={props.theme.textMuted}>Conversation includes reasoning estimates; hygiene excludes reasoning.</text>
803
- )}
804
809
  {s()!.tailHygiene !== undefined && (
805
810
  <StatRow
806
811
  theme={props.theme}
807
812
  label="Hygiene"
808
- value={formatTailHygiene(s()!.tailHygiene!)}
813
+ value={hygieneValue(s()!.tailHygiene!)}
809
814
  warning={!s()!.tailHygiene!.evaluable}
810
815
  />
811
816
  )}