Skip to content

Add scoped Compass initialization#29

Merged
forhappy merged 4 commits into
mainfrom
agent/scoped-compass-init
Jul 25, 2026
Merged

Add scoped Compass initialization#29
forhappy merged 4 commits into
mainfrom
agent/scoped-compass-init

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

  • add interactive and automation-friendly compass init
  • persist project-relative include/exclude scope in .compass/config.toml
  • perform a forced initial build and reuse the saved scope for update, extract, and watch
  • add help, completions, and user documentation
  • harden root-path, portable absolute-path, and config-symlink validation

Why

Compass previously required users to repeat repository paths and exclusions for every build or watch invocation. This adds a first-run workflow that records a reviewable project scope and consistently applies it afterward.

User impact

Users can initialize an entire repository interactively with compass init, or automate a focused monorepo setup with repeatable --include and --exclude flags plus --yes. Invalid or unmatched scope fails before configuration is written, and existing configuration requires --force to replace.

Final review fixes

The final review found and addressed three edge cases:

  • . and ./ now work as literal project-root directory scopes
  • Windows absolute paths are rejected even when configuration is processed on Unix
  • symlinked .compass configuration paths cannot escape and overwrite files outside the project root

Regression coverage also verifies interactive/non-interactive behavior, forced replacement, saved-scope reuse on update, and fail-closed invalid configuration handling.

Validation

  • cargo fmt --all -- --check
  • cargo test -p compass-files
  • cargo test -p compass-core
  • cargo test -p compass-cli --test init_cli --test update_cli --test watch_cli --test help_cli --test compass_product
  • cargo clippy -p compass-files -p compass-core -p compass-cli --all-targets --no-deps -- -D warnings
  • bash -n completions/compass.bash
  • zsh -n completions/_compass
  • git diff --check
  • graphify update .

@forhappy
forhappy marked this pull request as ready for review July 25, 2026 01:07
@forhappy
forhappy merged commit 9103532 into main Jul 25, 2026
1 of 9 checks passed
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.

1 participant