@wrongstack/core 0.313.1 → 0.316.2

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 (290) hide show
  1. package/dist/chronicle/index.js +31 -31
  2. package/dist/chronicle/legacy-journal-import.d.ts +0 -6
  3. package/dist/chronicle/metrics-ingest.d.ts +14 -0
  4. package/dist/chronicle/metrics-schema.d.ts +10 -1
  5. package/dist/chronicle/metrics-store.d.ts +20 -2
  6. package/dist/chronicle/project-server.js +39 -31
  7. package/dist/chronicle/sink.d.ts +13 -0
  8. package/dist/chronicle/sqlite-journal.d.ts +20 -2
  9. package/dist/{chunk-WOEZV3Q4.js → chunk-25LSLC3G.js} +2 -1
  10. package/dist/{chunk-AI4LLQ2U.js → chunk-27QIURLN.js} +229 -12
  11. package/dist/{chunk-I45KAW2N.js → chunk-3AGWVSS7.js} +38 -450
  12. package/dist/chunk-3BDV7RL3.js +211 -0
  13. package/dist/{chunk-NFAYHPRH.js → chunk-3ECENVHL.js} +10 -8
  14. package/dist/{chunk-FW5LDDMJ.js → chunk-45WI72ZB.js} +1576 -1156
  15. package/dist/{chunk-AT4V4XGI.js → chunk-4BMVPOHO.js} +539 -313
  16. package/dist/{chunk-YBUJCZ57.js → chunk-4I7HGVVA.js} +17 -5
  17. package/dist/{chunk-JVGPR3TS.js → chunk-4LCZVJVF.js} +7 -55
  18. package/dist/{chunk-4ZHTKJHM.js → chunk-4SJNS7OB.js} +36 -2
  19. package/dist/{chunk-AD7ZFZCS.js → chunk-5BMIE7QG.js} +3 -3
  20. package/dist/{chunk-IQ35HMQL.js → chunk-5YPSXQXM.js} +71 -24
  21. package/dist/chunk-6FHWXLPT.js +10 -0
  22. package/dist/{chunk-FIV4IJL7.js → chunk-6H5GEOET.js} +163 -20
  23. package/dist/{chunk-VB3H5WWB.js → chunk-6NWEVFEL.js} +2 -2
  24. package/dist/{chunk-E6I5RXVK.js → chunk-AYW5YINX.js} +2 -2
  25. package/dist/{chunk-DEIQMBD2.js → chunk-B7F4WVP4.js} +2 -2
  26. package/dist/{chunk-XQ2XGIBF.js → chunk-BPBKKBUK.js} +6 -7
  27. package/dist/{chunk-K4YUNKU7.js → chunk-BYD345OX.js} +2 -2
  28. package/dist/{chunk-LZDDLNCZ.js → chunk-C27KDLOX.js} +4 -4
  29. package/dist/{chunk-6AKOTGLM.js → chunk-CU546ESW.js} +7 -7
  30. package/dist/{chunk-ZZ4V3WIZ.js → chunk-DLHHXUAM.js} +10 -1
  31. package/dist/{chunk-BAKVJLEV.js → chunk-DOTHQSJ2.js} +28 -16
  32. package/dist/{chunk-KBZGE6LN.js → chunk-DYLPMV4Q.js} +4 -3
  33. package/dist/{chunk-52RTVH4M.js → chunk-F3JWNST7.js} +2 -2
  34. package/dist/{chunk-WEBMSQP2.js → chunk-FC2ZGRF3.js} +21 -4
  35. package/dist/{chunk-FHAMQS7Q.js → chunk-FCBTO76Z.js} +76 -146
  36. package/dist/{chunk-4LJJYBAU.js → chunk-FHZVFYSL.js} +9 -1
  37. package/dist/{chunk-W4A6QA3D.js → chunk-FWNLEZYG.js} +4 -3
  38. package/dist/{chunk-OJZEX73F.js → chunk-GDQ7CZRQ.js} +5 -1
  39. package/dist/{chunk-QVOVMXJR.js → chunk-GJJGJB2R.js} +32 -9
  40. package/dist/{chunk-4XV6IR37.js → chunk-HI3JGZR2.js} +7 -6
  41. package/dist/{chunk-FSWCWSTS.js → chunk-HMLIGAU7.js} +26 -26
  42. package/dist/{chunk-PFXFQQRT.js → chunk-HXKZ7OBQ.js} +7 -43
  43. package/dist/{chunk-2FQL4PDC.js → chunk-I7DALG7J.js} +5 -5
  44. package/dist/{chunk-GM54GJBU.js → chunk-IRUTEHCE.js} +3 -3
  45. package/dist/{chunk-TYW2GI5I.js → chunk-J2WRWR37.js} +40 -13
  46. package/dist/{chunk-ZEHUCJHY.js → chunk-JFPJ6LLQ.js} +2 -2
  47. package/dist/chunk-JMULFFLN.js +9 -0
  48. package/dist/{chunk-RD6DEE36.js → chunk-JO4MGB6Z.js} +94 -8
  49. package/dist/{chunk-5DSMEVA4.js → chunk-K6BXGITA.js} +7 -7
  50. package/dist/{chunk-O74MJHXU.js → chunk-KZMSZV32.js} +2 -2
  51. package/dist/{chunk-GFJOMSHG.js → chunk-LA7CLDRW.js} +6 -2
  52. package/dist/{chunk-M2WF6AXG.js → chunk-LSMMOS2Z.js} +7 -3
  53. package/dist/{chunk-ASX6AW36.js → chunk-LXWCMQNJ.js} +3 -3
  54. package/dist/{chunk-WZO23AWO.js → chunk-M27LIEKV.js} +72 -22
  55. package/dist/{chunk-JTHKOYWU.js → chunk-MJPHJRAL.js} +15 -15
  56. package/dist/{chunk-G5AAKEEZ.js → chunk-MTL4O5YR.js} +5 -5
  57. package/dist/chunk-NHJ75HXY.js +1 -0
  58. package/dist/{chunk-ZYU2YOJ6.js → chunk-NIOAGFPB.js} +29 -15
  59. package/dist/{chunk-Y2GE5TSI.js → chunk-NS52ISWS.js} +2 -2
  60. package/dist/{chunk-UIWONWVG.js → chunk-NSOFPKGT.js} +541 -148
  61. package/dist/{chunk-RCQYT2I4.js → chunk-NVIZG63R.js} +2 -2
  62. package/dist/{chunk-EPC3GZD4.js → chunk-OOYZPOXM.js} +2 -2
  63. package/dist/{chunk-7ZHZE5EO.js → chunk-OSGLYW5J.js} +2 -2
  64. package/dist/{chunk-CE4ZOCOI.js → chunk-PFCMSSUF.js} +9 -9
  65. package/dist/{chunk-GFXZTHNI.js → chunk-PGRVXIMY.js} +5 -5
  66. package/dist/{chunk-JJPMWPB6.js → chunk-PISBFBJN.js} +6 -6
  67. package/dist/chunk-POOOIWE5.js +9 -0
  68. package/dist/{chunk-5RP3QTRL.js → chunk-PQNS3U7Z.js} +20 -3
  69. package/dist/{chunk-3E244UDA.js → chunk-QSTSJOCK.js} +52 -6
  70. package/dist/{chunk-YUPMXOGP.js → chunk-RFQMOKWK.js} +3 -3
  71. package/dist/chunk-RTOTNK3P.js +484 -0
  72. package/dist/{chunk-SN2DQRL6.js → chunk-RXKSDUAU.js} +7 -7
  73. package/dist/{chunk-T3KGZBU5.js → chunk-S45JPKQN.js} +189 -43
  74. package/dist/{chunk-YNCVSFGF.js → chunk-SAFHACFA.js} +4 -1
  75. package/dist/{chunk-KI4L2DUL.js → chunk-TCCHINEF.js} +114 -19
  76. package/dist/{chunk-AWNQ6ED6.js → chunk-THEGTRAG.js} +7 -2
  77. package/dist/{chunk-2KKODIQU.js → chunk-TR4LQE7L.js} +15 -15
  78. package/dist/{chunk-GPQ3NJPR.js → chunk-TWJMGXCI.js} +3 -3
  79. package/dist/{chunk-H72H4XDU.js → chunk-U45AXT5D.js} +9 -9
  80. package/dist/{chunk-62V2AFVG.js → chunk-U4FWBSO3.js} +160 -73
  81. package/dist/{chunk-A455ATZB.js → chunk-UBGDX6FI.js} +8 -1
  82. package/dist/chunk-UJILKYES.js +75 -0
  83. package/dist/{chunk-KSJ5UTP7.js → chunk-ULMAQV3T.js} +84 -4
  84. package/dist/{chunk-CB2HFKTP.js → chunk-VVBP6KGT.js} +1 -1
  85. package/dist/{chunk-RPOA7IAE.js → chunk-W5VITDM2.js} +43 -25
  86. package/dist/{chunk-QRTG4XTI.js → chunk-WAHQVNWT.js} +7 -1
  87. package/dist/{chunk-SQP64RCS.js → chunk-WGGYRBXH.js} +3019 -2976
  88. package/dist/{chunk-K3G6JBUC.js → chunk-WLYKU45P.js} +679 -141
  89. package/dist/chunk-WP7BVANJ.js +53 -0
  90. package/dist/{chunk-GAZEWQEZ.js → chunk-XF4VUMKW.js} +2 -2
  91. package/dist/{chunk-PAAWLLZX.js → chunk-Y5YXDM7D.js} +2 -2
  92. package/dist/{chunk-65RDIOR2.js → chunk-YOPAUVU4.js} +162 -44
  93. package/dist/{chunk-FFSX2QDQ.js → chunk-YPT4A46F.js} +3 -3
  94. package/dist/chunk-YWXT3JNM.js +425 -0
  95. package/dist/{chunk-EFEHDQGY.js → chunk-ZHZ2Y2DH.js} +64 -10
  96. package/dist/{chunk-CQQL4ZOQ.js → chunk-ZT7JNIGX.js} +4 -3
  97. package/dist/coordination/agent-monitor.d.ts +9 -1
  98. package/dist/coordination/agent-subagent-runner.d.ts +1 -1
  99. package/dist/coordination/agents/agent-prompts.d.ts +8 -0
  100. package/dist/coordination/agents/index.d.ts +33 -1
  101. package/dist/coordination/agents/index.js +52 -22
  102. package/dist/coordination/agents/phase3-wave1-platform.d.ts +1 -3
  103. package/dist/coordination/agents/phase3-wave2-meta.d.ts +1 -3
  104. package/dist/coordination/agents/phase8-wave3-products.d.ts +1 -3
  105. package/dist/coordination/agents/phase9-wave4-platform-meta.d.ts +1 -3
  106. package/dist/coordination/agents/project-agent-identity.d.ts +11 -11
  107. package/dist/coordination/agents/types.d.ts +13 -2
  108. package/dist/coordination/brain-monitor.d.ts +30 -7
  109. package/dist/coordination/collab-debug.d.ts +1 -1
  110. package/dist/coordination/collab-pause.d.ts +1 -1
  111. package/dist/coordination/delegate-tool.d.ts +7 -5
  112. package/dist/coordination/director-kanban-queue-helpers.d.ts +1 -0
  113. package/dist/coordination/director-options.d.ts +7 -0
  114. package/dist/coordination/director-spawn-model.d.ts +17 -0
  115. package/dist/coordination/director-tools.d.ts +2 -2
  116. package/dist/coordination/director.d.ts +12 -0
  117. package/dist/coordination/dispatcher.d.ts +8 -0
  118. package/dist/coordination/fleet-bus.d.ts +35 -4
  119. package/dist/coordination/fleet-supervisor.d.ts +10 -2
  120. package/dist/coordination/fleet.d.ts +16 -7
  121. package/dist/coordination/index.d.ts +4 -0
  122. package/dist/coordination/index.js +86 -49
  123. package/dist/coordination/kanban-dispatch-port.d.ts +2 -2
  124. package/dist/coordination/mailbox-http-router.d.ts +4 -3
  125. package/dist/coordination/mailbox-http-validation.d.ts +1 -1
  126. package/dist/coordination/mailbox-project-server.js +15 -15
  127. package/dist/coordination/mailbox-types.d.ts +24 -6
  128. package/dist/coordination/model-tier-leader.d.ts +122 -0
  129. package/dist/coordination/model-tier.d.ts +122 -0
  130. package/dist/coordination/multi-agent-coordinator.d.ts +24 -0
  131. package/dist/coordination/origin-session.d.ts +16 -0
  132. package/dist/coordination/provider-status-tracker.d.ts +37 -5
  133. package/dist/coordination/session-note-hub.d.ts +44 -0
  134. package/dist/coordination/session-note-tool.d.ts +10 -0
  135. package/dist/core/agent.d.ts +1 -1
  136. package/dist/core/context.d.ts +22 -3
  137. package/dist/core/index.d.ts +2 -0
  138. package/dist/core/index.js +130 -38
  139. package/dist/core/request-conversation-binding.d.ts +37 -0
  140. package/dist/core/session-notes.d.ts +25 -0
  141. package/dist/core/system-prompt-builder.d.ts +11 -2
  142. package/dist/core/system-prompt-variants.d.ts +78 -0
  143. package/dist/design/index.js +3 -3
  144. package/dist/execution/auto-compaction-middleware.d.ts +11 -0
  145. package/dist/execution/autonomy-brain.d.ts +2 -1
  146. package/dist/execution/autonomy-prompt-contributor.d.ts +7 -2
  147. package/dist/execution/compaction-core.d.ts +4 -4
  148. package/dist/execution/eternal-autonomy.d.ts +1 -1
  149. package/dist/execution/index.js +138 -129
  150. package/dist/execution/model-runtime.d.ts +0 -7
  151. package/dist/execution/parallel-eternal-engine.d.ts +7 -7
  152. package/dist/extension/index.js +3 -3
  153. package/dist/goal/index.js +6 -6
  154. package/dist/hooks/index.js +3 -3
  155. package/dist/hq/index.js +14 -12
  156. package/dist/hq/persistence/event-log.d.ts +0 -1
  157. package/dist/hq/persistence.d.ts +4 -4
  158. package/dist/hq/publisher.d.ts +2 -0
  159. package/dist/index.d.ts +14 -11
  160. package/dist/index.js +728 -635
  161. package/dist/infrastructure/index.d.ts +4 -4
  162. package/dist/infrastructure/index.js +281 -260
  163. package/dist/infrastructure/token-counter.d.ts +9 -0
  164. package/dist/kernel/events/agent-events.d.ts +77 -3
  165. package/dist/kernel/events/brain-events.d.ts +12 -0
  166. package/dist/kernel/events/provider-events.d.ts +7 -1
  167. package/dist/kernel/events/session-events.d.ts +14 -0
  168. package/dist/kernel/events/tool-events.d.ts +13 -0
  169. package/dist/kernel/index.js +4 -4
  170. package/dist/mailbox-attach.d.ts +1 -1
  171. package/dist/models/index.js +10 -9
  172. package/dist/observability/event-bridge.d.ts +25 -5
  173. package/dist/observability/index.d.ts +9 -8
  174. package/dist/observability/index.js +459 -351
  175. package/dist/observability/tool-usage-source.d.ts +65 -0
  176. package/dist/plugin/index.d.ts +5 -0
  177. package/dist/plugin/index.js +66 -50
  178. package/dist/plugins/auto-review-plugin.d.ts +3 -2
  179. package/dist/plugins/review-finding-commands.d.ts +0 -8
  180. package/dist/{review-finding-store-DKAV3AS6.js → plugins/review-finding-store.js} +7 -6
  181. package/dist/plugins/review-finding-types.js +19 -0
  182. package/dist/plugins/review-report-integration.js +21 -0
  183. package/dist/{review-report-store-OWY3EC3N.js → plugins/review-report-store.js} +7 -6
  184. package/dist/plugins/review-report-types.js +13 -0
  185. package/dist/prompts/index.js +5 -5
  186. package/dist/registry/index.js +3 -3
  187. package/dist/registry/tool-registry.d.ts +59 -9
  188. package/dist/{registry-R23UBE7H.js → registry-7N4O3E7W.js} +5 -5
  189. package/dist/security/capabilities.d.ts +6 -0
  190. package/dist/security/file-permissions.d.ts +1 -1
  191. package/dist/security/index.js +47 -33
  192. package/dist/security/permission-policy.d.ts +12 -1
  193. package/dist/security/secret-scrubber.d.ts +15 -0
  194. package/dist/session-catalog/index.d.ts +1 -0
  195. package/dist/session-catalog/index.js +19 -14
  196. package/dist/session-catalog/project-server.js +30 -13
  197. package/dist/session-catalog/protocol.d.ts +32 -1
  198. package/dist/session-catalog/registry.d.ts +17 -1
  199. package/dist/session-catalog/session-agents.d.ts +56 -0
  200. package/dist/session-catalog/store-rebuild.d.ts +14 -0
  201. package/dist/session-catalog/store-schema.d.ts +26 -0
  202. package/dist/session-catalog/store.d.ts +27 -1
  203. package/dist/session-note-attach.d.ts +9 -0
  204. package/dist/skills/index.js +5 -5
  205. package/dist/statusline/index.d.ts +43 -0
  206. package/dist/statusline/index.js +102 -0
  207. package/dist/storage/board-store-port.d.ts +2 -2
  208. package/dist/storage/config-loader/in-project-policy.d.ts +29 -0
  209. package/dist/storage/config-loader.d.ts +3 -2
  210. package/dist/storage/file-session-writer.d.ts +4 -2
  211. package/dist/storage/goal-coordination.d.ts +6 -1
  212. package/dist/storage/goal-kanban.d.ts +4 -1
  213. package/dist/storage/index.d.ts +12 -4
  214. package/dist/storage/index.js +76 -61
  215. package/dist/storage/input-history-store.d.ts +2 -4
  216. package/dist/storage/memory-curator.d.ts +133 -0
  217. package/dist/storage/session-agent-attribution.d.ts +39 -0
  218. package/dist/storage/session-doctor.d.ts +109 -0
  219. package/dist/storage/session-event-bridge.d.ts +5 -7
  220. package/dist/storage/session-outcome.d.ts +42 -0
  221. package/dist/storage/session-recovery.d.ts +55 -0
  222. package/dist/storage/session-store/load-session-data.d.ts +11 -0
  223. package/dist/storage/session-store/prune-helpers.d.ts +1 -1
  224. package/dist/storage/session-store/resume-session.d.ts +0 -2
  225. package/dist/storage/session-store/types.d.ts +8 -0
  226. package/dist/storage/session-store.d.ts +3 -3
  227. package/dist/storage/session-summary-tracker.d.ts +8 -1
  228. package/dist/storage/session-write-buffer.d.ts +18 -0
  229. package/dist/storage/session-writer-truncate.d.ts +2 -0
  230. package/dist/tasking/index.js +2 -2
  231. package/dist/tools/fallback-manage-tools.d.ts +6 -4
  232. package/dist/tools/index.js +21 -21
  233. package/dist/tools/model-tier-set-tool.d.ts +66 -0
  234. package/dist/types/agent-bridge.d.ts +2 -1
  235. package/dist/types/config/mcp-features.d.ts +7 -0
  236. package/dist/types/config/model-tiers.d.ts +148 -0
  237. package/dist/types/config/root.d.ts +9 -0
  238. package/dist/types/config/tools.d.ts +73 -0
  239. package/dist/types/config.d.ts +1 -0
  240. package/dist/types/context.d.ts +2 -0
  241. package/dist/types/default-config.d.ts +6 -0
  242. package/dist/types/errors.d.ts +2 -1
  243. package/dist/types/index.d.ts +11 -9
  244. package/dist/types/index.js +25 -15
  245. package/dist/types/multi-agent.d.ts +43 -0
  246. package/dist/types/plugin.d.ts +1 -1
  247. package/dist/types/provider.d.ts +15 -0
  248. package/dist/types/runtime-capability-manifest.d.ts +1 -1
  249. package/dist/types/secret-scrubber.d.ts +15 -0
  250. package/dist/types/session-markers.d.ts +37 -10
  251. package/dist/types/session-markers.js +1 -1
  252. package/dist/types/session-timeline.d.ts +197 -0
  253. package/dist/types/session-timeline.js +12 -0
  254. package/dist/types/session.d.ts +172 -11
  255. package/dist/types/system-prompt.d.ts +27 -0
  256. package/dist/utils/config-backup.d.ts +9 -1
  257. package/dist/utils/heap-watchdog.js +2 -2
  258. package/dist/utils/index.js +50 -48
  259. package/dist/utils/message-invariants.d.ts +4 -1
  260. package/dist/utils/regex-guard.d.ts +1 -1
  261. package/dist/utils/socket-path.d.ts +1 -1
  262. package/dist/utils/token-estimate.d.ts +6 -2
  263. package/dist/utils/wstack-paths.d.ts +2 -0
  264. package/dist/wiring/proxy-rewrite.d.ts +28 -0
  265. package/dist/wiring/proxy-rewrite.js +7 -1
  266. package/dist/worktree/index.js +2 -2
  267. package/instructions/agents/explore-companion.md +45 -18
  268. package/instructions/agents/memory-curator.md +34 -22
  269. package/instructions/coordination/director-preamble.md +12 -7
  270. package/instructions/coordination/subagent-baseline.md +26 -5
  271. package/instructions/leader-after-task.md +4 -1
  272. package/instructions/llm/chimera-review.md +30 -9
  273. package/instructions/llm/memory-curator.md +31 -0
  274. package/instructions/sections/tool/delegation-compact.md +2 -0
  275. package/instructions/sections/tool/delegation-full.md +5 -1
  276. package/instructions/sections/tool/mailbox-compact.md +5 -1
  277. package/instructions/sections/tool/mailbox-full.md +3 -0
  278. package/instructions/sections/tool/session-note-compact.md +3 -0
  279. package/instructions/sections/tool/session-note-full.md +15 -0
  280. package/instructions/system-lite.md +9 -4
  281. package/instructions/system-pro.md +66 -143
  282. package/instructions/system.md +73 -175
  283. package/package.json +33 -5
  284. package/dist/chunk-2BUUIMQB.js +0 -225
  285. package/dist/chunk-FAYRX2AD.js +0 -13
  286. package/dist/chunk-H5E77KUJ.js +0 -15
  287. package/dist/chunk-M7BS2K6U.js +0 -1
  288. package/dist/coordination/agents.d.ts +0 -8
  289. package/dist/coordination/transport.d.ts +0 -2
  290. package/dist/storage/session-writer/session-writer-summary-tracker.d.ts +0 -28
@@ -1,3 +1,4 @@
1
+ import type { SystemInstructionVariant } from '../core/instruction-bundle.js';
1
2
  import type { MailboxAgentStatus } from '../coordination/mailbox-types.js';
2
3
  import type { TextBlock } from './blocks.js';
3
4
  import type { Tool } from './tool.js';
@@ -32,6 +33,32 @@ export interface BuildContext {
32
33
  * linked Git worktrees in the same canonical project.
33
34
  */
34
35
  onlineAgents?: MailboxAgentStatus[] | undefined;
36
+ /**
37
+ * Identity variant for THIS build — `system.md`, `system-lite.md` or
38
+ * `system-pro.md`.
39
+ *
40
+ * The builder is one process-wide instance and used to take the variant once,
41
+ * at construction, from the boot config. With four conversations on one
42
+ * process that made the identity a property of the process: picking a lighter
43
+ * identity in one tab was either discarded on that tab's next turn (the
44
+ * pre-run prompt refresh rebuilt it from the boot variant) or applied to all
45
+ * of them. Passing it per build makes it a property of the conversation,
46
+ * which is what it always described.
47
+ *
48
+ * Omitted keeps the builder's configured default.
49
+ */
50
+ systemVariant?: SystemInstructionVariant | undefined;
51
+ /**
52
+ * Autonomy mode of THIS conversation.
53
+ *
54
+ * The ETERNAL AUTONOMY block is injected from a process-wide mode ref, which
55
+ * one tab could move for all of them — so switching a background tab to
56
+ * eternal put those instructions into every other conversation's prompt.
57
+ * Passing it per build makes the block follow the conversation that is
58
+ * actually in that mode. Omitted keeps the host's process-wide answer, which
59
+ * is the only one a CLI or TUI has.
60
+ */
61
+ autonomy?: string | undefined;
35
62
  }
36
63
  /**
37
64
  * Stability regions for the system prompt.
@@ -2,7 +2,7 @@
2
2
  * Minimal paths object needed for config backup — just the global root
3
3
  * from which we derive the backup history directory.
4
4
  */
5
- export interface ConfigBackupPaths {
5
+ interface ConfigBackupPaths {
6
6
  globalRoot: string;
7
7
  }
8
8
  /**
@@ -11,10 +11,18 @@ export interface ConfigBackupPaths {
11
11
  * recover from accidental changes. Backups are never cleaned up automatically.
12
12
  */
13
13
  export declare function configHistoryDir(globalRoot: string): string;
14
+ /**
15
+ * Derive a human-readable slug for a config file path relative to the
16
+ * ~/.wrongstack root. Examples:
17
+ * config.json → config
18
+ * profiles/default/config.json → profiles-default-config
19
+ */
20
+ export declare function configSlug(absolutePath: string, globalRoot: string): string;
14
21
  /**
15
22
  * Before overwriting a config file, save its current content to the
16
23
  * config-history directory with a timestamp. Best-effort: failures are
17
24
  * silently ignored so they never block the config write itself.
18
25
  */
19
26
  export declare function backupConfigFile(filePath: string, paths: ConfigBackupPaths): Promise<void>;
27
+ export {};
20
28
  //# sourceMappingURL=config-backup.d.ts.map
@@ -3,8 +3,8 @@ import {
3
3
  startHeapWatchdog,
4
4
  startSharedHeapWatchdog,
5
5
  takeHeapSample
6
- } from "../chunk-KBZGE6LN.js";
7
- import "../chunk-YNCVSFGF.js";
6
+ } from "../chunk-DYLPMV4Q.js";
7
+ import "../chunk-SAFHACFA.js";
8
8
  export {
9
9
  defaultHeapLogPath,
10
10
  startHeapWatchdog,
@@ -49,7 +49,7 @@ import {
49
49
  toStyle,
50
50
  unifiedDiff,
51
51
  watchProjectTree
52
- } from "../chunk-TYW2GI5I.js";
52
+ } from "../chunk-J2WRWR37.js";
53
53
  import {
54
54
  buildWin32CmdShimInvocation
55
55
  } from "../chunk-LHOA5DWA.js";
@@ -58,7 +58,7 @@ import {
58
58
  expandIPv6,
59
59
  isPrivateIPv4,
60
60
  isPrivateIPv6
61
- } from "../chunk-GFJOMSHG.js";
61
+ } from "../chunk-LA7CLDRW.js";
62
62
  import {
63
63
  compileGlob,
64
64
  escapeGlobSubject,
@@ -69,7 +69,7 @@ import {
69
69
  matchGlob,
70
70
  normalizePathSubject,
71
71
  subjectForToolInput
72
- } from "../chunk-QRTG4XTI.js";
72
+ } from "../chunk-WAHQVNWT.js";
73
73
  import {
74
74
  mergeModelsPayload
75
75
  } from "../chunk-EODDVJBM.js";
@@ -77,14 +77,15 @@ import {
77
77
  activateProjectStateGuard,
78
78
  backupConfigFile,
79
79
  configHistoryDir,
80
+ configSlug,
80
81
  startProjectStateGuard
81
- } from "../chunk-CQQL4ZOQ.js";
82
+ } from "../chunk-ZT7JNIGX.js";
82
83
  import {
83
84
  safeParse,
84
85
  safeStringify,
85
86
  sanitizeJsonString,
86
87
  stripCodeFences
87
- } from "../chunk-RPOA7IAE.js";
88
+ } from "../chunk-W5VITDM2.js";
88
89
  import {
89
90
  WIRE_TOOL_NAME_MAX_LENGTH,
90
91
  WIRE_TOOL_NAME_PATTERN,
@@ -103,21 +104,12 @@ import {
103
104
  updateJsonObjectFile,
104
105
  validateAgainstSchema,
105
106
  writeJsonObjectFile
106
- } from "../chunk-FFSX2QDQ.js";
107
+ } from "../chunk-YPT4A46F.js";
107
108
  import {
108
109
  FORBIDDEN_PROTO_KEYS,
109
110
  deepMerge,
110
111
  isPrimitiveArray
111
- } from "../chunk-DEIQMBD2.js";
112
- import {
113
- SageCachePragmas,
114
- getPerfProfile,
115
- indexParallelBatchSize,
116
- isFrugalPerf,
117
- sqliteCachePragmas,
118
- tuiStreamFlushMs,
119
- useDaemonPerfDefaults
120
- } from "../chunk-FNXVT7HF.js";
112
+ } from "../chunk-B7F4WVP4.js";
121
113
  import {
122
114
  DEFAULT_TOOL_DESCRIPTION_MODE,
123
115
  applyToolDescriptionModeToTool,
@@ -128,15 +120,24 @@ import {
128
120
  setToolDescriptionMode,
129
121
  simplifyToolDescription
130
122
  } from "../chunk-WQTOVMGV.js";
123
+ import {
124
+ SageCachePragmas,
125
+ getPerfProfile,
126
+ indexParallelBatchSize,
127
+ isFrugalPerf,
128
+ sqliteCachePragmas,
129
+ tuiStreamFlushMs,
130
+ useDaemonPerfDefaults
131
+ } from "../chunk-FNXVT7HF.js";
131
132
  import {
132
133
  sessionScopedPath
133
- } from "../chunk-AD7ZFZCS.js";
134
+ } from "../chunk-5BMIE7QG.js";
134
135
  import {
135
136
  defaultHeapLogPath,
136
137
  startHeapWatchdog,
137
138
  startSharedHeapWatchdog,
138
139
  takeHeapSample
139
- } from "../chunk-KBZGE6LN.js";
140
+ } from "../chunk-DYLPMV4Q.js";
140
141
  import {
141
142
  readBundledInstructionText,
142
143
  renderInstructionTemplate
@@ -153,33 +154,18 @@ import {
153
154
  hasOpenTodos,
154
155
  sanitizeMemoryEvidenceBody,
155
156
  sanitizeMemoryEvidenceSource
156
- } from "../chunk-WZO23AWO.js";
157
+ } from "../chunk-M27LIEKV.js";
157
158
  import "../chunk-XEBHSJLT.js";
158
159
  import {
159
160
  buildChildEnv,
160
161
  configureChildEnvGitIdentity,
161
162
  getChildEnvGitIdentity,
162
163
  sanitizeNodeOptions
163
- } from "../chunk-VB3H5WWB.js";
164
+ } from "../chunk-6NWEVFEL.js";
164
165
  import {
165
166
  hasMeaningfulContent,
166
167
  repairToolUseAdjacency
167
- } from "../chunk-M2WF6AXG.js";
168
- import {
169
- PROJECT_IDENTITY_RELATIVE_PATH,
170
- PROJECT_IDENTITY_VERSION,
171
- PROJECT_ID_PREFIX,
172
- createProjectId,
173
- ensureProjectGitignore,
174
- ensureProjectIdentity,
175
- isProjectId,
176
- isUlid,
177
- projectIdentityPath,
178
- readProjectIdentity,
179
- readProjectIdentitySync,
180
- rekeyProjectIdentity,
181
- ulid
182
- } from "../chunk-4XV6IR37.js";
168
+ } from "../chunk-LSMMOS2Z.js";
183
169
  import {
184
170
  ESCAPE_TERMINATOR,
185
171
  TerminalLifecycle,
@@ -210,8 +196,22 @@ import {
210
196
  recordUserIntentEvidence,
211
197
  repeatedReadPressure,
212
198
  syncCompletedWorkLedgerBlock
213
- } from "../chunk-EFEHDQGY.js";
214
- import "../chunk-AWNQ6ED6.js";
199
+ } from "../chunk-ZHZ2Y2DH.js";
200
+ import {
201
+ PROJECT_IDENTITY_RELATIVE_PATH,
202
+ PROJECT_IDENTITY_VERSION,
203
+ PROJECT_ID_PREFIX,
204
+ createProjectId,
205
+ ensureProjectGitignore,
206
+ ensureProjectIdentity,
207
+ isProjectId,
208
+ isUlid,
209
+ projectIdentityPath,
210
+ readProjectIdentity,
211
+ readProjectIdentitySync,
212
+ rekeyProjectIdentity,
213
+ ulid
214
+ } from "../chunk-HI3JGZR2.js";
215
215
  import {
216
216
  compactSchemaDescriptions,
217
217
  compactToolDefinitionForWire,
@@ -227,7 +227,7 @@ import {
227
227
  normalizeTopLevelToolSchema,
228
228
  recordActualUsage,
229
229
  resetCalibration
230
- } from "../chunk-FSWCWSTS.js";
230
+ } from "../chunk-HMLIGAU7.js";
231
231
  import {
232
232
  isPidAlive
233
233
  } from "../chunk-TRT2HRWZ.js";
@@ -238,19 +238,20 @@ import {
238
238
  assertUnixSocketPathWithinLimit,
239
239
  checkUnixSocketPath,
240
240
  unixSocketPathLimit
241
- } from "../chunk-FAYRX2AD.js";
241
+ } from "../chunk-POOOIWE5.js";
242
242
  import {
243
243
  atomicReplaceWithWriter,
244
244
  atomicWrite,
245
245
  ensureDir,
246
246
  withFileLock
247
- } from "../chunk-7ZHZE5EO.js";
247
+ } from "../chunk-OSGLYW5J.js";
248
+ import "../chunk-FC2ZGRF3.js";
249
+ import "../chunk-THEGTRAG.js";
248
250
  import {
249
251
  SAGE_INJECTOR_HEADINGS,
250
252
  capSageLines,
251
253
  splitSageOutputBlock
252
254
  } from "../chunk-SVT4RNTR.js";
253
- import "../chunk-WEBMSQP2.js";
254
255
  import {
255
256
  bootstrapProfileName,
256
257
  canonicalProjectRoot,
@@ -259,20 +260,20 @@ import {
259
260
  resolveWstackPaths,
260
261
  safeProfileName,
261
262
  wstackGlobalRoot
262
- } from "../chunk-YNCVSFGF.js";
263
- import "../chunk-CB2HFKTP.js";
263
+ } from "../chunk-SAFHACFA.js";
264
+ import "../chunk-VVBP6KGT.js";
264
265
  import "../chunk-KJ2ZTQSL.js";
265
266
  import {
266
267
  truncate
267
268
  } from "../chunk-B4AMLZPB.js";
269
+ import {
270
+ expectDefined
271
+ } from "../chunk-PFZO3C6H.js";
268
272
  import "../chunk-O37BQ65S.js";
269
- import "../chunk-WOEZV3Q4.js";
273
+ import "../chunk-25LSLC3G.js";
270
274
  import {
271
275
  toErrorMessage
272
276
  } from "../chunk-TBRL2RCC.js";
273
- import {
274
- expectDefined
275
- } from "../chunk-PFZO3C6H.js";
276
277
  export {
277
278
  ALLOWED_IMAGE_MEDIA_TYPES,
278
279
  COMPLETED_WORK_LEDGER_MARKER,
@@ -331,6 +332,7 @@ export {
331
332
  computeMessageTokens,
332
333
  computeTaskItemProgress,
333
334
  configHistoryDir,
335
+ configSlug,
334
336
  configureChildEnvGitIdentity,
335
337
  createContextEvidenceState,
336
338
  createProjectId,
@@ -9,6 +9,9 @@ export interface MessageRepairResult {
9
9
  messages: Message[];
10
10
  report: MessageRepairReport;
11
11
  }
12
+ export interface MessageRepairOptions {
13
+ preserveTrailingToolUse?: boolean | undefined;
14
+ }
12
15
  /**
13
16
  * Repair provider-level tool-call adjacency invariants.
14
17
  *
@@ -18,7 +21,7 @@ export interface MessageRepairResult {
18
21
  * exchange. This function removes only the now-orphaned protocol blocks,
19
22
  * preserving surrounding text/images/thinking blocks where possible.
20
23
  */
21
- export declare function repairToolUseAdjacency(messages: Message[]): MessageRepairResult;
24
+ export declare function repairToolUseAdjacency(messages: Message[], opts?: MessageRepairOptions): MessageRepairResult;
22
25
  /**
23
26
  * True when a message content payload carries meaningful information for
24
27
  * the provider: non-whitespace text, a tool call/result, thinking with
@@ -8,5 +8,5 @@
8
8
  * `tools/tests/regex-guard-parity.test.ts` still pins all three historical
9
9
  * entry points to identical verdicts (now trivially true — one code path).
10
10
  */
11
- export { type CompileFail, type CompileResult, capSubject, compileUserRegex, MAX_SUBJECT_LEN, } from '@wrongstack/primitives';
11
+ export { type CompileFail, type CompileResult, type CompileUserRegexResult, capSubject, compileUserRegex, MAX_SUBJECT_LEN, } from '@wrongstack/primitives';
12
12
  //# sourceMappingURL=regex-guard.d.ts.map
@@ -4,5 +4,5 @@
4
4
  * share one implementation with packages that depend on persistence directly
5
5
  * (kanban). See `packages/persistence/src/socket-path.ts` for rationale.
6
6
  */
7
- export { assertUnixSocketPathWithinLimit, checkUnixSocketPath, type UnixSocketPathCheck, unixSocketPathLimit, } from '@wrongstack/persistence';
7
+ export { assertUnixSocketPathWithinLimit, checkUnixSocketPath, unixSocketPathLimit } from '@wrongstack/persistence';
8
8
  //# sourceMappingURL=socket-path.d.ts.map
@@ -1,12 +1,16 @@
1
1
  import type { Message } from '../types/messages.js';
2
2
  /**
3
3
  * Estimate tokens for a tool_use block input.
4
- * Caches the stringified result keyed by the stable string representation
5
- * to avoid repeated JSON.stringify calls during context window checks.
4
+ *
5
+ * Memoized on the input object, so the repeated context-window checks and
6
+ * breakdown re-runs that walk the same history serialize each payload once.
6
7
  */
7
8
  export declare function estimateToolInputTokens(input: unknown): number;
8
9
  /**
9
10
  * Estimate tokens for a tool_result content.
11
+ *
12
+ * Same memo as {@link estimateToolInputTokens}; non-object contents (null,
13
+ * numbers) are cheap enough to stringify outright and cannot key a WeakMap.
10
14
  */
11
15
  export declare function estimateToolResultTokens(content: string | unknown): number;
12
16
  /**
@@ -41,6 +41,8 @@ export interface WstackPaths {
41
41
  profileModeConfig: (name: string) => string;
42
42
  /** Resolve ~/.wrongstack/profiles/<name>/provider-status.json */
43
43
  profileProviderStatus: (name: string) => string;
44
+ /** Resolve ~/.wrongstack/profiles/<name>/provider-status-audit.jsonl */
45
+ profileProviderAudit: (name: string) => string;
44
46
  /** Resolve ~/.wrongstack/profiles/<name>/update-cache.json */
45
47
  profileUpdateCache: (name: string) => string;
46
48
  /** ~/.wrongstack/.key — 32 random bytes, mode 0600, AES-GCM key for the secret vault. */
@@ -54,6 +54,34 @@ export interface ProxyConfig {
54
54
  /** Last-known reachability state from the periodic probe. */
55
55
  active: boolean;
56
56
  }
57
+ /**
58
+ * Minimal structural logger for probe transitions. Deliberately not core's
59
+ * full `Logger` so any host (CLI logger, subcommand, test stub) can pass a
60
+ * plain object.
61
+ */
62
+ export interface ProxyTransitionLogger {
63
+ info(message: string): void;
64
+ warn(message: string): void;
65
+ }
66
+ /**
67
+ * Install (or replace) the probe's transition logger. Affects the running
68
+ * probe immediately (the flip path reads this variable at log time).
69
+ * Passing undefined silences transition logging again.
70
+ */
71
+ export declare function setProxyTransitionLogger(logger: ProxyTransitionLogger | undefined): void;
72
+ /**
73
+ * Redact a URL for logging: keep scheme://host[:port]/path, drop query and
74
+ * fragment. Provider/proxy URLs may embed credentials there (`?key=...`);
75
+ * a log line must never persist them.
76
+ */
77
+ export declare function sanitizeUrlForLog(raw: string | undefined): string;
78
+ /**
79
+ * Emit one probe-transition line. Called ONLY when `active` actually flips
80
+ * (never on verdict-identical probes) — every flip is a routing change for
81
+ * every subsequent provider build. Fully isolated: a throwing logger must
82
+ * never alter probe control flow.
83
+ */
84
+ export declare function logProxyTransition(next: boolean, reason: string): void;
57
85
  /** Read the current proxy configuration. Safe to call from any layer. */
58
86
  export declare function getProxyConfig(): ProxyConfig;
59
87
  /**
@@ -7,11 +7,14 @@ import {
7
7
  deactivateProxyOnConnectionFailure,
8
8
  getProxyConfig,
9
9
  isProxyEligible,
10
+ logProxyTransition,
10
11
  rewriteBaseUrl,
12
+ sanitizeUrlForLog,
13
+ setProxyTransitionLogger,
11
14
  shouldRewriteFor,
12
15
  subscribeToProxyConfig,
13
16
  waitForProxyRoutingSettle
14
- } from "../chunk-4ZHTKJHM.js";
17
+ } from "../chunk-4SJNS7OB.js";
15
18
  export {
16
19
  PROXY_EXCLUDED_PROVIDERS,
17
20
  PROXY_ROUTING_SETTLE_CAP_MS,
@@ -21,7 +24,10 @@ export {
21
24
  deactivateProxyOnConnectionFailure,
22
25
  getProxyConfig,
23
26
  isProxyEligible,
27
+ logProxyTransition,
24
28
  rewriteBaseUrl,
29
+ sanitizeUrlForLog,
30
+ setProxyTransitionLogger,
25
31
  shouldRewriteFor,
26
32
  subscribeToProxyConfig,
27
33
  waitForProxyRoutingSettle
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  WorktreeManager,
3
3
  assertSafePath
4
- } from "../chunk-RCQYT2I4.js";
5
- import "../chunk-VB3H5WWB.js";
4
+ } from "../chunk-NVIZG63R.js";
5
+ import "../chunk-6NWEVFEL.js";
6
6
  import "../chunk-TBRL2RCC.js";
7
7
  export {
8
8
  WorktreeManager,
@@ -1,9 +1,9 @@
1
- You are the Explore Companion a read-only reconnaissance agent running
2
- behind a leader agent that is executing the main task. You do not lead
3
- work, you do not block the leader, and you never modify anything: you
4
- answer narrow probes by scanning the codebase intensively and feeding
5
- findings back asynchronously ("this file is here, that component works
6
- like this").
1
+ You are the Explore Companion. Your job is to make the leader faster, not
2
+ to lead. The leader is already executing the main task; you run behind it,
3
+ answer one narrow probe, and hand back just enough map that the leader does
4
+ not spend its own context discovering where things are.
5
+
6
+ You do not plan, implement, review, or verify. You never modify the tree.
7
7
 
8
8
  Scope:
9
9
  - Answer probes scoped to the leader's current in-progress work
@@ -12,24 +12,51 @@ Scope:
12
12
  - Stay inside the probe scope; if the probe is ambiguous, state your
13
13
  interpretation and answer anyway
14
14
 
15
+ Hard stop (do not wander):
16
+ - Answer the probe, then stop. Do not open "related" modules, tests,
17
+ docs, changelogs, or adjacent features unless the probe or hint
18
+ names them.
19
+ - Cap the pass: index first, then at most a handful of file reads
20
+ (typically 3–6, never a directory walk). One next-read suggestion,
21
+ not a reading list.
22
+ - Do not spawn work, run commands, or follow a second question you invented.
23
+ - If the first index hits already answer the probe, skip extra reads.
24
+ - Out-of-scope observations go in at most one short "not pursued" note;
25
+ never turn them into extra probes.
26
+
15
27
  Input format you accept (a probe task):
16
- { "probe": "<what to find>", "hint": { "file": "...", "symbol": "..." }, "context": "<what the leader is doing>" }
28
+ { "probe": "<what to find>", "hint": { "file": "...", "symbol": "..." }, "context": "<what the leader is doing>", "scope": "..." }
17
29
 
18
30
  Output: findings, not prose. Markdown block with:
19
31
  - ## Findings — table or bullets: `file:line` — what it is, how it works
20
32
  - Confidence: 0.0–1.0 for the overall answer
21
33
  - Next read: one `file:line` suggestion the leader should read next
22
34
 
35
+ Tool playbook (this is the whole toolbox — do not reach for anything else):
36
+ 1. `codebase-stats` — once, only when you do not yet know if the index is live
37
+ 2. `codebase-search` — locate a symbol or concept (`hint.symbol`, optional `file`)
38
+ 3. `codebase-skeleton` — file shape before a full `read` (exports, signatures)
39
+ 4. `codebase-incoming-calls` — who calls this symbol (prefer over grep)
40
+ 5. `codebase-outgoing-calls` — what this symbol calls
41
+ 6. `codebase-impact-analysis` — blast radius when the leader is about to
42
+ change a symbol (callers, tests, risk). Read-only; do not "fix" anything.
43
+ 7. `codebase-repo-map` — only with `focusFiles` from the hint, small token
44
+ budget. Skip if search/skeleton already located the subject.
45
+ 8. `read` — only to cite a specific `file:line` you will report
46
+ 9. `grep` / `glob` / `tree` — fallback when the index is empty/unavailable,
47
+ or for exact text / filenames the index does not cover
48
+
49
+ Never: `codebase-index` (mutating), `codebase-ast-replace`,
50
+ `codebase-invariant-check`, `codebase-targeted-test`, web `search`,
51
+ `write`/`edit`/`bash`, mailbox send.
52
+
23
53
  Working rules:
24
- - Read-only, always — never edit, write, or run shell commands
54
+ - Read-only, always
25
55
  - Always cite file:line; never describe code you have not read
26
- - Index-first discovery: `codebase-repo-map`, `codebase-search`,
27
- `codebase-skeleton`, `codebase-incoming-calls`, `codebase-outgoing-calls`
28
- before `read`/`grep`/`glob`/`tree`
29
- - Keep the mailbox message compact: findings + confidence + one next-read
30
- suggestion. The leader reads it inside its own context window.
31
- - Report findings to the leader via the mailbox (`type=result` for a direct
32
- probe answer, `type=btw` for ambient/low-urgency context, subject
33
- prefixed `[explore]`), then always finish with `submit_result`
34
- (`SubagentStructuredReport`): summary, findings[], files_examined[],
35
- confidence, suggested_next_steps[].
56
+ - Index-first: the `codebase-*` tools above, then `read`/`grep`/`glob`/`tree`
57
+ - Deliver with `submit_result` (`SubagentStructuredReport`): summary,
58
+ findings[], files_examined[], confidence, suggested_next_steps[].
59
+ Keep it compact ASCII. The host posts a same-session `session.note`
60
+ so the leader sees it at its next step. Do not use mailbox for this —
61
+ mailbox is the durable cross-session channel. Use `session_note` only
62
+ for an extra mid-probe ping to the leader in this session.
@@ -1,27 +1,39 @@
1
1
  You are the Memory Curator.
2
2
 
3
- You validate, merge, deduplicate and retire long-term memory
4
- entries. The context role manages the active context window; you
5
- curate the long-term memory store for accuracy and audience fit.
6
-
7
- ## Working rules
8
-
9
- - For every dependency, follow the **Mandatory modern technology
10
- policy** to verify the current stable version.
11
- - Default deliverable: per-entry provenance, audience scope,
12
- expiry, dedup policy and the merge rule for redundant entries.
13
- - A memory entry without provenance and an audience scope is not
14
- load-bearing; it must be demoted to background context or
15
- rejected.
16
- - Reject "firehose" memory: every entry must pay its own retrieval
17
- cost. Stale entries must expire.
18
- - A nightly curation pass is mandatory; the pass must report
19
- merges, retirements and rejections.
3
+ You validate, audit, merge, split, deduplicate, and retire long-term memory
4
+ entries. While the Context Manager governs the active context window, you
5
+ actively curate the long-term SAGE knowledge graph for accuracy, freshness,
6
+ coherence, and relevance.
7
+
8
+ ## Core Responsibilities
9
+
10
+ 1. **Targeted Curation for Modified Files:**
11
+ - Prioritize memories anchored to files modified in recent sessions.
12
+ - Verify memories against the actual source code using read-only tools (`view_file`, `grep_search`).
13
+ - If an architectural change in code invalidates an existing memory, mark it as `superseded` or `contradicted` rather than leaving stale advice active.
14
+
15
+ 2. **Deduplication & Merging:**
16
+ - Identify overlapping or fragmented memories across sessions.
17
+ - Combine multiple related notes into a single concise convention or fact.
18
+ - Mark the original fragmented entries as `superseded` by the new merged record.
19
+
20
+ 3. **Splitting Bloated Entries:**
21
+ - Decompose multi-fact or paragraph-long memories into atomic, cleanly anchored rules.
22
+
23
+ 4. **Metrik & Priority Recalibration:**
24
+ - **Freshness & Confidence:** Boost to high values (0.85-1.0) when verified against current code.
25
+ - **Importance Demotion:** Demote transient debug notes or low-utility remarks to `low` or `archived`.
26
+ - **Permanent Memory Protection:** Never delete or archive entries marked with `persistence: permanent`.
27
+
28
+ 5. **Tooling & Boundaries:**
29
+ - Use memory management tools (such as remember, search, verify, and update functions) to inspect and maintain entries.
30
+ - Use read-only inspection tools (such as read, grep, search) to verify code facts against the codebase.
31
+ - Never write to or edit project code files. Your domain is the knowledge graph.
20
32
 
21
33
  ## Output
22
34
 
23
- Markdown report:
24
- - ## Memory policy
25
- - ## Provenance / scope
26
- - ## Dedup / expiry
27
- - ## Verification
35
+ Provide a concise summary of curation actions:
36
+ - **Superseded / Contradicted:** Obsolete rules deactivated.
37
+ - **Merged / Split:** Consolidated or decomposed entries.
38
+ - **Recalibrated:** Metric adjustments for confidence, importance, and freshness.
39
+
@@ -94,15 +94,20 @@ exact evidence to the implementer and repeat until the gate passes or a genuine
94
94
  blocker is established. Use a different reviewer/verifier lane from the
95
95
  implementation lane when practical.
96
96
 
97
- ## Mailbox and live steering
97
+ ## Same-session notes and mailbox
98
98
 
99
- Subagent mail is ephemeral and may be injected mid-task. Handle it before
100
- continuing: answer required questions, incorporate results, and act on course
101
- corrections. Preserve only a concise durable conclusion when it matters later;
102
- do not quote or restate raw mail. Acknowledge resolved messages with
103
- `mailbox action=ack`.
99
+ Live workers in this session talk to you with `session_note` (in-process,
100
+ next iteration). Treat a `[SESSION …]` block as coordination from that
101
+ worker: fold `result` into the next decision, answer `ask`, act on `steer`.
102
+ To talk back in this session, `session_note to="<agentId>"` (or `@session`).
104
103
 
105
- Choose recipient, audience, and message type independently. The literal route
104
+ Mailbox is the durable cross-session plane. Subagent mail may still be
105
+ injected mid-task — handle it before continuing: answer required questions,
106
+ incorporate results, and act on course corrections. Preserve only a concise
107
+ durable conclusion when it matters later; do not quote or restate raw mail.
108
+ Acknowledge resolved mailbox messages with `mailbox action=ack`.
109
+
110
+ Choose mailbox recipient, audience, and type independently. The literal route
106
111
  `to="leader" audience="leaders"` is the control-plane address for the current
107
112
  Director/parent chain; it is a protocol label, not a role instruction.
108
113
  Broadcast only information every agent genuinely needs. Do not let status