Skip to content

feat: evidence-anchor citations and Agent Plugins protocol alignment - #85

Merged
Luhaozhu merged 2 commits into
mainfrom
feat/citation-anchors-plugin-protocol
Aug 12, 2026
Merged

feat: evidence-anchor citations and Agent Plugins protocol alignment#85
Luhaozhu merged 2 commits into
mainfrom
feat/citation-anchors-plugin-protocol

Conversation

@Luhaozhu

Copy link
Copy Markdown
Contributor

Summary

Evidence-anchor citation system

  • Replaces the legacy [ref:tool-N] citation pipeline (orchestration/citations.py) with evidence anchors (orchestration/citation_anchor.py): tool results stamp a cite_id on each citable item, the model writes [anchor text](cite:eN) inline, and the anchor allocator is bound to the agent instance so numbering stays monotonic across turns and subagents.
  • Citations render as capsule-style chips with hover source cards; the old footnote/hyperlink styling and dead citation utilities are removed.
  • IM channels degrade gracefully: anchored text is kept, bare markers are stripped.

Agent Plugins protocol alignment

  • plugin.json now follows the Agent Plugins standard: $schema, structured author object, org.hugagent extensions namespace, and MCP server definitions split into mcp.json.
  • Display metadata (name / category / icon) moves out of plugin.json into admin-side UI configuration, backed by a curated plugin icon library and icon picker.

Supporting changes

  • System prompt formatting guidance rewritten for the new citation style.
  • Docs updated: document/{zh-CN,en}/modules/chat.md and mcp-tools.md.
  • Tests: adds test_citation_anchor.py, removes test_citation_offset.py; plugin system tests updated for the new manifest format.

Testing

  • Backend test suite passes on the source tree (citation anchor + plugin system suites).
  • CE derivation pipeline passes all gates (brand gate, runtime file gate, license gate).

Luhaozhu added 2 commits August 12, 2026 09:28
…col alignment

- Replace the legacy [ref:tool-N] citation pipeline (orchestration/citations.py)
  with evidence anchors (orchestration/citation_anchor.py): tools stamp cite_id
  on citable items, the model writes [anchor text](cite:eN), and the allocator
  is bound to the agent instance so numbering stays monotonic across turns.
- Render citations as ChatGPT-style capsule chips with hover source cards;
  drop the old footnote/link styling and dead citation utilities.
- Align plugin.json with the Agent Plugins standard ($schema, author object,
  org.hugagent extensions namespace, external mcp.json) and move display
  metadata (name/category/icon) to admin-side UI configuration with a curated
  plugin icon library.
- Update system prompt guidance, docs (chat / mcp-tools), and tests to match:
  add test_citation_anchor.py, remove test_citation_offset.py.
citeTag was only referenced by renderers that are not part of this build;
with noUnusedLocals enabled tsc fails the frontend build (TS6133).
@Luhaozhu
Luhaozhu merged commit cd43bcb into main Aug 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant