页面顶部
已进入:阅读页
← 返回

动态2026-04-03GitHub作者:李笑来原文链接

mecha.im 发布 v0.5.16

Mecha: Run an army of bots on your own machines. 发布了 v0.5.16。

这个版本更新了什么#

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

以上是作者写在 GitHub 上的英文更新说明原文,未经翻译。查看原页面