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

Merged
chrnx merged 3 commits from fix/loud-node-and-response-contracts into develop 2026-10-31 01:29:59 +00:00
3 Commits
Author SHA1 Message Date
chrnx 06869e5f01 perf(graph): test a single provided token directly in the return-contract check
CI / dco (pull_request) Successful in 5s
CI / runtimes (bun) (pull_request) Successful in 49s
CI / build (pull_request) Successful in 1m15s
CI / runtimes (deno) (pull_request) Successful in 1m3s
CI / runtimes (edge) (pull_request) Successful in 49s
A @Provider or @Step provides one token, so the check no longer goes
through every() and its callback. On a 3-step pipeline the 4-round A/B
against the freeze commit showed -4.6% on Deno and -3.2% on Bun, both
outside the noise; with this change and 8 rounds every case overlaps.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-30 20:27:10 -05:00
chrnx c7f4a35008 docs(changelog): the node and handler return contracts are now enforced
CI / dco (pull_request) Successful in 4s
CI / runtimes (bun) (pull_request) Successful in 20s
CI / build (pull_request) Successful in 31s
CI / runtimes (edge) (pull_request) Successful in 23s
CI / runtimes (deno) (pull_request) Successful in 34s
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-30 11:23:01 -05:00
chrnx 44c783439c 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>
2026-10-30 11:22:10 -05:00