refactor(desktop): drop agent-usage file-size overrides and dedupe date formatter

The branch had ratcheted the desktop file-size gate four times. One of those
entries re-declared `src-tauri/src/lib.rs` at 1001 while a pre-existing entry
at line 58 sets 1013 — the override map is a JS `Map`, so the later key won and
the branch silently lowered a ceiling it never needed to touch (lib.rs is 920).

Splitting at existing seams removes the other two: the M1 schema migration
moves to `archive/store_migrations.rs` behind one `pub(super)` entry point, and
the kind-44200 archive tests move to `archive/mod_agent_metric_tests.rs`,
`#[path]`-included from `mod_tests.rs` so they keep reaching the shared
fixtures through `use super::*`. `mod_tests.rs` returns to its pre-branch 1208
ceiling rather than dropping it, since that debt predates this work.

`formatCoverageDate` was duplicated verbatim in both usage components; it now
lives beside the other formatters in `lib/agentUsage.ts`.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7
2026-07-25 15:43:57 -04:00
co-authored by Will Pfleger
parent 194ceb64f5
commit e1274be394
10 changed files with 617 additions and 596 deletions
+1 -19
View File
@@ -75,18 +75,7 @@ const overrides = new Map([
// is test-only content; the override covers the test growth accumulated
// across the local-archive + agent-metric-archive PR series. store_tests.rs
// (~731 lines) is under 1000 so needs no override.
// agent-usage-archive (Rev 3): persistedAgentMetrics decrypt-success
// assertion + re-ingest no-double-count test, plus three
// get_agent_usage_series integration tests (fresh ingest, agentPubkey
// filter + hasArchivedEvidence, pre-existing-row backfill) exercising the
// command's SQLite core end to end. Test-only content; ratcheted
// 1208 -> 1424.
["src-tauri/src/archive/mod_tests.rs", 1424],
// agent-usage-harness: M1 migration (atomic transaction wrapper, PRAGMA
// guard, canonical-store worklist) + rebuild_metric_index_in_tx helper
// + apply_schema_migrations + store_migration_tests.rs #[path] include.
// Load-bearing correctness fix (Thufir IMPORTANT). M1 tests split out.
["src-tauri/src/archive/store.rs", 1044],
["src-tauri/src/archive/mod_tests.rs", 1208],
// unified-agent-model 1A.1: profile reconcile split to agents_profile.rs,
// ratcheting 1443 -> 1295. Queued to split further in the A2 fold.
// global-agent-config: resolve_deploy_model_provider + visibility exports
@@ -532,13 +521,6 @@ const overrides = new Map([
// runtimeSupportsLlmProviderSelection guard on discovery provider (codex fix);
// hideProviderIds computation for Databricks v1 gate. Queued to split.
["src/features/agents/ui/AgentDefinitionDialog.tsx", 1035],
// agent-usage-archive (Rev 3): Phase 2's single invoke_handler registration
// line for get_agent_usage_series (826d79221) pre-existed under the prior
// 1000-line ceiling; rebasing this branch onto a later main (which grew
// lib.rs by 2 lines upstream, unrelated to this feature) tipped the file
// to 1001. Not generic debt growth from this PR — one line, pre-existing.
// Queued to split with the rest of this list.
["src-tauri/src/lib.rs", 1001],
]);
await runFileSizeCheck({