Repository navigation
Deduplicate runner envelope and provenance handling - #1914
Conversation
Architecture-Review: unchanged; runner arguments, review evidence, and acceptance and failure rules retain their existing contracts. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 1db329d65966185facce0687a236ec3be211d81c, 26.4s: 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.
| return {key: _setting(fields.get(key)) for key in ("model", "effort")} | ||
|
|
||
|
|
||
| def _read_envelopes(raw, loads=json.loads): |
There was a problem hiding this comment.
suggestion: New shared helper has no type hints, unlike the code around it
_read_envelopes(raw, loads=json.loads) is the one place both trust-boundary parsers now go through: json.loads for saved settings and validation, and _evidence_json, which rejects duplicate keys, for native Codex evidence. Its signature has no annotations, while neighbouring public functions are annotated. I checked behaviour and it matches the old code at every call site: review_settings still catches TypeError/ValueError, validate_runner_result still catches JSONDecodeError/TypeError, and _codex_evidence still catches ValueError. Normalization can't raise, so moving it inside the try blocks changes nothing. Smallest fix: annotate it, e.g. def _read_envelopes(raw: str, loads: Callable[[str], object] = json.loads) -> list[object]:, so it's clear which parser each caller relies on.
| if ( | ||
| type(value["version"]) is not int | ||
| or value["version"] != 1 | ||
| if (type(value["version"]) is not int or value["version"] != 1 |
There was a problem hiding this comment.
suggestion: Hand-collapsed conditions now indent inconsistently
Several conditions were folded by hand from the ruff-format style. In _valid_codex_evidence (around lines 645 and 671), the continuation or ... lines start at the same indent as the if body, while validate_runner_result and _codex_evidence use an 8-space hanging indent. Lint passes because E501/E12x are not selected, so this is cosmetic. But if anyone later runs ruff format on the file, it will expand these blocks again and give back most of the line savings. Smallest fix: use one hanging-indent style for the collapsed conditions, or leave formatter-owned blocks as they were and count only the real deduplications (_read_envelopes, _git_dir removal, the single Codex argv, the merged claude/codex pinned branches).
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Task
Remove 43 counted source lines from runners.py without changing runner behavior, CLI, configuration, state, or tests. Only #1380 touched this file among the 19 open PRs inspected. Its patch still applies cleanly to this change.
Proof
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Validation
Recorded for
1db329d65966uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Review