← fstackCONTENT HISTORY

Update to fstack

Snapshot Sep 30, 2026 · 23:16 UTC · version 1.1.2

Collection source: not recorded for this historical snapshot.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs.",
  "included_files": [],
  "name": "principle-make-operations-idempotent",
  "skill_md_contents": "---\r\nname: principle-make-operations-idempotent\r\ndescription: \"Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs.\"\r\nuser-invocable: false\r\ndisable-model-invocation: true\r\n---\r\n\r\n# Make Operations Idempotent\r\n\r\nDesign operations so they converge to the correct state regardless of how many times they run or where they start from. Every state-mutating operation should answer: \"What happens if this runs twice? What happens if the previous run crashed halfway?\"\r\n\r\n**Why:** Commands, lifecycle operations, and processing loops run where crashes, restarts, and retries are normal. If partial state changes the next run's outcome, every restart becomes a debugging session.\r\n\r\n**The pattern:**\r\n- Convergent startup: scan for existing state, clean stale artifacts, adopt live sessions\r\n- Content-based cleanup: compare by content equivalence, not creation order\r\n- Self-healing locks: use PID-based stale lock detection\r\n- Idempotent scheduling: failed work respawns cleanly, fresh input regenerated after each cycle\r\n\r\n**The test:**\r\n1. What happens if this runs twice in a row?\r\n2. What happens if the previous run crashed at every possible point?\r\n3. Does re-execution converge to the same end state?\r\n\r\nIf any answer is \"it depends on what state was left behind,\" the operation needs a reconciliation step.\r\n"
}

SHA-256 of public snapshot: ffeeb6a2314a3294bc6f36760db229b8c63e792106ce5f14bfd36d7fc62ff9d9