feat(workflow-executor): pin Trigger Action source by stable step id (PRD-469)#1691
Open
Scra3 wants to merge 1 commit into
Conversation
…(PRD-469) The trigger-action executor resolved its source record by a runtime selectedRecordStepIndex, which breaks on revise. Switch to the stable selectedRecordStepId standardized by Load Related Record (revise-safe BPMN step id, or the workflow-start sentinel). - step-definition: TriggerAction preRecordedArgs uses selectedRecordStepId - lift resolveSourceRecordRef from load-related into the shared RecordStepExecutor base (second caller → extract); load-related now inherits it - trigger-action: deterministic source via stable id; source step that loaded nothing → SourceRecordMissingError (no AI fallback, no action triggered) - legacy steps (no selectedRecordStepId) keep AI record selection - generalize SourceRecordMissingError wording (shared by both step types) fixes PRD-598 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (3)
🛟 Help
|
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
Executor side of the Deterministic Trigger Action epic (PRD-469). The trigger-action executor resolved its source record by a runtime
selectedRecordStepIndex(breaks on revise). Migrate to the stableselectedRecordStepIdstandardized by Load Related Record.Changes
step-definition:TriggerAction.preRecordedArgsnow usesselectedRecordStepId(revise-safe BPMN step id /workflow-startsentinel)resolveSourceRecordReffromload-related-record-step-executorinto the sharedRecordStepExecutorbase (trigger-action is now a second caller → extract); load-related inherits itSourceRecordMissingError(no AI fallback, no action triggered)selectedRecordStepId) keep AI record selection;actionNamepinning unchangedSourceRecordMissingErrorwording (shared by load-related + trigger-action)Tests
trigger-action: pinned
workflow-startsource + action → executes without AI (exactexecuteActionargs asserted); pinned source that loaded nothing → error, no action. All 246 executor tests pass.fixes PRD-598
Note
Pin Trigger Action source record by stable step id instead of index
selectedRecordStepIndex(number) withselectedRecordStepId(string) inTriggerActionStepDefinitionSchema.preRecordedArgsto reference a step by its stable BPMN id orWORKFLOW_START_STEP_ID.selectedRecordStepIdis present,TriggerRecordActionStepExecutor.handleFirstCallresolves the source record deterministically via a newresolveSourceRecordRefmethod on the baseRecordStepExecutor, skipping AI-based selection entirely.resolveSourceRecordRefwalks the live execution path to find the latest matchingLoadRelatedRecordstep, returns its loaded record, or throwsSourceRecordMissingErrorif the step loaded nothing.selectedRecordStepIdcontinue to use AI-based selection as before.SourceRecordMissingErrorif the pinned source step exists but loaded no record.Macroscope summarized 3a96144.