Skip to content

v0.5.16

Choose a tag to compare

@xiaolai xiaolai released this 02 Apr 16:12
· 48 commits to main since this release

Log — Fifth Domain Noun

Mecha now has five nouns: Events, Workers, Tasks, Policies, Logs.

Structured Audit Trail (internal/logs/)

  • Schema V6: logs table with INTEGER PRIMARY KEY AUTOINCREMENT, trace_id for causal grouping, typed outcome/attempt/error columns, sparse JSON detail
  • 14 action constants across 6 pipeline phases (webhook, match, dispatch, policy, writeback, worker)
  • 5 outcome values: ok, fail, skip, retry, deny
  • GET /logs API with filters: event, task, worker, action prefix, since, limit
  • All detail fields redacted via RedactSecrets before write
  • Fire-and-forget Record() — never blocks the pipeline

Package Rename — All Plural

  • internal/event/ → internal/events/
  • internal/worker/ → internal/workers/
  • internal/task/ → internal/tasks/
  • internal/policy/ → internal/policies/
  • internal/logs/ — new (already plural)
  • 160 files changed, pure rename + shadowing conflict resolution

Documentation — 100% Coverage

  • 183/183 exported symbols documented in go-api.md
  • Logs package: types, methods, 14 action constants, 5 outcome constants
  • All audit findings fixed: version refs, secrets permissions, state diagrams, Gemini annotation

Domain Model

Five nouns: Events, Workers, Tasks, Policies, Logs
Pipeline: Event.arrive → Event.match → Task.create → Task.dispatch → Policy.filter → Respond
Audit: Log.record at every pipeline stage

Full Changelog: v0.5.15...v0.5.16