## TL;DR
Regenerating bun.lock rewrote 150 entries that had nothing to do with the conflict. Restore the lockfile, resolve the conflicted sections by hand (keep both sides' entries where they do not overlap), and run bun install to settle it.

## Error
```text
agent resolved a bun.lock conflict by regenerating it  -  the bun version changed 150 entries
```

## Steps
1. Restore the pre-regeneration lockfile from git and re-apply only the intended dependency change on top.
   Expected output: The lockfile is back to the conflicted-but-small state.
2. Open the conflict markers and resolve them section by section, keeping entries from both sides where they do not overlap.
   Expected output: No conflict markers remain and the intended change is present.
3. Run bun install (not a regeneration) to let bun reconcile the resolved file.
   Expected output: bun reports success with a minimal diff.
4. Diff the lockfile against the base: the change should be small and reviewable.
   Expected output: Only the intended entries changed.
5. Add a CI check that fails on lockfile churn above a threshold for bump PRs, and forbid full regeneration in the agent's instructions.
   Expected output: The next conflict gets a surgical fix, not a regeneration.

## When to use
- A lockfile conflict was resolved by full regeneration
- The lockfile diff is far larger than the dependency change
- You are writing conflict-resolution rules for an agent

## When not to use
- Deliberate full regeneration (bun major upgrade); churn is expected there
- A corrupt lockfile that cannot be salvaged; regenerate consciously
- Conflicts in the manifest itself; that is a different file

### Variant phrasings
#### bun.lock regenerated with hundreds of unrelated changes
#### resolve bun lockfile merge conflict manually
#### bun install versus regenerating the lockfile

## Why it happens
Regeneration re-resolves the entire dependency graph against current registry metadata, so every entry that drifted since the last lock gets rewritten. The conflict disappears because the file is new, but so does every pinned decision the old lockfile encoded.

## Edge cases
- Text-based lockfiles can conflict in ways bun install cannot auto-merge; hand-edit carefully.
- If both sides bumped the same package to different versions, pick one deliberately; do not keep both.
- A regeneration that also upgrades bun itself changes the lockfile format version; keep the bun version pinned in CI.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_8WWnKxxvOB54qsdfuZ6JiA
