Repository navigation
Record signals in test/audit and assert them with expectSignals; dev --signal-sink (#917) - #923
Merged
Merged
Conversation
…ignals; dev --signal-sink (#917) One in-process SignalRecorder (packages/core/src/signal-recorder.ts) stands in for signal delivery. A runtime given one records each accepted signal as outcome `captured` (destination origin plus the fixed payload, never the URL path, query or headers) and never calls its egress transport. - `urlcode test` and `urlcode audit` always use a recorder, so fixtures deliver nothing. Request fixtures and steps gain `expectSignals: [{destination?, count?, match?: {<json-pointer>: value}}]` (bounded in schemas/requests.schema.json): exact count when given, else at least one; `[]` asserts no signal. Failures print method, route pattern, status and destination origin, through the existing redaction. verify-deployment notes expectSignals as not checked. - `urlcode dev --signal-sink stdout|<file.jsonl>` writes each would-be delivery as a JSON line and delivers none; a file inside the project is refused (reload loop), and serve and every other command refuse the flag. - signals counters and signals_total gain the `captured` outcome. - contact-form recipe fixtures assert its signal (and none on 422/415). - Docs: EGRESS "Checking signals locally", READINESS, LOCAL-DEVELOPMENT, TOOLING, OBSERVABILITY, llms, agent skill/guide. The agent-facts check now rejects prose saying test/audit fixtures deliver signals. - Core package budget re-measured: 996230 packed / 3929960 unpacked bytes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 15:03
…budget Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
…dget Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #917 item 2 with options (a) and (b), which share one recorder.
The recorder (
signal-recorder.ts):{version, route, status, method}. It never keeps URL paths, queries or headers, where webhook tokens live.SignalBrokerrecords synchronously as outcomecapturedand never calls egress.signals_totalgain acapturedoutcome.(a)
urlcode testandurlcode auditalways record, so nothing is delivered.expectSignals: [{destination?, count?, match?}]on single cases and steps.destinationis an exact origin.count(0–100) means exactly that many; without it, at least one must match.matchtakes up to 8 JSON Pointers into the payload, compared exactly.[]means the request must emit no signal.verify-deploymentnotes thatexpectSignalswas not checked.(b)
urlcode dev --signal-sink stdout|<file.jsonl>writes{"event":"signal","outcome":"captured",…}lines and delivers nothing.devon every line), a name not ending in.jsonl, and a directory that doesn't exist.serveand every other command refuse the flag.Recipe: the contact-form valid POST asserts its signal, and its 422 and 415 cases assert
expectSignals: [].Agent-facts check: the old fact "fixtures do fire signals" (#793) is now false. It is inverted into
signalsRecordedInTests, which caught a stale sentence in llms-full.Evidence (macOS, Node 26)
test/signal-recorder.test.ts:runFixturesagainst a real server with stubbed egress makes zero network calls, and metrics show 8 captured / 0 delivered;runProjectTestspasses, then fails when the count changes;npm run verifypasses;npm run test:packagepasses.Limits
urlcode benchmarkstill delivers signals.dev --signal-sink stdoutinterleaves with the readable log on a TTY.matchis exact equality only.Docs: EGRESS "Checking signals locally", READINESS, LOCAL-DEVELOPMENT, OBSERVABILITY, TOOLING, llms, skills, the agents guide.
🤖 Generated with Claude Code