plua → flua migration report — Dirigera project

Date: 2026-10-28 · flua 0.1.98 (Lua 5.4) · checked against the real Dirigera hub (live HTTP/WebSocket) and the real HC3 (read-only probe). Companion file: doc/FLUA_BUG_REPORT.md (upstream bugs with repros).


1. What this check covered

The ported code (Dirigera.lua, Lib.lua, Devices.lua, Auth.lua), the release management scripts (scripts/), and the packed artifacts (Dirigera.fqa, dist/Dirigera.fqa). Method: flua --check, offline runs against the real hub, UI compilation, a fresh flua --tool pack, the old plua -t pack path, and a read-only online probe of the HC3.

2. Migration status — what works

3. What still needs fixing (project side)

3.1 Dead plua directives in Dirigera.lua (low)

-- %%save:Dirigera.fqa
-- %%proxy:true
-- %%port=8269

Space before %% = plua spelling; flua warns and ignores each. They do nothing now (--%%mode:offline already pins the mode, pack -o sets the output). Remove them.

3.2 Release scripts still call plua (high for releases)

Net effect: ./scripts/create-release.sh would die at the artifact step today even though the rest of the release flow (setversion, changelog, tag, gh release) is tool-agnostic and fine.

3.3 Stale artifacts (medium)

3.4 Distribution hygiene (low)

--%%var:IP="192.168.50.165" bakes the private LAN IP into the distributed .fqa. Use the package-value form (--%%var:IP="192.168.50.165","<your-hub-ip>") so releases ship a placeholder while your own HC3 uploads keep the real value.

3.5 Online testing needs an extra flag (awareness, not a fix)

Because of upstream bug #1, running this QA against the real HC3 requires flua --api remote -D mode:online — --api remote alone silently keeps the QA's api.* calls on the sim.

4. Upstream findings (for flua)

Full repros in doc/FLUA_BUG_REPORT.md:

  1. High — --api remote does not win over the main QA's --%%mode:offline: engine runs online but the QA's api.* stays on the sim, silently (proved with /settings/info serials).
  2. Low — flua --tool ui text renderer drops components nested in horizontal/vertical containers (legacy viewLayout path), so multi-button rows print as blank "space" lines.
  3. Minor — plugin.restart() does not halt the current turn; code after the call runs in flua but not on the HC3.

5. Opinion on flua

What's good

The emulator fidelity surprised me positively. The plua surface I needed (plugin, __TAG, json.util.InitArray, net.WebSocketClientTls, $-system-file resolution, class/QwikAppChild) is all there and worked on the first run. Real network in "offline" mode is the right call for this kind of hub-integration QA and made the check meaningful. The -- %%-with-space warning in flua --check is exactly the right kind of migration help: loud, specific, per line. The pack tool is clean and the .env/config chain just worked. USAGE.md is a genuinely good manual.

Missing skills (project's .github/skills/)

The skill pack covers setup, API reference, patterns, types, testing and troubleshooting — but nothing migration-shaped:

Missing features

Things that were unclear

  1. CLI vs. header precedence for the main QA. USAGE.md's "an explicit --api local|remote always wins" did not hold for the QA's own api.* calls; the per-QA pin is documented only for secondary QAs. The observed behavior (main QA silently pinned to the sim under --api remote) contradicts both USAGE.md and this project's own AGENTS.md.
  2. plugin.restart() semantics. USAGE.md says it "re-runs the QA's code" — but not that the current turn keeps executing after the call, which differs from the HC3.
  3. Multi-element --%%u rows. The directive table shows only --%%u:{label=...} single-element examples; the list-of-dicts row syntax --%%u:{{a},{b}} is undocumented, and the --tool ui text output made me think it was broken until I read the compiled view.
  4. "Offline" naming vs. real network — resolved by the owner, but the docs bury it ("real network access" in the intro paragraph) rather than stating it next to the mode table.

6. Why I went into the flua Python package

The docs stopped answering questions at the exact points where behavior and documentation disagreed, and the tool output was misleading. Specifically:

In short: I read the package not because the docs were thin, but because the docs were confident and wrong (or silent) at precisely the three places the behavior mattered.

7. Recommendations

  1. Fix the release scripts (§3.2) and regenerate dist/Dirigera.fqa — releases are currently broken at the pack step.
  2. Clean the dead directives (§3.1) and delete/replace the root Dirigera.fqa.
  3. Use a package value for the IP var (§3.4).
  4. Submit doc/FLUA_BUG_REPORT.md upstream, with bug #1 first.
  5. If upstream accepts fixes: a plua-migration skill + compat matrix page in this repo's .github/skills/ would make the next plua project's conversion mechanical.