Skip to content

fix(command): cmd_gossip signature mismatch (gap-hunt round 2) - #4

Open
SuperInstance wants to merge 2 commits into
next-level-2026-07-10from
gap-hunt-2026-07-11
Open

fix(command): cmd_gossip signature mismatch (gap-hunt round 2)#4
SuperInstance wants to merge 2 commits into
next-level-2026-07-10from
gap-hunt-2026-07-11

Conversation

@SuperInstance

Copy link
Copy Markdown
Owner

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_gossip was declared as cmd_gossip(Agent*, Room*, const char*), which doesn't match the command-handler function-pointer type every other command uses ((Agent*, const char*)) and that command_register/command_execute expect. 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 (matching comms_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_sender and test_gossip_requires_message, wired into make test. 35/35 + 0-failures + 5/5 = all green.

CI run: 29165412314 (success, per kimi's report — worth double-checking on this PR too).

OpenCode and others added 2 commits July 10, 2026 17:14
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants