Commit Graph

658 Commits

Author SHA1 Message Date
b54ee8149c feat(dashboard): add tokens consumed per day chart to Progress page
Fetches /token-events/?limit=1000 in parallel with progress events and
renders a second area+line chart (amber) below the events-per-day chart,
aggregating tokens_in + tokens_out per calendar day over the same 30-day window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 00:42:09 +02:00
5fbce5ef6f chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-30:
  - update .custodian-brief.md for the-custodian
2026-03-30 00:02:40 +02:00
f5c166e77e feat(dashboard): add repo filter, sort order, and max results controls to Token Cost page
Three reactive dropdowns below the Token Cost heading:
- Filter by repo: client-side filter via 3-level chain resolution
- Sort by: Tokens Total (default), Tokens In, Out, Event Count, Most Recent
- Show: 10/20/50/100/500 rows per table (default 20)

Applies uniformly to By Repo, By Workplan, and Top Tasks tables.
"Most Recent" derives last_event_at per group from the fetched events.
Truncated tables show a "Showing M of N" count below.

Completes CUST-WP-0030 T07–T09.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 00:02:17 +02:00
4fd31d4a6d chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:59:59 +02:00
a4563dec14 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:59:24 +02:00
fc5a55a27a chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T09: todo → done
2026-03-29 23:59:22 +02:00
4b79c243dc chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T08: todo → done
2026-03-29 23:59:22 +02:00
6744ad5f74 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T07: todo → done
2026-03-29 23:59:22 +02:00
0de8c17bc7 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:41:06 +02:00
bf8acd0bed chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:40:32 +02:00
697da3825b chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:39:53 +02:00
81022533b5 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:38:55 +02:00
d403a3ed52 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:37:56 +02:00
d350293e6f chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:20:45 +02:00
ba516bb46c chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 23:06:09 +02:00
86548a4dea chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 22:51:38 +02:00
93a55ac4e2 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 22:37:02 +02:00
a32fe1166c chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 22:36:04 +02:00
20ce332d55 feat(dashboard): entity list UX — REF column, name cells, detail pages (CUST-WP-0030)
- ref-cell.js: REF column component — click=copy deeplink, dblclick=open
- field-help.js: field registry + fieldRow helper with help-tip decoration;
  FK fields (task_id, workstream_id, repo_id) render as async-linked cells
  with entity-title bubble-help on hover
- GET /token-events/{id} endpoint + get-by-id tests
- GET /repos/by-id/{repo_id} UUID lookup endpoint
- Landing pages: /token-events/[id], /workstreams/[id], /repos/[slug], /tasks/[id]
- token-cost.md: REF + Name columns on all three tables; parallel fetch of
  workstreams/tasks for title resolution
- reference.md: entity detail page URL scheme documented

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:35:35 +02:00
8a2e786111 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 22:22:18 +02:00
055c973be0 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 22:07:43 +02:00
2f7299ebc8 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 21:53:13 +02:00
00d5bcb919 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 21:38:35 +02:00
f2b847450f chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 21:24:18 +02:00
d9ba1ec7cb chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 21:09:15 +02:00
61fa59e6e6 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 20:54:39 +02:00
c54f8eb966 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 20:40:08 +02:00
3428a680c3 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 20:38:01 +02:00
3e54cb05c8 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T06: todo → done
2026-03-29 20:38:00 +02:00
3d64f288d9 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 20:25:22 +02:00
ac91e5905c chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 20:10:52 +02:00
490fdc52d4 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 20:09:54 +02:00
1d4c4e31d9 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 19:56:00 +02:00
943be6fb97 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T05: todo → done
2026-03-29 19:55:58 +02:00
99a8ba66e9 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T04: todo → done
2026-03-29 19:55:58 +02:00
94aee3d845 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T03: todo → done
2026-03-29 19:55:58 +02:00
df84198c2e chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T02: todo → done
2026-03-29 19:55:58 +02:00
b36e7d469c chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - T01: todo → done
2026-03-29 19:55:58 +02:00
b0edfbb06f chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 19:41:23 +02:00
99cf8c8386 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 19:27:19 +02:00
5594f15590 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 19:26:40 +02:00
a728d04eae chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 19:11:52 +02:00
c763df3805 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 19:05:45 +02:00
bb965e4990 feat(token-tracking): repo aggregation via graph walk (task→workstream→repo)
By Repo now resolves via the full chain rather than requiring repo_id
directly on the token event:
  1. token_events.repo_id (direct)
  2. → workstreams.repo_id (via workstream_id)
  3. → task.workstream_id → workstreams.repo_id (via task_id)

Changes:
- Auto-populate repo_id on token events at creation time (both the
  token_events router and the tasks router)
- New GET /token-events/by-repo/ endpoint with RepoTokenSummary schema;
  returns tokens_in/out/total, event_count, by_model, by_note per repo
- Dashboard By Repo section uses /by-repo/ directly and shows repo_slug
  instead of a truncated UUID
- Backfilled the three existing events (userbased) with repo_id via SQL

185 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 19:05:23 +02:00
18b73f1e2b chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 18:57:46 +02:00
e19953f0b1 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 18:48:10 +02:00
68943684e1 feat(token-tracking): introduce token note taxonomy (measured/userbased/workplan/heuristic)
Tier 1 (exact counts) now defaults to note="measured" instead of null,
signalling the counts were read from the Claude Code status bar.
Callers can pass note="userbased" when a human provided the numbers.

  measured  — agent read exact counts from the Claude Code status bar
  userbased — counts provided by a human
  workplan  — prorated from workplan total across task count
  heuristic — server fallback, 1000/500, no agent input

Added token_note field to TaskUpdate schema and exposed note param on
update_task_status and record_interactive_task MCP tools.
TOOLS.md documents the full taxonomy. 185 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 18:47:40 +02:00
48e0dfc0ca chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 18:42:25 +02:00
e5c2ab4114 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-03-29:
  - update .custodian-brief.md for the-custodian
2026-03-29 18:37:18 +02:00
edffc62775 feat(token-tracking): add record_interactive_task MCP tool
New tool for capturing ad-hoc work done outside formal workplans.
Finds or creates a persistent 'interactive-<repo>' workstream for the
repo, creates the task, marks it done, and records a token event using
the three-tier logic — all in a single call.

Seeded two example events on interactive-the-custodian:
  - Three-tier token recording on task done (8000/3500)
  - Add record_interactive_task MCP tool (4500/1800)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 18:36:51 +02:00