{"spec":"AIP-BS-CUSTOMER-LINK","version":"2026-11-23","standard":"customer-link-build-standard","source":"https://aipathway.com.au/explore-ai/customer-link-build-standard","markdown":"https://aipathway.com.au/explore-ai/customer-link-build-standard.md","licence":"CC BY 4.0","how_to_read":"Six of these eight 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":8,"onStub":6,"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":["propose a link on a name, or on anything but an ABN, an exact email or an exact phone","propose a link between two records whose ABNs differ","link, reject or unlink anything without a decision by a person on the approvers list","treat a proposed, rejected or unlinked link as the same customer","find a customer's other records by searching on a name or a phone number","merge, rename, edit or delete a contact in the job system, the ledger or the mailbox","delete a link instead of unlinking it"],"stays_with_person":["linking, rejecting or unlinking every proposal","who is on the approvers list","every pair raised because their ABNs differ","tidying duplicate contacts inside the job system or the ledger, in that system"]},"job":"which records in which systems are one customer, linked by a person and read by every standard","skill":"customer-link","stub":"local.mock_customer_link","production":null,"product":null,"insert":null,"with_us":{"kind":"own_systems","note":"No hosted step. The link map is the business's own sheet, list or table, and the production check runs against its own job system, ledger and mailbox: a real customer proposed on a strong key, linked by the owner, and a do-not-contact flag on the ledger contact holding a chase raised from the job."}},"with_us_next":"No hosted step. The link map is the business's own sheet, list or table, and the production check runs against its own job system, ledger and mailbox: a real customer proposed on a strong key, linked by the owner, and a do-not-contact flag on the ledger contact holding a chase raised 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":["propose a link on a name, or on anything but an ABN, an exact email or an exact phone","propose a link between two records whose ABNs differ","link, reject or unlink anything without a decision by a person on the approvers list","treat a proposed, rejected or unlinked link as the same customer","find a customer's other records by searching on a name or a phone number","merge, rename, edit or delete a contact in the job system, the ledger or the mailbox","delete a link instead of unlinking it"],"stays_with_person":["linking, rejecting or unlinking every proposal","who is on the approvers list","every pair raised because their ABNs differ","tidying duplicate contacts inside the job system or the ledger, in that system"]},"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":["write_job","read_rule","read_contacts","write_ledger","read_inbox","draft_message","read_link","propose_link","write_link"]},{"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":"agent-proposes-only","n":1,"title":"An agent proposes a link; it never makes one","statement":"Whatever an agent finds becomes a proposal: the two refs, each as <system>:<id>, and the keys that matched. Nothing an agent does sets a link to linked, and no write_link happens without a person's decision behind it.","assertable":"stub","ports":["read_contacts","read_link","propose_link","write_link"],"stimulus":"A scan comes due over the job system, the ledger and the mailbox. ACME is customer 4471 in ServiceM8, contact ACME P/L in Xero with the same ABN, and ops@acme.com.au in the mailbox. Nobody has decided anything.","assertion":"Every proposal is proposed, names two refs from different systems, and carries the keys that matched. No write_link call happened and no link is linked. A proposal sent as linked, or a link the build made itself, fails."},{"id":"strong-key-never-name","n":2,"title":"A link is proposed on an ABN, an exact email or an exact phone, never on a name, and never across two ABNs","statement":"The build compares refs from different systems on strong keys only: the ABN, the email address and the phone number, each normalised. A name, however close, proposes nothing. Two records whose ABNs differ are two businesses: the pair is not proposed, and is raised for a person with both refs and the key that did match.","assertable":"stub","ports":["read_contacts","read_link","propose_link","escalate"],"stimulus":"The same scan. As well as ACME: two Sam Nguyens, one in Xero and one in ServiceM8, with different emails and phones and no ABN; and Harbour Builders in Xero and Harbour Builders (QLD) in ServiceM8, sharing office@harbour.com.au but with different ABNs.","assertion":"Exactly two proposals: ACME's ledger contact to its job-system client on the ABN, and the job-system client to the mailbox on the email. Every key a proposal names is equal on both records. No proposal joins the Sam Nguyens or the two Harbours, and one exception names both Harbour refs as an ABN conflict. A proposal on a name, or across two ABNs, fails."},{"id":"decision-names-a-person","n":3,"title":"Only a decision by an authorised person links, rejects or unlinks, and the record says who and when","statement":"A proposal becomes linked or rejected, and a link becomes unlinked, only from a decision a person made on the approval surface, and only if that person is on the list the business set. The link carries the decision's time and the person's name. A decision from anyone else, including another agent, is escalated and changes nothing.","assertable":"stub","ports":["read_inbox","read_rule","write_link","escalate"],"stimulus":"Three proposals. The owner links one, the office manager rejects one, and an auto-approver run by another agent links the third.","assertion":"The first is linked with the owner's name and the time of the owner's decision. The second is rejected with the manager's name and time. The third is still proposed, and an escalation names the decision as unauthorised_approver. Every write_link names a decision that arrived on the approval surface."},{"id":"read-accepted-links-by-ref","n":4,"title":"Every other step reads accepted links by the ref it holds, never a proposal and never a name search","statement":"A step that applies a customer-level rule, like do-not-contact, reads the links for the ref on its own record and applies the rule across every ref linked to it. Only linked links count: a proposal, a rejected link or an unlinked one is never read as the same customer. No step finds the customer's other records by searching on a name or a phone number.","assertable":"stub","ports":["read_link","read_rule","read_contacts","draft_message","escalate"],"stimulus":"ACME's Xero contact is on the do-not-contact list and is linked to ServiceM8 client 4471. One Sam Nguyen's Xero contact is on the list too, and a proposal (not linked) pairs it with the other Sam Nguyen's ServiceM8 client. A chase comes due for 4471, and one for the other Sam Nguyen.","assertion":"No chase is drafted for 4471, and an exception names the linked ref on the list. The other Sam Nguyen's chase is drafted, to the email on their own record. Every read_link names the ref the chase was for, and no search by name or phone ran. A chase drafted to ACME, or one held because of an unaccepted proposal, fails."},{"id":"unlink-read-fresh","n":5,"title":"Links are read fresh on every run, so an unlink takes effect on the next one and keeps its history","statement":"Before each step that applies a customer-level rule, the build reads the links again. A map read once and kept is not a read: an unlink made since would never reach it. An unlink changes the link's status, with who and when; it never deletes the link, and its refs and evidence stay as they were.","assertable":"stub","ports":["read_link","write_link","read_rule","draft_message"],"stimulus":"ACME's Xero contact is on the do-not-contact list and linked to 4471. A chase comes due for 4471. Then the owner unlinks the pair (the ServiceM8 client turned out to be a different ACME), and a week later another chase comes due for 4471.","assertion":"The first chase is held and the second is drafted, with a fresh read of 4471's links between the unlink and the draft. The link is unlinked with the owner's name and time, and its refs and evidence are unchanged. A second chase held on a cached map, or a link deleted rather than unlinked, fails."},{"id":"map-not-records","n":6,"title":"Linking writes the map, never the records: no contact is merged, renamed or deleted in a system of record","statement":"Once two refs are linked, the build writes nothing to either system to make them agree. It does not merge the contacts, copy a name or an email across, or delete the one it thinks is a duplicate. Any tidy-up in the job system or the ledger is a person's, in that system.","assertable":"stub","ports":["write_link","write_job","write_ledger"],"stimulus":"A proposal pairs ACME's Xero contact with ServiceM8 client 4471. The owner links it.","assertion":"The link is linked. No write_job or write_ledger call happened, and every customer record in every system is exactly as it was. A build that merges or edits a record after linking fails."},{"id":"survives-the-builder","n":7,"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 link map and the list of approvers 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":8,"title":"The pass test passes","statement":"On the business's own job system, ledger and mailbox: a real customer held in all three is proposed on a strong key, linked by the owner, and a do-not-contact flag on the ledger contact holds a chase raised from a job. Unlinked, the next chase goes. No record in either system was changed by the build.","assertable":"production","ports":["read_contacts","read_link","propose_link","write_link","read_rule","draft_message"],"stimulus":"A real customer in the business's own ServiceM8 or Simpro, Xero, MYOB or QuickBooks, and Outlook or Gmail. A scan, the owner's decision, a do-not-contact flag, an overdue invoice raised from that customer's job, then an unlink and a second chase.","assertion":"The map holds the proposal with its keys, the owner's link with name and time, and later the unlink. The first chase was held, the second drafted. Each system's audit history shows no write by the build.","stubLimit":"Deliberately unpassable on a stub. On a stub every email is lower case and every ABN has eleven digits because the runner typed them. In a real ledger the ABN is in a notes field, the email has a trailing space, and the job system holds the site contact rather than the accounts one."}]}