PeaNote keeps recovery local and explainable. Nothing here needs an account, cloud service, telemetry, or network call. Markdown files in vault/ remain the source of truth.
The running version is 3.11.0; the 4.0 sync-safety preview now guards board task toggles and snapshots linked notes before rename rewrites, with no vendor SDK or network call.
Ctrl+Z undoes the last editor change; Ctrl+Y or Ctrl+Shift+Z redoes it.#editor has focus. Title, tags, search, dialog inputs, and the quick-capture field keep their native browser undo.Ctrl+Shift+P) and shortcut overlay (?).Deleting a note (Ctrl+Shift+P → “Delete current note”) moves the Markdown file to vault/.portable-notes/trash/ with a timestamp suffix. It is excluded from search, graph, tree views, and exports.
The Trash view adds:
Inbox/ with a collision-safe name.data/config.json and is applied when the policy is saved or a bulk restore runs; listing trash is read-only.“Empty trash” permanently removes all trashed files and still asks for confirmation.
Every save snapshots the previous note into .portable-notes/history/ (20 per note). In Ctrl+H you can:
.labels.json sidecar, never as a note.restored tag.If you put vault/ inside OneDrive, Dropbox, Syncthing, or another sync folder, PeaNote stays offline-first: it never contacts those services. On the next local refresh it detects an external modification or removal and:
.portable-notes/history/ stream (same 20-per-note retention);vault/.portable-notes/sync.json (newest 100 events kept), with path, action, time, hashes, and snapshot id;Ctrl+Shift+P → Sync status / conflicts or GET /api/sync.When you save a note that changed on disk since you opened it, the server compares the updated stamp and a SHA-256 body fingerprint. A mismatch returns 409 with the current note instead of overwriting it. The dialog offers Keep my version or loading the newer disk version; choosing to load keeps your draft in editor undo history. No event or snapshot leaves the machine.
“Back up vault now” or POST /api/backup writes a ZIP under vault/.portable-notes/backups/:
.portable-notes/ and symlinks are excluded.portable-notes-backup.json manifest records version, creation time, vault path, and note count.testzip(), the manifest is checked, and a .json sidecar records the SHA-256 digest and verified: true. A failed check deletes the archive.CLI: python app.py --backup creates one verified backup and exits without persisting a --vault override.
“Check vault integrity” runs a read-only GET /api/integrity scan and reports:
| Issue | Meaning |
|---|---|
broken_link |
[[wiki link]] or relative Markdown link has no target, or points outside the vault |
missing_attachment |
A linked file such as Attachments/photo.png does not exist |
duplicate_path |
Two notes differ only by case, which is unsafe on Windows/macOS |
malformed_front_matter |
YAML-like front matter has an unclosed block, missing colon, empty key, duplicate key, or orphan list item |
Each issue names the note and the detail. The checker never rewrites files; fix issues in Markdown or via the editor and rescan with “Rescan”.
Versions are explicit: config_version in data/config.json and SQLite user_version in data/index.db. Current targets are CONFIG_VERSION = 1 and SCHEMA_VERSION = 1.
GET /api/migrations (or “Upgrade & recovery”) shows a dry-run plan. It never creates or writes config or the index DB.POST /api/migrations { "action": "apply", "dry_run": false } copies data/config.json and data/index.db to data/migrations/<token>.* first, then stamps the versions. Unknown/user config keys are preserved.POST /api/migrations { "action": "rollback", "token": "..." } restores those local files. Apply prints the token in the UI and API response.CLI equivalents:
python app.py --migrate plan # read-only preview
python app.py --migrate apply # backup, then stamp versions
python app.py --rollback TOKEN # restore the pre-migration files
All one-shot commands skip save_cfg() when --vault is supplied, so a maintenance run does not change your saved vault path.
| Method | Path | Purpose |
|---|---|---|
GET |
/api/trash?q=&sort= |
Search/sort trashed files |
POST |
/api/trash/restore |
{ "names": [...] } bulk restore |
GET / POST |
/api/settings/trash |
Read or update retention policy |
POST |
/api/history/label |
{ "path", "id", "label" } |
POST |
/api/history/restore |
{ "path", "id" } → new note |
GET |
/api/history/diff?path=&id1=&id2= |
Segments plus aligned side-by-side rows |
POST |
/api/backup |
Create and verify a local ZIP |
GET |
/api/settings/backup |
Settings plus backup manifest list |
GET |
/api/integrity |
Read-only vault health report |
GET / POST |
/api/migrations |
Dry-run plan / apply / rollback |
GET |
/api/sync |
Read-only external-change ledger (?limit= not required) |
All mutating endpoints require a same-origin localhost request and application/json, as with every other write.
python -m unittest discover tests -v # 78 tests
python tests/e2e_ui_actions.py # 114 live checks
See UI_TEST_REPORT_v3.11.0.md for the generated per-action report and AUDIT_REPORT.md for the broader reliability history.