# FrameOS by Almanac: handoff for another AI

## Project
- Samsung Tizen TV web app (home screen replacement for a Samsung The Frame, model in the 85" class, 2025 firmware). Source is `CleanFrame-main/`. Display name is now **FrameOS by Almanac**. The package and app ID (`s85fclean1` / `s85fclean1.CleanFrameS85F`) are unchanged on purpose, so the Home mapping on the TV survives reinstalls. Do not change the IDs without a plan for the Home mapping.
- Key files: `app/main.js` (about 4,100 lines, all app logic and rendering), `app/index.html`, `app/style.css`, `app/config.xml` (manifest), `scripts/check.py` (identity/version checks), `scripts/font_assets.py` (`write_widget_archive`, builds an unsigned .wgt).
- Docs in `docs/`: `agent-tv-setup-guide.md`, `interaction-behaviour.md`, `tv-status.md`, `testing.md`.

## Hard limits (do not cross these)
-
- Do not commit or export device identifiers, LAN IPs, the TV model number, the Wi-Fi name, or local file paths. Known leaks to fix: `scripts/check-browser.mjs` (model number, IP, Wi-Fi name) and `docs/tv-status.md` (IP, model).
- Home and startup changes on the TV are high risk. Only change them with explicit approval, and keep the rollback path in the setup guide.
- Signing: the build is unsigned. Signing uses the user's own certificate and is not handled by the AI.

## Done so far
1. Rename: display name and page title changed to "FrameOS by Almanac" (`config.xml` `<name>`, `index.html` `<title>`). Package ID unchanged.
2. Profile overlay on the Control keys (Tools, Info, Menu): each press moves to the next profile and shows a short list; hides after 1 second with no input. Built and checked (syntax and `check.py`), not yet tested on the TV.
3. Stage 1, Blue picker: Blue (key code 406, taken from the TV at registration) opens the existing profile sheet in picker mode. OK switches profile and returns to the exact screen that was open. Back or pressing Blue again closes it without switching. Built and checked, not yet tested on the TV.

## Not done
- **Stage 2, Blue picker over other apps (e.g. Netflix):** NOT verified. Samsung's docs say registered keys reach the app in front. They do not confirm that a background web app gets Blue while another app is showing, or that it can resume a background native app without reopening it. Test on the TV first. Do not ship a fallback that could strand the user on a black screen.
- **Stage 3, first-run setup:** not built. Planned as a separate overlay in its own file, shown only on first launch (a localStorage flag), covering: name for the first profile (via the TV's on-screen keyboard), wallpaper pick from the existing set, Home app choice, Weather location, remote and sound check, then Home. Keep it out of the main renderer if possible.
- **Search over other apps:** not feasible. Tizen's public APIs do not expose other apps' search or catalogue results. Search would only cover typing a title and opening the app that the user picks.
- Watchlist, Up Next, screen saver: not started; requests were paused, not dropped.

## Test checklist (on the TV)
- Install the unsigned build after signing with the user's certificate. Confirm the app name shows as "FrameOS by Almanac".
- Home key replaces the TV Home and opens FrameOS.
- Control keys (Tools, Info, Menu): overlay shows profiles, switches on each press, hides after 1 second.
- Blue: opens the picker from FrameOS screens. OK switches and returns to the same screen. Back and a second Blue close it.
- Blue from inside Netflix or another app: record what actually happens. Expect no response.
- Check the four app launches and any others that are not verified (Disney+, Apple Music, Prime Video, BBC iPlayer, Spotify). Launch failures show "The TV could not open this screen."
- Power-cycle the TV and confirm profiles and Home mapping persist.

## Working rules for the next AI
- Ask for the files needed before a code fix, then give complete changed files (the user's preference). Tell the user which parts are untested on the TV.
- Keep changes small and testable. Run `node --check app/main.js` and `python3 scripts/check.py` after every edit, and rebuild the .wgt with `write_widget_archive`.
- Do not change the app ID, package ID, or Home/startup behaviour without asking.
- When something cannot be verified from the sandbox, say so rather than assuming it works

Samsung os is allowed to be modified slightly but not so that the os is broken

