{"spec":"AIP-BS-HAND-OFF","version":"2026-11-23","standard":"hand-off-build-standard","source":"https://aipathway.com.au/explore-ai/hand-off-build-standard","markdown":"https://aipathway.com.au/explore-ai/hand-off-build-standard.md","licence":"CC BY 4.0","how_to_read":"Seven of these nine checks run on your own machine, against the stub, before you talk to anybody. The last one is a live tenant, and that one runs against your own live systems. One is not a software check at all: it asks what you measured before you started.","verdicts":{"pass":"asserted green here","fail":"asserted red here. This is a fixture: it names the check to price","shape_only":"shape holds on the stub, truth needs the live provider","with_us":"cannot be proved on the stub; runs against your own live systems (see with_us_next)","evidence_required":"not a software check. Attach what proves it"},"tally":{"total":9,"onStub":7,"productionOnly":1,"partial":0,"preconditions":1},"envelope_version":"1.0","port_shape":{"read_ledger":{"verb":"read","subject":"ledger"},"read_job":{"verb":"read","subject":"job"},"read_asset":{"verb":"read","subject":"asset"},"read_rule":{"verb":"read","subject":"rule"},"read_contacts":{"verb":"read","subject":"contacts"},"read_segment":{"verb":"read","subject":"segment"},"resolve_address":{"verb":"read","subject":"address"},"write_job":{"verb":"write","subject":"job"},"read_pricebook":{"verb":"read","subject":"pricebook"},"draft_quote":{"verb":"write","subject":"quote"},"write_invoice":{"verb":"write","subject":"invoice"},"write_ledger":{"verb":"write","subject":"ledger"},"record_promise":{"verb":"write","subject":"promise"},"record_service":{"verb":"write","subject":"service_record"},"release_payment":{"verb":"write","subject":"payment"},"talk":{"verb":"say","subject":"turn"},"disclose":{"verb":"say","subject":"disclosure"},"send_sms":{"verb":"say","subject":"sms"},"notify":{"verb":"say","subject":"alert"},"escalate":{"verb":"say","subject":"handoff"},"issue_notice":{"verb":"say","subject":"notice"},"answer":{"verb":"say","subject":"answer"},"publish_report":{"verb":"say","subject":"report"},"record_consent":{"verb":"write","subject":"consent"},"read_file":{"verb":"read","subject":"file"},"write_file":{"verb":"write","subject":"file"},"raise_task":{"verb":"write","subject":"task"},"read_node":{"verb":"read","subject":"node"},"write_node":{"verb":"write","subject":"node"},"read_register":{"verb":"read","subject":"register"},"write_register":{"verb":"write","subject":"register"},"index_passage":{"verb":"attach","subject":"passage"},"search_index":{"verb":"read","subject":"index"},"read_inbox":{"verb":"read","subject":"message"},"file_message":{"verb":"attach","subject":"message"},"write_order":{"verb":"write","subject":"order"},"read_quote":{"verb":"read","subject":"quote"},"write_log":{"verb":"write","subject":"log"},"read_sales":{"verb":"read","subject":"sales"},"read_sale":{"verb":"read","subject":"sale"},"draft_message":{"verb":"write","subject":"draft"},"send_message":{"verb":"say","subject":"message"},"read_memory":{"verb":"read","subject":"memory"},"propose_memory":{"verb":"write","subject":"proposal"},"write_memory":{"verb":"write","subject":"memory"},"close_job":{"verb":"write","subject":"job"},"raise_exception":{"verb":"write","subject":"exception"},"list_exceptions":{"verb":"read","subject":"exception"},"read_acceptance":{"verb":"read","subject":"acceptance"},"read_contract":{"verb":"read","subject":"contract"},"read_assessment":{"verb":"read","subject":"assessment"},"draft_claim":{"verb":"write","subject":"claim_draft"},"read_menu":{"verb":"read","subject":"menu"},"request_payment":{"verb":"write","subject":"payment_request"},"read_payment":{"verb":"read","subject":"payment"},"write_booking":{"verb":"write","subject":"booking"},"read_signoff":{"verb":"read","subject":"signoff"},"propose_journal":{"verb":"write","subject":"journal_proposal"},"set_lock_date":{"verb":"write","subject":"lock_date"},"read_link":{"verb":"read","subject":"link"},"propose_link":{"verb":"write","subject":"link_proposal"},"write_link":{"verb":"write","subject":"link"},"request_hold":{"verb":"write","subject":"hold"},"read_hold":{"verb":"read","subject":"hold"},"emit_handoff":{"verb":"write","subject":"handoff"},"read_handoffs":{"verb":"read","subject":"handoff"},"claim_record":{"verb":"write","subject":"claim"},"mark_processed":{"verb":"write","subject":"dedupe_key"},"evidence":{"verb":"attach","subject":"evidence"},"cite":{"verb":"attach","subject":"citation"},"rank":{"verb":"decide","subject":"order"},"gate":{"verb":"decide","subject":"gate"}},"provider":{"boundary":{"never":["hand a job over as anything but one envelope in the contract's shape","put a customer's name, address, email, phone or an amount in a hand-off","trust a copy in an envelope over the record it names","act twice on an event id it has already handled","work a record another node holds, or work without reading its claim back","work a stage the business's rules name another node for","edit or delete an entry in the hand-off log","emit an event only a person causes: customer.linked, customer.unlinked, hold.released, hold.refused or exception.closed","stop the chain over an extension event it does not know"],"stays_with_person":["naming which bot holds each stage","reading the log when a job stalls, and deciding what happens next","anything an exception or a hold stops, until a person closes or releases it"]},"job":"how every step hands a job to the next: one envelope of refs, one holder at a time, a repeated event ignored, every hand-over kept in a log","skill":"hand-off","stub":"local.mock_hand_off","production":null,"product":null,"insert":null,"with_us":{"kind":"own_systems","note":"No hosted step. The hand-off log, the claims and the dedupe keys are the business's own list or table, and the production check runs with two of its own bots in a chain on a real job: the webhook retried, a second bot not named for the stage, and the log walked from the job."}},"with_us_next":"No hosted step. The hand-off log, the claims and the dedupe keys are the business's own list or table, and the production check runs with two of its own bots in a chain on a real job: the webhook retried, a second bot not named for the stage, and the log walked from the job. There is nothing to buy: your build does this step on the business's own systems. No production run is offered yet, because the live port map is not published, so do not run AIPATHWAY_ENV=production. Run the pass test by hand on the real systems and attach the evidence.","default_path":null,"boundary":{"never":["hand a job over as anything but one envelope in the contract's shape","put a customer's name, address, email, phone or an amount in a hand-off","trust a copy in an envelope over the record it names","act twice on an event id it has already handled","work a record another node holds, or work without reading its claim back","work a stage the business's rules name another node for","edit or delete an entry in the hand-off log","emit an event only a person causes: customer.linked, customer.unlinked, hold.released, hold.refused or exception.closed","stop the chain over an extension event it does not know"],"stays_with_person":["naming which bot holds each stage","reading the log when a job stalls, and deciding what happens next","anything an exception or a hold stops, until a person closes or releases it"]},"substrate":{"how_to_read":"These are roles, not products. Work out which you already have by matching `providers[].detect` against the repository, then build or add only the gap. No check asserts against a vendor, so any substrate that answers the role passes the same checks.","requires":[{"role":"record","label":"Somewhere the book lives","need":"Durable storage that the workflow owns the write path to, keyed so the same record can be found twice.","when_missing":"Half a day. Any Postgres will do and the free tiers are ample at this size. The trap is not the database, it is letting people edit around the app that is supposed to own the value.","ports":["read_job","read_rule","write_ledger","read_inbox","emit_handoff","read_handoffs","claim_record","mark_processed"]},{"role":"surface","label":"Something a person opens","need":"A view of the book that whoever does this job can read and act on without asking a developer.","when_missing":"Start at tier 0 and stop there until the business asks for more. The cheapest surface is not a screen, it is a scheduled email carrying the list, and for one person doing this job that is not a compromise, it is the right answer. On Microsoft 365 or Workspace you can skip straight past this: a list and a sheet are already what people open. Build upward only when two people need the same list at the same time.","tiers":[{"tier":0,"label":"A scheduled digest carrying the list","cost":"About an hour. Needs nothing you do not already have.","satisfiedBy":"send","whenYouNeedIt":"One person does this job. They want to know what is waiting when they sit down, and they act on it from their inbox."},{"tier":1,"label":"A read-only page showing the book","cost":"An afternoon. One query and one table.","whenYouNeedIt":"Somebody needs to look mid-day without waiting for tomorrow's digest, or to answer a customer on the phone."},{"tier":2,"label":"Editable rows, a queue and a log","cost":"A day or two with a coding agent, which is what agents are best at. It is bounded work: the fields are the schema, the queue is whatever escalate hands off, the log is the trace.","whenYouNeedIt":"More than one person shares the book and they need to correct it without treading on each other, and you need to see afterwards who changed what."}],"ports":["escalate"]}],"registry":"https://aipathway.com.au/substrates.json"},"checks":[{"id":"one-envelope","n":1,"title":"Every hand-off is one envelope in the contract's shape","statement":"When a step finishes, it emits one envelope: specversion 1.0, a unique id, a type from the mesh vocabulary (or an x-<publisher>. extension), source node:<its slug>, the time, the subject as a <system>:<id> ref, aiphandoffversion 1.0, and data with refs keyed by the vocabulary's id names and caused_by naming the event that woke it. A node never emits customer.linked, customer.unlinked, hold.released, hold.refused or exception.closed, because only a person causes those.","assertable":"stub","ports":["read_inbox","read_job","write_ledger","emit_handoff"],"stimulus":"The job system fires job.completed for job simpro:4471. The node under test is the invoice desk, named for the invoice-out stage. It raises the invoice and hands over.","assertion":"Every envelope the build emitted has all eight fields in the contract's shape, a type the vocabulary names, its own node as source, refs for the type's id and the job it came from (the type's id equal to subject), and a caused_by. Ids are unique. A plain message, a made-up type, a bare id with no system or a missing version fails."},{"id":"references-not-copies","n":2,"title":"The envelope carries references, never copies, and the next step reads the record by its ref","statement":"No customer name, address, email, phone or amount goes in an envelope, under any field name, extensions included. The step that receives it reads each record it needs from the system of record by the ref it was given, and uses what it read. A copy that arrived in an envelope is never trusted over the record.","assertable":"stub","ports":["read_inbox","read_job","write_ledger","emit_handoff"],"stimulus":"job.completed for simpro:4471 arrives from an upstream node that copied a total of $1,500 into an extension field. The job in the job system says ACME Facilities, 12 Wharf St, $1,840.","assertion":"The invoice is raised for $1,840, after a read of simpro:4471 by its ref, with no search by name. No envelope the build emitted contains the customer's name, address, email, phone or the amount, and none has a field named for them. An invoice for $1,500, or a summary copied into the hand-off, fails."},{"id":"repeat-does-nothing","n":3,"title":"A repeated event does nothing","statement":"Before its step, a node looks up the dedupe key <ref>|<event id>|<node slug>. If it has handled that key, it stops. When it finishes, it records the key. A retried webhook, a replayed queue or a second poll of the same event cannot fire a step twice.","assertable":"stub","ports":["read_inbox","read_handoffs","mark_processed","write_ledger","emit_handoff"],"stimulus":"job.completed E1 for simpro:4471 arrives and is handled. Ten minutes later the job system retries the same webhook: the same event, the same id.","assertion":"One invoice for simpro:4471, one envelope caused by E1, and the key simpro:4471|E1|invoice-desk recorded. The second run claims nothing and writes nothing. A second invoice, or a second hand-off for the same event, fails."},{"id":"one-holder","n":4,"title":"One holder at a time: claim with an expiry, read it back, work only if you hold it","statement":"Before its step, a node writes itself onto the record as seam.holder with seam.holder_until no more than 30 minutes ahead, reads the record back, and works only if the read-back names it. A record another node holds, unexpired, is skipped, not queued. A claim past its expiry frees the record. When the step is done, the node clears its own claim.","assertable":"stub","ports":["read_job","claim_record","write_ledger"],"stimulus":"Four jobs complete at once. 4471 is free. 4472 is held by another invoice bot for 20 more minutes. 4473 was held by that bot, but the claim ran out ten minutes ago. 4474 is free, but the other bot's claim lands a moment after ours.","assertion":"Invoices for 4471 and 4473 only. No claim was written on 4472. Every claim the build wrote expires within 30 minutes. 4471 and 4473 end with no holder, and 4474 still names the other bot. Working a held record, working without reading the claim back, or a claim with no expiry, fails."},{"id":"named-for-its-stage","n":5,"title":"A bot not named for its stage does nothing","statement":"The business's rules name one node per stage (stage_holders). A node reads the rules each run and, if they name another node for its stage, or none, it stops before it reads, claims, writes or hands over anything.","assertable":"stub","ports":["read_rule","read_inbox","claim_record","write_ledger","emit_handoff"],"stimulus":"A second invoice bot, invoice-bot-2, is connected and woken by job.completed for simpro:4471. The rules name node:invoice-desk for the invoice-out stage.","assertion":"invoice-bot-2 read the rules and did nothing else: no claim, no invoice, no hand-off, no dedupe key. A bot that works the job because it was woken fails."},{"id":"log-append-only","n":6,"title":"Every hand-off is appended to a log that is never edited, and the log shows where a job is by walking caused_by","statement":"Every envelope, from a system's own webhook or from a node, is appended to one log. Nothing in it is edited or deleted, by a node or a tidy-up. Starting from the job's first event and following caused_by forward, anyone can read where the job is now and every node and system that touched it.","assertable":"stub","ports":["emit_handoff","read_handoffs"],"stimulus":"job.completed E1 for simpro:4471 is in the log. The invoice desk does its step. Then Xero reports the invoice sent, caused by the invoice desk's hand-off. The owner asks where job 4471 is and who touched it.","assertion":"Walking caused_by from E1 reaches invoice.sent, through the invoice desk's invoice.raised. The trail names system:simpro, node:invoice-desk and system:xero. Every entry in the log is exactly as it was appended. A hand-off whose caused_by is not the waking event's id, or a build that marks the old entry done, fails."},{"id":"unknown-ignored","n":7,"title":"An extension event a bot does not know is ignored, not failed","statement":"An event named x-<publisher>.<event> that the node does not consume is skipped: no exception, no hold, no stop. A later 1.x envelope is read for the fields the node knows, because minor versions only add. The node carries on with the next event.","assertable":"stub","ports":["read_inbox","escalate","emit_handoff"],"stimulus":"Two events arrive together. First x-firecheck.defect.found for simpro:4471, from a fire compliance node. Then job.completed for simpro:4475, sent at hand-off version 1.3 with an extension attribute the node has never seen.","assertion":"Nothing was raised for the extension event, and simpro:4471 was not touched. simpro:4475 was invoiced and handed over. A build that raises an exception for the unknown event, stops the run, or refuses version 1.3, fails."},{"id":"survives-the-builder","n":8,"title":"It survives the builder","statement":"Someone other than the builder can explain what it does, and it runs on an account the business owns.","assertable":"precondition","ports":["read_rule"],"stimulus":"No stimulus. The builder names who else can explain it and whose account the hand-off log, the claims and the dedupe keys runs on.","assertion":"The runner reports what was declared and never scores it green on its own say-so.","stubLimit":"Not a runtime property. Software cannot prove a second person understands it, and outliving its author is precisely what is being asked about."},{"id":"pass-test","n":9,"title":"The pass test passes","statement":"On the business's own systems, with two real bots in a chain: a real job is finished, the job system's own webhook wakes the first bot, it claims, works and hands over, and the second picks up from the envelope alone. The webhook retried does nothing, a second copy of the first bot not named for the stage does nothing, and the log answers where the job is and who touched it.","assertable":"production","ports":["read_inbox","read_rule","read_job","claim_record","write_ledger","emit_handoff","read_handoffs","mark_processed"],"stimulus":"A real job in the business's own ServiceM8, Simpro or job sheet, a real ledger, two bots from any builder, and the business's rules naming one of them per stage. The job is completed, the webhook is replayed by hand, and a second copy of the first bot is switched on.","assertion":"One invoice, one hand-off per hop, each with a caused_by. The log, walked from the job, names both bots and the systems in order. The replayed webhook and the second copy left no write. No hand-off holds a name or an amount.","stubLimit":"Deliberately unpassable on a stub. On a stub each event arrives once, in order, and a claim lands the instant it is written. In production a webhook arrives twice, out of order or ten minutes late, and the job system may not write the holder fields at all, which is when stage_holders is the guard that matters."}]}