test_run: caller-decided fetch_cloud + local/cloud agreement (audit fix 1)#85
Merged
Conversation
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>
This was referenced Jul 16, 2026
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
Fix 1 from the evidence-chain audit (#83 finding A, doc §5.1; campaign PyAutoBuild#155 Phase 2): the
test_runcheck's server-first cloud verdict was unreachable from every real entrypoint —run()inferredfetch_cloudfromresults_dir is None, andmain()(the tick and the mobile path) always passedresults_dir, so the leg has been running on the localtest_results/latest(stale since 2026-07-09) since the server-first design merged.Changes:
fetch_cloudis decided by the caller, never inferred:main()passesfetch_cloud=Trueexplicitly (the tick IS the real path); barerun()defaults to no network (library/test callers).ready = local AND cloud),cloud_readyis always recorded, and a mismatch writes adisagreementfield. 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 passingleg'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
source=cloudwith the true latest run's timestamp.Generated by the PyAutoLabs agent workflow.