Skip to content

Bind frozen evidence to stored code copies instead of live modules - #385

Merged
lanyue-llk merged 2 commits into
mainfrom
refactor/frozen-copies
Nov 25, 2026
Merged

lanyue-llk merged 2 commits into
mainfrom
refactor/frozen-copies

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Purpose

Step 1 of #379: frozen evidence binds a copy of the code it ran, not the bytes of a live module. After this, Web Extract modules (pipeline.py, dataset.py, repair.py, swde.py, self_hosted.py) and the visual checkers can be edited without invalidating completed evidence.

flowchart LR
    subgraph Run["At run time"]
        C["collection / repair / visual check"] -->|copy bytes| K["copies beside the evidence<br/>execution/pipeline.py, execution/dataset.py,<br/>execution/repair.py, frozen-sources/&lt;sha&gt;.py.txt"]
    end
    subgraph Verify["Later verification"]
        V["load_run, verify_repair,<br/>receipt_is_current, web_search verify"] --> K
        V --> G["Git store for older evidence<br/>reporting/data/frozen-sources/"]
    end
    L["live module"] -. "only for a collection still to come<br/>(plan pins the code that will run)" .-> C
Loading

Survey: every verifier of these bindings

Binding Verifier before Now
pipeline_sha256 (run contract) resume guard (live, in flight); preflight assessment re-checked live when a completed cohort was re-certified run stores execution/pipeline.py (pipeline_snapshot, existing field), checked by verify_execution_snapshot; completed cohorts check the assessment against the run's own contract (as the report build already did)
dataset_registry_sha256 (plans, contracts) certification.run compared the plan to live dataset.py even for completed cohorts run stores execution/dataset.py (dataset_registry_snapshot); completed cohorts skip live code checks; a collection still to come keeps the live guard
task_adapter_sha256 / task_scoring_dependencies_sha256 (records.py, swde.py) same certification.run path same: live only before collection
repair code_sha256 (repair.py, pipeline.py) code_snapshots: false: hash only, nothing could verify it later code_snapshots: true; copies are stored and verify_repair already checks them
implementation_sha256 (self_hosted.py) the deployed service compares its own identity at call time unchanged: a call-time guard, no historical verifier exists
lexbench orchestrator_sha256 historical verifiers (resource_summary, resource_evidence, lexbench/verification) already read the orchestrator.py copy stored with the evidence; execute() checks live only before calls unchanged; nothing to migrate
checker_sources / producer_sources (visual receipts) receipt_is_current and Web Search verify compared to live modules receipts keep content-addressed copies in frozen-sources/ beside the receipt; receipts written before resolve in src/harness/reporting/data/frozen-sources/ (bytes of all five checker modules at 8738917, listed with path and commit in index.json)

Live comparisons that remain are pre-call guards: a frozen plan must run the code it pinned, and an in-flight run resumes on its original commit (existing policy).

What changed

  • reporting/visual.py: checker_paths, keep_sources, sources_are_frozen; the reference browser's binary discovery (binary_env, local_executables) is declared on the chromium adapter, so browser_executable has no instance literal. Its private file_sha256 now comes from record_io.
  • BrowserAdapter gains binary_env and local_executables.
  • browser_use/report_visual.py, trajectory_replay/webarena_report_visual.py, web_search/visual.py keep copies when they write a receipt.
  • web_extract/pipeline.py, repair.py, certification.py, dataset.py (registry_source) as in the table.
  • Tests that asserted runs were hash-only now assert the copies; new tests cover kept copies, the Git store, tampering and completed-cohort re-certification with a changed registry.
  • Skill reference: visual receipts no longer block routing checker modules.

Allowlists

  • Instance literals: 1 → 0 (harness.reporting.visual -> chromium removed; file is now {}).
  • Layering: unchanged.
  • test_shared_hash_json_helpers frozen-copy exemptions: 3 → 2 (reporting/visual.py no longer needs its own hash helper).

Baselines

Unchanged (tests/baselines pass without refresh). Scorer hash unchanged: 0fe8931734e1ba7282e1e9c8303eea958d20fdcee83d84e87cdc7e08cd08169e.

Verification

  • uv run --frozen --all-extras python -m pytest -n 8 --dist worksteal tests: 21644 passed, 78 skipped, 2 xfailed.
  • make lint-check: passed.
  • uv run --frozen lexbench-webfetch version: same scoring-source hash.

Breaking changes

None to commands. New Extract run contracts and repair contracts carry pipeline_snapshot/dataset_registry_snapshot and code_snapshots: true; an Extract run that was initialized but not yet given a contract, with a stray execution/pipeline.py that differs from the code, now stops instead of ignoring it.

Part of #379 (step 2 follows in a separate PR). Follows up #368 (last instance-literal allowlist entry).

…nce browser from its adapter

Visual receipts store copies of the checker sources beside the receipt and
verify against those copies; receipts written before resolve in the Git store
of frozen sources. The visual QA browser binary comes from the reference
browser adapter, emptying the instance-literal allowlist.
Collections store pipeline.py and dataset.py beside the scheduler copy and
repairs store repair.py and pipeline.py. A completed cohort verifies its
certificate chain and stored copies, not the live modules.

@lexmount-ocr lexmount-ocr 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.

✅ Review complete · 109d47f

No findings in this review.

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