Skip to content

Parity audit columns + wiring (source+head_sha; computeGateParity ported) #1024

Description

@JSONbored

Part of #983.

Context

The cutover safety model depends on computeGateParity (computeGateParity/isParityCutoverReady, ALREADY ported as src/review/parity; MIN_PARITY_SAMPLE=30, agreement floor ~0.98, ZERO unsafe disagreements) which JOINs latest gate-decision rows per (project, target, head_sha) across two source writers in a comparable audit store. gittensory's audit store is auditEvents (db/repositories.ts recordAuditEvent; schema columns id/eventType/actor/route/targetKey/outcome/detail/metadataJson/createdAt) with NO source and NO head_sha (head_sha exists on check_summaries/recommendation_snapshots, not on auditEvents). So parity CANNOT run as-is. This issue adds the audit columns + wires the ported parity module so shadow-parity can run; #1013-era reviewbot rows are tagged source=reviewbot, gittensory rows source=gittensory (migration 0019 is the reference).

Deliverables

  • Add source + head_sha columns to a gittensory gate-decision audit row (new migration; reference reviewbot migration 0019).
  • Tag every gate decision with its writer source (gittensory vs reviewbot) and the PR head_sha on write.
  • Wire the ported src/review/parity (computeGateParity/isParityCutoverReady) over the source-tagged audit rows so shadow-parity can run (floor ~0.98, min 30, zero unsafe disagreements).
  • Reconcile collecting both writers' decisions into one analysis store keyed by (repo, pr, head_sha) — cross-account D1 is impractical, so export/import into one store.
  • Add tests: parity computes agreement + unsafe-disagreement count over source-tagged rows; isParityCutoverReady gates on floor + sample.

Acceptance criteria

  • A gate-decision audit row carries source + head_sha; both writers' decisions are comparable in one store keyed by (repo, pr, head_sha).
  • computeGateParity runs over the source-tagged rows and isParityCutoverReady returns ready only at ≥30 paired samples, ≥ floor agreement, zero unsafe disagreements.

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