This document is the “memory handoff” for continuing work on ABCarus without re-discovering basics each chat. Read this first, then follow the referenced docs.
ABCarus is a small Electron desktop app for working with ABC notation:
- Main process:
src/main/(window, IPC, menu). - Preload bridge:
src/preload.js(renderer ↔ main IPC). - Renderer/UI:
src/renderer/(HTML/CSS/JS). - Import/export tooling:
third_party/(Python scripts, abcMIDIabc2abc).
- Prefer tolerant-read / strict-write: easy to scan/search, hard to corrupt user data.
- File writes must be safe (atomic replace when possible; temp+rename; retries for platform quirks).
- Avoid clever abstractions; keep state ownership clear and changes auditable.
- Throttle UI progress/status updates; do not spam renderer events.
- Maintain existing menu action strings and IPC message names.
- Keep changes small and focused; avoid new dependencies unless necessary.
- AGENTS.md — repo-specific agent notes + constraints.
- WORKFLOW.md — day-to-day workflow, release flow, debug flags, “what not to commit”.
- README.md — user-facing overview and quick commands.
docs/— deeper docs and release notes/checklists.docs/midi2abc-microtones.md— microtone behavior in abc2svg and converter constraints for futureMIDI -> ABCwork.
- Install deps:
npm install - Run app:
npm start
If something behaves “impossibly” (e.g. Electron commands acting like Node), check environment gotchas in WORKFLOW.md.
To avoid "patched but unchanged" loops on visual tasks:
- Run from this repo via
scripts/local/run.sh(ornpm startif local script is unavailable). - Verify the exact acceptance point in-app before reporting done (specific control, state, and expected visual delta).
- For layout/visibility changes, prefer objective checks (DOM state/class/hidden) plus a visible smoke check.
- If the visual effect is subtle, first apply a clearly visible diagnostic delta, verify, then tune it down.
If startup suddenly becomes very slow (blank/white window for seconds), do not assume it is a code regression first.
Electron/Chromium can get stuck on corrupted or locked browser-storage databases under userData and stall startup.
Preferred (non-technical): use the app menu:
Help → Open Settings Folder
Alternative (terminal): while the app is running, find --user-data-dir=...:
pgrep -af electron | head -n 50
In dev, this repo’s Electron profile commonly ends up at:
~/.config/abc-electron-proto
You may see a Chromium log line like:
Failed to delete the database: Database IO error
If this appears and correlates with multi-second startup delays, treat it as a profile storage issue first.
Goal: clear only regeneratable Chromium caches (Service Worker storage and code cache), without touching ABCarus state/settings.
- Quit the app.
- Back up the important ABCarus files from
userData:state.jsonuser_settings.abcabcarus.properties(if present)fonts/(if present)templates/(if present)
- Delete only these folders (they are safe to regenerate):
Service Worker/DatabaseService Worker/CacheStorageService Worker/ScriptCacheCode Cache
After that, launch again. If startup returns to normal and the DB error disappears, the cause was the corrupted/locked Chromium storage.
If the error keeps coming back after cleaning, escalate:
- check filesystem permissions on
userData - check OS logs (
dmesg) for I/O errors
- Manual dump:
Ctrl+Shift+D→ savesabcarus-debug-*.json. - Dumps include file+tune identity near the top (
context.label,context.filePath,context.xNumber). - Default dump dir when running from source:
kitchen/debug_dumps/(not committed).
Auto-dumps are opt-in (dev only):
ABCARUS_DEV_AUTO_DUMP=1 npm start- Optional:
ABCARUS_DEV_AUTO_DUMP_DIR=/some/path
When reporting/fixing a bug, capture:
- Exact file path + tune (
X:) + steps + expected/actual. - One fresh debug dump produced during/after the failure.
During rapid debugging/iteration:
- Prefer working locally (uncommitted or local commits).
- Do not push WIP commits to GitHub unless explicitly requested.
- Push only when there is a coherent checkpoint (or when asked to open/update a PR).
See also: WORKFLOW.md → “Branch / Push etiquette”.
- Upstream updates may arrive under
third_party/_upd/(staging; not committed). - Prefer integrating updates via the repo’s scripts and documenting the delta; avoid hand-editing vendored code unless necessary.
By policy (see WORKFLOW.md and .gitignore):
scripts/local/**(local helpers, dumps).third_party/_upd/**(staging).
- Run tests/harnesses (when relevant):
npm run test:measuresnpm run test:transposenpm run test:settingsnpm run test:truth-scale
ABCarus uses scripts/release.mjs (via npm run release:*) to prepare releases.
It requires a clean git working tree and a non-empty CHANGELOG.md ## [Unreleased] section.
Patch release sequence (typical)
- Ensure
masteris up to date and clean:git checkout master && git pullnpm run test:settings && npm run test:measures
- Add release notes to CHANGELOG.md under
## [Unreleased](must be non-empty), then commit:git add CHANGELOG.md && git commit -m "docs: add unreleased notes for next patch"
- Prepare the release (bumps version, moves changelog entry, creates tag):
npm run release:patch
- Publish:
git push origin mastergit push origin vX.Y.Z
CI gotchas
- If GitHub Actions fails with “GitHub Releases requires a tag”, you ran the release workflow on a branch ref; publishing happens only on tags (
refs/tags/v*). - If GitHub retires runner images (e.g.
macos-13), update.github/workflows/release-assets.ymland cut a new patch tag so the fixed workflow exists in the tag ref used by CI.