worktree finish looks for os-sdlc-implementation-report without the plugins/ prefix and skips the usage sweep #778

Closed
opened 2026-09-27 16:15:01 +00:00 by jared · 1 comment
Owner

Problem

worktree finish cannot find the usage-sweep script. Worktree::UsageSweep.default_script_path builds a path that omits the plugins/ segment. The finish command prints a "not found" line and skips the usage sweep on every run.

Observed

plugins/os/bin/worktree finish <name> --implementation <id>
/home/jared/dev/cc-os/os-sdlc/bin/os-sdlc-implementation-report not found, usage not swept

Observed on 2026-09-27 on four finishes: ticket-658, ticket-728, ticket-732, ticket-765 (implementations 49, 50, 52, 53).

Reproduce

plugins/os/bin/worktree finish <name> --implementation <id>

Approach

Worktree::UsageSweep.default_script_path (plugins/os/lib/worktree/usage_sweep.rb:6-8) resolves plugin_root with File.expand_path('../../..', __dir__). From plugins/os/lib/worktree, three .. levels land on plugins/, not plugins/os. The following File.join(plugin_root, '..', 'os-sdlc', 'bin', ...) then climbs one level above plugins/ to the repo root, dropping the plugins/ segment and producing <repo-root>/os-sdlc/bin/os-sdlc-implementation-report instead of <repo-root>/plugins/os-sdlc/bin/os-sdlc-implementation-report.

Required work:

  1. Fix plugin_root (or the join) in Worktree::UsageSweep.default_script_path so it resolves to plugins/os-sdlc/bin/os-sdlc-implementation-report — check: finish prints the usage sweep result instead of a "not found" line.

Acceptance criteria

  1. Given a completed implementation, when worktree finish runs with --implementation, then the usage sweep runs and no "not found" line prints.

Owner sketch

class Worktree::UsageSweep
  def self.default_script_path
  end
end

Origin

  • Trigger: plugins/os/bin/worktree finish <name> --implementation <id> printing "not found, usage not swept" on four finishes (ticket-658, ticket-728, ticket-732, ticket-765; implementations 49, 50, 52, 53) on 2026-09-27.
  • Improvised this session: none
  • Chain: usage sweep skipped ← default_script_path drops the plugins/ segment ← DESIGN (plugins/os/lib/worktree/usage_sweep.rb:6-8, likely miscounted .. levels when commit 9efa4ef0 (#768) replaced os-sdlc-runner with per-command bin scripts)
  • Root candidate: this ticket
  • Where: plugins/os/lib/worktree/usage_sweep.rb:7-8
  • Session: 17688436-99ef-4a59-9eec-74e4f87e9c1f
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/17688436-99ef-4a59-9eec-74e4f87e9c1f.jsonl

VERDICT: CREATE
REASON: Verified path bug — default_script_path drops the plugins/ segment, silently skipping usage sweep on every worktree finish since #768; observed on four real finishes with clean root-vs-symptom provenance.

## Problem `worktree finish` cannot find the usage-sweep script. `Worktree::UsageSweep.default_script_path` builds a path that omits the `plugins/` segment. The finish command prints a "not found" line and skips the usage sweep on every run. ## Observed ``` plugins/os/bin/worktree finish <name> --implementation <id> ``` ``` /home/jared/dev/cc-os/os-sdlc/bin/os-sdlc-implementation-report not found, usage not swept ``` Observed on 2026-09-27 on four finishes: ticket-658, ticket-728, ticket-732, ticket-765 (implementations 49, 50, 52, 53). ## Reproduce ``` plugins/os/bin/worktree finish <name> --implementation <id> ``` ## Approach `Worktree::UsageSweep.default_script_path` (plugins/os/lib/worktree/usage_sweep.rb:6-8) resolves `plugin_root` with `File.expand_path('../../..', __dir__)`. From `plugins/os/lib/worktree`, three `..` levels land on `plugins/`, not `plugins/os`. The following `File.join(plugin_root, '..', 'os-sdlc', 'bin', ...)` then climbs one level above `plugins/` to the repo root, dropping the `plugins/` segment and producing `<repo-root>/os-sdlc/bin/os-sdlc-implementation-report` instead of `<repo-root>/plugins/os-sdlc/bin/os-sdlc-implementation-report`. Required work: 1. Fix `plugin_root` (or the join) in `Worktree::UsageSweep.default_script_path` so it resolves to `plugins/os-sdlc/bin/os-sdlc-implementation-report` — check: finish prints the usage sweep result instead of a "not found" line. ## Acceptance criteria 1. Given a completed implementation, when `worktree finish` runs with `--implementation`, then the usage sweep runs and no "not found" line prints. ## Owner sketch ```ruby class Worktree::UsageSweep def self.default_script_path end end ``` ## Origin - Trigger: `plugins/os/bin/worktree finish <name> --implementation <id>` printing "not found, usage not swept" on four finishes (ticket-658, ticket-728, ticket-732, ticket-765; implementations 49, 50, 52, 53) on 2026-09-27. - Improvised this session: none - Chain: usage sweep skipped ← `default_script_path` drops the `plugins/` segment ← DESIGN (plugins/os/lib/worktree/usage_sweep.rb:6-8, likely miscounted `..` levels when commit 9efa4ef0 (#768) replaced `os-sdlc-runner` with per-command bin scripts) - Root candidate: this ticket - Where: plugins/os/lib/worktree/usage_sweep.rb:7-8 - Session: 17688436-99ef-4a59-9eec-74e4f87e9c1f - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/17688436-99ef-4a59-9eec-74e4f87e9c1f.jsonl VERDICT: CREATE REASON: Verified path bug — `default_script_path` drops the `plugins/` segment, silently skipping usage sweep on every worktree finish since #768; observed on four real finishes with clean root-vs-symptom provenance.
Author
Owner

Resolution

Done: duplicate of #733, same defect (relative path to the report script), fixed by ADR-0240

Evidence: merge 6bd034df

Follow-ups: none

## Resolution **Done:** duplicate of #733, same defect (relative path to the report script), fixed by ADR-0240 **Evidence:** merge 6bd034df **Follow-ups:** none
jared closed this issue 2026-09-28 16:39:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#778
No description provided.