Repository navigation
feat(reporting): S3 provider for object row bindings - #3164
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — new S3 row-object provider, clean diff.
Adds @adcp/sdk/reporting/s3 provider (src/lib/reporting/s3/index.ts, 371 lines) mirroring the existing GCS provider. No blocking or medium findings.
Checked:
- Witness model preserved — get returns null on absent version, no fabricated fields, bytes verified downstream vs PG digests.
- Official @aws-sdk/client-s3 commands only; peer dep optional + newer dev dep, matching GCS pattern.
- Changeset present, correctly scoped as minor/additive.
- Delete path (L944-972) safe: versioned buckets pin VersionId; unversioned uses HEAD-confirm + If-Match; 501 fallback TOCTOU is benign due to content-addressed keys.
- Ops readiness: abortSignal threaded through every client.send within the signal race; streaming cap enforced without ContentLength; probe fail-closes correctly.
- Export map, package-size bump, tsup glob all consistent.
No escalation triggers: high_risk false, gated_paths false, no team gate, no prior decision. Falls through to row 9.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean pass, no blocking or medium findings.
This delta adds a servedVersion fail-closed guard to the S3 row provider's two read paths and the delete path, defending against S3-compatible stores that silently ignore VersionId/If-Match selectors. The ETag comparison is consistent with versionOf/selectorOf, the full-get path destroys the body before returning null (no leak), and the delete-path check closes a real hole where a selector-ignoring store could delete the current object. A new test covers the selector-dropping case and confirms legitimate pinned reads still succeed.
Governance checks: a .changeset/reporting-s3-row-provider.md is present for the src/lib/** change (changeset-vs-wire-impact satisfied); package.json edit is dependency-related, no hand-edited version line observed. No witness/translator fabrication concerns. high_risk false, gated_paths false, review_decision: APPROVED, no author-team gate. Prior decision was also approve.
No findings → decision table rows 1–8 do not fire → row 9 applies.
985ffd6 to
9599926
Compare
0016fe1 to
31f9bed
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — new @adcp/sdk/reporting/s3 object-row provider mirroring the approved GCS provider.
No blocking findings. Reviewer verified:
- Create-only writes with bounded single 409 retry; 412 adopts existing version (
index.ts:759-768). - Version pinning via
selectorOf/servedVersion(L681-694) — mismatched echoed version returns null, never wrong bytes. - Byte cap fires without ContentLength (L935-939 + stream cap).
- Witness fidelity: no fabricated fields; errors map to stable secret-free codes (proven by
secretFreeassertions). - Every
client.sendcarriesabortSignal; DEADLINE/ABORTED tested. - Changeset
minoraccurate; export matches sibling dual-format shape; package-size cap bumped +4;tsup.config.ts:105globs the subpath automatically.
Gate check: gated_paths: false, no high-risk files, no no-auto-approve team match. review_decision: APPROVED. Prior decision was also approve with no findings. No critical/high/medium findings — falls through to row 9.
|
Ladon cannot review this PR until merge conflicts are resolved. |
a87fb9e to
706b0d0
Compare
5bbe487 to
65fd6a6
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean pass, no blocking findings.
This delta adds the reporting/s3 and reporting/azure row-object providers, mirroring the already-approved GCS provider with the same credential-free, host-injected-client contract. Verified: create-only writes (If-None-Match: *, 412/409 adoption), version-pinned reads with servedVersion re-verification, byte-cap enforcement via readReportingRowStream even when ContentLength is absent, exact-version deletes, and account-binding enforcement. Operational readiness holds — every SDK call carries abortSignal, ops run under runReportingRowProviderOperation with DEADLINE_EXCEEDED/ABORTED propagation, and errors map to secret-free PROVIDER_UNAVAILABLE (tests assert no SAS/credential leakage). Two minor changesets for the additive subpaths + optional peers; exports/typesVersions match the gcs shape.
Decision table: no critical/high/medium findings (row 1 N/A); gated_paths false (row 2 N/A); high_risk false (rows 3,5 N/A); no medium data-loss/schema/infra (row 4 N/A); prior decision was approve (row 6 N/A); no no-auto-approve team match (row 7 N/A); zero medium findings (row 8 N/A). Falls through to row 9 → approve. review_decision is APPROVED.
706b0d0 to
ea06329
Compare
The base branch was changed.
65fd6a6 to
34ad56f
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — new S3/Azure reporting row-object providers, clean pass.
This PR adds @adcp/sdk/reporting/s3 and @adcp/sdk/reporting/azure providers mirroring the already-audited GCS provider via shared row-storage-provider-io helpers. The reviewer verified: version/ETag discrimination is sound (quoted ETags never collide with VersionIds), create-only writes enforced via If-None-Match: * plus empirical probe, exact-version pinning on reads/deletes with servedVersion guarding, unconditional-delete fallback safe under content-addressed keys, Azure versioned delete removes base blob only when it is the target version. Both changesets are correctly minor/additive, export shape matches the dual-format pattern, package-size accounting updated, peer deps optional, no hand-edited version. Tests cover conformance, abort/deadline, secret redaction, and foreign-version negatives.
Decision rules walked top-down: no critical/high findings (row 1 no); gated_paths is false (row 2 no); high_risk is false, no deletions (rows 3/5 no); no medium findings at all (rows 4/8 no); prior decision was approve so sticky-escalate (row 6) does not apply; no no-auto-approve team match (row 7 no). Falls through to row 9 → approve. Note: review_decision is REVIEW_REQUIRED, but with gated_paths: false that does not gate approval.
Add the @adcp/sdk/reporting/s3 subpath with
createS3ReportingRowObjectProviderV1({ client, clients }), backed by the
new optional peer @aws-sdk/client-s3.
- location { bucket, region? }; endpoint, credentials and region come only
from host-injected clients selected by credentialRef.
- putIfAbsent: PutObject with If-None-Match: *; 412 -> HeadObject adopts
the existing version; 409 ConditionalRequestConflict retried once.
- nativeVersion: VersionId when present, else the quoted ETag.
- get: VersionId or If-Match, ranged, byte-capped stream; missing,
mismatched or foreign versions read as null.
- delete: HeadObject confirms the exact version, then DeleteObject by
VersionId or If-Match (HEAD-compare fallback where conditional deletes
are not implemented); absent is success.
- probe: HeadBucket, client region, public policy status, lifecycle
expiration over the prefix, and an empirical create-only check that
writes a probe key twice and requires the second write to fail with 412.
An opt-in emulator test (REPORTING_S3_TEST_ENDPOINT) runs the conformance
suite through the official client; verified locally against moto.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Some S3-compatible stores ignore versionId or If-Match. Reads now return null and deletes report absent unless the response echoes the exact pinned VersionId or ETag, so such a store can never serve or delete a different version. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add the @adcp/sdk/reporting/azure subpath with
createAzureBlobReportingRowObjectProviderV1({ client, clients }), backed by
the new optional peer @azure/storage-blob (type-only import; the host
injects BlobServiceClient instances).
- location { account, container }; the selected client must belong to the
bound account; endpoint and credentials come only from the client.
- putIfAbsent: block-blob upload with If-None-Match: *; 409
BlobAlreadyExists / 412 -> getProperties adopts the existing blob.
- nativeVersion: versionId when blob versioning is enabled, else the quoted
ETag; reads (ranged, byte-capped) and deletes pin it and only count a
response that echoes that exact version.
- delete: ETag-conditional, or for versions: confirm the version, delete the
base blob if it is still that version, then delete the version.
- probe: container exists, no anonymous access, and an empirical
create-only check with a probe blob under the prefix.
- Metadata names are stored as C# identifiers (adcp-intent -> adcp_intent).
An opt-in emulator test (REPORTING_AZURE_TEST_CONNECTION_STRING) runs the
conformance suite through the official client; verified locally against
Azurite.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
34ad56f to
b070398
Compare
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean pass, no blocking or medium findings.
This PR adds @adcp/sdk/reporting/s3 and @adcp/sdk/reporting/azure object-store row providers mirroring the reviewed GCS pattern. Checks verified:
- Witness-not-translator respected: storage I/O only, no wire fabrication or re-shaping.
- Official clients only; no HTTP/SSE reimplementation.
- Two
minorchangesets present; no hand-editedpackage.jsonversion line; exports + typesVersions + check-package-size counts match the two dual-format sets. - S3 VERSION_ID regex correctly excludes
"(no ETag collision); putCreateOnly 409 single-retry; delete HEAD-confirms exact version (fail-closed). - Azure servedVersion never serves/deletes a non-echoed version; versioned delete respects the root-blob ordering rule.
- All client calls thread abortSignal; build glob picks up new files.
Decision table: no critical/high findings (row 1 n/a); gated_paths false (row 2 n/a); high_risk false (rows 3/5 n/a); no medium findings (rows 4/8 n/a); no no-auto-approve team match (row 7 n/a); prior decision was approve (row 6 n/a). Falls through to row 9 → approve. Note review_decision is REVIEW_REQUIRED, but with gated_paths=false that does not block auto-approve.
…s; regenerate release worksheet AbortSignal.timeout uses an unreferenced timer, so the S3 and Azure hanging-fake deadline tests could be cancelled by the test runner when the event loop drained (as already handled in the GCS test). Add a keep-alive interval. Also regenerate docs/migration-14.x-rc-worksheet.md for the new optional S3 and Azure peers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Delta touches docs + tests only (no src/lib, no bin, no build-affecting scripts, no package.json files path), so no new changeset obligation is triggered. The worksheet change correctly documents the two optional provider peers (@aws-sdk/client-s3, @azure/storage-blob) matching the S3/Azure row providers. The test fix adds a referenced setInterval keepAlive (torn down via t.after) so the unref'd AbortSignal.timeout(20) deadline can fire against a hanging fake with no active I/O — correct shape, no leak, accurate comment.
No critical/high/medium findings. Prior decision was a clean approve. No author team gate, gated_paths is false, high_risk is false. Falls through to row 9.
Stacked on #3161 (GCS provider). Second of three cloud providers for the shared SDK persistence spec (adcontextprotocol/adcp#7996 §3.4).
What
New subpath
@adcp/sdk/reporting/s3exportingcreateS3ReportingRowObjectProviderV1({ client, clients }), with a new optional peer@aws-sdk/client-s3(^3.700.0, the first range whose models carryIfNoneMatchon PutObject andIfMatchon DeleteObject; also a devDependency). Wiring mirrorsreporting/gcs:exports,typesVersions,peerDependencies,peerDependenciesMeta. Lockfile changes are limited to the new dev dependency tree.location: { bucket, region? }(closed; bucket validated, IP-style names refused). The endpoint, credentials, region and path style come only from host-injectedS3Clients selected bycredentialRef, never from the location. Ifregionis set, the probe requires the client's configured region to match.PutObjectwithIfNoneMatch: '*', noContentEncoding, metadata passed through. A 412 triggers aHeadObjectand returnscreated: false. A 409ConditionalRequestConflictis retried once.VersionIdwhen present; otherwise the ETag, always kept quoted. Version IDs never contain", so the two cannot be confused when read back.VersionId(orIfMatchfor ETag versions) plusRange. The earlyContentLengthcheck and the streaming cap both enforcemaxBytes. These read asnull:NoSuchKey/NotFound/NoSuchVersion, 412, and a 400 for a malformed or foreign version ID (AWS answers 400 on unversioned buckets).InvalidRange/416 →ROWS_INTEGRITY_FAILED.nulland deletes reportabsentunless the response echoes the exact pinnedVersionId/ ETag. Some S3-compatible stores ignoreversionIdorIf-Match, and this check stops them from serving or deleting a different version.HeadObjectconfirms the exact version first (404/412/400/405 →absent). It then callsDeleteObjectwithVersionId, or withIfMatchfor ETag versions. Where conditional deletes returnNotImplemented, it falls back to an unconditional delete after the HEAD compare.HeadBucket: 404 / 403 / 301 →UNSAFE_BINDING.GetBucketPolicyStatus:IsPublic→UNSAFE_BINDING; errors are ignored because S3-compatible stores often lack this API.GetBucketLifecycleConfiguration: an enabledExpiration(Days/Date) whose prefix filter overlaps the binding →UNSAFE_BINDING. Tag-filtered rules,ExpiredObjectDeleteMarker, noncurrent-version and abort-MPU rules are allowed. AccessDenied →UNSAFE_BINDING.{prefix}/.adcp-probe/<uuid>twice withIf-None-Matchand requires the second write to fail with 412. Every probe version is then deleted. A store that ignores the header failsUNSAFE_BINDING.abortSignalis passed to everysend, and the shared helper settles on abort (DEADLINE_EXCEEDEDvsABORTED). Raw SDK errors never escape.Tests
test/lib/reporting-s3-row-provider.test.jsuses an in-memory fake ofS3Client.send(command, { abortSignal })with the real command classes, in both versioned and unversioned modes. It covers:runReportingRowObjectProviderConformanceV1), with probe objects cleaned up;VersionId/If-Matchpinning, ranged reads, themaxBytescap with and withoutContentLength;credentialRefmap, endpoint/secret fields rejected inlocation, secret-free error messages, and deadline/abort.REPORTING_S3_TEST_ENDPOINT=http://127.0.0.1:54500 node --test test/lib/reporting-s3-row-provider.test.js. It runs conformance plus foreign-version get/delete checks through the realS3Clienton versioned and unversioned buckets. Passed locally against moto 5.1.22 (python -m moto.server), which enforcesIf-None-Matchand returns 412.build:lib,typecheck, andcheck-package-size(+4 files) pass. ESM and CJS loads of@adcp/sdk/reporting/s3work.Risks
🤖 Generated with Claude Code
Stack note: this branch now also contains #3166 (Azure Blob provider for object row bindings), which was squash-merged into it while the stack was being assembled. Review that PR's description for the Azure provider.