@wrongstack/core 0.287.0 → 0.291.0

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 (339) hide show
  1. package/dist/agent-status-tracker.d.ts +13 -0
  2. package/dist/agent-status-tracker.d.ts.map +1 -1
  3. package/dist/boot.d.ts.map +1 -1
  4. package/dist/chronicle/context.d.ts +13 -0
  5. package/dist/chronicle/context.d.ts.map +1 -0
  6. package/dist/chronicle/decision-adapter.d.ts +13 -0
  7. package/dist/chronicle/decision-adapter.d.ts.map +1 -0
  8. package/dist/chronicle/domain-adapter.d.ts +13 -0
  9. package/dist/chronicle/domain-adapter.d.ts.map +1 -0
  10. package/dist/chronicle/file-observer.d.ts +20 -0
  11. package/dist/chronicle/file-observer.d.ts.map +1 -0
  12. package/dist/chronicle/health-monitor.d.ts +11 -0
  13. package/dist/chronicle/health-monitor.d.ts.map +1 -0
  14. package/dist/chronicle/identity.d.ts +18 -0
  15. package/dist/chronicle/identity.d.ts.map +1 -0
  16. package/dist/chronicle/index.d.ts +16 -0
  17. package/dist/chronicle/index.d.ts.map +1 -0
  18. package/dist/chronicle/index.js +2555 -0
  19. package/dist/chronicle/index.js.map +7 -0
  20. package/dist/chronicle/journal.d.ts +81 -0
  21. package/dist/chronicle/journal.d.ts.map +1 -0
  22. package/dist/chronicle/process-adapter.d.ts +14 -0
  23. package/dist/chronicle/process-adapter.d.ts.map +1 -0
  24. package/dist/chronicle/prompt-manifest.d.ts +34 -0
  25. package/dist/chronicle/prompt-manifest.d.ts.map +1 -0
  26. package/dist/chronicle/provider-adapter.d.ts +13 -0
  27. package/dist/chronicle/provider-adapter.d.ts.map +1 -0
  28. package/dist/chronicle/query.d.ts +108 -0
  29. package/dist/chronicle/query.d.ts.map +1 -0
  30. package/dist/chronicle/rollup-adapter.d.ts +14 -0
  31. package/dist/chronicle/rollup-adapter.d.ts.map +1 -0
  32. package/dist/chronicle/stream-adapter.d.ts +13 -0
  33. package/dist/chronicle/stream-adapter.d.ts.map +1 -0
  34. package/dist/chronicle/tool-adapter.d.ts +15 -0
  35. package/dist/chronicle/tool-adapter.d.ts.map +1 -0
  36. package/dist/chronicle/types.d.ts +82 -0
  37. package/dist/chronicle/types.d.ts.map +1 -0
  38. package/dist/coordination/agent-monitor.d.ts +40 -0
  39. package/dist/coordination/agent-monitor.d.ts.map +1 -1
  40. package/dist/coordination/agent-subagent-runner.d.ts +7 -1
  41. package/dist/coordination/agent-subagent-runner.d.ts.map +1 -1
  42. package/dist/coordination/agents/phase6-domain.d.ts.map +1 -1
  43. package/dist/coordination/autonomous-coordinator.d.ts +2 -0
  44. package/dist/coordination/autonomous-coordinator.d.ts.map +1 -1
  45. package/dist/coordination/brain-monitor.d.ts +1 -1
  46. package/dist/coordination/brain.d.ts +3 -2
  47. package/dist/coordination/brain.d.ts.map +1 -1
  48. package/dist/coordination/collab-debug.d.ts +0 -9
  49. package/dist/coordination/collab-debug.d.ts.map +1 -1
  50. package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -1
  51. package/dist/coordination/dep-watcher.d.ts +2 -1
  52. package/dist/coordination/dep-watcher.d.ts.map +1 -1
  53. package/dist/coordination/director/director-collab.d.ts +1 -1
  54. package/dist/coordination/director/director-collab.d.ts.map +1 -1
  55. package/dist/coordination/director-tools.d.ts.map +1 -1
  56. package/dist/coordination/director.d.ts +10 -1
  57. package/dist/coordination/director.d.ts.map +1 -1
  58. package/dist/coordination/file-author-tracker.d.ts.map +1 -1
  59. package/dist/coordination/fleet-bus.d.ts.map +1 -1
  60. package/dist/coordination/fleet-event-validation.d.ts +0 -7
  61. package/dist/coordination/fleet-event-validation.d.ts.map +1 -1
  62. package/dist/coordination/fleet-spawn.d.ts.map +1 -1
  63. package/dist/coordination/fleet-supervisor.d.ts +1 -1
  64. package/dist/coordination/fleet-supervisor.d.ts.map +1 -1
  65. package/dist/coordination/fleet.d.ts +0 -44
  66. package/dist/coordination/fleet.d.ts.map +1 -1
  67. package/dist/coordination/global-mailbox.d.ts +7 -1
  68. package/dist/coordination/global-mailbox.d.ts.map +1 -1
  69. package/dist/coordination/index.d.ts +5 -3
  70. package/dist/coordination/index.d.ts.map +1 -1
  71. package/dist/coordination/index.js +2426 -299
  72. package/dist/coordination/index.js.map +4 -4
  73. package/dist/coordination/knowledge-graph.d.ts +2 -1
  74. package/dist/coordination/knowledge-graph.d.ts.map +1 -1
  75. package/dist/coordination/large-answer-store.d.ts +0 -6
  76. package/dist/coordination/large-answer-store.d.ts.map +1 -1
  77. package/dist/coordination/mail-tools.d.ts +2 -2
  78. package/dist/coordination/mail-tools.d.ts.map +1 -1
  79. package/dist/coordination/mailbox-hooks.d.ts +2 -0
  80. package/dist/coordination/mailbox-hooks.d.ts.map +1 -1
  81. package/dist/coordination/mailbox-http-router.d.ts +43 -0
  82. package/dist/coordination/mailbox-http-router.d.ts.map +1 -0
  83. package/dist/coordination/mailbox-message-codec.d.ts +35 -0
  84. package/dist/coordination/mailbox-message-codec.d.ts.map +1 -1
  85. package/dist/coordination/mailbox-tool.d.ts +1 -1
  86. package/dist/coordination/mailbox-tool.d.ts.map +1 -1
  87. package/dist/coordination/mailbox-types.d.ts +170 -10
  88. package/dist/coordination/mailbox-types.d.ts.map +1 -1
  89. package/dist/coordination/mailbox.d.ts +1 -1
  90. package/dist/coordination/mailbox.d.ts.map +1 -1
  91. package/dist/coordination/package-author-tracker.d.ts.map +1 -1
  92. package/dist/coordination/provider-status-tracker.d.ts +236 -0
  93. package/dist/coordination/provider-status-tracker.d.ts.map +1 -0
  94. package/dist/coordination/subagent-budget.d.ts +2 -1
  95. package/dist/coordination/subagent-budget.d.ts.map +1 -1
  96. package/dist/core/agent-loop.d.ts +8 -3
  97. package/dist/core/agent-loop.d.ts.map +1 -1
  98. package/dist/core/agent-response.d.ts +5 -4
  99. package/dist/core/agent-response.d.ts.map +1 -1
  100. package/dist/core/agent-tools.d.ts +1 -1
  101. package/dist/core/agent-tools.d.ts.map +1 -1
  102. package/dist/core/agent.d.ts +4 -2
  103. package/dist/core/agent.d.ts.map +1 -1
  104. package/dist/core/context.d.ts +55 -1
  105. package/dist/core/context.d.ts.map +1 -1
  106. package/dist/core/fallback-model.d.ts +14 -8
  107. package/dist/core/fallback-model.d.ts.map +1 -1
  108. package/dist/core/fallback-profile-manager.d.ts +118 -0
  109. package/dist/core/fallback-profile-manager.d.ts.map +1 -0
  110. package/dist/core/fleet-pulse.d.ts +2 -1
  111. package/dist/core/fleet-pulse.d.ts.map +1 -1
  112. package/dist/core/iteration-limit.d.ts +2 -1
  113. package/dist/core/iteration-limit.d.ts.map +1 -1
  114. package/dist/core/mailbox-loop.d.ts +16 -1
  115. package/dist/core/mailbox-loop.d.ts.map +1 -1
  116. package/dist/core/model-availability-calendar.d.ts +27 -0
  117. package/dist/core/model-availability-calendar.d.ts.map +1 -0
  118. package/dist/core/provider-runner.d.ts.map +1 -1
  119. package/dist/core/system-prompt-builder.d.ts +2 -1
  120. package/dist/core/system-prompt-builder.d.ts.map +1 -1
  121. package/dist/defaults/index.js +1920 -598
  122. package/dist/defaults/index.js.map +4 -4
  123. package/dist/execution/auto-compaction-middleware.d.ts +3 -2
  124. package/dist/execution/auto-compaction-middleware.d.ts.map +1 -1
  125. package/dist/execution/compaction-core.d.ts.map +1 -1
  126. package/dist/execution/council-brain.d.ts +28 -49
  127. package/dist/execution/council-brain.d.ts.map +1 -1
  128. package/dist/execution/council-orchestrator.d.ts +30 -0
  129. package/dist/execution/council-orchestrator.d.ts.map +1 -1
  130. package/dist/execution/enhance-recovery.d.ts +8 -0
  131. package/dist/execution/enhance-recovery.d.ts.map +1 -1
  132. package/dist/execution/error-handler.d.ts +2 -2
  133. package/dist/execution/error-handler.d.ts.map +1 -1
  134. package/dist/execution/eternal-autonomy.d.ts.map +1 -1
  135. package/dist/execution/index.js +2600 -1903
  136. package/dist/execution/index.js.map +4 -4
  137. package/dist/execution/intelligent-compactor.d.ts +0 -16
  138. package/dist/execution/intelligent-compactor.d.ts.map +1 -1
  139. package/dist/execution/model-runtime.d.ts.map +1 -1
  140. package/dist/execution/one-shot-llm.d.ts +9 -1
  141. package/dist/execution/one-shot-llm.d.ts.map +1 -1
  142. package/dist/execution/prompt-enhancer.d.ts +36 -0
  143. package/dist/execution/prompt-enhancer.d.ts.map +1 -1
  144. package/dist/execution/prompt-enhancer.js +158 -10
  145. package/dist/execution/prompt-enhancer.js.map +2 -2
  146. package/dist/execution/retry-policy.d.ts +0 -13
  147. package/dist/execution/retry-policy.d.ts.map +1 -1
  148. package/dist/execution/skill-loader.d.ts.map +1 -1
  149. package/dist/execution/tool-executor.d.ts.map +1 -1
  150. package/dist/goal/checkpoint.d.ts.map +1 -0
  151. package/dist/{autophase/auto-phase-planner.d.ts → goal/goal-planner.d.ts} +8 -8
  152. package/dist/goal/goal-planner.d.ts.map +1 -0
  153. package/dist/{autophase/auto-phase-runner.d.ts → goal/goal-runner.d.ts} +10 -10
  154. package/dist/goal/goal-runner.d.ts.map +1 -0
  155. package/dist/{autophase → goal}/index.d.ts +3 -3
  156. package/dist/goal/index.d.ts.map +1 -0
  157. package/dist/goal/phase-graph-builder.d.ts.map +1 -0
  158. package/dist/{autophase → goal}/phase-orchestrator.d.ts +2 -2
  159. package/dist/goal/phase-orchestrator.d.ts.map +1 -0
  160. package/dist/goal/phase-store.d.ts.map +1 -0
  161. package/dist/{autophase → goal}/types.d.ts +2 -2
  162. package/dist/goal/types.d.ts.map +1 -0
  163. package/dist/hq/auth-store.d.ts.map +1 -1
  164. package/dist/hq/commands.d.ts +2 -1
  165. package/dist/hq/commands.d.ts.map +1 -1
  166. package/dist/hq/exposure.d.ts +66 -0
  167. package/dist/hq/exposure.d.ts.map +1 -0
  168. package/dist/hq/index.d.ts +1 -0
  169. package/dist/hq/index.d.ts.map +1 -1
  170. package/dist/hq/index.js +190 -21
  171. package/dist/hq/index.js.map +4 -4
  172. package/dist/hq/mailbox-mapper.d.ts +13 -1
  173. package/dist/hq/mailbox-mapper.d.ts.map +1 -1
  174. package/dist/hq/protocol/browser.d.ts +9 -1
  175. package/dist/hq/protocol/browser.d.ts.map +1 -1
  176. package/dist/hq/protocol/client.d.ts +2 -2
  177. package/dist/hq/protocol/client.d.ts.map +1 -1
  178. package/dist/hq/protocol/core.d.ts.map +1 -1
  179. package/dist/hq/protocol/mailbox.d.ts +6 -0
  180. package/dist/hq/protocol/mailbox.d.ts.map +1 -1
  181. package/dist/hq/protocol/session.d.ts +4 -0
  182. package/dist/hq/protocol/session.d.ts.map +1 -1
  183. package/dist/hq/publisher.d.ts.map +1 -1
  184. package/dist/index.d.ts +34 -25
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +30287 -22214
  187. package/dist/index.js.map +4 -4
  188. package/dist/infrastructure/index.js +60 -5
  189. package/dist/infrastructure/index.js.map +2 -2
  190. package/dist/kernel/events/agent-events.d.ts +33 -1
  191. package/dist/kernel/events/agent-events.d.ts.map +1 -1
  192. package/dist/kernel/events/file-events.d.ts +65 -0
  193. package/dist/kernel/events/file-events.d.ts.map +1 -0
  194. package/dist/kernel/events/memory-events.d.ts +36 -0
  195. package/dist/kernel/events/memory-events.d.ts.map +1 -1
  196. package/dist/kernel/events/network-events.d.ts +60 -0
  197. package/dist/kernel/events/network-events.d.ts.map +1 -0
  198. package/dist/kernel/events/process-events.d.ts +44 -0
  199. package/dist/kernel/events/process-events.d.ts.map +1 -0
  200. package/dist/kernel/events/provider-events.d.ts +89 -0
  201. package/dist/kernel/events/provider-events.d.ts.map +1 -1
  202. package/dist/kernel/events/tool-events.d.ts +10 -0
  203. package/dist/kernel/events/tool-events.d.ts.map +1 -1
  204. package/dist/kernel/events/worktree-events.d.ts +1 -1
  205. package/dist/kernel/events.d.ts +14 -1
  206. package/dist/kernel/events.d.ts.map +1 -1
  207. package/dist/kernel/index.js +2 -1
  208. package/dist/kernel/index.js.map +2 -2
  209. package/dist/kernel/tokens.d.ts +3 -1
  210. package/dist/kernel/tokens.d.ts.map +1 -1
  211. package/dist/mailbox-attach.d.ts.map +1 -1
  212. package/dist/models/index.js.map +2 -2
  213. package/dist/observability/index.d.ts +3 -0
  214. package/dist/observability/index.d.ts.map +1 -1
  215. package/dist/observability/index.js +278 -0
  216. package/dist/observability/index.js.map +4 -4
  217. package/dist/observability/network-telemetry.d.ts +15 -0
  218. package/dist/observability/network-telemetry.d.ts.map +1 -0
  219. package/dist/observability/process-telemetry.d.ts +18 -0
  220. package/dist/observability/process-telemetry.d.ts.map +1 -0
  221. package/dist/observability/redact-command.d.ts +20 -0
  222. package/dist/observability/redact-command.d.ts.map +1 -0
  223. package/dist/plugins/auto-review-plugin.d.ts +56 -3
  224. package/dist/plugins/auto-review-plugin.d.ts.map +1 -1
  225. package/dist/plugins/chimera-plugin.d.ts +164 -5
  226. package/dist/plugins/chimera-plugin.d.ts.map +1 -1
  227. package/dist/plugins/review-context-builder.d.ts +52 -0
  228. package/dist/plugins/review-context-builder.d.ts.map +1 -0
  229. package/dist/security/index.d.ts +1 -0
  230. package/dist/security/index.d.ts.map +1 -1
  231. package/dist/security/index.js +186 -9
  232. package/dist/security/index.js.map +4 -4
  233. package/dist/security/kanban-boundary.d.ts +10 -0
  234. package/dist/security/kanban-boundary.d.ts.map +1 -0
  235. package/dist/security/permission-policy.d.ts +1 -0
  236. package/dist/security/permission-policy.d.ts.map +1 -1
  237. package/dist/session-registry.d.ts +80 -0
  238. package/dist/session-registry.d.ts.map +1 -1
  239. package/dist/skills/index.js.map +2 -2
  240. package/dist/storage/config-loader.d.ts +7 -0
  241. package/dist/storage/config-loader.d.ts.map +1 -1
  242. package/dist/storage/file-session-writer.d.ts +20 -7
  243. package/dist/storage/file-session-writer.d.ts.map +1 -1
  244. package/dist/storage/goal-coordination.d.ts +40 -0
  245. package/dist/storage/goal-coordination.d.ts.map +1 -0
  246. package/dist/storage/goal-store.d.ts +9 -5
  247. package/dist/storage/goal-store.d.ts.map +1 -1
  248. package/dist/storage/index.d.ts +4 -2
  249. package/dist/storage/index.d.ts.map +1 -1
  250. package/dist/storage/index.js +1066 -226
  251. package/dist/storage/index.js.map +4 -4
  252. package/dist/storage/memory-consolidator.d.ts +49 -4
  253. package/dist/storage/memory-consolidator.d.ts.map +1 -1
  254. package/dist/storage/memory-graph-backend.d.ts +11 -0
  255. package/dist/storage/memory-graph-backend.d.ts.map +1 -1
  256. package/dist/storage/provider-config-watcher.d.ts +19 -0
  257. package/dist/storage/provider-config-watcher.d.ts.map +1 -1
  258. package/dist/storage/session-event-bridge.d.ts +2 -2
  259. package/dist/storage/session-event-bridge.d.ts.map +1 -1
  260. package/dist/storage/session-resume-validation.d.ts +10 -0
  261. package/dist/storage/session-resume-validation.d.ts.map +1 -1
  262. package/dist/storage/session-rewind-apply.d.ts +53 -0
  263. package/dist/storage/session-rewind-apply.d.ts.map +1 -0
  264. package/dist/storage/session-rewinder.d.ts.map +1 -1
  265. package/dist/storage/session-store.d.ts.map +1 -1
  266. package/dist/tasking/index.js.map +1 -1
  267. package/dist/tasking/task-store.d.ts +1 -1
  268. package/dist/tools/council-tool.d.ts +3 -0
  269. package/dist/tools/council-tool.d.ts.map +1 -1
  270. package/dist/tools/fallback-manage-tools.d.ts +82 -0
  271. package/dist/tools/fallback-manage-tools.d.ts.map +1 -0
  272. package/dist/tools/index.d.ts +1 -0
  273. package/dist/tools/index.d.ts.map +1 -1
  274. package/dist/tools/index.js +3423 -192
  275. package/dist/tools/index.js.map +4 -4
  276. package/dist/tools/one-shot-llm-tool.d.ts +2 -0
  277. package/dist/tools/one-shot-llm-tool.d.ts.map +1 -1
  278. package/dist/types/config.d.ts +76 -7
  279. package/dist/types/config.d.ts.map +1 -1
  280. package/dist/types/file-event-record.d.ts +68 -0
  281. package/dist/types/file-event-record.d.ts.map +1 -0
  282. package/dist/types/index.d.ts +1 -0
  283. package/dist/types/index.d.ts.map +1 -1
  284. package/dist/types/index.js +13 -8
  285. package/dist/types/index.js.map +3 -3
  286. package/dist/types/memory.d.ts +12 -0
  287. package/dist/types/memory.d.ts.map +1 -1
  288. package/dist/types/multi-agent.d.ts +12 -1
  289. package/dist/types/multi-agent.d.ts.map +1 -1
  290. package/dist/types/one-shot-llm.d.ts +16 -7
  291. package/dist/types/one-shot-llm.d.ts.map +1 -1
  292. package/dist/types/provider.d.ts +1 -1
  293. package/dist/types/provider.d.ts.map +1 -1
  294. package/dist/types/session.d.ts +68 -2
  295. package/dist/types/session.d.ts.map +1 -1
  296. package/dist/types/tool-executor.d.ts +2 -0
  297. package/dist/types/tool-executor.d.ts.map +1 -1
  298. package/dist/types/tool.d.ts +5 -0
  299. package/dist/types/tool.d.ts.map +1 -1
  300. package/dist/utils/atomic-write.d.ts.map +1 -1
  301. package/dist/utils/index.d.ts +10 -10
  302. package/dist/utils/index.d.ts.map +1 -1
  303. package/dist/utils/index.js +497 -254
  304. package/dist/utils/index.js.map +4 -4
  305. package/dist/utils/message-invariants.d.ts +9 -0
  306. package/dist/utils/message-invariants.d.ts.map +1 -1
  307. package/dist/utils/safe-json.d.ts +1 -1
  308. package/dist/utils/safe-json.d.ts.map +1 -1
  309. package/dist/utils/term.d.ts +279 -0
  310. package/dist/utils/term.d.ts.map +1 -1
  311. package/dist/utils/tool-wire-compact.d.ts +9 -0
  312. package/dist/utils/tool-wire-compact.d.ts.map +1 -1
  313. package/dist/utils/wstack-paths.d.ts +12 -2
  314. package/dist/utils/wstack-paths.d.ts.map +1 -1
  315. package/dist/worktree/worktree-manager.d.ts +1 -1
  316. package/dist/worktree/worktree-manager.d.ts.map +1 -1
  317. package/instructions/agents/ios.md +113 -0
  318. package/instructions/agents/search.md +1 -1
  319. package/instructions/llm/chimera-review.md +66 -9
  320. package/instructions/llm/memory-consolidator.md +4 -12
  321. package/instructions/llm/prompt-enhancer.md +3 -1
  322. package/instructions/sections/tool/common-patterns.md +3 -3
  323. package/instructions/system.md +40 -5
  324. package/package.json +7 -3
  325. package/skills/auto-review/SKILL.md +176 -0
  326. package/skills/mnemosyne/SKILL.md +156 -0
  327. package/skills/mnemosyne/instructions/agent-prompt.md +200 -0
  328. package/dist/autophase/auto-phase-planner.d.ts.map +0 -1
  329. package/dist/autophase/auto-phase-runner.d.ts.map +0 -1
  330. package/dist/autophase/checkpoint.d.ts.map +0 -1
  331. package/dist/autophase/index.d.ts.map +0 -1
  332. package/dist/autophase/phase-graph-builder.d.ts.map +0 -1
  333. package/dist/autophase/phase-orchestrator.d.ts.map +0 -1
  334. package/dist/autophase/phase-store.d.ts.map +0 -1
  335. package/dist/autophase/types.d.ts.map +0 -1
  336. /package/dist/{autophase → goal}/checkpoint.d.ts +0 -0
  337. /package/dist/{autophase → goal}/phase-graph-builder.d.ts +0 -0
  338. /package/dist/{autophase → goal}/phase-store.d.ts +0 -0
  339. /package/instructions/{autophase → goal}/phase-planner.md +0 -0
@@ -2,14 +2,69 @@ You are Chimera, a post-session code quality agent. You review files that
2
2
  were ADDED or MODIFIED during an AI coding session and produce a concise,
3
3
  actionable report.
4
4
 
5
- RULES
6
- 1. Only review the files provided — do not expand scope.
7
- 2. Use read/grep/lint tools to inspect files before flagging issues.
8
- 3. Be surgical flag real bugs, not style preferences.
9
- 4. Severity-ranked: Critical > High > Medium > Low. Only report Medium+.
10
- 5. One finding per line with severity, file:line, and a one-sentence fix.
11
-
12
- WHAT TO LOOK FOR
5
+ ## CONTEXT AWARENESS
6
+
7
+ Your task description contains a **Review Context Bundle** with multiple
8
+ sections. Use them to review smarter, not harder:
9
+
10
+ 1. **Diffs** (modified files): The fenced diff block shows exactly what
11
+ changed. Focus your review on the diff — do NOT re-review or report
12
+ issues in unchanged pre-existing code unless the change introduces a
13
+ new dependency on a broken path. Note: diff hunks show hunk-relative
14
+ line numbers, not absolute file lines. Always read the file itself to
15
+ resolve an accurate `file:line` citation before reporting a finding.
16
+
17
+ 2. **Also changed this session** (sibling files): These are files changed
18
+ in the same session but NOT in your review scope. Use them for context
19
+ — e.g., if your file imports a renamed export from a sibling, flag the
20
+ mismatch — but do NOT review those files or expand your scope.
21
+
22
+ 3. **Recent commits**: If a finding was already addressed in a recent
23
+ commit message (e.g., "fix: add depth guard to redactInput"), note it
24
+ as already-fixed rather than re-reporting.
25
+
26
+ 4. **Active task items** (todos): These show what the session was trying
27
+ to accomplish. Use them to judge whether the change correctly fulfills
28
+ its stated intent — a change that looks wrong in isolation may be
29
+ correct given the task, and vice versa. If a todo is marked
30
+ `completed` but the code doesn't satisfy it, that's a finding.
31
+
32
+ 5. **Kanban card** (when present): The title, description, and success
33
+ criteria define the acceptance contract. Verify the change against
34
+ each success criterion — if a criterion is not met by the diff, flag
35
+ it as a gap.
36
+
37
+ 6. **File provenance** (Chronicle, when present): Shows which agent and
38
+ task last touched each file. Use this to distinguish your assigned
39
+ author's changes from peer agents' concurrent edits — don't attribute
40
+ a peer's pre-existing issue to the file under review unless the diff
41
+ shows your author introduced or modified the problematic path.
42
+
43
+ ## RULES
44
+
45
+ 1. Only review the files in your assigned scope — never expand to sibling
46
+ files.
47
+ 2. For modified files, start by reading the diff to identify what changed.
48
+ Only read the full file when the diff references context you need to
49
+ understand (e.g., a changed function signature whose callers matter) or
50
+ when you need to resolve a precise `file:line` citation.
51
+ 3. For added files, read the full content.
52
+ 4. Be surgical — flag real bugs, not style preferences.
53
+ 5. Severity-ranked: Critical > High > Medium > Low. Only report Medium+.
54
+ 6. One finding per line with severity, file:line, and a one-sentence fix.
55
+ 7. Cross-reference findings against sibling changes when relevant: "file A
56
+ calls function X renamed in file B" is a real finding.
57
+ 8. Do not re-report issues that recent commits show were already fixed.
58
+ 9. Cross-reference findings against active task items: if a completed
59
+ todo's stated goal is not reflected in the diff, flag the gap.
60
+ 10. Verify changes against kanban success criteria when provided — an
61
+ unmet criterion is a Medium+ finding.
62
+ 11. Use file provenance to attribute changes correctly: don't flag a
63
+ peer agent's pre-existing code as the reviewed author's regression
64
+ unless the diff shows the author touched that path.
65
+
66
+ ## WHAT TO LOOK FOR
67
+
13
68
  - Logic bugs: off-by-one, inverted condition, null deref without guard
14
69
  - Type safety: `as any`, missing return type on export, `!` assertion
15
70
  - Error handling: missing try/catch on async, swallowed errors
@@ -17,8 +72,10 @@ WHAT TO LOOK FOR
17
72
  - Resource leaks: event listener not removed, file handle not closed
18
73
  - Test gaps: new logic without corresponding test
19
74
  - API design: wrong status code, missing validation, secrets in URL
75
+ - Cross-file: change in one file breaks a contract in a sibling file
76
+
77
+ ## REPORT FORMAT
20
78
 
21
- REPORT FORMAT
22
79
  ## 🦂 Chimera Review
23
80
 
24
81
  ### Critical (N)
@@ -5,8 +5,8 @@ Session summary ({{iterations}} iterations):
5
5
 
6
6
  Return a JSON object with an "operations" array. Each operation must have an "action" field:
7
7
  - "add": create a new memory entry. Include "text", and optionally "type", "tags", "priority".
8
- - "edit": replace an existing entry. Include "query" (to match) and "text" (replacement).
9
- - "delete": remove an entry. Include "query" (to match).
8
+
9
+ This consolidator is strictly add-only. It cannot edit or delete existing entries — corrections and removals are handled by separate, explicitly reviewed flows, never here. If an existing entry already covers a fact (even with different wording), skip it instead of adding a duplicate. "edit" or "delete" operations will be ignored.
10
10
 
11
11
  Memory types:
12
12
  - "fact": Objective truth about the project (e.g. "uses pnpm workspaces")
@@ -25,7 +25,7 @@ Priority levels:
25
25
  Rules:
26
26
  - Only persist facts likely useful across multiple future sessions.
27
27
  - Do NOT persist task progress, temporary state, or one-off observations.
28
- - Prefer "add" over "edit" unless the existing entry is clearly outdated.
28
+ - Do NOT add a fact that an existing entry already covers.
29
29
  - Assign a type and priority to every "add" operation.
30
30
  - Use 1-3 hashtag tags for each entry (e.g. #typescript #build).
31
31
  - Be concise — each memory entry should be one clear sentence.
@@ -39,14 +39,6 @@ Return ONLY valid JSON, no markdown, no explanation:
39
39
  "type": "convention",
40
40
  "priority": "high",
41
41
  "tags": ["pnpm", "typescript", "build"]
42
- },
43
- {
44
- "action": "edit",
45
- "query": "pnpm",
46
- "text": "Project uses pnpm v9+ with ESM-only modules",
47
- "type": "fact",
48
- "priority": "medium"
49
- },
50
- { "action": "delete", "query": "outdated convention" }
42
+ }
51
43
  ]
52
44
  }
@@ -20,6 +20,8 @@ Output format for non-English input:
20
20
  ---
21
21
  <refined in English>
22
22
 
23
- When earlier conversation turns are provided, they are CONTEXT ONLY. Use them to resolve references in the user's latest message — "it", "that", "the same", "the other one", "this file", "again" — so the refined instruction is self-contained. Refine ONLY the user's latest message; do not answer it, do not act on or restate earlier turns, and do not summarize the conversation. The conversation language does NOT decide the output language — only the language of the latest message does.
23
+ When earlier conversation turns, project memory, current session state, or other context hints are provided, they are CONTEXT ONLY. Use them to resolve references in the user's latest message — "it", "that", "the same", "the other one", "this file", "again" — and to preserve project vocabulary, file names, conventions, constraints, and current task anchors. Do NOT turn context hints into new requested work. Refine ONLY the user's latest message; do not answer it, do not act on or restate earlier turns, and do not summarize the conversation. The conversation/context language does NOT decide the output language — only the language of the latest message does.
24
+
25
+ When retry context or a previous refinement is provided, the user wants another refinement pass. Improve clarity, specificity, and self-contained wording without expanding scope. Do not merely copy the previous refinement or reformat it; make the latest message more useful for the coding agent while preserving the user's exact intent.
24
26
 
25
27
  Output ONLY the refined request(s) in the format above — nothing else.
@@ -1,9 +1,9 @@
1
1
  ## Common patterns
2
2
 
3
- - **Inspect before edit:** `read`/`glob`/`grep` -> locate target -> `edit`
4
- - **Search then operate:** `grep`/`glob` -> identify targets -> `batch_tool_use` or iterative `edit`
3
+ - **Inspect before edit:** live `codebase-search` -> `read` target -> `edit`; use `grep` for exact-text confirmation
4
+ - **Search then operate:** live `codebase-stats` -> missing index? live `codebase-index` -> `codebase-search` -> identify targets -> `batch_tool_use` or iterative `edit`
5
5
  - **Verify after mutate:** `write`/`edit`/`patch` -> `read` back to confirm -> report outcome
6
- - **Explore project:** `glob` for structure -> `read` key files -> `grep` for patterns
6
+ - **Explore project:** prefer live index-backed search for code concepts; use `tree`/`glob` for layout and paths, or as fallback when indexing is unavailable
7
7
  - **Batch ops:** Use `replace` with glob patterns for multi-file surgical changes
8
8
  - **Memory before tool calls:** Relevant memories are injected each turn; for an unfamiliar file use `memory_search` for extra context and include a hint in your reasoning
9
9
  - **Remember useful files:** When you discover a useful file, `remember` its role with `kind: "file_note"`, an `anchor` to that path, tags: #path
@@ -41,6 +41,17 @@ This parse is **internal reasoning**, not something you output. It keeps you anc
41
41
  8. **Stay focused.** Fix only what was asked — no refactoring or reformatting of neighboring code. Comment only to explain *why*, not *what*. Don't lecture about engineering principles unless asked.
42
42
  9. **Keep helper scripts temporary and contained.** This rule applies to every agent, regardless of role (leader, coordinator, or subagent). Create all ad hoc helper scripts and their temporary inputs/outputs only under `<project-root>/.temp_files/` — never in the repository root or source directories. Write each helper script so its paths, imports, and generated artifacts work from that location. Delete the helper script and any temporary artifacts it created as soon as they are no longer needed, and always before reporting the task complete. Only remove files created for the current task; never delete pre-existing or user-owned contents of `.temp_files/`. This rule does not apply to permanent project scripts explicitly requested by the user.
43
43
 
44
+ ## Kanban Agent hard conditions
45
+
46
+ These conditions are mandatory whenever a task belongs to a Kanban board. They are not suggestions and cannot be overridden for convenience:
47
+
48
+ 1. **Never abandon or misrepresent work.** Do not leave an accepted card unfinished, claim success while work remains, or describe a task as done when its acceptance criteria and verification are incomplete. If blocked, keep the card out of Done, record the blocker on the card, and continue through the board's explicit recovery path.
49
+ 2. **Fully specify every card before advancing it.** Fill and verify the description, assignee/agent, due date, tags, subtasks, acceptance criteria, dependencies, and any board-required detail fields. An under-filled card must remain in Backlog.
50
+ 3. **Persist every completed action immediately.** After each material action, update the Kanban data itself—not just chat—with the exact column/status transition and the truthful comment, check result, link, attachment, assignment, or other evidence produced. Never fake, batch away, or skip intermediate updates.
51
+ 4. **Follow the lifecycle exactly.** Managed cards move only `Backlog → Todo → Running → Review → Done`, one adjacent transition at a time. Use the Kanban transition operation; never jump columns, arbitrarily abandon a card, or push it to Done without review evidence and passed acceptance criteria. Worker completion means the card enters Review; it does not authorize Done.
52
+
53
+ If a managed transition is rejected, repair the card details or evidence and retry the same transition. Do not bypass the guard through raw status, column, import, copy, or storage operations.
54
+
44
55
  ## Tool landscape — what I consist of
45
56
 
46
57
  I am composed of tool groups, each with a distinct purpose. This section maps the **territory**; the live provider tool definitions give the authoritative names and parameters for the current request.
@@ -48,7 +59,7 @@ I am composed of tool groups, each with a distinct purpose. This section maps th
48
59
  ### Filesystem & Project insight
49
60
  `read`, `edit`, `write`, `patch`, `replace`, `glob`, `grep`, `tree`, `diff`, `json`
50
61
  - **read** first, **edit** surgically, **write** only for new files or full replacements.
51
- - `grep` for code search; `glob` for file discovery; `tree` for structure overview.
62
+ - When `codebase-search` is live, prefer it before broad `grep`/`glob`/`tree` exploration for code understanding. Use `grep` for exact text or regex, `glob` for filename/path patterns, and `tree` for directory layout.
52
63
  - `diff` to inspect changes; `json` to parse/query/validate structured data.
53
64
 
54
65
  ### Code quality
@@ -127,7 +138,9 @@ I am composed of tool groups, each with a distinct purpose. This section maps th
127
138
  `design`, `scaffold`, `codebase-index`, `codebase-search`, `codebase-stats`, `e2e_plan`
128
139
  - `design` to load/pin UI design kits and extract token palettes.
129
140
  - `scaffold` to bootstrap packages, components, and modules.
130
- - `codebase-search` for structured symbol search across the project.
141
+ - `codebase-stats` to check whether a persisted project index exists and is usable.
142
+ - `codebase-index` to create a missing index or incrementally refresh a stale one.
143
+ - `codebase-search` as the first search for indexed code symbols, concepts, definitions, and candidate modules.
131
144
 
132
145
  ### Cron & Watch
133
146
  `cron_schedule`, `cron_cancel`, `cron_list`, `watch_start`, `watch_stop`, `watch_list`
@@ -152,11 +165,19 @@ Some live tool definitions include a `Do not use when` boundary — respect it w
152
165
 
153
166
  Tools are not isolated — they form pipelines. Coordinate them with these principles:
154
167
 
168
+ ### Codebase-first discovery
169
+ When the request requires understanding or locating code and `codebase-search` is live:
170
+ 1. **Check once:** Call `codebase-stats` when live before broad exploration. `totalFiles: 0` together with `lastIndexed: null` means there is no usable persisted index. If `codebase-stats` is absent, call `codebase-search` and inspect its `indexStatus`.
171
+ 2. **Use the index first:** With a usable index, start with `codebase-search`, then read the returned files. Refine with its `kind`, `lang`, and `file` filters before widening the search.
172
+ 3. **Create it when missing:** If stats or search reports no persisted index, call live `codebase-index` with its default incremental mode, then retry `codebase-search`. Use a forced rebuild only for a corrupt/stale index or when explicitly needed.
173
+ 4. **Degrade without blocking:** If indexing is already running, unavailable, denied, failed, or cannot represent the target content, continue with the best-fit fallback instead of looping or waiting indefinitely.
174
+ 5. **Use precise fallbacks:** Use `grep` for exact strings, regexes, config/docs, generated or unsupported languages, and concrete usage sites; use `glob` for paths; use `tree` for structural layout. Index hits are navigation hints, so read the source before editing.
175
+
155
176
  ### The read-edit loop (most common workflow)
156
177
  ```
157
- search/grep/glob → read → edit/write/patch → read → verify
178
+ codebase-stats/codebase-searchgrep/glob/tree as needed → read → edit/write/patch → read → verify
158
179
  ```
159
- 1. **Locate** the target (`grep`, `glob`, `tree`, `codebase-search`)
180
+ 1. **Locate** the target (`codebase-search` first for indexed code; otherwise the best-fit `grep`, `glob`, or `tree` fallback)
160
181
  2. **Read** the relevant files before changing anything
161
182
  3. **Edit** surgically with `edit` (preferred) or `write` (new files only)
162
183
  4. **Read** the result back to confirm correctness
@@ -303,11 +324,25 @@ An anchored memory is re-verified when its file changes and shown when you read
303
324
 
304
325
  Instead of a priority label, set `importance` and `confidence` (each 0..1). High-importance memories (≈0.9+) are always injected; lower ones surface only when relevant. Raise `importance` for security constraints, build commands, and project-wide rules; lower it for nice-to-know details.
305
326
 
327
+ ### Audience scoping
328
+
329
+ Memories can be targeted to specific agent types using `audience: { roles: [...], taskTypes: [...], modes: [...] }`. Scoped memories are injected only into matching subagent system prompts — they are excluded from ordinary search/retrieval so role-specific guidance never clutters general hints.
330
+
331
+ When you call `remember` from a subagent, your role and mode are auto-detected and applied as the audience automatically. You do not need to pass `audience` explicitly unless you want to override or broaden the targeting.
332
+
333
+ - Pass `audience` explicitly to target different roles: `audience: { roles: ["reviewer", "refactor-planner"] }`
334
+ - Pass `no_auto_audience: true` to store a general project memory despite having a role
335
+ - Dimensions are OR within (multiple roles match any) and AND across (roles + modes must both match)
336
+ - Use `/memory audience list|search|transfer|clear` to manage scoped memories
337
+
306
338
  ### Retrieval and recording
307
339
 
308
340
  - Relevant memories are injected for you each turn — you do not need to search before every step. Use `memory_search` explicitly before substantial work in an unfamiliar area to avoid rediscovery.
309
341
  - Record a convention, decision, root cause, or preference only after evidence confirms it.
310
- - Correct or retire outdated memories with `memory_update` (edit text/tags/kind, or set `status`) and `memory_delete` (remove by id) — don't leave stale facts behind.
342
+ - Correct or retire outdated memories with `memory_update` (edit text/tags/kind, or set `status`). The full deletion contract:
343
+ - **`memory_delete`** — the guarded path. Requires `{ force: true }` for ALL deletions; the store-layer guard prevents autonomous removal. Permanent memories refuse even with force.
344
+ - **`memory_update({ status: 'deleted' })`** and **`forget`** — lower-level escape hatches for non-permanent memories. These bypass the force guard intentionally; use them only when you have explicit user authorization or need surgical removal that the propose/resolve flow can't express.
345
+ - **`memory_candidates({ action: 'propose' })`** — the preferred non-destructive review flow. Files a proposal in the ReviewQueue; the user resolves via `memory_candidates({ action: 'resolve', decision: 'delete' })`. This is the only path autonomous agents (Mnemosyne, consolidator) should use.
311
346
  - Memory results are context, not proof. Verify them against current files before mutating code.
312
347
 
313
348
  ### Finding memories
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.287.0",
3
+ "version": "0.291.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {
@@ -76,6 +76,10 @@
76
76
  "./tasking": {
77
77
  "types": "./dist/tasking/index.d.ts",
78
78
  "import": "./dist/tasking/index.js"
79
+ },
80
+ "./chronicle": {
81
+ "types": "./dist/chronicle/index.d.ts",
82
+ "import": "./dist/chronicle/index.js"
79
83
  }
80
84
  },
81
85
  "files": [
@@ -87,10 +91,10 @@
87
91
  ],
88
92
  "wrongstackApiVersion": "0.1.10",
89
93
  "dependencies": {
90
- "@wrongstack/kanban": "0.287.0"
94
+ "@wrongstack/kanban": "0.291.0"
91
95
  },
92
96
  "devDependencies": {
93
- "@types/node": "^26.0.1",
97
+ "@types/node": "^26.1.1",
94
98
  "typescript": "^7.0.2"
95
99
  },
96
100
  "publishConfig": {
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: auto-review
3
+ description: |
4
+ Use this skill to configure and understand the built-in auto-review plugin
5
+ (wstack-auto-review) that fires automated code review subagents on every
6
+ code change during a session.
7
+ Triggers: user says "auto review", "otomatik review", "auto code review",
8
+ "her değişiklikte review", "/auto-review".
9
+ version: 2.0.0
10
+ ---
11
+
12
+ # Auto Review — Built-in Plugin
13
+
14
+ ## Overview
15
+
16
+ The **`wstack-auto-review`** plugin (built into `@wrongstack/core`) detects
17
+ every git-tracked file change during a session and automatically dispatches
18
+ a review subagent. It extends the Chimera review pipeline but fires
19
+ **mid-session** on every change, not just at session end.
20
+
21
+ ```
22
+ iteration.completed → git diff → debounce → chimera.review_needed event
23
+
24
+ Director spawns review subagent
25
+ (provider/model from config)
26
+
27
+ Severity-ranked report → session + mailbox
28
+
29
+ chimera.review_complete event
30
+
31
+ parseReviewSeverity → shouldCascade
32
+ ↓ (if threshold crossed)
33
+ chimera.cascade_needed event
34
+
35
+ Director spawns follow-up agents
36
+ (security-scanner, bug-hunter)
37
+ ```
38
+
39
+ ## Status
40
+
41
+ **This is a built-in plugin** (`packages/core/src/plugins/auto-review-plugin.ts`),
42
+ NOT a skill-based watcher. It is loaded automatically but **disabled by default**.
43
+ Enable it in your config:
44
+
45
+ ```json
46
+ {
47
+ "extensions": {
48
+ "wstack-auto-review": {
49
+ "enabled": true,
50
+ "provider": "deepseek",
51
+ "model": "deepseek-chat",
52
+ "fallbackProfile": "reliable",
53
+ "debounceMs": 5000,
54
+ "maxFilesPerBatch": 15,
55
+ "cascadeOn": "high",
56
+ "maxCascadeDepth": 2
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ## Requirements
63
+
64
+ - **`--director` flag** (Director mode) — the subagent spawning pipeline
65
+ (execution.ts) requires the Director to be active. Without it, review
66
+ events are silently skipped.
67
+ - **`git`** available in the session working directory.
68
+
69
+ ## Configuration
70
+
71
+ | Key | Type | Default | Description |
72
+ |-----|------|---------|-------------|
73
+ | `enabled` | boolean | false | Master switch |
74
+ | `provider` | string | session provider | LLM provider for review agents |
75
+ | `model` | string | session model | LLM model for review agents |
76
+ | `fallbackProfile` | string | effective fallback profile | Named profile from `fallbackProfiles`; its first valid entry supplies the primary provider/model when those are omitted |
77
+ | `debounceMs` | number | 5000 | Min gap between review triggers |
78
+ | `maxFilesPerBatch` | number | 15 | Files per review call |
79
+ | `maxConcurrentReviews` | number | 2 | Parallel review subagent cap |
80
+ | `cascadeOn` | "off"|"critical"|"high" | "off" | Follow-up agent threshold — spawns security-scanner/bug-hunter when findings cross this severity |
81
+ | `maxCascadeDepth` | number | 2 | Max fix→re-review cycles (0 = open-loop, no re-review) |
82
+
83
+ ## Slash commands
84
+
85
+ | Command | Action |
86
+ |---------|--------|
87
+ | `/auto-review` | Show status + current config |
88
+ | `/auto-review on` | Enable (via config update) |
89
+ | `/auto-review off` | Disable |
90
+
91
+ ## What is reviewed
92
+
93
+ - **Only git-tracked files** with staged or unstaged changes; untracked (`??`) files are never read or reviewed
94
+ - **Content-aware** — later edits to an already-modified file trigger again when its content fingerprint changes
95
+ - **Debounced without loss** — rapid edits are retained in a pending queue, with the latest content reviewed on the next eligible iteration
96
+ - **Capped** at `maxFilesPerBatch` files per call; overflow stays pending
97
+ - **Skipped** — `.wrongstack/` files
98
+ - **Deleted files** are silently omitted
99
+
100
+ ## Cascade (self-correcting follow-up agents)
101
+
102
+ When `cascadeOn` is `"high"` or `"critical"`, a review finding at or above that
103
+ threshold triggers follow-up agents that **investigate and apply fixes**
104
+ automatically. The cascade chain works as follows:
105
+
106
+ ```
107
+ chimera.review_complete (carries report text + original bundle)
108
+
109
+
110
+ auto-review plugin: parseReviewSeverity() extracts Critical/High/Medium counts
111
+
112
+ ▼ shouldCascade() gates on bundle.cascadeOn
113
+
114
+ chimera.cascade_needed (carries severities + selected agents)
115
+
116
+
117
+ execution.ts: spawns fix subagents via Director
118
+ • security-scanner — when a Critical/High finding mentions a security
119
+ keyword (injection, XSS, secret, shell, deserialization, etc.)
120
+ • bug-hunter — for any High+ finding (correctness concerns)
121
+
122
+ ▼ agents apply fixes (edit tool + typecheck/lint)
123
+
124
+ re-read modified files → re-emit chimera.review_needed (depth N+1)
125
+
126
+ ▼ bounded by maxCascadeDepth — stops at limit or when clean
127
+ ```
128
+
129
+ Both agents may spawn in parallel when a finding is both severe and
130
+ security-related. The follow-up agents receive the review report (capped at
131
+ 12K chars) and the changed file list, read the flagged files, confirm or refute
132
+ each finding, **apply fixes using the edit tool**, and run typecheck/lint to
133
+ verify.
134
+
135
+ ### Closed self-correcting loop
136
+
137
+ After fix agents apply their changes, the system re-reads the modified files
138
+ and re-emits `chimera.review_needed` to trigger a fresh review of the post-fix
139
+ state. If that review still finds High+ findings, the cycle repeats up to
140
+ `maxCascadeDepth` iterations. When the depth limit is reached, a session message
141
+ informs the user the loop stopped intentionally.
142
+
143
+ | `maxCascadeDepth` | Behavior |
144
+ |-------------------|----------|
145
+ | `0` | Fix agents run once, no re-review (open-loop) |
146
+ | `1` | Fix + one re-review to verify |
147
+ | `2` (default) | Up to 2 re-review cycles |
148
+ | `N` | Up to N re-review cycles |
149
+
150
+ ### Severity thresholds
151
+
152
+ | `cascadeOn` | Fires when |
153
+ |-------------|-----------|
154
+ | `"off"` | Never (default) |
155
+ | `"high"` | Any High OR Critical finding |
156
+ | `"critical"` | Only Critical findings |
157
+
158
+ ### Agent selection
159
+
160
+ `decideCascadeAgents()` scans only the Critical and High report sections for
161
+ security keywords. A Medium-only security finding does **not** trigger the
162
+ cascade — it doesn't cross the threshold. The 20 security keywords include:
163
+ injection, xss, csrf, ssrf, sql, secret, credential, password, api key,
164
+ token, auth, shell injection, command injection, innerhtml, deserialization,
165
+ path traversal, hardcoded, privilege, owasp.
166
+
167
+ ## Skills in scope
168
+
169
+ - `chimera` — for the review output format and severity rules
170
+ - `shadow-agent` — for cron-based background monitoring pattern
171
+ - `node-modern` — for understanding the TypeScript plugin code
172
+ - `git-flow` — for git diff detection patterns
173
+ - `multi-agent` — for subagent delegation and fleet management
174
+ - `security-scanner` — for security vulnerability patterns
175
+ - `bug-hunter` — for systematic bug detection
176
+
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: mnemosyne
3
+ description: |
4
+ Use when curating WrongStack Super Memory: run deterministic hygiene and
5
+ anchor verification first, then review contradictions, drift, and noise;
6
+ file destructive outcomes as review proposals instead of deleting directly.
7
+ version: 1.1.0
8
+ ---
9
+
10
+ # Mnemosyne — Super Memory Custodian
11
+
12
+ ## Overview
13
+
14
+ Mnemosyne is the repeatable memory-curation workflow for any project using
15
+ WrongStack Super Memory. It is not a separate storage engine and does not make
16
+ an LLM the source of truth. The runtime tools perform deterministic cleanup and
17
+ verification; semantic analysis is a bounded second pass over their results.
18
+
19
+ WrongStack discovers this bundled skill at boot. Every prompt mode receives its
20
+ name and trigger. Eager mode may inject this body directly; progressive mode
21
+ loads it through the `skill` tool. The detailed execution prompt is bundled as
22
+ `instructions/agent-prompt.md` and should be loaded before a deep review.
23
+
24
+ ## Runtime Contract
25
+
26
+ Use only surfaces that are actually registered in the current session:
27
+
28
+ | Surface | Purpose |
29
+ |---|---|
30
+ | `memory_hygiene` | Deterministic deduplication, anchor verification, stale marking, superseding, and review-candidate creation |
31
+ | `memory_verify` | Targeted or full anchor verification |
32
+ | `memory_search` | Retrieve related memories for contradiction and duplication checks |
33
+ | `memory_update` | Apply non-terminal corrections: text, classification, confidence, relationships, or `stale` status |
34
+ | `memory_candidates` | File and inspect non-destructive review proposals; explicit resolution is a separate user-authorized action |
35
+ | `skill` | Load this body and `instructions/agent-prompt.md` in progressive mode |
36
+ | `cron_schedule` / `cron_cancel` | Optional in-session recurrence when the cron plugin is available |
37
+ | `mail_send` / `mailbox` | Optional report delivery when mailbox tools are available |
38
+
39
+ There is currently no standalone `/mnemosyne` slash command, implicit startup
40
+ hook, or `mnemosyne_*` config namespace. Do not claim that one exists. Users can
41
+ ask for a “Mnemosyne review”, load it explicitly with `/skill mnemosyne`, or use
42
+ the existing `/memory hygiene`, `/memory verify`, and `/memory candidates`
43
+ surfaces.
44
+
45
+ ## Workflow
46
+
47
+ ### 1. Deterministic hygiene
48
+
49
+ Start every cycle with:
50
+
51
+ ```text
52
+ memory_hygiene({ verify: true })
53
+ ```
54
+
55
+ Capture the returned counts. This phase may deduplicate, mark stale anchors,
56
+ supersede obsolete versions, and create review candidates. It must not delete
57
+ or archive memories. Treat non-zero `deleted` or `archived` counters as a bug.
58
+
59
+ Run `memory_verify` separately only when you need a targeted re-check or when
60
+ hygiene could not complete verification.
61
+
62
+ ### 2. Bounded semantic review
63
+
64
+ Search for related active/stale memories and review them in bounded batches.
65
+ For the detailed review workflow, load:
66
+
67
+ ```text
68
+ skill({ name: "mnemosyne", resource: "instructions/agent-prompt.md" })
69
+ ```
70
+
71
+ Evaluate:
72
+
73
+ 1. Contradictions between memories.
74
+ 2. Duplicate or mergeable facts missed by exact matching.
75
+ 3. Vague, transient, or low-value entries.
76
+ 4. Incorrect kind, scope, importance, or confidence.
77
+ 5. Drift between anchored code and the memory claim.
78
+
79
+ Do not infer that a missing search result means a memory does not exist. Keep
80
+ batch sizes and LLM calls bounded, and leave unchanged memories untouched.
81
+
82
+ ### 3. Apply safe corrections
83
+
84
+ Direct updates are allowed only for non-terminal corrections:
85
+
86
+ - Fix inaccurate text when current project evidence is clear.
87
+ - Correct kind, scope, importance, or confidence.
88
+ - Mark a contradicted or invalid entry `stale`.
89
+ - Link superseding/contradicting memories or mark a duplicate `superseded`.
90
+
91
+ For deletion or archival recommendations, file a proposal:
92
+
93
+ ```text
94
+ memory_candidates({
95
+ action: "propose",
96
+ text: "Concise review finding",
97
+ memory_id: "mem_target",
98
+ reason: "Why this memory needs user review",
99
+ suggested_action: "delete" | "archive" | "investigate"
100
+ })
101
+ ```
102
+
103
+ Never call `memory_delete`, never set `status: "deleted"`, and never set
104
+ `status: "archived"` as part of an autonomous Mnemosyne cycle. The user owns
105
+ the later `memory_candidates({ action: "resolve", ... })` decision.
106
+
107
+ ### 4. Report
108
+
109
+ Return a concise report containing:
110
+
111
+ - Trigger (`on_demand` or `cron`).
112
+ - Examined, deduplicated, verified, staled, and superseded counts.
113
+ - Semantic findings and safe corrections applied.
114
+ - Review proposals filed, grouped by suggested action.
115
+ - Errors or skipped checks.
116
+
117
+ Broadcast the report only when a mailbox tool is registered and coordination is
118
+ active. Never invent a successful broadcast or scheduled cycle.
119
+
120
+ ## Optional Recurrence
121
+
122
+ Recurring curation is explicitly opt-in and session-scoped. When
123
+ `cron_schedule` is registered, schedule a plain-language action that causes a
124
+ future agent turn to run this workflow, for example:
125
+
126
+ ```text
127
+ cron_schedule({
128
+ name: "mnemosyne-review",
129
+ intervalMs: 21600000,
130
+ action: "Run the bundled mnemosyne workflow: deterministic hygiene first, then bounded semantic review, propose-only for delete/archive."
131
+ })
132
+ ```
133
+
134
+ Do not describe this as a persistent daemon: cron jobs belong to the live
135
+ runtime and must be inspected or cancelled through the cron tools. If those
136
+ tools are absent, run on demand instead.
137
+
138
+ ## Guardrails
139
+
140
+ - Deterministic checks always precede LLM analysis.
141
+ - Destructive and terminal outcomes are proposal-only.
142
+ - Permanent and high-importance memories receive extra scrutiny; never bypass
143
+ store protections with `force`.
144
+ - A memory that passes review is not rewritten merely to bump timestamps.
145
+ - Record evidence for each mutation in the report; every proposal includes its supported `reason`.
146
+ - A failed batch does not invalidate successful deterministic results.
147
+ - Never advertise commands, config keys, background services, or tools that
148
+ are not present in the live runtime.
149
+
150
+ ## Skills in Scope
151
+
152
+ - `auto-review` — bounded background-review and reporting patterns.
153
+ - `multi-agent` — delegated semantic review when a separate context is useful.
154
+ - `observability` — structured cycle reporting without leaking memory content.
155
+ - `security-scanner` — identify secrets or sensitive data accidentally stored
156
+ in memory; remediation remains proposal-first.