Skip to content

refactor(cli): replace the three isPlainObject copies with the shared isRecord guard - #431

Merged
theCodeDrift merged 1 commit into
mainfrom
fix/421-is-record
Sep 30, 2026
Merged

theCodeDrift merged 1 commit into
mainfrom
fix/421-is-record

Conversation

@theCodeDrift

Copy link
Copy Markdown
Member

The 0.12.0 stack added packages/cli/src/util/is-record.ts and consolidated six private copies of the object guard. Three older copies survived under the name isPlainObject, with an identical body. This removes them and points all 7 call sites at isRecord:

  • packages/cli/src/filesystem/manifest.ts (3 call sites)
  • packages/cli/src/filesystem/migrations/0002-install.ts (2)
  • packages/cli/src/filesystem/migrations/0003-drop-installed-at.ts (2)

The migrations can share the guard safely: a project is taken to the latest schema before any command runs, so a shared helper doesn't change what an old project sees. No isPlainObject remains in packages/cli/src.

No changeset: an internal refactor with no user-visible change.

Verified locally: pnpm typecheck, pnpm lint (including taskless check), and the CLI suite (112 files, 1905 tests) pass.

Fixes #421

@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@claude

claude Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Claude finished @theCodeDrift's task in 45s —— View job


Review complete

Review mode: incremental — read 0 prior review thread(s) before reviewing. .prior-review.json contains only the triggering @claude /review comment itself, with no prior reviews or review threads recorded. This is the first review of this PR, so everything below is assessed fresh (nothing to mark as previously addressed or still-open).

  • Read .prior-review.json
  • Fetch PR diff (gh pr diff 431) and metadata
  • Read all three changed files in full, plus packages/cli/src/util/is-record.ts
  • Verify no remaining isPlainObject references and cross-check other isRecord call sites
  • Post review

Assessment: clean, no findings.

This is a mechanical consolidation with essentially no behavioral surface to get wrong:

  • isRecord in packages/cli/src/util/is-record.ts is byte-identical to the three removed isPlainObject bodies (typeof value === "object" && value !== null && !Array.isArray(value)), so every call site's guard semantics are unchanged.
  • All 7 call sites (3 in manifest.ts, 2 each in migrations/0002-install.ts and migrations/0003-drop-installed-at.ts) are simple 1:1 renames — no logic around them changed.
  • Confirmed no isPlainObject remains anywhere under packages/cli/src (grep is empty), so this isn't a partial migration.
  • The migration-sharing rationale in the PR body checks out: 0002-install.ts and 0003-drop-installed-at.ts each independently parse and validate their own taskless.json read, so sharing the guard doesn't introduce any coupling between migrations or change what an older project sees — migrations still run in sequence up to the latest schema before any command executes.
  • readManifest/readRawManifest/writeManifest call sites elsewhere in the codebase are unaffected since the function signatures of manifest.ts didn't change, only its internal guard.
  • No changeset is correctly omitted per the PR body — this is an internal-only refactor with no observable behavior change and no new/changed public surface.

No correctness, security, performance, or clarity issues found. No inline comments posted.

@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @claude[bot] — "Claude finished @theCodeDrift's task in 45s — Review complete…"
#431 (comment)

Acknowledged: the review found no issues, so no changes were needed.

— AI Coding Agent

@theCodeDrift
theCodeDrift merged commit 1aff9a8 into main Sep 30, 2026
8 checks passed
@theCodeDrift
theCodeDrift deleted the fix/421-is-record branch September 30, 2026 19:32
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.

Replace the three isPlainObject copies with the shared isRecord guard

1 participant