Skip to content

Keep the 1.0 meaning of tracked time in the API, routines and filters - #1024

Merged
pixari merged 1 commit into
mainfrom
fix/tracked-time-api-compatible
Nov 7, 2026
Merged

pixari merged 1 commit into
mainfrom
fix/tracked-time-api-compatible

Conversation

@pixari

@pixari pixari commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Follow-up of #1008 (issue #1004).

Why

#1008 made a repeating task's tracked total count only its current occurrence. That is the right figure in the app, but it also changed what three v1 surfaces mean: tracked_minutes in the agent tools and MCP, the automation condition tracked (server and device runner), and the filter terms tracked / tracked cmp duration (saved views, routine Find tasks steps). docs/stability.md allows only additions within 1.x, and "changing what a field means" needs a new major version. #1008 is in no release yet, so restoring the 1.0 meaning now breaks nobody.

What changes

The old names go back to the 1.0 meaning, and the new meaning gets new names alongside them.

Surface Repeating task, 30 min before a completion and 10 after
MCP / agent tools tracked_minutes 40 (as in v1.0.0)
MCP / agent tools tracked_minutes_occurrence (new, repeating tasks only) 10
REST no tracked total in any response (unchanged); docs/api.md points to the MCP fields
Routine condition tracked: {min_minutes: 30} matches (40)
Filter tracked >= 30m (saved views, Find tasks) matches
Filter tracked occurrence >= 30m (new) no match; tracked occurrence = 10m matches
Row chip, Time tab total 10m (per occurrence, from #1008), "All occurrences 40m"
  • tracked occurrence was a syntax error on 1.0, so no stored query changes meaning. In the condition editor it is the tracked time condition with the new All occurrences switch turned off.
  • No new routine condition: a routine's condition usually runs on task.completed, and completing the task is what starts a new occurrence, so a per-occurrence condition would always read 0 there. A Find tasks step with tracked occurrence covers it (design D3).
  • The app's shared totals store holds both maps. Rows read the occurrence, and filters, saved views and sidebar counts read both.

Tests

  • internal/mcp TestTrackedMinutesOfRepeatingTask pins tracked_minutes 40 and tracked_minutes_occurrence 10, and checks that a plain task has no new field.
  • internal/rules TestTrackedKeepsTheTotal: the condition and the tracked / tracked occurrence Find tasks queries.
  • Shared vectors: occurrence_fixture.json gains the 30/10 case (totals / all_totals); evaluate.vectors.json gains tracked_occurrence with cases; formatted.txt is regenerated.
  • vitest filter.test.ts "evaluate: tracked occurrence", the builder round trips, and timeTab.test.tsx (row 10, filter 50/10).
  • The v1 surface snapshot was updated additively. The sample task now repeats, which records tracked_minutes_occurrence, recurrence and next_occurrences.

Bundle

The first load is 687.03 KB against 687 KB, so the budget goes up to 688 KB with the reason in web/bundle-budget.json. The entry chunk is 139.7 KB of 140.

OpenSpec

tracked-time-api-compatible has a proposal, a design, MODIFIED deltas for time-tracking "Tracked time of a repeating task" and filter-queries "Tracked time terms", and tasks. It is archived.

Checks

  • go test ./internal/timetrack ./internal/agenttools ./internal/mcp ./internal/filter ./internal/rules ./internal/ruleval ./internal/httpapi/..., plus ./internal/codesize
  • full vitest, npm run build, npm run lint, make bundle-budget
  • make i18n-check (two new strings, translated in every catalog), make docs-check, make repo-check, make openspec-validate, make ui-lint

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bkw4TZLFDGeMdZR3vWZF13

#1008 made a repeating task's tracked total count only its current
occurrence everywhere, which changed what tracked_minutes, the routine
condition tracked and the filter terms tracked mean. docs/stability.md
allows only additions within 1.x, so those surfaces read every entry of
the task again, as in v1.0.0, and the current occurrence is added
alongside: tracked_minutes_occurrence on repeating tasks and the filter
term tracked occurrence (All occurrences turned off in the builder).
The row chip and the Time tab keep the per-occurrence figure.

OpenSpec change tracked-time-api-compatible (archived).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bkw4TZLFDGeMdZR3vWZF13
@pixari
pixari merged commit 92ea924 into main Nov 7, 2026
34 checks passed
@pixari
pixari deleted the fix/tracked-time-api-compatible branch November 7, 2026 13:52
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.

1 participant