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-124

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.

StepEntryWhat it does
run, firstharness/read.py NAME ITEM PASS OUTMints 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 modelharness/run.py TASK OUTThe new two-argument form: it reads its inputs from the reader's folder
verifyharness/verify.py RESULT OUTTakes the Result by RUN_DIGEST and writes verdict/1 with checks: not_run (L-54)
applyharness/apply_step.py NAME ITEM PASS RESULT OUTMints 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, lastharness/outcome.py NAME APPLIED OUTAlways 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 actharness/approve_step.py NAME ITEM PASS OUTRuns 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, writesadapters/effects.mainNow 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.py reads the item again the way the pass does, through controller/pass_.context_of, which is now one function shared by pass_.run and the steps.
  • adapters/identity.from_key mints any App's token from its key.
  • adapters/facts.accounts_of and dispatcher_of moved there from the entry.
  • adapters/facts.snapshot(with_head=True), adapters/pull.change (the diff's bytes) and adapters/passes.find.
  • controller/configuration.py.
  • harness/steps.py gives 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.py and approve_step.py, not harness.task, harness.apply and harness.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 concluded success.
  • 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, and find'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, which 0fccb4d had 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 0e57aa8 is 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.