Commit Graph

224 Commits

Author SHA1 Message Date
FFXN
484adb3cfa fix(knowledge-fs): recover website import workflows and log scheduler failures` 2026-09-04 23:36:45 +08:00
FFXN
74c702a5ab fix(api): fix CI 2026-09-04 22:30:00 +08:00
FFXN
9f52da1a4d fix(knowledge-fs): retry transient embeddings and recover website source state 2026-09-04 22:07:30 +08:00
FFXN
90dd7fa894 fix(knowledge-fs): propagate preview capability to crawl import 2026-09-04 21:09:44 +08:00
FFXN
244226b4da fix(knowledge-fs): harden website preview lifecycle
- prevent preview cancellation during knowledge base creation handoff
- serialize preview scheduler ticks and handle timer failures
- prevent cleanup jobs from starving queued previews
- pass workflow page content through object storage references
2026-09-04 19:56:04 +08:00
Stephen Zhou
6aba69326e
fix(knowledge-fs): show v2 workflow citations 2026-09-04 19:21:59 +08:00
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
FFXN
397cc2d7cc fix(knowledge-fs): add namespace source preview jobs and pages schema 2026-09-04 17:23:56 +08:00
FFXN
3171b69984 feat(knowledge-fs): fix CI. 2026-09-04 16:56:21 +08:00
Stephen Zhou
876aab708e
fix(knowledge-fs): track workflow retrieval outcomes 2026-09-04 16:50:09 +08:00
Stephen Zhou
7fba0afc91
fix(knowledge-fs): refresh contract lock 2026-09-04 12:50:27 +08:00
FFXN
0361ee6a8b fix: expose active import workflows as source sync status 2026-09-04 11:53:35 +08:00
FFXN
448fd92f6d fix: expose active import workflows as source sync status 2026-09-04 11:52:41 +08:00
FFXN
7ca5eaab97 fix(llm-semantic-chunker): revert default max output tokens from 8000 to 6000 2026-09-03 22:57:44 +08:00
FFXN
8c0f8e7113 fix(llm-semantic-chunker): increase default max output tokens from 6000 to 8000 2026-09-03 22:18:16 +08:00
FFXN
85ac5a79c7 fix(knowledge-fs): handle unknown unit ID errors with LlmSemanticChunkingOutputError 2026-09-03 22:11:26 +08:00
FFXN
bbde5fab52 fix(knowledge-fs): update content handling to use KnowledgeFSCrawlImportPagePayload and add cleanup tests 2026-09-03 21:31:00 +08:00
FFXN
06cd47807c feat(knowledge-fs): add content handling for initial source preview and cleanup tasks 2026-09-03 21:01:21 +08:00
FFXN
43d50ce021 feat(knowledge-fs): enhance capability grant admission middleware with deletion handling options 2026-09-03 18:55:37 +08:00
FFXN
25277f66d6 fix(knowledge-fs): harden semantic chunking and deletion cleanup
- retry semantic chunking when the LLM returns an invalid schema
- add corrective schema instructions to retry prompts
- remove capability grant foreign keys from durable deletion records
- preserve capability grant IDs as immutable audit provenance
- add migration and regression coverage
2026-09-03 17:00:17 +08:00
FFXN
239dedba48 fix(knowledge-fs): enhance website crawl handling with support for exact page fetching 2026-09-03 16:20:42 +08:00
Jyong
c8aa2d4f59 feat(knowledge-fs): report specific, actionable background task failures
Every document-processing failure surfaced as "the document could not be
processed", and every data-source failure as "the source could not be read",
because the root cause was erased at three points: the compilation classifier
collapsed any coded-but-non-retryable error into DOCUMENT_COMPILATION_FAILED,
datasource runtime errors were reduced to per-operation constants, and the
console mapped dozens of codes onto a handful of generic sentences without the
stage or a support reference.

- knowledge-fs: keep the specific public code for any coded error in the
  compilation classifier (retry follows the error or the catalog policy), tag
  previously uncoded failures (semantic chunking output, embedding dimension,
  PDF rendering, lease loss, generation model, unsupported file type) with
  public codes, give embedding provider errors their own codes instead of the
  parser's, alias datasource runtime codes, and register 17 catalog entries
  (model response invalid, parser unsupported type, PDF render, crawl page
  not found, provider timeout/unavailable/rejected, content too large, ...).
- api: extend the public error-code enum (including the missing
  DOCUMENT_PARSER_TIMEOUT) and regenerate the contracts.
- web: per-code copy that says what happened and what to do, in all 24
  locales, plus a "failed while <stage> · reference <id>" line under each
  failed task in the background-task drawer and the document task list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-03 03:09:29 -04:00
Jyong
4d71c4a83a fix(knowledge-fs): allow one unresolved bad case per retrieval trace
A retrieval test record could be flagged as a bad case any number of times,
piling duplicate open cases onto the quality page. Refuse to file another bad
case while the trace already has one that is open or replaying, and let the
retrieval test page know about it.

- knowledge-fs: `createBadCase` looks up an unresolved case for the trace
  inside its transaction and throws `QualityBadCaseAlreadyOpenError`; the
  create route answers 409 with `QUALITY_BAD_CASE_ALREADY_OPEN`. Quality trace
  list items expose `openBadCaseId`.
- api: pass `open_bad_case_id` through the console trace response;
  regenerate the contracts.
- web: show the saved-as-bad-case state instead of the flag action when the
  selected trace already has an unresolved case, treat a 409 on flagging the
  same way, and refresh the history so the state follows the server.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-03 01:40:11 -04:00
Stephen Zhou
af7f2b75b3
fix(knowledge-fs): refresh contract subtree lock 2026-09-03 12:03:14 +08:00
Stephen Zhou
299cf4f45a
fix(knowledge-fs): refresh contract subtree lock 2026-09-02 22:28:11 +08:00
Jyong
afa771dcac feat(knowledge-fs): keep query images with retrieval test history
Query images attached to a retrieval test vanished as soon as the run's
history record was selected, and were never shown again after a reload,
because nothing persisted them: the gateway dropped `queryImages` when writing
`answer_traces`, the console trace/research responses had no image field, and
the composer cleared its images on every record selection.

- knowledge-fs: add a nullable JSON `query_images` column to `answer_traces`
  (migration 0049 for postgres and tidb), persist and read it in the answer
  trace repository, and expose `queryImages` on quality trace list items.
- api: enrich trace and research task responses with
  `KnowledgeFSQueryImageResponse`, resolving file names and short-lived signed
  preview URLs only for files the acting account still owns; regenerate the
  console and service contracts.
- web: keep composer images scoped to the selected record like the query
  text, remember images per run in this session, fall back to persisted
  previews (with a labelled placeholder when the file is gone), show them in
  the result panel and as a count on history records, and carry them into
  retests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-02 09:17:36 -04:00
Stephen Zhou
2b16c5baf1
fix(knowledge-fs): refresh contract subtree lock 2026-09-02 20:33:15 +08:00
FFXN
46c345401f fix(knowledge-fs): cap object-list page size and enforce entity name length limits 2026-09-02 19:18:18 +08:00
FFXN
567f4f5ab4 fix(knowledge-fs): enhance source import handling and error recovery for remote updates 2026-09-02 18:38:38 +08:00
FFXN
9dd7e3f5f8 fix(knowledge-fs): repair sync policy version handling to accommodate concurrent updates 2026-09-02 18:07:57 +08:00
Jyong
049a4c514e fix(knowledge-fs): show task object titles 2026-09-02 01:43:16 -04:00
Jyong
222d09f474 feat(knowledge-fs): add profile-driven multimodal retrieval 2026-09-02 01:01:57 -04:00
FFXN
b55ec59d37 fix(knowledge-fs): handle source selection mismatch and improve error handling, make source selection replacement durable. 2026-09-02 12:56:37 +08:00
Jyong
a15ca672a1 fix(knowledge-fs): align retrieval test timeout 2026-09-01 13:51:15 -04:00
Jyong
2ad192fce7 fix(knowledge-fs): harden research retrieval execution 2026-09-01 13:26:43 -04:00
FFXN
66a93d5dfb fix(knowledge-fs): update subtreeTree hash in lock file 2026-09-01 20:17:51 +08:00
FFXN
2e6af36f77 fix(knowledge-fs): ensure balanced parentheses in SQL query for document retrieval 2026-09-01 20:02:36 +08:00
FFXN
aff51ae6f3 fix(knowledge-fs): retry source selection CAS conflicts and log workflow errors 2026-09-01 19:32:54 +08:00
Jyong
dbcc3a11e5 fix(knowledge-fs): type retrieval lease clock 2026-09-01 05:37:51 -04:00
Jyong
7876f6e670 fix(knowledge-fs): scope child deletion conflicts 2026-09-01 05:18:38 -04:00
Jyong
4f3a2952d6 perf(knowledge-fs): harden cross-format document ingestion 2026-08-31 07:48:35 -04:00
FFXN
2bcfc139c3 fix(knowledge-fs): add SOURCE_DOCUMENT_COMPILATION_FAILED error code and update DTOs 2026-08-31 18:19:23 +08:00
Stephen Zhou
9abfd110cc
fix(knowledge-fs): refresh contract subtree lock 2026-08-31 13:08:59 +08:00
Jyong
b2aff3432c fix(knowledge): preserve traces with deleted evidence 2026-08-30 23:16:37 -04:00
FFXN
d23b9229db feat(knowledge-fs): enhance source update payload with selection and sync policy validation 2026-08-31 00:00:37 +08:00
Stephen Zhou
0fd0122400
fix(knowledge-fs): refresh contract subtree lock 2026-08-30 23:53:18 +08:00
FFXN
72461af522 feat(knowledge-fs): support source config updates and deferred sync
- allow updating mutable source configuration fields
- enqueue sync after active business configuration changes
- pause scheduled sync while a source is disabled
- preserve and rebind sync policies across source version updates
- support website, online document, and online drive sources
2026-08-30 22:12:21 +08:00
Stephen Zhou
adf650cc83
fix(knowledge-fs): refresh contract subtree lock 2026-08-30 22:08:44 +08:00
FFXN
7a16aaf0a1 fix(knowledge-fs): add rebase functionality for publication head revision and enhance error handling 2026-08-28 15:56:09 +08:00
FFXN
1212b92bf1 fix(knowledge-fs): remove provider mode from sync policies and update related constraints 2026-08-28 15:08:11 +08:00