Skip to content

Accept check receipts across host environments - #1755

Closed
eowca wants to merge 3 commits into
mainfrom
lean178/1740-portable-check-receipts
Closed

eowca wants to merge 3 commits into
mainfrom
lean178/1740-portable-check-receipts

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #1772 after two review rounds. The blocking finding was resolved and both the portable receipt and stage-reuse regression are carried by the replacement. Refs #1740.

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 primary review by claude on 6ebc7002c279194fca90e21f7d7c0e7094969402, 39.7s: 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)

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

Comment thread tests/test_sandbox.py
monkeypatch.setenv('LZ_KEEP', 'changed')
assert _current_check_report(git_repo, cfg, fetched_base) is None
elif change == 'grant':
elif change in {'grant', 'host_environment'}:

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: No regression shows explicit or delegated values still bind the fingerprint

The new host_environment case only shows that changes to inherited PATH/LANG/LC_ALL/TERM/HEAVY_SLOT_GRANTED_CORES are now accepted. No test shows the other half of the task: an explicit [checks] env value (for example env={'PATH': ...} or env={'HEAVY_SLOT_GRANTED_CORES': '2'}) still invalidates the receipt when it changes. No test shows that a check_runner config still binds these variables either. I searched the tests and no other test covers this. The code looks right: host_env - dict(config.env).keys() skips explicit keys, and the not config.check_runner guard keeps delegated runners bound. But a later refactor could pop these values unconditionally and every test would still pass. Smallest fix: in this case, also assert that _current_check_report(...) returns None after changing an explicit cfg.env PATH value, or after switching to a check_runner config while PATH changes.

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: Make the exempt host-variable set a named module constant

The set {"PATH", "LANG", "LC_ALL", "TERM", "HEAVY_SLOT_GRANTED_CORES"} is rebuilt on every call inside settings_fingerprint. The same names are repeated in docs/ARCHITECTURE.md and the test. A module-level constant next to SANDBOX_ENV, for example RECEIPT_PORTABLE_ENV = frozenset(...), would give one place to update and let the test import it. This avoids the code, docs and tests drifting apart. It's non-blocking.

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 5c82dce740078e61938b23de0642c328d46ad75b, 21.1s: request_changes (0 critical, 1 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)

Findings without a file location:

  • suggestion: Inline copy of the cache_check fixture drops assert report.ok and adds a redundant core.excludesFile setting — cache_check(cfg) is replaced by a hand-written copy of the fixture, but cache_check is still used elsewhere, for example test_unmatched_inputs_run_fresh at line 811. The copy has three problems:
  1. It drops assert report.ok. If the first run fails, the negative cases (all except other) would pass without testing anything, because a failed receipt is never reused anyway.
  2. It writes the receipt before adding .loopzero/ to the exclude file. The fixture adds the exclude first.
  3. It sets core.excludesFile to .git/info/exclude. Git already reads that file by default, so the setting does nothing and only suggests that something else is going on.
    Smallest fix: put back the cache_check fixture parameter and the cache_check(cfg) call.

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

Comment thread docs/ARCHITECTURE.md Resolved
Co-Authored-By: Codex <noreply@openai.com>
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