Skip to content

Close seven gaps in the release-contract fixtures and their docs (follow-up to #1285) #1616

Open

Description

@MaxGhenis

A review of #1285 after it merged found these seven gaps.

  1. The fixture generator, tools/generate_release_contract_fixtures.py, replaces the US builder's _runtime_versions with a hand-copied table, US_RUNTIME, and no test compares that table with the builder's package tuple. A contributor can add a package to that tuple in tools/build_us_fiscal_refresh_release.py, and every real US build then records a different runtime while --check and the fixture tests pass. Have the generator replace _package_or_workspace_version and platform.python_version instead, so the golden takes its keys from the builder, or add a test that compares the two key lists.

  2. docs/release-contract.md lists what a real US build writes beyond the golden, and its list names no block that the builder reads from a gate-evidence file. A contributor can change _qrf_tail_register_manifest_block, read that list and expect --check to fail, yet --check passes. Admit a UK local-area release to build folders only once the registry names it #1603 added those blocks to the matching lists in docs/agent-guide.md and the generator's docstring. The generator also replaces _release_gate_failures, so the golden records a passing calibration gate, and the agent guide's list omits that verdict. Add Admit a UK local-area release to build folders only once the registry names it #1603's clause to the document, and name the replaced gate in the guide.

  3. Without --check, the generator runs shutil.rmtree on whatever directory --output names. A contributor who passes --output packages/microcosm-data/tests/fixtures loses uk_june_2023/ and stored_input_inventories.json along with the goldens. tools/generate_staging_contract_fixtures.py deletes its --output the same way, so have both generators refuse a target that holds any file they do not write.

  4. The generator writes the UK calibration file name itself, while a real assembly takes it from _assemble in tools/assemble_uk_release_dir.py. A contributor who renames the NPZ there and updates the assembler tests that name it leaves the golden with the old name, and --check and test_assembled_release_has_the_release_contract_golden_shape pass. Move the name into one assembler constant that _assemble, the generator and the tests read.

  5. The generator's _c1_inventory calls line_for_release_id to write line into c1/inventory.json, and C1 in docs/release-contract.md names only the two pointer-file functions as its remaining callers. The generator also sets default on both golden records, and C5 says only the switch tool sets it. Name the generator in each sentence.

  6. In packages/microcosm-data/tests/engine_free/shared/test_release_contract_keying.py, test_the_same_bytes_pass_under_an_unlisted_id_and_fail_under_a_us_id gives the validator different bytes on each call, because its _retarget helper rewrites build_id and every artifact's revision. Rename it test_the_same_release_passes_under_an_unlisted_id_and_fails_under_a_us_id, and cut "with nothing else changed" from its docstring.

  7. The retire list in docs/release-contract.md still says of format_uk_release_id and apply_uk_release_identity: "On main none has a caller outside its own tests and the uk_runtime re-export". Put the release contract on paper and freeze C1 and C5 as golden fixtures (M0) #1285 deleted the helpers, their tests and the re-export, so update the cell.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions