dify/api/tests
Jyong b79b8a879b feat(knowledge-fs): record and count every knowledge space query
Workflow KnowledgeFS retrieval nodes ran through `retrieval-tests`, which
never wrote an AnswerTrace or an overview event, so their queries were
missing from the retrieval history and from the space overview; the history
also only ever showed each member their own traces.

- AnswerTrace gains a `source` (retrieval_test | workflow | service_api |
  agent | mcp; migration 0051_answer_trace_source) derived from the
  Capability v2 caller kind. The retrieval-tests route records one trace per
  run (stages, evidence bundle, profile metadata), returns its id as
  `answerTraceId`, and the workflow node's failed-retrieval capture attaches
  to that trace instead of creating a second record.
- The quality trace list exposes and filters by `source`; traces from other
  caller kinds are visible to any current reader of the space, and counts and
  scores fall back to the evidence embedded in the trace when no bundle row
  exists.
- Overview accounting: retrieval-tests and Research tasks now emit
  `query.requested`, and the Research job state machine emits
  `query.completed` / `query.failed` on terminal stages (wired for both the
  in-process gateway and the durable runtime), so query volume, answer rate
  and outcomes include every caller. Activity details keep `source` and
  `taskKind`.
- Console and service trace routes accept a `source` filter; the retrieval
  test page shows a source badge and an all / retrieval tests / workflow
  filter, with translations for every locale.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-04 05:48:17 -04:00
..
fixtures/workflow Implement the requested changes across the application 2026-08-09 22:40:48 -04:00
helpers chore: port isinstance to match case (#37271) 2026-06-18 00:18:03 +00:00
integration_tests fix(api): raise Socket.IO max_http_buffer_size for large workflows (#41347) 2026-08-27 11:48:42 +00:00
test_containers_integration_tests Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-03 16:32:30 +08:00
unit_tests feat(knowledge-fs): record and count every knowledge space query 2026-09-04 05:48:17 -04:00
__init__.py refactor: move vdb implementations to workspaces (#34900) 2026-04-13 08:56:43 +00:00
conftest.py refactor(workflow-file): move core.file to core.workflow.file (#32252) 2026-02-16 22:38:19 +08:00
pytest_dify.py test(api): manage backend pytest services natively (#36235) 2026-05-19 07:52:15 +00:00
seed_legacy_model_type_dirty_data.py feat(api): introduce model-type migration script (#36520) 2026-05-27 02:12:11 +00:00
workflow_test_utils.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00