WeKnora/internal
Ankit Jha 0b4cd706c2 fix(knowledge): stop synthesizing never-run stages as failed
Closes #3452.

buildSpanTree fills every canonical stage that has no span row using a
status inferred from knowledge.parse_status, so a failed parse painted
all of them "failed". That status carries information it cannot know:
it cannot tell "this stage ran and failed" from "this stage never ran".

The frontend picks the focused stage with the first failed one in
canonical order, so whenever the real failure left an earlier stage
rowless, the UI named the earlier stage. On main today a text passage is
chunked without ever opening a docreader stage, so an embedding failure
reports 文档解析 / docreader as the broken step for content that has no
document to parse, and four of five segments render as failures.

Once a stage has actually recorded a failure its position is known, so
missing stages are now resolved against it:

- downstream of the failure, per StageDependencies or canonical order →
  cancelled, which is what the status is documented to mean
- before it → skipped; the stage either did not apply or its row was
  never written, and neither of those is a failure

With no failed row anywhere the parse_status fallback stands unchanged,
which is the case it was written for: legacy knowledge parsed before
span tracking existed still renders done/failed rather than five pending
segments.

Also maps parse_status "cancelled" to a cancelled placeholder; it fell
through the switch to pending, so a cancelled document showed spinners
on the stages it never reached.

The DAG walk is redundant with canonical order for today's stage list,
where every dependency points at an earlier stage. It is there so the
answer stays right if the list is reordered or a stage gains an upstream
that is not its predecessor.

No frontend change: skipped and cancelled already render, with localized
labels in every locale.
2026-09-22 18:04:32 +08:00
..
agent fix(skill): count create-time sandbox env vars in the required check 2026-09-22 16:45:58 +08:00
application fix: satisfy revive unused-parameter and gofumpt in #3493 review findings 2026-09-22 17:52:49 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
browserskill fix(browserskill): release connection capacity when members disconnect 2026-09-21 23:03:11 +08:00
common fix(markdown): sanitize invalid UTF-8 and NUL bytes 2026-08-31 12:24:35 +08:00
config feat(knowledge): derive knowledge base descriptions from document profiles (#3370) 2026-09-17 22:21:55 +08:00
container fix(container): wire shared agent lookup for MCP handler 2026-09-21 14:38:54 +08:00
database fix(sandbox): resolve a session's pinned sandbox in the workspace that owns it (#3471) 2026-09-21 15:38:39 +08:00
datasource fix(ima): traverse subfolders using list response media IDs 2026-09-19 22:42:57 +08:00
embedpolicy fix(embed): enforce host origin allowlists on framed pages 2026-09-14 18:03:57 +08:00
errors feat(agent): keep long sandbox turns from truncating, overflowing, or rewriting files 2026-09-02 22:09:09 +08:00
event fix(agent): end the turn when the completion cap truncates an answer (#3449) 2026-09-20 13:17:50 +08:00
filetransport refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
handler fix(knowledge): stop synthesizing never-run stages as failed 2026-09-22 18:04:32 +08:00
im test(im): close the lifecycle test database and keep its name unique (#3433) 2026-09-20 11:24:28 +08:00
infrastructure fix(parser): keep PDFs on builtin instead of defaulting to anydoc 2026-09-21 16:28:02 +08:00
ipclass fix: align client sessions and integration request handling (#3305) 2026-09-16 16:20:57 +08:00
localsandbox feat(localsandbox): add host OS sandbox core and macOS Seatbelt backend (#3472) 2026-09-21 13:24:05 +08:00
logger fix(sandbox): record product-level Langfuse spans and detach idle sweeps 2026-08-31 19:42:32 +08:00
mcp fix: align client sessions and integration request handling (#3305) 2026-09-16 16:20:57 +08:00
mcpserver refactor(agent): consolidate knowledge retrieval tools into search_knowledge, read_document, list_documents (#3381) 2026-09-18 14:12:22 +08:00
middleware fix(upload): clean multipart temporary files 2026-09-22 17:40:56 +08:00
modelcontext refactor(models): rebuild vendor integration on protocol + catalog + vendor layers (#3470) 2026-09-20 21:28:23 +08:00
models test(rerank): pin every vendor's request, and correct three facts the table surfaced (#3513) 2026-09-21 20:01:09 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router fix(upload): clean multipart temporary files 2026-09-22 17:40:56 +08:00
runtime fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
sandbox feat(session): in-place rewind with workspace checkpoint reset (#3469) 2026-09-20 21:01:00 +08:00
searchutil fix: satisfy revive unused-parameter and gofumpt in #3493 review findings 2026-09-22 17:52:49 +08:00
storageallowlist fix(storage): align default provider fallback with STORAGE_ALLOW_LIST 2026-07-15 11:05:00 +08:00
storageurl refactor(resource-access): unify scoped authorization and transfer recovery (#3097) 2026-09-08 15:36:33 +08:00
stream feat(session): in-place rewind with workspace checkpoint reset (#3469) 2026-09-20 21:01:00 +08:00
textconv fix: remove GPL converter and bundle third-party license sources 2026-09-08 15:19:10 +08:00
tracing/langfuse fix(milvus): preserve keyword retrieval scores 2026-09-17 11:59:40 +08:00
types fix(knowledge): bind extracted images to their document and unscope shared-KB parent lookups 2026-09-22 17:52:49 +08:00
utils refactor(asr): move the wire format into protocol packages, and cover every vendor whose docs offer ASR (#3503) 2026-09-21 13:25:27 +08:00