Repository navigation
fix(query): reject truncated dictionary keys as parse errors - #191
TimeToBuildBob wants to merge 2 commits into
Conversation
Git-Session-Id: e7890338-d6fc-4b47-843e-a159a67ce343
[Low impact] This PR appears safe to merge. Summary
Reviews (1) · Last reviewed commit: "fix(query): reject truncated dictionary ..." · Reviewed by Greptile |
Git-Session-Id: e7890338-d6fc-4b47-843e-a159a67ce343
|
All six checks pass on head 784c271, including Linux/macOS/Windows tests, lint and CodeQL; the PR is mergeable. Greptile reports 5/5 on parser commit 9af9b71 (before the CI runner-only follow-up). No outstanding review threads or human questions. Waiting only on a maintainer merge; Bob has triage, not push access. |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
🤖 AI code reviewSafe to merge — 1 P1 disposed (rejected)Updated after inline dispositions on finding threads — this is the current state; the verdict below is frozen at review time and is kept as the historical record of that pass. Finding disposition
QDict.parse in aw_query/query2.py replaces the post-key indexing check with startswith(":"). The PR adds dictionary parsing and RETURN-query cases in tests/test_query2.py and pins the Ubuntu build matrix entry to ubuntu-22.04. Not safe to merge — 1 P1 openConfidence 3/5 1 finding · ❌ 1 P1❌ P1 high — The added How this was verified: Traced aw_query/query2.py lines 243-249 through _parse_token at lines 349-355 and QString.check at line 110: whitespace is stripped only after the empty-input check, leaving string[0] to raise IndexError. Files changed (3) — the diff as I read it
Reviewed Maintainer commands
|
Summary
Closes #190.
Verification
c7821899ab38c1a39c87d7bf011c22a78de9b205: new cases 5 failed, 7 passed before the fix (IndexError); 68 query2 tests passed after.make test: 374 passed, 5 skipped. This repository has notest-fasttarget.make typecheck: clean across 37 source files. Pinned Ruff check/format and hook-enabled commit passed./api/0/query/against aw-server master994ea988ca30af36e08cef71ce6046e8c3391584, synthetic MemoryStorage, query caching disabled, no listener or personal data: five truncated forms return 500 on master → 400 with QueryParseException on this head. Missing-value/nonempty missing-colon controls stay 400; empty/single/multi-entry/nested complete dictionaries stay 200 with exact expected bodies.37eb865): 149 passed across both query2 test modules, including whitespace-only empty collections. The adjacent repair is not copied into this PR.Scope
One predicate change:
startswith(":")is equivalent to indexing for nonempty strings and safely rejects an empty remainder. No blanket IndexError handler, parser rewrite, missing-comma policy change, or Rust/deployed-release claim. The offline route harness and raw RED/GREEN receipts are retained at/home/bob/data/aw-dictionary-replay-ebe3/; they are local evidence, not repository test dependencies.The optional delegated review was unavailable (Claude subscription access disabled), not a passing review. Hosted CI/review will be recorded after opening.