Skip to content

doctor: ignore host .in_use heartbeat files in file audit#24

Merged
beefiker merged 2 commits into
mainfrom
fix/file-audit-in-use-lockfiles
Jul 10, 2026
Merged

doctor: ignore host .in_use heartbeat files in file audit#24
beefiker merged 2 commits into
mainfrom
fix/file-audit-in-use-lockfiles

Conversation

@beefiker

Copy link
Copy Markdown
Owner

Problem

superloopy doctor reports ok: false on every Claude Code marketplace install that has (or had) an active session:

fileAudit: File audit missing entries: .in_use/16880, .in_use/93757.

Claude Code writes .in_use/<pid> heartbeat files ({"pid":…,"procStart":…}) into the installed plugin cache root to mark that version as actively used so it is not garbage-collected mid-session. These are host runtime state, not shipped files.

Root cause

The cache root has no .git, so listGitVisibleFiles falls back to the raw filesystem walk (listFilesystemVisibleFiles). SKIP_FILESYSTEM_DIRS did not include .in_use, so the heartbeat files were swept into the audited file set; they are absent from docs/superloopy-file-audit.md, so checkFileAudit fails and runDoctor's all-checks-must-pass aggregate flips the whole report to ok: false.

This is the .in_use sibling of the packed-install fileAudit false positive tracked in #14.

Fix

  • Add .in_use to SKIP_FILESYSTEM_DIRS so the walk never descends into it.
  • Treat .in_use/ paths as runtime files in isRuntimeFile, matching how .superloopy/ runtime state is already handled.

Testing

  • New regression test in test/doctor-packed.test.js: an npm-packed install seeded with .in_use/<pid> heartbeat files must pass doctor cleanly. Verified red without the fix, green with it.
  • Full suite: 541/541 pass.
  • End-to-end: ran the fixed CLI's doctor --root against the real installed cache at ~/.claude/plugins/cache/beefiker/superloopy/0.9.0 (live heartbeat present) → ok: true.

Claude Code writes .in_use/<pid> heartbeat files into an installed
plugin cache root to mark the version as actively used so it is not
garbage-collected mid-session. The packed-install filesystem walk in
listFilesystemVisibleFiles swept them into the audited file set, so
`doctor` failed the fileAudit check ("File audit missing entries:
.in_use/<pid>") on every marketplace install with an active session.

Skip the .in_use directory in the walk (SKIP_FILESYSTEM_DIRS) and
treat .in_use/ paths as runtime files (isRuntimeFile), matching how
.superloopy runtime state is already handled.

Regression test: packed install seeded with .in_use/<pid> heartbeats
must pass doctor cleanly.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@beefiker
beefiker merged commit 494a9f4 into main Jul 10, 2026
6 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