|
| 1 | +# Channel Bank Module Instructions |
| 2 | + |
| 3 | +These instructions apply to all work under `misc_modules/channel_bank/` and |
| 4 | +supplement the repository-root `AGENTS.md`. |
| 5 | + |
| 6 | +## Scope and platform preservation |
| 7 | + |
| 8 | +- Keep Channel Bank work scoped to this module unless the user explicitly |
| 9 | + requests a core or cross-module change. |
| 10 | +- Desktop/macOS uses `src/main.cpp`; iOS uses `src/main_ios.cpp`. Preserve both |
| 11 | + implementations and their platform-specific CMake wiring. |
| 12 | +- Do not overwrite the iOS implementation with the desktop implementation, or |
| 13 | + vice versa. Share behavior deliberately when a change belongs on both. |
| 14 | +- Use a task-specific build directory or a build directory known to match the |
| 15 | + current branch. Do not trust a CMake cache copied from another worktree. |
| 16 | +- Never commit models, recordings, runtime configuration, app bundles, |
| 17 | + dependency output, or build output. |
| 18 | + |
| 19 | +## Required validation |
| 20 | + |
| 21 | +At minimum, configure the repository with Channel Bank enabled and build the |
| 22 | +`channel_bank` target. Build the full `sdrpp` target when shared interfaces, |
| 23 | +module registration, packaging, or runtime integration changed. For iOS-facing |
| 24 | +changes, also build the iOS simulator application. |
| 25 | + |
| 26 | +Before deployment, record the commit being tested and whether the worktree is |
| 27 | +dirty. A successful library link is not sufficient deployment validation. |
| 28 | + |
| 29 | +## Private deployment configuration |
| 30 | + |
| 31 | +The public repository intentionally contains no SSH host, user name, launchd |
| 32 | +labels, or private paths. Before any Channel Bank deployment, locate the |
| 33 | +repository root and read `../LOCAL_DEPLOYMENT.md` relative to that root. |
| 34 | + |
| 35 | +- If the private guide is absent, stop and ask the user for it. Do not guess |
| 36 | + the host, service labels, application path, or signing procedure. |
| 37 | +- Never stage or commit the private guide or reproduce its private values in a |
| 38 | + tracked file, commit message, pull request, or public log. |
| 39 | +- The private guide is operational configuration, not source code. Git pulls |
| 40 | + and fresh clones do not replace it. |
| 41 | + |
| 42 | +## Remote macOS completion workflow |
| 43 | + |
| 44 | +For Channel Bank work intended for runtime testing, the default completion |
| 45 | +workflow includes deploying the complete macOS test application after build |
| 46 | +validation, unless the user explicitly requests build-only work. |
| 47 | + |
| 48 | +Follow the private guide in this order: |
| 49 | + |
| 50 | +1. Build and validate the complete macOS application locally. |
| 51 | +2. Stage the new app bundle on the remote Mac without touching the installed |
| 52 | + app or stopping services yet. |
| 53 | +3. Inspect and record which configured plist-managed SDR++ services are |
| 54 | + loaded. Only those services may be stopped or restarted. |
| 55 | +4. Stop the loaded services with `launchctl bootout`. Do not merely kill their |
| 56 | + processes because launchd may immediately restart them. |
| 57 | +5. Preserve exactly one complete rollback app using the path in the private |
| 58 | + guide, then replace the installed test app with the staged bundle. |
| 59 | +6. Clear extended attributes. Sign every nested Mach-O file and dynamic |
| 60 | + library first, then sign the outer app bundle. Do not rely on deprecated |
| 61 | + `codesign --deep` signing behavior. |
| 62 | +7. Run full strict codesign verification. If it fails, do not start services |
| 63 | + from the new bundle; restore the rollback app and verify it instead. |
| 64 | +8. Restart only the services that were loaded before deployment, using their |
| 65 | + plist files and `launchctl bootstrap`. |
| 66 | +9. Verify each expected service, process, listening port, and recent log. A |
| 67 | + successful copy or `launchctl` exit status alone is not enough. |
| 68 | + |
| 69 | +Never stop or restart unrelated GUI instances, unmanaged SDR++ servers, or |
| 70 | +services not listed in the private guide unless the user explicitly broadens |
| 71 | +the deployment scope. |
| 72 | + |
| 73 | +If any step after service shutdown fails, prioritize restoring the known-good |
| 74 | +app and the prior service state before investigating the new build. |
0 commit comments