D7 predicted ~0.25% per step and called it invisible. Measured over a real
socket it is -3.9% on JSON hello and -2.1% on a three-step pipeline: the route
with *fewer* steps loses more, which falsifies a per-step model rather than
just its constant. Per-step work is skipped when nothing subscribes, so what
remains is a fixed per-request cost that a shallow route amortises over less.
The decision survived, for a better reason than it was made with: there is
nothing per-step left to make optional.
Also records the two regressions that measurement caught and reasoning did not,
both larger than anything the design anticipated — a second async frame in
handle() at 0.43us per request, and a closure allocated per request inside
correlateRequest at 0.16us. On this path an extra promise costs more than any
amount of bookkeeping.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Eight tasks from the reviewed design, ordered so the correction lands before
anything consumes it — a logger built on uncorrelated events would grow its own
notion of request identity, which is the failure the design exists to prevent.
Two placement details worth having settled in writing. requestId is generated
in the adapters rather than in handle(), because both read and size-check the
body first, so a 413 never reaches handle() — generating there would leave
exactly the failures an operator most wants to correlate without an id. And
step timing takes N+1 timestamps for N steps, since one step's end is the next
one's start; the design measured that against the naive 2N.
Task 7 benchmarks the hot path and says outright that if the measurement
disagrees with D7, the design changes rather than the number being quietly
kept.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
D6: a request span ends when the handler returns, and stream events carry its
requestId. Ending it at stream close would mix 2ms buffered requests with
hour-long SSE connections in one latency distribution; connection duration is
already readable from stream:open/close once they can be joined. Same boundary
#21 chose for its concurrency gate — the framework should not disagree with
itself about when a request is over.
D7: per-step timing is always on. Measured rather than argued: performance.now()
at step boundaries costs 25.2ns per step against a 10.19us request, or 0.25% —
below the 0.3% run-to-run CV of the project's own benchmark. A flag would buy
two code paths for something the harness cannot detect. The measurement also
settles Date.now(), which is both slower (28.6ns) and coarser.
D8: request logging is a Bus subscriber, wrapped to fall back to console. One
path, composable as #10 asks, and the wrapper closes the hole that emit()
swallows listener failures by design — the Bus keeps its guarantee without
buying it with silence.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
The issue says green-tea ships no logging, metrics or tracing contract. The
mechanism is actually already there — Bus has 19 emission points across boot,
pipeline, streams, mesh and plugins, and plugins already subscribe to it. What
is missing is narrower and worse: no event carries request identity, so under
concurrency step events cannot be attributed; durationMs is declared in the
payload and written by nothing; there are no request-level events for step
events to hang from; and a failing step reports as name: 'pipeline'.
That reframes the work. A logger, a metrics exporter and an OpenTelemetry
bridge are not three features, they are three consumers of one corrected event
stream — which is a sharper reason for #10's 'one design, not six' than the
issue had, and it puts most of the work in bus.ts and pipeline.ts rather than
in new files.
Five decisions settled with their reasoning, including why the logger cannot be
an ordinary provider (it must outlive the graph to report the graph failing to
boot) and why route labels carry the pattern rather than the URL (a metrics
consumer labelling on raw paths takes down the backend, not the app).
Three questions left open for review rather than answered alone, the sharpest
being where a request span ends on a streaming route — the same boundary #21
hit, which should be answered once for both.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
The plan asked Task 2.3 to decide between two answers; the decision and what
the runtimes actually allow now sit in it, so the next reader is not re-deriving
either. The Deno constraint in particular was found by measurement and is not
in any issue.
Adds Task 2.5 for the plugin/provider teardown idea, kept out of the #15 work
on purpose: it needs a new await-aware surface on PluginApi, because the
existing Bus is a synchronous observer by design and cannot be made to hold up
a shutdown without losing the guarantee that makes it safe.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
The reports in .specs/reports/ were written independently and converge on
observability as the gap that matters most. Two things they demand had no
issue filed at all: CI never runs the Deno/Bun/edge suites that package.json
defines, so the multi-runtime claim has no evidence behind it, and explain()
returns each node's needs without ever naming what produced them.
Sequenced so the cheap phases land first and produce the material the
observability design needs. API freeze stays out: README already declares it
under 'next', and freezing a surface that is still missing its observability
contract would freeze the wrong thing.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>