Skip to content

Accept check receipts across host environments - #1772

Merged
mergify[bot] merged 5 commits into
mainfrom
lean178/1740-portable-check-receipts-v2
Nov 26, 2026
Merged

mergify[bot] merged 5 commits into
mainfrom
lean178/1740-portable-check-receipts-v2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1740. Supersedes #1755 after its two review rounds. The live danio-3 receipt proof follows rollout of the new CLI on both hosts.

The local-sandbox receipt ignores only inherited PATH, LANG, LC_ALL, TERM and the CPU grant. Workflow-pinned values, other allowlisted inputs, the delegated runner identity and environment, the trusted base where used by the check, and ordered commands remain bound. Stage reuse still binds the actual execution environment.

The existing transferred-receipt integration test now verifies that ordinary ready accepts an unchanged receipt from a worker with a different PATH, locale, TERM, and CPU grant. It also verifies actual stage reuse under matching settings, actual stage reruns across environments, and rejection followed by a fresh check for a legacy receipt without a digest. Size delta: +2 source lines and +3 test lines.

Validation

Recorded for 97ac94073955

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

eowca and others added 3 commits November 26, 2026 10:19
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown

⚠️ The sha of the head commit of this PR conflicts with #1755. Mergify cannot evaluate rules on this PR. Once #1755 is merged or closed, Mergify will resume processing this PR. ⚠️

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

loopzero primary review by claude on 486f9b78a22fe141b11af187ffc88780f7d5ec5c, 32.5s: approve (0 critical, 0 important, 1 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/sandbox.py
settings["environment"].pop("HEAVY_SLOT_GRANTED_CORES", None)
if not config.check_runner:
# Inherited host settings can differ at readiness. Stage reuse still binds them.
host_env = {"PATH", "LANG", "LC_ALL", "TERM", "HEAVY_SLOT_GRANTED_CORES"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Host-environment exclusion set is an inline literal duplicating existing base-env lists

{"PATH", "LANG", "LC_ALL", "TERM", "HEAVY_SLOT_GRANTED_CORES"} is rebuilt on every call. It repeats runners.BASE_ENV (("PATH", "LANG", "LC_ALL", "TERM")) and the default env_allowlist in types.py:40. If one of those lists changes later, nothing keeps this exclusion set in step, so readiness portability and the documented list in ARCHITECTURE.md could drift apart. Smallest fix: define a module-level constant, e.g. _PORTABLE_HOST_ENV = frozenset({...}), next to SANDBOX_ENV, add a comment saying it must match the docs, and use it here. Behaviour is otherwise correct. _hash_inputs still passes the full _execution_settings environment into each stage key, so stages rerun when these values change. Explicit config.env entries are still bound, and the check_runner path is unchanged.

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

loopzero delta review by claude on cadcc8d068cb5099e44f2117507d21ae0e7445c9, 36.6s: approve (0 critical, 0 important, 2 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Findings without a file location:

  • suggestion: Inlined copy of the cache_check fixture drops report.ok and adds a redundant git config line — test_declared_input_reuse no longer uses the cache_check fixture (lines 731-747). It now repeats the fixture's work inline: it runs the checks, saves the report, and appends .loopzero/ to .git/info/exclude. Two things changed along the way:
  1. The assert report.ok check on the seeding run is gone. If the seeding run fails, nothing stops the test there. The 'grant' and 'other' cases would still catch it, but the other parametrized cases would check reuse against a failed receipt without saying so.
  2. It adds git config core.excludesFile .git/info/exclude. Git always reads .git/info/exclude, so this line does nothing. It looks like a workaround for a problem that doesn't exist.

The other tests in this file (test_unmatched_inputs_run_fresh, test_local_check_reuse_tracks_checkout_bytes, test_cache_fingerprint_spawn_error, test_local_checks_run_fresh_without_a_base, test_runner_upgrade_invalidates_pass) still use the fixture, so the receipt-seeding logic now lives in two places. Smallest fix: put cache_check back in the signature, call cache_check(cfg), and delete the three inline lines.

  • suggestion: PATH/LANG/LC_ALL/TERM portability is no longer tested directly at the sandbox layer — Removing the 'host_environment' case means _current_check_report is no longer tested directly against PATH, LANG, LC_ALL or TERM changes. At this layer only the CPU grant (HEAVY_SLOT_GRANTED_CORES) is still covered. The CLI test test_ready_checks_transferred_whole_job_receipt[different-environment] now covers this end to end, and it also checks that stages rerun. So the coverage still exists, but if it regresses, the failure will show up in a much bigger CLI test. That is acceptable under the task's "reuse existing regression cases" wording. If you want a precise failure location, consider extending the existing 'grant' branch so it also changes PATH and LANG before calling _current_check_report.

Native Claude output is retained in the restricted local review receipt.

@eowca
eowca marked this pull request as ready for review November 26, 2026 10:14
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 3f60c7f at 10:20 UTC

6 min in the queue, 4 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 10:14 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1800
  • ✅ Merged 10:20 · 3f60c7f · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 3f60c7f into main Nov 26, 2026
15 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1740-portable-check-receipts-v2 branch November 26, 2026 10:21
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