Skip to content

docs: record the two example test gaps left by the review fixes - #12

Merged
btravers merged 1 commit into
mainfrom
docs/deferred-example-test-gaps
Aug 12, 2026
Merged

docs: record the two example test gaps left by the review fixes#12
btravers merged 1 commit into
mainfrom
docs/deferred-example-test-gaps

Conversation

@btravers

Copy link
Copy Markdown
Contributor

Follow-up to #11. That PR shipped two deliberate shortcuts in
examples/order-api whose reasoning lived only in the PR description — which is
exactly where a deferral goes to be forgotten. Both are now in CLAUDE.md's
"Deferred, deliberately" list, alongside the rest of this repo's deferrals.

GapCeilingTrigger to revisit
No test for the permanent server 'error' listenerneeds vi.mock("node:http") hoisted above describe, breaking Test conventions rule 1 in the teaching-surface workspace; vi.spyOn cannot patch a node builtin (Cannot redefine property: createServer)a second example needing the same capture, at which point a shared fixture earns its keep
closeAfterResponse's headersSent branch is uncoveredunreachable through this router — endWith puts writeHead and end adjacent, and oRPC serialises these small bodies in one goadding a streamed route

Each entry records why the gap is acceptable, not just that it exists: the
first is guarded by its kernel twin (probes.spec.ts"does not throw when
the server emits an error after binding"
— the same two lines for the same
reason), and the second costs nothing at the gate because examples/ carries no
coverage threshold.

Recorded here rather than marked inline.CLAUDE.md already states that
rationale belongs in it and not in comments, with one carve-out — a comment
guarding a specific line against a plausible "simplification". The headersSent
branch already has that comment; neither of these is a line needing a guard, so
both belong in the list.

Docs only: no code, no changeset (CLAUDE.md is not in the published tarball —
files: ["dist"]).

🤖 Generated with Claude Code

PR #11 shipped two deliberate shortcuts in `examples/order-api` whose reasoning
lived only in that PR's description. Both now sit in the "Deferred,
deliberately" list, where the rest of this repo's deferrals are tracked, each
with the ceiling that stopped it and the trigger to revisit.
- The permanent server `'error'` listener has no test of its own. Guarding it
needs `vi.mock("node:http")` hoisted above `describe` — `vi.spyOn` cannot
patch a node builtin — which breaks Test conventions rule 1 in the one
workspace whose spec shape is itself the advice, to cover a mechanism its
kernel twin in `probes.spec.ts` already covers.
- `closeAfterResponse`'s `headersSent` branch is unreachable through this
router, so nothing can exercise it without inventing a streamed route purely
to be tested. It exists so the drain's guarantee stays "no reuse" rather than
"no reuse where we caught the header in time".
Recorded rather than marked inline: this file already states that rationale
belongs here and not in comments, and both are deferrals rather than a line
needing a guard against a plausible simplification.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 12, 2026 12:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s root CLAUDE.md to permanently document two known, deliberate test/coverage gaps in examples/order-api that were previously only captured in PR #11’s description, keeping deferral rationale centralized alongside other documented tradeoffs.

Changes:

  • Add a deferral entry explaining why examples/order-api’s permanent server 'error' listener fix lacks a dedicated test (and what would trigger revisiting it).
  • Add a deferral entry explaining why closeAfterResponse’s headersSent branch remains uncovered (and what would make it coverable).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadCLAUDE.md
@btravers
btravers merged commit 0263723 into mainAug 12, 2026
14 checks passed
@btravers
btravers deleted the docs/deferred-example-test-gaps branch August 13, 2026 09:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@btravers