Skip to content

test_run: caller-decided fetch_cloud + local/cloud agreement (audit fix 1)#85

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/heart-testrun-wiring
Jul 16, 2026
Merged

test_run: caller-decided fetch_cloud + local/cloud agreement (audit fix 1)#85
Jammy2211 merged 1 commit into
mainfrom
feature/heart-testrun-wiring

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Fix 1 from the evidence-chain audit (#83 finding A, doc §5.1; campaign PyAutoBuild#155 Phase 2): the test_run check's server-first cloud verdict was unreachable from every real entrypointrun() inferred fetch_cloud from results_dir is None, and main() (the tick and the mobile path) always passed results_dir, so the leg has been running on the local test_results/latest (stale since 2026-07-09) since the server-first design merged.

Changes:

  • fetch_cloud is decided by the caller, never inferred: main() passes fetch_cloud=True explicitly (the tick IS the real path); bare run() defaults to no network (library/test callers).
  • Disagreement is surfaced, never silently resolved: when both the local report and the cloud run carry a verdict, green requires both (ready = local AND cloud), cloud_ready is always recorded, and a mismatch writes a disagreement field. This closes the audit's §4 hole (a fresh local pass could green the leg while the server surface failed) and its mirror. A cloud run in progress (ready=None) keeps the local verdict.

Verified end-to-end against the real tick invocation (sandboxed state dir): the sidecar now reads source=cloud, ts=2026-07-15T13:09:17Z (the actual latest workspace-validation run) instead of the 07-09 local report — both surfaces currently agree NOT-ready, so the leg is honestly red rather than stale-red.

Shipped under the human-authorized corrective-PR exception for Heart RED (standing this session; this PR is reason-scoped to the workspace validation not passing leg's evidence). PR-open only; merge stays human.

API Changes

None — heart.checks.test_run.run() keeps its signature; behaviour change is confined to the tick entrypoint (now actually server-first) and two new sidecar fields (cloud_ready, disagreement).

Test Plan

  • Full suite: 284 passed (4 new: main-consults-server, agree-to-be-green, cloud-in-progress, no-implicit-network).
  • Real tick invocation verified: sidecar source=cloud with the true latest run's timestamp.
  • Existing cloud-override tests pass unchanged under the AND semantics.

Generated by the PyAutoLabs agent workflow.

The server-first cloud verdict was unreachable from every real entrypoint:
run() inferred fetch_cloud from `results_dir is None` and main() — the tick
and the mobile path — always passed results_dir, leaving the leg on the local
test_results/latest (stale since 2026-07-09) since the design merged. main()
now passes fetch_cloud=True explicitly; bare run() defaults to no network.
When both surfaces carry a verdict, green requires both (ready = local AND
cloud), cloud_ready is always recorded, and a mismatch writes a disagreement
field — closing the audit's local-green/cloud-red hole and its mirror.
Verified against the real tick invocation: the sidecar now carries the actual
latest workspace-validation run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release Merged changes awaiting the next release cycle label Jul 16, 2026
@Jammy2211
Jammy2211 merged commit cb60dd5 into main Jul 16, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/heart-testrun-wiring branch July 16, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release Merged changes awaiting the next release cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant