Skip to content

feat(telemetry): export per-status serve_shape request counter#4500

Open
erik-the-implementer wants to merge 5 commits into
mainfrom
alco/request-telemetry
Open

feat(telemetry): export per-status serve_shape request counter#4500
erik-the-implementer wants to merge 5 commits into
mainfrom
alco/request-telemetry

Conversation

@erik-the-implementer
Copy link
Copy Markdown
Contributor

@erik-the-implementer erik-the-implementer commented Jun 4, 2026

What

Adds a new unsampled, per-request metric from the shape-serving path:

electric.plug.serve_shape.requests.count   tags: [status, known_error, live]

It hangs off the existing [:electric, :plug, :serve_shape] telemetry event (no new emission point) and threads a known_error flag into that event's metadata, read straight off the electric-internal-known-error response header.

Why

We sample shape-request spans aggressively (head sampling + tail overrides) to stay within our tracing event budget. That makes the span dataset great for drill-down but unreliable as a health signal:

  • It under-represents true volume (sampled), and
  • It drops some request classes entirely — admission-control rejections are marked known_error and are intentionally excluded from span export, so a request plot built from spans can look perfectly healthy while the system is actually shedding load under overload.

Admission rejection counts already exist as a metric (electric.admission_control.reject.count), but there was no general, status-dimensioned request counter. The existing serve_shape metrics also (a) drop live/long-poll requests and (b) aren't tagged by response status, so they can't express request mix or error rate.

This counter fills that gap:

  • Unsampled — every request is counted, so there's no detection floor. Errors and rejections are visible the moment they rise, not once they cross a sampling threshold.
  • Counts live requests too — unlike the other serve_shape.* metrics, which keep: live != true. Cheap to do as an aggregated metric (the reason we couldn't do it for spans doesn't apply).
  • Admission rejections appear inline as status=503, known_error=true. check_admission halts the conn, but a halt isn't a raise, so the halted conn still flows through emit_shape_telemetry/1 and gets counted.
  • known_error matches the wire signal — it's derived from the electric-internal-known-error response header, the same byte downstream consumers (e.g. the edge worker's tracing) key on, so the classification is consistent end to end.

Intended use: this becomes the authoritative "requests by status / error rate" dashboard panel and alert source, leaving the sampled span dataset for exemplar drill-down.

Changes

  • electric-telemetry: define counter("electric.plug.serve_shape.requests.count", tags: [:status, :known_error, :live]) against the existing event (explicit event_name/measurement to avoid colliding with the existing serve_shape.count).
  • sync-service: add known_error to the serve_shape event metadata, derived from the electric-internal-known-error response header. The header check lives next to the code that sets it so the expected values stay single-sourced.

Cardinality

Bounded: status (~6 codes) × known_error (2) × live (2), per stack.

Notes

  • One pre-existing gap is unchanged: the mid-stream re-raise path (Plug.Conn.chunk/2 raising after the response is committed) doesn't emit the serve_shape event, so those requests aren't counted here — same limitation that already affects every serve_shape.* metric.
  • No rollout/rollback concerns: additive metric only, no behavior change on the request path.

alco and others added 2 commits June 4, 2026 13:02
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

❌ 107 Tests Failed:

Tests completed Failed Passed Skipped
4344 107 4237 17
View the top 3 failed test(s) by shortest run time
test/runtime-dsl.test.ts > F: coordination orchestration > F7: manager-worker uses placeholders when every perspective child is silent
Stack Traces | 0.00148s run time
Error: spawn manager-f2/manager-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manager-f2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4064:20
test/runtime-dsl.test.ts > H: pipeline sequencing > H2: pipeline feeds each stage the previous stage output and persists final state
Stack Traces | 0.00154s run time
Error: spawn pipeline-h1/pipeline-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn pipeline-h1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4712:20
test/runtime-dsl.test.ts > F: coordination orchestration > F11: dispatcher preserves counters and child rows when a specialist fails
Stack Traces | 0.00154s run time
Error: spawn dispatcher-f1/dispatch-11 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn dispatcher-f1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4317:20
test/runtime-dsl.test.ts > D: shared state > D8: a later writer can overwrite a shared row and a new reader sees the latest value
Stack Traces | 0.00156s run time
Error: spawn ss-creator-d4/ssw-8a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator-d4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3346:21
test/runtime-dsl.test.ts > D: shared state > D1: mkdb produces entity history with a manifest entry
Stack Traces | 0.00157s run time
Error: spawn ss-creator-d1/ssc-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator-d1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3124:20
test/runtime-dsl.test.ts > F: coordination orchestration > F6: wait_for_all before spawning perspectives returns the documented error path
Stack Traces | 0.0016s run time
Error: spawn manager-f2/manager-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manager-f2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4029:20
test/runtime-dsl.test.ts > D: shared state > D11: adjacent writers contending on the same shared key preserve full history and last-write-wins
Stack Traces | 0.0016s run time
Error: spawn ss-creator-d4/ssw-11a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator-d4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3490:21
test/runtime-dsl.test.ts > H: pipeline sequencing > H3: pipeline status caps at stage_5 while longer pipelines still complete
Stack Traces | 0.00161s run time
Error: spawn pipeline-h1/pipeline-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn pipeline-h1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4742:20
test/runtime-dsl.test.ts > D: shared state > D7: multiple entities can contribute durable rows to the same shared collection
Stack Traces | 0.00164s run time
Error: spawn ss-creator-d4/ssw-7a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator-d4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3310:21
test/runtime-dsl.test.ts > D: shared state > D5: shared state update and delete events remain durable across wakes
Stack Traces | 0.00165s run time
Error: spawn ss-creator-d4/ssc-5 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator-d4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3197:20
test/runtime-dsl.test.ts > D: shared state > D9: a setup-registered shared-state effect fires on the first wake write and survives a later wake
Stack Traces | 0.00166s run time
Error: spawn ss-effect-d9/sse-9 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-effect-d9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3400:20
test/runtime-dsl.test.ts > B: spawn mechanics > B4: spawn marks the child manifest row as observed
Stack Traces | 0.00168s run time
Error: spawn obs-parent-b4/op-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn obs-parent-b4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3079:20
test/runtime-dsl.test.ts > G: map-reduce ordering > G3: map-reduce reuses chunk children across later wakes and returns only the latest chunk outputs
Stack Traces | 0.00169s run time
Error: spawn map-reduce-g1/map-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn map-reduce-g1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4602:20
test/runtime-dsl.test.ts > F: coordination orchestration > F2: manager-worker spawns, observes, and later collects all perspectives in a stable order
Stack Traces | 0.00171s run time
Error: spawn manager-f2/manager-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manager-f2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3818:20
test/runtime-dsl.test.ts > F: coordination orchestration > F5: dispatcher returns the documented placeholder when a child produces no text
Stack Traces | 0.00171s run time
Error: spawn dispatcher-f1/dispatch-4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn dispatcher-f1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4005:20
test/runtime-dsl.test.ts > H: pipeline sequencing > H1: pipeline writes its state row during the first wake before stage execution
Stack Traces | 0.00172s run time
Error: spawn pipeline-h1/pipeline-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn pipeline-h1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4690:20
test/runtime-dsl.test.ts > C: state collections > C3: self-authored state writes do not trigger a second run
Stack Traces | 0.00174s run time
Error: spawn state-loop-c3/loop-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn state-loop-c3"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3105:20
test/runtime-dsl.test.ts > L: reactive observation flows > L3: a child delete while the watcher is asleep replays as one delete notice
Stack Traces | 0.00175s run time
Error: spawn observed-child-e1/child-l3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5980:19
test/runtime-dsl.test.ts > K: wiki coordination > K1: wiki specialists accumulate shared articles that a later query can read
Stack Traces | 0.00175s run time
Error: spawn wiki-parent-k1/wiki-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5387:20
test/runtime-dsl.test.ts > D: shared state > D10: separate entities can contribute to different collections in one shared state
Stack Traces | 0.00175s run time
Error: spawn ss-writer-d6/ssw-10a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-writer-d6"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3447:21
test/runtime-dsl.test.ts > B: spawn mechanics > B3: spawn manifest history includes the resolved entityUrl
Stack Traces | 0.00176s run time
Error: spawn spawner-b3/s-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn spawner-b3"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3071:20
test/runtime-dsl.test.ts > H: pipeline sequencing > H4: pipeline persists stage-by-stage currentInput updates through the run
Stack Traces | 0.00177s run time
Error: spawn pipeline-h1/pipeline-4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn pipeline-h1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4778:20
test/runtime-dsl.test.ts > K: wiki coordination > K5: query_wiki before any specialist articles exist returns the empty-state message
Stack Traces | 0.00177s run time
Error: spawn wiki-parent-k1/wiki-5 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5597:20
test/runtime-dsl.test.ts > E: observation replay > E0: observe without wake does not re-wake on later child writes
Stack Traces | 0.00178s run time
Error: spawn observed-child-e1/child-0 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3610:19
test/runtime-dsl.test.ts > G: map-reduce ordering > G1: map-reduce returns results in chunk order even when completions differ
Stack Traces | 0.00179s run time
Error: spawn map-reduce-g1/map-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn map-reduce-g1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4507:20
test/runtime-dsl.test.ts > D: shared state > D12: mutating one shared collection does not disturb reads from another collection
Stack Traces | 0.00181s run time
Error: spawn ss-writer-d6/ssw-12a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-writer-d6"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3542:27
test/runtime-dsl.test.ts > F: coordination orchestration > F12: dispatcher preserves counters and child rows across repeated failing dispatches
Stack Traces | 0.00182s run time
Error: spawn dispatcher-f1/dispatch-12 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn dispatcher-f1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4391:20
test/runtime-dsl.test.ts > D: shared state > D6: multi-collection shared state stays consistent across writer and reader entities
Stack Traces | 0.00182s run time
Error: spawn ss-writer-d6/ssw-6 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-writer-d6"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3272:20
test/runtime-dsl.test.ts > F: coordination orchestration > F3: dispatcher increments dispatch count and keeps both child rows across wakes
Stack Traces | 0.00182s run time
Error: spawn dispatcher-f1/dispatch-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn dispatcher-f1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3921:20
test/runtime-dsl.test.ts > L: reactive observation flows > L2: re-waking the watcher without new child changes does not duplicate prior observation notices
Stack Traces | 0.00182s run time
Error: spawn observed-child-e1/child-l2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5921:19
test/runtime-dsl.test.ts > L: reactive observation flows > L5: one watcher can observe multiple children and preserve source attribution
Stack Traces | 0.00182s run time
Error: spawn observed-child-e1/child-l5-a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6093:20
test/runtime-dsl.test.ts > F: coordination orchestration > F4: dispatcher records the expected status progression during a dispatch
Stack Traces | 0.00183s run time
Error: spawn dispatcher-f1/dispatch-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn dispatcher-f1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3975:20
test/runtime-dsl.test.ts > K: wiki coordination > K2: repeating create_wiki reuses existing specialists and only spawns missing subtopics
Stack Traces | 0.00183s run time
Error: spawn wiki-parent-k1/wiki-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5436:20
test/runtime-dsl.test.ts > D: shared state > D4: a second entity can connect to existing shared state and read prior rows
Stack Traces | 0.00183s run time
Error: spawn ss-creator-d4/ssc-4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator-d4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3157:20
test/runtime-dsl.test.ts > D: shared state > D2: shared state stream exists even before any writes
Stack Traces | 0.00184s run time
Error: spawn ss-creator2-d2/ssc-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-creator2-d2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3134:20
test/runtime-dsl.test.ts > L: reactive observation flows > L4: watching the same child twice stays deduped
Stack Traces | 0.00184s run time
Error: spawn observed-child-e1/child-l4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6043:19
test/runtime-dsl.test.ts > A: basic entity lifecycle > A14: an entity can recover from a failed tool call in a later run
Stack Traces | 0.00184s run time
Error: spawn toolful-a9/tool-recover-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn toolful-a9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3019:20
test/runtime-dsl.test.ts > N: wake primitives verification > N3: wake events are delivered as wake when the parent is re-woken
Stack Traces | 0.00184s run time
Error: spawn wake-type-parent-n1/idle-test-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wake-type-parent-n1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6346:20
test/runtime-dsl.test.ts > F: coordination orchestration > F10: manager-worker can retry after a targeted failure and later collect full results
Stack Traces | 0.00186s run time
Error: spawn manager-f2/manager-6 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manager-f2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4223:20
test/runtime-dsl.test.ts > D: shared state > D3: writes to shared state are reflected in both histories
Stack Traces | 0.00187s run time
Error: spawn ss-writer-d3/ssw-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-writer-d3"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3145:20
test/runtime-dsl.test.ts > K: wiki coordination > K4: create_wiki rejects switching the topic on an existing wiki
Stack Traces | 0.00188s run time
Error: spawn wiki-parent-k1/wiki-4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5548:20
test/runtime-dsl.test.ts > E: observation replay > E1: observed effects do not duplicate old child rows after parent re-wake
Stack Traces | 0.00188s run time
Error: spawn observed-child-e1/child-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3637:19
test/runtime-dsl.test.ts > K: wiki coordination > K3: get_wiki_status reports complete coverage after specialist articles land
Stack Traces | 0.0019s run time
Error: spawn wiki-parent-k1/wiki-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5523:20
test/runtime-dsl.test.ts > F: coordination orchestration > F8: repeated spawn_perspectives reuses the same child streams for later questions
Stack Traces | 0.00193s run time
Error: spawn manager-f2/manager-4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manager-f2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4098:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A13: failing tools close the run cleanly with durable failure history
Stack Traces | 0.00193s run time
Error: spawn toolful-a9/tool-fail-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn toolful-a9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3005:20
test/runtime-dsl.test.ts > F: coordination orchestration > F1: dispatcher routes to the requested specialist type and records the child
Stack Traces | 0.00193s run time
Error: spawn dispatcher-f1/dispatch-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn dispatcher-f1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3795:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A10: async tool completion preserves a single clean run history
Stack Traces | 0.00195s run time
Error: spawn toolful-a9/tool-async-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn toolful-a9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2944:20
test/runtime-dsl.test.ts > C: state collections > C1: ctx.state inserts are reflected in full stream history
Stack Traces | 0.00196s run time
Error: spawn state-writer-c1/sw-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn state-writer-c1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3089:20
test/runtime-dsl.test.ts > K: wiki coordination > K10: same-topic wiki expansion adds only the missing article and updates later query coverage
Stack Traces | 0.00196s run time
Error: spawn wiki-parent-k1/wiki-10 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5793:20
test/runtime-dsl.test.ts > G: map-reduce ordering > G2: map-reduce with one chunk still uses the orchestration path
Stack Traces | 0.00197s run time
Error: spawn map-reduce-g1/map-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn map-reduce-g1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4561:20
test/runtime-dsl.test.ts > B: spawn mechanics > B2: spawn with initial message writes the child history
Stack Traces | 0.00197s run time
Error: spawn parent2-b2/p-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn parent2-b2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3059:20
test/runtime-dsl.test.ts > N: wake primitives verification > N1: WakeEvent type is "wake" when parent is re-woken by child completion
Stack Traces | 0.00197s run time
Error: spawn wake-type-parent-n1/wake-type-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wake-type-parent-n1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6142:20
test/runtime-dsl.test.ts > L: reactive observation flows > L1: explicit observe plus createEffect forwards insert, update, and delete notices
Stack Traces | 0.00197s run time
Error: spawn observed-child-e1/child-l1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5860:19
test/runtime-dsl.test.ts > G: map-reduce ordering > G4: map-reduce uses a placeholder only for the failed chunk while keeping the others
Stack Traces | 0.00197s run time
Error: Expected 1 additional wake error(s), but they did not occur
 ❯ drainRuntimeWakes test/runtime-dsl.ts:589:15
 ❯ waitForRuntimeSettled test/runtime-dsl.ts:619:5
 ❯ Object.waitForSettled test/runtime-dsl.ts:929:7
 ❯ test/runtime-dsl.test.ts:2806:3
test/runtime-dsl.test.ts > F: coordination orchestration > F9: manager-worker records a targeted child failure and uses a placeholder only for that perspective
Stack Traces | 0.00198s run time
Error: spawn manager-f2/manager-5 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manager-f2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4155:20
test/runtime-dsl.test.ts > B: spawn mechanics > B1: spawn creates a child entity that can receive messages
Stack Traces | 0.002s run time
Error: spawn parent-b1/p-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn parent-b1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3046:20
test/runtime-dsl.test.ts > E: observation replay > E3: an observed row update is replayed as an update, not a second insert
Stack Traces | 0.002s run time
Error: spawn observed-child-e1/child-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3738:19
test/runtime-dsl.test.ts > N: wake primitives verification > N5: runFinished wake records the finished child on the parent stream
Stack Traces | 0.00201s run time
Error: spawn wake-summary-parent-n4/wake-summary-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wake-summary-parent-n4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6253:20
test/runtime-dsl.test.ts > J: debate coordination > J2: end_debate before any arguments exist returns the empty-state error path
Stack Traces | 0.00201s run time
Error: spawn debate-parent-j1/debate-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn debate-parent-j1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5295:20
test/runtime-dsl.test.ts > K: wiki coordination > K9: idempotent wiki recreation does not duplicate shared article rows
Stack Traces | 0.00202s run time
Error: spawn wiki-parent-k1/wiki-9 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5762:20
test/runtime-dsl.test.ts > C: state collections > C2: setup-initialized state remains visible in final history
Stack Traces | 0.00204s run time
Error: spawn status-entity-c2/se-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn status-entity-c2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3097:20
test/runtime-dsl.test.ts > J: debate coordination > J3: debate with only one durable side stays partial until the missing side arrives
Stack Traces | 0.00204s run time
Error: spawn debate-parent-j1/debate-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn debate-parent-j1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5330:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A12: stateful note writes persist across wakes and can be read later
Stack Traces | 0.00205s run time
Error: spawn toolful-a9/tool-note-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn toolful-a9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2976:20
test/runtime-dsl.test.ts > N: wake primitives verification > N4: ctx.agent.run receives the wake payload and performs a second run on child completion
Stack Traces | 0.00207s run time
Error: spawn idle-wake-parent-n3/wake-agent-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn idle-wake-parent-n3"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6226:20
test/runtime-dsl.test.ts > M: deep researcher coordination > M3: separate researcher entities keep child results isolated across later wakes
Stack Traces | 0.00207s run time
Error: spawn deep-researcher-m1/research-3a failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn deep-researcher-m1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4970:19
test/runtime-dsl.test.ts > K: wiki coordination > K6: repeating create_wiki with the same topic and subtopics is idempotent
Stack Traces | 0.00208s run time
Error: spawn wiki-parent-k1/wiki-6 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5632:20
test/runtime-dsl.test.ts > I: peer review coordination > I3: peer review with one configured reviewer summarizes only that durable row
Stack Traces | 0.00209s run time
Error: spawn peer-review-i1/review-3 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn peer-review-i1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5145:20
test/runtime-dsl.test.ts > K: wiki coordination > K8: wiki keeps durable child metadata and shared articles carry topic and author details
Stack Traces | 0.00212s run time
Error: spawn wiki-parent-k1/wiki-8 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5690:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A5: multiple messages produce two completed runs
Stack Traces | 0.00215s run time
Error: spawn multi-a5/m-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn multi-a5"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2866:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A8: manifest history includes the configured agent
Stack Traces | 0.00217s run time
Error: spawn manifested-a8/mf-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn manifested-a8"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2915:20
test/runtime-dsl.test.ts > I: peer review coordination > I2: summarize_reviews before any reviews exist returns the empty-state error path
Stack Traces | 0.00217s run time
Error: spawn peer-review-i1/review-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn peer-review-i1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5112:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A7: setup state writes appear before the run history
Stack Traces | 0.00218s run time
Error: spawn stateful-a7/s-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn stateful-a7"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2906:20
test/runtime-dsl.test.ts > K: wiki coordination > K7: get_wiki_status before creating a wiki reports the empty state
Stack Traces | 0.00219s run time
Error: spawn wiki-parent-k1/wiki-7 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn wiki-parent-k1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5670:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A6: agent-less entity records only inbound messages
Stack Traces | 0.00221s run time
Error: spawn noagent-a6/na-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn noagent-a6"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2898:20
test/runtime-dsl.test.ts > M: deep researcher coordination > M1: researcher workers start from spawn initialMessage without an extra send
Stack Traces | 0.00225s run time
Error: spawn deep-researcher-m1/research-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn deep-researcher-m1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4917:20
test/runtime-dsl.test.ts > J: debate coordination > J1: debate parent reads both sides from shared state before issuing a ruling
Stack Traces | 0.00227s run time
Error: spawn debate-parent-j1/debate-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn debate-parent-j1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5223:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A4: agent text output is reflected in the final history
Stack Traces | 0.00234s run time
Error: spawn texter-a4/t-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn texter-a4"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2857:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A3: single message produces a full run history
Stack Traces | 0.0024s run time
Error: spawn runner-a3/r-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn runner-a3"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2849:20
test/runtime-dsl.test.ts > I: peer review coordination > I1: peer review aggregates three reviewer writes through shared state
Stack Traces | 0.00241s run time
Error: spawn peer-review-i1/review-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn peer-review-i1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5051:20
test/runtime-dsl.test.ts > I: peer review coordination > I4: peer review with two configured reviewers summarizes only those durable rows
Stack Traces | 0.0025s run time
Error: spawn peer-review-i1/review-4 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn peer-review-i1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:5183:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A9: sync tool calls appear in-order within one completed run
Stack Traces | 0.00255s run time
Error: spawn toolful-a9/tool-sync-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn toolful-a9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2923:20
test/runtime-dsl.test.ts > H: pipeline sequencing > H6: pipeline carries a failed stage forward as placeholder input for later stages
Stack Traces | 0.00257s run time
Error: spawn pipeline-h1/pipeline-6 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn pipeline-h1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4862:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A5c: t.waitForSettled waits for runtime quiescence
Stack Traces | 0.00272s run time
Error: spawn multi-a5/m-settled-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn multi-a5"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2888:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A11: repeated tool calls keep ordering stable and use the last result
Stack Traces | 0.00283s run time
Error: spawn toolful-a9/tool-double-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn toolful-a9"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2959:20
test/runtime-dsl.test.ts > M: deep researcher coordination > M2: wait_for_results before spawning researchers returns the empty-state error path
Stack Traces | 0.00294s run time
Error: spawn deep-researcher-m1/research-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn deep-researcher-m1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4944:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A5b: entity.waitForSettled returns the settled history without run-count polling
Stack Traces | 0.00304s run time
Error: spawn multi-a5/m-settled-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn multi-a5"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2877:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A2: spawn with initial message writes inbox history before any run
Stack Traces | 0.00323s run time
Error: spawn basic-a2/b-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn basic-a2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2828:20
test/runtime-dsl.test.ts > H: pipeline sequencing > H5: pipeline later runs reuse stage children but reset to the latest input chain
Stack Traces | 0.00341s run time
Error: spawn pipeline-h1/pipeline-5 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn pipeline-h1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:4818:20
test/runtime-dsl.test.ts > E: observation replay > E2: updating an observed row preserves a single derived row key
Stack Traces | 0.0039s run time
Error: spawn observed-child-e1/child-2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn observed-child-e1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:3683:19
test/runtime-dsl.test.ts > N: wake primitives verification > N2: observe(db(...)) with wake option triggers re-wake on shared state write
Stack Traces | 0.0045s run time
Error: spawn ss-wake-writer-n2/ss-writer-n2 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn ss-wake-writer-n2"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6188:20
test/runtime-dsl.test.ts > A: basic entity lifecycle > A1: spawn writes entity_created immediately with spawn args
Stack Traces | 0.0245s run time
Error: spawn basic-a1/b-1 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn basic-a1"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:2811:20
Elixir.Electric.Replication.PublicationManagerTest::test component restarts handles relation tracker restart
Stack Traces | 0.208s run time
15) test component restarts handles relation tracker restart (Electric.Replication.PublicationManagerTest)
     .../electric/replication/publication_manager_test.exs:503
     ** (exit) exited in: GenServer.call({:via, Registry, {:"Electric.ProcessRegistry:Electric.Replication.PublicationManagerTest test component restarts handles relation tracker restart", {Electric.Replication.PublicationManager.RelationTracker, nil}}}, {:remove_shape, "130679634-1780575665025627"}, 5000)
         ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
     code: PublicationManager.remove_shape(ctx.stack_id, shape_handle)
     stacktrace:
       (elixir 1.19.5) lib/gen_server.ex:1135: GenServer.call/3
       (electric 1.6.9) .../replication/publication_manager/relation_tracker.ex:73: Electric.Replication.PublicationManager.RelationTracker.remove_shape/2
       .../electric/replication/publication_manager_test.exs:522: (test)
View the full list of 16 ❄️ flaky test(s)
test/dispatch-policy-routing.test.ts > dispatch policy routing > creates pull-wake subscriptions for runner-targeted spawns

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0.039s run time
AssertionError: expected 500 to be 201 // Object.is equality

- Expected
+ Received

- 201
+ 500

 ❯ test/dispatch-policy-routing.test.ts:115:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > creates webhook subscriptions and stores the original target

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0.000738s run time
AssertionError: expected 500 to be 201 // Object.is equality

- Expected
+ Received

- 201
+ 500

 ❯ test/dispatch-policy-routing.test.ts:173:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > does not re-add already linked runner streams before sending

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.000864s run time
AssertionError: expected 500 to be 204 // Object.is equality

- Expected
+ Received

- 204
+ 500

 ❯ test/dispatch-policy-routing.test.ts:360:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > links legacy entities through the type default before sending

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0.00216s run time
AssertionError: expected 500 to be 204 // Object.is equality

- Expected
+ Received

- 204
+ 500

 ❯ test/dispatch-policy-routing.test.ts:286:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > links pull-wake dispatch before sending spawn initialMessage

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0.000808s run time
AssertionError: expected 500 to be 201 // Object.is equality

- Expected
+ Received

- 201
+ 500

 ❯ test/dispatch-policy-routing.test.ts:204:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > links webhook dispatch before sending spawn initialMessage

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.000747s run time
AssertionError: expected 500 to be 201 // Object.is equality

- Expected
+ Received

- 201
+ 500

 ❯ test/dispatch-policy-routing.test.ts:244:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > recreates missing runner dispatch subscriptions before sending

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.000797s run time
AssertionError: expected 500 to be 204 // Object.is equality

- Expected
+ Received

- 204
+ 500

 ❯ test/dispatch-policy-routing.test.ts:321:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > treats runner subscription create conflicts as an idempotent spawn link

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.000915s run time
AssertionError: expected 500 to be 201 // Object.is equality

- Expected
+ Received

- 201
+ 500

 ❯ test/dispatch-policy-routing.test.ts:419:29
test/dispatch-policy-routing.test.ts > dispatch policy routing > uses separate pull-wake subscriptions for separate runner-targeted entities

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.00182s run time
AssertionError: expected 500 to be 201 // Object.is equality

- Expected
+ Received

- 201
+ 500

 ❯ test/dispatch-policy-routing.test.ts:149:26
test/electric-agents-manager-write-validation.test.ts > ElectricAgentsManager event source subscriptions > persists subscription deletion before unregistering wake side effects

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.000576s run time
TypeError: this.registry.replaceSharedStateLink is not a function
 ❯ EntityManager.syncManifestLinks src/entity-manager.ts:3052:25
 ❯ EntityManager.writeManifestEntry src/entity-manager.ts:2660:5
 ❯ EntityManager.deleteEventSourceSubscription src/entity-manager.ts:2898:5
 ❯ test/electric-agents-manager-write-validation.test.ts:250:5
test/electric-agents-manager-write-validation.test.ts > ElectricAgentsManager event source subscriptions > persists the manifest before registering wake side effects

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.00548s run time
TypeError: this.registry.replaceSharedStateLink is not a function
 ❯ EntityManager.syncManifestLinks src/entity-manager.ts:3052:25
 ❯ EntityManager.writeManifestEntry src/entity-manager.ts:2660:5
 ❯ EntityManager.upsertEventSourceSubscription src/entity-manager.ts:2859:5
 ❯ test/electric-agents-manager-write-validation.test.ts:210:5
test/electric-agents-status.test.ts > ElectricAgentsManager.forkSubtree > forks durable streams before registering remapped entity rows

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0.00833s run time
TypeError: this.registry.replaceSharedStateLink is not a function
 ❯ EntityManager.syncManifestLinks src/entity-manager.ts:3052:25
 ❯ EntityManager.materializeForkManifestSideEffects src/entity-manager.ts:2050:7
 ❯ EntityManager.forkSubtreeInner src/entity-manager.ts:1141:11
 ❯ src/entity-manager.ts:876:22
 ❯ src/tracing.ts:32:14
 ❯ withSpan src/tracing.ts:30:10
 ❯ EntityManager.forkSubtree src/entity-manager.ts:874:12
 ❯ test/electric-agents-status.test.ts:478:20
test/event-source-subscriptions-route.test.ts > event source subscription routes > creates a manifest-backed webhook wake subscription

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.0281s run time
TypeError: ctx.entityManager.registry.hasEntityPermission is not a function
 ❯ canAccessEntity src/permissions.ts:40:39
 ❯ src/routing/entities-router.ts:713:9
 ❯ fetch ../../node_modules/.pnpm/itty-router@5.0..../node_modules/itty-router/index.mjs:1:1266
 ❯ Object.fetch ../../node_modules/.pnpm/itty-router@5.0..../node_modules/itty-router/index.mjs:1:1266
 ❯ test/event-source-subscriptions-route.test.ts:29:22
test/event-source-subscriptions-route.test.ts > event source subscription routes > rejects subscriptions whose params do not match the bucket schema

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.000577s run time
TypeError: ctx.entityManager.registry.hasEntityPermission is not a function
 ❯ canAccessEntity src/permissions.ts:40:39
 ❯ src/routing/entities-router.ts:713:9
 ❯ fetch ../../node_modules/.pnpm/itty-router@5.0..../node_modules/itty-router/index.mjs:1:1266
 ❯ Object.fetch ../../node_modules/.pnpm/itty-router@5.0..../node_modules/itty-router/index.mjs:1:1266
 ❯ test/event-source-subscriptions-route.test.ts:135:22
test/runtime-dsl.test.ts > N: wake primitives verification > N3b: spawn wake and child manifest share one runFinished registration

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 0.00179s run time
Error: spawn idle-wake-parent-n3/idle-test-dedupe-1780575669976 failed (401): {"error":{"code":"UNAUTHORIZED","message":"Principal is not allowed to spawn idle-wake-parent-n3"}}
 ❯ Object.spawnEntity src/runtime-server-client.ts:444:13
 ❯ timeStep test/runtime-dsl.ts:236:12
 ❯ Object.spawn test/runtime-dsl.ts:894:22
 ❯ test/runtime-dsl.test.ts:6302:20
test/server-start.test.ts > ElectricAgentsServer.start > rehydrates pending future_send manifest schedules on startup

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0.00218s run time
AssertionError: expected "vi.fn()" to be called with arguments: [ '/chat/test', …(3) ]

Number of calls: 0

 ❯ test/server-start.test.ts:356:50

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@claude
Copy link
Copy Markdown

claude Bot commented Jun 4, 2026

Claude Code Review

Summary

Adds an unsampled, per-status electric.plug.serve_shape.requests.count counter on the existing [:electric, :plug, :serve_shape] event, threading a known_error flag (derived from the electric-internal-known-error response header) into the event metadata. Iteration 3 lands the last cosmetic fix from my previous review — the change is small, additive, and low-risk. Ready to merge.

What's Working Well

  • All prior feedback is now resolved. The comment-wording suggestion from iteration 2 is fixed: response.ex:393-395 now correctly documents the expected values as "true" or "false" (and absent when known_error is nil) rather than the earlier imprecise "true" or "". The logic (== ["true"]) was always correct; the comment now matches it.
  • PR description is back in sync with the code. The Changes section now reads "The header check lives next to the code that sets it so the expected values stay single-sourced" and no longer references the abandoned known_error_header/0 name. Description and implementation now agree.
  • Correctness still verified end to end. check_admissionApi.Response.error(..., known_error: true)send/2 writes electric-internal-known-error: truehalt(); the halted conn still flows through super(opts) |> emit_shape_telemetry(), so the rejection is counted as status=503, known_error=true. The two tests in serve_shape_plug_test.exs lock in both the 200/known_error: false and the admission-rejected 503/known_error: true paths.

Issues Found

Critical (Must Fix)

None.

Important (Should Fix)

None.

Suggestions (Nice to Have)

  • conn_has_known_error?/1 still has no @spec (response.ex:396). Minor convention point for a new public function per the Elixir guidelines; it's a trivial one-liner, so genuinely optional. This is the only carry-over item, and it's not blocking.

Issue Conformance

No linked issue — a minor warning per project convention; consider linking the dashboard/alerting work this metric enables. The PR description is thorough and now accurately matches the merged code. The mid-stream re-raise gap (Plug.Conn.chunk/2 raising post-commit) remains honestly documented as a pre-existing limitation shared by all serve_shape.* metrics.

Previous Review Status

  • Comment wording in response.ex (Suggestion) — fixed in d3bd19bf1.
  • Stale PR description (known_error_header/0) (Suggestion) — description updated to describe conn_has_known_error?/1 co-location.
  • Missing test coverage for known_error metadata (Important, iter 1) — resolved by the two new tests.
  • has_known_error_header?/1 exact-match brittleness (Suggestion, iter 1) — resolved by co-locating the reader with the writer.
  • ◻️ @spec on conn_has_known_error?/1 — optional, still open; non-blocking.

Nothing actionable remains. The PR is ready to merge.


Review iteration: 3 | 2026-06-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants