alvidaa
AGENTS.md β working on alvidaa with an AI session
This repo is routinely driven by AI coding sessions (the whole project was built that way β see STORY.md). If you are an agent (or a human driving one), this file is your briefing.
What this repo is
Two lanes share one TV:
- The launcher (product lane): a self-installing home screen for Hisense VIDAA TVs β one canvas page + a Python/Pi server speaking the TV's RemoteNow MQTT channel. Safe, reversible, the 90% use case.
- The research (root lane): how root was gained on 2024+ firmware and
what it unlocked. Own-TV-only, documented in
docs/models/50A51HUV/09.01O.P0813/findings/.
Ground rules (non-negotiable)
- Only on a TV you own. LAN-local. No DRM circumvention. Verified boot
stays green β the hard "never touch" rules (read-only partitions,
/OADstaging, the stock engine shell, the root-exec triggers) are checked in as tools/launcher-host/never-touch.json, and scripts refuse against it vianever-touch.cjs; every match is a refusal, not a warning. Freeze OTA endpoints before editing UI code. - Reversibility is the design law. Every change needs a teardown path.
The hook keeps a rolling backup (
/var/local/otaTest.v1.bak); check/var/localstate before overwriting β another agent session may be working the same TV. Checkgit logtoo. - One MQTT server per TV. The paired client identity is shared; two servers kick each other off the broker.
- Keys and tokens never leave
server/keys/(gitignored). LAN IPs in code are fine. - FINDINGS discipline: every discovery β bug, trap, errno β goes into
docs/models/50A51HUV/09.01O.P0813/findings/the same hour it happens. That discipline is why the root chain worked.
Map
| Path | What |
|---|---|
server/vidaa_server.py |
HTTP + WebSocket + MQTT bridge; /api/open loads any URL on the TV; /api/recon receives probe reports |
server/pair.py |
the 2024 pairing handshake (cert + dynamic credentials) |
server/tv |
root one-shot/interactive wrapper over dropbear (PATH-fixed) |
bridge/ |
on-TV Go daemon: loopback HTTP + WS + local MQTT session (see bridge/README.md) |
launcher/recon.html |
the probe page pattern (v1βv8 in git history) |
launcher/hookinstall.html, hookcheck.html |
remote hook install/verify |
docs/models/50A51HUV/09.01O.P0813/findings/01β¦09,11β12 and docs/research/10-patched-firmware-playbook.md |
canonical record: bridge, privilege map, root primitive, SSH gauntlet, root summary, images, endpoints, patched firmware playbook, firmware notes, cobalt runtime & overlay traps |
docs/launcher/ |
launcher deployment, the on-TV launcher v2 roadmap, and the two-lane architecture (LANES.md) |
docs/project/ |
the project story, AI prompt ladder and blog draft |
docs/research/ |
cross-model inventory, method catalogue, tested-models guide and playbook |
scripts/check.sh |
read-only health check: generated tables vs JSON, python/shell syntax, relative doc links, duplicate firmware rows |
scripts/report.py |
tested-model report scaffolder: validates the firmware id, refuses duplicates, scaffolds the guide tree, appends the inventory row, runs the generators + check |
scripts/gen-site.py |
renders the markdown in place into site/ for GitHub Pages (.github/workflows/pages.yml) |
TODO.md |
open work, ordered β loose ends and the catalogue refactor plan |
firmware/ENDPOINTS.md |
live endpoint/kill-list working copy (gitignored) |
Canonical recipes
- Verify before you commit:
./scripts/check.shβ read-only, no regeneration. Fails on stale generated tables, syntax errors, or broken relative links. - Screenshot the TV (no remote interaction):
tools/screenshot.sh [out.png]β vendor HAL capture into TV/tmp, pulled over the root-SSH lane./dev/fb0has no readback path on this MTK display (read/dd give ENODEV); the HAL's sysctrlservice RPC is the working lane. - Root shell:
./server/tv(interactive) or./server/tv 'cmd'. PATH is exported by the wrapper β dropbear sessions have none. Default host is192.168.0.11; override withTV_HOST=<ip>when the TV's DHCP lease moves. - Load any page on the TV:
curl "http://<server>:8770/api/open?url=β¦". - MQTT traps: subscribe to exact topics (wildcards silently denied); list payloads are JSON arrays; one session per credential set; the firmware disables ICMP β probe TCP 36669, never ping.
- The TV's browser exposes
Hisense_*bridge functions to any page, and the file bridge (phoenix, localhost:9009) is unauthenticated with CORS*. The TV browser must never see the open web β DNS-block it.
Onboarding a new TV/model
- Fingerprint: SSDP descriptor (
transport_protocol=), thenHisense_GetFirmWareVersion()/Hisense_GetChipSetName()from any page in the TV browser. - Launcher lane first (generation-dependent, not SoC-dependent): pair, serve, self-install. See findings 01.
- Root lane only after 1β2 are green, and expect SoC-specific differences (this chain is MTK9602/armv7; HiSilicon models differ in partitions and tools). See findings 03β07 for the method, not just the constants.
- Add the unit to
docs/research/inventory.json(single source of truth) and runscripts/gen-inventory.pyβ the README compact matrix and the full table indocs/research/TESTED-MODELS.mdboth regenerate from it. By PR.