| 1 | # Contributor protocol |
| 2 | |
| 3 | A contributor publishes a signed change, supplies the required verification evidence, and explicitly |
| 4 | requests integration. The same protocol applies to humans and agents. |
| 5 | |
| 6 | Publishing a topic branch makes the work available for review. Requesting integration asks the |
| 7 | integrator to evaluate it and, if policy is satisfied, update the protected branch. |
| 8 | |
| 9 | ## Publishing and requesting integration |
| 10 | |
| 11 | Commit the work with native SSH commit signing, then push the topic branch to the project's |
| 12 | canonical `origin`: |
| 13 | |
| 14 | ```sh |
| 15 | git push --set-upstream origin <branch> |
| 16 | ``` |
| 17 | |
| 18 | Use the valley review helper to inspect the published change: |
| 19 | |
| 20 | ```sh |
| 21 | nix run .#valley -- review <branch> |
| 22 | ``` |
| 23 | |
| 24 | The helper fetches and reviews `origin/<branch>` against `origin/main`. At its prompt: |
| 25 | |
| 26 | - `[s]kip` leaves the change available for later review. |
| 27 | - `[b]ase`, when offered, rebases it in a temporary worktree, pushes with a lease, and returns to |
| 28 | review of the resulting diff. |
| 29 | - `[a]sk` runs the required checks, signs their results, and publishes an integration request. |
| 30 | Choose it when the change is ready to be evaluated for landing. |
| 31 | - `[r]eject` deletes the remote branch after confirmation. |
| 32 | |
| 33 | The review prompt's `[a]sk` action currently targets `main`. It reads the project policy from the |
| 34 | target's integrated tip and the floor from the owning valley's integrated repository. It runs checks |
| 35 | over a temporary checkout of the published branch, not over the reviewer's working files. |
| 36 | |
| 37 | When checks are required, `VALLEY_ATTEST_KEY` must name the host's Ed25519 signing-key file. |
| 38 | `VALLEY_ATTEST_NAME` optionally selects the signing name. The integrator must recognize that signer. |
| 39 | This configuration is separate from native Git commit signing. |
| 40 | |
| 41 | The evidence and request are sent in one `git push --atomic`. The branch is already on `origin`, so |
| 42 | it is not part of that second push. A check or signing failure publishes no request. An atomic-push |
| 43 | failure publishes neither the request nor new evidence on the remote. |
| 44 | |
| 45 | The CLI does not write `main`. The integrator evaluates the request and records its outcome. GitHub, |
| 46 | when configured as a publication mirror, is not part of this review or integration path. |
| 47 | |
| 48 | ## Records in the protocol |
| 49 | |
| 50 | | Record | Purpose | |
| 51 | | ----------------------- | ------------------------------------------------------------------------------------------ | |
| 52 | | Signed commit | Attribute the authored repository change | |
| 53 | | Check statement | Identify the checked tree, check, result, and supplied provenance | |
| 54 | | Signed note | Attribute that statement to its signer and permit additional signatures over the same text | |
| 55 | | Attestation ref | Store evidence by tree digest and signer | |
| 56 | | Integration request ref | Name the submitted head and target stream | |
| 57 | |
| 58 | Attestations are stored at: |
| 59 | |
| 60 | ```text |
| 61 | refs/the-valley/attestations/<tree digest>/<signer key hash> |
| 62 | ``` |
| 63 | |
| 64 | A request is a ref pointing to the change's head: |
| 65 | |
| 66 | ```text |
| 67 | refs/the-valley/integration-requests/<target>/<change> |
| 68 | ``` |
| 69 | |
| 70 | The current review helper derives the change name from the branch name, replacing slashes with |
| 71 | dashes, and prints the resulting request ref. The integrator derives the delta from the head and its |
| 72 | merge base with the target. |
| 73 | |
| 74 | A policy that requires no check still permits a request. The helper reports that case and sends the |
| 75 | request without check evidence or an attestation key. The integrator records explicitly that no |
| 76 | checks were required. |
| 77 | |
| 78 | ## Using the lower-level helper |
| 79 | |
| 80 | `nix run .#attest -- run` runs checks and stores signed notes. Its `--push` option atomically |
| 81 | publishes the topic branch and evidence, but does not request integration. Native Git can publish a |
| 82 | request ref when the caller has assembled the required evidence. `valley review` provides the |
| 83 | current combined evidence-and-request workflow. |
| 84 | |
| 85 | [Verification](./verification.md) defines the helper options, signed bytes, and storage. |
| 86 | [Integration](./integration.md) defines request evaluation and evidence transfer. |
| 87 | |
| 88 | ## Enforcement and planned additions |
| 89 | |
| 90 | Protected refs are reserved for the integrator. Attestation refs are create-only through the receive |
| 91 | boundary. Other namespaces currently follow push access; the |
| 92 | [project-scoped permissions](../.the-valley/decisions/dcr-e544f20-access-is-verbs-on-projects.md) |
| 93 | need additional enforcement. |
| 94 | |
| 95 | Submitting a request is separate from supplying human approval. The |
| 96 | [core decision](../.the-valley/decisions/dcr-9c75283-substrate-adoption-and-the-core.md) requires |
| 97 | signed physical approval by default, with policy exemptions for ordinary work. That mechanism must |
| 98 | be available before the requirement is activated. Clicking `[a]sk` does not itself produce that |
| 99 | future approval evidence. |
| 100 | |
| 101 | External transparency publication and inclusion proofs are planned for |
| 102 | [Phase 6](./roadmap.md#phase-6--trust-backstop). Current local attestations do not include that |
| 103 | guarantee. |