Skip to content

feat(review): dispatch wiring for e2eTests in queue/processors.ts #4194

Description

@JSONbored

Part of #4189. Depends on #4192, #4193.

Context

Fix-handoff's dispatch shape in src/queue/processors.ts is a three-touch-point pattern, verified at the exact lines currently in main:

// processors.ts:8619
let fixHandoffEnabledForReview = false;

// processors.ts:9164
fixHandoffEnabledForReview = shouldEmitFixHandoff(env, repoFullName, reviewManifestForAutoReview?.review.fixHandoff ?? undefined);

// processors.ts:10592
...(fixHandoffEnabledForReview && aiReview?.inlineFindings?.length
  ? { fixHandoffBlocks: buildFixHandoffCollapsible(...) }
  : {}),

The critical invariant (called out explicitly in the surrounding comment at processors.ts:10589-10591): blocks are only built on a fresh cache-miss pass with inline findings present — a cache hit must render byte-identically, nothing new emitted. Getting this wrong means either regenerating (and re-billing) an LLM call on every cached re-render, or a stale block persisting after a repo turns the feature off.

Requirements

  • Declare an outer-scoped e2eTestGenEnabledForReview = false flag near fix-handoff's own flag declaration (processors.ts:8619).
  • Resolve it unconditionally alongside the other deterministic manifest overrides, using feat(review): resolver gate for e2eTests — src/review/e2e-test-gen.ts #4192's gate function against reviewManifestForAutoReview?.review.e2eTests (or the equivalent converged-feature accessor — confirm the exact manifest field name against feat(review): register e2eTests as the sixth converged-feature key #4190's schema work), mirroring processors.ts:9164.
  • Build the actual blocks (calling feat(review): LLM core to turn a PR diff into Playwright E2E test source #4191's generation core, then feat(review): render + comment-assembly for generated E2E test blocks #4193's render function) only when e2eTestGenEnabledForReview is true, this is a fresh cache-miss pass, and aiReview?.inlineFindings?.length (or the equivalent "there's something worth generating tests for" condition) holds — mirroring processors.ts:10592-10594's exact cache-miss-only discipline.
  • A cache-hit re-render must reuse the previously-generated block content rather than re-invoking the LLM — this feature is a real cost driver (an LLM call, potentially per push), so silent re-generation on every cached render is a correctness bug, not just a cost nit.
  • No change needed to ENGINE_DECISION_GUARDRAIL_GLOBS (src/review/guardrail-config.ts:22-40) — sibling converged-feature wire files aren't individually listed there, and src/queue/** is already blanket-covered; this only changes if the feature later becomes a gate blocker (out of scope for this issue).

Deliverables

Expected outcome

Generated E2E test blocks appear in the PR comment exactly once per genuinely new review pass, never regenerated on a cache hit, and disappear cleanly the moment a repo's features.e2eTests flips to off or absent.

Resources / examples

  • src/queue/processors.ts:8619, 9164, 10589-10594 (the exact fix-handoff touch points to mirror)

Effort

M — wiring is mechanical, but the cache-miss-only test is the part worth getting right.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions