fix(graph)!: enforce the node and handler return contracts instead of failing silently

provide() and run() must return an object holding every token the node
provides. A provider that returned its value bare (return client rather
than return { db: client }) booted without complaint: the token was
undefined, and the client's own properties were spread over every
request's context. That now fails, naming the node and the fix:
- providers fail the boot;
- steps fail the request;
- plugin nodes are held to the same rule for each token in provides.

A handler that returned a Fetch Response was JSON-encoded and went out
as 200 {}, with its status, headers and body lost. It now fails the
request with a TypeError that points to a plain value, @Transformer or
HttpError. Sending a Response as is can be added later without
breaking anything; taking it back would not be possible.

The check stays synchronous for a synchronous node, so a plain step
adds no microtask. Fixed health tests whose providers returned {}.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-10-30 11:22:10 -05:00
1 parent 2744b225a5
commit 44c783439c
6 files changed
+224 -7

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ Deno.test('CARD-17 T1: /__ready__ 503 booting while a slow provider boots, /__li
class SlowDb {
async provide() {
await new Promise<void>((resolve) => (finish = resolve));
return {};
return { slowDb: {} };
}
}
@Module({ mountpoint: '/', controllers: [Ctl], providers: [SlowDb] })