The release step keeps its own exchanges, held to lists, as a public artifact of its run (record 0176)

Merged
DO
7d ago
+1087-20

Closes #531, "The release step records its own exchanges, redacted, after factory/v0.1.0".

The edit to .github/workflows/release.yml was pre-approved by the Maintainer 2026-11-08, ruled by the Factory Builder. The design was approved on 2026-11-09 with three rulings:

  • one record, numbered at enqueue;
  • import tools/redact_trial.py, don't copy it;
  • keep the artifact 90 days.

The record is 0176, the number the Factory Builder gave at enqueue; main is merged in.

What it does

release/exchanges.py's Recording wraps the release step's one transport. It keeps each exchange the step sends through RELEASE_TOKEN, and passes every request through unchanged. The file becomes an artifact of a public repo, so what is kept is held to lists, and anything not on them is left out and its place named in dropped:

WhatKept as
The call and its AcceptAs sent; an Accept only where one is given
Headers, sent and answeredOnly those tools/check_trials.py's HEADERS lets a trial's fixture keep, but location, a redirect's address
A JSON body, sent or answeredOnly the fields FIELDS names, at any depth; a text, a number or a truth only under such a field
An artifact's download, a file read at a commit, a body that is not JSONSize and sha256 alone; a file by its own bytes, so a fixture can hold it to the file; an answer with no body, by nothing
Everything keptThen put through tools/redact_trial.py's redact_json, the trials' own redaction

Keeping never changes the step. A fault drops that exchange and is counted in unkept. release/move.py writes the file in a finally, whatever stopped the step, and prints what it printed before.

release.yml:

  • names the folder: RELEASE_EXCHANGES: ${{ github.workspace }};
  • gains a last step, if: always(), that uploads release-exchanges.json as the one artifact release-exchanges, kept 90 days. Nothing prints it.

tools/check_repo.py refuses that file at the checkout's root, so a committed one can never stand there first and be uploaded in place of the step's own record.

The rulings' conditions on the import:

  1. It is pure. Importing release.exchanges starts no process and opens nothing but modules, held by an audit-hook test.
  2. It redacts what the trials' own tests use. A test runs every counter-example in tests/test_tools.py's SHAPED through it.

Held by

  • Tests: tests/test_release_exchanges.py has 15, and tests/test_tools.py one more for the root file.
  • Workflow shape: tools/check_workflows.py's rules for release.yml, with six counter-examples:
    • the upload only on success;
    • the exchanges printed;
    • another name;
    • 30 days;
    • no folder named;
    • an empty with: on the step.
  • Schema: release-exchanges/1 (schemas/release-exchanges.schema.json), with an example and a counter-example.
  • Mutants: 26 new, plus 4 of tools/check_workflows.py's re-pointed to lines this change moved. Every mutant of release/exchanges.py and release/move.py is killed by the tests it names alone.
  • The record: docs/decisions/0176-the-release-step-keeps-its-own-exchanges-held-to-lists-as-a-public-artifact-of-its-run.md, and a row in release/AGENTS.md.

Checks

  • make verify on an export of the head, 8057b8e (tree a7e3ecd): running; the result is added below when it ends.
  • Every mutant of release/exchanges.py and release/move.py, 46 in all, is killed by its named tests alone; 41 of them were also run by tools.mutants and killed.

Reads

Argon and Muse read fcfbfc3; the Claude review and the security pass read 1c71084. The fix round after them, d71ec66, answers their findings, and no reader read it again. The merge of main and the numbering change nothing of this PR's own.

ReviewerHeadUnread partsBlockingMajorMinorInfo
agyfcfbfc3none0120
musefcfbfc3none0120
claude-review1c71084none0041
claude-security1c71084none0010
FindingSeverityCriterionWhereWhatDisposition
agy#1majorPR-3release/move.py:181Multiple Recording instances overwrite-fail on mode 'x', and zero connections write no exchanges fileFixed in d71ec66: one recording serves the step, set on each transport it makes, and writes its file even where the step stopped before it connected.
agy#2minorPR-3release/exchanges.py:74_headers strips header names in the KEPT_HEADERS check but not in dict keys, and _keep sets accept=None when omittedFixed in d71ec66: a header's name is kept stripped, and an Accept is written only where one was given, each with a mutant.
agy#3minorPR-3release/exchanges.py:105Recording._keep mutates self.dropped in place before an exchange is completely keptFixed in d71ec66: what an exchange leaves out is named only once the exchange is kept, with a mutant.
muse#1majorPR-1release/exchanges.py:71A JSON array-of-strings (or scalar) body is kept whole, under no named fieldFixed in d71ec66: a text, a number or a truth is kept only under a field FIELDS names; one alone or in a list no field names is left out and its place named, with a mutant.
muse#2minorPR-3release/exchanges.py:69No test or mutant holds the masking of a non-identifier dropped field nameFixed in d71ec66: a left-out field whose name is not a plain identifier is named by its place alone, held by a test and a mutant.
muse#3minorPR-3release/exchanges.py:133No test or mutant holds write()'s refusal of a relative folderFixed in d71ec66: a relative folder that stands is refused, held by a test and a mutant.
claude-review#1minornonerelease/exchanges.py:50A file read at a commit is measured as its re-serialized API envelope, not as the file or the bytes GitHub sentFixed in fcfbfc3: an opaque answer with no body has no measure, and validates.
claude-review#2minorPR-3release/exchanges.py:62No test holds that each field left out is listed in droppedFixed in fcfbfc3: a request's body and headers are held to the lists in a test, with two mutants.
claude-review#3minorPR-3release/exchanges.py:98No test holds the request side to the lists: a mutant that keeps the request body or headers whole survivesFixed in fcfbfc3: the test asserts what dropped names, with a mutant.
claude-review#4minorPR-3release/exchanges.py:105An opaque read answered with an empty JSON body is written as measured: null, which fails release-exchanges/1Fixed in fcfbfc3: a file at a commit is measured as its own bytes, decoded from GitHub's base64, with a mutant.
claude-review#5infoPR-1release/exchanges.py:39An error's message is kept verbatim (less any credential shape), where the issue lists an error body among what is droppedKept, as ruled: an error's message and documentation are what tell a refusal from another, and are redacted; nothing else of an error body is kept.
claude-security#1minorPR-3release/exchanges.py:128A release-exchanges.json committed at the cut commit, as a file or a symlink, is uploaded publicly in place of the step's own recordFixed in fcfbfc3: tools/check_repo.py refuses release-exchanges.json at the root, so no commit carrying one passes verify to reach main; a test and a mutant hold it.

šŸ¤– Generated with Claude Code