Lua API — brainstorm integrations & v11 features
Complete Lua surface for Discovery, Cutlass/TF32, portal, IIS, PHP, graphs, natural disasters, MySQL configuration, SimpleMathNN, and CadDccRL.
Registered from:
_SpeechCommands::RunLuaScriptFile(every script run)AgentRuntimecommon + per-type agent Lua states
| Registrar | Globals |
|---|---|
_BrainstormIntegrations::RegisterLuaGlobals |
integrate_*, discovery_*, cutlass_*, portal_*, iis_*, php_site_*, graphs_* |
_WeatherHazards::RegisterLuaGlobals |
weather_*, disaster_*, settings_config_* / settings_mysql_primary / … |
_SimpleMathNNBridge::RegisterLuaGlobals |
simple_nn_* |
_CadDccRL::RegisterLuaGlobals |
cad_rl_* |
Related: BrainstormIntegrations.md · DiscoveryWordPress.md · TF32MatrixMultiply.md · WeatherHazards.md · MySQLConfiguration.md
Running scripts
integrate lua
or (if your build routes Lua run this way):
lua run lua_scripts/Brainstorm-Integrations.lua
Harness scripts:
| Script | Role |
|---|---|
lua_scripts/Features-V11-Harness.lua |
Master smoke for config + disasters + discovery + integrate + simple_nn + cad_rl + cutlass |
lua_scripts/Brainstorm-Integrations.lua |
Discovery / TF32 / portal / IIS / disasters preview |
lua_scripts/Natural-Disasters-Watch.lua |
Multi-hazard desk + optional monitor |
lua_scripts/MySQL-Configuration.lua |
MySQL-primary config inspect/toggle |
lua_scripts/Simple-MathNN-Bridge.lua |
Media → MathNN fuse |
lua_scripts/Cad-Dcc-RL.lua |
CAD/DCC RL mock smoke |
lua_scripts/AugmentedIntelligence-Bootstrap.lua |
Startup health (includes v11 feature probe) |
Scripts also receive existing WordPress helpers:
wordpress_post(title, content, status) → ok, post_id, link, error
wordpress_test() → ok, details
wordpress_status() → string
Integration / orchestration
| Function | Returns | Description |
|---|---|---|
integrate_status() |
string | Hub status (php root, discovery, cutlass, WP) |
integrate_doctor() |
string | Operator checklist |
integrate_all() |
string | Seed discovery + portal export + graphs + cutlass check |
integrate_selftest() |
string | Offline dry-run self-test |
Globals (strings, snapshot at register time):
integrate_status_textphp_site_rootphp_site_url
Discovery journal
| Function | Args | Returns | Description |
|---|---|---|---|
discovery_status() |
— | string | Journal status |
discovery_seed_all() |
— | integer | Entries touched (paper+session) |
discovery_list(pending) |
bool | string | List text |
discovery_record(title, summary, category, detail) |
strings | id, auto_posted |
Log discovery |
discovery_post_pending() |
— | count, note |
Post unposted |
discovery_wordpress(on) |
bool or "on"/"off" |
bool | Auto-post toggle |
discovery_dry_run(on) |
bool or string | bool | Dry-run toggle |
Example:
discovery_dry_run(true)
discovery_seed_all()
local id, auto = discovery_record(
"Lua finding",
"Observed X when Y",
"platform",
"Detail lines…")
print(id, auto)
-- Live only when WP configured:
-- discovery_dry_run(false)
-- discovery_wordpress(true)
-- local n, note = discovery_post_pending()
Cutlass / TF32
| Function | Args | Returns | Description |
|---|---|---|---|
cutlass_status() |
— | string | Backend + precision |
cutlass_set_precision(p) |
"fp32"/"tf32"/"fp16"/"bf16" |
string | New precision name |
cutlass_gemm(M,N,K) |
ints (default 64) | ok, detail |
Run GEMM fill |
cutlass_bench(size, n) |
ints | string | Timing report |
cutlass_check(size) |
int | string | FP32 + TF32 correctness |
Example:
cutlass_set_precision("tf32")
local ok, detail = cutlass_gemm(256, 256, 256)
print(ok, detail)
print(cutlass_check(64))
Graphs (PHP export)
| Function | Returns |
|---|---|
graphs_architecture() |
JSON string |
graphs_discovery() |
JSON string |
graphs_rl() |
JSON string |
graphs_all() |
JSON string |
graphs_export() |
status string (writes files) |
Portal
| Function | Args | Returns |
|---|---|---|
portal_status() |
— | string |
portal_export() |
— | path/status string |
portal_enable(on) |
bool | enabled bool |
IIS
| Function | Args | Returns |
|---|---|---|
iis_status() |
— | string |
iis_doctor() |
— | string |
iis_recycle(name, apply) |
string, bool | string |
Never pass apply=true from unattended scripts unless explicitly intended.
PHP site
| Function | Args | Returns |
|---|---|---|
php_site_status() |
— | string |
php_site_health() |
— | string |
php_site_config_root(path) |
string | status |
php_site_config_url(url) |
string | status |
php_site_deploy(apply) |
bool | status |
Weather & natural disasters
Registered by _WeatherHazards::RegisterLuaGlobals.
| Function | Args | Returns | Description |
|---|---|---|---|
weather_status() / weather_doctor() / weather_metrics() |
— | string | Module status |
weather_selftest() |
— | string | Offline mock self-test |
weather_mock(on) |
bool or "on"/"off" |
bool | Force mock feeds |
weather_is_mock() |
— | bool | Mock flag |
weather_now() |
— | string | Open-Meteo current conditions |
weather_forecast(days) |
int | string | Daily forecast |
weather_alerts(storms_only) |
bool | string | NWS alerts |
weather_storm() |
— | string | Storm watches/warnings |
weather_earthquakes(mag, hours) |
number, int | string | USGS quakes |
weather_locate(place) |
string | ok, detail |
Geocode |
weather_set_location(lat, lon, name?) |
numbers, string | status | Set point |
weather_summary() |
— | string | Legacy weather+storm+quake |
disaster_all(filter?, mag?, hours?, max?) |
strings/numbers | string | All hazards merged |
disaster_list(...) |
same | string | Alias of disaster_all |
disaster_desk() |
— | string | Full multi-hazard desk |
disaster_categories() |
— | string | Category taxonomy |
disaster_eonet(limit?) |
int | string | NASA EONET only |
disaster_gdacs() |
— | string | GDACS only |
disaster_space() |
— | string | NOAA SWPC only |
disaster_monitor_start(sec?) |
int | string | Background poll |
disaster_monitor_stop() |
— | string | Stop monitor |
disaster_monitor_status() |
— | string | Monitor state |
disaster_monitor_snapshot() |
— | string | Last poll snapshot |
disaster_selftest() |
— | string | Multi-hazard self-test |
disaster_classify(text) |
string | string | NWS/event → category |
Example:
weather_mock(true)
print(disaster_selftest())
print(disaster_all("flood"))
print(disaster_classify("Red Flag Warning"))
-- live:
-- weather_mock(false)
-- print(disaster_desk())
-- disaster_monitor_start(300)
MySQL-primary configuration
Also registered with weather (for harness convenience). Globals from registerSettingsGlobals: settings_mysql_primary, settings_write_file_mirror, mysql_hostname, …
| Function | Args | Returns | Description |
|---|---|---|---|
settings_config_status() |
— | string | Primary/mirror + host summary |
settings_mysql_primary([on]) |
optional bool/string | bool | Get/set MySQL source of truth |
settings_file_mirror([on]) |
optional bool/string | bool | Get/set full settings.txt mirror |
settings_save() |
— | bool | _Settings::SaveSettings() |
settings_load_configuration() |
— | string | Full MySQL-primary load path |
settings_reload_mysql() |
— | string | LoadMySQLSettings / LoadAll |
SimpleMathNN / CadDccRL (brief)
| Function | Module |
|---|---|
simple_nn_status, simple_nn_encode_*, simple_nn_fuse, simple_nn_train_*, simple_nn_predict, simple_nn_gate, simple_nn_selftest, … |
SimpleMathNNBridge |
cad_rl_doctor, cad_rl_train, cad_rl_eval, cad_rl_smoke, cad_rl_scenarios, … |
CadDccRL |
Minimal integration script
print(integrate_doctor())
discovery_seed_all()
cutlass_set_precision("tf32")
print(cutlass_check(64))
print(portal_export())
print(graphs_export())
print(php_site_health())
print(iis_doctor())
print(settings_config_status())
print(disaster_all(""))
print(integrate_all())
Master harness: lua_scripts/Features-V11-Harness.lua.
Integrations harness: lua_scripts/Brainstorm-Integrations.lua.
Registration notes
- If a function is missing, the harness prints
missing binding: name(script uses safepcallwrappers). - Rebuild after adding
BrainstormIntegrations.cppso symbols link. - Agent scripts get the same globals when the agent Lua state is created after this registration was wired in.
Files
BrainstormIntegrations.cpp— alllua_*bindingslua_scripts/Brainstorm-Integrations.luaSpeechCommands.cpp—RunLuaScriptFileregistrationAgentRuntime.cpp— agent registration