Repository navigation
refactor(studio): have the BFF report each schedule fire's outcome - #2317
Merged
kantord merged 1 commit intoOct 15, 2026
Conversation
kantord
added this pull request to stack #2325
October 14, 2026 13:27
41 tasks done
kantord
marked this pull request as ready for review
October 15, 2026 08:41
peppescg
approved these changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. Moving the stop-reason mapping into the BFF with a closed enum, typed label maps on the web, and a test that checks every enum value is covered is exactly the shape I hoped for.
Nits:
apps/server/src/mecatl/schedules.ts:234:type FireOutcome = z.infer<typeof scheduleFireOutcomeSchema>would tie the BFF to the schema directly instead of going through the generated response type.
kantord
force-pushed
the
studio-followups/07-schedules-bff-outcome
branch
4 times, most recently
from
October 15, 2026 09:29
120473a to
0f40385
Compare
Add a closed `outcome` enum to the schedule fire contract and compute it in the BFF from the daemon's stop reason, so every client reads one vocabulary. `stop`, `error`, and `inFlight` are unchanged. The web drops its own stop-reason mapping and only labels the outcome, reading an unknown value as stopped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kantord
force-pushed
the
studio-followups/07-schedules-bff-outcome
branch
from
October 15, 2026 12:25
0f40385 to
bbc9c6c
Compare
Merged
2 tasks
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.
Summary
The mapping from the daemon's stop reason to a fire outcome lived in the web app. The BFF now owns it, so every client reads the same vocabulary.
Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 7 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
scheduleFireOutcomeSchemaenum (claimed,in_flight,completed,failed,cancelled,timed_out,limit_reached,stopped) and a requiredoutcomeonscheduleFireSchema.stop,errorandinFlightare unchanged. The schema comment says consumers must treat unknown future values asstopped.fireOutcome(fire), ported verbatim from the web function with its precedence and DECISION comment.no_progressstaysstopped.OUTCOME_LABELandOUTCOME_VARIANTare Records over the generated union (compile-time exhaustive). An unknown or missing outcome reads "Stopped". The raw "Stop: ..." line is kept.openapi.jsonandtypes.gen.tsregenerated withpnpm run generate.Behavior changes
None user-visible; labels and badge variants are identical to before.
API compatibility
/api/v1OpenAPI contract, not the daemon wire API.engine/sessionandcontracts/protoare untouched, and none of the paths in.claude/rules/wire-api-compatibility.mdare touched, so the rule is not triggered. The wire policy (docs/architecture/api-surface.md#wire-api-compatibility) says additions stay in-major and stop reasons remain open strings; nothing here changes that.stop,errorandinFlightare unaffected.Verification
Biome, typecheck, the full Studio test suite and
pnpm generated:checkpass on this branch, run on the assembled stack. The full Playwright suite passes on the stack tip (122 passed, 30 skipped, 0 failed, includingchat-approvalagainst a realmecatedbuild). A 17-case BFF table test (includingno_progressand an unknown stop) asserts it covers every enum value; a service test assertsstop,errorandinFlightare still emitted. Only the two service-level server tests fail without the production change; the table and web tests call functions that exist only with this change.Not included
The daemon, its protobuf contracts and the stop-reason vocabulary.
Fully or partially written by an AI agent.
🤖 Generated with Claude Code