# Re-review the UTF-8 graph serialization correction Task ID: V-002-R1 Role: astra_reviewer Status: APPROVED ## 1. Context and baseline Repository/cwd /home/faumaray/Projects/VoidBuildSystem, main, unborn HEAD; all additions remain untracked. You completed independent V-002 with one P2 finding: quote() could emit malformed UTF-8 JSON. No other material defects were found in the bootstrap and twenty plans. Root reproduced the defect and made the bounded correction below. This is a follow-up review by the same nonimplementing reviewer, not a new implementation assignment. ## 2. Objective and deliverables Determine whether V-002's encoding defect is resolved without regression and whether the initial bootstrap/documentation milestone can now be accepted. Return READY, CHANGES_REQUIRED or INSUFFICIENT_EVIDENCE with actual source/test evidence. No file edits. ## 3. Scope and non-goals Review changed serializer validation, encoding contract, tests and registration counts, plus their integration with previous CLI/description checks. Do not repeat the entire architectural review or require native engine features. V-002 remains the baseline review of unaffected files. ## 4. Files to inspect src/build.cpp: new require_utf8() called by quote() for every serialized string/key. include/vbs/build.hpp: to_json encoding contract comment. tests/SdkDeclarations.cpp: json_preserves_valid_utf8 and json_rejects_malformed_utf8. tests/RunSdkTests.cmake and tests/SdkRegistration.cmake: count 17 and two named cases. docs/SDK.md: JSON encoding policy and non-UTF-8 path limitation. Read docs/agent-workflow/tasks/T-001.md and V-002.md for original scope; actual pre-correction source was already reviewed by you. Root may update STATE/TASKS/VERIFICATION and persist the review disposition while you review. ## 5. Write ownership and coordination Write scope: none Shared checkout. Source, tests and SDK documentation are frozen during this review. Root owns all integrated files and is updating workflow records only. No stage/commit/push/reset/clean, branches, extra agents, Serena activation or reindex. Any extra repro requiring new files must be returned as text for root. ## 6. Implementation or investigation approach Inspect validator bounds and Unicode scalar rules, preservation of valid bytes, no partial-return behavior and central quote coverage. Confirm rejection of stray/invalid leads, truncated sequences, invalid continuation, overlong forms, surrogates and values above U+10FFFF. Inspect tests as code, including valid boundary sequences, malformed strings in names/source paths/option keys/option values/profile flags and unchanged ASCII/control tests. Verify tests register/execute 17 bodies. Use bounded existing tests if helpful; do not repeat completed broad checks without a new concern. ## 7. Interfaces and data contracts Schema_version remains 1. All serialized strings and keys must be valid UTF-8; Project::to_json() throws std::invalid_argument with "JSON string contains invalid UTF-8" on malformed encoding. Declaration methods may record raw bytes; failure occurs at serialization before returned JSON. Valid Unicode bytes are preserved and ASCII controls still escaped. This is a bug correction to valid JSON output, not a new source-encoding conversion. Non-UTF-8 filesystem paths require future explicit policy. ## 8. Dependencies and integration SDK remains standard-library-only; no new runtime/test dependency was introduced. Existing Void::Json::Strict is used for structural roundtrip tests but is not treated as an independent UTF-8 validator. Root ran Python strict UTF-8/JSON as a one-off independent oracle against a compiled SDK harness in ignored build/bootstrap-pinned; Python is not a bootstrap dependency. Existing pinned/local VoidLibrary source remains unchanged. ## 9. Edge cases security and performance Bounds checks must prevent truncated-input access. Unsigned byte handling must avoid signed-char errors. Reject surrogate/overlong/out-of-range scalars and preserve legitimate U+10FFFF and noncharacters. Empty UTF-8 strings are valid where the field otherwise permits them; declaration name validation remains separate. Validation is linear in string bytes; no normalization, replacement or silent transcoding. Ordinary user C++ remains trusted. ## 10. Acceptance criteria 1. V-002 P2 is demonstrably fixed: raw 0xff no longer crosses the JSON boundary. 2. Valid 1/2/3/4-byte boundary encodings and existing ASCII/control behavior are preserved. 3. Meaningful malformed-input tests and 17-case registration pass. 4. Both dependency modes still pass all four CTest checks; current header/docs match behavior. 5. No new material defects in changed code; findings have severity, trigger, expected/actual behavior and evidence. ## 11. Verification commands and evidence All commands ran in /home/faumaray/Projects/VoidBuildSystem. Before fix, root compiled your exact stdin reproducer against build/bootstrap-pinned/libvbs_sdk.a with dev cpp-gcc -c g++ -std=c++26 -Iinclude; program exit0 and Python strict decode failed as predicted. After fix: dev cpp-gcc -c cmake --build build/bootstrap-pinned --parallel 2 -> exit0 (log build/bootstrap-pinned/review-build.log). dev cpp-gcc -c cmake --build build/worker-bootstrap --parallel 2 -> exit0 (log build/worker-bootstrap/review-build.log). dev cpp-gcc -c ctest --test-dir build/bootstrap-pinned --output-on-failure -> exit0, 4/4. dev cpp-gcc -c ctest --test-dir build/worker-bootstrap --output-on-failure -> exit0, 4/4. Exact ten C++ source/header clang-format --dry-run --Werror command from V-002 -> exit0. Independent harness build/bootstrap-pinned/utf8-oracle accepts newline-delimited hex bytes and emits one JSON line or "! JSON string contains invalid UTF-8". Root tested empty + every one/two-byte string + 14 boundary sequences + 5000 seeded random byte strings + up to 1000 random valid scalars (seed 20261125). 71803 cases agreed with Python strict decoding; 19708 accepted/JSON-roundtripped, 52095 rejected. Not a persisted application test or full Unicode-space proof. Existing bin/vbs_sdk_tests and bin/vbs_describe/CLI paths remain valid in both build dirs. CTest LastTest.log contains actual counts and bodies. ## 12. Constraints and stop conditions Read-only source/documents. No dependency or global installation changes. Correct graph project home-faumaray-Projects-VoidBuildSystem remains stale for new files; check coverage and use direct source for missed lines, without reindexing. Shared Serena project stays VoidBuildSystem. Report any verification needing extra authority; do not silently change models or claim runtime identity. Stop if a meaningful issue requires source changes; root owns correction. ## 13. Authorization and decisions User's "Implement the plan" authorizes this local correction and review within the initial milestone. Root handled the small integration fix under workflow policy. You remain the independent configured astra_reviewer at XHigh and did not implement the correction. No external action, release or deployment is authorized. ## 14. Return format Return V-002-R1 verdict; resolution of original P2; new findings if any; exact commands/results; evidence limitations and residual risks. State no files changed. Do not spawn children.