WeKnora/internal/agent
wizardchen 5d0326f987 fix(wiki): harden slug integrity across ingest and agent write paths
Weak LLMs routinely mangle high-entropy wiki slugs (especially UUID-based
summary/<id> slugs), producing dead cross-links and cross-item dedup
hallucinations. This tightens integrity end to end:

- Ingest dedup now groups each new item with only its own trigram
  candidates and validates merges against that per-item scope, rejecting
  cross-item mispairings; candidate top-K narrowed 20 -> 5.
- Editor path aliases out-link slugs behind low-entropy ref-N tokens and
  translates them back after generation, removing the chance to mangle.
- Agent write tool normalizes/validates slugs, blocks manual creation of
  system-owned summary pages, and auto-repairs dead [[slug]] links
  (rewrite-only, never strips) via bigram/display-text resolution.
- llmresource registry aliases summary/<uuid> slugs the same way as
  storage handles so they round-trip safely through chat.

Adds unit tests for slug validation, aliasing round-trip, dead-link
repair, and dedup rejection rules.
2026-07-24 15:57:08 +08:00
..
approval refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
memory feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
skills feat: adapt preloaded skills to smart-reasoning agent 2026-02-04 20:08:49 +08:00
token feat(agent): enhance message consolidation and context management 2026-03-25 22:08:29 +08:00
tools fix(wiki): harden slug integrity across ingest and agent write paths 2026-07-24 15:57:08 +08:00
act.go feat: scope API MCP OAuth by principal 2026-06-30 20:01:05 +08:00
const.go feat: Implement wiki_config updates in knowledge base management 2026-04-22 21:17:21 +08:00
engine.go feat(agent): add per-agent citation output toggle 2026-07-17 10:19:43 +08:00
engine_image_test.go feat: auto-describe MCP tool result images via VLM 2026-03-25 21:38:15 +08:00
engine_test.go feat(agent): add per-agent citation output toggle 2026-07-17 10:19:43 +08:00
finalize.go feat(agent): add per-agent citation output toggle 2026-07-17 10:19:43 +08:00
finalize_image_requirement_test.go fix(chat): enforce retrieved image output in answers 2026-07-15 18:10:31 +08:00
image_requirement.go fix(chat): enforce retrieved image output in answers 2026-07-15 18:10:31 +08:00
langfuse_test.go feat(observability): instrument agent ReAct loop and tool calls in Langfuse 2026-04-24 19:58:08 +08:00
observe.go feat(llm): introduce request-local source reference aliases 2026-07-17 10:19:43 +08:00
observe_test.go feat(llm): introduce request-local source reference aliases 2026-07-17 10:19:43 +08:00
prompts.go feat(chat): add @Skill/@MCP mentions with scoped agent runtime 2026-06-29 18:09:44 +08:00
prompts_wiki.go fix(wiki): harden slug integrity across ingest and agent write paths 2026-07-24 15:57:08 +08:00
prompts_wiki_test.go feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
think.go feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00