Skip to content

fix: sqlite database slicing + direct-write samples_summary (aggregator Phase D)#1380

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/aggregator-sqlite
Jul 16, 2026
Merged

fix: sqlite database slicing + direct-write samples_summary (aggregator Phase D)#1380
Jammy2211 merged 1 commit into
mainfrom
feature/aggregator-sqlite

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Phase D of the aggregator work (#1377, follow-up to #1375/#1376): the sqlite results database was exercised at scale with the merged mock-results harness and assessed. Two genuine bugs found and fixed; the full where-it's-at assessment (including database-vs-directory performance, which shows the sqlite path currently offers no loading-speed advantage) is posted on #1377.

API Changes

None — bug fixes only.

  1. Database aggregator slicing was inverted: agg[:5] on 26 fits returned 21 (len − stop − offset items instead of stop − start); agg[3:8] returned 15. The pre-existing unit test passed only by coincidence (2 fits, stop=1, where len − stop == stop). Fixed in database/aggregator/aggregator.py::__getitem__ with a 3-fit regression test.
  2. Direct-write (session) fits never stored samples_summary: DatabasePaths fell through to the abstract no-op, so values("samples_summary") raised AttributeError on any session-written database — the summary-only workflows sped up in perf: aggregator result-loading speedups (single-scan listing, cached summaries, faster samples parse) #1376 were unusable there. Implemented save_samples_summary / load_samples_summary on DatabasePaths (mirrors the directory filter semantics; a missing summary maps to the FileNotFoundError the Fitness resume check expects). Verified end-to-end: a session-written fit's database now serves summaries.

See full details below.

Test Plan

  • pytest test_autofit/ — 1486 passed, 1 skipped
  • New regression test: test_autofit/aggregator/test_aggregator.py::test_slicing (3 fits, breaks the old coincidence)
  • End-to-end: scripts/database/session/general.py fit → values("samples_summary") loads from the session-written database
  • Scrape at scale: 25/25 mock results ingested and queryable (was 1/25 before the workspace-side harness fix)
Full API Changes (for automation & release notes)

Changed Behaviour

  • database/aggregator/Aggregator.__getitem__ — positive-stop slices now return stop − start fits (previously len − stop − offset); negative indices normalised consistently.
  • DatabasePaths.save_samples_summary / load_samples_summary — implemented (previously silent no-op / None); session-written fits now store the summary json exactly as scraped fits do; load_samples_summary raises FileNotFoundError when absent (matching directory semantics).

Generated by the PyAutoLabs agent workflow.

- database Aggregator.__getitem__: positive-stop slices returned
  len-stop-offset fits instead of stop-start (agg[:5] on 26 fits gave
  21); existing test passed only by coincidence (2 fits, stop=1);
  fixed + 3-fit regression test
- DatabasePaths.save_samples_summary/load_samples_summary: implemented
  (previously silent no-op), so session-written (direct-write) fits
  store and serve samples_summary like scraped fits; missing summary
  maps to the FileNotFoundError the Fitness resume check expects

Aggregator Phase D (#1377); assessment on the issue.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 16, 2026
@Jammy2211
Jammy2211 merged commit 6c7936f into main Jul 16, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/aggregator-sqlite branch July 16, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant