fix(cli): restore Encodable synthesis for PendingCursorShellApproval
https://github.com/manaflow-ai/cmux/pull/9349 added a decode-only legacyCommand = "command" CodingKey plus a custom init(from:) to ClaudeHookSessionRecord.PendingCursorShellApproval, but no encode(to:). Swift refuses to synthesize Encodable when a CodingKeys case matches no stored property, so the cmux-cli target fails to compile on current main:
CLI/cmux.swift:155:12: error: type 'ClaudeHookSessionRecord.PendingCursorShellApproval' does not conform to protocol 'Encodable'
CLI/cmux.swift:227:18: note: CodingKey case 'legacyCommand' does not match any stored properties
Hit by two independent fleet builds of main (35e888dae0) tonight. Fix: explicit encode(to:) that writes the seven stored fields and never emits the legacy key, preserving the decode-side migration exactly. No behavior change for records written by the new code.
Open question for reviewers: how did #9349 pass its checks? Worth confirming the merge gate actually compiles cmux-cli.
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by CodeRabbit
- Bug Fixes
- Improved record serialization to consistently preserve fingerprints, timestamps, identifiers, display commands, lengths, and tool-use requirements.
- Excluded a legacy command field from serialized output to prevent outdated data from being written.