Repository navigation
feat(wasm-split): port Symbolicator wasm-split - #1589
Conversation
- Add `sentry wasm-split` with the same flags and stdout contract as the Rust tool Co-authored-by: Cursor <cursoragent@cursor.com>
- Reject unknown section ids and out-of-order sections - Closer to Rust wasm-split than header-only parsing was
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4289633. Configure here.
loewenheim
left a comment
There was a problem hiding this comment.
Seems solid apart from the manual UUID parsing stuff.
There was a problem hiding this comment.
All the UUID stuff should probably be handled by the uuid7 library, which is already a dependency.
a408240 to
0b4e3b4
Compare
0b4e3b4 to
a408240
Compare
| * id, but the distinction still matters: minting a fresh id for a module that | ||
| * already has a good one would orphan every debug file uploaded against it. | ||
| */ | ||
| export function buildIdFromSections( |
There was a problem hiding this comment.
IMO this is the only worthwhile function left in this file, and it could go in binary.ts. The rest are just converting between UUIDs, bytes, and strings.
I think the UUID type should be used wherever possible, including in the output of this function, and only be converted to a string or bytes when it needs to be written somewhere.
There was a problem hiding this comment.
I'd keep the wrappers: each handles a different concern in one place, uuidToBytes turns parse failures into CLI errors, and UUID on the read path is wrong because build_id is arbitrary bytes. The other cmd i'm working on will reuse the same helpers when it reads and stamps ids.
a408240 to
0fc4d8f
Compare
0fc4d8f to
a408240
Compare
…sm-split behavior)
| continue; | ||
| } | ||
| const buildId = decodeBuildId(section.contents); | ||
| if (buildId) { |
There was a problem hiding this comment.
Bug: The check if (buildId) incorrectly evaluates to true for an empty Uint8Array, causing the tool to accept an empty build ID instead of generating a new one.
Severity: MEDIUM
Suggested Fix
Change the condition if (buildId) to if (buildId !== null) to correctly distinguish between a null value (no section found) and an empty Uint8Array (empty section found). This ensures that an empty but present build ID section will still trigger the generation of a new build ID.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/cli/src/lib/wasm/build-id.ts#L74
Potential issue: In `buildIdFromSections`, the check `if (buildId)` is used to determine
if a build ID was found. However, if a WebAssembly module's `build_id` section contains
a zero-length vector, `decodeBuildId` returns an empty `Uint8Array`. In JavaScript, an
empty `Uint8Array` is an object and therefore truthy, causing the check to pass. This
prevents the subsequent logic in `splitWasm` from generating a new random build ID when
one is missing, as the empty array is not `null`. As a result, the tool outputs an empty
string for the build ID, which can break downstream processes like symbolication.
…mand coverage, AGENTS.md update (#1602) ## Weekly Documentation Audit — 2026-09-21 Automated cross-reference of implementation vs documentation, covering commits since the last audit (`ca7ef6af3`, PR #1579). --- ## Gap Report ### A. Undocumented or Missing Commands/Subcommands Command docs are auto-generated from CLI metadata, so all commands have generated doc pages. However, the **hand-written feature pages** were missing coverage for recently-added commands: | Command | Source | Missing From | |---------|--------|--------------| | `agent-conversation list/view` | `src/commands/agent-conversation/` | `agentic-usage.md`, `agent-guidance.md` | | `wasm-split` | `src/commands/wasm-split.ts` (PR #1589) | `agentic-usage.md`, `agent-guidance.md` | | `status show` | `src/commands/status/show.ts` | `agentic-usage.md` capabilities | **Fixed in this PR**: Added all three to the Capabilities list in `agentic-usage.md` and added workflow patterns with bash examples in `agent-guidance.md`. ### B. Undocumented Flags No new gaps. All non-hidden flags are auto-documented in generated Options tables via `generate-command-docs.ts`. ### C. Missing Usage Examples All command groups have fragment files in `apps/cli-docs/src/fragments/commands/` with bash examples. The new `wasm-split.md` fragment was added alongside PR #1589. **Bug found**: The `agent-conversation.md` fragment had **incorrect positional syntax** — it showed `sentry agent-conversation view my-org conv-123` (two separate args) but the command accepts a single slash-separated positional `[<org>/]<conversation-id>`, so the correct form is `sentry agent-conversation view my-org/conv-123`. **Fixed in this PR.** ### D. Stale Descriptions No drift found. The `brief` strings in code match the auto-generated doc descriptions. ### E. Missing Route Mappings in Skill Generator N/A — the manual `ROUTE_TO_REFERENCE` map was removed in a prior audit. The skill generator now uses `groupRoutesByReference()` for automatic 1:1 route-to-file mapping. ### F. Installation / Distribution Gaps No new gaps. The install script, `getting-started.mdx`, and `README.md` all document: - `curl`, Homebrew, npm/pnpm/yarn/bun install methods - `--no-modify-path`, `--no-completions`, `--no-agent-skills` installer flags - `SENTRY_INSTALL_DIR`, `SENTRY_VERSION`, `SENTRY_INIT` env vars - Supported platforms (macOS x64/arm64, Linux x64/arm64 glibc/musl, Windows x64) - Nightly channel via `--version nightly` ### G. Undocumented Environment Variables All `SENTRY_*` env vars accessed via `getEnv()` are registered in `env-registry.ts` and appear in the generated `configuration.md`. Intentionally excluded internal/test-only vars remain unchanged from prior audits: - `SENTRY_ENVIRONMENT` — bash-hook template only - `SENTRY_CLI_NO_EXIT_TRAP` — bash-hook internal - `SENTRY_SCAN_DISABLE_WORKERS` — internal perf tuning - `SENTRY_CLI_INTEGRATION_TEST_VERSION_OVERRIDE` — test-only - `SENTRY_RN_*` — React Native wrapper internals ### H. Auth / Self-Hosted Gaps No new gaps. Self-hosted docs cover OAuth 26.1.0+ requirement, token auth fallback, `SENTRY_HOST`/`SENTRY_URL`/`SENTRY_CLIENT_ID`/`SENTRY_CUSTOM_HEADERS`, TLS/CA certs, and `sentry cli defaults` for persistent proxy headers. ### I. Plugin/Skills Gaps The `plugins/README.md` accurately describes the skill installation flow and supported directories (`~/.claude`, `~/.agents`). The agent detection list in `agentic-usage.md` is current (includes Cline, Grok, Kimi, Junie, OpenClaw from PR #1571). No new gaps. ### J. README / DEVELOPMENT.md Drift No drift found: - Node.js version: `>=22.15` in devEngines, `>=20.0` in engines — matches docs - pnpm: `10.11.0` — matches docs - Build toolchain: esbuild + fossilize — matches GENERATED sections - OAuth scopes: auto-generated via GENERATED markers **AGENTS.md drift found**: The Architecture section's command group list was outdated — it listed a subset with `…` ellipsis, omitting `agent-conversation`, `alert`, `build`, `code-mappings`, `dart-symbol-map`, `debug-files`, `docs`, `feedback`, `snapshots`, `status`, `wasm-split`, and other groups. **Fixed in this PR**: Replaced with the full alphabetical list. --- ## Top 5 Most Impactful Fixes (Prioritized) 1. **`agent-conversation view` fragment had wrong positional syntax** — agents following the example would get a parse error. Fixed. 2. **`agent-conversation` missing from agentic docs** — AI agents had no guidance for browsing conversation transcripts, a feature specifically built for agent workflows. Fixed. 3. **`wasm-split` missing from agentic docs** — a new command (PR #1589) useful for WebAssembly projects had no agent guidance or workflow pattern. Fixed. 4. **AGENTS.md command group list was stale** — new contributors and agents referencing the Architecture section saw an incomplete picture. Fixed. 5. **`status` missing from agentic-usage.md capabilities** — the status command was already in agent-guidance.md workflow patterns but wasn't listed in the capabilities section. Fixed. <div><a href="https://cursor.com/agents/bc-65d7d00b-206a-420d-b8eb-d39cbd8ed041?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/automations/8b0c0f35-da5e-409d-984c-5e39518ffb8a"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

Summary
Ports Symbolicator's
wasm-splitinto the CLI assentry wasm-split.Same flags, same behaviour, same stdout (lowercase hex build id). Drop-in for the Rust binary. Nothing removed from Symbolicator.
Notes
Validation matches
wasmbin, not a full wasm engine.We validate the module envelope (header, section ids, and section order), but we do not read or validate the contents inside each section. Those bytes are passed through unchanged. This matches Symbolicator's Rust wasm-split.
We intentionally do not use WebAssembly.validate, since it performs deeper checks than wasmbin and would reject inputs the Rust tool accepts.