Threads port: a thread's resolver is told by its account, never by resolvedBy's type (#331, part 1; P-53)
Merged
DO
24d ago+1097+1097+0123456789012345678901234567890123456789-49-49-01234567890123456789
Part of #331. Its part 2 is #338, blocked by #196 PR 2b-2.
A review thread's resolver is now told by its account, never by resolvedBy's type. Record 0067 holds the ruling. It extends 0005 and edits neither 0005 nor 0061.
What changes
- The resolver (
adapters/threads.py,adapters/timeline.py).- GraphQL types
resolvedByas a User whoever resolved the thread, an App included (P-49), and no timeline item names a resolution (P-53). - The resolver's account id is first matched to the thread's comment author, whose type GraphQL gives. Failing that, it is matched to the repo's permission read of its login, which answers the account's id and type (P-53), held to the id.
- When neither answers, or a read fails, the resolver is unread and the Kernel defers on that thread. It is never taken for a User.
- Another App (a Bot that is not the thread's Lens) leaves a Lens's thread open under
gate.closed. - Cost: one permission read per login per pass, shared with the read of a person's write access.
- GraphQL types
- Reconciliation (
adapters/seen.py,controller/reconcile.py). A thread's resolver is told by its account id among the Factory's identities. A Role's resolution is matched to itsresolve_threadEffect. Before this, an App's resolution was attributed to no identity, so an unrecorded one went unseen. - Trial P-53 (
trials/P-53.json, with a section 6 row). It ran read-only, by the Maintainer's gh login, on the canary's pull request 55, the one P-49 used, and passed.- The REST issue timeline and GraphQL
timelineItemsname no thread's resolution. - Nothing links a reply to its deleted first comment.
- The repo's permission read answers the App's bot as id 344141469, a
Bot, and the Maintainer as aUser. - Nothing was written, no token was minted, and nothing was made, so there was nothing to undo.
/usersreads were taken, then dropped from the fixture: the trials check keeps a canary fixture under the org's repos.
- The REST issue timeline and GraphQL
Not here
- A deleted first comment (part 2, #338). GitHub keeps no link from the reply, so the check must come from the Lens's own
applied/1, which nothing reads per pull request until the collector does.test_a_thread_a_trial_recorded_is_read_as_the_port_reads_itstays@pendingfor it. 0005's row names that test as not held yet, and the context check requires a not-held row to name a pending test. - A follow-up worth filing.
_can_writenever holds the cached permission answer'suser.idto the actor's id. This was already true before this PR (from the Claude review).
Gates
- The Claude review with a security pass approved. It found no way to make a Lens's open thread read as closed.
- Argon and Muse each raised a blocker, the same stale mutant. Muse also raised a major: reconciliation read a resolver as a User. Both are fixed in bb51de0, and Argon re-read the fix round.
- Mutants. All 69 mutants of
threads.pyandtimeline.py, plus the newseen.pyandreconcile.pyones, apply once, parse and are killed.
Verify
make verify passes on a fresh export. The record is 0067: this pull request goes ahead of #340, which takes 0068.
š¤ Generated with Claude Code