Repository navigation
feat(platform): establish the portable Ontology Runtime and trusted execution contract #328
Description
Activity
R1 clarification: platform boundary versus business-domain acceptance
This requirement has two deliberately different layers:
- RoleWeave open-source core is a domain-neutral trusted execution platform. It must not hard-code one organization's business vocabulary as the universal product scope.
- Business domains bring their own scenario packs and acceptance criteria. The platform standardizes how their business semantics, metrics, rules, evidence and actions are defined, versioned, governed and executed.
- Other users and organizations use the same portable contracts without inheriting a fixed industry or business vocabulary.
Responsibility boundaries:
Area Primary owner Product contract Business semantics, metrics and rules Business domain owner Business defines the meaning, formula, scope, thresholds and acceptance Platform capability Open-source team Standard contracts/configuration, validation, runtime, permissions, approvals, idempotency, audit, readback and workbench surfaces Scenario capability Open-source team + business domain Co-create the scenario pack, workflow, mappings, evaluations and operator experience Data capability Business provides the source and ownership Business provides source data, access and quality definition; the platform ingests/stores it through a standard contract with provenance and scope Action policy is also business-configured:
- automatic execution;
- human approval before execution;
- or forbidden.
The platform does not decide the business risk policy by itself. It enforces the configured policy at execution time, re-checks effective permissions, preserves idempotency, and records the exact readback/indeterminate outcome.
This clarification refines REQ-006 and AC-001: R2 must distinguish platform acceptance, technical-pilot acceptance, and a business domain's own acceptance. A domain scenario is evidence for the platform, not a hard-coded dependency of the open-source product.
R2 增量:从业务语义契约升级为 Ontology Runtime
结合最近对个推 AIBI 和 OntoFlow 相关材料的研究,补充一个平台边界判断:
RoleWeave 的开源核心不是经营决策产品,也不是通用 Ontology 编辑器,而是 domain-neutral 的企业 Agent 可信执行平台。业务语义不能只停留在 BusinessObjectRef / EvidenceRef 的描述合同,还需要一个最小的 Ontology Runtime seam,让业务对象能够被查询、计算、推进状态并提出受控行动。
新增设计判断
- Ontology Runtime 至少需要覆盖:对象与关系、派生状态、生命周期、查询/函数、业务 Action、事件/回执、版本与失效。
- 推荐运行链路为:
source ingest -> normalization / semantic binding -> ontology runtime -> typed query / function / action API -> Agent / Workbench / Skill / MCP -> policy / approval / idempotency / execution / readback- Agent 负责理解意图、规划和解释,但不应成为每次 SQL/API 操作的控制平面;Agent 应通过类型化的语义查询和 Action 合同使用 Ontology Runtime。
- 不在本 Issue 内建设图数据库、Palantir 替代品或全量企业本体。存储实现保持可插拔,技术 proof 可以基于现有跨仓库契约、事件/回执和最小本地实现。
- 外部写操作继续必须满足权限重检、审批策略、幂等键、目标版本校验、精确回读;indeterminate 不能被客户端猜成 succeeded。
- 任一业务域都可以作为可选 domain pack,但不能进入 RoleWeave 核心的固定业务词汇。
参考材料:https://mp.weixin.qq.com/s/qy1OOT0_wbq15Rw_iuEWrQ
R2 需要补充的验收点
- glossary/boundary 中新增并定义 OntologyRuntime、DerivedState、Lifecycle、BusinessAction;
- 发布一个最小的只读 semantic-runtime proof:source -> binding -> object/relation -> derived state -> evidence;
- 发布一个低风险 write-capable proof:action proposal -> approval/policy -> idempotent execution -> exact readback receipt;
- 明确 RoleWeave、digital-employee、context、mem 分别拥有的运行时边界,不能引入第二套数据/会话/权限真相源。
本评论是设计增量,不代表实现、CI、合并或业务验收已经完成。
进展回填(R2 增量之后)
冯浩然要求:在 Issue/PR 回填实际进展和验证证据。下面按 已做到 / 未做到 分开,不把设计评论当成实现。
已提交的代码
PR: 将在本评论后附上(
docs/328-ontology-runtime-r2)。产物 路径 术语表 + 边界 + 台账 docs/design/ontology-runtime-r2.md只读 proof 示例 examples/github-ops/semantic/read-only-analysis.v1.json可写 proof 示例(squash-merge 合同,不是真 merge) examples/github-ops/semantic/write-pr-merge.v1.json合同 + 状态机 packages/shared/src/semantic-runtime.tsAC-003 测试 apps/server/test/semantic-runtime.test.ts对照验收
ID 状态 证据 AC-001 glossary/owners/pilot 未冻结 文档是提案;产品负责人尚未在本 Issue 点名 owner / 试点拍板 AC-002 示例载荷 仓库内完成 上述两个 JSON AC-003 安全不变量 单测已写 未批准不可执行、幂等键、目标版本 stale、 indeterminate ↛ succeeded;CI 未在本环境跑过AC-004 端到端可跟随 未 live 只有合同轨迹;没有对真实 PR 走 proposal→approval→gh merge→readback AC-005 与 #327/#143/handoff 设计对账完成 文档 §3:reuse 记忆窗口与 Handoff,不改 turn/approval 真相源 AC-006 试点度量 未测 指标已列,全部 NOT MEASURED AC-007 安全边界 写进文档 合同禁止凭据/私聊/原始客户字段;并诚实记录 #302 的 policy 不执行缺口 R2 OntologyRuntime 等四个词 已定义 文档 §2 R2 只读 / 可写 proof 合同级 不是运行时存储,也不是新 MCP 现成可 reuse、本切片故意没重写的
#302examples/github-ops三个岗位 +apps/server/test/example-github-ops.test.ts(已合 main)packages/shared/src/workflows.tsTask/Handoff 状态机(indeterminate终态不可复活)docs/design/workflow-handoff-v1.md- 审批事件与 turn readback(
docs/evidence/issue-25)
下一步(需要产品拍板后才能算 AC-001 完成)
- 在本 Issue 写 requirement-decision:productOwner / technicalOwner / 技术 proof 确认仍是 github-ops / Sales 仍是 dogfood 而非核心词汇。
- CI 跑绿本 PR 的
semantic-runtime测试。 - 另开实现切片:只读绑定视图;再开低风险 write(幂等 merge + 精确 readback)。不要在本 PR 里做 Palantir。
本评论不是合并、不是业务验收。
- added a commit that references this issue
on Sep 18, 2026 验证证据回填(R2 合同切片)
冯浩然要求:在 Issue/PR 回填实际进展和验证证据。下面是命令级证据,不是设计评论复述。对应 PR:#344
本轮做了什么
提交 作用 b6acbcaglossary/合同/github-ops 示例 + AC-003 纯函数测试 5d267c0把 dist/semantic-runtime.js写入桌面打包 allowlist首轮 CI(
b6acbca)失败,原因是本切片新增共享模块后漏了SHARED_RUNTIME_FILES:packages/shared/dist/index.js imports unpackaged dist/semantic-runtime.jsJob: https://github.com/bytefolk/roleweave/actions/runs/35301940106/job/105466205625
本地(Node v24.20.0)
npm ci --ignore-scripts npm run build node --test --test-timeout=120000 apps/server/dist/test/semantic-runtime.test.js✔ #328 AC-003: action cannot run without approval ✔ #328 AC-003: retries reuse the same idempotency identity ✔ #328 AC-003: target version change invalidates the proposal ✔ #328 AC-003: indeterminate never becomes succeeded ✔ #328 AC-002: committed github-ops semantic examples stay parseable ℹ tests 5 pass 5 fail 0GitHub Actions(head
5d267c02)verify run: https://github.com/bytefolk/roleweave/actions/runs/35302429962
Check 结果 Node 24 / ubuntu-latest ( npm run check)pass https://github.com/bytefolk/roleweave/actions/runs/35302429962/job/105467661920 Node 24 / macos-14 pass Unpacked staging smoke macOS arm64 / Windows x64 pass Unsigned installers macOS arm64 / Windows x64 pass Layout parity pass CodeQL / Dependency review / OpenSSF Scorecard pass Ubuntu 日志同一 5 条全部 ✔;该 job 的 server suite 为
tests 513 / pass 511(其余 skip)。PR 评论:#344 (comment)
对照验收(未把设计当成实现)
ID 状态 证据 AC-001 glossary/owners/pilot 未冻结 文档是提案;产品负责人尚未在本 Issue 点名拍板 AC-002 示例载荷 仓库内完成 + CI 解析 examples/github-ops/semantic/*.v1.json;CI parseable ✔AC-003 安全不变量 单测绿 + CI 绿 上列 5 条;ubuntu npm run checkAC-004 端到端可跟随 未 live 只有合同轨迹;没有对真实 PR 走 proposal→approval→ gh pr merge→readbackAC-005 与 #327/#143/handoff 设计对账完成 docs/design/ontology-runtime-r2.md§3AC-006 试点度量 未测 指标已列,全部 NOT MEASURED AC-007 安全边界 写进文档 合同禁止凭据/私聊/原始客户字段 R2 四词 / 只读+可写 proof 合同级 不是运行时存储,也不是新 MCP 明确不声称
- 没有合并 PR docs(platform): record Ontology Runtime R2 contract for trusted execution (#328) #344(仍
REVIEW_REQUIRED;不会自合) - 没有关闭本 Issue
- 没有把 Sales Workbench 写进开源核心词汇
- 没有把可移植合同 pin 到 digital-employee(设计写明「最终应 pin」,本切片未做)
下一步(需要别人拍板/评审)
- 在本 Issue 写 requirement-decision:productOwner / technicalOwner / 技术 proof 确认仍是 github-ops / Sales 仍是 dogfood 而非核心词汇。
- CODEOWNER 审 docs(platform): record Ontology Runtime R2 contract for trusted execution (#328) #344
- 另开实现切片:只读绑定视图;再开低风险 write(幂等 merge + 精确 readback)。不要在本 PR 里做 Palantir。
- 没有合并 PR docs(platform): record Ontology Runtime R2 contract for trusted execution (#328) #344(仍
- changed the title
[-]feat(platform): define the business semantic contract for trusted Agent execution[/-][+]feat(platform): establish the portable Ontology Runtime and trusted execution contract[/+]on Sep 18, 2026 - added a commit that references this issue
on Sep 18, 2026 #344 已 squash-merge 到
main(ecc0294b)。这只落地了 Ontology Runtime R2 合同切片(glossary/contract 文档 + AC-003 纯函数 + github-ops 语义示例)。Issue #328 本身不要关。
仍未完成:
- AC-001:产品负责人尚未点名 owner / 试点
- AC-004:还没有对真实 PR 走 proposal → approval →
gh pr merge→ exact readback - AC-006:试点指标全部 NOT MEASURED
- 可移植合同尚未 pin 到 digital-employee
记录门禁,避免把 #344 的技术合入当成 #328 产品验收。
- 设计契约 PR docs(platform): record Ontology Runtime R2 contract for trusted execution (#328) #344 已于 2026-09-18 合入 main(
ecc0294)。独立门禁里的 BEHIND main 已消失。 - 技术侧:非法
expiresAtfail-closed、幂等重试绑定target.version、proposed/approved不得直接进failed,以及 semantic-runtime 8/8、hosted CI 绿——这些只证明 R2 文档/测试契约,不是产品验收。 - 仍未完成(feat(platform): establish the portable Ontology Runtime and trusted execution contract #328 继续 OPEN):
- AC-001:
productOwner/technicalOwner仍是 pending;lastDecisionAt仍 pending。 - AC-004 / AC-005:live proof。A GitHub-operations team that can file issues, open PRs and merge — with authoring and merging split across positions #302 已关的是 GitHub ops 岗位形态,不是「对象 → 决策 → 审批 → 幂等执行 → 精确 readback」的现场证明。合同示例或 mock 不等于 live write。
- 平台验收、技术试点验收、业务域验收必须分开。Sales Workbench 仍未承诺。
- AC-001:
不关本 issue,不开运行时实现,直到 AC-001 记名决策落地。
- 设计契约 PR docs(platform): record Ontology Runtime R2 contract for trusted execution (#328) #344 已于 2026-09-18 合入 main(
关单审计 HOLD(不关闭)
精确缺口:
productOwner/technicalOwner/lastDecisionAt仍 pending(AC-001)。#344 只是 R2 文档契约。缺 live「对象→决策→审批→幂等执行→readback」。@PeterGuy326 先记名 owner,再谈关单。
schemaVersion: requirement-record.v2
revision: R2
status: needs-design
priority: P1
productOwner: pending maintainer decision
technicalOwner: pending cross-repository assignment
userOutcome: >
An operator can ask a RoleWeave employee to inspect a bounded business object,
reach a traceable decision, and propose or execute a controlled action with
evidence, policy enforcement, idempotency, and trusted readback.
parent: #37
dependencies:
technicalPilot: A GitHub-operations team that can file issues, open PRs and merge — with authoring and merging split across positions #302
relatedPullRequests:
lastDecisionAt: pending
North star
RoleWeave is moving from multi-Agent demonstrations to a domain-neutral,
open-source trusted execution platform for enterprise Agents.
The platform lets an Agent work with bounded business objects, evidence,
policies, and actions without directly depending on raw database schemas or
unrestricted external tools.
The open-source core is not a domain-specific business application, BI system,
general-purpose ontology editor, graph database, or Palantir replacement.
Business solutions are delivered as optional domain packs and enterprise
adapters on top of the platform.
User outcome
An operator can ask a RoleWeave employee to:
A multi-Agent conversation alone is not evidence of a trusted execution
platform.
Product boundary
No repository may introduce a second source of truth for sessions, permissions,
approvals, durable memory, raw source occurrences, or execution receipts.
Execution model
The normative execution path is:
The Agent is responsible for intent understanding, planning, explanation, and
delegation. The Ontology Runtime is responsible for bounded business meaning
and deterministic operational state.
The Agent must not directly control arbitrary SQL, database writes, or
unrestricted external APIs.
Ontology Runtime scope
The Ontology Runtime is a portable contract and runtime seam, not a mandated
storage engine.
The minimum model includes:
The first implementation must not require a graph database or a new enterprise
data platform. Storage and source adapters remain replaceable.
Core contracts
BusinessObjectRef
A bounded reference to a business object, relationship, metric, event, or
derived state. It preserves source identity, scope, time, version, digest, and
permission context where applicable. It must not contain an unbounded raw source
payload.
EvidenceRef
A reference to source evidence supporting a claim or decision. It preserves a
source locator, source type, time range, revision or digest, provenance, and
access scope.
DecisionRecord
A bounded conclusion, hypothesis, or recommendation. It records confidence or
uncertainty, evidence references, semantic bindings, timestamp, and originating
turn or task.
ActionProposal
A proposed action that has not necessarily executed. It records action type,
target, intent, expected effect, preconditions, required permission, approval
policy, idempotency key, target version or digest, expiry, and originating
decision.
ExecutionReceipt
A record of what actually happened. It records actor and position, effective
permission, target identity and version, action and idempotency identities,
start and terminal states, external identifiers, exact readback, failure or
indeterminate reason, and originating turn or task.
indeterminate must never be rendered as succeeded.
Requirements
REQ-001 — Stable semantic references
Define versioned contracts for business objects, relationships, metrics,
events, derived state, and evidence. References must preserve scope,
provenance, time, and version information.
REQ-002 — Ontology Runtime boundary
Define minimum runtime behavior for object and relationship resolution, derived
state, lifecycle transitions, typed queries and functions, action discovery,
and source/version invalidation.
REQ-003 — Decision-to-action contract
Define a versioned contract connecting DecisionRecord to ActionProposal.
Target, intent, expected effect, preconditions, policy, approval, expiry, and
idempotency must be explicit.
REQ-004 — Fail-closed execution
An action must not execute unless effective permission is present, required
approval is satisfied, the target is still valid, the proposal has not expired,
and the idempotency identity is preserved.
Retries must reuse the same idempotency identity.
REQ-005 — Trusted execution state machine
Define and enforce:
No client-side inference may convert failed or indeterminate into succeeded.
REQ-006 — Workbench traceability
The RoleWeave workbench must allow an operator to inspect semantic context,
source evidence, decision, action proposal, policy result, execution state,
readback, and final receipt from the task or turn timeline.
Parallel, relay, and handoff flows must preserve these references without
silently widening permissions or re-running an action.
REQ-007 — Cross-repository ownership
Portable contracts belong in digital-employee. RoleWeave owns local
orchestration, presentation, and receipt navigation. context and mem retain
ownership of source occurrences and durable memory.
No direct database coupling may bypass these boundaries.
REQ-008 — Domain neutrality
The core must not hard-code one organization's business vocabulary, one
vendor's data model, graph database assumptions, or unattended Agent autonomy.
Business semantics, metrics, rules, mappings, and action policies are supplied
by a domain pack or enterprise adapter.
Acceptance criteria
AC-001 — R2 decision and ownership
Record an accepted decision that freezes the glossary, repository ownership,
technical pilot, product owner, technical owner, domain-pack policy, and
revisit trigger.
Platform acceptance, technical-pilot acceptance, and business-domain acceptance
must remain separate.
AC-002 — Contract examples
Publish bounded examples for:
Examples must include evidence, semantic binding, uncertainty, permission,
approval, idempotency, target version, and readback.
AC-003 — Safety invariants
Add executable tests proving that:
AC-004 — Deterministic read-only proof
Using the GitHub operations pilot from #302, demonstrate:
This proof must not claim live business impact.
AC-005 — Controlled write proof
Demonstrate one low-risk write-capable path:
A contract example or mock execution is not equivalent to live external
execution. The verification level must be stated explicitly.
AC-006 — Existing contract reconciliation
Document what is reused, extended, or intentionally unchanged from #327,
#143, workflow-handoff-v1, existing permission and approval records, and the
GitHub operations proof.
AC-007 — Security and data boundary
Define workspace and tenant scope, actor identity, execution-time permission
re-evaluation, sensitive-field handling, retention and expiry, audit access,
source ownership, and public-repository exclusions.
Credentials, private chat content, and raw customer data must not enter the
public contract or examples.
AC-008 — Evidence ledger
Every implementation PR must record the consumed Issue revision, exact commit
and PR head, test commands and results, CI status, independent review status,
security and scope checks, known limitations, and product acceptance status.
Design complete, implemented, CI-green, reviewed, merged, and product-accepted
are separate states.
Issue lifecycle and governance
The intended lifecycle is:
Any semantic change must first be recorded as an append-only
requirement-decision comment. The Issue body then advances to a new revision,
and every implementation PR must state which revision it consumes.
A green CI run or a merged PR does not by itself close this Issue. Product
acceptance requires the evidence ledger and an explicit decision on the current
revision.
Technical pilot and domain packs
The technical pilot is the GitHub operations path from #302.
Any business domain may later be validated as an optional domain pack, but no
single domain is a committed core vocabulary or a prerequisite for the
domain-neutral platform.
Users and organizations must be able to bring their own business objects,
metrics, rules, evidence mappings, and action policies through the same
portable contracts.
Current evidence
As of 2026-09-18:
open and requires review; no runtime behavior is claimed.
tests. It is open and requires review; it is not live external execution.
Non-goals
This Issue does not include:
Delivery sequence
indeterminate rate, approval latency, operator correction rate, and relevant
token/tool-result cost.
Definition of done
This Issue may move to an accepted design state only when:
Runtime implementation, live external execution, domain-pack validation, and
business outcomes require separate Issues and evidence.
Non-normative references