# Onefinity firmware — agent guidelines ## Branch model This fork lives on **two long-lived branches**: - **`master`** — public-facing fork. General-use upgrades on top of upstream OneFinity firmware: V09 UX redesign, Font Awesome 6, faster cold boot, macOS dev/deploy tooling, build & flash docs, SD-card backup, `/api/diag/timing`, kiosk/tablet polish, and assorted bug-fixes. **No A-axis, ATC, hooks, or auxcnc/ESP content.** Aim for changes that benefit any Onefinity owner. - **`private-mods`** — bespoke shop branch. Stacks on top of `master` and adds everything specific to the auxcnc-ESP-driven A axis and the ATC: `Hooks` (ATC IPC), `AuxAxis` (ESP serial driver), `ExternalAxis` (virtual A through gplan), `AuxPreprocessor` (M100-M103), Z-A coupling interlock, the A-axis UI surface, and the `/api/aux/*` endpoints. Upstream: - `upstream` → `https://github.com/OneFinityCNC/onefinity-firmware.git` - `origin` → Gitea (`https://gitea.home.muehe.org/muehe/onefinity-firmware.git`) `origin/pre-split-backup` is a tag preserving the pre-split master tip. Keep it indefinitely until further notice. ## Where does a change go? | Change | Branch | |---|---| | UI polish, theme, layout that any user benefits from | `master` | | Build / install / boot performance | `master` | | Diagnostics, logging, generic Python / Tornado fixes | `master` | | Anything that touches `AuxAxis`, `ExternalAxis`, `Hooks`, `AuxPreprocessor` | `private-mods` | | Anything mentioning the auxcnc ESP, `/dev/ttyUSB0`, the M100-M103 ATC pneumatics, or motor index 4 | `private-mods` | | Z-A coupling interlock, ATC tool change sequencing | `private-mods` | | A-axis UI (DRO row, jog tile, settings page, A-axis routes) | `private-mods` | | W → A renames or aux.json migrations | `private-mods` | When in doubt: ask "would this be useful on a stock Onefinity with no ESP attached?" If yes → `master`. If no → `private-mods`. ## Workflow ```bash # Day-to-day shop / hardware work (default) git checkout private-mods # … do work, commit … git push origin private-mods # Generic improvement to master git checkout master # … do work, commit … git push origin master # After landing on master, replay private-mods on top git checkout private-mods git rebase master git push --force-with-lease origin private-mods ``` If a change accidentally lands on `master` but is bespoke (touches the file table above), move it: `git reset --hard ` on master, cherry-pick onto `private-mods`, force-push master. ## Deploy - `./deploy.sh local` — UI bundle on `localhost:8770` (tmux session `onefin-local`). No controller backend; A-axis row stays hidden. - `./deploy.sh hardware` — rsync to the Pi over SSH, restart `bbctrl.service`. Use the `private-mods` branch on the shop Pi. - `./deploy.sh prod` — bundle a release tarball. See `.pi/BUILD.md` for the full build / flash / cross-compile flow. ## Commit before ending a turn; push after significant changes.