fix(code-context): follow the server's watch decision and gate the journey map - #24
Merged
Merged
Conversation
…urney map Two places where the helper trusted itself or the prose over the server. The helper recomputed Next action locally, and for a creating or consumed pre-create Round that rule says "stop". A pre-create code can now hand over to its TRD's follow-up Rounds, and the server answers "wait" to say so, but the helper never read it: the agent still stopped at create. It now takes the server's next_action when the response carries one and falls back to the local rule only when it does not, so an older server behaves exactly as before. The helper sent `journeys` whenever the agent wrote them; the only condition was a line of Skill prose. A Doable backend that predates the field rejects any submission carrying it. record-round now keeps whether the Round asked for a journey map, and the submission drops declarations the Round did not request, reporting how many it omitted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
Two follow-ups to #23. In both, the helper trusted its own rule or the Skill prose instead of the server.
1.
Next actionwas computed locally, and it disagrees with the server.watchActionreturnsstopfor anycreating/consumedpre-create Round. getdoable/trd#480 lets a pre-create DQ code hand over to its TRD's follow-up Rounds and answersnext_action: "wait"to say so — but the helper never read that field. It printedNext action: stop, and the agent ended its watch at create. Without this PR, trd#480's hand-off does not happen.(My earlier end-to-end run appeared to pass only because the local trd served a longer copy prompt telling the agent to "stop only when the user stops you", which overrode the helper. trd#480 ships the short, budgeted prompt, so that no longer applies.)
2.
journeyswas gated only by prose. #23 sendsjourneyswhenever the agent writes them; the only condition was a sentence in SKILL.md. A backend without getdoable/trd#479 rejects any submission carrying the field (RoundSubmissionforbids unknown fields). #23 is already merged and installs frommain, so this is a live risk against production trd today.What changes
record-rounduses the server'snext_actionwhen the response carries a valid one, and falls back to the local rule only when it does not. An older server behaves exactly as before — it never sentwaitfor these states.record-roundstores whether the Round asked for a journey map (journey_map.requested).journeys/journey_map_skip_reasononly for a Round that asked. Otherwise the declarations are dropped andvalidate-submissionreportsJourney map not requested by this Round; omitted N declaration(s).Both rules are deterministic, so they live in the helper rather than in the Skill.
Testing
npm test— 2/2. New assertions:waitprintsNext action: wait.creatingfixture has nonext_actionand still printsstop(old-server fallback).node scripts/verify-release.mjspasses.Order
Safe to merge and release on its own, in any order — both changes are no-ops against a backend without the new fields. It should release before, or together with, getdoable/trd#480, since that change depends on it.
🤖 Generated with Claude Code