From a7b24dc2154d482d64cb4f5010aced703f62e0cf Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 18 Mar 2026 20:05:55 -0700 Subject: [PATCH] docs: update CLAUDE.md and progress for sim migration Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 18 +++++++++++++++- docs/plans/2026-03-18-refactor-progress.md | 24 ++++++++++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e76f977..9fd3ecb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,23 @@ pm3py/ 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) + sim/ # card simulation framework (~7.8k LOC, 686 tests) + transponder.py # Transponder ABC, MemoryRegion + medium.py # Medium, SoftwareMedium (RF simulation) + reader.py # Reader ABC, ScriptedReader, InteractiveReader + frame.py # RFFrame (bit/byte level) + iso14443a.py # Tag14443A, Tag14443A_3/4, Reader14443A + iso15693.py # Tag15693, Reader15693 + mifare.py # MifareClassicTag + Crypto1 + desfire.py # DesfireTag, DesfireReader + type5.py # NfcType5Tag (NDEF on 15693) + nxp_icode.py # NxpIcodeTag base + icode_slix.py # → icode_slix2 → icode3, icode_dna + ntag5_platform.py # → ntag5_switch, ntag5_link → ntag5_boost + sim_session.py # SimSession (table compile + WTX relay) + table_compiler.py # ResponseTable, TableCompiler + trace_fmt.py # TraceFormatter (14443-A + 15693 decoders) + # + lf_base, em4100, hid, t5577, ndef, implants, fuzzer, relay, etc. 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 0cb3e6d..0e45f5e 100644 --- a/docs/plans/2026-03-18-refactor-progress.md +++ b/docs/plans/2026-03-18-refactor-progress.md @@ -67,20 +67,32 @@ All directories have `__init__.py`. Model migration from sim worktree is a separ ## Phase 4 — Scaffold `reader/` and `sim/` -**Status: Complete (scaffolded)** +**Status: sim/ migrated, reader/ scaffolded** + +### sim/ migration (complete) + +Migrated full sim framework from `.worktrees/sim-framework/` to `pm3py/sim/`: +- 43 source files, ~7.8k LOC +- 23 test files, 686 tests +- Import fixes: 4 source files (..protocol/..transport → ..core.*), 1 source file (pm3py.hf_15 → pm3py.trace.ndef), 2 test files (flat → core.*) +- Added sim Cmd entries to `core/protocol.py` (EML_SETMEM, SIM_TABLE_*) +- Added deps to venv: `pycryptodome`, `bitarray` +- **751 total tests passing** (686 sim + 65 core) + +### reader/ (scaffolded) Created directory trees per design: - `reader/hf/nxp/` — NXP reader ICs (CLRC663, PN5xx) - `reader/hf/st/` — ST reader ICs - `reader/lf/` - `reader/modes/` — inventory, programming, access control workflows -- `sim/` — sim session, table compiler, relay (migrate from worktree) -All directories have `__init__.py`. Sim migration (~41 files, 7.8k LOC) is a separate effort. +All reader directories have `__init__.py` stubs. ## Next Steps -- Transponder migration: extract base classes from sim worktree, populate `transponders/` modules -- Sim migration: move sim session, table compiler, relay into `sim/` +- Reorganize transponder models from `sim/` into `transponders/` hierarchy (optional — sim/ works as-is) - Reader modes: implement inventory, programming, access workflows in `reader/modes/` -- Sniff: add `decode_iso14a.py` stub when 14443-A sniff support is added +- Unify `sim/trace_fmt.py` with `trace/` package (dedup 15693 decoders, move 14443-A decoders) +- Sniff: add `decode_iso14a.py` using decoders from `sim/trace_fmt.py` +- Sim worktree cleanup: verify parity, then remove `.worktrees/sim-framework/`