Skip to content

feat(storage): add writer-exclusive JSONL tail repair#975

Merged
XingYu-Zhong merged 1 commit into
developfrom
codex/replace-951-jsonl-repair
Jul 19, 2026
Merged

feat(storage): add writer-exclusive JSONL tail repair#975
XingYu-Zhong merged 1 commit into
developfrom
codex/replace-951-jsonl-repair

Conversation

@XingYu-Zhong

Copy link
Copy Markdown
Collaborator

Summary

  • Rebuilds the useful JSONL tail-repair logic from feat(storage): add guarded JSONL tail repair #951 on the current develop branch.
  • Repairs only a malformed final record, with bounded reads, a caller-controlled durable backup, and mandatory writer exclusion.

Changes

  • Requires a runExclusive(path, operation) maintenance runner around the complete inspect/backup/replace/verify transaction.
  • Scans JSONL incrementally with hard byte/record caps and preserves an exact SHA-256-addressed backup snapshot before mutation.
  • Uses a synced exclusive temp file, atomic replacement, stability checks, and an original-inode guard for already-open writers.
  • Returns changed/a retained conflict path instead of choosing a version when safety cannot be proven.

All writers for the repaired path must cooperate with the same maintenance runner; the service fails immediately when no runner is supplied.

Tests

  • Targeted repair/concurrency tests (8 passed).
  • Full Kun suite (2148 passed, 1 skipped).
  • Kun typecheck/build, targeted ESLint, and git diff --check.

Original contribution and repair direction: @luoye520ww in #951.

Replaces #951.

@XingYu-Zhong
XingYu-Zhong force-pushed the codex/replace-951-jsonl-repair branch from cceb85a to bdabef5 Compare July 19, 2026 05:00
@XingYu-Zhong
XingYu-Zhong marked this pull request as ready for review July 19, 2026 05:01
@XingYu-Zhong
XingYu-Zhong force-pushed the codex/replace-951-jsonl-repair branch from bdabef5 to 93089c9 Compare July 19, 2026 06:07
@XingYu-Zhong
XingYu-Zhong merged commit 6064a9e into develop Jul 19, 2026
9 checks passed
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.

1 participant