Skip to content

Metadata-only project directories poison diagnostics #1146

Description

@bcdonadio

Observed behavior: Observation-only lcm doctor backend health and aggregate statistics become unavailable as soon as a legitimate metadata-only project directory exists. Such a directory contains meta.json but no db.sqlite. The snapshot reports SQLite publication and pool ready, schema unverified, project unavailable and outbox unverified, despite authenticated daemon health and the existing project databases remaining available.

Expected behavior: Metadata-only project registrations that have not created a database should not poison aggregate diagnostics of initialized projects. Preserve registered metadata and never create, migrate or repair a database during observation. Unsafe topology or unreadable existing databases must remain refusals; a selected project without a database must retain honest unavailable semantics.

Root cause: collectSqliteStats enumerates every project directory and calls queryProjectStats; the latter returns null when db.sqlite is absent, and the aggregate loop throws Statistics unavailable instead of distinguishing a not-yet-initialized registration from a failed existing database. The relevant stats implementation is byte-identical before and after PR #1145; this is a pre-existing boundary exposed by newly created metadata-only project directories, not a regression in that PR's worker flags.

How to reproduce:

  1. Use a private LCM home with an initialized healthy SQLite project and an additional admitted owner-only project directory containing metadata but no db.sqlite.
  2. Run observation-only aggregate stats/doctor.
  3. Observe backend health unavailable rather than retaining healthy observations of initialized projects.
  4. Neither command should create a database in the metadata-only directory.

Evidence: On main merge 6a18f634534ecc27c52424d5ec1bdd1709e36127, a sanitized instrumented copy of installed stats recorded the missing-project-database branch immediately before producing the observed snapshot. Installed worker one-shot and session roundtrips both succeeded with old and new flags on Node 25.9.0 using a private fixture and empty child environment. Five metadata-only directories created after the prior healthy check explain the state change. No global state was mutated during diagnosis.

Environment:

  • Agent: Codex / GPT-6 Astra
  • Connector: CLI
  • OS: Fedora Linux
  • Runtime: Node 25.9.0, LCM 1.4.2 exact main artifact

Follow-up outside frozen campaign S5; preserve the resolved acceptance records of #1122, #1123, and #1124. Related PR #1145 only for discovery context.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Effort

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions