AGENTICAMIT // THE TICKET LOOP
a support loop, engraved
AgenticAmit // production loop // sheet 1 of 1
Every hour, on the hour.
This is an agent loop with a real job: read the support inbox,
score it, draft every reply, and let a human say send. Scroll to
run the 10:00 tick. Then let the afternoon run itself.
Stage 01// waketick 10:00 · step 1 of 7
It sleeps until the clock says look.
No daemon burning all day. Cron fires at the top
of the hour, the loop reads one saved cursor, and asks the helpdesk
for everything after it.
▸ the trigger, and the fetch it wakes
[cron] 0 * * * * 10:00:00GET /tickets?since=5802# cursor 200 OK · 14 new (5803..5816)cursor 5802 → 5816# idempotent
// the cursor is the idempotency: rerun the hour
and nothing fetches twice, nothing doubles.
Stage 02// triagestep 2 of 7
Fourteen tickets, three lanes.
Every ticket gets a category and a scored
sentiment, because everything downstream hangs off this call: tone,
urgency, escalation. Numbers, not adjectives.
// a triage that says "seems upset" cannot route.
Scores route.
Stage 03// draftstep 3 of 7
Nothing here sends itself.
One reply per ticket, tone matched to the score:
a refund apology does not read like a docs link. All fourteen go to
the queue. None go to the customer.
▸ one draft, tone-matched and parked
draft #5803 · tone: apologetic"You're right, and the double charge is ours. Refund issued today; invoice follows."status queued_for_reviewsent directly: 0 of 14
// the model drafts. A human speaks last,
every time.
The approval// a human decidesstep 4 of 7
The gate is a person.
Every draft waits here. Approve and it ships.
Reject and it goes back around carrying a note that says why. The
loop borrows judgment; this is where it is repaid.
Tickets 5809, 5812 and 5815 describe the same
defect in different words. The loop checks open issues first, files
once, and links all three tickets to it.
▸ the dedup, then the one issue
similar? #5809 #5812 #5815 cluster 0.91 · same defect open issues: # no matchgh issue create → #412"export: CSV drops UTF-8 rows past 1,000" linked tickets: 3
// three tickets is evidence. Three issues
is noise.
Stage 05// sync the sheetstep 6 of 7
The sheet is the memory.
Every ticket lands in the tracker with its
category, its reply, its issue link and an SLA clock. Next hour's
run reads this sheet before it writes a word.
▸ the tracker, fourteen rows appended
tracker.append(14 rows)#5803 billing sent - 0:12#5809 bug sent#412 0:14#5815 bug sent#412 0:09open0 · sla ok · oldest 0:14
// state kept inside the loop dies with the loop.
The sheet survives the restart.
Sleep// end the tickstep 7 of 7
Ending clean is the feature.
Persist the cursor, write the run log, schedule
the next tick, exit zero. A loop leaves nothing in its hands when it
stops; that is what makes the next wake safe.
▸ the shutdown, exactly as logged
state.cursor = 5816savedrun.log 14 in · 14 sent 1 issue · 14 rowsschedule next tick 11:00:00exit 0
// a loop you trust at 3am is one that ends
empty-handed.
That's one tick. Fourteen answered, one bug on file.
now let the hours pass
Live// ticks 11:00 to 14:00
Now let the afternoon run.
Four ticks, no narration. The gauge fills and
drains once an hour. Watch for the one draft a human had to stop.
11:00 · nine tickets, cleantick 11:00
12:00 · sarcasm in #5830 caughttick 12:00
13:00 · near-dupe of #412 heldno new issue
14:00 · four tickets, quiet hourtick 14:00
sheet 45 rows · cursor 5847day
// #5830 wrote "great, another
update that eats my files" and the model scored it positive. The
human read the sarcasm, rejected the cheery draft, and pass 2
shipped. 31 tickets crossed this afternoon; one was touched.
Asleep// day clear5 ticks · 45 sent
Trust is a clean shutdown.
Nothing held in memory, nothing half sent. The
cursor is saved, the sheet agrees with the inbox, and the next tick
is already on the clock.
▸ the day, summarized by its own log
day 10:00 → 14:00tickets 45 in · 45 sentissues1 filed · 1 dup heldrejects1 · redrafted · sentcursor 5847 · next 15:00
The drawing, at rest
The loop is the employee.
Five ticks, 45 tickets, one canonical issue, one caught bad draft.
The model wrote every reply and sent none of them. The human
decides; the sheet remembers; the loop just goes around. That is
loop engineering, in production.
The Ticket Loop · a Loop Engineering worked page · an AgenticAmit
engraving.