Add bambu-nfc dump parse, Key-A HKDF, and spool merge.

Parse filanfc-dump/v1 zip/JSON, Bambu 1K images, and merge stickers by tray UID. dump and mifare packages stay importable for a later common library.
This commit is contained in:
2026-08-23 15:23:11 -05:00
parent a794db4838
commit b38f7f643b
29 changed files with 893 additions and 0 deletions
@@ -0,0 +1,23 @@
# bambu-nfc Library Implementation Plan
> **For agentic workers:** Use TDD. Spec: `docs/superpowers/specs/2026-08-23-bambu-nfc-library-design.md`
**Goal:** Go module that parses filanfc-dump/v1 zips into Bambu tags/spools and derives MIFARE Key-A from a chip UID.
**Architecture:** Public packages `dump` (JSON/zip), `mifare` (1K layout), root `bambunfc` (HKDF, block parse, Merge).
**Tech Stack:** Go 1.25, stdlib `crypto/hkdf`, `encoding/json`, `archive/zip`.
## Global Constraints
- Module `git.s1d3sw1ped.com/s1d3sw1ped/bambu-nfc`
- Brand on success: `"Bambu Lab"`
- HKDF: IKM=UID, salt=`9a759cf2c4f7caff222cb9769b41bc96`, info=`RFID-A\0`, 16×6 Key-A
- Diameter float32 at block 5 offset 8; tray UID 16 raw bytes hex
- Required dump sectors for a Bambu parse: 0, 1, 2 (`sectors_fail` is sector indexes)
- `go test -race ./...`
- Fixtures from dump-app `docs/dumps/``testdata/`
Tasks: (1) module + mifare (2) dump JSON/zip (3) KeysA (4) ParseImage/ParseDump/ParseZip (5) Merge (6) testdata + README.
Executing in this session per user "do it".