Skip to content

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

Merged
SuperInstance merged 2 commits into
next-level-2026-07-10from
gap-hunt-2026-07-11
Aug 21, 2026
Merged

fix(command): cmd_gossip signature mismatch (gap-hunt round 2)#4
SuperInstance merged 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.
@SuperInstance
SuperInstance merged commit f99660e into next-level-2026-07-10 Aug 21, 2026
3 checks passed
@SuperInstance
SuperInstance deleted the gap-hunt-2026-07-11 branch August 21, 2026 16:40
SuperInstance added a commit that referenced this pull request Aug 21, 2026
* start: round 3 production-hardening scaffold

* chore: remove stray agent-prompt file accidentally committed as filename

A prior agent session misinterpreted its own task instructions as a
filename, creating a literal 0-byte file whose name was the entire
prompt. Remove this stray artifact from tracking.

* chore: stop tracking compiled binaries; ignore build artifacts

Remove committed ELF binaries (holodeck, bin/holodeck, obj/main.o,
test_conf, test_conf_v2, test_full_conf) from tracking and update
.gitignore to cover executables, object files, and build directories.

* test: rewrite test_rooms.c against the real current room API

The old test_rooms.c was written against an abandoned graph-container
design (RoomGraph, graph_create_room, graph_connect, room_init,
room_add_exit, room_look) that does not exist in src/room.h, so it
never compiled.

Rewrite it to exercise the real current API (room_create/destroy,
room_connect/disconnect/find_exit, room_add_agent/remove_agent,
room_add_note/get_notes, room_is_booted/set_booted), covering:

- room lifecycle: create sets id/name/description; fresh room has no
  exits/notes/agents and is not booted; destroy is NULL-safe
- exits: connect+find, one-way semantics, multiple exits, disconnect
  removes one exit while preserving others, NULL-arg safety
- agents: add/remove adjust agent_count, re-add, remove-absent safety
- notes: LIFO head ordering, author/text content, chain, NULL-safety
- boot state: set/clear booted flag, NULL-safety

35/35 pass. Uses the repo's existing TEST()/PASS() lightweight macros.

* build: wire all three real test suites into 'make test'

Previously 'make test' only compiled and ran conformance_simple.c.
Add build rules for the two other real test files and run all three:

- test_conf   <- tests/conformance_simple.c  (14 tests)
- test_rooms  <- tests/test_rooms.c           (35 tests)
- test_serial <- tests/test_serial_bridge.c   (serial_bridge_test)

Each test is a separate file target with correct source deps so it
rebuilds only when its inputs change. 'make test' builds all three
then runs them; clean removes all test binaries. Combined: 49 named
assertions + serial bridge internal suite, all passing.

* ci: add GitHub Actions workflow running build + make test

No CI existed. Add .github/workflows/ci.yml that builds the holodeck
binary and runs 'make test' (all three suites) on every push and pull
request.

* start: next-level production hardening

* Fix cmd_tell: look up target Agent* by name before calling comms_tell

* Add end-to-end cmd_tell tests and wire into make test

* Mark T09/cmd_tell as fixed in README and CONFORMANCE

* Ignore test_command binary

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

* docs(readme): link holodeck siblings; remove broken image ref

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.

* fix(command): align cmd_gossip signature with command handler type

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.

---------

Co-authored-by: opencode <opencode@users.noreply.github.com>
Co-authored-by: PurplePincher Automation <automation@purplepincher.org>

* docs(readme): link holodeck siblings; remove broken image ref (#3)

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.

Co-authored-by: opencode <opencode@users.noreply.github.com>

---------

Co-authored-by: PurplePincher Automation <automation@purplepincher.org>
Co-authored-by: opencode <opencode@users.noreply.github.com>
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