Skip to content

Complete finding resolution with legacy stdout encodings - #1565

Merged
mergify[bot] merged 4 commits into
mainfrom
lean178/1503-resolve-legacy-output-v2
Nov 26, 2026
Merged

mergify[bot] merged 4 commits into
mainfrom
lean178/1503-resolve-legacy-output-v2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Complete finding resolution with legacy stdout encodings

Context and goal

  • Goal: Resolve a finding and refresh eligibility even when the terminal cannot encode its title.
  • Problem: The successful GitHub mutations precede a print that can raise an encoding error, skipping the eligibility refresh.
  • Context: Preserve Unicode on capable streams. Escape a character only when the stream cannot encode it.

Closes #1503

Supersedes #1520, whose published head cannot receive a delta review after a base merge.

Acceptance

  • With strict ASCII stdout, list findings with Unicode titles or paths and complete the same reply, resolve, and eligibility operations in the same order.
  • Preserve the original Unicode on UTF-8 stdout and leave GitHub content intact.
  • Extend existing cases with zero net test lines.

Base

Base: 2a11772

Notes

Use the CLI's existing stdout configuration to select a display error handler for resolve. This keeps the mutation and dispatch flow as it was. No architecture update is needed because output encoding does not change GitHub or readiness authority.

Validation

Recorded for 33d2d5841f2f

  • 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

Architecture-Review: unchanged; stdout escaping preserves the existing resolution and eligibility sequence.
Co-Authored-By: Codex <noreply@openai.com>

@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 claude on e2df91b7a9db720b0f997f9330098590f099c6de, 23.2s: approve (0 critical, 0 important, 0 suggestion)

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

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Architecture-Review: unchanged; escaping is scoped to the existing finding output and leaves resolution and eligibility sequencing intact.
Co-Authored-By: Codex <noreply@openai.com>

@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 delta review by claude on a3deb601b14ac21cc68654269c1ecbfd6e76e312, 21.7s: approve (0 critical, 0 important, 2 suggestion)

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

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/cli.py

def cmd_resolve(args: argparse.Namespace) -> int:
"""List open blocking findings, or reply to one with what changed and resolve its thread."""
encoding = getattr(sys.stdout, "encoding", None) or "utf-8"

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: Unrelated removal of the cmd_resolve docstring

This diff replaces the docstring "List open blocking findings, or reply to one with what changed and resolve its thread." with the encoding = ... line. The docstring was the only summary of what the two modes of this command do, and removing it isn't needed for the encoding fix. Smallest fix: keep the docstring and put the encoding assignment on the line after it.

Comment thread src/loopzero/cli.py
if not args.finding:
for marker_id, _thread, f in github.open_findings(config.repo, pr.number):
print(f"{marker_id} {f.severity} {f.path or '-'}:{f.line or '-'} {f.title}")
print(f"{marker_id} {f.severity} {f.path or '-'}:{f.line or '-'} {f.title}".encode(encoding, "backslashreplace").decode(encoding))

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: The same encode/decode escaping is written out twice

Both resolve prints (lines 1675 and 1678) repeat .encode(encoding, "backslashreplace").decode(encoding) inline, which also makes line 1675 very long. If another resolve message later prints finding text, it would need to copy this again, and a missed copy would bring back the ASCII-stdout crash. The notes also describe a different approach: using the CLI's existing stdout configuration to pick the error handler, which is what the previous commit did. The per-print escaping in this commit is correct and more local, so this is non-blocking. Smallest fix: add a small _display(text) helper (or a local lambda) in cmd_resolve and call it from both prints.

Architecture-Review: unchanged; the merge preserves trusted review publishers and the reviewed display encoding.
Co-Authored-By: Codex <noreply@openai.com>

@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 delta review by claude on cc60ef913de4160ca24d63c7453694997c57fdf9, 11.2s: approve (0 critical, 0 important, 1 suggestion)

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

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/cli.py
@@ -1827,18 +1827,18 @@ def _delete_tracking_ref(wt: Path, branch: str, expected_head: str) -> None:


def cmd_resolve(args: argparse.Namespace) -> int:

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: Merge resolution dropped the cmd_resolve docstring that main added

When the conflict was resolved, the branch's encoding = ... line replaced main's docstring """List open blocking findings, or reply to one with what changed and resolve its thread.""" instead of being added after it. Nothing else in the repo contains that docstring, and nothing reads cmd_resolve.__doc__, because argparse help only uses __doc__ in eligibility.py. So nothing breaks, but the merge quietly undoes documentation from #1863 that this task never meant to touch. Smallest fix: put the docstring back as the first statement of cmd_resolve and keep the encoding line below it.

@eowca
eowca marked this pull request as ready for review November 26, 2026 12:24
@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 9f05593 at 12:32 UTC

7 min in the queue, 4 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 12:25 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1881
  • ✅ Merged 12:32 · 9f05593 · 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 9f05593 into main Nov 26, 2026
14 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1503-resolve-legacy-output-v2 branch November 26, 2026 12:34
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.

Complete finding resolution when stdout cannot encode the title

1 participant