The review flow inverts: the checks and an evidence pack exist before the operator reads the change. `valley review` and `approve` show the prepared diff and its evidence, then ask for the touch. Today checks run after the operator has read the diff.
Per `change-identity-design.md` §2, a ready version is prepared on a pinned tip: result tree, landing message, classes and required checks from the actual tip-to-result paths, and evidence over the result.
Done when review shows evidence that already exists, and approving starts no check.
Source: `plan.md` M4 item 6 and "the-valley: keep, rework, drop"; `change-identity-design.md` §2 and "Sequence" step 3.
Comments
contributor2026-11-01 16:58 UTC
Priority update, 2026-11-01: a real operator approval took 43m43s, dominated by one 43m30.3s system build. The CLI ran all 11 checks locally, while the coordinator observed complete reusable host-worker evidence for that exact head before the local command finished. Whether this was a stale client or evidence arriving after the one-time coverage read is still under investigation.
This outcome should be assessed alongside the one-minute latency mission, not deferred merely until overflow-worker work is complete. Preserve the explicitly chosen local fallback for unsupported checks and worker outages until a reviewed replacement is specified; do not strand those approvals or silently weaken evidence requirements. Review should expose preparation and distinguish ready-for-review from evidence-complete. Any proposal that files approval before evidence must account for current missing-evidence verdicts, restacking and exact-head authority, rather than assume that no other subsystem changes behavior.
The new telemetry outcome oc-8e7e027 will make host and client timing/progress visible to the coordinator. Use that evidence to choose the smallest safe approval/preparation improvement. Full end-to-end latency and version-to-evidence time must remain reported; moving waits before the approval prompt is not by itself proof of reduced total waiting.
contributor2026-11-02 22:17 UTCedited2026-11-04 00:27 UTC by contributor
The operator, 2026-11-02: "I see my approval of a change and checks passing as orthogonal." Observed the same evening: the operator approved a downstream project's mpun at 21:35, one minute after the host worker started its batch. The approve read coverage once, found all 18 checks missing because the worker publishes only a complete batch, and built all 18 on the workstation, alongside the worker building the same 18. The request is filed only after the local builds finish, so the approval itself waited 40+ minutes on duplicated work. Direction: approval records intent at once; the host worker supplies evidence; the integrator lands when both hold; a local build is an explicit fallback. A design is being drafted by a critic consult before any build.
contributor2026-11-02 22:23 UTC
Design draft, part 1 of 2 (Astra, consult thread approval-orthogonal, read against 247c466), 2026-11-02. Not built. It awaits the operator's decision on slicing and on automatic local builds.
Approval records intent immediately. Checks establish whether the approved content may land. A failed or unfinished check leaves the approval standing.
This is a proposed design; its changes are **not built**. The code findings below are verified against `247c466675ff0f50a8674d656c3b499ca0012c3c`. The reported duplicate-build incident is consistent with the implementation, but its timings were not independently verified.
The current behavior has three important limits. Approval carry is parsed but not enforced. A request is authorized through SSH and the `approve` grant, but does not contain a durable operator-signed approval statement. Finally, moved landings re-evaluate check closures, but do not derive the required check set again from the resulting landing delta. I could not find `oc-deeb48e` in HEAD or the available plan graph; its stated behavior must not be treated as implemented.
The request’s life is separate from its approval:
1. **Filed.** The operator’s approval and request are durable. Filing succeeds without check execution.
2. **Waiting for evidence.** The approval applies, but required evidence is missing. The request remains pending. This is a normal state.
3. **Check failed or worker unavailable.** The approval still applies. Durable worker records explain the failure, retry time, or inability to run a check. None of these records permits landing.
4. **Needs a new version.** The delta conflicts, or existing evidence cannot transfer to the candidate tree. A restack may produce a suitable version.
5. **Needs approval.** A replacement version fails the carry rules, or the approval expires, is revoked, or loses eligibility. Passing checks cannot clear this state.
6. **Submitted.** The integrator verifies both approval and evidence, then records the landing and consumes the request atomically.
Malformed evidence remains a rejection. An integrator execution error remains `failed`, distinct from a failed check. Unready changes remain held; withdrawal voids the pending authorization.
Today, missing evidence produces `stale`, with stale reason `evidence`. The integrator reports it, publishes a request-stale event, and records the outcome under `refs/the-valley/integration-outcomes`. It retains the request. An unchanged judgment is suppressed across passes and restarts. However, the fingerprint covers all attestation refs, so unrelated evidence can cause the same request to be judged and reported again. An execution failure instead records `failed` and has a ten-minute retry window; changed inputs bypass that window.
Add `waiting-evidence` to the verdict and every outcome reader. Store its missing checks and reasons in a durable detail record, bound atomically to the outcome. Do not emit request-stale for ordinary missing evidence. Recompute when relevant inputs change, but report only changes to the visible decision or its reasons. In particular, `restack.Currency` must hold a waiting request: today it releases a family on a current `stale` outcome.
Evidence pushes already wake the integrator. Preserve that path and include any new evidence namespace. A final passing note should trigger integration immediately, without waiting for a worker batch-end record or retry timer. “Within seconds” is an acceptance target for a healthy, otherwise unblocked controller, not an existing latency guarantee. Per-check publication increases wake frequency, so verification work must be reused safely and wakes coalesced without losing a final update.
In `bin/valley`, change `approve` to bind the reviewed head, perform the existing readiness and head checks, and file immediately. Evidence inspection becomes useful reporting rather than a prerequisite for recording intent. Reading worker status must not delay filing.
Make local execution explicit with `valley approve --build-here`. This files first, then runs and publishes missing checks. If execution fails or the client disconnects afterward, the output must say that approval is already recorded. Retrying local execution must not replace or silently re-file a consumed request. Keep request leases and the final readiness check.
The recommended default is no automatic local fallback. A missing worker declaration, an old progress record, or a recorded failure should produce an actionable status message. Automatically starting forty minutes of workstation work because a worker’s status is uncertain recreates the original problem. Worker presence also does not imply complete coverage: today the worker handles Nix checks only, while approval runs command checks locally.
Worker discovery needs two durable records. A host-controlled service declaration says which worker serves this repository and which runners it supports. Publishing that declaration follows the instance’s configuration; it is a **deployment choice**, not proof that the process is running. Absence means “no service declared.”
Each worker also publishes a signed, append-only history of attempts. An attempt names the head, tree, policy inputs, check definitions, attempt ID, completed checks, failure reasons, and retry time. A compare-and-swap update prevents concurrent writers from losing state. The hook permits the worker to write only its own records. Evidence refs remain authoritative for passing results; attempt records explain progress and failures. A running record left by a crashed worker eventually reads as “last reported running; current state unknown.” It must not be interpreted as either success or proof of failure.
`status/worker.go` keeps its existing local crash recovery and backoff, but publishes those decisions. It must also consider heads named by pending requests, not only active versions of ready changes. Otherwise approval of X can wait forever after the active version becomes Y. For carried requests, the integrator publishes a durable demand naming the actual candidate and the checks it still needs. That demand schedules work; it grants no approval.
Partial publication requires a new layout. The existing `<tree>/<signer>` ref cannot gain children while it exists, and updating its note tree violates the push namespace’s create-only rule.
Use a separate namespace:
`refs/the-valley/attestations-v2/<tree-digest>/<signer-key-hash>/<note-sha256>`
Each ref holds exactly one signed check note in a fixed tree layout. The final component hashes the complete note bytes. The hook verifies the note, subject, named signer, and content hash before accepting creation. Updates and deletion remain forbidden. Identical publication is idempotent; different notes occupy different names. Concurrent checks and workers therefore need no shared ref update.
In `attest/run.go`, validate, sign, and store each passing result independently. In `attest/check.go`, deliver completion notifications as checks finish: the current reporting callback waits in input order, so merely moving signing into that callback would still delay a fast check behind a slow one. Use a serialized publication queue to push completed notes while other checks continue. A later failure leaves earlier passes published. Failed pushes retain the exact stored objects for retry.
Keep failed execution reports outside passing-evidence refs. Also fix evidence selection before enabling the new layout. `change.SelectNotes` currently keeps the first verifying note, even if it records failure or names an unsuitable computation. The integrator also omits the attribute check that approval’s coverage reader performs. Selection must test the required name, runner, attribute, subject, authorized signer, passing result, and applicable transfer rules. An unsuitable early note must not hide usable evidence. Conflicting observations of the same pure computation need an explicit diagnostic rather than silent selection.
Approval carry needs a signed record; moving a request to Y is not sufficient. Introduce a versioned request record that names one approved head X and references an immutable operator-signed approval. Bind the instance, repository, target, change ID, reviewed base and head, whole-file delta, landing message and author fields, policy and registry snapshots, carry mode, expiry, and a unique approval ID. Retain the signed approval after the request is consumed.
This is new work. The existing request ref points directly at the approved commit, and the hook authorizes its writer through the SSH principal’s grant. No current code signs that approval record. The evidence key is not a substitute for the operator’s approval key.
For a restacked version Y, the integrator independently verifies the carry predicate from `oc-d28b43a`:
- The whole-file delta, landing message, and author fields match the approval.
- The actual landing result changes exactly the approved entries and nothing else.
- The target history advances linearly from the approved preparation.
- `exact` permits no intervening landing. `same-class` permits none touching the approved classes. `same-paths` adds no interval restriction.
- Authority snapshots and current approval eligibility satisfy the recorded rules. Policy declarations changing invalidate carry; a check implementation changing requires fresh check evidence without itself invalidating intent.
- Expiry, revocation, withdrawal, and any required independence rules still apply.
The existing `delta` package and review comparison provide whole-file comparison machinery. They do not currently authorize carry. The restacker publishes versions; it does not approve them. Keep the request’s approved head X unchanged and record Y separately as the candidate selected under that approval. Include the candidate, change-record revision, approval, and authority inputs in reconciliation’s memo. Record both X and Y in the landing provenance.
Evidence is then judged for the actual candidate result. A known signer authorized for this project may supply it; the signer need not be the operator. Evidence from X may satisfy a pure check on Y only after the integrator verifies the required computation’s input and derivation digests. The current moved-tree transfer logic already performs those comparisons for a request’s landing candidate. Finding and applying that evidence across recorded versions is additional work.
When transfer fails, the worker builds the missing checks on Y. Explicit local execution can provide the same evidence under another accepted signer. A version that fixes a bug usually changes the approved delta and therefore needs fresh approval. A restack that leaves the delta unchanged can retain approval even when changed dependencies require new checks. Approval carry does not mean approval of arbitrary future fixes.
Before judging evidence, derive required checks from the actual candidate landing delta under the target’s current composed policy. Today `materialize` derives them from the request’s base-to-head delta and re-evaluates those checks’ closures on a moved result. Preserve that useful transfer behavior, but do not describe it as re-derivation of the required set.
The final landing transaction must compare the live request’s approval ID, candidate binding, target, and authority generation used for the decision. Revocation or replacement during evaluation must prevent that decision from committing. Preserve atomic landing records and request consumption, extending them for carried candidates. The current transaction can leave a moved request standing while an earlier head lands; that behavior must not become a way to bypass a new approval’s revocation semantics.
Expose all of this through `valley status`, its JSON output, and the change view. Show the approved version and signer, any carried candidate, passing and missing checks, the worker’s last durable result, and its retry time. Detailed logs may remain telemetry. Whether approval stands, why landing waits, and when execution retries must be answerable without telemetry.
Automatic retries use durable backoff. Add an explicit retry command that records a retry request for the tree and checks and wakes the worker. It does not approve content or erase evidence. A new tree gets a new attempt; a same-tree retry preserves previous successful notes.
Filing early adds no landing authority. The operator’s signature authorizes X and only candidates satisfying its carry predicate. Worker signatures establish check results only. The worker’s grants must exclude approval and request mutation, and its progress records must never count as evidence. The integrator remains the only component that combines approval, required evidence, readiness, and current authority into a landing decision.
Migration should install readers and hook validation before enabling writers. Readers accept both evidence layouts and fingerprint both. Existing evidence remains intact. Deploy waiting-state readers together with the integrator change, including status, rebase, restacker, and web readers. Then enable incremental publication and immediate filing. Existing requests receive no inferred signature or carry authority; drain them through their existing behavior before requiring the signed request format. Automatic carry is a separate final step, enabled only after its authorization and transaction tests pass.
The tests should cover:
- Filing before a deliberately blocked check finishes, with no local build under ordinary `approve`.
- Durable waiting across restarts, no repeated unchanged report, and landing promptly after final evidence arrives.
- Fast-check publication ahead of a slow check; later failure, process death, lost push response, and concurrent publication without lost evidence.
- Worker discovery, stale running records, durable failure/backoff, explicit retry, command checks, and an approved non-active head.
- Exact check selection, unsuitable earlier notes, revoked signers, and evidence from unauthorized projects.
- Carry for unchanged deltas under every mode; refusal after content, metadata, policy, registry, expiry, or eligibility changes.
- Revocation, replacement, withdrawal, and target movement during landing.
- A worker attempting to approve, forge progress as evidence, or substitute a candidate.
The one operator decision needed is whether local execution may ever start automatically. The recommendation is that `--build-here` always expresses that choice, including when no worker is declared.
contributor2026-11-02 22:23 UTC
Design draft, part 2 of 2: claim-to-code checklist.
For the slice brief and change description, retain this claim-to-code checklist separately from the document:
- **Implemented:** approval reads coverage, runs missing checks, and atomically pushes evidence with the request — `bin/valley:1860`, `bin/valley:1981`, `bin/valley:2095`.
- **Implemented:** missing evidence yields `stale`; outcomes are durable and unchanged judgments are suppressed — `integrator/verdict/verdict.go:345`, `integrator/verdict/verdict.go:317`, `integrator/refs.go:148`, `integrator/refs.go:269`, `integrator/inputs.go:138`.
- **Implemented:** the evidence fingerprint covers the namespace; evidence pushes wake reconciliation — `integrator/refs.go:811`, `nix/valley-host.nix:793`, `integrator/wake.go:132`.
- **Implemented:** worker coverage is active-version Nix work; failures have local durable backoff — `status/worker.go:347`, `status/worker.go:605`, `status/worker.go:661`.
- **Implemented:** failed batches publish no evidence; completion reporting is ordered — `attest/run.go:196`, `attest/run.go:249`, `attest/check.go:318`.
- **Implemented:** pushed evidence is create-only and bound to subject and signer — `valleyhook/policy.go:179`, `valleyhook/attestation.go:41`.
- **Implemented:** evidence selection keeps the first verifying note; coverage applies additional reuse checks — `change/evidence.go:76`, `integrator/evidence.go:103`, `status/coverage.go:345`.
- **Implemented:** current stale outcomes release restacking; review compares whole-file deltas — `restack/plan.go:193`, `status/compare.go:338`, `delta/tree.go:47`.
- **Implemented:** carry is parsed; moved landings recompute closures, and landing writes are transactional — `integrator/policy.go:218`, `integrator/refs.go:393`, `integrator/refs.go:478`, `integrator/refs.go:655`.
- **Implemented:** request authority comes from the authenticated SSH principal and approval grant — `valleyhook/shell.go:181`, `valleyhook/policy.go:186`.
- **Deployment choice:** which projects the worker serves — `nix/valley-host.nix:459`.
- **Not built:** signed approval records, enforced carry, durable remote worker progress, incremental evidence publication, and the proposed waiting state. The implementation locations above are the change points, not evidence that these guarantees already exist.
contributor2026-11-02 22:37 UTC
Parked 2026-11-02: the design draft above (signed approval records, a second evidence layout, worker progress records, a waiting-evidence state) is reference only. It deepens the current model, which the redesign after M8 will reconsider (qn-94c8817). Under M8, the tactical step is smaller: valley approve stops building missing checks on the approving machine unless asked (--build-here).
contributor2026-11-08 22:29 UTC
Done: the host worker prepares evidence before approval, listings show it, and approve builds only with --build-here (oc-24ae62d, oc-ccc39e2, oc-b0c09f2 in f007964e). The approval design draft in its comments is reference material for qn-94c8817.