Skip to content

feat: ground unknown term summaries - #7

Merged
fly1d merged 1 commit into
mainfrom
feature/grounded-term-analysis
Aug 11, 2026
Merged

feat: ground unknown term summaries#7
fly1d merged 1 commit into
mainfrom
feature/grounded-term-analysis

Conversation

@fly1d

@fly1d fly1d commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What changed

  • Query the Chinese Wikipedia MediaWiki API when an unknown term is not covered by built-in knowledge.
  • Turn the most relevant result into a sourced quick summary, three concepts, takeaways, and learning steps.
  • Detect likely disambiguation pages and ask the user to choose among up to three meanings.
  • Fall back to the existing local template after timeout, API failure, malformed data, or no useful result.
  • Document the external term-query data flow and expose Wikipedia / CC BY-SA attribution on the source control.

Closes #6

Risk

  • Low: copy, styles, documentation, or isolated cleanup
  • Medium: interaction, API response, or shared behavior
  • High: fetching, security boundary, deployment, or data compatibility

Verification

  • npm run ci passes locally
  • I tested the main user path affected by this change
  • I checked desktop/mobile layout when UI changed
  • I added or updated tests for behavior changes
  • I documented anything intentionally not tested

Verification notes:

All 15 local checks pass. Real API and service-level smoke tests covered 量子纠缠 as a sourced result, Mercury as a dynamic clarification, and MCP as an unchanged built-in result. CI uses mocked MediaWiki responses and does not require external network access. The only UI change is source tooltip/accessibility metadata; layout is unchanged.

Review and release

  • The diff is focused and contains no unrelated changes
  • Error, empty, loading, and recovery states were considered
  • Security and privacy impact was considered
  • Rollback is understood

Rollback plan:

Revert this PR. Unknown terms will return to the existing local generic template; no data migration or dependency rollback is required.

@fly1d fly1d left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review completed with no blocking findings. Verified: built-in terms return before any external request; unknown terms use only the fixed Chinese Wikipedia endpoint with a 3.5-second timeout; relevance indices are sorted before selection; disambiguation, malformed data, failures, and empty results are covered; source attribution and the external data flow are documented; no dependency was added; all 15 checks pass.

@fly1d
fly1d merged commit e6d5d9d into main Aug 11, 2026
1 check passed
@fly1d
fly1d deleted the feature/grounded-term-analysis branch August 11, 2026 10:10
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.

feature: analyze unknown terms with a public knowledge source

1 participant