Skip to content

sync: add DebugConfig() + StreamAuditEvents() (DAK-7477, DAK-7534) - #146

Merged
ferhimedamine merged 2 commits into
mainfrom
fix/dak7534-debug-config-audit-stream
Jul 26, 2026
Merged

sync: add DebugConfig() + StreamAuditEvents() (DAK-7477, DAK-7534)#146
ferhimedamine merged 2 commits into
mainfrom
fix/dak7534-debug-config-audit-stream

Conversation

@ferhimedamine

Copy link
Copy Markdown
Contributor

Summary

Parity audit DAK-7534: two additions vs server v0.11.102.

1. DebugConfig() — GET /debug/config (DAK-7477)

New method returning map[string]string of active DAKERA_* env vars (non-secret) from the running server, plus _version and optionally _build_sha. Requires Admin scope. Used by bench harnesses to verify feature-flag config before scoring.

2. StreamAuditEvents() — GET /v1/audit/stream (OBS-1)

Go was the only SDK missing the audit stream endpoint (py/js/rs all have it). New method opens a long-lived SSE connection and returns <-chan *AuditEvent. Uses bufio.Scanner for SSE line parsing. Goroutine closes the channel on context cancellation, connection drop, or stream end. Added bufio to client imports.

Files changed:

  • client.go: Add bufio import, DebugConfig(), StreamAuditEvents() methods (inline error parsing for non-retry SSE path)
  • client_admin_test.go: Add fmt/time imports, TestDebugConfig* and TestStreamAuditEvents* tests

Test plan

  • CI: go test ./... + go vet ./... (Go not installed on prod box)
  • 4 new tests: TestDebugConfigReturnsEnvMap, TestDebugConfigRequiresAdminScope, TestStreamAuditEventsYieldsEvents, TestStreamAuditEventsRequiresAuth

Closes part of DAK-7534.

🤖 Generated with Claude Code

Two parity additions vs server v0.11.102:

1. DebugConfig() → GET /debug/config (DAK-7477, server v0.11.100):
   Returns map[string]string of active DAKERA_* env vars (non-secret)
   plus _version and optionally _build_sha.

2. StreamAuditEvents() → GET /v1/audit/stream (OBS-1):
   Go was the only SDK missing this endpoint. Opens a long-lived SSE
   connection and returns <-chan *AuditEvent. Uses bufio.Scanner for
   SSE line parsing. Supports agentID and eventType filters.

Tests: TestDebugConfig*, TestStreamAuditEvents* in client_admin_test.go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ferhimedamine ferhimedamine added the auto-merge Auto-merge when CI passes label Jul 25, 2026
…o has the typed *AuditEvent version (DAK-7540)
@ferhimedamine
ferhimedamine merged commit 98a74cd into main Jul 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Auto-merge when CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant