Skip to content

fix: carry plugin-created .factory/ subdirs into worktrees - #1265

Draft
shivchander wants to merge 2 commits into
mainfrom
fix/1263-worktree-plugin-subdirs
Draft

fix: carry plugin-created .factory/ subdirs into worktrees#1265
shivchander wants to merge 2 commits into
mainfrom
fix/1263-worktree-plugin-subdirs

Conversation

@shivchander

Copy link
Copy Markdown
Collaborator

Closes #1263

Changes

  • After the existing symlink/copy logic and per-cycle fresh directory creation in create_worktree, iterate over any remaining subdirectories in the source .factory/ and copy them to the worktree
  • Skips entries already present (symlinked shared entries, copied entries, or freshly-created per-cycle dirs like strategy/reviews/state) via a dst.exists() check
  • Only copies subdirectories, not loose files — plugin intake dirs like .factory/buildroot/ are the target

shivchander and others added 2 commits August 14, 2026 16:25
Plugin modes registered via add_modes() failed Pydantic validation
when headless mode created a CycleState, since the Literal type only
accepted hardcoded built-in mode names.

Closes #1262

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
After the existing symlink/copy logic and per-cycle fresh dirs, iterate
over remaining subdirectories in source .factory/ and copy any not
already handled. Skips entries already present (symlinked, copied, or
created fresh) to avoid duplication.

Closes #1263

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Sentrux Quality Report

Absolute

Scanning ....
[scan] git ls-files: 609 total, 597 kept, 12 dropped (ext:12, meta:0, big:0)
[build_project_map] 597 files, 102 unique dirs, 94 cache misses, 2.5ms
[resolve] 1088 resolved, 1537 unresolved (of 2625 total specs)
[resolve_imports] project_map 2.6ms, suffix_idx 1.1ms, suffix_resolve 15.3ms, total 19.1ms
[build_graphs] 597 files | maps 1.5ms, imports 19.2ms, calls+inherit 4.9ms, total 25.6ms | 1087 import, 8621 call, 11 inherit edges
sentrux check — 3 rules checked

Quality: 4789

✗ [Error] max_cc: 3 function(s) exceed max cyclomatic complexity of 30
    factory/cli/_ceo_helpers.py:_validate_ceo_flags (cc=43)
    factory/cli/_ceo_helpers.py:_execute_ceo (cc=43)
    factory/cli/run.py:cmd_run (cc=32)

✗ 1 violation(s) found

Diff (vs base branch)

Scanning ....
[scan] git ls-files: 609 total, 597 kept, 12 dropped (ext:12, meta:0, big:0)
[build_project_map] 597 files, 102 unique dirs, 94 cache misses, 2.6ms
[resolve] 1088 resolved, 1537 unresolved (of 2625 total specs)
[resolve_imports] project_map 2.7ms, suffix_idx 1.0ms, suffix_resolve 15.3ms, total 19.0ms
[build_graphs] 597 files | maps 1.5ms, imports 19.1ms, calls+inherit 5.0ms, total 25.7ms | 1087 import, 8621 call, 11 inherit edges
sentrux gate — structural regression check

Quality:      4790 -> 4789
Coupling:     0.79 → 0.79
Cycles:       3 → 3
God files:    3 → 3

Distance from Main Sequence: 0.38

✗ DEGRADED
  ✗ Complex functions increased: 53 → 54

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.33%. Comparing base (4129ba2) to head (fb516de).

Files with missing lines Patch % Lines
factory/worktree.py 62.50% 1 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (66.66%) is below the target coverage (79.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1265      +/-   ##
==========================================
- Coverage   86.34%   86.33%   -0.01%     
==========================================
  Files         211      211              
  Lines       23054    23062       +8     
  Branches     3627     3631       +4     
==========================================
+ Hits        19906    19911       +5     
- Misses       2308     2309       +1     
- Partials      840      842       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Worktree creation doesn't carry .factory/ for plugin modes

1 participant