From b177daea3ceb33d8abad1cc972afd661973c9705 Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 20 Oct 2026 13:11:35 +0200 Subject: [PATCH] fix(tours): point undo_tour_change at the revision prepare_tour_undo returns The expected_revision field told assistants to read now.revision of the preview, but prepare_tour_undo never returns that field: the revision sits at undo.expected_revision. An assistant following the description either guessed or left the value out and ran into a validation error or a revision conflict. The description now names the real field, and the schema spec pins it. --- shared/src/tours/tour-change.schema.spec.ts | 5 +++++ shared/src/tours/tour-change.schema.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shared/src/tours/tour-change.schema.spec.ts b/shared/src/tours/tour-change.schema.spec.ts index f1c2d4943..389d22b62 100644 --- a/shared/src/tours/tour-change.schema.spec.ts +++ b/shared/src/tours/tour-change.schema.spec.ts @@ -74,6 +74,11 @@ describe('a prepared change the traveller confirmed, sent to be saved (MCP-T03)' describe('a saved step the traveller confirmed to take back (MCP-T04)', () => { const undo = { step_id: 7, expected_revision: 4, confirmed: true }; + it('points the revision at the field prepare_tour_undo really returns', () => { + const field = tourChangeUndoRequestSchema.shape.expected_revision; + expect(field.description).toContain('undo.expected_revision of prepare_tour_undo'); + }); + it('takes the step, the revision it was shown at and the yes', () => { expect(tourChangeUndoRequestSchema.parse(undo)).toEqual(undo); }); diff --git a/shared/src/tours/tour-change.schema.ts b/shared/src/tours/tour-change.schema.ts index 7820a48d1..3453503fa 100644 --- a/shared/src/tours/tour-change.schema.ts +++ b/shared/src/tours/tour-change.schema.ts @@ -86,7 +86,7 @@ export const tourChangeUndoRequestSchema = z .object({ step_id: idSchema.describe('The id of the saved step, as list_tour_change_steps gives it'), expected_revision: tourRevisionSchema.describe( - 'now.revision of the preview: the revision of the tour the step was shown to be taken back from', + 'undo.expected_revision of prepare_tour_undo: the revision of the tour the step was shown to be taken back from', ), confirmed: z .literal(true)