Add the government_agency party role
check / check (push) Canceled after 0s

Regulators and registries that don't tax the company (a division of
corporations, a licensing board), distinct from tax_agency. Core Role,
MCP descriptions, viewer label/noun/icon, docs, and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GWVo7x3UHw5kwCUaWxiejX
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-10-15 20:21:11 -06:00
1 parent 2275948a64
commit 9927e56431
8 files changed
+27 -8

No files matched your search

+6 -1
View File
@@ -1079,6 +1079,7 @@ fn parties_lists_by_id_and_filters_by_role() {
let a = m.add_party("Acme Design", &["contractor"]);
let i = m.add_party("IRS", &["tax_agency"]);
let b = m.add_party("Bluevine", &["financial_institution"]);
let u = m.add_party("Utah Division of Corporations", &["government_agency"]);
let all = m.read_only("books.parties", json!({}));
assert!(all["year"].is_i64(), "defaults to this year");
let ids: Vec<u64> = all["parties"]
@@ -1087,7 +1088,7 @@ fn parties_lists_by_id_and_filters_by_role() {
.iter()
.map(|p| p["party_id"].as_u64().unwrap())
.collect();
assert_eq!(ids, [a, i, b]);
assert_eq!(ids, [a, i, b, u]);
let row = &all["parties"][0];
assert_eq!(row["name"], "Acme Design");
assert_eq!(row["label"], "Acme Design");
@@ -1098,6 +1099,10 @@ fn parties_lists_by_id_and_filters_by_role() {
let agencies = m.read_only("books.parties", json!({"role": "tax_agency"}));
assert_eq!(agencies["parties"].as_array().unwrap().len(), 1);
assert_eq!(agencies["parties"][0]["party_id"], json!(i));
// A regulator is its own role, not a tax agency.
let regulators = m.read_only("books.parties", json!({"role": "government_agency"}));
assert_eq!(regulators["parties"].as_array().unwrap().len(), 1);
assert_eq!(regulators["parties"][0]["party_id"], json!(u));
m.refuse("books.parties", json!({"role": "wizard"}));
}