Skip to main content

Runtime orchestration package for Cognition Engine.

Project description

runtime

目录定位

runtime/ 是认知引擎的运行组织支撑包,属于 runtime_container 背后的正式支撑面之一。

当前 v0.5.0 四层主入口中,运行时治理容器的主入口已经由以下物理包承担:

packages/runtime_container/

因此,runtime/ 不再被表述为 runtime-container 的物理替代入口,也不再与 composition/ 共同充当未落地 runtime_container 的临时映射。

当前正确关系是:

runtime_container = 运行时治理容器主入口 / facade
runtime = runtime_container 背后的运行组织支撑包
composition = runtime_container 背后的装配支撑包

本包负责基于公共行为契约、公共数据契约与配置上下文组织一次治理运行过程。

本包是运行组织者,不是契约定义者,不是装配根,也不是 ADK runtime 的替代实现。

本包回答的问题是:

在 behavior_contracts、schemas、config_contexts 已经定义清楚的前提下,认知引擎如何组织一次标准治理运行流程,并产出 RuntimeResult。

职责边界

本包负责:

  1. 消费 behavior_contracts 中定义的运行相关行为契约。
  2. 消费 schemas 中定义的 RuntimeInput、RuntimeResult、WorkflowResult、RuntimeEvent 等数据契约。
  3. 消费 config_contexts 中定义的运行配置上下文。
  4. 组织 runtime 执行过程。
  5. 调用由 composition 或上层装配入口注入的 WorkflowRunner、InvocationTracker、EventPublisher 等能力实现。
  6. 产出标准 RuntimeResult。
  7. observability_hub 提供稳定运行事实来源。
  8. 作为 runtime_container 的正式运行组织支撑面,被上层通过运行容器入口理解和复用。

本包不负责:

  1. 不定义行为契约。
  2. 不定义公共数据模型。
  3. 不定义配置上下文契约。
  4. 不读取根目录 config/
  5. 不执行配置装配。
  6. 不承担系统级装配根职责。
  7. 不直接依赖 ADK SDK。
  8. 不直接依赖具体 adapter 实现。
  9. 不直接依赖 LiteLLM、Hermes、OpenClaw 等外部运行实现。
  10. 不直接构建完整 evidence 系统。

与其他层的关系

与 runtime_container 的关系

  • runtime_container/ 是运行时治理容器主入口。
  • runtime/runtime_container 背后的运行组织支撑包。
  • 后续对外表达时,应把 runtime/ 归入运行时治理容器背后的正式支撑面,而不是把它表述为四层主入口。

与 composition 的关系

  • composition/ 是装配支撑包,负责把配置上下文、运行依赖与具体实现装配为可运行对象。
  • runtime/ 负责执行组织与结果聚合。
  • 二者都属于 runtime_container 背后的正式支撑面,但职责不同。

与 behavior_contracts 的关系

  • behavior_contracts/ 定义行为能力契约。
  • runtime/ 消费这些契约,并通过注入的实现完成运行组织。
  • runtime/ 不应自造与公共行为契约冲突的接口。

与 schemas 的关系

  • schemas/ 定义 RuntimeInput、RuntimeResult、WorkflowResult、RuntimeEvent 等公共数据契约。
  • runtime/ 消费并产出这些公共数据对象。
  • runtime/ 不应通过裸 dict 扩散跨模块运行结果。

与 config_contexts 的关系

  • config_contexts/ 定义运行过程可消费的配置上下文契约与 Config View。
  • runtime/ 只消费被注入的配置上下文,不直接读取 config/,也不承担配置装配。

与 adk_adapter 的关系

  • adk_adapter/ 是 ADK 能力适配实现层。
  • runtime/ 不直接依赖 adk_adapter/google.adk
  • 具体 ADK 能力应通过 WorkflowRunner 公共契约被装配后注入 runtime。

与 observability_hub 的关系

  • observability_hub/ 消费 RuntimeResult 等运行事实。
  • runtime/ 负责产出稳定 RuntimeResult,不负责构建 EvidenceBundle。
  • EvidenceBundle 当前仍是 observability_hub 内部候选观察记录,不属于 runtime 输出契约。

允许依赖

behavior_contracts
schemas
config_contexts

可通过装配关系间接协作的对象:

composition
runtime_container
adapter 实现
observability_hub

禁止依赖

config/
google.adk
litellm
hermes
openclaw
具体 workflow 实现包
具体 adapter 实现包
旧 cognition_engine 单包实现

标准执行链路

RuntimeInput
→ RuntimeConfigContext / Config View
→ StandardRuntimeRunner / RuntimeOrchestrator
→ WorkflowRunner
→ WorkflowResult
→ RuntimeEvent
→ RuntimeResult

发布面口径

在 v0.5.0 单一发布面表达中,runtime/ 应归入:

v0.5.0 正式支撑面 / 运行组织支撑面

不应归入:

历史遗留资产
独立主入口
ADK runtime 替代实现
早期未落地阶段的替代入口

四层主入口中与本包对应的入口是:

packages/runtime_container/

一句话收口

runtime/runtime_container 背后的运行组织支撑包,只按公共契约与配置上下文组织治理运行;它不直接读取配置事实、不绑定外部 SDK、不定义上游契约,也不替代 ADK runtime。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cognition_engine_runtime-0.5.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cognition_engine_runtime-0.5.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file cognition_engine_runtime-0.5.4.tar.gz.

File metadata

  • Download URL: cognition_engine_runtime-0.5.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cognition_engine_runtime-0.5.4.tar.gz
Algorithm Hash digest
SHA256 f684d81d87113261cfbfb8a80499c749c3e77235d09996831c82995697b4207d
MD5 ced4276a3394a7db3cdb9f9d6289aaf1
BLAKE2b-256 b1b647c387e0507473f0f6d3fc9f295efa35eeca7329ad5453aac8778dc28f65

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognition_engine_runtime-0.5.4.tar.gz:

Publisher: pypi-publish.yml on peacock-lab/cognition-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cognition_engine_runtime-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for cognition_engine_runtime-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e24e26bfec86924562e301de6e6d1eba4b088412933d74f8f57016c78405f8cb
MD5 f3969d2ebc3b29ea9af6ae3c9949bef9
BLAKE2b-256 8e61e1de17f8cba868fd2f847ba2f05cd44b11ffb74c4a5150f714f900467046

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognition_engine_runtime-0.5.4-py3-none-any.whl:

Publisher: pypi-publish.yml on peacock-lab/cognition-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page