A1: live-MCP upgrade smoke-check (post-restart gate) - #11
Merged
Conversation
Assertions-first for the post-restart upgrade gate: version>=3.4.0 floor, tools/list advertises every expected tool (load-bearing: mempalace_diary_write — the one that silently vanished against a stale server), diary_write->read round-trip on a disposable sandbox palace, search no-raise. Includes the no-stray-real-palace-drawer guard. Fails pre-implementation (module absent).
Runnable post-restart gate (python -m mempalace.smoke_upgrade). Spawns the configured server over the real stdio JSON-RPC wire (not a module import) and asserts version>=3.4.0, all expected tools advertised, diary round-trip, and search no-raise. version/advertise/search run read-only against the configured palace; the round-trip writes only to a disposable sandbox palace (MEMPALACE_PALACE_PATH=tmpdir), so the real palace gains no drawer and no col.delete is ever needed. Emits PASS/FAIL + exit code for use as A4's gate.
Owner
Author
Cross-coder review under /collaborate-to-build protocolBoth coders authenticate as the same GitHub account; GitHub blocks Verdict: APPROVE Verification performed (not just read)
Focal items — all confirmed
Good catch noted: Minor notes (non-blocking — coder's discretion)
None block. Well-designed, guardrail-compliant, TDD-disciplined, verified green including the live path. |
jpwinans
added a commit
that referenced
this pull request
Jun 14, 2026
…nused import (#14) * test(smoke): A1-polish assertions — prerelease version parse + hung-server FAIL (TDD red) Adds: _parse_version must read leading-digits-per-component so '3.4.0rc1'->[3,4,0] not [3,4,1]; _mcp_session must catch subprocess.TimeoutExpired and return {} so a hung server yields a clean FAIL report instead of crashing the gate; run_smoke reports ok=False (not a crash) when the server hangs. Fail pre-fix. * fix(smoke): A1-polish — leading-digit version parse, hung-server clean FAIL, drop unused import (TDD green) Addresses coder-2's #11 cross-review notes (1-3): - remove the unused 'from .version import __version__' import. - _parse_version takes leading digits per component (pre-release suffix no longer misread as a higher patch). - _mcp_session catches subprocess.TimeoutExpired -> returns {} so a hung server produces a FAIL report, not a crash. (Note 4, initialize-handshake-skip, kept as intentional: mempalace doesn't gate tools/list on the initialized notification.) 22/22 tests pass; live gate still PASS on the qdrant backend; ruff clean.
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.
A1 — Live-MCP upgrade smoke-check
Part of the MemPalace v3.4.0 Adoption + Backend Migration envelope (/collaborate-to-build, N=2). Codifies this session's #1 lesson:
diary_writeexisted in code but a stale running server failed to advertise it to the client — a silent capability gap.What it does
python -m mempalace.smoke_upgrade— a runnable post-restart gate that spawns the configured MCP server over the real stdio JSON-RPC wire (not a module import) and asserts:serverInfo.version>= 3.4.0tools/listadvertises every expected tool — load-bearing:mempalace_diary_write(the staleness catch)diary_write->diary_readround-tripssearchreturns without raisingEmits PASS/FAIL + exit code (0/1) so A4's runbook can use it as the mandatory post-upgrade gate.
Guardrails honored (envelope §2)
MEMPALACE_PALACE_PATH=tmpdir), auto-removed — so the real palace gains no drawer and nocol.deleteis ever needed.TDD
Honest red→green history:
0e1c918(test, failing pre-impl) →146b5ee(implementation, green). 19/19 tests pass; 287 existing mcp_server+config tests still green; ruff clean.Finding surfaced
The literal
__healthcheck__agent/wing name in the spec's §2 guardrail is rejected by mempalace's ownsanitize_name(_SAFE_NAME_REdisallows leading/trailing underscores). Sandbox-palace isolation makes the agent name cosmetic; usessmoke-healthcheck. Flagged to architect — affects §2 phrasing + B4 docs.Scope boundary
A1 = post-restart gate (verifies on-disk code current + configured launch advertises/runs tools). It deliberately does NOT introspect an already-bound client stdio subprocess (client-owned, unreachable from a standalone process). The in-session "is
diary_writein my live tool list?" check is an agent action → lives in A4's runbook.