Repository navigation
Step State: propagate step result State to later steps (#346) - #350
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steps publish State under their step name; later steps read it as State.<StepName>.<Key> in Preconditions and in With templates. - Catalog: optional StateSchema (same key schema as WithSchema, InvalidStateSchema). Handler State is validated against it and must not contain ScriptBlocks, PSCredential or SecureString. - Planning: With strings with State placeholders stay unresolved and are recorded in PlanStep.DeferredWith with their key schema; references are validated (StateReferenceNotAllowed/Invalid/UnknownStep/Ambiguous/ NotDeclared). Condition cannot use State. - Execution: completed steps publish a data-only copy; Preconditions get the State root; deferred strings are resolved once against Request and State before the step runs (StateReferenceUnresolved on missing values). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mple (#346) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Verdict: PASS The PR adds step State propagation with schema validation, reference checks at planning time, and deferred Findings: none that I could tie to a concrete line. Scope of this review: I read the PR metadata, the file list and |
Code Coverage Report
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45a0687e50
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Verdict: PASS No CRITICAL findings found. I read the PR description, the changed-file list and the deferred- Findings:
|
Summary
Steps publish
Stateunder their step name; later steps read it asState.<StepName>.<Key>inPreconditionand inWithtemplates. Design was folded intodocs/extend/steps.md(section Step State).Catalog
StateSchema(same key schema asWithSchema); invalid schemas fail at catalog load (InvalidStateSchema).Stateis validated against it (InvalidStepHandlerResult): undeclared keys, missing required keys, ScriptBlocks,PSCredential/SecureString. A step withoutStateSchemamust not returnState.Planning
Withstrings with{{State...}}stay unresolved in the plan (and plan export) and are recorded inPlanStep.DeferredWith(path, segments, key schema). TheirRequestplaceholders must resolve at planning time.StateReferenceNotAllowed(Condition,Provider/AuthSessionName/AuthSessionOptions),StateReferenceInvalid(name not an identifier),StateReferenceUnknownStep(producer does not run earlier),StateReferenceAmbiguous(name in bothStepsandOnFailureSteps),StateReferenceNotDeclared.Execution
NotApplicable/PreconditionSkipped/Blocked/Failedpublish nothing.OnFailureStepssee State of completed steps.Stateroot (missing producer →$null, useExists).RequestandStateright before the step; then validated against the stored key schema. Missing values fail the step (StateReferenceUnresolved). Request values are never re-scanned for templates (no injection).Steps / examples / docs
IdLE.Step.Mailbox.GetInfodeclaresStateSchema = @{ Keys = @{ Mailbox = ... } }.exo-leaver.psd1usesState.GetMailboxInfo.Mailboxin a Precondition (convert only user/shared mailboxes) and in the completion message.steps.md,preconditions.md,templates.md,conditions.md,security.md.Breaking changes
StatewithoutStateSchemanow fails (InvalidStepHandlerResult). OnlyMailbox.GetInforeturned State; it declaresStateSchemanow.Statemust be identifiers.Testing
tests/Core/StepState.Tests.ps1(catalog, planning validation, execution, handler result validation, failed/missing producer, ScriptBlock and credential rejection, no template injection from request data).examples/workflows/templates/exo-leaver.psd1with a mock EXO provider../tools/Invoke-IdlePesterTests.ps1: 1067 passed, 0 failed../tools/Invoke-IdleScriptAnalyzer.ps1: no findings.Known limitation (pre-existing):
Resolve-IdleWorkflowTemplatesflattens nested arrays, so a State template inside a nested array inWithcould get a shifted index.Closes #346
🤖 Generated with Claude Code