You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every governor decision (allowed, denied, throttled, kill-switch-tripped) needs to land in an immutable local event ledger so a contributor can audit what their own miner did — before any enforcement logic exists to populate it. This issue is schema + a pure/append-only writer function only.
Mirror src/selfhost/audit.ts's AuditEvent/logAudit shape (one structured JSON record per lifecycle event, easy to grep/pipe) but for local SQLite storage instead of stdout, since the miner's state must be 100% client-side per the architecture skeleton.
Deliverables
New migration-style SQL (e.g. packages/gittensory-miner/migrations/0001_governor_ledger.sql) defining an append-only governor_events table: id, ts, event_type, repo_full_name, action_class, decision, reason, payload_json — no UPDATE/DELETE path, insert-only
A typed GovernorLedgerEvent type + a pure appendGovernorEvent(db, event) writer, mirroring logAudit's one-JSON-record-per-event shape
Unit tests: successful append round-trips all fields, malformed event type is rejected before insert (fail closed on unknown event_type)
Explicitly note in comments that this issue does NOT wire the ledger into any real governor decision path — it only defines the storage contract other issues will write into
References
src/selfhost/audit.ts (39 lines) — the AuditEvent/logAudit structured-event pattern to mirror
migrations/0010_agent_orchestrator.sql (55 lines) — the existing orchestrator seed-schema style (append-friendly tables, CREATE INDEX per query pattern) to follow for the new miner-local migration
.gittensory-miner.yml (new MinerGoalSpec config file, per the architecture skeleton) — NOT touched by this issue but the eventual consumer of ledger-driven throttling config
Every governor decision (allowed, denied, throttled, kill-switch-tripped) needs to land in an immutable local event ledger so a contributor can audit what their own miner did — before any enforcement logic exists to populate it. This issue is schema + a pure/append-only writer function only.
Mirror
src/selfhost/audit.ts'sAuditEvent/logAuditshape (one structured JSON record per lifecycle event, easy to grep/pipe) but for local SQLite storage instead of stdout, since the miner's state must be 100% client-side per the architecture skeleton.Deliverables
packages/gittensory-miner/migrations/0001_governor_ledger.sql) defining an append-onlygovernor_eventstable:id,ts,event_type,repo_full_name,action_class,decision,reason,payload_json— no UPDATE/DELETE path, insert-onlyGovernorLedgerEventtype + a pureappendGovernorEvent(db, event)writer, mirroringlogAudit's one-JSON-record-per-event shapeReferences
src/selfhost/audit.ts(39 lines) — theAuditEvent/logAuditstructured-event pattern to mirrormigrations/0010_agent_orchestrator.sql(55 lines) — the existing orchestrator seed-schema style (append-friendly tables,CREATE INDEXper query pattern) to follow for the new miner-local migration.gittensory-miner.yml(new MinerGoalSpec config file, per the architecture skeleton) — NOT touched by this issue but the eventual consumer of ledger-driven throttling config