Prepare SCM product runtime release - #1
Merged
Conversation
saishshinde15
force-pushed
the
codex/product-grade-runtime
branch
from
July 9, 2026 09:00
1cc50f8 to
1ce28c0
Compare
saishshinde15
marked this pull request as ready for review
July 9, 2026 09:19
There was a problem hiding this comment.
Pull request overview
This PR prepares SCM for a product-grade “local-first” runtime release by standardizing a universal five-tool memory contract across the Python SDK, CLI, REST API, MCP server, JS SDK, and LangChain integrations, while also updating packaging, documentation, examples, and CI to support an installable release.
Changes:
- Standardized the canonical tool contract to
add_memory,search_memory,sleep,wake_summary,forget, preservingconsolidateas a backward-compatible alias across surfaces. - Added offline/no-key runtime support (OfflineLLM shim, hash embeddings) and updated SDKs/examples to verify offline quickstarts and contract behavior.
- Overhauled docs/README/changelog and expanded CI to include wheel-smoke + REST/MCP/JS contract smoke plus tracked-file secret scanning.
Reviewed changes
Copilot reviewed 38 out of 41 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_scm_sdk.py | Adds Python SDK smoke coverage for offline five-tool contract and package resource addressability. |
| tests/test_product_runtime_api.py | Adds REST /v1 contract coverage for tool listing + sleep/consolidate endpoints. |
| tests/test_mcp_contract.py | Adds MCP smoke test verifying tool listing and calling the five-tool contract (plus consolidate alias). |
| tests/test_cloud_auth.py | Adjusts test token string to avoid secret-like patterns. |
| src/llm/init.py | Introduces OfflineLLM shim and adjusts OpenAI-compatible token limit parameter handling. |
| src/integrations/tools.py | Renames consolidate tool to sleep, keeps consolidate as alias via tool lookup, updates add_memory response metadata. |
| src/integrations/memories_api.py | Adds /v1/memories/sleep endpoint and routes sleep/consolidate through pool wake-cache path. |
| src/integrations/mcp_server.py | Defaults to OfflineLLM, adds sleep/consolidate special handling, and adjusts activity bump semantics. |
| src/integrations/langchain_tools.py | Renames LangChain tool to sleep and keeps consolidate compatibility via method fallback. |
| src/integrations/langchain_adapter.py | Switches client adapter to POST /memories/sleep and aliases consolidate to sleep. |
| src/core/config.py | Changes default SCM_DATA_DIR to ~/.scm. |
| src/cli/main.py | Defaults to OfflineLLM/heuristic flow when no provider is configured; updates MCP CLI help text to use sleep. |
| src/api/main.py | Renames app branding to SCM and bumps API version strings to 0.9.0. |
| sdk/js/src/index.test.js | Adds JS SDK unit smoke tests for sleep endpoint, consolidate alias, auth header, and error handling. |
| sdk/js/src/index.js | Adds sleep() as canonical method and keeps consolidate() as an alias. |
| sdk/js/src/index.d.ts | Renames ConsolidateResponse → SleepResponse and updates typings for sleep + consolidate alias. |
| sdk/js/README.md | Updates JS SDK documentation to the five-tool contract and local server quickstart. |
| sdk/js/package.json | Bumps JS SDK metadata to 0.9.0 and updates repository/contact fields. |
| scm/runtime.py | Updates Python SDK wrapper to expose five-tool methods and adds offline=True support. |
| research/REPRODUCIBILITY_MANIFEST_2026_07_09.json | Adds machine-readable reproducibility manifest for release artifacts and paper hash. |
| README.md | Rewrites top-level README around product runtime + five-tool contract + offline quickstart and docs entrypoints. |
| pyproject.toml | Bumps package metadata/version to 0.9.0 and includes package data for runtime JSON/static assets. |
| examples/README.md | Updates examples to product-facing scripts runnable from an installed wheel. |
| examples/03_with_ollama.py | Removes Ollama-focused example in favor of product-facing examples. |
| examples/03_agent_integration.py | Adds minimal “agent integration pattern” example using the SDK offline mode. |
| examples/02_wake_summary.py | Removes prior wake-summary demo script. |
| examples/02_rest_server.py | Adds example that starts a temporary REST server and calls the five-tool API. |
| examples/01_quickstart.py | Updates offline quickstart to use the public SDK and print contract-shaped outputs. |
| docs/TUTORIAL_10MIN_CHATBOT.md | Replaces key placeholder text to avoid secret-like patterns. |
| docs/REPRODUCIBILITY.md | Adds reproducibility/runbook documentation for local checks and publication gates. |
| docs/README.md | Adds documentation index and clarifies product vs research doc paths. |
| docs/PHASES.md | Adds a maintained Phase 1–7 mapping document for product behavior. |
| docs/LANGCHAIN_GUIDE.md | Updates key placeholders to avoid secret-like patterns. |
| docs/INTEGRATIONS.md | Updates integration guidance to the sleep-based canonical tool contract. |
| docs/DEPLOYMENT.md | Updates key placeholders to avoid secret-like patterns. |
| docs/ARTIFACTS.md | Adds artifact bundle expectations (hashes/row counts) for the release. |
| docs/ARCHITECTURE.md | Adds a maintained architecture overview centered on the five-tool contract. |
| CHANGELOG.md | Adds v0.9.0-product-runtime release notes and verification checklist. |
| .gitignore | Ignores additional LaTeX build outputs and local tmp directory. |
| .github/workflows/ci.yml | Narrows test suite to product contract tests, adds secret scanning, and adds installed-wheel smoke + JS SDK smoke. |
Comments suppressed due to low confidence (1)
src/integrations/memories_api.py:140
- The REST sleep/consolidate fast-path calls pool.fire_sleep_now() without first ensuring an engine exists for the user. If a client calls /v1/memories/sleep before any add/search, fire_sleep_now returns ok=false ("no engine for user ..."). Consider creating the engine first so the endpoint behaves consistently for first-call users.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
84
to
+88
| _response, meta = engine.chat(text, force_versioning=replaces_prior) | ||
|
|
||
| concepts_total = int(meta.get("concepts_total", 0) or 0) | ||
| memory_id = meta.get("last_concept_id") | ||
| if ltm is not None and hasattr(ltm, "get_all_concepts"): |
| | Phase | Product behavior | Main implementation area | | ||
| |---|---|---| | ||
| | Phase 1: selective encoding | Decides which user information deserves memory formation. | `src/core/attention_gate.py`, `src/core/value_tagger.py` | | ||
| | Phase 2: event binding | Turns turns into event-like memory units with associations. | `src/core/event_compiler.py`, `src/core/association_binder.py` | |
Comment on lines
+1
to
+18
| import assert from "node:assert/strict"; | ||
| import test from "node:test"; | ||
|
|
||
| import { SCM, SCMError } from "./index.js"; | ||
|
|
||
| function mockFetch(handler) { | ||
| const calls = []; | ||
| globalThis.fetch = async (url, init = {}) => { | ||
| calls.push({ | ||
| url: url.toString(), | ||
| method: init.method || "GET", | ||
| body: init.body ? JSON.parse(init.body) : undefined, | ||
| headers: init.headers || {}, | ||
| }); | ||
| return handler(calls.at(-1)); | ||
| }; | ||
| return calls; | ||
| } |
saishshinde15
temporarily deployed
to
pypi-release
July 9, 2026 09:29 — with
GitHub Actions
Inactive
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
Prepare SCM as a product-grade open-source runtime backed by the July paper evidence.
This PR moves the public repo surface toward a local-first, installable SCM product with one five-tool contract across Python, CLI, REST, MCP, JavaScript, and LangChain.
What Changed
add_memory,search_memory,sleep,wake_summary,forget.consolidateas a compatibility alias for older integrations.SCM_DATA_DIRto~/.scm.Release Assets Prepared
The raw evidence bundles were built locally under
/tmp/scm-release-assetsand should be uploaded to the GitHub Releasev0.9.0-product-runtime:scm-alb-v02-canonical-1500.tar.gz16ed4ef250fd1ee57a6e61b3719d24c5f46c4d67ae655d27c7cf046ae938fad8scm-alb-v02-reference-4000.tar.gz0eb041d0d93418646d96375076ccf587846d1d7e3438f83e3ea47ac66ff82b53scm-ablation-1200.tar.gz378e31f4beebb0b92337681464979f027b95294f223d93cab670893c930e6126scm-mem0-official-500.tar.gzf256f3a182dbc68d45cd3d9074a56873a28de5f388f0272ea8e9a518ef0db369scm-real-llm-openai.tar.gzb052e1fee170f89b606937daf48e0cf346f9df0b913c99c9773c9a4b992aca44Verification
Verified in a clean staged-only worktree:
pytest tests/test_scm_sdk.py tests/test_product_runtime_api.py tests/test_mcp_contract.py tests/test_cloud_auth.py::test_byok_decryption_round_trip -q --tb=shortnpm testinsdk/jsgit diff --check --cachedpython -m build --wheel --sdisttwine check/tmpNotes
research-freeze-2026-07-09.