th-6fdd1c: document the park-ordering mechanism and how to trust a green port - #525
Merged
Conversation
…een port Three things this session cost real time to rediscover: - Rust has NO ordering code — its chunk takes an extra queue hop through an event-translator task while park bridges write to the sink directly, so the order falls out of tokio's scheduler. That does not port to goroutines, microtasks or Tasks; copying Rust literally gives you nothing to copy. The portable restatement is the predicate-and-re-emit the four ports already used for write-confirmation. - Two footguns that drop a chunk silently rather than failing: the predicate must match only request_<kind>, never the generic submit_interaction tool; and every non-park exit of the raise tool must re-emit immediately. - .NET's scenario runner is in server/integration-tests, NOT server/tests. Running the wrong project gives a clean pass that proves nothing — so the control (re-add the marker, confirm the xpass message) is documented as the way to trust any green port.
|
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.
Docs only — no code. Records three things that cost real time to rediscover during th-ef78d0 / th-6fdd1c, in
spec/conformance/scenarios/README.md.(This was meant to ride along with #523 but missed the squash by a minute.)
1. Do not copy Rust's park ordering
In all five servers the
toolCallchunk is emitted from the server's own stream loop, never from inside the engine — so it is always interceptable. The trap is that Rust has no ordering code at all: its chunk goes through a separate event-translator task (one extra queue hop) while both park bridges write to the sink directly, so the correct order falls out oftokio's scheduler. That's a scheduler property; it does not port to goroutines, JS microtasks or .NETTaskcontinuations. Anyone reading Rust to learn "how it's done" finds nothing to copy.The portable restatement — what Go, TypeScript, Python and .NET all do — is the mechanism their write-confirmation gate already used: skip the chunk in the stream loop on a tool-name predicate, then re-emit it from the park path right after the park event.
2. Two footguns that drop a chunk silently
Both fail quietly rather than loudly, which is why they're worth writing down:
request_<kind>raise tools, never the genericsubmit_interactiontool — it raises no park event, so nothing would ever re-emit its deferred chunk.interaction-conversational-fallbackbreaks, because that path has no park event to trail.3. How to trust a green port
.NET's scenario runner lives in
dotnet/server/integration-tests, notdotnet/server/tests. I ran the latter first and got a clean 405-test pass that said nothing whatsoever about this corpus.A port that passes and a port whose runner never executed the scenario look identical from outside — the exact failure this corpus exists to catch. So the README now documents the control: add the language to a scenario's
knownDivergences, re-run, and confirm the build fails withremove <lang> from knownDivergences … it now passes. Only a scenario that ran and passed can produce that message. Then take the marker back out.