Repository navigation
feat(categories): local manual event overrides outside watcher data - #782
TimeToBuildBob wants to merge 8 commits into
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #782 +/- ##
===========================================
+ Coverage 70.81% 85.34% +14.52%
===========================================
Files 51 86 +35
Lines 2916 11947 +9031
===========================================
+ Hits 2065 10196 +8131
- Misses 851 1751 +900 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@greptileai review |
|
Addressed both Greptile findings in
Verified locally: |
|
@greptileai review |
|
@greptileai review |
|
The red |
|
Status check on this PR: CI is green on the current head ( Two inline threads remain open, both on
A sound fix needs an unambiguous, query-scoped classification marker (rather than reusing No further Bob action here until that decision is made. |
🤖 AI code reviewAdds a SQLite v7 sidecar table for per-event manual category overrides, with a new bucket-scoped GET/PUT/DELETE API, a query-only overlay that strips watcher-supplied reserved keys and applies sidecars, and changes to merge/chunk transforms to keep manual categories separate during pre-aggregation. Also bumps the advertised DB version, adds a manual_event_category flag to /api/0/info, and adds CORS PUT support. Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads. 1 advisory finding (summary-only, not scored)These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.
In insert_events, the new ownership validation queries How this was verified: Traced the insert_events path and the worker's serialized transaction. No race is possible because the worker processes commands sequentially. Consensus: 2/3 passes agreed — pass 2 looked and disagreed Files changed (18) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
eea7682 to
e277a8f
Compare
|
Rebased onto master ( I dropped Locally: |
e277a8f to
bae2cd2
Compare
|
@greptileai review |
|
@greptileai review |
|
Status after today's rebase and latest Greptile review round (commit Greptile P1 findings — both addressed:
Current state: CI is running on |
Merge recommendation (convergence adjudication)Head verified: Fixed (earlier rounds, all threads resolved): category totals split by manual marker; desktop/app summaries misattributing time; duplicate app totals; merged time losing category provenance; raw stored Remaining, non-blocking:
Our open findings: none ( CI: all checks pass on Convergence: detector verdict Domain risk: the query/merge path ( Decision for maintainer: whether Maintainer judgment: merge is not automatic. Ready for review. |
…data Git-Session-Id: 6efa
- merge_events_by_keys: fold the manual marker into the merge key only before classification ($category absent). Once classified, a manual and an automatic event in the same final category must sum into one row; previously a category-totals merge ($category) returned two rows. - get_events_with_categories: look up overrides only for the returned event ids instead of scanning the whole queried interval, so limited reads pay for their result set and honour limit instead of the full history. Adds regression tests for both paths. Git-Session-Id: 64d2500a-11e6-51b0-9570-081fd85ce26c
merge_events_by_keys only drops the manual marker from the merge key when the merge actually groups by `$category`. App/title summaries run after `categorize`, so their events carry `$category` and the previous condition (ignore the marker whenever `$category` is present) folded a manually assigned event into an automatic one for the same app/title, keeping only the first event's category and misattributing the summed duration. Adds regression test app_summary_keeps_manual_and_automatic_categories_apart. Git-Session-Id: 6559c5ca-30af-5ddb-915f-e0ff866bf6ce
The previous cut only dropped the manual marker for `$category` merges and kept it everywhere else, so a manually assigned event and an automatically classified event with the same app/title and the same final category still produced two rows in the desktop app/title summaries. The merge key now carries the event's final `$category` when present (for groupings that do not already include it), so events that agree on the final category fold into one row and events that disagree stay apart instead of collapsing into a row that keeps only the first event's category. Before classification the manual marker still separates groups. Adds regression test app_and_title_merge_folds_manual_and_automatic_of_same_category. Git-Session-Id: 6559c5ca-30af-5ddb-915f-e0ff866bf6ce
The test_wait_for_start_retries_without_blocking_executor test was timing out on Windows CI runners. Increase the server startup delay from 30ms to 100ms to account for higher variance in socket binding time on Windows. Git-Session-Id: 1c86f110-b58a-452d-9dd1-a9b45ded3051
…t mask manual overrides A watcher-stored $category passes through query_bucket, so the merge key treated it as the final classification and merge-before-categorize queries (Android app totals) folded events with different manual overrides. Key on the manual override when present, else $category: identical to the final category after categorize, and keeps manual boundaries before it. Git-Session-Id: 361cddbd-4b13-5c01-95f2-838ae19ece56
…tand in for classification A watcher-stored $category reached transforms through query_bucket, so a merge before categorize could fold automatic time whose stored value matched a manual override into the manual row; categorize then gave the whole row to the override. Every merge-key heuristic left an adjacent hole because the stored value is indistinguishable from categorize's output. Strip it at the query boundary, as $manual_category already is: $category in a query now always comes from categorize. Raw reads (get_events, export) are unchanged. Git-Session-Id: 86643397-ca17-5f7a-a4b6-11c4b36c9764
Git-Session-Id: 00cc5e20-9819-5839-8f4a-941453a16fc1
f0c1227 to
235fe35
Compare
|
Rebased onto master ( The textual conflict was the datastore response enum: preserved both master's Tests caught a semantic integration issue with #776: schema inference recognized only v6, so a restored v7 database would try to recreate the category sidecar. Fixed in Verified locally: full |
Merge recommendation (convergence adjudication)Verified against: Fixed this session: none; no code changes. Earlier fixes and the rebase/schema-inference integration are recorded in the preceding comments. Remaining findings:
Our unresolved findings: none, confirmed with CI on this head: Windows and Android passed; Ubuntu, macOS, coverage, format and Clippy are queued. This is not a claim that current-head CI is green. Domain risk: maintainer smoke-test mixed manual/automatic category reports and merge-before/after-categorize queries; confirm the intended reserved-field and re-categorization semantics. Automatic repair of a manually removed SQLite trigger is not provided or verified by this change. Convergence: detector reports Recommendation: maintainer judgment after current-head CI completes; the remaining AI finding is not a blocker. |
Summary
Implement the backend contract for single-event manual categorization without editing watcher data or changing heartbeat equality.
Boundaries
Local database only. No UI editor, bucket defaults, Python backend parity, or annotation transport through export/import/aw-sync. README documents retention and sync reconciliation limits. Category paths remain historical until explicitly reassigned or cleared.
Verification
Includes a separate minimal lint prerequisite commit removing pre-existing duplicated parser allowances rejected by current Clippy.
This is the backend prerequisite for the user-requested manual category editor, not a claim that the user-facing feature is delivered.