Marmot-TS
    Preparing search index...

    Function validateCommitLegality

    • The single shared seam adapter for commit legality: derives every argument validateAppComponentIntegrity, validateCommitAccountIdentityProofs, classifyDisbandCommit, and validateAdminLeafCoupling need from parentState/resultingState/proposals, so no seam re-derives them independently (the mdk#707 bug class — "a guard that exists on one seam only is a documented bug").

      Runs four checks, in this fixed order (D-07):

      1. validateAppComponentIntegrity — component-integrity (WIRE-03). A violation here returns immediately.
      2. validateCommitAccountIdentityProofs — account-identity-proof profile drift, changed-leaf proof validity, and replacement-leaf identity binding (D-01/D-02/D-03, UPD-01). Runs before disband/admin-leaf-coupling reasoning, so an invalid identity blocks a commit before any admin-set reasoning does. 0x8009 data appearing in the GroupContext dictionary itself still reports component-integrity (rejected earlier by step 1), so Phase 7 expectations hold. A violation here returns immediately; an undecidable outcome (Phase 9, D-03) is NOT returned yet — it is remembered and checks 3-4 still run, so a definite violation there still outranks it (the same precedence rule this function's own changed-leaf loop enforces internally).
      3. classifyDisbandCommit — disband-legality.
      4. validateAdminLeafCoupling — admin-leaf-coupling (CONV-01).

      The remembered undecidable detail from step 2, if any, is returned only after steps 3-4 both find no violation.

      Stays pure: reads two ClientState values, performs no I/O, and calls nothing from src/engine or src/client.

      Returns a CommitLegalityOutcome. Each calling seam supplies its own disposition: violation throws on send (D-02), yields rejected with the violation's reason on inbound (D-03), or drops the candidate edge on convergence/replay (D-04/D-09); undecidable MUST map to that seam's own existing deferral idiom, never to a terminal rejection (Phase 9, D-03, refs/marmot/foundation/errors.md lines 63-68). This adapter itself is seam-agnostic.

      Parameters

      • args: {
            committerLeafIndex?: number;
            parentState: ClientState;
            proposals: readonly (ProposalWithSender | Proposal)[];
            resultingState: ClientState;
        }

      Returns CommitLegalityOutcome

      • refs/mdk/crates/cgka-engine/src/account_identity_proof.rs validate_staged_commit_account_identity_proofs
      • refs/marmot/app-components/account-identity-proof-v2.md "Validation"