The boundary after a known folder counted any "." as part of a name, so
"cannot open /home/max." kept the home folder, and withoutFolders would
then have kept its last segment, the user name. A "." now continues the
name only when a letter, mark, digit, "_" or "-" follows it:
/home/max.old and /home/max.2 stay, "/home/max." becomes "~.".
Found by the author's self-review.
Resolves#497
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wording of review 27245: the 300 000 random lines are not all of that
shape; the measure is what holds for the paths that have one.
Resolves#497
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One sub-bullet at the end of the checks due at the next release: on a
secondary test profile under Linux and Windows, a folder in place of
its database makes the opening fail, and the "Migration repair failed"
and "database preparation failed" lines must name the file without any
segment of the home folder, in the Journal, in what "Copy" copies and
in a test feedback (PR #512).
Resolves#497
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR 0021, section 7, now describes the exact curtain (the home and
profile folders, replaced in every entry, what it leaves: other
folders, subfolder names, 8.3 names, a line of db.ts already cut by the
heuristic before late folders), then the heuristic, its stops and its
two limits, with the corrections of review 27245 of PR #491: a path
glued to a character outside BEFORE_START has no recognized start and
can start from the home folder, and #478 adds rare cases to that limit;
"(" and the backtick open a new path too, and a blank in a following
folder leaves its words; a double quote and a line break keep the
suffix. The startup delay also covers the wait for the folders.
docs/architecture.md: logFolders.ts in the services table (22, and 28
services in the tree), the wait inside the section of connectToProfile,
cleanLogLine for every line of db.ts, the replacement and the replay in
logService, scrub in repair_migrations, what send_feedback carries, the
injected logError of the startup. CLAUDE.md counts 28 services.
CHANGELOG: one Fixed entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A path glued to ";" keeps "jean" through withoutFolders alone: one test
per site (failed close, failed checksum repair, stopped catch-up and
its copy, failed preparation) turns red if that site goes back to the
heuristic alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
withoutFolders guesses where a path starts and ends, and five review
passes each found a line it let a folder through: blanks, soft stops, a
kept stop in a folder name, the fallback after a cut, a path glued to a
character that starts nothing. The new src/services/logFolders.ts knows
the two folders that hold the OS user name instead: the home folder
(homeDir) becomes "~" and the folder of the profile databases
(appConfigDir) "<profile folder>", the latter first.
- replaceKnownFolders: either separator and any run of them between
segments (JSON.stringify doubles each backslash), case ignored with a
drive letter, trailing separator of the folder dropped, and a
boundary after it, so /home/max leaves /home/maxime alone. Never
throws.
- setKnownFolders builds the patterns once, every segment escaped
(CWE-185: a raw "(" would make every captured console call throw),
and ignores an empty or root folder.
- initKnownFolders resolves both folders once, independently
(Promise.allSettled), never rejected; knownFoldersReady resolves when
they are known or 2 s after initKnownFolders, and at once when it was
never called.
logService replaces them in every entry, whatever its channel, and
replayLogEntries rewrites the entries written before they arrived,
sessionStorage included; main.tsx wires it right after initLogCapture.
db.ts waits for knownFoldersReady inside the exclusive section of
connectToProfile, before repair_migrations, and its four sites clean a
line with cleanLogLine: the exact folders, then withoutFolders, which
does not change. "Migration checksums repaired for" goes through
logWarn, and startupConnection writes through a logError that App.tsx
passes: neither file writes to the Journal through console.* any more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
repair_migrations built its two errors without scrub: rusqlite appends
the full path of a database it cannot open, so "Cannot open database"
carried the profile folder, and the OS user name with it, to the
Journal. The body moves to repair_at(db_path), which passes every error
it returns through scrub once, at its exit, with the database's parent
folder; the command resolves the path, then calls it.
The test replaces the database file with a folder of the same name: the
exists() guard passes and rusqlite fails to open it even as root, where
a read-only file would simply open read-only. It first checks that
rusqlite's own message names the folder, then that repair_at's error
names the file and <profile folder>, and no segment of the folder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>