BunProfile: add missing Bun API coverage - #10
Conversation
Verified against the bunObjectTable lookup table in the bun runtime: - Bun.connect, Bun.listen, Bun.sliceAnsi, Bun.readableStreamToFormData - Bun.cron (.remove, .parse), Bun.plugin, Bun.gc - Bun.argv, Bun.env, Bun.main, Bun.cwd, Bun.stdin/stdout/stderr - Listener, UDPSocket, BuildArtifact object groups Fixes: - JSONL methods are parse + parseChunk (was stringify) - markdown exposes html/render/ansi/react (added react) - Bun.dns includes resolve/prefetch/getCacheStats/reverse - Bun.udpSocket returns typed BunUDPSocket
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR extends the Bun fuzzing profile with new IL types and object groups, updates JSONL method modeling, expands builtin typings for multiple Bun APIs, and registers the new groups in the profile. ChangesBun Profile Type and Builtin Updates
Sequence Diagram(s)Not applicable. Possibly related PRs
Suggested labels: enhancement, fuzzilli-profile, bun Suggested reviewers: Maintainers familiar with the Bun profile and Fuzzilli IL type system 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Sources/Fuzzilli/Profiles/BunProfile.swift`:
- Line 771: The `parseChunk` builtin in `BunProfile` is modeled too narrowly and
only covers the string overload. Update the `Bun.JSONL.parseChunk` entry to also
accept binary input shapes such as `ArrayBufferLike`, `TypedArray`, and
`DataView`, and account for the optional `start`/`end` byte-offset arguments
used for slicing. Keep the change localized to the `parseChunk` signature in
`BunProfile` so the fuzzing model reflects all supported overloads.
- Around line 2061-2064: The Bun.cron modeling in BunProfile is missing the
callback overload, so only the 3-string Promise signature is covered. Update the
Bun.cron entry to include the cronExpression + callback form and model it as
returning a CronJob object with stop/ref/unref methods, while keeping the
existing Promise overload intact. Use the Bun.cron symbol in the profile to
locate the API definition and extend the type description accordingly.
- Line 2039: `Bun.udpSocket` is currently modeled as returning a socket
directly, but it is async and resolves through a promise, which causes invalid
follow-up calls in the fuzzer. Update the `BunProfile` entry for `Bun.udpSocket`
to return `.jsPromise` instead of `.bunUDPSocket`, keeping the existing argument
shape intact so the fuzzer treats the result as a promise.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 09d5c5c0-1668-4cea-99a6-36c231e6d7d0
📒 Files selected for processing (1)
Sources/Fuzzilli/Profiles/BunProfile.swift
- Bun.udpSocket is async (returns Promise<UDPSocket>), so return .jsPromise instead of .bunUDPSocket - Bun.cron: model the in-process (schedule, handler) => CronJob overload with a BunCronJob group (cron property, stop/ref/unref methods). The OS-level (path, schedule, title) form is dropped since a builtin maps to one signature and it has host side effects (crontab/launchd/Task Scheduler) - Bun.JSONL parse/parseChunk accept string | TypedArray | DataView | ArrayBuffer with optional start/end offsets, not just string
Adds missing Bun APIs to the fuzzing profile, verified against the
bunObjectTablelookup table in the bun runtime (not just the.d.tstypes). Builds on the existing coverage (SHA3, subtle crypto, rapidhash).Independent of the upstream-sync PR (#8); this only touches
BunProfile.swift. If the sync PR lands first, rebase and theadditionalOptionsBagsfield it adds carries over automatically.New APIs
Functions:
Bun.connect,Bun.listen,Bun.sliceAnsi,Bun.readableStreamToFormData,Bun.cron/Bun.cron.remove/Bun.cron.parse,Bun.plugin,Bun.gcProperties:
Bun.argv,Bun.env,Bun.main,Bun.cwd,Bun.stdin,Bun.stdout,Bun.stderrObject groups:
Listener(fromBun.listen()),UDPSocket(fromBun.udpSocket()),BuildArtifact(fromBun.build())Fixes
Bun.JSONL: methods areparse+parseChunk(was incorrectlystringify)Bun.markdown: exposeshtml/render/ansi/react(addedreact; the engine defines all four)Bun.dns: expanded from justlookupto includeresolve,prefetch,getCacheStats,reverseBun.udpSocket: returns typedBunUDPSocketinstead ofjsAnythingVerification
swift buildpasses. The Bun profile andJavaScriptEnvironmentconstruct with all new builtins and ObjectGroups and no consistency errors (verified by runningFuzzilliCli --profile=bun).