{"spec":"AIP-BS-DUPLICATE-BILL-HOLD","version":"2026-11-28","standard":"duplicate-bill-hold-build-standard","source":"https://aipathway.com.au/explore-ai/duplicate-bill-hold-build-standard","markdown":"https://aipathway.com.au/explore-ai/duplicate-bill-hold-build-standard.md","licence":"CC BY 4.0","how_to_read":"Nine of these eleven 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 with us. 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 on the production provider (see with_us_next)","evidence_required":"not a software check. Attach what proves it"},"tally":{"total":11,"onStub":9,"productionOnly":1,"partial":2,"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":["pay, approve, void or edit a bill","change a supplier's bank details, or contact a supplier using details from the bill or its email","release its own hold","report a bill clear when the ledger could not be read in full","raise the same pair twice when nothing on either bill has changed"],"stays_with_person":["releasing or voiding each held bill, by name","ringing the supplier on a number already on file before releasing a bank detail hold","every bill reported not checked, before it goes in the pay run","merging a supplier entered twice, and fixing the bank details on a supplier record"]},"job":"no supplier bill is paid twice, and no payment goes to a bank account that changed by email, because both are caught before the pay run","skill":"duplicate-bill-hold","stub":"local.mock_bill_ledger","production":"office_voice.list_paid_bills","product":"AI Pathway","insert":null,"with_us":{"kind":"office_voice_tool","provider":"office_voice.list_paid_bills","product":"AI Pathway","note":"Two read-only tools on the AI Pathway connector read the ledger for this check: list_bills returns the bills awaiting payment and list_paid_bills the bills paid since a day, with the supplier's contact id, invoice number, dates and total. Paid bills are read from Xero today. Neither reads supplier bank details yet, so rule 5 runs on the business's own data (its own ledger connection or a supplier list it exports) until the connector does."}},"with_us_next":"Two read-only tools on the AI Pathway connector read the ledger for this check: list_bills returns the bills awaiting payment and list_paid_bills the bills paid since a day, with the supplier's contact id, invoice number, dates and total. Paid bills are read from Xero today. Neither reads supplier bank details yet, so rule 5 runs on the business's own data (its own ledger connection or a supplier list it exports) until the connector does. Call it on the AI Pathway MCP (office_voice.list_paid_bills): the owner mints a key at connect.aipathway.com.au/app/keys with the scope the tool names, on any AI Pathway account. There is no production run of these checks yet, so the stub run is the finished build; AIPATHWAY_PROVIDER=office_voice.list_paid_bills needs a live port map that is not published. Do not hand-roll the write.","default_path":"The live step runs on AI Pathway by default: list_paid_bills on the AI Pathway MCP, from any AI Pathway account. Build everything else to the standard, then have the owner mint a key at connect.aipathway.com.au/app/keys with the scope the tool names. Do not ask the owner to create a developer app or copy client keys, and do not write the live step yourself.","boundary":{"never":["pay, approve, void or edit a bill","change a supplier's bank details, or contact a supplier using details from the bill or its email","release its own hold","report a bill clear when the ledger could not be read in full","raise the same pair twice when nothing on either bill has changed"],"stays_with_person":["releasing or voiding each held bill, by name","ringing the supplier on a number already on file before releasing a bank detail hold","every bill reported not checked, before it goes in the pay run","merging a supplier entered twice, and fixing the bank details on a supplier record"]},"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_ledger","evidence","read_rule","write_ledger","request_hold","read_hold"]}],"registry":"https://aipathway.com.au/substrates.json"},"checks":[{"id":"every-approved-bill-checked","n":1,"title":"Every approved bill waiting to be paid is checked before the pay run","statement":"Each run covers every supplier bill that is approved and awaiting payment at the pay run cutoff. Each one ends the run clear, held or not checked, with nothing skipped. Drafts and bills still awaiting approval are left out. The cutoff and the pay run day are settings the business keeps, and a bill entered after the cutoff waits for the next run.","assertable":"stub","ports":["read_rule","read_ledger","evidence"],"stimulus":"Twenty bills: approved and awaiting payment, paid, a draft, one awaiting approval and one entered after the cutoff. The build runs four times across the day.","assertion":"In every run, every bill in scope at its start has exactly one result, and no draft, bill awaiting approval, bill entered after the cutoff, paid bill or voided bill has one."},{"id":"same-supplier-same-number","n":2,"title":"The same supplier and the same invoice number is held, however it was typed","statement":"A bill is held when another bill from the same supplier, matched by the supplier's id in your accounts and never by name, carries the same invoice number. Numbers are compared after case, spaces, punctuation and leading zeros are taken out, so INV-0042 and inv 42 are the same number.","assertable":"stub","ports":["read_ledger","request_hold"],"stimulus":"A bill numbered inv 42 awaiting payment, and the same supplier's INV-0042 paid two weeks earlier, for the same amount.","assertion":"The same_invoice_number holds raised in the first run are exactly the pairs the standard's comparison finds: that pair, and nothing from the clean set."},{"id":"same-supplier-same-amount","n":3,"title":"The same supplier and the same total within a few weeks is held, even with different invoice numbers","statement":"A bill is held when another bill from the same supplier has the same total and an issue date within the window (a setting, 30 days unless the business changes it), and the invoice numbers differ or one is missing. A supplier who sends a second copy with a new number is caught this way.","assertable":"stub","ports":["read_ledger","request_hold"],"stimulus":"Two bills from one electrician for $1,980.00 a week apart, one with no invoice number; a weekly cleaner's $450.00 bill a week after the last; and near misses: the same supplier at a different total, and monthly rent 31 days apart.","assertion":"The same_amount_in_window holds raised in the first run are exactly the pairs the standard's comparison finds, with nothing for the near misses."},{"id":"supplier-entered-twice","n":4,"title":"The same invoice number and total on two supplier records is held","statement":"A bill is held when a bill on a different supplier record carries the same invoice number, after the same clean-up, and the same total. That is one supplier entered twice in your accounts, and the second record is how the bill gets paid twice.","assertable":"stub","ports":["read_ledger","request_hold"],"stimulus":"Invoice SI-7781 for $3,302.50 paid to one supplier record, and SI 7781 for $3,302.50 awaiting payment on a second record for the same supplier; and an invoice number shared by two suppliers at different totals.","assertion":"The supplier_entered_twice holds raised in the first run are exactly the pairs the standard's comparison finds, with nothing for the shared number at different totals."},{"id":"bank-details-held","n":5,"title":"A bill whose bank details changed or belong to another supplier is held","statement":"A bill is held when its supplier's bank account is different from the account that supplier was last paid to, or matches the account on another supplier's record. The person who checks it never uses a phone number or email address from the bill or from the email that came with it. They ring the supplier on a number already on file from before the change.","assertable":"both","ports":["read_ledger","request_hold"],"stimulus":"A timber supplier whose account changed since last month's payment, and a new supplier whose account is the same as a paint supplier's.","assertion":"The bank_changed and bank_shared holds raised in the first run are exactly the ones the standard's comparison finds, each showing both accounts.","stubLimit":"On the stub the bank details are rows the runner chose. Live, they come from the supplier records in the business's own accounts, read through its own sign-in, and only a real file shows whether a change was made by the business or by someone who got into the inbox."},{"id":"both-bills-side-by-side","n":6,"title":"Each hold shows both bills side by side and the rule that fired","statement":"Every hold names the rule that fired and shows both bills: supplier, invoice number, date, total, status and paid date, and the bank account each was or would be paid to. A bank detail hold that matches another supplier shows that supplier and its account. The person deciding never has to go looking for the other bill.","assertable":"stub","ports":["request_hold"],"stimulus":"The holds from an ordinary first run.","assertion":"Every hold names one of the five rules and carries two bills (one bill and the other supplier for bank_shared), each with every field equal to the ledger at the time it was raised, and an owner."},{"id":"a-person-releases","n":7,"title":"A person releases or voids each hold, and the bot never touches a bill","statement":"A held bill stays held until a person releases it or voids it. The bot never pays, approves, voids or edits a bill and never changes bank details. A release is logged with the person's name and the time, and only then does the bill count as clear for the pay run.","assertable":"both","ports":["read_hold","write_ledger","evidence"],"stimulus":"The holds are raised; the bookkeeper releases the cleaner's weekly bill and voids the second skip bin bill; the build runs again.","assertion":"No write reaches the ledger in any run, and every bill reported clear after a hold on it was raised has every such hold released by a named person before the result.","stubLimit":"On the stub a release is a row the runner adds. Live, the release has to come from a named person through the business's own approval step, and only the ledger's own history proves nothing was changed."},{"id":"never-clear-on-a-partial-read","n":8,"title":"A bill that could not be compared in full is reported not checked, never clear","statement":"When your accounts cannot be read in full (the paid bills come back cut short, or the supplier bank details cannot be read), each bill it could not compare is reported as not checked, with what was missing. A run that read only part of your accounts never says a bill is clear.","assertable":"stub","ports":["read_ledger","evidence"],"stimulus":"The same ledger, with the paid bills read cut to the most recent half and the bank details unreadable.","assertion":"No bill is reported clear in any run, and every bill in scope that is not held is reported not checked."},{"id":"raised-once","n":9,"title":"The same pair is raised once, and a released pair stays released unless something changes","statement":"A pair of bills is raised once under each rule, however many times the check runs. Once a person releases it, it stays released, unless the amount, the invoice number or the bank details on either bill change. Then it is raised again as new.","assertable":"stub","ports":["read_hold","request_hold"],"stimulus":"Four runs. After the second, a person releases the cleaner's pair; after the third, the supplier reissues that bill under a new number.","assertion":"Each pair has one hold per state of its bills: every pair has one hold, and the reissued pair has exactly two, the second raised after the change."},{"id":"survives-the-builder","n":10,"title":"It keeps working if the person who built it leaves","statement":"Someone other than the person who built it 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 check 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":11,"title":"The pass test passes","statement":"In a test file of your own accounting software, enter a set of bills with one known duplicate for each rule and a clean set of near misses. Run the check. Every seeded duplicate is held with both bills and the rule that fired, the clean set has no holds, and the ledger's own history shows nothing was written.","assertable":"production","ports":["read_ledger","request_hold","write_ledger"],"stimulus":"A seeded test file in the business's own ledger: one duplicate per rule, a clean set of near misses, and the check run twice.","assertion":"Every seeded duplicate held once with both bills and its rule; zero holds on the clean set; the second run raises nothing new; the ledger's history shows no change made by the check.","stubLimit":"Deliberately unpassable on a stub. On a stub the bills are rows in the runner's memory; live, they have to be read from a ledger the business owns, through its own sign-in, with its own contact ids and its own bank detail fields, and the ledger's own history is the only proof nothing was written."}]}