CSE Roadmap

Core tier · about 9 hours · 13 parts

Part 10 of 13 · 2 min read

What the example does not do, and how to build it so it holds up

Limits of the example, build rules, and an interview answer.

What the example does not do

About this example What the example does not do

A test suite is honest about what the server lacks. This one has real gaps, and it should not be shipped as it is:

  • desk_export is unbounded. With 1,000 tickets, one export is 163,951 characters, which is 48 times a page of search results (3,394 characters). A model that calls it fills its context for one answer. The fix is a limit and a cursor, like search (Medium exercise 2). No check fails today, which is exactly the problem: nothing asserts a ceiling on result size.
  • No rate limiting. The specification says servers must rate limit tool invocations, validate all inputs, apply access controls, and sanitize outputs. The example does the second and third, only partly the fourth, and not the first (Medium exercise 3).
  • No timeouts, no concurrency limits, no per-request logging. The debugging page's advice: structured logs to stderr for stdio, and your own log aggregation or OpenTelemetry for HTTP, with request ids and timings. (Logging over the protocol, notifications/message, is marked deprecated as of the 2026-07-28 revision on that page.)
  • The tool list is static. It never sends listChanged, so the dynamic parts of module 2 are untested.
  • No real model. Selection and recovery are scripts.

How to build it so it holds up

  1. Keep business rules in the service, not the adapter — because only then can a plain function call test them, without starting a server.
  2. Every fixable failure is an isError result with a hint; protocol errors are only for malformed or unknown requests — because a model can act on words, but not on a status code alone.
  3. Run all seven layers on a correct server before trusting any of them against a defect — because a check that cannot pass on good code cannot be trusted to fail on bad code either.
  4. Snapshot everything the model reads, and require a reviewed commit to change it — because a "true-looking sentence that is false" is invisible to every other layer.
  5. Test both protocol eras with the same checks — because a server that only works in one era will fail silently for clients still speaking the other.
  6. Start a real child process and a real socket at least once — because the in-process pipe never exercises stdout, and a banner line there breaks every stdio client.
  7. Mutation-test the suite itself before trusting it — because passing checks only prove the suite catches the bugs someone already thought to write a test for.