Skip to content

Tracking B2: per-task change journal with torn-tail repair #1398

Description

@easonLiangWorldedtech

Tracking issue for the B2 PR (branch feat/change-journal-b2; PR to be opened after review).

Part of the file-write safety series — plan: easonLiangWorldedtech/Zoo-Code#33, epic: #1375. Item: B2 — Per-task change journal. Stacked on #1395 (S3) + the B1 per-write checkpoint PR; to be rebased onto main once both land.

Scope

  • Append-only changes.jsonl under the task dir (<globalStorage>/tasks/<taskId>/changes.jsonl): one entry per file write — path (relative), operation, the B1 checkpoint id, diff stats, timestamp.
  • The journal append chains onto the B1 per-write checkpoint so it records the real checkpoint hash; the whole tail stays fire-and-forget (no write-path latency, no floating promises).
  • apply_patch records one entry per file, all referencing the single checkpoint id.
  • Torn-tail repair on load: an incomplete final line is discarded and the rest parsed; load never throws on a torn tail (crash mid-append leaves a valid audit list).

Acceptance

  • One journal entry per successful write referencing the resolved checkpoint id; none for rejected writes or the task-start baseline
  • Load: clean tail, torn tail, empty file, missing file, and a corrupted middle line all resolve without throwing
  • Journal is the single per-task audit list and survives a crash mid-write
  • CI green (ubuntu unit-test gate), 100% codecov patch coverage

Status

  • PR: to be opened

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions