Repository navigation
Labels
area: architectureArchitecture, design debt, major refactors, or maintainabilityarea: sandboxOpenShell sandbox lifecycle, runtime, config, or recoveryhelp wantedMaintainers welcome external contributionintegration: dcodeLangChain Deep Code integration behavior
Description
Objective
Replace two overlapping rebuild harness implementations with one shared core and two named profiles.
Evidence
test/helpers/rebuild-flow-harness.tsis 872 lines.test/helpers/rebuild-flow-test-harness.tsis 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.tsalready 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
- Parent Epic: Consolidate test support and enforce test-suite boundaries #8345
- Blocked by:
- Consolidate the duplicate DCode test helper #8284 — establishes one DCode rebuild-helper and probe-fixture owner.
- Reuse canonical rebuild recovery and environment test fixtures #8353 — removes duplicate recovery and environment fixtures.
- Make six rebuild-flow case modules ordinary Vitest suites #8354 — makes all six rebuild case modules ordinary suites before harness migration.
- Blocks: None.
- Start condition: Do not start until GitHub shows zero active blockers.
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:repositoryMetadata
Metadata
Assignees
Labels
area: architectureArchitecture, design debt, major refactors, or maintainabilityarea: sandboxOpenShell sandbox lifecycle, runtime, config, or recoveryhelp wantedMaintainers welcome external contributionintegration: dcodeLangChain Deep Code integration behavior
Activity
MannXo commentedon Aug 5, 2026
I can this one if available
refactor(sandbox): give rebuild test harnesses one shared core (#8581)