Skip to content

feat(cli): global --spec lookup checks all spec file names in priority order#86

Merged
albertodebortoli merged 5 commits into
mainfrom
worktree-feature+global-spec-lookup
May 25, 2026
Merged

feat(cli): global --spec lookup checks all spec file names in priority order#86
albertodebortoli merged 5 commits into
mainfrom
worktree-feature+global-spec-lookup

Conversation

@albertodebortoli
Copy link
Copy Markdown
Member

@albertodebortoli albertodebortoli commented May 25, 2026

Description

  • When luca install --global is run without an explicit --spec, the command previously hardcoded a lookup for ~/.config/luca/Lucafile only. It now iterates all recognised spec file names (Lucafile, Toolfile, Skillfile — and their .yml variants) in priority order, returning the first match found.
  • Mirrors the existing local specPath() behaviour for CWD lookups.
  • Extracts the logic into a testable GlobalSpecFinder component in LucaCore.

Type of Change

  • Feature
  • Bug fix
  • Maintenance / Refactor
  • Documentation
  • CI / Tooling
  • Other (specify)

How Has This Been Tested?

  • Added / updated unit tests — 7 new GlobalSpecFinderTests covering all spec file names, .yml variants, priority order, and the noSpecFound error
  • Manually tested locally (describe) — swift run luca install --help confirms updated --global flag description
  • Tested on macOS (arch: arm64)

Checklist

  • Swift code builds locally (swift build)
  • Tests pass locally (swift test) — 488 tests, all passing
  • Code style / formatting respected
  • Documentation updated (README / comments)
  • Version / tag alignment considered (if release related)

Breaking Changes?

  • No

Additional Notes

GlobalSpecFinder is a new LucaCore component following the project's protocol-oriented DI pattern (GlobalSpecFinding protocol + GlobalSpecFinderFileManaging file system protocol). InstallCommand.globalSpecPath() delegates to it and translates the error into InstallCommandError.globalSpecMissing.

…nder

Rename InstallCommandError.globalLucafileMissing to globalSpecMissing and extract the global spec lookup logic from InstallCommand into a new GlobalSpecFinder component in LucaCore, making it fully testable via GlobalSpecFinderTests.
@albertodebortoli albertodebortoli added this to the 0.19.0 milestone May 25, 2026
@albertodebortoli albertodebortoli added the feature New feature or enhancement label May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@albertodebortoli albertodebortoli marked this pull request as ready for review May 25, 2026 22:24
@albertodebortoli albertodebortoli merged commit d9b7dec into main May 25, 2026
3 checks passed
@albertodebortoli albertodebortoli deleted the worktree-feature+global-spec-lookup branch May 25, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant