Spec: founding (P1) — found a community and its first gateway #11
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Wayfinder map: Matou/ourcloud#7 — founding's definition was locked on ticket #9 (2026-07-21); this spec inherits the map's cross-feature constraints (clan substrate behind the
clanseam, one enrollment mechanism with full community CA at v1, kanidm/OIDC, Netbird mesh,brandkittheming seam, tiered recovery, stack, cross-cutting UX rulings, seeded-cache supply chain).Design contract:
docs/ux/flows/p1-founding.mermaid+docs/ux/wireframes/p1-founding/(18 screens). Engineering tree: ADRs 0043–0052 (founding grill, 2026-07-21).Problem Statement
A community that wants to own its digital services has no way to begin. The person willing to do the work — the operator — is low-skill and low-time (the P1 persona, the design centre): they cannot rent and wire a server, configure DNS and TLS, stand up an identity provider, or manage secrets, and they must not be expected to. Today, going from "our community wants its own cloud" to "a live, branded, recoverable community on hardware the community controls" requires a sysadmin; communities without one are stuck renting their digital life from platforms they don't control.
The operator needs founding to be one guided journey that never strands them: reversible while they're deciding, resumable across days while the real world (routers, device owners, DNS) catches up, honest when something fails, and safe by construction — ending with the community, not the operator's laptop, holding its own keys.
Solution
Founding is a wizard in the operator app, in two phases.
The soft phase is minutes of draft-saved, reversible choices: what will happen (P1-S1), community details with a diacritic-folding slug (S2), the brand kit with a live portal preview (S3), Access — how members reach the community and which gateway hosts it (S4, with rent-in-flow S4a and the self-hosted connection pre-check S4b), the public Address (S5), and Review (S6). Nothing irreversible happens until Review.
The stand-up stage after Review is a durable, resumable checklist that does the real-world work — install, device-end consent, pairing and the spec gate, reachability, name wiring, gateway deploy, seeding, scrub — over one of four access paths: a rented server (broker-provisioned from the gateway image, so its checklist folds install and consent and runs reachability, name wiring, and deploy in place, per the S7 ruling), the operator's own VPS, a machine at the operator's place, or the private path (a local VM, no public address yet).
At hand-off (S12) the portal is live at the real address, the operator's first dashboard login happens through a one-time branded credential-enrolment (passkey), the recovery kit is offered, and the helper scrubs the laptop down to exactly its designed residue: repo replica, operator key, and any exported kit. The gateway is an ordinary enrolled node of its own community from day one, and the community — never the laptop, never Matou — holds its crown jewels.
User Stories
Acceptance criteria are Given/When/Then, sourced from
p1-founding.mermaidnodes and edges (including the failure branches) and the ADRs noted.Soft phase
As an operator, I want to start founding from the welcome surface, so that creating a community begins with one clear action.
As an operator, I want a plain "what will happen" overview (S1), so that I understand the journey and that nothing is irreversible until Review.
As an operator, I want to name my community (S2), so that it has an identity from the start.
As an operator, I want to capture the brand kit — logo, palette, greeting — with a live portal preview (S3), so that I see my community's face before anything exists.
As an operator, I want to pick Access (S4) — how members reach the community and which gateway hosts it, so that hosting fits my community's situation.
As an operator, I want to rent a server in-flow (S4a), so that I can found without owning any infrastructure.
As an operator self-hosting at my place, I want a connection pre-check (S4b) before any router work, so that I don't spend an evening on port-forwarding a connection that can never work.
As an operator with my own VPS, I want to enter its IP (S4 → S5), so that founding uses the server I already rent.
As an operator, I want a private path (S4 → S6), so that I can found a community on just this computer and go public later.
As an operator, I want to pick the community's public Address (S5), so that members can reach it at a name that belongs to us.
<slug>.matou.nz, to be pointed at the gateway IP once it is known (ADR 0049).As an operator, I want Review (S6) to confirm every soft-phase choice, so that I know exactly what "create" will do before anything irreversible happens.
As an operator, I want my draft saved, so that closing the app mid-soft-phase loses nothing.
Stand-up stage — the four paths
As an operator on the rented path, I want the stand-up checklist (S7) to skip what the gateway image already did, so that founding a rented server is short.
As an operator on my own VPS (S7a), I want a one-line install command, so that stand-up asks exactly one terminal action of me.
As an operator standing up a machine at my place (S7b), I want to choose the install method, so that the path matches my comfort.
As a device owner, I want to consent to an install mode on the device itself (S8), so that nothing wipes or claims my machine without me.
As an operator, I want the private path to stand up a local VM (VAR) without device-end consent, so that founding on my own computer is frictionless.
Pairing, gates, deploy
As an operator, I want the spec gate (S9) to show me the probed hardware, so that I see what the fleet is getting before deploy proceeds.
As an operator, I want a clear spec-gate failure (S9x), so that an underpowered machine costs minutes, not a broken community.
As an operator, I want the reachability test before name wiring (S10), so that DNS is only wired to an IP that provably accepts public visitors.
As an operator, I want the gateway deploy (S11) to stand up everything the community needs, so that hand-off means a working community, not a bare server.
As an operator whose VM-mode deploy fails, I want a clean retry, so that a failed attempt leaves no wreckage.
As an operator whose full-install deploy fails, I want honest recovery options, so that I'm never told a rollback exists when it doesn't.
Seeding, identity, hand-off
As an operator, I want the gateway to be an ordinary enrolled node of its own community, so that node #1 has no special identity path to go wrong later.
enrollcontrol-plane face (same package, in-process ledger; carrier per path — LAN listener at my place, SSH relay for VPS/rented, direct drive for the private VM), and seeding hands the connection-request record and issued IdentityGrant into the fleet's ledger (ADR 0043), so the control plane knows its gateway as enrolled node #1.As a community, we want our crown jewels to live on our fleet — never on the operator's laptop, so that no single personal machine is our quiet single point of failure.
As an operator, I want the config repo handed over to the fleet, so that from day one the control plane — not my laptop — is the authority.
As an operator, I want my first dashboard login to be a passkey enrolment at a branded screen, so that day one already feels like our community and no password ever exists.
As an operator, I want my app's fleet credential separate from my personal login, so that losing one never silently costs the other.
As an operator, I want the recovery kit offered at hand-off (S12), so that Tier-3 recovery exists from the community's first day.
As a community, we want the operator's laptop scrubbed after seeding, so that no ambient copy of our root keys exists anywhere.
As a member, I want the portal live at our address the moment founding ends, so that the community has a front door on day one.
As an operator, I want hand-off to land me somewhere useful, so that founding flows into running the community.
Resumability and safety
As an operator, I want the stand-up stage to survive closing the app and to take days if it must, so that real-world pace (routers, device owners, DNS propagation) never breaks founding.
As an operator, I want every stand-up action logged with drill-in, so that when something fails I (or remote support, later) can see what actually happened.
Implementation Decisions
foundingorchestrator, a Go package in the bundled helper and only there (ADR 0052). The Electron/Vue wizard is thin UI over stdio events; the control plane never runs this package.enrollcontrol-plane face — the same shared package backed by an in-process ledger, which must be an embeddable, first-class build target. The agent's enrollment client is carrier-agnostic: HTTP to a public endpoint, HTTP over LAN (machine at your place — the install command embeds the app's LAN address beside the code), or relayed over SSH to the agent's local Unix socket (own VPS / rented). Approval is the wizard itself: S9 is the pending card. Seeding performs the state handover (request record + IdentityGrant) into the fleet's ledger. Identity inherits the map's constraints: full community CA at v1, 90-day NodeCert, auto-renew at ⅔ validity over mTLS.{IP, root SSH key}back to the app, recurring billing to the community) and community-subdomain issuance (slug claim-check, record CRUD, pointing at the gateway IP once known). It is a fifth codebase in the monorepo (Go, same OpenAPI discipline) deploying to Matou infrastructure, never inside a community fleet. Sovereignty trade-off stated: the hosting contract is with Matou; everything on the box is the community's; own-VPS is the first-class eject route.Providerinterface that keeps a second provider additive. The gateway image is a DO snapshot built by CI per release, version-pinned to the app's release channel, generic and never per-community — all community material arrives at pairing time over SSH.status: confirmed):clan(Enrollment workflow for stand-up, Deploy for the gateway deploy, layered outcome detection),enroll(the state machine and one-way code→identity conversion),brandkit(compile at capture, pre-deploy preview via the local helper). Founding adds no new seam.Testing Decisions
foundingorchestrator driven headlessly against the fakes the seam docs already prescribe — fakeclan.Clan(simulating blocked/resume/remedy), in-memoryenrollledger + fake clock (exercises code expiry and token TTL without waiting), realbrandkit(pure — faking it is waste), fake broker client (scripts provision-success, payment failure, subdomain claim), fake DNS resolver (scripts resolving/not-yet). Every acceptance criterion above executes at this seam: four access-path happy paths, S7 item-failure → retry → switch-access, CGNAT pre-check fail, spec-gate fail (code survives), reachability fail, deploy-fail in both install modes, token-expiry re-mint, resume-from-snapshot after app restart, refuse-or-migrate on state-version mismatch, and scrub verification (residue is exactly replica + operator key + kit).design-verifychecks it at the end of the pipeline.clan,agent-control-plane); the real sides were validated by spike S13 (clan lifecycle, secrets, rollback, self-management) and spike #5 (kanidm/Netbird end-to-end on a real ACME origin). If a fake drifts from reality, the fix lands in the seam doc, not in more founding tests.Out of Scope
Further Notes
Seeded human decisions (
needs_human_decision— for Ben, not for agents to derive):Glossary: all terms per
CONTEXT.md— founding, soft phase, stand-up stage, gateway, gateway image, agent, install command, enrollment code, pairing, spec gate, install mode, full install, VM mode, reachability test, control plane, repo replica, operator key, recovery kit, broker, scrub, portal, brand kit.Cross-feature notes for slice-map: founding hands off to shell (welcome in, Operator home out — singleton assumption shared via ADR 0050), to device-add (P3-S2), to provisioning (portal links, service choice), to monitoring (gateway health on the fleet surface), to rescue (kit mechanics) and members (kaitiaki). The broker is a new external system for architecture diagrams 01/02 (done, ADR 0042 same-commit rule) and a fifth codebase for the repo skeleton (ADR 0040 as amended by 0047).
Note from the Sandcastle swarm (leaving open, not relabeling/closing — human triage call):
This is the Phase-1 founding spec deliverable, not an implementable vertical slice:
foundingorchestrator in the bundled helper, ADR 0052) does not exist yet — the ADR 0040 repo skeleton is still unbuilt (STATUS "Now" checklist);needs_human_decisionitems (broker operations/pricing, second provider/EU hosting, in-flow domain purchase).Implementable slices come from Phase 2 (
/slice-map) →/to-tickets. Labeledready-for-agent, so the swarm keeps re-selecting it with no actionable work — suggest retriaging the label until its tickets exist.Sandcastle note (not implementable yet — leaving open): this is a
to-specoutput (founding's feature spec), not a vertical slice with an implementation task manifest. STATUS.md records "founding now waits on the Phase-2 slice-map"; Phase 2 is not started (docs/slices/holds only the README; 2 of 8 features specced), and the slice-map +to-ticketssteps that emit implementable DAG-ordered tickets are human-gated. Until they run there is no seam/interface for the swarm to build and test against, so I'm not implementing this here.Not an executable slice for the swarm yet — this is the published feature spec, not an implementation ticket.
Same situation as #13: the swarm implements the per-slice tickets
to-ticketsemits after the Phase-2 slice-map, which has not run (nodocs/slices/*.yaml), and there is no repo skeleton / seam packages to build thefoundingorchestrator against (Phase 2.5 incomplete, ADR 0040). Attempting the whole feature would break one-slice-per-iteration and stay-in-scope. Consider droppingready-for-agentfrom the spec issues so the ready-list surfaces implementation tickets rather than specs. Leaving open; no code changed.Closed in the 2026-08-27
other-state sweep (Ben's ruling) — child spec complete: all 11 founding slices done, all 25 derived tickets closed; Phase-1 VM e2e green through Nextcloud 2026-08-24.