Skip to content
Back to skills

Rebuild State From Ordered Events

ASecurity

Reconstruct an entity's state from its ordered event history. Use when a current-status table disagrees with an append-only event log.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 26, 2026
ai-agents

Security analysis

A100/100

Scanned September 26, 2026

npx -y skills add alisonjieli-png/loop-engine --skill rebuild-state-from-ordered-events --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rebuild State From Ordered Events?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rebuild State From Ordered Events
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alisonjieli-png-rebuild-state-from-ordered-events/badge)](https://www.skillsdirectory.com/skills/alisonjieli-png-rebuild-state-from-ordered-events)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rebuild-state-from-ordered-events
description: Reconstruct an entity's state from its ordered event history. Use when a current-status table disagrees with an append-only event log.
---

# Rebuild state from ordered events

## When to use

Use this to explain a status at a named cutoff from recorded changes. The owner must supply what each event means and which transitions are valid.

## Inputs

- Event records with entity identity, event identity, and the fields used by the authoritative replay order. Keep effective, commit, and observation times distinct when supplied.
- Initial state, event meanings, transition rules, the authoritative replay ordering rule, and cutoff rule.
- A tie-breaking rule when the authoritative order can have ties.
- The log's rule for repeated event identities, including whether identical repeats are idempotent.

## Procedure

1. Select events for the entity and cutoff under the supplied cutoff rule. Compare repeated event identities and their payloads. Collapse identical repeats only when the supplied log rule declares them idempotent; hold conflicting duplicates. Identify missing ordering fields.
2. Order events by the supplied authoritative replay rule, which may use a commit sequence, effective time, or another declared field. Apply the supplied tie breaker where needed. Preserve other timestamps separately to explain delay; their presence does not make them replay order.
3. Apply each event to the prior state under the supplied transition rules. Record an invalid transition rather than guessing its effect.
4. Compare the reconstructed state with a materialized status record for the same cutoff, if one was supplied. Explain discrepancies with the exact event identities and timestamps. Do not compare a historical replay with a present-day status as if they shared a cutoff.
5. Repeat at a second cutoff when the task asks when a discrepancy began.

## Completion check

Return the initial state, cutoff and its inclusion rule, authoritative replay order, ordered event identities, resulting state after each event, final state, and unresolved anomalies. A replay with the same input and rules must produce the same result.

## Stop conditions

Stop on an unknown initial state, undefined event meaning, missing authoritative order or cutoff rule, unresolved ordering tie, or conflicting duplicate identity. Hold repeated identities when no idempotency rule is supplied. Do not repair the log or overwrite a current-status table.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.