Skip to content

refactor: move shell concerns from npcpy into npcsh#162

Open
cagostino wants to merge 9 commits into
mainfrom
separate-history-memory
Open

refactor: move shell concerns from npcpy into npcsh#162
cagostino wants to merge 9 commits into
mainfrom
separate-history-memory

Conversation

@cagostino

Copy link
Copy Markdown
Contributor

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.

cagostino added 2 commits June 3, 2026 12:37
- 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

@celeria-ai celeria-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 npcpy to 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

  1. npcsh/history.py — 2038-line public module with no API docs. Exports like start_new_conversation, save_conversation_message, load_kg_from_db are now imported throughout the codebase but not documented.

  2. npcsh/build_funcs.py — New build functions for the /build command. 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.

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.

1 participant