[Phase 1] Observation-only logging and event audit trail #8

Open
opened 2026-07-14 01:19:30 +00:00 by starsetbyte · 0 comments
Owner

Context

During Phase 1, all normalized events should be logged in an append-only audit trail. This proves the event path works without allowing autonomous action, and provides debugging data for Phase 2.

What to build

  1. Append-only SQLite table for observed events:
CREATE TABLE forgejo_event_audit (
    id INTEGER PRIMARY KEY,
    correlation_id TEXT UNIQUE NOT NULL,
    delivery_id TEXT,
    source TEXT NOT NULL,           -- 'webhook' or 'poll'
    repository TEXT NOT NULL,
    event_type TEXT NOT NULL,
    issue_number INTEGER,
    action TEXT,
    actor_kind TEXT,
    actor_principal_id TEXT,
    origin_component TEXT,
    raw_payload_hash TEXT,          -- SHA-256 of raw payload
    normalized_at TEXT NOT NULL,
    routing_decision TEXT NOT NULL  -- 'observe-only' during Phase 1
);
  1. CLI or API to query the audit trail:

    • Show recent events
    • Filter by repository, event type, actor
    • Show deduplication stats (how many duplicates rejected)
    • Show routing decisions
  2. Log webhook delivery failures and poll gaps.

Acceptance

  • All normalized events are written to the audit table
  • Duplicate detection is logged (count + reason)
  • CLI can query recent events with filters
  • Routing decision is always observe-only during Phase 1
  • Poll gaps and webhook failures are logged
## Context During Phase 1, all normalized events should be logged in an append-only audit trail. This proves the event path works without allowing autonomous action, and provides debugging data for Phase 2. ## What to build 1. Append-only SQLite table for observed events: ```sql CREATE TABLE forgejo_event_audit ( id INTEGER PRIMARY KEY, correlation_id TEXT UNIQUE NOT NULL, delivery_id TEXT, source TEXT NOT NULL, -- 'webhook' or 'poll' repository TEXT NOT NULL, event_type TEXT NOT NULL, issue_number INTEGER, action TEXT, actor_kind TEXT, actor_principal_id TEXT, origin_component TEXT, raw_payload_hash TEXT, -- SHA-256 of raw payload normalized_at TEXT NOT NULL, routing_decision TEXT NOT NULL -- 'observe-only' during Phase 1 ); ``` 2. CLI or API to query the audit trail: - Show recent events - Filter by repository, event type, actor - Show deduplication stats (how many duplicates rejected) - Show routing decisions 3. Log webhook delivery failures and poll gaps. ## Acceptance - [ ] All normalized events are written to the audit table - [ ] Duplicate detection is logged (count + reason) - [ ] CLI can query recent events with filters - [ ] Routing decision is always `observe-only` during Phase 1 - [ ] Poll gaps and webhook failures are logged
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starsetbyte/aether#8
No description provided.