Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .agents/skills/edgeflow-adapter-developer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ description: 新增或修改 LLM-EdgeFlow Adapter 的业务输入输出、InputC
字符串通过 `OutputStringWriter` 按实际容量和长度写入,不保存借用指针。

请求字段解析和最终协议组装留在 Converter;不向 Operator 中央分发添加业务分支,
也不把这些操作放进 Demo、Node 或 Core。同一 biz 的多个 Binding 必须保持外部 schema、
载体与 slot 契约一致。Binding 的批次限制及池深收紧由共享 Integration 规则处理。
也不把这些操作放进 Demo、Node 或 Core。每个 biz 只注册一个 Binding;外部契约不同就是另一个
biz。Binding 的批次限制及池深收紧由共享 Integration 规则处理。
若需 Demo,只补载体、调用与展示注册,不复制业务转换。

## 验证新增路径
Expand All @@ -50,7 +50,7 @@ description: 新增或修改 LLM-EdgeFlow Adapter 的业务输入输出、InputC
```bash
cmake --build build --target edgeflow_test_adapter_runner alg_pipeline_tool -j 4
./build/edgeflow_test_adapter_runner --gtest_list_tests
./build/alg_pipeline_tool catalog --io-binding <binding_id>
./build/alg_pipeline_tool catalog --io-binding <biz_name>
```

按改动运行列出的实际测试过滤器;业务契约测试须直接调用 Operator `Process`。
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/edgeflow-solution-planner/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Catalog 和完整 Operator 请求/响应为依据;流程与设计边界遵循

```bash
./build/alg_pipeline_tool catalog
./build/alg_pipeline_tool catalog --io-binding <existing_binding_id>
./build/alg_pipeline_tool catalog --io-binding <existing_biz_name>
./build/alg_pipeline_tool describe-node <node_type>
./build/alg_pipeline_tool describe-model <model_type>
./build/alg_pipeline_tool describe-backend <backend_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ slot configurations, allocator and capacities. It is not a Pipeline Node and doe
2. Operator public API lives in `include/edgeflow/operator/interface.h`; `types.h` forwards platform data structures. Platform mock interaction types live in `include/platform_mock/operator_types.h`, and payload structures in `operator_data_types.h`; see that directory's README for the distinction from real company headers.
3. Preserve exported Operator functions and their exception barrier in `src/adapter/operator/operator_adapter.cpp`: `noexcept`, `try`, `catch (const std::exception&)`, and `catch (...)`.
4. Implement ordinary `DecodeInputFn` callbacks in `InputConverterDefinition` under `src/adapter/input/`, `EncodeOutputFn` callbacks in `OutputConverterDefinition` under `src/adapter/output/`, and business binding through `IoBindingDefinition` under `src/adapter/biz/`. Register through `REGISTER_INPUT_CONVERTER`, `REGISTER_OUTPUT_CONVERTER`, and `REGISTER_IO_BINDING`.
5. Register `BizDefinition` with `PipelineCatalog::RegisterBizDefinition` to declare `biz_name` and complete ingress/egress Blackboard ports. `IoBindingDefinition` selects converters and defaults to the standard batch bound of 64; converter logical ports map to the same-named keys unless the binding lists a renamed mapping. External Pipeline JSON requires `deployment.io.io_binding` and rejects root `biz_name`; Integration derives the internal business boundary from the selected registration. Demo resolves its runner through the SDK configuration query; neither CLI nor Profile accepts a business selector. Bindings of the same biz must declare the same external schema, carrier and slot contract; Registry audit and deployment preflight enforce this before any payload cast.
5. Register `BizDefinition` with `PipelineCatalog::RegisterBizDefinition` to declare `biz_name` and complete ingress/egress Blackboard ports. `IoBindingDefinition` selects converters and defaults to the standard batch bound of 64; converter logical port names are the biz Blackboard keys. External Pipeline JSON requires `deployment.io.io_binding` and rejects root `biz_name`; Integration derives the internal business boundary from the selected registration. Demo resolves its runner through the SDK configuration query; neither CLI nor Profile accepts a business selector. Each biz registers exactly one binding, so the biz identifies one external contract; a second binding for the same biz is a registry conflict that fails SDK initialization.
6. Copy input data when the lifetime requires it, store request-scoped values in `AlgContext`, and pack output into leased pool slots only through the documented ownership contract.

Bindings default to the framework standard batch bound of 64; override
Expand All @@ -39,7 +39,7 @@ Process batch limit at the output pool depth; a larger binding limit cannot rela
For one required host slot, one business payload stream and one payload/result per request,
use `DecodeRequestRows` / `EncodeResultRows`
from `converter_authoring.h`. Business callbacks handle one owned payload or one borrowed output row;
helpers own looping, bindings, provenance, request IDs and diagnostic location. `OutputStringWriter`
helpers own looping, provenance, request IDs and diagnostic location. `OutputStringWriter`
uses actual pool capacities and explicit string lengths. Do not retain its borrowed view or pointers.
Independent metadata streams, multi-slot, expanded and aggregated conversions keep their explicit
algorithms and existing lower-level helpers; a single external slot alone does not imply a single stream.
Expand Down
8 changes: 4 additions & 4 deletions .agents/skills/pipeline-composer/references/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Build the tool if unavailable/stale, and rebuild after registration changes. Que
biz contract and its filtered assets:

```bash
./build/alg_pipeline_tool catalog --io-binding <binding_id>
./build/alg_pipeline_tool catalog --io-binding <biz_name>
```

Use the production tool for the target build. For fixtures deliberately using test-only
Expand All @@ -38,16 +38,16 @@ For an existing solution, edit the requested files instead of initializing anoth
Reuse registered nodes; cloning a Pipeline does not retarget the source Profile.

```bash
./build/alg_pipeline_tool init --io-binding <binding_id> --profile <profile_name>
./build/alg_pipeline_tool init --io-binding <binding_id> --empty
./build/alg_pipeline_tool init --io-binding <biz_name> --profile <profile_name>
./build/alg_pipeline_tool init --io-binding <biz_name> --empty
```

`init` normally returns a versioned response containing `pipeline`. To save a
runtime document directly, use `--raw` and a new destination (do not overwrite
an existing solution):

```bash
./build/alg_pipeline_tool init --io-binding <binding_id> --profile <profile_name> --raw > <new_pipeline.json>
./build/alg_pipeline_tool init --io-binding <biz_name> --profile <profile_name> --raw > <new_pipeline.json>
```

Check the command's exit status before using the file, then validate the saved
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ its last stage merges; delete the plan then. A plan describes intended changes,

Until the first production release there are no compatibility consumers. Rename or remove
identifiers, fields, parameters and diagnostic codes in place and update every reference in the
same change; do not keep aliases, retired values or migration shims. After release, an
incompatible external contract change adds a new versioned IoBinding instead of changing an
existing ID.
same change; do not keep aliases, retired values or migration shims. Each biz has exactly one
IoBinding and therefore one external contract. After release, an incompatible external contract
change is made in place and shipped in a new SDK release; add a new biz only when the old and new
contracts must be served side by side.

Use framework defaults for platform limits and scheduling values when a conservative value
is correct for every supported scenario, even if slower, or an independent runtime hard
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ cmake --build build --target alg_sdk alg_demo alg_pipeline_tool alg_show --paral

```bash
# 查询当前构建中可用的业务契约与节点
./build/alg_pipeline_tool catalog --io-binding keyword_match.operator.v1
./build/alg_pipeline_tool catalog --io-binding keyword_match
./build/alg_pipeline_tool describe-node TextRuleMatchNode

# 查看经过校验的执行计划
Expand Down
6 changes: 3 additions & 3 deletions configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ Validator 从输入数据的唯一生产者推导依赖,`depends_on` 仅用于

## 业务入口与输出配置

每份 Pipeline 显式填写 `deployment.io.io_binding`,它决定外部 C 结构体与内部数据的转换契约。
每份 Pipeline 显式在 `deployment.io.io_binding` 填写业务名,它选择该业务唯一的绑定,决定外部 C 结构体与内部数据的转换契约。
框架从注册关系获得业务边界、输入/输出转换器、端口和输出类型,不靠文件名或后缀猜测。
Demo 根据配置自动选取运行入口,Profile 只保存配置路径、数据集和执行参数。
同一业务的多个 binding 必须声明一致的外部协议、载体和有效槽位,注册审计及部署预检都会校验。
每个业务只注册一个 binding;同一业务的第二个 binding 会被注册审计拒绝,SDK 初始化失败。

```json
{
"deployment": {
"io": {
"io_binding": "keyword_match.operator.v1"
"io_binding": "keyword_match"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions configs/pipeline_audio_asr_intent_cpu.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"deployment": {
"io": {
"io_binding": "audio_asr_intent.operator.v1"
"io_binding": "audio_asr_intent"
}
},
"models": [
{
"model_id": "asr_model_v1",
"model_id": "asr_model",
"model_type": "whisper_asr",
"backend": "whisper_cpp",
"model_path": "models/ggml-base.bin",
Expand All @@ -25,7 +25,7 @@
"id": "transcribe",
"node_type": "AsrTranscribeNode",
"config": {
"bind_model": "asr_model_v1"
"bind_model": "asr_model"
},
"inputs": {
"audio": "audio_inputs"
Expand Down
6 changes: 3 additions & 3 deletions configs/pipeline_cross_rerank_cpu.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"deployment": {
"io": {
"io_binding": "cross_rerank.operator.v1"
"io_binding": "cross_rerank"
}
},
"models": [
{
"model_id": "rerank_model_v1",
"model_id": "rerank_model",
"model_type": "bge_reranker",
"backend": "onnxruntime",
"model_path": "./models/ms_marco_tinybert_l2_v2_quantized.onnx",
Expand All @@ -31,7 +31,7 @@
"id": "node_0_TextRerankNode",
"node_type": "TextRerankNode",
"config": {
"bind_model": "rerank_model_v1",
"bind_model": "rerank_model",
"top_k": 8
},
"inputs": {
Expand Down
16 changes: 8 additions & 8 deletions configs/pipeline_dialogue_audit_default.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"deployment": {
"io": {
"io_binding": "dialogue_audit.operator.v1"
"io_binding": "dialogue_audit"
}
},
"models": [
Expand All @@ -15,7 +15,7 @@
"backend_config": {
"max_batch_size": 4
},
"model_id": "embed_model_v2",
"model_id": "embed_model",
"model_path": "./models/bge_base_zh_v1.5.onnx"
},
{
Expand All @@ -28,7 +28,7 @@
"backend_config": {
"max_batch_size": 4
},
"model_id": "rerank_model_v1",
"model_id": "rerank_model",
"model_path": "./models/ms_marco_tinybert_l2_v2_quantized.onnx"
},
{
Expand All @@ -47,7 +47,7 @@
"n_gpu_layers": 0,
"check_tensors": false
},
"model_id": "audit_llm_v1",
"model_id": "audit_llm",
"model_path": "./models/qwen2.5-0.5b-instruct-q4_k_m.gguf"
}
],
Expand Down Expand Up @@ -92,7 +92,7 @@
"id": "node_2_QueryEmbeddingNode",
"node_type": "TextEmbeddingNode",
"config": {
"bind_model": "embed_model_v2"
"bind_model": "embed_model"
},
"inputs": {
"text": "user_texts"
Expand All @@ -105,7 +105,7 @@
"id": "node_3_PolicyEmbeddingNode",
"node_type": "TextEmbeddingNode",
"config": {
"bind_model": "embed_model_v2",
"bind_model": "embed_model",
"lifetime": "session"
},
"inputs": {
Expand Down Expand Up @@ -135,7 +135,7 @@
"id": "node_5_TextRerankNode",
"node_type": "TextRerankNode",
"config": {
"bind_model": "rerank_model_v1",
"bind_model": "rerank_model",
"top_k": 1
},
"inputs": {
Expand Down Expand Up @@ -165,7 +165,7 @@
"id": "node_7_LlmGenerateNode",
"node_type": "LlmGenerateNode",
"config": {
"bind_model": "audit_llm_v1",
"bind_model": "audit_llm",
"max_tokens": 256,
"temperature": 0.1
},
Expand Down
16 changes: 8 additions & 8 deletions configs/pipeline_dialogue_audit_kite.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"deployment": {
"io": {
"io_binding": "dialogue_audit.operator.v1"
"io_binding": "dialogue_audit"
}
},
"models": [
Expand All @@ -15,7 +15,7 @@
"backend_config": {
"max_batch_size": 4
},
"model_id": "embed_model_v2",
"model_id": "embed_model",
"model_path": "models/bge_base_zh_v1.5.onnx"
},
{
Expand All @@ -28,7 +28,7 @@
"backend_config": {
"max_batch_size": 4
},
"model_id": "rerank_model_v1",
"model_id": "rerank_model",
"model_path": "models/ms_marco_tinybert_l2_v2_quantized.onnx"
},
{
Expand All @@ -41,7 +41,7 @@
"backend_config": {
"run_config_file": "kite_text_run.json"
},
"model_id": "audit_llm_v1",
"model_id": "audit_llm",
"model_path": "models/qwen2.5-0.5b-instruct-q4_k_m.gguf"
}
],
Expand Down Expand Up @@ -86,7 +86,7 @@
"id": "node_2_QueryEmbeddingNode",
"node_type": "TextEmbeddingNode",
"config": {
"bind_model": "embed_model_v2"
"bind_model": "embed_model"
},
"inputs": {
"text": "user_texts"
Expand All @@ -99,7 +99,7 @@
"id": "node_3_PolicyEmbeddingNode",
"node_type": "TextEmbeddingNode",
"config": {
"bind_model": "embed_model_v2",
"bind_model": "embed_model",
"lifetime": "session"
},
"inputs": {
Expand Down Expand Up @@ -129,7 +129,7 @@
"id": "node_5_TextRerankNode",
"node_type": "TextRerankNode",
"config": {
"bind_model": "rerank_model_v1",
"bind_model": "rerank_model",
"top_k": 1
},
"inputs": {
Expand Down Expand Up @@ -159,7 +159,7 @@
"id": "node_7_LlmGenerateNode",
"node_type": "LlmGenerateNode",
"config": {
"bind_model": "audit_llm_v1",
"bind_model": "audit_llm",
"max_tokens": 128,
"temperature": 0.0
},
Expand Down
2 changes: 1 addition & 1 deletion configs/pipeline_doc_qa_cpu.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"deployment": {
"io": {
"io_binding": "doc_qa.operator.v1"
"io_binding": "doc_qa"
}
},
"models": [
Expand Down
12 changes: 6 additions & 6 deletions configs/pipeline_doc_qa_default.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"deployment": {
"io": {
"io_binding": "doc_qa.operator.v1"
"io_binding": "doc_qa"
}
},
"models": [
Expand All @@ -15,7 +15,7 @@
"backend_config": {
"max_batch_size": 4
},
"model_id": "embed_model_v1",
"model_id": "embed_model",
"model_path": "./models/bge_base_zh_v1.5.onnx"
},
{
Expand All @@ -34,7 +34,7 @@
"n_gpu_layers": 0,
"check_tensors": false
},
"model_id": "llm_model_v1",
"model_id": "llm_model",
"model_path": "./models/qwen2.5-0.5b-instruct-q4_k_m.gguf"
}
],
Expand All @@ -57,7 +57,7 @@
"id": "node_1_QueryEmbeddingNode",
"node_type": "TextEmbeddingNode",
"config": {
"bind_model": "embed_model_v1"
"bind_model": "embed_model"
},
"inputs": {
"text": "raw_queries"
Expand All @@ -70,7 +70,7 @@
"id": "node_2_ChunkEmbeddingNode",
"node_type": "TextEmbeddingNode",
"config": {
"bind_model": "embed_model_v1"
"bind_model": "embed_model"
},
"inputs": {
"text": "doc_chunks"
Expand Down Expand Up @@ -148,7 +148,7 @@
"id": "node_6_LlmGenerateNode",
"node_type": "LlmGenerateNode",
"config": {
"bind_model": "llm_model_v1",
"bind_model": "llm_model",
"max_tokens": 128,
"temperature": 0.3
},
Expand Down
Loading
Loading