Skip to content

Refactor rebuild test harnesses into a shared core with generic and Deep Agents Code profiles #8359

Closed

Description

@jyaunches

Objective

Replace two overlapping rebuild harness implementations with one shared core and two named profiles.

Evidence

  • test/helpers/rebuild-flow-harness.ts is 872 lines.
  • test/helpers/rebuild-flow-test-harness.ts is 695 lines.
  • Both load the rebuild graph, create sessions, install overlapping spies, emulate sandbox state, and restore mocks.
  • The older harness owns DCode route and image behavior.
  • The newer harness owns broader generic recovery, credential, messaging, and prepared-image behavior.
  • test/helpers/rebuild-flow-test-support.ts already owns part of the reusable type and session layer.

Scope

  • Extract one core for shared module loading, session creation, common spies, sandbox state, and cleanup.
  • Add only two profiles: generic and Deep Agents Code.
  • Migrate all current harness consumers.
  • Remove the superseded duplicate implementation.
  • Keep DCode-only image and route mocks out of the generic profile.
  • Keep generic credential, messaging, and prepared-image mocks from becoming mandatory DCode setup.
  • Do not change production source, supported behavior, test titles, or assertions.

Relationships

This is not a good first issue: it changes mock lifecycle across the rebuild suite.

Acceptance criteria

  • Common session, environment, module-loading, and mock lifecycle logic has one implementation.
  • Every rebuild suite selects the generic or DCode profile explicitly.
  • Profile-specific mocks remain isolated.
  • Existing test titles and collected-test counts remain unchanged.
  • Repository size, complexity, and project checks pass.
  • The change has a negative net LOC delta.

Validation

npx vitest run --project cli src/lib/actions/sandbox/rebuild*.test.ts
npm run typecheck:cli
npm run checks:repository

Activity

  1. added
    help wanted
    area: sandbox
    area: architecture
    integration: dcode
    on Aug 5, 2026
  2. added theissue type on Aug 5, 2026
  3. MannXo commented on Aug 5, 2026

    @MannXo

    I can this one if available

  4. self-assigned this
    on Aug 7, 2026
  5. added a commit that references this issue on Aug 11, 2026
    2afba61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: architecturearea: sandboxhelp wantedintegration: dcode

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions