Skip to content

The knowledge retrieval harnesses refuse a --param that filters the corpus - #373

Merged
zlareb1 merged 6 commits into
mainfrom
fix/bench-param-allow-list
Nov 7, 2026
Merged

zlareb1 merged 6 commits into
mainfrom
fix/bench-param-allow-list

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (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

bench/knowledge_retrieval.py built SEARCH_FIELDS as every KnowledgeSearchInput field minus FIXED_FIELDS, so --param 'block_types=["paragraph"]' or formats=[...] passed parse_params and reached knowledge.search: an arm scored a subset of the corpus as the whole, against the docstring's promise that the harness fixes depth, scope and filters so two arms differ by one flag. bench/beir_knowledge.py takes the same params.

SEARCH_FIELDS is now an allow-list of the ranking knobs (search_mode, lexical_weight, narrow_spans, collapse_sections, rerank), and formats and block_types join FIXED_FIELDS, so a field added to the wire model later is refused until it is named a knob, and the unit test fails until it is placed in one list. The docstrings of both harnesses and bench/README.md say so (the BEIR harness also fixes collapse_sections).

Scope and risk

The two retrieval harnesses' --param parsing. No server change; no benchmark was run.

Compatibility, rollout and rollback

  • None.

Tests

  • tests/unit/test_bench_knowledge_retrieval.py: test_the_fields_that_define_the_measurement_are_refused, parametrized over FIXED_FIELDS, now covers formats and block_types (both fail on main with no SystemExit); test_every_search_field_is_either_a_knob_or_fixed holds every KnowledgeSearchInput field to exactly one list. The file passes (46).
  • test_bench_beir_knowledge.py and test_public_copy.py: pass.

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 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.
  • Generated files are regenerated in this PR, not by hand.
  • 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 bumps both plugin manifests' version.
  • The frontend builds 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.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 6 commits November 7, 2026 13:11
…orpus

SEARCH_FIELDS was every KnowledgeSearchInput field minus FIXED_FIELDS, so
`--param 'block_types=["paragraph"]'` or `formats=[...]` passed
parse_params and reached knowledge.search, and an arm scored a subset of
the corpus as the whole. bench/beir_knowledge.py takes the same params.

SEARCH_FIELDS is now an allow-list of the ranking knobs (search_mode,
lexical_weight, narrow_spans, collapse_sections, rerank), and formats and
block_types join FIXED_FIELDS, so a filter added to the wire model later
is refused by default. The docstring and bench/README.md say so.

Tests: both filters are refused, and every KnowledgeSearchInput field is
either a knob or fixed, never both, so the two lists cannot drift.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…the filter test is the fixed-fields one

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…tring wraps evenly

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 93bfa9d into main Nov 7, 2026
34 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.

1 participant