Back to notes
The Tesseract MemoryTechnical note

Planning recovery when records belong in two stores

The workflow can separate business and runtime writes into a plan. Stable identities and individual receipts are still needed to recover from only one store succeeding.

Topics

Make each proposed write explicit

The processing modules append to recordBundles alongside the retained run context. Each bundle names a store, table, action, idempotency key and fields. Order, item and inventory records go into the business plan; the runtime plan identifies its record by trace and stage.

The planner rejects missing routing fields and unknown stores, defaults an unspecified action to upsert, and splits the bundles by destination. No writer follows it yet. Labels suggesting recorded or confirmed work are therefore descriptions inside a payload, not receipts proving that storage happened.

A retry needs the same record identity

The order key uses the supplied order ID, falling back to the trace ID. Item and inventory keys add the line position. Without an original line ID, reordering the input can attach an existing key to a different item.

The context builder preserves a supplied trace, but a newly created trace includes the current time. If a retry loses its earlier context, the same event can therefore receive another runtime audit key. An upsert instruction alone doesn't solve either identity problem.

Recover the missing write, not the whole event

Each future storage adapter needs table-specific checks and a result for every operation. If the business record saves but the runtime record fails, recovery should be able to identify the missing write instead of treating the entire event as new work.

Proposed tests cover missing routing fields, unknown stores, repeated events, reordered lines and failures after individual writes. They should assert both stable IDs and the operations left unfinished. These are tests still to implement and run, not evidence that the current prototype can recover from external storage failures.

Routing purchase and audit bundles through one planner

The planner separates two operation lists; neither list has a bound writer in the exports.

Direct callBlocked / denied
Inputs and rejection
Bundle construction
Planned operations

Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.

Choose a component to explore

Select a numbered component on the map or use the component menu. Its details and connections will appear here.

No component selected.

All connections (10)
  1. 01 · Supplied purchase data04 · Purchase record bundlesBuild business records · Direct call
  2. 02 · Run context and stage04 · Purchase record bundlesTrace and fallback identity · Direct call
  3. 02 · Run context and stage05 · Workflow audit bundleTrace plus stage · Direct call
  4. 04 · Purchase record bundles06 · Persistence plannerAppend business bundles · Direct call
  5. 05 · Workflow audit bundle06 · Persistence plannerAppend runtime bundle · Direct call
  6. 06 · Persistence planner03 · Rejected routing contractInvalid routing contract · Blocked / denied
  7. 06 · Persistence planner07 · Airtable operation listAirtable partition · Direct call
  8. 06 · Persistence planner08 · Data Tables operation listData Tables partition · Direct call
  9. 07 · Airtable operation list09 · External writers not wiredNo bound write adapter · Blocked / denied
  10. 08 · Data Tables operation list09 · External writers not wiredNo bound write adapter · Blocked / denied