Skip to content

Latest commit

 

History

History
445 lines (404 loc) · 48.8 KB

PLAN.md

File metadata and controls

445 lines (404 loc) · 48.8 KB

Shipkeep Implementation Plan (MVP v0.1)

How to use this plan

  • One task = one branch = one pull request. Branch feat/<task-id>-<slug>; the title starts with [<task-id>].
  • A task is done when its acceptance criteria are met and the definition of done in CLAUDE.md passes. Tick the box in this file in the same pull request.
  • A task too large for one pull request (over about 500 changed lines excluding generated code) is split into <task-id>a, <task-id>b.

Tracks: A agent (Go), C control plane (NestJS), W web UI (Angular), X cross-cutting.

Status

Open work is tracked as GitHub issues, each with a priority:P0 to priority:P3 label. The scope and order of the first stable version are below. The README says what works today. Real-server acceptance (M1.6, M3.4, M8.3a, M10.1) waits for a dedicated test machine; M1.4 and M1.5 are accepted in CI against a real Docker and Caddy.

Work that no task owned yet, now assigned:

Work Task
Action dispatch over the Connect stream (ActionRequest/ActionUpdate) M1.4a
ExecStream M6.1
CollectFacts M1.6
UpgradeAgent M8.3
Retry-safe certificate renewal (SPEC 16) M4.5
The web token scope picker M2.3f1

First stable version (v0.1.0)

The milestones below describe the whole MVP. The first stable version ships part of it: the maintainer decided this scope on 2026-11-18 and confirmed it with this order on 2026-11-21. Issues in scope carry the v0.1-stable label and priority:P1 or P0; #413 tracks them.

In scope:

  • Installation with one command: one machine for the control plane and its applications, or a control plane and several servers.
  • Deployment from an image or from Git.
  • Domains and HTTPS.
  • Rollback.
  • Secrets.
  • Stop, start and delete an application.
  • Logs.
  • Several servers, without a private network between them.

Out of scope, kept for later at priority:P2:

  • Managed databases (M5.1).
  • Backups and restore of application data (M5.2, M5.3).
  • The WireGuard network, internal DNS, routing distribution and automatic failover (M4.1, M4.2, M4.4, M4.5).
  • Previews (M7).
  • SSO (M8.1) and sign-in with GitHub and GitLab.
  • Compose applications (M3.8b, M3.8c).

Order:

Step Work Issues Waits for
1 The single-machine installation (ADR 0021): code and docs merged in #378 to #382 #377 Only its acceptance on a real machine, with step 5
2 Server detail, deployment detail, maintenance mode #264, #265, #256 Nothing; the full deployment log comes with step 4
3 Deployment from Git: providers, shipkeep.yml sync, builds (ADR 0030, 0031) #213, #214, #215 Nothing: each organization creates its GitHub App (ADR 0031)
4 Logs and container exec (M6.1) #232 Nothing: logs go through the control plane (ADR 0029)
5 Real-server acceptance, control plane backup, upgrades #200, #202, #18, #216, #239, #352, #377, #231, #240 The test VM and the domain; #231 lands before #240
6 Hardening and documentation (M10.2, M10.4) #244, #246 Nothing

Releases: v0.1.0-beta.1 once steps 1 to 4 are merged, then v0.1.0 once step 5 has passed on a real server and step 6 is merged. Each tag needs the maintainer's go-ahead.


M0. Foundations

  • M0.1 Repository bootstrap (X)
    • Nx workspace with pnpm; apps/api (NestJS), apps/web (Angular), packages/domain, packages/config-schema, packages/api-client, packages/proto-ts; go.work with the agent/, cli/ and lib/ modules (paths in CLAUDE.md).
    • Root package.json with a packageManager field (pnpm version pinned) and the scripts from the CLAUDE.md command table (pnpm lint, pnpm gen, pnpm dev, pnpm test:integration); test:integration may be a no-op placeholder that exits 0 until M1.2.
    • ESLint (strict, type-aware), Prettier, .golangci.yml (config version 2), EditorConfig, .nvmrc, .tool-versions.
    • Pre-commit hooks with lefthook: gitleaks on staged files, block files over 1 MB, lint-staged formatting. .env.example with fake values only.
    • Acceptance: pnpm install && pnpm lint && pnpm nx run-many -t test && go test ./agent/... ./cli/... ./lib/... pass on a clean clone; the ci and security workflows pass on the PR.
  • M0.2 CI and security workflows (X). Depends: M0.1
    • Harden the existing workflows in .github/workflows/: pin every third-party action to a full commit SHA (with the version in a comment) and every tool image to a digest (semgrep/semgrep, gitleaks/gitleaks); replace securego/gosec@master with a pinned release; pin the golangci-lint version so it matches .golangci.yml.
    • release.yml is only checked with actionlint here; its first dry run happens in M8.2d1.
    • Acceptance: all required checks listed in docs/MAINTAINING.md are green on the PR; actionlint passes; no action referenced by a mutable tag.
  • M0.3 Proto and codegen pipeline (X). Depends: M0.1
    • buf.yaml (lint STANDARD, breaking FILE), buf.gen.yaml; proto/shipkeep/agent/v1/ with the skeleton from SPEC Appendix A and all action messages with fields from SPEC 3.3, 3.6 and the ExecStream frames from SPEC 3.1.
    • Generated Go code in lib/gen, TS code in packages/proto-ts. pnpm gen regenerates; CI fails on drift.
    • Acceptance: buf lint clean; buf breaking wired against main; both sides compile.
  • M0.4 shipkeep.yml schema (X). Depends: M0.1
    • JSON Schema 2020-12 for SPEC section 2 in packages/config-schema; generated TS types; Go types and validator in lib/config.
    • Golden test files: 20 valid and 30 invalid examples covering every rule in SPEC 2.2.
    • Acceptance: TS and Go validators agree on every golden file (shared test fixture).
  • M0.5 Local dev environment (X). Depends: M0.1
    • deploy/dev/compose.yml with PostgreSQL 17, VictoriaLogs, VictoriaMetrics, a registry; pnpm dev starts API and web with hot reload.
    • Acceptance: a new contributor runs the stack with two commands documented in README.md.
  • M0.6 Custom Semgrep rules (X). Depends: M0.2
    • Starter rules already exist in .semgrep/rules/shipkeep-rules.yml. Add Semgrep rule tests (.semgrep/tests/) proving each rule fires on a bad sample and stays silent on a good one, and extend the rules if THREAT_MODEL requires more.
    • Acceptance: security workflow fails on the bad samples, passes on the codebase.

M1. Agent core

  • M1.1 Agent skeleton and config (A). Depends: M0.3
    • agent/cmd/shipkeep-agent, config file /etc/shipkeep/agent.yaml, structured JSON logging, graceful shutdown, --dev mode.
    • Acceptance: binary under 30 MB; starts and stops cleanly; unit tests for config validation.
  • M1.2 Enrollment and mTLS stream (A + C). Depends: M1.1, M2.1. Split into M1.2a, M1.2b and M1.2c. Acceptance met. The join-token REST endpoint, node list/revoke and the install command with the CA fingerprint moved to M2.7, because they need RBAC and tenant row-level security first.
    • M1.2a API fleet module: join tokens (hashed, single use, 15 min), internal Ed25519 CA with private keys encrypted by the KEK, confirmation signing key, EnrollNode and IssueJoinToken commands, node and certificate records.
      • Acceptance: CA issues a client certificate from a CSR with the SPIFFE identity decided by the control plane; a reused or expired token is rejected; audit events emitted.
    • M1.2b API AgentGatewayService gRPC server over TLS from the installation CA (Connect-RPC): Enroll, RenewCertificate, client-certificate authentication with the revocation list, CA fingerprint in the install command, join-token REST endpoint once RBAC exists (moved to M2.7).
      • M1.2b1 Certificate identity checks and atomic certificate renewal with revocation and audit; tests cover concurrent renewals and rollback on audit failure.
      • M1.2b2 TLS gateway and unary RPC adapters, default-deny client-certificate authentication, revocation checks and transport tests. The CA fingerprint is already returned by IssueJoinToken; displaying it in the install command and exposing join tokens remain gated on M2.3/M8.3. Connect lifecycle and revocation disconnection are implemented in M1.2c3. ExecStream relays the exec sessions of M6.1, behind the same authentication.
    • M1.2c Agent: key generation, CSR, Enroll, cert storage (0600), CA fingerprint pinning, Connect stream with reconnect and exponential backoff with jitter, cert renewal.
      • M1.2c1 Ed25519 keys and CSRs, identity-bound credential validation, atomic 0600 credential generations and persistence failure tests.
      • M1.2c2 Pinned TLS enrollment and certificate renewal client, with rogue-CA and token non-disclosure tests.
      • M1.2c3 Authenticated gateway stream lifecycle, Hello validation and active revocation checks.
      • M1.2c4 Agent connection loop, reconnect/backoff, renewal scheduling and real agent/gateway restart integration tests.
        • M1.2c4a Stream runner with Hello/Welcome validation, heartbeats, bounded jittered reconnect, key rotation scheduling and cancellation tests.
        • M1.2c4b Wire enrollment and the runner into the daemon, consume a private join-token file, and test the actual Go agent against the NestJS gateway through restart/revocation.
      • Acceptance: integration test enrolls an agent, reconnects after control plane restart, rejects reused token and revoked cert.
  • M1.3 Operation journal and local state (A). Depends: M1.1. Split into M1.3a/b/c for review.
    • M1.3a Private SQLite store, exclusive process ownership, durable operation intent/checkpoints/history, idempotency and stale-writer checks.
    • M1.3b Versioned desired/actual/routing state, leases and single-use confirmation persistence.
    • M1.3c Resumable/compensating step executor, transition notifications, daemon ownership and interruption tests.
    • SQLite schema from SPEC 3.4 and 3.5, journal API, resume and compensation framework, idempotency keys.
    • Acceptance: tests kill the agent mid-action (simulated) and verify resume or compensation for each step type.
  • M1.4 Container actions (A). Depends: M1.3. Split: all handlers are done (a, b, c). Accepted against a real Docker daemon in CI (#16): every action through the agent's own handlers, with Docker's view of the confinement checked (real_docker_test.go, job "Agent against Docker and Caddy"). That test found that an HTTP probe failed whenever the image exposed another port than the application's; the agent now probes the port the spec declares.
    • M1.4a Action dispatch over Connect: ActionRequest journaled before execution, ActionUpdate progress, CancelAction, control-plane dispatcher and audit, idempotent redelivery after reconnect.
      • M1.4a1 Agent side: validated, journaled dispatch with progress updates, idempotent redelivery and cancellation; handlers registered per kind.
      • M1.4a2 Control-plane side: durable per-node action queue, delivery over the stream, update persistence, redelivery after reconnect, audit.
    • M1.4b Docker Engine SDK adapter: EnsureNetwork, PullImage, EnsureVolume, RemoveVolume (confirmation token verified with the enrollment public key, jti single use).
      • M1.4b1 Typed Engine API client; EnsureNetwork, PullImage, EnsureVolume handlers with malicious-input and fuzz tests.
      • M1.4b2 Go confirmation-token verifier (SPEC 3.6) and RemoveVolume.
    • M1.4c CreateContainer, StartContainer, StopContainer, RemoveContainer, HealthCheck, RunReleaseTask, with validator fuzz tests.
      • M1.4c1 Container spec validation and CreateContainer with confined defaults, malicious-input and fuzz tests.
      • M1.4c2 StartContainer, StopContainer, RemoveContainer (confirmation when removing volumes).
      • M1.4c3 HealthCheck and RunReleaseTask.
    • EnsureNetwork, PullImage, CreateContainer, StartContainer, StopContainer, RemoveContainer, EnsureVolume, RemoveVolume, HealthCheck, RunReleaseTask through the Docker Engine SDK, with all validations from SPEC 3.3.
    • Acceptance: integration tests against real Docker; malicious-input tests (privileged, host mounts, path traversal, oversized fields) all rejected; fuzz tests for validators.
  • M1.5 Caddy route management (A). Depends: M1.3. The handlers and the typed admin client are done (UpsertRoute, RemoveRoute). Accepted against the pinned Caddy in CI (#17): v1 to v2 under constant load from eight clients, then the replaced replica stopped and removed, with no failed request (real_caddy_test.go). The load is generated by the test itself rather than k6 or vegeta, so no tool is added; the same test with the switch left out fails with 502s.
    • Caddy installed by the installer; agent manages routes through the admin Unix socket with typed JSON; UpsertRoute, RemoveRoute with switch-then-drain.
    • Acceptance: test deploys v1, switches to v2 under constant load (k6 or vegeta), zero failed requests.
  • M1.6 Agent self-reconciliation (A). Depends: M1.4, M1.5. Done: the intent journal, the 30 s reconciler restarting stopped managed containers offline, CollectFacts, Caddy --resume in the M8.3a installer, StateReport (M1.6b), and routes that follow a container restarted at another address (ADR 0017), accepted in CI against a real Docker and Caddy with the control plane absent. Remaining: the acceptance of a whole machine reboot on a VM.
    • Reconcile loop every 30 s against desired; restart crashed managed containers; report StateReport; answer CollectFacts.
    • M1.6b1 Bounded managed-container snapshots and stream reporter: sample changes every second, refresh every 30 s, include stopped containers and suppress incomplete inventories. Unit/race tests cover shutdown, transport, missing containers and redaction. Daemon activation waits for the control-plane receiver (M1.6b2), so older gateways keep working.
    • M1.6b3 Show replicas with their node and observed state, in the API and on the application page.
    • M1.6b2 Accept state reports under the node identity and persist audited allocation observations in a separate table, without changing scheduler reservations; activate the daemon reporter.
    • Acceptance: with control plane stopped, a killed container is restarted and routing keeps serving.

M2. Control plane core

  • M2.1 API skeleton (C). Depends: M0.1. Split into M2.1a and M2.1b (too big for one PR).
    • M2.1a NestJS app with module layout from CLAUDE.md, Prisma, config validation, health endpoints, problem-details errors, OpenAPI generation, request logging with secret redaction.
      • Acceptance: /api/v1/health up; OpenAPI document generated in CI; packages/api-client generated from it.
    • M2.1b Shared foundations used by every later module: KEK loading and the envelope encryption library (SPEC 9), the domain event bus, and the AuditEvent table with an append-only writer, so that every command from M1.2 onward emits audit events.
      • Acceptance: encryption library round-trip and tamper tests pass; an example command emits an audit event end to end.
  • M2.2 Identity (C + W). Depends: M2.1. Split into reviewable foundations, persistence, account/session flows, MFA/tokens and web flows.
    • M2.2a Pure identity policy, bounded Argon2id hashing, purpose-bound token hashes, TOTP counters and recovery-code generation.
    • M2.2b Transactional identity persistence and audit, database migrations and concurrent-use tests.
      • M2.2b1 Request-local unit of work; audit writes join command transactions; real PostgreSQL rollback and isolation tests.
      • M2.2b2 Identity schema, case-insensitive email uniqueness, bounded credential lifetimes and real PostgreSQL constraint/concurrency tests.
      • M2.2b3 Identity repositories, per-user mutation locks, session invalidation and atomic token consumption.
    • M2.2c Signup, verification, login, sessions, CSRF, reset and brute-force protection.
      • M2.2c1 Audited account/session commands, single-use email/reset flows, login rotation and concurrent password-reset protection.
      • M2.2c2 Persistent request limits and progressive login delays shared across API instances.
      • M2.2c3 Private email delivery with bounded retries.
        • M2.2c3a Transactional pg-boss jobs with encrypted payloads, bounded retries and restart/tamper tests.
        • M2.2c3b SMTP transport, configuration and TLS delivery tests.
      • M2.2c4 REST endpoints, secure cookies, origin checks, CSRF and HTTP acceptance tests.
        • M2.2c4a Default-deny session and rate-limit guards, host-bound cookies and HTTP boundary tests.
        • M2.2c4b Account/session controllers, module wiring, generated API contract and HTTP acceptance tests.
        • M2.2c4c Idempotent authentication mutations and concurrent retry tests.
          • M2.2c4c1 Encrypted retry storage, transaction-bound concurrency control, expiry and rollback tests.
          • M2.2c4c2 HTTP idempotency keys, credential-bound replay and acceptance tests.
      • M2.2c5 Strip credential-bearing URL queries and opaque framework errors from HTTP diagnostics and responses.
    • M2.2d TOTP enrollment/recovery and scoped API tokens.
      • M2.2d1 Encrypted TOTP enrollment storage, version/expiry checks and atomic counter/recovery claims.
      • M2.2d2 Audited MFA commands, login proof and session rotation on security changes.
        • M2.2d2a Require atomic TOTP/recovery proof before session creation; rotate sessions and reset links on security changes.
        • M2.2d2b Password reauthentication, TOTP setup/activation/disable and recovery-code regeneration.
      • M2.2d3 MFA HTTP endpoints and acceptance tests.
      • M2.2d4 Scoped API tokens and bearer authentication.
        • M2.2d4a Closed permission vocabulary, scope narrowing and bounded token metadata policy.
        • M2.2d4b Token persistence, audited creation/revocation and owner-permission checks.
          • M2.2d4b1 User-owned token schema/store, bounded expiry, version invalidation and atomic revocation.
          • M2.2d4b2 Reauthenticated token commands, audited lifecycle and live authorization port.
        • M2.2d4c Bearer authentication, per-token limits and HTTP acceptance tests.
          • M2.2d4c1 Credential authentication, live owner-policy intersection and API traffic quotas.
          • M2.2d4c2 Session-only token management, default-deny bearer guard and HTTP acceptance tests.
            • M2.2d4c2a Default-deny bearer guard, shared traffic limits and profile-read HTTP acceptance.
            • M2.2d4c2b Session-only token management endpoints, encrypted retries and generated contract.
    • M2.2e Web identity flows and end-to-end acceptance tests.
      • M2.2e1 Typed browser identity transport, CSRF/idempotency handling and session state.
        • M2.2e1a Correct pagination schema and preserve immutable request/response arrays in the generated SDK.
        • M2.2e1b Same-origin identity transport and race-safe in-memory session state.
      • M2.2e2 Accessible signup, verification, login and password-reset screens.
        • M2.2e2a Component-scoped submission state, bounded retries, cooldowns and stale-result protection.
        • M2.2e2b Validated account forms and private-input lifecycle.
        • M2.2e2c Account routes, labeled forms, focus feedback and responsive navigation; browser verification in M2.2e4.
      • M2.2e3 Account security screens for MFA/recovery and API-token lifecycle.
        • M2.2e3a MFA enrollment/recovery form state and temporary private grants.
        • M2.2e3b MFA status, manual enrollment and recovery screens; browser verification in M2.2e4.
        • M2.2e3c Token creation/revocation form state and paginated metadata.
        • M2.2e3d Token-management screens and one-time credential display; browser verification in M2.2e4.
      • M2.2e4 Browser acceptance and accessibility checks against the real backend, responsive verification and production static serving.
        • M2.2e4a Same-origin production web serving and development origin configuration.
        • M2.2e4b Real-browser identity/security acceptance with PostgreSQL, accessibility and secret-boundary checks.
          • M2.2e4b1 Isolated HTTPS/PostgreSQL/SMTP Chromium fixture; public forms, signup/verification/login/logout, secure cookies, CSRF, CSP and automated accessibility checks in CI.
          • M2.2e4b2 Browser password-reset, MFA/recovery and API-token workflows, failure/retry paths and private-grant lifecycle verification.
        • M2.2e4c Desktop/mobile inspection, independent finish review and built design-system documentation.
          • Acceptance: input-boundary contrast and narrow-table cues reviewed at desktop/tablet/mobile sizes; real-browser keyboard navigation preserves form state and reaches token actions. Design system recorded in apps/web/DESIGN.md.
    • Sign-up, email verification, login with argon2id, sessions, CSRF, TOTP 2FA with recovery codes, password reset, API tokens with scopes.
    • Acceptance: auth E2E tests; brute-force protection (rate limit and progressive delay); session rotation on privilege change.
  • M2.3 Organizations, projects, environments, RBAC (C + W). Depends: M2.2
    • M2.3a Pure role matrix, resource-scope checks, protected-environment rules and last-owner policy.
    • M2.3b Organization/membership/project/environment schema, tenant-bound relations and database isolation tests.
      • M2.3b1 Tenant tables, composite foreign keys, unique role scopes and database constraint tests.
      • M2.3b2 Enforced row-level security and concurrent last-owner database guards.
      • M2.3b3 Bind existing fleet records to organizations without assigning orphan records to an arbitrary owner.
    • M2.3c Tenant transaction context, repositories and audited commands with concurrent last-owner protection.
      • M2.3c1 Transaction-local tenant context, restricted runtime-role checks and pooled/nested/concurrent transaction tests.
      • M2.3c2 Runtime-role provisioning, account-bound organization discovery and tenant repositories.
        • M2.3c2a Separate runtime/migration credentials, restricted grants, queue upgrade preservation and full-app role acceptance.
        • M2.3c2b Account-bound organization discovery and scoped tenant repositories.
          • M2.3c2b1 Account-scoped discovery policies, mutually exclusive transaction contexts and restricted-login isolation tests.
          • M2.3c2b2 Tenant authorization repository and live resource-authority queries; mutation repositories land with their audited commands in M2.3c3/c4.
      • M2.3c3 Audited organization/project/environment commands and rollback acceptance.
        • M2.3c3a Pure resource-setting validation, safe defaults and scoped settings permissions.
        • M2.3c3b Audited organization creation/settings, creator ownership and session rotation.
          • M2.3c3b1 Public account-mutation authority with live version checks, reauthentication and transaction-bound session rotation.
          • M2.3c3b2 Organization persistence, audited commands and atomic owner/session acceptance.
        • M2.3c3c Audited project/environment creation/settings and filtered catalog queries.
          • M2.3c3c1 Tenant-scoped project/environment writes, live role checks and audit rollback acceptance.
          • M2.3c3c2 Bounded account/tenant catalog queries filtered by current resource grants.
      • M2.3c4 Membership/binding commands, live authority and privilege-change session invalidation.
        • M2.3c4a Ordered actor/subject account locks, reauthenticated privilege changes and atomic credential invalidation.
        • M2.3c4b Audited organization membership commands with serialized last-owner protection.
        • M2.3c4c Scoped resource-role binding commands and membership/binding queries.
          • M2.3c4c1 Audited project/environment role assignments, removals and credential invalidation.
          • M2.3c4c2 Bounded, scope-authorized member/binding administration queries.
    • M2.3d Default-deny resource authorization, live API-token authority and protected HTTP endpoints.
      • M2.3d1 Explicit account/tenant route declarations, canonical path scopes and fail-closed session/bearer guard.
      • M2.3d2 Live token authority and credential revalidation inside resource commands.
        • M2.3d2a Live tenant scope grants and account-locked command credential validation.
        • M2.3d2b Resource-command token permissions, actor auditing and bounded query access.
      • M2.3d3 Organization/project/environment HTTP endpoints and encrypted mutation retries.
        • M2.3d3a Session catalogs, scoped resource detail endpoints and generated OpenAPI/client contracts.
        • M2.3d3b Resource mutation retry contracts and credential-bound cached-result authorization.
        • M2.3d3c Audited resource creation/settings HTTP endpoints and mutation acceptance.
          • M2.3d3c1 Organization creation/settings endpoints, fresh proof, rotated cookies and transactional retry acceptance.
          • M2.3d3c2 Project/environment creation/settings endpoints and scoped mutation acceptance.
      • M2.3d4 Membership/binding HTTP endpoints and generated route/role acceptance matrix.
        • M2.3d4a Session-only membership and effective-binding directories with scoped pagination.
        • M2.3d4b Membership mutation HTTP, fresh proof, credential rotation and encrypted retries.
        • M2.3d4c Project/environment binding mutation HTTP and privilege-change acceptance.
        • M2.3d4d Generated registered-route/role matrix and full tenant acceptance checkpoint.
    • M2.3e Project-owned tokens constrained by their project and creator's current permissions.
      • M2.3e1 Project-bound tokens: schema with a composite project key, scopes confined to the project, creator member.manage check, per-use project check, cascade on project deletion.
      • M2.3e2 Project token directory and revocation by project administrators (ordered account locks, audit), plus the web scope picker in M2.3f1.
    • M2.3f Organization/project/environment administration screens and browser/tenant-isolation acceptance.
      • M2.3f1 Organization switcher, project/environment catalog and settings, member and binding screens, API-token scope picker.
        • M2.3f1a Workspace navigation: organizations (create with password re-authentication), projects and environments (protected by default), the main navigation, and sign-in landing on organizations.
        • M2.3f1b Settings, member and binding screens, API-token scope picker.
          • M2.3f1b1 Organization, project and environment settings; forms recover after a refused request.
          • M2.3f1b2 Member and binding screens.
          • M2.3f1b3 API-token scope picker and the project token directory.
      • M2.3f2 Real-browser acceptance: two organizations, cross-tenant URLs answer 404, role changes take effect on the next request (tenant.browser.spec.ts).
    • M2.3g Row-level security for the remaining tenant-scoped tables (nodes, join_tokens, node_certificates, audit_events), with enrollment token lookup and the agent gateway moved to a separate reviewed cross-tenant role (SPEC 4). Must land before any node, join-token or audit read endpoint is exposed (M2.4, M2.7).
      • M2.3g1 Fleet tables. node_certificates has no organization_id: add it with a composite foreign key to nodes, rather than relying on a join policy. Gateway lookups use the organization of the verified certificate; enrollment uses a context-bound, SELECT-only token lookup instead of a separate role (ADR 0015).
        • M2.3g1a node_certificates.organization_id with a composite foreign key to its node, backfilled by migration (ADR 0015).
        • M2.3g1b Forced RLS on nodes, join_tokens and node_certificates; tenant-scoped gateway lookups; context-bound enrollment lookup; fleet integration tests on the restricted login.
      • M2.3g2 audit_events: tenant rows readable only in their organization context. System rows (organization_id null, for example fleet.installation_key.created) are readable by installation administrators only. INSERT stays allowed for every command transaction.
    • Entities from SPEC 4, RBAC matrix from SPEC 7 as a policy module, default-deny guard, row-level security.
    • Acceptance: generated RBAC matrix test covers every route and role; tenant isolation suite passes.
  • M2.4 Audit log guarantees and UI (C + W). Depends: M2.3. Partly done: the runtime role has only SELECT/INSERT on audit_events, and runtime-role.integration.spec.ts proves that UPDATE, DELETE and TRUNCATE are denied.
    • Database permissions deny update and delete on AuditEvent; audit UI with filters; export endpoint.
    • M2.4a Scoped audit query and JSON Lines export endpoints for organization administrators and audit.read tokens. Depends: M2.3g2.
    • M2.4c A test that walks every registered mutating route and requires its declared audit events to exist in the code (apps/api/src/audit-coverage.spec.ts).
    • M2.4b Audit UI with filters, paging and the JSON Lines export.
    • Acceptance: test asserts every command handler emits at least one audit event.
  • M2.5 Confirmation tokens (C + W). Depends: M2.3
    • M2.5a POST /api/v1/confirmations: EdDSA JWS from the installation confirmation key (SPEC 3.6), the typed resource name checked, jti stored and marked used, audited.
      • M2.5a1 Token format and catalog, Ed25519 signing in the installation key module, confirmation_tokens table under RLS, issuance and single-use consumption services.
      • M2.5a2 HTTP issuance route and the node target resolver.
    • M2.5b Shared confirmation in the web UI (ConfirmByName). Server removal uses it; volume, database and environment deletion will use it when those screens and actions exist.
    • /confirmations endpoint, UI confirmation dialog that requires typing the resource name.
    • Acceptance: destructive endpoints reject requests without a valid, unused, matching token.
  • M2.6 Web UI shell (W). Depends: M2.2. Partly done in M2.2e: shell, routing, auth flows, design tokens, Tailwind and CDK. Remaining: only the Lighthouse score itself, which has not been measured. In tenant.browser.spec.ts, axe passes WCAG A and AA on every workspace screen, and every rule including best practices on sign-in and the landing pages. Lists have empty states. Done: navigation (M2.3f1a) and live updates per environment (M2.6b).
    • Angular app shell, routing, auth flows, org/project/environment navigation, design tokens, Tailwind, CDK, empty states, SSE client.
    • Acceptance: Lighthouse accessibility score at least 95 on login and dashboard; core flows keyboard-navigable.
  • M2.7 Fleet administration endpoints (C + W). Depends: M2.3d, M2.3g1. Moved from M1.2b.
    • M2.7a Join-token issuance (fresh proof, node.manage) and node listing, session-only.
    • M2.7b Node revocation with a confirmation token and active stream disconnection. Depends: M2.5a.
    • M2.7c Install command with the CA fingerprint in the web UI. Depends: M2.3f1. Done as a servers screen: list with status and capacity, a join token after re-authentication with the agent configuration (gateway address, CA fingerprint, token file), and removal confirmed by typing the server name. The one-line installer is M8.3.
    • Join-token issuance endpoint (fresh proof, nodes.manage permission), node list, node revocation (confirmation token, active stream disconnected), and an install command that shows the CA fingerprint.
    • Acceptance: an organization admin enrolls a node with the copied command; another organization neither sees the node nor can revoke it.

M3. Deploy pipeline

  • M3.1 Git providers (C + W). Depends: M2.3
    • GitHub App (installation flow, webhooks, checks API), GitLab, Gitea, Bitbucket via OAuth or tokens. Webhook signature verification.
    • Acceptance: a verified push webhook enqueues a deploy request job with the commit and branch; a forged or replayed webhook is rejected. (Turning the request into a deployment is M3.4.)
    • Progress: an organization's GitHub App through the manifest flow, and its signed webhooks with installations, API side (ADR 0031). Next: its web page, then a push to an application's branch.
  • M3.2 shipkeep.yml sync (C + W). Depends: M3.1, M0.4
    • Read config at commit, validate, show drift; UI editor that writes back as commit or PR with diff preview.
    • Acceptance: editing replicas in the UI opens a PR with the exact YAML change.
  • M3.3 Builds and registry (A + C). Depends: M1.2, M1.4, M3.1
    • BuildImage with rootless BuildKit on the application's first server; Dockerfile, Railpack, Nixpacks, image; the control plane's registry on its public name with per-action credentials (ADR 0030); build logs streamed.
    • Acceptance: builds for Node, Python, Go, PHP sample repos; malicious Dockerfile cannot reach the host Docker socket.
  • M3.4 Deployment state machine (C). Depends: M3.3, M1.5, M4.3
    • SPEC 5.1 implemented as a domain aggregate with exhaustive transition tests; orchestration via pg-boss jobs.
    • Acceptance: failure injected at every state leaves the previous release serving.
    • M3.4a Pure deployment aggregate with plan-based skipping, routing outcome on failure, and exhaustive transition tests.
    • M3.4b Applications and releases for image sources (API), with the one-active-deployment invariant.
      • M3.4b1 Image applications: applications table (forced RLS), schema-validated configuration with a hash for optimistic concurrency, audited create and update, list and read routes.
      • M3.4b2 Releases (immutable configuration snapshot and image) and deployments (queued through the aggregate, one active per application, cancel before work starts).
    • M3.4c Orchestration: pg-boss job driving agent actions per state (schedule, pull, create, start, health, switch, drain, stop the old release), restoring routing on failure.
      • M3.4c1 Minimal node liveness: heartbeats make connected nodes ready (audited); missed heartbeats read as suspect or down.
      • M3.4c2 Image digest resolution on the control plane (ADR 0012), with SSRF guards: HTTPS only, public addresses only, bounded time and size.
      • M3.4c3a Route upstreams that name a local container, resolved by the agent (ADR 0017), so the pipeline can switch routes without knowing container addresses.
      • M3.4c3b The pure pipeline planner (next agent actions per state, failure injection at every state).
      • M3.4c4 Allocations table and the pg-boss worker: drives queued deployments with the planner (placement, agent actions with secrets injection, wake-up on action results).
        • M3.4c4a Allocations table (forced RLS), pipeline store (placement, load, digests, step outcomes by key prefix) and the scheduler adapter.
        • M3.4c4b Planner steps as agent actions, with secret values injected at enqueue time.
        • M3.4c4c The pg-boss worker: one job per deployment, woken by action results, audited transitions and recovery.
    • M3.4d Configuration editor (W). Edit YAML with schema validation, review a diff, and save with expectedConfigSha. A 409 keeps the draft and requires reloading the latest version and reviewing again. Saving does not deploy.
  • M3.5 Rollback and release history (C + W). Depends: M3.4
    • M3.5a One-click rollback: a new release copying an earlier one's pinned image and configuration, without replaying its release command; the replaced deployment becomes rolled_back.
    • M3.5b Release history with a configuration diff, and removal of replaced and failed containers.
    • M3.5c Image retention (deploy.keep_images). Needs an image-removal agent action, so an action-list change (ADR or SPEC update and security review).
    • Keep N images; one-click rollback; release diff view (image, config).
    • Acceptance: rollback under load with zero failed requests.
  • M3.6 Domains and TLS (A + C + W). Depends: M1.5
    • M3.6a Hostnames unique per organization, wildcards refused, and a live DNS check on the application page. HTTP-01 certificates already work through the routes Caddy serves, unproven until the VM run.
    • M3.6b Node public addresses for real verification, certificate expiry tracking, DNS-01 for Cloudflare.
      • M3.6b1 Administrators declare each node's public addresses; the domain check says whether a domain points at a server running the application.
    • Custom domains, HTTP-01, DNS-01 for Cloudflare first, verification status, certificate expiry tracking.
    • Acceptance: domain added and served over HTTPS in an E2E test.
  • M3.7 Secrets (C + W). Depends: M2.3
    • Envelope encryption from SPEC 9; write-only API; env and file injection.
    • Acceptance: secret values never appear in API responses, logs or agent SQLite (test greps for fixtures).
    • M3.7a Secrets API: write-only, versioned, environment-encrypted, audited, with the protected-environment rule.
    • M3.7b Secrets screen in the web UI (with M2.3f1), together with the application screens: create from shipkeep.yml (validated in the browser with the same schema), deploy, follow and cancel deployments.
  • M3.8 Compose applications (C). Depends: M3.4
    • M3.8a Pure parser and fail-closed validator (apps/domain/compose.ts), with hostile and everyday fixtures. Not reachable from any route yet.
    • M3.8b Accept compose: applications and translate services to container plans.
    • M3.8c Deploy several services per release in the pipeline.
    • Compose parser and validator (SPEC 2.2), translated to typed ContainerSpecs.
    • Acceptance: 15 popular Compose files deploy; 20 malicious Compose files rejected with clear errors.

M4. Networking and multi-node

  • M4.1 WireGuard mesh (A + C). Depends: M1.2
    • Key generation on node, IP allocation per org CIDR, ConfigurePeers, NAT traversal via persistent keepalive and endpoint discovery.
    • Acceptance: three VMs in two providers communicate over the mesh; one behind NAT.
  • M4.2 Internal DNS and service discovery (A). Depends: M4.1
    • Embedded DNS on the WireGuard interface for <app>.<env>.<project>.internal.
    • Acceptance: app on node A reaches database on node B by name.
  • M4.3 Scheduler (C). Depends: M2.3 (pure function; can be built before M3.4, which uses it)
    • SPEC 6 algorithm as a pure function with property-based tests.
    • Acceptance: deterministic placement; spread respected; constraints honored.
  • M4.4 Routing table distribution (C + A). Depends: M4.1, M1.5
    • Compute table, version it, push to all agents, cross-node forwarding in Caddy.
    • Acceptance: request to any node reaches the app wherever it runs.
  • M4.5 Heartbeats, leases, failover, fencing (C + A). Depends: M4.4
    • ADR 0008 implemented.
    • Retry-safe certificate renewal after a lost response (SPEC 16), so a lease holder is never fenced by its own renewal.
    • Acceptance: E2E kills a node; stateless app back on another node in under 90 s; stateful app never runs twice (partition test).

M5. Data

  • M5.1 Managed databases (C + A + W). Depends: M4.2, M3.7
    • PostgreSQL, MySQL, MariaDB, MongoDB, Redis with versions, credentials as secrets, connection string injection.
    • Acceptance: each engine created, connected from an app, restarted without data loss.
  • M5.2 Backup targets and backups (C + A + W). Depends: M5.1, M3.7
    • S3 targets tested on save; DB dumps and volume backups with client-side encryption; schedules and retention.
    • Acceptance: backup and restore round trip for each engine and for a volume, checksum verified.
  • M5.3 Restore anywhere (C + A + W). Depends: M5.2
    • Restore into another node, a new database or volume; scheduled restore tests.
    • Restoring over an existing volume or database requires a confirmation token, checked by the agent (ADR 0013); restores into new targets do not.
    • Acceptance: restore to a different node in E2E.
  • M5.4 Instance backup (C). Depends: M5.2
    • Control plane DB, CA, KEK to a separate target; documented disaster recovery procedure tested.
    • M5.4a Encrypted export (ADR 0026, #231): backup.sh keygen | create | restore, an age archive of the database and the KEK, encrypted to the operator's public key and authenticated by the server that made it.
    • M5.4b S3 destination for the same archive: backup.sh create --s3 | list | check, restore s3:NAME, from a separate container that never sees the key.
    • Acceptance: a fresh control plane restored from backup re-adopts existing agents.

M6. Observability

  • M6.1 Log shipping and search (A + C + W). Depends: M1.4
    • Agent ships logs through the control plane to VictoriaLogs (ADR 0029), which sets the labels; UI live tail and search; 30-day retention.
    • ExecStream: typed, RBAC-checked and audited container exec sessions (rule 3), relayed by the gateway between the agent and the browser's WebSocket.
  • M6.2 Metrics (A + C + W). Depends: M1.4
    • Container, node and Caddy metrics to VictoriaMetrics; charts in UI. Done through the control plane (ADR 0024): application, server and Overview charts.
  • M6.3 Alerts and notifications (C + W). Depends: M6.1, M6.2
    • Rule types from SPEC 12; channels email, Slack, Discord, Telegram, webhook.
    • Acceptance: each rule type fires in an integration test and delivers to a test channel.

M7. Previews

  • M7.1 Preview environments (C + A + W). Depends: M3.1, M3.4, M5.2
    • SPEC 11 with TTL, quota, database modes, PR comments, cleanup.
    • Acceptance: open PR creates preview with cloned DB; closing PR removes everything.

M8. Access and tooling

  • M8.1 SSO OIDC (C + W). Depends: M2.2
    • Org-level OIDC (Google, GitHub, Microsoft Entra, Keycloak tested), JIT provisioning with default role, enforce-SSO option.
  • M8.2 CLI (X). Depends: M3.5
    • M8.2a Foundation: login, logout, init, status, secrets, reached with an API token.
    • M8.2b deploy, rollback, server remove, and a run of the real binary against the real API (cli.integration.spec.ts).
    • M8.2c logs, env, db, backup, preview, server add, as their bearer routes appear.
    • M8.2d1 .goreleaser.yaml for the agent (Linux) and the CLI (Linux, macOS, Windows), with checksums, SBOMs and a keyless cosign signature; release.yml dry run via workflow_dispatch.
    • M8.2d2 Homebrew tap and Scoop bucket (needs the two repositories and their tokens).
    • Go CLI commands from ARCHITECTURE.
  • M8.3 Installer and control plane upgrades (X). Depends: M5.4
    • M8.3a Agent/Caddy installer and verified command in Servers (first usable version; independent of control-plane upgrades). Merged. The command from the Servers page was run in an Ubuntu 24.04 container with systemd: the server reached ready, and the Caddy restart and kill -9 steps of deploy/README.md passed. With the published v0.1.0-alpha.1, a restart of that container, with Docker's storage on disk, brought the services, the application and its route back. That is not the reboot step: a real VM remains required before this is ticked. Caddy comes from its signed upstream repository (owner's decision, 2026-11-07) and runs with --resume; the M1.6 VM acceptance remains separate.
    • get.shipkeep.dev installer (CA fingerprint pinning, shipkeep-build user, cgroup v2 delegation, AppArmor profile on Ubuntu 24.04), signature checks, conflict detection.
    • M8.3b1 deploy/control-plane.Dockerfile: the API, the web UI, Prisma migrations and deploy/postgres/provision-runtime.mjs (restricted API login), built by release.yml.
    • M8.3b2 deploy/control-plane/compose.yml (PostgreSQL, key-encryption key, migrations, restricted login, control plane, Caddy) and docs/INSTALL.md. Run end to end on one machine with Docker (control plane, a server installed with the command from the Servers page, deployments and a rollback); repeated with the published v0.1.0-alpha.1; stays open until it has run on a real server with a public name.
    • M8.3b3 Control plane installer: deploy/control-plane/install.sh, shipped in a bundle that release.yml builds with deploy/control-plane/build-bundle.sh once the image is pushed (installer, compose.yml, Caddyfile, image reference by digest). It checks the machine, asks for the DNS name and the SMTP account, installs Docker on Ubuntu 24.04 when absent, writes the settings, starts the stack and waits for HTTPS. Published with v0.1.0-alpha.2 and run from that release in fresh Ubuntu 24.04 containers with systemd: bundle signature verified, Docker installed, stack started, sign-up, a server added, a deployment (docs/INSTALL.md, "What has been tested"). Stays open until the installer has ended with a public certificate on a real server.
    • Trivy image scan in release.yml, UpgradeControlPlane action with snapshot and rollback; UpgradeAgent with signature check and rollback to the previous binary.
    • Acceptance: upgrade from previous release to current on a VM, then forced failure triggers automatic rollback.

M9. Migration

  • M9.1 Coolify import (C + W). Depends: M3.8, M5.1
    • SPEC 13 with dry-run report and execution.
    • Acceptance: import of a Coolify v4 test instance with 5 apps and 2 databases.
  • M9.2 Template catalog (X). Depends: M3.8
    • Converter for Coolify templates with attribution; first 50 templates curated and tested.

M10. Hardening and beta

  • M10.0a Integration acceptance fixture maintenance (X). Align email verification fixtures with password proof, isolate validation cases from shared throttle budgets, and cover application, deployment, fleet, secret and token paths in the registered-route role matrix. Production authentication and rate limits are unchanged.
  • M10.1 E2E suite on real VMs (X). Depends: M4.5
    • Implement pnpm e2e:provision, pnpm e2e:run, pnpm e2e:teardown used by .github/workflows/e2e-nightly.yml (Hetzner Cloud via hcloud, resources tagged with the run id, teardown deletes by tag).
    • Scenarios: deploy, rollback, failover, backup and restore, preview, upgrade.
    • Acceptance: nightly run green three nights in a row; no orphaned VMs after a forced failure.
  • M10.2 Fuzzing and security pass (X). Depends: M1.4, M3.8
    • Fuzz targets from THREAT_MODEL running in CI for 5 minutes each nightly; fix all findings.
  • M10.3 Performance budget (X). Depends: M6.2
    • Measure resource targets from ARCHITECTURE; fail CI on regression beyond 10%.
  • M10.4 Documentation site (X). Depends: M8.2
    • User docs: install, concepts, shipkeep.yml reference (generated from schema), CLI reference, migration guide.
  • M10.5 Private beta (X). Depends: all above
    • Three external teams onboarded; MVP exit criterion tracked.

After the MVP (v0.5 to v1)

  • Control plane high availability (stateless API, PostgreSQL primary and replica).
  • Continuous volume replication between nodes.
  • Corrosion-based routing replication (ADR 0006).
  • SAML, white label, LTS channel.
  • External security audit.