Skip to content

Loop 8: PyPI production depth — inventory, artifact inspection, build-backend risk - #32

Merged
sairintechnologycom merged 2 commits into
mainfrom
loop-08-pypi-production-depth
Jul 2, 2026
Merged

Loop 8: PyPI production depth — inventory, artifact inspection, build-backend risk#32
sairintechnologycom merged 2 commits into
mainfrom
loop-08-pypi-production-depth

Conversation

@sairintechnologycom

Copy link
Copy Markdown
Owner

Summary

Loop 8 of the loop-engineering roadmap: PyPI Production Depth. Deepens Python dependency inventory and artifact analysis while keeping PyPI preview (now documented as GA-candidate) until the named readiness gates pass.

Dependency inventory (internal/deps/python)

  • Table-aware poetry.lock/uv.lock parsing (sub-tables can no longer clobber entries); records lockfile hashes, explicit registries, git/url sources
  • uv.lock virtual/editable/path entries (the project itself) are marked local and never scanned against PyPI
  • requirements.txt: backslash continuations + --hash capture (pip-compile --generate-hashes), PEP 508 name @ url direct references, URL/path lines can't become bogus scan targets
  • Pipfile.lock hashes + index-name→URL resolution; PEP 503 name canonicalization + validation
  • Dedupe(): one scan target per name@version across manifests+lockfiles; unpinned manifest entries collapse into their lockfile pin and keep direct provenance

Artifact inspection (internal/analyzer/pypi)

  • Orphaned compiled bytecode (.pyc without source), wheel RECORD missing/unlisted-files checks, wheel *.data/scripts/ analyzed as install surface
  • Section-aware [build-system] parsing; new findings for in-tree backend-path backends and direct-URL build requires
  • 5 new rules wired into policy.Default() + default-policy.yaml

CI scan

  • Discovers Pipfile/Pipfile.lock; dedups inventory; direct URL/VCS deps surface as UNKNOWN (fail closed); direct flag now reflects manifest provenance

Calibration fix

Nested example/test setup.py/pyproject.toml no longer score as install surfaces — click==8.1.7 false-blocked at 100 (11 inert example setup.py files × 15), now ALLOW at 20. Verified live against real PyPI.

Evidence

evidence/pypi/pypi-ga-readiness.md — depth matrix, full-suite/race/corpus results, live-scan calibration table, and the three remaining GA gates (pip-parity version resolution, large-artifact caps, real-repo Python benchmark).

Test plan

  • go vet ./..., go test ./... green
  • go test -race on all touched packages
  • Detection corpus: precision 1.0, recall 1.0, false-block 0
  • Live PyPI scans: requests/flask/click/httpx/numpy + uv.lock fixture repo E2E

🤖 Generated with Claude Code

sairintechnologycom and others added 2 commits July 2, 2026 21:30
…d-backend risk

Lockfile parsers:
- Table-aware poetry.lock/uv.lock parsing: sub-tables ([package.dependencies],
  [package.source]) can no longer clobber name/version; records artifact
  hashes (poetry files, uv wheels/sdist), explicit registries, and git/url
  sources; uv.lock virtual/editable/path entries (the project itself) are
  marked local and never scanned against PyPI.
- requirements.txt: backslash continuations and --hash capture
  (pip-compile --generate-hashes layout), PEP 508 'name @ url' direct
  references, URL/path lines no longer produce bogus scan targets.
- Pipfile.lock: hashes, index-name-to-URL resolution, git sources.
- PEP 503 name canonicalization and package-name validation.
- Dedupe(): one scan target per name@version across manifests+lockfiles;
  unpinned manifest entries collapse into their lockfile-resolved pin and
  keep direct-dependency provenance.

Artifact inspection:
- Orphaned compiled bytecode detection (.pyc/.pyo without matching source).
- Wheel RECORD checks: missing RECORD and extracted-but-unlisted files.
- Wheel {name}.data/scripts/ analyzed as an install execution surface.

Build-backend risk:
- Section-aware [build-system] parsing replaces line-based BuildBackend().
- New findings: in-tree backend-path backends and direct URL/VCS build
  requirements. Both wired into policy defaults and default-policy.yaml.

CI scan (pypi):
- Discovers Pipfile/Pipfile.lock; dedups inventory before scanning; direct
  URL/VCS dependencies surface as UNKNOWN (fail closed) instead of scanning
  a same-named index package; Direct flag now reflects manifest provenance.

Calibration fix: only the artifact-root setup.py/pyproject.toml participates
in build/install; nested example/test manifests are inert and no longer
score (click 8.1.7 false-blocked at 100 from 11 example setup.py files;
now ALLOW at 20). Hermetic-test hardening: PyPI CI tests isolate the
home-keyed artifact cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PyPI is promoted in documentation from bare preview to preview
(GA-candidate). evidence/pypi/pypi-ga-readiness.md records the depth
matrix, validation results, live-scan calibration evidence, and the three
named gates that must close before a GA claim (pip-parity version
resolution, large-artifact handling, real-repo Python benchmark).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

PkgSafe Dependency Gate

Decision: ALLOW
Mode: WARN
Fail On: BLOCK
Workflow Result: passes
Ecosystem: npm
Lockfile: testdata/npm/self-scan/package-lock.json
Changed Only: false
Baseline: main
Packages Scanned: 1

Counts

Allow Warn Block Unknown Vulnerabilities
1 0 0 0 0

Warn / Block Findings

No blocked or warning dependencies found.

Recommended Action

All scanned packages are allowed by policy.

Governance Evidence

  • Evidence pack generated: pkgsafe-evidence-pack.zip

@sairintechnologycom
sairintechnologycom merged commit 4b7fde6 into main Jul 2, 2026
4 checks passed
@sairintechnologycom
sairintechnologycom deleted the loop-08-pypi-production-depth branch July 2, 2026 16:04
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