RuleSpoolfor OpenCode 2
RULESPOOL / NOTE 07UPDATED October 15, 2026

A source contract, not a universal verdict.

RuleSpool explains a pinned stage of OpenCode 2 permission evaluation. The version label is part of the result, not decorative metadata.

The source snapshot

The modeled contract is OpenCode commit 775d1d0d7138fd9b4de455186ff2c1b1e2505a3b, observed on October 15, 2026. The reference is a development source snapshot. It does not prove that every distributed V2 binary, plugin setup or managed deployment uses identical behavior.

We retained the upstream MIT license with the local replay. The browser port follows the native matcher and supplied configured/saved flow, while deliberately avoiding the full runtime, model calls and tool execution.

A bounded matcher

The native matching function constructs a regular expression from the wildcard pattern. Repeated stars can create costly backtracking on an adversarial near-match. Our port uses two dynamic-programming rows over UTF-16 units, with a deterministic work budget. Budget exhaustion aborts the proposed comparison instead of returning a false match or permission effect.

Windows comparison follows the native non-Unicode regular-expression case rules. This includes subtle distinctions: a supplementary character occupies two units, and certain Unicode letters do not fold into ASCII. The special trailing space-star condition is recognized before repeated stars are collapsed.

Independent checks

The core tests compare the actual browser engine against extracted pinned upstream matcher and evaluator functions, using explicit edge cases and generated inputs. Pipeline fixtures separately cover configured denial, saved approvals, session overrides, multiple resources, empty resources and missing layer markers. UI tests then exercise imports, reordering, edits and exported replay files.

Those checks establish the tested functions and browser behavior. They do not simulate configuration discovery, tool resource extraction, a whole installed OpenCode server or an enterprise deployment. The replay included in your download is useful regression evidence for the same bounded contract.

What the preview knows

The agent array is evaluated exactly as supplied. A missing session or saved layer remains unknown. An empty supplied array is explicit input. No missing agent data is silently replaced by the runtime's missing-agent fallback, because an absent import is not evidence that native agent resolution failed.

The final runtime result remains untested. Policies, plugin hooks, server state, scanning and filesystem resolution can matter outside this stage. The site never automatically applies a permissive configuration change.

Sources: matcher, evaluation flow, native schema, retained MIT notice.