[codex] Add Loominary local archive service#32
Open
Coldaine wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a versioned “local archive” contract and a small loopback-oriented HTTP service (including an MCP-style JSON-RPC tool surface) so other local AI tools can list/search/fetch Loominary conversation + context data from disk.
Changes:
- Added archive contract validation/loading + in-memory search indexing and branch-tree projection.
- Added a local HTTP server with REST endpoints and an MCP
tools/list+tools/callsurface. - Added fixture archives, Node-based tests, and documentation for consumers and the trust/auth model.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/http-service.test.mjs | Exercises REST + MCP endpoints and token/unauth behavior against fixtures. |
| tests/archive-loader.test.mjs | Tests archive loading, search behavior, and branch tree projection. |
| tests/fixtures/archive-v1/manifest.json | Fixture manifest for the v1 archive layout/trust model. |
| tests/fixtures/archive-v1/conversations/conv-alpha.json | Fixture conversation including branching. |
| tests/fixtures/archive-v1/conversations/conv-beta.json | Fixture conversation for search/list coverage. |
| tests/fixtures/archive-v1/contexts/conv-alpha.json | Fixture captured context (project + memories). |
| tests/fixtures/archive-v1/annotations.json | Fixture tags + favorites annotations. |
| server/service/mcpSurface.mjs | MCP JSON-RPC handler exposing archive operations as tools. |
| server/service/httpServer.mjs | Local HTTP server with REST routes + /mcp POST handling + auth gate. |
| server/loominary-local-service.mjs | CLI entrypoint to load an archive and start the local service. |
| server/archive/searchIndex.mjs | Builds/searches a simple in-memory full-text index + excerpt building. |
| server/archive/loadArchive.mjs | Loads and validates archive files; provides LoomArchive query APIs. |
| server/archive/contract.mjs | Schema version constants + contract validation helpers. |
| docs/local-service-consumer-guide.md | Consumer-facing guide with REST/MCP examples and expectations. |
| docs/local-archive-contract.md | Formal v1 archive contract documentation and trust/index lifecycle notes. |
| README.md | Updates README to point to the new local integration surface + docs. |
| package.json | Adds local-service and test:local-service scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!manifest.layout || typeof manifest.layout !== 'object') { | ||
| throw new Error('Archive manifest is missing layout.'); | ||
| } | ||
|
|
Comment on lines
+9
to
+18
| function parseArguments(args) { | ||
| if (!args) { | ||
| return {}; | ||
| } | ||
|
|
||
| if (typeof args === 'string') { | ||
| return JSON.parse(args); | ||
| } | ||
|
|
||
| return args; |
Comment on lines
+21
to
+28
| async function readJsonBody(request) { | ||
| const chunks = []; | ||
| for await (const chunk of request) { | ||
| chunks.push(chunk); | ||
| } | ||
|
|
||
| const body = Buffer.concat(chunks).toString('utf8'); | ||
| return body ? JSON.parse(body) : {}; |
| ## Contributing | ||
|
|
||
| A contributing guide and development roadmap are on the way. In the meantime, if you have any idea, please [open an discussion](https://github.com/Laumss/Loominary/discussions). No newline at end of file | ||
| A contributing guide and development roadmap are on the way. In the meantime, if you have any idea, please [open an discussion](https://github.com/Laumss/Loominary/discussions). |
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.
What changed
Why
Sprint 2 called for the first real local integration surface promised in the README. This PR turns that promise into a narrow, provider-agnostic local API that other tools can consume.
Validation
npm run test:local-service