Repository navigation
Conversation
Description: Stage 4 fixed-run failure records lack failing test ids and log tails, so a resumed or handed-over resolver pass still has to re-query or rediscover what failed, and timing-gate, runner or cancelled checks either look green (when cancelled) or get handed to the resolver instead of being rerun. Goal: Record failing test ids and log tails per failed check in review_state['fixed_runs'] and ensure timing-gate, runner and cancelled failures are automatically rerun rather than handed to the resolver as defects. (1) Failed-log capture in apps/sandbox-executor/src/sandbox_executor/flow/review/fixed_run_failures.py and apps/sandbox-executor/src/sandbox_executor/flow/review/ci_inspection.py: add a trailing optional log_lookup seam (Callable[[dict[str, Any]], str | None] | None = None) to CiInspectionInputs. When log_lookup is None, default to a helper in fixed_run_failures.py using _run_gh from flow/github/ci_head_checks.py to fetch `gh run view <run_id> --log-failed` (passing `--job <job_id>` when a job id is in the check link, falling back to run-level `--log-failed` if needed). Clean log lines with check_log_text from flow/github/stage5_test_failure.py, extract failing test ids via failing_ids_from_output from entrypoint/test_failure_record.py, and build a bounded redacted log_tail (last 25 non-empty lines, capped at 1500 chars, via redact_agent_secrets). Store `'failing_test_ids': list[str]` and `'log_tail': str` on every check entry in `context.review_state['fixed_runs'][<head>]['checks']` (falling back to `[]` and `''` under `_SETTLE_ERRORS` so an unreadable log never blocks a push or loses the rest of the record). Update `fixed_run_handover` so `FIND-CI-<iteration:03d>-RUN` includes any recorded `failing_test_ids` and `log_tail` from the checkpointed record (while still tolerating older records that omit those keys). (2) Automatic rerun of timing-gate, runner and cancelled failures without handing them to the resolver as defects: in apps/sandbox-executor/src/sandbox_executor/flow/github/ci_policy.py include `'CANCELLED'` and `'STALE'` in `_FAILED_STATES` (keeping `'NEUTRAL'` passing) so cancelled/stale checks are never reported as `all_passed=True` and reach noise routing. In apps/sandbox-executor/src/sandbox_executor/flow/review/ci_noise_rerun.py extend `rerun_noise_once` so: (a) when every failed run on the head belongs to `NOISE_CLASSES` (even across mixed noise classes such as timing-gate plus runner or cancelled), all eligible runs are rerun once (`rerun_run` for cancelled, `rerun_failed` for timing/infra); (b) when a head mixes defect runs and un-rerun noise runs on a clean review, eligible noise runs are rerun once while defect runs proceed to resolution; (c) expose a helper `defect_check_names` (registered in apps/sandbox-executor/src/sandbox_executor/flow/lazy_exports_review.py) and use it in apps/sandbox-executor/src/sandbox_executor/flow/review/loop.py so un-rerun or freshly rerun timing-gate, runner or cancelled checks are never handed to the resolver as defects in `FIND-CI-<iteration>` (while a noise failure that remains red after its rerun budget is spent still reaches the resolver as today). (3) Budgets: keep `loop.py` within its 950-line budget (deleting an existing function docstring if needed to offset the wiring line) and all other modified source modules within the 350-line default; never touch `holon-config/hygiene/module_budgets.json`. (4) Docs: update the `'CI wait budget and outcomes'` section of `docs/git_flow.md` to document `failing_test_ids` and `log_tail` in `review_state.fixed_runs` and the rerun/exclusion of cancelled and mixed noise failures. (5) Tests: update and expand `apps/sandbox-executor/tests/flow/review/test_fixed_run_failures.py`, `apps/sandbox-executor/tests/test_review_loop_fixed_run.py`, `apps/sandbox-executor/tests/flow/github/test_ci_policy.py`, `apps/sandbox-executor/tests/flow/review/test_ci_noise_rerun.py`, and `apps/sandbox-executor/tests/flow/review/test_ci_routing_loop.py` to cover log capture, redaction, error tolerance, checkpoint round-trip into `FIND-CI-<iter>-RUN`, cancelled-run reruns, mixed noise reruns, and mixed defect+noise filtering. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show. Generated by Holon Intent Agent at 2026-12-01T12:58:59Z
…-run-logs-and-noise-rerun/P-1796129958-CLA-CO5.5/_
Action-Origin: pr_review Review-Iteration: 1 Review-Finding-Ids: R1-F1, R2-F1, R3-F1 Review-Severity: important
Action-Origin: pr_review Review-Iteration: 1
…ation 2) Action-Origin: pr_review Review-Iteration: 2 Review-Finding-Ids: R1-F1, R1-F2, R2-F1, R2-F2, R3-F1 Review-Severity: nit
Action-Origin: pr_review Review-Iteration: 2
thomashan
commented
Dec 1, 2026
thomashan
left a comment
Collaborator
Author
There was a problem hiding this comment.
✅ Ensemble Consensus Review — APPROVED (3/3)
Reviewed fixed-run-logs-and-noise-rerun at a8b7146a against main: 0 critical, 0 important and 0 nit findings; CI passing; mergeability CLEAN.
Role reviews:
| Role (activated) | Verdict | Review |
|---|---|---|
| Engineering | PASS | Checked the reordering: note_rerun now precedes record_routing, so the beside-defect RERUN row records reruns 1, like the all-noise path. |
| Testing | PASS | There is now one _routing_rows helper that filters non-routing rows; all 26 tests in test_ci_noise_rerun.py pass, and ruff is clean. |
Verified:
- The beside-defect RERUN row records the spent rerun count —
apps/sandbox-executor/src/sandbox_executor/flow/review/ci_noise_rerun.py - There is exactly one _routing_rows helper and the noise rerun tests pass —
apps/sandbox-executor/tests/flow/review/test_ci_noise_rerun.py - Only one _routing_rows helper remains and the tests pass —
apps/sandbox-executor/tests/flow/review/test_ci_noise_rerun.py - The beside-defect RERUN row records the spent rerun because note_rerun runs first —
apps/sandbox-executor/src/sandbox_executor/flow/review/ci_noise_rerun.py - One _routing_rows helper remains, with the row filter —
apps/sandbox-executor/tests/flow/review/test_ci_noise_rerun.py
Checks: Mergeability CLEAN · CI 15/16 passed, 0 failing, 0 pending (source: ci_head)
Covers head a8b7146; change fingerprint pf2:2bc4c4c6cc22; CI at that commit: 15 of 16 checks passed.
🗳️ Ensemble Review Breakdown
- Reviewer 1 (
claude-agent / claude-opus-5-5):APPROVED(critical: 0, important: 0, nit: 0) - Reviewer 2 (
claude-agent / claude-opus-5-5):APPROVED(critical: 0, important: 0, nit: 0) - Reviewer 3 (
claude-agent / claude-opus-5-5):APPROVED(critical: 0, important: 0, nit: 0) - Ensemble Consensus Verdict:
APPROVED
Reviewed by claude-agent (3-Agent Ensemble) · Model claude-opus-5-5
Stage 5 calibration will be added to this PR before merge. Merging remains with the human maintainer.
Action-Origin: pr_review Review-Iteration: 3
thomashan
deleted the
I-1796129923-fixed-run-logs-and-noise-rerun/P-1796129958-CLA-CO5.5/E-1796130203-CLA-CO5.5/_
branch
December 2, 2026 22:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage 4 fixed-run failure records lack failing test ids and log tails, so a resumed or handed-over resolver pass still has to re-query or rediscover what failed, and timing-gate, runner or cancelled checks either look green (when cancelled) or get handed to the resolver instead of being rerun.
Goal:
Record failing test ids and log tails per failed check in review_state['fixed_runs'] and ensure timing-gate, runner and cancelled failures are automatically rerun rather than handed to the resolver as defects. (1) Failed-log capture in apps/sandbox-executor/src/sandbox_executor/flow/review/fixed_run_failures.py and apps/sandbox-executor/src/sandbox_executor/flow/review/ci_inspection.py: add a trailing optional log_lookup seam (Callable[[dict[str, Any]], str | None] | None = None) to CiInspectionInputs. When log_lookup is None, default to a helper in fixed_run_failures.py using _run_gh from flow/github/ci_head_checks.py to fetch
gh run view <run_id> --log-failed(passing--job <job_id>when a job id is in the check link, falling back to run-level--log-failedif needed). Clean log lines with check_log_text from flow/github/stage5_test_failure.py, extract failing test ids via failing_ids_from_output from entrypoint/test_failure_record.py, and build a bounded redacted log_tail (last 25 non-empty lines, capped at 1500 chars, via redact_agent_secrets). Store'failing_test_ids': list[str]and'log_tail': stron every check entry incontext.review_state['fixed_runs'][<head>]['checks'](falling back to[]and''under_SETTLE_ERRORSso an unreadable log never blocks a push or loses the rest of the record). Updatefixed_run_handoversoFIND-CI-<iteration:03d>-RUNincludes any recordedfailing_test_idsandlog_tailfrom the checkpointed record (while still tolerating older records that omit those keys). (2) Automatic rerun of timing-gate, runner and cancelled failures without handing them to the resolver as defects: in apps/sandbox-executor/src/sandbox_executor/flow/github/ci_policy.py include'CANCELLED'and'STALE'in_FAILED_STATES(keeping'NEUTRAL'passing) so cancelled/stale checks are never reported asall_passed=Trueand reach noise routing. In apps/sandbox-executor/src/sandbox_executor/flow/review/ci_noise_rerun.py extendrerun_noise_onceso: (a) when every failed run on the head belongs toNOISE_CLASSES(even across mixed noise classes such as timing-gate plus runner or cancelled), all eligible runs are rerun once (rerun_runfor cancelled,rerun_failedfor timing/infra); (b) when a head mixes defect runs and un-rerun noise runs on a clean review, eligible noise runs are rerun once while defect runs proceed to resolution; (c) expose a helperdefect_check_names(registered in apps/sandbox-executor/src/sandbox_executor/flow/lazy_exports_review.py) and use it in apps/sandbox-executor/src/sandbox_executor/flow/review/loop.py so un-rerun or freshly rerun timing-gate, runner or cancelled checks are never handed to the resolver as defects inFIND-CI-<iteration>(while a noise failure that remains red after its rerun budget is spent still reaches the resolver as today). (3) Budgets: keeploop.pywithin its 950-line budget (deleting an existing function docstring if needed to offset the wiring line) and all other modified source modules within the 350-line default; never touchholon-config/hygiene/module_budgets.json. (4) Docs: update the'CI wait budget and outcomes'section ofdocs/git_flow.mdto documentfailing_test_idsandlog_tailinreview_state.fixed_runsand the rerun/exclusion of cancelled and mixed noise failures. (5) Tests: update and expandapps/sandbox-executor/tests/flow/review/test_fixed_run_failures.py,apps/sandbox-executor/tests/test_review_loop_fixed_run.py,apps/sandbox-executor/tests/flow/github/test_ci_policy.py,apps/sandbox-executor/tests/flow/review/test_ci_noise_rerun.py, andapps/sandbox-executor/tests/flow/review/test_ci_routing_loop.pyto cover log capture, redaction, error tolerance, checkpoint round-trip intoFIND-CI-<iter>-RUN, cancelled-run reruns, mixed noise reruns, and mixed defect+noise filtering. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show.Key Changes
References
None
Plan & Validation Metadata
P-1796129958-CLA-CO5.536.35claude-agentclaude-opus-5-5