Repository navigation
feat: memory_base.eval.sandbox serves the real REST API on a throwaway Postgres - #390
Merged
Merged
Conversation
…ans up on any stop
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
uv run python -m memory_base.eval.sandboxserves the real REST API on a throwaway Postgres and prints its URL, a key, the author, and an examplecurl. A PR's runtime evidence then comes from real HTTP requests without touching the deployment and without a temporary test file.The API subprocess inherits the environment:
DB_URLpoints at the throwaway DB, and the embedder, reranker and chat settings come from.env.EvalApi.__enter__now cleans up (terminates the subprocess, removes its temp dir) on any exception during boot, including a failedPopenand Ctrl-C; its timeoutRuntimeErroris unchanged.Owner decisions: reuse the eval parts (
throwaway_postgres,EvalApi,keys.new_key) rather than a new bash/compose path; the API uses the real.envservices.Review notes (GPT spec review ×3, two-axis review, a fix round, final two-axis review):
argvdropped, the README line moved into the Development code block.mcp_writer.run's three lines rather than gaining a shared helper;_prepare_schemastays private.throwaway_postgres's owndocker runcan leave a container in theCreatedstate (--rmnever applies to a container that did not start). Remove it withdocker rm -f $(docker ps -aq --filter label=memory-base-longmemeval).Related issues
None.
Runtime evidence (required for ingest / retrieval / serving behavior)
Background starts from the worktree (implementer and spec reviewer, independently):
/noteswith keykill -INTsandbox stoppedkill -TERMsandbox stoppedsandbox stoppedsandbox stoppeddocker buildsandbox stoppeddocker runsandbox stoppedCreatedcontainer (known limit above)Printed by a run (the key lives only in that throwaway DB):
RED before each change:
ImportError: cannot import name 'sandbox',assert [] == [True](EvalApi boot interrupt); thenAttributeError: … no attribute '_stop',assert not True(temp dir left after a failed Popen).Verification
uv run pytestpasses —tests/evalunit: 124 passeduv run ruff format --check .anduv run ruff check .passdocker compose build mcppasses (Dockerfile / dependency changes) — N/AChecklist (core principles)
doc_rowsand theturnslane.envskip-testslabel justified)