readthrough 0.4.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 (185) hide show
  1. readthrough-0.4.0/.gitignore +35 -0
  2. readthrough-0.4.0/AGENTS.md +112 -0
  3. readthrough-0.4.0/CHANGELOG.md +320 -0
  4. readthrough-0.4.0/LICENSE +21 -0
  5. readthrough-0.4.0/PKG-INFO +123 -0
  6. readthrough-0.4.0/README.md +90 -0
  7. readthrough-0.4.0/docs/guide.md +540 -0
  8. readthrough-0.4.0/docs/maintaining.md +166 -0
  9. readthrough-0.4.0/docs/profiles.md +102 -0
  10. readthrough-0.4.0/examples/README.md +12 -0
  11. readthrough-0.4.0/examples/custom_profile_source.py +83 -0
  12. readthrough-0.4.0/examples/offline_analysis.py +144 -0
  13. readthrough-0.4.0/pyproject.toml +161 -0
  14. readthrough-0.4.0/src/readthrough/__init__.py +8 -0
  15. readthrough-0.4.0/src/readthrough/__main__.py +3 -0
  16. readthrough-0.4.0/src/readthrough/agents.py +344 -0
  17. readthrough-0.4.0/src/readthrough/analyze.py +537 -0
  18. readthrough-0.4.0/src/readthrough/assets/SKILL.md +86 -0
  19. readthrough-0.4.0/src/readthrough/assets/defaults.toml +143 -0
  20. readthrough-0.4.0/src/readthrough/assets/profile-reference.md +133 -0
  21. readthrough-0.4.0/src/readthrough/assets/vendor/README.md +22 -0
  22. readthrough-0.4.0/src/readthrough/assets/vendor/cose-base.js +3214 -0
  23. readthrough-0.4.0/src/readthrough/assets/vendor/cytoscape-fcose.js +1549 -0
  24. readthrough-0.4.0/src/readthrough/assets/vendor/cytoscape.min.js +31 -0
  25. readthrough-0.4.0/src/readthrough/assets/vendor/layout-base.js +5230 -0
  26. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/cose-base-LICENSE +21 -0
  27. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/cytoscape-LICENSE +19 -0
  28. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/cytoscape-fcose-LICENSE +19 -0
  29. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/dompurify-LICENSE +202 -0
  30. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/layout-base-LICENSE +21 -0
  31. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/lucide-LICENSE +15 -0
  32. readthrough-0.4.0/src/readthrough/assets/vendor/licenses/marked-LICENSE +44 -0
  33. readthrough-0.4.0/src/readthrough/assets/vendor/lucide-icons.js +36 -0
  34. readthrough-0.4.0/src/readthrough/assets/vendor/marked.umd.js +82 -0
  35. readthrough-0.4.0/src/readthrough/assets/vendor/purify.min.js +7 -0
  36. readthrough-0.4.0/src/readthrough/assets/web/dashboard.css +202 -0
  37. readthrough-0.4.0/src/readthrough/assets/web/dashboard.html +48 -0
  38. readthrough-0.4.0/src/readthrough/assets/web/dashboard.js +937 -0
  39. readthrough-0.4.0/src/readthrough/assets/web/setup.css +57 -0
  40. readthrough-0.4.0/src/readthrough/assets/web/setup.html +28 -0
  41. readthrough-0.4.0/src/readthrough/assets/web/setup.js +342 -0
  42. readthrough-0.4.0/src/readthrough/assets/web/theme.css +36 -0
  43. readthrough-0.4.0/src/readthrough/assistants.py +699 -0
  44. readthrough-0.4.0/src/readthrough/brief.py +145 -0
  45. readthrough-0.4.0/src/readthrough/build.py +616 -0
  46. readthrough-0.4.0/src/readthrough/ci.py +107 -0
  47. readthrough-0.4.0/src/readthrough/cli.py +958 -0
  48. readthrough-0.4.0/src/readthrough/config.py +533 -0
  49. readthrough-0.4.0/src/readthrough/contract.py +394 -0
  50. readthrough-0.4.0/src/readthrough/engine.py +230 -0
  51. readthrough-0.4.0/src/readthrough/faults.py +92 -0
  52. readthrough-0.4.0/src/readthrough/files.py +110 -0
  53. readthrough-0.4.0/src/readthrough/forges/__init__.py +614 -0
  54. readthrough-0.4.0/src/readthrough/forges/azure_devops.py +658 -0
  55. readthrough-0.4.0/src/readthrough/forges/forgejo.py +300 -0
  56. readthrough-0.4.0/src/readthrough/forges/github.py +487 -0
  57. readthrough-0.4.0/src/readthrough/forges/gitlab.py +335 -0
  58. readthrough-0.4.0/src/readthrough/ledger.py +61 -0
  59. readthrough-0.4.0/src/readthrough/limits.py +26 -0
  60. readthrough-0.4.0/src/readthrough/logs.py +169 -0
  61. readthrough-0.4.0/src/readthrough/membership.py +76 -0
  62. readthrough-0.4.0/src/readthrough/model.py +177 -0
  63. readthrough-0.4.0/src/readthrough/onboard.py +551 -0
  64. readthrough-0.4.0/src/readthrough/onboard_model.py +319 -0
  65. readthrough-0.4.0/src/readthrough/process.py +169 -0
  66. readthrough-0.4.0/src/readthrough/profile.py +699 -0
  67. readthrough-0.4.0/src/readthrough/py.typed +0 -0
  68. readthrough-0.4.0/src/readthrough/registry.py +157 -0
  69. readthrough-0.4.0/src/readthrough/review.py +394 -0
  70. readthrough-0.4.0/src/readthrough/rules.py +111 -0
  71. readthrough-0.4.0/src/readthrough/runtimes/__init__.py +297 -0
  72. readthrough-0.4.0/src/readthrough/runtimes/anthropic.py +278 -0
  73. readthrough-0.4.0/src/readthrough/runtimes/copilot.py +313 -0
  74. readthrough-0.4.0/src/readthrough/runtimes/openai.py +307 -0
  75. readthrough-0.4.0/src/readthrough/serve.py +817 -0
  76. readthrough-0.4.0/src/readthrough/study.py +327 -0
  77. readthrough-0.4.0/src/readthrough/system.py +205 -0
  78. readthrough-0.4.0/src/readthrough/terminals.py +168 -0
  79. readthrough-0.4.0/src/readthrough/tuning.py +266 -0
  80. readthrough-0.4.0/src/readthrough/usage.py +169 -0
  81. readthrough-0.4.0/src/readthrough/web_setup.py +635 -0
  82. readthrough-0.4.0/tests/conftest.py +121 -0
  83. readthrough-0.4.0/tests/fake_gh.py +282 -0
  84. readthrough-0.4.0/tests/fakes.py +149 -0
  85. readthrough-0.4.0/tests/fixtures/courier.toml +303 -0
  86. readthrough-0.4.0/tests/fixtures/forges/README.md +18 -0
  87. readthrough-0.4.0/tests/fixtures/forges/ado/03be324e4f9e.json +9 -0
  88. readthrough-0.4.0/tests/fixtures/forges/ado/090629072c7e.json +9 -0
  89. readthrough-0.4.0/tests/fixtures/forges/ado/0e1fe07a4beb.json +9 -0
  90. readthrough-0.4.0/tests/fixtures/forges/ado/21609ce43570.json +9 -0
  91. readthrough-0.4.0/tests/fixtures/forges/ado/23c144c8cae2.json +9 -0
  92. readthrough-0.4.0/tests/fixtures/forges/ado/2f67f0784d3f.json +9 -0
  93. readthrough-0.4.0/tests/fixtures/forges/ado/4b737519e721.json +9 -0
  94. readthrough-0.4.0/tests/fixtures/forges/ado/7f26382a26ef.json +9 -0
  95. readthrough-0.4.0/tests/fixtures/forges/ado/9221b6d0840a.json +9 -0
  96. readthrough-0.4.0/tests/fixtures/forges/ado/92c5290eaff1.json +9 -0
  97. readthrough-0.4.0/tests/fixtures/forges/ado/e71b9e3fc4c0.json +10 -0
  98. readthrough-0.4.0/tests/fixtures/forges/ado/f3509478d4d7.json +9 -0
  99. readthrough-0.4.0/tests/fixtures/forges/ado/fc6b5e815e82.json +9 -0
  100. readthrough-0.4.0/tests/fixtures/forges/ado/index.json +105 -0
  101. readthrough-0.4.0/tests/fixtures/forges/forgejo/0cebf0b65aa5.json +11 -0
  102. readthrough-0.4.0/tests/fixtures/forges/forgejo/165113c4eabe.json +9 -0
  103. readthrough-0.4.0/tests/fixtures/forges/forgejo/26c499a0bd6b.json +10 -0
  104. readthrough-0.4.0/tests/fixtures/forges/forgejo/274a37d8bb25.json +11 -0
  105. readthrough-0.4.0/tests/fixtures/forges/forgejo/2e89d19be1f1.json +10 -0
  106. readthrough-0.4.0/tests/fixtures/forges/forgejo/39bdce47eea5.json +9 -0
  107. readthrough-0.4.0/tests/fixtures/forges/forgejo/4101cf99b3ab.json +10 -0
  108. readthrough-0.4.0/tests/fixtures/forges/forgejo/4b5a777cdf98.json +10 -0
  109. readthrough-0.4.0/tests/fixtures/forges/forgejo/59c71da3f041.json +10 -0
  110. readthrough-0.4.0/tests/fixtures/forges/forgejo/5a273c90feeb.json +9 -0
  111. readthrough-0.4.0/tests/fixtures/forges/forgejo/5c250e7135fc.json +10 -0
  112. readthrough-0.4.0/tests/fixtures/forges/forgejo/5dd2f033485b.json +9 -0
  113. readthrough-0.4.0/tests/fixtures/forges/forgejo/649b79bcdb19.json +10 -0
  114. readthrough-0.4.0/tests/fixtures/forges/forgejo/6a44ccb778e2.json +11 -0
  115. readthrough-0.4.0/tests/fixtures/forges/forgejo/9389f28310ef.json +11 -0
  116. readthrough-0.4.0/tests/fixtures/forges/forgejo/963f7a37840f.json +11 -0
  117. readthrough-0.4.0/tests/fixtures/forges/forgejo/a1dcb3f2df5a.json +11 -0
  118. readthrough-0.4.0/tests/fixtures/forges/forgejo/a467e70e374c.json +9 -0
  119. readthrough-0.4.0/tests/fixtures/forges/forgejo/aad3937bc2be.json +10 -0
  120. readthrough-0.4.0/tests/fixtures/forges/forgejo/abf7a246a063.json +11 -0
  121. readthrough-0.4.0/tests/fixtures/forges/forgejo/ae2091aa681b.json +9 -0
  122. readthrough-0.4.0/tests/fixtures/forges/forgejo/b3bcdf26f5f2.json +9 -0
  123. readthrough-0.4.0/tests/fixtures/forges/forgejo/c5f794f6d12a.json +9 -0
  124. readthrough-0.4.0/tests/fixtures/forges/forgejo/e97f70ce7e2e.json +9 -0
  125. readthrough-0.4.0/tests/fixtures/forges/forgejo/ee76ff2b2aa7.json +9 -0
  126. readthrough-0.4.0/tests/fixtures/forges/forgejo/fcd900fc02ac.json +10 -0
  127. readthrough-0.4.0/tests/fixtures/forges/forgejo/index.json +162 -0
  128. readthrough-0.4.0/tests/fixtures/forges/gitlab/03addf8039b3.json +12 -0
  129. readthrough-0.4.0/tests/fixtures/forges/gitlab/054a7bf76049.json +10 -0
  130. readthrough-0.4.0/tests/fixtures/forges/gitlab/05a1a7170d04.json +12 -0
  131. readthrough-0.4.0/tests/fixtures/forges/gitlab/0603a56f5c6e.json +10 -0
  132. readthrough-0.4.0/tests/fixtures/forges/gitlab/1faa33d3d89d.json +12 -0
  133. readthrough-0.4.0/tests/fixtures/forges/gitlab/2214b16b333f.json +10 -0
  134. readthrough-0.4.0/tests/fixtures/forges/gitlab/229ccc31e324.json +12 -0
  135. readthrough-0.4.0/tests/fixtures/forges/gitlab/235e10ac50b2.json +12 -0
  136. readthrough-0.4.0/tests/fixtures/forges/gitlab/26c82541d833.json +12 -0
  137. readthrough-0.4.0/tests/fixtures/forges/gitlab/293c168adbb5.json +10 -0
  138. readthrough-0.4.0/tests/fixtures/forges/gitlab/3a0f3d9a23f8.json +10 -0
  139. readthrough-0.4.0/tests/fixtures/forges/gitlab/4f32035198bb.json +12 -0
  140. readthrough-0.4.0/tests/fixtures/forges/gitlab/5a7f9f9571ba.json +12 -0
  141. readthrough-0.4.0/tests/fixtures/forges/gitlab/5d53ec48c954.json +12 -0
  142. readthrough-0.4.0/tests/fixtures/forges/gitlab/6c9d9aaf4865.json +12 -0
  143. readthrough-0.4.0/tests/fixtures/forges/gitlab/6d0b7f56058c.json +10 -0
  144. readthrough-0.4.0/tests/fixtures/forges/gitlab/6e76cb3a29c6.json +12 -0
  145. readthrough-0.4.0/tests/fixtures/forges/gitlab/6f7a226c9418.json +12 -0
  146. readthrough-0.4.0/tests/fixtures/forges/gitlab/788d7a59a435.json +10 -0
  147. readthrough-0.4.0/tests/fixtures/forges/gitlab/87847cd77255.json +12 -0
  148. readthrough-0.4.0/tests/fixtures/forges/gitlab/9159d1034171.json +12 -0
  149. readthrough-0.4.0/tests/fixtures/forges/gitlab/93514ae445cf.json +12 -0
  150. readthrough-0.4.0/tests/fixtures/forges/gitlab/995df583d679.json +12 -0
  151. readthrough-0.4.0/tests/fixtures/forges/gitlab/a103f9259efe.json +10 -0
  152. readthrough-0.4.0/tests/fixtures/forges/gitlab/ba7bbd8d7f4d.json +12 -0
  153. readthrough-0.4.0/tests/fixtures/forges/gitlab/c0d36d9d5385.json +12 -0
  154. readthrough-0.4.0/tests/fixtures/forges/gitlab/cb31d203bf57.json +12 -0
  155. readthrough-0.4.0/tests/fixtures/forges/gitlab/d9cf27bbda67.json +12 -0
  156. readthrough-0.4.0/tests/fixtures/forges/gitlab/e56b428bb2c2.json +12 -0
  157. readthrough-0.4.0/tests/fixtures/forges/gitlab/fe1e852021c5.json +12 -0
  158. readthrough-0.4.0/tests/fixtures/forges/gitlab/index.json +247 -0
  159. readthrough-0.4.0/tests/test_agents.py +104 -0
  160. readthrough-0.4.0/tests/test_analyze.py +201 -0
  161. readthrough-0.4.0/tests/test_assistants.py +501 -0
  162. readthrough-0.4.0/tests/test_browser.py +667 -0
  163. readthrough-0.4.0/tests/test_ci.py +109 -0
  164. readthrough-0.4.0/tests/test_cli.py +377 -0
  165. readthrough-0.4.0/tests/test_contract.py +163 -0
  166. readthrough-0.4.0/tests/test_e2e.py +119 -0
  167. readthrough-0.4.0/tests/test_engine.py +257 -0
  168. readthrough-0.4.0/tests/test_examples.py +24 -0
  169. readthrough-0.4.0/tests/test_forges.py +609 -0
  170. readthrough-0.4.0/tests/test_github_faults.py +528 -0
  171. readthrough-0.4.0/tests/test_jitter.py +63 -0
  172. readthrough-0.4.0/tests/test_ledger_config.py +155 -0
  173. readthrough-0.4.0/tests/test_onboard.py +289 -0
  174. readthrough-0.4.0/tests/test_onboard_model.py +309 -0
  175. readthrough-0.4.0/tests/test_profile.py +116 -0
  176. readthrough-0.4.0/tests/test_registry.py +267 -0
  177. readthrough-0.4.0/tests/test_review.py +291 -0
  178. readthrough-0.4.0/tests/test_rules.py +57 -0
  179. readthrough-0.4.0/tests/test_runtimes.py +701 -0
  180. readthrough-0.4.0/tests/test_serve.py +546 -0
  181. readthrough-0.4.0/tests/test_study.py +282 -0
  182. readthrough-0.4.0/tests/test_system.py +157 -0
  183. readthrough-0.4.0/tests/test_tuning.py +186 -0
  184. readthrough-0.4.0/tests/test_vendor.py +23 -0
  185. readthrough-0.4.0/tests/test_web_setup.py +283 -0
@@ -0,0 +1,35 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ *.egg-info/
6
+ build/
7
+ dist/
8
+
9
+ # Tool caches and reports
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .ty_cache/
13
+ .coverage
14
+ .coverage.*
15
+ coverage.xml
16
+ htmlcov/
17
+
18
+ # Anything the tool writes when run from a checkout: data, caches, logs, debug bundles
19
+ .readthrough/
20
+ readthrough.log*
21
+ logfile-*.txt
22
+ *.log
23
+ *.zip
24
+
25
+ # Editors and OS
26
+ .idea/
27
+ .vscode/
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # Secrets: never commit tokens or local environment files
32
+ .env
33
+ .env.*
34
+ *.pem
35
+ *.key
@@ -0,0 +1,112 @@
1
+ # Working on readthrough
2
+
3
+ One package, `src/readthrough`, standard library only at runtime (plus the `gh` CLI); the `[study]` extra adds the
4
+ GitHub Copilot SDK. Python 3.11 is the floor and what `.python-version` pins for development.
5
+
6
+ ## Commands
7
+
8
+ ```sh
9
+ uv sync # environment with the dev group (tests, ruff, ty, playwright) and [study]
10
+ uv run python scripts/check.py # the gate: ruff check, ruff format --check, ty check, pytest with coverage
11
+ uv run python scripts/check.py --fix # same, letting ruff fix and format first
12
+ uv run python scripts/check.py --quick # skip the browser tests (what the pre-commit hook runs)
13
+ uv run pytest tests/test_engine.py -q # one file; -k NAME for one test; -m e2e / -m browser for those groups
14
+ uv run readthrough --help # the CLI from the checkout
15
+ uv build # sdist and wheel into dist/
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
18
+ uv run python scripts/screenshots.py --repo microsoft/vscode --pr N # redraw docs/img/*.webp from a built repo
19
+ ```
20
+
21
+ 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
24
+ 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`:
27
+ `release.yml` runs the gate again and, after the maintainer approves, publishes to PyPI and GitHub
28
+ (`docs/maintaining.md`, "Releasing").
29
+
30
+ ## Conventions that aren't obvious
31
+
32
+ - **A failure is never mistaken for an answer.** "Couldn't check" must not become "no", "absent", or "nothing
33
+ to see". A value a forge may not supply is a `model.Capability` (`known` / `unsupported` / `unavailable`);
34
+ the build turns the last two into a `Warnings` entry and a per-PR `gap` signal, and `ci.classify` has an
35
+ `unknown` state. Only `read_file` / `api_or_none` / `Rest.call(absent=...)` return `None`, and only for a 404.
36
+ - **Every forge is an adapter in `forges/`** producing `model.PullRequest` records; nothing outside reads a
37
+ platform's API. GitHub goes through the `gh` CLI; the others speak REST over `urllib` (`forges.Rest`) with a
38
+ token from the platform's CLI or an environment variable, else anonymously. A repo's identity is its slug,
39
+ `<forge>/<path>` (data under `repos/<forge>/...`, pages under `/r/<forge>/...`); `forge` defaults to `github`.
40
+ Verify an adapter against a real public repo with `scripts/probe_forge.py`, which also records the responses
41
+ the replay tests in `test_forges.py` run on (identities and all but a few headers are scrubbed).
42
+ - **Every program whose output we read runs through `process.run`** with an argument list, never a shell
43
+ string. It resolves the program with `shutil.which` (so `.cmd` shims and wrappers work on Windows), decodes
44
+ as UTF-8, applies a timeout, and classifies failures (`faults.classify_stderr`). `READTHROUGH_GH` /
45
+ `READTHROUGH_GIT` / `READTHROUGH_GLAB` / `READTHROUGH_AZ` substitute a program: the tests use that to stand
46
+ in for `gh` at the process boundary. The OS integrations (`terminals.py` opening a window, `system.py`
47
+ registering the scheduled task and the protocol handler) are the exception: they hand a fixed command with
48
+ quoted values to the platform's launcher and don't wait for it.
49
+ - **UTF-8 everywhere.** Every `open`, `read_text`, `write_text`, and `subprocess` call names `encoding="utf-8"`.
50
+ A file another process may be reading while we write it (config, data, the ledger, the session index) goes
51
+ through `files.write_atomic`; the study log and the usage ledger are append-only; briefs and diff caches are
52
+ plain writes of files only this process reads. A model's file reads are held under the clone by
53
+ `files.inside`, symlinks followed.
54
+ - **Secrets never reach a log, an error, or a bundle.** Tokens are `process.Secret`s whose repr is
55
+ `Secret(***)`, registered with `process.remember` so `process.redact` strips every seen one from captured
56
+ output. `Rest` sends `Authorization` only to its own host. `config.toml` holds no credentials (the
57
+ `[forges.*]` tables name hosts and environment variables), and `doctor --bundle` says so.
58
+ - **Stochastic steps take a seed.** Retry backoff (`forges.jitter`) and refresh jitter (`Dashboard(seed=...)`)
59
+ each have their own `random.Random`; tests assert their distributions with a fixed seed and a stated margin.
60
+ - **Cache keys cover everything that changes the result.** Diffs are cached by PR number and head SHA, with
61
+ separate markers for "too large" and "legitimately empty" so neither is re-asked until the head changes.
62
+ Failures are never cached.
63
+ - **Pluggable things go through a registry** (`registry.Registry`): forges, profile sources, terminal
64
+ launchers, study assistants, model runtimes, review agents. A plugin has a name, a one-line summary, an
65
+ implementation, and a dataclass of options that the config loader validates with did-you-mean errors. Never
66
+ add a name-based `if/elif` for one of these; what a forge can't do is a missing entry in its `capabilities`,
67
+ which the build reads.
68
+ - **The model behind studying is a `runtimes.Runtime`, never a forge's credential.** The assistant and the
69
+ onboarding drafter describe their tools once as `ToolSpec`s and consume `Event`s; a runtime (`copilot` for
70
+ the SDK, `anthropic`, `openai` incl. Azure) owns the wire format, the tool loop, and the session store, and
71
+ reports `Usage` in its provider's own units with nothing unreported written as zero. New providers are new
72
+ modules under `runtimes/`; nothing in `assistants.py` names one.
73
+ - **Settings have one home each.** Per-machine or per-repo choices live in `config.toml` (`config.py`);
74
+ operational numbers are `[tuning.*]` with defaults and documentation in `assets/defaults.toml` (a test keeps
75
+ the two in step); safety limits are constants in `limits.py` and change only by a deliberate commit.
76
+ - **The study log is append-only and truthful about authorship.** Every entry's `by` is who wrote it (`you`,
77
+ `model`, `rules`; `readthrough` only for a `failure`, the record that a turn ended in an error). Only an
78
+ assistant that read the code writes verdicts; the rules assistant never grades. What the model assistant
79
+ writes carries the `model` the runtime reported and the `runtime` that carried it, since the same assistant
80
+ may be talking to GitHub Copilot, Claude, or a deployment of yours; labels (the page, the brief) come from
81
+ the entry, never from the current config. No brand names in `by` or in the UI: the engine is named by what
82
+ it is. Older logs say `by: copilot`, the assistant's former name; `study.load` reads it as `model` and claims
83
+ no runtime for it, and the file is never rewritten. Answers are tagged with the aids that preceded them
84
+ (`hint`, `brief`) from the log itself, never asserted.
85
+ - **Model usage goes to the ledger (`usage.py`), in the provider's units.** One line per call, idempotent
86
+ by call id; tokens, Copilot's multiplier, and AI credits stay separate, a dollar figure must name its price
87
+ table, and nothing unreported is written as zero. `billed_to` says whose account paid.
88
+ - **The pages are one served file.** `assets/web/` holds separate `.html`, `.css`, `.js` for editing;
89
+ `build.page_source` inlines them, every script carries a per-render nonce, and the CSP runs nothing else.
90
+ No inline `onclick=`; third-party HTML goes through DOMPurify. Vendored JS lives in `assets/vendor/` with
91
+ its license and is listed in `build.VENDOR_SCRIPTS`.
92
+ - **What crosses between page and server is declared in `contract.py`** (the payload, the SSE events, the
93
+ study API) and `test_contract.py` checks both sides: a build has exactly those shapes, the page reads nothing
94
+ 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.
97
+ - **Lint is `ruff` with `select = ["ALL"]`** and an ignore list that states each reason in `pyproject.toml`.
98
+ Suppress per file (with a reason) rather than per line where a whole file legitimately differs. Types are
99
+ checked by `ty`, pinned exactly; bump it deliberately.
100
+ - **Tests never touch the network, `gh`, git, Copilot, the registry, or the scheduler.** Reuse the fakes:
101
+ `FakeForge` (`tests/fakes.py`, installed by the `fake_forge` fixture in place of `forges.make`), `Script`
102
+ (`test_github_faults.py`), `tests/fake_gh.py` for the real executable, the recorded forge responses under
103
+ `tests/fixtures/forges/` (`test_forges.py`), `RecordingAssistant` (`test_engine.py`), the fake Copilot SDK in
104
+ `test_assistants.py`. PRs are described GraphQL-shaped by `make_pr` and normalized by `make_pull`.
105
+ - **Coverage is a ratchet.** `fail_under` in `pyproject.toml` only goes up.
106
+ - **Workflows are hardened the same way everywhere.** Every action is pinned to a full commit SHA with its
107
+ version in a comment (Dependabot bumps both); every checkout has `persist-credentials: false`; a workflow
108
+ starts from `permissions: {}` and each job grants what it needs with a comment saying why; the job that
109
+ builds what gets published uses no package cache (the test jobs may: a coverage report isn't shipped);
110
+ in-repo workflows are called as `$/.github/workflows/<file>` so they count as pinned. `.github/zizmor.yml`
111
+ 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.
@@ -0,0 +1,320 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0 (2026-10-30)
4
+
5
+ ### Added
6
+
7
+ - Repos on GitLab, Forgejo (Codeberg and other Forgejo or Gitea servers), and Azure DevOps, next to GitHub. A
8
+ repo's config entry says where it lives (`forge = "gitlab"`; GitHub is the default), and `readthrough onboard
9
+ --forge gitlab group/project` writes it. GitHub keeps going through `gh`; the others are read through their
10
+ REST API with a token from the platform's CLI (`glab`, `az`) or an environment variable (`GITLAB_TOKEN`,
11
+ `FORGEJO_TOKEN`, `AZURE_DEVOPS_EXT_PAT`), else anonymously, which is enough for public repos. Hosts and
12
+ variable names go under `[forges.<name>]`; tokens never go in the config. Each adapter was checked against a
13
+ real public repo, and the tests replay those recorded responses.
14
+ - What a forge can't tell us is said, not assumed: a warning on the dashboard and a *gap* signal on each affected
15
+ PR when a platform has no review decision, no merge state, no diffs, no per-file line counts (Azure DevOps),
16
+ no named required checks (GitLab), or when author associations need a token (Forgejo). CI that couldn't be read
17
+ is its own state, "couldn't be read", never "passing" or "no CI".
18
+ - A repo can carry its profile as `readthrough.toml` in its forge's dot-directory (`.github/`, `.gitlab/`,
19
+ `.forgejo/`, `.azuredevops/`) or at the root as `.readthrough.toml` or `readthrough.toml`. The dot-directory's
20
+ wins when a repo has several, with a warning. Shared profile directories take `forge/owner/name.toml`.
21
+ - Rate-limit replies that name a `Retry-After` are waited for that long (capped by `rate_limit_wait_seconds`)
22
+ instead of a fixed minute. gitlab.com throttles anonymous callers per IP address; the guide says so.
23
+ - `[tuning.forge] max_tree_files` caps how much of a repo's tree onboarding lists through an API that pages a
24
+ hundred files at a time. A partial tree is reported as partial, and path patterns aren't judged against it.
25
+ - `scripts/probe_forge.py` exercises an adapter against a real repo and can record its responses for the tests.
26
+ - Deep reviews can run in Claude Code as well as the Copilot CLI. `agent = "auto" | "copilot" | "claude"` in
27
+ `config.toml` chooses (`auto` takes the first one installed), with per-agent options under `[agents.<name>]`
28
+ and per-repo flags in `agent_args` (which replaces `copilot_args`). Sessions started in either agent are
29
+ linked to their PR by the marker in their first message and resumed in the agent that owns them; the PR
30
+ panel says which agent each one ran in. `readthrough install skill` installs the skill for every agent
31
+ found (`--agent` for one). Claude Code leaves no trace of an open session, so for its sessions the panel
32
+ shows when they were last written rather than claiming they're closed.
33
+ - Azure DevOps pull requests get a diff and line counts. The platform serves neither, so the adapter assembles
34
+ a unified diff from both versions of each changed file (two blob requests per file, cached by head commit
35
+ like every diff, capped by `[tuning.forge] max_assembled_diff_files`), and the build counts added and deleted
36
+ lines from it for any forge that reports none. Line heuristics now run on Azure DevOps, and the "no line
37
+ counts" and "no API for whole-change diffs" warnings are gone; a PR over the cap, or a build with `--no-diffs`,
38
+ keeps the line-counts gap and says so.
39
+ - Azure DevOps authors get an association and membership checks. The platform has no association, so one is
40
+ derived: an author with a completed PR in the repo is `COLLABORATOR` (everyone who can open a PR there holds
41
+ contribute rights, GitHub's collaborator), one on their first PR here is `FIRST_TIME_CONTRIBUTOR`; nobody is
42
+ `MEMBER`. The profile's `internal_orgs` (the organization's users) and `internal_teams`
43
+ (`organization/team`, through any nesting of groups, via the identities API) now work with a sign-in, so
44
+ the "can't tell us the association" warning is gone and authors are classified the way they are on GitHub.
45
+ - A token a CLI prints is used only if it looks like one (a line of printable characters). A stand-in that
46
+ printed a banner used to end up in an `Authorization` header, which `urllib` rejects by crashing the call.
47
+ - The study assistant and the onboarding drafter run on a **model runtime**, chosen machine-wide with
48
+ `runtime = "auto" | "copilot" | "anthropic" | "openai"` and configured in `[runtimes.NAME]`. `copilot` is the
49
+ Copilot SDK: GitHub Copilot through its sign-in, or with `provider = "openai" | "azure" | "anthropic"` a
50
+ provider of your own, where the runtime never touches the CLI's GitHub login. `anthropic` speaks Claude's
51
+ Messages API and `openai` the Responses API (OpenAI, or Azure OpenAI and Foundry with a key or `entra = true`
52
+ for an Entra token from `az`), both over the standard library with nothing to install but a key. The
53
+ Socratic behaviour, the tools, and what reaches the study log are the same on every runtime (`runtimes/`
54
+ holds the engines; `assistants.py` the behaviour), so the GitHub forge and the AI behind studying are no
55
+ longer one credential: a repo on Azure DevOps can be studied with no GitHub account at all. `auto` takes
56
+ the Copilot SDK when installed, else the first runtime whose key is set; `doctor` names the one in use.
57
+ Checked live on the same PR with all of GitHub Copilot (Claude Sonnet 5 through the SDK) and Azure OpenAI
58
+ `gpt-4.1` through both the SDK's provider mode and the Responses API with an Entra token.
59
+ - Every model call is recorded in the repo's usage ledger (`usage.jsonl`), one line per call keyed by the
60
+ provider's call id: the model, tokens in the provider's own units, Copilot's premium-request multiplier and
61
+ AI-credit consumption when it was Copilot, who was billed (`copilot:<login>` or `<provider>:<host>`), and
62
+ what for (`study` on a PR, or the onboarding `draft`). Units are never converted into one another and an
63
+ unreported quantity is absent, not zero. `doctor` sums the last thirty days per repo.
64
+ - Study-log entries an assistant writes carry the model that reached them, and the brief says "assessed by
65
+ gpt-4.1 (through Copilot)" rather than just "by Copilot", since a verdict's weight depends on who gave it.
66
+ - A study turn that ends in an error is written to the study log as a `failure` entry (by `readthrough`, naming
67
+ the assistant and the error), so a "Quiz me" with no reply is never read as one you abandoned. The Study tab
68
+ shows it as a line in the transcript.
69
+ - The Study tab shows your "what I missed" reflections and offers a **What I missed** button after a verdict
70
+ that wasn't *correct*; before, reflections could be written only through the API and appeared only in the
71
+ brief. The transcript opens at its end, where the latest exchange and the composer are, and follows new
72
+ entries while you're there.
73
+ - `scripts/screenshots.py` takes the documentation screenshots from a repo you've built, through the live
74
+ server and a headless browser, as WebP. The ones in `docs/` are of microsoft/vscode.
75
+ - `SECURITY.md` says what the tool trusts and doesn't (the forge's text, a repo's own profile, the local
76
+ server, credentials, model runtimes, `readthrough://` links) and how to report a vulnerability privately.
77
+ - The workflows are hardened: every action is pinned to a commit SHA, checkouts keep no credentials, each job
78
+ grants only the permissions it names, the build job uses no package cache, and `zizmor` lints the workflows
79
+ on every push. The gate is a reusable workflow (`test.yml`) that `ci.yml` calls and sums up in one `gate`
80
+ check; the browser tests fail on CI instead of skipping when the runner has no browser. Dependabot keeps the
81
+ Python dependencies and the action pins fresh, a week after each release. A pre-push hook in `.githooks`
82
+ lets only `main`, `release/*`, and `v*` tags leave a clone. Python 3.15 is in the matrix and the classifiers.
83
+ - A release pipeline (`release.yml`). A `vX.Y.Z` tag on `main` or a `release/*` branch is checked (the commit is
84
+ on one of those branches, the tag is the version in `pyproject.toml`, the changelog has its section), put
85
+ through the whole gate again, and then held until the maintainer approves the `pypi` environment. The last
86
+ job builds nothing: it attests the provenance of the wheel and sdist the gate built, uploads them to PyPI
87
+ through trusted publishing, and creates the GitHub release with the changelog section as its notes. There is
88
+ no manual trigger; `gh release verify`, `gh release verify-asset`, and `gh attestation verify` check a
89
+ published file from the outside.
90
+
91
+ ### Changed
92
+
93
+ - The PR panel keeps the primary review actions on one row and moves **Copy prompt** and **Copy worktree
94
+ cmd** under a keyboard-reachable **⋯** disclosure. **Your status** is a group of pills with every existing
95
+ ledger status; repeated clicks can't overlap saves for a PR, failures keep the last confirmed status, and
96
+ **To do** still keeps notes and linked sessions. Numeric table headings now align with their right-aligned,
97
+ tabular-figure values. Components with no matching PRs share a thin row per layer rather than empty
98
+ boxes, and remain visible and filterable even when nothing matches.
99
+ - The live chip has space beside Refresh and carries stale-data ages, including alongside offline or
100
+ refresh-failed states, instead of another standing banner. Actual refresh errors and snapshot age
101
+ warnings stay prominent. Its styling no longer spills onto a PR's active-session dot. Onboarding's
102
+ read-only connection line expands to show the CLI or API and the ordered credential sources; the
103
+ credential actually used is still shown after checking access.
104
+ - The header puts the product first, the repo second, and the small print third: **readthrough / microsoft/vscode ·
105
+ 100 of 2,885 open · as of 8:27 PM · @you**. The repo is a quiet pill that opens the switcher (the native select,
106
+ still keyboard-reachable, laid invisibly over it); the connection is a status chip that reads live, refreshing,
107
+ offline, or refresh failed, with the next check on hover, and the refresh button spins while a refresh runs
108
+ instead of growing a label. The tabs no longer breathe while the indicator slides (a selected tab is bolder, so
109
+ each label now reserves its bold width). The progress bar moved up beside the search box, and three banners
110
+ stopped appearing on every visit: "nothing new since you last opened this" (only news is announced now), the
111
+ standing "showing the N most recently active of M" (that's the header's count now, with the explanation on
112
+ hover), and the three-line explanation under each view, which is a fold ("How to read the map", "How sessions
113
+ are packed") that stays open or closed as you last left it. Content starts about 200 px higher on a big repo.
114
+ - The setup page shares the dashboard's header (brand, then where you are: Welcome, Set up a repo, or the
115
+ repo's name) and its theme button. On a first run it opens with a welcome card saying what readthrough does
116
+ and what the three steps ask for, the repo field focused, and no settings card for repos that don't exist yet;
117
+ finished steps show a check.
118
+ - What crosses between the page and the server is written down in one place, `contract.py`: the payload's
119
+ shape (every record in `data.json`), the Server-Sent Events and what each carries, and the study API, with
120
+ the rules they cross under (events are notifications and a GET is the truth; after any gap the page
121
+ re-fetches what it holds; study entry ids only grow; one turn per PR). `test_contract.py` checks both sides:
122
+ a build with every optional part populated has exactly the declared shapes, and the page's scripts read only
123
+ declared fields, listen only for declared events, handle every study event, and call only served routes.
124
+ The server refuses to broadcast an event the contract doesn't name.
125
+ - The study assistant that reads the code is named for what it is, a **model**, not for GitHub Copilot, which
126
+ is now one of three runtimes it can run on. `assistant = "model"` in `config.toml` (the old `"copilot"` is
127
+ refused with the list of names); the log's `by` is `model`, and every entry the model writes also records
128
+ the `runtime` that carried it next to the `model` the runtime reported, so the brief says "assessed by
129
+ gpt-4.1 via openai" from the entry itself and switching runtimes never relabels an old grade. Logs written
130
+ before this say `by: copilot`, the assistant's former name; they're read as `model` without touching the
131
+ file, and with no runtime claimed, since they never recorded one. The Study tab labels each reply with the
132
+ model that wrote it, says what will answer next (the configured model, or the runtime when GitHub Copilot
133
+ picks per call),
134
+ and names a failed turn by its runtime rather than a model that never answered; "Study with Copilot" is
135
+ "Study". Model-assisted onboarding is `readthrough onboard --assisted` (was `--copilot`) and the setup page's
136
+ **Draft with a model**, which names the runtime it would use or says why none can run; a draft's
137
+ `drafted_by` is `model` (profiles saying `copilot` still load) and its first line names the model and
138
+ runtime. `readthrough study --by model` records a review agent's finding. A registry name that resembles
139
+ nothing (a renamed plugin, say) now gets the list of valid names in the error instead of no hint.
140
+ - The config file is schema 2. Each repo's data lives under `repos/<forge>/<owner>/<name>/` (so
141
+ `repos/github/microsoft/vscode/`), dashboard pages under `/r/<forge>/<owner>/<name>/`, and
142
+ `readthrough://` links and the marker in Copilot prompts name repos the same way. There is no migration: move
143
+ `repos/owner/name` to `repos/github/owner/name`, rename `[tuning.github]` to `[tuning.forge]`, and set
144
+ `schema = 2`; the error message for an old file says the same. Sessions linked by the old `owner/name` marker
145
+ are still found.
146
+ - `data.json` is schema 2: the raw GitHub rollup state (`ci`) is gone, `ci_state` has the new `unknown` value,
147
+ and the payload carries the repo's `slug` and `forge`.
148
+ - Saving `config.toml` from the browser keeps `terminal`, `assistant`, and the plugin option tables; before, a
149
+ save from the settings page dropped them.
150
+ - The onboarding drafter ranks source roots by recent churn rather than file count, and names a generic
151
+ directory (`src`, `lib`, `core`) after its parent. Onboarding microsoft/vscode went from 76% coverage, refused,
152
+ to 100%.
153
+ - On GitHub the whole tree is read in one call, so `max_tree_files` no longer applies there and a repo the size
154
+ of vscode is judged against all of its files.
155
+ - A profile found in the repo's data directory, or named by `profile = ...`, is labelled with a `~`-relative path
156
+ on the map and in `doctor`, not an absolute one.
157
+ - A PR's worktree whose clone or data directory has moved since it was made (its `.git` file points at a gitdir
158
+ that is gone) is set aside as `pr-<n>.detached-<time>` and made afresh, instead of every deep review and
159
+ study turn failing with "not a git repository".
160
+ - The documentation images are WebP at 1.5× instead of PNG, a third of the size, and the logo is an SVG.
161
+
162
+ ### Fixed
163
+
164
+ - Text a forge supplies (check names, PR and check URLs, the repo's instruction-file URLs) and text a repo's
165
+ profile supplies (author badges, layer colors, ids) is escaped wherever the page puts it in an attribute, and
166
+ links are only ever web URLs. A profile's ids must be slugs and a layer's `color` a CSS color, checked when
167
+ it loads, so a `readthrough.toml` written by someone else can't shape the page's markup.
168
+ - What a model sends back is held to the same standard as what a stranger sends. On the Anthropic and OpenAI
169
+ runtimes a tool call's arguments are now checked against the tool's schema before a handler sees them
170
+ (unknown properties dropped, types coerced or refused, required ones present), as the Copilot SDK already
171
+ did; the study log refuses a writer that names its own `id`, `ts`, `kind`, or `by`, and holds every value to
172
+ a string, a number, a boolean, or a list of strings (`line` is a number); and the Study tab escapes an
173
+ entry's id, author, verdict, and line. Without those, a PR description that steered the model could have
174
+ planted markup in every reader's Study tab. The onboarding drafter's `read_file` now follows symlinks and
175
+ refuses anything that resolves outside the clone, as the study assistant's tools always did; a repository
176
+ can commit a symlink, and the name being in its tree says nothing about where it points.
177
+ - A repository locator is held to the slug grammar in every forge adapter (no `.`, `..`, or backslash
178
+ segments), since it becomes directory names under `repos/` and a self-hosted forge chooses the name it
179
+ answers with; removing a repo with its data checks the directory is under `repos/` before deleting it.
180
+ - A PR description containing `<!--<script` broke the whole page: the inlined data escaped `</` but not `<`,
181
+ and that sequence puts the HTML parser into a state where the real `</script>` no longer closes the script.
182
+ Every `<` in inlined JSON is now `\u003c`.
183
+ - A required-checks lookup that could read one of its two GitHub sources (classic protection, rulesets) but
184
+ was refused the other reported the union as known. It's now `unavailable`, naming the refusal, since a
185
+ partial answer is not an answer.
186
+ - Secrets are blanked out of every log record on its way to a handler (`logs.ContextFilter`), so no call site
187
+ has to remember to redact.
188
+ - The brief quotes the author's description and the unresolved threads as what they are: text written by the
189
+ PR's author, to be assessed. The review skill says the same of the profile's guidance and test command and
190
+ asks the agent to show you any command before running it; the study assistant gets the profile's guidance
191
+ labelled as the maintainers' advice rather than as part of its own instructions. `SECURITY.md` was corrected
192
+ where it claimed more than the code does (an `Origin` header is checked when the browser sends one; images in
193
+ a description may load from any `https` host; the profile's guidance does reach the models).
194
+ - Text a model wrote is rendered without images in the Study tab and the brief. A model that read a hostile PR
195
+ could have been steered into writing an image whose URL carried what it had read; a PR's own description
196
+ keeps its screenshots.
197
+ - A page that fell behind the server's events (a long streamed reply, a throttled background tab) was quietly
198
+ unsubscribed and kept showing a stale page over a connection that looked healthy. It's now sent one `resync`
199
+ and fetches everything it holds again; the same happens after a reconnect, which used to refresh the PR list
200
+ but not the open study log, so a `done` missed during the gap left the Study tab's composer disabled until
201
+ a reload.
202
+ - Two writers could corrupt the shared files: a review agent's terminal recording a finding while the server's
203
+ assistant wrote to the same study log produced duplicate entry ids and dropped lines (measured: 5 of 80
204
+ entries lost), and two tabs or the server and `readthrough ledger` could each load the ledger and the slower
205
+ one's write undo the other's. Both are now read and written under a file lock that holds across processes.
206
+ The config watcher and the setup page could also both start a dashboard for a freshly onboarded repo, one of
207
+ them an orphan that kept building; syncs are serialized. The watcher that picks up study-log appends made
208
+ from a terminal compares the file's size as well as its timestamp, so two appends within one clock tick
209
+ aren't missed.
210
+ - The live dashboard took two to four seconds to answer a page request on a repo with a hundred PRs. The
211
+ watcher thread recomputed every PR's agent sessions every three seconds while holding the payload lock, and
212
+ for each PR it searched PATH for the agents again (several milliseconds per lookup on Windows), so every page
213
+ load waited for a pass to finish. The agents are now resolved once per pass, and the scan runs without the
214
+ lock and applies its findings under it: 5.5 s to 0.1 s per pass on microsoft/vscode, and the page in about
215
+ 100 ms (the browser's own parse and render of the 2.6 MB page is about 200 ms).
216
+ - A clone (or a model, or a runtime) set in config.toml or on the setup page now reaches a running study
217
+ session. The server reloaded the repo's settings but the study engine and its assistant kept the Config they
218
+ were built with, so a repo onboarded without a clone kept failing "No local clone configured" after one was
219
+ added, until a restart; and a PR's checkout was made once per process, so a push to the PR between turns was
220
+ invisible to the assistant's tools. The engine now takes the new Config in place, the assistant reads it on
221
+ every turn, and the checkout follows the PR's head. Two further races closed on the way: two browser tabs (or
222
+ a double-click) could start two turns on one PR, since the busy check wasn't atomic across handler threads;
223
+ and the study assistant and a deep review launched from the page could `git worktree add` the same path at
224
+ once, now serialized per worktree.
225
+ - The `anthropic` and `openai` runtimes retry what the provider calls temporary (429, 529 overloaded, 5xx, a
226
+ dropped connection), waiting what `Retry-After` asks for or an exponential backoff with jitter, four attempts
227
+ at most; a bad key or a bad request still fails at once with the provider's message.
228
+ - A profile's `repo` is the repo's path on its forge, however many segments that has. The parser demanded
229
+ exactly `owner/name`, so onboarding an Azure DevOps repo (`organization/project/repository`) or a GitLab
230
+ project in a subgroup drafted a profile and then refused to load it. The default title, and the directory
231
+ `onboard` looks in for an existing clone, are the repo's own name (the last segment), not the project's.
232
+ - Azure DevOps projects called things like `Delivery Team` can be onboarded: a repo path's segments may have
233
+ spaces between words. The slug keeps the literal name (so does the data directory); dashboard and
234
+ `readthrough://` URLs carry it percent-encoded, and the marker in agent prompts carries it as written.
235
+ - A clone's remote is matched the way its forge writes URLs, so an Azure DevOps clone
236
+ (`https://…/org/Delivery%20Team/_git/repo`, or `v3/org/project/repo` over SSH) is recognised by `onboard`,
237
+ the setup page, and `doctor`; before, only the GitHub-shaped `…/owner/name(.git)` ending was.
238
+ - Login lists edited in the browser accept the email addresses Azure DevOps and GitLab use as logins.
239
+ - Pull requests with eight-digit numbers work in the dashboard. Azure DevOps numbers PRs per organization, and
240
+ a big one is past 17 million, but every PR route in the live server, the `readthrough://` URL, and the marker
241
+ that links agent sessions to PRs stopped at seven digits, so the Study and Brief tabs answered "not found".
242
+ The bound is now nine digits, in one place.
243
+ - A PR's brief says "Open on Azure DevOps" (or GitLab, or Forgejo) rather than "Open on GitHub" for every
244
+ forge, and its Files link, like the ones under each signal, opens the files tab the way that forge spells it.
245
+ - Azure DevOps sign-in no longer depends on which tenant `az` happens to default to. readthrough asks the
246
+ organization for its tenant (an anonymous call it refuses, naming it; the request carries
247
+ `X-TFS-FedAuthRedirect: Suppress`, so refusals are 401s rather than a sign-in page) and asks `az` for a
248
+ token in that tenant, so an account signed in to several tenants is no longer refused by an organization
249
+ outside its default one. When `az` has no sign-in there, `doctor` repeats what `az` said and its fix is a
250
+ single-tenant login (`az login --tenant … --allow-no-subscriptions --scope …`), which prompts once; a plain
251
+ `az login` with many accounts in Windows opens a window per tenant and most fail. A failed token lookup is
252
+ retried after ten minutes, so a sign-in made after `doctor`'s advice is picked up by a running server.
253
+ - The setup page says how a repo is read before anything runs: for the forge picked, which CLI or API
254
+ (the `gh` CLI for GitHub; the REST API, with the identities host, for Azure DevOps; the REST API for
255
+ GitLab and Forgejo) and where the credential comes from, in the order tried, as each adapter declares
256
+ (`Forge.access`, `Forge.credentials`). After **Check access**, and on an onboarded repo's settings, it
257
+ says which credential is in use right now (`az (tenant …)`, `gh as <account>`, `anonymous`).
258
+ - An organization that refuses both the `az` identity and anonymous access now fails with an error that
259
+ says how to sign in, instead of a bare refusal after a log line claiming anonymous access was fine. The
260
+ live server answers a forge refusal during setup with that message (HTTP 502) rather than a traceback on
261
+ stderr and a dropped connection, and anything else unexpected in a request with a 500 that names its
262
+ error id.
263
+
264
+ ### Removed
265
+
266
+ - `github.py`. Its pieces are `forges/github.py` (the adapter), `process.py` (running programs, secrets), and
267
+ `faults.py` (the error hierarchy, now shared with the REST adapters).
268
+
269
+ ## 0.3.0 (2026-10-14)
270
+
271
+ The first release under the name readthrough, and the first with a public baseline. Earlier versions were a
272
+ private tool for one repository; this one is for any repository, and the history starts here.
273
+
274
+ ### Added
275
+
276
+ - A rules-based study assistant that needs nothing installed. It asks the questions the repo's profile already
277
+ carries (the shared ones, each touched component's, the author kind's, and one per signal), hints by pointing
278
+ at files, and assembles a briefing from the PR's metadata. It never grades: after the last question about a
279
+ component it shows that component's contract once, so you can check yourself, and the Study tab offers a
280
+ "what I missed" note. `assistant = "auto" | "copilot" | "rules"` in `config.toml` chooses; `auto` takes Copilot
281
+ when the `[study]` extra is installed.
282
+ - Every answer in the study log is tagged with the aids that came before it (a hint for that question, a
283
+ briefing), computed from the log itself. The brief's summary says how many answers were unaided, and never
284
+ shows a score unless Copilot graded.
285
+ - Terminal launchers for deep-review sessions are chosen by name: `terminal = "auto" | "wt" | "console" |
286
+ "terminal-app" | "x-terminal-emulator" | "gnome-terminal"`, with per-launcher options under `[terminals.<name>]`
287
+ (Windows Terminal takes a `profile`, a `window`, and `extra_args`).
288
+ - Shared profile directories: `[profile_sources.shared] dirs = [...]` lists directories holding
289
+ `owner/name.toml` files, so a team can keep maps for repos that can't carry `.github/readthrough.toml`.
290
+ - Plugin names and options in `config.toml` are validated when the file is read, with a suggestion for a typo.
291
+ Relative paths in options are taken from the config file's directory.
292
+ - `READTHROUGH_GH` and `READTHROUGH_GIT` name the program to run instead of the one on PATH (a path, or a JSON
293
+ list for a command with arguments). The end-to-end tests use it; so can a wrapper script.
294
+ - CI on Linux, macOS, and Windows for Python 3.11 through 3.14, with a build job that installs the wheel into a
295
+ clean environment and uploads the artifacts.
296
+ - Runnable examples under `examples/`, including one that uses only the standard library.
297
+
298
+ ### Changed
299
+
300
+ - One package, `readthrough`, installed from the repository root. The PyRIT add-on package is gone, and with it
301
+ the `readthrough.profiles` entry point: a repo's profile comes from an explicit path, your local draft, the
302
+ repo's own `.github/readthrough.toml`, or a shared directory, in that order. An explicit `profile` path that
303
+ doesn't exist is an error rather than a silent fall-through.
304
+ - Tokens from `gh auth token` are held as `Secret` values whose repr is `Secret(***)`, and any token this process
305
+ has seen is blanked out of captured `gh` error output.
306
+ - Programs are resolved with `shutil.which` before they're run, so `.cmd` shims and wrappers are found on Windows.
307
+ - `gh` and `git` output is decoded as UTF-8 everywhere, including the PowerShell calls behind the Windows
308
+ installers.
309
+ - Retry backoff and refresh jitter use their own seeded random generators, so neither can perturb the other and
310
+ tests can pin them.
311
+ - The type checker is `ty`, pinned exactly; lint is ruff with every rule enabled and a reasoned ignore list.
312
+ - The logo is a page being read rather than a radar sweep. The URL scheme is `readthrough://`, the data directory
313
+ `~/.readthrough`, the environment variables `READTHROUGH_HOME` and `READTHROUGH_CONFIG`, and the in-repo profile
314
+ `.github/readthrough.toml`.
315
+
316
+ ### Fixed
317
+
318
+ - A legitimately empty diff (a PR GitHub serves no diff text for) was never cached, so it was fetched again on
319
+ every refresh. It's now remembered until the PR's head changes, like the "too large" answer.
320
+ - `drift()` took a profile it never read.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Spencer Schoenberg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.5
2
+ Name: readthrough
3
+ Version: 0.4.0
4
+ Summary: Lay a repo's open pull requests out on its architecture, then study each one before you review it.
5
+ Project-URL: Homepage, https://github.com/spencrr/readthrough
6
+ Project-URL: Documentation, https://github.com/spencrr/readthrough/blob/main/docs/guide.md
7
+ Project-URL: Changelog, https://github.com/spencrr/readthrough/blob/main/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/spencrr/readthrough/issues
9
+ Project-URL: Security, https://github.com/spencrr/readthrough/blob/main/SECURITY.md
10
+ Author: Spencer Schoenberg
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: azure-devops,code-review,dashboard,github,gitlab,learning,pull-requests
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Environment :: Web Environment
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Programming Language :: Python :: 3.15
26
+ Classifier: Topic :: Software Development :: Quality Assurance
27
+ Classifier: Topic :: Software Development :: Version Control :: Git
28
+ Classifier: Typing :: Typed
29
+ Requires-Python: >=3.11
30
+ Provides-Extra: study
31
+ Requires-Dist: github-copilot-sdk<2,>=1.0.11; extra == 'study'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # <img src="docs/img/logo.svg" alt="" width="36" height="36" align="top"> readthrough
35
+
36
+ Busy repos have fifty-plus open pull requests. I wanted two things from a queue like that: a picture of where the work is landing in the architecture, and a way to review PRs that leaves me actually understanding them, instead of skimming a diff and clicking approve.
37
+
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
+
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.
41
+
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
+
44
+ ## A repo has to be onboarded first
45
+
46
+ The map is only as good as readthrough's idea of the architecture, so before it lays out a repo you check that idea with it. Onboarding (in the browser at `/setup`, or `readthrough onboard`) drafts an architecture profile from the code, CODEOWNERS, the docs, and where recent PRs actually changed things, measures it against those PRs, and won't accept it until it covers them. A model can write the draft for you by reading the repo. Repos can ship their own profile as `readthrough.toml` (in `.github/`, `.gitlab/`, or the root), and a team can keep a directory of profiles for repos that can't.
47
+
48
+ ## Quick start
49
+
50
+ You need Python 3.11 or newer, [uv](https://docs.astral.sh/uv/), and, for GitHub repos, the GitHub CLI signed in (`gh auth login`). For deep reviews, the [Copilot CLI](https://github.com/github/copilot-cli) or [Claude Code](https://docs.anthropic.com/en/docs/claude-code) signed in; for the Study tab's model assistant, the `[study]` extra (GitHub Copilot) or an API key for Claude or OpenAI.
51
+
52
+ ```sh
53
+ uv tool install "readthrough[study]" # from PyPI; drop [study] to skip the Copilot SDK
54
+
55
+ readthrough onboard microsoft/vscode --accept # map the repo's architecture (edit the draft first if you like)
56
+ readthrough build --open # fetch the PRs and open the dashboard
57
+ ```
58
+
59
+ 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
+ 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
+
63
+ ![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
+ ## Docs
66
+
67
+ - [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
+ - [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
+ - [Maintaining readthrough](https://github.com/spencrr/readthrough/blob/main/docs/maintaining.md): the checks, error handling, logging, settings, plugins, and the pages' structure.
70
+ - [Working on readthrough](AGENTS.md): the exact commands and the conventions that aren't obvious.
71
+ - [Examples](examples/): runnable scripts, including one that needs nothing but the standard library.
72
+ - [Changelog](CHANGELOG.md).
73
+
74
+ ## How it's put together
75
+
76
+ One package, `src/readthrough`, with no runtime dependencies beyond the standard library (and the `gh` CLI for GitHub repos); the `[study]` extra adds the GitHub Copilot SDK (one of the model runtimes the study assistant can run on; the Anthropic and OpenAI ones need only a key).
77
+
78
+ ```
79
+ cli.py the commands; every failure ends in one line or an error id
80
+ config.py config.toml: repos, machine-wide choices, validated with did-you-mean errors
81
+ tuning.py operational numbers, typed and ranged; defaults.toml documents them
82
+ limits.py safety limits that only change by a deliberate commit
83
+ profile.py architecture profiles, and where a repo's comes from (a registry of sources)
84
+ onboard.py drafting a profile from the repo and measuring it against recent PRs
85
+ onboard_model.py the same, with a model reading the repo (on the configured runtime)
86
+ model.py the pull request as the analysis sees it, whichever forge it came from
87
+ forges/ a registry of forge adapters: github (gh), gitlab, forgejo, azure_devops (REST); the diff cache
88
+ faults.py how outside calls fail, classified from a CLI's stderr or an HTTP status
89
+ process.py running programs: UTF-8, timeouts, secrets that never reach a log
90
+ build.py one build: fetch, analyze, write data.json, the dashboard, and the briefs
91
+ analyze.py lanes, signals, line heuristics, overlaps, and the burn-down plan
92
+ ci.py which checks are required, failing, or also failing on main
93
+ brief.py the Markdown brief a reviewer reads before the diff
94
+ review.py deep-review sessions, worktrees, and the index linking agent sessions to PRs
95
+ agents.py a registry of review agents: copilot (the Copilot CLI) and claude (Claude Code)
96
+ study.py the append-only study log and its rendering into the brief
97
+ engine.py the Study tab's loop: records the learner's side, runs the assistant
98
+ assistants.py a registry of study assistants: the model one (reads code, grades) and rules (no model)
99
+ runtimes/ a registry of model runtimes the assistant runs on: copilot (the SDK), anthropic, openai
100
+ usage.py the usage ledger: every model call, in the provider's own units, and who paid
101
+ terminals.py a registry of terminal launchers for review sessions
102
+ registry.py the generic plugin registry with validated per-plugin options
103
+ serve.py the live server: refreshes, pushes changes to open pages, watches the config
104
+ web_setup.py the API behind the browser's onboarding and settings page
105
+ system.py the readthrough:// URL handler and the Windows scheduled tasks
106
+ logs.py the logger: build context on every line, error ids, JSON format
107
+ assets/web/ the pages as separate HTML, CSS, and JS, inlined into one served file
108
+ assets/vendor/ Cytoscape, marked, DOMPurify, and Lucide icons, with their licenses
109
+ ```
110
+
111
+ To extend it: a new forge, a new place profiles can come from, a new review agent, a new terminal, or a new study assistant is a registry entry with an options dataclass, described in [Maintaining readthrough](https://github.com/spencrr/readthrough/blob/main/docs/maintaining.md#plugins). Everything repo-specific is data in a profile, described in [Writing a profile](https://github.com/spencrr/readthrough/blob/main/docs/profiles.md).
112
+
113
+ ## Development
114
+
115
+ ```sh
116
+ git clone https://github.com/spencrr/readthrough.git
117
+ cd readthrough
118
+ uv sync
119
+ git config core.hooksPath .githooks # once: run the checks before every commit
120
+ uv run python scripts/check.py # lint, format, types, and tests with the coverage floor
121
+ ```
122
+
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.