feat(cf11): pin official registry origin for diagnostic reproducibility
Summary
Add a strictly allowlisted, opt-in registry-origin selector to the existing CF11 package resolver. The default --registry-origin automatic retains the exact existing primary-then-secondary fallback behavior. An explicit --registry-origin primary or secondary restricts both metadata and package downloads to the specified existing official endpoint and forbids cross-origin fallback. Neither an arbitrary URL nor simultaneous use with --source-dir is accepted. No changes to the actual archive digest, lockfile, dependency semantics, verification, or protected AF-02/CI paths.
Actually executed on authorized Mac (Darwin arm64, Rust 1.97.1)
- cargo test --locked -p commandf-pkg --lib registry::tests: 16 PASSED, 2 intentionally ignored network tests.
- cargo test --locked -p commandf --test registry_origin_behavior: 4/4 PASSED (including offline mirror positive, explicit-source conflicts, arbitrary origin rejection).
- cargo test --locked -p commandf-pkg --test resolution: 9/9 PASSED.
- cargo check --locked -p commandf; cargo clippy --locked -p commandf-pkg --lib -- -D warnings; cargo clippy --locked -p commandf --all-targets -- -D warnings; cargo fmt --all -- --check; git diff --check: all PASS.
- Two genuinely independent live resolutions of hl7.fhir.uv.ips@2.0.1 using separate caches, one --registry-origin primary and one --registry-origin secondary, each resolved 9 packages and independently verified 9/9. All 9 primary locked archive URLs used packages.fhir.org; all 9 secondary ones used packages2.fhir.org. The existing merged offline compare-locks reported 2 exact-package raw digest mismatches (hl7.fhir.uv.ips@2.0.1 and hl7.fhir.r4.core@4.0.1), identical dependency edges and roots, exit code 2. Evidence is recorded on issue #214.
- Commit signed with registered SSH key and DCO, no force-push.
Boundaries
This is diagnostic tooling; issue #214 remains OPEN because historical failed runner lockfiles were not retained. Never weaken or skip protected CF11 equality tests. All required exact-head CI checks, ordinary expected-head merge, and post-merge assurance remain mandatory. Jev and Alibaba OCR model review are NOT_RUN unless independently executed. No paid services or donor code adopted.
Summary by cubic
Adds an opt-in --registry-origin flag to commandf pkg resolve for bounded diagnostic reproducibility. The default automatic retains the existing primary-then-secondary fallback; primary or secondary pins both metadata and package downloads to a single built-in official endpoint and forbids cross-origin fallback. Arbitrary URL values are rejected, and explicit origin selection cannot be combined with --source-dir.
- Archive digests, lockfile format, dependency resolution, verification, and protected CI equality paths are unchanged.
- Adds 4 integration tests covering mirror compatibility, origin/mirror conflict handling, invalid URL rejection, and help output.
- Does not close
#214; historical failed-runner lockfiles were not retained, and this remains diagnostic tooling only.