- Fix Infinity anchorTimestamp repair on JSON round-trip (blocks extending
to end-of-conversation now restored correctly instead of discarded)
- Fix nextBlockId calculation to use max(id)+1 instead of array length
- Rename internal prompt tag <dcp-message-id> to <dcp-id>
- Add regression tests for corrupted-block resilience (PR #3, @wassname)
- Update README with Contributors section
- Update CHANGELOG for 1.0.7
- Bump package.json to 1.0.7
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The root cause of the compression spiral (101 failures, 2 hours):
resolveAnchorTimestamp returned Infinity when no message followed the
compression range. Infinity corrupted JSON serialization (became null),
and null timestamps in JS overlap checks coerced to 0, making every
range appear to overlap the ghost block b7.
Fixes:
- resolveAnchorTimestamp returns endTimestamp + 1 instead of Infinity
- Validate all timestamps are finite before creating a block (fail fast)
- Skip blocks with non-finite timestamps in overlap checks and compression
- Include existing block range in overlap error messages (diagnostic)
- Filter out corrupted blocks on session restore
- Guard synthetic message timestamp creation against non-finite values
- Add regression tests for Infinity anchor and null-timestamp blocks