Next-level: fix real char*/Agent* type-mismatch bug in cmd_tell#2
Open
SuperInstance wants to merge 11 commits into
Open
Next-level: fix real char*/Agent* type-mismatch bug in cmd_tell#2SuperInstance wants to merge 11 commits into
SuperInstance wants to merge 11 commits into
Conversation
added 11 commits
July 10, 2026 13:23
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.
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.
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.
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.
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.
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
Fixes the real, pre-existing bug flagged (but explicitly left out of scope) in an earlier round:
cmd_tell()calledcomms_tell(agent, room, target, message)wherecomms_tell's real signature expectsAgent *to, buttargetwas the raw tokenized string (the target's name), not anAgent*— a genuine compiler warning (incompatible pointer type), confirmed independently before and after this fix.What's real
room_find_agent_by_name()(iterates the room's real agent list,strcmpon names) and wiredcmd_tellto look up the realAgent*before callingcomms_tell, with a sensible error message when the target isn't present in the room.tests/test_command.c: message actually reaches the target's mailbox, does NOT reach the sender's own mailbox, and the not-found case reports a real error — wired intomake testalongside the existing 3 suites (now 4).CONFORMANCE.mdmarks T09 ✅; README's status/comparison-table conformance count updated 14/40 → 15/40, explicitly attributing T09's coverage totest_command(not conflating it with the separately-runconformance_simple.c, which is unchanged at its own real 14/14).Independent verification (by me, before opening this PR)
gcc -Wall -Wextra -c src/command.c -I src: the incompatible-pointer-type warning is gone, exit 0.make test: all 4 suites pass, including the 3 newtest_commandtests.src/conformance.c(the source of the "40" in "X/40") is never actually built by the Makefile (only the separate, smallertests/conformance_simple.c, which stays genuinely 14/14, unchanged by this PR). The README's new T09 bullet correctly attributes coverage totest_commandspecifically rather than implyingconformance_simple.cgrew — this is an honest, transparently-sourced claim, not a fabricated metric.