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 "..." --signas a human with no identity configured prints a clear, human-phrased warning (notagent '') and the commit succeeds unsigned, same as today's agent behavior.muse commit -m "..." --sign --agent-id Xwith no key forXstill prints the existing agent-phrased warning, unchanged.