Data Model: Mission write primitive

Mission write lock

  • Identity: lock file <git-common-dir>/spec-kitty-locks/<mission-dir-name>.status.lock (same file as feature_status_lock).
  • Invariant: every mutation of a Mission file in scope (status log, status snapshot, WP file activity log, tracer file) happens while the calling thread holds it. Re-entrant per thread.

RollbackPoint

FieldTypeMeaning
events_pathPaththe Mission's status.events.jsonl on the write surface
status_pathPaththe Mission's status.json
pre_event_sizeintlog size at capture
pre_status_bytesbytes \None
events_existedboolwhether the log existed at capture (rollback may unlink only then-absent logs)
  • Invariant: captured only while the Mission write lock is held (capture refuses otherwise).

RollbackOutcome

FieldTypeMeaning
rolled_backboolthe tail was cut (or nothing needed cutting) and the snapshot restored
refusalRollbackRefusal \None
  • State rule: a refused rollback leaves both files byte-identical.

Checkout claim lock

  • Identity: <git-common-dir>/spec-kitty-locks/__checkout-<sha1(normcase(resolved checkout))[:16]>__.status.lock.
  • Order: always taken before any Mission write lock.

SharedWorkspaceWriter (advisory)

FieldType
mission_slugstr
wp_idstr
lanein_progress \
actorstr \