44 lines
16 KiB
Markdown
44 lines
16 KiB
Markdown
# Approved implementation contract
|
|
|
|
Date: 2026-11-25
|
|
Approval: user said "Implement the plan" after the complete proposal.
|
|
Current delivery: repository initialization, detailed plans and compiling
|
|
bootstrap skeleton. The full product is a staged roadmap, not the claimed
|
|
capability of the first skeleton.
|
|
Baseline: empty project directory except .serena metadata; no prior Git HEAD.
|
|
Preflight: V-001-R1 READY after five contract corrections (see PREFLIGHT.md).
|
|
Technical default choices remain subject to evidence during implementation;
|
|
material scope changes require a recorded decision.
|
|
|
|
VoidBuildSystem proposed delivery and contracts (NEW; no files implemented).
|
|
|
|
Current delivery: initialize local Git main/MIT, preserve .serena metadata, add ignore rules; create README and project AGENTS, durable docs/agent-workflow state/decisions/tasks/verification plus docs/roadmap requirements/architecture/index and a detailed plan per subsystem. Add a C++26/GCC16 CMake>=4.0 bootstrap, vbs --help/--version using Void::Argparse::Parser, selected VoidLibrary Configuration+Testing module closure pinned at 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5, static linkage for bootstrap, own-library tests disabled. Allow an explicit local-source override for the inspected checkout without modifying it. Add minimal declaration-only SDK, root build.cpp plus helper compiled by CMake into an example harness; test target/profile/dependency records and graph protocol version. The example includes the optional profile-definition callback and tests separate GCC/Clang evaluation contexts. No application execution, solver, watchers or registry claim in this skeleton; unsupported commands fail. Root CMake file is solely bootstrap, root build.cpp will become native self-build. Conventional and explicit helper membership and all included headers enter the configuration identity and package source manifest, so the same descriptor builds from a Git checkout or exported source archive with no .git. All functionality below gets separate detailed implementation plans, not implemented in current delivery. No remote creation, commit, push or deployment.
|
|
|
|
Confirmed product: native Linux-first executor; host and build description C++26/GCC16, target GCC/Clang separate; no bespoke build language. Out-of-process void build(vbs::Project&) compiled against SDK and local helpers; seed compilation uses filesystem-discovered build-support/**/*.cpp, never Git tracking, plus explicit --build-source inputs; optional build.profiles.cpp defines void profiles(vbs::Profiles&) and otherwise SDK debug/release defaults apply; symbolic dependency handles avoid needing project packages to compile its declarations. The generated SDK driver first supports a profiles-discovery mode invoking the optional profiles callback, or SDK defaults. Root resolves profile inheritance and installed target toolchains/probes, then invokes the same host-compiled description executable once per selected effective ProfileContext. void build(vbs::Project&) observes project.profile()/project.toolchain()/project.target() runtime facts from that context; ordinary C++ preprocessor macros describe the host compiler and are not target selectors. Each evaluation emits its concrete graph, then providers resolve and actions lower for that context. Host-compilation identity and per-profile evaluation identities are separate. The profile callback cannot consume unresolved project packages. Recompile description on its source/header/toolchain changes; reevaluate configuration each graph reconciliation initially. Arbitrary C++ is trusted; no sandbox/complete hidden-I/O guarantee.
|
|
|
|
Explicit target kinds: executable/static/shared/header-only/object libraries/custom actions/tests/install/export. Conventional include and src/source roots with explicit/glob/custom overrides and opt-in module-directory discovery; target kinds are declared, never guessed from a main function. Source membership is input, including additions/deletions/renames. Custom actions declare input/output files, command argv, environment and toolchain. Generated prerequisites must precede consumers, usage requirements distinguish visibility and preserve static private-link requirements/link order. No output collisions or action cycles.
|
|
|
|
Profiles: effective options/toolchain/dependency context identify a profile; debug/release defaults and C++ custom profiles. Several requested targets and profiles build as the selected combination. Mutable products/state/editor generations are isolated below build/profiles/<profile>; immutable CAS may be shared under build/.vbs. Serialize execution per profile initially; allow profiles in parallel, with one overall concurrency budget. Compiler PCH/BMI/object/output directories never overlap.
|
|
|
|
Snapshots: SHA-256 content identities, declared source/include/search roots and namespace membership, relevant symlinks and negative lookups. Compiler-visible deterministic metadata is part of the contract: an explicit reproducibility epoch (default Unix epoch zero) is included in action identity; set SOURCE_DATE_EPOCH, TZ=UTC and LC_ALL=C, canonicalize snapshot file timestamps to that epoch, and use capability-tested structured path-prefix maps for __FILE__/__BASE_FILE__/source_location/debug paths. Generated inputs get the same deterministic metadata policy. Time/path macro fixtures must show cached/uncached equivalence. Unsupported deterministic drivers fail the requested capability rather than silently weakening it. An explicit wall-clock/custom nondeterministic action mode disables both cached and incremental result reuse for affected actions. Private copies/reflinks, no hardlinks to editable sources; capture plus full revalidation with bounded retries before sealing immutable manifest. It freezes captured bytes, not a promise of atomic cross-file filesystem time. No implicit secret, repository metadata or build-output capture; external symlinks require declared roots. Generated outputs become immutable inputs after successful producer validation. Compiler/helper/sysroot environment identity must be covered; opaque non-declared actions are noncacheable and outside closed-input guarantee. Opaque paths cannot silently escape snapshot mapping.
|
|
|
|
State/execution: transactional state via Void::Sqlite after its adapter is validated; content-addressed local cache, verified outputs, generation-based publication and crash recovery. SHA-256 via focused crypto adapter, candidate future VoidLibrary reuse. Direct argv process APIs, stdout/stderr drains and bounded logs, cancellation must kill ordinary descendants even if leader exits early. Known VoidLibrary cleanup gap handled by local Linux lifecycle wrapper and upstream-candidate record; no incidental upstream edit. Never mark partial/failed/cancelled outputs successful. Opaque binaries such as BMI/PCH include physical path/toolchain identity unless proven relocatable.
|
|
|
|
Compdb: standard per-profile JSON with arguments/file/directory/output for all configured enabled targets even when only subset builds. Physical snapshot executions stay in exact execution records; editor projection maps structured path operands to editable sources and graph-compatible generated views, never string-replaces arbitrary flags. Root build/compile_commands.json and a managed project-root alias select a complete immutable generation. Preserve any unrelated existing user-owned file. Publish atomically with request tickets/revision checks and a project-level selector lock so stale operations cannot overwrite newer selections. Single-profile build reserves selection on acceptance and publishes after valid configuration; compile failure does not undo it. Multiple profiles require --editor-profile (one of selected profiles) before work. Explicit compdb use is a newer selection request. Watchers refresh their profile but do not steal selection.
|
|
|
|
Automatic refresh: vbs build reconfigures/refreshes as necessary; vbs watch rebuilds; vbs compdb watch refreshes without engine-scheduled project-target/package builds, network fetches, lockfile writes or foreign configuration. It may compile/evaluate the trusted local build description and run known native compiler scanners/probes. It only reads validated cached provider exports/introspection and lock/package metadata; it never invokes CMake configure, Meson setup, Conan install, arbitrary generators or package builds. Changed provider inputs requiring such work yield an explicit needs-build/stale diagnostic. Arbitrary user C++ in the local description is trusted and may have its own side effects; no sandbox promise is made. File events are hints with periodic content/namespace reconciliation and overflow recovery. Deletion/addition/rename/profile/flag/manifest changes refresh metadata before target compilation. Missing generated artifacts get readiness diagnostics. Invalid config or unavailable/unresolved deps retain last valid DB with explicit stale/error status; never fabricate current commands or silently use incompatible generated outputs.
|
|
|
|
Modern C++ v1: named-module P1689 scanning/dynamic ordering, partitions/cycle diagnostics, explicitly declared header units (Clang scanner currently only supports named modules), profile-specific BMI/PCH ownership, PCH/unity/LTO/sanitizers and compiler/stdlib capability probes. Module TUs excluded from unity; unsupported combinations fail explicitly. Test GCC16.2 and Clang23.1.3 target drivers using actual commands, and supported lower compiler baselines can be broadened later. Target language standard is independent of host.
|
|
|
|
Dependencies: C++ inline declarations and vbs.deps.toml (TOML1.0 via toml++ initially) share source/provider/package/option records. Fields examples already shown to user: git/rev/builder/options or package/version; local path/archive checksummed sources and Conan provider also supported. Explicit load calls permit custom manifest filenames. Reject conflicting duplicate identities/values with origin diagnostics; compatible transitive version constraints solve jointly. Native deterministic PubGrub-style SemVer solver, one version per identity per profile and build/target context; configured registry authority is part of identity. vbs.lock stores exact sources, hashes, features/options/contexts, no credentials. A normal first build may create an absent lock; --locked disallows that. Existing incompatible declarations/options/contexts fail before actions and require explicit deps resolve/update; compatible pinned dependencies never silently upgrade. Project-wide lockfile publication uses a short project mutex plus compare-and-swap of the source lock revision, atomic replacement and revalidation of declaration/context fingerprints. Solving may happen outside the lock, but a changed revision triggers re-resolution/revalidation rather than overwriting another profile update. Each build pins one immutable lock payload/hash with its captured inputs; running builds never mix revisions. Offline mode reuses only verified data. Fetch transport/auth uses existing supported mechanisms; archive extraction and symlink/path traversal guarded. Native binaries keyed by toolchain/target/stdlib/ABI/options/linkage/CPU/sanitizers/LTO/dependency closure; incompatible binary uses source build or clear failure. Binary distribution is not remote build-cache scope.
|
|
|
|
Foreign providers: initially invoke CMake/Meson/Conan2 in isolated per-source/profile/build directories and import typed usage/artifact/prerequisite metadata. Use CMake>=4.2 File API plus evaluated consumer-interface probes/exports, Meson configured introspection plus exported pkg-config/interface data, Conan2 component-aware generator with distinct build/host contexts. Require explicit interface description for gaps, never guess from a library filename or assume introspection is universally lossless. During full build operations their mutable source inputs/build definitions trigger reconfigure/rebuild as needed; metadata-only operations use the restricted read-only provider mode above. No direct re-execution of their source code in native engine yet. Provide new VbsDeps.cmake helper for FetchContent/CPM-style dependency declarations; resolve with native package manager, generate imported targets/package configs. No exact drop-in compatibility claim. Dependency CMake/TOML/Python adapters do not become native build languages.
|
|
|
|
Registry v1 included: separate C++ HTTP service with immutable releases/source+binary blobs, filesystem CAS, SQLite metadata, versioned API, scoped publishing tokens, package ownership and reader/publisher/admin roles. Existing configured registry HTTPS+authenticated publication+content digests are v1 trust boundary; standalone publisher signing is future, not silently promised. Loopback development binding, reverse-proxy TLS deployment model; no actual exposure/deployment in current task. Web admin required: package/version search/detail, publish/yank operations, users/roles/tokens/audit/storage administration. Plain web assets served by C++ service use same auth API; HttpOnly session handling/CSRF/escaping and upload validation/quotas covered. Do not introduce a required third-party hosted service. Plan backup/restore and atomic blob/metadata publication.
|
|
|
|
Detailed roadmap documents: Bootstrap and SDK; configuration frontend; target/usage graph; profiles/toolchains; snapshots/invalidation; execution/scheduling; state/local cache; modules and compiler features; compilation database/editor selection; build+metadata watchers/CLI; TOML/model/solver/lock; fetching and binary packages; install/export; CMake/Meson/Conan providers; CMake-facing bridge; registry server; registry web UI; testing/benchmarks/CI; self-hosting and VoidLibrary migration; later native foreign graph translation/platform ports. Each gets goals/non-goals, architecture/interfaces, dataflow/invariants/failures, Void reuse/upstream candidates, dependency DAG, exclusive write ownership/configured role, implementation sequence and testable acceptance/commands with truthful status.
|
|
|
|
Phases: initial docs+bootstrap; core native/snapshots/profiles/compdb; native self-host through stage0->stage1->stage2 and VoidLibrary native migration; full modern C++ and package/adapters/bridge; registry API/UI and full-v1 hardening. Some are parallel after frozen contracts. All selected v1 features remain release gates; later native graph translation, Windows/macOS and remote caching/distributed execution are separately planned future work. Translator must prove complete graph support for a documented subset or explicitly use foreign fallback; compile_commands is not a build graph.
|
|
|
|
Initial checks (NEW planned after files exist): dev cpp-gcc -c cmake -S . -B build/bootstrap -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DVBS_VOID_SOURCE_DIR=/home/faumaray/Projects/VoidLibrary ; dev cpp-gcc -c cmake --build build/bootstrap ; dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure ; CLI help/version/error and SDK example tests. Local override/path is test convenience, committed defaults pin upstream. Validate both default pinned upstream fetching in a separate clean bootstrap directory and the local override, without widening permissions on a fetch failure. Review actual nonzero generated test registration and count because Void tests use CMake scanner; unique test stems avoid known collision. A future native C++ registration generator replaces CMake during strict self-host testing. No full project build/test yet; root observed syntax-only GCC check success for Void Argparse/Testing headers + reflection, and tool versions. Strict native self-host stages rebuild VBS plus its required VoidLibrary closure in clean stage directories, run tests, and demonstrate no CMake use or reuse of bootstrap-produced project artifacts after the shim stage. No bit-identical binary claim is required. Future adversarial tests include time/path macro equivalence, concurrent lock updates and changed declarations, no-Git helper discovery, forbidden foreign configure during metadata watch, per-profile target facts, snapshot mutation/symlink/header shadowing, removed archive members, modules, selector races/crash recovery, TOML conflicts/solver oracle/lock/offline/ABI, foreign public/private linkage, registry auth/uploads/XSS/CSRF, stage self-hosting.
|