Skip to content

refactor: audit batch 14 — Q03,Q07 transport/API split first slices - #216

Merged
hermes-gadget merged 1 commit into
mainfrom
fix/audit-batch14
Sep 6, 2026
Merged

hermes-gadget merged 1 commit into
mainfrom
fix/audit-batch14

Conversation

@hermes-gadget

Copy link
Copy Markdown
Owner

Summary

Final block of the 2026-09-05 GPT-6 audit — Q03 + Q07, closing out all 141 findings.

Q03 — transport/API split (dead duplicate collapse)

  • Deleted the 7 typed cron endpoints in `HermesApi` and their 7 unused `HermesRepository` wrappers — zero callers, superseded by CronViewModel's raw path with requireSemanticOk semantics.
  • `SyncSnapshot.cron` now carries the raw `JsonElement`; `HermesSyncWorker` decodes it with `parseCronJobs`.
  • Contract: one endpoint per path.

Q07 — ChatViewModel ownership split (dictation slice)

  • New `ChatDictationController`: server-dictation session (tab+generation), voice-scope guard, server STT capability probe/cache with TTL and one-shot per-scope probing.
  • `ChatViewModel` delegates all bookkeeping to it; guard/call sites rewritten.
  • 4 regression tests (`ChatDictationControllerTest`): session tracking, scope guard (scope/generation/tab/nullable cases), capability cache TTL + invalidation, probe bookkeeping.

Test plan

  • Local: `./gradlew :app:testDebugUnitTest` — 598 tests, 0 failures.

Fixes: #150 (Q03), #156 (Q07)
Part of the 2026-09-05 audit sweep (all 141 findings implemented across batches 1–14).

Completes the 2026-09-05 GPT-6 audit (ROADMAP.md):

- Q03: removed the dead typed cron endpoint duplicates — the seven typed
  cron endpoints in HermesApi and their unused HermesRepository wrappers
  (getCron/createCron/pauseCron/resumeCron/triggerCron/updateCron/deleteCron)
  had zero callers; CronViewModel's raw path (with semantic-OK handling) is
  the single live contract. SyncSnapshot.cron carries the raw JsonElement
  and HermesSyncWorker decodes it via parseCronJobs. One endpoint per path.

- Q07: extracted ChatDictationController out of ChatViewModel — server
  dictation session tracking (tab+generation), voice-scope guard, and the
  server STT capability probe/cache (TTL, per-scope one-shot probing) now
  live in an independently testable controller; ChatViewModel delegates.
  4 regression tests in ChatDictationControllerTest.

Local: 598 tests, 0 failures.

Fixes: #150 (Q03), #156 (Q07)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment