You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These operations are owned by separate memory modules: memory.coverage, memory.ingest.receipts, and memory.staleness.
The full sequence is not duplicated in the CLI surface. CLI memory coverage is a standalone reporting path, not an equivalent propose-on-finish workflow.
_session_memory_mixin.py is also an overloaded module: 734 LOC, fan-out 22, overloaded score approximately 0.938. It combines retrieval, governance dispatch, auto-sync, projection rebuild, scope resolution, and finish proposal behavior.
Expected Behavior
A transport-neutral propose-on-finish workflow should be owned by a surface-neutral application service. MCP should parse tool arguments, invoke the service, and render the bounded response.
The final owner should be validated explicitly during implementation — likely a memory application/workflow service or a controlled-change memory service — rather than assumed from package convenience.
Actual Behavior
The MCP surface defines the workflow ordering and coverage/staleness accounting semantics. A future CLI, IDE, or internal consumer would need to reproduce that order to obtain equivalent behavior.
Impact
Medium to high — No correctness bug is demonstrated today, but workflow semantics are coupled to one transport. This creates drift risk for future surfaces and makes changes to proposal/staleness accounting depend on MCP internals.
Proposed Direction
Extract a surface-neutral application operation for propose-on-finish.
Return a typed result containing proposal outcome, coverage before/after, coverage delta, and staleness effects.
Keep MCP-only argument parsing, error mapping, response budgeting, and payload shaping in _session_memory_mixin.py.
Preserve Engineering Memory authority rules: memory must not grant edit permission or override findings, gates, Patch Trail, edit_allowed, or do_not_touch.
Add contract tests for workflow ordering and result parity at the application-service boundary.
Acceptance Criteria
The coverage → proposal → staleness → coverage sequence has one surface-neutral owner.
_session_memory_mixin.py delegates the workflow and retains only MCP adaptation.
[Architecture] Move propose-on-finish memory orchestration out of the MCP surface
Labels:
enhancement,architecture,memory,mcpPriority: P1 (architecture triage)
Subject:
codeclone/surfaces/mcp/_session_memory_mixin.py::finish_propose_memorySignal:
domain_logic_leakage(+responsibility_overload)Triage run:
1f2fd12a(health 91/A)Summary
finish_propose_memoryin the MCP surface owns a transport-neutral Engineering Memory workflow order:The individual operations already live in
codeclone.memorymodules, but their required composition is defined only inside the MCP adapter.Environment
1f2fd12a)Current State
codeclone/surfaces/mcp/_session_memory_mixin.py::finish_propose_memorycomposes:compute_scope_coveragebefore proposal;propose_memory_from_changed_paths;apply_scope_staleness;compute_scope_coverageafter proposal;memory.coverage,memory.ingest.receipts, andmemory.staleness._session_memory_mixin.pyis also an overloaded module: 734 LOC, fan-out 22, overloaded score approximately 0.938. It combines retrieval, governance dispatch, auto-sync, projection rebuild, scope resolution, and finish proposal behavior.Expected Behavior
A transport-neutral propose-on-finish workflow should be owned by a surface-neutral application service. MCP should parse tool arguments, invoke the service, and render the bounded response.
The final owner should be validated explicitly during implementation — likely a memory application/workflow service or a controlled-change memory service — rather than assumed from package convenience.
Actual Behavior
The MCP surface defines the workflow ordering and coverage/staleness accounting semantics. A future CLI, IDE, or internal consumer would need to reproduce that order to obtain equivalent behavior.
Impact
Medium to high — No correctness bug is demonstrated today, but workflow semantics are coupled to one transport. This creates drift risk for future surfaces and makes changes to proposal/staleness accounting depend on MCP internals.
Proposed Direction
_session_memory_mixin.py.edit_allowed, ordo_not_touch.Acceptance Criteria
_session_memory_mixin.pydelegates the workflow and retains only MCP adaptation.Additional Context
sqlite_store.pyoverload is tracked separately in [Architecture] Split Engineering Memory SQLite persistence monolith #41 and should not be duplicated here.memory/retrieval/service.pyoverload remains a watchlist item while extraction is already in progress.