Commit Graph

218 Commits

Author SHA1 Message Date
FFXN
9006e110ed fix(knowledge-import): handle temporary policy-write fence for website source imports 2026-09-07 18:07:34 +08:00
FFXN
d60245efb9 fix(website-import): add replaceExistingSelection flag to crawl import payload 2026-09-07 16:50:04 +08:00
FFXN
fe09388e21 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge 2026-09-07 15:38:45 +08:00
FFXN
f7f74c8c35 fix(website-import): ensure proper handling of replacement selections and reconcile inventory 2026-09-07 15:37:43 +08:00
Jyong
4e17182fc2 feat(agent): enable autonomous KnowledgeFS CLI access 2026-09-07 03:32:33 -04:00
FFXN
30ad3801d2 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-09-07 11:40:38 +08:00
FFXN
33f5d6a065 fix(knowledge-fs): sync latest website selection without self-fencing deletions 2026-09-07 11:35:56 +08:00
Jyong
24db4f5af9 fix(knowledge-fs): bound document parsing and isolate resource-heavy work 2026-09-05 23:42:16 -04:00
FFXN
87df76637b fix(knowledge-fs): recover website import workflows and log scheduler failures` 2026-09-04 23:35:24 +08:00
FFXN
90dd7fa894 fix(knowledge-fs): propagate preview capability to crawl import 2026-09-04 21:09:44 +08:00
FFXN
a94adda138 Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-09-04 19:55:44 +08:00
FFXN
587efac57d 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:49:19 +08:00
Stephen Zhou
6aba69326e
fix(knowledge-fs): show v2 workflow citations 2026-09-04 19:21:59 +08:00
FFXN
0f38780115 fix(knowledge-fs): authenticate namespace source preview routes 2026-09-04 18:41:06 +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
c6b2978f6e Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge
# Conflicts:
#	api/knowledge-fs-contract.lock.json
2026-09-04 16:56:11 +08:00
Stephen Zhou
876aab708e
fix(knowledge-fs): track workflow retrieval outcomes 2026-09-04 16:50:09 +08:00
FFXN
ad059f55d4 feat(knowledge-fs): add namespace preview for initial website sources
- create website preview jobs before a knowledge space exists
- persist crawled page content in KnowledgeFS object storage
- import selected pages using preview job and page IDs
- validate preview ownership, expiry, and configuration fingerprint
- clean up preview content after cancellation, expiry, or consumption
- add namespace preview routes, capabilities, migrations, and contracts
- keep online document and drive flows unchanged
2026-09-04 15:52:36 +08:00
Stephen Zhou
9d3afb37ca
fix(knowledge-fs): classify threshold-filtered queries 2026-09-04 12:12:58 +08:00
FFXN
7262dc51be Merge remote-tracking branch 'origin/deploy/konwledge' into deploy/konwledge 2026-09-04 11:52:57 +08:00
FFXN
448fd92f6d fix: expose active import workflows as source sync status 2026-09-04 11:52:41 +08:00
Stephen Zhou
b8d39bec5f
fix(knowledge-fs): persist durable query outcomes 2026-09-04 11:43:04 +08:00
FFXN
f12c230689 fix(llm-semantic-chunker): revert default max output tokens from 8000 to 6000 2026-09-03 22:57:14 +08:00
FFXN
cc8a89cdf7 fix(llm-semantic-chunker): increase default max output tokens from 6000 to 8000 2026-09-03 22:18:06 +08:00
FFXN
b904fbe066 fix(knowledge-fs): handle unknown unit ID errors with LlmSemanticChunkingOutputError 2026-09-03 22:11:17 +08:00
FFXN
b7b8367234 feat(knowledge-fs): add content handling for initial source preview and cleanup tasks 2026-09-03 21:09:44 +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
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