Skip to content

Populate artifacts and add a Hermes bytecode inspector via hbcdump #32

Description

@pavlof01

Context

Supersedes #6, which was closed as completed although apps/engine-hermes/src/server.ts still runs a single hermes -dump-bytecode invocation.

Two things are being left on the table:

  • Artifact is part of the API contract (apps/api/src/types.ts), documented in README, and every engine returns artifacts: []. There is no way to download anything.
  • engines/dockerfiles/Dockerfile.hermes builds and installs hbcdump (lines 31, 52, 57) and nothing ever calls it. hbcdump reads a compiled .hbc bundle and prints the function table, the string table, literal buffers, and a pretty disassembly — an inspector nothing on the web offers.

Proposal

  • Compile the snippet with hermesc -emit-binary into the temp dir, return the .hbc as a real Artifact (kind: "bytecode", base64), and let the UI offer it as a download.
  • Add a second Hermes mode driven by hbcdump: function table, string table, literal buffers, -pretty-disassemble.
  • Surface the mode as a tab in the Hermes output pane.
  • Keep artifacts optional and empty for the other engines, so the contract stays as documented.

Acceptance criteria

  • A Hermes run returns a non-empty artifacts array and the file downloads and loads in hbcdump locally.
  • The inspector tab renders the function and string tables for a small snippet.
  • Output stays inside MAX_OUTPUT_BYTES; oversized bundles are reported, not truncated silently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendAPI, sandbox, engine integrationenhancementNew feature or requestfrontendUI and visual features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions