Skip to content

feat(core): absorb parallel-cc worktree + E2B into CodeFrame namespace (#535)#541

Merged
frankbria merged 3 commits intomainfrom
feat/absorb-parallel-cc-535
Apr 4, 2026
Merged

feat(core): absorb parallel-cc worktree + E2B into CodeFrame namespace (#535)#541
frankbria merged 3 commits intomainfrom
feat/absorb-parallel-cc-535

Conversation

@frankbria
Copy link
Copy Markdown
Owner

@frankbria frankbria commented Apr 4, 2026

Summary

  • Adds codeframe/core/sandbox/worktree.py re-export shim, exposing TaskWorktree, WorktreeRegistry, MergeResult, and get_base_branch from the codeframe.core.sandbox namespace
  • Expands codeframe/core/sandbox/__init__.py to re-export worktree symbols
  • Updates CLAUDE.md: adds core/sandbox/ and adapters/e2b/ to repository structure; adds E2B_API_KEY env var
  • Updates docs/V2_STRATEGIC_ROADMAP.md: marks parallel-cc absorption complete, removes stale dependency-arc language

Context

Most of the absorption work was already completed in #533 (WorktreeRegistry in core/worktrees.py) and #534 (E2BAgentAdapter in adapters/e2b/). This PR closes the namespace gap and updates documentation to reflect the final state. parallel-cc was never added as a dependency — the logic was ported directly.

Test plan

  • 84 tests pass across test_sandbox_context.py, test_worktrees.py, test_e2b_adapter.py
  • 5 new import-coverage tests verify the codeframe.core.sandbox re-exports
  • 680 web-ui Jest tests pass
  • No parallel-cc / parallel_cc import sites found in codebase

Closes #535

Summary by CodeRabbit

  • New Features

    • Sandbox package now exposes TaskWorktree, MergeResult, WorktreeRegistry and get_base_branch via a unified sandbox path.
    • Added an optional E2B cloud sandbox adapter (cloud agent, cost tracking, pre-upload secrets scanner).
  • Documentation

    • Documented core task worktrees, execution isolation, and the E2B cloud sandbox adapter.
    • Added E2B_API_KEY guidance and updated strategic roadmap to reflect completed parallel-cc absorption.
  • Tests

    • Added tests verifying sandbox re-exports and applied a v2 pytest marker.

#535)

- Add codeframe/core/sandbox/worktree.py re-export shim for TaskWorktree,
  WorktreeRegistry, MergeResult, get_base_branch
- Expose worktree symbols from codeframe.core.sandbox package __init__
- Add 5 import-coverage tests in test_sandbox_context.py
- Update CLAUDE.md: add core/sandbox/ and adapters/e2b/ to repo structure,
  add E2B_API_KEY env var note
- Update docs/V2_STRATEGIC_ROADMAP.md: mark parallel-cc absorption complete,
  remove dependency-arc language (parallel-cc was never added as a dep)

Closes #535
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 04a7c9b1-e3f5-4007-a758-64222027c327

📥 Commits

Reviewing files that changed from the base of the PR and between 04f2fe7 and b723692.

📒 Files selected for processing (1)
  • tests/core/test_sandbox_context.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/core/test_sandbox_context.py

Walkthrough

Adds a sandbox worktree re-export module and extends the sandbox package API to expose worktree types; adds tests asserting the re-exports; updates docs to reflect absorption of parallel-cc, and documents a new E2B adapter and required E2B_API_KEY env var.

Changes

Cohort / File(s) Summary
Sandbox package exports
codeframe/core/sandbox/__init__.py, codeframe/core/sandbox/worktree.py
New worktree.py re-exports TaskWorktree, MergeResult, WorktreeRegistry, get_base_branch from codeframe.core.worktrees. __init__ updated __all__ to include these names alongside existing ExecutionContext exports.
Core worktrees source (referenced)
codeframe/core/worktrees.py
Referenced by new re-exports (no edits in this diff; review to confirm exported symbols/signatures match re-exports).
Adapters & docs
CLAUDE.md, codeframe/adapters/e2b/..., codeframe/adapters/llm/...
Documentation updated to add adapters/e2b/ entry, document E2B_API_KEY and --engine cloud usage, and reorganize adapter listings (LLM adapters retained).
Roadmap doc
docs/V2_STRATEGIC_ROADMAP.md
Phase 4.B updated to mark parallel-cc absorption complete and note internal locations for ExecutionContext and worktree/E2B components.
Tests
tests/core/test_sandbox_context.py
Adds pytestmark = pytest.mark.v2 and TestSandboxWorktreeReexports class validating re-export accessibility and worktree submodule attributes.

Sequence Diagram(s)

(Skipped — changes are re-exports, tests, and documentation; no new multi-component control flow introduced requiring sequence visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I hopped through branches, tidy and fleet,

Re-exported treasures for CodeFrame to meet.
Parallel-cc folded, its logic now near,
E2B whispers ready, keys and docs clear.
A carrot for progress—snug paws, a happy cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective: absorbing parallel-cc worktree and E2B logic into CodeFrame's core namespace.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements: worktree re-exports via core/sandbox/worktree.py, E2B adapter already in place from prior work, and documentation updates reflect absorption completion.
Out of Scope Changes check ✅ Passed All changes are scoped to requirements in #535: re-exports, namespace reorganization, documentation updates, and test coverage for imports.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/absorb-parallel-cc-535

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown

claude bot commented Apr 4, 2026

Review: feat(core): absorb parallel-cc worktree + E2B into CodeFrame namespace

This is a clean, focused PR that closes the namespace gap left after #533 and #534. The approach is correct — a thin re-export shim rather than duplicating logic.

What is solid

  • Re-export shim (core/sandbox/worktree.py) is minimal and correct. __all__ is consistent between the shim and sandbox/__init__.py, which prevents accidental wildcard leakage.
  • No circular imports: the chain is sandbox/__init__sandbox/worktreecore/worktrees — all one-directional.
  • CLAUDE.md accurately reflects the new structure including the optional E2B note and E2B_API_KEY env var.
  • Roadmap prose correctly replaces future-tense dependency-arc language with past-tense completion status.

One formatting issue to fix

In docs/V2_STRATEGIC_ROADMAP.md the last row of the Phase 4.B deliverable table adds a fifth column:

| codeframe-xz0f | parallel-cc absorption into CodeFrame | 4.B | MEDIUM | ✅ |

All other rows have four columns. The extra pipe renders as a ragged table in most Markdown viewers. The checkmark should be moved into the task name cell instead:

| codeframe-xz0f | parallel-cc absorption into CodeFrame ✅ | 4.B | MEDIUM |

Tests

The 5 import-coverage tests are appropriate for a pure re-export shim — there is no logic to unit test, so verifying each symbol resolves from the new namespace is the right scope. Minor note: test_sandbox_worktree_module_importable imports the submodule directly, which is slightly redundant with the four symbol-level tests above it. Not blocking.

Summary: approve with one non-blocking fix suggested (roadmap table column). Everything else is correct.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/V2_STRATEGIC_ROADMAP.md`:
- Line 349: The Phase 4 table row contains one too many columns: the row "|
codeframe-xz0f | parallel-cc absorption into CodeFrame | 4.B | MEDIUM | ✅ |"
must match the table header's four columns; update the row in
V2_STRATEGIC_ROADMAP.md by removing the extra checkmark column (the trailing
"✅") or adjust the header to include a fifth column if intentional so that
"codeframe-xz0f", "parallel-cc absorption into CodeFrame", "4.B", and "MEDIUM"
align with the header columns.

In `@tests/core/test_sandbox_context.py`:
- Around line 158-180: The new test cases in class TestSandboxWorktreeReexports
(test_task_worktree_importable_from_sandbox,
test_merge_result_importable_from_sandbox,
test_worktree_registry_importable_from_sandbox,
test_get_base_branch_importable_from_sandbox,
test_sandbox_worktree_module_importable) need the v2 marker; add pytest.mark.v2
by either decorating the TestSandboxWorktreeReexports class with `@pytest.mark.v2`
or by adding module-level pytestmark = pytest.mark.v2 so all tests in that
module are marked v2 and comply with the tests/core marking guideline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9f0fb89-2d3a-432a-bc2d-48dbde8ab3e4

📥 Commits

Reviewing files that changed from the base of the PR and between 8d35a21 and bcfd115.

📒 Files selected for processing (5)
  • CLAUDE.md
  • codeframe/core/sandbox/__init__.py
  • codeframe/core/sandbox/worktree.py
  • docs/V2_STRATEGIC_ROADMAP.md
  • tests/core/test_sandbox_context.py

- Move ✅ into table cell (fix 5-column row in 4-column Phase 4 table)
- Add pytestmark = pytest.mark.v2 to test_sandbox_context.py per tests/core/ convention
@claude
Copy link
Copy Markdown

claude bot commented Apr 4, 2026

Follow-up review (commit 04f2fe7):

Both issues flagged in my first pass and by CodeRabbit are resolved:

  • Roadmap table column: ✅ moved into the task-name cell — table renders correctly now.
  • pytestmark = pytest.mark.v2 added at module level in test_sandbox_context.py — consistent with the tests/core/ convention.

Nothing new to flag. This is ready to merge.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/core/test_sandbox_context.py (1)

16-22: ⚠️ Potential issue | 🟠 Major

Move pytestmark below imports to fix Ruff E402.

pytestmark at Line 16 places a statement before module imports at Lines 18–22, which triggers the reported CI failure (E402).

✅ Minimal fix
 import pytest
-
-pytestmark = pytest.mark.v2
 
 from codeframe.core.sandbox.context import (
     ExecutionContext,
     IsolationLevel,
     create_execution_context,
 )
+
+pytestmark = pytest.mark.v2
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/core/test_sandbox_context.py` around lines 16 - 22, pytestmark is
defined before module imports causing Ruff E402; move the pytestmark assignment
so it appears after the import block that brings in ExecutionContext,
IsolationLevel, and create_execution_context. Locate the top of the test module
where pytestmark = pytest.mark.v2 is declared and cut/paste that single
statement immediately below the import statements for
codeframe.core.sandbox.context so imports precede the pytestmark declaration.
🧹 Nitpick comments (1)
tests/core/test_sandbox_context.py (1)

179-182: Optionally assert all sandbox.worktree re-exports in this test.

Nice coverage overall. For completeness, you can also assert MergeResult and get_base_branch on wt_mod to fully lock the submodule API surface.

Optional test hardening
     def test_sandbox_worktree_module_importable(self):
         from codeframe.core.sandbox import worktree as wt_mod
         assert hasattr(wt_mod, "TaskWorktree")
         assert hasattr(wt_mod, "WorktreeRegistry")
+        assert hasattr(wt_mod, "MergeResult")
+        assert hasattr(wt_mod, "get_base_branch")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/core/test_sandbox_context.py` around lines 179 - 182, Extend the
test_sandbox_worktree_module_importable test to also assert that the worktree
submodule re-exports MergeResult and get_base_branch: in
test_sandbox_worktree_module_importable (which imports
codeframe.core.sandbox.worktree as wt_mod) add assertions like hasattr(wt_mod,
"MergeResult") and hasattr(wt_mod, "get_base_branch") so the module API surface
is fully locked down.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@tests/core/test_sandbox_context.py`:
- Around line 16-22: pytestmark is defined before module imports causing Ruff
E402; move the pytestmark assignment so it appears after the import block that
brings in ExecutionContext, IsolationLevel, and create_execution_context. Locate
the top of the test module where pytestmark = pytest.mark.v2 is declared and
cut/paste that single statement immediately below the import statements for
codeframe.core.sandbox.context so imports precede the pytestmark declaration.

---

Nitpick comments:
In `@tests/core/test_sandbox_context.py`:
- Around line 179-182: Extend the test_sandbox_worktree_module_importable test
to also assert that the worktree submodule re-exports MergeResult and
get_base_branch: in test_sandbox_worktree_module_importable (which imports
codeframe.core.sandbox.worktree as wt_mod) add assertions like hasattr(wt_mod,
"MergeResult") and hasattr(wt_mod, "get_base_branch") so the module API surface
is fully locked down.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3c7c245-0646-4d46-8b3e-b13b9116f977

📥 Commits

Reviewing files that changed from the base of the PR and between bcfd115 and 04f2fe7.

📒 Files selected for processing (2)
  • docs/V2_STRATEGIC_ROADMAP.md
  • tests/core/test_sandbox_context.py
✅ Files skipped from review due to trivial changes (1)
  • docs/V2_STRATEGIC_ROADMAP.md

@claude
Copy link
Copy Markdown

claude bot commented Apr 4, 2026

Follow-up review (commit b723692):

The third commit moves pytestmark = pytest.mark.v2 to after the import block, resolving the ruff E402 lint error that would have fired had it been placed before the imports. Correct fix.

All items from my previous reviews are now addressed. Ready to merge.

@frankbria frankbria merged commit f61db8d into main Apr 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 4.B] Absorb parallel-cc worktree + E2B logic into CodeFrame core

1 participant