You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 62aa276
Browse filesBrowse the repository at this point in the historyBrowse files
storage: add state_append + state_log_scan to all backends (Step 2)
Adds the append-only verb to the unified state_* API. The
function_state_log table was provisioned in Turn 1, so this is just glue:
* FunctionStorage Protocol — two new methods
* BoundStorage facade — convenience wrappers (state_append / state_log_scan)
* FunctionStorageSqlite — INSERT OR IGNORE on UNIQUE(scope, ns, key,
attempt_id) for replay; SELECT-back to recover the prior id on conflict
since SQLite's lastrowid is unreliable after IGNORE.
* FunctionStorageAzureSql — SELECT-then-INSERT...OUTPUT inserted.id; the
unique index idx_function_state_log_replay enforces idempotency.
* FunctionStorageCfDo — POST /state_append and /state_log_scan with
attempt_id splicing on the append (HTTP-retry replay-detection).
Tests: 9 SQLite cases (round-trip, monotone ordinals, key/ns/scope
isolation, non-destructive scan, empty scan, execution_clear wipes the
log, BoundStorage facade); 2 mock cases each for Azure SQL and CfDo
(replay-hit-returns-prior-ordinal, scan SQL/HTTP shape). All pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments