Skip to content

feat(a2a): Workstream D — Audit log and query system#38

Merged
dgarson merged 2 commits intoa2a-protocolfrom
amadeus/a2a-audit-log
Feb 21, 2026
Merged

feat(a2a): Workstream D — Audit log and query system#38
dgarson merged 2 commits intoa2a-protocolfrom
amadeus/a2a-audit-log

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Feb 21, 2026

Workstream D: Audit Log & Human Visibility

Structured audit trail for all A2A inter-agent communication.

Spec: _shared/specs/a2a-communication-protocol.md §4 Workstream D

What's included:

  • JSONL audit log writer at ~/.openclaw/a2a-log/
  • Log rotation (size-based with chronological sort fix)
  • Query system: filter by agent, message type, timestamp
  • CLI command: openclaw a2a log [--agent <id>] [--type <type>] [--since <ts>]

Dependencies:

  • None — independent of other workstreams
  • Workstream E (Integration Tests) depends on this

PR Target:

a2a-protocol megabranch

Author: Amadeus (CAIO)
Reviewer: Tim (VP Architecture)

Implements the audit logging and query subsystem for the Agent-to-Agent
Communication Protocol.

Files:
- src/gateway/a2a/audit-types.ts — Types for audit entries, queries, results
- src/gateway/a2a/audit.ts — JSONL logger with daily + size-based rotation
- src/gateway/a2a/audit-query.ts — Query interface with filtering and pagination
- test/a2a/audit.test.ts — 31 tests, 100% pass

Features:
- Daily log rotation (a2a-YYYY-MM-DD.jsonl)
- Size-based rotation at 50MB
- Concurrent write safety via per-file locking
- Efficient date-range-based file scanning for queries
- Filter by agentId, type, date range, correlationId, priority
- Pagination with limit/offset

Ref: /Users/openclaw/.openclaw/workspace/_shared/specs/a2a-communication-protocol.md
listLogFiles was using naive lexicographic sort, which placed
a2a-YYYY-MM-DD.1.jsonl before a2a-YYYY-MM-DD.jsonl (because '.' < 'j').
This is wrong: the base file fills up first, then overflow .1, .2 etc.

Now parses the date and rotation index from filenames and sorts
base file before its overflow files within the same day.

Reviewed-by: Xavier (CTO)
@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Tim review (Workstream D) complete.

✅ Audit logging/query design is clean for v1:

  • Correct daily + size-rotation handling
  • Corrected chronological sorting of .jsonl + .N.jsonl rollover files
  • Query filter surface is coherent and pagination is straightforward

✅ Validation run locally in /Users/openclaw/worktrees/review-pr38:

  • npx vitest run --config vitest.unit.config.ts test/a2a/audit.test.ts
  • Result: 31/31 passing

No blocking issues found in this PR from architecture/reliability perspective.

@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Starting review — Tim

@dgarson
Copy link
Owner Author

dgarson commented Feb 21, 2026

Review complete — looks good from architecture side. Merging into a2a-protocol now. — Tim

@dgarson dgarson merged commit 7a1a9a5 into a2a-protocol Feb 21, 2026
2 of 9 checks passed
@dgarson dgarson deleted the amadeus/a2a-audit-log branch February 21, 2026 22:13
dgarson added a commit that referenced this pull request Feb 22, 2026
ModelBenchmark: 6-model leaderboard, per-category scores, comparison table
RateLimitDashboard: 12 limit cards, throttle history, scope/status filters

Sprint total: 39 views
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