Architecture Specs
This work holds cross-feature architecture specs — deep
descriptions of the substrates that user-facing features under
docs/specs/features/ build on top of. Each spec targets AI agents
and engineers reading the codebase and reasoning about changes,
not end users.
If you're new to the platform, read in this order:
pipeline-overview— wide-angle: how a generation request becomes three GitHub repositories.plugin-sdk— how plugins are loaded, selected, and given context. Almost every feature touches this.settings-system— the 3-tier resolution +x-secrethygiene contract every plugin obeys.trigger-integration— how the API hands long-running work to the Trigger.dev worker.database— the TypeORM module + repository pattern + migration policy.
Then drill into the specific subsystem(s) your work touches.
Spec Index
The specs come in companion pairs where one is wide-angle and one is internals; both are useful but you usually want the wide-angle first.
Pipeline & generation
| Spec | Focus |
|---|---|
pipeline-overview | Wide-angle: 4 pipeline categories, routing, 3-stage orchestrator |
pipeline-executor | Internals: state machine, step contract, modifiers, checkpointing |
work-import | Source-repo analyzer + the three import paths |
Trigger.dev & background work
| Spec | Focus |
|---|---|
trigger-integration | API → Trigger.dev dispatch, payload contract, callback channel |
trigger-worker | Internals: per-task NestJS bootstrap, plugin hydration, logger bridge |
job-runtime-providers | Proposed: pluggable runtime (Trigger.dev default; Temporal / BullMQ / pg-boss / Inngest) — ADR-015 |
Plugins & capabilities
| Spec | Focus |
|---|---|
plugin-sdk | @ever-works/plugin deep-dive: capabilities, settings cascade, lifecycle |
plugin-testing | The @ever-works/plugin/testing harness for plugin unit tests |
settings-system | 3-tier setting resolution + JSON Schema x-* extensions |
ai-facade | AiFacadeService routing, model catalog, retry & cost tracking |
Auth, audit, and access
| Spec | Focus |
|---|---|
auth | JWT + OAuth + API keys + device flow |
activity-log | Audit + per-feature changelog infrastructure |
Data & state
| Spec | Focus |
|---|---|
database | TypeORM module, repository pattern, forward-only migrations |
cache | The cache_entries table and its 4 consumers (locks, checkpoints, AI cache, model catalog) |
events | @nestjs/event-emitter + BaseEvent contract |
Surfaces
| Spec | Focus |
|---|---|
web-dashboard | Next.js 16 App Router internals — routing, layouts, server actions |
cli | Public CLI + internal-cli architectures |
mcp-server-internals | OpenAPI → MCP tool conversion + sanitiser |
Operations
| Spec | Focus |
|---|---|
deployment | Docker + Kubernetes + Compose + env-var contract |
monitoring | Sentry + PostHog + structured logging |
notifications-mail | In-app + email delivery |
subscriptions | Plans, usage ledger, billing-provider plugin contract |
Companion Pairs
Some specs are intentionally split into a wide-angle view + an internals deep-dive. Read the wide-angle first:
| Wide-angle | Internals |
|---|---|
pipeline-overview | pipeline-executor |
trigger-integration | trigger-worker |
plugin-sdk | plugin-testing |
Conventions
Every architecture spec in this work follows the same shape:
# Architecture: <Subject>
**Status**: `Active` | `Draft` | `Deprecated`
**Last updated**: YYYY-MM-DD
**Audience**: <one-sentence audience description>
---
## 1. Purpose
## 2. <Domain-specific sections>
...
## N. References / See Also
Specs ground every claim in a real file path or class name from
the current develop branch — no speculation, no aspirations. When
the code changes, the spec changes; when the spec is wrong, file an
ADR under docs/specs/decisions/ explaining why.
When a spec needs to change
- The code changed → update the spec in the same PR.
- The architecture should change → write an ADR under
docs/specs/decisions/, land it, then update the spec to match the new reality. - You found the spec wrong on
develop→ fix it directly; no ADR needed for documentation drift.
Related
- Feature specs under
docs/specs/features/— the user-facing features built on top of these substrates. Start withfeatures/data-generator/spec,features/markdown-generator/spec, andfeatures/website-generator/spec. - ADRs under
docs/specs/decisions/— historical decisions that constrain current designs. See001-pipeline-checkpointing,002-trigger-worker-callback-channel,003-pnpm-overrides-strategy. - AI / generation cross-cutting under
docs/specs/ai/— plans and task lists that touch multiple architecture substrates. - Spec index:
../README.md— the top-level contents page across all spec types. - Constitution:
.specify/memory/constitution.mdat the monorepo root.