Skip to content

fix(code-context): follow the server's watch decision and gate the journey map - #24

Merged
alphali merged 1 commit into
mainfrom
fix/code-context-server-watch-and-journey-gate
Sep 16, 2026
Merged

alphali merged 1 commit into
mainfrom
fix/code-context-server-watch-and-journey-gate

Conversation

@alphali

@alphali alphali commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Why

Two follow-ups to #23. In both, the helper trusted its own rule or the Skill prose instead of the server.

1. Next action was computed locally, and it disagrees with the server. watchAction returns stop for any creating/consumed pre-create Round. getdoable/trd#480 lets a pre-create DQ code hand over to its TRD's follow-up Rounds and answers next_action: "wait" to say so — but the helper never read that field. It printed Next 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. journeys was gated only by prose. #23 sends journeys whenever 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 (RoundSubmission forbids unknown fields). #23 is already merged and installs from main, so this is a live risk against production trd today.

What changes

  • record-round uses the server's next_action when 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 sent wait for these states.
  • record-round stores whether the Round asked for a journey map (journey_map.requested).
  • The submission includes journeys / journey_map_skip_reason only for a Round that asked. Otherwise the declarations are dropped and validate-submission reports Journey 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:

  • The main round fixture now requests a map, as a real base-context Round does, so feat: declare the journey map and keep results observable #23's declaration checks still exercise validation.
  • The same declarations against a Round that did not ask: omitted, with the message.
  • A consumed pre-create Round whose server says wait prints Next action: wait.
  • The existing creating fixture has no next_action and still prints stop (old-server fallback).

node scripts/verify-release.mjs passes.

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

…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>
@alphali
alphali merged commit cb9ebcd into main Sep 16, 2026
1 check passed
Sign up for free to 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.

1 participant