gunk-dev/the-valley

04-events-trust-and-durability.md

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