Skip to content

feat(miner-manage): append-only local event ledger for the manage/loop phase #2322

Description

@JSONbored

The miner needs an immutable, append-only event log (distinct from the mutable portfolio table in the schema foundation issue) so every state transition a PR goes through — opened, polled, ci_passed, ci_failed, gate_merged, gate_closed, rejected, disengaged — is replayable and auditable locally, mirroring the spirit of the cloud review_audit ledger but 100% client-side.

Deliverables

  • packages/gittensory-miner/src/state/event-ledger.tsappendEvent() (insert-only, never update/delete) and readEvents(filter)
  • Event type union covering the manage/loop lifecycle (opened, ci_status_changed, gate_verdict_observed, outcome_recorded, rejection_handled, loop_reentered)
  • Each event row is self-contained JSON with a monotonic sequence number per run
  • Unit tests: append-only invariant (no update path exists), ordering, and filter-by-run/by-type

References

  • packages/gittensory-miner/src/state/schema.ts (new, from the schema-foundation issue — this ledger is a sibling table in the same local DB)
  • migrations/0049_review_audit_parity.sql — cloud audit-ledger naming precedent (event_type discriminator column) to mirror in spirit only
  • New: packages/gittensory-miner/src/state/event-ledger.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions