serverless-ircd 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +96 -2
- package/.github/workflows/deploy-aws.yml +129 -0
- package/.github/workflows/deploy-cf.yml +0 -2
- package/.gitmodules +3 -0
- package/AGENTS.md +5 -0
- package/CHANGELOG.md +352 -0
- package/MOTD.txt +3 -0
- package/PLAN-FIXES.md +358 -0
- package/PLAN.md +420 -0
- package/README.md +115 -81
- package/apps/aws-stack/README.md +73 -0
- package/apps/aws-stack/bin/aws.ts +49 -0
- package/apps/aws-stack/cdk.json +10 -0
- package/apps/aws-stack/package.json +41 -0
- package/apps/aws-stack/scripts/smoke-helpers.d.mts +22 -0
- package/apps/aws-stack/scripts/smoke-helpers.mjs +89 -0
- package/apps/aws-stack/scripts/smoke.mjs +142 -0
- package/apps/aws-stack/src/aws-stack.ts +263 -0
- package/apps/aws-stack/src/tables.ts +10 -0
- package/apps/aws-stack/tests/localstack.test.ts +46 -0
- package/apps/aws-stack/tests/smoke-helpers.test.ts +98 -0
- package/apps/aws-stack/tests/stack.test.ts +464 -0
- package/apps/aws-stack/tsconfig.build.json +11 -0
- package/apps/aws-stack/tsconfig.test.json +8 -0
- package/apps/aws-stack/vitest.config.ts +20 -0
- package/apps/cf-worker/package.json +1 -1
- package/apps/cf-worker/wrangler.toml +25 -0
- package/apps/local-cli/package.json +1 -1
- package/apps/local-cli/src/config-loader.ts +56 -0
- package/apps/local-cli/src/server.ts +241 -32
- package/apps/local-cli/tests/config-loader.test.ts +107 -0
- package/apps/local-cli/tests/e2e.test.ts +74 -0
- package/apps/local-cli/tests/security-e2e.test.ts +239 -0
- package/biome.json +3 -1
- package/dashboards/cloudwatch-irc.json +139 -0
- package/docs/AWS-Adapter-Architecture.md +494 -0
- package/docs/AWS-Deployment.md +1107 -0
- package/docs/Cloudflare-Deployment-Guide.md +660 -0
- package/docs/Home.md +1 -0
- package/docs/Observability.md +87 -0
- package/docs/PlanIRCv3Websocket.md +489 -0
- package/docs/PlanWebClient.md +451 -0
- package/docs/Release-Process.md +440 -0
- package/package.json +8 -2
- package/packages/aws-adapter/README.md +35 -0
- package/packages/aws-adapter/package.json +52 -0
- package/packages/aws-adapter/src/aws-runtime.ts +783 -0
- package/packages/aws-adapter/src/cdk-table-defs.ts +69 -0
- package/packages/aws-adapter/src/config-loader.ts +96 -0
- package/packages/aws-adapter/src/dynamo.ts +61 -0
- package/packages/aws-adapter/src/handlers/connect.ts +44 -0
- package/packages/aws-adapter/src/handlers/default.ts +322 -0
- package/packages/aws-adapter/src/handlers/disconnect.ts +29 -0
- package/packages/aws-adapter/src/handlers/index.ts +248 -0
- package/packages/aws-adapter/src/handlers/ping-checker.ts +217 -0
- package/packages/aws-adapter/src/handlers/state.ts +13 -0
- package/packages/aws-adapter/src/handlers/sweeper.ts +84 -0
- package/packages/aws-adapter/src/index.ts +67 -0
- package/packages/aws-adapter/src/message-store.ts +34 -0
- package/packages/aws-adapter/src/serialize.ts +283 -0
- package/packages/aws-adapter/src/tables.ts +53 -0
- package/packages/aws-adapter/tests/aws-harness.ts +408 -0
- package/packages/aws-adapter/tests/aws-integration.test.ts +17 -0
- package/packages/aws-adapter/tests/aws-runtime.test.ts +654 -0
- package/packages/aws-adapter/tests/config-loader.test.ts +158 -0
- package/packages/aws-adapter/tests/dynamo.test.ts +57 -0
- package/packages/aws-adapter/tests/global-setup.ts +301 -0
- package/packages/aws-adapter/tests/gone-exception.test.ts +271 -0
- package/packages/aws-adapter/tests/handlers.test.ts +427 -0
- package/packages/aws-adapter/tests/message-store.test.ts +55 -0
- package/packages/aws-adapter/tests/ping-checker.test.ts +571 -0
- package/packages/aws-adapter/tests/serialize.test.ts +249 -0
- package/packages/aws-adapter/tests/smoke.test.ts +48 -0
- package/packages/aws-adapter/tests/sweeper.test.ts +420 -0
- package/packages/aws-adapter/tests/tables.test.ts +74 -0
- package/packages/aws-adapter/tests/transactions.test.ts +446 -0
- package/packages/aws-adapter/tsconfig.build.json +16 -0
- package/packages/aws-adapter/tsconfig.test.json +14 -0
- package/packages/aws-adapter/vitest.config.ts +23 -0
- package/packages/cf-adapter/package.json +2 -1
- package/packages/cf-adapter/src/config-loader.ts +106 -0
- package/packages/cf-adapter/src/connection-do.ts +34 -0
- package/packages/cf-adapter/tests/cf-harness.ts +2 -2
- package/packages/cf-adapter/tests/cf-integration.test.ts +2 -2
- package/packages/cf-adapter/tests/config-loader.test.ts +149 -0
- package/packages/cf-adapter/tests/connection-do.test.ts +42 -0
- package/packages/in-memory-runtime/package.json +1 -1
- package/packages/in-memory-runtime/src/in-memory-runtime.ts +108 -3
- package/packages/in-memory-runtime/src/index.ts +1 -1
- package/packages/in-memory-runtime/tests/in-memory-runtime.test.ts +115 -0
- package/packages/irc-core/package.json +12 -2
- package/packages/irc-core/src/admission.ts +216 -0
- package/packages/irc-core/src/caps/capabilities.ts +1 -0
- package/packages/irc-core/src/cloak.ts +81 -0
- package/packages/irc-core/src/commands/cap.ts +1 -2
- package/packages/irc-core/src/commands/chathistory.ts +305 -0
- package/packages/irc-core/src/commands/index.ts +7 -0
- package/packages/irc-core/src/commands/join.ts +59 -7
- package/packages/irc-core/src/commands/privmsg.ts +24 -0
- package/packages/irc-core/src/commands/registration.ts +71 -14
- package/packages/irc-core/src/commands/sasl.ts +251 -0
- package/packages/irc-core/src/config.ts +247 -0
- package/packages/irc-core/src/flood-control.ts +175 -0
- package/packages/irc-core/src/index.ts +5 -0
- package/packages/irc-core/src/ports.ts +655 -0
- package/packages/irc-core/src/protocol/base64.ts +16 -0
- package/packages/irc-core/src/protocol/index.ts +2 -1
- package/packages/irc-core/src/protocol/numerics.ts +11 -0
- package/packages/irc-core/src/protocol/parser.ts +27 -2
- package/packages/irc-core/src/state/connection.ts +41 -0
- package/packages/irc-core/src/types.ts +66 -2
- package/packages/irc-core/stryker.commands.conf.json +41 -0
- package/packages/irc-core/stryker.protocol.conf.json +26 -0
- package/packages/irc-core/tests/admission.test.ts +229 -0
- package/packages/irc-core/tests/caps/capabilities.test.ts +22 -0
- package/packages/irc-core/tests/cloak.test.ts +78 -0
- package/packages/irc-core/tests/commands/chathistory.test.ts +996 -0
- package/packages/irc-core/tests/commands/join.test.ts +246 -2
- package/packages/irc-core/tests/commands/privmsg.test.ts +146 -2
- package/packages/irc-core/tests/commands/registration.test.ts +277 -9
- package/packages/irc-core/tests/commands/sasl.test.ts +536 -0
- package/packages/irc-core/tests/config.test.ts +646 -0
- package/packages/irc-core/tests/flood-control.test.ts +394 -0
- package/packages/irc-core/tests/message-store.test.ts +530 -0
- package/packages/irc-core/tests/parser.test.ts +44 -1
- package/packages/irc-core/tests/ports.test.ts +263 -0
- package/packages/irc-server/package.json +1 -1
- package/packages/irc-server/src/actor.ts +162 -44
- package/packages/irc-server/src/dispatch.ts +89 -5
- package/packages/irc-server/src/index.ts +2 -0
- package/packages/irc-server/src/routing.ts +151 -0
- package/packages/irc-server/tests/actor.test.ts +470 -14
- package/packages/irc-server/tests/dispatch.test.ts +84 -0
- package/packages/irc-server/tests/routing.test.ts +201 -0
- package/packages/irc-test-support/README.md +32 -0
- package/packages/irc-test-support/package.json +37 -0
- package/packages/{cf-adapter/tests/integration → irc-test-support/src}/in-memory-harness.ts +1 -1
- package/packages/irc-test-support/src/index.ts +24 -0
- package/packages/{cf-adapter/tests/integration/harness.test.ts → irc-test-support/tests/in-memory-harness.test.ts} +1 -1
- package/packages/{cf-adapter/tests/integration/scenarios.test.ts → irc-test-support/tests/in-memory-scenarios.test.ts} +1 -2
- package/packages/irc-test-support/tests/smoke.test.ts +11 -0
- package/packages/irc-test-support/tsconfig.build.json +16 -0
- package/packages/irc-test-support/tsconfig.test.json +14 -0
- package/packages/irc-test-support/vitest.config.ts +20 -0
- package/progress.md +107 -0
- package/tickets.md +2485 -0
- package/tools/ci-hardening/package.json +30 -0
- package/tools/ci-hardening/src/index.ts +6 -0
- package/tools/ci-hardening/src/validate.ts +103 -0
- package/tools/ci-hardening/tests/__no_thresholds__.txt +11 -0
- package/tools/ci-hardening/tests/__partial_thresholds__.txt +16 -0
- package/tools/ci-hardening/tests/__stryker_bad__.json +4 -0
- package/tools/ci-hardening/tests/validate.test.ts +177 -0
- package/tools/ci-hardening/tsconfig.build.json +12 -0
- package/tools/ci-hardening/tsconfig.test.json +10 -0
- package/tools/ci-hardening/vitest.config.ts +21 -0
- package/tools/tcp-ws-forwarder/package.json +1 -1
- package/tools/tcp-ws-forwarder/src/forwarder.ts +34 -23
- package/tools/tcp-ws-forwarder/src/logger.ts +155 -0
- package/tools/tcp-ws-forwarder/src/main.ts +33 -14
- package/tools/tcp-ws-forwarder/tests/forwarder.test.ts +86 -0
- package/tools/tcp-ws-forwarder/tests/logger.test.ts +136 -0
- package/webircgateway/LICENSE +201 -0
- package/webircgateway/Makefile +44 -0
- package/webircgateway/README.md +134 -0
- package/webircgateway/config.conf.example +135 -0
- package/webircgateway/go.mod +16 -0
- package/webircgateway/go.sum +89 -0
- package/webircgateway/main.go +118 -0
- package/webircgateway/pkg/dnsbl/dnsbl.go +121 -0
- package/webircgateway/pkg/identd/identd.go +86 -0
- package/webircgateway/pkg/identd/rpcclient.go +59 -0
- package/webircgateway/pkg/irc/isupport.go +56 -0
- package/webircgateway/pkg/irc/message.go +217 -0
- package/webircgateway/pkg/irc/state.go +79 -0
- package/webircgateway/pkg/proxy/proxy.go +129 -0
- package/webircgateway/pkg/proxy/server.go +237 -0
- package/webircgateway/pkg/recaptcha/recaptcha.go +59 -0
- package/webircgateway/pkg/webircgateway/client.go +741 -0
- package/webircgateway/pkg/webircgateway/client_command_handlers.go +495 -0
- package/webircgateway/pkg/webircgateway/config.go +385 -0
- package/webircgateway/pkg/webircgateway/gateway.go +278 -0
- package/webircgateway/pkg/webircgateway/gateway_utils.go +133 -0
- package/webircgateway/pkg/webircgateway/hooks.go +152 -0
- package/webircgateway/pkg/webircgateway/letsencrypt.go +41 -0
- package/webircgateway/pkg/webircgateway/messagetags.go +103 -0
- package/webircgateway/pkg/webircgateway/transport_kiwiirc.go +206 -0
- package/webircgateway/pkg/webircgateway/transport_sockjs.go +107 -0
- package/webircgateway/pkg/webircgateway/transport_tcp.go +113 -0
- package/webircgateway/pkg/webircgateway/transport_websocket.go +126 -0
- package/webircgateway/pkg/webircgateway/utils.go +147 -0
- package/webircgateway/plugins/example/plugin.go +11 -0
- package/webircgateway/plugins/stats/plugin.go +52 -0
- package/webircgateway/staticcheck.conf +1 -0
- package/webircgateway/webircgateway.svg +3 -0
- package/packages/cf-adapter/tests/integration/index.ts +0 -17
- /package/packages/{cf-adapter/tests/integration → irc-test-support/src}/harness.ts +0 -0
- /package/packages/{cf-adapter/tests/integration → irc-test-support/src}/scenarios.ts +0 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# Release Process
|
|
2
|
+
|
|
3
|
+
End-to-end runbook for cutting, publishing, and rolling back a
|
|
4
|
+
ServerlessIRCd release. This is the canonical process — every release
|
|
5
|
+
follows this document top-to-bottom.
|
|
6
|
+
|
|
7
|
+
**Distribution model.** All workspace packages are `"private": true`. A
|
|
8
|
+
release is a **signed git tag** plus a **GitHub Release** whose body is
|
|
9
|
+
copied from `CHANGELOG.md`. There is no npm publish step in 0.x. See
|
|
10
|
+
§10 (Future: npm publish) for the criteria that would flip that on.
|
|
11
|
+
|
|
12
|
+
**Current cadence.** 0.x is "tag when ready" — there is no fixed
|
|
13
|
+
calendar release. Anyone with push rights may propose a release by
|
|
14
|
+
opening a PR that bumps versions and updates `CHANGELOG.md`; the
|
|
15
|
+
maintainer team cuts the tag.
|
|
16
|
+
|
|
17
|
+
Cross-reference: `README.md` (Roadmap), `progress.md` / `tickets.md`
|
|
18
|
+
(release content), `docs/deployment-cf.md` (prod deploy step §6),
|
|
19
|
+
`.github/workflows/ci.yml`, `.github/workflows/deploy-cf.yml`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 1. Versioning
|
|
24
|
+
|
|
25
|
+
ServerlessIRCd follows [Semantic Versioning](https://semver.org/) with
|
|
26
|
+
the 0.x convention:
|
|
27
|
+
|
|
28
|
+
| Bump | When |
|
|
29
|
+
|-------------|-----------------------------------------------------------------|
|
|
30
|
+
| `0.x.0 → 0.(x+1).0` | Any user-visible behavior change, new command/cap, new adapter, schema change to persisted DO state. |
|
|
31
|
+
| `0.x.y → 0.x.(y+1)`* | Internal-only fixes: tests, docs, refactors that don't change runtime behavior, perf work with identical output. (*Reserved for after 1.0; in 0.x every change is allowed to be a minor.) |
|
|
32
|
+
| `1.0.0` | The Cloudflare **and** AWS adapters are deployed to staging, the parametrized contract suite passes on both, ≥3 reference clients connect cleanly (PLAN §9 exit criteria). |
|
|
33
|
+
|
|
34
|
+
**The 0.x disclaimer.** Per SemVer 0.x, anything may change at any
|
|
35
|
+
minor bump. Consumers of `@serverless-ircd/*` packages (today: only
|
|
36
|
+
this repo itself) should pin exact versions.
|
|
37
|
+
|
|
38
|
+
### 1.1 Workspace version lock
|
|
39
|
+
|
|
40
|
+
All eight `package.json` files (root + 7 workspace packages) carry the
|
|
41
|
+
**same** version string. They are bumped together in the release
|
|
42
|
+
commit. The pre-release checklist in §4 enforces this.
|
|
43
|
+
|
|
44
|
+
Rationale: even though the packages are private today, keeping a single
|
|
45
|
+
version simplifies future npm publishing, release notes, and
|
|
46
|
+
bug-report triage ("what version are you on?" has one answer).
|
|
47
|
+
|
|
48
|
+
### 1.2 Persisted-state schema
|
|
49
|
+
|
|
50
|
+
A change to `PERSISTED_STATE_VERSION` in
|
|
51
|
+
`packages/cf-adapter/src/serialize.ts` (or any equivalent versioned
|
|
52
|
+
blob in a future adapter) is a **minor bump minimum**, and requires a
|
|
53
|
+
migration entry in `CHANGELOG.md` under a **⚠️ Migration required**
|
|
54
|
+
heading. See §9 (Rollback) for why rollback across such a bump is
|
|
55
|
+
not always possible.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 2. Roles & permissions
|
|
60
|
+
|
|
61
|
+
| Role | Who has it today | Required for |
|
|
62
|
+
|-----------------------------|--------------------------|---------------------------------------|
|
|
63
|
+
| Push to `main` | Maintainers | Merging the release PR. |
|
|
64
|
+
| Push tags (`v*`) | Maintainers | `git push origin v0.x.0`. |
|
|
65
|
+
| Create GitHub Release | Maintainers | Publishing the release notes. |
|
|
66
|
+
| `CLOUDFLARE_API_TOKEN` secret | Repo Settings → Secrets | Local prod deploys. CI staging deploys. |
|
|
67
|
+
| `CF_SMOKE_URL` variable | Repo Settings → Variables | Staging smoke e2e in CI. |
|
|
68
|
+
|
|
69
|
+
There is no separate "release engineer" role. The maintainer who cuts
|
|
70
|
+
the tag owns the release end-to-end, including the production deploy
|
|
71
|
+
and the post-release smoke check.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 3. Branch & tag conventions
|
|
76
|
+
|
|
77
|
+
- **Releases are cut from `main`.** No release branches in 0.x.
|
|
78
|
+
- **Tags** are annotated, signed where possible, formatted `v<semver>`
|
|
79
|
+
(e.g. `v0.1.0`, `v0.1.1`, `v1.0.0-rc.1`).
|
|
80
|
+
- **Pre-release tags** use SemVer suffixes: `v0.2.0-rc.1`,
|
|
81
|
+
`v1.0.0-beta.3`. GitHub marks the release as a pre-release
|
|
82
|
+
automatically based on the suffix.
|
|
83
|
+
- The release commit message is `chore(release): vX.Y.Z` (matches the
|
|
84
|
+
tag).
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 4. Pre-release checklist
|
|
89
|
+
|
|
90
|
+
Run every box before tagging. Most are verifiable from the repo root.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 0. Sanity: clean tree on main, up to date with origin.
|
|
94
|
+
git status # working tree clean
|
|
95
|
+
git checkout main
|
|
96
|
+
git pull --ff-only origin main
|
|
97
|
+
|
|
98
|
+
# 1. All desired work merged. No pending tickets targeted for this release.
|
|
99
|
+
# Cross-check progress.md — every ticket listed under this release is ✅.
|
|
100
|
+
|
|
101
|
+
# 2. CI is green on the tip of main.
|
|
102
|
+
# Open: https://github.com/<owner>/<repo>/actions
|
|
103
|
+
# - CI workflow: lint / typecheck / coverage all green.
|
|
104
|
+
# - deploy-cf workflow: staging deploy + smoke e2e green.
|
|
105
|
+
|
|
106
|
+
# 3. Local full verify.
|
|
107
|
+
pnpm install --frozen-lockfile
|
|
108
|
+
pnpm lint # biome check .
|
|
109
|
+
pnpm typecheck # tsc --noEmit across workspace
|
|
110
|
+
pnpm test # full suite
|
|
111
|
+
pnpm build # every package produces dist/
|
|
112
|
+
|
|
113
|
+
# 4. Coverage gate.
|
|
114
|
+
# NOTE: the 90% coverage gate (TICKET-048) is not yet wired in CI.
|
|
115
|
+
# Until it lands, manually inspect packages/*/coverage/ for regressions
|
|
116
|
+
# vs. the previous release. Any drop > 2 percentage points blocks the
|
|
117
|
+
# release unless explicitly justified in CHANGELOG.md.
|
|
118
|
+
|
|
119
|
+
# 5. Staging smoke e2e passes against the deployed tip-of-main.
|
|
120
|
+
node apps/cf-worker/scripts/smoke.mjs \
|
|
121
|
+
--url wss://serverless-ircd-staging.<subdomain>.workers.dev
|
|
122
|
+
|
|
123
|
+
# 6. CHANGELOG.md is complete and accurate (§5).
|
|
124
|
+
# 7. All package.json versions are bumped and lock-step (§6).
|
|
125
|
+
# 8. The Release PR is merged (§7).
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
If any box fails, **stop**. Fix forward on `main` and restart the
|
|
129
|
+
checklist — do not tag over a broken tip.
|
|
130
|
+
|
|
131
|
+
### 4.1 What is explicitly out of scope for a 0.x release
|
|
132
|
+
|
|
133
|
+
- AWS adapter (TICKET-039 through TICKET-044).
|
|
134
|
+
- SASL authentication (TICKET-026).
|
|
135
|
+
- Flood control (TICKET-028).
|
|
136
|
+
- Server password / rate limits / cloaking (TICKET-046).
|
|
137
|
+
- Config loader (TICKET-047).
|
|
138
|
+
- CI coverage gate ≥90% (TICKET-048).
|
|
139
|
+
|
|
140
|
+
These belong in a later 0.x release. Their absence is **not** a
|
|
141
|
+
blocker and should be called out under "Known limitations" in the
|
|
142
|
+
GitHub Release body.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 5. Writing `CHANGELOG.md`
|
|
147
|
+
|
|
148
|
+
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), newest
|
|
149
|
+
entry first. One `## [X.Y.Z] - YYYY-MM-DD` section per release.
|
|
150
|
+
|
|
151
|
+
Categories (use only what applies):
|
|
152
|
+
|
|
153
|
+
- **Added** — new features, commands, caps, adapters.
|
|
154
|
+
- **Changed** — behavior changes in existing functionality.
|
|
155
|
+
- **⚠️ Migration required** — anything that needs operator action on
|
|
156
|
+
upgrade (DO schema bumps, persisted-state version bumps, config
|
|
157
|
+
shape changes). One bullet per action item.
|
|
158
|
+
- **Deprecated** — functionality scheduled for removal.
|
|
159
|
+
- **Removed** — functionality removed in this release.
|
|
160
|
+
- **Fixed** — bug fixes.
|
|
161
|
+
- **Security** — vulnerability fixes (also request a CVE).
|
|
162
|
+
- **Known limitations** — explicit "not in this release" list so
|
|
163
|
+
operators aren't surprised.
|
|
164
|
+
|
|
165
|
+
Source material for the entry:
|
|
166
|
+
|
|
167
|
+
1. `progress.md` — the ticket table. Every `✅` row since the previous
|
|
168
|
+
release tag is a candidate bullet.
|
|
169
|
+
2. `tickets.md` — the per-ticket **Description** field, for the prose.
|
|
170
|
+
3. `git log v<previous>..HEAD --oneline` — for fixes that don't have a
|
|
171
|
+
ticket.
|
|
172
|
+
|
|
173
|
+
Group by user-facing theme (Registration, Channel ops, IRCv3,
|
|
174
|
+
Cloudflare adapter, …) rather than by ticket number. Operators read
|
|
175
|
+
themes; developers cross-reference tickets.
|
|
176
|
+
|
|
177
|
+
Rule of thumb: a new operator reading only `CHANGELOG.md` should
|
|
178
|
+
understand what changed and what they need to do.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 6. Bumping versions
|
|
183
|
+
|
|
184
|
+
There are eight `package.json` files. They must end up at the same
|
|
185
|
+
version:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
./package.json (workspace root)
|
|
189
|
+
packages/irc-core/package.json
|
|
190
|
+
packages/irc-server/package.json
|
|
191
|
+
packages/in-memory-runtime/package.json
|
|
192
|
+
packages/cf-adapter/package.json
|
|
193
|
+
apps/local-cli/package.json
|
|
194
|
+
apps/cf-worker/package.json
|
|
195
|
+
tools/tcp-ws-forwarder/package.json
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
To cut `v0.X.Y`:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# from the repo root, on a fresh branch off main:
|
|
202
|
+
git checkout -b release/v0.X.Y
|
|
203
|
+
|
|
204
|
+
# bump each file. The version field is the only change.
|
|
205
|
+
# (Optional helper: `pnpm -r exec -- node -e '...'` if you script it.)
|
|
206
|
+
|
|
207
|
+
# verify all eight files agree:
|
|
208
|
+
rg '"version":' package.json packages/*/package.json apps/*/package.json tools/*/package.json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The lockfile (`pnpm-lock.yaml`) is unaffected — none of the workspace
|
|
212
|
+
dependencies are version-pinned to the workspace root.
|
|
213
|
+
|
|
214
|
+
Do **not** run `pnpm publish` or `npm version` — those are for npm
|
|
215
|
+
distribution, which is not the current model.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 7. The release PR
|
|
220
|
+
|
|
221
|
+
The release PR contains **exactly two files changed**:
|
|
222
|
+
|
|
223
|
+
1. `CHANGELOG.md` (new entry under the version being cut).
|
|
224
|
+
2. Every `package.json` listed in §6 (version bump).
|
|
225
|
+
|
|
226
|
+
Nothing else. If a code change is needed for the release, it lands in
|
|
227
|
+
a separate PR first and the release PR is opened only after that PR
|
|
228
|
+
merges.
|
|
229
|
+
|
|
230
|
+
**PR title:** `chore(release): v0.X.Y`
|
|
231
|
+
**PR body:**
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
This cuts v0.X.Y. See CHANGELOG.md for the full diff vs. v0.W.Z.
|
|
235
|
+
|
|
236
|
+
Pre-release checklist: docs/release.md §4 — all green.
|
|
237
|
+
Out-of-scope tickets: docs/release.md §4.1.
|
|
238
|
+
|
|
239
|
+
After merge: tag + GitHub Release + manual prod deploy per
|
|
240
|
+
docs/release.md §8.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
The PR is squash-merged with the same title as the commit message.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 8. Cutting the release
|
|
248
|
+
|
|
249
|
+
Run **immediately** after the release PR merges, so the tag points at
|
|
250
|
+
the exact commit the changelog describes.
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
git checkout main
|
|
254
|
+
git pull --ff-only origin main
|
|
255
|
+
|
|
256
|
+
# Confirm the tip commit is the squashed release PR.
|
|
257
|
+
git log -1 --oneline # expect: chore(release): v0.X.Y
|
|
258
|
+
|
|
259
|
+
# Confirm versions are at the new release.
|
|
260
|
+
rg '"version":' package.json packages/*/package.json apps/*/package.json tools/*/package.json
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 8.1 Tag and push
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
git tag -a v0.X.Y -m "v0.X.Y"
|
|
267
|
+
git push origin v0.X.Y
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Annotated (`-a`) tags carry tagger + date + message; use them over
|
|
271
|
+
lightweight tags. Sign with `-s` if you have a GPG / SSH signing key
|
|
272
|
+
configured (`git config tag.gpgSign true`).
|
|
273
|
+
|
|
274
|
+
### 8.2 Create the GitHub Release
|
|
275
|
+
|
|
276
|
+
1. <https://github.com/<owner>/<repo>/releases/new> → choose the tag
|
|
277
|
+
just pushed.
|
|
278
|
+
2. **Title:** `v0.X.Y` (matches the tag, nothing fancier).
|
|
279
|
+
3. **Body:** paste the matching section from `CHANGELOG.md`. Strip the
|
|
280
|
+
`## [X.Y.Z] - YYYY-MM-DD` heading line (it's redundant with the
|
|
281
|
+
release title).
|
|
282
|
+
4. **Set as latest release** unless this is a pre-release. Pre-release
|
|
283
|
+
tags (`-rc.N`, `-beta.N`, etc.) get the "Set as a pre-release"
|
|
284
|
+
checkbox instead.
|
|
285
|
+
5. **Publish release.**
|
|
286
|
+
|
|
287
|
+
### 8.3 Production deploy (manual)
|
|
288
|
+
|
|
289
|
+
There is **no CI auto-deploy to production**. The maintainer runs the
|
|
290
|
+
prod deploy by hand, from a clean checkout on the tag:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
git checkout v0.X.Y
|
|
294
|
+
|
|
295
|
+
# Sanity-check the tag matches the released commit.
|
|
296
|
+
git log -1 --oneline # expect: chore(release): v0.X.Y
|
|
297
|
+
|
|
298
|
+
pnpm install --frozen-lockfile
|
|
299
|
+
pnpm build
|
|
300
|
+
pnpm typecheck
|
|
301
|
+
pnpm test
|
|
302
|
+
|
|
303
|
+
# Deploy the Cloudflare Worker to production.
|
|
304
|
+
pnpm deploy:cf:prod
|
|
305
|
+
# → wrangler deploy (default env = production)
|
|
306
|
+
|
|
307
|
+
# Tail prod logs while the first connections arrive.
|
|
308
|
+
npx wrangler tail
|
|
309
|
+
|
|
310
|
+
# Smoke-check prod with the same script CI uses on staging.
|
|
311
|
+
# You must point it at the prod wss:// URL:
|
|
312
|
+
node apps/cf-worker/scripts/smoke.mjs \
|
|
313
|
+
--url wss://<prod-workers-subdomain>.workers.dev
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
If smoke fails on prod:
|
|
317
|
+
|
|
318
|
+
1. **Do not roll forward blindly.** Tail logs, identify the regression.
|
|
319
|
+
2. If a rollback is required, follow §9.
|
|
320
|
+
3. If the regression is in the *deployed Worker code* (not the
|
|
321
|
+
protocol core), a hotfix follows the same process as a normal
|
|
322
|
+
release (new patch / minor → tag → GitHub Release → prod deploy).
|
|
323
|
+
|
|
324
|
+
### 8.4 Announce
|
|
325
|
+
|
|
326
|
+
- Update `progress.md` Status header (if a "current release" marker
|
|
327
|
+
was added there) — not currently present, optional.
|
|
328
|
+
- Open an issue with the body "v0.X.Y released" if external tracking
|
|
329
|
+
is desired. (Not currently wired to any external channel.)
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## 9. Rollback
|
|
334
|
+
|
|
335
|
+
There are two independent rollback axes: **code** and **data**.
|
|
336
|
+
|
|
337
|
+
### 9.1 Code rollback
|
|
338
|
+
|
|
339
|
+
To redeploy a previous release:
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
git checkout v0.W.Z # the previous tag
|
|
343
|
+
pnpm install --frozen-lockfile
|
|
344
|
+
pnpm build
|
|
345
|
+
pnpm deploy:cf:prod
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
This works as long as the previous release's code is compatible with
|
|
349
|
+
the persisted DO state shape (see 9.2).
|
|
350
|
+
|
|
351
|
+
There is no in-CI "prod rollback" workflow. The maintainer runs the
|
|
352
|
+
commands above from a checkout.
|
|
353
|
+
|
|
354
|
+
### 9.2 Data rollback (persisted DO state)
|
|
355
|
+
|
|
356
|
+
**Persisted-state version is one-way.** Once
|
|
357
|
+
`packages/cf-adapter/src/serialize.ts` ships a new
|
|
358
|
+
`PERSISTED_STATE_VERSION`, old code reading new blobs will reject
|
|
359
|
+
them, and new code reading old blobs may or may not migrate them
|
|
360
|
+
depending on whether a forward migration was shipped alongside.
|
|
361
|
+
|
|
362
|
+
Rules of thumb:
|
|
363
|
+
|
|
364
|
+
- If the release's `CHANGELOG.md` has **no ⚠️ Migration required**
|
|
365
|
+
entry, code rollback to the previous tag is safe — DO storage is
|
|
366
|
+
forward- and backward-compatible.
|
|
367
|
+
- If it **does** have a migration entry, assume code rollback will
|
|
368
|
+
not work without losing or transforming state. The migration entry
|
|
369
|
+
in `CHANGELOG.md` must spell out the recovery procedure.
|
|
370
|
+
|
|
371
|
+
In a catastrophic prod failure where the new version's migration
|
|
372
|
+
already ran, the path forward is:
|
|
373
|
+
|
|
374
|
+
1. Freeze new connections (set `MOTD_LINES` to a maintenance banner,
|
|
375
|
+
or block at the edge with a Route rule).
|
|
376
|
+
2. Decide: fix forward on the new code, or wipe staging-state (NOT
|
|
377
|
+
prod-state) and re-test the migration offline.
|
|
378
|
+
3. **Production DO namespaces must never be deleted** — the data is
|
|
379
|
+
gone permanently (per `docs/deployment-cf.md` §12.1).
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## 10. Future: npm publish
|
|
384
|
+
|
|
385
|
+
When `@serverless-ircd/irc-core` becomes the first package consumers
|
|
386
|
+
outside this repo depend on (likely: the in-memory runtime is pulled
|
|
387
|
+
into a third-party test harness, or someone ships an alternate
|
|
388
|
+
adapter), the following gates apply before flipping `"private": false`:
|
|
389
|
+
|
|
390
|
+
1. **Public API audit.** Every export from `src/index.ts` is one we're
|
|
391
|
+
willing to support across a minor. Anything experimental goes under
|
|
392
|
+
a `/internal` subpath.
|
|
393
|
+
2. **Stable type surface.** No `any`, no `@ts-expect-error` in the
|
|
394
|
+
public surface, no `exactOptionalPropertyTypes` surprises.
|
|
395
|
+
3. **README per package**, not just the root.
|
|
396
|
+
4. **`CHANGELOG.md` is already disciplined** (Keep a Changelog format,
|
|
397
|
+
one section per version, dated).
|
|
398
|
+
5. **CI coverage gate ≥90%** (TICKET-048) is wired and green.
|
|
399
|
+
6. **Provenance & provenanced verification** — npm publish from CI
|
|
400
|
+
with Sigstore signatures, not a local laptop.
|
|
401
|
+
|
|
402
|
+
At that point this document grows a §11 "Publishing to npm" with
|
|
403
|
+
`pnpm -r publish --filter @serverless-ircd/irc-core --access public`
|
|
404
|
+
and a new `publish.yml` workflow. The git-tag-plus-GitHub-Release flow
|
|
405
|
+
above stays unchanged — npm publish becomes an *additional* step, not
|
|
406
|
+
a replacement.
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## 11. Quick reference: cutting v0.X.Y
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
# 1. Pre-release checklist (docs/release.md §4).
|
|
414
|
+
git checkout main && git pull --ff-only origin main
|
|
415
|
+
pnpm install --frozen-lockfile
|
|
416
|
+
pnpm lint && pnpm typecheck && pnpm test && pnpm build
|
|
417
|
+
|
|
418
|
+
# 2. Branch, bump versions + CHANGELOG, open PR (§6, §7).
|
|
419
|
+
git checkout -b release/v0.X.Y
|
|
420
|
+
# ... edit 8 × package.json + CHANGELOG.md ...
|
|
421
|
+
git commit -am "chore(release): v0.X.Y"
|
|
422
|
+
git push -u origin release/v0.X.Y
|
|
423
|
+
# ... open PR, get it merged ...
|
|
424
|
+
|
|
425
|
+
# 3. Tag and push (§8.1).
|
|
426
|
+
git checkout main && git pull --ff-only origin main
|
|
427
|
+
git tag -a v0.X.Y -m "v0.X.Y"
|
|
428
|
+
git push origin v0.X.Y
|
|
429
|
+
|
|
430
|
+
# 4. GitHub Release (§8.2): paste CHANGELOG entry, publish.
|
|
431
|
+
|
|
432
|
+
# 5. Prod deploy (§8.3).
|
|
433
|
+
git checkout v0.X.Y
|
|
434
|
+
pnpm install --frozen-lockfile && pnpm build
|
|
435
|
+
pnpm deploy:cf:prod
|
|
436
|
+
node apps/cf-worker/scripts/smoke.mjs --url wss://<prod>.workers.dev
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Total wall-clock for a routine 0.x release: ~30 minutes including the
|
|
440
|
+
prod deploy and smoke check.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serverless-ircd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Serverless IRC daemon with a platform-agnostic core and Cloudflare Workers + AWS adapters",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -17,10 +17,16 @@
|
|
|
17
17
|
"lint": "biome check .",
|
|
18
18
|
"lint:fix": "biome check --write .",
|
|
19
19
|
"format": "biome format --write .",
|
|
20
|
+
"mutation:protocol": "pnpm --filter @serverless-ircd/irc-core mutation:protocol",
|
|
21
|
+
"mutation:commands": "pnpm --filter @serverless-ircd/irc-core mutation:commands",
|
|
22
|
+
"mutation": "pnpm run mutation:protocol && pnpm run mutation:commands",
|
|
20
23
|
"clean": "turbo run clean && rimraf node_modules",
|
|
21
24
|
"deploy:cf:staging": "pnpm --filter @serverless-ircd/cf-worker deploy:staging",
|
|
22
25
|
"deploy:cf:prod": "pnpm --filter @serverless-ircd/cf-worker deploy:prod",
|
|
23
|
-
"smoke:cf:staging": "pnpm --filter @serverless-ircd/cf-worker smoke:staging"
|
|
26
|
+
"smoke:cf:staging": "pnpm --filter @serverless-ircd/cf-worker smoke:staging",
|
|
27
|
+
"deploy:aws:staging": "pnpm --filter @serverless-ircd/aws-stack deploy:staging",
|
|
28
|
+
"deploy:aws:prod": "pnpm --filter @serverless-ircd/aws-stack deploy:prod",
|
|
29
|
+
"smoke:aws:staging": "pnpm --filter @serverless-ircd/aws-stack smoke:staging"
|
|
24
30
|
},
|
|
25
31
|
"devDependencies": {
|
|
26
32
|
"@biomejs/biome": "^1.9.0",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @serverless-ircd/aws-adapter
|
|
2
|
+
|
|
3
|
+
AWS Lambda + DynamoDB adapter implementing the `IrcRuntime` port.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
- `src/aws-runtime.ts` — `AwsRuntime` (`IrcRuntime` backed by DynamoDB +
|
|
8
|
+
`ApiGatewayManagementApi`).
|
|
9
|
+
- `src/serialize.ts` — marshal/unmarshal helpers between irc-core types
|
|
10
|
+
and DynamoDB rows.
|
|
11
|
+
- `src/dynamo.ts` — `DynamoDBDocumentClient` factory.
|
|
12
|
+
- `src/config-loader.ts` — Lambda env → `ParsedServerConfig`.
|
|
13
|
+
- `src/handlers/index.ts` — Lambda entry point dispatching on
|
|
14
|
+
`event.requestContext.routeKey` (`$connect` / `$disconnect` / `$default`).
|
|
15
|
+
- `src/tables.ts` — runtime-safe table metadata (`TABLE_KEYS`, `TablesConfig`).
|
|
16
|
+
- `src/cdk-table-defs.ts` — CDK-coupled `TABLE_DEFS` (re-exported from
|
|
17
|
+
`apps/aws-stack`, NOT from `index.ts` so the Lambda bundle excludes CDK).
|
|
18
|
+
|
|
19
|
+
## Running tests
|
|
20
|
+
|
|
21
|
+
The integration tests (`tests/aws-integration.test.ts`) require DynamoDB
|
|
22
|
+
Local. The vitest `globalSetup` boots it via one of:
|
|
23
|
+
|
|
24
|
+
1. **testcontainers** (Docker) — preferred for CI.
|
|
25
|
+
2. **DynamoDB Local JAR + Java** — dev fallback.
|
|
26
|
+
3. **Skip** — if neither is available, the integration `describe` blocks
|
|
27
|
+
are skipped via `describe.skipIf(!process.env.DDB_AVAILABLE)` and the
|
|
28
|
+
rest of the suite runs normally.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm --filter @serverless-ircd/aws-adapter test
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Coverage thresholds: 90/90/90/90 (lines/functions/branches/statements).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@serverless-ircd/aws-adapter",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "AWS Lambda + DynamoDB adapter: AwsRuntime implementing IrcRuntime + $connect/$disconnect/$default handlers",
|
|
6
|
+
"license": "BSD-3-Clause",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./cdk-table-defs": {
|
|
16
|
+
"types": "./dist/cdk-table-defs.d.ts",
|
|
17
|
+
"import": "./dist/cdk-table-defs.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.build.json",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.test.json --noEmit",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:watch": "vitest",
|
|
25
|
+
"coverage": "vitest run --coverage",
|
|
26
|
+
"clean": "rimraf dist coverage .tsbuildinfo .turbo"
|
|
27
|
+
},
|
|
28
|
+
"files": ["dist", "src", "README.md"],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@aws-sdk/client-apigatewaymanagementapi": "^3.682.0",
|
|
31
|
+
"@aws-sdk/client-dynamodb": "^3.682.0",
|
|
32
|
+
"@aws-sdk/lib-dynamodb": "^3.682.0",
|
|
33
|
+
"@aws-sdk/util-dynamodb": "^3.682.0",
|
|
34
|
+
"@serverless-ircd/irc-core": "workspace:*",
|
|
35
|
+
"@serverless-ircd/irc-server": "workspace:*"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@serverless-ircd/irc-test-support": "workspace:*",
|
|
39
|
+
"@types/node": "^26.1.1",
|
|
40
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
41
|
+
"aws-cdk-lib": "^2.160.0",
|
|
42
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
43
|
+
"constructs": "^10.4.0",
|
|
44
|
+
"rimraf": "^6.0.0",
|
|
45
|
+
"testcontainers": "^10.17.2",
|
|
46
|
+
"typescript": "^5.6.0",
|
|
47
|
+
"vitest": "^4.1.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20"
|
|
51
|
+
}
|
|
52
|
+
}
|