Repository navigation
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
The coding pack holds a write to a .pth file as "writing a model weights file" (TK-A058 for the file tools, TK-A059 for the shell; tracekit/policy2/packs/coding.yaml L472-489). That's right for a PyTorch checkpoint (checkpoints/model.pth). But a .pth file in a site-packages or dist-packages folder is something else: Python's site module reads every one of them at each interpreter start, adds its lines to sys.path and runs its lines that start with import. Holding that write is right, and it matters more than a weights file, but the reason a person sees is wrong, so they can't tell what they are approving.
On main, with dev.yaml, coding.yaml and server.yaml alike:
| call | decision |
|---|---|
Write to /home/u/proj/.venv/lib/python3.11/site-packages/src.pth |
ask, TK-A058, "writing a model weights file" |
Bash cp src.pth /home/u/proj/.venv/lib/python3.11/site-packages/src.pth |
ask, TK-A059, "writing a model weights file" |
Bash cp model.pth checkpoints/model.pth |
ask, TK-A059 (right) |
What's needed
- A
.pthwritten directly in asite-packagesordist-packagesfolder, by a file tool or by the shell (the same write targets TK-A059 reads,WRITE_TARGET:), is held with a reason that says what it is, for example "writing a Python .pth file, which runs at every Python start", and a rationale to match. - Those paths no longer match TK-A058 and TK-A059, so one call shows one reason. A
.pthanywhere else keeps the weights reason. - New rules take the next free ids after the open PRs' (Hold CI workflow writes that upload secrets #663 adds TK-A061, Policy: raw Docker or Podman socket calls and cgroup release_agent writes are held (TK-A063 to TK-A066) #731 TK-A063 to TK-A066), and the coding pack's
versionmoves on, as for any pack change; say in the PR which one you used and we'll settle it at merge. docs/policy-v2.md(the TK-A058 and TK-A059 entries in the coding pack's ask row, L711) names the new rule.
Acceptance
- In
tests/test_signer_policy.py, next to the TK-A058/TK-A059 tests (L1002-1078): the three calls above, plus adist-packagespath and a redirect (echo /src > …/site-packages/src.pth), each giveaskwith exactly the expected rule ids, ondev.yamlandserver.yaml(today each of the three gives one rule id, as the table shows). tracekit policy lintis clean on every shipped pack, andmake evalshows no verdict change but these (re-record the eval results the pack's hash moves).
Comment here to claim it. Commits need a DCO sign-off (git commit -s).
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Activity
nx9161 commentedon Nov 12, 2026
I'd like to claim this. Plan: add site-packages/dist-packages .pth rules ahead of TK-A058/TK-A059 in the coding pack, add the acceptance cases in tests/test_signer_policy.py, update docs/policy-v2.md, bump the pack version, and re-record evals. I'll state the new rule ID I used in the PR.
LoopGlitch26 commentedon Nov 12, 2026
It's yours, and the plan matches the issue. Two notes:
dev.yaml,coding.yamlandserver.yaml, as in the issue's table, and keep thecheckpoints/model.pthcase on TK-A059.Commits need a DCO sign-off (
git commit -s).tylrcc commentedon Nov 12, 2026
I'd like to work on this.
LoopGlitch26 commentedon Nov 12, 2026
This one is taken: nx9161 claimed it above.
policy: case-insensitive site-packages match for TK-A067/TK-A068; re-…
policy: a .pth in site-packages is held as a .pth file, not model wei…