feat(workflow-executor): add AI-assisted and Full AI execution to the guidance step (PRD-148 pattern, PRD-18)#1741
Draft
Scra3 wants to merge 1 commit into
Draft
Conversation
1 new issue
|
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (3)
🛟 Help
|
720c832 to
492febc
Compare
… guidance step (PRD-18) Widen GuidanceStepDefinitionSchema to the 3-way execution mode. In AI-assisted the AI pre-fills the free-text response (persisted as pendingData with an aiGenerated flag for the front badge) and the human submits; in Full AI the AI writes and submits automatically (executionResult.generatedByAi). On AI failure or an empty draft the step degrades to Manual (empty field, no auto-skip), and the AI is never re-run on re-dispatch. Hoist withAiAssist + logAiDegrade from LoadRelatedRecordStepExecutor into BaseStepExecutor (2nd consumer), leaving load-related behavior unchanged. Relates to PRD-18. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
492febc to
cd8665f
Compare
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
Adds the 3-way Execution mode (Manual / AI-assisted / Full AI) to the Guidance step. Part of PRD-18 — 3-PR set (executor + `ForestAdmin/forestadmin-server` orchestrator + `ForestAdmin/forestadmin` editor).
automated-with-confirmation) — AI pre-fills the free-text response from the step prompt + workflow context; persisted aspendingData.userInputwith anaiGeneratedflag (drives the front "AI" badge); the human edits/submits.fully-automated) — AI writes and submits automatically (executionResult.userInput+generatedByAi); the response becomes a variable reusable by downstream steps.Degrade / resilience (product-confirmed): on AI failure/timeout, or an empty draft, the step degrades to Manual (empty field,
pendingData: {}) — the run never fails, the step never auto-skips. Full AI always submits on a valid draft (no low-confidence degrade — a text generator, unlike Load Related Record). The AI is never re-run on re-dispatch of the same(runId, stepIndex).withAiAssist+logAiDegradeare hoisted fromLoadRelatedRecordStepExecutorintoBaseStepExecutor(2nd consumer); load-related behavior is unchanged.Tests
Full suite green (1412). Added: Manual never calls AI; submit path never calls AI; AI-assisted pre-fill + badge flag + re-dispatch no-regen + degrade (AI failure / empty draft) + no-retry-after-degrade; Full AI submit + replay + degrade; schema (3-way, no
.catch, rejects unknown); mapper (3 values + default manual). Load-related suite unchanged (hoist is behavior-neutral).Relates to PRD-18.
🤖 Generated with Claude Code
Note
Add AI-assisted and fully automated execution modes to guidance step executor
GuidanceStepExecutornow supports three execution modes:Manualreturnsawaiting-inputunchanged;AutomatedWithConfirmationuses an AI tool-call to draft a response, persists it aspendingData, and pauses for user confirmation;FullyAutomatedpersists the AI response asexecutionResultand completes.BaseStepExecutor.withAiAssisthelper (moved up fromLoadRelatedRecordStepExecutor) that normalizes failures toAiAssistUnavailableError; empty or failed AI drafts degrade to manual by persisting an emptypendingData.GuidanceStepDefinitionSchemanow accepts all three execution modes explicitly and rejects unknown values; missingexecutionTypedefaults toManual.GuidanceStepExecutionDatagains optionalaiGenerated/generatedByAiflags and supports an emptypendingDataobject to signal degrade state.executionTypevalues that were previously coerced toManualwill now be rejected outright.📊 Macroscope summarized 720c832. 6 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.