> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AD-003 pnpm monorepo and contract tests

> Decision record: why the suite is a pnpm monorepo guarded by contract tests.

| Field | Value |
| - | - |
| Status | Accepted |
| Scope | Repository layout, `pnpm-workspace.yaml`, `*.contract.test.ts` |

## Context

The kernel, SDK, services, design system, host app, and plugins change together but must keep strict boundaries.

## Decision

Use one pnpm workspace over `apps/*`, `packages/*`, and `plugins/*`. Packages reference each other with `workspace:*`. Protect public contracts with Vitest contract tests next to the code they cover.

## Consequences

| Type | Effect |
| - | - |
| Benefit | One install, one lockfile, and one CI verification run. |
| Benefit | Contract tests document and protect kernel and service behavior. |
| Cost | Contract tests cover only the kernel and demo authentication. Plugins have no tests. |
| Cost | Package boundaries are a convention. No tool enforces the dependency rules. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.