Skip to content

BocaNext Layer 1: rbx-side .pyz bundler for the Python BOCA packager #489

@rsalesc

Description

@rsalesc

Follow-up to #488. Tracks Layer 1 of the BocaNext design (the judge-side runtime, Layer 2, is designed in docs/plans/2026-05-29-boca-next-python-packager-design.md).

Scope

Layer 1 is the rbx-side packager that runs at rbx package time. It does not run on the judge. Its job is to assemble the .pyz bundles that embed the Layer 2 runtime and lay them out in the directory shape BOCA expects.

Location: rbx/box/packaging/boca_next/.

Responsibilities

  1. LanguageSpec resolution — map the existing env.rbx.yml BOCA extension config (BocaExtension / BocaLanguageExtension) into the per-language LanguageSpec data the Layer 2 engine consumes (kind + argv templates + flags + limit modifiers). Ship rbx defaults; let users extend/override via env config (incl. defining new languages that reuse an existing kind).
  2. Manifest baking — produce the small per-(entrypoint, language) manifest.json (task_type, resolved limits + max_time_error, bocajail/user policy, the one resolved LanguageSpec).
  3. .pyz assembly — bundle the rbx_boca runtime package + manifest + embedded asset sources (checker.cpp, testlib.h, rbx.h, interactor.cpp, safeexec.c, pipe.c) into a zipapp per emitted file, with #!/usr/bin/env python3 shebang and exec bit. Generate the 3-line __main__.py per (entrypoint, language).
  4. Directory layout — emit compile/<lang>, run/<lang>, compare/<lang>, limits/<lang>, tests/<lang>, plus description/problem.info + PDF, input/, output/, mirroring the existing BocaPackager output contract.
  5. CLI wiring — a new packager target (e.g. rbx package boca-next) alongside the existing boca one. The existing bash BocaPackager is left untouched.

Notes / open questions for Layer 1

  • Reuse existing limits resolution (limits_info.get_limits(language, profile='boca')) and language-mapping utils (boca_language_utils.py).
  • Decide how asset sources are embedded vs referenced (likely copied into each bundle's assets/).
  • Decide whether the rbx_boca runtime is vendored into the bundle from source at package time or built once and reused.
  • Document the new python3 (>= 3.8) deployment requirement on the BOCA judge / bocajail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions