Skip to content

Count review-thread findings only from review publishers - #1580

Merged
mergify[bot] merged 8 commits into
mainfrom
lean178/1100-trusted-thread-findings-3
Nov 26, 2026
Merged

mergify[bot] merged 8 commits into
mainfrom
lean178/1100-trusted-thread-findings-3

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Count review-thread findings only from review publishers

Context and goal

  • Goal: Only findings that loop-zero's own reviewer posted can block a PR or reach the agent that resolves findings; anyone else's review comment is ignored.
  • Problem: Readiness, hosted eligibility and loopzero resolve treated any unresolved review thread containing a finding marker as a blocking reviewer finding, whoever wrote it and wherever in the comment the marker sat. On a public repository any GitHub user can open such a thread, block merge, and have its text handed to an agent as reviewer output. A reviewer's own non-blocking comment that quoted a marker also became blocking.
  • Context: A finding marker is the hidden HTML comment the reviewer puts on the first line of each blocking inline comment (<!-- loopzero:finding v=1 severity=... head=... id=... -->). Review publishers are the trusted GitHub logins in the base workflow.toml (delivery.review_publishers), the same set already used to decide which reviews count.

Closes #1100

Acceptance

  • A thread whose first comment was written by someone other than a configured review publisher is ignored by open_blocking_findings, open_findings (loopzero resolve), readiness (loopzero ready/merge) and hosted eligibility.evaluate, even with a valid marker.
  • A publisher comment whose marker is not its first line (for example quoted in a suggestion) does not block.
  • Only the current head-bound v=1 marker (with head and id) blocks; the older unversioned forms without a head binding no longer do.
  • Publisher-authored blocking threads still block, and resolve lists and resolves them as before. The App's bot account is matched by its REST login (name[bot]); GraphQL reports bot authors without that suffix, so the code adds it only for Bot authors, and a user account with the same name does not match.
  • Tests cover an outsider marker, a quoted marker, an indented marker, unversioned markers, a same-name user lookalike, an empty publisher set and valid publisher markers.

Notes

  • Replaces PR Count review-thread findings only from review publishers #1454 (which replaced Count review-thread findings only from review publishers #1184): Count review-thread findings only from review publishers #1454's approved head conflicted with main after main consolidated a readiness test in tests/test_github.py; this PR is that approved head merged with current main, taking main's test and passing review publishers to it. Earlier Count review-thread findings only from review publishers #1184 note: its repair commits after the second (delta) review need review coverage, and the contract puts a head that needs another review in a new PR. Main's new trusted-config loader (load_trusted) already covers Count review-thread findings only from review publishers #1184's round-two findings (base mismatch, missing base workflow), so those parts were dropped; Count review-thread findings only from review publishers #1184's threads record the earlier findings and dispositions.
  • Design pass (trust boundary): actors are review publishers (trusted, from the pinned base config) and any commenter (untrusted). Asset: the readiness verdict and the text handed to agents as findings. Invariant: a thread counts only if a publisher authored its first comment and that comment opens with a head-bound marker. Chosen approach: fetch the first comment's author in the existing GraphQL query and filter in the one parser all consumers share. Publishers are a required argument of readiness, open_blocking_findings and open_findings, so no caller silently gets an unfiltered or empty set; with no configured publishers the CLI uses the current login, as it already does for reviews.
  • Regression proof: tests/test_cli.py::test_resolve_and_ready_ignore_findings_from_non_publishers fails on pre-fix source (the outsider's finding is listed by loopzero resolve) and passes after.
  • Earlier review round one on Count review-thread findings only from review publishers #1184 (Codex): loopzero resolve now loads review publishers pinned to the base, as ready and merge do, so a PR cannot add its author to the publisher list; the marker must be the exact emitted first line (40-hex head, 8-hex id), so split, trailed or truncated markers do not block. Both have regression tests that fail at the reviewed head. The suggestion to return the marker id from the parser is not taken: optional, no behaviour change.
  • Earlier review round two on Count review-thread findings only from review publishers #1184 (Codex delta), now covered by main's trusted loader: resolve now refuses a PR whose GitHub base differs from the configured base before reading findings, and pinned config ignores PR-supplied publishers when the base has no workflow.toml (affects ready/merge too; the current-login fallback applies). Both have regression tests that fail at the delta-reviewed head. This was the last review round under the budget.
  • Review round one on Count review-thread findings only from review publishers #1454 (Codex): resolve refuses a PR whose GitHub base differs from the configured base before reading threads, because the trusted publishers belong to the configured base; covers both forms of resolve and fails at the reviewed head.
  • Old unversioned markers: the reviewer has emitted only v=1 markers for a long time; an open PR still carrying an old unversioned blocking thread would stop being blocked by it.

Base

main @ 2a11772
Base: 2a11772

Validation

Recorded for 45ebea1f665e

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

eowca and others added 8 commits November 26, 2026 00:54
Readiness, hosted eligibility and loopzero resolve now count an unresolved
review thread as a blocking finding only when a configured review
publisher wrote its first comment and that comment opens with a
head-bound v=1 finding marker. Threads from other commenters, quoted
markers and unversioned markers no longer block or reach the resolve flow.

Closes #1100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loopzero resolve now loads review publishers from the pinned base
configuration, like ready and merge, so a PR's own workflow.toml cannot
add a publisher. A finding marker counts only as the exact emitted
first line with a full head and id.

Refs #1100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loopzero resolve now refuses a PR whose GitHub base differs from the
configured base before reading findings, and pinned configuration never
takes review publishers from the PR when the base has no workflow.toml;
the current-login fallback applies instead.

Refs #1100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thread-findings-2

# Conflicts:
#	docs/ARCHITECTURE.md
#	src/loopzero/cli.py
Refs #1100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The trusted review publishers belong to the configured base, so
loopzero resolve now stops before reading threads when the PR's GitHub
base differs.

Refs #1100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thread-findings-3

# Conflicts:
#	tests/test_github.py

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by codex on 45ebea1f665ef58d29966ec2ae96191b4403ae7d, 89.5s: approve (0 critical, 0 important, 1 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model gpt-6.2-astra (effort medium); CLI-reported model gpt-6.2-astra (effort medium); configured model gpt-6.2-astra (effort medium)
Raw reviewer output
Native Codex transcript retained in the restricted local review receipt; public evidence is publisher-derived, not backend attestation. Exact raw SHA256: acc8f41843937726896c853af988829ba6e93b3650eb8ff46ef560ae3694de3f

Comment thread src/loopzero/github.py
"""(marker id, thread id, finding) for every unresolved blocking thread, any head."""
return [
(MARKER_RE.search(node["comments"]["nodes"][0]["body"]).group("id") or node["id"], node["id"], f)
(_thread_marker(node, publishers).group("id"), node["id"], f)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Reuse the marker ID from the validated match

Both open_findings and resolve_finding call _thread_marker again after _parse_thread has already validated the same comment. Returning the marker ID alongside the Finding would let both callers use the accepted match directly and avoid repeating the publisher lookup and regex match.

@eowca
eowca marked this pull request as ready for review November 26, 2026 07:13
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 26331ce at 07:25 UTC

10 min in the queue, 3 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 07:14 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1625
  • ✅ Merged 07:25 · 26331ce · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 26331ce into main Nov 26, 2026
16 checks passed
@eowca
eowca deleted the lean178/1100-trusted-thread-findings-3 branch November 26, 2026 07:25
@mergify mergify Bot removed the queued label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: Count review-thread findings only from configured review publishers

1 participant