Repository navigation
Restart restores the newest valid snapshot set; range where_type_mismatch; memnet-mcp extra check - #254
Merged
Conversation
…(red-first, P-restart) New tests/test_restart_restore.py (real process SIGKILL/SIGTERM, precedence both ways, field case, tie, loud fallback, exit 3, skipped). test_safe_upgrade: a later start still restores; the third TCP start finds kept-fact. Red on 0a9c7c5 by design.
…ore) Start-up now ranks the checkpoint and upgrade-prepare manifests by timestamp (else mtime; tie goes to upgrade), pre-flights each, falls back loudly past broken newer sets, and exits 3 when none is valid. A retired upgrade manifest stays a candidate. prepare_upgrade stamps its manifest. Docs: Restart restore section, [mcp] install extra.
… (P-type) Score /tmp/srs/score.md §1.6-1.7. New tests/test_range_type_refusal.py and tests/test_mcp_extra_missing.py; in test_range_where.py the four quoted-string vs numeric-field NO_MATCH params move to a where_type_mismatch refusal; in test_typed_walk_where.py the mixed-pair rows become refusals and the rowRev quoted-operand test is renamed ..._is_refused.
…ows (P-type) Owner settlement of blocker r00002438. test_main_use_row_rev_quoted_operand_gives_no_rows keeps its old name (body stays the refusal; rename moves to M4 MODEL-ALIGN). In test_range_where.py, string-skips-numeric (n.x > '2000') moves out of ONE_MATCH to a where_type_mismatch refusal, and the r.n > 'a' row of test_relationship_range_delete_cardinality expects where_type_mismatch.
A quoted number range operand refuses at parse time; a quoted string against a stored number refuses at evaluation. AND/OR evaluate every child so the refusal does not depend on sibling order. Inline WHERE re-raises the refusal instead of falling to the relationship parser. Docs: cap-contract Range WHERE typing rules, gql-wire-profile WHERE row.
New memnet_mcp.entry checks mcp.server.fastmcp and uvicorn before argument parsing and writes one @err: mcp_extra_missing line naming pip install 'memnet-llm[mcp]'. Console script and python -m memnet_mcp now go through it. README and gateway/LAN front docs say any host running memnet-mcp installs the extra. Symphony restart-restore, movement M2, node E-mcp.
…reference (E-restore, CM2 fix)
…here_type_mismatch (CI)
…tch 14.1; S15, S16; console memnet_mcp.entry:main (MODEL-ALIGN)
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.
Why
Owner goal: after a
memnet serverestart, every session comes back, restored from the newest valid snapshot set, with a defined rule for which set wins when there is both a checkpoint and an upgrade-prepare. Range WHERE refuses type mismatches such asn.rowRev > '123'.memnet-mcpwithout the extra tells you exactly what to install. The model (SysML) matches.Root cause
When serve starts, it only looked at
upgrade-manifest.json. It never readcheckpoint/checkpoint-manifest.json. After the first restore,retire_manifestmarked the upgrade manifest retired, and later starts skipped retired manifests without saying so. So a restart after a checkpoint, or a second restart after an upgrade, came up with 0 sessions.Fix
upgrade.startup_restore_or_exitlooks at both sets (restore_candidates()). The newest valid set wins, by manifest timestamp or else mtime, and a tie goes to upgrade. A retired manifest is still a candidate.@WARN: restore_fallback. If no set is valid, serve exits 3.@STAT: restore_sourcenames the set it used.where_type_mismatch. Equality is unchanged.memnet_mcp/entry.pychecks for the extra before it parses arguments. Without it, it exits 2 with one line:pip install 'memnet-llm[mcp]'. The console entry is nowmemnet_mcp.entry:main.[Unreleased].Tests
tests/test_restart_restore.pystarts a real serve subprocess, kills it (SIGKILL and SIGTERM) and restarts it, then checks per-session rows and relations. It also covers precedence, retired manifests and the corrupt-set fallback.tests/test_typed_walk_where.pycovers the range type refusal. The rowRev test is renamed..._is_refused.Real-serve proof (kill and restart, 3 seeded sessions, after a checkpoint)
Base 0a9c7c5:
This branch, combined with keep-alive:
Nits (not fixed)
docs/lan-mcp-front.md:13wording;safe-upgrade.md:35cross-reference.upgrade.py: a missingsessionskey is accepted as empty.LATER
retire_manifesterrors print no@ERR(pre-existing).entry.pyerror names a dependency module.upgrade_restore_registry_busy).sysml-models/outputs/docs (ssot-to-code-allocate-map, safe-upgrade-case-study, checkpoint-case-study) still describe the old retire behaviour and the old console entry.The upgrade-safety points (mixed-version clients, health gate, one-step rollback, binds across upgrade and rollback) will come in a companion PR on top of this one.