Skip to content

test: cover campaign outcome evidence edge cases - #36

Draft
cursor[bot] wants to merge 14 commits into
mainfrom
cursor/regression-test-coverage-5cef
Draft

test: cover campaign outcome evidence edge cases#36
cursor[bot] wants to merge 14 commits into
mainfrom
cursor/regression-test-coverage-5cef

Conversation

@cursor

@cursor cursor Bot commented May 2, 2026

Copy link
Copy Markdown

Pull Request Template

Summary

Adds focused regression coverage for campaign outcome evaluation/projection edge cases.

Risky behavior now covered:

  • Config rows without any cycle/request evidence stay NO_EVIDENCE / INSUFFICIENT_EVIDENCE and cannot produce success-style review authority.
  • Aborted outcomes with no evaluator detail still project an abort-reason diagnostic instead of an empty failure cause.

Test files added/updated:

  • test_campaign_outcome_slice1.py

Why these tests materially reduce regression risk:

  • The campaign outcome slice gates final review messaging and process exit semantics. These cases prevent future changes from treating lifecycle/config metadata or missing diagnostic detail as trustworthy success evidence.

Why

Recent campaign outcome code added new truth/projection paths where weak evidence or missing failure detail could regress into misleading final-review output.

Scope

  • Narrow change
  • Broad change

Risk

Test-only change. It affects regression coverage for the campaign outcome evaluator/projection seam.

Validation

  • Dev contract verified (.\.venv\Scripts\python.exe .agent\scripts\helpers\verify_dev_contract.py --quick or CI equivalent)
  • Tests added or updated
  • Existing tests passed
  • Manual validation performed
  • Not validated yet

Ran:

  • QUANTMAP_LAB_ROOT=/tmp/quantmap-lab python3 -m ruff check test_campaign_outcome_slice1.py test_runner_campaign_outcome_hardening.py test_cli_ux_post_run_review.py test_cli_ux_yolo_review.py
  • QUANTMAP_LAB_ROOT=/tmp/quantmap-lab python3 -m pytest --cov=src.campaign_outcome --cov=src.runner --cov=src.ui --cov-report=term-missing test_campaign_outcome_slice1.py test_runner_campaign_outcome_hardening.py test_cli_ux_post_run_review.py test_cli_ux_yolo_review.py

Agent Surface

  • Instruction files reviewed if behavior/tooling changed
  • Workspace settings changes are intentional and minimal
  • If .agent/scripts/agent_surface_audit.py is present in this branch, agent surface audit passed

Notes

Dev dependencies were installed in the automation environment before validation because pytest was initially unavailable.

Open in Web View Automation 

Mad-Labs42 and others added 14 commits May 1, 2026 19:26
Adds a pure campaign_outcome package for deriving explicit campaign outcome truth from runner-fed evidence.

Final review now consumes a FinalReviewReadModel projected from CampaignOutcome instead of treating report_ok as campaign success. report_ok remains report-generation evidence only.

Wires runner finalization through evaluate_campaign_outcome and project_final_review, adds outcome-based exit-code handling, and preserves measurement truth separately from report/artifact success.

Adds focused evaluator/projection tests plus runner hardening regressions for report_ok false-success prevention and report-failure preservation.
Normalize explicit report status before report_ok, tighten recommendation authority to fully successful measurement evidence, preserve evaluator failure detail in projection, distinguish report/export failures from analysis failures, and add adversarial coverage for conflicting post-run truth.
Extract shared private post-run rendering helpers so legacy and read-model final-review entrypoints share presentation logic without changing outcome semantics, public renderer signatures, or UI behavior.
Preserve backend-startup failure domains during no-success finalization, exit interrupted campaigns with code 130, and align artifact test fixtures with canonical artifact constants.
Split campaign outcome synthesis into ordered private gates, reduce post-run review helper complexity, and remove duplicate metrics DTO drift by reusing the final-review metrics snapshot contract.
Manually port useful Cursor Bugbot regression coverage for pre-measurement aborts, fatal measurement failures, and campaign evidence aggregation while leaving stale or redundant bot-generated behavior out of the branch.
Add targeted docstrings for the campaign outcome contracts, evaluator, projector, runner evidence aggregation, and post-run UI rendering to clarify ownership of outcome truth and presentation boundaries.
Carry synthesized abort reasons through campaign outcome evaluation, treat explicit complete report status as authoritative, and route KeyboardInterrupt through evaluator-backed final review before exiting 130.
Use a single module import style for campaign outcome evaluator tests to satisfy CodeQL import hygiene while preserving behavior.
Guarantee interrupted campaigns exit 130 even if final review rendering fails, keep normal completion unreachable after interruption, narrow boundary-invalid measurement classification to OOM-backed evidence, and remove remaining artifact fixture drift.
Prioritize measurement failures over lifecycle-complete no-success states, share final-review rendering across normal and interrupted paths, and stop duplicating status truth inside evidence summaries.
Require enough OOM-backed aggregate capacity before treating invalid cycles as explained, remove the unreachable lifecycle-complete no-success outcome gate, and guarantee interrupted closeout exits 130 even when evidence fetch fails.
Project artifact display mode from campaign outcome truth so failed, aborted, and insufficient-evidence runs show diagnostics-oriented review instead of a full artifact table, while preserving full artifacts for success, partial, and degraded outcomes.
Co-authored-by: Joshua L. Davis Sr. <Mad-Labs42@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented May 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

2 participants