Files
Build-System/docs/roadmap/11-dependencies-solver-lock.md
faumaray ab64147f9d
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s
Implement VoidBuildSystem v1 (Plans 01-19) with VoidLibrary integration
2026-11-26 20:45:54 +03:00

5.1 KiB

11 — Dependency declarations, native solver and lockfile

Implementation status: IMPLEMENTED & VERIFIED (2026-11-26). See STATE and VERIFICATION for implemented files and observed checks.

Requirements and ownership

  • Requirements: R-003, R-006, R-009, R-014.
  • Delivery phase: Native package management.
  • Intended configured role: sol_implementer at XHigh; fresh astra_reviewer acceptance.
  • Dependencies: 02 context-specific declarations; 04 host/target contexts; shared package metadata contract with 12/16.
  • Proposed exclusive implementation scope: src/package/model/, src/package/solver/, src/package/lock/, tests/package/; root owns vbs.lock schema and public dependency types.

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

  • Normalize inline C++ and explicitly loaded TOML1.0 files to one model: alias, registry/package or source identity, version constraints, builder, typed options/features and build/target role. Use toml++ behind a loader adapter so future Void TOML support can replace it.
  • Preserve origin file/line or C++ declaration labels for diagnostics. Compatible transitive version requirements combine; duplicate contradictory source identities/options fail instead of silently overriding. Manifest paths and contents are configuration inputs.
  • Implement deterministic PubGrub-style SemVer solving in C++. Keep one version per package identity per resolution context, with build-machine and target-machine graphs distinct. Registry authority belongs to identity; no implicit cross-registry fallback.
  • Choose deterministic version ordering and explain incompatibility causes. Features/options participate in constraints and package identity; do not combine incompatible build choices merely because their version matches.
  • Use a versioned generated lock payload containing exact revisions/releases/content digests, nodes/edges, features/options and context/declaration fingerprints. Never store credentials. Multiple profiles can have separate contexts inside one project lock.
  • A first ordinary build may create an absent lock; --locked prevents modification. Existing incompatible declarations require explicit deps resolve/update. Publish with project-wide coordination, revision comparison, revalidation and atomic replacement. Every build pins one immutable payload.

Implementation sequence

  1. Freeze normalized dependency/context records and loader diagnostics; implement TOML/C++ equivalence fixtures.
  2. Implement SemVer/range semantics and deterministic solver with conflict explanations.
  3. Implement context-aware lock serialization, validation and explicit resolution/update operations.
  4. Add atomic concurrent publication and immutable build lock capture; integrate provider/fetch requests only after solving.

Failure behavior and boundaries

  • Malformed/unknown manifest fields and unsupported combinations fail with locations.
  • Offline mode cannot silently query registries; missing verified data is an actionable prerequisite.
  • Two concurrent profile updates cannot overwrite each other; retry/re-resolve on a revision conflict.
  • Changed declarations/options/platform facts cannot run actions under an incompatible lock.

Acceptance scenarios

  1. Equivalent C++/TOML declarations yield equivalent normalized graphs; boolean/integer/string options remain typed.
  2. Range/prerelease/diamond/conflict cases; compare solver against exhaustive enumeration for small generated graphs.
  3. Multiple profiles and build/target contexts do not leak settings; registry identity prevents substitution.
  4. Concurrent updates preserve contexts or report a conflict; edited manifest invalidates before actions.
  5. A running build uses one lock revision even if another operation updates the project lock.

Verification and integration gate

NEW solver/property tests, lock race subprocess fixtures and offline fake-registry tests. Future CLI commands deps resolve/update and --locked are acceptance interfaces only after implementation. Keep deterministic resolution fixtures independent of live network state.

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 Result/Data/Text primitives where semantics match; toml++ initially. Native SemVer solver and package policy remain VBS-owned. TOML/validated semantic-version utilities are candidates for VoidLibrary.

Shared invariants and input/publication policies are defined in ARCHITECTURE; requirement authority is REQUIREMENTS. Return implementation evidence to VERIFICATION.