mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-04 06:21:59 +09:00
* fix(cost-tracker): match Claude Code project slug for all non-alphanumerics The #1927 fix replaced only /, \\\\ and :, but Claude Code replaces every non-alphanumeric character in a project path with '-'. Paths containing '_' or '.' (for example C:\\Users\\john_doe\\my.project) therefore resolved to a directory that never exists, and the Stop hook silently persisted nothing (#4366).\n\nMove the encoder into a shared _encode-project-path.mjs, use it from track.mjs and the two test harnesses that were duplicating the old regex, and add unit coverage plus an end-to-end smoke case for an underscore/dot Windows path. The regression is visible in the unit test and in the 'looked under' diagnostic: the old code leaves 'my_project.v2' literal; the new code matches Claude Code's 'my-project-v2'. * chore(witness): repoint #1927 marker to _encode-project-path.mjs (#4366) #4366 moved encodeProjectPath out of track.mjs into a new shared _encode-project-path.mjs, taking the #1927 marker comment with it in different wording. Re-point all three OS manifests' #1927 entry at the new file/marker text and regenerate so witness-marker-drift-smoke and witness-verify-precondition-smoke pass again. Co-authored-by: 马建彤 <majiantong666@qq.com> Co-Authored-By: RuFlo <ruv@ruv.net> * fix(witness): don't append a history snapshot from an unbuilt checkout regen.mjs's --history flag records the current verification state as a new history entry. My prior regen ran in a source-only worktree (no pnpm build), so it recorded ~99 dist-dependent fixes as "missing" that CI's built-tree verify never saw as missing -- history.mjs then read that back as a mass regression against prior (post-build) snapshots. The actual fix (#1927 marker repointed to _encode-project-path.mjs) only needed the manifest's marker/file/sha256 corrected and re-signed, not a new history entry. Revert history.jsonl to its pre-regen state in all three OS directories; manifest.md.json is unchanged by this commit. Co-Authored-By: RuFlo <ruv@ruv.net> --------- Co-authored-by: 马建彤 <majiantong666@qq.com> Co-authored-by: r <r@x>
13 lines
471 B
JavaScript
13 lines
471 B
JavaScript
/**
|
|
* Claude Code's `~/.claude/projects/<slug>` encoding.
|
|
*
|
|
* #1927 fixed the Windows drive colon/backslash case, but the old
|
|
* `[/\\:]` replacement still left `_`, `.`, spaces and non-ASCII characters
|
|
* literal. Claude Code replaces *every* non-alphanumeric character with `-`,
|
|
* so those paths never resolved and the Stop hook silently tracked nothing
|
|
* (#4366).
|
|
*/
|
|
export function encodeProjectPath(cwd) {
|
|
return String(cwd).replace(/[^a-zA-Z0-9]/g, '-');
|
|
}
|