fix(ai): solution_design no longer models a process/approval as a table#1570
Merged
Merged
Conversation
Asking the assistant to "design expense reimbursement" made it invent an
approval_record TABLE by default (process-as-data anti-pattern); it only used a
flow after the user pushed back. Hardens the default:
- propose_blueprint generation prompt: status = select field (never a table);
do NOT create approval/approval_record/approval_step/workflow/process objects
(a process is a flow; trail = platform history); approver/reviewer/owner are
lookup fields; add an assumption that the approval flow is a separate step.
- solution_design skill: same rules + proactively draft the approval flow after
apply_blueprint (get_metadata_schema('flow') -> create_metadata type:flow,
bound to the app package) instead of waiting to be asked; optional
state_machine rule for transitions.
Regression test asserts the guardrail in the skill instructions. service-ai
suite green (480).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
The bug (root cause of the original report)
Asking the assistant "帮我设计费用报销 / design expense reimbursement" made it, by default, create an
审批记录 / approval_recordtable to represent the approval process — a non-functional "process-as-data" anti-pattern (the rows just sit there; nothing drives transitions or routing). It only switched to a flow after the user pushed back. Verified against the live showcase: the first blueprint contained an approval table; after correction the agent modeled status as aselectfield + approver lookups and offered a flow — proving it knows the right pattern, it just didn't use it by default.Fix — make the default correct, in the two places that decide
propose_blueprintgeneration prompt (the "metadata architect" system message that actually emits the objects):selectfield, never a table;approval/approval_record/approval_step/workflow/processobjects — a process is a flow, its trail comes from platform history;lookupfields;assumptionthat the approval flow is a separate step.solution_designskill instructions: the same modeling rules, plus — when the goal involves a process — the agent now proactively drafts the approval flow afterapply_blueprint(get_metadata_schema('flow')→create_metadata(type:'flow', …)with the approval node(s), bound to the same app package) instead of waiting for the user to say "now create the flow". Optionalstate_machinerule to block illegal status transitions.Tests
solution-design-guardrail.test.ts— asserts the skill instructions carry: no-process-as-table, status-as-select, and the proactive-flow step (regression guard).service-aisuite green (480).Independent of the draft/package-lifecycle backend (framework#1569) and the objectui buttons (objectui#1472) — this is the upstream "don't build it wrong in the first place" fix.
🤖 Generated with Claude Code