Skip to content

fix(install-engine): fail checkSurvivingPlaceholders on a zero-file scan - #2060

Open
jbmml wants to merge 2 commits into
danielmiessler:mainfrom
jbmml:fix/install-engine-zero-file-scan
Open

fix(install-engine): fail checkSurvivingPlaceholders on a zero-file scan#2060
jbmml wants to merge 2 commits into
danielmiessler:mainfrom
jbmml:fix/install-engine-zero-file-scan

Conversation

@jbmml

@jbmml jbmml commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #2058. Version: main @ 5e2f2e8 (also present in 7.40.4). File: LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts:518, and its byte-identical sibling LifeOS/Tools/InstallEngine.ts (Setup.md step 9(d) runs the outer copy; Doctor.ts imports the deployed one; both are patched here).

Repro against a clean tree (script imports the shipped function and points it at four temp roots):

nonexistent                              -> passed=true  total=0 files=0   <- bug
empty dir                                -> passed=true  total=0 files=0   <- bug
positive control (placeholder present)   -> passed=false total=1 files=1
clean rendered dir                       -> passed=true  total=0 files=0

After this change:

nonexistent                              -> passed=false total=0 files=0
empty dir                                -> passed=false total=0 files=0
positive control (placeholder present)   -> passed=false total=1 files=1
clean rendered dir                       -> passed=true  total=0 files=0

Fix: count files actually read (scanned) and require scanned > 0 && total === 0. The return type gains scanned for diagnostics. Doctor.ts sums total and never reads passed, so its behavior is unchanged. Setup 9(d) passes the full config root, which always holds CLAUDE.md and settings.json (both template extensions), so a real install still passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CvY8QkJKBWyXcZeL2Q2UXc

jbmml and others added 2 commits September 3, 2026 22:55
A nonexistent or mis-rooted rootDir walked zero template files and returned
passed: true, so the Setup 9(d) identity-placeholder gate could not fail in
exactly the case it exists to catch. Count the files actually read and require
at least one before the check can pass. The result gains a scanned field for
diagnostics; existing callers (Doctor.ts sums total only) are unaffected.

Fixes danielmiessler#2058

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CvY8QkJKBWyXcZeL2Q2UXc
…eOS/Tools/

LifeOS/Tools/InstallEngine.ts and LifeOS/install/skills/LifeOS/Tools/InstallEngine.ts
are byte-identical; Setup.md step 9(d) runs the outer one, Doctor.ts imports the
deployed one. Both now fail a zero-file scan.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CvY8QkJKBWyXcZeL2Q2UXc
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.

checkSurvivingPlaceholders returns passed:true on a zero-file scan, so a mis-rooted Setup 9(d) gate cannot fail

1 participant