feat: comprehensive requiresUnrestrictedMode detection
Previous detection had two problems: it only checked required_signers without collateral, and that check was wrong — required_signers is actually allowed in ORDINARY/MULTISIG by the v8 lib (only POOL_REGISTRATION modes forbid it). Replace with detection that mirrors the lib's per-mode rejection rules in parsing/transaction.ts: - Pool registration combined with any other cert (POOL_REGISTRATION_* requires a sole pool reg cert; lib AUTO throws CANNOT_DETERMINE). - Pool registration alongside Plutus signals (mutual exclusion). - Any cert/withdrawal/voter credential that resolves to a bare KEY_HASH (no matching signing file). ORDINARY needs KEY_PATH, MULTISIG needs SCRIPT_HASH; nothing else accepts KEY_HASH outside PLUTUS (only auto-inferred via collateral or other Plutus signals). - Mixed KEY_PATH + SCRIPT_HASH signals (lib AUTO can't decide ORDINARY vs MULTISIG, throws CANNOT_DETERMINE). - Pool retirement in a multisig-shape tx (MULTISIG rejects pool retirement). A new collectCertCredentials helper enumerates the credential fields a non-unrestricted mode actually validates per cert (stakeCredential, dRepCredential, coldCredential — but not the hotCredential on AUTHORIZE_COMMITTEE_HOT, which the lib doesn't constrain per mode). Known gap: device-owned outputs in a multisig-shape tx (MULTISIG forbids device-owned outputs). Detecting this needs change-output path → address resolution and is deferred; the lib catches it with a clear per-rule error if hit. Tests rewritten to use the new auto-detect triggers (pool reg + extra cert; key-hash credential with no matching signing file), constructed by mutating decoded bodies to avoid hand-crafted CBOR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>