Skip to content

fix: read the invoked model path once for staleness checks - #368

Open
rksharma-owg wants to merge 1 commit into
OWASP:masterfrom
rksharma-owg:codex/fix-stale-model-path
Open

rksharma-owg wants to merge 1 commit into
OWASP:masterfrom
rksharma-owg:codex/fix-stale-model-path

Conversation

@rksharma-owg

Copy link
Copy Markdown

Running python models/model.py --stale_days 2 looks for models/models/model.py and returns [ERROR]. _stale joins the model directory to sys.argv[0], although the invocation path already contains that directory.

Read the invocation path directly, retaining the existing model-relative sourceFiles lookup. Six real CLI tests cover directory, ./ prefix, nested-directory and space-containing paths, plus current-directory and absolute-path controls.

Validation for 8185eefb2c13cfe62a4a9e921d4194a70c64dc75, based on 381dea05c58055ba218e632510dd3a327d2bf215:

  • Local baseline: 251 tests passed. The new tests fail in four relative-path cases before the fix; both controls pass. Patched suite: 257 passed.
  • Fork preflight: Ubuntu/Python 3.11–3.14 each reproduced the baseline failures and passed all 257 patched tests. Package builds and test-file Black/Ruff checks passed on each runtime.
  • Equivalent Python CodeQL analysis passed with zero findings for baseline and patch, using current v4 actions because the upstream workflow uses retired v1 actions.

Existing full-file Black formatting drift in pytm/tm.py is identical on baseline and patch; the changed assignment adds none. The adopted CI has no formatting gate. Optional CodeSee requires an upstream secret and was not run in the fork.

This was discovered during CLI testing; no existing issue or competing fix was found. The contribution changes one production line and adds the regression tests, with no workflow or dependency changes.

@rksharma-owg
rksharma-owg requested a review from izar as a code owner October 11, 2026 18:02
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.

1 participant