Conversation
chatdsg.py called load_dsg_to_db() with the old five-argument signature (object labelspace, room labelspace, uri, creds, graph), but heracles now takes (uri, creds, graph) and reads the labelspaces out of the graph metadata. Passing --scene-graph therefore raised TypeError, and the tmux launch components invoke ./chatdsg.py with no arguments at all, so the prior scene graph was never loaded. - Default --scene-graph to $ADT4_PRIOR_MAP/hydra/backend/dsg.json, which is the layout the launch system already forwards to the chatdsg pane. - Fix the load_dsg_to_db() call and drop the --object-labelspace and --room-labelspace flags; labelspaces now come from the graph itself. Warn via extract_labelspaces_from_dsg() when a graph carries none, rather than silently loading unlabeled objects and rooms. - Add --no-dsg-load, since loading calls initialize_db() and so clears the database on every startup. - Fall back to ADT4_NEO4J_* credentials when HERACLES_NEO4J_* is unset, for running the example outside tmuxp. - Configure logging so the startup messages print before the Textual app takes over the terminal. Fixes MIT-SPARK/Awesome-DCIST-T4#337
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.
Fixes MIT-SPARK/Awesome-DCIST-T4#337.
Problem
Two separate things were wrong:
chatdsg.pycalledload_dsg_to_db()with the old five-argument signature (object_labelspace, room_labelspace, uri, creds, graph), butheracles.utils.load_dsg_to_db()now takes(neo4j_uri, neo4j_creds, scene_graph)and reads labelspaces out of the graph metadata. Passing--scene-graphraisedTypeError.dcist_launch_systeminvoke./chatdsg.pywith no arguments, and the load was gated onif args.scene_graph:, so the prior scene graph was never loaded into Neo4j.Changes
--scene-graphnow defaults to$ADT4_PRIOR_MAP/hydra/backend/dsg.json— the layout the launch system already documents and forwards into the chatdsg pane.load_dsg_to_db()call and removed--object-labelspace/--room-labelspace. Labelspaces come from the graph.extract_labelspaces_from_dsg()is used to warn when a graph carries none, instead of silently loading unlabeled objects and rooms.--no-dsg-load. This is the one addition beyond the issue: loading callsinitialize_db(), which clears the database, so auto-loading means every startup wipes Neo4j. Worth a deliberate look — there is an existingfeature/chatdsg_optional_dsg_resetbranch suggesting the same need.ADT4_NEO4J_*whenHERACLES_NEO4J_*is unset, so the example works when run directly rather than under tmuxp.logging.basicConfig()so the startup messages actually print before the Textual app takes the terminal.No config regeneration is required:
dcist_launch_system/scripts/generate_configs.shproduces a zero diff, and both tmux configs that launch chatdsg already forwardADT4_PRIOR_MAPand mapHERACLES_NEO4J_*fromADT4_NEO4J_*.Testing
Run against a live Neo4j with
example_dsg.jsonstaged as a prior map.chatdsg.pywith no CLI arguments, exactly as the tmux components do: loaded 65 objects / 96 2D places / 5 rooms.seating,storage,sign,decor; rooms tohallway,lounge.--no-dsg-loadskips the load; unset$ADT4_PRIOR_MAPwarns instead of failing.pre-commitclean (ruff, ruff-format, whitespace).Note that
--scene-graphkeepsnargs="?", so a bare--scene-graphwith no value still falls through to the$ADT4_PRIOR_MAPdefault.