Skip to content

440: opskit go — config-driven enabled-projects list (recursive discovery) - #441

Merged
growlf merged 4 commits into
mainfrom
440-opskit-go-config-driven-enabled-projects-list-list
Oct 13, 2026
Merged

growlf merged 4 commits into
mainfrom
440-opskit-go-config-driven-enabled-projects-list-list

Conversation

@growlf

@growlf growlf commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #440

What & why

opskit go was listing every top-level git repo under projects_dir and never recursing, so nested projects were invisible and the TUI was noise. The "enabled" mechanism the original plan promised (a config file in ~/.opskit/) was never built.

This makes ~/.opskit/config.yml the source of truth.

Changes

  • Config allow-list (opskit/_cache.py): projects: key + get_projects(); missing/null normalised; cache invalidates when config.yml is newer than the cache.
  • Recursive, bounded discovery (bin/opskit-projects.py): walks projects_dir (depth ≤ 4, pruning dotdirs/VCS/build dirs); grouping dirs are descended into; git worktrees (.git file or *-wt-*) excluded; each record carries a rel path.
  • Enabled filter: selectors resolve by rel path / basename / name / abs path; unmatched selectors warn.
  • Management: opskit projects bootstrap|add|remove; list/rescan respect the list.
  • First-run prompt (bin/opskit-go.py): empty list + TTY → offer to scan for .opskit/pack.yml members and enable them; non-TTY never blocks.
  • Launcher fixes: no-op sort condition fixed; substring match → subsequence (fzf-style) over name/basename/rel; inline fzf (--height); git detail computed lazily so scanning no longer shells out to git per project; close-match suggestions.

Verification

  • make test → 1675 passed, 1 skipped.
  • New tests: config round-trip + config-mtime staleness, recursive discovery through a grouping dir, worktree exclusion, enabled filter, unmatched-selector warning, bootstrap members-only, add/remove, no git at scan time, subsequence + nested-rel matching.
  • Sandbox demo: a nested project is found through its grouping dir; worktree excluded; bootstrap enables only the pack.yml member; non-contiguous and rel-path queries match it.

Plan: plans/440-opskit-go-config-driven-enabled-projects.md.

@growlf growlf self-assigned this Oct 13, 2026
@growlf

growlf commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Reviewed. Reproduced both reported failures against a scratch ~/.opskit and confirmed they're fixed:

  • Nested projects. The old scan_project_dir iterated one level (iterdir()), so a project under a grouping dir (neither .git/ nor .opskit/pack.yml) was skipped entirely → opskit go <nested-name> said "No project matches". discover_projects now descends (depth ≤ 4, pruning VCS/build/cache dirs), stops at a matched project, and records a rel path, so nested projects resolve by basename and by relative path.
  • Enabled list. ~/.opskit/config.yml projects: is now the source of truth. Empty list + TTY → one-time bootstrap prompt that offers to enable the .opskit/pack.yml members; non-TTY → clear message and exit. rescan warns on unmatched selectors; list/rescan respect the list.

Verified:

  • make test → 1675 passed, 1 skipped. New tests cover recursive discovery through a grouping dir, worktree exclusion, no-descent into a project, the enabled filter, bootstrap (members only), add/remove, config round-trip + config-mtime staleness, and subsequence + nested-rel matching.
  • Scan no longer shells out to git per project (lazy _git_info) — the reason opskit go was slow — and the no-op condition in sort_projects_by_last_used is fixed.
  • No client names anywhere: plan, code and tests all use generic placeholders. The earlier guards failure was real project names in the plan/tests/docstring; fixed in 76e1ea4 and public text rephrased generically.

Nit, not blocking: _git_info (opskit-go.py) duplicates git_info (opskit-projects.py). Leave it.

Merging.

@growlf
growlf merged commit 3aec3bf into main Oct 13, 2026
9 checks passed
@growlf
growlf deleted the 440-opskit-go-config-driven-enabled-projects-list-list branch October 13, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opskit go: config-driven enabled-projects list (list only enabled, recurse for nested)

1 participant