Commit Graph
29 Commits
Author SHA1 Message Date
chrnx e4a2047a1e docs: describe the shutdown deadline, and who owns it per runtime
Closes #18. The three places that still described close() without a timeout —
the createapp reference table, the README bullet and the dependency-injection
inline comment — now say that in-flight work gets 10 seconds, then a warning
and a force-close.

Also documents what #18 deliberately deferred, now that #15 has decided it.
runtimes.md gains the per-runtime story: app.close() is Node-only, the servers
serveDeno()/serveBun() return carry the same close({ timeoutMs }), and edge has
nothing to close. Including the row that matters — Node and Bun cut the
remainder after the deadline, Deno returns and lets the process end it — since
a deadline that means two things is worse than one that admits it.

createApp({ shutdownTimeoutMs }) from #19 gets its row in the options table.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-08-16 13:17:19 -05:00
chrnx 4aae9c3e71 chore(deps): bump nanoid to 3.3.18 in both lockfiles
CI / dco (pull_request) Successful in 4s
CI / build (pull_request) Successful in 33s
Clears Dependabot alert 26. The advisory is real but our exposure is not:
nanoid arrives through postcss, under tsup at the root and under astro in
website/, so it never ships. Production dependencies of the package are
reflect-metadata and nothing else, and `npm audit --omit=dev` was already
green. Reaching the bug needs control of the size argument passed to nanoid,
which postcss calls with a fixed length.

Fixing it anyway because the alert costs more to keep explaining than to
close, and an open badge trains us to skim Dependabot. The next advisory
should be the only one sitting there.

Dependabot files it under website/ as runtime scope because website/package.json
lists astro under dependencies and has no devDependencies at all. Moving them
would stop that mislabelling, but that is a separate change.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-08-12 14:09:22 -05:00
hgshreyas 8c781c1258 fix: treat non-positive connection limits as unlimited
Signed-off-by: hgshreyas <hgshreyas.cs24@bmsce.ac.in>
2026-08-10 16:14:07 +05:30
hgshreyas 9e5e5cffe9 feat: add concurrent connection limits
Signed-off-by: hgshreyas <hgshreyas.cs24@bmsce.ac.in>
2026-08-09 17:27:47 +05:30
chrnx 4f504eda11 Merge branch 'develop' into docs/observability-scope-and-analytics
CI / build (pull_request) Successful in 34s
2026-08-07 19:27:37 +00:00
chrnxandClaude Opus 5 3a8d93320d chore: clear the dependency advisories blocking CI
CI / build (pull_request) Successful in 33s
Both audit trees were failing, for unrelated reasons and with different fixes.

**Root — undici, high.** miniflare 4.20260730.0 (the newest stable) pulls
undici 7.28.0, and the advisory range is 7.0.0–7.28.0. `npm audit fix --force`
wants miniflare 5.20260801.1-alpha: a breaking major, and an alpha, to patch a
devDependency that never ships. undici 7.29.0 is outside the range, so pin it
through `overrides` instead — same approach already used for find-my-way and
hyperid.

**website — js-yaml, high.** Reached through Starlight. 4.3.1 carries the fix
and the bump is not breaking, so a plain `npm audit fix` covers it.

Verified: root and website audits both report 0 vulnerabilities; 357 tests
pass; `test:edge` still passes, which is the one that actually exercises
miniflare against the pinned undici; `docs:build` produces its 23 pages.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 14:22:43 -05:00
chrnxandClaude Opus 5 27f1d103ea docs(website): add privacy-friendly analytics to the docs site
CI / build (pull_request) Failing after 12s
GoatCounter via Starlight's `head` option, same site code as the marketing
site so /docs traffic lands in one dashboard and referrer paths stay
comparable. No cookies, no personal data, no consent banner, nothing to host.

Answers the one question we cannot answer today: do the articles convert into
documentation reads?

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 14:03:39 -05:00
chrnx fcd3df7022 docs(website): align guides with router behavior
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-08-02 21:11:08 -05:00
chrnx 3a56e656bd chore(deps): remediate security advisories
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-08-02 20:56:17 -05:00
chrnx b72883c2ed docs(runtimes): scope the parity claim to what the suite actually tests
CI / build (pull_request) Successful in 33s
The parity suite compares Node's listener against app.fetch inside Node
('Node is truth') — it does not exercise all four runtimes. Saying 'every
runtime ... enforced by a parity test suite' overstates it; the honest
version is that the others share the same app.fetch/app.upgrade core and
each has its own smoke tests. Also fixed the line crediting Node's
WebSocket support to serveDeno/serveBun — Node does it through listen().

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-17 10:27:36 -05:00
chrnx 489aa685bb docs: host the docs at green-tea.expressive-tea.io/docs
The site hangs off the expressive-tea.io cPanel as green-tea.expressive-tea.io.
A four-level docs.green-tea.expressive-tea.io subdomain reads badly and would
need its own AutoSSL cert (the *.expressive-tea.io wildcard stops one level
up). A /docs subfolder needs no extra host, DNS, or cert — it's a path — and
is what most projects do.

So the docs site now builds with base: '/docs' (its dist/ contents drop into
the subdomain's docs/ folder in cPanel), the 77 hard-coded content links are
prefixed, and the two hero actions Starlight doesn't rewrite are fixed by
hand. Verified: /docs/ serves, / 404s, no unprefixed internal href remains.
README points at the new docs URL.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-17 10:13:10 -05:00
chrnx c12be9a2f5 docs(site): document matcha, stop contradicting the transport rule, drop Node-only
The streaming guide argued with itself: the table said a plain return
streams by Accept while the section below it, added with the
explicit-transport change, said that same return is a 500. The prose got
swept, the table didn't.

Getting started said green-tea targets Node — true when written, wrong
since the Deno/Bun/edge adapters landed — and led with a manual install
even though matcha scaffolds a live app in two commands. matcha had no
page at all, so the CLI was invisible to anyone reading the docs.

site: pointed at green-tea.dev, which is the marketing site's domain; the
docs deploy to docs.green-tea.dev.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-17 09:29:04 -05:00
chrnx dba40b0c8b feat(mesh): heartbeat the link, and tell the truth when a teapot is gone
Three bugs, found by writing the tests for the status codes.

A teapot with a live control channel could never shut down. Control connections
were never registered with the stream registry, so server.close() sat waiting on
a connected teacup that had no reason to hang up, and app.close() never resolved.
Every other long-lived socket was already tracked; the control channel was the
one that skipped it.

A downed teapot answered 500 — after 30 seconds. sendRpc queued the frame on a
closed socket and waited out the full timeout for a verdict already known. It now
rejects immediately with 503: a dead upstream is not "this service broke", and the
status is what tells a caller it may retry and an operator where to look. An RPC
that times out on a *live* link is 504 — a slow teapot and a gone one are
different stories.

Heartbeat: each teacup pings its teapots (`mesh.heartbeatMs`, default 15s) and
closes a link after two unanswered rounds. This is what catches a half-open
connection, where the socket looks open with nobody home — otherwise a teacup only
learns on the next request. Ping/pong are mesh frames rather than WebSocket
protocol pings because Deno's and Bun's platform WebSocket does not expose
ws.ping(), so a protocol-level heartbeat could not work everywhere mesh runs.
Added to v1 while the wire still has no deployed peers; later it would be a
version bump that refuses every old peer.

The heartbeat's first close code was 1011, which silently did nothing: a *client*
may only send 1000 or 3000-4999, so it threw `invalid code` — and our neutral
close swallows throws, so the link stayed open while looking closed. 4011 mirrors
1011's meaning inside the application range.

Reconnect (and reconciling app-scope values, which survive their teapot from
cache) stays out — it is a post-beta spec of its own.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-15 23:32:45 -05:00
chrnx 9886e53747 feat(app): add app.ready() so introspection works on any app
inspect()/graph()/explain() are synchronous, but a mesh graph is not knowable
until its teapots have been asked, so on a mesh app they threw and the caller had
no way to fix it. Code holding an `App` could not tell which kind it had — the
Liskov complaint from the audit, and the last of it: fetch/upgrade stopped
throwing when the boot moved into the gate.

app.ready() resolves the graph and returns. On a mesh app it connects the
teapots; on every other app it is a no-op. So one shape works for both:

    await app.ready();
    app.graph();

which is what actually restores substitutability — a uniform protocol, not a type
that describes the asymmetry.

Deliberately not a full boot: it does not run provider factories. Resolving the
graph and being ready to serve are different things, and a devtool drawing a
diagram should not open your database connections. Serving boots them too and
shares the same memoized step, so ready() then fetch() resolves the graph once.

The guards stay — sync code cannot await network I/O — but the message names the
fix instead of describing the trap.

createApp hit 26 on the complexity gate with ready() added. Both boot stages had
their own copy of the same memoisation, so it collapses into one `once` helper
used by both, which is a smaller createApp than before this change.

Refs .specs/2026-07-15-green-tea-solid-audit (App/Mesh LSP)

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-15 23:00:14 -05:00
chrnx 34dbb32b2c docs(mesh): warn on shadowed remote routes, and tell the truth about mesh
Local routes are merged ahead of remote ones, so a local twin wins. That
precedence is worth keeping — your own code beating an imported one is how you
override a teapot — but it was an accident of [...local, ...remote] ordering with
nothing said, so a shadowed export looked like a broken teapot from the outside.
Warn, name the teapot, and leave the call to the developer.

The docs had gone stale in the way that started all of this. runtimes.md claimed
four times that mesh is Node-only; the mesh guide said finalization is deferred to
listen(); the changelog said "WebSocket and mesh remain Node-only". All false now.

The mesh guide gains what was enforced but never written down — which is how the
listen() trap got made in the first place, when the previous plan's "document it"
never landed:
- runs on Node/Deno/Bun, teapot and teacup, any combination; not on edge, and why
- no listen() required: the graph boots on first use
- buffered routes only, and why streams cannot cross an RPC hop
- one teapot per route, local-over-remote precedence, and the protocol version

Refs .specs/2026-07-15-green-tea-mesh-cross-runtime-plan.md Task 9

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-15 16:20:55 -05:00
chrnx 922700674c fix(bus): emit step events for ws and mesh routes
Steps were executed by three separate hand-rolled loops: runPipeline (HTTP),
buildWsRoutes (ws) and resolveScope (mesh). Only the HTTP one emitted
request:step:enter/leave, so a logging plugin silently observed nothing on ws
routes — a gap in a documented public API, not just redundancy.

Route every transport through a single runSteps() so observability is uniform
by construction rather than by remembering to copy the emit calls.

Also fixes the plugins guide, which documented a request:step:exit event that
has never existed (the bus emits request:step:leave).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-15 14:37:03 -05:00
chrnx 76267b74ec docs(transport): reword homepage hero — declare @Sse to stream
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-10 16:07:01 -05:00
chrnx 2b646eaec6 docs(transport): reword stale implicit-streaming passages
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-10 16:06:02 -05:00
chrnx 535392baba docs(transport): declared-transport contract + @Html return contract
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-10 16:02:36 -05:00
chrnx 2d6306b318 docs(views): reference pages, guide footgun note, drop unused test import
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-10 14:58:56 -05:00
chrnx 289ca5f8ff docs(views): @Html, templating, and static serving guide
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-10 14:50:06 -05:00
chrnx cb4ecd6801 docs: edgeHandler — WebSocket on Cloudflare Workers / edge
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 23:45:27 -05:00
chrnx 3d21117a07 docs: serveBun — WebSocket on Bun
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 21:54:34 -05:00
chrnx 47b7bf5f24 docs: serveDeno + app.upgrade — WebSocket on Deno
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 17:27:26 -05:00
chrnx 58853e8ba8 docs: changelog for app.fetch + provider memoization, runtimes body-size note
Record the app.fetch Web-Standards handler and the app-scope provider
memoization behaviour change in the changelog, and note on the runtimes
guide that app.fetch reads oversized bodies fully before rejecting them
(unlike Node's mid-stream abort) so non-Node deployments should also
bound request size at the platform layer.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 14:45:34 -05:00
chrnx 1fee7de543 docs: app.fetch runtimes guide (Node/Deno/Bun/edge)
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 14:37:12 -05:00
chrnx 9d97443847 feat(brand): Green Tea. identity — logo, wordmark, branded graph & docs
CI / build (push) Has been cancelled
Ship the visual brand across the framework:
- assets/ (logo.svg, logo-mono.svg, logo.png), included in the npm files list
- README header: leaf mark + Green Tea. + tagline; package description aligned
- /__graph__ viewer header now shows the logo + Green Tea. wordmark (Zen Maru)
- website/ (Starlight): matcha accent, Zen Maru headings, logo, favicon, hero

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-09 13:33:04 -05:00
chrnx 2db5de6858 feat: per-route body limits, custom error rendering, OpenAPI generation
CI / build (push) Has been cancelled
Three capabilities that share the same request/route metadata:

- **Per-route upload limits** — `@Post('/x', { maxBodyBytes, maxParts })`
  overrides the server-wide `limits` for one route (falls back to the
  global default), mirroring the existing per-route `duplicates`.

- **Custom error rendering** — `createApp({ onError })` takes over how any
  error becomes a response (HTML, RFC 7807, content-negotiated), covering
  the whole surface: handler/step throws, 404, 405, 413, 400. Returns a
  response or undefined to fall back to the default JSON. Also wires the
  previously-unused `HttpError` `body` field so `throw new HttpError(409,
  'conflict', { code })` renders a structured payload. Default behavior is
  unchanged when no hook is set.

- **OpenAPI 3.1** — `app.openapi(info?)` projects the route graph into a
  structural spec (paths, methods, path/query/header params, request-body
  presence, systematic error responses); opt-in `GET /__openapi__` via
  `devOpenapi`. Body/response schemas stay generic (Standard Schema exposes
  no JSON Schema) — the full `@Produce` mode is post-beta.

Docs: new error-handling and OpenAPI guides, plus reference updates.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-08 08:29:17 -05:00
chrnx 654c0563fc docs: honest README + quickstart, and a Starlight documentation site
CI / build (pull_request) Has been cancelled
Bring the README in line with what shipped and fill the gaps a technical
reader comparing frameworks needs: the busboy peer dep and dual build, a
Routing section with its limits, an explicit "bring your own auth" scope
note, why legacy decorators is a design choice (not laziness), and CalVer
beta versioning.

Add a full Astro Starlight docs site under website/ — getting started,
concepts, per-feature guides, and an API reference — migrated from the
tested quickstart so the examples stay accurate.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-07 12:02:17 -05:00