fix(cli): scope metadata db path to target repository#23
Merged
AperturePlus merged 1 commit intodevelopfrom Mar 14, 2026
Merged
fix(cli): scope metadata db path to target repository#23AperturePlus merged 1 commit intodevelopfrom
AperturePlus merged 1 commit intodevelopfrom
Conversation
Why: Index/search/update resolved .aci/index.db from CWD, which breaks cross-directory CLI usage and causes 'Path has not been indexed' errors. What: Added a project-scoped metadata DB path helper and wired index/search/update to initialize services with <repo>/.aci/index.db instead of a CWD-relative default. Added unit tests to verify the scoped path behavior in CLI flows. Test: uv run ruff check src tests (pass) Test: uv run pytest tests/unit/test_cli.py tests/unit/test_cli_metadata_db_path.py -q (pass) Test: uv run pytest tests/ -v --tb=short -q --durations=10 (interrupted; suite showed pre-existing failures while running) Test: uv run mypy src --ignore-missing-imports --no-error-summary (fails with many pre-existing typing issues)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
.aci/index.dbfrom being created relative to the caller's CWD when runningaci index /path/to/repo, which causedaci searchto report "Path has not been indexed" when the search was run from the project directory.Description
_project_metadata_db_path(path: Path) -> Pathto derive the project-scoped metadata DB path as<repo>/.aci/index.db.get_services()to accept an optionalmetadata_db_pathand forward it tocreate_services()so services initialize using the intended metadata file.index,search(when given--pathor implicit project), andupdateto callget_services(metadata_db_path=_project_metadata_db_path(...)), ensuring metadata operations are scoped to the target repository instead of CWD.Testing
uv run ruff check src testsand it passed successfully (✅).uv run pytest tests/unit/test_cli.py tests/unit/test_cli_metadata_db_path.py -qand they passed (✅).uv run pytest tests/ -v --tb=short -q --durations=10but this run was interrupted after exposing pre-existing unrelated failures in the broader suite (uv run mypy src --ignore-missing-imports --no-error-summarywhich reported existing repository-wide typing issues unrelated to the CLI fix (Codex Task