Skip to content

Unify default repo/queue base-dir resolution (avoid CWD/project-root split) #152

@kapral18

Description

@kapral18

Problem

The CLI currently uses different default roots for related runtime state:

  • Repository clones for URL/repo-name inputs are rooted at process.cwd() (.repos/...) in setup and index flows.
  • Queue state defaults to project root via SCSI_QUEUE_BASE_DIR resolution in config.

This can split state when commands are run from a different working directory (for example cron/job runners), causing repos and queue DBs to land in different base locations.

Why this is risky

  • Duplicate clones can be created across different CWDs.
  • Queue/recovery operations become harder to reason about.
  • Behavior is less predictable for automation and operators.

Current behavior (example)

Running the index command from /tmp can place:

  • repos under /tmp/.repos/...
  • queues under <project-root>/.queues/...

Proposed direction

Unify default base-dir behavior for repo storage and queue storage.

Possible approach:

  1. Introduce a single canonical repos base dir config (for example SCSI_REPOS_BASE_DIR) resolved from project root by default.
  2. Use that base in both setup_command and parseRepoArg for URL/repo-name inputs.
  3. Keep explicit absolute/relative repo path arguments working as-is.
  4. Document the final default behavior in README/DEVELOPER_GUIDE.

Acceptance criteria

  • Invoking from different CWDs does not split default repo/queue state across unrelated directories.
  • Existing explicit repo-path usage keeps working.
  • Unit tests cover repo path resolution for URL/repo-name + explicit paths.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions