Standards
How this fleet of repos is built. Find your repo's archetype, then follow the standards it applies.
Archetypes
A repo is exactly one of these. Open one to see how each standard applies to it.
Full-stack product31 of 31 applyA user-facing product: a Rust/Poem server that emits an OpenAPI contract, with native clients per platform, deployed to the homelab. The heavyweight archetype — every standard applies.
| Standard | Applies | How it applies here |
|---|---|---|
| Versioning | Applies | Derived MAJOR.MINOR.<count>; computed in CI, consumed by server/Docker/Xcode/web. |
| Identifiers | Applies | dev.thmsn.<product> root; per-platform bundle ids; auth grants .{read,write,admin}. |
| Build info | Applies | libbuildinfo in the server (and shipped binaries); exposed via /version. |
| Branding | Applies | In-repo generator produces all icons/tokens for every platform. |
| CI/CD | Applies | Self-hosted runners; *.build → GHCR :main; *.release → registry. Codegen drift + coverage gates. |
| Self-hosted agents | Applies | Linux/macOS runners via agentutil; dev Mac for Apple notarized builds. |
| Deployment | Applies | Komodo GitOps + Watchtower + Caddy; hostname <product>.dev.thmsn.dev; secrets in Komodo UI. |
| Registry publishing | Applies | Client apps (iOS/macOS/Windows) ship to apps.dev.thmsn.dev. |
| Testing | Applies | >80% tarpaulin on the server; vitest + hermetic Playwright on web; thin/none on native UI. |
| Platform UX | Applies | Native per OS; web is the reference, ported natively. |
| Workflow | Applies | Commit to main; continuous deploy. |
| Service architecture | Applies | Workspace core→db→engine→api; poem-openapi; 10s drain. |
| Data & persistence | Applies | sqlx + SQLite, .sql migrations, typed Id<T>. |
| Public short ids | Applies | Stored short alias in URLs; the UUID stays internal. |
| Backups | Applies | stash-backup sidecar + committed backup.toml; SHORTCUTS entries for checking and restoring. |
| API contracts | Applies | Emit OpenAPI/AsyncAPI; generate + drift-check clients. |
| Error handling | Applies | Domain Error→HTTP; liberror/valuable trinity. |
| Auth integration | Applies | Central auth SDK; me() live authority; grant-gated. |
| Refresh tokens (client storage & rotation) | Applies | Clients keep them in the platform secret store; rotate single-flight. |
| Configuration | Applies | libconfig Loader; <PRODUCT>_ + bare shared env. |
| Observability | Applies | liblog/OTLP; /api/metrics; ids/timings only. |
| Tracing | Applies | Always-on + collector tail sampling; short linked roots; client traceparent/x-<product>-*, Ref: on errors. |
| Alerting | Applies | Provisioned rules, code-as-truth; alert on sustained failure, liveness at minimum. |
| Grafana dashboards | Applies | Committed deploy/monitoring/grafana/<name>.dashboard.json; at least a <product>-overview. |
| Client analytics | Applies | Every client records the reserved usage events through one recorder; the server serves POST <api base>/telemetry/events and re-emits them to ClickHouse. |
| Security | Applies | Argon2, ChaCha20-Poly1305, CSP, SSRF/decompression caps. |
| Web & client architecture | Applies | TanStack Query + Zustand; generated client; shared Kit. |
| Rust conventions | Applies | Edition 2024, clippy pedantic, git deps. |
| The lib* ecosystem | Applies | Reuse shared lib* for cross-cutting concerns. |
| READMEs | Applies | Root README.md covers mechanism, layout, quickstart, what CI runs, and the codegen/drift rule; each app has its own. |
| Shortcuts | Applies | Root SHORTCUTS.md holds the routes to prod URLs, the live version, deploy lag, logs and dashboards. |
Library13 of 19 applyA shared Rust crate consumed by other repos over git. Lighter than a product: no deploy, no clients, often no CI. The emphasis is a clean public API and being a good dependency.
| Standard | Applies | How it applies here |
|---|---|---|
| Versioning | Optional | Default off. Workspace-unified placeholder version; consumers pin by git ref. Manual semver only if it's a published contract (an SDK another repo version-pins). |
| Identifiers | Applies | Use libproduct's product_name!("dev.thmsn.<name>") for runnable/service variants (e.g. a proxy binary). A pure library may omit it. |
| Build info | Applies | Optional, feature-gated (load_build_info!(optional)). Off by default. |
| Testing | Applies | Test the logic/parsing surface with inline #[cfg(test)] (no separate tests/ dir). No hard coverage gate — the 80% rule is for services. scripts/cov.sh (tarpaulin) optional. |
| CI/CD | Optional | Only if it ships an artifact. A library with a service variant (e.g. libsomeproduct's proxy) gets a Docker/GHCR workflow; a pure crate needs none. |
| Workflow | Applies | Commit to main. |
| Error handling | Applies | The liberror+thiserror+valuable trinity; serializable, FQN-named errors. |
| Rust conventions | Applies | Edition 2024, clippy pedantic + allowlist, git-dep distribution. |
| The lib* ecosystem | Applies | This is a lib* — follow the catalogue conventions; reuse siblings. |
| Observability | Applies | Optional: tracing + valuable fields if it logs; no OTLP wiring of its own. |
| Tracing | Applies | If it opens spans: explicit names, per-item/per-line work at DEBUG, no process-lifetime spans, no URLs/argv in fields or error Display. |
| READMEs | Applies | The README is the API documentation: install snippet, a minimal compiling example, feature flags, and what stays in the consuming repo. |
| Shortcuts | Applies | Root SHORTCUTS.md like every repo; usually short, since a library has no running system. |
| Service architecture | N/A | |
| Data & persistence | N/A | |
| API contracts | N/A | |
| Auth integration | N/A | |
| Security | N/A | |
| Web & client architecture | N/A |
Orchestration6 of 11 applyInfrastructure-as-code for the homelab itself — the repo that deploys the products rather than being one. There is essentially one of these (homelab), but the conventions are worth fixing so it stays coherent.
| Standard | Applies | How it applies here |
|---|---|---|
| Deployment | Applies | This is the canonical implementation of it — Komodo + Periphery + Caddy + Watchtower. |
| Identifiers | Applies | DNS naming <service>.<host>.thmsn.dev; registry source dev.thmsn.apps. Distinct from product identifiers. |
| Workflow | Applies | Commit to main; reconcile. |
| Secrets split | Defining | see below. |
| READMEs | Applies | Root README.md carries the stack inventory, the hostname/DNS schema, the topology, and state that lives outside the repo; each stack has its own. |
| Shortcuts | Applies | Root SHORTCUTS.md holds the routes to what is running where: hosts, stack health, logs. |
| Versioning | N/A | (it deploys versioned artifacts; it isn't one). |
| Build info | N/A | (it deploys versioned artifacts; it isn't one). |
| Branding | N/A | (it deploys versioned artifacts; it isn't one). |
| Testing | N/A | (it deploys versioned artifacts; it isn't one). |
| Platform UX | N/A | (it deploys versioned artifacts; it isn't one). |
CLI / service tool13 of 21 applyA standalone binary distributed to machines (not a hosted service with clients). It may be
its own repo or a bin/ member inside a product monorepo. The distinguishing feature is
distribution through the registry with an install manifest.
| Standard | Applies | How it applies here |
|---|---|---|
| Versioning | Applies | Derived MAJOR.MINOR.<count> via build.rs; wired into clap #[command(version = env!("APP_VERSION"))]. |
| Build info | Applies | libbuildinfo recommended — a --version/version subcommand that prints commit hash + dirty flag is invaluable for a distributed binary. |
| Identifiers | Applies | dev.thmsn.<product>.cli (or .worker, etc.) via libproduct. |
| Registry publishing | Defining | published as registry kind = cli; see below. |
| CI/CD | Applies | cli.release.yml builds per-target artifacts on self-hosted runners and publishes. |
| Testing | Applies | Test command/arg logic and parsing; completions generation. |
| Workflow | Applies | Commit to main. |
| Configuration | Applies | libconfig (Loader / config!{}); defaults→TOML→shared→prefixed. |
| Error handling | Applies | thiserror/liberror trinity; map to a clean exit code/message. |
| Rust conventions | Applies | Edition 2024, clippy pedantic, git deps. |
| The lib* ecosystem | Applies | Reuse libsignal (shutdown), libcmd/libwhich, etc. |
| READMEs | Applies | Root README.md leads with the registry install one-liner (re-running it upgrades), then a subcommand tour and config/completions. |
| Shortcuts | Applies | Root SHORTCUTS.md holds the routes to the install manifest and the latest published version. |
| Service architecture | N/A | (a CLI is not a hosted service). |
| Data & persistence | N/A | (a CLI is not a hosted service). |
| API contracts | N/A | (a CLI is not a hosted service). |
| Auth integration | N/A | (a CLI is not a hosted service). |
| Web & client architecture | N/A | (a CLI is not a hosted service). |
| Branding | N/A | (a CLI ships via the registry, not a deploy). |
| Deployment | N/A | (a CLI ships via the registry, not a deploy). |
| Platform UX | N/A | (a CLI ships via the registry, not a deploy). |
Vendored app9 of 24 applyA third-party application we do not own, pinned as an upstream/ submodule and wired
into our own build/release infrastructure. We don't fork it, rebrand it, or reimplement it —
we compile what upstream shipped, apply only the mechanical adjustments our signing/registry
setup needs, and publish it to apps.dev.thmsn.dev like any other fleet app.
| Standard | Applies | How it applies here |
|---|---|---|
| CI/CD | Defining | <platform>.release.yml builds/signs/notarizes on a self-hosted runner and publishes. Trigger is a bump of the upstream/ submodule pointer (or manual dispatch). |
| Self-hosted agents | Applies | The signing identity + registry access live on the self-hosted runner (e.g. the dev Mac for a notarized macOS build). |
| Registry publishing | Defining | published to apps.dev.thmsn.dev, attributed to upstream (developer, category: external). |
| Versioning | Adapted | ship upstream's own version (read from its git tag), not our derived MAJOR.MINOR.<count>. We release what upstream tagged. |
| Build info | Applies | As needed to feed the release metadata (upstream commit/tag → registry version + build number). We don't inject libbuildinfo into code we don't own. |
| Workflow | Applies | Commit to main; a release is a submodule-pointer bump on main. |
| Identifiers | Optional | Tooling only. dev.thmsn.<product> is the standards/registry slug for this repo; it is never applied to the vendored app, which keeps its upstream bundle ids. No rebrand. |
| READMEs | Applies | Root README.md says what upstream is and at which ref it's pinned, what we add and where, and that there is no rebrand. |
| Shortcuts | Applies | Root SHORTCUTS.md holds the routes to the published registry entry and the pinned upstream ref. |
| Service architecture | N/A | upstream owns how the app is built. |
| Data & persistence | N/A | upstream owns how the app is built. |
| Public short ids | N/A | upstream owns how the app is built. |
| API contracts | N/A | upstream owns how the app is built. |
| Error handling | N/A | upstream owns how the app is built. |
| Auth integration | N/A | upstream owns how the app is built. |
| Configuration | N/A | upstream owns how the app is built. |
| Observability | N/A | upstream owns how the app is built. |
| Security | N/A | upstream owns how the app is built. |
| Web & client architecture | N/A | upstream owns how the app is built. |
| Rust conventions | N/A | upstream owns how the app is built. |
| The lib* ecosystem | N/A | upstream owns how the app is built. |
| Branding | N/A | we ship upstream's branding and UX unchanged. |
| Platform UX | N/A | we ship upstream's branding and UX unchanged. |
| Testing | N/A | we don't test code we don't own; the release workflow's build/sign/notarize/staple steps are the gate. |
All docs
The standards
- VersioningDerived
MAJOR.MINOR.<commit count>; tag is the only manual knob. - IdentifiersReverse-domain
dev.thmsn.*; inject vialibproduct. - Build infoEmbed git/build metadata via
libbuildinfowhen feasible. - BrandingOne in-repo, code-as-truth generator produces all assets.
- CI/CDWoodpecker pipelines in
.woodpecker/; build → GHCR/registry onmain. - Self-hosted agentsWoodpecker agents by label; dev Mac for Apple builds.
- DeploymentKomodo GitOps + Watchtower + Caddy; secrets out of git.
- Registry publishingClient apps ship via
apps.dev.thmsn.dev. - Testing>80% on services; don't unit-test UIs; no change-detector tests.
- Platform UXNative per OS, designed for the target OS.
- WorkflowCommit to
main; versions for debugging, not releases. - Shared skills & the standards serverShared skills/MCP live here; repos link them in.
- ShortcutsRepeated operational questions get a one-command answer in the repo's
SHORTCUTS.md. - READMEsRoot
README.mdeverywhere: pitch, mechanism, layout, quickstart, what CI runs, what's missing.
Implementation standards
- Service architectureWorkspace layered
core→db→engine→api; poem-openapi; 10s graceful drain. - Data & persistencesqlx + SQLite,
.sqlmigrations, typedId<T>(UUIDv7). - Backups
stash-backupsidecar per stateful stack →Secure/Application Backups/<product>on the NAS; stash audits and drills them; keys never under/data. - Public short idsStored 11-char Crockford-Base32 alias; URLs use it, UUID stays internal.
- API contractsServer emits OpenAPI/AsyncAPI; clients generated + drift-checked.
- Error handlingDomain
Error→HTTP;liberror+thiserror+valuabletrinity. - Auth integrationCentral auth via SDK; explicit mode (fail-closed); TLS transport;
me()is live authority; grant-gated. - Refresh tokens (client storage & rotation)Client stores in Keychain/DPAPI/httpOnly-cookie/0600; rotate single-flight; refresh is non-idempotent.
- Configurationlibconfig
Loader: defaults→TOML→shared→prefixed env. - Observability
liblog/OTLP;/api/metrics; log ids/timings, never bodies. - TracingAlways-on export, collector tail-samples; spans finish inside 60 s;
traceparent+x-<product>-*from clients, trace id echoed asRef:. - Client analyticsClients batch usage events to their own server, which re-emits them as OTLP logs routed to ClickHouse; no third-party analytics SDKs, no user content in props.
- AlertingGrafana-provisioned rules as code; alert on repetition and severity, never a retry's substring; liveness at minimum.
- Grafana dashboardsCommitted
<name>.dashboard.json; queries key off fleet identifiers. - SecurityArgon2, ChaCha20-Poly1305, CSP, SSRF/decompression caps.
- Web & client architectureTanStack Query (server) + Zustand (UI); generated client;
@thmsn/uion Tailwind v4; shared Kit. - Rust conventionsEdition 2024, clippy pedantic + allowlist, git deps.
- The lib* ecosystemSolve cross-cutting concerns once in a shared
lib*.