Architecture Decision Records
Use 000-template.md. Accepted initial decisions:
001-go-module-layout.md— one Go module at the repository root until independent release/versioning is justified.002-messenger-envelope-v1.md— strict, bounded envelope structure; cryptographic verification and authorization remain separate. Amended 2026-10-17: the closed set gainsexecution.startedandexecution.output(ADR-009).003-local-status-ipc.md— foreground Mio status service over bounded, same-UID-authenticated Linux Unix-socket IPC; amended 2026-10-16 so that anflockonscoprad.lockserves as the single-daemon lock, and again so that the default state directory is the persistent$XDG_STATE_HOME/scopra(~/.local/state/scopra).004-workspace-validation.md— canonical workspace paths; rejection of the filesystem root, home directories, and other protected directories; owner-only roots; filesystem-identity fingerprint v1 and revalidation.005-workspace-registry-storage.md— version 1workspaces.jsonin a directory the caller owns exclusively; no duplicate or overlapping workspaces and none containing the registry; atomic writes and fail-closed reads. Amended 2026-10-16: Mio opens the registry at startup and refuses to serve if it is unusable, and no workspace may contain or lie inside the registry directory.006-local-workspace-commands.md—workspace.add,workspace.list, andworkspace.removeover IPC v1 with typed error replies and ID-cursor paging that fits each page in one frame; same-UID authorization for registration only, on the local socket only. A 2026-10-17 note records ADR-011's qualification for local runs.007-execution-request-v1.md— the strictexecution.requestpayload: exact keys, no nulls, transmitted text preserved exactly,shellfalse only, a workspace-relative working directory, explicit workspace access, networknoneonly, sanity-bounded limits, and a request window of at most one hour. The canonical form and action hash remain a follow-up. Amended 2026-10-16 so that the executable, working directory, and reason also reject the line and paragraph separators U+2028 and U+2029.008-canonical-execution-request.md— the canonical form of a whole version 1 execution request (RFC 8785 JCS, computed from the decoded value) and its action hash: lowercase hex SHA-256 over the labelscopra/execution.request/v1and a newline, then the canonical bytes. Mio always recomputes the hash. Includes two normative test vectors.009-execution-lifecycle-messages.md— Mio's execution states, plus four payloads:execution.startedandexecution.output(both new types that amend ADR-002's closed set),execution.result(exactly once, with exact keys for each state), andexecution.cancel. Output travels as base64url chunks numbered in one sequence across both streams, and results carry only metadata. It also defines the error codes, and the keys that make repeated messages idempotent. Fully implemented inpackages/protocolas of 2026-10-17.010-hollow-rootless-podman.md— Hollow runs each execution in one rootless Podman container, never as a native process. It requires Podman 4.0 or later, cgroups v2 delegation, and a configured image pinned by digest with no default. It fixes the exactpodman runargument vector: no network, no capabilities,no-new-privileges, a read-only root, the workspace as the only (CSV-quoted) mount, an empty environment, explicit limits with no swap, output passed straight to Mio and never logged, and an entrypoint override that keeps the argument vector exact. SELinux labels are disabled rather than the workspace relabelled. Implementation is planned in four increments; the argument builder, the preflight check, the runner, and Mio's wiring are implemented against a fake Podman, and no real Podman host has run them yet. An amendment adds thescoprad --sandbox-imagesetting and a runner (with timeout, cancellation, preflight, and leftover cleanup) tested against a fake Podman, both now implemented, and splits the runner into parts buildable here against a fake Podman, plus verification on a real host.011-local-execution.md— local execution over the Mio socket: the user's own action, contained in Hollow, with no grant or approval because nothing is delegated. It qualifies ADR-006's execution sentence for local runs only. Mio builds the full ADR-007 request with local principals taken from the peer credentials. The reply is streamed asstarted,output(base64url, at most 32 KiB), andresultframes, with a 30-second write deadline, cancellation on disconnect, and at most 4 concurrent runs. The ADR also covers thescopra runcommand and its exit statuses. Amended 2026-10-17: ADR-013 adds a bounded metadata-only journal of answered runs, with no output and no command line.012-systemd-user-service.md— Mio runs as a systemd user service, never a root service.scopra service installwrites one unit whoseExecStartis the durable configuration (absolutescoprad, explicit--state-dir, optional digest-pinned--sandbox-image), then enables and starts it;uninstallreverses that andstatusis read-only. The unit requestsDelegate=cpu cpuset io memory pids, and the installer probes Podman in a transient user service with the same delegation. The unit cannot useNoNewPrivileges,ProtectHome, orProtectSystem, because rootless Podman needs its setuid helpers and the workspace under the home directory. Installs are atomic and fail closed, refuse foreign units, and restore the previous unit when systemd rejects the change. It settles ADR-010's deferred question: there is no separate config file or environment variable.013-run-journal.md— Mio keeps a bounded, metadata-only journal of answered runs at<state-dir>/runs.jsonl(1000 entries and 1 MiB, owner-only 0600, atomic rotation, torn tail discarded, other corruption refuses startup) and serves it read-only overexecution.logs;scopra logsrenders it as text or schema-v1 JSON. It stores no command line, arguments, path, or output, and a journal that cannot be opened stops Mio, while a failed append stops later runs. Output capture is deferred to its own ADR.014-open-source-no-pricing.md— Scopra is released under the MIT License, with no pricing model: no paid tiers, subscriptions, usage-based billing, plan limits, feature gates, trials, or account requirements. Contributions are inbound under the same terms, third-party material keeps its own license (seeNOTICE), and the plan's billing item and the PRD's implied tiers are removed.015-documentation-site.md— the documentation site is generated from the repository's Markdown by a standard-library Go program (tools/docsite), committed as static HTML inapps/docs-site/public, and served by Vercel with no build step. Links are rewritten at build time and an unresolvable link fails the build;TestCommittedSiteIsUpToDatefails when the committed site no longer matches the docs. Chosen over a Node static-site generator and over downloading a Go toolchain during the deploy, because Vercel's build image has no Go and the project keeps one dependency-free toolchain.
016-one-command-installer.md— installing Scopra is one copy-paste command: a POSIXinstall.shpublished with the documentation site downloads the release, verifies its SHA-256 against the release'schecksums.txt, and hands the terminal toscopra install, a Go TUI built on a new standard-libraryinternal/tuipackage. The script never usessudo, never evaluates downloaded text, and writes only inside a temporary directory; the installer opens/dev/ttyso thatcurl … | shcan still be interactive, runs the Podman preflight in a transient delegated user service (and checks the current context for--no-service), changes nothing until confirmed, copies binaries atomically, and callsscopra service installrather than duplicating the unit.--yesis the non-interactive path, and a missing terminal without it stops instead of installing silently. Linux only, because containment requires Linux namespaces and cgroups. Amended 2026-10-17 by ADR-017: a missing prerequisite can be installed by the interface, after it prints the exact command and the user pressesy.
017-opt-in-prerequisite-provisioning.md— the installer may install a missing prerequisite (today, Podman) with the distribution's own package manager, and only on request: the checks screen offersf, a confirmation screen prints every argument vector,yruns them, and Enter,n, or Escape cancels. The plan is derived from/etc/os-releaseand a fixed table (never guessed, never a shell),sudois used only when it exists and the process is not root, and the terminal is handed to the child so the installer never sees a password.--yesnever provisions; an unknown system keeps the manual instructions. Cgroup delegation is also provisioned opt-in with a staged systemd drop-in. The installer and doctor test Podman in a transient delegated user service; a no-service install additionally checks the current process context. Rechecks use actual results, never a guessed relogin remedy, and an already-installed drop-in is not offered again.
Required follow-up ADRs cover device identity, relay transport/reconnect, containment backend, canonical execution requests, audit integrity, MCP authorization, output/redaction, token revocation, and update signing.