{"id":"lead-oncall-swap-requests-json","audience":"operations","category":"leadership-work","track":"leadership","level":"advanced","technique":"verification","title":"Apply on-call swap rules and output the final rota as JSON","free":false,"task":"Decide the swap requests in the order received. Rules: no one is on call two weeks in a row, and a swap needs both people to have agreed. A request is approved only if it follows both rules given the rota at that point. Output one json code block and nothing else, with keys \"final_rota\" (an array of 6 names, week 1 first), \"approved\" (a number) and \"declined\" (an array of two reasons, each under 12 words). At most 12 lines inside the block.","materialLabel":"Rota and requests (attached to your prompt automatically)","material":"On-call rota, weeks starting Mon\nWk1 Jun 2: Ana\nWk2 Jun 9: Raj\nWk3 Jun 16: Mei\nWk4 Jun 23: Ana\nWk5 Jun 30: Raj\nWk6 Jul 7: Mei\n\nRequests, in the order received:\n1. Ana asks to swap her Wk4 with Raj's Wk5. Raj replied \"fine by me\".\n2. Raj asks to swap his Wk2 with Mei's Wk3. Mei replied \"yes, ok\".\n3. Mei asks to give her Wk6 to Raj. Raj has not answered yet.\n\nNote: Raj is happy to take extra weeks in general.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":12},{"type":"maxProseWords","max":5}],"mistakes":[{"title":"Ignoring the order","why":"The AI approves request 2 before request 1.","fix":"Say: \"Process the requests in the order received, updating the rota after each.\"","checks":["r1"]},{"title":"Missing the back-to-back check","why":"The AI approves request 2 because both agreed.","fix":"Say: \"Check the consecutive-weeks rule on the updated rota.\"","checks":["r1","r2"]},{"title":"Treating silence as yes","why":"The AI approves request 3 because Raj is generally happy.","fix":"Say: \"A swap needs both people to have agreed.\"","checks":["r2"]},{"title":"Wrong shape","why":"The AI explains outside the block.","fix":"Say: \"One json code block and nothing else.\"","checks":["codeBlocks","maxProseWords"]},{"title":"Long block","why":"The AI pretty-prints extra keys.","fix":"Say: \"Only the three keys, at most 12 lines.\"","checks":["maxCodeLines","r0"]}],"promptHints":[{"label":"Gives the key names","patterns":["final_rota","approved","declined"]},{"label":"States both rules","patterns":["two weeks in a row","consecutive","both"]},{"label":"Says order received","patterns":["order","received"]},{"label":"One code block only","patterns":["one (json )?code block","only the"]},{"label":"Caps reason length","patterns":["under \\d+ words"]}],"hint":"List the keys, both rules, and say the rota changes after each approved swap.","rubricLabels":["The JSON has the keys final_rota, approved and declined, and final_rota lists 6 names","final_rota is Ana, Raj, Mei, Raj, Ana, Mei and approved is 1","declined has two short reasons: request 2 would put Raj on call weeks 3 and 4 in a row, and request 3 lacks Raj's agreement"]}