Rulebearing Playground Coverage Schemas GitHub

ADR-0067: The playground's wasm facade, and the JavaScript engine as an optional feature

Context

Plan 0004 adds a browser playground: the library crates compiled to wasm32-unknown-unknown behind a thin facade, rb-wasm, whose exports take and return strings. ADR-0010's table names every crate and the crates it may depend on, and the crate-boundary test holds the workspace to it. rb-wasm is not in the table.

Every library crate builds for the target. One links badly: rquickjs-sys 0.14, the QuickJS engine behind JavaScript configurations and plugin: reporters (ADR-0006). Its wasm bindings declare JS_DupValue and JS_FreeContext as functions, but QuickJS's C source emits neither as a symbol for that target, so the module fails to link. Fixing that means patching the dependency, which the plan's rule says not to do.

Decision

rb-wasm joins ADR-0010's table as a facade. It may depend on rb-model, rb-config, rb-rules, rb-report and rb-ingest, and no crate depends on it. ADR-0073 adds rb-extract-ts and rb-extract-python to the row, for cruise_ts and cruise_py. It never links rb-cli. The logic it needs from rb-cli's cruise --graph path moves into rb-rules, so both call the same code:

QuickJS becomes rb-config's js-config feature, on by default in rb-config and asked for explicitly by rb-cli.

The playground page states that it takes YAML and JSON configurations only.

Consequences

Alternatives considered

Option Why not
Patch rquickjs-sys with the two missing symbols A patched dependency is what the plan's rule rules out, and the sandbox is a security boundary (ADR-0006) that should run exactly the engine the command line runs.
Evaluate JavaScript configurations with the browser's own engine Breaks the rule that a configuration runs only in the sandbox, never a page-level eval (plan 0004 § 1.7, ADR-0006).
Leave rb-wasm out of the crate table and the test The table is how the dependency direction is enforced. A crate outside it is unguarded.