Skip to content

The docs and code comments match the code on graph walks, write verdicts, vector reads, row-scoped ops and audit - #593

Merged
zlareb1 merged 17 commits into
mainfrom
docs/accuracy
Nov 13, 2026
Merged

zlareb1 merged 17 commits into
mainfrom
docs/accuracy

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Documentation (changelog entry is not required)

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):

...

Why

Fifteen places where the docs, a code comment or an op description said something the code does not do. Each was checked against main:

  1. The entity graph walk runs one bounded query per hop (server/memory/app/facts.py, _handle_facts_traverse_uncached) and its docstring explains why a recursive CTE is not used. system-overview.md, the models_facts.py banner and a graph_quality.py comment said WITH RECURSIVE.
  2. memory.set embeds before it inserts (set_commit._set_embed has no fallback), so a failed embed fails the call. concepts/memory.md said a stub is written.
  3. conflicts.check_on_commit decides merge, then pinned, then the newest_wins substitution (refines, or conflict when the peer's valid_at is later), then duplicate, then conflict. concepts/memory.md had pinned last and neither page named the substitution.
  4. The fact leg reads codes first and rescores at full precision on 26.8+ with a quantized column (clickhouse.md#vector-storage). The retrieval page, the memory-architecture leg table and a failure-and-recovery limit called every vector read an exact scan.
  5. erasure.status and blacklist.remove also set row_scoped=True, and memory.verify is addressed by id the same way with skip_namespace_authz=True. security.md now states the rule and its two paths: memory.get_by_id and memory.update_by_id resolve the id's namespace through authz.row_reach before the read (id_namespace.namespace_for_id); memory.redact, erasure.status and blacklist.remove check after the fetch, with authz.row_in_scope for a row held in a namespace; a user's erasure saga needs the org-wide view, an org blacklist pattern of the caller's own org needs ORG_ADMIN, and a global pattern needs PLATFORM_ADMIN (both 403, as neither belongs to another tenant). The developer guide's code sample now uses namespace_for_id. The identities page, memory-architecture.md and AGENTS.md follow it.
  6. audit.md said audit rows have no TTL; LOOM_RETENTION_AUDIT_LOG_DAYS above 0, or a namespace's retention_days (server/storage/retention_overrides.py includes loom.audit_log in TARGETS), puts one on it.
  7. audit.md said a crash can lose audit rows queued in the events stream. observability/audit.emit inserts directly and transport/post_rows.py awaits it before the response; the events stream carries budget violations only. audit.md is fixed. failure-and-recovery.md and security.md said a failed audit insert never fails the write; audit.emit_strict makes it fail a memory.restore that undoes a retirement (server/memory/app/restore.py) and namespace.restore (server/identity/app/namespace_snapshot.py), so all three pages now name those two.
  8. A single grant read that fails counts as no grant (authz.grant_role_for); a failed re-read of the cached grant map serves the cached entry while it is younger than LOOM_JWT_REVOCATION_MAX_STALE_SECONDS and answers 503 past it (core/grant_cache._load). failure-and-recovery.md and the gate step in security.md now both say this.
  9. The erasure.request / erasure.export descriptions (and knowledge.delete's pointer to erasure) named GDPR articles while the architecture docs disclaim any compliance guarantee. Fixed in server/transport/mcp_descriptions.py (erasure.request now also says the audit trail is kept, as audit.md states); docs/reference/operations.md and operations/erasure.md regenerated.
  10. The document-extraction intro now lists Parquet, as its format table and extractor/loom_extractor/source.py do.
  11. The code_ask_cache_threshold comment pointed at code/app/answers.py; the table is in answers_entry.py. The settings reference, example YAML and schema are regenerated.
  12. The image carries scip-clang on amd64 (Dockerfile). The README and quickstart now name the C++ indexer on amd64. The translations under i18n/ of the README and quickstart go stale with this change; the i18n workflow refreshes them on the push to main (scripts/i18n/translate.py check --skip-stale passes).
  13. docs/benchmarks/results.md gave LongMemEval per-type figures from longmemeval_s.csv (arm ask) while longmemeval_s_judges.json reports gpt-4o-2024-08-06 at 29/30 preference and 123/133 multi-session; both total 483. Cause, found offline with no re-judging: the per-type n match in both files, so no question is mislabelled. The --hyp-out file that bench/rejudge.py grades is the primary ask arm of the same run. All six of the re-grade's split items are WRONG in the CSV. The totals and split lists show at least two labels that differ: on net one multi-session (CSV WRONG, re-grade CORRECT) and one preference (CSV CORRECT, re-grade WRONG), each agreed by all three re-grading judges. Swaps inside one type would leave every committed figure unchanged, so the exact count needs the answers file. The judge call runs at temperature 0 with no seed (bench/judges.py), so a second gpt-4o call is not repeatable. The answers file is not committed, so the two question ids cannot be named. results.md now says which file each figure comes from and what the two labels change. No published number changed.
  14. docs/concepts/identities-and-namespaces.md said a user- or session-scoped read is a primary-key range. loom.memory and loom.memory_embeddings sort by (org, namespace, agent, user_id, session_id, …), reads default to agent="*", and no skip index covers user_id or session_id. The page now says what the key gives and links to the memory-at-scale measurement.
  15. docs/concepts/memory.md said a byte-identical restatement bumps reinforcement_count "instead of writing a version". memory.set inserts a new version row carrying the live row's reinforcement_count + 1 (server/memory/app/write.py, reinforcement_count_for_insert), as memory-architecture.md says.

Also corrected while checking the pages above, each against the code named:

  • memory-architecture.md search step: trace, exposure and query-node rows are inserted directly with async_insert (server/memory/app/search/telemetry.py), not through the events stream.
  • The embedding_worker docstring (server/memory/workers/embedding.py) and the extraction.md workers row: a failed inline embed no longer leaves a stub; the worker fills stubs from paths that can wait for a vector and memories with no embedding row.
  • writing.md's memory.update_by_id row, adding-an-operation.md, errors.md and troubleshooting.md: the row-scoped rule of item 5.
  • bench/code_ask_cache_threshold/measure.py: the cache lookup is in answers_cache.py, the threshold table in answers_entry.py.
  • sharing.md and the erasure comments: the GDPR wording of item 9.
  • code-index-architecture.md: the code.search vector leg reads code_chunks, a coded table (CODED_TABLES), so codes first applies there too.

Scope and risk

Docs, comments and op description text only. The MCP tool descriptions of the three ops change wording; no behaviour changes.

Compatibility, rollout and rollback

  • Wire: no op or field changes; three op descriptions are reworded.
  • Operator steps: none.
  • Rollback: revert; only generated docs follow.

Tests

On the head rebased onto main: make format-check lint typecheck pass, and every generator (docs_reference, the settings reference, example and schema, both SDK op tables, the Codex plugin sync) reports its output current. The full tests/unit suite: 34468 passed, 26 skipped, 1 failed, test_deeply_nested_hidden_html_parses_in_bounded_time, a timing test that also fails on main on this machine and that this change does not touch.

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; each finding was checked against the code on main before the edit.

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

🤖 Generated with Claude Code

@zlareb1 zlareb1 changed the title The docs and code comments match the code on graph walks, write verdicts, vector reads and audit The docs and code comments match the code on graph walks, write verdicts, vector reads, row-scoped ops and audit Nov 13, 2026
@zlareb1
zlareb1 force-pushed the docs/accuracy branch 2 times, most recently from 5c09377 to ec52f05 Compare November 13, 2026 07:41
zlareb1 and others added 8 commits November 13, 2026 08:02
…cts, vector reads, row-scoped ops and audit

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…worker's targets read plainly

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…bedding worker's docstring parses

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ADME paragraph is reflowed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e-grade's judges are counted once

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…the re-grade names its three judges

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…verify, and the fact-leg switch reads in short sentences

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
zlareb1 and others added 6 commits November 13, 2026 08:14
…memory.verify sits with the before-the-read ops

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ther pages do

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…rash bound covers a detached erasure

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…s to the memory.ask column, and the edited lines are wrapped

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…perations legend reads as a sentence

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
zlareb1 and others added 3 commits November 13, 2026 09:20
…nd the extraction intro is wrapped

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e refines cell reads plainly

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit c46450b into main Nov 13, 2026
45 checks passed
@zlareb1
zlareb1 deleted the docs/accuracy branch November 13, 2026 11:44
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