Skip to content

Port audit persistence to PostgreSQL #154

Description

@atomantic

Port the tree auditor's persisted runs, issues, changes, cursors, and accept/reject/undo mutations from SQLite to PostgreSQL.

Depends on #150

Scope:

  • Convert auditor-agent persistence queries and transactions to the async PostgreSQL service.
  • Preserve pause/resume/cancel cursor lifecycle, status transitions, bulk operations, issue counts, change application, and undo semantics.
  • Translate SQLite-specific boolean/count/result assumptions and ensure concurrent audit activity uses explicit transaction ownership.
  • Add integration coverage for lifecycle handoffs, resume after restart, accept/reject/undo, cancellation, and rollback.

Acceptance criteria:

  • Audit REST/SSE behavior remains unchanged while all audit tables are read/written through PostgreSQL.
  • A paused run resumes from the persisted cursor after process restart.
  • Competing lifecycle actions cannot leave a run with contradictory status/ownership.
  • No auditor persistence path imports sqlite.service.

Files/areas: server/src/services/auditor-agent.service.ts, audit routes/SSE coordination, PostgreSQL audit schema, integration tests.

Part of #120

After this issue ships, check its box in #120. If it was the last open child, comment on #120 with a summary of the delivered children and close #120 as completed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort:maxMaximum reasoning effort recommendedmodel:heavyBest suited to the strongest available coding modelplanClaimable backlog item

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions