4.9 KiB
16 — Hosted package registry service
Implementation status: IMPLEMENTED & VERIFIED (2026-11-26). See STATE and VERIFICATION for implemented files and observed checks.
Requirements and ownership
- Requirements: R-009, R-012, R-014.
- Delivery phase: Full v1 registry.
- Intended configured role: astra_implementer at XHigh; fresh astra_reviewer acceptance.
- Dependencies: 11 package identity/solver metadata; 12 source/binary formats; 15 exports; API frozen before 17 UI.
- Proposed exclusive implementation scope: registry/service/, registry/include/, tests/registry-service/; root owns API/schema versions and migrations.
Before dispatch, reconcile these paths with the real HEAD, write a full task spec, lint it, and transfer shared-file ownership explicitly. Paths that do not yet exist are NEW. Source-disjoint work still coordinates shared state, ports and build directories.
Design and interfaces
- Implement a separate C++ service, initially one node with filesystem content-addressed artifacts and SQLite metadata. Use Void facilities where verified; no compulsory third-party hosted service.
- Version the API around package search, release metadata, source/binary download, publish, yank, users, roles, tokens and audit records. UI and CLI use this same API.
- Published release bytes are immutable. Repeating identical publication can be idempotent; different bytes for an existing identity conflict. Yanking changes availability policy without rewriting locked history.
- Publishing requires authenticated scoped authority and package ownership. Provide reader/publisher/admin roles, private/public visibility policy, bounded tokens and revocation. Store token hashes, not bearer secrets; use established password/session primitives where accounts require them.
- Stream uploads to private staging, enforce configurable size/entry/quota limits, validate hashes and archive/manifest paths, then publish blobs before transactionally recording references. The server never executes uploaded build recipes.
- Development binds to loopback; eventual deployment uses an explicitly configured reverse-proxy TLS/public origin and trusted proxy policy. HTTPS + configured registry authority + authenticated publication and hashes define initial trust; standalone publisher signing is not silently promised.
- Implement audit records with secret redaction, integrity checks, orphan collection and consistent metadata/blob backup/restore. Runtime credentials stay outside committed and Nix-store payloads.
Implementation sequence
- Verify required HTTP/storage/security Void APIs and freeze API/errors/authentication schemas.
- Implement read/index/download operations and native client interoperability against local fixtures.
- Implement authenticated publication/yank, transactional blobs, ownership/roles/tokens and audits.
- Add quotas/recovery/backup, harden request parsing and run independent security-oriented review before any exposure.
Failure behavior and boundaries
- Never trust a supplied filename, archive path, digest, role or forwarded header without validation.
- Failed/revoked authorization cannot expose private metadata or content; publish cannot overwrite release bytes.
- No cache/registry credential in locks, diagnostics, browser URLs or audit payloads.
- No actual server deployment or public exposure follows merely from code/review completion.
Acceptance scenarios
- Role/package authorization matrix, private read isolation, token expiry/revocation and privilege escalation attempts.
- Immutable/idempotent/conflicting publication, invalid digest, interrupted upload and concurrent same-version publish.
- Oversized/malformed archives, traversal/symlink cases and quotas.
- Crash between blob publication/metadata commit; backup/restore preserves releases and ownership.
- Malicious recipe upload never executes server-side; logs/audits contain no secrets.
Verification and integration gate
NEW local HTTP service fixtures with ephemeral ports, private test credentials and isolated storage. Run migration/restore and concurrent-client tests. Deployment needs a separate environment/authorization record.
Acceptance requires observed results for these scenarios, the affected regression suite, reviewed cross-component contracts, and a fresh independent review. Record unrun checks and environment limitations; tests passing alone do not waive an invariant. No merge, push or deployment is authorized by a review verdict.
VoidLibrary reuse and upstream candidates
Void Net/Sqlite/Crypto/Security/Log where contracts suffice; established focused libraries are allowed for gaps. Authentication and robust HTTP/streaming primitives are candidates for upstream reuse.
Shared invariants and input/publication policies are defined in ARCHITECTURE; requirement authority is REQUIREMENTS. Return implementation evidence to VERIFICATION.