Skip to content

Decode code check in TypeScript, dashboard type file panel on DeviceTypeFileManager, Raft Flasher app - #22

Merged
robdobsn merged 3 commits into
mainfrom
feature/codecheck-flasher
Oct 25, 2026
Merged

robdobsn merged 3 commits into
mainfrom
feature/codecheck-flasher

Conversation

@robdobsn

Copy link
Copy Markdown
Owner

Follow-up to #21, and pairs with robdobsn/RaftCore#24, which has the shared codecheck_vectors.json, the PSRAM file size default, and the Pages workflow that publishes the flasher. Plan and progress: devdocs/device-type-management-web-plan.md §11 (2026-10-25).

Library

  • RaftDeviceTypeCodeCheck: checkDeviceTypeCode and checkDeviceTypeRecordCode, a TypeScript copy of RaftCore's decode code check (PseudocodeHandler.check_code). It gives the same problems word for word, tested on RaftCore's vectors, including every RaftCore record's code.
  • readGitHubSource refuses a record whose decode or init code is outside the decode language, as a build refuses one from a git source.
  • TYPE_FILE_MAX_BYTES_DEFAULT_PSRAM (262144): the device's new default type file limit on boards with PSRAM.

Dashboard

TypeFilePanel uses DeviceTypeFileManager. You can check only, or upload and check, then Apply or Cancel. After applying it waits for the restart and verifies the device loaded the file. It can also download the device's file.

Raft Flasher (apps/flasher, published at /RaftCore/flash/ by RaftCore#24)

Flashes a Raft build to an ESP32 over USB from Chrome or Edge, using esptool-js 0.7.0 over Web Serial.

  • Input: a build folder (or its files), read through flasher_args.json as raft flash does; or an ESP Web Tools manifest URL.
  • Before writing: shows the partition table and the app's description (name, version, build date, ESP-IDF version), and checks each image fits its partition and the build is for the board's chip.
  • Modes: everything, firmware only (keeps the file system, like --no-fs), or file system only, with optional erase. It warns that writing the file system replaces the device type file and saved settings.
  • Writing: each image is verified by MD5.

Device Types app

  • Shows code problems for local records.
  • With no device connected, allows the PSRAM limit and warns above 64 KB.
  • File-picker labels are now styled as buttons, and there's a link to the flasher.

Testing

  • raftjs: 421 pass. One cross-check is skipped until RaftCore#24 is on RaftCore main; it passed against that branch. tsc (web, React Native, both apps, the dashboard) and eslint are clean.
  • Flasher: flashImage.test.ts covers the partition table, app description, image roles, the modes, size and missing-file problems, chip names, and MD5 against Node's. Axiom018's real build was read correctly, and the page ran in headless Chrome with those files.
  • Not tested on hardware: flashing a board with the flasher, and the dashboard panel's push and restart. No board was attached.

🤖 Generated with Claude Code

robdobsn and others added 3 commits October 25, 2026 12:40
…rces refuse code outside the decode language, PSRAM file size default

- checkDeviceTypeCode / checkDeviceTypeRecordCode: a TypeScript copy of PseudocodeHandler.check_code and
  check_decode_code, giving the same problems word for word (RaftCore's codecheck_vectors.json, in testdata/)
- readGitHubSource refuses a record whose decode or init code is outside the decode language, as a build refuses
  one from a git source
- TYPE_FILE_MAX_BYTES_DEFAULT_PSRAM (262144): the device's default type file limit with PSRAM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check only, or upload and check, then Apply or Cancel; after applying it waits for the restart and checks the
device loaded the file. It can also download the device's file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AM size limit, link to the flasher

- Raft Flasher: flash a Raft build to an ESP32 over USB from the browser (esptool-js 0.7.0, Web Serial). Reads a
  build folder through flasher_args.json as raft flash does, or an ESP Web Tools manifest; shows the partition
  table and the app's description; checks image sizes against partitions and the chip; writes everything, the
  firmware only (keeping the file system) or the file system only, optionally erasing first, with MD5
  verification. Published on RaftCore's Pages site at flash/
- Device Types app: shows local records' code problems; with no device, allows the PSRAM limit and warns above
  64 KB; .btn styles for labels (the file pickers); a link to the flasher
- Plan: progress for 2026-10-25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robdobsn
robdobsn merged commit 524b248 into main Oct 25, 2026
1 check passed
@robdobsn
robdobsn deleted the feature/codecheck-flasher branch October 25, 2026 11:42
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