fix(command): cmd_gossip signature mismatch (gap-hunt round 2) - #4
Open
SuperInstance wants to merge 2 commits into
Open
fix(command): cmd_gossip signature mismatch (gap-hunt round 2)#4SuperInstance wants to merge 2 commits into
SuperInstance wants to merge 2 commits into
Conversation
Base off next-level-2026-07-10 (cmd_tell/T09 fixed -> 15/40). - Up to date: fixed a real defect — README ended with <img src=callsign1.jpg> but no image file is tracked anywhere in the repo (verified via git ls-tree). Removed the broken reference. - Inter-connective: holodeck-go and holodeck-zig were named in the comparison table but never linked; added repo links (both verified to exist). - Educational tone: already strong (byte-level explanations, honest 15/40 count); left intact.
The gossip command was registered with the two-arg handler signature expected by command_execute, but cmd_gossip was declared/defined with three args (Agent*, Room*, const char*). Calling it through the handler pointer is undefined behavior and could crash or read garbage for the message argument. - Reduce cmd_gossip to the standard (Agent*, const char*) signature. - Look up the sender's room at dispatch time. - Add test coverage for the gossip command. - Update README/help text to match the current local-echo behavior.
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.
Gap-hunt pass (kimi), independently re-verified by me (rebuilt + reran
make test, confirmed 5/5 command tests pass including 2 new gossip tests, confirmed no leftover compiler warning).Bug:
cmd_gossipwas declared ascmd_gossip(Agent*, Room*, const char*), which doesn't match the command-handler function-pointer type every other command uses ((Agent*, const char*)) and thatcommand_register/command_executeexpect. Real risk of UB/miscompilation the moment gossip is dispatched through the generic handler table.Fix: matched the signature to the real handler type, looked up the room via
agent_get_room()internally (matchingcomms_gossip's real signature) instead of taking it as a parameter nothing actually supplied correctly.Doc fix in the same pass: README/help both claimed gossip "broadcast to the entire world" — the real implementation only echoes locally to the sender. Corrected to describe actual behavior rather than deleting the feature or leaving the false claim.
Tests: added
test_gossip_echoes_to_senderandtest_gossip_requires_message, wired intomake test. 35/35 + 0-failures + 5/5 = all green.CI run: 29165412314 (success, per kimi's report — worth double-checking on this PR too).