asobi_extension_reserved (asobi v0.75.1)

View Source

The names core keeps for itself.

asobi_extensions:validate/1 refuses an owns/0 claim on anything in here, so an extension cannot shadow a core table, a core Lua namespace, a core error domain or a core job queue.

Every list is derived from the live core source rather than restated, so it cannot drift:

  • lua from asobi_lua_surface:reserved_namespaces/0, the one place the game.* vocabulary is written down.

  • tables from every core kura_schema module's table/0, found the same way asobi finds an extension's schemas.

  • queues from every core shigoto_worker module's queue/0.

  • rpc from the domains of asobi_error:core_codes/0, plus the Lua namespaces. An RPC prefix and an error domain are the same token by construction ({"code": "quests.name_taken"}), so an extension owning the storage prefix would mint codes inside core's closed code set.

    core_codes/0 rather than codes/0 on purpose: codes/0 includes the codes the installed extensions declare, and reserving those would tell an extension it may not claim the namespace it just claimed.

Deriving from modules costs one code:ensure_loaded/1 sweep over core's module list. asobi_extensions only asks for it when at least one extension is installed, so a node with none pays nothing.

schema_tables/1 and worker_queues/1 are the two derivation rules themselves, exported over an arbitrary module list. asobi_extensions runs them over an extension's modules to derive that extension's table and queue claims, so core's names and an extension's names are found by the same rule rather than by two that can disagree.

Summary

Functions

The namespace kinds an extension may claim in owns/0.

Core's reserved token set, per namespace kind.

Every table declared by a kura_schema module in this list.

Every queue declared by a shigoto_worker module in this list.

Types

kind()

-type kind() :: tables | rpc | lua | queues.

Functions

kinds()

-spec kinds() -> [kind(), ...].

The namespace kinds an extension may claim in owns/0.

namespaces()

-spec namespaces() -> #{kind() := [asobi_extension:token()]}.

Core's reserved token set, per namespace kind.

schema_tables(Modules)

-spec schema_tables([module()]) -> [asobi_extension:token()].

Every table declared by a kura_schema module in this list.

worker_queues(Modules)

-spec worker_queues([module()]) -> [asobi_extension:token()].

Every queue declared by a shigoto_worker module in this list.