Skip to content

Remove duplicate subprocess option handling - #1585

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/575-runtime-dedupe
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/575-runtime-dedupe

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Remove duplicate subprocess option handling

Context and goal

  • Goal: Keep loop-zero within its source line cap.
  • Problem: The subprocess helper sets text mode explicitly even though its error handler already selects that mode. The environment override also needs a separate conditional.
  • Context: This slice covers the shared subprocess helper and excludes all files in the five parallel deduplication PRs.

Refs #575

Acceptance

  • Reduce measured source lines without touching excluded files or changing CLI output, exit codes, options or configuration.
  • Preserve subprocess environment overrides, decoded and raw output modes, and timeouts.
  • Pass the focused process tests and the full loop-zero check.

Notes

  • The initial main snapshot had 7,730 source lines. Main advanced during validation, and this branch incorporates that update.

Base

main @ 2a11772
Base: 2a11772

Focused validation

  • All 11 subprocess tests passed, including subprocess timeout cleanup and SIGTERM.
  • A direct check with CRLF and invalid UTF-8 verified both decoded and raw output modes.
  • Against the updated main snapshot, source drops from 7,824 to 7,822 lines. Test source stays at 13,695 lines.

Validation

Recorded for 54c88e15fe11

  • 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

  • primary, claude, 54c88e1, approve

eowca and others added 2 commits November 26, 2026 07:58
Architecture-Review: unchanged; subprocess I/O and environment semantics stay the same.
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 54c88e15fe11996e30141eab4a84d35cd87bde5c, 10.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/_proc.py
stderr=subprocess.STDOUT if merge_output else subprocess.PIPE,
text=not preserve_newlines,
encoding=None if preserve_newlines else encoding,
errors=None if preserve_newlines else "replace",

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: Text vs. bytes mode now depends implicitly on the errors argument

The change doesn't alter behavior. Popen turns on text mode when encoding, errors, text or universal_newlines is set. In the default path, errors="replace" is always set, even when encoding is None, so stdout and stderr are still decoded with universal newlines. In the preserve_newlines path, all three are None, so the pipes stay in bytes mode and the decode at lines 167-170 still runs. The risk is for future edits: the mode choice now depends on a side effect of errors. If someone later drops errors="replace" or passes it in both branches, the mode would quietly flip. That would return bytes where str is expected, or translate CRLF in raw mode. Smallest fix, with no line cost: add a short comment on line 141 saying errors also selects text mode. A regression test that asserts the decoded-mode CRLF→LF translation would also catch it.

@eowca
eowca marked this pull request as ready for review November 26, 2026 07:25
@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 f9514c4 at 07:36 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 07:27 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1638
  • ✅ Merged 07:36 · f9514c4 · 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 f9514c4 into main Nov 26, 2026
18 checks passed
@eowca
eowca deleted the lean178/575-runtime-dedupe branch November 26, 2026 07:37
@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.

1 participant