Skip to content

The platform was raw-read, so a host with a metatable answered nothing - #3

Merged
dop42 merged 1 commit into
mainfrom
fix/reach-the-ordinary-way
Sep 20, 2026
Merged

dop42 merged 1 commit into
mainfrom
fix/reach-the-ordinary-way

Conversation

@dop42

@dop42 dop42 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Native.Reach did rawget(_G, 'Open77'). Wrong twice over:

  • rawget skips a metatable, so a host exposing the namespace through an
    __index accessor answers nil;
  • _G is not necessarily the chunk's _ENV, so a host that hands a resource its
    own environment answers nil again.

Under either arrangement every wrapper in this library takes its absent-native path,
and a consumer's feature simply stops — with no refusal anybody can see.

That is not hypothetical. opx_infinity's name tags disappeared the day its client half
moved onto Store, Players and Native, and its pass() returning early on
Reach('players.nearby') == nil is exactly that shape.

It bought nothing, either. Reading a global that is not there yields nil in Lua and never
raises — the only thing rawget could have been guarding against. A plain read goes
through _ENV and is correct under every arrangement a host can choose.

The check that was missing

A namespace reachable only through a metatable must be found, and a platform that is
genuinely absent must still answer nil rather than raise. Mutation tested: restoring
rawget fails both.

547 → 550 checks, 0 failed.

🤖 Generated with Claude Code

…d nothing

`Native.Reach` did `rawget(_G, 'Open77')`. That is wrong twice over. `rawget`
skips a metatable, so a host exposing the namespace through an `__index`
accessor answers nil; and `_G` is not necessarily the chunk's `_ENV`, so a host
that hands a resource its own environment answers nil again.

Under either arrangement EVERY wrapper in this library takes its absent-native
path, and a consumer's feature simply stops with no refusal anybody can see.
That is not hypothetical: opx_infinity's name tags disappeared the day its
client half moved onto Store, Players and Native, and `pass()` returning early
on `Reach('players.nearby') == nil` is exactly that shape.

It bought nothing. Reading a global that is not there yields nil in Lua and
never raises, which is the only thing `rawget` could have been guarding
against. A plain read goes through `_ENV` and is correct under every
arrangement a host can choose.

The check is the one that was missing: a namespace reachable ONLY through a
metatable must be found, and a platform that is genuinely absent must still
answer nil rather than raise. Mutation tested -- restoring `rawget` fails both.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@dop42
dop42 merged commit 76f78b8 into main Sep 20, 2026
1 check passed
@dop42
dop42 deleted the fix/reach-the-ordinary-way branch September 20, 2026 14:48
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