Creator Docs
Workflow Editor

Default History and Agent Memory

World Snapshots, Historical Logs, and character-threshold compression.

Purpose and ownership

The default workflow separates canonical world context from provider conversation memory:

  • buildWorldSnapshot(round, audience) produces a deterministic current-state reset point;
  • buildHistoricalLog(fromRound, throughRound, audience) produces canonical chronology from game state;
  • the game simulator keeps exact recent user/assistant exchanges in jfGameStack.chunk.*;
  • jfGameStack.summary stores a compressed Historical Log, not a compressed provider transcript;
  • each catalyst scene uses its own jfCatalystStack.<id>.chunk.* and optional summary;
  • completed catalyst outcomes enter canonical round history;
  • jfCatalystArchives keeps the small durable records needed after a scene stack is removed.

World Snapshots are user-role reference data and are never compressed. The stable system prompt contains rules and immutable world-before-start premise, not a current entity/region/feature catalog.

The workflow owns context shape, thresholds, history cursors, and publication. The executor remains a transport adapter to platform-owned compress.v2.

When compression runs

Compression is driven by canonical character counts, not a round cadence:

  • game stack: 300,000 characters;
  • catalyst stack: 150,000 characters.

Immediately before classic Jump Forward generation, the workflow measures the retained context. When the boundary is crossed, compression input is:

  1. the previous Historical Log compression, if any; plus
  2. canonical Historical Log rounds after its cursor.

It never contains a World Snapshot. Successful publication atomically replaces the represented exact prefix with a summary and records the current pre-jump round as the new snapshot boundary. The first retained user message then carries that compression, the deterministic World Snapshot at the boundary, the current round log, and the short JF request. Later turns append only catch-up logs.

Ordinary compression runs before the next jump, not after every completed jump. Intervene remains the forced exception because its discarded continuation must not survive.

Reset, history editing, duplication, and game creation do not run compression. Reset and retrospective edits rebuild the game conversation deterministically from canonical surviving rounds. Reconstructed assistant messages use the provider-valid structured events envelope but carry no reasoning continuation. Migration packs one round at a time and never materializes a complete serialized transcript.

Catalyst outcomes

A catalyst scene has isolated memory while it runs. Because its interactive private transcript cannot be reconstructed as a world log, catalyst compression still compresses that scene's transcript. At terminal publication, its canonical closing summary and public meanwhile event enter round history. The scene transcript and reasoning continuation do not enter classic world memory.

Intervene

Intervene discards unrevealed output and publishes only the canonical revealed prefix. That sanitized exchange is force-compressed even below the normal game-stack threshold. The model sees neither the discarded continuation nor an intervention marker. If compression is temporarily unavailable, the exact sanitized exchange remains durable with an internal retry flag and is compressed before the next game or catalyst generation.

Persistence quota and atomicity

Workflow memory has one 30 MiB quota covering the combined UTF-8 JSON footprint of workflowStore and its optimized workflowStoreChangeLog. Compression, reconstruction, cheats, and ordinary writes all preflight that same combined footprint.

Summary publication is planned as one atomic store/log projection. The summary never has to coexist with every represented chunk as a temporary intermediate state, and a crash cannot expose a state with neither the exact prefix nor its summary.

Platform call

Default compression uses typed compress.v2 requests:

  • paxhistoria.global-history.v1 for canonical Historical Logs;
  • paxhistoria.catalyst-agent-stack.v1 for a catalyst scene.

Advisor and suggested-actions Historical Logs use audience-scoped paxhistoria.global-history.v1 summaries. Advisor Q&A remains a separate exact thread stack. Suggested actions is one-shot and does not replay prior suggestion responses.

The executor supplies current non-spectator human beneficiaries immediately before each call. The workflow never chooses payers or forwards provider details.

Each result carries an opaque call id. The same id links bundle compressionCallId, Broker idempotency, and trusted-service attempt telemetry without logging prompt or summary text.

Source contracts

The transport layer is covered in the bundle compression article.