Skip to content

Phase 0: ESP-IDF migration foundation#4

Merged
cryptotomte merged 5 commits into
mainfrom
001-phase0-foundation
Jun 10, 2026
Merged

Phase 0: ESP-IDF migration foundation#4
cryptotomte merged 5 commits into
mainfrom
001-phase0-foundation

Conversation

@cryptotomte

Copy link
Copy Markdown
Owner

Summary

Phase 0 of the Arduino → ESP-IDF migration (per docs/PRD-esp-idf-migration.md):

  • firmware/ skeleton — ESP-IDF v6.0.1 (pinned), C++, Kconfig board choice BOARD_REV1_DEVKIT/BOARD_REV2 with a board component (pin maps, DE-less RS485 on rev2, per-board level-sensor polarity), 4 MB partition table (2× 1.5 MB OTA + NVS + littlefs), pinned managed components (esp-modbus 2.1.2, littlefs 1.22.1, dependencies.lock tracked). Fail-safe app_main: pumps forced off before any other init, error handling independent of assertion level.
  • Dockerfile pinned to espressif/idf:v6.0.1idf.py build identical locally and in CI.
  • CIfirmware-build.yml builds both board targets (matrix, per-board sdkconfig verification, artifacts with if-no-files-found: error); arduino-legacy-cold.yml is a monthly cache-less reproducibility canary for the frozen legacy branch.
  • Governance — rewritten root CLAUDE.md (two-track development, frozen legacy paths, checkpoint-gated spec-kit workflow, model: inherit subagent policy, English outward), firmware/CLAUDE.md, constitution v1.0.0, rewritten .github/copilot-instructions.md (now tracked).
  • Docsdocs/prd/ PR breakdown (14 work packages + dependency graph + SYNC gates), docs/parity-checklist.md (~95 code-cited behavioral items, the parity contract), docs/partition-plan.md (closes the 4 MB open question: N4 suffices).
  • Hygiene.gitattributes with LF normalization (EOL-only changes in hardware/, isolated in the first commit), .gitignore updates.

Companion PR: chore/arduino-freezearduino-maintenance (legacy dependency pinning + CI).

Review

Reviewed pre-commit by three agents (code, doc-accuracy, silent-failure) + fix round + clean verification pass. Notable catches fixed before commit: RS485 TX/RX swap inherited from stale docs, outdated Modbus register map, CI silent-failure hardening.

Test plan

  • Both board variants build green in the pinned container (verified locally via Docker)
  • CI green on this PR for both matrix legs (phase 0 completion criterion)

🤖 Generated with Claude Code

cryptotomte and others added 5 commits June 10, 2026 10:21
Enforce LF line endings repo-wide (text=auto) with explicit binary
exclusions. Normalizes CRLF leftovers from Windows-era commits in
hardware/ (verified EOL-only changes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…artition layout

- ESP-IDF v6.0.1 project (C++), pinned via Dockerfile (espressif/idf:v6.0.1)
- Kconfig board choice BOARD_REV1_DEVKIT / BOARD_REV2 with board component
  (pin maps, RS485 DE-less rev2, level-sensor polarity per board)
- 4MB partition table: 2x 1.5MB OTA app slots + NVS + littlefs
- Fail-safe app_main: pumps forced off before any other init, explicit
  error handling independent of assertion level
- Pinned managed components: esp-modbus 2.1.2, littlefs 1.22.1
  (dependencies.lock tracked)
- Both board variants build green in the pinned container

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d canary

- firmware-build.yml: matrix over rev1_devkit/rev2, esp-idf-ci-action
  pinned to SHA, per-board sdkconfig verification, artifact upload with
  if-no-files-found: error
- arduino-legacy-cold.yml: monthly cache-less build of the frozen
  arduino-maintenance branch (reproducibility canary; workflow_dispatch
  only works from the default branch)
- copilot-instructions.md rewritten in English as a thin pointer to
  CLAUDE.md (previously gitignored and unreadable by Copilot)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion

- docs/prd/: master PRD broken into 14 PR-sized work packages with
  dependency graph and SYNC gates (versioned, not gitignored)
- docs/parity-checklist.md: behavioral contract extracted from the
  Arduino code, ~95 items cited to source lines, [HOST]/[HIL] tagged,
  known quirks documented (target correct behavior, not bug-for-bug)
- docs/partition-plan.md: 4MB layout math with margins; closes the PRD
  open question - N4 module suffices, no N8/N16 fallback needed
- Constitution v1.0.0 ratified (safety first, host-testability,
  reproducible builds, frozen legacy, checkpoint-gated workflow,
  English outward)
- Master PRD: corrected legacy patch flow (cable/serial flash; the
  Arduino firmware has no OTA endpoint)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Two tracks: active ESP-IDF development in firmware/, frozen Arduino
  legacy (src/, include/, data/, test/, platformio.ini) that must never
  be modified on main - patches only via the arduino-maintenance worktree
- Checkpoint-gated spec-kit workflow ported from ev-charging-manager;
  subagents inherit the session model (model: inherit)
- English for everything outward-facing (public repo); merge commits
  always, never squash
- .gitignore: ESP-IDF build outputs, session dialog docs; un-ignore
  copilot-instructions.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cryptotomte cryptotomte merged commit 6aa7bed into main Jun 10, 2026
2 checks passed
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