refactor(mcp): the party_id, document_id and cash_account aliases are removed (P5)

Agent reason: one name for one thing. S4 and S6 kept the old spellings "until
P5" so an agent that learned them did not break; P5 removes them, so the
schema an agent reads has one parameter for each fact and a call cannot name
the same thing twice with different answers.

books.create_invoice takes customer and books.create_bill vendor (a record's
id, its party's id or its name; required), no party_id.
books.receive_payment and books.pay_bill take invoice or bill and
deposit_to or paid_from, no document_id or cash_account; a payment names its
document and its account or is refused saying which to pass. A number that is
one record's id and another's name is still refused, never guessed (INVARIANT
6).

The over-the-wire tests that used the old spellings now use the new
(document_id becomes invoice or bill, cash_account becomes deposit_to or
paid_from, party_id becomes customer or vendor given as the id's text); the
one test that named the alias, party_id_alias_still_works, is now
a_customer_by_id_and_by_name_is_one_record and checks the same two spellings
of a customer, by id and by name, name one record.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-29 15:48:27 -06:00
1 parent 70a3f795f4
commit a319a64c3a
13 files changed
+81 -135

No files matched your search

+6 -6
View File
@@ -835,15 +835,15 @@ fn party_totals_match_a_hand_computed_year() {
);
let bill = m.ok(
"books.create_bill",
json!({"party_id": v, "date": "2026-07-01", "due_date": "2026-07-31",
json!({"vendor": (v).to_string(), "date": "2026-07-01", "due_date": "2026-07-31",
"vendor_ref": "D-1041",
"lines": [{"description": "Logo", "amount": "800.00", "account": "6000"}],
"upload_id": logo_invoice, "confirmed": true}),
);
let pay = m.ok(
"books.pay_bill",
json!({"confirmed": true, "document_id": bill["id"], "date": "2026-07-15", "amount": "300.00",
"cash_account": "1000"}),
json!({"confirmed": true, "bill": bill["id"], "date": "2026-07-15", "amount": "300.00",
"paid_from": "1000"}),
)["entry_id"]
.as_u64()
.unwrap();
@@ -917,14 +917,14 @@ fn party_totals_for_a_customer_a_member_and_a_prepaid() {
.unwrap();
let inv = m.ok(
"books.create_invoice",
json!({"party_id": c, "date": "2026-03-01", "due_date": "2026-03-31",
json!({"customer": (c).to_string(), "date": "2026-03-01", "due_date": "2026-03-31",
"lines": [{"description": "Work", "amount": "1000.00"}],
"confirmed": true}),
);
let pay = m.ok(
"books.receive_payment",
json!({"confirmed": true, "document_id": inv["id"], "date": "2026-03-20", "amount": "600.00",
"cash_account": "1000"}),
json!({"confirmed": true, "invoice": inv["id"], "date": "2026-03-20", "amount": "600.00",
"deposit_to": "1000"}),
)["entry_id"]
.as_u64()
.unwrap();