Skip to content

Prepare SCM product runtime release - #1

Merged
saishshinde15 merged 1 commit into
mainfrom
codex/product-grade-runtime
Jul 9, 2026
Merged

Prepare SCM product runtime release#1
saishshinde15 merged 1 commit into
mainfrom
codex/product-grade-runtime

Conversation

@saishshinde15

Copy link
Copy Markdown
Contributor

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

  • Rewrote the README around SCM as lifecycle memory, not only research code.
  • Added maintained public docs for architecture, Phase 1-7 mapping, reproducibility, artifacts, and docs navigation.
  • Standardized the canonical tool contract: add_memory, search_memory, sleep, wake_summary, forget.
  • Preserved consolidate as a compatibility alias for older integrations.
  • Added no-key/offline runtime support for first-user quickstarts.
  • Fixed wheel packaging for runtime JSON/static assets.
  • Set default SCM_DATA_DIR to ~/.scm.
  • Updated Python package metadata, URLs, author contact, and runtime dependencies.
  • Replaced examples with offline quickstart, REST server, and agent integration examples.
  • Updated JS SDK metadata and added path-level SDK tests.
  • Added CI coverage for installed-wheel smoke, REST contract smoke, JS SDK smoke, MCP contract smoke, and tracked-file secret scanning.
  • Added final paper PDF and machine-readable reproducibility manifest.

Release Assets Prepared

The raw evidence bundles were built locally under /tmp/scm-release-assets and should be uploaded to the GitHub Release v0.9.0-product-runtime:

Asset SHA256
scm-alb-v02-canonical-1500.tar.gz 16ed4ef250fd1ee57a6e61b3719d24c5f46c4d67ae655d27c7cf046ae938fad8
scm-alb-v02-reference-4000.tar.gz 0eb041d0d93418646d96375076ccf587846d1d7e3438f83e3ea47ac66ff82b53
scm-ablation-1200.tar.gz 378e31f4beebb0b92337681464979f027b95294f223d93cab670893c930e6126
scm-mem0-official-500.tar.gz f256f3a182dbc68d45cd3d9074a56873a28de5f388f0272ea8e9a518ef0db369
scm-real-llm-openai.tar.gz b052e1fee170f89b606937daf48e0cf346f9df0b913c99c9773c9a4b992aca44

Verification

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=short
  • npm test in sdk/js
  • git diff --check --cached
  • tracked-file secret scan
  • python -m build --wheel --sdist
  • twine check
  • clean installed-wheel SDK smoke from /tmp
  • offline quickstart example from installed wheel

Notes

  • Safety branch and tag were pushed as research-freeze-2026-07-09.
  • Heavy raw benchmark artifacts are intentionally not committed to Git.

@saishshinde15
saishshinde15 force-pushed the codex/product-grade-runtime branch from 1cc50f8 to 1ce28c0 Compare July 9, 2026 09:00
@saishshinde15
saishshinde15 marked this pull request as ready for review July 9, 2026 09:19
Copilot AI review requested due to automatic review settings July 9, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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, preserving consolidate as 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 thread src/integrations/tools.py
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"):
Comment thread docs/PHASES.md
| 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 thread sdk/js/src/index.test.js
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
saishshinde15 merged commit 2750228 into main Jul 9, 2026
6 checks passed
@saishshinde15
saishshinde15 temporarily deployed to pypi-release July 9, 2026 09:29 — with GitHub Actions Inactive
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.

2 participants