Kibo templates for Viper
The pack of templated features that turn a DSM model into a typed Python package and matching C++ surfaces — the template input of the code-generation pipeline: kibo(DSM, template) → feature.
-t flag Where it sits in the pipeline
The template pack is not a tool you run. It is what
Kibo loads when targeting the
Viper runtime. End users invoke it indirectly through
kibo (or through dsm_util.py create_python_package,
which wraps Kibo with this template under the hood).
DSM
model.dsm Kibo
kibo generate Template
cpp | python Output
*.py + *.hpp/cpp Static typed code, dynamic runtime
Viper is a dynamic, metadata-driven engine, strongly typed at runtime through its definitions catalog — values are walked through that runtime type tree. Without a typed bridge, every field access goes through string lookups : no autocomplete, no rename refactor, typos caught only at runtime. The template pack closes that gap by emitting a statically typed surface that mirrors your DSM, while the data underneath stays the same dynamically typed Viper value — no wrapper layer, no migration code.
Developer reality
What your editor sees: classes, fields, enums, methods, all named after your DSM model.
- Autocomplete and go-to-definition in any IDE
- Type checking before you run anything
- Rename refactor across the whole codebase
- Same ergonomics in Python and C++
Runtime reality
What actually executes: the dynamic Viper value tree with its metadata, mutation DAG, attachments, and dispatch.
- Typed accessors call straight into Viper — no wrapper
- RPC, persistence, and serialization for free
- The bridge is generated, never hand-written
- Schema changes regenerate the bridge — no migration code
Two surfaces, one source of truth
Pick a Python template, a C++ template, or both. Kibo emits the chosen surfaces ; when you take both, they stay in lock-step by construction (same DSM source) — no manual proxy code to maintain, no drift between languages.
Python package
Importable as import <namespace>, usable through the
dsviper runtime.
data.py— classes for namespaces, concepts, clubs, enums, structuresdefinitions.py— type definitions for Viperattachments.py— attachment API wrappersdatabase_attachments.py— database-backed attachmentspath.py— field-path constantsfunction_pools.py— function-pool wrappers (local and remote)pyproject.toml— ready topip installas a wheel
C++ surfaces
Headers and implementations linking against the Viper C++ engine — for embedding inside a native application.
*_Data.hpp/cpp— type implementations*_Definitions.hpp/cpp— definitions, paths, fields*_Database*.hpp/cpp— SQLite persistence layer*_Reader/Writer.hpp/cpp— binary and JSON codecs*_ValueCodec/Hasher/Type.hpp/cpp— bridge to dynamic Viper C++ values*_FunctionPools.hpp/cpp— function-pool surfaces (local and remote)*_Python.hpp/cpp— module constants for the C++ → Python bridge
Pack contents
Six categories of templated features. Each row in the pack is a
single -t argument to Kibo, opt-in independently.
Core Types
Data, Model, ValueType — typed classes, definitions, paths.
Persistence
Database, Attachments — SQLite persistence, attachment accessors.
Serialization
Stream, Json, ValueCodec, ValueHasher.
Function Pools
FunctionPool, AttachmentFunctionPool + remote RPC variants.
Python Bridge
Python — module constants for C++ apps embedding Python.
Testing
Test, TestApp — unit tests and runnable entry points, including a seedable fuzz harness.
Distribution and source
In the DevKit ZIP
Bundled alongside Kibo and the rest of the toolchain. No separate install — pulled from /downloads with the rest of DevKit.
On GitHub
digital-substrate/kibo-template-viper — public source repository.
Open template format, so a third-party pack can target any other
runtime (e.g. kibo-template-django, kibo-template-protobuf).
Generate Your First Package
Walk through a complete generation script, then package the typed Python output as an installable wheel.