Skip to content

Raise snapshot field cap to 64 and refuse over-cap at mutate - #217

Merged
chouswei merged 1 commit into
masterfrom
cursor/snapshot-field-cap-64-be76
Oct 14, 2026
Merged

chouswei merged 1 commit into
masterfrom
cursor/snapshot-field-cap-64-be76

Conversation

@chouswei

Copy link
Copy Markdown
Owner

Summary

Default MEMNET_MAX_FIELDS is 64. Mutate and snapshot save share one effective-field count (declared SCHEMA fields + undeclared extras on any row of that tag + the id column save appends). A CREATE / SET / MERGE that would exceed the cap refuses @ERR: limit_exceeded|fields n/max and writes nothing. Anything mutate accepts at exactly 64 saves and reloads. snapshot_unsaveable stays the fail-closed save backstop. Snapshot load of a SCHEMA over 64 refuses the same fields n/max code.

SysML first: MN-REQ-05.4 / MN-VER-05-S02, plus MN-REQ-01.9 text so save is never stricter than a mutate that succeeded.

Why

A live 0.19.23 session became snapshot_unsaveable because GQL mutate stored undeclared extras with no field cap, then save counted the widened SCHEMA (declared + extras + id) against max_fields=32. A PRT tag at 38 fields could be written and not saved.

Tests

  • tests/test_field_cap.py: 38-field PRT saves and reloads; mutate CREATE/SET/MERGE over 64 refuses and writes nothing; save helper identical at exactly 64; load of SCHEMA 65/64 refuses limit_exceeded.
  • Cap-contract / doc-gate / E18 pins updated from 32 to 64.
  • Full suite: pytest -o addopts='' -q -W ignore → 591 passed, 1 skipped (agensgraph_live).

Package identity is not bumped (Unreleased honesty c on 0.19.24).

Investigation (no code)

On released 0.19.23, export_pin_map / pin_map is not a lossless copy of a session (bounded cue neighbourhood, default M=50 / depth 2, empty q is outline). Node extras in that neighbourhood are emitted; leftover read list drops extras (SCHEMA columns only). import_slice is same-serve and also bounded. After this cut, mutate and session_load keep extras up to 64; over 64 mutate refuses and load of a SCHEMA over 64 refuses loudly. import_slice still upserts outside MutateGate, so a slice over 64 can still hit the save backstop.

Open in Web Open in Cursor 

Default MEMNET_MAX_FIELDS is 64. Mutate and snapshot save share one
effective-field count so a CREATE/SET/MERGE that could not save is
refused with limit_exceeded|fields n/max and writes nothing.
snapshot_unsaveable stays the fail-closed save backstop (MN-REQ-05.4).

Co-authored-by: chouswei <chouswei@users.noreply.github.com>
@chouswei
chouswei marked this pull request as ready for review October 14, 2026 03:02
@chouswei
chouswei merged commit 7f2996d into master Oct 14, 2026
2 checks passed
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