Skip to content

bug: daemon status and gortex repos disagree about tracked repos; a repo whose directory was deleted is never flagged #312

Description

@tiendungdev

Environment

  • gortex v0.60.0+dd3bb30, Windows 11 Pro (10.0.26200)

Observed

With two repos tracked, one of whose directory had been deleted from disk
days earlier:

  • gortex daemon statustracked repos: table listed 1 repo
    (only the live one).
  • gortex repos → listed 2 repos, including the deleted one:
    fastpanel-api | HEAD (none) | INDEXED (none) | LAST INDEXED 2026-07-10 | stale | C:\...\fastpanel-api (path no longer exists).

Two views of the same daemon disagreeing means neither can be trusted as the
inventory. And the ghost was 8 days old — nothing (status, health, repos, a
log line) ever said "this repo's path no longer exists".

A milder variant of the same identity confusion: the SessionStart status
prints the surviving repo as cwd ... is tracked as repo ` ` (empty repo
name) while gortex repos names it domain-manage. See #309 for where that leads.

Confirmed repro (isolated daemon, v0.60.0)

Immediately after rm -rf repo-b (still tracked): both views keep the
repo with no flag — daemon status lists it with its node counts, repos
shows HEAD (none) ... stale with the dead path. Nothing says the path is
gone. The production observation above (status=1 repo vs repos=2, eight days
later, daemon restarted meanwhile) shows the two views then drift apart —
same root cause: repo-path liveness is never checked.

Expected

  • One inventory, or at least two views that agree.
  • A tracked repo whose path fails stat should be flagged loudly in both
    views (e.g. MISSING — path deleted; run gortex untrack <path>), and
    should count against index_health.

Proposed fix

  1. Make both commands read the same repo registry snapshot.
  2. Add a stat check per repo when rendering either view; render a MISSING
    state instead of HEAD (none).
  3. Optionally auto-quarantine: after N days MISSING, suggest (not perform)
    untrack in the status output.

Repro

gortex track C:\tmp\some-repo
# wait for index
rm -rf C:\tmp\some-repo
gortex daemon status   # repo absent from table
gortex repos           # repo present, HEAD (none), no warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions