Skip to content

feat(registry): plugin compile report + /:name/:version/report API - #44

Merged
maxscharwath merged 4 commits into
mainfrom
feat/registry-plugin-report
Jul 4, 2026
Merged

feat(registry): plugin compile report + /:name/:version/report API#44
maxscharwath merged 4 commits into
mainfrom
feat/registry-plugin-report

Conversation

@maxscharwath

Copy link
Copy Markdown
Collaborator

Plugin compile report + report API

Publishing a plugin now discovers its server actions and persists them with the version, and a new read route serves the compile report (declared capabilities + discovered actions) over HTTP.

What's new

  • GET /:name/:version/report -> { name, version, manifest, actions } (thin controller, edge-cached).
  • ActionScanner port in @brika/registry-core (pure) + SucraseActionScanner adapter in the app: Worker-safe sucrase, action ids via Web Crypto that match the runtime's computeActionId (verified: listDevices@0844025241d0).
  • reg_versions.actions JSON column (migration 0006, hand-authored per repo convention), threaded commitVersion -> PackageVersion -> getPackage.
  • ResolveService.report() composes the stored manifest + actions.

Design notes

  • Kept the registry's existing in-repo sucrase compile gate; did not vendor brika's @brika/compiler/v8 bundle-gate (the registry has no dependency on it and its own gate is the Worker-safe equivalent). No npm publish needed.
  • The report = the already-stored manifest + the new actions; manifest is not duplicated.

Verified

  • Live end-to-end on wrangler dev (real workerd): migrate local D1 (through 0006) -> seed scope/member/token -> authenticated publish @test/demo@1.0.0 returned 201 and stored the tarball in R2 -> GET /@test/demo/1.0.0/report returned the manifest + listDevices@0844025241d0.
  • Failure gates confirmed: 401 (no token), 403 (unowned scope), 409 (immutable re-publish), 404 (unknown-version report).
  • bun run typecheck, bun run lint, and the packages/apps/registry/architecture test suites pass.

Note: this branch also snapshots other in-progress registry working-tree changes that predate this feature.

Publish now discovers a plugin's server actions and persists them with the
version; a new read route serves the compile report (declared capabilities +
discovered actions) over HTTP.

- ActionScanner port (registry-core) + SucraseActionScanner adapter: Worker-safe
  sucrase, Web Crypto ids matching the runtime's computeActionId
- reg_versions.actions JSON column (migration 0006), threaded through
  commitVersion -> PackageVersion -> getPackage
- ResolveService.report() + a thin report controller, bound in the composition root
- Verified end-to-end on wrangler dev (real workerd): authenticated publish gated
  and stored in D1/R2, report served; failure gates (401/403/409/404) confirmed

Also snapshots other in-progress registry working-tree changes.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
brika-registry 3c9cca8 Jul 04 2026, 06:44 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 4, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
brika-store 3c9cca8 Jul 04 2026, 06:45 PM

Wire the published isolate compiler into the publish path:
- manifest-validator calls compilePluginGate (rollup+sucrase, runs in the Worker)
  on the bricks/pages entrypoints: a stronger check than per-file syntax (catches
  unresolved imports), and it discovers the plugin's actions for the report
- keep the cheap per-file sucrase sweep (compile-check) for BREADTH: compilePluginGate
  only sees browser entrypoints, so the sweep still covers a broken/garbage server
  `main`, blocks, and server-only plugins (anti-squat)
- actions now flow from validate() -> commitVersion (drop the separate ActionScanner
  port + SucraseActionScanner adapter; delete the duplicated action-scan)
- depend on @brika/compiler@0.4.0-00e5f35c9ec7 (nightly); Worker is 452 KiB gzip

842 tests, typecheck, lint, architecture, thin-routes green.
…points

Feed compilePluginGate every declared entry - the server `main`, bricks, pages,
and blocks - so unresolved imports are caught on SERVER code too, not just
bricks/pages. Closes the publish-time blind spot (a broken import in main/blocks
used to slip to the hub). Verified: all 8 shipped plugins still compile clean
(action-stubbing keeps it from over-compiling server-action subtrees), and a
new test proves a main with an unresolved import is now rejected.

The system is now comprehensive: per-file sweep = syntax of every file (incl.
dead/stubbed code); bundle gate = syntax + link of the whole reachable graph.

843 tests, typecheck, lint green.
…rage

- test the compile gate returning discovered actions (the one uncovered branch
  in the validator: a plugin WITH an action, id matching the runtime)
- sonar.coverage.exclusions += apps/registry/bench/** (a benchmark, not shippable
  code - it was 40 uncovered lines dragging new-code coverage below the gate)
@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

@maxscharwath
maxscharwath merged commit 338cd82 into main Jul 4, 2026
6 checks passed
@maxscharwath
maxscharwath deleted the feat/registry-plugin-report branch July 4, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant