Skip to content

fix: make doctor current-project check resolution-aware#180

Merged
ScriptedAlchemy merged 3 commits into
masterfrom
codex/doctor-resolution-aware
Jul 2, 2026
Merged

fix: make doctor current-project check resolution-aware#180
ScriptedAlchemy merged 3 commits into
masterfrom
codex/doctor-resolution-aware

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • tracedecay doctor's "Current project" check used the synchronous TraceDecay::is_initialized, which only looks for a repo-local .tracedecay/ index; on profile-sharded setups it falsely warned "No index — run tracedecay init" for fully indexed projects (e.g. worktrees resolved via the git-common-dir alias to a profile store like proj_b4a8bbe4953823c4).
  • Doctor now resolves the store through the same registry/alias/profile-shard-aware path the real tools use (new TraceDecay::initialized_store_layout_with_options, shared with has_initialized_store) and reports the resolved data root, storage mode, and store id; DB size is measured at the resolved graph DB path instead of the repo-local marker path.
  • tracedecay init is only advised when resolution genuinely finds nothing (no resolvable store and no legacy repo-local DB).

Test plan

  • cargo check --all-targets and cargo clippy --all-targets clean
  • New unit test doctor::tests::current_project_store_resolves_profile_shard_via_registry_alias covers the profile-sharded case (registry alias resolution with no repo-local index) and the genuinely-uninitialized case, using an isolated profile root + global DB (no ~/.tracedecay pollution)
  • Existing doctor tests plus storage_resolver_test and profile_storage_migration_test pass with TRACEDECAY_DATA_DIR pointed at a tempdir

The doctor "Current project" check used the synchronous
TraceDecay::is_initialized, which only looks for a repo-local
.tracedecay/ index. On machines using profile-sharded stores it
reported "No index — run `tracedecay init`" even though the project
resolved to a fully indexed profile store, steering users into a
redundant re-init.

Resolve the store through the same registry/alias-aware path the real
tools use (via the new TraceDecay::initialized_store_layout_with_options,
shared with has_initialized_store), report the resolved store location,
mode, and id, measure DB size at the resolved graph DB path, and only
advise `tracedecay init` when resolution genuinely finds nothing.
@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4f5e7cf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6fcc5f56ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/tracedecay.rs
ScriptedAlchemy added 2 commits July 2, 2026 00:48
check_database previously measured a caller-supplied db path that could
differ from the DB TraceDecay::open actually serves (e.g. a branch-
specific DB), making the VACUUM size report inaccurate. Derive the path
from the opened instance instead, which also drops the threaded db_path
parameter and the LegacyRepoLocal payload field.
@ScriptedAlchemy ScriptedAlchemy merged commit 2d5abe3 into master Jul 2, 2026
18 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