test(core): every role the schema lists is a role the engine assigns

The schema's `ACCOUNT_ROLES` is now the list BS-ledger-8 names, not a list
read off any engine. The adapter passes `assign_role`'s key straight to
`Store::assign_role`, so a listed key this engine spelled differently
would turn an example into a refused assignment it did not ask for. The
new test walks the schema's list and requires `control_account` to resolve
every key, which is also the check that `other_deductions_payable` is now
listed and the internal-only roles are not.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-09 08:58:25 -07:00
1 parent eb073b53c6
commit 75533aeb45
1 file changed
+15
@@ -928,3 +928,18 @@ impl Books<'_> {
.unwrap_or_else(|r| panic!("{what}: {}", r.reason));
}
}
/// Every role the schema's list names is a role this engine's command
/// takes, spelled the same: the adapter passes `assign_role`'s key
/// straight to `Store::assign_role`, so a key this engine spelled
/// differently would make every example that named it a refused
/// assignment the example did not ask for.
#[test]
fn every_listed_role_is_the_engine_role() {
for &(role, _) in bookspec_checker::ACCOUNT_ROLES {
assert!(
ledger_core::control_account(role).is_some(),
"{role}: the schema names a role this engine does not have"
);
}
}