ContractSpec docs

OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

graph.refactor — pattern-level graph transformations

Four structural refactoring ops: rename-by-pattern, extract-subgraph, merge-nodes, split-node. Supports dryRun preview. Budget: 2 000 in / 600 out / $0.035.

field.key.label
graph.refactor — pattern-level graph transformations
field.version.label
field.type.label
field.title.label
graph.refactor — pattern-level graph transformations
field.description.label

Four structural refactoring ops: rename-by-pattern, extract-subgraph, merge-nodes, split-node. Supports dryRun preview. Budget: 2 000 in / 600 out / $0.035.

field.tags.label
automation,agent,execution,graph,ai,refactor,pattern,m5
field.owners.label
field.stability.label
public

Applies a single pattern-level structural transformation to a graph. Choose the operation type via `operation.type`.

Supported operations

`rename_by_pattern`

Renames node/edge labels matching a JS regex pattern. `scope`: `"nodes"` | `"edges"` | `"both"`.

`extract_subgraph`

Moves specified nodes (and edges between them) into a new sub-graph. Cross-boundary edges are preserved as stubs. Returns `resultGraphId`.

`merge_nodes`

Collapses `sourceNodeIds` into `targetNodeId`. `strategy`: `"union"` (all edges kept) | `"intersect"` (shared edges only).

`split_node`

Expands one node into multiple partitions. Edges re-distributed by kind affinity.

Dry run

Pass `dryRun: true` to preview the diff without mutating state. The `preview` field in the output is always populated; `applied` is `false`.

Budget (M5 P2/W2.2)

maxInputTokens=2 000 · maxOutputTokens=600 · hardCapUsd=$0.035