Skip to content

A dashboard pin keeps the row's tags, entities, confidence, sensitivity and source trace - #218

Merged
zlareb1 merged 16 commits into
mainfrom
fix/dashboard-pin-keeps-row-fields
Nov 3, 2026
Merged

zlareb1 merged 16 commits into
mainfrom
fix/dashboard-pin-keeps-row-fields

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Pinning a memory from the dashboard no longer clears its tags, entities, confidence, sensitivity, source trace, source resource or validity window. memory.get and memory.bulk_get now return source_trace and source_resource_id.

Why

Failing case: a memory with tags ["infra", "prod"], confidence 0.8 and source trace conversation:t1, pinned from the memory inspector (More, Pin) or from the Memories list's bulk Pin. The pinned version has no tags, confidence 1.0 and no source trace, so tag filters, tag-scoped retention and provenance lose the row.

Pattern: memory.pin is memory.set with pinned forced on (handle_memory_pin), and memory.set writes a whole version from its input: tags, entities, confidence, source_trace, valid_at and valid_to come from the request, not the live row. The dashboard read the row and wrote back only its value, type and char_limit.

Where the fix belongs: the op reference, the MCP description ("Same arguments as memory.set; pinned is forced on") and both SDKs' pin (set with pinned=True, the same arguments) all define pin as a full write. Making the server carry fields forward when they are omitted would change memory.set too, since they share the write path, and a client could no longer clear tags with []. So the dashboard, the caller doing a read-then-write, echoes the row.

Fix:

  • memory.get and memory.bulk_get serve source_trace and source_resource_id (row_output; the bulk fetch now selects source_resource_id). The dashboard could not send back a trace the read never served: without one, source_class_for fell back to asserted, turning extracted content into an assertion.
  • pinMemory takes the MemoryDetail read with memory.get and writes to that row's own agent, user and session (memory.get's fallback can answer with another agent's or session's row, and the bulk Pin now reads another user's row by that user; a pin under the caller's identity wrote a second row beside it and left the original unpinned). It sends the row's value, type, tags, entities, confidence, sensitivity, source trace, source resource, validity window and char_limit. Sensitivity matters because a write re-detects it from the value when the request has none, so a caller's high on a value the detector does not flag would drop to '' and the row would be embedded and searchable. source_class is sent only when it is one a caller may declare (derived, external, imported); the server derives the others from the source trace. ttl_seconds stays out, which keeps the row's expiry. The write carries if_match_sha256 from the read, so a change to the value since the read answers 409 ("Pin failed") instead of being reverted. The hash covers the value only: a metadata-only write since the read (new tags, say) is still overwritten by the pin, as before; guarding that needs a version precondition on memory.set. The bulk Pin reads each listed row by its own user and session. The inspector's Unpin addresses the same row, so a Pin of another agent's or session's row can be lifted from the same drawer.

Scope and risk

frontend/src/api.ts (pinMemory, six optional fields on MemoryDetail), the inspector's Pin and Unpin, the Memories list's bulk Pin, and two output fields on memory.get / memory.bulk_get. memory.list already served source_trace. loom import-okf still rewrites a concept that carries a source resource on every sync: asking memory.bulk_get for the new field would be a 422 from a server one build behind.

Left alone: the columns memory.set does not take at all, so no caller can send them back on any write. temporal_anchor, temporal_confidence, grounding and evidence are reset by every revision (REVISION_RESETS, read out of the old value's text), and concepts is written empty by memory.set. A pin of an extracted row, from the dashboard or any SDK, still clears them, as any memory.set restatement does. Keeping them on a byte-identical restatement is a change to the write path for every client and goes in its own PR. run_id is also not carried: memory.set takes it, but memory.get does not serve it, so a pinned row's run_id becomes '-', as it did before this change. The other inspector writes (tag edit, expiry change, value edit) also go through memory.set without confidence or source trace; they are left for a separate change.

Compatibility, rollout and rollback

  • Wire: memory.get and memory.bulk_get gain source_trace and source_resource_id (additive output fields; a build one version behind leaves them out, which the dashboard treats as empty). The dashboard sends only fields memory.pin already accepts. SDK op tables and docs/reference/operations/memory.md regenerated.
  • Operator steps: none.
  • Rollback: revert; nothing stored changes shape.

Tests

  • src/components/MemoryInspector.pin.test.tsx (new): Pin hands pinMemory the row the inspector read, and Unpin addresses that row's agent, user and session. It failed before the change (the call carried only the value, type and char_limit).
  • src/views/Recent.lists.test.tsx: the bulk Pin reads the listed row by its agent, user and session, and hands pinMemory the row memory.get returned.
  • src/api.memory.test.ts: the memory.pin body carries the row's tags, entities, confidence, sensitivity, source trace, source resource, validity and char_limit; source_class is sent for imported and left out for asserted; the body names the row's agent, user and session, and if_match_sha256 from the read.
  • tests/unit/test_point_reads_locate_then_fetch.py: memory.get and memory.bulk_get answer the same source_trace and source_resource_id for one row.
  • tests/integration/test_memory_pin.py (new tests, run in CI): test_pin_of_a_read_row_keeps_its_fields writes a row with every carried field, reads it, pins with what the read served and its hash, reads it again and compares each field (source_class stays extracted); test_pin_of_a_stale_read_is_refused changes the value between the read and the pin and expects 409 PRECONDITION_FAILED.
  • tests/integration/test_sensitivity_high_canary.py: its full memory.get comparison names the two new fields.
  • Local: the frontend tests above (130 passed), npm --prefix frontend run build, Biome, ruff, make typecheck, and the unit files that build memory.get rows, the SDK snapshots and docs. Two hand-built row fixtures (test_duplicates_not_served.py, test_memory_small_defects.py) gained source_resource_id, which row_output now reads. The full unit suite runs in CI.

Known red checks that also fail on main: tests/integration/same_key/test_retirement_ch.py (two tests, alias_merges() got an unexpected keyword argument 'cap') and test_search_statements_pass_analyzer.py::test_patch_part_probe_and_reemit_reads_pass_the_analyzer.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. The op contract was checked against the server write path, the op reference, the MCP description and both SDKs.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed. (Locally: format, ruff, typecheck and the touched unit files; the full unit and integration suites run in CI.)
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 2 commits November 3, 2026 13:40
…venance

memory.pin writes a whole new version through the memory.set path, so a
field the request leaves out is not on the pinned row. The inspector's Pin
and the Memories list's bulk Pin sent only the value, type and char_limit:
the pinned version lost its tags, entities, confidence, source_trace,
declared source_class and validity window.

pinMemory now takes the row read with memory.get and sends those fields
back; source_class only when it is one a caller may declare.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…n keeps them and the sensitivity

The dashboard's pin echoed a source_trace memory.get never served, so the
pinned version lost its trace and fell back to source_class asserted. The
point read and bulk_get now serve source_trace and source_resource_id
(bulk_get's fetch selects the latter), and pinMemory sends them back with
the row's sensitivity, which a write otherwise re-detects from the value.
pinMemory sends the row's type, tags and entities as served.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1 zlareb1 changed the title A dashboard pin keeps the memory's tags, entities, confidence and provenance A dashboard pin keeps the memory's fields, and memory.get serves its source trace Nov 3, 2026
@zlareb1 zlareb1 changed the title A dashboard pin keeps the memory's fields, and memory.get serves its source trace A dashboard pin sends back every field memory.set takes, and memory.get serves the source trace Nov 3, 2026
@zlareb1 zlareb1 changed the title A dashboard pin sends back every field memory.set takes, and memory.get serves the source trace A dashboard pin keeps the row's tags, entities, confidence, sensitivity and source trace Nov 3, 2026
zlareb1 and others added 14 commits November 3, 2026 14:11
row_output now reads it, so a hand-built row without it raised
AttributeError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ment says why it still rewrites

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
memory.get may answer with a row of another agent, user or session (the
agent="*" fallback opens those axes); pinning it under the caller's '-'
identity wrote a second row beside it and left the original unpinned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… the listed row by its user and session

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… pin leaves

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
A procedural declaration on a plain string is stored as semantic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ns them to the body

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e and source_resource_id

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 322f932 into main Nov 3, 2026
22 checks passed
@zlareb1
zlareb1 deleted the fix/dashboard-pin-keeps-row-fields branch November 3, 2026 18:46
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
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.

1 participant