Skip to content

test(engine): build a true live-gate-vs-predicted-gate cross-check #4257

Description

@JSONbored

Found during a 2026-07-08 miner-roadmap audit. The entire "byte-parity between the live gate and miner self-review" promise — the reason gittensory-engine exists — currently has no test that actually verifies it end-to-end.

test/contract/engine-parity.test.ts (real, wired into test:ci) is a regression detector: it diffs buildPredictedGateVerdict's output against committed golden fixtures, catching "predicted-gate's output silently changed." That's valuable, but it only checks predicted-gate's self-consistency — nothing verifies predicted-gate's output still agrees with what the real live gate (src/queue/processors.ts) would decide for the same PR. That guarantee currently rests entirely on ~15 file pairs being manually kept identical between src/{review,settings,signals}/*.ts and their packages/gittensory-engine/src/{review,settings,signals}/*.ts namesakes (see the separate engine-parity-drift-detector item in #2353's Phase 7, freshly annotated with this same finding).

This is the test that would have caught the one already-discovered divergence (signals/change-guardrail.ts, turned out behaviorally equivalent this time) if it hadn't been equivalent. Flagged maintainer-only and separate from the drift-detector item because building it needs a real processors.ts test harness and real design judgment about how to replay a scenario through both the live enforcement path and the predicted-gate composer without duplicating half the gate's own infrastructure.

Deliverables

  • A test harness that can replay a representative PR scenario through both src/queue/processors.ts's real enforcement path and buildPredictedGateVerdict, without needing a live GitHub/DB round-trip for each
  • Diff the two verdicts; fail on disagreement
  • Cover at minimum the same scenario set as test/contract/engine-parity.test.ts's existing 8 fixtures, ideally the same set the sibling fixture-expansion issue adds
  • Wire into test:ci alongside the existing test:engine-parity script
  • Document in the test file itself what this catches that the existing self-consistency suite doesn't, so future maintainers understand why both exist

References

  • test/contract/engine-parity.test.ts (existing self-consistency suite — what this complements, not replaces)
  • src/queue/processors.ts (the real live-gate enforcement path to cross-check against)
  • packages/gittensory-engine/src/predicted-gate.ts (the composer under test)
  • Issue 🧩 Wave 2 — Analyze, Plan, Create & Deploy (HELD tracker) #2353, Phase 7 "engine-parity drift detector" item (the freshly-annotated finding this test would directly protect against)

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions