Skip to content

feat: register knowledge sources and add source with find_ui - #32305

Merged
bolichen97 merged 1 commit into
mainfrom
fix/23304-knowledge-add-source-find-ui
Nov 10, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/23304-knowledge-add-source-find-ui

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Asked how to add a source to the knowledge base, the agent can walk the user straight to the Add Source button in their own dashboard, not just to the Knowledge tab.

Asked where the knowledge library lives, the agent can only point at the tab (/capabilities?tab=knowledge, which find_ui returns). Sent to "Add Source", the user lands on the Knowledge list and still has to find the Sources view and the button.

Why it matters

"Where do I add a folder to the knowledge base?" is a common question, and today the answer is a tab plus a description of where to click. find_ui can only guide to a control it has registered.

Not a goal

  • A new ?highlight= route or any other agent-facing link format: find_ui's existing guide is the contract.
  • Customize controls beyond Knowledge's Sources view and Add Source.
  • Registering the Knowledge search box: it renders through SearchInput, which does not forward a find_ui marker.

What changed (motivation → approach → change)

find_ui("add source") now answers Customize › Knowledge › Sources › + Add Source with a guide plan; on main it stops at the Knowledge tab.

The issue proposed a hand-kept table of Customize ?highlight= ids. That would be a second list beside the find_ui index, which already registers Customize controls under a parent tab (connections.mcp-servers-tab → mcp.add-custom). So the two Knowledge locations are registered in find_ui instead, and the agent's existing guide walks the user from the tab to the button.

Piece What it does
uiLocations/areas/capabilities.ts knowledge.sources-tab (under tab.capabilities.knowledge) and knowledge.add-source (under the Sources tab), with newcomer search words in en and zh-CN
pages/knowledge/index.tsx the Sources tab gets its own render site in the tab strip, so the index can read its label key; useGuideRevealScope('open:knowledge.sources-tab', …) tells the guide when Sources is the open tab
pages/knowledge/SourcesList.tsx Add Source carries the knowledge.add-source marker
ui-index.generated.json, guidePlans.gen.ts regenerated with npm run gen:ui
docs/architecture/mcp.md names the Knowledge Sources view among the wired reveal-scope owners

Backwards compatibility

Compatible: two new index entries and two DOM markers; no existing location, route or label changes.

Removes nothing: the Knowledge tab strip renders the same four tabs with the same labels, icons, classes and keyboard handling.

Tests

  • uiLocations/schedule-artifacts-capabilities.locations.test.ts: goldens for both new locations (kind, label key, parent chain, route, entry, requirements) and that each marker sits at exactly one render site.
  • KnowledgeEmbedded.test.tsx: the page reports open:knowledge.sources-tab closed on the list view, open after clicking Sources, and drops the report on unmount; and the marked Sources tab still takes focus on an arrow key (fails when the marker does not forward the roving ref).
  • test/test_find_ui_schedule.py: "add a folder to the knowledge base" and "添加文件夹到知识库" reach knowledge.add-source first, with its en and zh-CN path and route.
  • Ran on this head: the backend find_ui, guide and UI-index tests (33 files) and 70 frontend Knowledge, guide and uiLocations test files pass. On a heavily loaded machine some of them timed out and passed when re-run alone. Two still fail, neither about Knowledge: the Continue with GitHub golden in test_find_ui_auto.py, which fails wherever the generator runs (test_find_ui_auto: the Continue with GitHub golden fails wherever the generator runs #32670), and test_scoped_runner_self_test_passes, which runs past its 120-second limit while the same run_scoped_tests.py --test passes on its own.

Manual verification

Ran this branch's backend find_ui: "add source" and "add a folder to the knowledge base" return knowledge.add-source with the path Customize › Knowledge › Sources › + Add Source at /capabilities?tab=knowledge; "knowledge sources" returns knowledge.sources-tab; "where is my knowledge base?" stays no_match, as on main.

Screenshots / video

Why no screenshot: the Sources tab and Add Source render exactly as before; the diff adds only find_ui markers, a reveal-scope report and index entries.

Related Issues

Closes #23304

Builds on #23324 by @cixuuz.

The issue proposed ?highlight= links; this meets the same need (a user sent to Add Source lands on it) through find_ui's guide instead.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of f0c4215ca6734e6546812201a41177464f855917 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing changes on screen: the Sources tab renders with the same icon, label and classes as before, and Add Source only gains a find_ui marker. The guide walking the user there already exists, so no screenshot is needed.

[UX-REVIEWED] f0c4215

Description read

[DESCRIPTION-READ] 73c476b6aa45f11267aadc1e16cf82afcf5a66051c051b1510739b7bcb4ba55c

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f0c4215ca6734e6546812201a41177464f855917 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Every item is a registration, marker or reveal-scope report that the guide to Add Source needs, and they reuse the existing find_ui contract (the same pattern as connections.mcp-servers-tab → mcp.add-custom).

What this change ships

Inventory (6 items) — 6 justified

Intent: when a user asks how to add a knowledge source, the agent can guide them all the way to the + Add Source button instead of stopping at the Knowledge tab. ADDITION.

  1. find_ui answers "add source" / "add a folder to the knowledge base" with a guide to Customize › Knowledge › Sources › + Add Source — justified
  2. find_ui answers "knowledge sources" with the Sources view of the Knowledge tab — justified
  3. New en and zh-CN search words for both locations — justified
  4. The Knowledge page tells the guide when the Sources view is open (open:knowledge.sources-tab) — justified
  5. The Sources tab button is now rendered on its own, separately from the other tabs, so it can carry the marker; its label, icon and keyboard handling are unchanged — justified
  6. The Add Source button carries the knowledge.add-source marker — justified

[FIRST-PRINCIPLES-REVIEWED] f0c4215

Description read

[DESCRIPTION-READ] e6c6dd35f97f94b78f29853625cd96e09e024f38fc15383d66c34be110658e15

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of f0c4215ca6734e6546812201a41177464f855917 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns. The two Knowledge controls are registered in the existing find_ui index under their parent tab, so no second id table is added, and the tab strip renders the same as before.

[DESIGN-REVIEWED] f0c4215

Description read

[DESCRIPTION-READ] affda4e866387cc265b31a0f822d0d2fe46f6fa381b70f6280a60733b22e23e7

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f0c4215ca6734e6546812201a41177464f855917 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f0c4215

Verdict parsed from the review's SHA-scoped output markers for commit f0c4215ca6734e6546812201a41177464f855917.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f0c4215ca6734e6546812201a41177464f855917 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f0c4215ca6734e6546812201a41177464f855917 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f0c4215

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f0c4215ca6734e6546812201a41177464f855917 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/23304-knowledge-add-source-find-ui branch from b92b7bc to fc20cf8 Compare November 7, 2026 15:41
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json, website/src/uiLocations/guidePlans.gen.ts since this head went green (bab2387 -> a254f30); CI re-running.

The two generated files conflicted on their digests only; both were regenerated with npm run gen:ui (--check up to date) and the change itself is unchanged.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/23304-knowledge-add-source-find-ui branch from fc20cf8 to 0de335a Compare November 7, 2026 19:15
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json, docs/architecture/mcp.md since this head went green (a254f30 -> 347225f); CI re-running.

Only the generated index conflicted, on its digest and coverage counts; it was regenerated with npm run gen:ui (--check up to date) and the change itself is unchanged.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/23304-knowledge-add-source-find-ui branch from 0de335a to 7ae2ca0 Compare November 8, 2026 02:22
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/docs/ui-index.generated.json, docs/architecture/mcp.md, docs/architecture/context-management.md, docs/architecture/resource-protection.md, website/src/pages/knowledge/EmbeddingStatus.tsx since this head went green (347225f -> 601aa4c); CI re-running.

Only the generated index conflicted, on its digests and coverage counts; it was regenerated with npm run gen:ui and the change itself is unchanged. The new base also carries #32606, the fix for main's red Windows shards 5 and 6.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 8, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Re-sync budget reset

The base moved under this PR more times than the re-sync budget allows; a maintainer asked for one more round of re-syncs so it can be rebased and its conflicts resolved.

[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/23304-knowledge-add-source-find-ui branch from 7ae2ca0 to ec8aa05 Compare November 9, 2026 06:42
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, src/kiro_crew/docs/ui-index.generated.json, website/src/pages/knowledge/index.tsx, website/src/pages/knowledge/SourcesList.tsx, website/src/uiLocations/guidePlans.gen.ts since this head went green (601aa4c -> 2538eee); CI re-running.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 9, 2026
buluoray
buluoray previously approved these changes Nov 9, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. find_ui now registers the Knowledge > Sources tab and the + Add Source button with a reveal scope (website/src/pages/knowledge/index.tsx:279, 702-721; website/src/pages/knowledge/SourcesList.tsx:790; website/src/uiLocations/areas/capabilities.ts:81-99). The change is additive, roving focus on the tab bar still works, generated files are fresh, and tests and mutations confirm the guards. Build Desktop (ubuntu-22.04) failed on a 504; the arm build on the same head passed.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 9, 2026
Asked how to add a source to the knowledge base, find_ui could only
point at the Knowledge tab, so the user still had to find the Sources
view and the button. Register both as find_ui locations under the
existing Knowledge tab, with a reveal scope for the Sources view, so the
guide walks the user's own dashboard from the tab to Add Source.

Builds on #23324 by @cixuuz.

Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>
@bolichen97
bolichen97 force-pushed the fix/23304-knowledge-add-source-find-ui branch from ec8aa05 to f0c4215 Compare November 10, 2026 14:20
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, src/kiro_crew/docs/ui-index.generated.json, website/src/pages/knowledge/SourcesList.tsx, website/src/uiLocations/guidePlans.gen.ts since this head went green (2538eee -> a86f313); CI re-running.

Only the generated find_ui index conflicted; it was taken from main and regenerated with npm run gen:ui (--check up to date), and the change itself is unchanged.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 10, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. On this head the review checked these points. The Sources tab marker keeps the roving focus ref, so ArrowLeft and End still reach it. The tab icon and label match the other tabs. The open:knowledge.sources-tab reveal scope is in the generated guide plans and reads closed, open and gone on unmount. The guide route really mounts the Knowledge page. The generated index and guide plans are current against main. A run of find_ui at this head returns knowledge.add-source for "add source" and 添加来源, and knowledge.sources-tab for "knowledge sources".
Done well: the new tests each fail if their production line is reverted, including the easy-to-miss case where a marked tab drops out of arrow-key focus.
Optional:

  • Closes #23304 also closes the knowledge.search half of that issue, which this PR leaves out on purpose. A follow-up issue for SearchInput forwarding a find_ui marker would keep that work tracked.
  • knowledge.sources-tab has frontend goldens but no backend en and zh-CN phrasing row in test/test_find_ui_schedule.py, so the ranking of its search terms is not pinned.
  • This PR and #34353 touch the same five files (the capabilities.ts header, mcp.md, the generated files). Whichever merges second should rebase, keep the other's wording, and rerun npm run gen:ui.

@bolichen97
bolichen97 merged commit c779938 into main Nov 10, 2026
101 checks passed
@bolichen97
bolichen97 deleted the fix/23304-knowledge-add-source-find-ui branch November 10, 2026 16:19
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 10, 2026
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.

feat(customize): deep links that open a Customize tab and flash a control

3 participants