feat(query): read-side multi-source — connectable pool, provenance, fail-loud client#68
Merged
Conversation
Clears the BUNDLE_DOT_STALE warning from the full bundle validation (scripts/validate-full.sh → validation_mode: full, overall PASS). 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
b5eaccc to
2855ee1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delivers read-side multi-source support for the context-intelligence query tools (
graph_query,blob_read): the graph-analyst can now select and connect to any endpoint in a merged connectable set (configuredsources∪ hookdestinations), every result is provenance-tagged so the user always sees which source answered, and the client fails loud instead of silently swallowing failures.This builds on the single-source selection foundation (fail-loud on unknown/ambiguous source) originally authored by @bkrabach in #67 — that commit (
3287df4) is included here as the base. This PR carries the complete, proven, validated capability as one self-contained unit.What's delivered
Selection (base, from #67) — optional
source=<name>selector; fail-loud on unknown source (enumerates valid names) and on ambiguity (2+ sources, no pointer); per-entry source validation.Phase 0 — fail-loud client —
AsyncCIClient.cypher()/fetch_blob()/list_blob_keys()now raise a classifiedCIClientError(connection_error | timeout | http_status | decode_error) instead of swallowing failures to[]/None/set(), plus a real per-sourcerequest_timeout(default 30s; non-positive → 0.1s floor). A down / 500 / hung source surfaces assuccess=False— never a silent empty result. Genuine empty-200 still succeeds.reconstruct/callers surface failures instead of silent partial reconstruction.Connectable set — merged pool = tool
sources∪ hookdestinations. Explicitsource=<name>selects across the whole pool (you can name a destination too);list_sources: truereturns{"connectable_set":[{name,url,origin}]}(no api_key); source-wins on name collision. Default resolution: 1 source → it; 2+ sources + no pointer → fail-loud; 0 sources → first destination (established fallback, no fail-loud). Resolver consolidated intoresolve_query_connection.Source provenance — visible to the user —
graph_querysuccess returns{"source":{name,url,origin},"rows":[…]};blob_readsuccess adds asourceblock; failures carrysourceonce an endpoint is resolved. The graph-analyst agent + SKILLs now state which source produced the answer.graph_queryoutput changed from bare rows →{source, rows}to surface provenance. The tool is only visible to agents inside this bundle (no external consumers), and every in-repo consumer already speaks the new shape — no external contract to break.list_blob_keyscorrectness (found via live testing) — parses the server's{"blobs":[…]}envelope and returns bare keys (was silently returning empty against the real server, and would have double-prefixedci-blob://onfetch_blob).Docs / diagrams / tooling —
config-resolution.dot/.pngrewritten (it is @-mentioned into the graph-analyst agent); README read-path contract section; corrected example return-shapes;ruff+pyright(1.1.411) dev deps; repo-wideuv.lockrefresh (every package passesuv lock --check); regeneratedbundle.dot/bundle.png.Verification — end-to-end, real
Unit / integration (green): module
tool-context-intelligence-query192 passed, top-level 753 passed;ruff check+ruff format --check+pyright(1.1.411) clean.uv buildsucceeds for all 4 packages;uv lock --checkclean repo-wide. Real end-to-end tests use liveThreadingHTTPServersockets (not mocks).Full bundle validation (
scripts/validate-full.sh→validation_mode: full): PASS — all 10 bundles load via BundleRegistry asgood; packaging, hygiene, context-sink, tool-placement, YAML-lint all pass. The lone mode ERROR is a documented false positive (name collision), confirmed against source per the repo'sAGENTS.md.Live DTU runs against production endpoints (read-only). Two distinct real DBs —
private-home-server(1,072,740 nodes) andteam-shared(541,677 nodes). Provenance verifiably names the endpoint that actually answered (node counts track the named source, never cross):list_sourcesallorigin=source; no api_keylist_sources= union (both origins); explicit source and explicit destination both reach real servers; default → source wins; collision → source winsconnection_errorfail-loud (not silent empty)blob_readsuccess + provenance — proven live: a real 476 KB server-minted blob fetched viaBlobReadTool.execute(), provenance for bothsourceanddestinationorigins; 404 + down-endpoint fail-loud carry provenance.list_blob_keys→fetch_blobchain — proven live: 163 bare keys (sync == async);fetch_blob(session, bare_key)composes a clean/blobs/{sid}/{key}path (no doubled scheme); reconstruct metadata enrichment resolves live.Review: six-lens
/council×2 (both surfaced blockers fixed) + a dedicated restless-old-brian ship-gate (GO). Two live-only bugs were caught by the live runs and fixed, each re-proven live.Relationship to #67
This PR incorporates and completes the work in #67 (@bkrabach's selection commit is the base here). It exists as a separate PR so the full read-side capability can be reviewed and merged as one proven, self-contained unit. Coordinate with @bkrabach on whether to land this and close #67, or land #67 first.
Non-blocking follow-ups
DefaultAzureCredentialacquisition path in a DTU with a managed identity (the real Azure APIM+graph round-trip was proven via a host-acquired bearer).