Files
dify/api/controllers
Yansong Zhang ba8ddff696 feat(api): composer slash validations — human must be referenced + knowledge placeholder — ENG-617
Hard rule (PRD: human involvement must be slash-referenced or save errors):
every configured human contact must appear as {{#human:<id>#}} in its surface's
prompt (matched via any identity alias: id/contact_id/human_id/email/name;
identity-less contacts are skipped). Error code human_involvement_not_referenced,
enforced on both the agent soul prompt and the workflow job prompt.

Soft findings (never block save), returned by validate and attached to save
responses as `validation`:
- knowledge_retrieval_placeholder: dangling {{#knowledge:<id>#}} mentions (not
  in config, or configured-but-deleted in DB) are kept with a placeholder name
  (mention label, fallback "Knowledge <id8>") per the 0522 consensus, instead of
  being dropped or rejected; knowledge not referenced is fine.
- mention_target_missing: skill/file/tool/cli_tool/human/node_output/output
  mentions whose id resolves to no configured item.
- mention_malformed: mention-shaped markers the strict grammar rejects
  (degraded to plain text at runtime by the scrub pass).

Response models gain warnings/knowledge_retrieval_placeholder (validate) and
validation (save); validate endpoints now resolve dataset existence via the
tenant-scoped dataset lookup.

Design: Confluence 490012681 §5. Depends on the ENG-616 mention contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 14:51:31 +08:00
..
2026-04-16 08:50:02 +00:00