Skip to content

Harden SCM lifecycle behavior across public surfaces - #4

Merged
saishshinde15 merged 1 commit into
mainfrom
codex/scm-lifecycle-product-audit
Jul 9, 2026
Merged

Harden SCM lifecycle behavior across public surfaces#4
saishshinde15 merged 1 commit into
mainfrom
codex/scm-lifecycle-product-audit

Conversation

@saishshinde15

Copy link
Copy Markdown
Contributor

Summary

  • route SDK, CLI, MCP, and demo through one lifecycle engine builder
  • fix state-transition versioning so former values do not remain active
  • surface real sleep/schema stats and structured wake insights
  • document and diagnose the optional OpenAI provider setup

Validation

  • 88 focused lifecycle/product tests passed
  • clean wheel and sdist passed twine check
  • installed-wheel SDK and REST smoke checks passed
  • final OpenAI gpt-5.4-mini paper gate passed 6/6 with sanitized artifacts

Copilot AI review requested due to automatic review settings July 9, 2026 18:34
@saishshinde15
saishshinde15 merged commit 2f4ee95 into main Jul 9, 2026
6 checks passed

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 hardens SCM’s lifecycle behavior across its public surfaces (SDK, CLI, MCP server, REST, demo) by routing them through a shared lifecycle engine builder, improving state-transition/versioning handling, and making wake/sleep outputs more structured and diagnosable (including optional provider setup guidance).

Changes:

  • Centralized engine construction via build_lifecycle_engine so all surfaces consistently enable lifecycle features (sleep orchestration, schema extraction, wake summaries) and offline fallback.
  • Improved explicit “from X to Y” handling: contradiction detection + transition term extraction + normalization so former values don’t remain active in current memory/version lineage.
  • Made wake-summary insights JSON-structured (dicts) and expanded regression tests + docs for optional OpenAI(-compatible) provider setup and doctor diagnostics.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_scm_sdk.py Adds offline schema-extraction + structured wake-summary regression coverage.
tests/test_product_runtime_api.py Tightens REST wake-summary contract to require structured insights.
tests/test_llm_transition_normalization.py Verifies transition normalization drops former-state concepts and promotes current-state to fact.
tests/test_event_compiler.py Adds “from→to” contradiction + term extraction tests.
tests/test_contradiction_versioning.py Ensures explicit transition terms trigger version supersession correctly.
tests/test_cli_doctor.py Adds CLI doctor checks for optional provider configuration.
src/sleep/sleep_cycle.py Renames/extends curiosity-engine builder and wires schema stats into sleep cycle stats.
src/sleep/deep_sleep.py Filters schema extraction to user episodes and emits schemas_formed metric.
src/runtime_factory.py Introduces shared lifecycle engine builder used by all public surfaces.
src/llm/init.py Adds transition normalization, improves provider install error guidance, and applies normalization to JSON extraction.
src/integrations/tools.py Makes wake-summary insights structured and updates time handling + legacy stat aliasing.
src/integrations/mcp_server.py Routes MCP engine creation through the shared lifecycle factory.
src/core/long_term_memory.py Uses explicit transition terms to improve version-candidate selection and supersession behavior.
src/core/event_compiler.py Adds explicit transition parsing and treats transitions as contradictions.
src/cli/main.py Routes CLI engine build through factory; adds provider-configuration doctor check.
src/chat/engine.py Plumbs transition term tags into stored concepts; surfaces schema/contradiction stats in sleep results.
src/api/main.py Bumps API version to 0.9.2.
src/api/demo_router.py Routes demo engine creation through the shared lifecycle factory.
scm/runtime.py Routes SDK engine creation through the shared lifecycle factory and keeps wake/sleep routed through tool handlers.
scm/init.py Adds scm.__version__ and includes it in exports.
README.md Documents optional provider setup and explicit opt-in for LLM-backed curiosity filling.
pyproject.toml Bumps package version to 0.9.2.
docs/GETTING_STARTED.md Documents optional provider + curiosity opt-in environment variables.
CHANGELOG.md Adds v0.9.2 release notes matching lifecycle parity and transition/versioning changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/integrations/tools.py
Comment on lines 385 to 388
"narrative": getattr(summary, "narrative", "") or "",
"insights": [str(i) for i in insights[:20]],
"insights": [serialize_insight(insight) for insight in insights[:20]],
"schemas_formed": getattr(summary, "schemas_formed_count", len(insights)),
}
Comment thread src/runtime_factory.py
schema_extractor=SchemaExtractor(
config=SchemaExtractorConfig(
enabled=True,
min_repetitions=max(2, int(schema_min_repetitions)),
Comment thread src/runtime_factory.py
min_repetitions=max(2, int(schema_min_repetitions)),
)
),
enable_paraphrase=True,
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