{"spec":"AIP-BS-RULES-AND-HOLDS","version":"2026-11-23","standard":"rules-and-holds-build-standard","source":"https://aipathway.com.au/explore-ai/rules-and-holds-build-standard","markdown":"https://aipathway.com.au/explore-ai/rules-and-holds-build-standard.md","licence":"CC BY 4.0","how_to_read":"Eight of these ten 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":10,"onStub":8,"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":["keep its own copy of a limit, a list or the contact hours instead of reading the rules","take an action the rules do not mention","take an action over a limit before a person releases it","record a release or refusal from anyone not on that rule's release list","use one release for more than the one action it was raised for","send, chase or call a customer on the do-not-contact list","contact a customer outside the contact hours","pay, refund or transfer money","work a stage the rules name another bot for"],"stays_with_person":["writing and changing the rules","every release or refusal of a hold","who is on each release list","every do-not-contact entry"]},"job":"the business's rules written once and read by every bot, with anything over a limit held for a named person","skill":"rules-and-holds","stub":"local.mock_rules_and_holds","production":null,"product":null,"insert":null,"with_us":{"kind":"own_systems","note":"No hosted step. The rules document and the holds list are the business's own sheet, list or table, and the production check runs on its own systems with its own bots: a real invoice over the limit held until the owner releases it and then sent once, nothing to a do-not-contact customer or after hours, and a lowered limit read by every bot on its next run."}},"with_us_next":"No hosted step. The rules document and the holds list are the business's own sheet, list or table, and the production check runs on its own systems with its own bots: a real invoice over the limit held until the owner releases it and then sent once, nothing to a do-not-contact customer or after hours, and a lowered limit read by every bot on its next run. 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":["keep its own copy of a limit, a list or the contact hours instead of reading the rules","take an action the rules do not mention","take an action over a limit before a person releases it","record a release or refusal from anyone not on that rule's release list","use one release for more than the one action it was raised for","send, chase or call a customer on the do-not-contact list","contact a customer outside the contact hours","pay, refund or transfer money","work a stage the rules name another bot for"],"stays_with_person":["writing and changing the rules","every release or refusal of a hold","who is on each release list","every do-not-contact entry"]},"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","release_payment","read_inbox","request_hold","read_hold"]},{"role":"schedule","label":"Something that runs it on time","need":"A trigger that fires on a cadence and can call an authenticated endpoint.","when_missing":"An hour. Expose one authenticated endpoint that starts the work and let anything call it, so the schedule is never welded to whoever is hosting you.","ports":["gate"]},{"role":"send","label":"Something that sends","need":"Email or SMS from a domain the recipient recognises, with delivery visible enough to tell a bounce from a silence.","when_missing":"An hour for the wiring, longer for the DNS. Sending from a domain you do not own is the single fastest way into a spam folder.","ports":["send_message"]},{"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."}],"already_reachable":[{"tier":0,"label":"A scheduled digest carrying the list","because":"this standard already requires the send role, so nothing new is needed for it"}],"ports":["escalate"]}],"registry":"https://aipathway.com.au/substrates.json"},"checks":[{"id":"one-copy-read-fresh","n":1,"title":"Every bot reads the one rules document fresh before it acts, never its own copy","statement":"Before it takes or holds any action, the build reads the business's rules document as it stands now: the limits, the release lists, the do-not-contact list, the contact hours and the stage holders. A limit typed into a prompt, a setting kept from an earlier run or a copy of the list is not a read. A rule a person changes applies on the next run.","assertable":"stub","ports":["read_rule","read_job","request_hold","send_message"],"stimulus":"The rules hold invoice.sent over $5,000. A $3,000 invoice comes due and is sent. The owner lowers the limit to $2,000, and an hour later a second $3,000 invoice comes due.","assertion":"The first invoice was sent. The second was not, and a hold names the rule invoice.sent over 2000. A read of the rules happened after the owner's change and before that hold. A build that sends the second invoice on the old limit fails."},{"id":"no-rule-held","n":2,"title":"An action with no matching rule is held, never taken","statement":"If the rules have no entry for the action a step is about to take, the action waits as a hold for a person. Nothing goes ahead because the rules forgot to mention it. The hold says there was no rule, so the person can release this one and write the rule for next time.","assertable":"stub","ports":["read_rule","read_job","request_hold","send_message"],"stimulus":"The rules cover invoice.sent and nothing else. A quote for $800 comes due to be sent to a customer.","assertion":"No quote was sent. One hold was requested for it, as a ref, with the rule recorded as no rule for quote.sent. A quote sent because nothing said to hold it fails."},{"id":"over-limit-held","n":3,"title":"An action over the amount the rules set raises a hold naming the rule, and waits","statement":"When the amount on the record is over the rule's over_amount, the build raises hold.requested with the record's ref, the amount and the rule that asked for it, and takes no action until the hold is released. At or under the amount it goes ahead. A rule with no amount holds every time.","assertable":"stub","ports":["read_rule","read_job","request_hold","send_message"],"stimulus":"The rules hold invoice.sent over $5,000. Three invoices come due: $4,200, exactly $5,000 and $7,800.","assertion":"The $4,200 and $5,000 invoices were sent. The $7,800 one was not, and one hold, with a ref for its id and status requested, names that invoice, its amount and the rule invoice.sent over 5000. Sending the $7,800 invoice, or holding the $5,000 one, fails."},{"id":"release-by-named-person","n":4,"title":"Only a person on that rule's release list releases or refuses, with who and when, and a release allows one action once","statement":"A hold is released or refused only by a decision a person made on the holds list, and only if that person is on the release_by list of the rule that asked for it. The hold keeps the person's name and the time. A release allows the one action it was raised for, taken once. A decision by anyone else, including another bot, changes nothing and goes to a person.","assertable":"stub","ports":["read_inbox","read_rule","read_hold","gate","send_message","escalate"],"stimulus":"Three invoices over the limit for the same customer wait on holds. The owner releases the first and refuses the second. The office manager, who is not on the release list, releases the third, and the owner's release of the first arrives twice. Then a fourth invoice over the limit comes due for that customer, and the next day the bot runs again.","assertion":"The first invoice was sent once, on its own hold, which is released with the owner's name and the time of her decision. The second is refused with her name and time and was not sent. The third is still held, and an escalation names the decision as an unauthorised releaser. The fourth waits on a new hold of its own. A release used for another invoice, or one accepted from someone off the list, fails."},{"id":"do-not-contact-stops","n":5,"title":"A customer on the do-not-contact list gets no send, chase or call","statement":"Before anything goes to a customer by email, text or phone, the build checks the customer's ref against the do-not-contact list in the rules. A customer on it gets nothing, whatever the amount or the stage, and the item stops with the reason for a person. It is not raised as a hold, because a release would contact them.","assertable":"stub","ports":["read_rule","read_job","send_message","escalate"],"stimulus":"ACME's Xero contact is on the do-not-contact list. An invoice email, a chase text and a chase call come due for ACME, and an invoice email for another customer.","assertion":"Nothing went to ACME. Each of the three items stopped with a do_not_contact escalation and no hold. The other customer's invoice was sent. A send, a text or a call to ACME fails."},{"id":"contact-hours","n":6,"title":"Nothing goes to a customer outside the contact hours in the rules","statement":"A send, a text or a call to a customer happens only inside the contact hours the rules set, read in the business's own timezone. Outside them the item waits, untouched, and goes on the first run inside them.","assertable":"stub","ports":["read_rule","read_job","send_message"],"stimulus":"Contact hours are 8am to 5pm, Monday to Friday, Brisbane time. A $400 invoice comes due at 8:30pm on Monday. The bot runs then, at 7:30am Tuesday and at 8:05am Tuesday.","assertion":"The invoice was sent once, on the 8:05am run, and no send happened outside the hours. A send at 8:30pm, or one timed by UTC rather than Brisbane, fails."},{"id":"no-bot-moves-money","n":7,"title":"No bot moves money: any payment is refused, whatever the rules or a release say","statement":"The rules document fixes nodes_may_move_money at false, and no rule or release changes it. A step that comes due to pay, refund or transfer is refused: no payment is released and no hold is raised for one, because a released hold would let a bot pay. The item stops with the reason for a person, who pays in their own banking.","assertable":"stub","ports":["read_rule","read_job","request_hold","release_payment","escalate"],"stimulus":"A $1,200 supplier payment comes due. The rules even carry a payment.made rule with the owner on its release list. Any hold raised for it, the owner releases, and the bot runs again.","assertion":"No release_payment happened and no hold was raised for the payment. The item stopped with an escalation naming the money rule. A build that pays once released fails."},{"id":"stage-holder-only","n":8,"title":"A bot not named in stage_holders for its stage does nothing","statement":"The rules name one bot per stage. Before a step, the build checks that it is the one named for that stage. If another bot is named, or none is, it takes no action, raises no hold and writes nothing, so two chase bots never both chase one invoice.","assertable":"stub","ports":["read_rule","read_job","request_hold","send_message","escalate"],"stimulus":"The rules name this bot for invoice-out and another bot for debtor-chasing, and name nobody for quote-out. An invoice email, a chase and a quote come due.","assertion":"The invoice was sent. The chase and the quote are untouched: no send, no hold, no escalation, still open. A build that chases another bot's invoice fails."},{"id":"survives-the-builder","n":9,"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 rules document and the holds list 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":10,"title":"The pass test passes","statement":"On the business's own systems: the owner writes the rules once. An invoice over the limit waits as a hold until the owner releases it, then goes once; a customer on the do-not-contact list gets nothing; nothing goes after hours. The owner lowers the limit, and the next run of every bot holds at the new one.","assertable":"production","ports":["read_rule","read_job","request_hold","read_hold","gate","send_message"],"stimulus":"The business's own job system or ledger, its mailbox, its rules document and its holds list. A real invoice over the limit, a real customer on the do-not-contact list, a send due after hours, then a lower limit.","assertion":"The holds list shows the hold with its rule, the owner's release with name and time, and one send for it. Nothing went to the do-not-contact customer or after hours. After the change, the next invoice over the new limit was held by every bot that sends one.","stubLimit":"Deliberately unpassable on a stub. On a stub every bot is one build reading one document, and the runner's clock is exact. In a business three bots built by three people each have a limit somewhere in a prompt, and the only proof none of them kept it is the next real invoice."}]}