Skip to content

fix(scrub): capture Primary working directory form in keepClientCwd - #22

Merged
rynfar merged 1 commit into
rynfar:mainfrom
mradwankhalil:fix/primary-working-directory
Oct 15, 2026
Merged

rynfar merged 1 commit into
rynfar:mainfrom
mradwankhalil:fix/primary-working-directory

Conversation

@mradwankhalil

Copy link
Copy Markdown
Contributor

Fixes #21

  • Accept the optional Primary prefix in the keepClientCwd capture regex (Claude Code env form), preserving the client cwd in the kept block
  • Case-insensitive matching preserved; legacy form unchanged
  • 3 new tests (Primary form, legacy form, mixed case) — suite 20/20
  • Verified live against the published 0.2.3 dist: cwd preserved through the bridge while all fingerprint scrubbing (identity lines, , brand tokens) remains intact

Claude Code env blocks emit "Primary working directory:" — the line-anchored
"Working directory:" capture missed it, so the kept <env> block lost the cwd
entirely. Consumers reading the client cwd from the scrubbed prompt (Meridian
session keying, model project context) degrade. Accept the optional Primary
prefix; case-insensitive as before. Fixes rynfar#21.
@mradwankhalil

Copy link
Copy Markdown
Contributor Author

Status from my side, now that #24 carries this commit together with #23.

Checked today on Windows 11 x64, Bun 1.3.14, no live model calls:

Head bun test tsc --noEmit
this PR, 50e9526 31 pass, 0 fail (71 assertions) not rerun
#24, d75fca9 57 pass, 0 fail (625 assertions) clean

This branch still sits directly on current main (77316d2) and is mergeable. That is the unit suite only. It is not the native Windows client and model verification #24 lists as a draft gate, and I have not run scripts/e2e-cwd-package.mjs.

I'm fine with either route: landing #24, or merging this PR and putting #23 and your two corrections on top. Maintainer edits are enabled on this branch if you want to push to it directly. If a specific Windows check from the #24 gate list would help, tell me which one and I'll run it.

@rynfar
rynfar merged commit cf047f8 into rynfar:main Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keepClientCwd misses Primary working directory form — env cwd dropped from scrubbed prompt

2 participants