| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-93e4f91 |
| 4 | status: adopted |
| 5 | title: "Changes, not branches: the integration primitive is a change, not a ref" |
| 6 | created: 2026-07-14 |
| 7 | source: brainstorm during the S1 week |
| 8 | --- |
| 9 | |
| 10 | # Changes, not branches |
| 11 | |
| 12 | **Thesis.** What matters about a pending branch is the _diff targeting a particular version stream_ |
| 13 | — the branch is transport, not substance. A change is (target stream, delta, provenance, attestation |
| 14 | over the resulting tree). Every branch in the S1 pending queue was created, reviewed as a diff, |
| 15 | integrated, deleted: single-use packaging around the object that was actually under review. The |
| 16 | integration primitive should be a change object, not a ref. |
| 17 | |
| 18 | **Demand signal.** The S1 week's staleness pain. A branch bakes its base into its identity, so every |
| 19 | integration invalidated the rest of the queue — `valley review` grew a [b]ase verb (rebase onto main |
| 20 | in a throwaway worktree) within a day of going sovereign. The queue's members were never "branches |
| 21 | to merge"; they were diffs targeting main whose packaging kept expiring. |
| 22 | |
| 23 | **Staleness reframed, not eliminated.** A patch that applies cleanly to a moved stream yields a tree |
| 24 | _nobody tested_. The architecture already answers this: attestations bind to trees, so reapplication |
| 25 | on a new base demands re-verification. That is "staleness as the unified failure mode" and witness |
| 26 | re-derivation — patch-shaped all along. The change model doesn't dodge the failure mode; it names it |
| 27 | precisely. |
| 28 | |
| 29 | **Commutation.** Non-overlapping changes can land in any order (Darcs/Pijul patch theory). The |
| 30 | pending queue stops being a race for the base and becomes a **partial order** — structurally rhyming |
| 31 | with the outcome DAG ([[ida-eac723e]], [ida-eac723e-outcome-dag.md](./ida-eac723e-outcome-dag.md)). |
| 32 | Changes are to code what outcome nodes are to intent: units with dependencies, not positions in a |
| 33 | line. |
| 34 | |
| 35 | **Stable identity.** A change's identity is its intent + content, not its base. Prior art to study, |
| 36 | all three: jj's change-ids surviving rebase (hardest study — git-compatible underneath), Gerrit's |
| 37 | change/patchset model, the kernel's `format-patch` flow. |
| 38 | |
| 39 | ## Consequences by phase |
| 40 | |
| 41 | - **Phase 3 (integrator).** The integrator accepts changes targeting streams. Candidate encoding: |
| 42 | `refs/the-valley/changes/*`, iterations reviewed via `git range-diff`; |
| 43 | [contribute.md](../../design/contribute.md)'s integration-request ref is already nine-tenths of a |
| 44 | change object. |
| 45 | - **Phase 2 (attestations).** Attestations bind (base, delta, tree) explicitly — the re-verification |
| 46 | demand above falls out of the schema instead of being policy. |
| 47 | - **Phase 4 (dispatch).** Dispatch becomes symmetric: an agent consumes an outcome node and emits a |
| 48 | change. klaus's budget-pause persistence gap (patflynn/klaus#282; the gap row in [[ida-594df79]], |
| 49 | [ida-594df79-klaus-s3-requirements-oracle.md](./ida-594df79-klaus-s3-requirements-oracle.md)) is |
| 50 | trivially a stored change object. |
| 51 | |
| 52 | ## Open design questions |
| 53 | |
| 54 | Unanswered on purpose: |
| 55 | |
| 56 | - The identity function of a change — what is hashed, over what, to survive rebase. |
| 57 | - The iteration/patchset model — what "a new version of the same change" is. |
| 58 | - Conflict semantics — what imposes order between overlapping changes. |
| 59 | - Signature/attribution binding across re-application — whose signature covers the rebased tree. |