Uh oh!
There was an error while loading. Please reload this page.
feat(workflow-executor): add AI-assisted and Full AI execution to the guidance step (PRD-148 pattern, PRD-18) - #1741
Conversation
2 new issues
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (3)
🛟 Help
|
720c832 to
492febcCompareUh oh!
There was an error while loading. Please reload this page.
492febc to
cd8665fCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cd8665f to
bb1f84fComparehercemer42
commented
Jul 9, 2026
Follow-up: the context gap is a PRD-148 degrade-safety violation, not just a missing fieldThe context gap reported above (guidance AI never receives the trigger record) breaks a core, product-signed-off rule of the PRD-148 pattern this PR is built on:
PRD-148 makes this explicit for Load Related Record:
Guidance has no equivalent guard. With no record in context, Full AI has nothing to ground "the account holder's first and last name" on — yet it auto-commits an ungrounded draft ( Suggested guidance AC (mirroring PRD-148):
LRR's "can't ground" triggers are crisp (empty candidate list / no source record). Guidance is free-text so "can't ground" is fuzzier to detect, but the operator-name substitution shows the risk is real and currently unguarded. |
hercemer42
commented
Jul 9, 2026
Test-coverage note: the grounding bug is invisible to the unit suiteThe guidance executor suite ( The gap is the single test that inspects what's actually sent to the model — "sends the step prompt and workflow context to the AI" (L230). It asserts only the prompt: constallContent=messages.map(m=>m.content).join('\n');expect(allContent).toContain('Summarize the customer situation');It runs on a mocked context and never asserts the trigger record (id / field values) is in Suggested regression guard (add with the context fix): assert the trigger record reaches the AI, e.g. expect(allContent).toContain(triggerRecord.id);// or a known field valueToday that assertion fails — which is the point: it pins the fix and prevents silent regression of context completeness. Without it, a green suite gives false confidence about response grounding. |
bb1f84f to
84e5770CompareScra3
commented
Jul 10, 2026
Thanks for the thorough end-to-end catch — this was a real gap. Addressed in 1. Context gap (grounding) — fixed. 3. Test gap — fixed. Added 2. Degrade-safety — intentional product divergence, not an oversight. Full AI guidance auto-submitting with no low-confidence degrade is a signed-off product decision (Brice, on PRD-18): unlike Load Related Record (a record pick with hard downstream consequences and a crisp "can't ground" signal — empty candidate list / no source), guidance is free-text generation where "can't ground" isn't reliably detectable. The decision was: Full AI guidance always submits; the safety net is the default being AI-assisted (human review) + the AI-failure→Manual degrade, not a confidence gate. The reported failure was really the missing record (now fixed) + the prompt already instructing "use only facts in context, never invent names". I'd rather not add a heuristic confidence-degrade that contradicts the signed-off call — happy to take it back to product if you think the free-text grounding risk warrants revisiting that decision. Everything else you validated end-to-end (editor modes, persistence, AI-assisted draft/badge/edit, Full AI auto-complete, idempotent re-dispatch) — thanks for the detailed pass. |
84e5770 to
b33e2e4CompareUh oh!
There was an error while loading. Please reload this page.
… 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>
… not JSON-serializable JSON.stringify throws on BigInt values; one such field dropped the entire trigger-record context from the guidance AI prompt. Fall back to String(value) per field instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26f3b10 to
719bfd3Compare
hercemer42
left a comment
There was a problem hiding this comment.
Approving — review threads resolved. Grounding fix verified end-to-end (trigger record now in the AI context; draft names the account holder, not the operator), the regression guard test passes, and the degrade-safety point is product-approved (Brice). Editor modes / persistence / AI-assisted / Full AI / idempotent re-dispatch all validated in a live run.
Uh oh!
There was an error while loading. Please reload this page.
# @forestadmin/workflow-executor [1.16.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/workflow-executor@1.15.0...@forestadmin/workflow-executor@1.16.0) (2026-07-15) ### Features * **workflow-executor:** add AI-assisted and Full AI execution to the guidance step (PRD-148 pattern, PRD-18) ([#1741](#1741)) ([7a5dc1c](7a5dc1c))




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 steps
GuidanceStepExecutornow supports three modes: Manual (unchanged), AutomatedWithConfirmation (AI drafts a response for user review), and FullyAutomated (AI completes the step directly withgeneratedByAi=true).buildTriggerRecordMessages, improving model grounding.pendingData, preventing repeated AI attempts on re-dispatch.GuidanceStepExecutionDatagainsaiGeneratedandgeneratedByAiflags; the guidance summary formatter now attributes AI-generated responses to the AI instead of the operator.BaseStepExecutorgains sharedwithAiAssistandlogAiDegradehelpers, removing duplicated logic fromLoadRelatedRecordStepExecutor.GuidanceStepDefinitionSchemanow rejects invalidexecutionTypevalues instead of coercing them; defaults tomanualwhen the field is absent.Macroscope summarized 719bfd3.