refactor(server): move the install audit trail from core to the server (P1.2, UF-040)

Core keeps only shared infrastructure, so InstallAuditStore leaves it and
lives in packages/server/src/local/install-audit.ts. The trail itself stays:
the Audit and Activity tabs, the extend and export routes, and the threat
model entry keep working on the same waggle.db table.

- @waggle/shared gets RecordAuditInput and the narrow InstallAuditRecorder
  (record only), which the agent's skill tools now depend on.
- The server creates the audit table before the one-time legacy copy, which
  no longer constructs it in core.
- UF-040: GET /api/debug/logs called prepare() on the store's private db
  wrapper, which has none, so the support bundle never carried recent
  installs. It now reads them through getRecentSummary().
This commit is contained in:
shumeiko.it
2026-10-25 21:32:38 +01:00
parent 3befcd8e9b
commit 2e08f2ae96
22 changed files with 118 additions and 79 deletions

View File

@@ -2,8 +2,8 @@
* Cron Store — SQLite persistence for solo cron schedules.
*
* Stores cron job definitions with expression validation via cron-parser,
* due-job queries, and run tracking. Follows the same pattern as
* InstallAuditStore — operates on the .mind DB with lazy table creation.
* due-job queries, and run tracking. Operates on waggle.db with lazy table
* creation.
*/
import cronParser from 'cron-parser';