From 20f5d66f93df81deccf74f8f7ceada647c2aea73 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 18 Mar 2026 19:46:10 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20update=20refactor=20progress=20?= =?UTF-8?q?=E2=80=94=20all=20phases=20complete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/plans/2026-03-18-refactor-progress.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/plans/2026-03-18-refactor-progress.md b/docs/plans/2026-03-18-refactor-progress.md index fb93adf..8df22e8 100644 --- a/docs/plans/2026-03-18-refactor-progress.md +++ b/docs/plans/2026-03-18-refactor-progress.md @@ -1,7 +1,7 @@ # pm3py Refactor Progress **Design:** [2026-03-18-refactor-design.md](2026-03-18-refactor-design.md) -**Branch:** `refactor/core-package` +**Branch:** merged to `master` **Started:** 2026-03-18 ## Phase 1 — Create `core/`, normalize names, fix imports @@ -33,11 +33,19 @@ ## Phase 2 — Extract `sniff/` -**Status: Scaffolded — extraction deferred** +**Status: Complete** -`hf_iso15.py` is 94 lines of clean reader commands + thin `sniff()` firmware call. The trace parsing, 15693 decoders, NDEF annotation, and ANSI formatting described in the design doc haven't been written yet. Nothing to extract. +Extracted sniff infrastructure from `core/hf_iso15.py` (615→130 lines) into dedicated modules: +- `sniff/trace.py` — `parse_tracelog()`, `TRACELOG_HDR_SIZE` (protocol-agnostic) +- `sniff/ndef.py` — NDEF TLV/record decode (`decode_ndef_annotation()`) +- `sniff/decode_iso15.py` — ISO 15693 command/response decoders, command tables +- `sniff/format.py` — ANSI color formatting, `format_sniff_line()` +- `sniff/session.py` — `SniffSession` with `iso15()` method (replaces `sniff_decoded()`) +- `sniff/__init__.py` — re-exports all public symbols -Created `pm3py/sniff/__init__.py` placeholder. Will extract into sub-modules when sniff infrastructure is implemented. +`core/hf_iso15.py` retains `HF15Commands` (scan/rdbl/wrbl/sniff) and re-exports sniff symbols for backward compat. `download_trace()` and `sniff_decoded()` delegate to `SniffSession`. + +**65/65 tests passing** (35 sniff tests work through re-exports, no test changes needed). ## Phase 3 — Scaffold `transponders/` @@ -68,7 +76,7 @@ All directories have `__init__.py`. Sim migration (~41 files, 7.8k LOC) is a sep ## Next Steps -- Sniff infrastructure: implement trace parsing, 15693 decoders, NDEF annotation, ANSI formatting in `sniff/` - Transponder migration: extract base classes from sim worktree, populate `transponders/` modules - Sim migration: move sim session, table compiler, relay into `sim/` - Reader modes: implement inventory, programming, access workflows in `reader/modes/` +- Sniff: add `decode_iso14a.py` stub when 14443-A sniff support is added