gabriel / muse public
issue-2-sign-silent-failure.md markdown
63 lines 2.4 KB
Raw
sha256:2c28ee2f8955ec67b41a9f8606a52d873631c2ded2a7082b06de44fe37bbb45b fix: muse commit --sign now works for human identities, not… Sonnet 5 patch 1 day ago

muse commit --sign fails silently when no identity is resolvable for a human commit

Background

Companion to issue #1. Even once #1's gate bug is fixed, there's a second, independent inconsistency in the same code path in muse/cli/commands/commit.py:

signing = None
pre_signer_public_key = ""
if sign and resolved_agent_id:
    from muse.cli.config import get_signing_identity
    signing = get_signing_identity(root, agent_id=resolved_agent_id)
    if signing is not None:
        _, pre_signer_public_key = encode_public_key(signing.private_key)
    else:
        logger.warning(
            "No signing identity found for agent %r — commit will be unsigned. "
            "Run `muse auth keygen && muse auth register` to set up a keypair.",
            resolved_agent_id,
        )

When --sign is passed with --agent-id but that agent has no registered key, the else branch fires and a clear warning is logged.

When --sign is passed without --agent-id/MUSE_AGENT_ID at all (the human case), the entire if block was skipped before #1's fix — so there was no path to ever reach the warning, regardless of whether a human identity existed or not. Once #1 changes the gate to if sign:, a human commit with no identity configured will correctly reach get_signing_identity(), get None back, and hit the same else — except the warning message hardcodes agent phrasing ("No signing identity found for agent %r"), which reads wrong when resolved_agent_id is "".

Fix

Branch the warning message on whether resolved_agent_id is set, so a human commit with no identity gets human-appropriate phrasing instead of No signing identity found for agent '':

elif resolved_agent_id:
    logger.warning(
        "No signing identity found for agent %r — commit will be unsigned. "
        "Run `muse auth keygen && muse auth register` to set up a keypair.",
        resolved_agent_id,
    )
else:
    logger.warning(
        "No signing identity found — commit will be unsigned. "
        "Run `muse auth keygen && muse auth register` to set up a keypair."
    )

Acceptance criteria

  • muse commit -m "..." --sign as a human with no identity configured prints a clear, human-phrased warning (not agent '') and the commit succeeds unsigned, same as today's agent behavior.
  • muse commit -m "..." --sign --agent-id X with no key for X still prints the existing agent-phrased warning, unchanged.
File History 1 commit
sha256:2c28ee2f8955ec67b41a9f8606a52d873631c2ded2a7082b06de44fe37bbb45b fix: muse commit --sign now works for human identities, not… Sonnet 5 patch 1 day ago