Commit Graph

192 Commits

Author SHA1 Message Date
FFXN
06cd47807c feat(knowledge-fs): add content handling for initial source preview and cleanup tasks 2026-09-03 21:01:21 +08:00
FFXN
ce5d702c46 feat(knowledge-fs): enhance capability grant admission middleware with deletion handling options 2026-09-03 18:54:43 +08:00
FFXN
644a9b96a6 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 16:59:57 +08:00
FFXN
ad66d2c08a fix(knowledge-fs): update crawl function to accept WebsiteCrawlInput type 2026-09-03 16:31:53 +08:00
FFXN
f51a759e0c Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-09-03 16:20:24 +08:00
FFXN
6d9d388c73 fix(knowledge-fs): enhance website crawl handling with support for exact page fetching 2026-09-03 16:19:47 +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
523844a774
test(knowledge-fs): align migration entrypoint baseline 2026-09-02 21:48:58 +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
Jyong
bf2e9f0781 fix(knowledge-fs): scope research checkpoints by the expanded retrieval query
A Research run with query images retrieves with the user's text joined to the
vision expansion, while the evidence bundle keeps the raw text as `query` and
records the expanded text as `retrievalQuery`. The durable checkpoint validator
compared the bundle's raw `query` against the search state's expanded query, so
every text-plus-image (and image-only) Research task failed with
"Research retrieval durable checkpoint scope mismatch" on its first boundary
and again on every retry. Compare the search state against the query that was
actually retrieved instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-02 09:17:14 -04:00
Stephen Zhou
2f8dd177d3
fix(knowledge-fs): stabilize research result streaming 2026-09-02 20:10:24 +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
2ad192fce7 fix(knowledge-fs): harden research retrieval execution 2026-09-01 13:26:43 -04:00
FFXN
98fb48de18 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge 2026-09-01 20:03:01 +08:00
FFXN
3d5f8b6d2b fix(knowledge-fs): ensure balanced parentheses in SQL query for document retrieval 2026-09-01 20:02:17 +08:00
Stephen Zhou
1dd3775dde
fix(knowledge-fs): use low effort for OpenRouter reasoning 2026-09-01 19:52:20 +08:00
Stephen Zhou
bbfea75857
fix(knowledge-fs): balance lifecycle fence sql 2026-09-01 19:44:10 +08:00
FFXN
9b85d7bead fix(knowledge-fs): retry source selection CAS conflicts and log workflow errors 2026-09-01 19:32:39 +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
f80f30e964 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-08-31 18:13:27 +08:00
FFXN
8c472c217b fix(knowledge-fs): add SOURCE_DOCUMENT_COMPILATION_FAILED error code and update DTOs 2026-08-31 18:12:42 +08:00
Jyong
b2aff3432c fix(knowledge): preserve traces with deleted evidence 2026-08-30 23:16:37 -04:00
FFXN
e7086d5b1a Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-08-31 00:00:26 +08:00
FFXN
949549b9b1 feat(knowledge-fs): enhance source update payload with selection and sync policy validation 2026-08-30 23:58:27 +08:00
Stephen Zhou
e578e55e7b
fix(knowledge-fs): harden long document ingestion 2026-08-30 23:45:22 +08:00
FFXN
ecba1aa779 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-08-30 22:12:01 +08:00
FFXN
52df787444 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:10:12 +08:00
Stephen Zhou
138e810f9c
fix(knowledge-fs): improve Chinese PDF ingestion and retrieval 2026-08-30 22:00:34 +08:00
FFXN
c81cf7e17b fix(knowledge-fs): add rebase functionality for publication head revision and enhance error handling 2026-08-28 15:52:43 +08:00
FFXN
ae495d3f97 fix(knowledge-fs): remove provider mode from sync policies and update related constraints 2026-08-28 14:06:49 +08:00
Stephen Zhou
e5dc72812a
fix(knowledge-fs): support source configuration editing 2026-08-27 23:52:18 +08:00
Jyong
7d1b7f97f0 fix(knowledge-fs): unblock upload completion 2026-08-27 07:24:56 -04:00
Jyong
6702314998 fix(knowledge-fs): scope deletion admission to target 2026-08-27 06:29:09 -04:00
Stephen Zhou
7c3b4aa3c6
fix(knowledge-fs): preserve DOCX image placement 2026-08-27 17:55:02 +08:00
Jyong
42b1be58f3 fix(knowledge-fs): repair document deletion task progress 2026-08-27 04:35:05 -04:00
Jyong
12adc39383 fix(knowledge-fs): preserve spreadsheet image placement 2026-08-27 03:01:57 -04:00
FFXN
9f1b0a445e fix(knowledge-fs): enhance embedding profile migration handling and retry logic 2026-08-27 11:27:12 +08:00
FFXN
3e5febec04 fix(knowledge-fs): implement profile migration projection promotion logic 2026-08-27 10:23:43 +08:00
FFXN
304a06f61d Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge 2026-08-27 09:59:29 +08:00
FFXN
756a3ab4bf fix(knowledge-fs): update projection status to 'building' during profile migration 2026-08-27 09:59:08 +08:00
Jyong
499abe4fca fix(knowledge-fs): segment structured tables by record 2026-08-26 06:38:30 -04:00
Jyong
c195854260 fix(knowledge-fs): bound document compilation memory 2026-08-26 04:51:07 -04:00