1.5 KiB
1.5 KiB
Embedding detz: research notes
Options compared:
- Dynamic .so plugin (
dlopen): flexible versioning, but host must ship/resolve the .so at runtime; symbol drift risk; packaging burden. - Subprocess/IPC (spawn detz binary): simplest isolation, but per-call latency + serialization cost; no in-process context hook.
- Static archive link (chosen):
build/libdetz.a+ C ABI headersrc/glue/detz_embed.h(detz_set_context,detz_context,detz_version) plus C++ hookdetz::embed::apply_context(). Single artifact, no runtime deps beyond system libs, version pinned at build time.make staticadditionally yields fully staticbuild/detz-static(verifiedfile: statically linked,ldd: not a dynamic executable) using vendoredthird_party/{curl,sqlite,jitterentropy}archives. Re-verified 2026-10-27 at 1.44.3:make staticexits 0, the binary is 29 MB,filesays statically linked,--versionprintstai 1.44.3, and the link shows only the standard glibc static warnings (dlopen,getaddrinfo,gethostbyname,getpwuid). - Header-only: rejected — codebase too large, would explode host build times.
Why this API: minimal C surface (stable ABI, callable from C/Rust/Python-ctypes) with a thin C++ apply_context() injection point wired into GlueApp::one_shot, so hosts prepend context without touching agent internals. Proven: third-party TU links against libdetz.a and apply_context("ping") → [ctx] STATIC-PROOF\nping, version 1.44.3.