app.py, core/, api/, services/, static/, tests/, and root/docs metadata.This report supersedes the stale 2.32.0 audit. That document claimed “100% test coverage” and “APPROVED FOR PRODUCTION”; neither claim was supported by the evidence.
The feature baseline is broad and the shipped tests were green, but three high-severity problems were invisible to them:
app.py, data/config.json, and data/index.db.All three are fixed, along with the reported left-panel opening problems and the risky always-visible delete button. The 2.x-era duplicated vault helpers have been replaced by one canonical core/vault.py that the HTTP host actually imports.
| Check | Before | After |
|---|---|---|
| Unit tests | 24/24 | 78/78 |
| Live E2E checks | 69/69 (mostly smoke) | 114/114 (shape + security + recovery + contracts + launch + sync + regression checks) |
| Python compile | clean | clean |
node --check static/app.js |
clean | clean |
No API routes, Markdown formats, or local-first guarantees were removed or changed incompatibly. The 3.4 additions (/api/capture, /api/inbox/scan, /api/export/markdown, /Attachments/<name>, and --capture) and the 3.5 recovery endpoints (trash settings/bulk restore, history labels/restore-as-new, verified backups, integrity, and migrations) are additive; existing routes keep their shapes.
| ID | Finding | Evidence | Fix |
|---|---|---|---|
| B1 | History snapshots and deleted/renamed notes stayed in notes_fts. data/index.db had 2 real notes but 43 FTS rows, 31 of them under .portable-notes/history. Stale rows could consume the 200-hit search budget. |
app.py cleanup deleted only from notes; core/vault.refresh() had no snapshot filter. |
core/vault.py now owns indexing: iter_notes() excludes .portable-notes, prune_index() cleans both tables, rename/delete remove FTS rows, and an ALTER TABLE migration adds the legacy size column. Regression tests cover rebuild, refresh, and snapshots. |
| B2 | Whole-repository static disclosure. GET /app.py, /data/config.json, /api/notes.py, /core/vault.py, and directory listings were served because the handler fell through to SimpleHTTPRequestHandler after os.chdir(ROOT). |
Backend audit + live E2E (No repository / config disclosure). |
serve_static() serves only files under static/, rejects hidden/outside paths, and returns JSON 404 otherwise. os.chdir() was removed. |
| B3 | No CSRF/origin check on state-changing localhost requests. A remote page could POST JSON-as-text/plain to /api/trash/empty, /api/rebuild, or /api/task/toggle. |
Backend audit + live E2E (Cross-origin state change blocked, JSON content type enforced). |
origin_ok() rejects foreign Origin/Referer on POST/PUT/DELETE; JSON endpoints require application/json; CLI/urllib clients without origin headers still work. |
| ID | Finding | Evidence | Fix |
|---|---|---|---|
| U1 | Hidden slash menu blocked clicks. style.css gave .slash-menu{display:flex}, overriding the hidden attribute, so a dismissed / menu stayed above the note list and editor. |
Frontend audit; CSS cascade inspection. | Added .slash-menu[hidden]{display:none !important} and an E2E/source-level regression check. |
| U2 | Duplicate notes. Preview wikilinks were bound twice (per-node onclick plus delegated handler), and byTitle()/daily() looked only in the currently filtered st.notes. Missing targets were auto-created twice. |
Frontend audit; source review. | One delegated .wikilink handler; byTitle() and daily() search the whole vault via /api/search?q=; quick capture is debounced. |
| U3 | Notes not opening from the left panel. Per-card onclick handlers were rebuilt on every render, stale tab failures threw silently, and rapid clicks could let an older fetch overwrite a newer one. |
Frontend audit; open() race review. |
Single delegated #list click/keydown handler, keyboard-accessible cards, openSeq guard, try/catch with user-visible toast, and tab cleanup that no longer reopens the closed note. |
| U4 | Duplicated/replicated notes in the left panel. The folder tree rendered every note and the recent-note list did, so the same file appeared twice. | Frontend audit; tree()/render() comparison. |
Tree is now folders only and filters the single note list; “All notes” is an explicit root entry; count/title reflect the active filter. |
| U5 | Destructive delete in the always-visible header. The ⌫ button was easy to hit among other glyph buttons. |
Frontend audit. | Removed #deleteNote from the header; “Delete current note” remains in the command palette. Trash/restore is unchanged and recoverable. |
| B4 | core/vault.py was a divergent fork of helper logic. 'false' became truthy, the wikilink regex truncated aliases to one character, encoded traversal was not decoded, CRLF front matter was ignored, and snapshots were indexed. |
Backend audit; unit tests. | Rewrote core/vault.py as the canonical module and wired it into app.py; all broken behaviours have direct regression tests. |
| B5 | Rename rewrote history snapshots and left stale index rows. | Backend audit. | Link rewriting now iterates iter_notes() and re-indexes changed files; both notes and notes_fts rows are removed on rename/delete. |
| B6 | Risk radar counted completed dependencies as blockers and could 500 on task rows without done. |
Backend audit; E2E Risk radar failure after the first fix. |
waiting now checks .get('done', False); E2E keeps the endpoint under assertion. |
keydown.Ctrl+S toasts “Saved” only after a successful PUT; Ctrl+Shift+N/Ctrl+Shift+V are checked before plain-letter shortcuts.javascript: / data: / vbscript: URLs neutralised; attachment picker accepts non-text files./api/health performs an incremental refresh() instead of a full rebuild() on every request.3.1.0 Constellation; view shortcuts say Ctrl+Shift+2–5.app.py is still a large HTTP host; api/* modules are unwired reference adapters, not runtime route modules.app.py now uses runtime dispatch tables with named handlers while api/routes.py remains the typed contract source of truth.core.tasks.parse_task_line() / parse_tasks() exist and are tested, but 25 task endpoints still import only the regex constants and repeat the parse loop.Task model supplied through TaskRepository.services/task_repository.py is used only by tests; test_done_filter relies on an identity check that should become a truthiness check.app.py, done filtering uses truthiness, and empty row sets are safe.content-visibility rendering virtualization.localStorage but have no recall UI; single-item trash delete is missing. (Both were addressed after this audit; see the Unreleased section of CHANGELOG.md.)python -m unittest discover tests -v # 78 tests, OK
python tests/e2e_ui_actions.py # 114 checks, 0 failed
python scripts/benchmark.py # 1k / 10k / 50k timings → docs/BENCHMARKS.md
python -m py_compile app.py core/*.py api/*.py services/*.py scripts/*.py tests/*.py
python scripts/check_version.py
python scripts/generate_api_docs.py --check
node --check static/app.js
New regression coverage includes:
notes, notes_fts, /api/notes, /api/search, and /api/tree;'false' front matter staying false and wiki aliases resolving to the real target;3.1.0 manifest and no .portable-notes files;data/onboarding.json;? shortcut overlay and the local-only onboarding banner;pn:// / plain-text capture parsing, one-shot --capture without config writes, drop-folder .eml import processed once, and the all-notes Markdown bundle;/api/backup;--set-launch that never persists a temporary vault;409 stale-save guard that leaves the disk copy untouched.The generated report is UI_TEST_REPORT_v3.1.0.md.
Preserved: all existing /api/* routes and response shapes (the onboarding routes are additive), Markdown + YAML front matter as source of truth, disposable SQLite index, localhost-only binding, no telemetry, no account, vanilla JS UI, no build step, and no third-party runtime dependencies.
Not attempted in this revamp: cloud sync, accounts, collaborative editing, heavyweight editor frameworks, or feature parity with Notion/Obsidian. Those are explicitly out of scope in PRODUCT.md.
The 3.1.0 baseline is now internally consistent and the reported usability defects are fixed with regression coverage. The 3.2–3.5 additions preserve that baseline while making recovery, integrity, and upgrades explicit and local. The 3.6 developer layer adds typed contracts, generated API docs, and runtime dispatch tables for app.py; 3.7 adds a launch-mode chooser that changes only how the same localhost UI is opened. The first 4.0 slice adds bring-your-own-folder sync protection without a vendor SDK or network call. This report intentionally makes no “production-ready” or “100% coverage” claim.