Standards

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.
StandardAppliesHow it applies here
VersioningAppliesDerived MAJOR.MINOR.<count>; computed in CI, consumed by server/Docker/Xcode/web.
IdentifiersAppliesdev.thmsn.<product> root; per-platform bundle ids; auth grants .{read,write,admin}.
Build infoApplieslibbuildinfo in the server (and shipped binaries); exposed via /version.
BrandingAppliesIn-repo generator produces all icons/tokens for every platform.
CI/CDAppliesSelf-hosted runners; *.build → GHCR :main; *.release → registry. Codegen drift + coverage gates.
Self-hosted agentsAppliesLinux/macOS runners via agentutil; dev Mac for Apple notarized builds.
DeploymentAppliesKomodo GitOps + Watchtower + Caddy; hostname <product>.dev.thmsn.dev; secrets in Komodo UI.
Registry publishingAppliesClient apps (iOS/macOS/Windows) ship to apps.dev.thmsn.dev.
TestingApplies>80% tarpaulin on the server; vitest + hermetic Playwright on web; thin/none on native UI.
Platform UXAppliesNative per OS; web is the reference, ported natively.
WorkflowAppliesCommit to main; continuous deploy.
Service architectureAppliesWorkspace core→db→engine→api; poem-openapi; 10s drain.
Data & persistenceAppliessqlx + SQLite, .sql migrations, typed Id<T>.
Public short idsAppliesStored short alias in URLs; the UUID stays internal.
BackupsAppliesstash-backup sidecar + committed backup.toml; SHORTCUTS entries for checking and restoring.
API contractsAppliesEmit OpenAPI/AsyncAPI; generate + drift-check clients.
Error handlingAppliesDomain Error→HTTP; liberror/valuable trinity.
Auth integrationAppliesCentral auth SDK; me() live authority; grant-gated.
Refresh tokens (client storage & rotation)AppliesClients keep them in the platform secret store; rotate single-flight.
ConfigurationApplieslibconfig Loader; <PRODUCT>_ + bare shared env.
ObservabilityAppliesliblog/OTLP; /api/metrics; ids/timings only.
TracingAppliesAlways-on + collector tail sampling; short linked roots; client traceparent/x-<product>-*, Ref: on errors.
AlertingAppliesProvisioned rules, code-as-truth; alert on sustained failure, liveness at minimum.
Grafana dashboardsAppliesCommitted deploy/monitoring/grafana/<name>.dashboard.json; at least a <product>-overview.
Client analyticsAppliesEvery client records the reserved usage events through one recorder; the server serves POST <api base>/telemetry/events and re-emits them to ClickHouse.
SecurityAppliesArgon2, ChaCha20-Poly1305, CSP, SSRF/decompression caps.
Web & client architectureAppliesTanStack Query + Zustand; generated client; shared Kit.
Rust conventionsAppliesEdition 2024, clippy pedantic, git deps.
The lib* ecosystemAppliesReuse shared lib* for cross-cutting concerns.
READMEsAppliesRoot README.md covers mechanism, layout, quickstart, what CI runs, and the codegen/drift rule; each app has its own.
ShortcutsAppliesRoot SHORTCUTS.md holds the routes to prod URLs, the live version, deploy lag, logs and dashboards.

Read the Full-stack product archetype

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.
StandardAppliesHow it applies here
VersioningOptionalDefault 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).
IdentifiersAppliesUse libproduct's product_name!("dev.thmsn.<name>") for runnable/service variants (e.g. a proxy binary). A pure library may omit it.
Build infoAppliesOptional, feature-gated (load_build_info!(optional)). Off by default.
TestingAppliesTest 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/CDOptionalOnly 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.
WorkflowAppliesCommit to main.
Error handlingAppliesThe liberror+thiserror+valuable trinity; serializable, FQN-named errors.
Rust conventionsAppliesEdition 2024, clippy pedantic + allowlist, git-dep distribution.
The lib* ecosystemAppliesThis is a lib* — follow the catalogue conventions; reuse siblings.
ObservabilityAppliesOptional: tracing + valuable fields if it logs; no OTLP wiring of its own.
TracingAppliesIf it opens spans: explicit names, per-item/per-line work at DEBUG, no process-lifetime spans, no URLs/argv in fields or error Display.
READMEsAppliesThe README is the API documentation: install snippet, a minimal compiling example, feature flags, and what stays in the consuming repo.
ShortcutsAppliesRoot SHORTCUTS.md like every repo; usually short, since a library has no running system.
Service architectureN/A
Data & persistenceN/A
API contractsN/A
Auth integrationN/A
SecurityN/A
Web & client architectureN/A

Read the Library archetype

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.
StandardAppliesHow it applies here
DeploymentAppliesThis is the canonical implementation of it — Komodo + Periphery + Caddy + Watchtower.
IdentifiersAppliesDNS naming <service>.<host>.thmsn.dev; registry source dev.thmsn.apps. Distinct from product identifiers.
WorkflowAppliesCommit to main; reconcile.
Secrets splitDefiningsee below.
READMEsAppliesRoot README.md carries the stack inventory, the hostname/DNS schema, the topology, and state that lives outside the repo; each stack has its own.
ShortcutsAppliesRoot SHORTCUTS.md holds the routes to what is running where: hosts, stack health, logs.
VersioningN/A(it deploys versioned artifacts; it isn't one).
Build infoN/A(it deploys versioned artifacts; it isn't one).
BrandingN/A(it deploys versioned artifacts; it isn't one).
TestingN/A(it deploys versioned artifacts; it isn't one).
Platform UXN/A(it deploys versioned artifacts; it isn't one).

Read the Orchestration archetype

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.
StandardAppliesHow it applies here
VersioningAppliesDerived MAJOR.MINOR.<count> via build.rs; wired into clap #[command(version = env!("APP_VERSION"))].
Build infoApplieslibbuildinfo recommended — a --version/version subcommand that prints commit hash + dirty flag is invaluable for a distributed binary.
IdentifiersAppliesdev.thmsn.<product>.cli (or .worker, etc.) via libproduct.
Registry publishingDefiningpublished as registry kind = cli; see below.
CI/CDAppliescli.release.yml builds per-target artifacts on self-hosted runners and publishes.
TestingAppliesTest command/arg logic and parsing; completions generation.
WorkflowAppliesCommit to main.
ConfigurationApplieslibconfig (Loader / config!{}); defaults→TOML→shared→prefixed.
Error handlingAppliesthiserror/liberror trinity; map to a clean exit code/message.
Rust conventionsAppliesEdition 2024, clippy pedantic, git deps.
The lib* ecosystemAppliesReuse libsignal (shutdown), libcmd/libwhich, etc.
READMEsAppliesRoot README.md leads with the registry install one-liner (re-running it upgrades), then a subcommand tour and config/completions.
ShortcutsAppliesRoot SHORTCUTS.md holds the routes to the install manifest and the latest published version.
Service architectureN/A(a CLI is not a hosted service).
Data & persistenceN/A(a CLI is not a hosted service).
API contractsN/A(a CLI is not a hosted service).
Auth integrationN/A(a CLI is not a hosted service).
Web & client architectureN/A(a CLI is not a hosted service).
BrandingN/A(a CLI ships via the registry, not a deploy).
DeploymentN/A(a CLI ships via the registry, not a deploy).
Platform UXN/A(a CLI ships via the registry, not a deploy).

Read the CLI / service tool archetype

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.
StandardAppliesHow it applies here
CI/CDDefining<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 agentsAppliesThe signing identity + registry access live on the self-hosted runner (e.g. the dev Mac for a notarized macOS build).
Registry publishingDefiningpublished to apps.dev.thmsn.dev, attributed to upstream (developer, category: external).
VersioningAdaptedship upstream's own version (read from its git tag), not our derived MAJOR.MINOR.<count>. We release what upstream tagged.
Build infoAppliesAs needed to feed the release metadata (upstream commit/tag → registry version + build number). We don't inject libbuildinfo into code we don't own.
WorkflowAppliesCommit to main; a release is a submodule-pointer bump on main.
IdentifiersOptionalTooling 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.
READMEsAppliesRoot README.md says what upstream is and at which ref it's pinned, what we add and where, and that there is no rebrand.
ShortcutsAppliesRoot SHORTCUTS.md holds the routes to the published registry entry and the pinned upstream ref.
Service architectureN/Aupstream owns how the app is built.
Data & persistenceN/Aupstream owns how the app is built.
Public short idsN/Aupstream owns how the app is built.
API contractsN/Aupstream owns how the app is built.
Error handlingN/Aupstream owns how the app is built.
Auth integrationN/Aupstream owns how the app is built.
ConfigurationN/Aupstream owns how the app is built.
ObservabilityN/Aupstream owns how the app is built.
SecurityN/Aupstream owns how the app is built.
Web & client architectureN/Aupstream owns how the app is built.
Rust conventionsN/Aupstream owns how the app is built.
The lib* ecosystemN/Aupstream owns how the app is built.
BrandingN/Awe ship upstream's branding and UX unchanged.
Platform UXN/Awe ship upstream's branding and UX unchanged.
TestingN/Awe don't test code we don't own; the release workflow's build/sign/notarize/staple steps are the gate.

Read the Vendored app archetype

All docs

The standards

Implementation standards

Archetypes

Reference