Repository navigation
fix(claude): move the transcript import's commit batching into its own file to clear max-lines - #51292
Conversation
…n file to clear max-lines
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
One Claude transcript file grew past the 300-line limit after two recent merges, which fails the max-lines check on every open PR. This moves one self-contained step out of it, with no behaviour change.
What Changed
claude-transcript-import-plan.ts(305 → 261 lines):finish()now hands the collected rows to a newclaudeTranscriptImportBatches()instead of building the commits inline.claude-transcript-import-batches.ts(new): the moved code, unchanged. It marks rows that revise saved items, expects the untouched dependencies on the first commit, adds the "continued outside" divider before the first created row, revises or pushes each row, then finishes the batch with the same key.Why
config/max-lines-baseline.txtis a ratchet that may only shrink, so the file has to be split rather than allow-listed. Turning rows into catch-up commits is the one step of the import plan that needs nothing from its closure except values passed in, so it moves cleanly and keeps the row-by-row restore logic in one place.Linked Issue
None. #48929 and #47819 together took the file over the limit; #51272 fixed the type error from the same merges.
Visual Proof
N/A. Nothing visible changes; the code moved as is.
Testing
The existing transcript tests cover this path, including
claude-transcript-compaction-catch-up.test.ts(5 files, 17 tests pass). Node typecheck passes. No test added: nothing changed in behaviour.Performance
None, because the same code runs in the same order; only one function boundary was added.
Risk
Low. The moved code is unchanged and keeps its order: the cancellation check before
batch.finishis still there, and no new check was added. Back out with a plain revert.Level: Low
AI Disclosure
Review
Self-reviewed against the original block line by line.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)