Skip to content

feat: add C, C++, Rust, Java, and Kotlin probe templates#18

Closed
Toubat wants to merge 6 commits into
mainfrom
feat/systems-language-templates
Closed

feat: add C, C++, Rust, Java, and Kotlin probe templates#18
Toubat wants to merge 6 commits into
mainfrom
feat/systems-language-templates

Conversation

@Toubat

@Toubat Toubat commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Extends the advertised template matrix from nine to fourteen language/ingest pairs: C, C++, Rust, Java, Kotlin (all file ingest).

Design

  • C/C++/Rust: explicit value-builder APIs (tagged union / initializer_list / enum + From impls) with hand-rolled stdlib-only JSON serialization and a hand-ported key-normalization pipeline — differential-fuzzed against the canonical isSensitiveKey over 1,503 edge-case and random keys with zero mismatches.
  • Java/Kotlin: clones of the C# approach — real regex normalization, Map/List/scalar + java.lang.reflect fallback, IdentityHashMap cycle detection, genuine self-reference cycle fixtures, reflection-path value-type coverage.
  • All five: verbatim redaction policy, 65536-byte cap, depth-64, 0600 append, total failure suppression (C verified leak-free under leaks --atExit; ASAN/UBSan clean).
  • Every pair passes the live behavioral parity suite locally (real rustc/clang/clang++/java/kotlinc). CI enforces all runtimes via REQUIRE_TEMPLATE_RUNTIMES=1 (all five toolchains preinstalled on GitHub runners).
  • Whole-branch review: approved (differential fuzzing + memory verification); review fixes in the final commit.

Ships as a minor release via the included changeset (nine→fourteen pairs).

🤖 Generated with Claude Code

toubatbrian and others added 6 commits July 20, 2026 11:18
Add the Rust (file ingest) probe template: an owned AgentValue enum with
From impls and an adbg! json-style macro, hand-rolled key normalization
matching the shared redaction contract (Rust std has no regex), a
backslash-free JSON serializer, verbatim redaction policy, 65536-byte cap,
depth-64 cap, epoch-ms timestamp, 0600 append via OpenOptions, and total
failure suppression. Registered as "rust" (alias "rs"), file ingest only.

Cycles are unrepresentable in an owned value tree, so the live cycle fixture
exercises the depth cap instead. Docs matrices and contract/e2e suites
extended; live e2e compiles single-file rustc with no cargo/serde.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add the C++ (file ingest) probe template: an owned AgentValue struct with
implicit ctors from bool/long long/double/const char*/std::string plus an
nlohmann-style initializer_list constructor for nested object/array literals,
hand-rolled key normalization matching the shared redaction contract (no
regex, ported 1:1 from the verified Rust normalizer), a backslash-free JSON
serializer via ostringstream, verbatim redaction policy, 65536-byte cap,
depth-64 cap, chrono epoch-ms timestamp, ofstream append with 0600 on POSIX,
and total failure suppression (try/catch(...)). Registered as "cpp" (aliases
"c++", "cxx"), file ingest only.

Cycles are unrepresentable in an owned value tree, so the live cycle fixture
exercises the depth cap instead. Docs matrices and contract/e2e suites
extended; live e2e compiles single-file clang++ (g++ fallback), -std=c++17.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a Java (file-ingest) probe template cloning the csharp.ts approach:
real java.util.regex key normalization, Map/List/array/scalar handling
with a java.lang.reflect fallback over public getters and fields,
IdentityHashMap-based cycle detection with a depth-64 cap, fully-qualified
names (no imports) so the helper is injectable anywhere, and single-file
`java <File>.java` execution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add the Kotlin (file ingest) probe template, closing the five-language
systems batch (C, C++, Rust, Java, Kotlin). Kotlin clones the Java JVM
approach: java.lang.reflect over public getters then fields (not
kotlin-reflect), IdentityHashMap cycle detection, depth cap 64, real
java.util.regex secret-key normalization, Files.write(CREATE, APPEND)
with 0600-at-create POSIX handling, and an object AgentDebugLog.emit
static helper that never alters control flow (catch Throwable).

Also updates the changeset (minor bump: nine helper/runtime pairs become
fourteen) and every current-facing language matrix and count (README,
DESIGN, SKILL, REFERENCE, spec advertised list + region-marker row).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DESIGN.md advertised-list contradiction; C NULL-key guard on malloc
failure; Rust allow attributes so user builds stay warning-free; C++
int constructor to remove the LL-suffix footgun.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Toubat

Toubat commented Jul 20, 2026

Copy link
Copy Markdown
Owner Author

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants