mixdog 1.4.1 → 1.4.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 (326) hide show
  1. package/package.json +3 -2
  2. package/scripts/build-shipped-history.mjs +115 -33
  3. package/scripts/gate-local.mjs +172 -61
  4. package/scripts/lib/gate-scheduler.mjs +138 -32
  5. package/scripts/lib/gate-timing-reporter.mjs +16 -0
  6. package/scripts/lib/run-node-tests.mjs +54 -29
  7. package/scripts/lib/scoped-temp.mjs +1 -0
  8. package/scripts/lib/test-failure-records.mjs +14 -1
  9. package/scripts/lib/test-failure-summary.mjs +16 -4
  10. package/scripts/lib/test-spawn-ledger.mjs +12 -3
  11. package/scripts/pptx-kit-index.mjs +5 -6
  12. package/scripts/suite-health.mjs +110 -28
  13. package/scripts/test.mjs +9 -14
  14. package/src/agents/advisor/AGENT.md +4 -4
  15. package/src/agents/advisor/agent.json +1 -1
  16. package/src/agents/explore/AGENT.md +22 -0
  17. package/src/agents/explore/agent.json +6 -0
  18. package/src/cli.mjs +7 -0
  19. package/src/defaults/agents.json +7 -0
  20. package/src/defaults/shipped-history.json +18 -2
  21. package/src/defaults/skills/browser-use/SKILL.md +4 -1
  22. package/src/defaults/skills/code-tidy/SKILL.md +71 -102
  23. package/src/defaults/skills/code-tidy/references/agent-cleanup.md +66 -114
  24. package/src/defaults/skills/code-tidy/references/cleanup-report.md +19 -35
  25. package/src/defaults/skills/code-tidy/references/dead-code.md +3 -9
  26. package/src/defaults/skills/code-tidy/references/test-suite-slop.md +16 -27
  27. package/src/defaults/skills/computer-use/SKILL.md +12 -2
  28. package/src/defaults/skills/goal-management/SKILL.md +1 -1
  29. package/src/defaults/skills/setup/references/actions.md +12 -6
  30. package/src/defaults/skills/setup/references/surfaces.md +2 -2
  31. package/src/defaults/skills/setup-guide/SKILL.md +5 -2
  32. package/src/defaults/skills/setup-guide/model-recommendations.json +13 -0
  33. package/src/defaults/skills/skill-creator/SKILL.md +85 -190
  34. package/src/defaults/skills/skill-creator/references/design.md +70 -162
  35. package/src/defaults/skills/skill-creator/references/evaluation.md +33 -92
  36. package/src/defaults/skills/test-suite/SKILL.md +194 -0
  37. package/src/defaults/skills/test-suite/references/case-management.md +51 -0
  38. package/src/defaults/skills/test-suite/references/flaky-policy.md +39 -0
  39. package/src/defaults/skills/test-suite/references/reliability.md +49 -0
  40. package/src/defaults/skills/test-suite/references/suite-design.md +78 -0
  41. package/src/defaults/skills/test-suite/scripts/inventory.mjs +335 -0
  42. package/src/defaults/skills/visualize/SKILL.md +6 -2
  43. package/src/lib/rules-builder.cjs +6 -30
  44. package/src/rules/lead/LEAD.md +3 -3
  45. package/src/rules/shared/20-research.md +3 -6
  46. package/src/rules/shared/40-editing.md +1 -0
  47. package/src/rules/shared/60-verification.md +10 -9
  48. package/src/rules/shared/70-delivery.md +4 -3
  49. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +5 -1
  50. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +10 -1
  51. package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +130 -21
  52. package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +13 -0
  53. package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +4 -1
  54. package/src/runtime/agent/orchestrator/config.mjs +12 -7
  55. package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +7 -7
  56. package/src/runtime/agent/orchestrator/context/role-instructions.mjs +5 -26
  57. package/src/runtime/agent/orchestrator/internal-agents.mjs +3 -14
  58. package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +122 -12
  59. package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +5 -3
  60. package/src/runtime/agent/orchestrator/mcp/client-config.mjs +13 -2
  61. package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +152 -58
  62. package/src/runtime/agent/orchestrator/mcp/client.mjs +51 -18
  63. package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +83 -52
  64. package/src/runtime/agent/orchestrator/mcp/oauth.mjs +42 -26
  65. package/src/runtime/agent/orchestrator/providers/account-pool.mjs +43 -8
  66. package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +30 -28
  67. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
  68. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +31 -21
  69. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +3 -1
  70. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -2
  71. package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
  72. package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +1 -1
  73. package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +40 -0
  74. package/src/runtime/agent/orchestrator/providers/custom-provider-keys.mjs +34 -0
  75. package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +3 -0
  76. package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +14 -7
  77. package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +3 -2
  78. package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +2 -2
  79. package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -1
  80. package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +48 -31
  81. package/src/runtime/agent/orchestrator/providers/lib/oauth-page.mjs +0 -18
  82. package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +138 -6
  83. package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +1 -1
  84. package/src/runtime/agent/orchestrator/providers/model-cache.mjs +100 -33
  85. package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +1 -1
  86. package/src/runtime/agent/orchestrator/providers/oauth-secret-fields.fixtures.mjs +45 -0
  87. package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +26 -28
  88. package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +3 -1
  89. package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +1 -0
  90. package/src/runtime/agent/orchestrator/providers/opencode-go-oauth.mjs +1 -1
  91. package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +3 -1
  92. package/src/runtime/agent/orchestrator/providers/registry.mjs +33 -2
  93. package/src/runtime/agent/orchestrator/providers/vertex-ai-auth.mjs +622 -0
  94. package/src/runtime/agent/orchestrator/providers/vertex-ai-maas.mjs +185 -0
  95. package/src/runtime/agent/orchestrator/providers/vertex-ai-models.mjs +445 -0
  96. package/src/runtime/agent/orchestrator/providers/vertex-ai.mjs +567 -0
  97. package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
  98. package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +2 -1
  99. package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
  100. package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +3 -0
  101. package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +14 -5
  102. package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -0
  103. package/src/runtime/agent/orchestrator/session/agent-room.d.mts +30 -5
  104. package/src/runtime/agent/orchestrator/session/agent-room.mjs +171 -37
  105. package/src/runtime/agent/orchestrator/session/cache-warm.mjs +94 -10
  106. package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +3 -3
  107. package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +10 -5
  108. package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +5 -5
  109. package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +11 -1
  110. package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -3
  111. package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -6
  112. package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +5 -3
  113. package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +21 -2
  114. package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +2 -0
  115. package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +23 -1
  116. package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +13 -8
  117. package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +50 -28
  118. package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +1 -0
  119. package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +3 -4
  120. package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +2 -0
  121. package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +7 -0
  122. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +15 -0
  123. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +25 -14
  124. package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +17 -14
  125. package/src/runtime/agent/orchestrator/session/manager/session-scratch-environment.mjs +70 -0
  126. package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +0 -3
  127. package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +7 -3
  128. package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +47 -29
  129. package/src/runtime/agent/orchestrator/session/manager/turn-reap.mjs +125 -0
  130. package/src/runtime/agent/orchestrator/session/mixy-name.mjs +11 -5
  131. package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +1 -1
  132. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +243 -38
  133. package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +163 -64
  134. package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +164 -4
  135. package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +142 -18
  136. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
  137. package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +36 -26
  138. package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +3 -5
  139. package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
  140. package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +20 -15
  141. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +96 -20
  142. package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +59 -10
  143. package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
  144. package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +99 -2
  145. package/src/runtime/agent/orchestrator/tools/lib/owned-shell-trees.mjs +2 -0
  146. package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +103 -13
  147. package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +3 -1
  148. package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +49 -15
  149. package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +45 -27
  150. package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +34 -10
  151. package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +2 -0
  152. package/src/runtime/agent/orchestrator/tools/lib/wait-until-fixture.mjs +26 -0
  153. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +7 -2
  154. package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
  155. package/src/runtime/channels/lib/whisper-port.mjs +19 -10
  156. package/src/runtime/channels/lib/whisper-server.mjs +10 -1
  157. package/src/runtime/connectors/connector-accounts-mcp.mjs +236 -103
  158. package/src/runtime/connectors/gmail-app-password.mjs +3 -3
  159. package/src/runtime/explore/explorer.mjs +93 -0
  160. package/src/runtime/explore/tool-defs.mjs +35 -0
  161. package/src/runtime/explore/tool.mjs +123 -0
  162. package/src/runtime/memory/index.mjs +4 -0
  163. package/src/runtime/memory/lib/embedding-provider.mjs +4 -1
  164. package/src/runtime/memory/lib/embedding-worker.mjs +4 -0
  165. package/src/runtime/office/quality/assurance-structure-docx.mjs +1 -1
  166. package/src/runtime/shared/agent-route-config.mjs +17 -2
  167. package/src/runtime/shared/atomic-file.mjs +103 -2
  168. package/src/runtime/shared/background-tasks.mjs +15 -6
  169. package/src/runtime/shared/connector-accounts.mjs +5 -5
  170. package/src/runtime/shared/connector-catalog.d.mts +11 -4
  171. package/src/runtime/shared/connector-catalog.mjs +60 -52
  172. package/src/runtime/shared/custom-provider-keys.mjs +20 -0
  173. package/src/runtime/shared/file-has-data.mjs +26 -2
  174. package/src/runtime/shared/file-lock.mjs +13 -15
  175. package/src/runtime/shared/git-launch.d.mts +9 -0
  176. package/src/runtime/shared/git-launch.mjs +213 -0
  177. package/src/runtime/shared/git-runner-worker.mjs +2 -1
  178. package/src/runtime/shared/llm/cost.mjs +6 -1
  179. package/src/runtime/shared/llm/http-agent.mjs +313 -29
  180. package/src/runtime/shared/llm/model-catalog-projection.mjs +3 -2
  181. package/src/runtime/shared/llm/model-catalog.mjs +46 -6
  182. package/src/runtime/shared/llm/provider-catalog-registry.mjs +3 -0
  183. package/src/runtime/shared/llm/system-proxy.mjs +452 -0
  184. package/src/runtime/shared/provider-accounts.mjs +52 -2
  185. package/src/runtime/shared/staged-install-worker.mjs +5 -0
  186. package/src/runtime/shared/staged-update.mjs +47 -2
  187. package/src/runtime/shared/tool-surface.mjs +110 -36
  188. package/src/runtime/shared/tool-work-units.mjs +4 -0
  189. package/src/runtime/shared/turn-worktree-snapshot.mjs +414 -54
  190. package/src/runtime/shared/worktrees/activity-gate.mjs +215 -318
  191. package/src/runtime/shared/worktrees/activity-ledger-worker.mjs +56 -0
  192. package/src/runtime/shared/worktrees/activity-ledger.mjs +391 -0
  193. package/src/runtime/shared/worktrees/branch-management.mjs +9 -3
  194. package/src/runtime/shared/worktrees/git.mjs +57 -0
  195. package/src/runtime/shared/worktrees/manager.mjs +205 -137
  196. package/src/runtime/tidy/install.mjs +95 -15
  197. package/src/runtime/tidy/languages.mjs +17 -15
  198. package/src/runtime/tidy/process.mjs +7 -4
  199. package/src/runtime/tidy/resolve.mjs +19 -16
  200. package/src/runtime/tidy/runners/biome.mjs +3 -3
  201. package/src/runtime/tidy/tool.mjs +1 -1
  202. package/src/runtime/tidy/worktree.mjs +10 -6
  203. package/src/runtime/visualize-bridge/client.mjs +4 -1
  204. package/src/runtime/visualize-bridge/tool-defs.mjs +7 -2
  205. package/src/runtime/web-search/index.mjs +1 -1
  206. package/src/session-runtime/agent-task-sessions.mjs +410 -353
  207. package/src/session-runtime/boot/tools.mjs +2 -0
  208. package/src/session-runtime/bot-status.mjs +103 -103
  209. package/src/session-runtime/connector-merge-migration.mjs +18 -15
  210. package/src/session-runtime/conversation-import/discovery.mjs +159 -40
  211. package/src/session-runtime/conversation-import/service.mjs +9 -3
  212. package/src/session-runtime/handoff-attachments.mjs +1 -1
  213. package/src/session-runtime/held-requests.mjs +3 -1
  214. package/src/session-runtime/internal-tool-executor/feature-tools.mjs +2 -0
  215. package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +8 -0
  216. package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +143 -116
  217. package/src/session-runtime/lifecycle/teardown/session-close.mjs +6 -1
  218. package/src/session-runtime/lifecycle/teardown.mjs +1 -1
  219. package/src/session-runtime/mcp-glue/server-catalog.mjs +16 -10
  220. package/src/session-runtime/mcp-glue/server-input.mjs +4 -1
  221. package/src/session-runtime/mixy-heartbeat.mjs +1 -1
  222. package/src/session-runtime/provider-auth/login.mjs +2 -2
  223. package/src/session-runtime/resource-mcp-api.mjs +98 -35
  224. package/src/session-runtime/resource-mcp-connector-accounts.mjs +44 -31
  225. package/src/session-runtime/resource-mcp-secrets.mjs +28 -11
  226. package/src/session-runtime/resource-mcp-servers.mjs +5 -4
  227. package/src/session-runtime/services/agent-tool/send-flow.mjs +10 -2
  228. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +8 -3
  229. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +4 -1
  230. package/src/session-runtime/services/agent-watchdog-registry.mjs +32 -4
  231. package/src/session-runtime/services/channel-worker/daemon-spawn.mjs +2 -0
  232. package/src/session-runtime/services/daemon-candidate.mjs +4 -1
  233. package/src/session-runtime/services/memory-runtime-proxy/daemon-spawn.mjs +4 -0
  234. package/src/session-runtime/services/plugin-admin.mjs +10 -6
  235. package/src/session-runtime/services/provider-admin.mjs +281 -10
  236. package/src/session-runtime/session-turn-api.mjs +2 -0
  237. package/src/session-runtime/settings-builtin-tools-api.mjs +4 -1
  238. package/src/session-runtime/settings-system-api.mjs +1 -1
  239. package/src/session-runtime/setup-tool/agent-settings-actions.mjs +13 -3
  240. package/src/session-runtime/setup-tool/connector-widen-approval.mjs +96 -0
  241. package/src/session-runtime/setup-tool/executor.mjs +6 -2
  242. package/src/session-runtime/setup-tool/tool-defs.mjs +2 -1
  243. package/src/session-runtime/turn/agent-ops.mjs +23 -0
  244. package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +49 -11
  245. package/src/session-runtime/workflow-agents-api/agent-route.mjs +10 -1
  246. package/src/session-runtime/workspace/activity-guards.mjs +176 -0
  247. package/src/session-runtime/workspace/session-view.mjs +149 -0
  248. package/src/session-runtime/workspace/side-checkouts.mjs +203 -0
  249. package/src/session-runtime/workspace/transition-runner.mjs +188 -0
  250. package/src/session-runtime/workspace/transitions.mjs +108 -1066
  251. package/src/session-runtime/workspace/workspace-merge.mjs +132 -0
  252. package/src/session-runtime/workspace/worktree-intents.mjs +242 -0
  253. package/src/session-runtime/workspace/worktree-maintenance.mjs +80 -0
  254. package/src/session-runtime/workspace/worktree-setup.mjs +85 -0
  255. package/src/session-runtime/workspace/worktree-tool.mjs +54 -54
  256. package/src/standalone/daemon-desktop-runtime.mjs +2 -0
  257. package/src/standalone/daemon-session-control.mjs +151 -136
  258. package/src/standalone/daemon.mjs +7 -0
  259. package/src/standalone/desktop-service-registry.mjs +9 -0
  260. package/src/standalone/local-session-runtime.mjs +5 -1
  261. package/src/standalone/session-client/daemon-unavailable.mjs +3 -0
  262. package/src/standalone/session-client.mjs +5 -1
  263. package/src/standalone/session-frame-stream.mjs +83 -11
  264. package/src/standalone/session-protocol.mjs +4 -0
  265. package/src/standalone/session-service/agent-tree.mjs +45 -9
  266. package/src/standalone/session-service/projection/transcript-window.mjs +700 -64
  267. package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
  268. package/src/standalone/session-service/stored-reader.mjs +127 -40
  269. package/src/tui/App.jsx +154 -164
  270. package/src/tui/app/app-view/floating-panel.jsx +3 -0
  271. package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
  272. package/src/tui/app/clipboard.mjs +21 -10
  273. package/src/tui/app/prompt-handlers/use-prompt-history-nav.mjs +1 -1
  274. package/src/tui/app/prompt-handlers/use-prompt-interrupt.mjs +3 -0
  275. package/src/tui/app/prompt-submit/provider-prompts.mjs +3 -1
  276. package/src/tui/app/provider-setup/api-key-actions.mjs +31 -1
  277. package/src/tui/app/provider-setup/oauth-actions.mjs +25 -6
  278. package/src/tui/app/provider-setup-picker.mjs +20 -13
  279. package/src/tui/app/shell-layout/row-budgets.mjs +12 -10
  280. package/src/tui/app/slash-commands.mjs +1 -0
  281. package/src/tui/app/slash-dispatch/session-commands.mjs +46 -0
  282. package/src/tui/app/slash-dispatch.mjs +1 -1
  283. package/src/tui/app/use-btw-panel.mjs +29 -0
  284. package/src/tui/app/use-context-panel-refresh.mjs +31 -0
  285. package/src/tui/app/use-model-catalog-cache.mjs +13 -10
  286. package/src/tui/app/use-mouse-input.mjs +11 -0
  287. package/src/tui/app/use-onboarding-start.mjs +8 -3
  288. package/src/tui/app/use-panel-transition.mjs +10 -1
  289. package/src/tui/app/use-pasted-buffers.mjs +28 -20
  290. package/src/tui/app/use-prompt-draft-flow.mjs +7 -0
  291. package/src/tui/app/use-prompt-layout-rows.mjs +3 -3
  292. package/src/tui/app/use-prompt-queue-history.mjs +3 -2
  293. package/src/tui/app/use-selection-focus.mjs +11 -2
  294. package/src/tui/app/use-selection-geometry.mjs +18 -9
  295. package/src/tui/app/use-selection-paint.mjs +4 -4
  296. package/src/tui/app/use-selection-stitch.mjs +3 -3
  297. package/src/tui/app/use-slash-palette.mjs +62 -0
  298. package/src/tui/app/use-terminal-chrome.mjs +2 -2
  299. package/src/tui/app/use-transcript-activity.mjs +47 -32
  300. package/src/tui/app/use-transcript-follow.mjs +12 -4
  301. package/src/tui/app/use-transcript-scroll.mjs +46 -17
  302. package/src/tui/app/use-transcript-swap-reset.mjs +27 -0
  303. package/src/tui/app/use-transcript-window/geometry.mjs +19 -5
  304. package/src/tui/app/use-transcript-window/instance-state.mjs +4 -0
  305. package/src/tui/app/use-transcript-window/selection-shift.mjs +5 -1
  306. package/src/tui/app/use-transcript-window.mjs +21 -11
  307. package/src/tui/app/use-tui-ready.mjs +18 -0
  308. package/src/tui/app/use-welcome-prompt-hint.mjs +5 -0
  309. package/src/tui/app/use-workflow-tab-cycle.mjs +5 -3
  310. package/src/tui/components/Picker.jsx +27 -3
  311. package/src/tui/components/SignInUrl.jsx +68 -0
  312. package/src/tui/components/TextEntryPanel.jsx +76 -46
  313. package/src/tui/components/sign-in-url-layout.mjs +24 -0
  314. package/src/tui/dist/index.mjs +1896 -1341
  315. package/src/tui/session/goal-turn-state.mjs +6 -2
  316. package/src/tui/session/session-api/controls.mjs +4 -0
  317. package/src/tui/session/session-api/extensions.mjs +8 -0
  318. package/src/tui/session/session-api/intake/abort.mjs +2 -1
  319. package/src/tui/session/session-api/intake.mjs +2 -0
  320. package/src/tui/session/session-api/integrations.mjs +2 -2
  321. package/src/tui/session/session-api/routes-agent-definitions.mjs +1 -0
  322. package/src/tui/session/session-api/settings.mjs +2 -2
  323. package/src/tui/session/transcript-spill/spill-writer.mjs +15 -0
  324. package/src/tui/session/transcript-spill.mjs +92 -4
  325. package/src/tui/session/transcript-store.mjs +2 -0
  326. package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
@@ -1,203 +1,111 @@
1
1
  # Skill design
2
2
 
3
- Use this reference after deciding that the requested outcome belongs in a
4
- skill.
3
+ ## One owner
5
4
 
6
- ## Start from behavior
5
+ Before writing, name the result the skill makes more reliable, the decisions
6
+ the agent misses without it, the evidence that proves completion, the failures
7
+ that need recovery, and the nearby request it must leave alone.
7
8
 
8
- Define the behavior before naming files:
9
+ Extend an existing skill that owns the outcome; create a new one only for a
10
+ distinct trigger, workflow and verification. Avoid skills that redirect to
11
+ other skills, several skills competing for one request, one skill covering a
12
+ whole technology, and product features written as prose.
9
13
 
10
- - What recurring result should become more reliable?
11
- - Which decisions does the agent currently miss?
12
- - What evidence proves completion?
13
- - Which failures need recovery rather than a hard stop?
14
- - Which adjacent task must remain outside this skill?
15
-
16
- A skill earns its context cost by supplying judgement or procedure that changes
17
- results. Generic encouragement and tool documentation do not qualify.
18
-
19
- ## Pick one owner
20
-
21
- Prefer extending an existing skill when it already owns the outcome. Create a
22
- new skill when it has a distinct trigger, workflow, and verification boundary.
23
-
24
- Avoid:
25
-
26
- - umbrella skills that merely redirect to narrower skills;
27
- - several skills competing for the same user intent;
28
- - one skill that attempts to cover an entire profession or technology family;
29
- - product features represented as prose because implementing code is harder.
30
-
31
- ## Choose where it lives
32
-
33
- | Scope | Use when |
34
- |---|---|
35
- | Machine-global | The user wants the workflow available across Projects |
36
- | Plugin | The workflow depends on and ships with an extension |
37
- | Built-in | The workflow is broadly useful, stable, and inexpensive to expose |
38
-
39
- A workflow specific to one repository may be better owned by project
40
- documentation than by a machine-global skill.
14
+ System instructions and tool schemas outrank a skill: it explains when and how
15
+ to use tools, never redefines their arguments or permissions.
41
16
 
42
17
  ## Frontmatter
43
18
 
44
- Required:
19
+ - `name`: lowercase letters, digits and hyphens, no leading, trailing or
20
+ repeated hyphen, at most 64 characters, equal to the folder name.
21
+ - `description`: one plain capability sentence for the UI, at most 100
22
+ characters. The model never sees it.
23
+ - `when_to_use`: the trigger (Listing line below).
24
+ - `dependencies.tools`: tools loaded with the skill. `type: tool` takes an
25
+ exact tool name, `type: mcp` a connected server's name. A missing or
26
+ disabled tool is reported, never installed or enabled, and nothing grants
27
+ permissions. Leave optional tools out.
45
28
 
46
- - `name`: lowercase letters, digits, and hyphens; no edge or repeated hyphen;
47
- at most 64 characters; identical to the parent directory.
48
- - `description`: one sentence naming the capability.
29
+ ```yaml
30
+ dependencies:
31
+ tools:
32
+ - type: tool
33
+ value: office
34
+ ```
49
35
 
50
- Recommended:
36
+ - `metadata.requires`: a Mixdog built-in feature the skill cannot work without.
51
37
 
52
- - `when_to_use`: the trigger line — phrases and situations that should select
53
- the skill, then the boundary against the nearest neighbour.
54
-
55
- Optional portable fields include `license`, `compatibility`, `metadata`, and
56
- `allowed-tools`. A parsed field is not automatically an implemented feature.
57
- Confirm runtime support before assigning it operational meaning.
58
-
59
- Declare mandatory tools in `dependencies.tools`, either in `SKILL.md`
60
- frontmatter or an imported `agents/openai.yaml`:
61
-
62
- ```yaml
63
- dependencies:
64
- tools:
65
- - type: tool
66
- value: office
67
- - type: mcp
68
- value: existing-server
69
- ```
70
-
71
- `mcp` resolves the available tools of an already connected server. Missing,
72
- disabled, and policy-blocked tools are reported, never installed or enabled.
73
-
74
- The skill editor keeps tool-link overrides in Mixdog's data directory so
75
- updating a downloaded skill does not erase local links or rewrite its source.
76
- An empty override disconnects all tools; restoring the declaration removes
77
- the override. Changing the instruction text still requires an editable skill.
38
+ Other fields have no effect in Mixdog.
78
39
 
79
40
  ## Listing line
80
41
 
81
- The model never sees the body until it calls `Skill()`. Selection happens on
82
- one listing line per skill:
42
+ The model sees one line per skill and loads the body only by calling `Skill`:
83
43
 
84
44
  ```text
85
45
  - <name>: <when_to_use> [tools: <linked tool names>]
86
46
  ```
87
47
 
88
- The runtime cuts the trigger at 100 characters on a word boundary, and when
89
- many skills share the listing budget it shrinks every trigger evenly toward
90
- 60; text past the cut never routes the skill. The tool suffix comes from effective dependencies, not
91
- handwritten trigger text; `mcp:<server>` denotes a server's tools. Keep these
92
- three responsibilities separate:
93
-
94
- | Field | Job | Budget | Write | Avoid |
95
- |---|---|---|---|---|
96
- | `description` | UI-only summary | ≤ 100 chars | One plain capability sentence | Operating rules or selection conditions found nowhere else |
97
- | `when_to_use` | When to load the skill | ≤ 100 chars, core in the first 60 | English descriptions of user intents across languages, implicit situations, then `not …` naming the neighbouring owner | How to use it — procedures, rules, constraints, commands, tool arguments; translated keyword lists |
98
- | Body | Loaded operating instructions | As needed | Capability, prerequisites, procedure, constraints, recovery, and verification | Depending on UI copy to supply an instruction |
48
+ The trigger is cut at 100 characters on a word boundary, and shrinks evenly
49
+ toward 60 when many skills share the listing; text past the cut never selects
50
+ the skill. The tool suffix comes from `dependencies`, never from the trigger.
99
51
 
100
- Put the strongest trigger first in `when_to_use`. A boundary is worth writing
101
- only when a neighbouring skill or plain tool could plausibly win the request.
52
+ | Field | Job | Write | Avoid |
53
+ |---|---|---|---|
54
+ | `when_to_use` | When to load the skill; core in the first 60 characters | The user intents and situations, strongest first, in English for every language, then `not …` naming the nearest other owner | How to do it: steps, rules, commands, tool arguments; translated keyword lists |
55
+ | Body | Everything after selection | Capability, prerequisites, procedure, recovery, verification | Relying on the trigger or the UI description for an instruction |
102
56
 
103
- Example:
57
+ Never summarise the procedure in the trigger: a model that reads a workflow
58
+ there may follow it instead of loading the body. Add the `not …` boundary only
59
+ when a nearby skill or a plain tool could plausibly win the request.
104
60
 
105
61
  ```yaml
106
- description: Deploy Mixdog to the installed app, VPS, or a live release.
107
- when_to_use: 'Deploy, redeploy, or update the installed app, VPS, or a live release; not builds or tests alone.'
62
+ when_to_use: 'Deploy or update the installed app or a live release; not builds or tests alone.'
108
63
  ```
109
64
 
110
65
  ## Body
111
66
 
112
- The body loads once, after selection, so it owns everything the listing line
113
- left out. Use only the sections the workflow needs, in this order:
67
+ Only the sections the workflow needs, in this order:
114
68
 
115
- 1. **Intro** — two or three sentences: what the skill produces, what it does
116
- not do, and the key dependency stance.
69
+ 1. **Intro** — two or three sentences: what it produces and what it does not.
117
70
  2. **Boundary or mode selection** — the decision that picks a path or hands
118
71
  the request to another owner.
119
- 3. **Prerequisites** — exact tools, features, environment, and approvals.
72
+ 3. **Prerequisites** — exact tools, environment and approvals.
120
73
  4. **Procedure** — numbered steps; each important step ends with the
121
- observable result that proves it is done, and an irreversible step names
122
- the user checkpoint before it.
74
+ observable result that proves it, and an irreversible step names the user
75
+ checkpoint before it.
123
76
  5. **Pitfalls** — observed failures and their recovery, not generic caution.
124
77
  6. **Verification** — the check that proves the outcome.
125
- 7. **Resource links** — each `references/` or `scripts/` file with the
126
- condition for reading or running it.
78
+ 7. **Resource links** — each file with the condition for reading or running it.
127
79
 
128
- Write in the imperative. Explain why a rule exists when the reason changes
129
- behaviour; drop rules the model already follows without being told.
80
+ Write in the imperative; give a reason only when it changes behaviour, and drop
81
+ rules the model already follows. About 100 lines for a simple workflow, about
82
+ 200 for a complex one, never over 500. Split by loading condition, not by
83
+ length.
130
84
 
131
- Size: about 100 lines for a simple workflow, about 200 for a complex one, and
132
- below 500 in every case. Split content because it has a different loading
133
- condition, not simply because the file became long.
85
+ ## Resources
134
86
 
135
- ## Bundled resources
136
-
137
- ### References
138
-
139
- Put detailed rules or domain material in `references/`. Link each file directly
140
- from `SKILL.md` and state the condition for reading it. Do not create chains in
141
- which one reference points the agent to another.
142
-
143
- ### Scripts
144
-
145
- Use `scripts/` for deterministic repeated work. Every executable should:
146
-
147
- - validate inputs before side effects;
148
- - operate on explicit paths;
149
- - bound time, memory, retries, and output;
150
- - return actionable errors and a non-zero failure status;
151
- - avoid hidden network, installation, deletion, or credential behavior;
152
- - work on every claimed platform or declare the limitation;
153
- - have a behavioral test separate from the prose.
154
-
155
- Reference executable paths through `${MIXDOG_SKILL_DIR}` so installation
156
- location does not matter.
157
-
158
- ### Assets
159
-
160
- Use `assets/` for templates and static material consumed by outputs. Guidance
161
- belongs in Markdown, not in files that the agent will not load as instructions.
162
-
163
- ## Portability audit
164
-
165
- Inspect prose and scripts for:
166
-
167
- - POSIX-only commands or paths on Windows;
168
- - Windows-only shell syntax on other platforms;
169
- - machine-specific absolute paths;
170
- - undeclared external programs and environment variables;
171
- - assumptions about a vendor CLI, model, or authentication state;
172
- - output paths that overwrite user files by default.
173
-
174
- Prefer portable implementation first. Restrict compatibility only when the
175
- dependency cannot reasonably be removed.
176
-
177
- ## Editing discipline
178
-
179
- - Preserve identity and public behavior unless change is requested.
180
- - Replace outdated guidance instead of appending exceptions.
181
- - Keep safety and recovery behavior during simplification.
182
- - Do not duplicate a rule across the body, reference, script help, and tool
183
- schema; choose the component that owns it.
184
- - End with a pass that removes instructions that did not influence outcomes.
87
+ - `references/` — detailed rules read only in some cases. Link each directly
88
+ from `SKILL.md` with its read condition; no file points to another.
89
+ - `scripts/` — deterministic work that would otherwise be redone each time.
90
+ Validate inputs before side effects, use explicit paths, bound time, output
91
+ and retries, fail with an actionable message and a non-zero status, and do
92
+ no hidden network, installs, deletion or credential access. Give it a
93
+ behavioural test, and call it through `${MIXDOG_SKILL_DIR}`.
94
+ - `assets/` — templates and static material the output uses; guidance stays
95
+ in Markdown.
185
96
 
186
97
  ## Audit checklist
187
98
 
188
- Apply to every skill when asked to audit, review, or tidy the skill set.
189
-
190
99
  | Check | Failure looks like | Fix |
191
100
  |---|---|---|
192
- | Field separation | UI `description` over 100 chars, `when_to_use` over 100, or operating details present only in metadata | Keep the UI summary short, selection conditions in the trigger, and all execution details in the body |
193
- | Trigger presence | `when_to_use` empty while a neighbour competes | Add the phrases users actually write and the `not …` boundary |
194
- | Trigger content | `when_to_use` says how rather than when: rules, constraints, commands, tool names or arguments | Move them to the body; keep the request situations and the `not …` boundary |
195
- | Body order | Sections out of the order above, a `When to use` section in the body, steps without a completion result | Reorder; delete body triggers (they never route); add the observable result |
196
- | Resources | A referenced file missing, a chain of references, a script without an input check | Fix the path, flatten the chain, add validation |
197
- | Duplication | The same rule in the body, a reference, and a script help text | Keep it in the owner; delete the copies |
198
- | Staleness | Paths, tools, or flags that no longer exist | Replace or remove; never leave an instruction that cannot succeed |
199
-
200
- Run `scripts/validate-skill.mjs` on each directory; it reports the listing-line,
201
- code-fence, and resource checks mechanically, and the rest is a read of the body against
202
- this reference.
203
-
101
+ | Fields | `description` or `when_to_use` over 100 characters; an instruction found only in metadata | Short UI summary, selection in the trigger, execution in the body |
102
+ | Trigger | Empty while a neighbour competes; says how instead of when | The phrases users write plus the `not …` boundary; move the how to the body |
103
+ | Body | Out of order, a "when to use" section, steps without a result | Reorder, delete body triggers, add the observable result |
104
+ | Resources | A missing file, a chain of references, a script without input checks | Fix the path, flatten, validate inputs |
105
+ | Side effects | External programs, network, secrets or irreversible steps (commit, deploy, publish, restart) not visible or not waiting for the user | Name them in prerequisites; checkpoint before the step |
106
+ | Duplication | One rule in the body, a reference and a script's help | Keep it in its owner, delete the copies |
107
+ | Staleness | Paths, tools or flags that no longer exist | Replace or remove |
108
+ | Value | A rule or section that no scenario needed | Delete it |
109
+
110
+ The validator checks fields, fences and resource paths; the rest is a read
111
+ against this table.
@@ -1,111 +1,52 @@
1
1
  # Evaluating a skill
2
2
 
3
- Use this reference after a draft exists or when a current skill has a reported
4
- defect.
3
+ Use after a draft exists or when a skill misbehaves. A passing validator
4
+ proves structure only, never behaviour.
5
5
 
6
- ## Separate the questions
6
+ ## Scenarios
7
7
 
8
- A complete evaluation asks:
8
+ Two to five realistic requests, with the context a real user would give:
9
9
 
10
- | Area | Question |
11
- |---|---|
12
- | Selection | Does the description attract relevant requests and reject close alternatives? |
13
- | Execution | Does the loaded workflow produce the required outcome? |
14
- | Integration | Do resources, paths, tools, and feature gates resolve? |
15
- | Recovery | Do failures remain bounded and actionable? |
16
- | Efficiency | Does the skill remove repeated work without adding ritual? |
17
-
18
- Passing a frontmatter check proves none of the execution questions.
19
-
20
- ## Scenario set
21
-
22
- Use two to five realistic requests:
23
-
24
- 1. a normal request that names the intent;
10
+ 1. a request that names the intent;
25
11
  2. an implicit request that should still select the skill;
26
- 3. an important edge or failure condition;
27
- 4. a close negative request owned elsewhere;
28
- 5. a subjective artifact case when human judgement matters.
12
+ 3. an edge or failure condition that matters;
13
+ 4. a near-miss negative: shares the skill's words but belongs to another
14
+ owner;
15
+ 5. a subjective artifact, when taste or domain judgement decides.
29
16
 
30
- Do not use “load this skill” as a positive test. Include concrete context, files,
31
- or constraints that a real user would provide.
32
-
33
- An optional record shape:
34
-
35
- ```json
36
- {
37
- "id": "short-purpose",
38
- "prompt": "Realistic user request",
39
- "expected_owner": "skill-name or none",
40
- "observable_result": "What must become true",
41
- "inputs": []
42
- }
43
- ```
44
-
45
- Keep evaluation artifacts outside the distributable directory unless the
46
- packaging process explicitly excludes them.
17
+ Never use "load this skill" as a positive case. Keep scenario files outside
18
+ the skill's folder.
47
19
 
48
20
  ## Baseline
49
21
 
50
- Before improving a skill, preserve its exact prior behavior through existing
51
- version history or a read-only evaluation snapshot. Compare identical prompts,
52
- inputs, model class, tool availability, and environment.
53
-
54
- For a new skill, compare against no skill only when the runner can isolate the
55
- draft from the baseline. Otherwise report a smoke test rather than implying a
56
- controlled A/B result.
57
-
58
- The evaluation harness must remain uniform. Do not add task-specific routing,
59
- timeouts, prompt clues, retries, or scoring exceptions to make one version win.
22
+ Before changing a skill, keep a copy of the prior version and run the same
23
+ prompts, inputs, model and tools against both. A new skill with no runnable
24
+ baseline gets a smoke test, not a claimed comparison. Keep the harness the
25
+ same for both: no task-specific hints, retries, timeouts or scoring
26
+ exceptions.
60
27
 
61
28
  ## Evidence
62
29
 
63
- Use deterministic checks for mechanical outcomes:
64
-
65
- - required files exist and open;
66
- - structured fields and values are valid;
67
- - references resolve;
68
- - malformed input fails with useful guidance;
69
- - resource and retry limits hold;
70
- - an irreversible action waits for approval;
71
- - prohibited side effects do not occur.
72
-
73
- Do not test exact prose, source strings, internal algorithms, or snapshots whose
74
- expected behavior has intentionally changed.
75
-
76
- Use user review for clarity, visual quality, writing taste, and domain
77
- judgement. Present the full-size persisted output rather than a description of
78
- it.
30
+ - Mechanical outcomes get deterministic checks: files exist and open, fields
31
+ are valid, references resolve, bad input fails with useful guidance, an
32
+ irreversible step waits for approval, no forbidden side effect happens.
33
+ - Never assert exact prose or internal steps.
34
+ - Clarity, taste and domain judgement go to the user, shown the real output.
79
35
 
80
36
  ## Diagnose before revising
81
37
 
82
- Classify a failure:
83
-
84
- - **selection** — description signal or neighboring boundary;
85
- - **instruction** — missing decision, sequence, or completion evidence;
86
- - **resource** — broken script, reference, asset, or path;
87
- - **integration** — unavailable tool, feature, dependency, or platform;
88
- - **harness** — invalid comparison or test infrastructure;
89
- - **underlying capability** — the tool or product cannot deliver the outcome.
90
-
91
- Edit the component that owns the failure. More prompt text does not repair a
92
- broken tool, and body changes cannot fix a description that never selects the
93
- skill.
38
+ | Class | Where the fix goes |
39
+ |---|---|
40
+ | Selection | Trigger or the neighbour's boundary |
41
+ | Instruction | A missing decision, step order or completion result in the body |
42
+ | Resource | The broken script, reference, asset or path |
43
+ | Integration | The unavailable tool, feature or dependency |
44
+ | Harness | The test setup, not the skill |
45
+ | Capability | The tool or product; the skill cannot deliver it |
94
46
 
95
47
  ## Improve without sediment
96
48
 
97
- After each revision:
98
-
99
- 1. rerun affected scenarios;
100
- 2. validate structure and resource paths;
101
- 3. retain safety, recovery, and bounded execution;
102
- 4. remove rules superseded by the fix;
103
- 5. check whether the change generalizes beyond the failing example.
104
-
105
- Look for tests that always pass, high variance, repeated helper work, excessive
106
- token or time cost, and rules that change no outcome. Those are signals to
107
- improve the evaluation or simplify the skill.
108
-
109
- Stop when required behavior passes, subjective review is accepted, and further
110
- edits no longer produce meaningful gains.
111
-
49
+ After each revision, rerun the affected scenarios, validate, keep safety and
50
+ recovery, delete the rules the fix superseded, and check that the fix is not
51
+ tailored to one example. Stop when the required behaviour passes, the user
52
+ accepts the subjective parts, and further edits stop paying off.
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: test-suite
3
+ description: Write, run, diagnose, prune and audit a project's tests without overloading the machine.
4
+ when_to_use: 'Write, fix, run, diagnose, prune or audit tests, flaky failures, suite health; not live UI checks.'
5
+ dependencies:
6
+ tools:
7
+ - type: tool
8
+ value: read
9
+ - type: tool
10
+ value: shell
11
+ ---
12
+
13
+ # Test suite
14
+
15
+ Owns how tests in any project are written, run during a change, diagnosed when
16
+ they fail intermittently, pruned and audited. The project's own
17
+ commands, lanes and conventions win over every default here; this skill
18
+ supplies the judgement and procedure around them. Driving a running app or
19
+ device by hand is outside it.
20
+
21
+ ## Pick the mode
22
+
23
+ | Request | Mode |
24
+ |---|---|
25
+ | Add a test, fix a bug test-first | Write |
26
+ | Check a change while editing | Run |
27
+ | A test fails sometimes, only in a full run, only in CI, only on this machine | Diagnose |
28
+ | Duplicate, dead, obsolete or worthless tests | Prune |
29
+ | Review the suite's health or a whole area | Audit |
30
+
31
+ ## Prerequisites: find the project's own way
32
+
33
+ Before the first run, look for the project's focused test command in this
34
+ order, and stop at the first source that gives it plus any constraint that
35
+ affects the change (lane, setup, needed service): `AGENTS.md` or `CLAUDE.md`,
36
+ `docs/testing*`, `CONTRIBUTING*`, package scripts (`package.json`, `Makefile`,
37
+ `pyproject.toml`, `Cargo.toml`), then CI workflows. Do not survey every
38
+ manifest or CI lane. Result: one focused command, copied from the project,
39
+ never invented; a broader command only when the change is broad. When nothing
40
+ is documented, fall back to the
41
+ runner's own selection: `node --test <file>`, `vitest run <file>`,
42
+ `jest <file>`, `pytest <file>::<test>`, `go test -run <Name> ./<pkg>`,
43
+ `cargo test <name>`.
44
+
45
+ ## Machine rules
46
+
47
+ Tests run on the user's working machine. These hold in every mode.
48
+
49
+ - The Verification section of your system rules owns the evidence budget,
50
+ reruns, fix attempts, heavy runs and stopping what you started; follow it.
51
+ - Never loop a test to "reproduce" flakiness here, and never shard in
52
+ parallel locally; repetition belongs to CI history.
53
+ - Confirm by PID or command line that detached processes you started are gone.
54
+
55
+ ## Write
56
+
57
+ What a change gets:
58
+
59
+ | Change | New tests |
60
+ |---|---|
61
+ | Bug fix | One regression test for the reported behaviour |
62
+ | New behaviour | One per observable behaviour the requirement names (its success and its stated rejections) |
63
+ | Refactor, rename, move | None; the existing tests must still pass unchanged |
64
+ | Removal | None; delete the removed behaviour's tests, never assert the absence |
65
+ | Docs, copy, style, config values | None |
66
+
67
+ Only a test owning a lasting contract joins the suite and its CI lane.
68
+ Reproductions, probes and one-off checks are scratch: they live in a temp
69
+ directory outside the repository, are never committed, and are deleted when
70
+ the task ends. A scratch reproduction that proves a bug becomes the
71
+ regression test above or is deleted, never both kept.
72
+
73
+ 1. Name the behaviour and its owner: the one contract this test owns, beside
74
+ the code it exercises. If a test already owns it, extend that test
75
+ (`references/suite-design.md`). Result: one file and test name chosen.
76
+ 2. Name the production change that would make the test fail; if you cannot,
77
+ redesign it around an observable behaviour (`references/suite-design.md`).
78
+ Write the test through the user's interface (caller, CLI,
79
+ HTTP, rendered output) with the expected value from the requirement, not
80
+ from running the code. For a new regression test, show it failing first:
81
+ the failure names the missing behaviour. An existing failing test already
82
+ counts as that evidence.
83
+ 3. Apply `references/reliability.md` for any time, process, port, file,
84
+ environment, locale or platform dependency. Result: no fixed sleep, no
85
+ fixed port, no unrestored global, no host-locale assumption.
86
+ 4. Make it pass with the smallest change, then rerun the same file. Result:
87
+ a new regression test's fail-before and pass-after pair goes into the
88
+ report. Add no further
89
+ tests unless the user asks.
90
+ 5. Put it in the lane its duration and needs call for (`suite-design.md`).
91
+
92
+ ## Run
93
+
94
+ 1. Run the covering file(s) only. Result: the selected count matches the files
95
+ you meant.
96
+ 2. On failure read the full log before editing; do not rerun to see if it
97
+ passes.
98
+ 3. Run a broader lane once after the last edit only if the change touches a
99
+ shared contract or an integration point; otherwise stop at the covering
100
+ file. Reuse an earlier pass only when no later edit touched the code it
101
+ checks.
102
+ 4. After two evidence-backed fix attempts, report what was tried and the log.
103
+
104
+ ## Diagnose
105
+
106
+ An intermittent failure is a defect in the test or the product, never noise
107
+ (`references/flaky-policy.md`).
108
+
109
+ 1. Collect evidence without reruns: the failing assertion, the full log, what
110
+ else was running, the OS and locale. Result: the failing line and the
111
+ condition it waited on.
112
+ 2. Classify the cause with the table in `references/reliability.md`. Result:
113
+ one named cause with the line that assumes it.
114
+ 3. Propose the fix: in the test, or in the product when real users can hit
115
+ the same race. A longer timeout, a retry or a skip is not a fix.
116
+
117
+ Diagnose ends at a report: cause, evidence, proposed fix. Only when the user
118
+ asked for a fix, apply it and prove it with the focused file plus a
119
+ deterministic trigger of the cause (a held promise, a fake clock, a localized
120
+ fixture), not by looping. It never becomes an open-ended fix loop. Never
121
+ skip or disable a failing test; when the fix cannot land now, report it and
122
+ leave that decision to the user. Only a capability skip (a platform or tool
123
+ the test needs is absent) is allowed, and its reason names that capability.
124
+
125
+ ## Prune
126
+
127
+ First tell redundant coverage from removing a supported behaviour, and keep
128
+ distinct observable success, rejection, error and compatibility cases.
129
+ Removing a behaviour with its tests needs evidence independent of those tests
130
+ (current requirements, real callers, a specification); a test existing only
131
+ for a branch, or a fallback and test justifying each other, is no evidence,
132
+ and unresolved intent blocks deletion.
133
+
134
+ - Delete a test only when it is dominated (same branch and result as a
135
+ stronger test), tautological (cannot fail), a permutation crossing no new
136
+ branch, or verification theater (verifier and producer share one failure
137
+ domain). Name the test that still owns the contract.
138
+ - Deleting a contract test needs the user's approval.
139
+ - Same contract owned twice → merge the unique cases into the owner at the
140
+ user's interface.
141
+ - Asserts that something was removed, restates a constant, copies production
142
+ logic or source text into the test, or pins internals no user observes →
143
+ delete it, or rewrite it at the interface when a real contract is behind it.
144
+ - Passes only alone → Diagnose; never mark it serial to hide it.
145
+
146
+ Prune as you go: a change that touches a test file applies these rules to that
147
+ file only. A whole-suite sweep is an Audit the user asked for.
148
+
149
+ Result: each removal names the owning test that still covers the contract, or
150
+ states that the contract is gone.
151
+
152
+ ## Audit
153
+
154
+ 1. Run `node ${MIXDOG_SKILL_DIR}/scripts/inventory.mjs <project-root>`
155
+ (`--json` for data). Result: per-area counts, lanes, languages, risk
156
+ markers, and defect skips for JS/TS, Python, Go and Rust.
157
+ 2. Read `references/case-management.md` and rank findings by impact: defect
158
+ skips, risky markers in the fast lane, duplicate owners.
159
+ 3. Report one table (area, finding, count, proposed action) and wait for the
160
+ user's choice of batches. Audit ends at this report; fix only the batches
161
+ the user picks, one or two at a time, each verified by its covering files.
162
+
163
+ ## Pitfalls
164
+
165
+ - Parsing localized tool output (a console in another language, a busy host
166
+ dropping rows) passed on the author's machine and failed elsewhere. Query a
167
+ structured source.
168
+ - Fixed sleeps passed alone and failed in bulk when other work ran.
169
+ - A load generator or server started by an agent was detached, outlived the
170
+ agent and froze the machine. Nothing detached survives a report.
171
+ - Render tests passed while the real screen hid a row: assert the rendered
172
+ output, not the inputs.
173
+ - Full lanes that take many minutes fail under load; selection, not more
174
+ retries, fixes that.
175
+
176
+ ## Verification
177
+
178
+ - Write/fix: the focused file passes; a new regression test also failed
179
+ before, and the report quotes both.
180
+ - Diagnose: the named cause and its evidence. Only when the user asked for a
181
+ fix: the deterministic trigger and its passing run.
182
+ - Every mode: no process you started is still running.
183
+
184
+ ## Resources
185
+
186
+ - `references/reliability.md` — read when a test touches time, processes,
187
+ ports, files, environment, locale or the platform, or when diagnosing.
188
+ - `references/flaky-policy.md` — read when a failure is intermittent.
189
+ - `references/suite-design.md` — read when writing a test, choosing its lane
190
+ or file, or reviewing how a suite is organized.
191
+ - `references/case-management.md` — read for Audit, or when adding a new
192
+ area.
193
+ - `scripts/inventory.mjs` — run for Audit; read-only, bounded, Markdown or
194
+ `--json`.