12 KiB
Implement the compiling bootstrap and declaration SDK
Task ID: T-001 Role: sol_implementer Status: APPROVED
1. Context and baseline
Root/cwd /home/faumaray/Projects/VoidBuildSystem, main, unborn HEAD. Root just initialized Git. Preexisting .serena metadata is preserved and ignored; no application files existed. Root created AGENTS.md, LICENSE, .gitignore and docs/agent-workflow records. Read those applicable instructions. User approved "Implement the plan": initial delivery is detailed plans plus a compiling bootstrap skeleton, NOT the entire future build engine. P-001/P-002 planning and V-001-R1 fresh preflight READY completed; records persisted. Requirements: R-001 C++/VoidLibrary, R-002 cpp/hpp descriptions, R-003 profiles/host-target split, R-004 honest bootstrap, R-005 tests, R-006 pinned source. All interfaces below are NEW.
2. Objective and deliverables
Create a real CMake-built vbs CLI, minimal declaration SDK, compile-tested root build.cpp/build.profiles.cpp with reusable helper cpp/hpp, a description harness emitting versioned JSON, and meaningful Void::Testing/CTest tests. Complete local-source bootstrap verification. Root separately writes all documentation and runs pinned-source integration.
3. Scope and non-goals
Implement only declaration/data recording and bootstrap infrastructure. Do not implement native compilation, snapshots, source glob expansion, automatic config compilation, solver, TOML loading, watchers, native compdb selection or registry. Do not fake those features. CLI native build/test/compdb/deps/watch requests must fail clearly with nonzero status. Do not modify VoidLibrary or global installation.
4. Files to inspect
AGENTS.md and docs/agent-workflow/APPROVED_PLAN.md/PREFLIGHT.md in new repo. Dependency /home/faumaray/Projects/VoidLibrary main HEAD 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5, tracked clean, matches remote. Relevant verified paths: CMakeLists.txt (CMake>=4, C++26, selectable VOID_ENABLED_MODULES), cmake/Module.cmake, cmake/VoidTesting.cmake and VoidTestScanner.cmake, include/Void/Configuration/Argparse.hpp and src/Configuration/Argparse.cpp, src/Configuration/module.cmake, src/Testing/module.cmake, include/Void/Testing/Test.hpp and Assert.hpp, tests/standalone/Configuration/Argparse.cpp. Optional JSON test validator include/Void/Data/StrictJson.hpp already exists. Never inspect dependency .env/WG.conf/keys/.serena or other untracked data.
5. Write ownership and coordination
Write scope: CMakeLists.txt; cmake; include; src; tests; build.cpp; build.profiles.cpp; build-support; .clang-format You share this checkout; root is writing README/AGENTS/LICENSE/ignores and all docs concurrently. Do not edit those or revert anyone's work. No commit/stage/push, branch switches, worktrees, activation/index changes or children. Your build artifacts belong only under build/worker-bootstrap; root uses separate build directories. Root owns shared files/pins after handoff.
6. Implementation or investigation approach
- Inspect existing dependency APIs before coding. Use CMake>=4.0, project version 0.1.0, C++26, no extensions, GCC16+ host as supported bootstrap. Propagate required -freflection to own targets when using GNU>=16; useful early compiler diagnostics.
- FetchContent default public HTTPS Git https://git.faumaray.com/Void/VoidLibrary.git at exact SHA 9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 (not floating/shallow incompatible pin). VBS_VOID_SOURCE_DIR optional local source override, validate directory/CMakeLists and document bypass in diagnostic. Use explicit local MODULE selection Configuration;Testing (Testing only when VBS_BUILD_TESTS ON is reasonable), VOID_ENABLE_TESTING OFF, VOID_ENABLE_BENCHMARKS OFF, BUILD_SHARED_LIBS OFF for dependency without changing unrelated parent state. No root-wide dependency download/install outside build artifacts.
- CLI uses actual Void::Argparse::Parser, help/version exit0, no args help0, invalid/unsupported requests exit2 and useful message. Parser returns help text as unexpected; treat standalone -h/--help as success deliberately. Avoid claiming help-listed roadmap commands are implemented.
- Add a lightweight ordinary C++ SDK per interfaces below. Handles must survive vector growth, cannot accidentally refer to another Project, and cannot outlive or be silently rebound to moved owner storage. Prefer index+owner handles with owner nonmovable if simplest. No deferred graph callbacks crossing the process boundary.
- Root build.cpp describes at least vbs_sdk static library and vbs executable, selected VoidLibrary dependency, source sets/public include dirs and link relationships. build.profiles.cpp defines debug/release defaults; build-support cpp/hpp supplies reusable helper. Context-dependent flag difference must be driven by runtime context.compiler, never host preprocessor.
- Add vbs_describe example executable built by CMake from root descriptor, profiles and helpers. It accepts --profile debug|release and --compiler gcc|clang, constructs runtime context and emits graph JSON; it DOES NOT invoke those target compilers. Unknown profile/compiler exit2. It proves SDK/example boundary, not a general native configure command.
- Use Void::Testing for SDK tests, explicit void_add_tests(target) loaded from dependency script when needed, with unique source stems. Add CTest CLI process contract checks checking exact exit/output, not WILL_FAIL alone. Inspect real runner options before testing registration count; assert at least the expected named cases execute.
- Format exact owned C++ files with dev cpp-gcc -c clang-format -i , run local-source configure/build/ctest in assigned directory, fix issues within scope. No additional libraries needed for this skeleton.
7. Interfaces and data contracts
Public umbrella include/vbs/build.hpp, namespace vbs; free entry void build(vbs::Project&) and void profiles(vbs::Profiles&) for optional profile source; SDK supplies debug/release defaults when custom profiles absent in later native frontend. Define explicit ProfileContext with name, compiler family (gcc/clang), target OS and architecture, effective compile options. Project::context() returns runtime facts. Profiles records distinct named profile descriptions. A helper resolves name + compiler override to an effective context, rejecting unknown names. Project::executable(name), static_library(name), dependency(name), glob(pattern) are declaration operations. Target handles support sources(source set), include_directory(path, visibility), compile_option(string), link(local target or imported target, visibility). Default private linkage; visibility enum. Dependency handles support git(url, Commit{sha}), cmake(option map), package(id, range), target(exported_name). A SourceSet distinguishes explicit file and glob, retaining spelling without filesystem reads. Typed option values support string, bool and integer. Use concrete records inspectable by tests. Reject duplicate/empty identifiers, invalid cross-project links and contradictory source-provider declarations. Full graph cycle/usage propagation belongs to later plan. Graph serialization schema version 1: top-level schema_version, profile, targets, dependencies. Profile includes name/compiler/os/architecture and effective options. Targets include name/kind/source records/include directories/options/link records with visibility. Dependencies include name/source kind+location+revision OR package+version; builder and typed options. Escape JSON correctly; deterministic declaration order; integer schema_version (not string). Implement to_json(Project) or Project::to_json consistently and expose schema_version constant. Roundtrip tests with StrictJson can validate structure. No TOML parser now: documentation will label project.dependencies("vbs.deps.toml") as planned. No filesystem enumeration or dependency download while constructing descriptors.
8. Dependencies and integration
Configuration closure observed: Core, Functional, System, Data, Time, LogState; Data also pulls Math; external Threads only. Testing optionally sees selected Configuration but no intentional Boost dependency. Verify actual CMake configuration. Root integrates final files and creates docs using your actual public names; return exact APIs/commands. root preflight has approved these bootstrap boundaries.
9. Edge cases security and performance
No shell command interpolation from user values. Avoid source-root writes for generated registrations, version information or compile_commands. Never hardcode /home/faumaray paths in defaults. Local override does not alter source dependency. File/test names must avoid scanner stem collisions. Reject malformed CLI input and cross-owner handles. Correctly escape quotes, backslashes, newline/control characters in JSON. Keep handles valid after additions. Installed/public configuration context is separate from target facts. Don't add silent fallbacks to downloaded/compiler versions.
10. Acceptance criteria
- CLI builds/links with actual pinned/local VoidLibrary and implements help/version/error contracts.
- Root example/helper/profile sources compile through CMake.
- Same host-built descriptor emits different correct GCC/Clang and debug/release graph contents.
- Serialization parses as schema v1, preserves typed option values and escaped strings; handles remain correct after container growth.
- Real SDK tests register and execute nonzero cases; CLI process checks catch wrong exit status.
- Unsupported native build/compdb/dependency/watch commands fail honestly.
- No unowned files or external repository changes.
11. Verification commands and evidence
cwd /home/faumaray/Projects/VoidBuildSystem. Existing dev commands verified: dev cpp-gcc supplies GCC16.2/CMake4.4.4/Ninja1.13.2 and clang-format; dev cpp supplies Clang23.1.3. No old project runner existed. NEW commands once your scaffold creates targets: dev cpp-gcc -c cmake -S . -B build/worker-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/worker-bootstrap --parallel 2 dev cpp-gcc -c ctest --test-dir build/worker-bootstrap --output-on-failure Run actual executable paths discovered from generated targets (prefer build/worker-bootstrap/bin/vbs, vbs_describe, vbs_sdk_tests as runtime output locations). Record outputs and test count. These write only build artifacts plus your owned files. Root will independently verify pinned upstream mode. No Nix flake evaluation beyond user-authorized dev wrapper.
12. Constraints and stop conditions
Stop and report unexpected source mutation, scope conflicts, missing dependency APIs or unsupported compiler prerequisites. Do not weaken tests or fix VoidLibrary. After two failed repair cycles on the same issue, stop that approach and return errors/current owned diff so root can assign Astra re-diagnosis. No models/roles substitutions, no extra agents. Graph source discovery for dependency: exact-file search only; index home-faumaray-Projects-VoidLibrary is stale/partial, use check_index_coverage for each relied source, verify reported missed lines directly and do not reindex. Keep active Serena project VoidBuildSystem.
13. Authorization and decisions
User approved full proposal with "Implement the plan"; current deliverable is docs + bootstrap. MIT confirmed. Root owns docs and integration. Jev sol_implementer candidate is compatible; role configured XHigh, runtime identity not independently verified. No deployment/stage/commit authorization.
14. Return format
Return T-001 DONE/BLOCKED/PARTIAL, files changed, public APIs and executable paths, actual commands/cwd/exit and test counts, deviations, unrun checks, residual risks, integration notes. Do not spawn children.