| 1 | # Events, trust, and durability |
| 2 | |
| 3 | the-valley is trying to make a project's history sufficient to explain and govern its operation. |
| 4 | That is a stronger ambition than keeping source code in Git. It reaches into distributed systems, |
| 5 | workflow recovery, authorization, and the conditions under which a record deserves to be called |
| 6 | evidence. The most useful distinction is between **remembering a decision, making its consequences |
| 7 | happen, and knowing what those consequences were**. Each needs a separate contract, even when all |
| 8 | three use the same infrastructure. |
| 9 | |
| 10 | This chapter's central judgment is that the project's direction is sound, but its strongest language |
| 11 | about replay and transparency currently exceeds the guarantees visible in the implementation. The |
| 12 | next step should be to specify exactly which facts survive failure and which actions can be retried. |
| 13 | That work would make the existing small tools more dependable without requiring a general workflow |
| 14 | platform. |
| 15 | |
| 16 | The analysis uses repository revision `5bb3a7736fe49b0cc4914299b142c0c9bafb6870` and sources checked |
| 17 | on 2026-09-20. “Implemented” below means visible in this checkout, not independently verified on the |
| 18 | deployed host. Code inspection supports the implementation findings; the proposed failure |
| 19 | experiments have not been executed. The [annotated source register](sources-distributed.md) records |
| 20 | reading depth and limitations for D01–D28. |
| 21 | |
| 22 | ## 1. What exists, and what remains an ambition |
| 23 | |
| 24 | The [requirements](../../design/requirements.md) ask for durable project state, agent attribution, |
| 25 | bounded and revocable trust, and a single history from which consequences can be explained. The |
| 26 | [architecture](../../design/architecture.md) chooses Git, a replaceable event bus, independent |
| 27 | controllers, and a governed identity registry. These choices already produce useful machinery, but |
| 28 | they do not yet form the complete system described by the later scenarios. |
| 29 | |
| 30 | | Area | Evidence in this checkout | Larger claim still requiring work | |
| 31 | | ----------------- | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | |
| 32 | | Event publication | A detached post-receive hook publishes ref changes; the integrator publishes outcomes. | Every historically important transition can be recovered after bus loss. | |
| 33 | | Integration | A polling controller reads durable request refs and compares evidence before updating a protected ref. | A landing and its durable decision record survive every interruption as one complete result. | |
| 34 | | Replay | `valley replay` enumerates current refs and publishes synthetic creation events. | Replay reproduces the original sequence of updates, deletions, judgments, and external effects. | |
| 35 | | Identity | A CUE registry compiles into SSH authorized keys and attestation verifier keys. | Every capability, delegation, and recovery action is checked against current governed authority. | |
| 36 | | Governance | Policy and registry changes are described as amendments judged under earlier rules. | Runtime behavior, privileged recovery, and external outputs are covered by the proposed self-transparency invariant. | |
| 37 | |
| 38 | The relevant implementation is in [the host module](../../nix/valley-host.nix), |
| 39 | [the CLI](../../bin/valley), [the integrator](../../integrator/refs.go), and |
| 40 | [the identity compiler](../../identity/compile.go). Some prose lags the code: the integrator's help |
| 41 | still says no registry compiler exists, although the compiler is present. Conversely, a decision |
| 42 | document's settled status does not demonstrate that every enforcement boundary it describes has |
| 43 | shipped. |
| 44 | |
| 45 | This distinction matters because architectural simplification can hide obligations. Saying that the |
| 46 | bus is replaceable is safe only when every irreplaceable fact has another durable home. Saying that |
| 47 | identity is declared in a repository is safe only when running gates check the declaration, or a |
| 48 | clearly identified compilation of it. The design should be judged at these boundaries. |
| 49 | |
| 50 | ## 2. A Git repository contains several different histories |
| 51 | |
| 52 | ### State reconstruction is weaker than event reconstruction |
| 53 | |
| 54 | An event-sourced system retains the events needed to reconstruct application state. Fowler's account |
| 55 | also identifies two replay hazards: repeating external updates and substituting present-day external |
| 56 | query results for historical ones. Event sourcing therefore requires a replay policy for effects and |
| 57 | observations, not just a stored sequence. |
| 58 | [D02: Event Sourcing](https://martinfowler.com/eaaDev/EventSourcing.html) |
| 59 | |
| 60 | Git can carry an event store, but its ordinary commit graph does not automatically record every |
| 61 | action taken against a repository. A commit says what tree it names and which commits precede it. A |
| 62 | branch ref says which object it currently names. Those are different facts from “this ref moved from |
| 63 | A to B in this accepted push.” The same final refs can result from several different sequences of |
| 64 | pushes. |
| 65 | |
| 66 | The current [event schema](../../schema/events.cue) acknowledges this directly: replay sets `old` to |
| 67 | the all-zero object ID because a ref's previous value is not derivable from the current repository. |
| 68 | [The replay command](../../bin/valley) runs `git for-each-ref` and publishes one `ref-updated` event |
| 69 | per surviving ref. A deleted ref has no row to enumerate. A branch that moved A→B→C is presented as |
| 70 | a creation at C. |
| 71 | |
| 72 | This gives a concrete counterexample to the strongest replay claim. Create a temporary branch, |
| 73 | update it twice, and delete it. Erase the bus. The final ref inventory cannot tell a fresh |
| 74 | subscriber that any of those operations occurred. A clone containing the same current objects and |
| 75 | refs cannot recover the missing transitions merely by inspecting commit ancestry. Some objects may |
| 76 | eventually disappear if nothing retains them. |
| 77 | |
| 78 | Reflogs are useful recovery aids, but their standard contract is different from a permanent domain |
| 79 | ledger. Git documents ref-update logs with expiration controls, including default expiration periods |
| 80 | for ordinary and unreachable entries. Making a reflog the authoritative event history would |
| 81 | therefore require explicit retention, replication, and restore rules. |
| 82 | [D03: git-reflog](https://git-scm.com/docs/git-reflog) |
| 83 | |
| 84 | There are three separate promises the project could make: |
| 85 | |
| 86 | 1. **Reconstruct present state.** Rebuild indexes and let controllers converge from durable current |
| 87 | facts. |
| 88 | 2. **Reconstruct decision history.** Recover accepted and rejected decisions with the evidence and |
| 89 | policy used at the time. |
| 90 | 3. **Recover unfinished effects.** Determine which authorized actions remain incomplete or uncertain |
| 91 | after failure. |
| 92 | |
| 93 | The existing ref replay primarily serves the first promise. The S4 “why did X occur” requirement |
| 94 | needs the second. Reliable deployment and notification need the third. None follows from the others. |
| 95 | |
| 96 | ### The landing has a recording gap |
| 97 | |
| 98 | The integrator already treats the target-ref update as a commit point. In |
| 99 | [`land`](../../integrator/refs.go), it prepares signed evidence, moves the target ref using the |
| 100 | expected previous object ID, stores evidence refs, deletes the request, and publishes the outcome. |
| 101 | It attempts the later steps even when an earlier post-commit step fails. That is sensible error |
| 102 | handling within a running process. |
| 103 | |
| 104 | A process can also disappear between those steps. [`countersign`](../../integrator/transfer.go) |
| 105 | writes evidence blobs before the target moves, but the refs that make those blobs discoverable are |
| 106 | installed afterwards. A crash immediately after the target update can therefore leave the accepted |
| 107 | commit without its ordinary evidence references. The objects may still exist, but an ordinary |
| 108 | consumer has no complete durable landing record to follow. This is a crash-consistency concern from |
| 109 | inspection, not a claim of an observed production incident. |
| 110 | |
| 111 | Git offers transactions over multiple ref updates through `update-ref --stdin`. Its documentation |
| 112 | also warns that a concurrent reader may observe only some modifications even when the transaction's |
| 113 | updates were accepted together. That makes multi-ref transactions a candidate tool, with reader and |
| 114 | crash behavior to test against the selected ref backend. They are not a blanket claim of |
| 115 | database-style snapshot isolation. [D04: git-update-ref](https://git-scm.com/docs/git-update-ref) |
| 116 | |
| 117 | **Recommendation.** Make one immutable landing record the durable explanation of a transition. It |
| 118 | should name the previous and accepted heads, request identity, evidence, policy snapshot, and |
| 119 | intended downstream work. Protect the relationship between that record and the target update. A |
| 120 | transaction, a recovery journal, or one authoritative record from which the target is derived are |
| 121 | alternatives to evaluate. Bus publication then becomes a retryable projection of an already recorded |
| 122 | fact. |
| 123 | |
| 124 | The objection is extra machinery around a small tool. The answer is to keep the record narrow. The |
| 125 | system need not remember every internal computation. It must remember enough that a restarted |
| 126 | controller does not have to guess whether an accepted change was authorized or which consequences |
| 127 | remain due. |
| 128 | |
| 129 | ## 3. Causality is not the order of entries in a log |
| 130 | |
| 131 | Lamport's happened-before relation orders events connected by process order and message |
| 132 | transmission. It is a partial order: independent events may be concurrent. Logical timestamps can |
| 133 | extend that relation into a total order, but an earlier logical timestamp does not establish that |
| 134 | one event caused another. A total ordering chooses a sequence compatible with known dependencies; it |
| 135 | does not discover the dependencies. |
| 136 | [D01: Time, Clocks, and the Ordering of Events in a Distributed System](https://lamport.azurewebsites.net/pubs/time-clocks.pdf) |
| 137 | |
| 138 | For the-valley, an integration event followed by a deployment event in a bus is therefore |
| 139 | insufficient explanation. The deployment might concern a different commit. It might have been |
| 140 | manually requested. A restarted subscriber might publish old work after newer work. The record needs |
| 141 | explicit links: which accepted artifact the controller observed, which policy authorized the action, |
| 142 | and which request identified the intended effect. |
| 143 | |
| 144 | “One history” can mean one queryable body of linked evidence without demanding one global sequence |
| 145 | across all valleys. Per-project ordering remains useful at the protected ref. Cross-project |
| 146 | causality can be represented by references to particular decisions or artifact versions. A single |
| 147 | cross-valley total order would add coordination without answering the semantic question of why a |
| 148 | change mattered. |
| 149 | |
| 150 | W3C PROV distinguishes production relationships from attribution and delegation. Its delegation |
| 151 | relation describes responsibility; it does not enforce a permission. |
| 152 | [D14: PROV-DM](https://www.w3.org/TR/prov-dm/) The knowledge chapter develops the vocabulary. Here |
| 153 | the practical lesson is to record authorization separately from a claim about who acted. |
| 154 | |
| 155 | OpenTelemetry addresses a neighboring problem. Its tracing API supplies trace and span identifiers, |
| 156 | parent relationships, and links across traces; links are especially useful when one operation has |
| 157 | several predecessors. The API also exposes recording and sampling distinctions. These are good |
| 158 | correlation mechanisms, but the tracing specification is not a promise to retain every domain |
| 159 | decision permanently or authenticate its truth. |
| 160 | [D15: OpenTelemetry Tracing API](https://opentelemetry.io/docs/specs/otel/trace/api/) |
| 161 | |
| 162 | A practical division follows. Domain records should carry stable causal references even if telemetry |
| 163 | expires. Traces should point to those records and supply operational detail while retained. The |
| 164 | existing [three signal contracts](../../.the-valley/decisions/dcr-62ecc36-signal-contracts.md) |
| 165 | already separate durable events, lossy metrics, and logs retained under policy. The difficult part |
| 166 | is deciding which observation must be promoted before the raw data disappears. |
| 167 | |
| 168 | ### Provenance does not establish incident blame |
| 169 | |
| 170 | A deployment record may prove which artifact ran and who authorized it. It does not prove that this |
| 171 | artifact caused an outage. A database failure, traffic change, or independent configuration update |
| 172 | may have contributed. Halpern and Pearl formalize actual causation using structural models and |
| 173 | counterfactual interventions. Their analysis makes the chosen variables and model assumptions part |
| 174 | of the answer. A dependency graph alone is not that model. |
| 175 | [D28: Causes and Explanations, Part I](https://www.cs.cornell.edu/home/halpern/papers/actcaus.pdf) |
| 176 | |
| 177 | The project's incident memory should preserve this distinction. A useful report would separate |
| 178 | observed facts, candidate explanations, discriminating tests, and the current assessment. “Rollback |
| 179 | restored service” is evidence. It can remain inconclusive if rollback also restarted a dependency or |
| 180 | changed traffic. Automated attribution should preserve the observations supporting a conclusion and |
| 181 | the alternatives that remain plausible. A confidence number without that structure would make the |
| 182 | record look more scientific than it is. |
| 183 | |
| 184 | ## 4. Controllers and workflows solve different recovery problems |
| 185 | |
| 186 | Kubernetes controllers repeatedly compare desired and observed state and request changes that reduce |
| 187 | the difference. They can act through the API server or on external systems, and they report observed |
| 188 | state for other controllers to use. This is a strong precedent for durable request refs plus |
| 189 | repeated reconciliation: a missed notification should delay inspection rather than erase an |
| 190 | obligation. |
| 191 | [D08: Kubernetes Controllers](https://kubernetes.io/docs/concepts/architecture/controller/) |
| 192 | |
| 193 | The implemented integrator takes this approach. Its [polling loop](../../integrator/main.go) works |
| 194 | without a bus subscription. The |
| 195 | [production-DAG idea](../../.the-valley/ideas/ida-b48bded-production-dags-and-events.md) makes the |
| 196 | same move for future work: events invalidate observations, while durable demand determines what |
| 197 | should progress. This is a better foundation for the outcome engine than encoding obligations only |
| 198 | in chains of callbacks. |
| 199 | |
| 200 | Temporal retains an event history for each workflow execution so execution can recover after a |
| 201 | crash. The history records commands and externally reported results, and it has explicit size and |
| 202 | event-count limits. This is a mature example of preserving the progress of a particular operation, |
| 203 | rather than inferring all progress from current desired state. |
| 204 | [D09: Temporal Events and Event History](https://docs.temporal.io/workflow-execution/event) |
| 205 | |
| 206 | Temporal's activity lifecycle also makes an essential limit visible. A worker can disappear after |
| 207 | starting an activity; a timeout can trigger a retry. Cancellation is cooperative and may be ignored |
| 208 | by activity code. A workflow engine consequently does not remove the need to reason about actions |
| 209 | that may already have occurred outside the engine. |
| 210 | [D10: Temporal Activity Execution](https://docs.temporal.io/activity-execution) |
| 211 | |
| 212 | For this project, the useful comparison is by task: |
| 213 | |
| 214 | | Task | State that must survive | Natural starting point | |
| 215 | | ------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------ | |
| 216 | | Keep a service on an accepted artifact | Desired artifact and current observation | Reconciliation | |
| 217 | | Land a pending change | Request, evidence, judgment, target state | Reconciliation with a durable commit record | |
| 218 | | Execute a deployment with an approval and timeout | Progress, approval scope, deadline, effect results | Explicit operation state or durable workflow | |
| 219 | | Run an agent until an outcome is satisfied | Demand, attempts, budget, reservations, evaluations | Reconciliation around recorded attempts | |
| 220 | | Send a notification once for a decision | Effect identity and delivery result | Durable effect record plus recipient-aware retry | |
| 221 | |
| 222 | These are recommendations, not requirements to adopt Kubernetes or Temporal. A small Git-backed |
| 223 | state machine may be sufficient at the project's intended scale. However, once it implements durable |
| 224 | timers, retries, cancellation, compensation, operation versioning, and recovery, the project is |
| 225 | implementing workflow machinery even if there is no workflow configuration file. |
| 226 | |
| 227 | **Opinion.** Keep the bus a transport and keep standing obligations in durable state. Introduce a |
| 228 | workflow engine only when a real operation requires enough sequential recovery logic to justify it. |
| 229 | Compare a small custom controller and Temporal on one deployment experiment. Count operational |
| 230 | dependencies, understandable failure states, and recovery behavior as well as lines of application |
| 231 | code. |
| 232 | |
| 233 | The outcome engine needs an additional distinction: the dependency graph says what could be |
| 234 | attempted; it does not say which attempt owns a budget or may publish a result. Attempts need |
| 235 | durable ownership, expiry, and acceptance rules. Otherwise two controllers can satisfy the same |
| 236 | apparent demand twice while both behave correctly against stale observations. |
| 237 | |
| 238 | ## 5. Reliable messages do not make external effects atomic |
| 239 | |
| 240 | JetStream streams define retention through limits and policies. They may discard older messages or |
| 241 | refuse new ones when limits are reached. The official documentation distinguishes ordinary |
| 242 | unacknowledged publication from JetStream publication acknowledged after storage. “Persistent |
| 243 | stream” is therefore an incomplete durability specification without the publication mode, retention |
| 244 | configuration, and recovery source. |
| 245 | [D05: NATS Streams](https://github.com/nats-io/nats.docs/blob/master/nats-concepts/jetstream/streams.md) |
| 246 | |
| 247 | JetStream's documented exactly-once mechanisms combine publication deduplication with |
| 248 | acknowledgement confirmation. The standard duplicate window is finite, and deduplication uses the |
| 249 | message ID rather than payload equality. A successful double acknowledgement prevents redelivery |
| 250 | caused by a lost acknowledgement. These are useful transport guarantees; they do not put an |
| 251 | arbitrary deployment API in the same transaction as the consumer acknowledgement. |
| 252 | [D06: JetStream Model Deep Dive](https://github.com/nats-io/nats.docs/blob/master/using-nats/jetstream/model_deep_dive.md) |
| 253 | |
| 254 | Consumers separately track delivery and acknowledgements and can redeliver unacknowledged messages. |
| 255 | JetStream exposes pull and push consumers for different processing patterns. Consumer state should |
| 256 | consequently be treated as part of an operational recovery plan, even when the underlying domain |
| 257 | facts can be re-created elsewhere. |
| 258 | [D07: NATS Consumers](https://github.com/nats-io/nats.docs/blob/master/nats-concepts/jetstream/consumers.md) |
| 259 | |
| 260 | The current host module sets a bounded file store and creates a stream for `valley.>` using CLI |
| 261 | defaults. Its publishers call ordinary `nats pub`; the inspected calls do not request a JetStream |
| 262 | storage acknowledgement. Publication errors are logged and nonfatal. These are understandable |
| 263 | choices for observational notifications. They do not yet establish durable delivery of an |
| 264 | irreplaceable effect request. The broad subject wildcard also needs review when the planned lossy |
| 265 | metrics namespace is introduced. |
| 266 | |
| 267 | The classical publication gap occurs when one operation changes durable state and a separate |
| 268 | operation sends a message. A transactional outbox records the state change and message together, |
| 269 | then lets a relay publish the message repeatedly until acknowledged. Microsoft's implementation |
| 270 | example makes that local atomic boundary explicit and uses idempotent consumers for duplicate |
| 271 | delivery. |
| 272 | [D11: Transactional Outbox](https://learn.microsoft.com/en-us/samples/azure-samples/cosmos-db-design-patterns/transactional-outbox/) |
| 273 | |
| 274 | The Git equivalent need not be a database table. A durable landing record can contain the fact that |
| 275 | needs publishing. The relay's cursor is disposable only if the retained records support |
| 276 | re-enumeration and consumers tolerate repetition. The word “outbox” names the atomicity requirement, |
| 277 | not a mandatory storage technology. |
| 278 | |
| 279 | The next gap is harder. Consider this sequence: |
| 280 | |
| 281 | 1. An actuator reads an authorized deployment request. |
| 282 | 2. The remote platform accepts the deployment. |
| 283 | 3. The actuator crashes before recording the response. |
| 284 | 4. Recovery sees a request without a completion record. |
| 285 | |
| 286 | Retrying can create a duplicate. Declining to retry can abandon a request that never reached the |
| 287 | remote service. A local log cannot tell these cases apart. The external system must support a stable |
| 288 | operation key, a way to query the original operation, or a compensation whose meaning is acceptable |
| 289 | to the project. Otherwise the honest state is “outcome unknown,” with a defined resolution |
| 290 | procedure. |
| 291 | |
| 292 | Helland's treatment of independent transaction scopes puts duplicate handling in application |
| 293 | semantics: an operation is idempotent when repetitions do not repeat the substantive change. The |
| 294 | definition depends on what the application regards as substantive. Repeated observation and repeated |
| 295 | charging are plainly different. |
| 296 | [D13: Life beyond Distributed Transactions](https://www.cidrdb.org/cidr2007/papers/cidr07p15.pdf) |
| 297 | |
| 298 | Sagas supply another option: divide a long operation into committed steps with compensating actions. |
| 299 | Compensation restores an acceptable business condition rather than erasing history. For the-valley, |
| 300 | reverting a release can compensate a deployment, but it cannot make an already delivered |
| 301 | notification unseen or undo every external consequence of bad code. |
| 302 | [D12: Sagas](https://sigmodrecord.org/?download_id=11106&smd_process_download=1) |
| 303 | |
| 304 | **Recommendation.** The proposed |
| 305 | [actuator](../../.the-valley/ideas/ida-f1b39e8-outbound-effects-pass-through-an-actuator.md) should |
| 306 | own authorization and an effect ledger. Each effect should have a stable identity, target, approved |
| 307 | arguments, deduplication contract, result, and recovery policy. Separate a logical effect from its |
| 308 | attempts. Rebuilding a view must never implicitly issue historical effects again. |
| 309 | |
| 310 | ## 6. Durability needs a recoverable set of objects |
| 311 | |
| 312 | The [durability requirement](../../design/requirements.md#durability) is unusually concrete: |
| 313 | integrated work should reach independent copies, including an offsite copy, within minutes, and a |
| 314 | copy counts only after a verified restore. That is a stronger starting point than merely configuring |
| 315 | backup software. The remaining ambiguity is what must be restored together. |
| 316 | |
| 317 | A useful recovery inventory includes source commits, knowledge nodes, policy history, registry |
| 318 | history, attestation refs, requests, decision records, and any effect results that cannot be |
| 319 | recovered from the target system. It also includes the material necessary to interpret and verify |
| 320 | those records. A clean source checkout is insufficient if it omits the evidence namespace that |
| 321 | justified its accepted state. |
| 322 | |
| 323 | Git's ordinary clone and mirror modes have different ref coverage. `--mirror` maps all refs and |
| 324 | configures later updates to overwrite those mirrored refs. This matters for custom namespaces such |
| 325 | as attestations and integration requests. An export or backup test must specify which namespaces it |
| 326 | includes rather than assuming that “clone” means all project state. |
| 327 | [D26: git-clone](https://git-scm.com/docs/git-clone) |
| 328 | |
| 329 | There are two recovery problems: losing bytes and losing authority. A backup may retain all commits |
| 330 | but restore an obsolete registry that re-enables a revoked key. A correct current registry may be |
| 331 | useless if the sole authorized recovery credential was lost with the host. These cases call for |
| 332 | separate restore checks: content completeness, trustworthy policy continuity, and a safe way to |
| 333 | establish the recovered instance's current authority. |
| 334 | |
| 335 | Replication also has a different failure model from backup. Raft maintains an agreed replicated log |
| 336 | through leader election and majority-based commitment under its stated assumptions. Its safety |
| 337 | argument is about agreement despite failures, not protection from every authorized destructive |
| 338 | command or compromised administrator. |
| 339 | [D27: In Search of an Understandable Consensus Algorithm](https://raft.github.io/raft.pdf) |
| 340 | |
| 341 | For the-valley, several copies on one host do little for host loss. Several continuously |
| 342 | synchronized copies can faithfully propagate an unwanted deletion. A recovery copy that retains |
| 343 | earlier state serves a different purpose from a live replica. These are consequences of the |
| 344 | project's failure scenarios, not reasons to operate a consensus cluster immediately. |
| 345 | |
| 346 | **Recommendation.** Name three observable states for an accepted change: locally committed, |
| 347 | independently replicated, and included in a verified recoverable snapshot. This need not put a |
| 348 | remote round trip on the integration path. It makes the allowed exposure window visible. The |
| 349 | requirement's phrase “integrated means replicated … within minutes” otherwise mixes an immediate |
| 350 | status with an eventual obligation. |
| 351 | |
| 352 | A restore exercise should recover one complete accepted change, its author evidence, the |
| 353 | integrator's decision, the policy used, and one downstream effect record. It should demonstrate that |
| 354 | an old revoked credential cannot regain access silently. That experiment would validate much more |
| 355 | than a successful `git fsck`. |
| 356 | |
| 357 | ## 7. Identity, authority, and evidence should stay distinct |
| 358 | |
| 359 | The |
| 360 | [identity registry decision](../../.the-valley/decisions/dcr-b87f6e8-identity-is-a-governed-registry.md) |
| 361 | contains a valuable rule: a permission belongs in the schema only when an enforcement boundary |
| 362 | checks it. This resists a common failure in authorization design, where richly named roles express |
| 363 | intentions that no running component actually enforces. |
| 364 | |
| 365 | Still, four questions must remain separate. Which key authenticated the request? Which principal |
| 366 | does current policy associate with that key? What may that principal do here? What evidence supports |
| 367 | the claims it makes? A machine can authenticate correctly and still supply a false check result. An |
| 368 | honest machine can produce valid evidence while lacking permission to modify a protected policy. |
| 369 | |
| 370 | Saltzer and Schroeder's complete-mediation principle requires authority checks across access paths, |
| 371 | including initialization, recovery, and maintenance. Their least-privilege and |
| 372 | separation-of-privilege principles also explain why a signing service and an unrestricted agent |
| 373 | process should not automatically share authority. The relevance is structural: a policy file cannot |
| 374 | constrain an operation that bypasses its enforcement point. |
| 375 | [D20: The Protection of Information in Computer Systems](https://web.mit.edu/Saltzer/www/publications/protection/Basic.html) |
| 376 | |
| 377 | ### Delegation must narrow what can be done |
| 378 | |
| 379 | The proposed |
| 380 | [delegation model](../../.the-valley/ideas/ida-a8243d2-agent-runs-act-under-delegated-authority.md) |
| 381 | lets agent runs act under a principal without receiving persistent registry entries. Each delegation |
| 382 | narrows authority, and human approval is non-delegable. That avoids treating an ephemeral run as a |
| 383 | durable account. It leaves the enforcement question open: who verifies the claimed chain, and who |
| 384 | prevents a run from using credentials outside it? |
| 385 | |
| 386 | Macaroons are important prior art for attenuating authority by adding caveats. Their chained |
| 387 | authentication construction supports restrictions and third-party discharge conditions. They also |
| 388 | discuss expiry and state-based revocation. Their ordinary bearer-credential model is a poor direct |
| 389 | match for the registry's rejection of long-lived bearer secrets, although the paper discusses |
| 390 | holder-of-key restrictions. Study the attenuation semantics before choosing the credential format. |
| 391 | [D21: Macaroons](https://theory.stanford.edu/~ataly/Papers/macaroons.pdf) |
| 392 | |
| 393 | A minimal dispatch authorization could name the project, allowed verbs, input or target scope, |
| 394 | expiry, resource budget, parent authorization, and recipient enforcement boundary. A child |
| 395 | authorization would be accepted only if its rights are a subset of the parent's rights. The receiver |
| 396 | would check the entire relevant chain and current revocation policy. These fields are a proposed |
| 397 | experiment, not a settled format. |
| 398 | |
| 399 | The most significant choice is whether the run ever receives reusable credentials. If every |
| 400 | privileged action passes through an actuator, the actuator can verify scope and sign receipts. If |
| 401 | the run has a general shell on a host with ambient credentials, a carefully signed delegation chain |
| 402 | describes intended authority while the actual process can do more. The boundary determines the |
| 403 | guarantee. |
| 404 | |
| 405 | ### Workload identity is a useful implementation option |
| 406 | |
| 407 | SPIFFE defines workload identities and short-lived identity documents, with a Workload API for |
| 408 | obtaining them across heterogeneous environments. It provides a basis for mutual authentication. It |
| 409 | does not decide that an authenticated workload may approve a registry amendment or deploy a |
| 410 | particular artifact. Those remain authorization decisions. |
| 411 | [D22: SPIFFE Overview](https://spiffe.io/docs/latest/spiffe-about/overview/) |
| 412 | |
| 413 | SPIRE implements this model with a server, node agents, registration entries, and node/workload |
| 414 | attestation. It can issue identities based on configured selectors and conditions. This offers |
| 415 | concrete machinery for replacing repeatedly provisioned raw machine keys, at the cost of another |
| 416 | service and another set of attestation assumptions. |
| 417 | [D23: SPIRE Concepts](https://spiffe.io/docs/latest/spire-about/spire-concepts/) |
| 418 | |
| 419 | There is no necessary conflict with a repository as the governance source. In a possible deployment, |
| 420 | the registry would determine permitted workload identities and compile registration policy; SPIRE |
| 421 | would perform issuance. The registry would still govern authority. At the current scale, that may be |
| 422 | more machinery than the problem warrants. The decision should turn on measured credential churn and |
| 423 | revocation needs, not the appeal of a standardized name. |
| 424 | |
| 425 | ### Expiry is only as strong as its enforcement |
| 426 | |
| 427 | The actual [identity renderer](../../identity/render.go) omits expired principals when it |
| 428 | successfully compiles. The host deliberately keeps manually declared SSH keys as a recovery path. A |
| 429 | failed compilation preserves the last good files; it does not cause already installed raw keys to |
| 430 | expire at the SSH server. Thus “expires on this date” currently means removal after a successful |
| 431 | convergence, subject to separate recovery access. |
| 432 | |
| 433 | That tradeoff favors avoiding accidental lockout. It should be stated as such. If convergence stops, |
| 434 | the effective revocation delay can exceed the timer interval indefinitely. A stronger policy could |
| 435 | use short-lived certificates, enforce expiry at the receiving boundary, or reject sensitive |
| 436 | operations when the compiled policy is too old. Those alternatives have different availability |
| 437 | consequences. |
| 438 | |
| 439 | The claim that access is purely a function of integrated repository bytes also needs a time input |
| 440 | once expiry exists. The more precise model is that access depends on the selected governance state, |
| 441 | the evaluation time, and the enforcement boundary's installed state. Recording those values would |
| 442 | make stale authorization diagnosable. |
| 443 | |
| 444 | ### Human presence and agent attribution need precise claims |
| 445 | |
| 446 | WebAuthn distinguishes user presence from user verification and distinguishes backup-eligible |
| 447 | multi-device credentials from single-device credentials. A generic passkey is therefore not evidence |
| 448 | that its private key can never leave one hardware device. An approval protocol must select and check |
| 449 | the properties it requires and bind the assertion to the intended statement and relying party. |
| 450 | Presence or verification alone does not establish that the person understood and approved that |
| 451 | statement. The approval interface and transaction binding remain part of the trust boundary. |
| 452 | [D25: Web Authentication Level 3](https://www.w3.org/TR/webauthn-3/) |
| 453 | |
| 454 | Similarly, the |
| 455 | [agent-provenance proposal](../../.the-valley/ideas/ida-45178f6-agent-identity-is-provenance.md) is |
| 456 | a useful record of inputs, but identical prompts and model identifiers can produce different |
| 457 | executions. A run needs an occurrence identity as well as input provenance. Two identical |
| 458 | experiments are still two observations. A host signature establishes who asserted the provenance; it |
| 459 | cannot by itself establish that an untrusted harness recorded everything accurately. |
| 460 | |
| 461 | **Opinion.** Keep persistent principals few, but give every run and every privileged effect a |
| 462 | distinct durable identity. Keep the signer, the claimed producer, the delegating authority, and the |
| 463 | verifier as separate fields. Collapsing them makes records simpler to print and harder to trust. |
| 464 | |
| 465 | ## 8. Recursive governance needs a declared trust boundary |
| 466 | |
| 467 | The [self-transparency draft](../../design/self-transparency.md) proposes that no actor durably |
| 468 | changes the system or its outputs without transparency. The architecture has since added a partial |
| 469 | answer to the bootstrap question: rules at tip N judge the transition to tip N+1. That temporal |
| 470 | induction is coherent. It prevents a proposed amendment from authorizing itself merely by declaring |
| 471 | more permissive rules in its own output. |
| 472 | |
| 473 | The Update Framework supplies a concrete succession precedent: a root update requires both old and |
| 474 | new signing thresholds. The client starts with trusted root metadata; it does not manufacture |
| 475 | initial trust. |
| 476 | [D24: The Update Framework Specification, §5](https://theupdateframework.github.io/specification/latest/) |
| 477 | |
| 478 | The unresolved part is broader than succession. A root user can replace an executable, edit a bare |
| 479 | repository, change authorized keys, or restore an earlier disk image. An external service can accept |
| 480 | a credential outside the integrator's path. Versioning the intended configuration does not make |
| 481 | these paths disappear. The architecture already recognizes recovery below the machinery; the |
| 482 | invariant must explain how that recovery relates to transparency. |
| 483 | |
| 484 | Three interpretations are available: |
| 485 | |
| 486 | | Interpretation | Meaning | What would establish it | |
| 487 | | ------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------ | |
| 488 | | Governed normal operation | Supported changes go through recorded policy decisions. | Enforced gates and a documented privileged recovery path. | |
| 489 | | Detectable deviation | Out-of-band durable changes can be discovered after they occur. | Independent observation, retained baselines, and evidence of comparison. | |
| 490 | | Prevented deviation within a boundary | No actor inside a specified authority boundary can bypass recording. | A complete mediator with a stated trusted computing base. | |
| 491 | |
| 492 | These interpretations have different costs. The first fits the solo-operator scenario. The second is |
| 493 | valuable when a compromised controller might hide a change. The third requires a much sharper |
| 494 | account of which host, kernel, keys, and external services are trusted. A universal statement |
| 495 | covering the operator's root access and all external outputs would be difficult to defend within the |
| 496 | project's explicit non-goals. |
| 497 | |
| 498 | **Recommendation.** State the initial invariant over named enforcement boundaries. Record |
| 499 | exceptional recovery as a separate signed transition when normal operation resumes. Preserve |
| 500 | evidence that an exception occurred, even when it was necessary. Distinguish an authorized |
| 501 | exceptional action from an unobserved action; neither should silently become an ordinary |
| 502 | integration. |
| 503 | |
| 504 | This still leaves a research question: what evidence can survive the compromise of the system that |
| 505 | ordinarily records evidence? An independent witness or retained checkpoint can constrain history |
| 506 | rewriting. It cannot demonstrate every unobserved host action. The strongest useful guarantee may be |
| 507 | that accepted project states have an externally checkable chain of authority, while runtime drift is |
| 508 | separately monitored. |
| 509 | |
| 510 | Self-modification also has an epistemic limit. An old policy can authorize a new policy correctly |
| 511 | while the new policy is a poor decision. Governance proves the route by which rules changed. It does |
| 512 | not prove that every permitted amendment preserves the project's goals. The knowledge layer's |
| 513 | rationale and evaluations remain necessary. |
| 514 | |
| 515 | ## 9. Federation should exchange evidence while preserving local authority |
| 516 | |
| 517 | Local-first software treats users' local data as primary and seeks useful operation without a |
| 518 | provider's continued permission. The original paper connects offline work, collaboration, ownership, |
| 519 | privacy, and long-term preservation, while treating CRDTs as one promising technical ingredient. |
| 520 | This is a close philosophical fit for the-valley's insistence that project knowledge travels with |
| 521 | the repository. [D16: Local-First Software](https://martin.kleppmann.com/papers/local-first.pdf) |
| 522 | |
| 523 | CRDTs offer convergence when replicas receive the same updates under specified assumptions. The |
| 524 | foundational work gives sufficient conditions involving monotonic state merges or commuting |
| 525 | operations. That is useful for some collaborative metadata. It does not by itself decide whether |
| 526 | concurrent approvals satisfy a governance rule or whether two individually valid changes jointly |
| 527 | violate an application invariant. |
| 528 | [D17: Conflict-free Replicated Data Types](https://perso.lip6.fr/Marc.Shapiro/papers/2011/CRDTs_SSS-2011.pdf) |
| 529 | |
| 530 | For example, an append-only set of signed review comments is a reasonable candidate for independent |
| 531 | replication. “The release is approved by the current governing set” is a derived judgment that |
| 532 | depends on a particular policy state. Automatically merging both sides of a concurrent membership |
| 533 | change may preserve bytes while producing an unauthorized interpretation. The project should |
| 534 | identify which data can merge freely and which decisions require an owning authority. |
| 535 | |
| 536 | Radicle provides an especially relevant detail beyond the |
| 537 | [systems comparison](02-existing-systems.md): a repository identifier anchors the history of its |
| 538 | identity document. [D18: Radicle Protocol Guide](https://radicle.dev/guides/protocol) This deserves |
| 539 | comparison with the-valley's genesis and subsequent policy amendments. |
| 540 | |
| 541 | The research opportunity for the-valley is more specific: combine governed integration, transferable |
| 542 | verification evidence, durable project knowledge, and recoverable effects. Radicle deserves an |
| 543 | implementation-level comparison before inventing a federation format. Whether its identity and |
| 544 | collaborative-object rules can carry the-valley's policies remains to be tested; similarity is not |
| 545 | compatibility. |
| 546 | |
| 547 | Fossil's integrated project facilities provide another comparison; their scope is covered in the |
| 548 | [systems chapter](02-existing-systems.md). Its own account favors compact deployment. |
| 549 | [D19: Fossil Versus Git](https://www.fossil-scm.org/home/doc/trunk/www/fossil-v-git.wiki) |
| 550 | |
| 551 | Fossil challenges the assumption that minimalism always means many independently replaceable tools. |
| 552 | A single program can be easier to operate than several services whose failure contracts must be |
| 553 | composed. the-valley's modularity can still be valuable, especially for verification portability. |
| 554 | The comparison should count the total recovery and maintenance burden, not just the size of each |
| 555 | component. |
| 556 | |
| 557 | A useful first federation experiment would send a proposed change, its evidence, and its approval |
| 558 | claims from valley A to valley B. B would verify the material under B's own policy and return an |
| 559 | explicit acceptance or refusal. A statement that A trusts a signer would not automatically become |
| 560 | B's authorization. Imported history would retain its origin and causal references. |
| 561 | |
| 562 | Cross-repository release atomicity should be deferred until its meaning is explicit. Two refs moving |
| 563 | together is one possible requirement. Ensuring all deployed consumers remain compatible is another, |
| 564 | harder requirement. A staged schema change with a compatibility interval may serve the scenario |
| 565 | better than a distributed commit protocol. The experiment should begin with the user-visible |
| 566 | invariant, then choose coordination machinery. |
| 567 | |
| 568 | ## 10. Experiments that would resolve the important uncertainties |
| 569 | |
| 570 | The following experiments are proposed research work. They are deliberately small enough to produce |
| 571 | decisive evidence before a broad architecture commitment. |
| 572 | |
| 573 | | Experiment | Procedure | What would count as success | |
| 574 | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | |
| 575 | | History versus snapshot replay | Create, update, force-move, and delete disposable refs; record notifications; erase only the bus; rebuild. | The report names exactly which facts return and which do not. Any promised historical facts have a demonstrated durable source. | |
| 576 | | Interrupted landing | Kill a disposable integrator at each step around target update, evidence storage, request deletion, and publication. | Restart yields one accepted transition with discoverable evidence and no indefinitely stranded request. | |
| 577 | | Duplicate external effect | Use a fake target that accepts an operation and then drops the response; restart the actuator repeatedly. | One logical effect occurs, or the operation becomes explicitly unknown with a safe recovery procedure. | |
| 578 | | Revocation during failed convergence | Expire a disposable principal while registry compilation fails; test each receiving boundary. | Observed access matches a declared maximum staleness policy, including the recovery path. | |
| 579 | | Complete restore | Restore onto a fresh disposable host from an offsite copy without the original machine. | One accepted change, its evidence, applicable policy, and downstream result remain verifiable; revoked authority is not silently revived. | |
| 580 | | Federation without shared trust | Exchange one contribution between two isolated valleys with different signer policies. | Transport success never substitutes for local authorization, and refusal explains the unsatisfied policy. | |
| 581 | |
| 582 | Two further comparisons would sharpen the solution choice. Implement one interrupted deployment in |
| 583 | both a small controller and Temporal, then compare the amount of durable state and recovery logic |
| 584 | each requires. Export a representative project's knowledge and approval records through Radicle and |
| 585 | Fossil-shaped models, then list what remains awkward or unrepresentable. These are evaluations of |
| 586 | fit, not proposals to migrate the project immediately. |
| 587 | |
| 588 | The most promising direction is a small number of durable, independently interpretable records: |
| 589 | proposed change, accepted decision, delegated authorization, intended effect, observed result, and |
| 590 | exceptional recovery. Transport, indexes, and most telemetry can then remain replaceable. The |
| 591 | research burden shifts to proving the relationships among those records and the operations they |
| 592 | govern. That is a tractable version of the project's ambition, and a useful basis for its more |
| 593 | speculative outcome engine. |