Threads port: every review thread with who opened and resolved it; a Lens's is its own App's, and an outside reviewer's never defers (#191)

Merged
DO
1mo ago
+353-53

Closes #191. This is the last part of the facts port. It follows the working rulings on #191 (comment 6326441619) and the Maintainer's answers to them (comment 6327479372).

What it adds

  • adapters/threads.py reads every review thread in one GraphQL read, page by page.
    • Each thread is read with its id, whether it is resolved, who resolved it, and who opened it and when, from its first comment.
    • Each actor is told apart by timeline.Accounts, by account id and type, never by a name's spelling (decision 0005, L-57). No comment text is read.
    • A thread a person opened is human, with no severity.
    • A Lens's thread is one whose author is that Lens's own App. It has no category or severity until harness/ uploads the Finding records they are joined from (decision 0038). The join rows now say "waiting on harness/".
    • An outside reviewer's thread (CodeRabbit's, Codex's) is not a required Lens's thread, so it never defers. Only a required model Lens's own App's open thread defers (unreadable_thread).
    • The list counts as whole only when:
      • every counted thread was read, and none twice;
      • no cursor repeats;
      • no next page is named past the count.
    • Three cases are handled so as not to block the whole pull request:
      • A resolved thread with no resolver named (as when an App resolved it) is read with none, and the Kernel defers on that thread alone.
      • A thread whose first comment replies to another is refused, because its opener cannot be read.
      • A deleted account's thread refuses the snapshot. That limit is stated in the code.
  • adapters/facts.py puts threads and complete.threads in the snapshot from this read.
  • adapters/checks.py no longer counts threads.
  • Rows re-pointed: 0005, 0015, 0018, 0022, 0026, 0038 and adapters/AGENTS.md.

#191's Done-when

  • Bullet 8 is met: the REST timeline is whole by its pagination. The bullet now says so.
  • Bullet 9 is not met as written. It is filed as "Facts port: the contract test replays every recorded fixture against the fake" (#283).
  • The other follow-ups filed under the epic:
    • #282: the thread trial, which a @pending test waits on;
    • #284: the snapshot pinned to the head commit;
    • #285: a failed Run's outcome read once, not every pass;
    • #286: a killed Run's outcome, §3.10 against decision 0029.

Gates

GateResult
Claude review + security passdone; one fix round (0657068), then the Maintainer's narrowing (6f0a573)
AGYnot required for this port (Argon reads Kernel, sim, CI and token-handling PRs)
Musenot run (Maintainer, 2026-10-20: Kernel/hook only)
Capped mutant run, by handevery adapters mutant killed (198 at c5441a8, plus the threads round)
Export verify (6f0a573)exit 0, 956 tests
tools/check_decisions.py in the checkoutpasses

🤖 Generated with Claude Code