Skip to content

refactor(engine): rename worktree-allocator to worktree-plan to end the miner filename collision - #5674

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-rename-worktree-plan
Jul 14, 2026
Merged

refactor(engine): rename worktree-allocator to worktree-plan to end the miner filename collision#5674
JSONbored merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-rename-worktree-plan

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

gittensory-engine's src/miner/worktree-allocator.ts (pure git-worktree path/branch planning + retention policy) and gittensory-miner's lib/worktree-allocator.js (SQLite-backed slot leasing + PID-liveness orphan reclaim) shared a filename while doing genuinely different jobs — a real source of confusion for the engine/miner split (one is pure and reusable, the other single-machine PID-coupled).

What this does

Renames the engine-side pure planner to src/miner/worktree-plan.ts (its export is planWorktree), keeping the miner's lib/worktree-allocator.js name since it's the one that actually allocates/leases slots — exactly the split the issue suggests.

  • Pure rename, no behavior change (req 3): the exported symbols (planWorktree, WorktreePlan, WORKTREE_*, …) are unchanged, so every @loopover/engine consumer — including the whole miner package — is unaffected.
  • Only the engine's own internal references change: worktree-pool.ts's import, index.ts's re-export path, and two comment mentions.
  • The test file is renamed to match (test/unit/worktree-allocator.test.tsworktree-plan.test.ts); its content is unchanged (it imports planWorktree from the engine index).
  • No file in the repo imports the old path (req 2); the miner's own lib/worktree-allocator.js is untouched.

Validation

  • Engine build OK; tsc --noEmit clean.
  • vitest: the renamed planWorktree suite (8/8) + worktree-pool (7/7) pass unchanged.
  • manifest:drift-check OK; git diff --check clean. Cut from latest main.

Closes #5668

…he miner filename collision

gittensory-engine's src/miner/worktree-allocator.ts (pure git-worktree path/branch
planning + retention policy) and gittensory-miner's lib/worktree-allocator.js
(SQLite-backed slot leasing + PID-liveness orphan reclaim) shared a filename while
doing genuinely different jobs. Renames the engine-side PURE planner to
worktree-plan.ts (its export is planWorktree), keeping the miner's allocator name
since it is the one that actually allocates/leases slots (JSONbored#5668).

Pure rename, no behavior change: exported symbols (planWorktree, WorktreePlan, etc.)
are unchanged, so every @loopover/engine consumer is unaffected; only the engine's
own internal import (worktree-pool.ts) + index re-export path change, plus the two
comment references. Test file renamed to match.

Closes JSONbored#5668
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (b579eb6) to head (d004cae).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5674   +/-   ##
=======================================
  Coverage   95.04%   95.04%           
=======================================
  Files         577      577           
  Lines       45987    45987           
  Branches    14708    14708           
=======================================
  Hits        43707    43707           
  Misses       1527     1527           
  Partials      753      753           
Flag Coverage Δ
shard-1 43.98% <ø> (ø)
shard-2 35.65% <ø> (-0.04%) ⬇️
shard-3 32.46% <ø> (+0.06%) ⬆️
shard-4 33.30% <ø> (+0.73%) ⬆️
shard-5 31.19% <ø> (-0.59%) ⬇️
shard-6 44.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/gittensory-engine/src/miner/iterate-loop.ts 74.32% <ø> (ø)
...kages/gittensory-engine/src/miner/worktree-plan.ts 100.00% <ø> (ø)
...kages/gittensory-engine/src/miner/worktree-pool.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 14, 2026
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-14 02:19:24 UTC

5 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): packages/gittensory-engine/src/index.ts (matched packages/gittensory-engine/**), packages/gittensory-engine/src/miner/iterate-loop.ts (matched packages/gittensory-engine/**), packages/gittensory-engine/src/miner/worktree-plan.ts (matched packages/gittensory-engine/**), packages/gittensory-engine/src/miner/worktree-allocator.ts (matched packages/gittensory-engine/**), packages/gittensory-engine/src/miner/worktree-pool.ts (matched packages/gittensory-engine/**).

Review summary
This is a straightforward rename of the engine-side pure worktree planner from worktree-allocator.ts to worktree-plan.ts, resolving a filename collision with the miner's SQLite-backed worktree-allocator.js. All three internal references (worktree-pool.ts's import, index.ts's re-export, and a comment in iterate-loop.ts) are updated consistently, and the full post-change index.ts confirms planWorktree/WorktreePlan/WORKTREE_* are now exported from ./miner/worktree-plan.js with no symbol changes. The PR closes the linked issue #5668, is narrowly scoped, and CI is green across build/typecheck/tests.

Nits — 4 non-blocking
  • The renamed test file and worktree-plan.ts itself are shown as 'no inline patch' in the diff, so I'm trusting the description that content is otherwise unchanged rather than seeing it directly.
  • Consider a repo-wide grep for any remaining string references to 'worktree-allocator' inside packages/gittensory-engine (e.g. in docs or other comments) to be fully sure nothing was missed beyond the two files touched here.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5668
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 60 registered-repo PR(s), 25 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 60 PR(s), 4 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ⚠️ ℹ️ None detected risk: low · value: none — No structural-improvement signals were detected for this PR.
Review context
  • Author: jaytbarimbao-collab
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Rust
  • Official Gittensor activity: 60 PR(s), 4 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 14, 2026
@JSONbored
JSONbored merged commit 5b1ee73 into JSONbored:main Jul 14, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename to resolve the worktree-allocator filename collision

2 participants