Skip to content

feat(knowledge): add Amazon Bedrock Knowledge Base retrieval sources - #8985

Closed
jingchaodev wants to merge 1 commit into
kirodotdev:mainfrom
jingchaodev:feat/bedrock-kb-connector
Closed

jingchaodev wants to merge 1 commit into
kirodotdev:mainfrom
jingchaodev:feat/bedrock-kb-connector

Conversation

@jingchaodev

@jingchaodev jingchaodev commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let knowledge search answer from an Amazon Bedrock Knowledge Base that a team already keeps in its own AWS account, without re-ingesting it locally.

The Knowledge library can only search content KiroCrew ingests itself
(files, folders, vaults). Teams that already keep a curated Amazon Bedrock
Knowledge Base — often gigabytes of code and docs indexed in their own AWS
account — cannot point KiroCrew at it: the only options are re-ingesting the
whole corpus locally or leaving the KB unreachable from knowledge search.
Requested in #7947.

Why it matters

Not a goal

  • Keying AWS consent grants per (service, profile, region). v1 allows one Bedrock account at a time; the keyed-grant change is a follow-up that also deletes the one-target conflict code.
  • Caching the STS consent probe, or telling the caller when the remote leg was skipped.
  • A failure state on the "● Live" row for a revoked grant or broken credentials (tracked in knowledge: Bedrock KB Live row should reflect grant and retrieval health #11113).
  • Storing Bedrock content locally, or carrying a Bedrock source through a bundle export or import.
  • Writing to a Knowledge Base: the connector only calls Retrieve.

Backwards compatibility

Compatible: every source type main has keeps main's add, import and ingest behavior. The refusals this PR adds name only a bedrock_kb row or a bedrock-kb:// uri, which no main writer creates, plus a body type check that refuses a non-string field, which no caller sends. src/kiro_crew/eval/bench/kb_retrieval.py:_build_store builds its own local corpus, so add_item never sees a live source there.

  • Reader: website/src/components/MarkdownPanel.tsx:useFileKnowledgeState -- crew page -- posts the file's basename as name; a non-Bedrock name is stored as sent (test_markdown_panel_file_add_keeps_a_long_basename)
  • Reader: website/src/pages/knowledge/SourcesList.tsx:handleAdd -- crew page -- posts addName || addUri; a long typed name or folder path is stored whole (test_knowledge_tab_folder_add_keeps_a_long_name)
  • Reader: website/src/apps/md-notebook/api.ts:knowledgeRegister -- app -- posts the vault name, stored as sent (test_md_notebook_vault_add_keeps_a_long_vault_name)
  • Reader: src/kiro_crew/dashboard/handlers/knowledge.py:import_bundle -- crew page -- a bundle main exports has no bedrock_kb row and no bedrock-kb:// uri, so it imports as before (test_knowledge.py::TestKnowledgeStore::test_export_import_roundtrip; the refusal: test_an_account_bound_uri_is_refused_under_any_type)
  • Reader: src/kiro_crew/knowledge/ingestion.py:IngestionPipeline._ingest_file_body -- crew page -- every caller passes a local source it created or synced; only a bedrock_kb id is refused (test_triggers_immediate_ingestion)
  • Reader: src/kiro_crew/knowledge/ingestion.py:IngestionPipeline._ingest_text_impl -- crew page -- the ingest-text route refuses a bedrock_kb source before the pipeline runs, and the sync never fetches one (test_ingest_text_under_a_bedrock_source_is_refused_before_the_pipeline_runs, test_source_is_never_synced)

What changed (motivation → approach → change)

Part What it does
src/kiro_crew/knowledge/connectors/bedrock_kb.py one bedrock-agent-runtime Retrieve per configured KB (kb_ids takes ids or ARNs, at most 10), merged by relevance; vectorSearchConfiguration with a managedSearchConfiguration fallback for MANAGED KBs; the query text leaves the host through the platform shim redact_via_context (a companion policy's shapes on top of the OSS baseline, whose URL pass runs first); citations from the document's source_uri metadata; every string a hit keeps is redacted whole through the same shim, then clamped (title and source name 200, source URI 1024, content 10,000; the summary from the clamped content), so a cut can never leave half a credential the redactors no longer recognise
search_remote_sources_bounded (connector), src/kiro_crew/mcp_tools/knowledge.py, search_for_context a shared worker pool under a wall-clock budget over bounded timeouts, failing OPEN to local-only results, interleaved by rank; the enumeration reads at most 64 bedrock_kb rows (MAX_BEDROCK_KB_SOURCES, the same constant that limits registration) with the attested ids first, and cuts every column in SQL (id 64, name 200, uri 256, properties 1024 characters, each above what an insert writes; the one-target lookup uses the same SELECT and fetches only attested rows), so rows planted in knowledge.db cannot push a registered source out of the window or the budget, or reach Python at full size, and attestations past that count, written outside the add route, are counted in one warning per search; each search checks the budget before each row's attestation check, before the consent probe and again before it builds the client, and the STS probe gets only the budget left (rounded up to whole seconds, at least 1 s; every other caller keeps 15 s), with a failure under that shorter timeout left out of the confirmation surfaces' probe cache; an install with no bedrock_kb source pays one indexed SELECT and starts no thread; on the MCP tool a namespace scope skips the leg, since a bedrock_kb source holds no items and so no hit can fall inside a namespace
src/kiro_crew/aws_consent.py, src/kiro_crew/dashboard/handlers/aws_consent.py, src/kiro_crew/dashboard/server.py, src/kiro_crew/security_posture.py the bedrock-kb consent grant for (profile, region) pinned to the confirmed account; record_source_attestation / attested_sources / revoke_source_attestation (strict read: an unreadable store raises, never "nothing attested") under bedrock-kb.sources; recorded_source_attestations (every entry under any account, strict read) for the one-target check and the registration limit; bedrock_authorization_snapshot (the grant and its attestations from one store read, so the per-retrieve recheck cannot pair a stale grant with its replacement's attestations); compare-and-delete revoke_if_matches / reconcile_drift for bedrock-kb only (every other service keeps main's key-wise revoke, and its stored grant keeps main's shape); the identity-probe cache holds at most 64 entries (_PROBE_CACHE_MAX_ENTRIES) and drops expired ones on each write, since its (profile, region) key is caller-supplied; the consent POST imports the connector (and so boto3) only in its worker thread and only for bedrock-kb, so no confirmation loads it on the event loop and a Polly or Transcribe one never loads it
src/kiro_crew/dashboard/handlers/knowledge.py owner-only bedrock_kb add and delete (403 owner_only; the knowledge owner gate admits an app token and an internal-secret caller, this one does not); body shape checked before any field is read; a bedrock_kb name, typed or uri-derived, is cut to 200 characters, the most a search result serves back, and every other type stores its name as sent, as on main; the retained triple kb_ids / region / profile bounded at retention (400 bedrock_kb_config_invalid); server-derived uri (bedrock-kb://<region>/<sorted ids>); attestation written with the row and pinned to the account validation verified, which the connector's validate_registration returns (a confirmation for another account landing mid-validation, or a grant that moves to another account and back while the probes run, is 409 bedrock_kb_grant_changed; 500 bedrock_kb_attestation_failed undoes the insert; delete revokes first, and a failed revoke is 500 bedrock_kb_attestation_revoke_failed with "Couldn't remove this source. Nothing was deleted. Try again."); one Bedrock target at a time (409 bedrock_kb_target_conflict, the held source named through security.redact; only a row a gateway attestation pins holds the target, so a row written straight into knowledge.db refuses nothing); at most 64 registrations (MAX_BEDROCK_KB_SOURCES, attestations under any account): the next add is 409 bedrock_kb_source_limit before either write, after a full population revokes the attestations whose row is gone (the delete route 404s on a missing row), and a re-add of a registered KB still answers source_exists at the limit; 409 live_source_holds_no_items on ingest-text under a live source; a re-add of a registered KB answers 409 source_exists with text naming the remove-then-add recovery, since only a row the add creates is attested; internal remote-search route
src/kiro_crew/knowledge/store.py _ACCOUNT_BOUND_SOURCE_TYPE: export_all drops bedrock_kb rows, import_bundle refuses them, and a row of any type carrying a bedrock-kb:// uri (it would squat the handle the owner's add dedupes on), with the items, locations, mentions and relations riding on them (ids compared as text); add_item / add_source_location_in_txn raise LiveSourceHoldsNoItems, the export leaves out what a direct write planted under such a row, and the two deletion paths pick a surviving item's new owner from _reassignment_candidates (holders that are not account-bound), so a planted location row never makes a bedrock_kb row own a local document; bedrock-kb:// exempt from the local-path check
website/src/pages/knowledge/SourcesList.tsx, website/src/components/AwsConsentGate.tsx, website/src/api/client/security.ts, website/src/pages/CapabilitiesPage.tsx, website/src/i18n/locales/*.json the Bedrock KB add form (labelled fields built from the shared Input and Btn, in-form consent card, submit gated on a grant for the typed profile and region, the reason always beside a dead button; while the profile field differs from the profile the card names, the card stays in place but inert, with no probe and no Confirm), the Local Folder inputs labelled the same way (the UX review on 987fa5e flagged one dialog with two labeling systems, and a placeholder disappears once the field has text), the "● Live" row with its own remove copy, a failed remove shown on the row it restores through ErrorNotice, a successful add that resets the committed profile with the field (a reopened form gates on the blank profile it shows), 14 i18n keys in 13 catalogs in each guide's informal register; the Knowledge tab loaded through lazy() + Suspense behind the Templates tab's ContentSkeleton
src/kiro_crew/extras.py, setup.cfg the optional [bedrock] extra (boto3, imported lazily)
docs/system-specs/modules/knowledge.md, docs/feature-map/README.md every rule above, in the same commit; the feature-map entry

A registered Bedrock Knowledge Base answers through the same retrieval surfaces as local knowledge, local_knowledge_search (MCP) and the dashboard's search-for-context, without touching the local index. Until now search reached only what was ingested locally, so a KB a team already keeps in Bedrock had to be re-ingested to be found.

The new bedrock_kb source type holds no local items and is queried live at search time, beside the local store. It is a consent-gated paid service: the add-time probe and every retrieval need the owner's grant for (service, profile, region) and re-verify the account, so a repointed profile is refused fail-closed instead of billed, and every paid request that did not happen writes an aws_consent.denied SEL line. Registering or deleting one is an owner action; local sources keep their existing paths. The row is not the registration, the attestation is: knowledge.db is agent-writable in-sandbox, so the owner-gated insert also records the row in aws_service_consent.json (a read-only leaf to the agent), pinned to the row's id, uri, retained triple and the account validation ran under (the insert refuses a grant whose account moved in between, and the writer refuses to pin any other), and the enumeration searches only rows that still match one. A bundle never carries such a row in either direction, no item can name one through the gateway (add_item and add_source_location_in_txn refuse it), and the export leaves out anything a direct write planted under one, so dropping the row from an export leaves nothing a clean import would trip over. Every caller-supplied value the row retains is bounded where it is parsed, and the uri is derived on the server, so one knowledge base is one row whatever its spelling.

Two v1 trade-offs are flagged for maintainer sign-off: grants are keyed per service rather than per (service, profile, region), so a second Bedrock target is refused by a small conflict subsystem the keyed-grant follow-up (#14337) would delete; and every remote search runs an uncached STS consent probe, which is what closes the account-drift window. Bundle budget: the add form's growth of SourcesList would cross the App chunk's first-party ceiling, so CapabilitiesPage.tsx loads the Knowledge tab through lazy() + Suspense inside its existing ErrorBoundary; the sources list, ingestion controls and form are a KnowledgePage-*.js chunk only the Knowledge tab fetches, so App stays under its ceiling. The 14 keys x 13 locales add ~12.6 KB to the eager all catalog chunk (src/i18n/all.ts, the 13 catalogs plus the entry, with no module to split); that chunk's ceiling is main's own (38610 KB since #13607), so this PR changes no budget.

flowchart LR
  subgraph Before
    A1[Add Source]:::ctx --> A2[local file / folder / vault]:::ctx --> A3[local index]:::ctx
  end
  subgraph After
    B1[Add Source]:::ctx --> B2{type}:::ctx
    B2 --> B3[local file / folder / vault]:::ctx --> B4[local index]:::ctx
    B2 --> B5[Bedrock KB<br/>consent-gated]:::added --> B6[live Retrieve<br/>merged by rank]:::added
  end
  classDef ctx fill:#E0F2FE,stroke:#0284C7;
  classDef added fill:#DCFCE7,stroke:#16A34A;
Loading

🟩 added · 🟦 unchanged — knowledge search now merges a live Bedrock KB beside the local index, with no local re-ingest.

Tests

  • test/test_bedrock_kb_connector.py (68, mocked client, no network): every
    string a hit keeps stays within its bound while normal-size strings pass
    through unchanged (mutation-verified against the unclamped append); the
    kb_ids bounds (count, entry length, id shape: strict names the violation,
    lenient drops it) and that an out-of-bounds list is refused before the
    client is built; the row handle names the sorted full id set (same ids in
    another order dedupe, a set sharing only a first id does not, single-id
    shape unchanged; mutation-verified); the
    managed fallback fires only on the naming error (the fixture is the
    ValidationException text a live Retrieve against a MANAGED knowledge
    base returned) and is not issued once the
    search budget is spent (mutation-verified); a search whose budget is spent
    runs no consent probe and builds no client (mutation-verified), and a
    budgeted search hands the probe only the budget left while an unbounded
    one keeps 15 s; multi-KB fan-out merges and
    survives partial failure; citation precedence; validate_config field checks;
    bounded entry's no-sources fast path, timeout fail-open, error swallowing;
    rank interleave; the connector never syncs; a mid-search withdrawal and a
    withdrawal between the vector attempt and the managed fallback each
    write exactly one denied audit event naming the refused KB and issue
    no Retrieve; the per-Retrieve recheck reads the row's registration too, so
    a delete landing after the first KB's Retrieve stops the second before it
    goes out, with the denied line naming the registration
    (mutation-verified against a grant-only recheck); each freeze-verify refusal (other account, other profile,
    other region) writes exactly one denied event naming the target and
    the check, with no account numbers in it, and the verified path writes
    none (mutation-verified); only gateway-attested rows are searched: a
    clone row with no attestation and an attested row whose stored KB set
    was widened are both skipped with one denied line naming the row id,
    never reach the client, and revoking the attestation stops a row too
    (mutation-verified against the gate); planted rows cannot crowd out the
    owner's row: with 69 planted rows ahead of it, the owner's row is still
    searched inside the 64-row window, planted rows' audit writes stop once
    they spend the budget, and a spent budget writes no audit line at all
    (mutation-verified against the old enumeration, no ORDER BY, no LIMIT,
    and the budget check after the attestation check); attestations past the
    limit, written outside the add route, are counted in one warning per
    search (mutation-verified); both bedrock_kb row reads keep every field
    bounded: with three planted rows whose every field is 100,000 characters,
    the one-target lookup fetches only the attested row, and the enumeration
    returns no field over 1024 while the owner's row is still searched
    (mutation-verified against the old unbounded reads); an enlarged name
    reads back as NULL and the result names the source Bedrock KB <kb id>,
    so no clipped name prefix reaches a result (mutation-verified); a row
    whose id or uri a NUL suffix or an oversized value changes under the SQL
    bound is refused with its own denied line instead of matching the
    attested row it projects to (mutation-verified against the old projection
    and against a silent SQL filter); every kept hit string is redacted whole
    before its clamp, so a key across the cut is redacted, not halved
    (mutation-verified per field);
    validation reports the account of the grant it verified, and none on a
    refusal (mutation-verified); an attestation is pinned to the
    confirmed account, so a grant re-confirmed for another account leaves the
    row skipped and audited until it is re-registered, and nothing can be
    attested without a readable grant (mutation-verified against the account
    filter); region and profile outside the shapes a grant can name are
    refused before any probe and by retained_properties itself, and pass
    stripped at the ceilings (mutation-verified against the shape check);
    the one-target compare counts only a registered row: a planted row with a
    foreign target refuses nothing, and a registered row keeps its target
    after its grant is revoked (mutation-verified against no attestation
    filter and against a current-grant-only one); the compare renders the held
    row's name redacted, so a registered row whose name was rewritten with a
    key and an exfil URL reaches the
    refusal as the two tags with the target still readable (mutation-verified
    against the bare rendering and against a credential-first order, which
    leaves the URL's host and query in place); the query leg goes out through
    the same composite, so a query carrying a credential inside a URL's query
    string reaches the client as the URL tag with the token, host and payload
    parameters gone and the surrounding text intact (mutation-verified against
    the credential-first order); both egress sites go through
    kiro_crew.platform.redact_via_context, so with a companion credential
    policy installed a companion-only shape in the query and in a planted
    name is scrubbed on top of the baseline (mutation-verified against a
    direct security.redact import).
  • test/test_mcp_knowledge_search.py: a namespace-scoped
    local_knowledge_search over a store with a registered bedrock_kb row
    makes no remote call and answers from local results, and an unscoped one
    keeps the remote leg (mutation-verified against the leg ignoring the
    namespace).
  • test/test_aws_consent.py, test/test_knowledge_add_source.py,
    test/test_knowledge_owner_gate.py, test/test_spawn_audit.py: the grant lifecycle, compare-and-delete kept to bedrock-kb (a Polly drift and a Polly authorize mismatch revoke key-wise, a row whose own service field names another service cannot redirect the revoke, only the Bedrock grant carries a grant_id, and the consent GET pins the drift check for bedrock-kb alone; mutation-verified four ways), the probe timeout (a
    budgeted caller's STS call gets the budget left, rounded up with a 1 s
    floor, every other caller keeps 15 s, and a failure under a budget is not
    cached; the probe hands the AWS runner timeout only when budgeted, so an
    unbudgeted probe keeps its exact call; fails when timeout=None is
    passed), the probe cache (both write sites hold it at
    _PROBE_CACHE_MAX_ENTRIES, evicting the oldest; a held key refreshes
    without evicting, and an expired entry leaves on the next write;
    mutation-verified against no cap, no sweep and either site writing the
    dict directly), a bedrock_kb name over 200 characters is cut to 200 while
    a long local file, folder or vault name is stored whole (mutation-verified
    against refusing every long name, cutting every name and no Bedrock cut), a
    bundle row typed local_folder that carries a bedrock-kb://
    uri is refused and leaves the uri free (mutation-verified), off-loop add-time
    validation, the owner gate on bedrock_kb registration (messaging
    non-owner and app token refused 403 before validation with nothing
    persisted, the owner passes, and an app token, which the knowledge owner
    gate admits, still adds a local folder;
    mutation-verified), the body-shape gate (a non-string uri from the owner
    with valid Bedrock properties is a 400 before validation with nothing
    persisted, every read field is gated, null reads as absent;
    mutation-verified against the 500), the retained triple (a body with
    extra properties keys lands as a row carrying exactly the three read
    keys, and a body whose region, profile and KB ids are whitespace-padded
    and ARN-spelled lands as the stripped, canonical values the grant check
    matched; a caller-chosen uri, oversized or unique per request, never
    reaches the row and a second add of the same KB is a 409 source_exists;
    all three mutation-verified), the registration limit (with the limit set
    to 2: the next add is refused with no row and no attestation, removing a
    source frees its slot, a full population reclaims an attestation whose
    row was deleted outside the dashboard, and a re-add that loses the race
    to the in-lock recheck still answers source_exists; all four
    mutation-verified), the attestation (the insert records exactly
    the inserted row, pinned to its stored triple so a widened kb_ids does not
    match, and a DELETE of the row drops the entry; mutation-verified
    against no-attest and no-revoke; a retained profile or region outside
    its bound is a coded 400 with no row even when the registered
    connector's validation passes everything; a same-target confirmation for
    another account landing during validation is 409 bedrock_kb_grant_changed with no row and nothing attested, and so is a
    grant that moves to another account and back while the probes run
    (mutation-verified against a read taken before validation), while the
    same-account one lands attested for that account, and the attestation
    writer itself refuses an expected_account the grant does not confirm
    (all three mutation-verified); an attestation write that fails
    undoes the insert and answers 500 bedrock_kb_attestation_failed with no
    row and nothing attested; an unreadable consent store makes the revoke
    raise (bytes untouched, a missing store reads as nothing attested) and the
    DELETE route answer 500 bedrock_kb_attestation_revoke_failed with the
    row still present (mutation-verified against the fail-soft read); a delete revokes before the row goes, a failed
    revoke deletes nothing, and the two writes run in that order; all
    mutation-verified), the failed-revoke text (both paths answer "Couldn't
    remove this source. Nothing was deleted. Try again."), the re-add recovery (a re-add of a KB whose
    attestation went dark answers 409 source_exists with the same id and the
    remove-then-add text, the consent store byte-identical and still one row,
    failing on the generic text; removing that row and adding again attests the
    new row for the new account), the owner gate on deleting a bedrock_kb row (an
    app token, which the knowledge owner gate admits, is refused 403 with the row still attested, the same
    caller deletes a local folder row, the owner deletes the Bedrock row and
    its attestation goes with it; mutation-verified), the delete gate keyed
    on the sealed attestation rather than the row's type (a registered row
    re-labelled local_folder by a raw write still refuses a non-owner with
    its attestation kept, and the owner's delete still revokes it;
    mutation-verified against the type-only gate), the conflict refusals
    (the add-source and consent-POST 409s each name the held source
    through the redacted rendering: a planted key and exfil URL arrive as
    tags, never as values; both mutation-verified), the consent-POST error
    split (a failed one-account lookup is the 503 bedrock_kb_conflict_check_failed; a grant write that fails, for Polly,
    propagates as its own error with nothing recorded; mutation-verified
    against the broad catch), the consent POST's connector import (a
    Bedrock confirmation loads it off the event loop, a failed lookup is
    refused unchanged, a Polly one never loads it; mutation-verified against
    an on-loop import), the bundle-route rule (an app-token import and an
    owner import each register no bedrock_kb row and report it as
    refused; an export leaves a registered one out and round-trips
    without touching it; an item naming a registered bedrock_kb source is
    refused and counted while the rest of the bundle lands, and an item
    riding on a refused bundle row is dropped with its location, mention and
    relation instead of rolling the bundle back; a crafted bundle carrying
    numeric ids is refused the same way, since ids compare as text on both
    sides; a refused item with no id, beside one literally called "None",
    drops neither an evidence-free relation nor anything else with a null
    item id, while the relation the "None" item evidences is still dropped;
    an id-less refused bedrock_kb row beside a local source called "None"
    leaves that source's item in place; all five mutation-verified against
    the FOREIGN KEY failure / the planted row / the dropped relation / the
    refused item; the store refuses an item insert and a location attach that
    name a registered bedrock_kb source while writing under a local source
    still works, and the export of that store imports whole into a clean
    store that never saw the row; the ingest-text route answers 409 live_source_holds_no_items for a bedrock_kb target with the pipeline
    never called; the two guards and the route gate each mutation-verified;
    an item, location, mention and relation planted by raw SQL under a
    bedrock_kb row are left out of the export and a clean store imports it
    whole, mutation-verified against the filter; a local item whose only
    other holder is a planted bedrock_kb location row is destroyed with its
    owner on both deletion paths, with the planted row, while a genuine local
    co-holder still takes ownership, and the export imports whole into a
    clean store, mutation-verified against the unfiltered holder read at
    each site), the spawn allowlist, and the internal remote-search POST
    listed among the owner gate's read-only routes.
  • error-code-baseline.json: re-snapshotted with
    python test/test_error_code_contract.py --update. The body-shape gate
    answers every shape violation from one uncoded 400 site where there were
    two, so dashboard/handlers/knowledge.py missing_code moves 60 -> 59
    (the ratchet only ever tightens); the _compliant total also absorbs
    main's own drift since the last snapshot.
  • website/src/test/SourcesList.bedrock.test.tsx (12): the type button, submit
    gating, the kb properties with no uri and nothing credential-shaped
    in the POST body, the default name carrying the bare first KB id and no
    account id when an ARN is pasted first (mutation-verified), field reset
    after add, a reopened form that gates on its blank profile after an add
    with a named one, so its first Add submits (mutation-verified), that a profile the consent
    gate did not probe is never POSTed — it re-targets the gate instead
    (mutation-verified), the consent card kept in place but inert while the
    typed profile differs from the one it names, so it never offers to
    confirm a profile the field no longer reads, with the hint "Finish
    editing the profile to confirm." (each mutation-verified), the
    Bedrock fields and buttons rendered by the shared Input and Btn, and
    the Live row's Database icon (each mutation-verified), the pointerdown answer to a submit with an
    uncommitted profile, the region-missing reason appearing and clearing,
    the profile helper line, the Live row's removal confirm copy, the file and
    folder branches staying reachable, the folder branch's visible labels,
    and the Live row without sync affordances but with its meaning as
    visible text and a space after the dot (fails with inline-flex), and a failed remove that restores the row and shows the
    error, with the agent hand-off hidden while the add form is open
    (mutation-verified).
  • website/src/test/CapabilitiesPage.knowledgeChunkFallback.test.tsx: with
    both lazy chunks held pending, the Knowledge pane shows the same skeleton
    as the Templates pane (fails with fallback={null}).
    website/src/test/SourcesList.namespace.test.tsx finds the folder path by
    its visible label.

Manual verification

Verified end-to-end against a real Bedrock Managed Knowledge Base
(~45K documents) with profile-based credentials: the raw vector-config call is
rejected (confirming the fallback is load-bearing), the connector returns
scored results whose URLs are the original document links, and the add-source
live probe passes. The screenshot harness
(website/scripts/capture-bedrock-kb-source.mjs) asserts the form's presence,
submit gating, hint text, consent states, add-failure notice, and the 320px
layout (region and profile stack, same width, uncompressed) against the built
SPA.

Screenshots / video

Captured from the real built dashboard by website/scripts/capture-bedrock-kb-source.mjs (stubbed API routes), including a failed remove. The Knowledge tab's loading skeleton only shows while its chunk loads, so CapabilitiesPage.knowledgeChunkFallback.test.tsx pins it instead of a capture. The harness also clicks the Live row's remove control and asserts the confirm message is the no-local-data copy quoted above. Headless Chromium paints no native confirm(), so for the "remove confirm" shot the harness draws that exact message in an in-page stand-in: the frame is the harness's, the copy is what ships.

Remove confirmation on a Live row (dark), the copy the user reads before the destructive click:
remove confirm

Failed remove (dark): the server refused the delete, so the row is restored with "Couldn't remove this source. Nothing was deleted. Try again." inline through ErrorNotice, and "Ask the agent" shows because the Add form is closed (committed at temp-screenshots/bedrock-kb/bedrock-source-row-remove-failed-dark.png):
remove failed dark

Add Source dialog, Bedrock KB type (dark, empty — labelled fields, the region placeholder reads e.g. us-east-1, submit disabled):
empty dark

Filled (dark), consent still ungranted — submit disabled with its adjacent reason:
filled dark

Consent granted — the receipt inside the form, submit enabled:
consent granted

Profile being edited — the card stays in place but inert: no account, no Confirm, and the hint "Finish editing the profile to confirm." until the field commits:
consent pending

Blocked submit — the profile was edited after the grant and Add was clicked: the consent card is focused and ringed, the reason turns warn-toned, the button is disabled again:
consent nudge

Region missing (KB IDs typed, region empty) — the third dead-submit state, with its adjacent reason:

region missing

Region-format warning (malformed region) and add-failure notice (the server's own conflict refusal, inline):
region warning
add error

More states

Filled (light):
filled light

Narrow viewport (320px, dark) — region and profile stack instead of compressing side by side:
filled narrow

Connected source row: "● Live" with a space after the dot, its meaning as visible text, and no sync, staleness or item controls (committed at temp-screenshots/bedrock-kb/bedrock-source-row-live-dark.png):
live row

Local Folder branch, labelled like the Bedrock branch, with example-only placeholders:

folder form

Related Issues

Closes #7947

Related: #14337 (AWS consent is keyed per service; re-keying it per (service, profile, region) is the keyed-grant follow-up, which deletes this PR's one-target conflict code) and #11113 (a health state for the "● Live" row).

Pattern harvest

N/A — feature PR, not a fix/revert.

@jingchaodev
jingchaodev requested review from a team and buluoray September 6, 2026 10:26
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 6, 2026
@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from 686d06f to 05d5325 Compare September 6, 2026 10:36
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of 3567ae1f861c8fb4f958c77a61fc36f2541b2c4f via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Every debounced command-palette query now becomes a paid Bedrock Retrieve to each KB, plus an STS subprocess, because search_for_context always runs the remote leg.

Watch

  • The remote leg runs on a navigation surface. The diff adds results = await asyncio.to_thread(_augment_in_thread) to search_for_context with no way for a caller to turn it off. The command palette's All tab sends each debounced partial query to that same route (allAggregator.search → knowledgeProvider → /api/knowledge/search-for-context, 250 ms debounce). So typing "settings" to jump to a page sends prefixes like "se" and "sett" off the host. Each one is a Retrieve against up to 10 KBs, billed to the user's account, and the palette results wait on the remote time budget. The consent grant was given for knowledge search. It was not given for palette navigation, and nobody watching the palette can tell AWS is being called.
    Clears when: search-for-context runs the Bedrock leg only when the caller asks for it (for example a remote=1param that the@knowledge picker in useKnowledgeFetch sends and the palette provider does not), with a test that a palette search makes no Retrieve call.

Suggestions

  • Make remote retrieval something each surface turns on, not something every caller of the shared route gets. The MCP tool already reaches it through its own remote-search route, so only the dashboard surfaces need the switch.

[DESIGN-REVIEWED] 3567ae1

Description read

[DESCRIPTION-READ] fe2ac7dd8cc728e765b7e2528d381109cf264ff26d9f4a5c07c68b478995a8b7

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 Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 3567ae1f861c8fb4f958c77a61fc36f2541b2c4f via the fork AI-review pipeline — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check one thing before merge: Bedrock KBs can only point at one AWS account. That limit and its conflict code are interim, so the keyed-grant follow-up should be tracked somewhere.

What this change ships

Inventory (10 items) — 10 justified

Intent: let knowledge search answer from a team's existing Amazon Bedrock Knowledge Base (#7947) without ingesting it locally. This is an ADDITION.

  1. The Knowledge tab's add form gets a new source type, "Bedrock KB", with fields for KB ids, region and profile. Only the owner can add or delete one. — justified
  2. The add form shows an inline AWS billing consent card for the profile and region typed in, and Add stays disabled until consent is given. — justified
  3. Knowledge search (the MCP tool and the dashboard's search-for-context) now also queries registered KBs live, merges the hits by rank, and falls back to local-only results on any failure. — justified
  4. A Bedrock source shows as a "● Live" row, is never synced or ingested, and is refused in bundle import and export. — justified
  5. A new internal route, /api/knowledge/remote-search, lets the sandboxed MCP server run the remote search in the gateway, which reads the live consent file. — justified
  6. A new bedrock-kb consent grant, plus per-source attestations pinned to the confirmed AWS account. — justified
  7. A second Bedrock account is refused while one is registered. This is interim; the description says the keyed-grant follow-up deletes it. — justified
  8. Query text is redacted before it leaves the host, and every result string is redacted and then length-capped. A new row is added to the security posture redaction sinks. — justified
  9. A new bedrock install extra (boto3 only). The identity-probe cache is capped at 64 entries because callers now supply the (profile, region) key. — justified
  10. The Knowledge tab on the Capabilities page now loads as its own lazy chunk, so the new form stays out of the main bundle that check-bundle-size.mjs budgets. — justified

[FIRST-PRINCIPLES-REVIEWED] 3567ae1

Description read

[DESCRIPTION-READ] aac22f1d12afb102e961eebabbae62c3773f1bbdc3d88258c5ecbd497d7dfbbe

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 Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🟡 CONCERNS

UX-level review of 3567ae1f861c8fb4f958c77a61fc36f2541b2c4f via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

While the profile is being edited, the consent card says "Finish editing the profile to confirm" but the line below it still says "Confirm the AWS account above", and there's nothing to confirm.

Watch

  • The pending card gives two instructions that contradict each other (attachment-05). The card shows pending_profile_hint ("Finish editing the profile to confirm.") and has no Confirm button. Below it, the line under addKbIds.trim() !== '' && addKbRegionShapeOk && !addKbConsentGranted still says "Confirm the AWS account above to add this source." That condition never checks targetPending. Anyone who changes the profile (frequent) is told to press a button that isn't there, every time, until the field loses focus. Fix: hide confirm_account_to_enable while addKbProfile.trim() !== addKbProfileCommitted, or show the pending hint in its place.
  • The card's title changes as you type (attachments 03 → 05 → 06). The pending row uses confirm_title ("Confirm AWS usage before the first request"). The ask and confirmed states use "Amazon Bedrock (knowledge base retrieval)". Typing a single character turns the card into what reads like a different, generic prompt, and blurring the field turns it back. This is friction on every profile edit. Fix: keep the service title in the pending row and change only the subtitle line.
  • No first-time reader has seen these surfaces. Every new control appears in a screenshot, but this lane has no blind read. Nobody cold has judged "Knowledge Base IDs", the ARN helper, "● Live" or "Confirm and enable". Ask a maintainer to push the branch so the blind read runs.

Suggestions

  • confirm_account_to_enable: make it "Confirm and enable the AWS account above to add this source." so it matches the button label the user has to find.

[UX-REVIEWED] 3567ae1

Description read

[DESCRIPTION-READ] f3aaa8ef699cb65c51845b3af196041210a71086f89c449aef35e130ee5deb80

That sha256 names everything this verdict read: the PR description, plus the 17 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 Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 3567ae1f861c8fb4f958c77a61fc36f2541b2c4f via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 3567ae1

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from 05d5325 to 5eab1e8 Compare September 6, 2026 10:49
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 3567ae1f861c8fb4f958c77a61fc36f2541b2c4f via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 3567ae1

@jingchaodev

Copy link
Copy Markdown
Contributor Author

First Principles round 1 — accepted and applied (head 5eab1e8): top_k was indeed validated and documented with zero consumers — search() derives its per-KB count from the caller's limit alone. Applied the suggested subtraction rather than inventing a consumer: dropped top_k from validate_config, removed DEFAULT_TOP_K, and removed both spec/docstring mentions (MAX_TOP_K stays — it is the fan-out clamp search() reads). PR description updated to match. Connector suite 19/19 after removing the now-moot validation assertion.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from 5eab1e8 to 207fb57 Compare September 6, 2026 11:17
@jingchaodev

Copy link
Copy Markdown
Contributor Author

Round 3 — all findings accepted and fixed (head 207fb57):

  • GPT F1 + Opus (blocking, same finding): add_source ran connector.validate_config inline on the event loop while the bedrock_kb path issues live Retrieve probes. Fixed at the call site with await asyncio.to_thread(...) — same discipline as the sibling discovery walk.
  • GPT F2 (blocking): the bedrock add-form error now renders through inline ErrorNotice (with a comment on why there is no askAgent hand-off: the agent cannot see the unsaved form fields). The pre-existing folder-branch div is untouched — separate surface, grandfathered.
  • GPT F3 (non-blocking, real): ARN inputs are now normalized to their trailing KB ID in _parse_kb_ids — the Retrieve API's knowledgeBaseId field is ID-only, so a forwarded ARN would save a source that never retrieves. New unit test pins the normalization; spec + docstring updated to the honest semantics.
  • Backend Lint (3.12): the two new Python files were not black-formatted (my pre-push floor missed black); formatted with the pinned 26.3.1.

Connector suite 21/21, black/isort/flake8/mypy/tsc green, SourcesList suites 38/38.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from 207fb57 to 3798cb3 Compare September 6, 2026 11:34
@jingchaodev

Copy link
Copy Markdown
Contributor Author

Round 4 — all four items fixed (head 3798cb3):

  • GPT F1 (blocking): Knowledge feature-map row updated to name the Bedrock KB live-retrieval source and the search-for-context endpoint.
  • GPT F2: ValidationException/ParamValidationError are now fatal probe codes — by the time one escapes _retrieve_one the managed-config fallback is exhausted, so what remains is a malformed id/request and the source must be refused at add time, not saved to fail every search. New test pins the rejection.
  • GPT F3: ThreadPoolExecutor import hoisted to module level per top-level-imports.
  • Backend Lint (3.12): the black baseline ratchet — round 3's formatting made 2 baselined files clean; baseline pruned via check_black_formatting.py --update-baseline (1165 remain).

Connector suite 22/22; black gate + baseline check, flake8, mypy green.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from 3798cb3 to f519b8d Compare September 6, 2026 12:18
@jingchaodev

Copy link
Copy Markdown
Contributor Author

Round 5 — both blockers and both findings fixed (head f519b8d):

  • Boot-path eager load (blocking): the handler no longer imports the bedrock_kb module at import time. Registration is a zero-work lazy proxy whose validate_config/fetch load the module on first Bedrock use; detect_changes answers False locally so SyncScheduler sweeps never load it either. Both search legs defer the import into the request path with a comment citing the rule.
  • Unbounded executor queue (blocking): admission is now bounded by a 4-slot semaphore — when every slot is held, new searches fail open immediately instead of queueing. Timed-out futures are cancelled; the slot releases exactly once (worker finally when it ran, cancel-confirmed branch when it never started). Tests pin slot exhaustion (pool must not even be consulted), timeout fail-open, and full slot recovery after the worker drains.
  • Optional-import contract: one module-level try/except ImportError with sentinels; _get_client reports the missing [bedrock] extra. Test pins the sentinel path.
  • Stale client cache: the (region, profile) client cache is gone — a cached client pinned rotated credentials until restart. A client is built per call; milliseconds against a multi-second network budget.
  • Backend Lint (3.12): root-caused to round 3's blanket black run rewrapping untouched lines in two BASELINED files, which the diff-scoped sync-io gate then read as added blocking calls. Reverted the rewraps (files stay baselined), re-applied only the functional edits; the sync-io gate now passes with zero additions.

Connector suite 26/26 (74 with neighbors), black gate + new-files check, flake8, isort, mypy (1302 files) all green; single commit.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from f519b8d to f66dc61 Compare September 6, 2026 13:01
@jingchaodev

Copy link
Copy Markdown
Contributor Author

Advisory rounds (Design / UX / First Principles) — addressed (head f66dc61):

  • Design: remote relevance floor — added MIN_REMOTE_SCORE = 0.25 (live probes against a real ~45K-doc KB scored relevant hits 0.43-0.60); sub-floor hits are dropped before the merge, so an off-topic KB can no longer occupy interleaved slots. Test pins it.
  • Design: duplicated merge snippet — both retrieval surfaces now call one augment_with_remote() helper.
  • Design: serial remote leg — deferred as a follow-up: overlapping local+remote saves at most the local-search latency in the worst case, and the concurrency plumbing (kick off before the embed-pool call, join after) is not worth the complexity until someone measures the stack-up. Declared here rather than silently skipped.
  • UX: dead row — a connected KB row now shows a Live badge and a '● live' meta chip (i18n'd in all locales) instead of 'pending / 0 items / Never synced', and the Sync button is gone for live sources. Test pins the presentation.
  • First Principles: undeclared riders — both now declared in the PR description (the all-connector to_thread validate and the bedrock-kb:// prefix exemption).
  • First Principles: drop the lazy proxy — declined with reasons: the proxy keeps the whole bedrock_kb MODULE import off the boot path (not just boto3), and the module-level sentinel import shape was itself requested by the GPT round-5 optional-import finding; both blocking lanes are green on exactly this shape, so re-cutting it would churn settled findings. Happy to revisit if a maintainer prefers the cloudwatch.py convention.

Backend 26/26, frontend SourcesList suites 52/52, i18n 19/19, tsc, black/sync-io/brand ratchets green; single commit.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from f66dc61 to cc3794f Compare September 6, 2026 13:15
@jingchaodev

Copy link
Copy Markdown
Contributor Author

Round 7 — security finding fixed (head cc3794f): the remote query is now passed through redact_credentials() + redact_exfiltration_urls() at the connector's search entry — the ONE leg of knowledge search that leaves the host. Redaction is byte-identical for ordinary queries, so local search semantics are untouched and the subsystem's raw-query contract for local legs stands (the adjudication annotation is right that the destination is the user's own account; defense-in-depth here costs nothing, so complying rather than contesting). New test pins that a credential-shaped token never reaches the Retrieve call while ordinary text survives. Connector suite 26/26; black/isort/flake8/mypy/sync-io green; single commit.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from cc3794f to 1459ff6 Compare September 6, 2026 13:37
@jingchaodev

Copy link
Copy Markdown
Contributor Author

Round 8 — security finding fixed as prescribed (head 1459ff6): Bedrock KB retrieval is now registered with aws_consent (SERVICE_BEDROCK_KB, labeled for the consent cards) and BOTH egress paths gate on the account-bound authorization — validate_config refuses before constructing a client (a repointed profile cannot receive even the access probe; the error names the consent page), and search() contributes nothing for an unconsented/revoked source (denial logged + audited by the consent layer). The consent bridge runs the async check via asyncio.run from the always-off-loop call sites and REFUSES on any failure mode, including the on-a-running-loop edge — fail-closed everywhere, matching the module's contract. Also fixed the stale _parse_kb_ids docstring (non-blocking finding). Tests: consent-refused paths pinned for both validate and search (the client factory asserts if ever consulted without consent); consent module suite + connector suite 185/185 green; live retrieval re-verified against a real Managed KB on this exact head. Spec documents the gate. Single commit.

@jingchaodev
jingchaodev force-pushed the feat/bedrock-kb-connector branch from 1459ff6 to 12438f9 Compare September 6, 2026 14:04
@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • The dark-row recovery text in _source_exists_response (span=bfc26fe5f3f8): rebutted

Not a stopgap for the one-target rule: it serves the account pin. A grant confirmed for another account leaves the row's attestation outside attested_sources, so the row is dark, and re-adding the same knowledge base lands on 409 source_exists. The text names the recovery that works: remove the source, then add it again.
Keyed grants keep the account pin (the attestation records the confirmed account), so the same dark row and the same recovery exist after the follow-up, and the text stays.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • remote_search sends raw, unredacted connector output into the agent's context (span=cdeffa2cbab2): rebutted

The agent never receives the route's raw payload. POST /api/knowledge/remote-search refuses every caller without internal_auth with a 403 (dashboard/handlers/knowledge.py:3472). Its one caller is the MCP tool's _fetch_remote_results.
local_knowledge_search merges those hits with the local ones (mcp_tools/knowledge.py:315), renders the output, and runs redact_exfiltration_urls then redact_credentials over the whole string before returning it (:377-378). The dashboard search redacts each merged hit with _redact (dashboard/handlers/knowledge.py:3379). search_for_context uses the same _redact (knowledge/ingestion.py:406): the same two functions, in the same order.
Probe: a Bedrock hit carrying a GitHub token, an AWS key id and a credential-bearing URL, sent through local_knowledge_search, came back with all three redacted.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Placeholders read as filled values (span=bdedaa3d8a32): fixed in b9a05df55 (b9a05df)

Accepted: both placeholders now start with "e.g.", so an empty field cannot read as a typed one. The region field shows e.g. us-east-1 and the folder field e.g. /home/user/notes.
Both are catalog strings in all 12 locales, each in its locale's own "e.g." form (z. B., p. ej., 例: and so on), not English literals. The placeholder color stays the theme's muted one.
The retaken "empty dark", "region missing" and "folder form" shots show both.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • The consent card can name a different profile from the field (span=e458545f43d2): fixed in b9a05df55 (b9a05df)

Accepted in part. The card names the profile committed on blur, so while the field had typed past it, the two disagreed. Now the card is withheld until the field's value is committed, and then it comes back for that profile: the same absence the card shows while its own probe runs.
A click on "Confirm and enable" straight after typing could not approve the old profile even before: the mousedown blurs the field and re-targets the card first. The mismatch in attachment-04 came from the capture fixture, which returned a fixed profile. The fixture now echoes the requested profile, as the real GET does.
Pinned by a vitest in SourcesList.bedrock.test.tsx that types past a committed profile, and mutation-checked: rendering the card unconditionally fails it. The retaken nudge shot shows the field and the card both naming my-team-profile-2.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • No screenshot shows the new remove confirmation for a Live source (span=0b99b7c853b4): fixed in b9a05df55 (b9a05df)

Accepted: the description now carries a "remove confirm" shot of a Live row with its confirmation open.
The row asks through the browser's native confirm(), which headless Chromium does not paint. So the harness replaces window.confirm with an in-page stand-in that shows the exact message the row passes, and checks it against the catalog copy: "Remove this knowledge base source? Nothing is stored locally; the knowledge base itself is not touched." The frame comes from the harness; the copy is what ships.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • kb_ids_comma_separated_id_or_arn: the helper repeats its label (span=2d6e14ff5088): fixed in b9a05df55 (b9a05df)

Accepted: the helper now gives only the format and an example, "Comma-separated, e.g. KXABC12345 or arn:aws:bedrock:…:knowledge-base/KXABC12345", in all 12 locales. The French string also gains the ARN example the others had.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • The one-target conflict error says "remove that source first" but gives no way to do it (span=f12a28e862af): rebutted

The error already names the held source ("{name} already uses a different AWS profile or region…"), and that source's row, with its remove control, is on the same Sources tab right below the form. Cancel closes the form.
A link or scroll target would be new UI for a message the keyed-grant follow-up (#14337) deletes along with the one-target rule. The spec now records that removal.

@jingchaodev

Copy link
Copy Markdown
Contributor Author

Pushed b9a05df55, rebased on main 548ac5f7a, still one commit. It answers every item the five review lanes raised on 8ba3cd99d.

  • GPT (2 blocking) and the Semgrep red: both point at the same three test lines, and all three are fixed. The timeout test holds its worker on an event instead of timing a sleep, the autouse consent fixture patches through _floor_monkeypatch, and the delete test scopes its failing revoke with monkeypatch.context().
  • First Principles item 7: compare-and-delete and grant_id are now bedrock-kb only. Polly, Transcribe, S3 and Cost Explorer revoke key-wise, and their stored grants have main's shape.
  • Design: the knowledge spec now states that existing bedrock-kb.sources attestations need no migration for keyed grants, and which one-target code the follow-up deletes. The redaction suggestion does not hold: every path that hands Bedrock hits to the agent redacts them (call chain in the reply).
  • UX: fixed the placeholders (now "e.g. …"), the consent card naming a stale profile, the helper that repeated its label, and the missing remove-confirm shot. The conflict-error link is answered in its reply.
  • Screenshots: 11 are retaken on this head, including the new remove confirmation. The two committed row shots are unchanged.
  • Sensitive Change Review stays red on this PR by design: it refuses every fork PR that changes a sensitive path, and this one adds one _REDACTION_SINKS row to src/kiro_crew/security_posture.py for the Bedrock query egress. That row is required: test_every_redactor_call_site_is_a_registered_sink_or_allowlisted fails without it.

@jingchaodev

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • SQL clipping lets unattested clones inherit approval (span=d9c396c835f0): fixed in a2e317f0c (a2e317f)

Accepted as stated and reproduced on a real SQLite store: a row whose id and uri are an attested row's values plus a NUL suffix is a distinct row, but substr returned the attested values, so the clone matched the attestation.
_BOUNDED_ROW_SELECT now also selects (id = substr(id, 1, 64) AND uri = substr(uri, 1, 256)) AS identity_exact. _row_is_attested refuses a row with identity_exact 0 before any attestation match, with its own denied line ("identity changed under the SQL bound"), and the one-target lookup skips such a row.
Pinned by test_sql_projection_rejects_nul_suffixed_identity_clone: one paid Retrieve (the owner's) and exactly one denied line. Mutation-checked against the old projection and against a silent WHERE filter, which drops the audit line.

@jingchaodev

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Truncation exposes credential fragments before redaction (span=d9c396c835f0): fixed in a2e317f0c (a2e317f)

Accepted as stated and reproduced with the real redactors: a 40-character AWS secret across the 200-character title cut kept 39 characters, and neither the MCP output pass nor the dashboard's _redact recognised the fragment.
The connector now runs each complete content, title, citation URI and source-name value through redact_via_context before it clamps it. For a source name the SQL would have clipped, the SELECT returns NULL and the result names the source Bedrock KB <validated kb id>, so no clipped prefix is ever shown.
Pinned by test_search_redacts_complete_result_values_before_clipping and test_sql_clipped_source_name_uses_the_kb_id_fallback. Mutation-checked: putting the slice first fails the first test for each of the four fields, one at a time, and a SQL prefix clip fails the fallback test.

@jingchaodev

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • New form controls bypass required shared primitives (span=89f91980d414): fixed in a2e317f0c (a2e317f)

Accepted: the blocking page-layout-pattern rule (item 5) requires Input and Btn for new controls.
The Bedrock branch's four inputs are Input and its Cancel and Add buttons are Btn, with every id, label, aria-label, handler (the pointerdown profile commit included) and disabled condition kept. Controls main already had are unchanged.
Pinned in SourcesList.bedrock.test.tsx, which checks the shared styling on the fields and buttons. Mutation-checked: a raw input loses focus-ring and a raw button loses font-body, and each fails the test.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Config split across two stores (span=453e7e461b4b): needs-a-decision

Today's guarantee: every search compares the row's (id, uri, kb_ids, region, profile) with the sealed attestation, and a row that differs is skipped with its own denied line before any Retrieve. So a tampered row cannot widen the queried KB set; the tampered-row and planted-row tests pin that.
The split this item describes is smaller and equally safe if every paid request compares the complete sealed entry: an analysis of bedrock_kb.py puts it at about 25-35 lines added and 70-90 removed, with 70-100 test lines rewritten, and it would make the SQL identity check unnecessary because the query would select attested ids by exact equality.
Question for a maintainer: switch the retrieval parameters to the attestation in this PR, or land the current check and take the switch as a follow-up? This PR does not choose for you, because it moves the paid-request authorization path late in review.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Make the attestation the only source of the retrieval parameters (span=2feb7c1ffedc): needs-a-decision

The same change as the span=453e7e461b4b Watch item, and the same question to a maintainer: in this PR, or as a follow-up. The current per-search comparison already stops a tampered row from widening the queried KB set; the switch would remove most of the SQL clamping and window logic around it.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Item 3: the MANAGED-type fallback claim rests only on mocked responses (span=1e9058cbdc6e): fixed in a2e317f0c (a2e317f)

Both clear conditions are now in the spec. It cites the AWS reference KnowledgeBaseRetrievalConfiguration, where managedSearchConfiguration and vectorSearchConfiguration are both members of the Retrieve request's retrievalConfiguration.
It also quotes the rejection the fallback matches: MANAGED_ERR in test/test_bedrock_kb_connector.py, recorded from a live Retrieve against a MANAGED-type knowledge base (botocore 1.43.89): "vectorSearchConfiguration is not supported for managed knowledge bases. Use managedSearchConfiguration instead."

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • The consent card disappears on the first keystroke in the profile field (span=921e6890b664): fixed in a2e317f0c (a2e317f)

Accepted: the card no longer unmounts. While the field differs from the profile the card names, AwsConsentGate renders the same card in a pending state (aria-disabled, no probe, no old profile and no Confirm), and the commit on blur re-targets it to the field's profile.
Pinned by the updated vitest in SourcesList.bedrock.test.tsx (card present and inert while typing, re-targeted after blur, no extra probe). Mutation-checked: unmounting it again fails the test.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • The Live row uses the folder-sync glyph (span=ad1364ef3897): fixed in a2e317f0c (a2e317f)

Accepted: Live (bedrock_kb) rows now use the Database icon, the same one the type button uses, so the row no longer suggests a folder that syncs. The retaken "live row" and "remove failed" shots show it.
Pinned by an icon assertion in SourcesList.bedrock.test.tsx; putting FolderSync back fails it.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • The one-Bedrock-target refusal arrives last (span=87e7a3b0367b): rebutted

The order is real, but it reaches only an owner who adds a second Bedrock profile or region while one is registered. The keyed-grant follow-up (#14337) deletes that refusal together with the one-target rule, as the knowledge spec now records.
Showing it before Add needs new API surface: a conflict field on the consent GET, read by the card and the form, about 25-35 production lines across four files plus tests. That is a lot of new surface for a message the follow-up removes. The consent POST and the add route keep refusing the second target, so nothing is recorded or billed for it.

@jingchaodev

Copy link
Copy Markdown
Contributor Author

Pushed a2e317f0c, rebased on main 97fdb002d, still one commit. It answers every item the five review lanes raised on b9a05df55.

  • GPT (3 blocking): all fixed. A row whose id or uri a NUL suffix changes under the SQL bound is refused with its own denied line; every hit string is redacted whole before it is clamped, and an oversized source name reads back as NULL with a Bedrock KB <kb id> fallback; the Bedrock form uses the shared Input and Btn.
  • First Principles: the spec cites the AWS Retrieve reference and the recorded MANAGED-KB rejection for the fallback.
  • UX: the consent card stays in place but inert while the profile is retyped, and Live rows use the Database icon. The early-conflict request is answered in its reply.
  • Design: moving the retrieval parameters to the attestation is a maintainer decision; the question is in the span=453e7e461b4b reply.
  • Screenshots: 11 retaken on this head; the two committed row shots are updated for the new icon.
  • CI on b9a05df55: Frontend Tests (1) had two failures. The French helper string was this PR's and is fixed. focusRingContrast fails on website/src/pages/chat/AskAnswersCard.tsx:41, which main's feat(ask_question): block and return answers as the tool result #15250 added; this PR does not touch that file, and main fails the same test. Sensitive Change Review stays red on a fork PR that changes security_posture.py, as before.

A bedrock_kb source points at existing Bedrock Knowledge Bases in the
user's own AWS account and is queried live at search time - no local
ingestion, no stored credentials (profile name only, resolved through
the standard AWS chain at call time). Results merge into
local_knowledge_search and the dashboard's search-for-context by rank,
under a 5s fail-open budget, so a slow or broken KB never breaks
knowledge search.

Retrieval tries vectorSearchConfiguration and falls back to
managedSearchConfiguration when the ValidationException names it:
MANAGED-type KBs reject the vector key. Citations come from the
source_uri metadata attribute so hits link to original documents
rather than S3 objects. Every string a hit keeps is clamped before the
result is kept: title and source name at 200 characters and source URI
at 1024 (the local knowledge path's own ceilings), content at 10,000
(the local embedder's per-chunk fold budget), and the summary is taken
from the clamped content. boto3 ships as a new optional [bedrock] extra.

Registering a source is an owner action, by the same rule the consent
endpoints apply: add_source refuses a bedrock_kb body from a non-owner
dashboard caller or an app token before validation, since validation
probes the KB with the owner's credentials and the insert registers a
KB against the owner's grant. Local sources keep their existing path.
The bundle routes are no way around it: import_bundle refuses a
bedrock_kb row, and a row of any type carrying a bedrock-kb:// uri,
which would squat the handle the owner's add dedupes on (both counted
and audited), and export_all leaves bedrock_kb rows
out, since a bundle carries no consent, validation or target check and
a live account binding with no items is not knowledge. An item that
names a refused row, or an already-registered bedrock_kb source (its id
is on the sources list every authenticated caller can read), is refused
and counted with its locations, mentions and relations, so no local
content lands under a live-only source and no crafted item fails the
whole import on its FK. Only a refused row or item that carries an id
joins its refused set, and a dependent is matched only when its own id is
not null: str(None) is the text "None", which a bundle can also spell as
a source or item id, so a local source called "None" keeps its items and
an evidence-free relation is not dropped because a refused item was
called "None". "No items" is enforced where an item comes to name a
source: add_item and add_source_location_in_txn raise
LiveSourceHoldsNoItems for a source_id naming a bedrock_kb row (one
primary-key read inside the write transaction), and the agent's
ingest-text route, which takes any existing source id, refuses such a
target with 409 live_source_holds_no_items before reading the body.
Without that rule the export filter would be the defect: an item
written under a bedrock_kb row would travel while its source row does
not, and a clean store's import would trip the items.source_id foreign
key and roll the whole bundle back. The locked insert also requires the
grant's account to be the one validation verified, which
validate_registration returns: STS resolved the credentials to it, the
grant read after that call named it, and every probe rechecked that
grant. An account read before validation would match a grant that moved
to another account and back while the probes ran. Same target is not the
same account either, and a same-target confirmation for another
account landing during the seconds of validation would otherwise be
attested for a KB never validated there (409 bedrock_kb_grant_changed);
record_source_attestation takes that expected account and refuses to pin
any other. revoke_source_attestation reads the store strictly: an
unreadable store raises (the route deletes nothing) instead of reading
as nothing attested, which would leave the approval on disk for a row
re-minted under the same id to inherit. export_all leaves out items a
direct write planted under an account-bound source, with the locations,
mentions and relations riding on them, so an export never names a row
it dropped. The deletion paths hold the same line: delete_source_cascade
and delete_items_batch_in_txn pick a surviving item's new owner from
_reassignment_candidates, the holders that are not account-bound, so a
planted location row never makes a bedrock_kb row own a local document
(the document would survive live and vanish from every bundle); an item
whose only other holders are account-bound goes with its owner, and the
planted row with it.

The row itself is not the registration; the attestation is. knowledge.db
is agent-writable in-sandbox (the MCP server ingests into it in-process,
and the sandbox seals neither workspace/knowledge nor the file), so a
bedrock_kb row on its own proves nothing about who put it there: an
agent could clone one, or point a clone at any KB the granted profile
reaches, and the enumeration would pay to query it. The owner-gated,
consent-checked insert therefore also records the row in
aws_service_consent.json (aws_consent.record_source_attestation, under
the bedrock-kb.sources key beside the grants, written under the same
lock; the file is in the sandbox's read-only leaves, so only the gateway
writes it), pinned to the row's id, uri and retained
kb_ids/region/profile, and to the account the grant confirms at that
moment: a profile name is not an account, and re-pointing the profile
then confirming again keeps the same profile and region, so without the
account the old registration would authorize paid retrieval of the same
KB id in the new account. attested_sources returns only entries recorded
under the current grant's account; a grant confirmed for another account
leaves every earlier registration unattested until the owner removes the
source and adds it again. A plain re-add is not that recovery: it
dedupes on the row's uri and only a row the add creates is attested, so
for this type the 409 source_exists text names the remove-then-add path.
The two writes of an add and of a delete are not one
transaction, so each fails in the safe direction: an attestation write
that fails undoes the insert (bedrock_kb_attestation_failed, no row),
and a delete revokes the attestation first (a failed revoke deletes
nothing), so a failure between the two leaves at worst a dark row a
retry removes, never an attestation without a row that a later row
minted under the same id and values would inherit. Deleting a
bedrock_kb row is owner-only like adding one; a local source's delete is
not gated. Whether a row is a Bedrock row is decided from the sealed
attestation under its id (has_source_attestation, read strictly before
the row's type is trusted) or from its source_type, never from the type
alone: that column lives in the agent-writable knowledge.db, so a
registered row an agent re-labelled as a local one would otherwise skip
both the owner gate and the revoke and leave its attestation for a row
re-minted under the same id and values to inherit. Every retained field is bounded where it is retained: region
and profile pass aws_consent.target_is_well_formed (the shapes a grant
can be confirmed under) in validate_config before any probe and again in
retained_properties (bedrock_kb_config_invalid).
search_remote_sources reads the attestations once per enumeration and
searches only rows that still match one; a row that does not (a clone,
or an attested row whose stored KB set was widened afterwards) is
skipped before any consent or credential work, with an
aws_consent.denied SEL line naming the row id, not its KBs or the
account. Registration and the enumeration share MAX_BEDROCK_KB_SOURCES
(64). The owner-gated insert refuses a new registration once that many
attestations are recorded under any account (409
bedrock_kb_source_limit, before either write); a full population first
revokes each attestation whose row is gone, since the delete route
answers 404 for a missing row. The enumeration reads at most that many
rows, attested ids first, so every registration fits in its window, and
an overflow written outside the insert is counted in one warning per
search. It checks the search budget before any per-row
work, so rows planted in knowledge.db cannot push a registered source
out of the window or the budget. Both reads of bedrock_kb rows cut every
column in SQL (id 64, name 200, uri 256, properties 1024 characters,
each above what an insert writes), so a planted field never reaches
Python whole. Only a row an attestation pins holds
the one target, under any account (recorded_source_attestations), and
the target lookup fetches only those rows: a
row written straight
into knowledge.db is never searched, so it cannot refuse the owner's
grant or registration. The one-target compare is the one place a
sources row's name becomes operator-facing text (both conflict
refusals show it), and the attestation pins the target, not the name,
so an agent can rewrite a registered row's name past the handler's
name bound. The compare therefore
renders it through the platform shim redact_via_context (a composed
companion policy's shapes on top of the OSS baseline; never
security.redact directly) before either payload is built:
a credential or exfiltration URL in the name arrives as the tag, the
profile and region stay readable. Both refusals are 409s: the request
is well formed and the conflict is with registered state the owner can
change. The consent POST's bedrock_kb_conflict_check_failed (503)
covers the lookup alone; a grant write that fails propagates as the
unhandled error it is, for every service, like the other consent
writes. The POST names the connector only inside the worker that
records the grant, and only for bedrock-kb: the module imports boto3 at
its top, so naming it on the loop would stall every task for the
import, and a Polly or Transcribe confirmation never loads it. The
query leg, the one part of a
search that leaves the host, goes out through the same shim. Its
baseline runs the URL pass first: a credential inside a URL's query string
blanked ahead of the URL pass leaves a placeholder the URL matcher
does not recognise, and the host and the rest of the query survive.

add_source checks the body's shape once, before any field is read:
every text field must be a string or absent and properties an object,
else 400. kb_ids is the one caller-supplied field a source retains and
re-parses on every search, so it is bounded where it is parsed: at most
10 entries (also the per-search fan-out cap), each raw entry at most
128 characters, each normalized id exactly the 10-character shape the
Retrieve API accepts; validate_config refuses the first violation by
name before any probe, so nothing out of bounds is probed or stored.
The insert stores the connector's retained_properties: exactly the
three keys it reads back (kb_ids, region, profile), each in the
validated form the gates judged rather than the caller's raw spelling
(canonical bare ids; stripped region and profile), so the row's size
follows the gates' own bounds instead of the request-body cap and it
never carries a field nothing reads. The row's uri, the UNIQUE dedup
key, is the server's canonical_source_uri(retained), never the
caller's: a caller-chosen handle could mint a row per request for one
knowledge base, each with a name up to the body cap; the derived one
names the sorted full id set, so it is one per distinct set of knowledge
bases: the same ids in any order dedupe to one row (one Retrieve per KB
per search, not one per spelling) and a set sharing only a first id with
an existing row is a different source, not a false 409.
The form posts no uri for this type, and its default name is the bare
first KB id (an ARN's trailing segment), since an ARN carries the
account id and name is a column every authenticated caller can list.
add_source bounds name itself, for every source type, at the 200
characters the rename endpoint already enforces (400 name_too_long
before any branch runs): the add path must not admit what a rename
would refuse, or a valid request lands an oversized row the list
serves back on every read. A blank name falls back to the uri, cut to
that same ceiling once for every insert. The error-code baseline is
re-snapshotted for the one site the shape gate removed (knowledge.py
missing_code 60 -> 59).

The per-KB recheck runs immediately before every paid request and
derives two facts from ONE read of the consent store
(aws_consent.bedrock_authorization_snapshot): the grant is still the one
the frozen credentials were verified against, and the row the search
runs for is still attested under that same grant. Two separate reads
would let a same-account grant for another target, published between
them, pass a client frozen against the old grant: the attestation
filter compares accounts only. The enumeration checks the registration
once when it starts, but a delete landing during a search revokes the
attestation and leaves the grant in place, so a grant-only recheck
would let the rest of that search keep billing for a source the owner
had just removed. A retrieve
the recheck refuses writes its own SEL denied event naming the KB and
which check refused, so the audit log holds every paid request that did
not happen; the
freeze-verify refusal in _get_client (no grant, another account, or a
grant confirmed for a different profile/region) writes the same denied
event naming the target and the check that refused, before any client
is built. The
managed fallback is checked against the search budget like every other
request: a rejection slow enough to spend it leaves the fallback
unissued. The identity-probe cache in aws_consent, keyed on a
caller-supplied profile and region, keeps at most
_PROBE_CACHE_MAX_ENTRIES entries and drops expired ones on each write.
A pointer
submit with an uncommitted profile is answered at pointerdown, before the
input's blur can disable the button under the click. A successful add
resets the committed profile with the field, so a reopened form gates
on the blank profile it shows instead of the one just added. A filled form with
a disabled Add always says why beside the button (region missing,
region malformed, account unconfirmed); a Live row states what live
means as visible text; a remove that fails shows its error on the row
it restores, with the agent hand-off only while the add form is closed,
since the hand-off navigates away from the form's unsaved fields; the
folder branch carries visible labels too,
because a placeholder disappears once the field has text; the
region/profile pair stacks below the sm breakpoint instead of
compressing side by side at 320px.

The translated copy uses each locale guide's informal register (du,
tu, ты, तुम), which the catalogs' style tests hold changed values to.
The 14 keys x 13 locales grow the eager `all` catalog chunk
(src/i18n/all.ts, the 13 catalogs plus the entry, with no module to
split) by about 12.6 KB, under that entry's ceiling on main, so this
change touches no budget. The
add form's growth of SourcesList would cross the App chunk's first-party
ceiling, so CapabilitiesPage loads the Knowledge tab through lazy() +
Suspense, the boundary App.tsx already gives SessionsPage and
MembersPage: the sources list, the ingestion controls and this form
become their own chunk that only the Knowledge tab fetches, and the
tab's ErrorBoundary covers that load as it covers the Graph chunk.
While that chunk loads, the pane shows the ContentSkeleton the
Templates tab shows for its own chunk.

Closes kirodotdev#7947
@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Same badge, two meanings, and no screenshot of the pending row (span=03e6762cdc6c): fixed in 3567ae1f8 (3567ae1)

Accepted, both parts. The pending row now carries one muted line, "Finish editing the profile to confirm.", so a user who sees "Not enabled" with nothing to click knows that leaving the field brings Confirm back. The string is a catalog key in all 12 locales, in each locale guide's informal register.
The description now has a "consent pending" shot: a valid region, the profile retyped and the field still focused, and the inert card with the hint and no Confirm. The capture harness asserts that state before it takes the shot.
Pinned by the inert-card vitest in SourcesList.bedrock.test.tsx, which now checks the hint while the profile is pending and its absence after the blur. Mutation-checked: removing the line fails the test.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • _fetch_remote_results drops the caller's namespace (span=d35cd85b04c1): fixed in 3567ae1f8 (3567ae1)

Accepted as stated. Namespaces live on items.namespace, and the store refuses items for a bedrock_kb source (_refuse_live_source), so no remote hit can fall inside a namespace. local_knowledge_search now runs the remote leg only when namespace is unset, as suggested: a namespace-scoped search makes no call to /api/knowledge/remote-search and answers from local results. An unscoped or source_id-scoped search keeps the leg as before. The dashboard's search_for_context takes neither scope, so the MCP tool was the only affected path.
The knowledge spec's remote-leg bullet now states how each scope composes with the leg.
Pinned by TestKnowledgeSearchRemoteLegScope in test/test_mcp_knowledge_search.py, which runs end to end over a real store with a registered bedrock_kb row. Mutation-checked: with the old condition, the namespace test fails because the remote leg is called.

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Duplicated registry (span=9f98cae8c27d): needs-a-decision

Why the row stays today: every existing reader of knowledge sources works from knowledge.db. The Sources list, rename, delete and the source counts all read that table, so a Bedrock source with no row would need its own path through each of them. The attestation is the authority that makes a row searchable; the row is the record those readers already handle.
Moving registration off knowledge.db entirely is the larger form of the span=453e7e461b4b question already put to a maintainer (read the retrieval parameters only from the attestation). Question for a maintainer: keep the row as the readers' record with the attestation as the authority, as shipped, or move to an attestation-only registry, in this PR or as a follow-up?

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Interim code for one account at a time (span=7e56b58bd197): needs-a-decision

The clear condition is a maintainer's to meet: confirming that #14337 (keyed grants) is scheduled, or landing it first. This PR cannot schedule it.
What this PR does to keep the cost low: the knowledge spec states that existing bedrock-kb.sources attestations need no migration under keyed grants and names the code the follow-up deletes (registered_target_mismatch and both bedrock_kb_target_conflict refusals). Question for a maintainer: is #14337 scheduled, or should this PR wait for keyed grants?

@jingchaodev

Copy link
Copy Markdown
Contributor Author
  • Item 5: the one-target code treats a symptom of one grant per service (span=5d254512a085): needs-a-decision

Agreed on the cause: the refusals exist because the consent store keeps one grant per service. Keying grants per (service, profile, region) inside this PR would change the consent store for Polly, Transcribe, S3 and Cost Explorer too, which the span=e0c96b45f862 round asked this PR to leave as on main.
So the clear condition that fits this PR is the second one. Question for a maintainer: do you accept shipping the one-target refusals now and deleting them in #14337, or should keyed grants come first?

@jingchaodev

Copy link
Copy Markdown
Contributor Author

Pushed 3567ae1f8, rebased on main 63c155a58, still one commit. It answers every item the five review lanes raised on a2e317f0c.

  • UX (block): fixed. The pending consent row carries the hint "Finish editing the profile to confirm.", and the description now has the "consent pending" shot of that state.
  • Opus: fixed. A namespace-scoped local_knowledge_search no longer calls the Bedrock remote leg.
  • GPT: no blocking findings on a2e317f0c, per its check run. Its PR comment kept the b9a05df55 stamp, so this push re-runs that lane.
  • Design and First Principles: the duplicated registry and the interim one-account code need a maintainer ruling; each question is in its own reply.
  • CI on a2e317f0c: Backend Tests shard 4 (Linux and Windows) and the Coverage Gate failed on two test_aws_consent.py tests. Their mock rows lacked the new identity_exact column; this push fixes the helper. Sensitive Change Review stays red on a fork PR that changes security_posture.py, as before.
  • Rebase: main's upload size limit (feat(dashboard): configurable upload size limit, default 100 MB #18617) touched the same locale block and SourcesList.tsx. Main's keys are kept beside this PR's one new key, and the ErrorNotice import that main now adds is no longer added twice.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks @jingchaodev for the thorough work and the per-finding dispositions. The maintainer confirmed this feature is wanted. Because this PR changes a sensitive path, the Sensitive Change Review gate cannot pass on a fork, so it continues in #26988 on a branch of this repository. Your commit is kept as-is with you as the author. That PR is rebased onto current main; main had split the knowledge store and the knowledge handlers into owner modules, so the changes were ported into those owners without changing behavior, and the temp screenshots and capture script were dropped. This PR stays open until #26988 merges.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you for this work, @jingchaodev. Your Bedrock Knowledge Base change has landed on main through #26988, which carried your commit over to a branch in this repo (a fork PR that touches a sensitive path cannot pass the Sensitive Change Review gate). Your authorship is kept on the merged commit. Closing this PR because #26988 supersedes it. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable knowledge backend: use an Amazon Bedrock Knowledge Base as a retrieval source

3 participants