Skip to content

fix(doctor): shape install records before reading paths - #397

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-365-install-state-shape
Oct 14, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-365-install-state-shape

Conversation

@StepenkoAnatoli

Copy link
Copy Markdown
Owner

Doctor passed untyped install-state JSON to path functions, crashing on values such as kitHome: 42 and accepting primitive records as installations. Install-state reads now shape existing fields, and doctor names an unreadable deployment record with a deploy warning and install remedy.

Fixes #365

what changed: Require an object; filter path strings, path arrays and skill hashes using existing type rules. Added library and CLI regressions for malformed records and retained valid metadata.

why: Parsed JSON alone does not establish a valid path or install record. Apply the same type boundary used for machine config. No alternative design was set aside.

what it touched: machine/doctor libraries and tests, architecture, changelog and research-kit README inventory. No new record format.

what you verified: verified - red-first 89 passes and three expected failures; then 92 doctor/machine tests passed in 134.6 seconds, including parseable CLI JSON and named deploy warnings. Handoff OK, preflight PASS, doctor READY collector/firecrawl-cli in this checkout. The standard full offline commit gate accepted 1dae0ab39506986f1e4788c8e7009320529b4e56.

what you got wrong and fixed: nothing to report.

what changed: Install-state reads accept only objects, keep non-empty string paths and path arrays, and filter skill hashes with the installer's existing string-value rule. Doctor warns by filename when an existing record lacks a readable deployment path instead of passing ill-typed data to path functions.

why: Parsed JSON was treated as a valid install record, allowing numbers, arrays and other values to crash doctor or be spread into future writes. Apply the same boundary typing already used for machine config. No alternative design was set aside.

what it touched: machine/doctor libraries and tests, architecture, changelog and research-kit README inventory. Existing install-state field names and other metadata are preserved.

what you verified: verified - red-first 89 passes and three expected failures; then 92 doctor/machine tests passed in 134.6 seconds. Covered non-object records, ill-typed and blank paths, mixed arrays/hash values, read-only preservation, named deploy warnings and the CLI's JSON output. Handoff OK, preflight PASS, doctor READY collector/firecrawl-cli in this checkout. The required full offline suite runs in the commit gate before acceptance.

what you got wrong and fixed: nothing to report.
@StepenkoAnatoli
StepenkoAnatoli merged commit 0dc3ff0 into main Oct 14, 2026
7 checks passed
@StepenkoAnatoli
StepenkoAnatoli deleted the fix/issue-365-install-state-shape branch October 14, 2026 18:56
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.

doctor dies with a raw ERR_INVALID_ARG_TYPE stack when the install state's kitHome is not a string

1 participant