diff options
Diffstat (limited to 'CONSOLIDATION.md')
| -rw-r--r-- | CONSOLIDATION.md | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/CONSOLIDATION.md b/CONSOLIDATION.md new file mode 100644 index 0000000..5180987 --- /dev/null +++ b/CONSOLIDATION.md | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | # Consolidation Plan | ||
| 2 | |||
| 3 | Merge all feature branches into master, establish tollgate_core as the single source of truth, | ||
| 4 | and clean up worktrees/stashes/stale branches. | ||
| 5 | |||
| 6 | ## End State | ||
| 7 | |||
| 8 | ``` | ||
| 9 | esp32-tollgate (master only) | ||
| 10 | main/ = thin shell calling tollgate_core API | ||
| 11 | components/tollgate_core/ = THE reusable core (cashu, dns, firewall, session, mining, stratum) | ||
| 12 | |||
| 13 | esp-miner-nerdqaxeplus (develop) | ||
| 14 | references tollgate_core via IDF Component Manager (override_path for local dev) | ||
| 15 | |||
| 16 | esp-miner (master) | ||
| 17 | references tollgate_core via IDF Component Manager (after its feature/tollgate-component-integration) | ||
| 18 | ``` | ||
| 19 | |||
| 20 | --- | ||
| 21 | |||
| 22 | ## Phase 1: Preserve Uncommitted Work | ||
| 23 | |||
| 24 | - [ ] **1.1** Apply stash@{1} to master (AP-only services, market config wiring, sta_connecting guard) | ||
| 25 | - [ ] **1.2** Commit: "feat: AP-only services startup + market config wiring (from stash)" | ||
| 26 | - [ ] **1.3** Drop stashes 0, 2, 3 (compiled binaries only, no source) | ||
| 27 | - [ ] **1.4** Verify master builds: `idf.py build` | ||
| 28 | - [ ] **1.5** Verify unit tests pass: `make test-unit` | ||
| 29 | - [ ] **1.6** Commit + push | ||
| 30 | |||
| 31 | ## Phase 2: Merge feature/display-fix (touch + WiFi setup UI) | ||
| 32 | |||
| 33 | - [ ] **2.1** Verify feature/display-fix has no uncommitted source changes (only binaries — confirmed) | ||
| 34 | - [ ] **2.2** Squash-merge feature/display-fix into master | ||
| 35 | - [ ] **2.3** Resolve any conflicts (display.c/font.c may conflict with master versions) | ||
| 36 | - [ ] **2.4** Verify build: `idf.py build` | ||
| 37 | - [ ] **2.5** Verify unit tests: `make test-unit` (should pick up test_touch, test_keyboard, test_wifi_setup) | ||
| 38 | - [ ] **2.6** Commit + push | ||
| 39 | |||
| 40 | ## Phase 3: Merge feature/miner-integration (full tollgate_core) | ||
| 41 | |||
| 42 | This is the critical merge. Master has the OLD tollgate_core skeleton (9 files, 7 callbacks). | ||
| 43 | feature/miner-integration has the FULL version (13 files, 22 callbacks, extern C, mining + stratum). | ||
| 44 | We need to take the miner-integration version of tollgate_core entirely. | ||
| 45 | |||
| 46 | - [ ] **3.1** Verify feature/miner-integration has no uncommitted source changes (only binaries — confirmed) | ||
| 47 | - [ ] **3.2** Checkout feature/miner-integration version of tollgate_core into master: | ||
| 48 | - Replace `components/tollgate_core/` entirely with the miner-integration version | ||
| 49 | - This adds: tollgate_core_mining.c/h, tollgate_core_stratum_proxy.c/h | ||
| 50 | - This updates: tollgate_core.h (extern C + 5 new mining API functions) | ||
| 51 | - This updates: tollgate_platform.h (extern C + 14 new platform callbacks for mining/stratum) | ||
| 52 | - This updates: tollgate_core_firewall.c (conditional NAPT) | ||
| 53 | - This updates: CMakeLists.txt (mining + stratum source files) | ||
| 54 | - [ ] **3.3** Commit: "feat: upgrade tollgate_core to full version with mining + stratum + extern C" | ||
| 55 | - [ ] **3.4** Merge remaining docs from feature/miner-integration (REMOTES.md, MINER_INTEGRATION_PLAN.md) | ||
| 56 | - [ ] **3.5** Verify build: `idf.py build` | ||
| 57 | - [ ] **3.6** Verify unit tests: `make test-unit` | ||
| 58 | - [ ] **3.7** Commit + push | ||
| 59 | |||
| 60 | ## Phase 4: Restructure — Option B (main/ calls tollgate_core API) | ||
| 61 | |||
| 62 | Move module logic from main/ into components/tollgate_core/, making main/ a thin shell. | ||
| 63 | |||
| 64 | - [ ] **4.1** Identify modules in main/ that have tollgate_core equivalents: | ||
| 65 | - cashu.c/h → tollgate_core_cashu.c/h | ||
| 66 | - dns_server.c/h → tollgate_core_dns.c/h | ||
| 67 | - firewall.c/h → tollgate_core_firewall.c/h | ||
| 68 | - session.c/h → tollgate_core_session.c/h | ||
| 69 | - mining_payment.c/h → tollgate_core_mining.c/h | ||
| 70 | - stratum_proxy.c/h → tollgate_core_stratum_proxy.c/h | ||
| 71 | - [ ] **4.2** For each module: replace main/*.c implementation with calls to tollgate_core API | ||
| 72 | - Keep the main/*.c files as thin wrappers that delegate to tollgate_core | ||
| 73 | - OR remove them entirely if tollgate_core API is called directly from tollgate_main.c | ||
| 74 | - [ ] **4.3** Update main/CMakeLists.txt — remove replaced source files from SRCS | ||
| 75 | - [ ] **4.4** Verify build: `idf.py build` | ||
| 76 | - [ ] **4.5** Verify unit tests: `make test-unit` | ||
| 77 | - [ ] **4.6** Run integration tests if hardware available: `make test-integration` | ||
| 78 | - [ ] **4.7** Commit: "refactor: main/ delegates to tollgate_core component" | ||
| 79 | - [ ] **4.8** Push | ||
| 80 | |||
| 81 | ## Phase 5: Wire up NerdQAxePlus via Component Manager | ||
| 82 | |||
| 83 | - [ ] **5.1** Create main/idf_component.yml in NerdQAxePlus: | ||
| 84 | ```yaml | ||
| 85 | dependencies: | ||
| 86 | tollgate_core: | ||
| 87 | override_path: /home/c03rad0r/esp32-tollgate/components/tollgate_core | ||
| 88 | ``` | ||
| 89 | - [ ] **5.2** Remove symlink: rm esp-miner-nerdqaxeplus/components/tollgate_core | ||
| 90 | - [ ] **5.3** Update main/CMakeLists.txt — remove hardcoded include path, use component dependency | ||
| 91 | - [ ] **5.4** Verify build: `BOARD=NERDAXE TOLLGATE=1 idf.py build` | ||
| 92 | - [ ] **5.5** Commit + push | ||
| 93 | |||
| 94 | ## Phase 6: Delete Branches & Worktrees | ||
| 95 | |||
| 96 | - [ ] **6.1** Delete feature/tollgate-core-component branch (merged in commit be4788b) | ||
| 97 | - [ ] **6.2** Delete backup/multi-mint-support-pre-rebase branch (fully in master) | ||
| 98 | - [ ] **6.3** Delete feature/display-fix branch (merged in Phase 2) | ||
| 99 | - [ ] **6.4** Delete feature/miner-integration branch (merged in Phase 3) | ||
| 100 | - [ ] **6.5** Remove worktree: esp32-miner-integration/ | ||
| 101 | - [ ] **6.6** Remove worktree: esp32-tollgate-arch/ | ||
| 102 | - [ ] **6.7** Remove worktree: esp32-tollgate-display/ | ||
| 103 | - [ ] **6.8** Clean up test binaries from git tracking: `git rm --cached tests/unit/test_*` (keep in .gitignore) | ||
| 104 | - [ ] **6.9** Refresh backup bundles | ||
| 105 | - [ ] **6.10** Push everything | ||
| 106 | |||
| 107 | ## Phase 7: Update esp-miner (optional, after consolidation) | ||
| 108 | |||
| 109 | - [ ] **7.1** Switch esp-miner from flat-file modules to tollgate_core via Component Manager | ||
| 110 | - [ ] **7.2** Create main/idf_component.yml with git dependency on esp32-tollgate | ||
| 111 | - [ ] **7.3** Delete flat-file TollGate modules from main/ (tollgate_cashu/dns/firewall/session.c/h) | ||
| 112 | - [ ] **7.4** Create main/tollgate_platform.c implementing tollgate_platform_t with NVS backend | ||
| 113 | - [ ] **7.5** Verify build | ||
| 114 | - [ ] **7.6** Commit + push | ||
| 115 | |||
| 116 | --- | ||
| 117 | |||
| 118 | ## Current State Summary | ||
| 119 | |||
| 120 | ### Repos | ||
| 121 | |||
| 122 | | Repo | Path | Branch | HEAD | Status | | ||
| 123 | |------|------|--------|------|--------| | ||
| 124 | | esp32-tollgate | /home/c03rad0r/esp32-tollgate | master | 897a8d9 | Canonical source | | ||
| 125 | | esp-miner-nerdqaxeplus | /home/c03rad0r/esp-miner-nerdqaxeplus | develop | 588c9f67 | Consumer | | ||
| 126 | | esp-miner | /home/c03rad0r/esp-miner | master | a8dc494 | Consumer (Phase 1 done) | | ||
| 127 | |||
| 128 | ### Branches (esp32-tollgate) | ||
| 129 | |||
| 130 | | Branch | Worktree | Merged? | Unique Content | Action | | ||
| 131 | |--------|----------|---------|----------------|--------| | ||
| 132 | | master | esp32-tollgate | — | Current production code | Keep | | ||
| 133 | | feature/display-fix | esp32-tollgate-display | NO | touch.c/h, keyboard.c/h, wifi_setup.c/h, 4 unit tests, E2E test, WiFi QR, error state | Merge (Phase 2) | | ||
| 134 | | feature/miner-integration | esp32-miner-integration | PARTIAL | Full tollgate_core (mining+stratum+extern C+22 callbacks), docs | Merge (Phase 3) | | ||
| 135 | | feature/tollgate-core-component | esp32-tollgate-arch | YES (be4788b) | None — superseded by miner-integration | Delete (Phase 6) | | ||
| 136 | | backup/multi-mint-support-pre-rebase | (none) | YES | None | Delete (Phase 6) | | ||
| 137 | |||
| 138 | ### Stashes (esp32-tollgate) | ||
| 139 | |||
| 140 | | Stash | Content | Action | | ||
| 141 | |-------|---------|--------| | ||
| 142 | | stash@{0} | Recompiled test binaries (no source changes) | Drop | | ||
| 143 | | stash@{1} | AP-only services, market config wiring, sta_connecting guard | Apply (Phase 1) | | ||
| 144 | | stash@{2} | Recompiled test binaries (no source changes) | Drop | | ||
| 145 | | stash@{3} | Recompiled test binaries (no source changes) | Drop | | ||
| 146 | |||
| 147 | ### Tollgate Core Divergence | ||
| 148 | |||
| 149 | | File | Master (old skeleton) | Miner-integration (full) | | ||
| 150 | |------|----------------------|--------------------------| | ||
| 151 | | tollgate_core.h | 34 lines, no extern C, no mining API | 48 lines, extern C, 5 mining functions | | ||
| 152 | | tollgate_platform.h | 17 lines, 7 callbacks | 37 lines, extern C, 22 callbacks | | ||
| 153 | | CMakeLists.txt | 9 source files (no mining/stratum) | 11 source files (mining+stratum) | | ||
| 154 | | tollgate_core_firewall.c | unconditional NAPT | conditional CONFIG_LWIP_IPV4_NAPT | | ||
| 155 | | tollgate_core_mining.c | MISSING | Present (168 lines) | | ||
| 156 | | tollgate_core_mining.h | MISSING | Present (35 lines) | | ||
| 157 | | tollgate_core_stratum_proxy.c | MISSING | Present (160 lines) | | ||
| 158 | | tollgate_core_stratum_proxy.h | MISSING | Present (39 lines) | | ||