chrismdp / counting-house-rung-5-transact
Fernwick Air: rebook after a missed connection, tier transact
workflow.yaml
workflow.yaml is AWML 0.6, as it was pushed. The registry draws, checks and fits it converted to AWML 0.8.
awml: "0.6"
title: "Fernwick Air: rebook after a missed connection, tier transact"
description: |
Tier transact. The clerk replies as at tier contain, and its answer now carries a write intent: the
rebooking it wants. Plain code, the orchestrator, checks the intent's schema and re-checks it
against the live booking system, then runs the rebooking as a saga. Rebookings under the policy
cap go under a standing approval, those over it wait for a supervisor's yes, and refusals go with
a reason code to the exception queue, where a rep picks them up. Fernwick Air is fictional.
scopes:
- { id: tokenised, label: "tokenised: Fernwick staff", processing: { anthropic: any } }
- { id: ops, label: "ops: Fernwick staff", processing: none, in: tokenised }
parts:
- { id: asks, kind: trigger, label: "A customer writes in: rebook me after a missed connection", wait: PT1H, untrusted: true }
- { id: contact, kind: connector, label: "Fernwick's contact centre: email and chat", in: ops, untrusted: true }
- { id: bookings, kind: connector, label: "Fernwick's booking system, live", in: ops }
- { id: tokenise, kind: code, op: bring-in, label: "PII gateway: swap names, booking references and contact details for tokens", in: ops }
- { id: vault, kind: context, label: "The PII vault: the real value behind each token", in: ops }
- { id: case, kind: context, label: "The tokenised case", in: tokenised }
- { id: sop, kind: context, label: "The intent's SOP and policy row", in: tokenised }
- { id: flights, kind: connector, label: "Flight status and seats, read only, through the MCP gateway", in: tokenised }
- { id: clerk, kind: ai, op: draft, label: "The clerk drafts a reply and a write intent for the rebooking", in: tokenised }
- { id: answer, kind: context, label: "The clerk's answer", in: tokenised }
- { id: detok, kind: code, op: do, label: "PII gateway: swap the real values back into the clerk's answer", in: ops }
- { id: desk, kind: surface, label: "The rep's case screen", in: ops }
- { id: eligible, kind: code, op: check, label: "Orchestrator: pass on only the write intent's booking reference and new flight, once they match its schema and the live booking system shows the booking is this customer's, the connection was missed and the seat is free", in: ops, cleans: true }
- { id: exceptions, kind: surface, label: "The exception queue, by reason code", in: ops }
- { id: execute, kind: code, op: do, label: "Orchestrator: run the rebooking saga once per idempotency key, reading back each write and undoing every step if one fails", in: ops }
- { id: cap, kind: approval, label: "Customer ops' standing approval: same-cabin rebookings, fare difference up to 200 pounds each", in: ops }
- { id: approved_list, kind: surface, label: "Each rebooking made under the cap, with how to undo it", in: ops }
- { id: supervisor, kind: review, label: "A supervisor's yes to the exact rebooking, over the cap", in: ops }
- { id: rep_rebook, kind: person, op: do, label: "A rep rebooks the passenger, if eligible", in: ops }
- { id: rebook, kind: outside, label: "Rebook the passenger: Ask", in: ops }
- { id: send, kind: code, op: do, label: "PII gateway: swap the real values back into the clerk's reply and send it", in: ops }
- { id: policy, kind: approval, label: "CX and legal's standing approval: replies on this intent only, risk accepted on the October scored set (judge-graded exam above the human baseline)", in: ops }
- { id: rep_reply, kind: person, op: do, label: "The rep replies to the customer", in: ops }
- { id: reply, kind: outside, label: "Reply to the customer: Ask", in: ops }
- { id: sent_list, kind: surface, label: "Each reply the clerk sent, for QA to sample", in: ops }
- { id: tokenise_out, kind: code, op: bring-in, label: "PII gateway: tokenise what was sent and done", in: ops }
- { id: outcome, kind: context, label: "What was sent and done, tokenised", in: tokenised }
- { id: judge, kind: ai, op: check, label: "The judge scores the clerk's answer against what was sent and done, by the intent's rubric", in: tokenised }
- { id: record, kind: code, op: do, label: "Record the score", in: tokenised }
- { id: scores, kind: context, label: "The intent's scores, for promotion", in: tokenised }
- { id: itinerary, kind: comment, label: "The new itinerary goes to the customer from the booking system when the ticket is reissued, as one of the saga's steps" }
lines:
- { from: asks, to: tokenise, kind: start }
- { from: contact, to: rep_rebook, kind: data, label: the message }
- { from: bookings, to: rep_rebook, kind: data }
- { from: rep_rebook, to: rebook, kind: data }
- { from: rebook, to: bookings, kind: data }
- { from: rep_rebook, to: rep_reply, kind: start }
- { from: rep_reply, to: reply, kind: data }
- { from: reply, to: contact, kind: data }
- { from: contact, to: tokenise, kind: data, label: the message }
- { from: tokenise, to: vault, kind: data }
- { from: tokenise, to: case, kind: data, label: "tokens only, under Fernwick's data rule" }
- { from: tokenise, to: clerk, kind: start }
- { from: case, to: clerk, kind: data }
- { from: sop, to: clerk, kind: data }
- { from: flights, to: clerk, kind: data }
- { from: clerk, to: answer, kind: data }
- { from: clerk, to: send, kind: start }
- { from: answer, to: send, kind: data }
- { from: vault, to: send, kind: data }
- { from: send, to: policy, kind: start }
- { from: policy, to: reply, kind: data, label: "[within the policy row]" }
- { from: policy, to: sent_list, kind: data, label: each reply sent }
- { from: clerk, to: detok, kind: start }
- { from: answer, to: detok, kind: data }
- { from: vault, to: detok, kind: data }
- { from: detok, to: desk, kind: data }
- { from: clerk, to: eligible, kind: start }
- { from: answer, to: eligible, kind: data, label: the write intent }
- { from: vault, to: eligible, kind: data }
- { from: bookings, to: eligible, kind: data }
- { from: eligible, to: exceptions, kind: data, label: "[refused] the reason code" }
- { from: eligible, to: rep_rebook, kind: start, label: "[refused]" }
- { from: exceptions, to: rep_rebook, kind: data }
- { from: eligible, to: execute, kind: start, label: "[eligible]" }
- { from: execute, to: cap, kind: start, label: "[under the cap]" }
- { from: cap, to: rebook, kind: data, label: "[within limits]" }
- { from: cap, to: approved_list, kind: data, label: "each rebooking, with how to undo it" }
- { from: execute, to: supervisor, kind: start, label: "[over the cap]" }
- { from: supervisor, to: rebook, kind: data, label: "[yes]" }
- { from: execute, to: tokenise_out, kind: start }
- { from: desk, to: rep_rebook, kind: data, label: the clerk's suggestions }
- { from: rep_rebook, to: tokenise_out, kind: start }
- { from: contact, to: tokenise_out, kind: data, label: the reply sent }
- { from: bookings, to: tokenise_out, kind: data, label: the rebooking made }
- { from: vault, to: tokenise_out, kind: data }
- { from: tokenise_out, to: outcome, kind: data, label: "tokens only, under Fernwick's data rule" }
- { from: tokenise_out, to: judge, kind: start }
- { from: answer, to: judge, kind: data }
- { from: outcome, to: judge, kind: data }
- { from: judge, to: record, kind: start, label: the score }
- { from: record, to: scores, kind: data }
- { from: rebook, to: itinerary, kind: tie }