feat(workflow-executor): PRD-551 apply deterministic Load Related Record config (revise-safe)#1687
Open
Scra3 wants to merge 3 commits into
Open
feat(workflow-executor): PRD-551 apply deterministic Load Related Record config (revise-safe)#1687Scra3 wants to merge 3 commits into
Scra3 wants to merge 3 commits into
Conversation
…ig (revise-safe) - Forward preRecordedArgs from the orchestrator wire through the step-definition mapper (it was dropped) and the ServerWorkflowTaskLoadRelatedRecord type. - Resolve the "Related to" source revise-safely: match a previous load-related step on its own stepIndex OR originalStepIndex (mirrors resolveStepExecution), plus the workflow-start record — instead of a strict own-index match on the flattened pool, which wrongly reported a valid chained source as missing after a revise. - Remove selectedRecordIndex (index-based record pinning): brittle, not revise-safe, unused — the final record stays AI-suggested + user-confirmed. fixes PRD-551 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 new issue
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (3)
🛟 Help
|
…not runtime index The "Related to" source is now referenced by the source step's stable BPMN step id (selectedRecordStepId) or the WORKFLOW_START_STEP_ID sentinel, instead of the runtime stepIndex. This is knowable by the editor at build time (the runtime index is not) and survives revisions by construction (clones keep their step id), so the own→originalStepIndex index juggling is gone. In a loop the most recent live-path occurrence wins. fixes PRD-551 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When the "Related to" source step ran but loaded no record, throw SourceRecordMissingError with a clear user message (naming the source step when available) instead of the generic "pre-configured step parameters are invalid". A config pointing at a non-existent step still throws InvalidPreRecordedArgsError. fixes PRD-551 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Context
Runtime half of the Deterministic Load Related Record epic (PRD-471). The executor must consume the
preRecordedArgsthe orchestrator now sends (PRD-548) and resolve the source record + relation deterministically.What
preRecordedArgsfrom the orchestrator wire: it was silently dropped bystep-definition-mapper(onlyprompt/executionType/titlewere mapped). Added toServerWorkflowTaskLoadRelatedRecord+ the mapper.resolveSourceRecordRefmatches a previous load-related step on its ownstepIndexororiginalStepIndex(mirrorsresolveStepExecution/getAvailableRecordRefs), plus the workflow-start record. The previous strict own-index match on the flattened pool reported a valid chained source as "no source record" after a revise.selectedRecordIndex(index-based record pinning) from schema/executor/tests: brittle, not revise-safe, unused here. The final record stays AI-suggested + user-confirmed.Scope
Source + relation are pinned; the final record choice remains AI-suggested + user-confirmed (Full AI pinning is PRD-148). Error on deleted relation/collection reuses existing
InvalidPreRecordedArgsError/RelationNotFoundError(dual technical/user message).Tests
80/80 in the load-related suite (added a revise-safety test that fails on the old strict match), 1081/1081 across the package.
fixes PRD-551
🤖 Generated with Claude Code
Note
Replace index-based pinning with stable step-id resolution in
LoadRelatedRecordStepExecutorpreRecordedArgsforLoadRelatedRecordsteps now pins the source record using a stable BPMN step id (selectedRecordStepId) instead of a runtime step index (selectedRecordStepIndex), making recordings revise-safe.WORKFLOW_START_STEP_IDsentinel ('workflow-start') identifies the workflow's base/trigger record as the source.SourceRecordMissingErroris thrown when the referenced source step ran but loaded no record.selectedRecordStepIndexorselectedRecordIndexfields will fail schema validation and must be migrated toselectedRecordStepId.Macroscope summarized ed69e2b.