- New rootless doos container runtime: sandbox, cgroup, network, images, hardening, davmount, CLI plus molo integration - 18 CVE audit reproductions with READMEs and Makefiles - Example DoosDemo routes, IndexCatalog, static assets, spec update - CLI serve on 0.0.0.0:8000, arg parser, dev server improvements - Runtime HTTP fixes, supervisor isolation backend - Tests for doos, example doos routes, CLI serve; suite count 261 to 265
4.8 KiB
4.8 KiB
Static embeddability of ../tai/taicpp - research report (2026-10-26)
Verdict
Yes. taicpp builds build/libdetz.a (36 MB, verified 2026-10-26) excluding main.o, plus a fully-static build/detz-static (13.5 MB). Link it into molo and inject context via Agent::update_system() / run_turn().
1. Verified tree
taicpp/main.cpp(20 lines):cli::Parser::parseOpts → glue::GlueApp::run → AppBundle. Not in archive.taicpp/src/: 25 modules; agent coresrc/agent/agent.{h,cpp}, prompt bytessrc/agent/data.{h,cpp}(generated bysrc/agent/gen/gen_data.pyfromtai.py), configsrc/agent/agent_config.h, DI adapterssrc/glue/*_adapter.cpp, entrysrc/glue/glue_app.{h,cpp}+app_bundle.{h,cpp}.taicpp/third_party/:curl/libcurl.a,sqlite/libsqlite3.a,jitterentropy/libjitterentropy.a(vendored, statically linked).- Correction: earlier subagent-2 claim "libdetz.a does NOT exist" was wrong - it inspected moloapp (
build/molo,libai.a), not taicpp.ls -laconfirmsbuild/libdetz.aexists.
2. Makefile targets (taicpp/Makefile)
- Line 27:
LIB = $(BUILD)/libdetz.a;all → build/detz(dynamic:-lsqlite3 -lcurl -lz -pthread -lutil). - Lines 48–49
static::g++ -pthread -static main.o ALL_OBJS third_party/curl/libcurl.a third_party/sqlite/libsqlite3.a -lssl -lcrypto third_party/jitterentropy/libjitterentropy.a -lzstd -lz -lnghttp2 -lpsl -lbrotlidec -lidn2 -lrtmp -o build/detz-static. - Line 52 comment: every test links
tests/<name>.cppagainstbuild/libdetz.a. - Needs
MOLOAPP_SRCinclude (../../moloapp/src) + allsrc/*/as-I.
3. Link recipe (tested 2026-10-26, LINK_OK)
INCS=$(ls -d ../tai/taicpp/src/*/ | sed 's/^/-I/')
g++ -std=c++23 $INCS -I../tai/taicpp -I../tai/taicpp/src \
your_molo_obj.o build/libdetz.a \
third_party/curl/libcurl.a third_party/sqlite/libsqlite3.a \
third_party/jitterentropy/libjitterentropy.a \
-lssl -lcrypto -lzstd -lz -lnghttp2 -lpsl -lbrotlidec -lidn2 -lrtmp \
-lsqlite3 -lcurl -lz -pthread -lutil -o molo
Probe /tmp/embed_probe.cpp calling detz::agent::data::DefaultSystem() linked OK (104 KB binary).
4. Context-injection hooks (verified signatures + probe)
src/agent/agent.h:64std::string system_message;src/agent/agent.h:90void update_system(const std::string& text);- setssystem_message, persists viastore->save_system/save_bot_system, callsapply_system(), logs event (agent.cpp:353-359).src/agent/agent.cpp:301void Agent::apply_system()- composessystem_message + skill_catalog + tool_catalog + orientation_block + capability_block + AutonomousNote.src/agent/agent.h:124std::string run_turn(const std::string& text, bool capture=false, int max_steps=MAX_STEPS, bool routed=false);- per-turn injection point (prepend molo context totext).src/agent/data.h:13-14DefaultSystem()/MergeSystem()- byte-exact base prompt; permanent edits go viasrc/agent/gen/gen_data.py.src/agent/agent_config.hstruct AgentConfig : llm::LlmConfig-profile, db_path, history_path, auto_approve.- Probe
/tmp/embed_ctx.cpp:DefaultSystem() + "\n\n# Molo extra context\n..."→CTX_OK base=2796 total=2869, asserts substring present. Compiled + ran OK againstlibdetz.a. - Minimal embed:
#include "agent/agent.h"
detz::agent::AgentConfig cfg; /* db_path, profile, ... */
detz::agent::Agent agent(cfg, myPorts); // StorePort etc., see src/glue/*_adapter.cpp
agent.update_system(detz::agent::data::DefaultSystem() + "\n\n# Molo extra context\n" + myCtx);
agent.run_turn(userInput);
5. External sources (static-embedding practice)
- AwesomeModernCPP - Static Libraries: Packaging with
arand Linking with-l/-L-ar rcsreplace-and-insert semantics. https://awesome-embedded-learning-studio.github.io/Tutorial_AwesomeModernCPP/en/compilation/06-static-libraries (retrieved 2026-10-26) - CodeGenes - Best Practices for Wrapping C++ Class APIs for C/FFI (2026-01-19): opaque types,
extern "C", no exceptions across boundary, error codes. https://www.codegenes.net/blog/wrapping-c-class-api-for-c-consumption/ (retrieved 2026-10-26) - zackli.ai - How C/C++ Bindings Work: ABI and FFI (2026-07-15): C ABI as interop standard,
extern "C"linkage, opaque handles, function tables. https://zackli.ai/blog/c-abi-ffi/ (retrieved 2026-10-26) - w3tutorials - How to Develop a C Wrapper API for Object-Oriented C++ Code (2026-01-16): C wrapper with opaque pointer +
extern "C"+ careful error handling. https://www.w3tutorials.net/blog/developing-c-wrapper-api-for-object-oriented-c-code/ (retrieved 2026-10-26)
6. Gaps
- No
extern "C"wrapper exists yet - needed only for C/Python FFI; C++ molo links directly. - Fully-static link requires static variants of system libs (ssl, crypto, zstd, nghttp2, psl, brotli, idn2, rtmp) present.