Skip to content

Workflow.record: platform-recorded typed history with list/latest#53

Open
czpython wants to merge 4 commits into
mainfrom
commonzenpython/eng-733-sdk-the-run-record-platform-recorded-typed-history-with
Open

Workflow.record: platform-recorded typed history with list/latest#53
czpython wants to merge 4 commits into
mainfrom
commonzenpython/eng-733-sdk-the-run-record-platform-recorded-typed-history-with

Conversation

@czpython

@czpython czpython commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Every extension that accumulates working state hand-maintains a journal — each agent call wrapped in an add_* write, the replay contract restated in a docstring — rebuilding what the platform already witnesses at its own chokepoints. This gives the SDK the record instead.

Workflow.record — an ordered, in-memory, read-only record of the run's typed utterances, appended by the platform:

  • Agent.__call__ appends the post-to_result() domain value, body-level only. The existing _in_step gate keeps in-step calls out on the live pass; the enclosing step's memoization keeps them out on replay — so the record rebuilds bit-for-bit on recovery. run() bodies (one whole step) never append.
  • Gate.wait appends the validated Gate instance.
  • review() now returns a typed ReviewReply (platform-owned Gate subclass, topic pinned to review) and appends it. The resume endpoint's wire shape is untouched — {action, answers, note} validates as-is, partial senders included.

Selection is by contract type, never by producer: record.list(T, **filters) / record.latest(T, **filters), flat attr=value equality, ANDed — subscriber-filter semantics. No after=, no windows, no ordinals — a projection that needs more is a domain bug, per the ticket.

record is a plain read-don't-write instance attribute, same species as subject and input. Two SDK test flows that used the name as a step renamed to note_repo.

Nothing is stored and no DBOS step was added, renamed, or reordered — in-flight runs replay across this deploy unchanged.

Docs: "Replay-rebuilt workflow state" in writing-an-extension.md becomes "The run record" — the platform records the run's calls, extensions project them; step returns and run() internals stay in locals.

Build's _plan_phase moves to attribute access on the typed reply; the journal migration itself is ENG-734, stacked on this.

codex-reviewed: the adversarial pass flagged subclass shadowing of record and a filter-typo inconsistency. The typo behavior is settled as plain subscriber semantics (attributes read directly; a typo raises as entries scan); the shadowing hardening (getter-only property + reserved-name check) was tried and dropped — platform attributes stay plain read-don't-write names here, like subject/input/state.

ENG-733

@czpython
czpython force-pushed the commonzenpython/eng-733-sdk-the-run-record-platform-recorded-typed-history-with branch from cfb2146 to 37e14d0 Compare July 21, 2026 20:14
@czpython
czpython force-pushed the commonzenpython/eng-733-sdk-the-run-record-platform-recorded-typed-history-with branch from 81bcc00 to 11e3df4 Compare July 21, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant