Skip to content

Bounded portable regex provider rejects expr match descriptors #670

Description

@kamilio

Problem

safe-bash0.1.470 exposes portableAgentCommands({provider:createBoundedRegexProvider()}), registers expr, and injects the provider into its executor, but the package-owned bounded provider rejects every expr-match descriptor. Arithmetic works; regex matching does not.

Reproduction

Import Shell, portableAgentCommands, and createBoundedRegexProvider from @poe-platform/safe-bash/portable; instantiate a virtual filesystem-backed Shell and install the plugin. Execute:

expr 2 + 3
# stdout5, exit0
expr abc : 'a.*'
# expected stdout3, exit0
# actual exit2, stderr:
# expr: bounded regex unsupported: only grep and fixed rg selection descriptors are supported

Verified in real workerd using production Wrangler build, compatibility date2025-01-01 and nodejs_compat_v2. This is not a missing worker_threads module: the portable executor reaches the bounded provider and safely rejects the descriptor.

Requested API

Support conservative ASCII BRE expr-match descriptors, including anchored match-length semantics and bounded captures, through createBoundedRegexProvider with the same work/allocation/input caps. Keep unsupported syntax explicit and cancellation/disposal safe. Alternatively expose an environment-neutral bounded executor supporting this descriptor through a documented portable export. No native unbounded RegExp fallback or worker_threads shim.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions