Skip to content

Commit 63374d1

Browse files
committed
chore: streamline docs and test suite structure
1 parent 724083b commit 63374d1

52 files changed

Lines changed: 942 additions & 1203 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: CI
33
on:
44
pull_request:
55
push:
6+
workflow_dispatch:
67

78
jobs:
89
test-and-static-checks:
@@ -67,6 +68,27 @@ jobs:
6768
name: phasmid-release-review
6869
path: /tmp/phasmid-release
6970

71+
optional-test-profile:
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- name: Check out repository
76+
uses: actions/checkout@v4
77+
78+
- name: Set up Python
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: "3.10"
82+
83+
- name: Install dependencies
84+
run: |
85+
python -m pip install --upgrade pip
86+
python -m pip install -r requirements.txt
87+
python -m pip install -r requirements-dev.txt
88+
89+
- name: Run optional test profile
90+
run: python -m unittest discover -s tests_optional
91+
7092
reproducible-build:
7193
runs-on: ubuntu-latest
7294

@@ -93,3 +115,25 @@ jobs:
93115
sha256sum /tmp/repro-a/MANIFEST.sha256 /tmp/repro-a/sbom.cyclonedx.json /tmp/repro-a/release-summary.json /tmp/repro-a/phasmid-release.tar.gz | awk '{print $1}' > /tmp/repro-a.sha
94116
sha256sum /tmp/repro-b/MANIFEST.sha256 /tmp/repro-b/sbom.cyclonedx.json /tmp/repro-b/release-summary.json /tmp/repro-b/phasmid-release.tar.gz | awk '{print $1}' > /tmp/repro-b.sha
95117
diff -u /tmp/repro-a.sha /tmp/repro-b.sha
118+
119+
archive-review-tests:
120+
if: github.event_name == 'workflow_dispatch'
121+
runs-on: ubuntu-latest
122+
123+
steps:
124+
- name: Check out repository
125+
uses: actions/checkout@v4
126+
127+
- name: Set up Python
128+
uses: actions/setup-python@v5
129+
with:
130+
python-version: "3.10"
131+
132+
- name: Install dependencies
133+
run: |
134+
python -m pip install --upgrade pip
135+
python -m pip install -r requirements.txt
136+
python -m pip install -r requirements-dev.txt
137+
138+
- name: Run archive-review test profile
139+
run: python -m unittest discover -s tests_archive_review

AGENTS.md

Lines changed: 4 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Use this file to keep AI-assisted changes small, scoped, and consistent with the
2929

3030
### Current Focus: Unified JES Operator Surface Hardening and Documentation Consistency
3131

32-
The JES Operator Interface unification work is merged into **`main`** and the Raspberry Pi Zero 2 W validation issue track (`#89` through `#94`) is completed. The current focus is stability maintenance of the unified operator experience, preserving WebUI/TUI terminology parity, and keeping implementation and documentation synchronized without reintroducing branch-specific assumptions. Design concept: *政府機関・軍 × DEFCONハッカー* — institutional structure with terminal-hacker aesthetic.
32+
The JES Operator Interface unification work is merged into **`main`** and the Raspberry Pi Zero 2 W validation issue track (`#89` through `#94`) is completed. The current focus is stability maintenance of the unified operator experience, preserving WebUI/TUI terminology parity, and keeping implementation and documentation synchronized without reintroducing branch-specific assumptions.
3333

3434
### Active Branch
3535

@@ -130,6 +130,7 @@ Preserve these invariants unless a change explicitly updates the threat model, s
130130
## Canonical Source Map
131131

132132
Load only the relevant files for the requested change. Do not load the whole repository by default.
133+
Issue-level implementation history is maintained in `docs/ROADMAP_HISTORY.md`.
133134

134135
### Cryptography, Container Format, and Key Path
135136

@@ -145,14 +146,6 @@ Use this context for changes involving `vault.bin`, the Phasmid vault core, Argo
145146
- `docs/THREAT_MODEL.md`
146147
- `tests/test_vault_core.py` and related tests
147148

148-
Relevant issues:
149-
150-
- `#4` cryptographic erase and local access-path invalidation
151-
- `#5` Argon2id + HKDF-SHA-256 migration
152-
- `#10` cryptographic module boundary and startup self-tests
153-
- `#19` local multi-source key derivation pipeline ✅
154-
- `#26` vault cryptographic core split ✅
155-
156149
### TUI Operator Console
157150

158151
Use this context for changes involving the Textual-based operator interface, TUI screens, widgets, theme, banner, service layer, or WebUI lifecycle management from the TUI:
@@ -167,7 +160,7 @@ Use this context for changes involving the Textual-based operator interface, TUI
167160
- `docs/TUI_OPERATOR_CONSOLE.md`
168161
- `tests/test_tui.py`
169162

170-
Design concept: *政府機関・軍 × DEFCON hacker*institutional structure with terminal-hacker aesthetic.
163+
Design concept: structured institutional UI with terminal-first aesthetics.
171164
Theme: `phasmid-dark` (`primary=#00d7af`, `background=#0d0d0d`, `success=#87d700`).
172165

173166
Key TUI-only responsibilities (do not replicate these in WebUI):
@@ -176,11 +169,6 @@ Key TUI-only responsibilities (do not replicate these in WebUI):
176169
- WebUI lifecycle control (start/stop/auto-kill) via `WebUIService`
177170
- Secure passphrase input (terminal prompt, not browser field)
178171

179-
Relevant issues:
180-
- `#39` JES Neon-Ops design system for WebUI (TUI color parity) ✅
181-
- `#41` Operator Console pages (shared service layer usage) ✅
182-
- `#42` Terminology alignment (TUI vocabulary → WebUI) ✅
183-
184172
### WebUI, API Routes, and Restricted Actions
185173

186174
Use this context for changes involving FastAPI routes, Web mutation token, restricted confirmation, hidden routes, Field Mode, face lock sessions, store/retrieve routes, maintenance routes, emergency routes, response headers, or neutral download filenames:
@@ -195,21 +183,6 @@ Use this context for changes involving FastAPI routes, Web mutation token, restr
195183
- `docs/THREAT_MODEL.md`
196184
- `tests/test_web_server.py` and related tests
197185

198-
Relevant issues:
199-
200-
- `#3` observable differences in restricted recovery flows
201-
- `#7` authentication attempt limiting and backoff
202-
- `#15` WebUI security headers and CSRF review
203-
- `#21` deployment profiles and capability table
204-
- `#22` restricted action policy enforcement ✅
205-
- `#24` local coercion and restricted-flow scenario matrix ✅
206-
- `#25` user-visible UI and CLI strings ✅
207-
- `#39` JES Neon-Ops design system overhaul (Phase 1–2) ✅
208-
- `#40` Operator Console navigation + WebUI exposure banner (Phase 3) ✅
209-
- `#41` Operator Console pages: Doctor, Audit, Guided, Inspect (Phase 0+4) ✅
210-
- `#42` WebUI/TUI terminology alignment (Phase 5) ✅
211-
- `#43` Brand polish and animation update (Phase 6–7) ✅
212-
213186
### CLI Behavior
214187

215188
Use this context for changes involving `main.py`, command syntax, CLI output, confirmations, retrieve/store/init/brick/reset-face-lock behavior, or CLI terminology:
@@ -221,15 +194,6 @@ Use this context for changes involving `main.py`, command syntax, CLI output, co
221194
- `docs/THREAT_MODEL.md`
222195
- `tests/test_cli.py` and related tests
223196

224-
Relevant issues:
225-
226-
- `#4` cryptographic erase and local access-path invalidation
227-
- `#6` access passphrase policy and strength checks
228-
- `#7` authentication attempt limiting and backoff
229-
- `#11` process hardening and secure memory best-effort support
230-
- `#25` user-visible UI and CLI strings ✅
231-
- `#29` local operations commands and docs alignment ✅
232-
233197
### Object Cue, Camera Matching, and Face Lock
234198

235199
Use this context for changes involving ORB matching, camera capture, object cue registration, match ambiguity, stable multi-frame matching, face template enrollment, or UI lock behavior:
@@ -240,12 +204,6 @@ Use this context for changes involving ORB matching, camera capture, object cue
240204
- `docs/THREAT_MODEL.md`
241205
- related tests in `tests/`
242206

243-
Relevant issues:
244-
245-
- `#20` multi-object cue and visual sequence matching
246-
- `#27` split camera, object cue, and face UI lock responsibilities
247-
- `#28` local dual-passphrase approval flow, if face-lock replacement is affected
248-
249207
### Metadata Handling
250208

251209
Use this context for changes involving metadata risk detection, metadata reduction, uploads, in-memory processing, file type support, original filename handling, or neutral metadata-reduced downloads:
@@ -256,12 +214,6 @@ Use this context for changes involving metadata risk detection, metadata reducti
256214
- `docs/THREAT_MODEL.md`
257215
- related tests in `tests/`
258216

259-
Relevant issues:
260-
261-
- `#24` scenario matrix ✅
262-
- `#25` user-visible UI and CLI strings ✅
263-
- `#30` metadata reduction for exported payloads
264-
265217
### Audit Logging
266218

267219
Use this context for changes involving event logs, audit record shape, hash chains, HMACs, log export, audit filenames, event names, or audit metadata:
@@ -273,13 +225,6 @@ Use this context for changes involving event logs, audit record shape, hash chai
273225
- `docs/SPECIFICATION.md`
274226
- related tests in `tests/`
275227

276-
Relevant issues:
277-
278-
- `#2` hash-chained audit log integrity checks
279-
- `#16` release integrity manifest and SBOM workflow
280-
- `#29` local operations commands and docs alignment ✅
281-
- `#31` audit integrity and hash-chaining
282-
283228
### Local State and Deployment Posture
284229

285230
Use this context for changes involving `.state/`, state file names, state permissions, typed state, attempt limiting, tmpfs, LUKS, deployment profile, appliance setup, service hardening, runtime secrets, or Raspberry Pi deployment:
@@ -295,17 +240,6 @@ Use this context for changes involving `.state/`, state file names, state permis
295240
- `docs/SOLUTION_READINESS_PLAN.md`
296241
- related tests in `tests/`
297242

298-
Relevant issues:
299-
300-
- `#11` process hardening and secure memory best-effort support
301-
- `#12` volatile local key-material store using tmpfs
302-
- `#13` local device-binding inputs
303-
- `#17` optional LUKS layer
304-
- `#18` restricted recovery observability on target hardware ✅
305-
- `#21` deployment profiles and capability table
306-
- `#23` typed local state store and transition checks ✅
307-
- `#29` local operations commands and docs alignment ✅
308-
309243
### Testing, CI, Coverage, and Release Review
310244

311245
Use this context for changes involving tests, CI, static analysis, coverage, release validation, SBOMs, manifests, or review records:
@@ -319,11 +253,6 @@ Use this context for changes involving tests, CI, static analysis, coverage, rel
319253
- `docs/SOLUTION_READINESS_PLAN.md`
320254
- `README.md`
321255

322-
Relevant issues:
323-
324-
- `#16` release integrity manifest and SBOM workflow
325-
- `#24` scenario matrix ✅
326-
327256
---
328257

329258
## Documentation Authority
@@ -539,12 +468,6 @@ Before finalizing an AI-generated change, verify:
539468

540469
## Operational Discipline
541470

542-
### AI Context Management
543-
544-
- Load only the **minimal set of files** required for the current domain.
545-
- Do not initiate broad repository-wide rewrites.
546-
- Check `ruff` and `mypy` before submitting any Python changes.
547-
548471
### Self-Hardening Execution Rules
549472

550473
When implementing tasks generated from `PHASMID_SELF_HARDENING_ISSUES.md`, follow these additional constraints:
@@ -559,7 +482,7 @@ When implementing tasks generated from `PHASMID_SELF_HARDENING_ISSUES.md`, follo
559482
### Change & Test Strategy
560483

561484
- **Surgical Edits**: Prefer targeted edits over full-file rewrites for large files.
562-
- **Verification**: Always run `python3 -m unittest discover -s tests` after changes.
485+
- **Verification**: Run `ruff`, `mypy`, and `python3 -m unittest discover -s tests` after changes.
563486
- **No Regressions**: Ensure coverage stays above **70%**.
564487

565488
---

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This repository accepts focused, reviewable contributions that preserve Phasmid'
2929

3030
## Minimum Validation Before PR
3131

32-
- Run: `python3 -m unittest discover -s tests`
32+
- Run default profile: `python3 -m unittest discover -s tests`
33+
- Run optional profile when your change touches optional modules (AI/object/camera/LUKS/property tests): `python3 -m unittest discover -s tests_optional`
34+
- Run archive-review profile only when you are updating historical/evaluation paths: `python3 -m unittest discover -s tests_archive_review`
3335
- For Python changes, also run: `python3 -m ruff check .` and `python3 -m mypy src`
3436
- For self-hardening issues that require it, run additional checks listed in the issue (for example `black --check` and `bandit`).

0 commit comments

Comments
 (0)