query: add COMMIT entry to corpus parity _FIELD_TO_KIND (#81) - #97
Merged
IceRhymers merged 1 commit intoJul 24, 2026
Conversation
Add "commit": TokenKind.COMMIT to the parity test's _FIELD_TO_KIND
map and two commit: corpus entries exercised by both the Python and
TS suites, closing the latent KeyError('commit') in the safe-atom
parity test.
Refs #81
IceRhymers
force-pushed
the
feat/81-parity-commit-field-kind
branch
from
July 24, 2026 06:44
bb6c75a to
658e6dd
Compare
IceRhymers
merged commit Jul 24, 2026
e90cac0
into
integration/search-hardening-and-ci-integrity
4 checks passed
5 tasks
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.
Refs #81
What & why
tests/unit/test_query_corpus_parity.py's_FIELD_TO_KINDmap was missing a"commit": TokenKind.COMMITentry, even thoughapp/query/parser.pysupportscommit:as a first-class field. Anycommit:corpus entry added to the shared Python/TS parity corpus would trigger a latentKeyError('commit')intest_safe_entries_tokenize_to_the_corpus_atoms— this closes that gap and proves it with a real corpus entry rather than leaving it as a theoretical hole.Changes
tests/unit/test_query_corpus_parity.py— add"commit": TokenKind.COMMIT,to_FIELD_TO_KIND, positioned after"branch"to matchparser.py's_FIELD_KINDSordering.webui/frontend/src/utils/queryModel.corpus.json— append two safecommit:entries (lowercase hex hashes, to stay valid under Python's hash-lowering + hex-validation and TS's raw-case, any-bareword acceptance):commit:abc1234(single atom)repo:acme commit:abc1234 foo(three atoms, exercisescommit:alongside other fields)Test-only change; no production code touched.
TDD proof
make test→KeyError: 'commit'intest_safe_entries_tokenize_to_the_corpus_atoms[commit:abc1234]and[repo:acme commit:abc1234 foo]— 2 failed / 1059 passed. Reproduces the issue.88 passed(84 baseline + 2 new cases × 2 parametrized test functions).make webui-test→ TSrecognize()classifies both new entries safe with identical atoms —209 passed (209), 12 files.Test plan (actual output)
make lint— pass:ruff checkclean,ruff format --check(130 files already formatted),mypy app indexer webui— no issues in 35 source files.make test— pass:1061 passed, 237 deselected(parity suite alone:88 passed).make webui-test— pass:Test Files 12 passed (12),Tests 209 passed (209).make test-integration— N/A: test-only change, no DB surface touched. Integration coverage (ci-lakebase.yml) is Lakebase-only and unprovisioned repo-wide; deferred to CI, not silently skipped.Acceptance mapping
_FIELD_TO_KIND["commit"]present, ordering matchesparser.py's_FIELD_KINDS.commit:atom exercised through atom-matching path): Step A red (KeyError) → Step B green is the proof.make webui-testgreen on the same corpus; atom offsets independently hand-verified.app/,indexer/, non-corpuswebui/srcuntouched.Review
Independent
code-reviewerpass (separate context, not self-review) against the plan's acceptance criteria: 0 findings (CRITICAL/HIGH/MEDIUM/LOW), offsets independently recomputed and confirmed correct, scope confirmed to the 2 files above. APPROVE.Integration sequencing
Branch off
origin/integration/search-hardening-and-ci-integrity, base of this PR is that integration branch (notmaster) — child of umbrella draft PR #96, which stays open and untouched. No sequencing dependency on sibling issues #38/#75/#80; only shared-file conflict surface isqueryModel.corpus.json, a trivial append.