The texts port reads what a Lens said on each of its own review threads, and never an edited comment (#856)

Merged
DO
1d ago
+263-7

Part of #856: step 1 of the three the Factory Builder ruled on 2026-11-14, the Maintainer's choice "Full fix, keep auto-release".

What is wrong

"A re-review is given none of its Lens's open Findings, so a thread closes on the silence of one more review" (#856). A review is handed no Finding its Lens raised before, so a later review that says nothing of one has not ruled on it. Since "A push past a Lens's review asks it again while its thread gates, and a thread its later review dropped is the Kernel's to resolve (#833, record 0212)" (#859), live on factory/v0.1.13, that silence releases the thread.

The fix has three steps. This is the first: the read. Nothing changes at run time until the second.

What this changes

  • adapters/texts.py gains findings. It reads what a Lens said on each review thread a caller asks for, by the thread's id, as {id, by, body} with the id thread: and the thread's id: a text as an issue's body is, which a Task carries under its writer's trust. It is never a fact, a decision or a code.
  • What it holds each text to. A review thread, the one asked for, of this pull request in this repo; its first comment, which replies to none; written by that Lens's own account, by id and type, as adapters/timeline.Accounts tells it; never edited; and a body that is text.
  • An edited comment is refused. GitHub's author is who made a comment, not who wrote the words it holds now, and anyone with write access can edit one (the design's 3.3). So a first comment with a lastEditedAt, the Lens's own edit included, raises.
  • A field GitHub does not give proves nothing. That a comment replies to none, and that it was never edited, are each read from an explicit null.
  • What cannot be read whole raises Unanswered, so that no Task lists a Finding it does not show. A list that is no list, names a thread twice, holds an id of no thread's form or is longer than 50 raises before anything is asked of GitHub.
  • No caller asks yet. Which threads to ask for is the caller's, from the facts.

What it does not do

  • Step 2, by hand: harness/read.py hands a re-review its Lens's open Findings, harness/apply.py refuses a Result with no disposition on a Finding it was shown, and the reviewer's instructions ask for one. harness/ is a model Lens's input, so that pull request is the Maintainer's to approve.
  • Step 3, after the cut that follows step 2: a thread closes on a later review's accepted ruling alone, with the record that takes the place of 0212's row on a dropped thread. Until then release on silence stays as it is.
  • No trial has recorded this read. The query follows the threads port's (P-41, P-5, P-49), and P-58 records lastEditedAt for a description, not for a review comment. I asked GitHub the query word for word, once, as the Maintainer's login, for the reviewer's thread on "Trial P-66, a queued pull request: once the base it waits on moves into conflict with it, the queue takes it out unmerged (#812)" (#847): it answered a PullRequestReviewThread with its pull request, replyTo null, lastEditedAt null and the author a Bot with its id. An edited review comment's answer I have not seen. The test states the query word for word, so a change to it is a change to a test.
  • A deleted first comment. GitHub then gives the thread's next comment as its first (P-49, P-53), so a Lens's own reply would be read as what it first said. No Factory write replies on a thread today. The module says so; step 2's caller must not rely on more.
  • Length. The port bounds how many threads it reads, not how long each is. What a Task keeps is harness/task.py's: a Lens's text ranks before an issue's there, and a text over the room left is left out whole. Step 2 must count a Finding as shown only where its text was kept.

Checked at this desk

At 9b796a12: tests.test_adapters, 184 tests; make checks, every check ok; the change's 22 mutants, all killed, and no mutant stale of 7,611; gitleaks, no leaks. 314 lines and 27,956 characters as the Kernel counts them, under the 60,000 of the review budget. CI verifies.

Reviews

Astra (max): 3 findings, 3 taken. Kimi (max): 1 finding, 1 taken. Carbon: 4 findings, 4 taken. Claude security: 5 findings, 5 taken. Muse: not run (quota), owed. Each read 0b2e8c32; none has read the fixes at 9b796a12.

ReaderSeverityFindingTaken
Claude securitymajorA first comment is handed as the Lens's own words by its author alone, though another account may have edited itYes: lastEditedAt is asked for and an edited comment raises, with two mutants
AstramajorA missing replyTo is accepted as proof of an opening commentYes: read from an explicit null, with a mutant
Astra, Claude securitymajor, minorThe query is its own test oracle: one that asks less still passesYes: the test states the query word for word, with two mutants
Astra, Kimi, Carbon, Claude securitymajor, minorNo test holds the status guard: the failed read's body was emptyYes: a 502 with a whole body, and a mutant; one for a body that is no object too
Carbonmajordata or repository that is a string raises AttributeError, not UnansweredYes: each is read as an object or as nothing, with cases
CarbonmajorThe guard on a list that is no list, the id's length and a comment that is no object survive mutationYes: cases for a string with no letter twice, a tuple, 100 and 101 characters and a null comment, with two mutants
Carboninfoadapters/AGENTS.md no longer names texts.pyYes: one sentence; the file is at its 40 lines
Claude securityinfoA thread whose Finding's comment was deleted hands the Lens's reply as the FindingSaid in the module and above; nothing reaches it today
Claude securityinfoThe port bounds the threads' number, not their length, and a thread's text ranks before the issue's in a TaskSaid in the module and above; it is step 2's to hold

šŸ¤– Generated with Claude Code