Skip to content

feat(fixed): Stage 4 fixed-run failure records lack failing test ids and log tails, so a resumed... - #473

Merged
thomashan merged 16 commits into
mainfrom
I-1796129923-fixed-run-logs-and-noise-rerun/P-1796129958-CLA-CO5.5/E-1796130203-CLA-CO5.5/_
Dec 2, 2026
Merged

thomashan merged 16 commits into
mainfrom
I-1796129923-fixed-run-logs-and-noise-rerun/P-1796129958-CLA-CO5.5/E-1796130203-CLA-CO5.5/_

Conversation

@thomashan

Copy link
Copy Markdown
Collaborator

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-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.

Key Changes

  • Implement 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.

References

None

Plan & Validation Metadata

  • Plan ID: P-1796129958-CLA-CO5.5
  • Expected Value (EV): 36.35
  • Agent: claude-agent
  • Model: claude-opus-5-5

Holon Intent Agent and others added 13 commits December 1, 2026 12:59
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 thomashan left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✅ 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.

@thomashan
thomashan added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit ff77b3b Dec 2, 2026
20 of 22 checks passed
@thomashan
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
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