diff --git a/.claude/skills/podbay-change/SKILL.md b/.claude/skills/podbay-change/SKILL.md index 3743e98..9b5d7f2 100644 --- a/.claude/skills/podbay-change/SKILL.md +++ b/.claude/skills/podbay-change/SKILL.md @@ -38,7 +38,7 @@ Podbay stores other people's mail. The way of working is part of the product: ev | Edit a file that came from the seed | `node scripts/checks/copies.ts --fix` | | Remove lint warnings or shrink an oversized file | `node scripts/checks/ratchets.ts --update` (it only ever goes down) | | Finish or reorder roadmap work | [`docs/roadmap.md`](../../../docs/roadmap.md) | - | Add a dependency | An exact version at least three days old (`node scripts/pins.ts --resolve `); a 0.x one needs a dated `pinExceptions` entry | + | Add a dependency | An exact version at least three days old (`node scripts/pins.ts --resolve `), written in the catalog of `pnpm-workspace.yaml`, with `catalog:` in the package; a 0.x one needs a dated `pinExceptions` entry in the root `package.json` | 6. **Commit.** Conventional commits, signed off (`git commit -s`). Code with its tests in one commit, documents in another when both are large. Add files by explicit path, then read `git show --stat` of each commit: a commit must contain what its message says. Never push, publish, deploy or open a pull request unless asked. diff --git a/.claude/skills/podbay-security/SKILL.md b/.claude/skills/podbay-security/SKILL.md index 021439c..c9d664a 100644 --- a/.claude/skills/podbay-security/SKILL.md +++ b/.claude/skills/podbay-security/SKILL.md @@ -125,8 +125,8 @@ Each boundary below has the same five lines: what crosses it, the invariant, the - **Crosses:** every package version with its install scripts and licence, every file copied from the seed, and third-party text such as the vendored skill. - **Invariant:** exact pins, at least three days old, installed from a frozen lockfile; build scripts approved one by one. Licences from the allow-list; no AGPL or GPL. No code, schema, test, text, translation or asset from any other mail product, and none named. Every seed file is listed in `copies.json`. The vendored skill is byte-identical to its manifest. -- **Code today:** `scripts/pins.ts`, `scripts/checks/licences.ts`, `names.ts`, `copies.ts`, `vendored-skills.ts`; `minimumReleaseAge` and `allowBuilds` in `pnpm-workspace.yaml`. On every pull request the job `dependency review` (GitHub's action, pinned by commit, read-only) fails on what the pull request adds with a known vulnerability of any severity, or with a licence off the same allow-list. -- **Proof today:** `pnpm static pins`, `licences`, `names`, `copies`, `vendored`; `test/unit/pins.test.ts`, `test/unit/checks.test.ts` (licences, names), `test/unit/vendored-skills.test.ts`; `test/unit/dependency-review.test.ts` (the review's licences and exemptions equal the static check's and the lockfile's); CI installs with `--frozen-lockfile`; `.github/dependabot.yml` opens weekly update pull requests. +- **Code today:** `scripts/pins.ts` and `scripts/workspace.ts` (every package of the workspace, and the catalog of `pnpm-workspace.yaml` where every version is written once), `scripts/checks/licences.ts` (every package, `-r`), `names.ts`, `copies.ts`, `vendored-skills.ts`; `minimumReleaseAge`, which holds for a catalog entry as for any version (tried on 2026-11-19), and `allowBuilds` in `pnpm-workspace.yaml`. On every pull request the job `dependency review` (GitHub's action, pinned by commit, read-only) fails on what the pull request adds with a known vulnerability of any severity, or with a licence off the same allow-list. +- **Proof today:** `pnpm static pins`, `licences`, `names`, `copies`, `vendored`; `test/unit/pins.test.ts` and `test/unit/licences-workspace.test.ts` (a second package of a workspace held to both rules), `test/unit/checks.test.ts` (licences, names), `test/unit/vendored-skills.test.ts`; `test/unit/dependency-review.test.ts` (the review's licences and exemptions equal the static check's and the lockfile's); CI installs with `--frozen-lockfile`; `.github/dependabot.yml` opens weekly update pull requests. - **Open:** a unit test for the `copies` check, the vulnerability audit job (S15), the scheduled job that fails on a pin more than one major behind (V2). ### B10. CI and releases diff --git a/AGENTS.md b/AGENTS.md index 9c6fb3e..e239360 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,7 +63,7 @@ curl -X POST 'http://localhost:5173/cdn-cgi/local/email?from=a@sender.test&to=he Short form; the full text and the reason for each is in [docs/engineering-rules.md](docs/engineering-rules.md). **A rule without an automated check is not a rule**, so the table under it says which checks exist today. -1. **Latest, pinned.** Every dependency is one exact stable version, at least three days old when installed. A 0.x package needs a dated `pinExceptions` entry in `package.json`. (V1, V3, V6) +1. **Latest, pinned.** Every dependency is one exact stable version, at least three days old when installed, written once in the catalog of `pnpm-workspace.yaml`; a package names it as `catalog:`. A 0.x package needs a dated `pinExceptions` entry in the root `package.json`. (V1, V3, V6) 2. **Original work only.** No code, schema, test, text, translation or asset from any other mail product, and no other product named in this repository. No dependency under AGPL or GPL. A file that came from the seed stays listed in `copies.json`; when you change one, run `node scripts/checks/copies.ts --fix`. (S17, S15) 3. **Deny by default.** Every API route is in `workers/auth/route-table.ts` with the right it needs; the guard refuses a route that is not there. Access is decided only by `authorize` in `workers/auth/authorize.ts`. A person who is not a member of a mailbox gets 404, whatever their instance role: managing is not reading. The one exception is who the members are: an owner or administrator of the instance sees and changes them without a membership, with fresh proof and on a record the mailbox's owners read. Accounts are never created over HTTP. (S1, S10) 4. **Mail is hostile bytes.** Route by the envelope recipient, never by a header. A name or id from a message or a request never becomes a storage key without going through `workers/lib/inbound.ts` or `workers/lib/filenames.ts`. (S2, S3) diff --git a/biome.json b/biome.json index 7bfc40c..5d70607 100644 --- a/biome.json +++ b/biome.json @@ -34,6 +34,14 @@ "style": { "noNonNullAssertion": "error" } + }, + "domains": { + "drizzle": "recommended", + "playwright": "recommended", + "react": "recommended", + "tailwind": "recommended", + "tanstackQuery": "recommended", + "test": "recommended" } }, "javascript": { diff --git a/docs/engineering-rules.md b/docs/engineering-rules.md index c0cc73a..e710d03 100644 --- a/docs/engineering-rules.md +++ b/docs/engineering-rules.md @@ -8,7 +8,7 @@ | Rule | Enforcement | |---|---| -| **V1.** Every dependency starts at its latest stable version and is pinned exactly in one place: the package manifest today, a pnpm catalog once the repository has more than one package | The pins check fails on a range or a pre-release | +| **V1.** Every dependency starts at its latest stable version and is pinned exactly in one place: the catalog of `pnpm-workspace.yaml`, which every package of the workspace names as `catalog:` | The pins check reads every package and fails on a range or a pre-release in the catalog and on a version written in a package | | **V2.** Updates arrive as automated weekly pull requests. A new major is adopted within 30 days or gets a dated exception in the catalog. A security fix is merged within 48 hours | Update bot; a scheduled job fails when a pin is more than one major behind without an exception | | **V3.** No pre-release package in production dependencies without a written exception | The pins test rejects `-alpha`, `-beta`, `-rc` and `0.0.x` versions that are not on the exception list | | **V4.** The Workers `compatibility_date` moves forward every month, with the full test run | Scheduled job opens the pull request | diff --git a/docs/status.md b/docs/status.md index ed43245..983662b 100644 --- a/docs/status.md +++ b/docs/status.md @@ -9,13 +9,13 @@ | Check | Rules | Where | |---|---|---| -| Exact pins, 0.x exceptions | V1, V3 | `pnpm static pins`, unit tests | +| Exact pins, 0.x exceptions: every version of the workspace once, in the catalog of `pnpm-workspace.yaml`; every package of the workspace names it as `catalog:` (or `workspace:` for a package of the workspace), and a version written in a package is refused. The exceptions stay in the root `package.json`: a pnpm the project pins refuses a setting of ours in `pnpm-workspace.yaml`. The workspace file is read line by line, and a shape the check does not read (a named catalog) is refused. Biome turns a domain of rules on by itself only for a dependency with a version, so `biome.json` names the domains the catalog would have turned on, and `pnpm static schemas` keeps them in step | V1, V3 | `pnpm static pins`, `pnpm static schemas`; `test/unit/pins.test.ts` (a second package of a fixture workspace that writes its own version is refused), `test/unit/schemas.test.ts` | | Minimum release age | V6 | `pnpm-workspace.yaml` (`minimumReleaseAge`) | | Weekly update pull requests | V2 | `.github/dependabot.yml` | | Compatibility date at most 60 days old | V4 | `pnpm static compat` | | Every Cloudflare surface in the configuration has a sourced ledger entry | V5 | `pnpm static ledger` | | Copied files listed, modified ones marked | S17 | `pnpm static copies` | -| Licence allow-list over every installed package | S15, S17 | `pnpm static licences` | +| Licence allow-list over every installed package, of every package of the workspace (`pnpm licenses list -r`: without `-r` it reads the root's dependencies alone, tried on 2026-11-19 with pnpm 12.10.1) | S15, S17 | `pnpm static licences`; `test/unit/licences-workspace.test.ts` (a throwaway workspace whose second package's dependency is GPL is refused) | | What a pull request adds to the dependencies is read before it merges: it fails on a known vulnerability of any severity in every scope, and on a licence the static check does not allow (the same list, and the same LGPL packages of the toolchain). A licence it cannot detect is reported there and fails only `pnpm static licences`. A required check on `main` since 2026-11-18 | V2, S15, S17 | The job `dependency review` in `.github/workflows/checks.yml` (GitHub's `actions/dependency-review-action`, v5.0.0 pinned by commit); `test/unit/dependency-review.test.ts` holds its inputs to the static check's lists and the lockfile | | No other mail product named | S17 | `pnpm static names` | | No credential shapes, no tracked environment file | S6 | `pnpm static secrets` | @@ -29,7 +29,7 @@ | The guidance is consistent: `AGENTS.md` is one page and names every skill and subagent; skills are named as their folders; a rule's paths still match files; a subagent names only skills that exist and cannot edit; the settings keep local secrets unread and ask before a push or a deploy | D15 | `pnpm static guidance`, `test/unit/guidance.test.ts` | | No lint warning: every rule has one level for every file, no file is exempt, and `pnpm lint` fails on a warning (`--error-on-warnings`), so a clean run prints none. A rule is kept off at a place only by a `biome-ignore` that says why (two keyed lists that are never reordered). File size only goes down | D1, D4 | `pnpm lint`, `pnpm static ratchets` (lint warnings at 0) | | The app's controls are Kumo's (`pnpm static controls`): no `