MOVA Contract Writer
Transform a fully calibrated pre-contract into a complete MOVA contract — structured JSON with envelope, instruction profile, and episode frame — ready for execution by any MOVA-compliant runtime.
What this skill does
- 1. Parses the pre-contract — reads all sections produced by INLINECODE0
- Maps to MOVA constructs — translates each pre-contract section into the correct MOVA artifact
- Drafts each artifact — envelope (
env.*), data schema references (ds.*), instruction profile, episode frame - Human review gate — each artifact is shown to the user for approval before the final contract is assembled
- Outputs the complete MOVA contract — a single JSON document ready for submission to a MOVA runtime
Requirements
- - A completed pre-contract with
Status: VALID from INLINECODE4 - MOVA spec available at
/home/mova/.openclaw/workspace/mova-spec/ for schema validation
Pre-contract → MOVA mapping
| Pre-contract section | MOVA artifact | Notes |
|---|
| ACTOR (actor, owner, reasonnow) | INLINECODE6 | actor = sender/initiator, owner = recipient/accountable |
| CHANGE DEFINITION (changetarget, changetype, afterstate) |
verb_id in envelope | change_type maps to verb: action→create/update, state→route/record, result→analyze/publish |
| OBJECT (object
description, selectionrule) |
ds.* schema reference +
input_data_refs[] | describes what is being acted on |
| GOAL (goal
statement, verificationmethod, confirmation_owner) | Episode
result contract | defines expected
result_status and confirmation criteria |
| CONSTRAINTS (forbidden
action, invariant, unacceptableconsequence) |
ds.instruction_profile_core_v1 rules | each constraint → a
deny or
transform rule in instruction profile |
| SUCCESS/FAILURE states | Episode
result_status allowed values | success →
completed; failure →
failed/
cancelled/
partial |
| DECISION POINTS (deterministic) | Inline in episode frame or envelope verb | deterministic rules go into policy; human decisions go to human gates |
| HUMAN GATES |
ds.instruction_profile_core_v1 HITL rules |
trigger_condition maps to policy rule; pause execution and wait for human input |
| INPUTS (name, available, source) |
input_data_refs[] +
input_envelopes[] in episode | unavailable inputs → blocking dependency in instruction profile |
| DEPENDENCIES (name, type, blocking) | Instruction profile:
required_resources[] or blocking rules | blocking deps → must be resolved before execution starts |
| ASSUMPTIONS | Episode
context notes + instruction profile
on_violation | blocking assumptions → deny rule; safe assumptions → warn rule |
| TIME LIMITS (deadline, max
attempts, stopcondition) | Instruction profile
limits or episode
finished_at constraint | encode as policy constraints |
| AMBIGUITIES | Annotation in
meta.ext of the envelope | documented but not executable until resolved |
| LINEARITY CHECK | Validates that the episode frame has no hidden branches | non-linear → decision points must appear as explicit HITL gates |
Verb selection guide
| Change type from pre-contract | Verb | Use when |
|---|
| Creating something new | INLINECODE30 | afterstate is a new record or artifact |
| Modifying existing data |
update | afterstate is a changed version of an existing record |
| Making a routing/selection decision |
route | the task is choosing between options |
| Recording a fact or observation |
record | the task produces an audit entry or episode |
| Publishing to a registry |
publish | the task distributes a catalog or configuration |
| Analyzing data |
analyze | the task produces findings, scores, or risk bands |
| Planning a sequence of steps |
plan | the task produces a plan or strategy |
| Explaining a decision |
explain | the task produces a human-readable justification |
| Summarizing content |
summarize | the task condenses input into a shorter form |
Step-by-step process
Step 1 — Receive and validate the pre-contract
Ask: "Paste the pre-contract document (output of mova-intent-calibration)."
Check:
- - Status must be
VALID — if BLOCKED, stop here and tell the user to resolve the blocking items first - All required sections must be present
- No unresolved blocking ambiguities
Step 2 — Identify the core MOVA constructs
From the pre-contract, determine:
- 1. Verb — use the Verb selection guide above
- Envelope ID — format:
env.[domain]_[operation]_v1 (e.g. env.procurement_po_review_v1) - Primary data schema — format:
ds.[domain]_[object]_v1 (e.g. ds.procurement_po_v1) - Roles — map actor →
initiator, owner → accountable, confirmation_owner → INLINECODE47 - Instruction profile ID — format:
[domain]_policy_v1 (e.g. procurement_po_policy_v1)
Show the user this mapping and ask for confirmation before continuing.
Step 3 — Draft the envelope
CODEBLOCK0
Show to user. Ask to approve or edit.
Step 4 — Draft the instruction profile
CODEBLOCK1
Show to user. Ask to approve or edit.
Step 5 — Draft the episode frame
CODEBLOCK2
Show to user. Ask to approve or edit.
Step 6 — Assemble and output the complete MOVA contract
When all three artifacts are approved, output the final contract:
CODEBLOCK3
Spec reference
All schema structures are validated against:
- - INLINECODE50
- INLINECODE51
- INLINECODE52
- INLINECODE53
Use mova-spec-guide skill to look up any concept while drafting.
Rules
- - NEVER accept a pre-contract with status BLOCKED — stop and tell the user what to resolve first
- NEVER invent verb IDs, schema IDs, or policy values outside the MOVA verb catalog — read from spec
- NEVER skip the human review step for each artifact — the user must approve envelope, profile, and episode frame individually
- NEVER produce a contract with unresolved blocking ambiguities — mark it PENDING AMBIGUITY RESOLUTION
- If the pre-contract has optional sections marked notrequired — omit the corresponding MOVA fields
- Generated IDs (envelopeid, profileid, episodetype) follow MOVA naming conventions: lowercase, underscores, versioned with v1
- toolid = 0 unless the pre-contract specifies an external tool channel
MOVA 合约编写器
将完全校准的预合约转换为完整的MOVA合约——包含信封、指令配置文件和事件框架的结构化JSON,可供任何兼容MOVA的运行时执行。
该技能的功能
- 1. 解析预合约——读取mova-intent-calibration生成的所有章节
- 映射到MOVA结构——将每个预合约章节转换为正确的MOVA构件
- 起草每个构件——信封(env.)、数据模式引用(ds.)、指令配置文件、事件框架
- 人工审核关卡——在最终合约组装前,每个构件均展示给用户审批
- 输出完整MOVA合约——一份可直接提交至MOVA运行时的JSON文档
前置要求
- - 来自mova-intent-calibration且状态为VALID的已完成预合约
- MOVA规范位于/home/mova/.openclaw/workspace/mova-spec/,用于模式验证
预合约 → MOVA映射
| 预合约章节 | MOVA构件 | 备注 |
|---|
| 参与者(actor、owner、reasonnow) | env.*.roles[] | actor = 发送方/发起方,owner = 接收方/责任人 |
| 变更定义(changetarget、changetype、afterstate) |
信封中的verb
id | changetype映射到动词:action→create/update,state→route/record,result→analyze/publish |
| 对象(object
description、selectionrule) | ds.*模式引用 + input
datarefs[] | 描述被操作的对象 |
| 目标(goal
statement、verificationmethod、confirmation
owner) | 事件result合约 | 定义预期的resultstatus和确认标准 |
| 约束条件(forbidden
action、invariant、unacceptableconsequence) | ds.instruction
profilecore_v1规则 | 每个约束→指令配置文件中的一条deny或transform规则 |
| 成功/失败状态 | 事件result_status允许值 | success→completed;failure→failed/cancelled/partial |
| 决策点(确定性) | 事件框架或信封动词内联 | 确定性规则进入策略;人工决策进入人工关卡 |
| 人工关卡 | ds.instruction
profilecore
v1 HITL规则 | triggercondition映射到策略规则;暂停执行等待人工输入 |
| 输入(name、available、source) | 事件中的input
datarefs[] + input_envelopes[] | 不可用输入→指令配置文件中的阻塞依赖 |
| 依赖关系(name、type、blocking) | 指令配置文件:required_resources[]或阻塞规则 | 阻塞依赖→执行开始前必须解决 |
| 假设条件 | 事件context备注 + 指令配置文件on_violation | 阻塞假设→拒绝规则;安全假设→警告规则 |
| 时间限制(deadline、max
attempts、stopcondition) | 指令配置文件limits或事件finished_at约束 | 编码为策略约束 |
| 歧义项 | 信封meta.ext中的注释 | 已记录但在解决前不可执行 |
| 线性检查 | 验证事件框架无隐藏分支 | 非线性→决策点必须作为显式HITL关卡出现 |
动词选择指南
| 预合约中的变更类型 | 动词 | 使用场景 |
|---|
| 创建新内容 | create | afterstate是新记录或构件 |
| 修改现有数据 |
update | afterstate是现有记录的变更版本 |
| 做出路由/选择决策 | route | 任务是在选项之间进行选择 |
| 记录事实或观察 | record | 任务产生审计条目或事件 |
| 发布到注册表 | publish | 任务分发目录或配置 |
| 分析数据 | analyze | 任务产生发现、评分或风险等级 |
| 规划步骤序列 | plan | 任务产生计划或策略 |
| 解释决策 | explain | 任务产生人类可读的理由说明 |
| 总结内容 | summarize | 任务将输入压缩为更短形式 |
分步流程
第1步——接收并验证预合约
询问:请粘贴预合约文档(mova-intent-calibration的输出)。
检查:
- - 状态必须为VALID——如果为BLOCKED,在此停止并告知用户先解决阻塞项
- 所有必需章节必须存在
- 无未解决的阻塞性歧义
第2步——识别核心MOVA结构
从预合约中确定:
- 1. 动词——使用上述动词选择指南
- 信封ID——格式:env.[领域][操作]v1(例如env.procurementporeviewv1)
- 主数据模式——格式:ds.[领域][对象]v1(例如ds.procurementpov1)
- 角色——映射actor→initiator,owner→accountable,confirmationowner→approver
- 指令配置文件ID——格式:[领域]policyv1(例如procurementpopolicy_v1)
向用户展示此映射,并在继续前请求确认。
第3步——起草信封
json
{
envelopeid: env.[领域][操作]_v1,
verb: [第2步的动词],
roles: {
initiator: [预合约中的actor],
accountable: [预合约中的owner],
approver: [预合约中的confirmation_owner]
},
payload: {
object_ref: {
datatype: ds.[领域][对象]_v1,
description: [预合约中的object_description]
}
},
policyprofileid: [指令配置文件ID],
meta: {
reason: [预合约中的reason_now],
goal: [预合约中的goal_statement]
}
}
展示给用户。请求批准或编辑。
第4步——起草指令配置文件
json
{
schemaid: ds.instructionprofilecorev1,
profile_id: [指令配置文件ID],
securitymodelversion: movasecuritydefault_v1,
rules: [
// 预合约中每个约束对应一条规则
{
ruleid: constraint[n],
description: [约束陈述],
target: {
kind: action,
verb_id: [动词]
},
effect: deny, // forbiddenaction/unacceptableconsequence用deny;安全假设用warn
condition: [此规则触发条件],
rationale: [此约束存在的原因]
}
],
hitl_gates: [
// 预合约中每个人工关卡对应一个条目
{
gateid: gate[n],
triggercondition: [预合约中的triggercondition],
questionforhuman: [预合约中的questionforhuman],
validresolutioncriteria: [预合约中的validresolutioncriteria],
onnoresponse: block
}
],
on_violation: block
}
展示给用户。请求批准或编辑。
第5步——起草事件框架
json
{
schemaid: ds.movaepisodecorev1,
episodetype: execution/[领域][操作],
mova_version: 6.0.0,
verb_id: [第2步的动词],
tool_id: 0,
executor: {
role: ai_agent,
skill_id: mova-contract-writer
},
input_envelopes: [
{ envelopetype: env.[领域][操作]_v1 }
],
inputdatarefs: [
// 每个可用的必需输入对应一个条目
{ datatype: ds.[领域][对象]v1, dataid: [来自预合约输入] }
],
result_contract: {
success_statuses: [completed],
failure_statuses: [failed, cancelled],
partialallowed: [来自预合约partialsuccess_allowed的true/false],
verificationmethod: [预合约中的verificationmethod],
confirmedby: [预合约中的confirmationowner]
},
context: {
assumptions: [预合约中的假设条件],
ambiguities: [预合约中的任何剩余歧义]
}
}
展示给用户。请求批准或编辑