Trellis Design Index

Use this index to find the smallest set of design docs needed for a task.

Do not load the entire design/ folder by default. Start with one topic area, then follow only the linked prerequisites that matter for the task at hand.

Documentation Scope

The design/ tree records Trellis architecture, protocol semantics, durable invariants, lifecycle rules, and public Trellis-owned wire compatibility. It is not the primary API reference for TypeScript or Rust packages.

Use design/ for material that must remain true across implementations and over time:

  • architecture and package-ownership decisions
  • invariants, lifecycle rules, and system rules
  • protocol, wire, and authorization semantics
  • durable data structures, manifest formats, and compatibility rules
  • runtime behavior that language libraries must preserve

Use the docs site for reader-facing and language-specific material:

  • tutorials, task walkthroughs, and troubleshooting guides live under docs/ and are published as /guides/*
  • TypeScript language-library usage belongs in /guides/libraries/typescript
  • Rust language-library usage belongs in /guides/libraries/rust
  • generated TypeScript API reference comes from JSDoc on public entrypoints and is discovered through /api
  • generated Rust API reference comes from Rustdoc and is discovered through /api

Design docs may name the public helper family that implements a system rule, but ordinary examples such as how to connect a client, call an RPC, upload bytes, or mount a handler should live in guides and API reference. Keep exact language helper signatures in generated docs unless the signature itself is a protocol or wire-compatibility requirement.

Quick Participant Examples

These headings are intentionally named for fast human and AI lookup.

  • Minimal installable service example: core/service-development.md#minimal-installable-service-example
  • Minimal activated device example: auth/device-activation.md#minimal-activated-device-example
  • When choosing between them, read core/service-development.md#participant-kind-and-runtime-helper first

Core Platform Docs

DocumentRead WhenWhy
core/trellis-patterns.mdYou need Trellis-wide architecture rulesService categories, platform boundaries, communication patterns
auth/trellis-auth.mdYou are changing auth architectureIdentity model, identity authority, deployment authority, auth subsystem boundaries
auth/device-activation.mdYou are changing device preregistration or device activationKnown-device activation flow, connect info, profiles, online activation
contracts/trellis-contracts-catalog.mdYou are changing manifests, codegen inputs, or permission derivationCanonical contract format, uses, subject ownership, activation rules

Subsystem Design Docs

DocumentRead WhenWhy
operations/trellis-operations.mdYou are designing caller-visible async workflowsOperations model, auth model, internal control protocol, watch semantics
jobs/trellis-jobs.mdYou are designing service-private background executionJobs model, stream/SQL projection, retries, worker lifecycle, admin model
contracts/trellis-typescript-contract-authoring.mdYou are changing TypeScript contract architectureTS contract-driven model, specialized contract helpers, uses, derived API views
contracts/trellis-rust-contract-libraries.mdYou are changing Rust contract architectureRust participant facades, alias model, generation rules
tooling/trellis-cli.mdYou are changing Trellis CLI behavior or contract tooling workflowsCLI command architecture, install and upgrade flows, contract generation

Cross-Cutting Pattern Docs

DocumentRead WhenWhy
core/platform-libraries.mdYou are changing library/package boundariesPackage ownership and runtime responsibilities
core/files-transfer-patterns.mdYou are changing the public files API or operation-native transferContract-owned file metadata APIs, transfer-capable operations, and runtime helper boundaries
core/state-patterns.mdYou are changing the public shared state APINamed store declarations, runtime state semantics, admin inspection, and TTL behavior
core/kv-resource-patterns.mdYou are changing KV buckets, keys, TTLs, or projectionsKV naming, TTL, and projection rules
core/store-resource-patterns.mdYou are changing service-owned blob store resourcesStore resource shape, runtime semantics, and auth boundaries
core/type-system-patterns.mdYou are changing schemas, Result, or error modelingShared type-system and validation rules
core/service-development.mdYou are implementing service code or service runtime ergonomicsService layout, lifecycle, jobs vs operations
core/observability-patterns.mdYou are changing telemetry, correlation, health, or docs guidanceObservability and request-correlation rules
core/frontend-svelte-patterns.mdYou are changing Svelte frontend conventionsTrellis frontend state patterns
core/capability-patterns.mdYou are changing capability naming or deployment-role guidanceCapability taxonomy and assignment guidance

Protocol, API, And Runtime Surface Docs

These documents define the public protocol, API, and runtime-facing surfaces. Read them when you are implementing or reviewing library/runtime/codegen ergonomics.

DocumentSurfaceRead When
auth/auth-protocol.mdAuth protocol surfaceImplementing auth callout, proofs, reply validation, or auth state model
auth/auth-api.mdAuth public wire APIImplementing /auth/*, operations.v1.Auth.*, rpc.v1.Auth.*, or auth events
auth/trellis-auth.mdAuth system/runtime designImplementing auth helper semantics, sessions, identity authority, deployment authority, or runtime auth
auth/device-activation.mdDevice activation designImplementing known-device activation, connect info, or activation review flows
operations/trellis-operations.mdOperations designImplementing caller-visible async workflows in TypeScript or Rust
jobs/trellis-jobs.mdJobs designImplementing service-private background execution or jobs admin surfaces
contracts/trellis-typescript-contract-authoring.mdTypeScript contract designImplementing TS contract authoring or TS contract-driven runtime ergonomics
contracts/trellis-rust-contract-libraries.mdRust contract designImplementing Rust generated SDKs, facades, descriptors, or runtime ergonomics
core/state-patterns.mdState designImplementing contract-owned state declarations, runtime state semantics, or migrations
core/files-transfer-patterns.mdFiles and transfer designImplementing service-owned files APIs and operation-native transfer behavior
/api in the guides siteGenerated language API docsLooking up exact TypeScript signatures, Rustdoc links, pending Rustdoc crates, or generated SDK surfaces

Suggested Read Paths

For ordinary app/service library usage, prefer /guides/libraries/typescript, /guides/libraries/rust, and /api instead of the design docs.

Implement Trellis operations in TypeScript

  1. operations/trellis-operations.md
  2. auth/trellis-auth.md
  3. contracts/trellis-contracts-catalog.md
  4. /api for exact TypeScript signatures

Implement Trellis operations in Rust

  1. operations/trellis-operations.md
  2. auth/trellis-auth.md
  3. contracts/trellis-contracts-catalog.md
  4. /api for Rustdoc links

Implement Trellis jobs in TypeScript

  1. jobs/trellis-jobs.md
  2. core/service-development.md
  3. operations/trellis-operations.md only if the jobs attach to public operations
  4. contracts/trellis-contracts-catalog.md when changing job-owned resources, bindings, or provisioning surfaces
  5. /api for exact TypeScript signatures

Implement Trellis jobs in Rust

  1. jobs/trellis-jobs.md
  2. core/service-development.md
  3. operations/trellis-operations.md only if the jobs attach to public operations
  4. contracts/trellis-contracts-catalog.md when changing job-owned resources, bindings, or provisioning surfaces
  5. /api for Rustdoc links

Work on type systems or errors

  1. core/type-system-patterns.md
  2. relevant subsystem design doc
  3. /api for exact language API signatures when needed

Work on KV resources or projections

  1. core/kv-resource-patterns.md
  2. relevant subsystem design doc

Work on store resources

  1. core/store-resource-patterns.md
  2. contracts/trellis-contracts-catalog.md
  3. /api if the public runtime API changes

Work on contract state

  1. core/state-patterns.md
  2. contracts/trellis-contracts-catalog.md
  3. contracts/trellis-typescript-contract-authoring.md when changing TS authoring
  4. /api for exact TypeScript state helper signatures

Work on files or transfer

  1. core/files-transfer-patterns.md
  2. core/store-resource-patterns.md
  3. relevant subsystem design doc or /api for exact language signatures

Work on service layout or runtime ergonomics

  1. core/service-development.md
  2. relevant subsystem design doc
  3. /api for exact language signatures when needed

Implement an installable service in TypeScript

  1. core/service-development.md
  2. contracts/trellis-typescript-contract-authoring.md
  3. contracts/trellis-contracts-catalog.md
  4. core/platform-libraries.md
  5. /api for exact TypeScript signatures

Implement an activated device in TypeScript

  1. auth/device-activation.md
  2. auth/trellis-auth.md
  3. contracts/trellis-typescript-contract-authoring.md
  4. contracts/trellis-contracts-catalog.md
  5. core/platform-libraries.md
  6. /api for exact TypeScript signatures

Work on telemetry, docs, or request correlation

  1. core/observability-patterns.md
  2. relevant subsystem design doc

Work on capability naming or deployment policy

  1. core/capability-patterns.md
  2. auth/trellis-auth.md
  3. contracts/trellis-contracts-catalog.md

Change manifests, codegen, or discovery

  1. contracts/trellis-contracts-catalog.md
  2. contracts/trellis-typescript-contract-authoring.md or contracts/trellis-rust-contract-libraries.md
  3. relevant subsystem design doc
  4. /api for exact generated SDK or runtime APIs

Implement TypeScript contract/runtime surfaces

  1. contracts/trellis-typescript-contract-authoring.md
  2. contracts/trellis-contracts-catalog.md
  3. /api for exact TypeScript signatures

Implement Rust contract/runtime surfaces

  1. contracts/trellis-rust-contract-libraries.md
  2. contracts/trellis-contracts-catalog.md
  3. /api for Rustdoc links

Change auth or operation watch behavior

  1. auth/trellis-auth.md
  2. auth/auth-protocol.md
  3. operations/trellis-operations.md
  4. /api if the public language API changes

Implement auth protocol or auth callout

  1. auth/trellis-auth.md
  2. auth/auth-protocol.md
  3. contracts/trellis-contracts-catalog.md

Implement auth HTTP or RPC APIs

  1. auth/trellis-auth.md
  2. auth/auth-api.md
  3. auth/auth-protocol.md
  4. auth/device-activation.md if device activation is involved

Implement TypeScript auth surfaces

  1. auth/trellis-auth.md
  2. auth/auth-api.md
  3. auth/auth-protocol.md
  4. /api for exact TypeScript signatures

Implement Rust auth surfaces

  1. auth/trellis-auth.md
  2. auth/auth-api.md
  3. auth/auth-protocol.md
  4. /api for Rustdoc links

Operate Trellis auth in production

  1. auth/trellis-auth.md
  2. auth/auth-operations.md
  3. auth/auth-protocol.md

Notes For AI And Reviewers

  • load subsystem design docs for architecture
  • use /api in the guides site for exact TypeScript and Rust API details
  • load auth/contracts docs only when the task crosses those boundaries
  • prefer task-specific reading paths over broad context dumps
  • choose docs by participant kind (service, device, app, agent) and identity anchor (web, cli, native, device-user) rather than by repo folder name
  • search for the exact headings Minimal installable service example and Minimal activated device example before inventing a new participant shape