glove/fuzz
0xkite c473a0e102
fix(control): bind Pi wallet status content to connected state and harden wallet fuzz clock
GLM complementary review remediation on the wallet stack:
- The Pi status adapter content string now reflects the structured
  connected flag ("Wallet is not connected.") instead of an
  unconditional "Wallet status is available." that contradicted
  connected:false; bound by a new REQUIRE on the disconnected path.
- The wallet_status_json fuzzer clock now advances its monotonic
  component from fuzz input, so fuzzed frames traverse the deeper
  revalidation ladder and deadline paths instead of a single fixed-
  authority success path.
- docs/architecture.md: documented the one-strike authority teardown
  contract (no retry/resync by the bridge) and the ABA generation-
  reuse defense living in authority contracts, gated on adversarial
  authority tests before any live composition.

Validation (umask 0022): dev CTest 79/79, ASan/UBSan 79/79,
TSan 79/79; wallet_status_json fuzzer 10,000 units fuzz_exit=0;
clang-format clean; git diff --check clean.
2026-08-29 10:49:09 -06:00
..
corpus feat(control): add Glove wallet status bridge core 2026-08-29 09:47:49 -06:00
apple_container_stats_fuzzer.cpp Merge current PR #23 head 4097a21 with validated Apple repairs 2026-08-29 09:41:16 -06:00
change_apply_journal_fuzzer.cpp test(fuzz): cover untrusted parser boundaries 2026-07-21 22:23:45 -04:00
change_manifest_fuzzer.cpp test(fuzz): cover untrusted parser boundaries 2026-07-21 22:23:45 -04:00
CMakeLists.txt feat(control): add Glove wallet status bridge core 2026-08-29 09:47:49 -06:00
library_bundle_fuzzer.cpp test(fuzz): cover untrusted parser boundaries 2026-07-21 22:23:45 -04:00
mcp_codec_fuzzer.cpp test(fuzz): cover untrusted parser boundaries 2026-07-21 22:23:45 -04:00
policy_jsonpath_fuzzer.cpp test(fuzz): cover untrusted parser boundaries 2026-07-21 22:23:45 -04:00
README.md test(fuzz): cover untrusted parser boundaries 2026-07-21 22:23:45 -04:00
session_plan_fuzzer.cpp fix(linux): join bridge before closing 2026-08-15 00:21:07 -06:00
wallet_status_json_fuzzer.cpp fix(control): bind Pi wallet status content to connected state and harden wallet fuzz clock 2026-08-29 10:49:09 -06:00

Fuzzing

Fuzz targets exercise untrusted wire and persistence parsers under libFuzzer, ASan, and UBSan. The current targets cover the MCP/JSON-RPC codec, the argument parser that backs constrained policy decisions, and the retained change-manifest decoder, strict canonical session-plan validation, and change-apply journal recovery parser, and retained library-bundle verifier. Checked corpus files are stable review artifacts; fuzzing must mutate a copy rather than writing generated units into the repository.

Configure and build the targets with a Clang distribution that includes the libFuzzer runtime. Apple Clang installations do not always ship that runtime; Homebrew LLVM is the default used by preflight on macOS.

cmake --preset fuzz -DCMAKE_CXX_COMPILER=/path/to/clang++
cmake --build --preset fuzz

Run the MCP codec target against a disposable corpus copy:

corpus_copy="$(mktemp -d "${TMPDIR:-/tmp}/glove-mcp-corpus.XXXXXX")"
cp -R fuzz/corpus/mcp_codec/. "${corpus_copy}/"
./build/fuzz/fuzz/glove_mcp_codec_fuzzer \
  -runs=10000 -max_len=65536 -timeout=5 -rss_limit_mb=2048 \
  "${corpus_copy}"

Run the policy target the same way, substituting fuzz/corpus/policy_jsonpath and glove_policy_jsonpath_fuzzer.

Run the manifest target the same way, substituting fuzz/corpus/change_manifest and glove_change_manifest_fuzzer.

Run the session-plan target the same way, substituting fuzz/corpus/session_plan and glove_session_plan_fuzzer.

Run the change-apply journal target the same way, substituting fuzz/corpus/change_apply_journal and glove_change_apply_journal_fuzzer.

Run the library-bundle target the same way, substituting fuzz/corpus/library_bundle and glove_library_bundle_fuzzer.

Crashes, sanitizer findings, or timeouts are failures. Minimize a reproducer before adding it to the checked corpus, and give each retained input a descriptive filename tied to the parser invariant it covers.