Skip to content

fix(skills): use bounded replacement windows for leak candidates - #169

Merged
codeasier merged 1 commit into
mainfrom
fix/issue-160-leak-query-window
Oct 3, 2026
Merged

codeasier merged 1 commit into
mainfrom
fix/issue-160-leak-query-window

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Correct the leak skill Step 2 and both querying guides to match the current leak_detection contract. The latest issue review confirms that unsupported offset already fails rather than silently repeating rows.

  • Obtain an exact row count, then use one affordable positive bounded window, removing or synchronizing an explicit limit.
  • Replace earlier results instead of accumulating overlapping rows or bytes; verify the count and completeness flags.
  • Handle zero totals without -n 0, and report incomplete coverage when the complete set exceeds the budget.
  • Explain that has_more does not imply offset support. Keep unknown-parameter rejection and the existing result schema intact.
  • Add independent CLI/API regressions and execute the actual Step 2 command examples against a synthetic 325-candidate SQLite fixture.

🔗 Related Issue

Fixes #160

🧪 Testing

  • Tests added/updated
  • Manual testing completed (reviewed examples, bilingual parity, and scope)

Run from this worktree with /Users/test1/liuyekang/miniconda3/bin/python, its src first in PYTHONPATH, the original user site preserved, and an isolated HOME for pytest. Verified the package imports from this worktree; no editable install was changed.

  • tests/test_fixture_provenance.py: 7 passed in the initial focused run before any deserializing suite.
  • python -m pytest tests/test_leak_query_window.py -q: 7 passed.
  • python -m pytest -q: 1031 passed, 1 xfailed, including all tests/skills, bundled-skill parity, query, CLI/API, and runtime suites.
  • python -m ruff check .: passed.
  • python -m black --check .: passed (156 files unchanged).
  • python -m basedpyright --pythonpath /Users/test1/liuyekang/miniconda3/bin/python: 0 errors, 831 informational warnings in unchanged package Python sources.
  • git diff --check: passed.

The shared environment emits a pytest-asyncio unset-loop-scope deprecation warning. No live external-agent evaluation or large production snapshot run was performed; the workflow regressions use deterministic SQLite data.

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes tested locally

Snapshot Runtime Provenance

  • Snapshot provenance evaluation completed when snapshot runtime files change
    Snapshot provenance decision: no-update
    Snapshot provenance no-update reason: Only leak skill text, querying guides, and an independent synthetic-SQLite test file changed; no snapshot runtime or executable fixture changes.

📸 Screenshots (if applicable)

Not applicable.

📋 Additional Notes

Based on origin/main at c85a357. Only Step 2 changes in the source and bundled leak skill; Step 4 (#161), Step 7 (#164), and prerequisites (#162) are outside this PR. Those parallel fixes may touch the same two skill files in different sections. The new test file avoids modifying shared test modules. No pagination fields or implementation added.

@codeasier
codeasier merged commit df204bc into main Oct 3, 2026
6 checks passed
@codeasier
codeasier deleted the fix/issue-160-leak-query-window branch October 3, 2026 19:18
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.

leak_detection has no offset parameter — Step 2 paging advice can yield 20x incorrect totals

1 participant