Skip to content

Validate history.jsonl concurrent-append behavior; gate the feature-flagged mitigation on it #2

Description

@hefgi

Background

history.jsonl is the single shared, append-only file at the master root and the only real concurrency exposure when two profiles are live at once (PRD §15). All other shared state (sessions/, projects/, tasks/) is keyed by path/id and does not collide across different repositories.

Phase 2 treats history.jsonl as an ordinary shared symlink (decision #7). Whether that is safe under two concurrent Claude daemons is unvalidated.

Task (PRD §11.4)

Run the focused append test:

  1. Two profiles live in different repositories.
  2. Drive rapid interleaved activity so both append to the shared history.jsonl.
  3. Verify every line parses as JSON, no line is torn/interleaved, and entry counts from both sessions are all present.
  4. Repeat under scripted bursts to stress the append path.

Decision it feeds (PRD §15)

  • Clean → keep history.jsonl fully shared. No code change. (Desired outcome.)
  • Torn/interleaved → mitigate only this one file, without disturbing the rest of the shared model:
    1. Preferred: Recif-daemon-mediated advisory lock (flock) serializing appends to the master file.
    2. Fallback: make history.jsonl alone per-profile (add to denylist), accepting loss of global history search while keeping sessions/projects/tasks shared and resumable.

Full sharing / resume-anywhere is a hard requirement either way — no partial-sharing fallback.

Notes

  • Any mitigation should ship behind a feature flag so it is off until the test forces it on.
  • Priority: this is the one open design question; it can change behavior of one file only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions