feat(paw_sign): append puppy signature to code-puppy git commits#480
Open
dudeinthemirror wants to merge 1 commit into
Open
feat(paw_sign): append puppy signature to code-puppy git commits#480dudeinthemirror wants to merge 1 commit into
dudeinthemirror wants to merge 1 commit into
Conversation
Add a builtin plugin that hooks pre_tool_call and appends a playful '[-- paw-signed: code-puppy --]' signature (with paw-print glyph) as an extra -m paragraph to git commit messages composed by code-puppy. Design notes: - Uses shlex to ANALYSE commands (respecting quotes), never to rebuild them, so shell substitutions / heredocs / exotic quoting are preserved. - Only signs when the 'git commit -m' invocation is the LAST segment in the chain, so chains like 'git commit && git push' are never corrupted. - Skips editor-style commits (no -m), already-signed commands (idempotent), and anything shlex can't parse cleanly. - The paw-print is stored as a \\U0001F43E unicode escape so the repo's emoji_filter doesn't strip it from the source on write. 18 unit tests cover the happy path, the conservative no-op cases, and helper internals.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a builtin plugin that paw-signs commit messages composed by code-puppy. When code-puppy runs a
git commit -m "...", the plugin tacks on an extra-mparagraph:So the audience knows the commit came from a very good boy.
How it works
Hooks
pre_tool_calland mutates theagent_run_shell_commandargs in place (same pattern as theemoji_filterplugin). Adds the signature as a second-m, which git stacks as a trailer-style paragraph at the bottom of the message.Safety / design
A corrupted
git commitis far worse than a missing paw print, so the detector is deliberately conservative:shlexonly to inspect the command (respecting quotes), never to reconstruct it — so shell substitutions$(...), heredocs, and exotic quoting in the original are preserved untouched.git commit -mis the LAST segment in the chain. This meansgit add . && git commit -m "x"gets signed, butgit commit -m "x" && git pushis left alone (no paw landing onpush).-m) and anythingshlexcan't parse cleanly.\\U0001F43Eunicode escape so the repo'semoji_filterdoesn't strip it from source on write.Testing
Config
No toggle — always on, keep it simple (YAGNI).