Repository navigation
fix(platform): close the 2026-09-18 round-J API evaluation findings - #3410
Merged
Merged
Conversation
`tracePropagationTargets: []` alone did not stop the leak: the deployment env carries `SENTRY_TRACES_SAMPLE_RATE` (the CLI writes it, `'0'` by default), which switches span recording on, and the SDK then registers OpenTelemetry's http/undici instrumentation. Its propagator derives the target URL from the active span; an unsampled span records none, so the empty target list is never consulted and `sentry-trace`/`baggage` — the release, public key and environment — go out on every request the backend makes, the website crawler's fetches included. Register the http and native-fetch integrations with `spans: false` so the request lanes stay on the Sentry-native hooks, which honour the empty target list. The wire test now runs with `SENTRY_TRACES_SAMPLE_RATE=0` and adds a positive control proving the instrumentation is live.
The crawler read only the `*` robots group, so a site that followed our own documentation and addressed `User-agent: TaleBot` to refuse or throttle the crawler was crawled under everyone-else's rules. Parse robots.txt for the product token (named group wins over `*`, RFC 9309), honour `Allow` with longest-match precedence, `$` end-anchors and `Crawl-delay` (capped at 60s), and carry the policy on the website row as an object. Both fetch legs pace to the delay; the create-time homepage metadata probe now reads robots first and identifies as TaleBot instead of a bare `node`. Also from the same evaluation: a redirect off the registered site is a new `host_not_allowed` fetch kind rather than the misleading `private_ip`; a non-default port is refused, not silently dropped to :443; a fully-disallowed site ends `error`, not `active` with zero pages; and a third concurrent scan that meets the render-session cap waits for a slot and defers the batch to its next link rather than failing the whole scan and discarding what it fetched.
`delivery_key` folds the requested project into its hash, so the same delivery id at the organization door and at a project door produced two ledger rows and two runs: an operator who moved an automation between organization and project scope had the sender's redelivery run a second time, silently, and the documented `409 AUTOMATION_DELIVERY_SCOPE_MISMATCH` never fired. Record a scope-free `identity_hash` beside the per-scope key (migration 0107, nullable and rolling-safe) and, on accept, refuse a live delivery that first ran under the other side of the organization/project boundary. A per-project fan-out stays legitimate: the same id still starts one run in each installed project.
Bump the contract to 1.15.0 and make the published document honest to a generated client again: - de-duplicate `budget_exceeded` in the three `failureCode` enums, so `openapi.json` validates as OAS 3.0.3 and `openapi-python-client` no longer aborts, with a guard that every enum has unique items; - declare the skills file download's conditional GET (`If-None-Match`, `If-Modified-Since`, 304, `ETag`/`Last-Modified`) the door already answers; - name `host_not_allowed` in `WebsitePage.lastErrorKind`, accept any case in `Product.currency`, and describe `WebsiteSearchResults.total` as the match count, the chat content cap as UTF-16 units, and `system:provisioning` in `createdBy`; - serve `/openapi.json` with an `ETag` and answer 304 to a matching `If-None-Match`. MCP `cancel_run` on an unknown run now answers `RUN_NOT_FOUND` instead of "already finished", and a task-create 201 carries `Location`.
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.
Reviews and re-confirms every finding in the round-J external API evaluation (v0.5.32, contract 1.14.0), then fixes the four S2 issues plus the worth-fixing S3/S4. Contract bumps to 1.15.0.
S2 — serious
tracePropagationTargetsfrom round I is correct and present, but the deployment env carriesSENTRY_TRACES_SAMPLE_RATE(the CLI writes it,'0'by default), which turns span recording on and registers OpenTelemetry's request instrumentation. Its propagator derives the target URL from the active span; an unsampled span has none, so the empty list is never consulted and the headers go out on every outbound request. Fixed by registering the http and native-fetch integrations withspans: false, so it covers the whole backend, not just the crawler. Proved on the wire with the sample-rate env set.User-agent: TaleBotrobots group was ignored. robots.txt is now parsed for the product token (named group over*, RFC 9309), withAllowlongest-match precedence,$end-anchors andCrawl-delay(capped 60s), honoured on every leg and by the create-time homepage probe.identity_hash(migration 0107) lets the accept path answer409 AUTOMATION_DELIVERY_SCOPE_MISMATCHwhen a delivery crosses the organization/project boundary, while per-project fan-out still runs.errorwith fetched content discarded.S3 / S4
failureCodede-duplicated soopenapi.jsonvalidates as OAS 3.0.3 (with a uniqueItems guard); MCPcancel_runanswersRUN_NOT_FOUNDfor an unknown id; task-create 201 carriesLocation;host_not_allowedfetch kind for an off-site redirect; non-default port refused; website searchtotalis a real match count; currency accepts any case;/openapi.jsoncarries anETagand answers 304; plus doc precision for the UTF-16 content cap andsystem:provisioning.Verification
tsc --noEmit,oxlint --type-aware,oxfmt --checkclean; the pre-commit SAST hook passed on every commit.lint:manualok.backend:integrationdeferred to CI: it runs destructive probes and no isolated throwaway stack is available locally. The webhook and crawler lanes there cover the migration end to end.