Repository navigation
fix: read the model-directory recheck's relpath with '/' on Windows - #1065
Conversation
Release v0.11.1 — Fail Closed
The v0.11.1 publish matrix failed on every Windows combination (nothing was published): os.path.relpath answers 'models\final' there, and the layout check, which takes the config's '/' form, rejected it, so a run with a nested training.final_model_dir would fail after training, at finalisation. The recheck now converts the separator; on POSIX a backslash is part of a name and that path still fails the resolve() comparison that follows. Two Linux-runnable regression tests, one per mutant (no conversion; no resolve comparison). The [0.11.1] CHANGELOG entry that promised the recheck for nested directories now says it holds on Windows too, and the release record's test count moves from 6769 to 6771. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring back the merge commit of the first v0.11.1 release pull request so the next one starts up to date.
|
Architecture Data flow No data-flow sequence changed in this PR. Tip Add 🪧 More tips
Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn |
|
Sorry @cemililik, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 21 hours and 48 minutes by commenting |
Reviewer's GuideFixes a Windows-only failure in runtime model-destination rechecks by translating platform backslashes to the config’s forward-slash layout format, while preserving resolve-based protection against POSIX path-name ambiguity. Adds focused regression tests, updates v0.11.1 release metadata, and restores the main merge history. Sequence diagram for cross-platform model destination rechecksequenceDiagram
participant Runtime
participant ArtifactPaths
participant OS
participant LayoutValidator
participant PathResolver
Runtime->>ArtifactPaths: _check_model_destination(output_dir, final_path, config)
ArtifactPaths->>OS: os.path.relpath(final_path, output_dir)
OS-->>ArtifactPaths: platform-relative path
ArtifactPaths->>ArtifactPaths: replace("\\", "/")
ArtifactPaths->>LayoutValidator: _validate_layout(output_dir, relative, benchmark_output_dir)
LayoutValidator-->>ArtifactPaths: expected destination
ArtifactPaths->>PathResolver: resolve comparison
PathResolver-->>ArtifactPaths: actual destination matches or rejects
Flow diagram for Windows nested model-directory validationflowchart TD
A[Windows relpath: models\\final] --> B[Normalize separators: models/final]
B --> C[_validate_layout accepts config path]
C --> D[resolve comparison checks actual destination]
D --> E[Runtime recheck passes]
F[POSIX name containing backslash] --> G[resolve comparison detects mismatch]
G --> H[Runtime recheck rejects path]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
Fix a Windows regression that stopped the
v0.11.1publish run, and bringmain's release merge commit back intodevelopment. Merge with "Create a merge commit" so the sync keeps its second parent.Related issues
None filed. #962 tracks the gap that let this through: tests run on Windows only when a release tag is pushed.
What happened
The
v0.11.1tag's publish run built the wheel and passed every Ubuntu and macOS combination, but all four Windows combinations failed on the same four tests intests/test_eu_ai_act.py::TestFinalizedModelIntegrity. Because of that, thepublishjob was skipped and nothing reached PyPI.The four tests are the ones that use a nested
training.final_model_dir: models/final. The flow that failed:_check_model_destinationrechecks the destination before saving, finalising or reverting. It computes the relative path withos.path.relpath.models\final._validate_layouttakes the config's/form and rejects any backslash.The rule arrived in this release cycle, so no published version has the bug.
Changes
forgelm/_artifact_paths.py. The recheck now reads the relative path with/separators (.replace("\\", "/")). On POSIX a backslash is part of a directory name, and such a path still fails, because the existingresolve()comparison right after the check rejects it. A comment records both points.tests/test_config.py. Two regression tests that run on Linux:test_runtime_recheck_accepts_a_windows_relpathmakesrelpathanswer with backslashes, as it does on Windows, and checks that the final and staging destinations pass. It fails without the fix.test_runtime_recheck_rejects_a_backslash_in_a_posix_namechecks thatmodels\finalas one POSIX name is still refused. It fails if theresolve()comparison is removed. It is skipped on Windows, where a backslash is a separator.CHANGELOG.md[0.11.1]. The existing entry already promised the recheck for "nested custom model directories". I amended that entry instead of adding aFixedline, because no shipped version has the bug. The release record's test count moves from 6769 to 6771.main. It brings back6e050be, the Release v0.11.1 — Fail Closed #1064 merge commit, and changes no file.Next steps (owner-approved)
development→main).v0.11.1tag and recreate it, GPG-signed, on the new merge commit.Type
Testing
GAUNTLET_RC=0.tests/test_config.py,tests/test_eu_ai_act.pyandtests/test_trainer.pypass (551 tests).resolve()comparison in the other.Checklist
[0.11.1], which has not been published yet)🤖 Generated with Claude Code
Summary by Sourcery
Fix cross-platform model-directory validation so nested custom destinations pass runtime rechecks on Windows without weakening POSIX path safety.
Bug Fixes:
Documentation:
Tests:
Chores:
Summary by CodeRabbit