readthrough 0.4.0__tar.gz → 0.5.0__tar.gz

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 (190) hide show
  1. {readthrough-0.4.0 → readthrough-0.5.0}/AGENTS.md +18 -8
  2. {readthrough-0.4.0 → readthrough-0.5.0}/CHANGELOG.md +59 -0
  3. readthrough-0.5.0/CONTRIBUTING.md +39 -0
  4. {readthrough-0.4.0 → readthrough-0.5.0}/PKG-INFO +8 -4
  5. {readthrough-0.4.0 → readthrough-0.5.0}/README.md +7 -3
  6. {readthrough-0.4.0 → readthrough-0.5.0}/docs/guide.md +17 -4
  7. {readthrough-0.4.0 → readthrough-0.5.0}/docs/maintaining.md +12 -9
  8. {readthrough-0.4.0 → readthrough-0.5.0}/pyproject.toml +10 -4
  9. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/agents.py +6 -0
  10. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/SKILL.md +2 -0
  11. readthrough-0.5.0/src/readthrough/assets/extension/extension.mjs +96 -0
  12. readthrough-0.5.0/src/readthrough/assets/extension/readthrough.mjs +185 -0
  13. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/dashboard.css +3 -1
  14. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/dashboard.js +53 -7
  15. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/setup.css +1 -0
  16. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/setup.js +10 -1
  17. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/theme.css +2 -0
  18. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/cli.py +198 -43
  19. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/contract.py +19 -1
  20. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/serve.py +78 -17
  21. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/system.py +140 -1
  22. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/web_setup.py +11 -1
  23. {readthrough-0.4.0 → readthrough-0.5.0}/tests/conftest.py +10 -0
  24. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_browser.py +165 -6
  25. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_cli.py +175 -3
  26. readthrough-0.5.0/tests/test_commit_messages.py +77 -0
  27. readthrough-0.5.0/tests/test_extension.py +76 -0
  28. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_serve.py +53 -0
  29. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_web_setup.py +11 -1
  30. {readthrough-0.4.0 → readthrough-0.5.0}/.gitignore +0 -0
  31. {readthrough-0.4.0 → readthrough-0.5.0}/LICENSE +0 -0
  32. {readthrough-0.4.0 → readthrough-0.5.0}/docs/profiles.md +0 -0
  33. {readthrough-0.4.0 → readthrough-0.5.0}/examples/README.md +0 -0
  34. {readthrough-0.4.0 → readthrough-0.5.0}/examples/custom_profile_source.py +0 -0
  35. {readthrough-0.4.0 → readthrough-0.5.0}/examples/offline_analysis.py +0 -0
  36. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/__init__.py +0 -0
  37. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/__main__.py +0 -0
  38. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/analyze.py +0 -0
  39. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/defaults.toml +0 -0
  40. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/profile-reference.md +0 -0
  41. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/README.md +0 -0
  42. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/cose-base.js +0 -0
  43. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/cytoscape-fcose.js +0 -0
  44. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/cytoscape.min.js +0 -0
  45. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/layout-base.js +0 -0
  46. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/cose-base-LICENSE +0 -0
  47. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/cytoscape-LICENSE +0 -0
  48. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/cytoscape-fcose-LICENSE +0 -0
  49. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/dompurify-LICENSE +0 -0
  50. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/layout-base-LICENSE +0 -0
  51. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/lucide-LICENSE +0 -0
  52. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/licenses/marked-LICENSE +0 -0
  53. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/lucide-icons.js +0 -0
  54. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/marked.umd.js +0 -0
  55. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/vendor/purify.min.js +0 -0
  56. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/dashboard.html +0 -0
  57. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assets/web/setup.html +0 -0
  58. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/assistants.py +0 -0
  59. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/brief.py +0 -0
  60. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/build.py +0 -0
  61. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/ci.py +0 -0
  62. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/config.py +0 -0
  63. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/engine.py +0 -0
  64. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/faults.py +0 -0
  65. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/files.py +0 -0
  66. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/forges/__init__.py +0 -0
  67. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/forges/azure_devops.py +0 -0
  68. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/forges/forgejo.py +0 -0
  69. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/forges/github.py +0 -0
  70. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/forges/gitlab.py +0 -0
  71. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/ledger.py +0 -0
  72. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/limits.py +0 -0
  73. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/logs.py +0 -0
  74. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/membership.py +0 -0
  75. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/model.py +0 -0
  76. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/onboard.py +0 -0
  77. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/onboard_model.py +0 -0
  78. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/process.py +0 -0
  79. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/profile.py +0 -0
  80. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/py.typed +0 -0
  81. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/registry.py +0 -0
  82. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/review.py +0 -0
  83. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/rules.py +0 -0
  84. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/runtimes/__init__.py +0 -0
  85. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/runtimes/anthropic.py +0 -0
  86. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/runtimes/copilot.py +0 -0
  87. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/runtimes/openai.py +0 -0
  88. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/study.py +0 -0
  89. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/terminals.py +0 -0
  90. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/tuning.py +0 -0
  91. {readthrough-0.4.0 → readthrough-0.5.0}/src/readthrough/usage.py +0 -0
  92. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fake_gh.py +0 -0
  93. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fakes.py +0 -0
  94. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/courier.toml +0 -0
  95. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/README.md +0 -0
  96. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/03be324e4f9e.json +0 -0
  97. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/090629072c7e.json +0 -0
  98. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/0e1fe07a4beb.json +0 -0
  99. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/21609ce43570.json +0 -0
  100. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/23c144c8cae2.json +0 -0
  101. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/2f67f0784d3f.json +0 -0
  102. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/4b737519e721.json +0 -0
  103. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/7f26382a26ef.json +0 -0
  104. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/9221b6d0840a.json +0 -0
  105. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/92c5290eaff1.json +0 -0
  106. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/e71b9e3fc4c0.json +0 -0
  107. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/f3509478d4d7.json +0 -0
  108. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/fc6b5e815e82.json +0 -0
  109. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/ado/index.json +0 -0
  110. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/0cebf0b65aa5.json +0 -0
  111. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/165113c4eabe.json +0 -0
  112. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/26c499a0bd6b.json +0 -0
  113. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/274a37d8bb25.json +0 -0
  114. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/2e89d19be1f1.json +0 -0
  115. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/39bdce47eea5.json +0 -0
  116. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/4101cf99b3ab.json +0 -0
  117. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/4b5a777cdf98.json +0 -0
  118. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/59c71da3f041.json +0 -0
  119. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/5a273c90feeb.json +0 -0
  120. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/5c250e7135fc.json +0 -0
  121. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/5dd2f033485b.json +0 -0
  122. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/649b79bcdb19.json +0 -0
  123. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/6a44ccb778e2.json +0 -0
  124. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/9389f28310ef.json +0 -0
  125. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/963f7a37840f.json +0 -0
  126. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/a1dcb3f2df5a.json +0 -0
  127. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/a467e70e374c.json +0 -0
  128. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/aad3937bc2be.json +0 -0
  129. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/abf7a246a063.json +0 -0
  130. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/ae2091aa681b.json +0 -0
  131. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/b3bcdf26f5f2.json +0 -0
  132. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/c5f794f6d12a.json +0 -0
  133. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/e97f70ce7e2e.json +0 -0
  134. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/ee76ff2b2aa7.json +0 -0
  135. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/fcd900fc02ac.json +0 -0
  136. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/forgejo/index.json +0 -0
  137. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/03addf8039b3.json +0 -0
  138. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/054a7bf76049.json +0 -0
  139. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/05a1a7170d04.json +0 -0
  140. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/0603a56f5c6e.json +0 -0
  141. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/1faa33d3d89d.json +0 -0
  142. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/2214b16b333f.json +0 -0
  143. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/229ccc31e324.json +0 -0
  144. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/235e10ac50b2.json +0 -0
  145. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/26c82541d833.json +0 -0
  146. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/293c168adbb5.json +0 -0
  147. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/3a0f3d9a23f8.json +0 -0
  148. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/4f32035198bb.json +0 -0
  149. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/5a7f9f9571ba.json +0 -0
  150. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/5d53ec48c954.json +0 -0
  151. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/6c9d9aaf4865.json +0 -0
  152. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/6d0b7f56058c.json +0 -0
  153. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/6e76cb3a29c6.json +0 -0
  154. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/6f7a226c9418.json +0 -0
  155. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/788d7a59a435.json +0 -0
  156. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/87847cd77255.json +0 -0
  157. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/9159d1034171.json +0 -0
  158. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/93514ae445cf.json +0 -0
  159. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/995df583d679.json +0 -0
  160. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/a103f9259efe.json +0 -0
  161. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/ba7bbd8d7f4d.json +0 -0
  162. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/c0d36d9d5385.json +0 -0
  163. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/cb31d203bf57.json +0 -0
  164. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/d9cf27bbda67.json +0 -0
  165. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/e56b428bb2c2.json +0 -0
  166. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/fe1e852021c5.json +0 -0
  167. {readthrough-0.4.0 → readthrough-0.5.0}/tests/fixtures/forges/gitlab/index.json +0 -0
  168. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_agents.py +0 -0
  169. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_analyze.py +0 -0
  170. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_assistants.py +0 -0
  171. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_ci.py +0 -0
  172. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_contract.py +0 -0
  173. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_e2e.py +0 -0
  174. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_engine.py +0 -0
  175. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_examples.py +0 -0
  176. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_forges.py +0 -0
  177. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_github_faults.py +0 -0
  178. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_jitter.py +0 -0
  179. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_ledger_config.py +0 -0
  180. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_onboard.py +0 -0
  181. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_onboard_model.py +0 -0
  182. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_profile.py +0 -0
  183. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_registry.py +0 -0
  184. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_review.py +0 -0
  185. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_rules.py +0 -0
  186. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_runtimes.py +0 -0
  187. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_study.py +0 -0
  188. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_system.py +0 -0
  189. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_tuning.py +0 -0
  190. {readthrough-0.4.0 → readthrough-0.5.0}/tests/test_vendor.py +0 -0
@@ -14,16 +14,17 @@ uv run pytest tests/test_engine.py -q # one file; -k NAME for one test; -m e2
14
14
  uv run readthrough --help # the CLI from the checkout
15
15
  uv build # sdist and wheel into dist/
16
16
  uvx zizmor .github/workflows # lint the workflows; a required check, so keep it clean
17
- git config core.hooksPath .githooks # once per clone: --quick before every commit; push only main, release/*, v* tags
17
+ git config core.hooksPath .githooks # once per clone: runs --quick before every commit
18
18
  uv run python scripts/screenshots.py --repo microsoft/vscode --pr N # redraw docs/img/*.webp from a built repo
19
+ uv run python scripts/screenshot_canvas.py --repo microsoft/PyRIT --pr N # the VS Code canvas shot (Windows; a real session)
19
20
  ```
20
21
 
21
22
  CI (`ci.yml`) runs the same gate through the reusable `test.yml` on Linux, macOS, and Windows for every Python
22
- in its matrix, and sums it up in `gate`; `gate` and `zizmor` (the workflow linter) are the two checks the branch
23
- ruleset requires. The local gate is one cell of that matrix: CI adds the other platforms and Pythons, refuses a
23
+ in its matrix, and sums it up in `gate`; `gate`, `zizmor` (the workflow linter), and `commits` (Conventional Commits on the PR title and each commit) are the checks the branch
24
+ ruleset requires, and a change reaches `main` through a pull request the maintainer (the code owner) has approved, up to date with `main` and rebased or squashed so the history stays linear. Work in progress lives on `dev/<your login>/<topic>` branches, the one namespace a collaborator can create on the repository; they take no checks and may be rewritten freely. The local gate is one cell of that matrix: CI adds the other platforms and Pythons, refuses a
24
25
  stale `uv.lock` (`UV_LOCKED`), and lints the workflows, so run `uv lock` after changing dependencies and
25
- `uvx zizmor` after touching `.github/`. The browser tests skip locally when no Chromium-family browser is
26
- installed; on CI they fail instead, since the hosted runners have one. A release is a `vX.Y.Z` tag on `main`:
26
+ `uvx zizmor` after touching `.github/`. The browser tests run on Playwright's own Chromium (`uv run playwright install chromium`, once), the same
27
+ engine CI uses, else an installed Edge or Chrome; they skip when there is none, and on CI they fail instead. A release is a `vX.Y.Z` tag on `main`:
27
28
  `release.yml` runs the gate again and, after the maintainer approves, publishes to PyPI and GitHub
28
29
  (`docs/maintaining.md`, "Releasing").
29
30
 
@@ -92,8 +93,15 @@ installed; on CI they fail instead, since the hosted runners have one. A release
92
93
  - **What crosses between page and server is declared in `contract.py`** (the payload, the SSE events, the
93
94
  study API) and `test_contract.py` checks both sides: a build has exactly those shapes, the page reads nothing
94
95
  else. Events are notifications; a GET is the truth, and after any gap (`hello` with a new instance, `resync`,
95
- a reconnect) the page re-fetches what it holds. Shared files (study logs, the ledger) are read and written
96
- under `files.locked`, which also holds against another process.
96
+ a reconnect) the page re-fetches what it holds. The one exception is `focus`, a request to show a PR that a
97
+ missed delivery rightly loses. Shared files (study logs, the ledger) are read and written under
98
+ `files.locked`, which also holds against another process.
99
+ - **Programs drive the server through the CLI, never the page's API.** `serve.json` in the home records the
100
+ running server (port, instance, token) for programs of the same user; `readthrough show` reads it to steer
101
+ open pages, and `repos --json` reports it. The Copilot canvas (`assets/extension/`, two ES modules the Copilot
102
+ runtime loads, installed by `install canvas`) is a client of the CLI alone: it runs the interpreter that
103
+ installed it with an argument list from a fixed directory, reads, steers, and writes nothing to the log or the
104
+ ledger; `test_extension.py` keeps its constants and flags in step with `contract.py` and `cli.py`.
97
105
  - **Lint is `ruff` with `select = ["ALL"]`** and an ignore list that states each reason in `pyproject.toml`.
98
106
  Suppress per file (with a reason) rather than per line where a whole file legitimately differs. Types are
99
107
  checked by `ty`, pinned exactly; bump it deliberately.
@@ -109,4 +117,6 @@ installed; on CI they fail instead, since the hosted runners have one. A release
109
117
  builds what gets published uses no package cache (the test jobs may: a coverage report isn't shipped);
110
118
  in-repo workflows are called as `$/.github/workflows/<file>` so they count as pinned. `.github/zizmor.yml`
111
119
  holds the policy and the `zizmor` job fails on any finding.
112
- - **Commits** are one logical change each, with a message a person would write, and no trailers.
120
+ - **Commits** are one logical change each. The subject is Conventional Commits, `type(scope): description`
121
+ (`CONTRIBUTING.md` lists the types; `scripts/commit_messages.py --range origin/main..HEAD` checks what you're
122
+ about to propose); the body is prose a person would write, and there are no trailers.
@@ -1,5 +1,64 @@
1
1
  # Changelog
2
2
 
3
+ 0.4.0 is the first published version; the entries before it are the project's history from before it was public.
4
+
5
+ ## 0.5.0 (2026-11-04)
6
+
7
+ ### Added
8
+
9
+ - The dashboard beside an agent session, as a Copilot canvas (experimental): `readthrough install canvas` adds
10
+ a small Copilot extension that shows the live dashboard next to the chat in VS Code's Agents window and lets
11
+ the agent point it at a PR: on the architecture map alone before the reviewer has predicted, then its brief,
12
+ overview, or study log. Beside a session the page hides the buttons that would start another review and shows
13
+ the study log without a second composer. The extension only runs the `readthrough` CLI, with the interpreter
14
+ that installed it; `doctor` reports a stale copy; `uninstall canvas` removes what was installed, and
15
+ `readthrough install` offers it wherever the Copilot CLI is.
16
+ - `readthrough show N [--panel none|overview|study|brief]` points every open dashboard page (browser tabs and
17
+ canvases) at a PR, through a `focus` event the live server sends; `--client` addresses one page by the name it
18
+ gave on its event stream. The server records where it is in `serve.json` (port, instance, token) for programs
19
+ of the same user, and `/api/health` names its instance.
20
+ - `#map?pr=N` is a deep link to a PR's panel, `panel=` picks its tab, and opening or closing the panel keeps the
21
+ URL current, so any panel can be bookmarked or handed on.
22
+ - `readthrough repos --json`: the live server, the default repo, and each repo's slug and URL, for programs.
23
+ - `CONTRIBUTING.md`, and a check on every pull request that its title and each of its commits follow
24
+ Conventional Commits (`type(scope): description`). The grammar is `scripts/commit_messages.py`, which also
25
+ checks a range locally; Dependabot's pull requests carry `build(deps)` and `ci(deps)` prefixes so they pass.
26
+ The history before this isn't rewritten.
27
+ - `readthrough install` with nothing named sets up the machine in one go: it lists every piece that isn't set up
28
+ (each agent's review skill, the live server at logon, one-click links, the morning nudge), says what each does,
29
+ and asks; `--all` says yes to the recommended ones without asking, and outside a terminal it only reports. The
30
+ same table drives `doctor`, which now points at the one command when two or more pieces are missing, and the
31
+ setup page's side bar, which lists what is left to set up; onboarding ends with the same pointer.
32
+
33
+ ### Fixed
34
+
35
+ - Switching views no longer shifts the page sideways: the views differ in height, so the scrollbar came and went
36
+ with the tab and the layout moved by its width each time. The gutter is reserved now, on the page and in the
37
+ PR panel.
38
+
39
+ ### Changed
40
+
41
+ - Work in progress goes on `dev/<login>/<topic>` branches: the one place a collaborator can create a branch on the
42
+ repository, with no checks required and rewriting allowed. The repository's rulesets are the whole policy now;
43
+ the pre-push hook that kept other branches off the remote is gone.
44
+ - `doctor` reports a missing morning nudge and, on platforms without the automation, the link handler and the
45
+ logon task as optional rather than as problems: they are choices, and nothing is wrong without them.
46
+ - `repo_url` percent-encodes the slug, so a repo whose name has spaces (an Azure DevOps project) gets a URL a
47
+ program can use.
48
+ - The release pipeline marks a release as latest only when its version is the highest released, so a patch to
49
+ an older line doesn't take the badge from a newer one; and when a GitHub release already exists for the tag, it
50
+ is left alone only if it is in every respect (files, title, notes, flags) the one the run would have made, and
51
+ otherwise fails the run instead of lending its approval to someone else's release.
52
+ - The toolchain that builds a release is pinned: `uv` is the version the pinned `setup-uv` action ships a
53
+ checksum for, and the build backend is an exact build constraint in `pyproject.toml`.
54
+ - The documented provenance check names the signing workflow and the tag, not just the owner, so an attestation
55
+ from another workflow or branch no longer passes it.
56
+ - The page picks its view with a switch on the tab's name, so a name from the URL never selects a function by
57
+ lookup.
58
+ - The browser tests prefer Playwright's own Chromium, which CI now installs, so a developer's run and every CI
59
+ cell drive the same engine; an installed Edge or Chrome remains the fallback, and the test report names which
60
+ one ran.
61
+
3
62
  ## 0.4.0 (2026-10-30)
4
63
 
5
64
  ### Added
@@ -0,0 +1,39 @@
1
+ # Contributing
2
+
3
+ Thanks for looking. The short version: work on a `dev/<your login>/<topic>` branch, open a pull request against
4
+ `main`, and give the pull request a Conventional Commits title. [AGENTS.md](AGENTS.md) has the exact commands,
5
+ including the gate to run before you push, and the conventions that aren't obvious; the maintainers' guide
6
+ (`docs/maintaining.md`) has the rest, and [SECURITY.md](SECURITY.md) says how to report a vulnerability.
7
+
8
+ ## Branches
9
+
10
+ `main` is what ships; `release/X.Y` carries a patch to an older line; `dev/<login>/<topic>` is where work in
11
+ progress lives, under your own GitHub login. Those are the only branch names the repository accepts (a ruleset
12
+ refuses others), and `dev/*` is yours to rebase or rewrite as you like. A change reaches `main` through a pull
13
+ request the maintainer has approved, rebased or squashed so the history stays linear.
14
+
15
+ ## Commit messages
16
+
17
+ Subjects follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/): `type(scope)!: description`.
18
+ A check on every pull request reads the title (a squash makes it the commit) and each commit's subject (a rebase
19
+ lands them as they are); `uv run python scripts/commit_messages.py --range origin/main..HEAD` runs the same check
20
+ locally.
21
+
22
+ - The **type** says what kind of change it is: `feat` (something new for users), `fix` (a bug), `docs`,
23
+ `refactor` (no change in behaviour), `test`, `build` (packaging and dependencies), `ci` (workflows and
24
+ checks), `chore` (nothing else fits; a formatting-only change is one, since ruff owns formatting), `perf`,
25
+ `revert`.
26
+ - The **scope** is optional, lowercase, and names the part touched: `canvas`, `serve`, `page`, `forges`,
27
+ `study`, `cli`, `release`, `deps`, or whatever reads best. Don't agonize over it.
28
+ - A **breaking change** carries `!` after the type or scope, and says what breaks in the body.
29
+ - The **description** says what the change does. Lowercase reads best after the colon, but it isn't checked:
30
+ Dependabot capitalizes, and the specification doesn't mind.
31
+ - The **body** is prose a person would write: what changed and why, the reasoning behind a choice, what was
32
+ considered and rejected. Wrap it at about 110 columns. No trailers.
33
+
34
+ ```text
35
+ fix(serve): refuse a focus for a PR that isn't open
36
+
37
+ The page would have shown a toast and moved on, but the caller had no way to tell the request was pointless.
38
+ The server now answers 404 for a number that isn't in the current payload, and `readthrough show` says so.
39
+ ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: readthrough
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Lay a repo's open pull requests out on its architecture, then study each one before you review it.
5
5
  Project-URL: Homepage, https://github.com/spencrr/readthrough
6
6
  Project-URL: Documentation, https://github.com/spencrr/readthrough/blob/main/docs/guide.md
@@ -37,7 +37,7 @@ Busy repos have fifty-plus open pull requests. I wanted two things from a queue
37
37
 
38
38
  readthrough does both, for repos on GitHub, GitLab, Forgejo (Codeberg), or Azure DevOps. It pulls the open PRs (the hundred most recently active by default; `limit` raises it) and places each on the repo's architecture (its layers and components), marking which ones come from outside contributors and which have CI trouble. It packs the reviewable ones into hour-long sessions grouped by component, then gives each PR a study brief.
39
39
 
40
- From there you can go two ways. A button on each PR starts a deep-review session in a terminal, in the GitHub Copilot CLI or Claude Code, where you predict what the PR does, answer questions about it, explain it back, and list your concerns before the agent shows you its own. Or you study it right in the dashboard: an assistant quizzes you on the change one question at a time and keeps everything you got right and wrong in an append-only study log that becomes part of the brief. Given a model (GitHub Copilot through the Copilot SDK, or Claude or GPT through their own APIs, including Azure OpenAI), the assistant reads the code and grades your answers; without one, a rules-based assistant asks the questions the repo's profile already carries and never pretends to grade.
40
+ From there you can go two ways. A button on each PR starts a deep-review session in a terminal, in the GitHub Copilot CLI or Claude Code, where you predict what the PR does, answer questions about it, explain it back, and list your concerns before the agent shows you its own. Or you study it right in the dashboard: an assistant quizzes you on the change one question at a time and keeps everything you got right and wrong in an append-only study log that becomes part of the brief. Given a model (GitHub Copilot through the Copilot SDK, or Claude or GPT through their own APIs, including Azure OpenAI), the assistant reads the code and grades your answers; without one, a rules-based assistant asks the questions the repo's profile already carries and never pretends to grade. In VS Code the two meet: the dashboard sits beside the deep-review session, steered by the agent, which puts the PR on the map before you predict and opens its brief after.
41
41
 
42
42
  ![The architecture map of microsoft/vscode, with each open PR placed on the component it changes most](https://raw.githubusercontent.com/spencrr/readthrough/main/docs/img/map.webp)
43
43
 
@@ -54,19 +54,23 @@ uv tool install "readthrough[study]" # from PyPI; drop [study] to skip
54
54
 
55
55
  readthrough onboard microsoft/vscode --accept # map the repo's architecture (edit the draft first if you like)
56
56
  readthrough build --open # fetch the PRs and open the dashboard
57
+ readthrough install # the rest, one question each: the agents' review skill, the VS Code canvas, the live server
57
58
  ```
58
59
 
59
60
  Repos elsewhere take a `--forge`: `readthrough onboard --forge forgejo forgejo/forgejo`, `--forge gitlab gitlab-org/cli`, or `--forge ado organization/project/repository`. Those are read through the platform's REST API, with a token from its own CLI (`glab`, `az`) or an environment variable when there is one, and anonymously otherwise, which is enough for public repos.
60
61
 
61
- That gives you a static dashboard you rebuild when you want. For one that stays fresh, run the live server (`readthrough serve`, or `readthrough install server` to start it at logon on Windows) and open <http://127.0.0.1:8765/>; with nothing onboarded yet it walks you through onboarding, with a model drafting the profile if you like. `readthrough install skill` teaches the review agents the deep-review routine, and `readthrough doctor` tells you what's missing.
62
+ That gives you a static dashboard you rebuild when you want. For one that stays fresh, run the live server (`readthrough serve`, or let `readthrough install` start it at logon on Windows) and open <http://127.0.0.1:8765/>; with nothing onboarded yet it walks you through onboarding, with a model drafting the profile if you like. `readthrough install` offers everything else readthrough can set up on your machine and asks about each (`--all` skips the questions); `readthrough doctor` tells you what's missing afterwards.
62
63
 
63
64
  ![Studying a vscode PR: the prediction, a question the model asked, the answer, and its verdict with evidence](https://raw.githubusercontent.com/spencrr/readthrough/main/docs/img/study.webp)
64
65
 
66
+ ![A deep review in VS Code's Agents window, with the dashboard beside it: the agent has placed the PR on the architecture map and asked for a prediction](https://raw.githubusercontent.com/spencrr/readthrough/main/docs/img/canvas.webp)
67
+
65
68
  ## Docs
66
69
 
67
70
  - [Using readthrough](https://github.com/spencrr/readthrough/blob/main/docs/guide.md): onboarding, the dashboard, deep reviews, studying, keeping it fresh, configuration, and troubleshooting.
68
71
  - [Writing a profile](https://github.com/spencrr/readthrough/blob/main/docs/profiles.md): how to describe a repo's architecture well, and how to share it.
69
72
  - [Maintaining readthrough](https://github.com/spencrr/readthrough/blob/main/docs/maintaining.md): the checks, error handling, logging, settings, plugins, and the pages' structure.
73
+ - [Contributing](CONTRIBUTING.md): branches, commit messages, and the checks a change goes through.
70
74
  - [Working on readthrough](AGENTS.md): the exact commands and the conventions that aren't obvious.
71
75
  - [Examples](examples/): runnable scripts, including one that needs nothing but the standard library.
72
76
  - [Changelog](CHANGELOG.md).
@@ -120,4 +124,4 @@ git config core.hooksPath .githooks # once: run the checks before every com
120
124
  uv run python scripts/check.py # lint, format, types, and tests with the coverage floor
121
125
  ```
122
126
 
123
- The same gate runs in CI on Linux, macOS, and Windows for every supported Python. The browser tests use an installed Edge or Chrome; locally they skip without one, on CI they fail. See [SECURITY.md](https://github.com/spencrr/readthrough/blob/main/SECURITY.md) for what the tool trusts and how to report a vulnerability.
127
+ The same gate runs in CI on Linux, macOS, and Windows for every supported Python. The browser tests run on Playwright's Chromium (`uv run playwright install chromium`), or an installed Edge or Chrome; locally they skip without one, on CI they fail. See [SECURITY.md](https://github.com/spencrr/readthrough/blob/main/SECURITY.md) for what the tool trusts and how to report a vulnerability.
@@ -4,7 +4,7 @@ Busy repos have fifty-plus open pull requests. I wanted two things from a queue
4
4
 
5
5
  readthrough does both, for repos on GitHub, GitLab, Forgejo (Codeberg), or Azure DevOps. It pulls the open PRs (the hundred most recently active by default; `limit` raises it) and places each on the repo's architecture (its layers and components), marking which ones come from outside contributors and which have CI trouble. It packs the reviewable ones into hour-long sessions grouped by component, then gives each PR a study brief.
6
6
 
7
- From there you can go two ways. A button on each PR starts a deep-review session in a terminal, in the GitHub Copilot CLI or Claude Code, where you predict what the PR does, answer questions about it, explain it back, and list your concerns before the agent shows you its own. Or you study it right in the dashboard: an assistant quizzes you on the change one question at a time and keeps everything you got right and wrong in an append-only study log that becomes part of the brief. Given a model (GitHub Copilot through the Copilot SDK, or Claude or GPT through their own APIs, including Azure OpenAI), the assistant reads the code and grades your answers; without one, a rules-based assistant asks the questions the repo's profile already carries and never pretends to grade.
7
+ From there you can go two ways. A button on each PR starts a deep-review session in a terminal, in the GitHub Copilot CLI or Claude Code, where you predict what the PR does, answer questions about it, explain it back, and list your concerns before the agent shows you its own. Or you study it right in the dashboard: an assistant quizzes you on the change one question at a time and keeps everything you got right and wrong in an append-only study log that becomes part of the brief. Given a model (GitHub Copilot through the Copilot SDK, or Claude or GPT through their own APIs, including Azure OpenAI), the assistant reads the code and grades your answers; without one, a rules-based assistant asks the questions the repo's profile already carries and never pretends to grade. In VS Code the two meet: the dashboard sits beside the deep-review session, steered by the agent, which puts the PR on the map before you predict and opens its brief after.
8
8
 
9
9
  ![The architecture map of microsoft/vscode, with each open PR placed on the component it changes most](https://raw.githubusercontent.com/spencrr/readthrough/main/docs/img/map.webp)
10
10
 
@@ -21,19 +21,23 @@ uv tool install "readthrough[study]" # from PyPI; drop [study] to skip
21
21
 
22
22
  readthrough onboard microsoft/vscode --accept # map the repo's architecture (edit the draft first if you like)
23
23
  readthrough build --open # fetch the PRs and open the dashboard
24
+ readthrough install # the rest, one question each: the agents' review skill, the VS Code canvas, the live server
24
25
  ```
25
26
 
26
27
  Repos elsewhere take a `--forge`: `readthrough onboard --forge forgejo forgejo/forgejo`, `--forge gitlab gitlab-org/cli`, or `--forge ado organization/project/repository`. Those are read through the platform's REST API, with a token from its own CLI (`glab`, `az`) or an environment variable when there is one, and anonymously otherwise, which is enough for public repos.
27
28
 
28
- That gives you a static dashboard you rebuild when you want. For one that stays fresh, run the live server (`readthrough serve`, or `readthrough install server` to start it at logon on Windows) and open <http://127.0.0.1:8765/>; with nothing onboarded yet it walks you through onboarding, with a model drafting the profile if you like. `readthrough install skill` teaches the review agents the deep-review routine, and `readthrough doctor` tells you what's missing.
29
+ That gives you a static dashboard you rebuild when you want. For one that stays fresh, run the live server (`readthrough serve`, or let `readthrough install` start it at logon on Windows) and open <http://127.0.0.1:8765/>; with nothing onboarded yet it walks you through onboarding, with a model drafting the profile if you like. `readthrough install` offers everything else readthrough can set up on your machine and asks about each (`--all` skips the questions); `readthrough doctor` tells you what's missing afterwards.
29
30
 
30
31
  ![Studying a vscode PR: the prediction, a question the model asked, the answer, and its verdict with evidence](https://raw.githubusercontent.com/spencrr/readthrough/main/docs/img/study.webp)
31
32
 
33
+ ![A deep review in VS Code's Agents window, with the dashboard beside it: the agent has placed the PR on the architecture map and asked for a prediction](https://raw.githubusercontent.com/spencrr/readthrough/main/docs/img/canvas.webp)
34
+
32
35
  ## Docs
33
36
 
34
37
  - [Using readthrough](https://github.com/spencrr/readthrough/blob/main/docs/guide.md): onboarding, the dashboard, deep reviews, studying, keeping it fresh, configuration, and troubleshooting.
35
38
  - [Writing a profile](https://github.com/spencrr/readthrough/blob/main/docs/profiles.md): how to describe a repo's architecture well, and how to share it.
36
39
  - [Maintaining readthrough](https://github.com/spencrr/readthrough/blob/main/docs/maintaining.md): the checks, error handling, logging, settings, plugins, and the pages' structure.
40
+ - [Contributing](CONTRIBUTING.md): branches, commit messages, and the checks a change goes through.
37
41
  - [Working on readthrough](AGENTS.md): the exact commands and the conventions that aren't obvious.
38
42
  - [Examples](examples/): runnable scripts, including one that needs nothing but the standard library.
39
43
  - [Changelog](CHANGELOG.md).
@@ -87,4 +91,4 @@ git config core.hooksPath .githooks # once: run the checks before every com
87
91
  uv run python scripts/check.py # lint, format, types, and tests with the coverage floor
88
92
  ```
89
93
 
90
- The same gate runs in CI on Linux, macOS, and Windows for every supported Python. The browser tests use an installed Edge or Chrome; locally they skip without one, on CI they fail. See [SECURITY.md](https://github.com/spencrr/readthrough/blob/main/SECURITY.md) for what the tool trusts and how to report a vulnerability.
94
+ The same gate runs in CI on Linux, macOS, and Windows for every supported Python. The browser tests run on Playwright's Chromium (`uv run playwright install chromium`), or an installed Edge or Chrome; locally they skip without one, on CI they fail. See [SECURITY.md](https://github.com/spencrr/readthrough/blob/main/SECURITY.md) for what the tool trusts and how to report a vulnerability.
@@ -12,7 +12,7 @@ Install it as a uv tool so `readthrough` is on your PATH. `[study]` adds the Cop
12
12
  uv tool install "readthrough[study]"
13
13
  ```
14
14
 
15
- Releases on PyPI are built by the repository's release workflow from a tagged commit, with signed provenance; `gh attestation verify <downloaded file> --owner spencrr` checks one. For the latest `main` instead, install from the repository: `uv tool install "readthrough[study] @ git+https://github.com/spencrr/readthrough"`.
15
+ Releases on PyPI are built by the repository's release workflow from a tagged commit, with signed provenance; `gh attestation verify <downloaded file> -R spencrr/readthrough --signer-workflow spencrr/readthrough/.github/workflows/release.yml --source-ref refs/tags/vX.Y.Z` checks one. For the latest `main` instead, install from the repository: `uv tool install "readthrough[study] @ git+https://github.com/spencrr/readthrough"`.
16
16
 
17
17
  To work on the tool itself, clone it and install it editable, so edits take effect right away:
18
18
 
@@ -23,12 +23,13 @@ uv tool install -e "~/src/readthrough[study]"
23
23
 
24
24
  If the live server is running, stop it before reinstalling (`readthrough uninstall server`, then `install server` again afterwards). Windows won't let uv replace files the server has open.
25
25
 
26
- Then run the installers. Each one is optional and can be undone with `readthrough uninstall <same thing>`.
26
+ Then run `readthrough install`. With nothing named it goes through everything readthrough can set up on this machine that isn't set up yet, says what each piece does, and asks; `--all` says yes to every recommended piece without asking (the morning nudge isn't one: it opens a browser on a timer, so it stays a question, or `readthrough install schedule`). In a script, or anywhere that isn't a terminal, `readthrough install` without `--all` only lists what it would do. Each piece can also be installed on its own, and undone with `readthrough uninstall <same thing>`:
27
27
 
28
28
  - `readthrough install skill` copies the deep-review instructions into each installed agent's skill directory: `~/.agents/skills/readthrough` for the Copilot CLI and VS Code's agent sessions, `~/.claude/skills/readthrough` for Claude Code (`--agent claude` for just one). Re-run it after pulling changes; `doctor` warns you when an installed copy is out of date.
29
29
  - `readthrough install server` starts the live dashboard now and again every time you log in. Open it with `readthrough open`, or bookmark <http://127.0.0.1:8765/>.
30
30
  - `readthrough install schedule` creates a Task Scheduler entry that refreshes every repo in the morning and opens the dashboard when something needs you. More on this below.
31
31
  - `readthrough install protocol` registers a `readthrough://` link handler for your Windows user, so the buttons in the snapshot version can start a review. The live dashboard doesn't need it. No admin rights are needed; it writes a single key under `HKCU\Software\Classes`.
32
+ - `readthrough install canvas` puts the dashboard beside agent sessions in VS Code's Agents window (see [The dashboard beside the session](#the-dashboard-beside-the-session-experimental)). Offered wherever the Copilot CLI is.
32
33
 
33
34
  None of this does anything until you onboard a repo. With the server running, its front page takes you to onboarding.
34
35
 
@@ -252,6 +253,16 @@ Sessions are linked to their PR wherever they started. Every prompt readthrough
252
253
 
253
254
  To burn down a whole session, ask Copilot for "burn down session 2 of OWNER/NAME". It gives you a quick overview of how the PRs in that session relate, then runs the routine for each one.
254
255
 
256
+ ### The dashboard beside the session (experimental)
257
+
258
+ In VS Code's Agents window a session can have *canvases*: pages shown beside the chat that the agent can open and steer. `readthrough install canvas` adds one that shows the live dashboard, so the map, a PR's panel, and its study log sit next to the deep review instead of in a browser tab you keep switching to. It needs the live dashboard running (`readthrough serve`, or `readthrough install server` to keep it running), and it appears after the Agents window reloads its extensions.
259
+
260
+ The agent opens the canvas on a repo and points it: in the predict phase it places the PR on the architecture map without opening anything (the map narrows to that one PR, so you see which components it touches and nothing more), and once you've committed it opens the brief, the overview, or the study log. The same page, a browser tab included, answers to `readthrough show 2897` (`--panel none|overview|study|brief`), which is all the agent does. Beside a session the page knows that the session is the deep review: the buttons that would start another one are hidden, and the Study tab shows the log the session writes to rather than a second composer.
261
+
262
+ ![The dashboard beside a deep-review session in VS Code's Agents window, narrowed to the one PR under review](img/canvas.webp)
263
+
264
+ The canvas is a small Copilot extension (two JavaScript files the Copilot runtime loads, under `~/.copilot/extensions/readthrough/`) that only runs the `readthrough` CLI; it records which interpreter installed it, so it keeps working when the editor's PATH doesn't have `readthrough`. `readthrough doctor` says whether the installed copy matches the version you have; `readthrough uninstall canvas` removes exactly what was installed. The canvas API is experimental in the Copilot SDK, so this part of readthrough is too.
265
+
255
266
  ## Studying a PR
256
267
 
257
268
  The deep review is a long, guided conversation in a terminal. The **Study** tab in the PR panel is the lighter version, right in the dashboard, for building understanding a question at a time. It needs the live dashboard.
@@ -486,7 +497,7 @@ Every command except `onboard`, `repos`, `default`, `remove`, `install`, `uninst
486
497
  | Command | What it does |
487
498
  | --- | --- |
488
499
  | `onboard OWNER/NAME [--forge F] [--clone P] [--account A] [--assisted] [--update] [--preview] [--accept] [--force]` | Draft, check, preview, and accept a repo's profile |
489
- | `repos` | List the repos you've onboarded |
500
+ | `repos [--json]` | List the repos you've onboarded (`--json` for programs: the live server, each repo's URL) |
490
501
  | `default OWNER/NAME` | Set the default repo |
491
502
  | `remove OWNER/NAME [--purge]` | Stop tracking a repo |
492
503
  | `profile [show\|check\|sources\|path\|export] [--file F]` | Look at, check, or export the repo's profile |
@@ -494,12 +505,14 @@ Every command except `onboard`, `repos`, `default`, `remove`, `install`, `uninst
494
505
  | `build [--all] [--open [auto\|always\|never]] [--no-diffs]` | Fetch, analyze, and write the snapshot and briefs |
495
506
  | `open` | Open the dashboard (live if the server is up) |
496
507
  | `brief N [--path]` | Print a PR's study brief |
508
+ | `show N [--panel none\|overview\|study\|brief] [--client ID] [--wait S]` | Point every open dashboard page at a PR |
497
509
  | `review N [--fresh] [--here] [--vscode] [--print]` | Start or resume the deep-review session |
498
510
  | `worktree N [--remove]` | Check out a PR in its own worktree and print the diff command |
499
511
  | `ledger N [--status S] [--note T] [--clear]` | Record, show, or clear what you did with a PR |
500
512
  | `study N [--prediction T] [--teachback T] [--note T] [--finding S:T --at P:L]` | Show or add to a PR's study log |
501
513
  | (browser) `/setup` | Onboard a repo, or change a repo's settings |
502
- | `install` / `uninstall skill\|server\|schedule\|protocol` | Manage the integrations |
514
+ | `install [skill\|server\|schedule\|protocol\|canvas] [--all]` | Set up the integrations: all that are missing, asking about each, or one |
515
+ | `uninstall skill\|server\|schedule\|protocol\|canvas` | Undo one |
503
516
  | `config [--edit] [--defaults] [--check]` | Show, open, explain, or validate the configuration |
504
517
  | `doctor [--bundle]` | Check the setup, or write a debug bundle for a bug report |
505
518
 
@@ -4,7 +4,7 @@ How the code handles failure, where settings live, and how to check a change bef
4
4
 
5
5
  ## Checking a change
6
6
 
7
- The same gate runs on your machine and in CI. `.github/workflows/test.yml` is the gate as a reusable workflow (lint and types on Linux, tests on Linux, macOS, and Windows for every supported Python, then a build that installs the wheel into a clean environment and uploads it as the `dist` artifact); `ci.yml` calls it on every push and PR and adds `gate`, which is green only when everything in it was. `zizmor.yml` lints the workflows themselves and fails on any finding. `gate` and `zizmor` are the two checks the branch ruleset requires. The browser tests fail on CI if the runner has no Chrome or Edge, where locally they would skip:
7
+ The same gate runs on your machine and in CI. `.github/workflows/test.yml` is the gate as a reusable workflow (lint and types on Linux, tests on Linux, macOS, and Windows for every supported Python, then a build that installs the wheel into a clean environment and uploads it as the `dist` artifact); `ci.yml` calls it on every push and PR and adds `gate`, which is green only when everything in it was. `zizmor.yml` lints the workflows themselves and fails on any finding. `commits.yml` checks that a pull request's title and every commit in it follow Conventional Commits (`CONTRIBUTING.md`; the grammar is `scripts/commit_messages.py`, which the tests cover). `gate`, `zizmor`, and `commits` are the checks the branch ruleset requires. The browser tests fail on CI if the runner has no Chrome or Edge, where locally they would skip:
8
8
 
9
9
  ```sh
10
10
  uv run python scripts/check.py # lint, format, types, tests with the coverage floor
@@ -29,7 +29,7 @@ The gates:
29
29
  | types | ty | Pinned to an exact version in the dev group, because it's pre-1.0 and its diagnostics change between releases. Bump it on purpose, with the fixes in the same commit. Covers `src`, `tests`, and `scripts`. Production code is written against `forges.Forge` and the `Protocol`s (`membership.Membership`, `assistants.Assistant`, `assistants.Harness`) rather than a concrete adapter, which is what lets the tests' fakes type-check. |
30
30
  | tests | pytest with pytest-cov | Fails below the floor in `[tool.coverage.report] fail_under`. Raise the floor when coverage goes up; don't lower it to get a change in. |
31
31
 
32
- The browser tests (`tests/test_browser.py`, marked `browser`) drive the real dashboard and setup page in headless Edge or Chrome through Playwright. They use whichever of those is installed and are skipped if neither is. They catch script errors and broken interactions that Python tests can't see. The first time they ran, they found a chart that drew negative-size shapes.
32
+ The browser tests (`tests/test_browser.py`, marked `browser`) drive the real dashboard and setup page in a headless Chromium through Playwright: Playwright's own build first (`uv run playwright install chromium` fetches it), so a run on your machine and a run on CI use the same engine, else an installed Edge or Chrome; they are skipped if there is none. The branded builds are more lenient in places, which is how a test can pass locally and fail on CI; the test report's last line names the engine that ran. They catch script errors and broken interactions that Python tests can't see. The first time they ran, they found a chart that drew negative-size shapes.
33
33
 
34
34
  The end-to-end tests (`tests/test_e2e.py`, marked `e2e`) run the real `readthrough` executable as a subprocess, with `tests/fake_gh.py` standing in for `gh` through `READTHROUGH_GH`. That's the one place the whole program is exercised the way a user runs it: onboarding, a build, studying from the terminal, a second build that must hit the diff cache, `doctor`. The first time it ran, it found that a legitimately empty diff was never cached, so docs-only PRs were re-fetched on every refresh.
35
35
 
@@ -37,7 +37,7 @@ Tests never touch the network, `gh`, git, Copilot, the registry, or the schedule
37
37
 
38
38
  The recordings come from `scripts/probe_forge.py --record`, which runs an adapter against a real public repo (codeberg.org/forgejo/forgejo, gitlab.com/gitlab-org/cli, dev.azure.com/powershell) and writes every response, including the refusals, keyed by request. Re-record when an adapter asks for something new; the tests then need their expectations refreshed, since the data is whatever the forge said that day. Only a few response headers are kept and known identity fields are scrubbed, so a recording holds nothing about whoever made it.
39
39
 
40
- The screenshots in `docs/img/` come from `scripts/screenshots.py`, which serves a repo you've built through the live server, drives headless Edge or Chrome through Playwright at a fixed size in the light theme, and writes WebP (Pillow converts; Playwright writes only PNG and JPEG). They show microsoft/vscode, onboarded into a scratch home: `READTHROUGH_HOME=~/.readthrough-docs readthrough onboard microsoft/vscode --accept`, a build, a real study exchange on one PR, then `scripts/screenshots.py --repo microsoft/vscode --pr <n>`. Re-take them after a visible change to the pages.
40
+ The screenshots in `docs/img/` come from `scripts/screenshots.py`, which serves a repo you've built through the live server, drives headless Edge or Chrome through Playwright at a fixed size in the light theme, and writes WebP (Pillow converts; Playwright writes only PNG and JPEG). They show microsoft/vscode, onboarded into a scratch home: `READTHROUGH_HOME=~/.readthrough-docs readthrough onboard microsoft/vscode --accept`, a build, a real study exchange on one PR, then `scripts/screenshots.py --repo microsoft/vscode --pr <n>`. Re-take them after a visible change to the pages. The one a headless browser can't take, the dashboard beside an agent session (`canvas.webp`), comes from `scripts/screenshot_canvas.py`, Windows only: it starts a second VS Code on a throwaway profile, opens an agent session with a prompt that has the agent open the canvas, and captures the window once you've sent the prompt and the agent has asked its question; the profile is signed in to GitHub once and remembers it.
41
41
 
42
42
  ## Failures
43
43
 
@@ -120,7 +120,7 @@ The UI lives in `assets/web/`. Each page has its own `.html`, `.css`, and `.js`,
120
120
  - Every script carries a per-render nonce, and the content security policy runs nothing else. Don't add inline event handlers (`onclick=`); use the delegated listeners.
121
121
  - PR descriptions and comments are third-party HTML. They go through DOMPurify, and `test_browser.py` checks that an `onerror` attribute doesn't survive.
122
122
  - Escape everything else you interpolate with `esc()`.
123
- - Third-party JavaScript is vendored under `assets/vendor/` with its license, and listed in `build.VENDOR_SCRIPTS`. The page makes no requests to other sites.
123
+ - Third-party JavaScript is vendored under `assets/vendor/` with its license, and listed in `build.VENDOR_SCRIPTS`. The page itself makes no requests to other sites; the images in a PR's description are the one exception, and `SECURITY.md` says what that means.
124
124
  - Check both themes. New colors go in `theme.css` as tokens if both pages use them, otherwise at the top of the page's CSS.
125
125
 
126
126
  ### The contract with the server
@@ -146,21 +146,24 @@ A terminal launcher is a pure function from a `Command` to a `Spawn`; only the W
146
146
 
147
147
  ## Releasing
148
148
 
149
- A release is a `vX.Y.Z` tag on `main` (or on a `release/*` branch, for a patch to an older line). The tag starts `.github/workflows/release.yml`, which checks that the tagged commit is on one of those branches, that the tag is the version in `pyproject.toml`, and that `CHANGELOG.md` has a section for it; runs the whole gate again through `test.yml`; and then waits. Approving the `pypi` environment (Actions → the run → *Review deployments*) lets the last job run: it takes the wheel and sdist the gate built, attests their provenance, uploads them to PyPI through trusted publishing (no token anywhere), and creates the GitHub release with the changelog section as its notes. Nothing in that last job builds anything, and nothing starts it but a tag plus a click, so a leaked push credential can burn runner minutes but can't publish.
149
+ A release is a `vX.Y.Z` tag on `main` (or on a `release/*` branch, for a patch to an older line). The tag starts `.github/workflows/release.yml`, which checks that the tagged commit is on one of those branches, that the tag is the version in `pyproject.toml`, and that `CHANGELOG.md` has a section for it; runs the whole gate again through `test.yml`; and then waits. Approving the `pypi` environment (Actions → the run → *Review deployments*) lets the last job run: it takes the wheel and sdist the gate built, attests their provenance, uploads them to PyPI through trusted publishing (no token anywhere), and creates the GitHub release with the changelog section as its notes. Nothing in that last job builds anything, and nothing starts it but a tag plus a click. Who can do what is set by the repository's rulesets: only an admin creates tags or `release/*` branches (or any branch outside `dev/*`, which is where everyone's work in progress goes, under their own login), and anyone else lands a commit on `main` only through a pull request that the code owner (`.github/CODEOWNERS`: the maintainer) has approved, with the branch brought up to date first so the commit that lands is the one the checks ran on; so a collaborator's credential can't start a release, and a branch run can't enter the `pypi` environment, whose policy admits only `v*` tags. The admin's own credential is the root of trust: a token with the `repo` scope can push the tag and approve the deployment, so there is no gate against it beyond keeping it safe (push with an SSH key, and treat the `gh` login as the credential it is). A GitHub release someone else created for the tag ahead of the pipeline makes the publish job fail rather than pass, since it only leaves an existing release alone when it carries exactly the files it built.
150
150
 
151
151
  1. Bump `version` in `pyproject.toml` and run `uv lock`, so the lockfile names the new version (`UV_LOCKED` in CI refuses a stale one). `readthrough.__version__` reads it from the installed package.
152
152
  2. Add a `## X.Y.Z (YYYY-MM-DD)` section to `CHANGELOG.md`; the release notes are that section, up to the next heading.
153
- 3. Run `uv run python scripts/check.py`, commit, and push `main`. Wait for CI.
154
- 4. `git tag vX.Y.Z && git push origin vX.Y.Z`. Only a repository admin can create a `v*` tag, and once it exists it can't be moved or deleted.
153
+ 3. Run `uv run python scripts/check.py`, commit on a `dev/<login>/*` branch, and land it on `main` through a pull request (nothing reaches `main` any other way). Wait for CI.
154
+ 4. `git tag vX.Y.Z && git push origin vX.Y.Z`. Only a repository admin can create a tag, and once a `v*` tag exists it can't be moved or deleted. The release is marked latest only when its version is the highest released, so a patch to an older line doesn't take the badge from a newer one.
155
155
  5. Approve the deployment when the run reaches `publish`. Then check it from the outside, on a downloaded file rather than a local build:
156
156
 
157
157
  ```sh
158
158
  gh release verify vX.Y.Z # the release is immutable and attested
159
159
  gh release verify-asset vX.Y.Z readthrough-X.Y.Z-py3-none-any.whl # this file is the published asset
160
- gh attestation verify readthrough-X.Y.Z-py3-none-any.whl --owner spencrr # built by release.yml at the tagged commit
160
+ gh attestation verify readthrough-X.Y.Z-py3-none-any.whl -R spencrr/readthrough \
161
+ --signer-workflow spencrr/readthrough/.github/workflows/release.yml --source-ref refs/tags/vX.Y.Z # built by release.yml from this tag
161
162
  uv tool install readthrough==X.Y.Z && readthrough --version
162
163
  ```
163
164
 
164
165
  If the run fails after PyPI accepted the files, fix what failed and re-run the failed job: the upload skips files PyPI already has, and the release step leaves an existing release alone. The tag can't be moved, so a mistake in the release itself means a new patch version.
165
166
 
166
- For a patch to an older line when `main` has unfinished work: `git switch -c release/X.Y vX.Y.0`, cherry-pick with `-x`, release from there, and add the changelog section to `main` by hand.
167
+ For a patch to an older line when `main` has unfinished work: `git switch -c release/X.Y vX.Y.0`, cherry-pick with `-x`, release from there, and add the changelog section to `main` by hand.
168
+
169
+ The toolchain that builds a release is pinned, in two places: `uv` is whatever version the pinned `setup-uv` action ships a checksum for (`version: latest-known`, so Dependabot's bump of the action, after its cooldown, is what moves `uv`), and the build backend is an exact `build-constraint-dependencies` entry in `pyproject.toml`, bumped by hand like `ty`.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "readthrough"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  description = "Lay a repo's open pull requests out on its architecture, then study each one before you review it."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -58,11 +58,16 @@ dev = [
58
58
  "pillow>=10",
59
59
  ]
60
60
 
61
+ [tool.uv]
62
+ # The build backend is resolved at build time, outside uv.lock; pinned exactly so a release is built by a known
63
+ # version (1.33.0 built 0.4.0). Bump it deliberately, like ty.
64
+ build-constraint-dependencies = ["hatchling==1.33.0"]
65
+
61
66
  [tool.uv.sources]
62
67
  readthrough = { workspace = true }
63
68
 
64
69
  [tool.hatch.build.targets.sdist]
65
- include = ["src/readthrough", "tests", "docs", "examples", "CHANGELOG.md", "LICENSE", "README.md", "AGENTS.md"]
70
+ include = ["src/readthrough", "tests", "docs", "examples", "CHANGELOG.md", "CONTRIBUTING.md", "LICENSE", "README.md", "AGENTS.md"]
66
71
  exclude = ["docs/img"]
67
72
 
68
73
  [tool.hatch.build.targets.wheel]
@@ -154,8 +159,9 @@ skip_covered = true
154
159
 
155
160
  [tool.ty.environment]
156
161
  python-version = "3.11"
157
- # tests/ is a root too, so `from conftest import ...` resolves the way pytest's rootdir import does.
158
- root = ["src", "tests"]
162
+ # tests/ is a root too, so `from conftest import ...` resolves the way pytest's rootdir import does; scripts/ so a
163
+ # test can import the script it checks.
164
+ root = ["src", "tests", "scripts"]
159
165
 
160
166
  [tool.ty.src]
161
167
  include = ["src", "tests", "scripts"]
@@ -23,6 +23,7 @@ import re
23
23
  import sys
24
24
  from collections.abc import Iterator
25
25
  from dataclasses import dataclass, field
26
+ from importlib.resources import files
26
27
  from pathlib import Path
27
28
  from typing import Any, ClassVar
28
29
 
@@ -35,6 +36,11 @@ AUTO_ORDER = ("copilot", "claude") # the first installed wins when agent = "aut
35
36
  SKILL_NAME = "readthrough"
36
37
 
37
38
 
39
+ def bundled_skill() -> str:
40
+ """The deep-review skill as shipped, which ``install skill`` writes and ``doctor`` compares against."""
41
+ return files("readthrough").joinpath("assets/SKILL.md").read_text(encoding="utf-8")
42
+
43
+
38
44
  @dataclass(frozen=True)
39
45
  class SessionRecord:
40
46
  """A session as found on disk, before anything is read from it."""
@@ -36,6 +36,8 @@ You may have been launched by the dashboard's review button. If so, this session
36
36
 
37
37
  In the commands below, `R` stands for `--repo OWNER/NAME`.
38
38
 
39
+ **If your host renders canvases** (you have `open_canvas` and `invoke_canvas_action` tools and a `readthrough` canvas is listed), show the dashboard beside this session instead of describing it. In Phase 0, `open_canvas` with a stable `instanceId` and `{"repo": "OWNER/NAME"}`; if it says the live dashboard isn't running, tell the user to run `readthrough serve` and carry on without it. Then steer it with the `show` action, one PR at a time: in Phase 1 `{"pr": N, "panel": "none"}`, which places the PR on the architecture map and reveals nothing else; from Phase 2 `"panel": "brief"` for the reading order and contracts; in Phase 4 `"panel": "study"` so the user sees the evidence you both built. The canvas reads; everything you record still goes through the CLI commands below, which the user can see. If your host has canvas tools but lists no `readthrough` canvas, say once, in one line, that `readthrough install canvas` would put the dashboard beside this session from the next session on, then carry on. Without canvas tools, skip this paragraph: nothing else changes.
40
+
39
41
  ### Phase 0: Prepare (silent)
40
42
 
41
43
  1. `readthrough R profile show`. This is the repo's architecture profile: its layers and components, where its component contracts live, its review guidance, and its test command. Follow the review guidance throughout.
@@ -0,0 +1,96 @@
1
+ // The readthrough canvas: the live dashboard beside an agent session, in any Copilot host that renders canvases.
2
+ //
3
+ // `readthrough install canvas` puts this directory under the Copilot home's `extensions/`; the Copilot runtime
4
+ // loads it into each session, with its own copy of the SDK. It declares one canvas whose page is the dashboard
5
+ // the user already runs (`readthrough serve`), so the view is the same page a browser shows, told through
6
+ // `canvas=<instance>` in its URL that an agent session sits beside it. The agent steers it with the `show`
7
+ // action, and reads a PR's brief or study log, all through the readthrough CLI; nothing is written here.
8
+ //
9
+ // Experimental: the canvas API is marked so in the SDK, and may change under this file.
10
+
11
+ import { CanvasError, createCanvas, joinSession } from "@github/copilot-sdk/extension";
12
+
13
+ import { ACTIONS, CliError, OPEN_SCHEMA, Readthrough, text } from "./readthrough.mjs";
14
+
15
+ const canvasId = "readthrough";
16
+ let session;
17
+ const log = (message, level = "info") => {
18
+ if (session) session.log(message, { level }).catch(() => {});
19
+ };
20
+ const readthrough = new Readthrough({ log });
21
+ // The repo each open instance shows, so an action on that instance means that repo and not the CLI's default.
22
+ // Filled by open(), which the host calls again for every instance it restores after a reload.
23
+ const showing = new Map();
24
+
25
+ const toCanvasError = error =>
26
+ error instanceof CliError ? new CanvasError(error.code, error.message) : new CanvasError("readthrough_error", String(error?.message ?? error));
27
+
28
+ /** A stable instance id is also the page's name on its event stream, so steering reaches this view alone. */
29
+ const clientId = instanceId => {
30
+ const id = `canvas-${String(instanceId).replace(/[^A-Za-z0-9._:-]/g, "-")}`.slice(0, 64);
31
+ return text(id, "instance", { max: 64, pattern: /^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$/ });
32
+ };
33
+
34
+ const canvas = createCanvas({
35
+ id: canvasId,
36
+ displayName: "readthrough",
37
+ description: "The live readthrough dashboard: a repo's open pull requests laid out on its architecture, with each one's brief and study log, beside the deep-review session.",
38
+ inputSchema: OPEN_SCHEMA,
39
+ actions: ACTIONS.map(action => ({
40
+ name: action.name,
41
+ description: action.description,
42
+ inputSchema: action.inputSchema,
43
+ handler: async ctx => {
44
+ try {
45
+ const input = { repo: showing.get(ctx.instanceId), ...(ctx.input ?? {}) };
46
+ if (input.repo === undefined && !showing.has(ctx.instanceId)) {
47
+ throw new CliError("readthrough_not_open", "This canvas isn't open yet; open it first, or name the repo.");
48
+ }
49
+ return await action.run(readthrough, input, { ...ctx, instanceId: clientId(ctx.instanceId) });
50
+ } catch (error) {
51
+ throw toCanvasError(error);
52
+ }
53
+ },
54
+ })),
55
+
56
+ async open(ctx) {
57
+ const input = ctx.input ?? {};
58
+ let repo;
59
+ try {
60
+ repo = readthrough.pick(await readthrough.repos(), input.repo);
61
+ } catch (error) {
62
+ throw toCanvasError(error);
63
+ }
64
+ const client = clientId(ctx.instanceId);
65
+ showing.set(ctx.instanceId, repo.slug);
66
+ // The URL is the same every time this instance opens, so re-opening focuses the view instead of reloading
67
+ // it; where the page should look is said separately, once it is up.
68
+ const url = `${repo.url}#map?canvas=${encodeURIComponent(client)}`;
69
+ if (input.pr !== undefined && input.pr !== null) {
70
+ readthrough
71
+ .show({ repo: repo.slug, pr: input.pr, panel: input.panel, client })
72
+ .then(result => log(`${repo.name}: ${result}`))
73
+ .catch(error => log(`${repo.name}: couldn't point the page at #${input.pr}: ${error.message}`, "warning"));
74
+ }
75
+ const built = repo.built ? `built ${new Date(repo.built).toLocaleString()}` : "not built yet";
76
+ const renders = ctx.host?.capabilities?.canvases !== false;
77
+ return {
78
+ url,
79
+ title: `readthrough · ${repo.name}`,
80
+ status: renders ? built : `${built} · this host doesn't render canvases; open ${repo.url} in a browser`,
81
+ };
82
+ },
83
+
84
+ onClose(ctx) {
85
+ // The dashboard is the user's, served for every page that shows it; closing a view stops nothing.
86
+ showing.delete(ctx.instanceId);
87
+ log(`canvas ${ctx.instanceId} closed`);
88
+ },
89
+ });
90
+
91
+ try {
92
+ session = await joinSession({ canvases: [canvas] });
93
+ } catch (error) {
94
+ // An older runtime without canvases: there is nothing for this extension to do, and nothing to break.
95
+ process.stderr.write(`readthrough canvas: not loaded (${error?.message ?? error})\n`);
96
+ }