gunk-dev/the-valley

roadmap.md

source7964e6acfb7fmain's published tip history
19.7 KiB · Rendered
1# Roadmap
2
3The roadmap develops the-valley through useful increments and tests the claims behind each one. The
4[user scenarios](./user-scenarios.md) define what must become possible. Phases describe the work and
5evidence needed to support them.
6
7The immediate product priorities are a usable interface for improving the-valley and moving the
8projects in `gunk-dev/` and `patflynn/` off GitHub. The
9[interface proposal](../.the-valley/ideas/ida-23aa413-project-surfaces-are-derived-views.md) and
10[Cosmo migration outcome](../.the-valley/outcomes/oc-87deec8-valley-can-host-cosmo.md) identify work
11toward those priorities. Their minimum scope and ordering remain to be selected alongside the open
12design problems.
13
14## How phases are used
15
16Each phase should:
17
181. Deliver something useful even if no later phase is built.
192. Leave a coherent system that can continue to be used.
203. Test one main design claim, so a failed validation is understandable.
214. Serve a named user scenario.
22
23A scenario may require several phases. If the implementation plan no longer serves the scenario,
24revise the plan. Later phases remain less detailed until experience makes their requirements
25concrete.
26
27Completion depends on observed exit criteria. A component's existence is not enough to mark its
28phase complete. The plan uses validation gates rather than calendar estimates.
29
30## Phases at a glance
31
32| Phase | Delivers | Scenario | Main validation |
33| ----- | -------------------------------------------------------------- | -------------------------------- | ----------------------------------------------------------------------------- |
34| 0 | Durable self-hosted repositories and initial project knowledge | S1 | Verified restore and a week of real work without GitHub |
35| 1 | Git ref-event projection and inspection | Supports S2 and later automation | Real ref updates are visible; current-state projection is reproducible |
36| 2 | Signed local check evidence | S2 | The contributor protocol works well for daily changes |
37| 3 | Request-based integration | S2 | Protected history advances through evaluated requests |
38| 4 | Agent contributions with recorded provenance | S3 | Authorized dispatched work lands without further supervision |
39| 5 | Builds, deployments, and notifications as reactions | S4 | Their causal history is recoverable and queryable |
40| 6 | Independent verification and a trust process | Hardens S3; supports S5 | False claims are detected and unknown signers follow explicit admission rules |
41| 7 | Discussion, attention routing, and incident memory | S6; extends S4 | Review and incident recovery use a durable shared record |
42
43S7, contribution by strangers, has no phase. It remains deferred.
44
45Outcome-based work also extends beyond this sequence. Phase 4 assigns work to an outcome, and Phase
465 records completion, but a general scheduler still needs its own design.
47
48## Current state
49
50The initial hosting, mirroring, and restore exercise have been performed. S1 still has unchecked
51criteria: a recorded week of independent daily work and a repeatable migration and restore runbook.
52
53Phase 1 has a recorded live validation from 2026-07-17. Local attestations and the integrator are
54implemented, and the contributor CLI can submit evidence and a request. Identity compilation and
55policy composition have also been added. Their presence does not mark every Phase 2, 3, or 6
56criterion complete.
57
58The remaining sections retain the validation sequence and distinguish initial arrangements from the
59current workflow. [Contributor protocol](./contribute.md) is the operational guide for submitting a
60change now.
61
62The initial deployment uses classic-laddie as the host and Cosmo as the NixOS configuration project
63that installs it. Klaus supplies the existing agent workflow. Armstrong is the proposed controller
64for external effects, and a Tessera-backed log is the proposed transparency component. These are
65reference choices, not requirements that every deployment use the same hosts or tools.
66
67## Phase 0 — durable self-hosting
68
69This phase serves [S1](./user-scenarios.md#s1--repositories-under-my-control-and-recoverable). It
70establishes the canonical home and recovery process on which later work depends.
71
72### Delivery
73
74Bare Git repositories are served over SSH on infrastructure the operator controls. The CUE
75[host schema](../schema/valley.cue) declares projects, publication mirrors, and backup policy. The
76[NixOS module](../flake.nix) installs the reference host from that declaration. Other installers can
77consume the same schema.
78
79The initial workflow used direct pushes to `main`. Agents could push a topic branch for manual
80review and integration. This kept agent work usable before the integrator existed. That arrangement
81is historical; protected projects now use the [request workflow](./contribute.md).
82
83Project knowledge begins as Markdown files containing bugs, outcomes, ideas, and decisions. The
84[graph conventions](../.the-valley/README.md) and node schema define their format. Initially, lint
85could report invalid content without preventing a direct push. The integrator later makes required
86graph checks part of the admission policy.
87
88### Replication and migration
89
90The initial durability design combines three copies: the primary repositories, an independent live
91mirror, and periodic encrypted offsite backup. GitHub serves as the transitional live mirror. The
92[replication decision](../.the-valley/decisions/dcr-d7952bc-phase0-replication-github-transitional.md)
93records this choice.
94
95The host's per-project `mirrors` list controls publication. Replication publishes `main` and tags,
96propagates their deletions, and removes other branch heads on the mirror. It does not publish
97pending topic branches or modify a hosting service's separate namespaces. Replication is
98best-effort: an unavailable mirror does not reject a push to the primary.
99
100The durability requirement is therefore an operational result to verify. Integrated work must reach
101at least two independent locations, one offsite, within minutes. Pending work has periodic backup
102depth until it integrates. Recovery from the offsite copy must complete within a day and must have
103been tested.
104
105Migration starts by establishing copies and checking recovery. The canonical remote then changes per
106repository as confidence is earned. A publication mirror can remain during the transition or serve a
107later public view. Adding another mirrored project still needs the
108[credential decision](../.the-valley/ideas/ida-a0e5d03-second-mirror-identity.md).
109
110The-valley itself is the pilot. Later projects reuse the verified workflow and add their own
111verification, automation, and consumer-access requirements.
112
113### Validation
114
115The phase is complete when every item in
116[S1's acceptance checklist](./user-scenarios.md#acceptance-criteria) is satisfied. The claim is that
117self-hosting can be the reliable and practical home for everyday work.
118
119## Phase 1 — the event log
120
121This phase tests Git ref updates as a useful source of observable events. It supports S2 and the
122later automation scenarios; the current integrator can also reconcile directly from Git.
123
124### Delivery
125
126A `post-receive` hook projects ref updates onto NATS JetStream. The event vocabulary includes
127ordinary ref changes and the attestation and request namespaces as those appear. `valley tail`
128displays events. No automated effect is required to validate this first step.
129
130Git remains authoritative for repository state. Replaying current refs rebuilds the corresponding
131projection. It does not recreate every past update or any external event absent from Git.
132
133### Validation
134
135- A real push produces a `ref-updated` event visible within seconds, with the expected object ID.
136- Repeated projection of the same repository refs produces identical event sets.
137
138This was validated on the pilot host on **2026-07-17**: a branch push appeared within a second, and
139two full ref replays produced identical sets.
140
141Two limits remain explicit:
142[bus authorization](../.the-valley/bugs/bd-d853d9c-bus-unauthenticated.md) is needed before an
143automated consumer trusts events to act, and
144[service isolation](../.the-valley/bugs/bd-500adf7-bus-shares-git-user.md) is needed before wider
145network access. Full history retention is separate work.
146
147## Phase 2 — local attestations
148
149This phase tests whether signed local verification is a practical daily workflow for S2.
150
151### Delivery
152
153The `attest` helper runs checks over a committed tree, composes one statement per check, signs the
154statements with the host's key, and stores them by subject digest and signer. Native atomic push
155publishes the relevant refs.
156
157[Verification](./verification.md) defines pure and effectful claims, the exact text and signature
158formats, and the helper's commands. The Nix runner is the reference implementation. Other runners
159must be able to satisfy the same portable statement contract.
160
161External transparency publication and witness re-verification are deferred to Phase 6. Local
162attestations establish attributable claims, not independent proof that a recognized signer executed
163them honestly.
164
165### Validation
166
167- Real changes carry evidence for their required checks and the trees checked.
168- Publication uses native atomic Git push.
169- Daily use shows that this is preferable to waiting for a separate CI service.
170
171The helper is implemented. The practical preference and sustained-use criteria still require
172explicit validation.
173
174## Phase 3 — the integrator
175
176This phase completes the intended S2 workflow: submit a verified change and have it integrated
177promptly when its evidence remains applicable.
178
179### Delivery
180
181Receive hooks restrict protected refs and prevent contributors from rewriting attestation refs. The
182integrator reads requests, derives required checks from governing policy, verifies the evidence, and
183applies the delta. It publishes the resulting outcome.
184
185The current controller polls request refs. Event consumption is not required for that
186implementation. [Integration](./integration.md) defines its reconciliation loop, evidence-transfer
187rules, and commit point.
188
189Checks are selected from all path classes touched by the diff. A knowledge change therefore takes
190the same protected path as code while requiring only the checks its governing policy selects. The
191[policy decision](../.the-valley/decisions/dcr-f41f718-declared-verification-policy.md) defines this
192behavior.
193
194A change is a delta targeting a stream. The branch carries it. If the target moves, evidence can
195still transfer per check when its inputs remain valid. A changed tree alone is not a reason to
196repeat every check.
197
198### Validation
199
200- Direct contributor pushes to protected `main` are rejected.
201- A request leads to integration without a manual protected-ref write.
202- A conflict or stale-evidence case produces a useful `request-stale` result naming the work that
203 needs refreshing, without repeated unchanged announcements.
204- Invalid evidence is distinguished from stale evidence.
205
206The integrator and review submission path exist. The
207[check-definition gap](../.the-valley/bugs/bd-eaefe82-check-definitions-come-from-the-branch.md) and
208[contention risk](../.the-valley/bugs/bd-c324184-occ-starvation-under-contention.md) still need to
209be addressed when assessing the integration guarantee.
210
211Changes to the integrator itself also require the bootstrap, approval, and recovery procedures
212described in [open questions](./openquestions.md#identity-approval-and-bootstrap).
213
214## Phase 4 — agent contributions
215
216This phase serves S3. A dispatched change follows the same integration process as human work, with
217the agent run and its authority recorded.
218
219It follows usable attestations and integration from Phases 2 and 3. Any dispatch consumer acting on
220bus events also depends on authenticated events.
221
222### Delivery
223
224Klaus assigns work to an outcome node and agents read and update the graph as part of their work.
225Dispatch needs answers about required checks, conflicts, review or approval, and whether a request
226can land. Those answers must come from valley records and policy.
227
228An agent run has no signing key or registry entry of its own. The host signs provenance naming the
229run's harness, model, prompt and context digests, and recorded delegation. The
230[provenance design](../.the-valley/ideas/ida-45178f6-agent-identity-is-provenance.md) describes that
231record.
232
233The current helper accepts provenance supplied by a caller. Automatic collection and verification of
234delegated authority remain work for this phase and the trust design.
235
236Unattended integration applies where policy authorizes it. The
237[core approval decision](../.the-valley/decisions/dcr-9c75283-substrate-adoption-and-the-core.md)
238permits exemptions for ordinary work but retains physical approval for policy changes. Agent support
239must preserve those requirements.
240
241### Validation
242
243- A Klaus-dispatched change lands without human action between dispatch and landing when the
244 applicable policy permits it.
245- The accepted record identifies the agent run through signed provenance and distinguishes it from
246 human-authored work.
247- The assignment names an outcome node, and the work reads and writes knowledge nodes end to end.
248
249The claim is that the contribution workflow supports unattended authorized work. The accuracy of the
250recorded provenance still depends on its producer and key custody. A later transparency log can
251preserve the statement's publication; it cannot make false provenance true.
252
253## Phase 5 — effectful reactions
254
255This phase serves S4: builds, deployments, and notifications follow changes, and their causes can be
256reconstructed.
257
258### Delivery
259
260The proposed Armstrong controller reacts to an integrated change, builds the required artifact, and
261performs the configured deployment and notification. Controllers own these reactions independently.
262
263Knowledge changes join the same record. A change that satisfies an outcome can update that node
264through the governed contribution path. Landing a commit alone does not establish that every outcome
265it mentions is complete; completion links and evaluation need a concrete design.
266
267This phase must also choose durable storage for external-effect history. The bus cannot remain the
268only unprotected copy of records required to explain deployments.
269
270### Validation
271
272- Integration causes a build and deployment through a controller without manual coordination.
273- The chain for a selected commit is reconstructable from the shared history.
274- A change that completes an outcome records that completion, and the history connects the two.
275
276The minimum automation needed to migrate a project may be smaller than the full phase.
277[Cosmo's migration outcome](../.the-valley/outcomes/oc-87deec8-valley-can-host-cosmo.md)
278distinguishes moving existing configuration and consumers from building a general deployment
279controller.
280
281## Phase 6 — trust backstop
282
283This phase strengthens S3 and supports S5, contribution by an invited collaborator whose claims are
284not accepted solely because they arrived.
285
286### Delivery
287
288The proposed design adds:
289
290- External attestation publication with a verifiable inclusion proof.
291- Independent witnesses that rerun pure checks and report agreement or divergence.
292- A trust process that determines admission, restrictions, and revocation from evidence.
293
294A Tessera-backed transparency log is the current proposed publication mechanism. The trust
295controller still needs rules for new signers, sampling, thresholds, and response to divergence.
296
297The identity registry and compiler provide part of the access machinery now. They do not replace
298these verification and trust decisions.
299
300### Validation
301
302- Every attestation is published to the log with a verifiable inclusion proof.
303- A deliberately false pure-check claim is detected by independent verification and affects the
304 signer's standing under an explicit rule.
305- An unknown signer's change enters only through the defined trust process.
306- A real invited collaborator contributes through that process with bounded, revocable access.
307
308These observations would test particular guarantees. They do not establish an assurance level from
309the names of the mechanisms alone.
310
311[Verification](./verification.md#trust-and-limits) explains the residual risks. In particular, the
312[post-landing recovery problem](../.the-valley/bugs/bd-e63bac8-cascading-revocation-on-divergence.md)
313needs an answer for accepted work and external effects; revoking a key does not undo them.
314
315## Phase 7 — feedback and incident memory
316
317This phase serves S6 and develops the attention and discussion parts of S4.
318
319### Delivery
320
321Views collect discussion, evidence, approvals, and outcomes for a change or causal chain. Their
322records remain usable independently of a pull-request page.
323
324An attention router selects events that need a person's response. The
325[outcome scheduler](../.the-valley/ideas/ida-eac723e-outcome-dag.md) chooses work; it does not
326replace this routing decision.
327
328An incident creates durable project knowledge linking the observed failure, suspected cause,
329uncertainty, and recovery. Attribution must distinguish evidence from inference.
330
331The graph already exists. This phase adds feedback and incident behavior to the files, agent use,
332and recorded changes introduced earlier. The first product interface can expose those existing
333records before the full routing and incident system is ready.
334
335### Validation
336
337- A change's discussion, approval, and outcome are readable as one chronology.
338- The router brings an event requiring action to the appropriate person without overwhelming them
339 with unrelated events.
340- A real or deliberately exercised bad deployment produces an incident record with attribution,
341 stated uncertainty, and a link to the revert or other recovery.
342
343Attention routing remains a substantive design problem in
344[open questions](./openquestions.md#attention-and-work-scheduling).
345
346## Work across phases
347
348**Schemas and compatibility.** CUE already describes host declarations, events, graph nodes,
349attestations, identity, and verification policy. New behavior must define how records are validated
350and how older producers and consumers remain compatible. Conformance examples are part of that
351contract.
352
353**CLI and product interface.** The CLI currently provides commands including `pending`, `review`,
354`checks`, `tail`, and `replay`. The native contribution protocol remains available to other clients.
355The [CLI graduation proposal](../.the-valley/decisions/dcr-2aa1a12-valley-cli-graduation.md) is
356unresolved; continued prototype growth is not already an approved replacement for its lifecycle
357rules. A product interface should expose the same state and operations to people and agents.
358
359**Durability.** Every new store needs a recovery and retention contract. Git refs preserve
360repository state, but historical ref transitions, run records, deployment events, and later
361transparency records need their own explicit treatment. A rebuildable view must not be mistaken for
362the only copy of required history.
363
364**Portability.** Nix and NixOS are reference backends. Schemas and observable behavior must remain
365implementable elsewhere. A field that only one backend can produce needs examination before it
366becomes part of a shared contract.
367
368**Operational experience.** Migration and daily use should reveal which parts are costly or
369confusing. Feed those findings into the graph and revise the next increment. The aim is useful
370software and a development process that can keep improving with it.