Skip to content

Package the pipeline as navkit with a nav command - #3

Merged
ShivtejG236 merged 2 commits into
feat/binary-wire-protocolfrom
feat/navkit-package
Nov 14, 2026
Merged

ShivtejG236 merged 2 commits into
feat/binary-wire-protocolfrom
feat/navkit-package

Conversation

@ShivtejG236

Copy link
Copy Markdown
Member

Step 3 of the plan. Stacked on #2: merge that first, then retarget this to main.

What changes

  • The pipeline is now an installable package, navkit, that provides the nav command. It no longer has to run from a checkout.
  • nav flash detects the chip, finds the matching image in the firmware repo's GitHub Releases, verifies its SHA-256, caches it and flashes it with esptool. --file flashes a local build.
  • nav doctor checks Python, pyserial/esptool, serial-port permissions, drivers and the workspace.
  • nav record, process, calibrate, sessions, log, wizard, where, ports, firmware list|fetch replace the numbered menu actions. The wizard is still there.
  • Sessions, outputs and calibration_params.json live in a workspace: ~/navkit by default, or --workspace / NAVKIT_HOME.
  • Core install (pip install navkit) needs only pyserial, esptool and platformdirs. navkit[pipeline] adds pandas, numpy, scipy and matplotlib; the stages are imported on demand.
  • run_pipeline.py still works and uses the checkout as its workspace.

Behaviour changes to be aware of

  • Modules moved from pipeline/ to src/navkit/; session_trimmer.py → trimmer.py.
  • With no terminal attached and no calibration file, a dynamic session now aborts (strict) instead of blocking on a prompt.
  • Existing sessions under data/ in a checkout are not moved. Use python run_pipeline.py, or nav --workspace ., to keep working on them.

Testing

  • 73 tests pass locally (Linux, Python 3.13), including end-to-end nav process runs on synthetic sessions and nav flash with the board and GitHub stubbed.
  • Built the wheel and sdist, installed the wheel core-only in a clean venv, and confirmed nav doctor runs and no heavy library is imported. CI repeats this.
  • nav firmware list ran against the real GitHub API (it correctly reports no releases yet).
  • Not tested: anything that touches a board. nav flash, chip detection and nav record have only run against stubs. Chip detection in particular (flash.detect_chip) uses esptool internals I could not exercise.

Release

release.yml publishes wheel + sdist to a GitHub Release when a v* tag matching the package version is pushed. PyPI publishing is off until the repository variable PYPI_PUBLISH=true is set and the workflow is registered as a trusted publisher for navkit on pypi.org (the name was free when I checked).


Generated by Claude Code

- src/navkit: installable package; pipeline stages are imported on demand
  so flashing and logging need only pyserial and esptool
- nav flash: detect the chip, resolve the firmware release (manifest.json
  or file-name fallback), verify SHA-256, cache, flash with esptool
- nav doctor, ports, firmware list/fetch, record, process, calibrate,
  sessions, log, wizard, where
- workspace directory (~/navkit, --workspace, NAVKIT_HOME) replaces paths
  relative to the script
- strict calibration gate by default when no terminal is attached
- run_pipeline.py kept as a wrapper around the wizard
- CI builds the package and tests a core-only install; release workflow
  publishes wheel and sdist on a tag, PyPI behind a repository variable
The session summary contains a micro sign, which the default Windows code
page cannot encode; the Windows test legs caught it. The CLI also switches
its console streams to UTF-8.
@ShivtejG236
ShivtejG236 merged commit d57dba4 into feat/binary-wire-protocol Nov 14, 2026
8 checks passed
@ShivtejG236 ShivtejG236 mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant