Skip to content

[EL-32] Add usage, budgets, retention, exact-cache, prompt-cache, and batch-job dashboards #127

Description

@sodejm

Catalog ID: EL-32

Public issue: #127

Reviewed baseline: 71abaf4067d4118f28910a22c20524b4e0282b28

Core objective: Provide privacy-minimal operational dashboards and controls
for aggregate usage, explicit budgets, retention, caches, and batch jobs without
displaying or storing prompt or response payloads.

Priority / phase: P2 / Operational controls

Publication status: Published as #127.

Dependency mapping

UX/UI requirements

  • Provide scoped date filters, provider/model breakdowns, budgets, cache
    statistics, retention controls, batch status, and accessible chart tables.
  • Distinguish estimates from provider-reported values.
  • Confirm cache clearing, retention reduction, and batch cancellation.
  • Never display payloads, secrets, or precise sensitive filenames.

Public interfaces

  • Add UsageSummary, BudgetPolicy, RetentionPolicy, CacheSummary,
    CacheClearRequest, and BatchJobSummary.
  • Expose aggregate counts, durations, tokens, costs, cache metrics, status, and
    coarse timestamps only.
  • Budget updates require scope, currency, threshold, and revision.

Underlying app changes

  • Add aggregate endpoints over existing usage, cache, retention, and batch
    services.
  • Add policy-enforced budget checks before generation.
  • Add bounded atomic cache clearing, batch cancellation, and payload-free
    retention deletion.

Acceptance criteria

  • Dashboards reconcile against deterministic seeded aggregate records.
  • Prompt, response, secret, genealogy, and full-path content never appears
    in DTOs or charts.
  • Warnings and hard stops occur at configured budget boundaries.
  • Retention changes preview affected aggregate record counts.
  • Cache clearing is scoped and audited without payloads.
  • Batch status survives renderer reload and sidecar restart.
  • Charts have keyboard-accessible table alternatives.
  • Server aggregation and bounded results keep large datasets responsive.

Security mitigations and rejected anti-patterns

  • Applies TM-S01, TM-L02, TM-A02, TM-C01, and TM-O01.
  • Reject payload telemetry, prompt/response dashboards, secret-derived provider
    inference, client-only budgets, unbounded histories, raw cache inspection,
    and sensitive filenames.

Workspace mapping

  • Exclusive owned paths: desktop/src/features/operations-dashboard/**,
    src/ancestryllm/api/routes/operations_dashboard/**,
    tests/api/operations_dashboard/**, and
    desktop/tests/operations-dashboard/**.
  • Shared-file rule: Request narrowly scoped changes from existing usage,
    cache, retention, and batch owners; shared schemas/dependencies remain
    owner-managed.
  • Base rule: Branch from updated main after all dependencies merge.
  • Branch: feature/electron-el-32-operations-dashboard
  • Worktree: /Users/justinsoderberg/Development/worktrees/ancestryllm-electron-el-32-operations-dashboard
  • Validation: make test; make lint; make typecheck; make security;
    pnpm --dir desktop test; pnpm --dir desktop typecheck

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions