Skip to content

fix: preserve client cwd across scrub rules and label forms - #24

Draft
rynfar wants to merge 5 commits into
mainfrom
codex/cwd-preservation-22-23-20261012
Draft

rynfar wants to merge 5 commits into
mainfrom
codex/cwd-preservation-22-23-20261012

Conversation

@rynfar

@rynfar rynfar commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Client working directories containing OpenCode/OhMyOpenCode or instruction-like text can be rewritten by fingerprint rules, corrupting project context. The optional Primary working directory label can also lose the cwd entirely. This integration protects cwd metadata before prose scrubbing and accepts the supported label forms while preserving ordinary scrub behavior and idempotence.

Incorporates #22 and #23 through actual authored cherry-picks preserving Mohamed R. Khalil's and Sergio Márquez's Author/AuthorDate. The overlap is resolved in the shared cwd extractor. A separate maintainer correction fixes a demonstrated interaction: the protection matcher also needs Primary, case and whitespace variations or bare metadata still gets corrupted.

Before: 23 of #23's 24 new regressions fail on main. The initial combination passes 55 tests but fails two additional cross-contribution controls. After correction: all 57 tests (613 assertions) and TypeScript build pass. Exact author mappings, adversarial findings and before/after logs are in docs/evidence/cwd-22-23/.

Draft acceptance gates: a committed actual-client cwd/tool/continuation harness, independently installed package, affected Windows/client/model verification with both required plugins, and final-head CI. The contributor's Windows fixture report is retained as reported evidence, not independently reproduced proof. No credential access, live model call, package version change or release is part of this preparation. Sources #22/#23 and issue #21 remain open.

Installed-package review found and corrected one additional real integration defect: a protected tabbed cwd label remained unreadable by Meridian's production parser. Canonicalizing every retained label fixes six failing cases. The committed credentialless scripts/e2e-cwd-package.mjs uses the real Meridian loader/transform runner, cwd parser and conversation fingerprint against independently installed tarballs: intermediate 6/48 fail; corrected 48/48 pass; published 0.2.3 48/48 fail. All runs retain active plugin and successful hook witnesses, entrypoint/implementation hashes and package integrity. Genuine unmarked passthrough remains unchanged. This is package/parser evidence, not native Windows/client or live model acceptance. Unit suite remains 57 passing tests (625 assertions), build and pack pass.

mradwankhalil and others added 5 commits October 12, 2026 12:10
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 #21.
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.

3 participants