@ouro.bot/cli 0.1.0-alpha.1469 → 0.1.0-alpha.1470

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 (567) hide show
  1. package/README.md +1 -1
  2. package/changelog.json +6 -2
  3. package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
  4. package/deploy/unraid/sanctuary.xml +1 -1
  5. package/desk.lock.json +8 -0
  6. package/dist/heart/identity.js +27 -1
  7. package/dist/mind/desk-section.js +33 -43
  8. package/dist/repertoire/desk-mcp.js +140 -0
  9. package/dist/repertoire/mcp-manager.js +22 -0
  10. package/dist/repertoire/mcp-tools.js +11 -7
  11. package/npm-shrinkwrap.json +2 -2
  12. package/package.json +4 -1
  13. package/vendor/desk/.claude-plugin/plugin.json +35 -0
  14. package/vendor/desk/.mcp.claude-codex.json +28 -0
  15. package/vendor/desk/.mcp.copilot.json +16 -0
  16. package/vendor/desk/.ouro-desk.json +6 -0
  17. package/vendor/desk/CHANGELOG.md +7004 -0
  18. package/vendor/desk/README.md +195 -0
  19. package/vendor/desk/activation/README.md +98 -0
  20. package/vendor/desk/activation/copilot-root.flattened-bundle.json +38 -0
  21. package/vendor/desk/activation/desk.activation.json +251 -0
  22. package/vendor/desk/activation/host-capability-evidence.md +46 -0
  23. package/vendor/desk/activation/support-matrix.json +84 -0
  24. package/vendor/desk/agency.json +20 -0
  25. package/vendor/desk/agents/observer.agent.md +26 -0
  26. package/vendor/desk/agents/observer.md +29 -0
  27. package/vendor/desk/agents/worker.agent.md +32 -0
  28. package/vendor/desk/agents/worker.md +40 -0
  29. package/vendor/desk/artifacts/tombstones/tombstone.schema.json +53 -0
  30. package/vendor/desk/artifacts/tombstones/tombstones.jsonl +1 -0
  31. package/vendor/desk/changelog.d/README.md +12 -0
  32. package/vendor/desk/docs/agent-files.md +104 -0
  33. package/vendor/desk/docs/agentic-engineering-v2-rfc.md +206 -0
  34. package/vendor/desk/docs/agentic-engineering-v3-rfc.md +109 -0
  35. package/vendor/desk/docs/browser-remote-desktops.md +69 -0
  36. package/vendor/desk/docs/dependency-activation-stories-and-criteria.md +500 -0
  37. package/vendor/desk/docs/evaluation-packet.md +363 -0
  38. package/vendor/desk/docs/factory-local-capture.md +651 -0
  39. package/vendor/desk/docs/factory-store-playbook.md +927 -0
  40. package/vendor/desk/docs/images/factory-site.png +0 -0
  41. package/vendor/desk/docs/issue-drains.md +79 -0
  42. package/vendor/desk/docs/lfs-inspection.md +55 -0
  43. package/vendor/desk/docs/preview-diagnostics.md +11 -0
  44. package/vendor/desk/docs/relays.md +88 -0
  45. package/vendor/desk/docs/schedules.md +69 -0
  46. package/vendor/desk/docs/search-recovery.md +22 -0
  47. package/vendor/desk/docs/session-labels.md +157 -0
  48. package/vendor/desk/docs/session-retention.md +125 -0
  49. package/vendor/desk/docs/sessions.md +17 -0
  50. package/vendor/desk/docs/stalled-nudges.md +54 -0
  51. package/vendor/desk/docs/webhooks.md +80 -0
  52. package/vendor/desk/docs/workspace-tidy.md +74 -0
  53. package/vendor/desk/hooks/boot-checks.cjs +7 -0
  54. package/vendor/desk/hooks/claude-session-start.cjs +123 -0
  55. package/vendor/desk/hooks/compatible-node.cjs +97 -0
  56. package/vendor/desk/hooks/copilot-boot-prompt.cjs +69 -0
  57. package/vendor/desk/hooks/copilot-durable-files.cjs +8 -0
  58. package/vendor/desk/hooks/copilot-hooks.json +61 -0
  59. package/vendor/desk/hooks/copilot-intake-context.cjs +5 -0
  60. package/vendor/desk/hooks/copilot-lane-model.cjs +8 -0
  61. package/vendor/desk/hooks/copilot-session-start.cjs +264 -0
  62. package/vendor/desk/hooks/copilot-skill-current.cjs +28 -0
  63. package/vendor/desk/hooks/factory-end.cjs +5 -0
  64. package/vendor/desk/hooks/factory-start.cjs +27 -0
  65. package/vendor/desk/hooks/hooks.json +40 -0
  66. package/vendor/desk/hooks/lib/boot-checks.cjs +643 -0
  67. package/vendor/desk/hooks/lib/child-agent.cjs +14 -0
  68. package/vendor/desk/hooks/lib/copilot-intake-context.cjs +73 -0
  69. package/vendor/desk/hooks/lib/current-release.cjs +162 -0
  70. package/vendor/desk/hooks/lib/delivery-stop.cjs +326 -0
  71. package/vendor/desk/hooks/lib/detach-worker.cjs +43 -0
  72. package/vendor/desk/hooks/lib/durable-files.cjs +102 -0
  73. package/vendor/desk/hooks/lib/factory-end.cjs +327 -0
  74. package/vendor/desk/hooks/lib/lane-model.cjs +82 -0
  75. package/vendor/desk/hooks/lib/node-required.cjs +56 -0
  76. package/vendor/desk/hooks/lib/orca-session-title.cjs +60 -0
  77. package/vendor/desk/hooks/lib/session-end.cjs +30 -0
  78. package/vendor/desk/hooks/lib/sync-end.cjs +89 -0
  79. package/vendor/desk/hooks/loop-start.cjs +105 -0
  80. package/vendor/desk/hooks/node-missing.sh +78 -0
  81. package/vendor/desk/hooks/orca-session-title.cjs +8 -0
  82. package/vendor/desk/hooks/session-end.cjs +8 -0
  83. package/vendor/desk/mcp/README.md +269 -0
  84. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  85. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  86. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  87. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  88. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  89. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  90. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  91. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  92. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  93. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  94. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  95. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  96. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  97. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  98. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  99. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/support-matrix.json +72 -0
  100. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  101. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  102. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  103. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  104. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  105. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  106. package/vendor/desk/mcp/artifacts/runtime-deps/README.md +25 -0
  107. package/vendor/desk/mcp/bootstrap.cjs +761 -0
  108. package/vendor/desk/mcp/docs/private-feedback.md +13 -0
  109. package/vendor/desk/mcp/idle-proxy.cjs +423 -0
  110. package/vendor/desk/mcp/index.js +813 -0
  111. package/vendor/desk/mcp/package-lock.json +3717 -0
  112. package/vendor/desk/mcp/package.json +44 -0
  113. package/vendor/desk/mcp/scripts/agency-desk-channel.js +7 -0
  114. package/vendor/desk/mcp/scripts/build-runtime-deps-pack.js +5 -0
  115. package/vendor/desk/mcp/scripts/crew.js +89 -0
  116. package/vendor/desk/mcp/scripts/drains-launcher.mjs +329 -0
  117. package/vendor/desk/mcp/scripts/drains.js +5 -0
  118. package/vendor/desk/mcp/scripts/factory.js +657 -0
  119. package/vendor/desk/mcp/scripts/file-desk-problem.js +9 -0
  120. package/vendor/desk/mcp/scripts/finish-commit.js +7 -0
  121. package/vendor/desk/mcp/scripts/lfs.js +37 -0
  122. package/vendor/desk/mcp/scripts/local-recovery.js +363 -0
  123. package/vendor/desk/mcp/scripts/migrations.js +11 -0
  124. package/vendor/desk/mcp/scripts/private-view.js +177 -0
  125. package/vendor/desk/mcp/scripts/resolve-desk-root.js +106 -0
  126. package/vendor/desk/mcp/scripts/session-boot.js +22 -0
  127. package/vendor/desk/mcp/scripts/session-retention.js +5 -0
  128. package/vendor/desk/mcp/scripts/session-sync.js +10 -0
  129. package/vendor/desk/mcp/scripts/sessions.js +5 -0
  130. package/vendor/desk/mcp/scripts/sync-push.js +13 -0
  131. package/vendor/desk/mcp/scripts/tidy-status.js +8 -0
  132. package/vendor/desk/mcp/scripts/verify-runtime-deps-pack.js +5 -0
  133. package/vendor/desk/mcp/src/actions/desk-read.actions.mts +73 -0
  134. package/vendor/desk/mcp/src/actions/desk-session.actions.mts +42 -0
  135. package/vendor/desk/mcp/src/actions/desk-web.actions.mts +52 -0
  136. package/vendor/desk/mcp/src/actions/desk.actions.mts +5 -0
  137. package/vendor/desk/mcp/src/actions/generated/desk/OuroActions.swift +649 -0
  138. package/vendor/desk/mcp/src/actions/generated/desk/OuroActionsReins.swift +61 -0
  139. package/vendor/desk/mcp/src/actions/generated/desk/actions.json +280 -0
  140. package/vendor/desk/mcp/src/actions/generated/desk/commands.json +145 -0
  141. package/vendor/desk/mcp/src/actions/generated/desk/mcp.json +256 -0
  142. package/vendor/desk/mcp/src/actions/generated/desk/web.ts +59 -0
  143. package/vendor/desk/mcp/src/actions/generated/desk/webmcp.json +250 -0
  144. package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActions.swift +241 -0
  145. package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActionsReins.swift +25 -0
  146. package/vendor/desk/mcp/src/actions/generated/desk-web/actions.json +73 -0
  147. package/vendor/desk/mcp/src/actions/generated/desk-web/commands.json +53 -0
  148. package/vendor/desk/mcp/src/actions/generated/desk-web/mcp.json +83 -0
  149. package/vendor/desk/mcp/src/actions/generated/desk-web/web.ts +47 -0
  150. package/vendor/desk/mcp/src/actions/generated/desk-web/webmcp.json +81 -0
  151. package/vendor/desk/mcp/src/actions/served.js +5 -0
  152. package/vendor/desk/mcp/src/activation/admit.js +77 -0
  153. package/vendor/desk/mcp/src/activation/failures.js +65 -0
  154. package/vendor/desk/mcp/src/activation/readiness-policy.js +102 -0
  155. package/vendor/desk/mcp/src/activation/schema.js +17 -0
  156. package/vendor/desk/mcp/src/activation/superpowers-context.js +265 -0
  157. package/vendor/desk/mcp/src/activation/validate.js +540 -0
  158. package/vendor/desk/mcp/src/artifacts/tombstones.js +61 -0
  159. package/vendor/desk/mcp/src/crew/initiative.js +287 -0
  160. package/vendor/desk/mcp/src/crew/workspace.js +1259 -0
  161. package/vendor/desk/mcp/src/db/init.js +75 -0
  162. package/vendor/desk/mcp/src/db/schema.sql +83 -0
  163. package/vendor/desk/mcp/src/desk/active-tasks.js +408 -0
  164. package/vendor/desk/mcp/src/desk/card-commit-guard.js +281 -0
  165. package/vendor/desk/mcp/src/desk/cleanup-index.js +53 -0
  166. package/vendor/desk/mcp/src/desk/content-home.js +246 -0
  167. package/vendor/desk/mcp/src/desk/crew-config.js +102 -0
  168. package/vendor/desk/mcp/src/desk/crew-member.js +196 -0
  169. package/vendor/desk/mcp/src/desk/crew-roster.js +151 -0
  170. package/vendor/desk/mcp/src/desk/frontmatter-lite.js +228 -0
  171. package/vendor/desk/mcp/src/desk/gh-logins.js +109 -0
  172. package/vendor/desk/mcp/src/desk/handles.js +123 -0
  173. package/vendor/desk/mcp/src/desk/handoff-reference.js +35 -0
  174. package/vendor/desk/mcp/src/desk/improvement-authority.js +3 -0
  175. package/vendor/desk/mcp/src/desk/improvement-cards.js +704 -0
  176. package/vendor/desk/mcp/src/desk/improvement-person.js +51 -0
  177. package/vendor/desk/mcp/src/desk/lifecycle.js +16 -0
  178. package/vendor/desk/mcp/src/desk/machine-desks.js +119 -0
  179. package/vendor/desk/mcp/src/desk/naming.js +333 -0
  180. package/vendor/desk/mcp/src/desk/organization.js +592 -0
  181. package/vendor/desk/mcp/src/desk/resources.js +274 -0
  182. package/vendor/desk/mcp/src/desk/runtime-resolver.js +30 -0
  183. package/vendor/desk/mcp/src/desk/scratch-paths.js +44 -0
  184. package/vendor/desk/mcp/src/desk/step-delivery.js +140 -0
  185. package/vendor/desk/mcp/src/desk/steps.js +263 -0
  186. package/vendor/desk/mcp/src/desk/tidy.js +930 -0
  187. package/vendor/desk/mcp/src/desk/unsigned-deliveries.js +359 -0
  188. package/vendor/desk/mcp/src/factory/agent-types.js +45 -0
  189. package/vendor/desk/mcp/src/factory/andon-watch.js +109 -0
  190. package/vendor/desk/mcp/src/factory/binding.js +612 -0
  191. package/vendor/desk/mcp/src/factory/boot-check.js +645 -0
  192. package/vendor/desk/mcp/src/factory/capture-classify.js +158 -0
  193. package/vendor/desk/mcp/src/factory/capture-count.js +183 -0
  194. package/vendor/desk/mcp/src/factory/capture-flush.js +268 -0
  195. package/vendor/desk/mcp/src/factory/capture-publish.js +141 -0
  196. package/vendor/desk/mcp/src/factory/capture-schema.js +193 -0
  197. package/vendor/desk/mcp/src/factory/capture-sweep.js +239 -0
  198. package/vendor/desk/mcp/src/factory/catch-point.js +60 -0
  199. package/vendor/desk/mcp/src/factory/commit-resolve.js +94 -0
  200. package/vendor/desk/mcp/src/factory/consent-answer.js +37 -0
  201. package/vendor/desk/mcp/src/factory/context-capability.js +15 -0
  202. package/vendor/desk/mcp/src/factory/context-outbox.js +885 -0
  203. package/vendor/desk/mcp/src/factory/context-run.js +386 -0
  204. package/vendor/desk/mcp/src/factory/context-schema.js +249 -0
  205. package/vendor/desk/mcp/src/factory/copilot-turn-index.js +93 -0
  206. package/vendor/desk/mcp/src/factory/copilot-usage.js +148 -0
  207. package/vendor/desk/mcp/src/factory/credential.js +45 -0
  208. package/vendor/desk/mcp/src/factory/derive-claude.js +960 -0
  209. package/vendor/desk/mcp/src/factory/derive-codex.js +734 -0
  210. package/vendor/desk/mcp/src/factory/derive-common.js +279 -0
  211. package/vendor/desk/mcp/src/factory/derive-copilot.js +1057 -0
  212. package/vendor/desk/mcp/src/factory/derive-run.js +807 -0
  213. package/vendor/desk/mcp/src/factory/desk-problem-file.js +310 -0
  214. package/vendor/desk/mcp/src/factory/desk-problem-fingerprint.js +70 -0
  215. package/vendor/desk/mcp/src/factory/desk-problem-known.js +246 -0
  216. package/vendor/desk/mcp/src/factory/desk-problem-template.js +107 -0
  217. package/vendor/desk/mcp/src/factory/desk-repo.js +1223 -0
  218. package/vendor/desk/mcp/src/factory/desk-task-line.js +28 -0
  219. package/vendor/desk/mcp/src/factory/desk-visibility.js +48 -0
  220. package/vendor/desk/mcp/src/factory/end-hook.js +14 -0
  221. package/vendor/desk/mcp/src/factory/evaluate-kick.js +164 -0
  222. package/vendor/desk/mcp/src/factory/evaluate-run.js +678 -0
  223. package/vendor/desk/mcp/src/factory/evaluator-step.js +484 -0
  224. package/vendor/desk/mcp/src/factory/filer-launch.js +79 -0
  225. package/vendor/desk/mcp/src/factory/flush-health.js +26 -0
  226. package/vendor/desk/mcp/src/factory/flush.js +1758 -0
  227. package/vendor/desk/mcp/src/factory/focus.js +326 -0
  228. package/vendor/desk/mcp/src/factory/headless-flag.cjs +32 -0
  229. package/vendor/desk/mcp/src/factory/headless-flag.js +25 -0
  230. package/vendor/desk/mcp/src/factory/headless-ledger.js +743 -0
  231. package/vendor/desk/mcp/src/factory/headless.js +567 -0
  232. package/vendor/desk/mcp/src/factory/held-route.js +93 -0
  233. package/vendor/desk/mcp/src/factory/host-flags.js +36 -0
  234. package/vendor/desk/mcp/src/factory/improvement-verify.js +429 -0
  235. package/vendor/desk/mcp/src/factory/kaizen-file.js +231 -0
  236. package/vendor/desk/mcp/src/factory/label-binding.js +90 -0
  237. package/vendor/desk/mcp/src/factory/label-schema.js +426 -0
  238. package/vendor/desk/mcp/src/factory/local-status.js +368 -0
  239. package/vendor/desk/mcp/src/factory/loop-conditions.js +121 -0
  240. package/vendor/desk/mcp/src/factory/loop-health.js +500 -0
  241. package/vendor/desk/mcp/src/factory/loop-slot.js +90 -0
  242. package/vendor/desk/mcp/src/factory/loop-status.js +100 -0
  243. package/vendor/desk/mcp/src/factory/loop-switch.cjs +14 -0
  244. package/vendor/desk/mcp/src/factory/loop-worker-state.js +96 -0
  245. package/vendor/desk/mcp/src/factory/loop-worker.js +290 -0
  246. package/vendor/desk/mcp/src/factory/marker.js +61 -0
  247. package/vendor/desk/mcp/src/factory/mirror-step.js +145 -0
  248. package/vendor/desk/mcp/src/factory/os-protect.js +243 -0
  249. package/vendor/desk/mcp/src/factory/outbox.js +2231 -0
  250. package/vendor/desk/mcp/src/factory/outcome.js +431 -0
  251. package/vendor/desk/mcp/src/factory/pipeline/andon.js +319 -0
  252. package/vendor/desk/mcp/src/factory/pipeline/attention-rollup.js +158 -0
  253. package/vendor/desk/mcp/src/factory/pipeline/attention.js +146 -0
  254. package/vendor/desk/mcp/src/factory/pipeline/build.js +299 -0
  255. package/vendor/desk/mcp/src/factory/pipeline/compare.js +148 -0
  256. package/vendor/desk/mcp/src/factory/pipeline/formulas.js +652 -0
  257. package/vendor/desk/mcp/src/factory/pipeline/kaizen.js +387 -0
  258. package/vendor/desk/mcp/src/factory/pipeline/lifecycle-clocks.js +345 -0
  259. package/vendor/desk/mcp/src/factory/pipeline/normalize.js +73 -0
  260. package/vendor/desk/mcp/src/factory/pipeline/number-states.js +154 -0
  261. package/vendor/desk/mcp/src/factory/pipeline/outcomes.js +268 -0
  262. package/vendor/desk/mcp/src/factory/pipeline/report.js +737 -0
  263. package/vendor/desk/mcp/src/factory/pipeline/rollups.js +883 -0
  264. package/vendor/desk/mcp/src/factory/pipeline/stretches.js +523 -0
  265. package/vendor/desk/mcp/src/factory/pipeline/timeline.js +199 -0
  266. package/vendor/desk/mcp/src/factory/pipeline/validate-pr.js +238 -0
  267. package/vendor/desk/mcp/src/factory/pipeline/versions.js +42 -0
  268. package/vendor/desk/mcp/src/factory/pipeline/walk.js +1177 -0
  269. package/vendor/desk/mcp/src/factory/plugin-registry.js +72 -0
  270. package/vendor/desk/mcp/src/factory/plugin-sources.cjs +249 -0
  271. package/vendor/desk/mcp/src/factory/pr-green.js +77 -0
  272. package/vendor/desk/mcp/src/factory/process-lock.js +142 -0
  273. package/vendor/desk/mcp/src/factory/proof-session.js +75 -0
  274. package/vendor/desk/mcp/src/factory/publish.js +637 -0
  275. package/vendor/desk/mcp/src/factory/published-schema.js +648 -0
  276. package/vendor/desk/mcp/src/factory/reconcile-reasons.js +22 -0
  277. package/vendor/desk/mcp/src/factory/reconcile-step.js +251 -0
  278. package/vendor/desk/mcp/src/factory/reconcile.js +808 -0
  279. package/vendor/desk/mcp/src/factory/release-version.js +134 -0
  280. package/vendor/desk/mcp/src/factory/repo-name.js +13 -0
  281. package/vendor/desk/mcp/src/factory/retention.js +60 -0
  282. package/vendor/desk/mcp/src/factory/route-desk.js +40 -0
  283. package/vendor/desk/mcp/src/factory/route-issues.js +251 -0
  284. package/vendor/desk/mcp/src/factory/route-local.js +264 -0
  285. package/vendor/desk/mcp/src/factory/schema.js +957 -0
  286. package/vendor/desk/mcp/src/factory/session-kind.js +16 -0
  287. package/vendor/desk/mcp/src/factory/session-lifetime.js +56 -0
  288. package/vendor/desk/mcp/src/factory/session-route.js +183 -0
  289. package/vendor/desk/mcp/src/factory/shell-git.js +500 -0
  290. package/vendor/desk/mcp/src/factory/store-issues.js +143 -0
  291. package/vendor/desk/mcp/src/factory/store-route.js +208 -0
  292. package/vendor/desk/mcp/src/factory/test-state-guard.js +103 -0
  293. package/vendor/desk/mcp/src/factory/time.js +36 -0
  294. package/vendor/desk/mcp/src/factory/tool-issue-file.js +84 -0
  295. package/vendor/desk/mcp/src/factory/tool-kinds.js +87 -0
  296. package/vendor/desk/mcp/src/factory/triage-schema.js +233 -0
  297. package/vendor/desk/mcp/src/factory/windows-acl.js +679 -0
  298. package/vendor/desk/mcp/src/indexer/chunk.js +232 -0
  299. package/vendor/desk/mcp/src/indexer/discover.js +434 -0
  300. package/vendor/desk/mcp/src/indexer/exclusions.js +247 -0
  301. package/vendor/desk/mcp/src/indexer/index.js +167 -0
  302. package/vendor/desk/mcp/src/indexer/refs.js +0 -0
  303. package/vendor/desk/mcp/src/indexer/text-hash.js +18 -0
  304. package/vendor/desk/mcp/src/lib/ouro-actions/actions.claims.json +75 -0
  305. package/vendor/desk/mcp/src/lib/ouro-actions/dist-manifest.json +70 -0
  306. package/vendor/desk/mcp/src/lib/ouro-actions/ouro-actions.mts +1416 -0
  307. package/vendor/desk/mcp/src/lib/ouro-ui/LICENSE +21 -0
  308. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-claims.ts +190 -0
  309. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-command.ts +1020 -0
  310. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/checks.ts +343 -0
  311. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/cli.ts +240 -0
  312. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/component.ts +430 -0
  313. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/dev-commands.ts +204 -0
  314. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/doctor.ts +126 -0
  315. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/effects.ts +68 -0
  316. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/exit-codes.ts +75 -0
  317. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/help.ts +220 -0
  318. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/mcp.ts +268 -0
  319. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/outcome.ts +265 -0
  320. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/output.ts +67 -0
  321. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/precise-copy.ts +235 -0
  322. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/problem.ts +124 -0
  323. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.kit.mts +8 -0
  324. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.ts +568 -0
  325. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/terminal.ts +245 -0
  326. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/voice.ts +136 -0
  327. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/wait.ts +226 -0
  328. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/work-event.ts +181 -0
  329. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.kit.mts +18 -0
  330. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.ts +2072 -0
  331. package/vendor/desk/mcp/src/package-metadata.js +20 -0
  332. package/vendor/desk/mcp/src/protected/legacy-ledger.js +55 -0
  333. package/vendor/desk/mcp/src/readiness/leftovers.js +75 -0
  334. package/vendor/desk/mcp/src/readiness/process-start.js +149 -0
  335. package/vendor/desk/mcp/src/runtime/admission-worker.js +194 -0
  336. package/vendor/desk/mcp/src/runtime/admission.js +177 -0
  337. package/vendor/desk/mcp/src/runtime/agency-desk-channel.js +342 -0
  338. package/vendor/desk/mcp/src/runtime/agents-md.js +62 -0
  339. package/vendor/desk/mcp/src/runtime/append-lane.js +68 -0
  340. package/vendor/desk/mcp/src/runtime/argv-safe-reason.js +55 -0
  341. package/vendor/desk/mcp/src/runtime/boot-dependencies.js +75 -0
  342. package/vendor/desk/mcp/src/runtime/boot-text.js +504 -0
  343. package/vendor/desk/mcp/src/runtime/boot.js +1677 -0
  344. package/vendor/desk/mcp/src/runtime/bootstrap.js +1455 -0
  345. package/vendor/desk/mcp/src/runtime/chunked-import.js +102 -0
  346. package/vendor/desk/mcp/src/runtime/copilot-commit-trailer.js +133 -0
  347. package/vendor/desk/mcp/src/runtime/copilot-session.js +155 -0
  348. package/vendor/desk/mcp/src/runtime/deliver.js +469 -0
  349. package/vendor/desk/mcp/src/runtime/desk-channel.js +86 -0
  350. package/vendor/desk/mcp/src/runtime/desk-failure.js +26 -0
  351. package/vendor/desk/mcp/src/runtime/desk-health.js +168 -0
  352. package/vendor/desk/mcp/src/runtime/desk-session.js +1451 -0
  353. package/vendor/desk/mcp/src/runtime/diagnostic-server.js +72 -0
  354. package/vendor/desk/mcp/src/runtime/diagnostics.js +241 -0
  355. package/vendor/desk/mcp/src/runtime/drains-cli.js +187 -0
  356. package/vendor/desk/mcp/src/runtime/drains.js +781 -0
  357. package/vendor/desk/mcp/src/runtime/elsewhere-note.js +9 -0
  358. package/vendor/desk/mcp/src/runtime/failure-evidence.js +21 -0
  359. package/vendor/desk/mcp/src/runtime/fast-refs.js +209 -0
  360. package/vendor/desk/mcp/src/runtime/filer-throttle.js +66 -0
  361. package/vendor/desk/mcp/src/runtime/focused-card.js +147 -0
  362. package/vendor/desk/mcp/src/runtime/front-door.js +204 -0
  363. package/vendor/desk/mcp/src/runtime/gate-wait.js +2 -0
  364. package/vendor/desk/mcp/src/runtime/git-inspection.js +201 -0
  365. package/vendor/desk/mcp/src/runtime/git-read-worker.js +157 -0
  366. package/vendor/desk/mcp/src/runtime/health.js +50 -0
  367. package/vendor/desk/mcp/src/runtime/hooks.js +353 -0
  368. package/vendor/desk/mcp/src/runtime/hosted.js +163 -0
  369. package/vendor/desk/mcp/src/runtime/inbox.js +102 -0
  370. package/vendor/desk/mcp/src/runtime/index-drift.js +118 -0
  371. package/vendor/desk/mcp/src/runtime/last-start.js +133 -0
  372. package/vendor/desk/mcp/src/runtime/lesson-section.js +92 -0
  373. package/vendor/desk/mcp/src/runtime/lessons-shelf.js +100 -0
  374. package/vendor/desk/mcp/src/runtime/lfs.js +319 -0
  375. package/vendor/desk/mcp/src/runtime/native-path.js +12 -0
  376. package/vendor/desk/mcp/src/runtime/newest-release.js +197 -0
  377. package/vendor/desk/mcp/src/runtime/node-selection.js +233 -0
  378. package/vendor/desk/mcp/src/runtime/orca-session-title.js +225 -0
  379. package/vendor/desk/mcp/src/runtime/other-sessions.js +183 -0
  380. package/vendor/desk/mcp/src/runtime/pending-migrations.js +653 -0
  381. package/vendor/desk/mcp/src/runtime/plugin-update.js +215 -0
  382. package/vendor/desk/mcp/src/runtime/pluginless-runtimes.js +34 -0
  383. package/vendor/desk/mcp/src/runtime/pr-publication.js +226 -0
  384. package/vendor/desk/mcp/src/runtime/preview-snapshot.js +23 -0
  385. package/vendor/desk/mcp/src/runtime/publication-mode.js +19 -0
  386. package/vendor/desk/mcp/src/runtime/relays.js +974 -0
  387. package/vendor/desk/mcp/src/runtime/release-alert.js +148 -0
  388. package/vendor/desk/mcp/src/runtime/remote-identity.js +140 -0
  389. package/vendor/desk/mcp/src/runtime/resolve-here.js +4 -0
  390. package/vendor/desk/mcp/src/runtime/runtime-deps-cli.js +65 -0
  391. package/vendor/desk/mcp/src/runtime/runtime-deps.js +1109 -0
  392. package/vendor/desk/mcp/src/runtime/runtime-identity.js +22 -0
  393. package/vendor/desk/mcp/src/runtime/runtime-swap.js +101 -0
  394. package/vendor/desk/mcp/src/runtime/schedules.js +235 -0
  395. package/vendor/desk/mcp/src/runtime/session-activity.js +190 -0
  396. package/vendor/desk/mcp/src/runtime/session-label.js +30 -0
  397. package/vendor/desk/mcp/src/runtime/session-retention.js +662 -0
  398. package/vendor/desk/mcp/src/runtime/session-sync.js +333 -0
  399. package/vendor/desk/mcp/src/runtime/session-trailer.js +126 -0
  400. package/vendor/desk/mcp/src/runtime/sessions-cli.js +301 -0
  401. package/vendor/desk/mcp/src/runtime/signoff-listed.js +81 -0
  402. package/vendor/desk/mcp/src/runtime/skills.js +76 -0
  403. package/vendor/desk/mcp/src/runtime/stale-card-lead.js +52 -0
  404. package/vendor/desk/mcp/src/runtime/stale-desk-refresh.js +198 -0
  405. package/vendor/desk/mcp/src/runtime/stale-desk.js +219 -0
  406. package/vendor/desk/mcp/src/runtime/stalled.js +255 -0
  407. package/vendor/desk/mcp/src/runtime/standing-authority.js +79 -0
  408. package/vendor/desk/mcp/src/runtime/startup-boot.js +341 -0
  409. package/vendor/desk/mcp/src/runtime/startup-resolve.js +140 -0
  410. package/vendor/desk/mcp/src/runtime/state-branch.js +203 -0
  411. package/vendor/desk/mcp/src/runtime/status-compact.js +165 -0
  412. package/vendor/desk/mcp/src/runtime/status-inspection-child.js +26 -0
  413. package/vendor/desk/mcp/src/runtime/status-inspection.js +147 -0
  414. package/vendor/desk/mcp/src/runtime/status-root.js +39 -0
  415. package/vendor/desk/mcp/src/runtime/sync-worker.js +911 -0
  416. package/vendor/desk/mcp/src/runtime/test-state-guard.js +107 -0
  417. package/vendor/desk/mcp/src/runtime/unmerged-saves.js +247 -0
  418. package/vendor/desk/mcp/src/runtime/workspace-claim.js +53 -0
  419. package/vendor/desk/mcp/src/runtime/workspace-evidence.js +96 -0
  420. package/vendor/desk/mcp/src/runtime/workspace-tidy.js +509 -0
  421. package/vendor/desk/mcp/src/search/direct-lexical.js +54 -0
  422. package/vendor/desk/mcp/src/search/embedder.js +108 -0
  423. package/vendor/desk/mcp/src/search/engine.js +406 -0
  424. package/vendor/desk/mcp/src/search/files-router.js +22 -0
  425. package/vendor/desk/mcp/src/search/old-index.js +46 -0
  426. package/vendor/desk/mcp/src/search/vectors.js +60 -0
  427. package/vendor/desk/mcp/src/server.js +389 -0
  428. package/vendor/desk/mcp/src/tool-names.js +73 -0
  429. package/vendor/desk/mcp/src/tool-refusal.cjs +35 -0
  430. package/vendor/desk/mcp/src/tool-schema-parts.js +12 -0
  431. package/vendor/desk/mcp/src/tool-schemas.js +325 -0
  432. package/vendor/desk/mcp/src/tools/_card-commit.js +148 -0
  433. package/vendor/desk/mcp/src/tools/archive-links.js +185 -0
  434. package/vendor/desk/mcp/src/tools/archive-move.js +18 -0
  435. package/vendor/desk/mcp/src/tools/archive-native-session.js +728 -0
  436. package/vendor/desk/mcp/src/tools/archive-state.js +513 -0
  437. package/vendor/desk/mcp/src/tools/delivery-gate.js +251 -0
  438. package/vendor/desk/mcp/src/tools/desk-save.js +444 -0
  439. package/vendor/desk/mcp/src/tools/doctor.js +122 -0
  440. package/vendor/desk/mcp/src/tools/done-evidence.js +260 -0
  441. package/vendor/desk/mcp/src/tools/factory-context.js +204 -0
  442. package/vendor/desk/mcp/src/tools/friction.js +332 -0
  443. package/vendor/desk/mcp/src/tools/improvement.js +156 -0
  444. package/vendor/desk/mcp/src/tools/lesson-lines.js +22 -0
  445. package/vendor/desk/mcp/src/tools/lesson-owners.js +137 -0
  446. package/vendor/desk/mcp/src/tools/lesson-team.js +169 -0
  447. package/vendor/desk/mcp/src/tools/lesson.js +254 -0
  448. package/vendor/desk/mcp/src/tools/local-only.js +151 -0
  449. package/vendor/desk/mcp/src/tools/move.js +794 -0
  450. package/vendor/desk/mcp/src/tools/native-stage-context.js +32 -0
  451. package/vendor/desk/mcp/src/tools/note.js +267 -0
  452. package/vendor/desk/mcp/src/tools/search.js +634 -0
  453. package/vendor/desk/mcp/src/tools/shared-write.js +196 -0
  454. package/vendor/desk/mcp/src/tools/sibling-desk.js +37 -0
  455. package/vendor/desk/mcp/src/tools/status.js +233 -0
  456. package/vendor/desk/mcp/src/tools/task-archive-due.js +9 -0
  457. package/vendor/desk/mcp/src/tools/task-archived-resource.js +53 -0
  458. package/vendor/desk/mcp/src/tools/task-body.js +141 -0
  459. package/vendor/desk/mcp/src/tools/task-focus.js +164 -0
  460. package/vendor/desk/mcp/src/tools/task-log.js +76 -0
  461. package/vendor/desk/mcp/src/tools/task-signoff.js +155 -0
  462. package/vendor/desk/mcp/src/tools/task.js +1768 -0
  463. package/vendor/desk/mcp/src/tools/track-row.js +89 -0
  464. package/vendor/desk/mcp/src/tools/track.js +240 -0
  465. package/vendor/desk/mcp/src/util/agency-session.cjs +29 -0
  466. package/vendor/desk/mcp/src/util/archive-links.js +105 -0
  467. package/vendor/desk/mcp/src/util/bash.js +36 -0
  468. package/vendor/desk/mcp/src/util/capture-record.js +73 -0
  469. package/vendor/desk/mcp/src/util/cas-commit.js +252 -0
  470. package/vendor/desk/mcp/src/util/created-dirs.js +71 -0
  471. package/vendor/desk/mcp/src/util/deferred-tools.js +51 -0
  472. package/vendor/desk/mcp/src/util/desk-owner.js +99 -0
  473. package/vendor/desk/mcp/src/util/env-value.js +13 -0
  474. package/vendor/desk/mcp/src/util/file-identity.js +40 -0
  475. package/vendor/desk/mcp/src/util/finish-commit.js +145 -0
  476. package/vendor/desk/mcp/src/util/fm.js +410 -0
  477. package/vendor/desk/mcp/src/util/git-config-file.js +85 -0
  478. package/vendor/desk/mcp/src/util/git-stage.js +440 -0
  479. package/vendor/desk/mcp/src/util/main-publish.js +240 -0
  480. package/vendor/desk/mcp/src/util/markdown-links.cjs +555 -0
  481. package/vendor/desk/mcp/src/util/object-input.js +59 -0
  482. package/vendor/desk/mcp/src/util/paths.js +647 -0
  483. package/vendor/desk/mcp/src/util/rank.js +189 -0
  484. package/vendor/desk/mcp/src/util/redact.js +92 -0
  485. package/vendor/desk/mcp/src/util/remove-retry.js +35 -0
  486. package/vendor/desk/mcp/src/util/rename-retry.js +73 -0
  487. package/vendor/desk/mcp/src/util/route-around.js +265 -0
  488. package/vendor/desk/mcp/src/util/shell-quote.js +18 -0
  489. package/vendor/desk/mcp/src/util/startup-direction.js +124 -0
  490. package/vendor/desk/mcp/src/util/state-ignore.js +33 -0
  491. package/vendor/desk/mcp/src/util/tool-commits.js +64 -0
  492. package/vendor/desk/mcp/src/util/unicode-16/LICENSE-MIT.txt +7 -0
  493. package/vendor/desk/mcp/src/util/unicode-16/README.md +9 -0
  494. package/vendor/desk/mcp/src/util/unicode-16/letter.cjs +1 -0
  495. package/vendor/desk/mcp/src/util/unicode-16/mark.cjs +1 -0
  496. package/vendor/desk/mcp/src/util/unicode-16/number.cjs +1 -0
  497. package/vendor/desk/mcp/web-auth.cjs +1897 -0
  498. package/vendor/desk/mcp/web-browser-discovery.cjs +53 -0
  499. package/vendor/desk/mcp/web-catalog.json +34 -0
  500. package/vendor/desk/mcp/web-launch.cjs +101 -0
  501. package/vendor/desk/mcp/web.cjs +1239 -0
  502. package/vendor/desk/migrations/01-move-to-ourostack-desk.md +188 -0
  503. package/vendor/desk/migrations/02-tidy-desk.md +87 -0
  504. package/vendor/desk/migrations/03-desk-release-channel.md +38 -0
  505. package/vendor/desk/optional/session-label/consumer.mjs +237 -0
  506. package/vendor/desk/optional/session-label/extension.mjs +32 -0
  507. package/vendor/desk/plugin.json +54 -0
  508. package/vendor/desk/settings.json +3 -0
  509. package/vendor/desk/skills/add-workspace-mcp/SKILL.md +180 -0
  510. package/vendor/desk/skills/adopt-inflight-work/SKILL.md +212 -0
  511. package/vendor/desk/skills/archive-workflow/SKILL.md +132 -0
  512. package/vendor/desk/skills/content-routing/SKILL.md +95 -0
  513. package/vendor/desk/skills/core-meeting-capture/SKILL.md +47 -0
  514. package/vendor/desk/skills/core-meeting-capture/references/capture-contract.md +175 -0
  515. package/vendor/desk/skills/curator/SKILL.md +103 -0
  516. package/vendor/desk/skills/delightful-decks/SKILL.md +67 -0
  517. package/vendor/desk/skills/desk-problem/SKILL.md +87 -0
  518. package/vendor/desk/skills/directory-structure/SKILL.md +169 -0
  519. package/vendor/desk/skills/doc-review-rigor/SKILL.md +63 -0
  520. package/vendor/desk/skills/draining-issues/SKILL.md +62 -0
  521. package/vendor/desk/skills/evaluate-release/SKILL.md +96 -0
  522. package/vendor/desk/skills/evidence-discipline/SKILL.md +150 -0
  523. package/vendor/desk/skills/factory-evaluator/SKILL.md +122 -0
  524. package/vendor/desk/skills/factory-task-context/SKILL.md +116 -0
  525. package/vendor/desk/skills/factory-work/SKILL.md +16 -0
  526. package/vendor/desk/skills/fast-honest-ci/SKILL.md +70 -0
  527. package/vendor/desk/skills/fast-honest-ci/examples.md +49 -0
  528. package/vendor/desk/skills/first-run-bootstrap/SKILL.md +95 -0
  529. package/vendor/desk/skills/friction-management/SKILL.md +98 -0
  530. package/vendor/desk/skills/git-hygiene/SKILL.md +253 -0
  531. package/vendor/desk/skills/independent-review/SKILL.md +34 -0
  532. package/vendor/desk/skills/interaction-style/SKILL.md +239 -0
  533. package/vendor/desk/skills/lesson-capture/SKILL.md +85 -0
  534. package/vendor/desk/skills/lesson-capture/agents-md-budget.mjs +61 -0
  535. package/vendor/desk/skills/online-evaluation/SKILL.md +81 -0
  536. package/vendor/desk/skills/operator-voice-comments/LICENSE-humanize +21 -0
  537. package/vendor/desk/skills/operator-voice-comments/SKILL.md +90 -0
  538. package/vendor/desk/skills/operator-voice-comments/human-voice.md +43 -0
  539. package/vendor/desk/skills/peer-pr-review/SKILL.md +104 -0
  540. package/vendor/desk/skills/pr-feedback-on-own-pr/SKILL.md +145 -0
  541. package/vendor/desk/skills/pr-review-interrogation/SKILL.md +121 -0
  542. package/vendor/desk/skills/pr-reviewer-audit/SKILL.md +68 -0
  543. package/vendor/desk/skills/pr-reviewer-audit/helpers/audit.py +335 -0
  544. package/vendor/desk/skills/pr-reviewer-audit/helpers/test_audit.py +486 -0
  545. package/vendor/desk/skills/pr-self-review/SKILL.md +86 -0
  546. package/vendor/desk/skills/pr-surface-hygiene/SKILL.md +105 -0
  547. package/vendor/desk/skills/pr-surface-hygiene/check-visual-proof.cjs +99 -0
  548. package/vendor/desk/skills/pr-surface-hygiene/repository-setup.md +19 -0
  549. package/vendor/desk/skills/pr-surface-hygiene/resources/pr-visual-proof.yml +29 -0
  550. package/vendor/desk/skills/pr-surface-hygiene/resources/pull-request-template.md +5 -0
  551. package/vendor/desk/skills/preflight-actions/SKILL.md +60 -0
  552. package/vendor/desk/skills/preview-feedback/SKILL.md +70 -0
  553. package/vendor/desk/skills/repo-handling/SKILL.md +67 -0
  554. package/vendor/desk/skills/rnd-lab/SKILL.md +52 -0
  555. package/vendor/desk/skills/runtime-symptom-investigation/SKILL.md +106 -0
  556. package/vendor/desk/skills/session-resumption/SKILL.md +126 -0
  557. package/vendor/desk/skills/session-start/SKILL.md +54 -0
  558. package/vendor/desk/skills/session-start/details.md +150 -0
  559. package/vendor/desk/skills/session-start-migrations/README.md +71 -0
  560. package/vendor/desk/skills/session-start-migrations/SKILL.md +108 -0
  561. package/vendor/desk/skills/start-task/SKILL.md +88 -0
  562. package/vendor/desk/skills/task-card-format/SKILL.md +198 -0
  563. package/vendor/desk/skills/task-lifecycle/SKILL.md +217 -0
  564. package/vendor/desk/skills/track-card-format/SKILL.md +90 -0
  565. package/vendor/desk/skills/using-desk/SKILL.md +58 -0
  566. package/vendor/desk/skills/using-superpowers-with-desk/SKILL.md +156 -0
  567. package/vendor/desk/skills/work-orchestration/SKILL.md +162 -0
@@ -0,0 +1,737 @@
1
+ import { withState } from "./number-states.js"
2
+ import { ATTENTION_METHOD } from "./attention.js"
3
+
4
+ const LABELS = Object.freeze({
5
+ active_in_lead_ms: "Active time inside the lead-time window",
6
+ queue_before_start_ms: "Queue before start",
7
+ human_wait_ms: "Human wait",
8
+ permission_wait_ms: "Permission wait",
9
+ api_retry_ms: "API retry wait",
10
+ compaction_ms: "Compaction wait time",
11
+ })
12
+
13
+ function compareText(left, right) {
14
+ return Number(left > right) - Number(left < right)
15
+ }
16
+
17
+ // The plain words for every reason a page can print. A reason with no entry
18
+ // here stops the build (`reasonText` throws), and a test walks the facts
19
+ // enums, the lists below and every reason in the built output, so a new
20
+ // reason cannot ship as a raw identifier.
21
+ const FACT_REASON_TEXT = {
22
+ host_does_not_record: "the host does not record it",
23
+ log_missing: "the session log was missing",
24
+ log_truncated: "the session log ended mid-record",
25
+ session_open: "the session was still open",
26
+ not_collected_in_slice_1: "it is not collected yet",
27
+ source_unreadable: "the source could not be read",
28
+ capped: "it was cut to a size limit",
29
+ desk_public: "the desk is public, so job timing is withheld",
30
+ field_absent: "the host's record did not include it",
31
+ host_records_partly: "the host records only some of it, so this is a lower bound",
32
+ withheld_public: "it is withheld because the store is public",
33
+ interval_outside_session_clock: "some intervals ran outside the span of the session's main log, so they are left out",
34
+ }
35
+
36
+ // Reasons only the report and the rollups name; the facts enums do not.
37
+ const REPORT_REASON_TEXT = {
38
+ worker_split: "the job owns only some workers of a session, and that session is not counted",
39
+ worker_shared: "the session's work was shared with another job",
40
+ censored: "the job was still open when this was measured",
41
+ mixed: "several different causes",
42
+ no_sessions: "no session has reported yet",
43
+ partial: "only some sessions supplied it",
44
+ open_job: "the job is not finished",
45
+ not_labeled: "the independent evaluator has not labeled it",
46
+ cancelled: "the job was cancelled",
47
+ status_unavailable: "the job's status was not recorded",
48
+ wait_fields_unavailable: "the wait records were not available",
49
+ job_offsets_unavailable: "the job clock could not be read",
50
+ zero_lead_time: "the job's lead time is zero",
51
+ over_budget_after_binning: "the swimlane file is still larger than its size budget after every run of intervals was merged, because the intervals its stretches cite do not fit",
52
+ labels_from_shared_session: "the labels come from a session several jobs share, so they may count another job's time",
53
+ finish_time_not_known: "no published record places the time the task finished, so its lead time runs to the end of its recorded work and is at least that",
54
+ card_dates_shorter_than_work: "the task card's dates are shorter than the work its sessions recorded, so the lead time is at least that recorded span",
55
+ session_work_unattributed: "a session of this task did work that no task's binding claims, so that time stays under cause not recorded and some of it may have been another task's",
56
+ // Why a partial figure's `bound` is null: no direction is known.
57
+ bound_reasons_conflict: "its reasons pull it both ways, so the true figure may be higher or lower",
58
+ bound_not_moved: "its reasons do not change this figure, so it is exact for the task's window as stated",
59
+ bound_direction_undecided: "one of its reasons has no decided direction yet, so the true figure may be higher or lower",
60
+ bound_not_one_quantity: "it is a ranking or a status, not one quantity, so it has no single direction",
61
+ no_wait_intervals: "no wait was recorded",
62
+ no_active_intervals: "no active time was recorded",
63
+ not_reported_to_store: "the store only receives published facts, so it cannot count sessions that never published any",
64
+ not_in_published_facts: "published facts do not carry it",
65
+ facts_missing: "the session's facts are missing",
66
+ no_facts: "no facts file matches the labels",
67
+ facts_ambiguous: "more than one facts file matches the labels",
68
+ // A task's finish day.
69
+ finish_from_card_update: "the day comes from the task card's last update, so the task finished on or before it",
70
+ reopened: "the task was finished more than once, so this is the day it last finished",
71
+ finish_before_last_work: "the task's recorded work went on past this day, so it may have finished later and this day may not be a bound",
72
+ job_offsets_withheld: "the desk withholds this task's timing because its remote is public",
73
+ // Why the agent stopped before a wait for the next prompt, when it is not known, and the split by why.
74
+ could_not_tell: "the evaluator read this wait's evidence and could not tell why the agent stopped",
75
+ stop_not_recorded: "no recorded wait for the operator covers this time, so there is no record of why the agent stopped, and some hosts do not record stops",
76
+ outside_own_share: "the facts do not say which part of the session was this task's, so the evaluator does not judge this wait for it",
77
+ stop_partly_classified: "why the agent stopped is not known for some of this waiting, and some of that may belong here, so this is at least this much",
78
+ // The lifecycle clocks (`lifecycle-clocks.js`), in the store's words (ourostack/factory site/src/format.js).
79
+ original_request_not_recorded: "the original request was not recorded",
80
+ work_before_card: "recorded work began before the task card",
81
+ late_work_without_reopen: "work was recorded after delivery without a recorded reopen",
82
+ episode_boundary_not_recorded: "a production episode boundary was not recorded",
83
+ episode_history_incomplete: "the recorded production episode history is incomplete",
84
+ }
85
+
86
+ // What the independent evaluator's labels file can declare unreadable, and the codes of the check of labels against facts.
87
+ const LABEL_REASON_TEXT = {
88
+ session_log_missing: "the session log was missing",
89
+ session_mismatch: "the labels name a different session",
90
+ job_unbound: "the session is not bound to the job",
91
+ range: "a labeled stretch runs past the session",
92
+ evidence_unmatched: "the labeled evidence no longer matches the facts",
93
+ // The store's meaning (ourostack/factory site/src/format.js), in this map's punctuation; the check against facts also writes it for a stop on a wait a rule already decides.
94
+ inconsistent: "the labels contradict themselves or the facts, for example stops or waste listed while those facts are marked missing, a stop judged by a newer evaluator than the labels file, or a stop on a wait a rule already decides, so they are left unused",
95
+ share_unknown: "the facts do not record which part of the session was the job's",
96
+ outside_share: "the labels cover none of the job's own part of the session",
97
+ }
98
+
99
+ // Reasons the outcome figures (sign-off, first-pass yield, rework) carry, in words for the operator who reads the page.
100
+ const OUTCOME_REASON_TEXT = {
101
+ not_recorded: "no outcome record is available",
102
+ signoff_not_recorded: "the job was delivered before sign-offs were recorded",
103
+ history_not_recorded: "the task card does not record what was sent back",
104
+ not_delivered: "the job has no standing delivery yet",
105
+ returns_not_fully_recorded: "some of what was sent back was not recorded",
106
+ awaiting_signoff: "the human has not yet accepted the delivery",
107
+ no_delivered_jobs: "no delivered job has a first-pass result yet",
108
+ no_refusals: "no refusal could be compared with the agent's reason",
109
+ no_labels: "the independent evaluator has not labeled any job",
110
+ no_finished_jobs: "no job has finished yet",
111
+ not_all_labeled: "some finished jobs are not labeled yet",
112
+ active_time_unavailable: "the active time of some jobs was not recorded",
113
+ catch_point_not_recorded: "some defect time has no recorded place where it was caught",
114
+ }
115
+
116
+ // Reasons the attention figure (human attention on a job) carries, in words for the operator. `not_recorded` already means "no outcome record" for the outcome figures, and the shared table holds one text per code, so its attention words are kept here and not in the shared table; `desk_public` has its words in the facts table.
117
+ export const ATTENTION_REASON_TEXT = Object.freeze({
118
+ not_recorded: "no session of the job recorded the human's turns",
119
+ desk_public: "the desk is public, so job timing is withheld",
120
+ no_segments: "the job's time inside its sessions was not recorded, so the turns cannot be placed on it",
121
+ turns_not_recorded: "some sessions did not record all of the human's turns, so this is a lower bound",
122
+ turns_capped: "a session's list of human turns was cut to a size limit, so this is a lower bound",
123
+ turn_not_estimable: "some turns could not be estimated, so this is a lower bound",
124
+ })
125
+ // Reasons only the store-wide attention figures carry (`attention-rollup.js`). Their words are in the shared table too, so the reasons in the built files all have text.
126
+ const ATTENTION_ROLLUP_REASON_TEXT = {
127
+ no_accepted_outcomes: "no job has an accepted outcome yet",
128
+ no_turn_records: "no session in the store records the human's turns",
129
+ decision_not_estimable: "some permission decisions could not be estimated, so this is a lower bound",
130
+ }
131
+
132
+ // On an attention line a host's own flag says which host it is, so the operator can see why the figure is a lower bound. `desk_public` and the rest keep the words of the tables above.
133
+ const ATTENTION_PAGE_REASON_TEXT = Object.freeze({
134
+ ...ATTENTION_REASON_TEXT,
135
+ ...ATTENTION_ROLLUP_REASON_TEXT,
136
+ host_does_not_record: "a host does not record the human's turns, so this is a lower bound",
137
+ host_records_partly: "a host records the human's turns only in part, so this is a lower bound",
138
+ })
139
+ const ATTENTION_SHARED_TEXT = Object.fromEntries(Object.entries(ATTENTION_REASON_TEXT).filter(([code]) => code !== "not_recorded" && code !== "desk_public"))
140
+
141
+ /** The reasons only the store-wide attention figures carry. */
142
+ export const ATTENTION_ROLLUP_REASONS = Object.freeze(Object.keys(ATTENTION_ROLLUP_REASON_TEXT))
143
+
144
+ /** The reasons the report and rollups name that are not in the facts enums. */
145
+ export const REPORT_ONLY_REASONS = Object.freeze(Object.keys(REPORT_REASON_TEXT))
146
+
147
+ /** The reasons the outcome figures carry. */
148
+ export const OUTCOME_REASONS = Object.freeze(Object.keys(OUTCOME_REASON_TEXT))
149
+
150
+ /** The reason codes of the labels files: what a label can declare unreadable and why one is left unused. */
151
+ export const LABEL_REASONS = Object.freeze(Object.keys(LABEL_REASON_TEXT))
152
+
153
+ export const REASON_TEXT = Object.freeze({ ...FACT_REASON_TEXT, ...REPORT_REASON_TEXT, ...OUTCOME_REASON_TEXT, ...LABEL_REASON_TEXT, ...ATTENTION_SHARED_TEXT, ...ATTENTION_ROLLUP_REASON_TEXT })
154
+
155
+ /** `reasonText(id) -> string`: the plain words for a reason. An id with no words is a defect and stops the build. */
156
+ export function reasonText(id) {
157
+ if (!Object.hasOwn(REASON_TEXT, id)) throw Object.assign(new Error(`Add plain text for the reason ${String(id)}: it has none`), { code: "report_add_plain_text_for_the" })
158
+ return REASON_TEXT[id]
159
+ }
160
+
161
+ export const FIELD_TEXT = Object.freeze({
162
+ tokens: "Tokens",
163
+ requests: "Model requests",
164
+ models: "Models",
165
+ turns: "Turns",
166
+ tool_durations: "Tool durations",
167
+ permission_waits: "Permission waits",
168
+ human_waits: "Human waits",
169
+ api_retries: "API retries",
170
+ commits: "Commits",
171
+ ci_runs: "CI runs",
172
+ plugins: "Plugins",
173
+ ended_at: "Session end time",
174
+ compaction_waits: "Compaction wait time",
175
+ agents: "Subagents",
176
+ prs: "Pull requests",
177
+ reasoning_tokens: "Reasoning tokens",
178
+ entrypoint: "Entrypoint",
179
+ tool_outcomes: "Tool outcomes",
180
+ job_segments: "Job time segments",
181
+ job_offsets: "Job clock offsets",
182
+ human_turns: "Human turns",
183
+ outcomes: "Task outcomes",
184
+ })
185
+
186
+ function fieldText(field) {
187
+ if (!Object.hasOwn(FIELD_TEXT, field)) throw Object.assign(new Error(`Add a plain name for the field ${String(field)}: it has none`), { code: "report_add_a_plain_name_for" })
188
+ return FIELD_TEXT[field]
189
+ }
190
+
191
+ const DEFINITIONS = "API retry counts are the errors the host surfaced: Claude surfaces only some of them, so its count is a lower bound, and Codex does not record them. Human wait is the gaps between prompts inside a session. Tool failure and retry definitions differ by host: Codex reads an output layout it does not recognise as ok, and Copilot adds denied. The number of compactions is recorded on every host; compaction wait time is recorded only where the host records it. Cost in money is not measured in v0."
192
+
193
+ const FOOTNOTE = `How to read these numbers: measured means every session that should supply a number did; partial means the number is a lower bound or covers only some sessions, and the reason follows; not recorded means there is no number, which is never zero. ${DEFINITIONS}`
194
+
195
+ function plural(count, singular, pluralForm = `${singular}s`) {
196
+ return `${count} ${count === 1 ? singular : pluralForm}`
197
+ }
198
+
199
+ function reasonsPhrase(value) {
200
+ return value.reasons.map(reasonText).join(" and ")
201
+ }
202
+
203
+ // The state a number carries, in words. A result with no known state is a
204
+ // defect upstream and stops the page; it is never read as measured.
205
+ function stateText(value, evidence = true) {
206
+ if (!["measured", "partial", "unavailable"].includes(value.state)) throw Object.assign(new Error(`Give the number a known state: ${String(value.state)} is not one`), { code: "report_give_the_number_a_known" })
207
+ if (value.state === "unavailable") return `not recorded (${reasonsPhrase(value)})`
208
+ const note = evidence && value.class !== "measured" ? [`${value.class} evidence`] : []
209
+ if (value.state === "measured") return ["measured", ...note].join(", ")
210
+ const uncovered = value.partial === true && value.uncovered_sessions > 0 ? [`${plural(value.uncovered_sessions, "session")} uncovered`] : []
211
+ return `partial: ${[reasonsPhrase(value), ...uncovered, ...note].join("; ")}`
212
+ }
213
+
214
+ // A value followed by its state, or the state alone when nothing was recorded.
215
+ function labelled(text, value, evidence = true) {
216
+ return value.state === "unavailable" ? stateText(value) : `${text} (${stateText(value, evidence)})`
217
+ }
218
+
219
+ function metric(value, suffix = " ms") {
220
+ return labelled(`${value.value}${suffix}`, value)
221
+ }
222
+
223
+ function percentage(value) {
224
+ return `${(value * 100).toFixed(2)}%`
225
+ }
226
+
227
+ function flowText(value) {
228
+ return labelled(percentage(value.value), value)
229
+ }
230
+
231
+ function concurrencyText(value) {
232
+ return labelled(value.state === "unavailable" ? "" : `maximum ${value.value.maximum}, average ${value.value.average.toFixed(2)}`, value)
233
+ }
234
+
235
+ function signalText(value, singular, pluralForm) {
236
+ return value.state === "unavailable" ? `${pluralForm} ${stateText(value)}` : `${plural(value.value, singular, pluralForm)} (${stateText(value, false)})`
237
+ }
238
+
239
+ const SETTLED_WAIT = Object.freeze({ lt_1h: "under 1 hour", lt_1d: "under 1 day", lt_7d: "under 7 days", ge_7d: "7 days or more" })
240
+ // An unfinished wait reads as its lower edge: it has lasted at least this long.
241
+ const OPEN_WAIT = Object.freeze({ lt_1h: "under 1 hour so far", lt_1d: "at least 1 hour", lt_7d: "at least 1 day", ge_7d: "at least 7 days" })
242
+
243
+ function waitedText(wait) {
244
+ return wait === null ? "" : `, waited ${SETTLED_WAIT[wait.class]}`
245
+ }
246
+
247
+ // The job page's sign-off line: what the human said about the delivery, how sure the record is, and how long it waited.
248
+ function signoffText(formula) {
249
+ if (formula.class === "unavailable") return formula.reason === "signoff_not_recorded" ? "delivered, sign-off not recorded" : "not recorded"
250
+ if (formula.value === "accepted") return `accepted${waitedText(formula.wait)}`
251
+ if (formula.value === "refused") return `refused, reason ${formula.reason}${waitedText(formula.wait)}`
252
+ if (formula.value === "delivered_unsigned") {
253
+ if (formula.wait === null) return "delivered, waiting for sign-off"
254
+ return formula.wait.class === "lt_1h" ? "delivered, waiting, under 1 hour so far" : `delivered, waiting ${OPEN_WAIT[formula.wait.class]}`
255
+ }
256
+ return formula.value === "reopened" ? "reopened after delivery" : "not delivered yet"
257
+ }
258
+
259
+ // Attention reasons are printed through the attention words, never through the shared table's `not_recorded` ("no outcome record is available"). A code the attention words do not hold (a host's own flag, `desk_public`) falls back to the shared words.
260
+ function attentionReasonsPhrase(reasons, table = ATTENTION_REASON_TEXT) {
261
+ return reasons.map((reason) => (Object.hasOwn(table, reason) ? table[reason] : reasonText(reason))).join(" and ")
262
+ }
263
+
264
+ // A duration the operator can read: seconds under a minute, minutes under an hour, hours above.
265
+ function durationText(ms) {
266
+ if (ms < 1000) return `${ms} ms`
267
+ const trim = (value) => String(Number(value.toFixed(1)))
268
+ if (ms < 60_000) return `${trim(ms / 1000)} ${ms === 1000 ? "second" : "seconds"}`
269
+ if (ms < 3_600_000) return `${trim(ms / 60_000)} ${ms === 60_000 ? "minute" : "minutes"}`
270
+ return `${trim(ms / 3_600_000)} ${ms === 3_600_000 ? "hour" : "hours"}`
271
+ }
272
+
273
+ // The job page's attention line: the estimate first, what it is, then its state.
274
+ function attentionText(formula) {
275
+ if (formula.state === "unavailable") return `not recorded (${attentionReasonsPhrase(formula.reasons)})`
276
+ const state = formula.state === "measured" ? "measured" : `partial: ${attentionReasonsPhrase(formula.reasons)}`
277
+ return `about ${durationText(formula.value)} over ${plural(formula.turns, "human turn")} (an estimate, method version ${formula.method}; ${state})`
278
+ }
279
+
280
+ const PARTIAL_YIELD = Object.freeze({ awaiting_signoff: "waiting for sign-off" })
281
+
282
+ // The job page's first-pass line: 1 when the delivery has no return that counts, 0 when it has. A 1 with the human's answer still missing is an upper bound.
283
+ function firstPassText(formula) {
284
+ const only = formula.changed_ask_only ? "; only changed asks came back" : ""
285
+ if (formula.value === 0) return `0, sent back after review (${plural(formula.returns.counting, "return")} counted)${only}`
286
+ if (formula.state === "partial") return `1, upper bound (passed so far, ${formula.reasons.map((reason) => PARTIAL_YIELD[reason]).join(", ")})${only}`
287
+ return `1, passed first time${only}`
288
+ }
289
+
290
+ function reworkText(formula) {
291
+ const { in_task: inTask, at_review: atReview, after_delivery: afterDelivery } = formula.value
292
+ const check = formula.reason_check
293
+ const bound = check.compared > 0 ? " (a lower bound)" : ""
294
+ const partial = formula.state === "partial" ? ` (partial: ${reasonsPhrase(formula)})` : ""
295
+ return `returned in the task ${inTask}, at review ${atReview}, after delivery ${afterDelivery}; reason check on refusals: compared ${check.compared}, disagree ${check.disagree}${bound}${partial}`
296
+ }
297
+
298
+ function countsText(counts, labels) {
299
+ const entries = Object.keys(labels).filter((key) => counts[key] > 0).map((key) => `${labels[key]} ${counts[key]}`)
300
+ return entries.length === 0 ? "none" : entries.join(", ")
301
+ }
302
+
303
+ function signoffSection(signoff) {
304
+ if (!signoff.recorded) return ["## Sign-off", "", "Sign-off: not recorded in any session of this store.", ""]
305
+ const reasons = Object.fromEntries(Object.keys(signoff.refusal_reasons).map((key) => [key, key]))
306
+ return [
307
+ "## Sign-off",
308
+ "",
309
+ `- Jobs with a sign-off record: ${signoff.jobs}; with no work record: ${signoff.jobs_without_work_record}. Jobs with a work record and no sign-off record: ${signoff.no_record}.`,
310
+ `- Accepted (recorded by the agent on the operator's word): ${signoff.accepted}.`,
311
+ `- Delivered, waiting for sign-off: ${signoff.delivered_unsigned}. Refused: ${signoff.refused}. Reopened: ${signoff.reopened}.`,
312
+ `- Delivered before sign-off was recorded: ${signoff.not_recorded}. Not delivered yet: ${signoff.not_delivered}.`,
313
+ `- Refusal reasons: ${countsText(signoff.refusal_reasons, reasons)}.`,
314
+ `- Waits that ended in an answer: ${countsText(signoff.waits.signed, SETTLED_WAIT)}.`,
315
+ `- Waits still open (at least this long): ${countsText(signoff.waits.unsigned, OPEN_WAIT)}.`,
316
+ "",
317
+ ]
318
+ }
319
+
320
+ function yieldSection(result) {
321
+ const left = result.excluded.length === 0 ? "none" : result.excluded.map((entry) => `${plural(entry.jobs, "job")} (${reasonText(entry.reason)})`).join(", ")
322
+ const counted = result.state === "unavailable"
323
+ ? [`- First-pass yield: not recorded (${reasonsPhrase(result)}).`]
324
+ : [yieldText(result), `- Sent back: ${result.returned}. Only changed asks came back: ${result.changed_ask_only}.`]
325
+ return ["## First-pass yield", "", ...counted, `- Left out of the count: ${left}.`, ""]
326
+ }
327
+
328
+ // `n of N`, and an upper bound while the human's answer is still missing for any counted job.
329
+ function yieldText(result) {
330
+ if (result.state === "measured") return `- First-pass yield: ${result.n} of ${result.N} delivered jobs passed first time (${percentage(result.value)}).`
331
+ // A yield is partial only while a delivered job awaits its sign-off.
332
+ return `- First-pass yield: at most ${result.n} of ${result.N} delivered jobs passed first time (upper bound ${percentage(result.value)}; ${result.awaiting_signoff} waiting for sign-off).`
333
+ }
334
+
335
+ function reworkSection(rework) {
336
+ if (rework.state === "unavailable") return ["## Rework", "", `- Rework: not recorded (${reasonsPhrase(rework)}).`, ""]
337
+ const caught = (point) => countsText(rework.returns[point], Object.fromEntries(Object.keys(rework.returns[point]).map((key) => [key, key])))
338
+ const check = rework.reason_check
339
+ const bound = check.state === "unavailable"
340
+ ? `not recorded (${reasonsPhrase(check)})`
341
+ : `compared ${check.compared}, disagree ${check.disagree}. This is a lower bound on disagreement`
342
+ return [
343
+ "## Rework",
344
+ "",
345
+ `- Jobs with returns recorded: ${rework.n} of ${rework.N}${rework.state === "partial" ? ` (partial: ${reasonsPhrase(rework)})` : ""}.`,
346
+ `- Returns caught in the task: ${caught("in_task")}. At review: ${caught("at_review")}. After delivery: ${caught("after_delivery")}.`,
347
+ `- Returns that were changed asks: ${rework.changed_ask}.`,
348
+ `- Reason check on refusals: ${bound}.`,
349
+ "",
350
+ ]
351
+ }
352
+
353
+ // The headline first: the number and what it is (an estimate, with its method version), then its state. With no accepted outcome there is no number, and the page says so in those words and gives the attention so far, as "at least" when it is a lower bound. When nothing was recorded, no time is given at all.
354
+ function attentionHeadline(attention) {
355
+ const { headline, est_ms: placed, human_turns: turns } = attention
356
+ const method = attention.method.version
357
+ const why = headline.reasons.filter((reason) => reason !== "no_accepted_outcomes")
358
+ const phrase = attentionReasonsPhrase(why, ATTENTION_PAGE_REASON_TEXT)
359
+ if (headline.state === "unavailable" && headline.reasons.includes("no_accepted_outcomes")) {
360
+ if (headline.numerator_ms === undefined) return `- Human attention per accepted outcome: no accepted outcomes yet, and no human attention is recorded in the period (${phrase}).`
361
+ const bound = why.length > 0 ? "at least " : ""
362
+ const total = placed.attributed + placed.unattributed + placed.unplaced
363
+ return `- Human attention per accepted outcome: no accepted outcomes yet. The estimated attention so far, with nothing to divide it by, is ${bound}${durationText(total)} over ${bound}${plural(turns, "human turn")}${why.length > 0 ? ` (${phrase})` : ""}.`
364
+ }
365
+ if (headline.state === "unavailable") return `- Human attention per accepted outcome: not available (${phrase}).`
366
+ const state = headline.state === "measured" ? "measured" : `partial, so a lower bound: ${phrase}`
367
+ return `- Human attention per accepted outcome: about ${durationText(headline.value)} (an estimate, method version ${method}; ${state}). That is ${durationText(headline.numerator_ms)} of estimated attention over ${plural(headline.accepted_outcomes, "accepted outcome")}.`
368
+ }
369
+
370
+ function attentionTurnsLine(attention) {
371
+ const { turns_per_accepted: figure, human_turns: turns } = attention
372
+ if (figure.state === "unavailable") {
373
+ return figure.reasons.includes("no_accepted_outcomes") ? "- Human turns per accepted outcome: no accepted outcomes yet." : `- Human turns per accepted outcome: not available (${attentionReasonsPhrase(figure.reasons, ATTENTION_PAGE_REASON_TEXT)}).`
374
+ }
375
+ const bound = figure.state === "partial" ? "at least " : ""
376
+ return `- Human turns per accepted outcome: ${bound}${Number(figure.value.toFixed(2))} (${plural(turns, "human turn")} over ${plural(figure.N, "accepted outcome")}).`
377
+ }
378
+
379
+ function attentionPermissionLine(permission) {
380
+ const lead = "- Permission decisions, reported beside the headline and not in it: "
381
+ if (permission.state === "unavailable") return `${lead}not recorded (${permission.reasons.map(reasonText).join(" and ")}).`
382
+ const bound = permission.state === "partial" ? ` (partial: ${permission.reasons.map((reason) => (Object.hasOwn(ATTENTION_ROLLUP_REASON_TEXT, reason) ? ATTENTION_ROLLUP_REASON_TEXT[reason] : reasonText(reason))).join(" and ")})` : ""
383
+ return `${lead}${permission.decisions}, estimated at ${durationText(permission.est_ms)}${bound}.`
384
+ }
385
+
386
+ function attentionSection(attention) {
387
+ const { est_ms: placed, sessions, method } = attention
388
+ const hostReasons = attention.headline.reasons.some((reason) => reason === "host_does_not_record" || reason === "host_records_partly")
389
+ const hostNote = hostReasons ? " A host that does not record the human's turns (such as Codex) or records them only in part (such as Copilot, or Claude Code when only some prompts carry an origin) makes the figure a lower bound." : ""
390
+ const constants = (table) => Object.entries(table).map(([size, ms]) => `${size} ${durationText(ms)}`).join(", ")
391
+ return [
392
+ "## Human attention",
393
+ "",
394
+ attentionHeadline(attention),
395
+ attentionTurnsLine(attention),
396
+ ...(placed === undefined ? [] : [`- Where the estimate went: ${durationText(placed.attributed)} on jobs, ${durationText(placed.unattributed)} on sessions that were not on any job, ${durationText(placed.unplaced)} on sessions that could not be placed on a job. All of it is in the headline, including time on refused, unsigned and undelivered work.`]),
397
+ `- Sessions in the period: ${sessions.in_period}, of which ${sessions.complete} record the human's turns completely. Sessions from before turns were recorded are not in the period.${hostNote}`,
398
+ attentionPermissionLine(attention.permission),
399
+ `- Method: version ${method.version}. An estimate of the time the human spent reading the reply and writing the prompt, never longer than the gap before the prompt, and at least ${durationText(method.floor_ms)} per turn. Reading a reply by size: ${constants(method.read_ms)}. Writing a prompt by size: ${constants(method.type_ms)}. A permission decision counts at most ${durationText(method.permission_ms)}.`,
400
+ "",
401
+ ]
402
+ }
403
+
404
+ /**
405
+ * `outcomeSections(outcomes) -> lines`: the sign-off, first-pass yield and rework sections of the rollups page, then the human attention section when the rollups carry one. `undefined` (a caller with no outcome rollups) adds nothing.
406
+ */
407
+ export function outcomeSections(outcomes) {
408
+ if (outcomes === undefined) return []
409
+ return [...signoffSection(outcomes.signoff), ...yieldSection(outcomes.first_pass_yield), ...reworkSection(outcomes.rework), ...(outcomes.attention === undefined ? [] : attentionSection(outcomes.attention))]
410
+ }
411
+
412
+ function listedCounts(value, order = Object.keys(value).sort()) {
413
+ const entries = order.filter((key) => value[key] !== undefined).map((key) => `${key} ${value[key]}`)
414
+ return entries.length === 0 ? "none" : entries.join(", ")
415
+ }
416
+
417
+ function unavailableLines(formulas) {
418
+ const lines = formulas.unavailable.value.map((entry) =>
419
+ `- ${fieldText(entry.field)}: ${reasonText(entry.reason)} (${plural(entry.count, "session")}).`)
420
+ for (const [label, formula] of [["First-pass yield", formulas.first_pass_yield], ["Rework", formulas.rework]]) {
421
+ if (formula.state === "unavailable") lines.push(`- ${label}: ${stateText(formula)}.`)
422
+ }
423
+ return lines
424
+ }
425
+
426
+ function contributorLines(formulas) {
427
+ const contributors = formulas.lead_contributors
428
+ if (contributors.state === "unavailable") return [`- Lead-time contributors: ${stateText(contributors)}.`]
429
+ const lines = contributors.value.slice(0, 2).map((entry) => {
430
+ const source = formulas.waits[entry.key] ?? formulas[entry.key]
431
+ const result = withState({ class: contributors.class, partial: source.partial, uncovered_sessions: source.uncovered_sessions, partial_reasons: source.partial_reasons, censored: contributors.censored })
432
+ return `- ${LABELS[entry.key]}: ${entry.value_ms} ms, ${percentage(entry.share)} of lead time (${stateText(result)}).`
433
+ })
434
+ if (contributors.state === "partial") lines.push(`- Lead-time contributors are partial: ${reasonsPhrase(contributors)}.`)
435
+ return lines
436
+ }
437
+
438
+ function waitsText(waits) {
439
+ return `human ${metric(waits.human_wait_ms)}, permission ${metric(waits.permission_wait_ms)}, API retry ${metric(waits.api_retry_ms)}, compaction wait time ${metric(waits.compaction_ms)}`
440
+ }
441
+
442
+ const TOKEN_NAMES = Object.freeze([["total", "total"], ["input", "input"], ["output", "output"], ["cache_read", "cache read"], ["cache_write", "cache write"], ["reasoning", "reasoning"]])
443
+
444
+ // Types that share one state and reason are said once: "input, output not recorded (...)".
445
+ function tokensText(tokens) {
446
+ const groups = []
447
+ for (const [key, name] of TOKEN_NAMES) {
448
+ const state = stateText(tokens[key], false)
449
+ const same = tokens[key].state === "unavailable" ? groups.find((group) => group.state === state) : undefined
450
+ if (same === undefined) groups.push({ state, entries: [[name, tokens[key]]] })
451
+ else same.entries.push([name, tokens[key]])
452
+ }
453
+ return groups.map((group) => group.entries[0][1].state === "unavailable"
454
+ ? `${group.entries.map(([name]) => name).join(", ")} ${group.state}`
455
+ : `${group.entries[0][0]} ${labelled(`${group.entries[0][1].value}`, group.entries[0][1], false)}`).join(", ")
456
+ }
457
+
458
+ function referencesText(references) {
459
+ const parts = references.parts
460
+ const pullRequests = references.value.public_pull_requests.length === 0 ? "none" : references.value.public_pull_requests.map((entry) => `${entry.repo}#${entry.number}`).join(", ")
461
+ const count = (part) => labelled(`${part.value}`, part, false)
462
+ return `Public pull requests: ${labelled(pullRequests, parts.public_prs, false)}; public commits: ${count(parts.public_commits)}; private pull requests counted: ${count(parts.private_prs)}; private commits counted: ${count(parts.private_commits)}`
463
+ }
464
+
465
+ // The words for a Clock basis.
466
+ const basisText = (basis) => basis.replaceAll("_", " ")
467
+
468
+ // A lifecycle Clock in words: its value, how far it runs and which way the true figure lies, then its state, evidence and basis; or why
469
+ // it was not recorded.
470
+ function clockText(clock) {
471
+ if (clock.state === "unavailable") return stateText(clock)
472
+ const direction = clock.bound === "lower" ? "at least " : clock.bound === "upper" ? "at most " : ""
473
+ const none = clock.state === "partial" && clock.bound === null ? [clock.bound_reason === "bound_not_moved" ? reasonText(clock.bound_reason) : `direction not known, because ${reasonText(clock.bound_reason)}`] : []
474
+ return `${direction}${clock.value} ms${clock.so_far ? " so far" : ""} (${[stateText(clock), `basis: ${clock.basis.map(basisText).join(", ")}`, ...none].join("; ")})`
475
+ }
476
+
477
+ // The production periods in words, each on the job clock with what dates its ends.
478
+ function periodsText(periods) {
479
+ if (periods.state === "unavailable") return stateText(periods)
480
+ // A period list that is not unavailable always holds at least one episode (`deriveLifecycleClocks`).
481
+ const items = periods.items.map((item) => `${item.start_ms} to ${item.end_ms} ms${item.so_far ? " so far" : ""} (${basisText(item.start_basis)} to ${basisText(item.end_basis)})`).join(", ")
482
+ return `${items} (${stateText(periods, false)})`
483
+ }
484
+
485
+ // The six lifecycle clock lines of a job page, after its lead time; none when the job has no clocks (a caller that renders the legacy page).
486
+ function clockLines(clocks) {
487
+ if (clocks === undefined) return []
488
+ return [
489
+ `- Recorded request to delivery: ${clockText(clocks.request_to_delivery_ms)}.`,
490
+ `- Queued before production: ${clockText(clocks.queue_ms)}.`,
491
+ `- Production time: ${clockText(clocks.production_ms)}.`,
492
+ `- Recorded working time in production: ${clockText(clocks.active_in_production_ms)}.`,
493
+ `- Production not recorded as active (not by itself idle time or waste): ${clockText(clocks.production_remainder_ms)}.`,
494
+ `- Production periods: ${periodsText(clocks.production_periods)}.`,
495
+ ]
496
+ }
497
+
498
+ function transitionText(entry) {
499
+ return entry.offset_ms === null ? `${entry.to} at an unknown offset` : `${entry.to} at ${entry.offset_ms} ms`
500
+ }
501
+
502
+ // The evaluator's labels for this job's sessions, or "not classified yet"
503
+ // when none of them has accepted labels. Labels come from the store's
504
+ // `labels/` entries that passed the build's checks against the facts.
505
+ function wasteLines(timeline, labelsByJobSession) {
506
+ const total = timeline.sessions.length
507
+ const labeled = timeline.sessions.flatMap((session) => {
508
+ const entry = labelsByJobSession.get(`${timeline.job}/${session.id}`)
509
+ return entry === undefined ? [] : [entry]
510
+ })
511
+ if (labeled.length === 0) return ["Not classified yet: no session of this job has labels from the independent evaluator."]
512
+ const byClass = { value: 0, support: 0, muda: 0, unknown: 0 }
513
+ const byWaste = new Map()
514
+ let mura = 0
515
+ let muri = 0
516
+ for (const stretch of labeled.flatMap((entry) => entry.stretches)) {
517
+ const duration = stretch.end_ms - stretch.start_ms
518
+ byClass[stretch.class] += duration
519
+ if (stretch.class === "muda") {
520
+ const current = byWaste.get(stretch.waste) ?? { ms: 0, stretches: 0 }
521
+ byWaste.set(stretch.waste, { ms: current.ms + duration, stretches: current.stretches + 1 })
522
+ }
523
+ if (stretch.mura) mura += 1
524
+ if (stretch.muri) muri += 1
525
+ }
526
+ const classified = byClass.value + byClass.support + byClass.muda + byClass.unknown
527
+ // Every line below covers only the labeled sessions, so its state is the labeled share of the job's sessions.
528
+ const state = labeled.length === total ? "measured" : `partial: ${reasonText("not_labeled")}; ${plural(total - labeled.length, "session")} uncovered`
529
+ const coverage = labeled.length === total
530
+ ? `Classified by the independent evaluator: ${plural(total, "session")} labeled (${state}).`
531
+ : `Classified by the independent evaluator: ${labeled.length} of ${plural(total, "session")} labeled (${state}).`
532
+ const wastes = [...byWaste.entries()]
533
+ .sort((left, right) => right[1].ms - left[1].ms || compareText(left[0], right[0]))
534
+ .map(([waste, entry]) => `${waste} ${entry.ms} ms in ${plural(entry.stretches, "stretch", "stretches")}`)
535
+ const share = classified === 0 ? "" : `, ${percentage(byClass.muda / classified)} of labeled time`
536
+ const lines = [
537
+ `- ${coverage}`,
538
+ wastes.length === 0 ? `- Muda: none in the labeled stretches (${state}).` : `- Muda: ${byClass.muda} ms${share}, by type: ${wastes.join(", ")} (${state}).`,
539
+ `- Value ${byClass.value} ms; support ${byClass.support} ms (${state}).`,
540
+ ...(byClass.unknown === 0 ? [] : [`- Unknown (the evaluator could not tell, not counted as muda): ${byClass.unknown} ms (${state}).`]),
541
+ `- Mura (unevenness) flagged on ${plural(mura, "stretch", "stretches")}; muri (overburden) on ${plural(muri, "stretch", "stretches")} (${state}).`,
542
+ ]
543
+ const unreadable = new Map()
544
+ for (const code of labeled.flatMap((entry) => entry.unavailable)) unreadable.set(code, (unreadable.get(code) ?? 0) + 1)
545
+ if (unreadable.size > 0) {
546
+ lines.push(`- The evaluator could not read: ${[...unreadable.entries()].sort((left, right) => compareText(left[0], right[0])).map(([code, count]) => `${reasonText(code)} in ${plural(count, "session")}`).join(", ")} (measured).`)
547
+ }
548
+ return lines
549
+ }
550
+
551
+ function contextLines(context, job) {
552
+ if (!context) return []
553
+ if (context.record === null) return ["## Task context", "", "The earlier explanation no longer matches the available source evidence. Context is unavailable until it is reviewed again.", ""]
554
+ const value = context.record
555
+ if (value.state !== "published") return ["## Task context", "", value.state === "withheld" ? "The explanation is withheld for privacy." : "An evidence-supported explanation is not recorded.", ""]
556
+ const lines = ["## Task context", ""]
557
+ if (value.heading !== null) lines.push(value.heading, "")
558
+ for (const event of value.events) {
559
+ lines.push(`- ${event.kind === "waiting" ? "Waiting" : event.kind === "result" ? "Result" : "Work"} (${event.confidence} confidence): ${event.explanation}`)
560
+ if (event.reason !== null) lines.push(` Reason: ${event.reason} Prerequisite: ${event.prerequisite}${event.resumption === null ? "" : ` Resumption: ${event.resumption}`}`)
561
+ }
562
+ if (value.coverage.state === "partial") lines.push(``, `Context coverage is partial; ${value.coverage.omitted_events} events omitted. Unexplained time remains unexplained.`)
563
+ lines.push("", `[Full public context and evidence](${job}.json). The explanation does not change the measured totals below.`, "")
564
+ return lines
565
+ }
566
+
567
+ export function renderJobMarkdown({ timeline, formulas, labels = new Map(), clocks, context }) {
568
+ const hostCounts = formulas.sessions_by_host.value
569
+ const sessions = formulas.sessions.value
570
+ const transitions = timeline.transitions.length === 0 ? "none" : timeline.transitions.map(transitionText).join(", ")
571
+ const transitionState = timeline.transitions.some((entry) => entry.offset_ms === null) ? `partial: ${reasonText("job_offsets_unavailable")}` : "measured"
572
+ const longest = formulas.longest_wait.state === "unavailable"
573
+ ? `- Longest single wait: ${stateText(formulas.longest_wait)}.`
574
+ : `- Longest single wait: ${LABELS[`${formulas.longest_wait.value.kind}_ms`].toLowerCase()}, ${formulas.longest_wait.value.duration_ms} ms (${stateText(formulas.longest_wait)}).`
575
+ const signals = formulas.rework_signals
576
+
577
+ return [
578
+ `# Job ${timeline.job}`,
579
+ "",
580
+ ...contextLines(context, timeline.job),
581
+ "## What happened",
582
+ "",
583
+ `- Status: ${labelled(`${formulas.status.value}`, formulas.status)}.`,
584
+ `- Sessions: ${sessions.bound} bound, ${sessions.timeline} on the job clock (${stateText(formulas.sessions)}); by host: ${listedCounts(hostCounts)} (${stateText(formulas.sessions_by_host)}).`,
585
+ `- Shared work: ${plural(sessions.shared, "session")} shared with ${plural(sessions.shared_with_jobs, "other job")} (${stateText(formulas.sessions)}).`,
586
+ `- Lead time: ${metric(formulas.lead_time_ms)}.`,
587
+ ...clockLines(clocks),
588
+ `- Queue before start: ${metric(formulas.queue_before_start_ms)}.`,
589
+ `- Active time: ${metric(formulas.active_time_ms)} in total; inside the lead-time window: ${metric(formulas.active_in_lead_ms)}.`,
590
+ `- Active before card (work before the task card existed, outside lead time): ${metric(formulas.active_before_card_ms)}.`,
591
+ `- Busy time: ${metric(formulas.busy_time_ms)}; parallelism: ${metric({ ...formulas.parallelism, value: formulas.parallelism.value === null ? null : Number(formulas.parallelism.value.toFixed(2)) }, "")}.`,
592
+ `- Flow efficiency: ${flowText(formulas.flow_efficiency)}.`,
593
+ `- Concurrent sessions: ${concurrencyText(formulas.concurrent_sessions)}.`,
594
+ `- Concurrent agents: ${concurrencyText(formulas.concurrent_agents)}.`,
595
+ `- Waits: ${waitsText(formulas.waits)}.`,
596
+ `- Tool calls: ${labelled(listedCounts(formulas.tool_calls_by_kind.value ?? {}), formulas.tool_calls_by_kind)}.`,
597
+ `- ${referencesText(formulas.references)}.`,
598
+ `- Tokens: ${tokensText(formulas.tokens_total)}.`,
599
+ `- Status transitions: ${transitions} (${transitionState}).`,
600
+ `- Sign-off: ${signoffText(formulas.signoff)}.`,
601
+ ...(formulas.first_pass_yield.state === "unavailable" ? [] : [`- First-pass yield: ${firstPassText(formulas.first_pass_yield)}.`]),
602
+ ...(formulas.rework.state === "unavailable" ? [] : [`- Rework: ${reworkText(formulas.rework)}.`]),
603
+ `- Human attention: ${attentionText(formulas.attention)}.`,
604
+ "",
605
+ "## What mattered",
606
+ "",
607
+ ...contributorLines(formulas),
608
+ longest,
609
+ "",
610
+ "## What was waste",
611
+ "",
612
+ ...wasteLines(timeline, labels),
613
+ `- Candidate signals only (inferred): ${signalText(signals.tool_failures, "tool failure", "tool failures")}, ${signalText(signals.tool_retries, "tool retry", "tool retries")}, ${signalText(signals.api_retries, "API retry", "API retries")}, ${signalText(signals.session_retouches, "session re-touch", "session re-touches")}.`,
614
+ `- Wait signals: ${waitsText(formulas.waits)}.`,
615
+ "",
616
+ "## What we could not see",
617
+ "",
618
+ ...unavailableLines(formulas),
619
+ "",
620
+ FOOTNOTE,
621
+ "",
622
+ ].join("\n")
623
+ }
624
+
625
+ export function buildCoverage(sessions) {
626
+ const hostCounts = new Map()
627
+ const unavailableCounts = new Map()
628
+ const pluginCounts = new Map()
629
+ let bound = 0
630
+ for (const session of sessions) {
631
+ if (session.jobs.length > 0) bound += 1
632
+ hostCounts.set(session.session.host, (hostCounts.get(session.session.host) ?? 0) + 1)
633
+ for (const entry of session.unavailable) {
634
+ const key = `${entry.field}\n${entry.reason}`
635
+ unavailableCounts.set(key, (unavailableCounts.get(key) ?? 0) + 1)
636
+ }
637
+ for (const plugin of new Set(session.plugins.map((entry) => `${entry.name}\n${entry.version}`))) {
638
+ pluginCounts.set(plugin, (pluginCounts.get(plugin) ?? 0) + 1)
639
+ }
640
+ }
641
+ const total = sessions.length
642
+ return {
643
+ // The store only receives published facts, so it cannot count sessions
644
+ // that never published any.
645
+ sessions_seen: { class: "unavailable", value: null, reason: "not_reported_to_store" },
646
+ sessions_with_facts: total,
647
+ bound_sessions: bound,
648
+ unattributed_sessions: total - bound,
649
+ hosts: [...hostCounts.entries()].map(([host, count]) => ({ host, sessions: count })).sort((left, right) => compareText(left.host, right.host)),
650
+ unavailable: [...unavailableCounts.entries()].map(([key, count]) => {
651
+ const [field, reason] = key.split("\n")
652
+ return { field, reason, sessions: count, rate: count / total }
653
+ }).sort((left, right) => compareText(left.field, right.field) || compareText(left.reason, right.reason)),
654
+ plugins: [...pluginCounts.entries()].map(([key, count]) => {
655
+ const [name, version] = key.split("\n")
656
+ return { name, version, sessions: count }
657
+ }).sort((left, right) => compareText(left.name, right.name) || compareText(left.version, right.version)),
658
+ }
659
+ }
660
+
661
+ export function renderIndexMarkdown(reports, coverage) {
662
+ const sorted = [...reports].sort((left, right) => compareText(left.timeline.job, right.timeline.job))
663
+ const jobs = sorted.length === 0
664
+ ? ["No job has published facts yet."]
665
+ : [
666
+ "| Job | Lead time | Active time | Active before card | Flow efficiency |",
667
+ "| --- | ---: | ---: | ---: | ---: |",
668
+ ...sorted.map(({ timeline, formulas }) => `| ${timeline.job} | ${metric(formulas.lead_time_ms)} | ${metric(formulas.active_time_ms)} | ${metric(formulas.active_before_card_ms)} | ${flowText(formulas.flow_efficiency)} |`),
669
+ ]
670
+ // One line per field; each reason it carries follows with how many sessions it covers.
671
+ const byField = new Map()
672
+ for (const entry of coverage.unavailable) byField.set(entry.field, [...(byField.get(entry.field) ?? []), entry])
673
+ const unavailableEntries = [...byField.entries()].map(([field, entries]) =>
674
+ `- ${fieldText(field)}: ${entries.map((entry) => `${reasonText(entry.reason)} (${entry.sessions} of ${coverage.sessions_with_facts} sessions, ${percentage(entry.rate)})`).join("; ")}.`)
675
+ const pluginEntries = coverage.plugins.map((entry) => `- ${entry.name} ${entry.version}: ${plural(entry.sessions, "session")} (measured).`)
676
+ return [
677
+ "# Factory report index",
678
+ "",
679
+ "## Jobs",
680
+ "",
681
+ ...jobs,
682
+ "",
683
+ "Flow efficiency divides active time inside the lead-time window by lead time. Active before card is work before the task card existed; it is outside lead time. Each number carries its state: measured, partial with its reason, or not recorded.",
684
+ "",
685
+ "Totals and distributions across jobs, including which waste costs the most, are in `rollups/index.md`.",
686
+ "",
687
+ "## Coverage",
688
+ "",
689
+ `- Sessions seen: not recorded (${reasonText(coverage.sessions_seen.reason)}).`,
690
+ `- Sessions with facts: ${coverage.sessions_with_facts} (measured).`,
691
+ `- Bound sessions: ${coverage.bound_sessions} (measured).`,
692
+ `- Unattributed sessions: ${coverage.unattributed_sessions} (measured).`,
693
+ ...coverage.hosts.map((entry) => `- Host ${entry.host}: ${plural(entry.sessions, "session")} (measured).`),
694
+ "",
695
+ "### Unavailable evidence",
696
+ "",
697
+ ...(unavailableEntries.length === 0 ? ["- None."] : unavailableEntries),
698
+ "",
699
+ "### Plugin versions",
700
+ "",
701
+ ...(pluginEntries.length === 0 ? ["- None."] : pluginEntries),
702
+ "",
703
+ ].join("\n")
704
+ }
705
+
706
+ export function renderReadme() {
707
+ return [
708
+ "# Factory reports",
709
+ "",
710
+ "These files are generated deterministically from validated published session facts.",
711
+ "",
712
+ "- `index.md` lists job reports and coverage.",
713
+ "- `jobs/<job>.md` answers the four factory questions.",
714
+ "- `jobs/<job>.json` carries the normalized timeline and classed formulas.",
715
+ "- `rollups/index.md` shows which waste costs the most across jobs and the measure catalog per plugin version, host and job class; `rollups/measures.json`, `rollups/muda.json`, `rollups/tool-kinds.json`, `rollups/coverage.json` and `rollups/totals.json` carry the same numbers.",
716
+ "- `rollups/totals.json` holds fact-level totals per host and overall (sessions, tool calls, tool failures, model requests, tokens by type and subagent dispatches), each with its state, its value, n and N.",
717
+ "",
718
+ "Published facts contain durations and offsets only. Every number carries one of three states: measured, partial or not recorded. Not recorded means there is no number, with the reason; it is never printed as zero, and a zero is printed only when a zero was measured. Partial means the number covers only part of what it should, and its reason and the count of uncovered sessions follow it. A total or a median over several sessions or jobs reads n of N: n counted a measured value, of N in all.",
719
+ "",
720
+ "The reason `the host records only some of it` marks a lower bound: the host surfaced some of the records, so the real number is at least what is printed. Claude API retry counts are such a lower bound.",
721
+ "",
722
+ DEFINITIONS,
723
+ "",
724
+ "## Human attention",
725
+ "",
726
+ `Human attention per accepted outcome is an estimate, not a measurement. It is made with method version ${ATTENTION_METHOD}, and the method version is printed beside the attention figures. Desk changes the method version whenever it changes a constant, and the reports are rebuilt from the same facts, so a figure is only compared with figures of its own method version.`,
727
+ "",
728
+ "No host records how long a person spent reading a reply or writing a prompt. The estimate adds two parts for each human turn, reading the reply and writing the prompt, each taken from the size class of its character count. It is never more than the gap the host shows, when there is one, and never less than one second. The person may have read while the agent was still writing, and no host records that, so a figure is closer to a floor than to a ceiling.",
729
+ "",
730
+ "The headline counts every human turn of every session in the period, including turns on jobs that were refused, are unsigned or were never delivered, and the total is divided by the jobs accepted (recorded by the agent on the operator's word). A turn that falls in no job's time is shown apart as unattributed, and a turn in a session whose jobs publish no time is shown as unplaced; both stay in the headline. The same page also gives human turns per accepted outcome, a plain count over the same jobs.",
731
+ "",
732
+ "The headline has three states. It is measured when every session in the period has a complete list of human turns. It is partial, a lower bound, when some session in the period flags the field: Codex records no human turns, Copilot records them only in part because a prompt there cannot be told from a hook's follow-up with certainty, and a Claude Code session whose host wrote no origin on its prompts, a session cut at 1,000 turns and a log cut short flag it too. The reasons are printed. It is unavailable, with no value and no total, when no session in the period kept a list (the reason reads no human-turn records when no session is in the period, and turns not recorded, with the host's own reason, when sessions are, for example when all are Codex). It is also unavailable, with no total, when every turn is unreadable. A turn the estimator cannot read is counted, adds no time and gives the reason that a turn could not be estimated. With no accepted outcome the headline is unavailable and reads no accepted outcomes yet; the total so far is still shown, as \"at least\" when it is partial, only when a list exists and a turn could be estimated, and the headline is never zero. Sessions in the old format (`/1`) are outside the period.",
733
+ "",
734
+ "Permission decisions are shown beside the headline, not in it. Only Copilot records them, and each is taken as at most five seconds.",
735
+ "",
736
+ ].join("\n")
737
+ }