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.
This commit is contained in:
Maurice
2026-10-20 13:11:35 +02:00
parent 63a7a4d397
commit b177daea3c
2 changed files with 6 additions and 1 deletions
@@ -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);
});
+1 -1
View File
@@ -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)