os-backlog finds no tracker from a subdirectory of a normal checkout #1674

Open
opened 2026-11-10 17:48:08 +00:00 by jared · 0 comments
Owner

Problem

The os-backlog CLI finds no tracker from any subdirectory of a normal checkout. Backlog::ConfigLocator#locate reads .cc-os/config in the start directory. If that file is absent, it asks find_owning_root for a second directory. find_owning_root returns the primary root only when the primary root differs from the repository root, which is true only inside a git worktree. In a normal checkout the two are equal, so the method returns nil and the CLI never reads the repository root's .cc-os/config. A session that starts in plugins/os-sdlc gets /os-backlog:capture preloads with no scope labels and a prompt to run /os-backlog:route.

Observed

The tracker is null from two subdirectories. One has a .cc-os/ folder with no config file. The other has no .cc-os/ folder.

cd /home/jared/dev/cc-os/plugins/os-sdlc && os-backlog project show
cd /home/jared/dev/cc-os/docs && os-backlog project show
{
  "root": "/home/jared/dev/cc-os/plugins/os-sdlc",
  "tracker": null
}
{
  "root": "/home/jared/dev/cc-os/docs",
  "tracker": null
}

The same command from /home/jared/dev/cc-os prints forgejo:jared/cc-os.

The code, plugins/os-backlog/lib/backlog/config_locator.rb lines 24 to 30:

def find_owning_root
  finder = RepoRootLink.new.load
  return unless finder

  primary = finder.primary_root(@start_dir)
  primary unless primary == finder.find(@start_dir)
end

Reproduce

cd /home/jared/dev/cc-os/docs && os-backlog project show

Approach

Not decided. The rule that plugins/os-backlog/lib/backlog/project/session_note.rb states is: a subdirectory's own .cc-os/config overrides the repository root's. That rule needs a fallback to the repository root when the subdirectory has no config. locate_for_write uses the same method, so os-backlog project configure from a subdirectory writes a new config there; decide if that stays.

Required work: none beyond the acceptance criteria.

Acceptance criteria

  1. Given a normal checkout whose root .cc-os/config names a tracker, and a subdirectory with no .cc-os/config, when os-backlog project show runs in the subdirectory, then it prints the root's tracker.
  2. Given a subdirectory whose own .cc-os/config names a tracker, when os-backlog project show runs in the subdirectory, then it prints the subdirectory's tracker.
  3. Given a git worktree with no .cc-os/config, when os-backlog project show runs in it, then it prints the primary checkout's tracker.

Origin

  • Trigger: /os-backlog:capture in a session started in plugins/os-sdlc
  • Improvised this session: ran the CLI from /home/jared/dev/cc-os
  • Chain: no tracker from a subdirectory ← ConfigLocator#locate gets nil from find_owning_root (plugins/os-backlog/lib/backlog/config_locator.rb:10) ← find_owning_root drops the primary root when it equals the repository root (config_locator.rb:29), DESIGN (plugins/os-backlog/lib/backlog/config_locator.rb)
  • Root candidate: none found; searched tracker, ConfigLocator, find_owning_root, config_locator, subdirectory, project show, primary_root, .cc-os/config
  • Where: Backlog::ConfigLocator#find_owning_root, plugins/os-backlog/lib/backlog/config_locator.rb
  • Session: 597f9257-8f08-43d7-903c-22571a2b510c
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/597f9257-8f08-43d7-903c-22571a2b510c.jsonl

VERDICT: CREATE — A real, reproducible fault in Backlog::ConfigLocator#find_owning_root. The ticket is the root, and no open ticket covers it.

## Problem The os-backlog CLI finds no tracker from any subdirectory of a normal checkout. `Backlog::ConfigLocator#locate` reads `.cc-os/config` in the start directory. If that file is absent, it asks `find_owning_root` for a second directory. `find_owning_root` returns the primary root only when the primary root differs from the repository root, which is true only inside a git worktree. In a normal checkout the two are equal, so the method returns nil and the CLI never reads the repository root's `.cc-os/config`. A session that starts in `plugins/os-sdlc` gets `/os-backlog:capture` preloads with no scope labels and a prompt to run `/os-backlog:route`. ## Observed The tracker is null from two subdirectories. One has a `.cc-os/` folder with no `config` file. The other has no `.cc-os/` folder. ``` cd /home/jared/dev/cc-os/plugins/os-sdlc && os-backlog project show cd /home/jared/dev/cc-os/docs && os-backlog project show ``` ``` { "root": "/home/jared/dev/cc-os/plugins/os-sdlc", "tracker": null } { "root": "/home/jared/dev/cc-os/docs", "tracker": null } ``` The same command from `/home/jared/dev/cc-os` prints `forgejo:jared/cc-os`. The code, `plugins/os-backlog/lib/backlog/config_locator.rb` lines 24 to 30: ```ruby def find_owning_root finder = RepoRootLink.new.load return unless finder primary = finder.primary_root(@start_dir) primary unless primary == finder.find(@start_dir) end ``` ## Reproduce ``` cd /home/jared/dev/cc-os/docs && os-backlog project show ``` ## Approach Not decided. The rule that `plugins/os-backlog/lib/backlog/project/session_note.rb` states is: a subdirectory's own `.cc-os/config` overrides the repository root's. That rule needs a fallback to the repository root when the subdirectory has no config. `locate_for_write` uses the same method, so `os-backlog project configure` from a subdirectory writes a new config there; decide if that stays. Required work: none beyond the acceptance criteria. ## Acceptance criteria 1. Given a normal checkout whose root `.cc-os/config` names a tracker, and a subdirectory with no `.cc-os/config`, when `os-backlog project show` runs in the subdirectory, then it prints the root's tracker. 2. Given a subdirectory whose own `.cc-os/config` names a tracker, when `os-backlog project show` runs in the subdirectory, then it prints the subdirectory's tracker. 3. Given a git worktree with no `.cc-os/config`, when `os-backlog project show` runs in it, then it prints the primary checkout's tracker. ## Origin - Trigger: `/os-backlog:capture` in a session started in `plugins/os-sdlc` - Improvised this session: ran the CLI from `/home/jared/dev/cc-os` - Chain: no tracker from a subdirectory ← `ConfigLocator#locate` gets nil from `find_owning_root` (`plugins/os-backlog/lib/backlog/config_locator.rb:10`) ← `find_owning_root` drops the primary root when it equals the repository root (`config_locator.rb:29`), `DESIGN` (`plugins/os-backlog/lib/backlog/config_locator.rb`) - Root candidate: none found; searched tracker, ConfigLocator, find_owning_root, config_locator, subdirectory, project show, primary_root, .cc-os/config - Where: `Backlog::ConfigLocator#find_owning_root`, `plugins/os-backlog/lib/backlog/config_locator.rb` - Session: 597f9257-8f08-43d7-903c-22571a2b510c - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/597f9257-8f08-43d7-903c-22571a2b510c.jsonl VERDICT: CREATE — A real, reproducible fault in `Backlog::ConfigLocator#find_owning_root`. The ticket is the root, and no open ticket covers it.
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#1674
No description provided.