Subject keying rides DBOS workflow attributes; durable_runs shrinks - #3
Closed
czpython wants to merge 4 commits into
Closed
Conversation
start() stamps {subject_type, subject_id, extension} as DBOS custom
workflow attributes at enqueue (subject_id always a string), so every
runs-for-a-subject query reads workflow_status itself through one
EXISTS predicate (subject_filter). The subject, extension, and input
columns leave durable_runs; the row keeps only the facts DBOS has no
slot for: the gate ask, failure, and timestamps.
Events and signals take subject/extension from the workflow's own
arguments (replay-deterministic), the park notification receives the
subject from the parking workflow, and the transcript-files route names
its own mount instead of reading the run's stamp. The migration runs
DBOS's system migrations first so the attributes backfill from
durable_runs always has its column, whatever the host booted last.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every host already runs dbos 2.26, so the attributes column exists before this history does, and runs predating the deploy stay unkeyed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Run.list_for_subject grows a kind filter; build's newest-scope lookup and Scope.parked_for compose it instead of importing the raw subject_filter predicate from the durable engine. Per (kind, subject) the queue dedup makes runs strictly sequential, so newest-first holds within a kind and at most one run is parked. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Folded into #4, which now targets main and carries this branch's commits verbatim (subject keying via DBOS attributes) plus the extension-as-class-identity work that removes the per-run extension entirely. Review history stays here; nothing from this branch lands separately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Runs are keyed to their subject through DBOS custom workflow attributes instead of druks-owned columns.
Workflow.start()wraps the enqueue inSetWorkflowAttributes({subject_type, subject_id, extension})—subject_idalways stamped as a string, the one shape every reader compares. Scheduled framework crons stay attribute-less (subjectless by design).Run.list_for_subject,AgentCall.list_for_subject) filter through one internalsubject_filterEXISTS predicate onworkflow_status.attributes.AgentCall.list_for_subjectno longer touchesdurable_runsat all. The predicate takes a fresh alias per call, so it stays independent of thestate/updated_atscalar subqueries (which claim the bare table viacorrelate_except).Run.list_for_subjectgrows akindfilter, and build's newest-scope lookup andScope.parked_forcompose it — no engine-internal imports in extension code.durable_runsshrinks:subject,extension, andinputcolumns are gone. The row keeps only the facts DBOS has no slot for — the gate ask triple,failure/failure_code,kind,created_at. (inputhad zero readers; DBOS keeps its own copy of workflow arguments for recovery.)No wire changes:
RunResponsenever carried subject, extension, or input.Migration
Drops the three columns, nothing else — every host already runs dbos 2.26, so
workflow_status.attributesexists. Runs started before this deploy carry no attributes and drop out of subject timelines; new runs key themselves at start().Operational note: DBOS
workflow_statusGC/retention must stay off — a purged workflow row now also unkeys its run's timeline, not just its derived state.Tests
seed_dbos_statusstamps attributes (the shapestart()writes); every seeding suite moved its subject/extension keying there.test_durable_sdk: a subjected start through the live DBOS enqueue lands{"subject_type", "subject_id"}onworkflow_status.attributes, id normalized to string.Run.inputwrite-shape pin is replaced by asserting the input round-trips into the body through DBOS's checkpointed arguments.🤖 Generated with Claude Code