reopt Data SDK Review
Read-only by default. Inspect and report; do not edit code, dependencies, env files, or agent markers unless the user explicitly asks for fixes.
Step 1 — Ground the review
- Detect installed versions and every import of
@reopt-ai/data-sdk*/@reopt-ai/data-contract, plus anyreopt-dataCLI call in build scripts and which package provides that bin (@reopt-ai/data-cli, or the server package's bin that existed only through0.4.x). - Read the installed client/server/devtool READMEs (and the data-cli README when it is installed) before judging behavior. Supported floor: client/server
0.2.0, optional devtool0.2.0, contract0.7.0; verified against client0.4.0, server0.5.0, contract0.10.0, data-cli0.1.0. A0.1.xclient is a finding when the project relies on error tracking: it sends flat$exception_*keys only. - Read the existing
<!-- BEGIN:reopt/data-sdk-agent-rules -->block when present; otherwise use this skill's byte-identicalagent-rules.mdfallback as review guidance. A missing block is informational in a read-only review.
Step 2 — Review categories
- Packages — versions below the supported floor, client/server version skew, invalid entrypoint for the runtime, any import of the deprecated
@reopt-ai/data-sdkmeta-package, server>= 0.5.0with a build script still calling the server bin (no@reopt-ai/data-clidev dependency), or data-cli on a Node< 22CI image. - Secrets —
clientSecretorREOPT_DATA_API_KEYinNEXT_PUBLIC_*, client components, RSC props, logs, fixtures, source control, or browser-visible devtools. - Lifecycle —
createReopt()inside a request/component, duplicate clients, fire-and-forget Node work, missingflush()/close(). - Next boundary — server package in client code, functions crossing RSC props,
getBootstrap()underuse cache/ request cache, bootstrap invented instead ofnull. - Proxy —
/ingestomitted from matcher, wrong prefix/origin, open custom rewrite, reopt before redirect/tenant routing, dropped existing response headers/cookies. - Page capture —
ReoptPageViewplus manual pageview, unbounded dynamic paths, missing web-vitals/path context where intended. - Identity — hand-built cookie names, write-key mismatch, trusted browser profile/session id, logout without
reset(), delayed conversions losingdeviceId. - Consent — external manager uses
persist: falsewithout synchronizing the proxy cookie, opt-out retains identity, server events ignore the request decision. - Error tracking —
capture.exceptionRateLimit: falsein production (or the key placed at the config root, where it is silently ignored);addExceptionStepimported from the package root instead of called on the client instance;captureExceptionin loops/retries or with credentials, tokens, or PII in properties, breadcrumbdata, or step messages; a client-computed group id instead of afingerprintsuggestion;beforeCapturethat can throw;onRequestErrormissing where server tracking exists (or its multi-projectresolvereturning credentials without the matchingwriteKey);releasehand-typed or absent while regressions are expected; maps uploaded by map filename instead of chunk URL,--url-prefixnot matching the served asset origin,sourcemap injectrunning after upload, a CI gate that treats only exit1(not6, partial failure) as failure, or browser source maps published without a decision recorded (no--delete-after-uploadand no explicit choice). - Catalogue —
reopt-data.events.jsoncommitted without itsreopt-data.events.lock.json;event push --apply --forcein CI;event verifyabsent from CI while the file is the declared truth;conversion: trueon events that are not business outcomes; high-cardinality keys inrollupProperties; atrack()wrapper that ignores theevent typesoutput while the project generates it. - Fail-open — analytics errors break checkout/render/auth, while application validation or authorization incorrectly fails open.
- Devtool/testing — forced production devtool, raw batches exposed publicly, tests mock ingest before checking the SDK-built payload, no accepted-batch or roundtrip evidence.
Canonical sources
| Finding area | Read |
|---|---|
| Browser, React, Next client config/capture/consent | installed @reopt-ai/data-sdk-client/README.md |
Exceptions, throttling, breadcrumbs, captureException options, release |
installed @reopt-ai/data-sdk-client/README.md → "$exception_list" and "Release tracking" |
Request scope, bootstrap, proxy, identity, onRequestError, Node |
installed @reopt-ai/data-sdk-server/README.md |
Source map CLI, credentials, exit codes, postbuild shape |
installed @reopt-ai/data-cli/README.md → "Source maps in CI"; @reopt-ai/data-sdk-server/README.md § 4-1 |
Event catalogue as code, reopt-data tools --json, MCP |
installed @reopt-ai/data-cli/README.md → "Event catalogue as code", "For agents" |
| Recorder, panel, exposure and production behavior | installed @reopt-ai/data-sdk-devtool/README.md |
Assembled reference app (multi-tenant + proxy + consent + devtool + /debug/errors lab) |
reopt-ai/reopt-data-sdk-example README — its postbuild may predate the data-cli move |
Report contract
Order findings by severity. For every finding provide:
- severity and short pattern name;
- exact file and line;
- concrete evidence from the code;
- user/runtime/security impact;
- canonical installed README section and a scoped remediation.
Separate confirmed defects from suggestions and unverified live behavior. End with checks run, checks skipped, and residual risks. If no findings exist, say so explicitly and still report coverage gaps.
Safety
- Never print env values, credential headers, stored identity cookies, captured personal data, or exception payloads verbatim.
- Do not create or rotate Data resources during a review.
- Do not recommend production devtool exposure as an observability solution.
- Do not commit or push without explicit authorization.