Skip to content

fix: pin_map ranking by observables, not hid - #147

Merged
chouswei merged 2 commits into
masterfrom
cursor/pin-map-observable-rank-fffb
Sep 4, 2026
Merged

fix: pin_map ranking by observables, not hid#147
chouswei merged 2 commits into
masterfrom
cursor/pin-map-observable-rank-fffb

Conversation

@chouswei

@chouswei chouswei commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Problem

pin_map ranking in 0.19.x used hidden Record.hid (_elN) as the sort key. Label sets matched under CREATE-order shuffle; emitted sequences did not. Hid never leaked into the body, but admission order (Lost in the Middle) followed physical CREATE order. That is a gauge anomaly.

Verified in this tree (not only the 0.19.3 install hypothesis):

  • bounded_match_find sorted hits by r.hid
  • MemStore.list_records / _edge_records / neighbors BFS / context_pack used hid order
  • apply_shell_soft_cap and session-outline exemplars sorted by hid (and leftover nickname id)

Fix (0.19.c honesty)

Not a usage-method b, not 0.20, not 1.0. Same operators: Recall = pin_map, Commit = mutate. Hid still off the wire. Package version left at 0.19.3 (c bump is for publish).

  • Ranking key = kind + remaining observable payload (exclude hid; exclude nickname id — ranking by nickname is the same class of leak)
  • Edges rank by type + endpoint observables
  • BFS expansion, fan-out clamp, max_rows admission, shell cap, outline, Peak_L tie-break, CueConflict listing follow that key
  • SysML: MN-REQ-04.11 / MN-VER-04-S05 — order of pin_map is a function of the Shape’s observables, not hid

Test

tests/test_pin_map_observable_rank.py builds isomorphic sessions (shuffled CREATE order and shuffled nickname ids), cues by kind + locator slug= (never leftover id), and asserts canonicalised pin_map sequences match. Also asserts _el / _memnet_hid stay off the emit.

Proof on this branch: full pytest green (skips are live Agens/Neo4j). Two sessions with reversed CREATE and shuffled nicknames emit the same canonical sequence; hids differ (_el1… vs _el8…) and do not appear on the wire.

Honesty

  • Do not claim 1.0
  • N-server stays Later
  • No cabinet vendored
  • Do not raise (M)
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 3, 2026 18:57
Hid stays off the wire and is no longer the ranking key for MATCH_L,
BFS/edge emit, outline, Peak_L ties, or shell/max_rows admission.
Optional nickname id is excluded from the rank key as well (MN-REQ-04.11).

Co-authored-by: chouswei <chouswei@users.noreply.github.com>
Format ranking helpers and assert MATCH_L seed order follows kind plus
payload (goal/slug), not slug alphabet and not hid.

Co-authored-by: chouswei <chouswei@users.noreply.github.com>
@chouswei
chouswei marked this pull request as ready for review September 3, 2026 19:00
@chouswei
chouswei merged commit eff05dc into master Sep 4, 2026
1 of 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