shape_workbench_open with mode: "fork" creates a separate derived
shape, with the source’s types, properties, and relationships copied in as a
starting point. You edit the copy; the original is untouched.
This is the right move when a system shape is close to what you want but not
exact, the memory and research shapes being the common ones. You inherit a
working model, then cull, add, and rename until it fits your domain.
Fork mode vs. edit mode
shape_workbench_open has four modes. Two of them look similar but do opposite
things:
| Mode | What it does |
|---|---|
edit | Opens an existing shape and changes it in place. Same shape, new version. |
fork | Copies a shape into a new, separate shape. Source unchanged. |
new | Starts a blank draft. |
inspect | Reads a shape without opening an editable session. |
Worked example: a domain-specific memory shape
The default memory shape ships with one type,memory, whose kind field
takes preference, decision, fact, lesson, observation, or signal, plus
content, domain, scope, date_observed, source_context, and expiry. It
also wires ABOUT and SUPERSEDED_BY edges. That is a lot of working structure
to inherit rather than rebuild.
Say you run sales and want memory tuned to deals: fewer generic kinds, a couple of
fields the default does not have.
Fork the memory shape
Open the system memory shape in fork mode against your project. You get a
new draft that already contains the
memory type, its fields, and its edges.Retune the types
Cull the kinds you do not use, add the ones you do, and add fields. Each is a
single tool call against the forked draft.
shape_workbench_edit_typeto narrow thekindenum (dropsignal, addobjectionandcommitment).shape_workbench_edit_propertyto add adeal_stagefield.shape_workbench_add_typeif your domain needs a second entity type.shape_workbench_rename_propertyif an inherited name does not fit.
Compile and check the surface
Compile the draft, then preview what the runtime will see.
shape_workbench_compilereturns the structure, denotative, and operative views plus version hashes. A clean compile means the model is coherent.shape_workbench_preview_operating_surfaceshows exactly the tools and fields runtime agents and generated tools will get from this shape. Check it before materializing.
Materialize it to the project
shape_workbench_materialize commits the compiled shape to its project. It is
now a live shape the runtime can read and write against, separate from the
system memory shape it was forked from.shapeId is what selects your variant. Without it, pb.memory uses the default
memory shape; with it, writes and reads conform to the shape you forked and
materialized.What you inherit, what you change
A fork copies the source as it stands at fork time. After that, the two shapes are independent: changes to your variant do not propagate back, and later changes to the system shape do not flow into your fork. You own the copy. The Workbench tools work on the forked draft the same way they work on any other draft, so the authoring flow applies in full: model, diff, version, plan migrations.| Tool | Use on a fork |
|---|---|
shape_workbench_diff | Compare your draft against its committed state. |
shape_workbench_version_graph | See the variant’s version history. |
shape_workbench_plan_migration | Plan a migration when you change a live variant. |
shape_workbench_inspect | Read the variant’s current state. |
Next
Authoring
The full Workbench tool surface for modeling, compiling, and versioning.
Materialize
Commit a compiled shape to a project so the SDK can use it.