Skip to content

feat: add durable conversations and sanitized audit storage - #9

Merged
YangYuS8 merged 22 commits into
mainfrom
agent/durable-conversation-audit
Jul 16, 2026
Merged

feat: add durable conversations and sanitized audit storage#9
YangYuS8 merged 22 commits into
mainfrom
agent/durable-conversation-audit

Conversation

@YangYuS8

@YangYuS8 YangYuS8 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What changed

  • add a durable conversation Store abstraction with SQLite and PostgreSQL implementations
  • run transactional startup migrations and expose storage health through readiness
  • persist public user/assistant messages, release and Prompt metadata, sanitized Tool lifecycle records, and Provider support-case references
  • add deterministic run/message/Tool identities and reject cross-tenant or cross-conversation replay conflicts
  • decorate the Agent Streamer instead of coupling persistence to the HTTP transport
  • decorate Provider case.create to persist the returned case reference without storing raw Tool payloads
  • add a private tenant-scoped transcript endpoint for trusted support operators
  • add transactional, restart-safe retention cleanup
  • add tests for idempotency, tenant isolation, transcript protection, support-case recording, and cleanup
  • document PostgreSQL production configuration, SQLite development use, migration, rollback, and data-minimization rules

Privacy boundary

The store never persists chain of thought, bearer contexts, service secrets, Tool arguments, unrestricted Tool results, raw Provider payloads, product recipes, or other customers' data.

Production behavior

Set NIVORA_STORAGE_REQUIRED=true in production. Storage then participates in /readyz, and an unavailable database prevents customer traffic. Writes fail closed so a completed response is not served without its required public transcript and audit metadata.

Locked drivers

  • modernc.org/sqlite v1.34.5
  • github.com/jackc/pgx/v5 v5.7.2

Validation

The final read-only CI passes:

  • clean go mod tidy
  • gofmt
  • go vet ./...
  • go test -race ./...
  • go build -trimpath ./...

The SQLite tests execute migrations, replay/idempotency checks, tenant-scoped transcript reads, sanitized Tool and support-case persistence, and transactional retention cleanup.

@YangYuS8
YangYuS8 marked this pull request as ready for review July 16, 2026 11:25
@YangYuS8
YangYuS8 merged commit 618795d into main Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant