Integrating tom_som_go_v0
tom_som_go_v0 is the typed TomSpecs object-model facade for Go. It depends on tom_som_go_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_go_v0 to your module (go get github.com/al-the-bear/tom_ai_build/tom_som_go_v0@v1.3.2), then:
import (
som "github.com/al-the-bear/tom_ai_build/tom_som_go_runtime"
somv0 "github.com/al-the-bear/tom_ai_build/tom_som_go_v0"
)
// A typed Solution Blueprint over a fresh document. The constructor also runs
// the instantiation-time model-version check (an empty stamp is editable).
doc := som.NewSpecDocument()
blueprint, err := somv0.NewD00SolutionBlueprint(doc, "")
if err != nil {
panic(err)
}
blueprint.SetContent("A platform that unifies our fragmented order systems.")
blueprint.CurrentLandscape().SetContent(
"Three legacy systems with no shared customer record.")
fmt.Println(blueprint.Content())
Dependency routes
From go get
Fetch the facade at a version tag (it pulls in tom_som_go_runtime):
go get github.com/al-the-bear/tom_ai_build/tom_som_go_v0@v1.3.2
or pin it in your go.mod:
require github.com/al-the-bear/tom_ai_build/tom_som_go_v0 v1.3.2
Version tags
Go has no central registry — a module version is a VCS tag. Both tom_som_go_runtime
and tom_som_go_v0 are tagged vMAJOR.MINOR.PATCH at the TomSpecs model version (currently
v1.3.2), matching the in-source Version constant each module exports. Fetch a specific version with
go get <module-path>@vMAJOR.MINOR.PATCH.
Path replace (monorepo / vendored)
When the SOM projects sit alongside your code, point Go at the local checkout with a replace
directive in your go.mod (the facade already does this for the runtime):
require github.com/al-the-bear/tom_ai_build/tom_som_go_v0 v0.0.0
replace github.com/al-the-bear/tom_ai_build/tom_som_go_v0 => ../tom_som_go_v0
replace github.com/al-the-bear/tom_ai_build/tom_som_go_runtime => ../tom_som_go_runtime
Pinning the version
Both tom_som_go_runtime and tom_som_go_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 and build/vet both modules from the workspace (the facade resolves the runtime through its relative
replace):
dart run tom_specs_clitool/bin/generate_som.dart
cd tom_som_go_runtime && go build ./... && go vet ./...
cd ../tom_som_go_v0 && go build ./... && go vet ./...
Further documentation
| Document | Covers |
|---|---|
| README.md | What this package is, its document roots, and how to use them. |
| doc/tutorial.md |
A Go 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_go_runtime | The generic runtime this facade depends on. |