Harness: a Run's steps, each reading with its own credential and revoking it, and every Run leaving its outcome (#196, PR 2b-1)
Merged
DO
22d ago+1694+1694+0123456789012345678901234567890123456789-124-124-012345678901234567890123456789
What
The first part of #196's PR 2b, split on 2026-10-25 because nothing the Run's workflow files will run had an entry. This PR adds the steps; PR 2b-2 adds pass.yml, run-jobs.yml, their check rules, the checksummed CLI install, and re-points the rows that wait on run.yml. Record 0064. Nothing runs these steps until 2b-2's workflow files call them.
| Step | Entry | What it does |
|---|---|---|
run, first | harness/read.py NAME ITEM PASS OUT | Mints the reader App's token from READER_APP_KEY, for reads only. Finds the pass record by PASS, then the Decision the run-name names, held to the run-name's item, Intent, Role and content. Reads the facts and the diff's bytes, which must hash to that content, at the head the snapshot was held to. Writes a new folder of 0600 files, and revokes the token on every path before the model's step; a failed revoke fails the step |
run, the model | harness/run.py TASK OUT | The new two-argument form: it reads its inputs from the reader's folder |
verify | harness/verify.py RESULT OUT | Takes the Result by RUN_DIGEST and writes verdict/1 with checks: not_run (L-54) |
apply | harness/apply_step.py NAME ITEM PASS RESULT OUT | Mints nothing unless NEEDS shows that run and verify succeeded. Then mints pr-review's reads-only token, apply.READS. Finds the record, held to RELEASE and the run-name, and hands apply.job the item read again, a mint of its write token, and a writer held to the Role's allowlist |
apply, last | harness/outcome.py NAME APPLIED OUT | Always leaves this Run's outcome/1, apply_failed when there is none. An outcome naming a fault fails the step, so the run concludes as it ended and the pass reads it |
| the act | harness/approve_step.py NAME ITEM PASS OUT | Runs with APPROVER_TOKEN alone, held by Approving to its item. The record is held to the Release and the run-name. A fault fails the step |
| pass, writes | adapters/effects.main | Now mints the Controller's token from CONTROLLER_APP_KEY, with the writes it is granted, and revokes it when the writes end |
Shared pieces:
harness/reread.pyreads the item again the way the pass does, throughcontroller/pass_.context_of, which is now one function shared bypass_.runand the steps.adapters/identity.from_keymints any App's token from its key.adapters/facts.accounts_ofanddispatcher_ofmoved there from the entry.adapters/facts.snapshot(with_head=True),adapters/pull.change(the diff's bytes) andadapters/passes.find.controller/configuration.py.harness/steps.pygives each step a new folder of 0600 files, and makes it print one code and exit 1 when it cannot go on.
Departures
- Module names:
harness/read.py,apply_step.pyandapprove_step.py, notharness.task,harness.applyandharness.approve, so those three modules stay functions of their inputs. - What a Task carries: the diff alone. Texts and Findings are not read yet, since their ports are not built, so the review Intent is the one Intent a Run can carry. An issue's Run is refused,
issue_not_built. - Refused until the grants:
apply's reads need the pr-review App expanded (0054).- The tracking issue's write and the Pause's read need the Controller's grants (0056).
- Until then each of those steps fails closed and records why.
Gates
- Claude review with a security pass: 1 high, 2 medium and 5 low findings, all fixed in
0fccb4d. The high one: a faulted Run concludedsuccess. - Argon: 3 blockers, all fixed in
0fccb4d. Its decision-check finding was also the Claude review's. The other two:apply's and the act's callbacks were never exercised, andfind's 1 MiB bound was not held by any test. - Muse: 2 majors and 3 minors, fixed in
0e57aa8: the Release check, the re-read's Pause, the reader's grant filter, the issue Run, and the reader's item check, which0fccb4dhad already fixed. - Mutants: 66 new, each killed by hand, and every mutant in the refactored files killed again.
- Export verify: passed on the first head (1168 tests); the re-run on
0e57aa8is running.
🤖 Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Added a staged workflow for reading pull-request details, verifying results, applying eligible changes, and recording outcomes.
- Added support for locating a Run’s pass record and retrieving the pull-request diff tied to its starting revision.
- Added verdict records to report result digests and check status.
-
Improvements
- Controller and workflow credentials are now granted and revoked as part of the workflow.
- Workflow outputs use restricted file access, and invalid inputs or unreadable responses stop processing.