Repository navigation
test(datasources): add connection identity and bounded I/O regressions - #191
Conversation
Datasource Lambdas cap success (4 MiB) and error (64 KiB) bodies before parsing and close streams on every exit. Missing explicit instance IDs fail closed. Connection tests run the real bounded query operation, and Jaeger/Dynatrace/Datadog/Loki report partial or unverified results instead of absence. Prometheus/Mimir enforce the saved execution ceiling inside the connector. Optional Jaeger/Dynatrace VPC attachment stays default-off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation Review follow-ups for the connector bounds: connect, headers and body share one monotonic deadline so a slow upstream cannot double the aligned HTTP timeout past the Lambda wall; oversized or slow error bodies keep their HTTP status. Loki and Jaeger report limit saturation as partial with requested/returned counts, separately from byte-bound loss. Connection probes return latency_ms, accept empty or warned results, and keep the SSRF classification. The default kind mirror is stamped with its instance id, the id-keyed lookup accepts only that default's mirror (legacy unstamped mirrors keep working with a warning until the next save), and timeoutS rides the console conn config for every kind. Restores the resolve-and-recheck disclosure that the stacked agent change replaces. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Custom MCP transports connect to the address set validated at request time while preserving Host, TLS SNI and certificate verification, and reject every 3xx. IPv6 addresses are bracketed so AAAA-only endpoints connect. The transport deadline and the MCP session read timeout follow a 60s read budget separate from the 8s connect budget. A malformed port is an SSRF-classified rejection, discarded per-address failures are logged, and pasted trailing whitespace in an api_key value is stripped. The pin composes with the default-off custom MCP governance: spec validation and the attested secret version run first, then the validated addresses are pinned for that session. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…tor-bounds # Conflicts: # agent/agent.py # agent/lambda/datasource_http.py # agent/pinned_http.py # agent/streamable_http_sigv4.py # agent/test_agent.py # agent/test_pinned_http.py
* fix(web): show datasource completeness, limits and shared scope The datasource API and UI report instance-specific configuration only, show effective execution/response limits, pass the selected window to trace and SaaS kinds, reject unsupported SQL range shapes, and label shared default datasources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(web): align datasource guides with the stacked connector contract Review follow-ups: the datasource guides (ko/en/ja/zh) and API reference describe the shared timeout contract, the real-query connection test and the Mimir API prefix; the reference doc records Loki saturation disclosure, the shared request deadline and the oauth_3lo posture. The form no longer offers oauth_3lo. A Datadog instance's legacy key pair counts as configured and survives a settings-only PATCH regardless of the row's authType. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix: address review feedback (iteration 1/5) * fix: address review feedback (iteration 2/5) * fix(web): defer oauth_3lo enablement to the custom MCP governance gate The enable-time transport check is superseded by the merged default-off governance gate, which admits only api_key and oauth_client_credentials; registration validation and the form still reject oauth_3lo. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the #185 squash (b5bfb94). It was merged into this branch instead of dev, which pushed this PR's diff to 245 KB — past the AI review input limit, so the reviewers were never called. The web and documentation change returns as a dev-based PR after this one merges. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The instance-id stamp on the default kind mirror, the console-path timeoutS forwarding and the default/delete mirror handling are web changes that ship with the datasource web contract PR. Keeping them here pushed this PR against the review input limit; the connector side already fails closed without an id-bound credential, and the runbook's backfill (re-save the default) writes the id key with today's web code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The optional Jaeger/Dynatrace VPC flags move to their own PR and the datasource-development FAQ wording moves to the web contract PR; both are independent of the connector changes reviewed here. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The feature-level bullet describes the net behavior of the connector and web changes together, so it ships with the final PR of the pair; this keeps the connector PR within the review input limit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The AI review input limit is 128 KiB and this PR's diff was 131 KiB, so the review never reached a model. The 544-line test_external_connections.py moves unchanged to a follow-up PR stacked on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores test_external_connections.py, split from the connector-bounds PR to keep that PR under the AI review input limit. Covers connection identity, bounded reads, query proof and result-completion behavior (121 tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…' into test/datasource-connector-bounds-regressions
Matches the connector change in the base PR: when the byte bound drops every trace, returnedCount is now the length of the emitted (empty) traces array. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…' into test/datasource-connector-bounds-regressions
…' into test/datasource-connector-bounds-regressions
…' into test/datasource-connector-bounds-regressions
…tor-bounds # Conflicts: # docs/runbooks/CLAUDE.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…' into test/datasource-connector-bounds-regressions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctor-bounds-regressions
🤖 AI Code Review (two independent reviewers)_Reviewer responses: codex/ALL claude/ALL _ Status: PASSED — No blocking issues found Spot verification confirms the panel claims: all referenced base symbols exist ( PR #191 — Chair Review: test(datasources): connection identity and bounded I/O regressions1. SummaryThis PR is test-only: it adds 2. Issues per lensL2 — Code correctnessNo CRITICAL/MAJOR. Codex found nothing (its review was static due to an
L3 — Security / AWS mutation safetyNo findings — both models agree. No IAM, Terraform, or production connector code changes; the ADR-005 frozen-mutation boundary is untouched (all exercised connectors remain readers, ClickHouse behind L4 — Observability / data-integration correctnessNo CRITICAL/MAJOR — both models agree the completion-contract coverage matches the producing code (Dynatrace caps/pagination/warning demotion, Loki
L5 — Docs/ADR consistencyNo CRITICAL/MAJOR. ADRs live in the private upstream repo (per root CLAUDE.md), so no ADR text exists here to reconcile; ADR-005 is satisfied on the merits. Notably, the PR repairs a docs mismatch:
3. Suggestions
4. VerdictTest-only PR; no production logic, IAM, or infrastructure change. All findings are MINOR and non-blocking. Both panels and the chair declared image coverage not required (the manifest lists zero images, zero deletions, zero omissions, status IMAGE_COVERAGE: NOT_REQUIRED Triggered by commit |
Stacked on #183. Merge #183 first, then retarget this PR to
dev.This adds
agent/lambda/test_external_connections.py(544 lines, 121 tests) with no changes. It was split out of #183 because that PR's diff (131 KiB) went over the 128 KiB AI review input limit, so the review never reached a model.The tests cover connection identity binding, bounded reads, shared request deadlines, query-proof verification and result-completion disclosure for the datasource connector Lambdas.
docs/runbooks/datasource-credential-isolation.mdin #183 already points to this file.Verification:
cd agent/lambda && python3 -m pytest test_external_connections.py -q→ 121 passed.🤖 Generated with Claude Code