Skip to content

fix(ai): solution_design no longer models a process/approval as a table#1570

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/solution-design-process-guardrail
Jun 3, 2026
Merged

fix(ai): solution_design no longer models a process/approval as a table#1570
xuyushun441-sys merged 1 commit into
mainfrom
feat/solution-design-process-guardrail

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

The bug (root cause of the original report)

Asking the assistant "帮我设计费用报销 / design expense reimbursement" made it, by default, create an 审批记录 / approval_record table 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 a select field + 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

  1. propose_blueprint generation prompt (the "metadata architect" system message that actually emits the objects):

    • status / lifecycle → a single select field, never a table;
    • MUST NOT create approval / approval_record / approval_step / workflow / process objects — a process is a flow, its trail comes from platform history;
    • the people a process references (approver / reviewer / owner) → lookup fields;
    • if the goal implies a process, add an assumption that the approval flow is a separate step.
  2. solution_design skill instructions: the same modeling rules, plus — when the goal involves a process — the agent now proactively drafts the approval flow after apply_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". Optional state_machine rule 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).
  • Full service-ai suite 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

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 3, 2026 11:43am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/s labels Jun 3, 2026
@xuyushun441-sys xuyushun441-sys merged commit 4705fb8 into main Jun 3, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/solution-design-process-guardrail branch June 3, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants