Integrating tom_som_rust_v0
tom_som_rust_v0 is the typed TomSpecs object-model facade for Rust. It depends on tom_som_rust_runtime. Both are versioned to the TomSpecs
model version (currently 1.3.2) — pin to that version so your document reads and writes match the model the facade was generated from.
Quick start
Add tom_som_rust_v0 to your Cargo.toml (cargo add tom_som_rust_v0), then:
use tom_som_rust_runtime as som;
use tom_som_rust_v0::D00SolutionBlueprint;
fn main() {
// A typed Solution Blueprint over a fresh document. The constructor also
// runs the instantiation-time model-version check (an empty stamp is
// editable).
let doc = som::doc_ref(som::SpecDocument::new());
let pd = D00SolutionBlueprint::new(doc, "").expect("new D00SolutionBlueprint");
pd.set_content("A platform that unifies our fragmented order systems.");
pd.current_landscape()
.set_content("Three legacy systems with no shared customer record.");
println!("{}", pd.content());
}
Dependency routes
From crates.io
These are proprietary (publish = false) crates, so they are not on crates.io. When published to a private registry, add the facade (it pulls in
tom_som_rust_runtime):
cargo add tom_som_rust_v0
or pin it in your Cargo.toml:
[dependencies]
tom_som_rust_v0 = "1.3.2"
Git dependency
Depend on the facade directly from source control (it lives in a sub-directory of the mono-repo):
[dependencies]
tom_som_rust_v0 = { git = "https://github.com/al-the-bear/tom_ai_build.git", branch = "main" }
Cargo resolves the crate by name within the repository, so the sub-directory is discovered automatically.
Path dependency (monorepo / vendored)
When the SOM crates sit alongside your crate, depend by path (the facade already does this for the runtime):
[dependencies]
tom_som_rust_v0 = { path = "../tom_som_rust_v0", version = "1.3.2" }
Pinning the version
Both tom_som_rust_runtime and tom_som_rust_v0 carry version 1.3.2, taken from the TomSpecs model version. When you upgrade the model, regenerate and move to the new matching version so the facade and your stored documents stay in step.
Building from source
Regenerate the facade, then build/package from the workspace (runtime first — the facade compiles against it through its relative
path dependency):
dart run tom_specs_clitool/bin/generate_som.dart
cd tom_som_rust_runtime && cargo package --no-verify
cd ../tom_som_rust_v0 && cargo build
The runtime cargo packages standalone. The facade depends on the publish = false
runtime, and cargo package requires every dependency to resolve from a registry — so the facade is packaged only when the runtime is available in one (e.g. a private registry / workspace publish). Locally the facade builds against the runtime by path, which is the correctness check.
Further documentation
| Document | Covers |
|---|---|
| README.md | What this package is, its document roots, and how to use them. |
| doc/tutorial.md |
A Rust walkthrough end to end — install, open a document, read and edit a section, validate it, and serialize to
*.docspecs.yaml
and Markdown.
|
| examples/README.md | The runnable samples. |
| tom_specs_model/doc/som_multiplatform_spec_model.md |
The SOM authority: the model, the formats, and
SOM §17
— the packaging rules this guide implements.
|
| tom_specs_model/doc/index.md | The catalogue of every TomSpecs subject-matter document. |
| tom_som_rust_runtime | The generic runtime this facade depends on. |