feat: add issue_usage tracking and metrics for AI ticket enhancement and planning

Add `issue_usage` table with columns for user_uid, tokens, cost, and latency metrics, including a unique index on user_uid. Wire `accumulate_usage` into `enhance_ticket` and `generate_plan` to capture per-request AI usage, persist totals via `add_issue_usage` in both `IssueCreateService` and `PlanningReportService`, and expose aggregated usage as metric cards through `IssueTrackerService.collect_metrics`. Update planning API docs summary to reflect the new phased implementation document format.
This commit is contained in:
2026-06-19 11:59:40 +00:00
parent 7bbaf51450
commit ff3cbbbfe2
16 changed files with 503 additions and 122 deletions
@@ -50,6 +50,8 @@ export class PlanningGenerator {
poll(statusUrl, ui) {
return JobPoller.run(statusUrl, {
intervalMs: 2000,
maxAttempts: 400,
onDone: (status) => {
if (ui.status) ui.status.hidden = true;
this.renderReport(status, ui);