Skip to content

State + audit migration (decision-cache/approvedSha/reputation/tunables/review_audit) before cutover #1025

Description

@JSONbored

Part of #983.

Context

A fresh gittensory DB without reviewbot's stateful tables would trigger a full re-review STORM (the dead-letter-storm class of incident) + a reputation RESET across all 3 repos on cutover. The stateful tables to migrate are: per-head_sha decision-cache (migration 0005), approved_sha approve-once-per-commit (0006), submitter reputation/stats (0011/0018), tunables + shadow overrides + override audit (0014-0016), and review_audit with source/head_sha (0019, the parity columns from #1024). These must land in gittensory D1 BEFORE any cutover. reviewbot's migrations 0001-0019 must be reconciled against gittensory's 0001-0045 schema (namespace-check review_audit table-name collision with gittensory's recordAuditEvent).

Deliverables

  • Migrate the decision-cache (per head_sha, migration 0005) so cutover does NOT re-review every open PR.
  • Migrate approved_sha (0006) so approve-once-per-commit is preserved.
  • Migrate submitter reputation/stats (0011/0018) so reputation is NOT reset.
  • Migrate tunables + shadow overrides + override audit (0014-0016) so the self-improve state carries over.
  • Migrate review_audit rows with source/head_sha (0019 / Parity audit columns + wiring (source+head_sha; computeGateParity ported) #1024) so parity has history.
  • Reconcile reviewbot migrations 0001-0019 against gittensory 0001-0045; resolve table-name collisions (review_audit vs gittensory auditEvents/recordAuditEvent).
  • Add a migration dry-run + a re-review-storm guard verifying no mass re-enqueue post-migration.

Acceptance criteria

  • All stateful tables (decision-cache, approvedSha, reputation/stats, tunables/shadow/override-audit, review_audit with source/head_sha) exist in gittensory D1 with data, BEFORE any cutover.
  • Cutover does not cause a re-review storm or a reputation reset; the migration dry-run confirms no mass re-enqueue.

Notes

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions