Repository navigation
The optional MedxEHR clone comes from SHAPE_MEDXEHR_CLONE, and a guard keeps host paths out of the tree (#61) - #64
Conversation
…d keeps host paths out of the tree (#61) Brett Heap, 2026-09-05: "file the env var fix as a follow-up", then "pick up #61 and merge on green too". tests/test_adopt_plan.py read a hard-coded scratchpad path from one machine and one session (6013a5b, 2026-09-02) for the optional read-only clone of MedxSoft/MedxEHR that the plan test copies before use; the test skipped everywhere else, so the suite stayed green and nobody else could ever opt in. It now reads SHAPE_MEDXEHR_CLONE, this repository's SHAPE_* convention, with deliberately no default, and skips with a message naming the variable when it is unset or names no directory. What the test checks is unchanged. tests/test_repo_hygiene.py gains a guard: no committed text file names a host-absolute path (/home/<user>/, the Claude scratchpad tmp prefix, /Users/<name>/, C:\Users\<name>\). Rule 1 of the estate's agent instructions is the reason, and #61 was the one instance this tree had. Tightened against what the tree legitimately carries: the Windows examples with a space in the username, and the GitHub-hosted runner's own account; the guard spells its own trigger prefix in two pieces so it does not flag itself. Shown to bite on an injected path before landing. No shipped code changes; README and AGENTS.md untouched. 611 passed, 1 skipped on Linux (612 collected). Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 11 hours and 18 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideThe PR removes a machine-specific MedxEHR fixture path in favor of the SHAPE_MEDXEHR_CLONE environment variable and adds a hygiene test that prevents host-absolute paths from being committed in tracked text files. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
The MedxEHR test skip condition checks exists() rather than is_dir(), so an env var pointing at an existing file would run the test and fail at copytree().
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR addresses #61 by removing a machine-specific hardcoded MedxEHR clone path from the test suite and adding a repository hygiene guard to prevent committing host-absolute paths into tracked text files.
Changes:
- Make the optional MedxEHR-backed adoption-plan test read its clone location from
SHAPE_MEDXEHR_CLONEand skip when unavailable. - Add a hygiene test that scans
git ls-filestracked UTF-8 text for common host-absolute path patterns (Linux/macOS/Windows), excluding known safe cases.
File summaries
| File | Description |
|---|---|
| tests/test_adopt_plan.py | Replaces a hardcoded scratchpad path with SHAPE_MEDXEHR_CLONE and updates the skip logic/message. |
| tests/test_repo_hygiene.py | Adds a new hygiene test and regex guard to prevent host-absolute paths from being committed in tracked UTF-8 text files. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…says (Copilot on #64) Copilot's one finding on PR #64: the skip condition tested exists() while its reason said the variable must name a directory; a SHAPE_MEDXEHR_CLONE pointing at a file would have run the test into copytree() instead of skipping. One word. Verified: a variable naming a regular file now skips with the same message. Lane: xfactory-2 (xFactory-2) Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
There was a problem hiding this comment.
🟢 Approval recommended
The changes are confined to tests, align with the stated issue/requirements, and the added guard appears consistent with existing repository content and CI portability goals.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite



Lane: xfactory-2 (xFactory-2)
Claim: #61 (claim comment on the issue)
Closes #61.
What this changes
The optional MedxEHR clone comes from an environment variable, and a guard keeps host paths out of the tree. Brett Heap, 2026-09-05, in session: "file the env var fix as a follow-up", then "pick up #61 and merge on green too".
tests/test_adopt_plan.pyread a hard-coded/tmp/claude-1000/…/adopt-inventory/MedxEHR— one machine's scratchpad from one session (6013a5b, 2026-09-02) — for the optional read-only clone the MedxEHR-backed plan test copies before use. It now readsSHAPE_MEDXEHR_CLONE(theSHAPE_*family is this repository's convention), with deliberately no default, and skips with a message naming the variable when it is unset or names no directory. What the test checks is unchanged.tests/test_repo_hygiene.pygains a guard: no committed text file contains a host-absolute path (/home/<user>/,/tmp/claude-,/Users/<name>/,C:\Users\). Rule 1 of the estate's agent instructions says why — a path baked into a committed file breaks silently when the repository moves — and tests/test_adopt_plan.py names one machine's scratchpad; the optional MedxEHR clone should come from an environment variable #61 was the one instance this tree had. The guard was shown to bite on an injected path before landing.No shipped code changes; README and AGENTS.md untouched, caps unchanged.
Evidence
Linux:
python3 -m pytest tests -q— 611 passed, 1 skipped (612 collected: the new guard passes; the MedxEHR-backed test now skips here becauseSHAPE_MEDXEHR_CLONEis unset, where before it ran against a leftover scratchpad directory that happened to exist on this machine, which is the point) (611 onmainat6942d83; the MedxEHR-backed test skips as before, now naming the variable). macOS and Windows: thetests-macosandtests-windowsjobs on this PR.Merge word: Brett Heap, 2026-09-05, "pick up #61 and merge on green too".
🤖 Generated with Claude Code
Summary by Sourcery
Remove the machine-specific MedxEHR test path and enforce repository hygiene against committed host-absolute paths.
Bug Fixes:
SHAPE_MEDXEHR_CLONEenvironment variable and skip clearly when the clone is unavailable.Tests: