From 7fc2470b012c62d85a7503c00b3339c1d144b04e Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 18 Mar 2026 19:49:59 -0700 Subject: [PATCH] docs: update CLAUDE.md and progress for trace/ package Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 12 +++++++++--- docs/plans/2026-03-18-refactor-progress.md | 22 +++++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c44da53..e76f977 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,12 +27,18 @@ pm3py/ hw.py # hardware commands, LED API (platform-aware) hf.py # HF core — tune, search, sniff, dropfield hf_iso14a.py # ISO 14443-A — scan, raw. Uses MIX frames - hf_iso15.py # ISO 15693 — scan, rdbl, wrbl, sniff + trace decoders + hf_iso15.py # ISO 15693 — scan, rdbl, wrbl, thin sniff cmd hf_mfc.py # MIFARE Classic — rdbl, wrbl, rdsc, chk, nested, cident lf.py # LF commands + T55xxCommands + LFSearchResult - sniff/ # sniff sessions, trace parsing, protocol decoders (scaffold) + trace/ # firmware trace infrastructure (shared by sniff, sim, reader) + trace.py # parse_tracelog, TRACELOG_HDR_SIZE + decode_iso15.py # ISO 15693 command/response decoders + ndef.py # NDEF TLV/record decode for trace annotation + format.py # ANSI color formatting, format_sniff_line + sniff/ # sniff orchestration — protocol detection, session lifecycle + session.py # SniffSession — start/download/decode per protocol sim/ # card simulation sessions, table compiler, relay (scaffold) - reader/ # higher-level reader modes (scaffold) + reader/ # higher-level reader modes by protocol/vendor (scaffold) transponders/ # tag/transponder models independent of hardware (scaffold) ``` diff --git a/docs/plans/2026-03-18-refactor-progress.md b/docs/plans/2026-03-18-refactor-progress.md index 8df22e8..0cb3e6d 100644 --- a/docs/plans/2026-03-18-refactor-progress.md +++ b/docs/plans/2026-03-18-refactor-progress.md @@ -35,17 +35,21 @@ **Status: Complete** -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 +Extracted sniff infrastructure from `core/hf_iso15.py` (615→130 lines) into two packages: -`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`. +**`pm3py/trace/`** — shared trace infrastructure (used by sniff, sim, reader): +- `trace.py` — `parse_tracelog()`, `TRACELOG_HDR_SIZE` (protocol-agnostic) +- `ndef.py` — NDEF TLV/record decode (`decode_ndef_annotation()`) +- `decode_iso15.py` — ISO 15693 command/response decoders, command tables +- `format.py` — ANSI color formatting, `format_sniff_line()` -**65/65 tests passing** (35 sniff tests work through re-exports, no test changes needed). +**`pm3py/sniff/`** — sniff orchestration (consumes trace/): +- `session.py` — `SniffSession` with `iso15()` method (replaces `sniff_decoded()`) +- `__init__.py` — re-exports trace symbols for convenience + +`core/hf_iso15.py` retains `HF15Commands` (scan/rdbl/wrbl/sniff) and re-exports trace symbols for backward compat. `download_trace()` and `sniff_decoded()` delegate to `SniffSession`. + +**65/65 tests passing** (35 sniff/trace tests work through re-exports, no test changes needed). ## Phase 3 — Scaffold `transponders/`