Skip to content

feat(mesh): serve tokens of an absent teapot degraded instead of failing the boot - #113

Merged
chrnx-dev merged 1 commit into
developfrom
feat/mesh-degraded-steps
Nov 30, 2026
Merged

chrnx-dev merged 1 commit into
developfrom
feat/mesh-degraded-steps

Conversation

@chrnx-dev

@chrnx-dev chrnx-dev commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #96 (supersedes #56). Stacked on #112: base is feat/mesh-parallel-boot-connect; GitHub retargets it to develop once #112 merges.

Behaviour

  • A local @needs token with no producer, while at least one teapot is absent at boot, becomes a degraded request-scope step: 503 + retry-after (from the late-retry backoff; none with reconnect: false, since nothing will retry). The boot goes on.
  • One warn per token at boot naming the token, the absent teapots and the did-you-mean hint, plus a mesh:degraded event.
  • A late teapot that exports the token fills it in: it serves again, with an info line and mesh:restored. Its other steps are still not added (graph fixed at boot, D15).
  • Once every late teapot has connected and none exports a degraded token, one error line says so (almost always a typo).
  • With every teapot connected at boot, an unknown token still fails the boot (typos stay boot errors).
  • A teapot that connected and later dropped already answered 503 + retry-after through the link; unchanged.

Owner decision (2026-11-30): request scope only. The mesh contributes virtual steps, never providers: a remote value can fail at registration, after it, or mid-request.

API

LifecycleEvent gains mesh:degraded and mesh:restored (api/index.api.md regenerated). Mesh events are within D19. MeshConfig.bootTimeoutMs docs and the README mesh section are updated; they used to say the boot fails.

Tests

  • Node (test/mesh/boot-retry.test.ts): the four tests that asserted a boot failure now assert the degraded 503. New ones: typo still fails when every teapot connected (with hint), late teapot restores the token (events in order), orphan error said once, no retry-after with reconnect: false.
  • Deno and Bun: degraded 503 + retry-after, then 200 after the teapot connects late.

Verified locally

lint (0 errors), format, complexity, typecheck, coverage, build, api:check, test:deno (71), test:bun (61), test:edge.

Benchmark: no request hot-path change (a degraded step is one closure check, and only on apps with an absent teapot), so no throughput bench was run.

Observability (owner, 2026-11-30): no per-request mesh:* event. While a token is degraded every request that needs it fails at once with 503, and each one is visible in request:end with that status; the state changes (mesh:degraded / mesh:restored) are the mesh events.

…ing the boot

A teapot absent at boot sent no manifest, so a local @needs on one of its
tokens failed the boot. Now, when a needed token has no producer and at least
one teapot is absent, the teacup registers a request-scope step for it that
answers 503 with retry-after, warns once (token, absent teapots, did-you-mean)
and emits mesh:degraded. A late teapot that exports the token fills it in
(mesh:restored); once every late teapot connected without it, one error says
so. With every teapot connected an unknown token still fails the boot.

Request scope only: the mesh contributes virtual steps, never providers,
because a remote value can fail at registration, after it, or mid-request.

New events mesh:degraded and mesh:restored (mesh surface, D19).

Closes #96

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
@chrnx-dev
chrnx-dev deleted the branch feat/mesh-parallel-boot-connect November 30, 2026 17:52
@chrnx-dev chrnx-dev closed this Nov 30, 2026
@chrnx-dev chrnx-dev reopened this Nov 30, 2026
@chrnx-dev
chrnx-dev changed the base branch from feat/mesh-parallel-boot-connect to develop November 30, 2026 17:52
@chrnx-dev chrnx-dev closed this Nov 30, 2026
@chrnx-dev chrnx-dev reopened this Nov 30, 2026
@chrnx-dev
chrnx-dev merged commit 80e1706 into develop Nov 30, 2026
5 checks passed
@chrnx-dev
chrnx-dev deleted the feat/mesh-degraded-steps branch November 30, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mesh: degraded remote steps (503 at runtime, not a boot failure)

1 participant