refactor: move shell concerns from npcpy into npcsh#162
Conversation
- Added 10 new benchmark tasks covering shell, file-ops, python, data, text, system, and debug categories. - Fixed parse_trace in train_from_csv.py to extract [tool_call] markers and reconstruct Qwen3 <tool_call> JSON blocks for proper tool-use training data. - Added generate_tasks.py for rule-based benchmark task generation from conversation history. - Added append_tasks.py helper for curated task appending. - Staged prior session scripts: benchmark_to_sft, compile_and_train, extract_memories, extract_tasks, run_training_pipeline, train_npcsh_rl.
- Add npcsh.history with CommandHistory, conversation logging, memory lifecycle - Move build_funcs.py from npcpy to npcsh (CLI wrappers belong in shell) - Update npcsh._state, npcsh.npcsh, npcsh.routes to import from npcsh.history - Remove execute_brainblast_command dependency from npcsh - Bump version to 1.2.20, require npcpy>=1.4.29
There was a problem hiding this comment.
Documentation Gap: Architecture Mismatch
This refactor moves shell-specific concerns (command history, CommandHistory class, conversation persistence) from npcpy to npcsh. However, the documentation still describes the old architecture.
Issue in docs/guide.md
Line 18 states:
"The NPC Shell system integrates the capabilities of
npcpyto maintain conversation history..."
This is now architecturally incorrect. After this PR, npcsh/history.py owns conversation history, not npcpy.
Suggested Fix
The NPC Shell system integrates the capabilities of `npcpy` for NPC execution,
while `npcsh` maintains shell-specific concerns like conversation history and
command routing.Additional Documentation Gaps
-
npcsh/history.py— 2038-line public module with no API docs. Exports likestart_new_conversation,save_conversation_message,load_kg_from_dbare now imported throughout the codebase but not documented. -
npcsh/build_funcs.py— New build functions for the/buildcommand. The guide mentions the command but not the underlying functions.
Recommendation: Update docs/guide.md line 18 before merge to reflect the new module boundaries.
Adds npcsh.history with CommandHistory, conversation logging, and memory lifecycle. Moves build_funcs.py from npcpy to npcsh. Updates shell imports to use npcsh.history. Bumps version to 1.2.20.