Skip to content

test(fork-sync): mock ablation suite for fork-boundary modules (Option 2 — DEFERRED) #2438

@alexey-pelykh

Description

@alexey-pelykh

Status

DEFERRED — see Revisit Conditions below. Tracked for visibility, not actively scheduled.

Problem (when revisited)

Even after the Phase 1-2 child issues of #2433 (AST gate, baselines, attestation manifest) land, there may remain a residual class of regression where mocks diverge from real implementations in ways that none of those gates detect (e.g., return-shape mismatches that are syntactically valid). Mock ablation — running the test suite both with and without fork-boundary mocks — would catch any such divergence empirically.

Proposed solution (when revisited)

Second Vitest config (vitest.ablation.config.ts) with setupFiles that monkey-patches vi.mock to no-op for configured fork-boundary modules. CI runs full suite both normally and ablated; tests that fail without the mock are candidates for review. Initially non-blocking, promoted to blocking on sync PRs only.

Why deferred

  • High initial triage cost — sample test (src/cron/isolated-agent/run.auth-retry.test.ts) mocks 8 functions of agent-scope plus 7 other modules. Ablating these surfaces hundreds of legitimate "needs-mock-because-X" cases (subprocess spawning, filesystem I/O, network).
  • Coverage overlap with the attestation manifest (other child issue of meta(fork-sync): hardening architecture epic — prevent #2408-class regressions #2433) at lower cost.
  • Doubles CI runtime for ablated runs.

Revisit when

Effort (estimated when revisited)

2-4 days bootstrap + ongoing 0.5-1 day/quarter curation.

Dependencies

Tracked under: #2433
Revisit-after: attestation manifest lands and 1-2 sync cycles validate it

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-discussionApproach is opinionated or uncertain — needs team alignment before implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions