Skip to content

Commit 7bf6256

Browse files
committed
better scaffolding, robustness
1 parent a014140 commit 7bf6256

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎.claude/skills/pr-analysis/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Run through this before creating or editing any file under `test/`:
1111

1212
1. **Helpers first:** Check `test/db_test_helpers.py` for existing factories (`make_db`, `make_device_dict`, `insert_device_from_dict`, `DummyDB`). Use them. If what you need doesn't exist, add it there — never define it locally in the test file.
1313
2. **MAC literals must be lowercase:** Every MAC string in fixtures, parametrize, assertions, docstrings, and comments must be lowercase hex (e.g. `aa:bb:cc:dd:ee:01`). No exceptions.
14-
3. **Test file location:** Place tests under a subdirectory of `test/` that mirrors the source path (e.g. `test/scan/` for `server/scan/`). Never put test files directly in `test/`.
14+
3. **Test file location:** Place *new* tests under a subdirectory of `test/` that mirrors the source path (e.g. `test/scan/` for `server/scan/`). Don't add new files directly in `test/` root - a handful of existing ones there (e.g. `test_plugin_helper.py`, `test_wol_validation.py`) predate this convention; that's not license to add more, but don't migrate them unprompted either.
1515
4. **No inline imports:** All imports at the top of the file.
1616

1717
## Before Acting on Any PR Comment

‎.gemini/skills/pr-analysis/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Run through this before creating or editing any file under `test/`:
1111

1212
1. **Helpers first:** Check `test/db_test_helpers.py` for existing factories (`make_db`, `make_device_dict`, `insert_device_from_dict`, `DummyDB`). Use them. If what you need doesn't exist, add it there — never define it locally in the test file.
1313
2. **MAC literals must be lowercase:** Every MAC string in fixtures, parametrize, assertions, docstrings, and comments must be lowercase hex (e.g. `aa:bb:cc:dd:ee:01`). No exceptions.
14-
3. **Test file location:** Place tests under a subdirectory of `test/` that mirrors the source path (e.g. `test/scan/` for `server/scan/`). Never put test files directly in `test/`.
14+
3. **Test file location:** Place *new* tests under a subdirectory of `test/` that mirrors the source path (e.g. `test/scan/` for `server/scan/`). Don't add new files directly in `test/` root - a handful of existing ones there (e.g. `test_plugin_helper.py`, `test_wol_validation.py`) predate this convention; that's not license to add more, but don't migrate them unprompted either.
1515
4. **No inline imports:** All imports at the top of the file.
1616

1717
## Before Acting on Any PR Comment

‎.github/skills/devcontainer-setup/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Reprovision and reset the devcontainer environment. Use this when a
55

66
# Devcontainer Setup
77

8-
The setup script forcefully resets all runtime state. It is idempotent—every run wipes and recreates all relevant folders, symlinks, and files.
8+
The setup script forcefully resets all *runtime* state (services, tmpfs ramdisks, symlinks, log files) unconditionally on every run. Persistent DB/config content under `/data` is the one exception - it's preserved by default; see step 7 below.
99

1010
## Command
1111

@@ -29,8 +29,8 @@ The setup script forcefully resets all runtime state. It is idempotent—every r
2929
- After modifying setup scripts
3030
- After container rebuild
3131
- When environment is in broken state
32-
- After database reset
32+
- To pick up a database/config reset done another way (setup.sh itself won't reset them - see step 7)
3333

3434
## Philosophy
3535

36-
No conditional logic. Everything is recreated unconditionally. If something doesn't work, run setup again.
36+
Runtime state (services, tmpfs, symlinks, logs) has no conditional logic - everything is recreated unconditionally, every run. DB/config are the one deliberate exception, gated behind `ALWAYS_FRESH_INSTALL`. If something in runtime state doesn't work, run setup again.

‎.github/skills/pr-analysis/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Run through this before creating or editing any file under `test/`:
1111

1212
1. **Helpers first:** Check `test/db_test_helpers.py` for existing factories (`make_db`, `make_device_dict`, `insert_device_from_dict`, `DummyDB`). Use them. If what you need doesn't exist, add it there — never define it locally in the test file.
1313
2. **MAC literals must be lowercase:** Every MAC string in fixtures, `parametrize`, assertions, docstrings, and comments must be lowercase hex (e.g. `aa:bb:cc:dd:ee:01`). No exceptions.
14-
3. **Test file location:** Place tests under a subdirectory of `test/` that mirrors the source path (e.g. `test/scan/` for `server/scan/`). Never put test files directly in `test/`.
14+
3. **Test file location:** Place *new* tests under a subdirectory of `test/` that mirrors the source path (e.g. `test/scan/` for `server/scan/`). Don't add new files directly in `test/` root - a handful of existing ones there (e.g. `test_plugin_helper.py`, `test_wol_validation.py`) predate this convention; that's not license to add more, but don't migrate them unprompted either.
1515
4. **No inline imports:** All imports at the top of the file.
1616

1717
## Before Acting on Any PR Comment

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Three distinct roots, each with a different persistence contract — get this wr
5757
- `configPath` (`/data/config`) — durable, user-facing. `app.conf` lives here; config-like plugin artifacts (exports, backups) belong here too.
5858
- `logPath` (`/tmp/log`, plus `/tmp/api`, `/tmp/db_is_locked`, nginx state) — **ephemeral tmpfs**, wiped on every container restart. Never put anything here you need to survive a restart. (`server/plugins/adguard_export`, `unifi_import` were both fixed this way after shipping with state files rooted in `logPath` — check any plugin that opens a file outside its `RESULT_FILE` against this before assuming it's fine.)
5959

60-
All three are exported from `server/const.py` (`dbFolderPath`, `configPath`, `dataPath`, `logPath`) and importable by any plugin.
60+
All three, plus `dataPath` (`/data`, the bare parent of `dbFolderPath`/`configPath` - avoid writing loose files directly under it; pick one of the two subpaths above instead), are exported from `server/const.py` and importable by any plugin.
6161

6262
### Plugin system (`server/plugins/*/`)
6363

0 commit comments

Comments
 (0)