Skip to content

feat: record notesd's and the app shell's problems in the local journal (T857 t12) - #130

Merged
bketelsen merged 1 commit into
mainfrom
irulan/t857-problems
Nov 5, 2026
Merged

bketelsen merged 1 commit into
mainfrom
irulan/t857-problems

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Plan T857, task t12: notesd and the Tauri shell record problems in the local systemd journal (core ADR-0069, schema frostyard.problem/1, kind S8). Decision: ADR-0036.

What changes

  • notesd (github.com/frostyard/std/problems, std v0.5.0), app ID org.frostyard.Frostnotes, component daemon:
    • Panics: RecoverPanic in runWith; a dispatcher in rpcserver records a request handler's panic and re-panics, so the kit still answers internal as before; CrashOutput turns a crash of any other goroutine (or a fatal error) into 1 record at the next start.
    • Codes, each at 1 place: store.migrate_failed (cmd/notesd, on *store.MigrateError), merge.failed (vault.guardMerge: a panic of the merge library is recorded and re-panicked; internal/merge is unchanged), vault.write_failed (vault.writeFailed in write and create; client errors, cancels and simulated crashes are not recorded), watch.overflow_rescan (fsnotify.ErrEventOverflow only), sync.protocol_error (syncer.protocolFault, once for a run of failing sessions).
    • The recorder reaches packages through their configs (internal/problem.Recorder); no package state.
  • Tauri shell (crate frostyard-problems, git dependency on std tag v0.5.0), component gui: src/problems.rs installs the panic hook with the version from package_info().
  • Version stamping: notesd strips 1 leading v (make build's git describe). The Flatpak manifest gives pnpm tauri build --config the version in FROSTNOTES_VERSION (0.0.0), and stamp-version.sh stamps the tag's version there on a v* tag, checked exactly once like the ldflags. A development build (dev, flatpak, v0.5.0-3-gabc, 0.0.0-…-snapshot, a shell at 0.0.0) records nothing.
  • No network: a record is 1 datagram to /run/systemd/journal/socket. README says the apps send nothing; only chairlift can send, under its own consent.
  • make flatpak-sources regenerated cargo-sources.json and go-sources.json.

Tests (test socket, fields checked with problems.Validate / validate)

  • Go: cmd/notesd/problems_test.go (migration end to end through a real socket, main-goroutine panic, crash file in a child process, releaseVersion), internal/vault/problems_test.go (write failure and its exclusions, merge panic, overflow), internal/syncer/problems*_test.go (table test of protocolFault, de-duplication), internal/rpcserver/panic_test.go (handler panic recorded, reply unchanged), internal/store/store_test.go (MigrateError), internal/packagecheck/flatpak_test.go (the new stamp).
  • Rust: problems::tests::a_panic_is_recorded, an_unstamped_build_records_nothing.
  • Revert test: each new test was run with its change removed: 19 of 19 failed (each code, dispatch panic, main panic, crash output, v strip, write exclusions, re-panic, de-duplication, stamp script, 2 Rust tests). Re-checked by hand: watch.overflow_rescan removed → TestAWatchOverflowIsRecorded fails.

Checks

  • make check ✅; go test -race on vault, syncer, store, rpcserver, cmd/notesd, packagecheck ✅
  • nsl: make app-build, make app-test (40 passed) ✅, make ui-check ✅
  • An offline cargo test with the git crate vendored (as the Flatpak does) ✅. No local flatpak-builder run: CI's Flatpak job builds it.

Must not break

RPC replies are unchanged (a panic still answers internal); sync and write behaviour are unchanged (merge panics still propagate); standalone Flatpak behaviour is unchanged; no new network call.

Revert test (scratch worktree at b8de1ab)

internal/problem.Record made a no-op (the recording reverted, tests kept), then go test -count=1 ./internal/vault/ ./internal/syncer/ ./cmd/notesd/: 7 tests fail on their record assertions: TestAWriteThatFailsOnDiskIsRecorded, TestWriteFailedRecordsOnlyInternalErrors, TestAMergeThatPanicsIsRecordedAndPanicsAgain, TestAWatchOverflowIsRecorded, TestAProtocolFaultIsRecordedOncePerRun, TestAProtocolFaultOfTheHubIsRecorded, TestAFailedMigrationIsRecorded. The scratch worktree was restored and removed.

Cross-review

openai/gpt-6.1-sol (coder github-copilot/claude-opus-5.5), base 5675138, head b8de1ab, 33 files in 2 batches (lockfiles and generated sources excluded): Ready, Blocking: none.

…al (T857 t12)

notesd records panics (main goroutine, request handlers, and a crash
file turned into a record at the next start) and 5 coded errors:
store.migrate_failed, merge.failed, vault.write_failed,
watch.overflow_rescan and sync.protocol_error, with
github.com/frostyard/std/problems (std v0.5.0). The Tauri shell records
its panics with the crate frostyard-problems (std tag v0.5.0).

Builds stamp the release version: notesd strips the tag's v, and the
Flatpak's stamp-version.sh also stamps FROSTNOTES_VERSION, which
pnpm tauri build --config gives the shell. A development build records
nothing. Nothing is sent over a network (ADR-0036).
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 5, 2026
@bketelsen
bketelsen merged commit 503fef3 into main Nov 5, 2026
9 checks passed
@bketelsen
bketelsen deleted the irulan/t857-problems branch November 5, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants