oliver-zehentleitner / maity
clean-up: Deploy and supply chain: shared lock-check script, one origin parser for tools/, exact hatchling pin
tsk-kgkh3gz3mkfz Open
From the clean-up audit, area 15 (Deploy and supply chain), tsk-hgnbapyw7hnh. Read at main 80647565; all lines refer to that SHA, so check each one against current main before changing it. Sent to the lead as seq 125414 (items 1 and 2) and seq 125443 (item 3).
Shared tooling: the lock checks in four Makefiles, the origin parser in three tools/ scripts, and the hub's build backend pin. These changes are behavioural, with medium risk, so they are kept apart from the workflow-only card.
Order: item 1 before item 3, so the hub's backend pin check can reuse the shared lock-check script.
Related, not duplicates: these open P3 notes touch the same parser lines as item 2. Take them along when it is built:
- tsk-dest4a10zfw9, note nte-8zy0qmaefvhr:
FILE://casing - tsk-dest4a10zfw9, note nte-ybf994g41qe0: 127.x octets
- tsk-wtypyywf2vv1, note nte-3xrqmet1krxe, item 2: a credential in origin's URL
1. The same lock-check recipe exists four times (A15-6)
- Kind: duplication
- Files: hub/Makefile:66-74, cli/Makefile:44-60, web/Makefile:72-80, tools/Makefile:14-20. All four copy their inputs to a temp dir, strip hashes with the same sed (
-e '/^ *--hash=/d' -e 's/ \\$$//'), recompile withuv pip compile --generate-hashes --universal, then run diff -u. - What is wrong: a fix to the stripping or the compile flags has to be made four times.
--python-versionalso differs (3.12 for hub and web, 3.11 for cli and tools). That is intended, but only each file says so. - Proposal: one tools/lock_check.sh (or .py) that takes
<lock.txt> -- <uv compile args>and does copy, strip, compile and diff. Each Makefile's lock-check becomes one or two calls to it. cli keeps its setuptools pin check next to it. - Effort: M. Risk: low. The output is a diff, and CI's hub-lock, cli, changelog and web-e2e jobs exercise all four.
2. Origin URL parsing copied in three shell tools, one of them different (A15-7)
- Kind: duplication / design
- Files: tools/overlap.sh:130-164 and tools/coverage.sh:63-93 use the same parser, copied (coverage.sh:61 says "read as tools/overlap.sh reads them"). tools/pr.sh:124-160 has a different, stricter parser: it refuses a query, a fragment and extra path segments, and strips
git/for the loopback proxy. - What is wrong: three tools that should agree on which repository origin is use two grammars. For an origin with more path segments (e.g.
https://host/a/b/c), overlap.sh and coverage.sh take the last two (b/c) and go on, while pr.sh refuses it. They also handle a query and a fragment differently. A fix to one parser will miss the others. - Proposal: one sourced tools/lib/origin.sh that sets repo_owner, repo_name and repo_host, using pr.sh's stricter grammar (the one CONTRIBUTING.md documents). test_overlap.py, test_coverage.py and test_pr.py then hold all three to it.
- Effort: M. Risk: medium. overlap.sh and coverage.sh would start refusing origin URLs they accept today (more than owner/repo after the host), so their tests need cases for that.
3. The hub's [build-system] has only a lower bound; the CLI pins its backend exactly (A15-9)
- Kind: design (one rule implemented two ways)
- Files: hub/pyproject.toml:2 (
requires = ["hatchling>=1.25"]), hub/requirements/build.in:2 (hatchling>=1.25); the lock has hatchling 1.32.4 (hub/requirements/build.txt:7). The CLI pins[build-system]to the lock's exact setuptools and checks it in cli/Makefile:54-59, per context/process.md:385-387 (a8dd1473): "so a build from the sdist uses the backend the release was made with". - What is wrong: anyone who builds the hub's sdist from PyPI with build isolation gets the newest hatchling, not 1.32.4. process.md:1985-1986 (9a0ed6f7) names this ("hatchling with only a lower bound") as the reason CI avoids isolated builds, but sdist users are not covered. hub/README.md:451 calls the floor intended, and no context entry says why the hub differs from the CLI.
- Proposal: pin
hatchling==1.32.4in hub/pyproject.toml [build-system] and build.in, and extend the hub's lock-check with the CLI's three-way equality check (or the shared script from item 1). - Open question: is the floor on purpose? If so, record why in hub/context/packaging.md instead.
- Effort: S. Risk: low. A hatchling bump then means moving the pin in two files, which the check enforces.
Effort sum: M+M+S = 7 points.
Notes
Lotse · Nov 18, 2026, 20:06 UTC
This card now owns the tools/ origin parser (from tsk-hq56zjtmx55j item 1) and the shared lock-check (from tsk-tvk5atq3306p item 1). Both cards were told to leave those items out (req-gqt5b2812nej).