feat(extensions): add conversation-compiler extension#28
Open
ehfazrezwan wants to merge 15 commits intodevfrom
Open
feat(extensions): add conversation-compiler extension#28ehfazrezwan wants to merge 15 commits intodevfrom
ehfazrezwan wants to merge 15 commits intodevfrom
Conversation
…fest Define the interface all NeuralScape extensions must implement: - ExtensionManifest (Pydantic model with name, version, description, hooks) - NeuralscapeExtension (runtime-checkable Protocol with startup, shutdown, on_event, and get_routes methods)
Define canonical event types (conversation_turn, session_start, session_end, memory_stored, compile_requested) as an enum with corresponding Pydantic payload models for type-safe event dispatch.
ExtensionRegistry handles: - Auto-discovery from extensions/ subdirectories - Explicit registration via NEURALSCAPE_EXTENSIONS env var - Startup/shutdown lifecycle with graceful failure handling - Route mounting at /v1/extensions/<name>/ - Event broadcasting to extensions matching manifest.hooks
Integrate ExtensionRegistry into main.py: - Discover and start extensions during lifespan startup - Mount extension routes onto the app - Shutdown extensions during lifespan teardown - Add GET /v1/extensions endpoint to list registered extensions - Add POST /v1/extensions/events endpoint for external event posting
Cover the extension protocol, step-by-step creation guide, lifecycle (discovery → startup → events → shutdown), route mounting, event listening, configuration via env vars, and a skeleton example.
30 tests covering registration, lifecycle (startup/shutdown), event dispatch, route mounting, discovery (local + env var), graceful failure handling, /v1/extensions listing endpoint, event schemas, and protocol compliance.
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
conversation-compilerNeuralScape extension implementing Karpathy's "LLM Wiki" + coleam00's "Claude Memory Compiler" pattern/v1/extensions/conversation-compiler/(flush, compile, query, lint, status)Depends on
feature/extension-interface(merged into this branch)Test plan
uv run python -m pytest tests/ --ignore=tests/test_async_pipeline.py -v)