Skip to content

Commit 4575fcd

Browse files
Will DarneyWill Darney
authored andcommitted
Document safe Channel Bank deployment workflow
1 parent 09f9a97 commit 4575fcd

3 files changed

Lines changed: 120 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ file, and confirm the requested runtime target. Commit and push the focused
4848
branch after validation; merge it into `integration/main` only after it is
4949
working.
5050

51+
Modules may contain a more specific `AGENTS.md`. Read and follow the nearest
52+
module-level instructions before changing or deploying that module. A scoped
53+
instruction file may also direct you to a private deployment guide outside the
54+
repository; never copy private machine details from that guide into a commit.
55+
5156
## Validation
5257

5358
Configure the combined macOS build from the repository root:

docs/LOCAL_DEPLOYMENT.example.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Local SDR++ Deployment Guide Template
2+
3+
Copy this template to `../LOCAL_DEPLOYMENT.md` relative to the repository root
4+
and fill it in locally. The resulting file is outside the Git repository and
5+
must not be committed.
6+
7+
## Target
8+
9+
- SSH target: `<user>@<host>`
10+
- launchd domain: `gui/<uid>`
11+
- Installed application: `/Applications/<test-app>.app`
12+
- Single rollback application: `/Applications/<test-app>.previous.app`
13+
- Remote staging path: `/private/tmp/<test-app>.new.app`
14+
15+
## Managed services
16+
17+
List only services that this deployment is authorized to stop and restart.
18+
19+
| Purpose | Label | Plist | Port | stdout | stderr |
20+
| --- | --- | --- | --- | --- | --- |
21+
| Server 1 | `<label>` | `~/Library/LaunchAgents/<label>.plist` | `<port>` | `<path>` | `<path>` |
22+
23+
Also list any SDR++ processes or services that must explicitly remain
24+
untouched.
25+
26+
## Required procedure
27+
28+
1. Build and validate the full app locally.
29+
2. Copy the new bundle to the remote staging path.
30+
3. Record which authorized services are loaded.
31+
4. Boot out only loaded authorized services.
32+
5. Replace the single rollback copy with the current known-good app.
33+
6. Move the staged app into the installed location.
34+
7. Clear extended attributes and sign nested Mach-O files before the bundle.
35+
8. Verify the installed bundle with strict codesign verification.
36+
9. Bootstrap only the services that were previously loaded.
37+
10. Verify service state, listening ports, processes, and logs.
38+
11. On failure, restore the rollback app and prior service state.
39+
40+
Document any host-specific permission requirements, but do not add passwords,
41+
private keys, access tokens, or other secrets to this file.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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

Comments
 (0)