headroom-ai-bin
The package installs a prebuilt Python wheel from PyPI and its dependencies into a vendored Python 3.12 environment; while the pip install uses a variable, the source is from a trusted, official repository (pypi.org) and the wheel is integrity-verified via sha256sum, making supply-chain risk low.
Triggered rules
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The package installs a prebuilt Python wheel from PyPI and its dependencies into a vendored Python 3.12 environment; while the pip install uses a variable, the source is from a trusted, official repository (pypi.org) and the wheel is integrity-verified via sha256sum, making supply-chain risk low.
-
PKGBUILD:43
./venv/bin/python -m pip install --no-cache-dir --no-compile "$srcdir/$_wheel[proxy]"
1 higher static finding superseded - not the current verdict (shown for transparency)
pip_install_external
`pip install <package>` fetches an unpinned package from PyPI at build time, outside source=() and makepkg's checksums.
-
PKGBUILD:42
./venv/bin/python -m pip install --quiet --no-cache-dir --upgrade pip
PKGBUILD
2 offending line(s) highlighted# Maintainer: Xavier Francisco <echo moc.liamg@ocsicnarf.n.reivax | rev>
pkgname=headroom-ai-bin
_pyname=headroom_ai
pkgver=0.42.0
pkgrel=1
pkgdesc="Context optimization layer for LLM applications - cut token costs by 50-90% (binary wheel, Python 3.12)"
arch=('x86_64')
url="https://github.com/chopratejas/headroom"
license=('Apache-2.0')
depends=('python312' 'ast-grep')
provides=("headroom-ai=$pkgver")
conflicts=('headroom-ai')
# Prebuilt wheel + vendored .so's: don't strip them or extract a -debug package
# (avoids dangling build-id debug symlinks for the bundled binaries).
options=('!strip' '!debug')
# Upstream switched from pure-Python (hatchling) to Rust+maturin in 0.21.x.
# 0.32.1 ships a stable-ABI cp310-abi3 wheel for x86_64 Linux. We install it into
# a python3.12 venv: abi3 wheels run on any Python >=3.10, and pinning python3.12
# (a fixed-version package) keeps the vendored venv stable across Arch's rolling
# /usr/bin/python bumps.
#
# Arch's python-* ecosystem (tiktoken/pydantic/litellm/...) is built against
# /usr/bin/python (3.14) and is invisible to /usr/bin/python3.12, so we can't
# satisfy headroom's Python deps via regular Arch packages. We vendor them
# into /usr/lib/python3.12/site-packages/ via pip in a transient venv.
#
# The wheel declares fastapi/uvicorn/openai/mcp/onnxruntime/transformers/etc.
# as the `proxy` extra. The bare CLI loads without it, but `headroom proxy`,
# `wrap`, `deploy` and `install` need it, and the venv cannot fall back on
# Arch's python-* packages, so [proxy] is always installed.
_pytag=cp310-abi3-manylinux_2_28_x86_64
_wheel="$_pyname-$pkgver-$_pytag.whl"
source=("$_wheel::https://files.pythonhosted.org/packages/${_pytag%%-*}/${_pyname:0:1}/$_pyname/$_wheel")
noextract=("$_wheel")
sha256sums=('fbb3ceb8f6c3f208edcc3aad43c0e03e0db45636d9d2061525ad0d0a166da146')
build() {
rm -rf venv
/usr/bin/python3.12 -m venv venv
./venv/bin/python -m pip install --quiet --no-cache-dir --upgrade pip
./venv/bin/python -m pip install --no-cache-dir --no-compile "$srcdir/$_wheel[proxy]"
}
package() {
local sitepkg="$pkgdir/usr/lib/python3.12/site-packages"
install -dm755 "$sitepkg"
# Copy the venv's vendored deps, then strip bootstrap + bytecode noise.
cp -a venv/lib/python3.12/site-packages/. "$sitepkg/"
rm -rf \
"$sitepkg"/pip "$sitepkg"/pip-*.dist-info \
"$sitepkg"/setuptools "$sitepkg"/setuptools-*.dist-info \
"$sitepkg"/wheel "$sitepkg"/wheel-*.dist-info \
"$sitepkg"/_distutils_hack "$sitepkg"/pkg_resources \
"$sitepkg"/distutils-precedence.pth
find "$sitepkg" -depth -type d -name __pycache__ -exec rm -rf {} +
install -dm755 "$pkgdir/usr/bin"
cat > "$pkgdir/usr/bin/headroom" <<'EOF'
#!/usr/bin/python3.12
import sys
from headroom.cli import main
if __name__ == '__main__':
sys.exit(main())
EOF
chmod 755 "$pkgdir/usr/bin/headroom"
}
Changes since previous scan
--- PKGBUILD @ 2026-10-28 00:06+++ PKGBUILD @ 2026-11-01 00:21@@ -2,7 +2,7 @@ pkgname=headroom-ai-bin _pyname=headroom_ai-pkgver=0.41.0+pkgver=0.42.0 pkgrel=1 pkgdesc="Context optimization layer for LLM applications - cut token costs by 50-90% (binary wheel, Python 3.12)" arch=('x86_64')@@ -27,13 +27,14 @@ # into /usr/lib/python3.12/site-packages/ via pip in a transient venv. # # The wheel declares fastapi/uvicorn/openai/mcp/onnxruntime/transformers/etc.-# as the `proxy` extra, but headroom.cli imports headroom.proxy unconditionally-# so the [proxy] set is effectively required just for `headroom --help` to load.+# as the `proxy` extra. The bare CLI loads without it, but `headroom proxy`,+# `wrap`, `deploy` and `install` need it, and the venv cannot fall back on+# Arch's python-* packages, so [proxy] is always installed. _pytag=cp310-abi3-manylinux_2_28_x86_64 _wheel="$_pyname-$pkgver-$_pytag.whl" source=("$_wheel::https://files.pythonhosted.org/packages/${_pytag%%-*}/${_pyname:0:1}/$_pyname/$_wheel") noextract=("$_wheel")-sha256sums=('f4db5e5119a73af3ed952b1c10caff2430831d899eb17d995a27574ae6e6b306')+sha256sums=('fbb3ceb8f6c3f208edcc3aad43c0e03e0db45636d9d2061525ad0d0a166da146') build() { rm -rf venvScan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-01 00:21:48 | Low | 2 |
| 2026-10-31 00:07:41 | Low | 2 |
| 2026-10-30 00:29:30 | Low | 2 |
| 2026-10-29 00:13:55 | Low | 2 |
| 2026-10-28 23:51:05 | Medium | 1 |
| 2026-10-28 00:06:54 | Low | 2 |
| 2026-10-27 00:23:28 | Low | 2 |
| 2026-10-26 00:12:40 | Low | 2 |
| 2026-10-25 00:20:48 | Low | 2 |
| 2026-10-24 00:14:55 | Low | 2 |
| 2026-10-23 00:02:19 | Low | 2 |
| 2026-10-22 00:13:10 | Low | 2 |
| 2026-10-21 00:12:50 | Low | 2 |
| 2026-10-20 00:10:31 | Low | 2 |
| 2026-10-19 00:03:55 | Low | 2 |
| 2026-10-18 00:06:55 | Low | 2 |
| 2026-10-17 00:21:55 | Low | 2 |
| 2026-10-16 03:14:05 | Medium | 1 |
| 2026-10-16 00:12:47 | Medium | 2 |
| 2026-10-15 00:28:05 | Medium | 2 |