Review https://github.com/entireio/cli/pull/1147 only for dead code
- User
Review https://github.com/entireio/cli/pull/1147 only for dead code
Assistant· claude-opus-4-7
Now I have the full diff. Let me verify dead code candidates by checking the actual codebase state.
Assistant· claude-opus-4-7
Verified the diff and traced every new symbol against the tree. Reviewing for dead code only.
Dead code findings
One candidate, borderline:
migrateOneCheckpoint(cmd/entire/cli/migrate.go:515)After this PR, the production loop calls directly (migrate.go:600), with resolved from the new index. The pre-existing wrapper now exists to support one test:
- User
yeah if there's code that's only called in a test (no production code calls it) then delete it
Assistant· claude-opus-4-7
I'll inline the wrapper into the test and delete it.
Assistant· claude-opus-4-7
Also need to update the comment in
recordMigrationSkipOrFailurethat references the old name.Assistant· claude-opus-4-7
Now run the verification commands required before any push.
Assistant· claude-opus-4-7
Lint clean. Now test the migrate package.
Assistant· claude-opus-4-7
Tests pass. Summary:
- Deleted the
migrateOneCheckpointwrapper incmd/entire/cli/migrate.go(it was only reachable from one test). - Updated
TestMigrateCheckpointsV2_RerunResumesInterruptedMigrationincmd/entire/cli/migrate_test.go:563to callmigrateOneCheckpointWithExistingdirectly, passingexisting=niland a freshnewMigrateCompactOffsetCache()— the test repo has no prior v2 state so the lookup the wrapper performed was a no-op anyway. - Updated the comment on
recordMigrationSkipOrFailureto reference the surviving function name. mise run fmt && mise run lintclean; migrate tests pass.
- Deleted the
- User
why the migrateOneCheckpointWithExisting rename though? why not migrateOneCheckpoint?
Assistant· claude-opus-4-7
Good point — the
WithExistingsuffix only made sense to disambiguate from the now-deleted wrapper. Renaming.Assistant· claude-opus-4-7
Renamed
migrateOneCheckpointWithExisting→migrateOneCheckpoint(5 sites: definition, doc comment, prod caller, test caller, plus therecordMigrationSkipOrFailuredoc reference). Lint clean, migrate tests pass.