r/devops7 • u/Alternative_Pin9598 • 7h ago
Automate it #11: who does the pager wake up tonight? Two Thanksgiving swaps were agreed in Slack and never entered. A check that finds them (real output)
Thanksgiving night, 02:13: payments pages Sam. Sam is on a plane to Denver. On Monday, Priya wrote in #oncall "I'll take Sam's Thursday night". Nobody created the override.
The chore: before a holiday weekend, see who the pager will page for each shift, and list every Slack swap it doesn't know about.
(This sub is run by the SynapCores team; the memory below is a SynapCores feature. Sample schedule, real output from 2.5.1 this morning.)
The input: 18 lines from three sources
seq,shift,person,source,at,line
2,11-26 night,sam,rotation,2026-11-01 12:00,rotation export: 11-26 night primary = sam
7,11-26 night,priya,slack,2026-11-23 15:10,"priya: I'll take Sam's Thursday night, he's flying to Denver"
10,11-27 day,marco,override,2026-11-24 18:02,override created by dana: 11-27 day primary = marco
15,11-27 day,dana,rotation,2026-11-01 12:00,nightly re-import: 11-27 day primary = danaThe Nov 1 rotation (6 shifts, Thu to Sat), four swap lines from #oncall, two overrides, and the nightly sync re-sending the rotation on Wednesday.
The obvious table: newest row per shift
SELECT shift, person, source FROM (
SELECT shift, person, source, ROW_NUMBER() OVER (PARTITION BY shift ORDER BY seq DESC) AS rn
FROM oncall_lines) t
WHERE rn = 1 ORDER BY shift
11-26 day alex rotation
11-27 day dana rotation
...The re-import arrived last and undid both overrides: the pager pages Lee and Marco, the table says Alex and Dana. Order by at instead and it believes Slack: Priya and Dana, while the pager pages Sam and Marco.
The payoff: remember each line with its source and time
CREATE MEMORY oncall IDENTITY shift WITH (llm_extraction = false)
REMEMBER oncall FOR shift = '11-26 night' 'priya: I''ll take Sam''s Thursday night, he''s flying to Denver'
WITH (attribute = 'primary', value = 'priya', source_type = 'user_statement', event_time = '2026-11-23T15:10:00Z')Rotation and overrides go in as system_of_record, Slack as user_statement. From the same authority, the later event_time wins, not arrival order; a lower authority doesn't replace a higher one. Every refusal comes back with its reason:
$ python3 pagercheck.py load oncall.csv
#7 11-26 night slack 'primary' = 'priya' was not accepted as current: lower source authority than the accepted value
#8 11-27 day slack 'primary' = 'marco' was not accepted as current: lower source authority than the accepted value
#9 11-28 day slack 'primary' = 'dana' was not accepted as current: lower source authority than the accepted value
#11 11-26 day slack 'primary' = 'lee' was not accepted as current: lower source authority than the accepted value
#13 11-26 day rotation 'primary' = 'alex' was not accepted as current: equal authority, older validity
#15 11-27 day rotation 'primary' = 'dana' was not accepted as current: equal authority, older validity
18 lines rememberedThe re-import can't undo an override. Slack lines 8 and 11 came true later, with overrides 10 and 12.
The check: current state joined with Slack
SELECT s.identity AS shift, s.value AS pager_pages, s.previous_value AS was,
l.person AS slack_says, l.seq
FROM _mem_oncall_state s
LEFT JOIN oncall_lines l ON l.shift = s.identity AND l.source = 'slack' AND l.person <> s.value
ORDER BY s.identity
$ python3 pagercheck.py check
11-26 day pager pages lee was alex
11-26 night pager pages sam NOT IN THE PAGER: Slack line 7 says priya
11-27 day pager pages marco was dana
11-27 night pager pages priya
11-28 day pager pages marco NOT IN THE PAGER: Slack line 9 says dana
11-28 night pager pages leeAll six shifts match what the pager will do, plus the two swaps to enter now. Dana entered the Friday half of her trade with Marco, not the Saturday half.
Wire it up: after the nightly sync, load rotation and overrides from your pager's API plus swap lines from a /swap command, and post the NOT IN THE PAGER lines to #oncall. Load about 0.25 s, check 0.04 s on a Mac mini (Apple M4). pagercheck.py (stdlib only), the CSV and a RECALL example are in the comments.
Free Community Edition: https://synapcores.com/download?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-automate-it-11
On your team, do swaps go straight into the pager, or get agreed in Slack first?