Repository navigation
A search excerpt serves a decision or constraint row as stored - #276
Merged
Merged
Conversation
8 of 9 tasks
zlareb1
force-pushed
the
fix/search-excerpt-decisions-whole
branch
3 times, most recently
from
November 5, 2026 14:02
e648ad2 to
3a50f20
Compare
bodies="excerpt" cut every memory hit to memory_search_excerpt_chars (200), so a decision row's reasons and rejected options, which follow its outcome, never reached an agent through loom_search. A decision or constraint row now keeps up to memory_search_decision_excerpt_chars (6000, LIVE), as the repository decision leg and the pre-edit block already serve them whole. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… cap The stored excerpt is already clipped at write time, so the cap never applied. One predicate, is_whole_row, now decides for the pre-edit block and search. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…eeps its stored clip 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]>
…aint Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… clip 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]>
…le_row reads Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…t with no read Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… CONSTRAINT_TAG Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…T_TAG in the pre-edit markers 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]>
zlareb1
force-pushed
the
fix/search-excerpt-decisions-whole
branch
from
November 5, 2026 14:31
3a50f20 to
ed97b90
Compare
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.
Changelog category (leave one):
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):
A search that serves excerpts (
bodies="excerpt", theloom_searchdefault) now shows a decision or constraint row as stored (the write-time clip: 1,200 characters, more for an extracted answer) instead of its first 200 characters.Why
A decision row's statement opens with its scenario and outcome; its reasons and the options it rejects come after. With
bodies="excerpt"every memory hit was cut atmemory_search_excerpt_chars(200), so an agent that searched for why something is built a certain way read the outcome at best and never the rejected options or their reasons. On the design-rationale bench (bench/design_rationale/), the extracted decisions reached the agent through search only (they carry fewer files than hand-written rows, so the pre-edit block served few of them), and the excerpt cut most of each row.Two other surfaces already serve decisions in full: the pre-edit block prints them whole (
memory.for_file, up tomemory_for_file_whole_tokens), and the repository decision leg ofloom_searchserves them as stored (server/memory/app/loom_search/repo_decisions.py, which pinsbodies="full"). This brings the home namespace's search in line with them. The stored excerpt is already bounded at write time (EXCERPT_LIMIT, 1,200 characters,server/memory/domain/excerpt.py), so a decision or constraint row skips the excerpt clip and needs no cap of its own.Scope and risk
_apply_bodies(server/memory/app/search/payload.py) leaves the stored excerpt of a decision or constraint row (is_whole_row, new besideis_decisioninserver/memory/domain/decision_schema.py, and now also whatmemory.for_filereads to print a row whole) unclipped; every other row is clipped as before.bodies="none","full","unit"and"source"are unchanged.loom_searchandmemory.searchwithbodies="excerpt", at most the stored excerpt each (1,200 characters; an extracted fact that carries a structured answer can hold up tomemory_structured_answer_excerpt_limit, 4,096). Rows taggedconstraintinclude conversation facts the extraction tags so (a diet, an allergy), not only design decisions; they are served whole too. This includes the large-k excerpt default (memory_search_excerpt_bodies_k, a request above it that pinned nobodies): a decision-heavy response atbodies="excerpt"can carry several times the bytes the 200-character clip gave (six for a 1,200-character excerpt, about twenty for a 4,096-character answer), never more thanbodies="full"would.anchor_first/recent_firsttier hits now carry their row tags (stamp_row_tags), so a constraint served from a tier is kept as stored like one from a search leg.bodiesdescriptions ofloom_search(the MCP tool schema and the op model) andmemory.searchsay so (docs/reference/operations/search.mdregenerated).CONSTRAINT_TAGmoves fromserver/memory/app/decision_extract.pytoserver/memory/domain/decision_schema.pybesideDECISION_TAG;for_file's_WHOLE_ROWand_ORDERSQL andcode_plane_readsread it instead of the literal (no behaviour change).Compatibility, rollout and rollback
bodies="excerpt"returns longer bodies for decision and constraint rows.Tests
tests/unit/test_search_bodies_floor_mode.py: from a stored excerpt built bybuild_excerptover adecision.recordstatement, a decision by type or row tags and a constraint by row tags are served as stored with their rejected option; a constraint from therecent_firsttier keeps its excerpt; a plain row is cut atmemory_search_excerpt_chars;bodies="none"still blanks a decision.make format lint typecheckpass. Full unit suite on the rebased head: everything passes except four cases oftest_the_delimiter_is_sniffed_in_bounded_time, a timing test that fails the same way onmainon the machine that ran it.The "after" row ran with decisions served as stored (up to 1,200 characters for a decision), which is what this change serves. The "before" row is the earlier full run on the same set; the arm 3 reference stayed within 80-86 on B and 96-98 on A precision in both. At K = 3 over five documents the B difference is inside its interval (MDE about 46 points), so this is direction, not proof; the mechanism (whole reasons and rejected options reach the reader) is what the change rests on. Reproduce:
python -m bench.design_rationale run <taskset> --arms 3,4 --k 3 ...thenscore.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; I checked the clip rule against
memory.for_file's whole-row rule and the repository decision leg, and ran the tests and the bench above.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (format, lint and typecheck pass; the unit suite as stated under Tests; no integration run: the change is in hit shaping, which the unit tests drive.)docs/reference/configuration.mdand thedocs/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).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code