state-hub/api/schemas
tegwick acb30978cd 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
..
__init__.py feat(state-hub): add Extension Points and Technical Debt tracking 2026-02-27 07:29:51 +01:00
agent_message.py feat(CUST-WP-0015): implement agent inbox for inter-agent coordination 2026-03-16 02:55:45 +01:00
capability_request.py feat(capability-requests): add routing dispute & reroute workflow (CUST-WP-0027) 2026-03-21 23:58:52 +01:00
contribution.py feat(gems): three-pass schema migration aligning state-hub with GEMS 2026-03-02 23:39:17 +01:00
decision.py Add in-dashboard decision resolution with project log write 2026-02-25 09:34:35 +01:00
doi.py feat(doi): Repository DoI automated gate and dashboard integration (CUST-WP-0024) 2026-03-20 01:08:18 +01:00
domain.py feat(state-hub): implement v0.5 — dynamic domains & multi-repo 2026-02-28 15:20:15 +01:00
domain_goal.py feat(goals): add domain/repo goal tracking and update_workstream MCP tool 2026-03-09 00:15:29 +01:00
extension_point.py fix(api): add ep_id to EPUpdate schema so extension point IDs can be patched 2026-03-11 01:24:42 +01:00
managed_repo.py feat(repos): git-fingerprint-based machine-independent repo identity 2026-03-28 23:55:06 +01:00
progress_event.py Add state-hub v0.1 — local-first state service for the Custodian 2026-02-24 17:47:49 +01:00
repo_goal.py feat(goals): add domain/repo goal tracking and update_workstream MCP tool 2026-03-09 00:15:29 +01:00
sbom.py feat(gems): three-pass schema migration aligning state-hub with GEMS 2026-03-02 23:39:17 +01:00
state.py feat(capability-requests): add cross-domain capability catalog and request routing 2026-03-19 21:07:50 +01:00
task.py feat(token-tracking): introduce token note taxonomy (measured/userbased/workplan/heuristic) 2026-03-29 18:47:40 +02:00
technical_debt.py feat(suggestions): full suggestion workflow with per-step notes 2026-03-18 00:57:34 +01:00
token_event.py feat(token-tracking): repo aggregation via graph walk (task→workstream→repo) 2026-03-29 19:05:23 +02:00
topic.py feat(state-hub): implement v0.5 — dynamic domains & multi-repo 2026-02-28 15:20:15 +01:00
tpsc.py feat(tpsc): Third-Party Services Catalog (CUST-WP-0023) 2026-03-20 00:15:26 +01:00
workstream.py feat(goals): add domain/repo goal tracking and update_workstream MCP tool 2026-03-09 00:15:29 +01:00
workstream_dependency.py Implement State Hub v0.2: dependency graph, next-steps suggestions, design boundary 2026-02-25 23:33:14 +01:00