refactor(rustd): a connector is a descriptor, and a fault is not a posture
Two names Indy caught, and one of them was a regression against the Zig's own rule rather than a port of it. `credentials/integration.zig`'s header states RULE CFG outright — "a connector is a descriptor in REGISTRY, not a branch in the broker's mint dispatch" — and `mintsOnDemand(registry, id)` takes its registry as a parameter so a test can inject a fake. The enum collapsed both away. It read well at five connectors and cost three edits at six: the variant, the spelling, and the supply, each in a different function, each easy to get right and easy to forget. Now it is `Connector` + `Connectors` + `Descriptor` + `Registry`, which is `afd_fleet_runtime::provider`'s shape byte for byte. That module solves the same problem for webhook signature schemes — declared data now, a crate-backed client later, one trait so callers cannot tell the difference — and two registries in one workspace answering the same kind of question should not be two different designs. Adding a connector is one entry in `DECLARED`. The mint exchange attaches later as a second trait a descriptor implements; nothing in this file moves when it does, and no caller learns about it. That is the reason the seam is a trait now rather than after the broker lands. `Supply` is two arms rather than a bool, because the two answers are not "yes" and "not yes" — they are two delivery mechanisms, and a reader meeting `supply()` should not have to remember which way round a bool went. The exhaustiveness the enum gave up is bought back by tests: every declared name resolves, no name is declared twice, and only `static` is inline. `Mintable.integration` is the connector's NAME, not a `&dyn Connector`. That value travels on the execution policy and the broker resolves it again through its own registry; borrowing would tie a whole lease to the registry's lifetime for a string it is about to serialize. Separately: `admit/posture.rs` is now `admit/fault.rs`. `Posture` is already taken by the money path — it is `billing.usage_ledger.posture`'s own spelling, so it keeps the name — and the module beside it meant `admit/mod.rs` imported `posture::PAYER` and `Posture` on adjacent lines for two unrelated questions: who pays, and what a dead datastore means. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
K
Kishore Kumar committed
36a656cb7ff7e1892154e9a14d341e46366706e0
Parent: 20e83a9