frostney / frostney/GocciaScript

Implement TC39 Compartments with sandbox-safe capability boundaries

Open
#1,025 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

engine new feature spec compliance
Dominant language
Pascal
Stars
20
Forks
3
Avg merge
3d 4h
Merged PRs (30d)
45

Description

Summary

Implement the Stage 1 TC39 proposal: https://github.com/tc39/proposal-compartments

Implement the current proposal while preserving no ambient authority and no dynamic code generation by default.

Why

This proposal fits GocciaScript's modern ECMAScript surface and the 0.13.0 proposal roadmap. It should extend the engine's existing architecture rather than arrive as a userland shim.

Current behavior

Realm, module loader, virtual module, and opt-in ShadowRealm foundations exist, but no Compartment/endowment/module-map isolation API does.

Expected behavior

Implement the current proposal while preserving no ambient authority and no dynamic code generation by default.

Scope notes

First record realm/global/module/cache/error ownership in an ADR, then implement on Realm and Modules.Loader. Endowments expose only host grants. Dynamic evaluate/source remains behind an explicit unsafe capability flag for security, not compatibility. Do not claim SES hardening. Cover leakage, modules, errors, GC, deterministic mode, and cross-realm calls.

Related bytecode roadmap: #871 and #875. Update relevant documentation and the Goccia proposal inventory. Use the current proposal specification at implementation time; add focused project tests and matching pinned Test262/proposal coverage without regressions.

Acceptance criteria

  • Parser/API surface, descriptors, evaluation order, errors, and protocol behavior match the current proposal.
  • Implementation uses the identified shared engine seam without a duplicate compatibility shim.
  • Focused positive, negative, abrupt-completion, and edge-case tests cover the proposal.
  • Relevant project suites, pinned Test262 cases, formatting, and documentation checks pass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the current TC39 Compartments proposal and the existing Realm, module loader, virtual module, and ShadowRealm foundations. Record realm/global/module/cache/error ownership in an ADR, then inspect Realm and Modules.Loader as the identified seams. Done means focused isolation, module, error, GC, deterministic-mode, and cross-realm tests pass alongside pinned proposal coverage, documentation, and relevant project checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.