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
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
Part of #983.
Context
The cutover safety model depends on
computeGateParity(computeGateParity/isParityCutoverReady, ALREADY ported assrc/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 twosourcewriters in a comparable audit store. gittensory's audit store isauditEvents(db/repositories.tsrecordAuditEvent; schema columns id/eventType/actor/route/targetKey/outcome/detail/metadataJson/createdAt) with NOsourceand NOhead_sha(head_sha exists oncheck_summaries/recommendation_snapshots, not onauditEvents). 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 taggedsource=reviewbot, gittensory rowssource=gittensory(migration 0019 is the reference).Deliverables
source+head_shacolumns to a gittensory gate-decision audit row (new migration; reference reviewbot migration 0019).source(gittensory vs reviewbot) and the PRhead_shaon write.src/review/parity(computeGateParity/isParityCutoverReady) over the source-tagged audit rows so shadow-parity can run (floor ~0.98, min 30, zero unsafe disagreements).isParityCutoverReadygates on floor + sample.Acceptance criteria
source+head_sha; both writers' decisions are comparable in one store keyed by (repo, pr, head_sha).computeGateParityruns over the source-tagged rows andisParityCutoverReadyreturns ready only at ≥30 paired samples, ≥ floor agreement, zero unsafe disagreements.Notes
computeGateParityis ALREADY ported (src/review/parity); scope here is the audit columns + wiring, not re-porting. This is a hard prerequisite for a safe per-repo flip (feat(agent): return useful decision packs while snapshots refresh #15) — without it the cutover loses its primary safety net.