Metadata-Version: 2.5
Name: cf-bootstrap-source-pypi
Version: 0.1.22
Summary: Deterministic wheel-only PyPI artifact resolver.
License: GPL-3
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# cf-bootstrap-source-pypi

`cf-bootstrap-source-pypi` is the artifact-source adapter for resolving a pinned Cogniflow distribution from a Python package index. It validates a complete wheel-only dependency closure and publishes a deterministic artifact set for a separate instance provider to install.

The console script communicates over `cf.bootstrap.artifact-resolver.v1` JSON lines. Inputs identify the package, exact version, index URL, and artifact output root. Outputs bind every accepted wheel to its filename, package metadata, size, and SHA-256 digest and record the resolver report.

The package does not plan installations, import resolved packages, create target environments, or perform service handoff. Local Repository Mode uses `cf-bootstrap-source-local` instead.

## Read-only frozen public artifact verification

The existing JSON-lines envelope also accepts method `artifacts/verify`. Its params have exactly these fields:

- `schema`: `cf.bootstrap.public-artifact-verification.request.v1`
- `bootstrap_plan`: a profiled `cf.bootstrap.plan.v2` public Cogniflow plan
- `artifact_set`: the supplied `cf.bootstrap.artifact-set.v3` records

Verification reuses the existing frozen release check and requires the private `CF_FROZEN_AUTHORITY`, `CF_FROZEN_AUTHORITY_DIGEST` and `CF_FROZEN_AUTHORITY_CONTEXT` install handoff. A source catalog alone cannot authorize it. An optional source-catalog handoff must match the frozen input. Supported releases remain 0.1.16–0.1.19; no historical authority is changed.

Success returns `schema: cf.bootstrap.public-artifact-verification.v1`, `scope: frozen-public-artifact-metadata`, the supplied `plan_digest` and `artifact_set_digest`, and `providers` (capability-to-provider names). These bind a successful metadata check to the exact inputs. This is **not** wheel-file integrity validation, installation approval, or proof of installed state. No wheelhouse/output path is accepted, no wheel bytes are read, and verification performs no downloads or writes.

Invalid request/plan shape returns `SCHEMA_INVALID`. Invalid records, substituted artifacts, or absent/mismatched authority return `ARTIFACT_VERIFICATION_FAILED` with a generic message. Envelope/JSON errors retain their existing behavior, as does `artifacts/resolve`. No consumers are migrated in this milestone.

Verification binds the authenticated frozen release version directly to the plan source version and requires canonical native wheel metadata, including its kind, tags and executable. Public plan paths must already use the plan builder's canonical lexical spelling, with the installation root outside Cogniflow home; validation does not inspect or resolve filesystem paths. Plan digests retain the existing profiled producer's ASCII-escaped canonical JSON convention, including for non-ASCII paths. Artifact-set digests retain the wire contract's UTF-8 convention.

The guarded installed-process regression runs with bytecode disabled (`-B`) and installs its effect audit hook **after importing the resolver**. It checks application writes, subprocesses and network attempts under that configuration, not interpreter startup effects. A separate regression installs the non-editable resolver wheel with `--no-compile` into a fresh writable virtual environment and invokes its ordinary console entry point without bytecode suppression. In the same process, it reads a side-effect-free control response, records package bytecode files and contents, then verifies that a successful first verification request creates or changes none. Verification temporarily suppresses bytecode writes for its lazy import and authority checks and restores the previous interpreter setting even on failure. Ordinary interpreter startup may still create caches; startup and `artifacts/resolve` retain their existing cache behavior. The verification no-write boundary includes request-triggered import caches, not interpreter startup.

Validation: `.venv/Scripts/python.exe -m pytest -c pytest.ini -q stonecastle/cf_bootstrap_source_pypi/tests stonecastle/cf_bootstrap_orchestrator/tests` (configured `resolver-protocol` gate, isolated snapshot and fresh installed-product virtual environment): **114 passed**, exit 0. The gate reports existing RDFLib deprecations and the intentional duplicate-ZIP fixture warning.
