abelien-harness 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +19 -20
- package/README.md +12 -12
- package/package.json +1 -1
- package/skills/abelien-algorithm/SKILL.md +14 -6
- package/skills/abelien-algorithm/domain.json +59 -5
- package/skills/abelien-algorithm/references/research-policy.md +11 -3
- package/skills/abelien-algorithm/references/selection-service-contract.md +50 -0
- package/skills/abelien-algorithm/schemas/algorithm-bindings.v1.json +414 -0
- package/skills/abelien-algorithm/schemas/algorithm-candidates.v1.json +192 -0
- package/skills/abelien-algorithm/scripts/candidates.mjs +119 -0
- package/skills/abelien-algorithm/scripts/evidence.mjs +69 -0
- package/skills/abelien-algorithm/scripts/finalize-selection.mjs +64 -7
- package/skills/abelien-algorithm/scripts/lane-state.mjs +27 -0
- package/skills/abelien-algorithm/scripts/research.mjs +203 -0
- package/skills/abelien-hardware/SKILL.md +4 -4
- package/skills/abelien-hardware/domain.json +4 -4
- package/skills/abelien-hardware/references/knowledge-recall-service-contract.md +4 -4
- package/skills/abelien-hardware/references/search-index-format.md +5 -5
- package/skills/abelien-hardware/references/search-index-release.md +7 -7
- package/skills/abelien-hardware/references/selection-service-contract.md +3 -3
- package/skills/abelien-hardware/scripts/build-search-index.mjs +1 -1
- package/skills/abelien-hardware/scripts/oss-object-store.mjs +247 -0
- package/skills/abelien-hardware/scripts/{tos-wiki-search.mjs → oss-wiki-search.mjs} +19 -19
- package/skills/abelien-hardware/scripts/search-index-release.mjs +25 -25
- package/skills/abelien-hardware-selection/SKILL.md +2 -2
- package/skills/abelien-hardware-selection/domain.json +2 -2
- package/skills/abelien-hardware-selection/scripts/load-guide.mjs +1 -1
- package/skills/abelien-harness/references/adapter-contract.md +1 -1
- package/skills/abelien-harness/references/m1-integration.md +2 -2
- package/skills/abelien-harness/scripts/ab.mjs +45 -3
- package/skills/abelien-harness/scripts/studio.mjs +15 -14
- package/skills/abelien-reference/domain.json +1 -1
- package/skills/abelien-reference/references/research-contract.md +1 -0
- package/skills/abelien-reference/schemas/reference-evidence.v1.json +1 -1
- package/skills/abelien-reference/scripts/finalize.mjs +3 -1
- package/skills/abelien-workspace/SKILL.md +1 -1
- package/skills/abelien-workspace/assets/journey-stage-plan.json +46 -13
- package/skills/abelien-workspace/assets/lane-plan.json +36 -0
- package/skills/abelien-workspace/domain.json +24 -2
- package/skills/abelien-workspace/references/hardware-journey-orchestration.md +2 -2
- package/skills/abelien-workspace/references/harness-binding.md +3 -3
- package/skills/abelien-workspace/references/user-journey.md +5 -5
- package/skills/abelien-workspace/scripts/journey-next.mjs +10 -2
- package/skills/abelien-workspace/scripts/lanes-next.mjs +38 -0
- package/skills/abelien-workspace/workflows/user-journey.json +1 -1
- package/skills/abelien-hardware/scripts/tos-object-store.mjs +0 -202
package/.env.example
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
# Harness automatically loads .env and then .env.local from its launch directory.
|
|
2
2
|
# Existing process variables take precedence. Never commit real credentials.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
# Aliyun OSS connection, same names as the Web host (S3-compatible SigV4).
|
|
5
|
+
CAD_STORAGE_REGION=cn-hangzhou
|
|
6
|
+
CAD_STORAGE_ENDPOINT=https://oss-cn-hangzhou.aliyuncs.com
|
|
7
|
+
CAD_STORAGE_BUCKET=your-bucket
|
|
8
|
+
CAD_STORAGE_ACCESS_KEY=
|
|
9
|
+
CAD_STORAGE_SECRET_KEY=
|
|
10
|
+
CAD_STORAGE_ADDRESSING_STYLE=virtual
|
|
11
|
+
# Optional STS token for temporary credentials.
|
|
12
|
+
CAD_STORAGE_SESSION_TOKEN=
|
|
11
13
|
|
|
12
|
-
# Optional
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# CAD_STORAGE_ACCESS_KEY=
|
|
23
|
-
# CAD_STORAGE_SECRET_KEY=
|
|
24
|
-
# CAD_STORAGE_ADDRESSING_STYLE=virtual
|
|
14
|
+
# Optional hardware Wiki search and publish controls
|
|
15
|
+
OSS_WIKI_PREFIX=hardware_profile_wiki/
|
|
16
|
+
OSS_SEARCH_CONCURRENCY=8
|
|
17
|
+
# Total attempts (incl. the first) for idempotent reads on transient failures (dropped connection, timeout, 429/5xx); 1–5.
|
|
18
|
+
OSS_REQUEST_ATTEMPTS=3
|
|
19
|
+
OSS_MAX_FULL_WIKI_FETCH_PER_SLOT=24
|
|
20
|
+
OSS_PUBLISH_CONCURRENCY=6
|
|
21
|
+
OSS_REQUEST_TIMEOUT_MS=30000
|
|
22
|
+
OSS_MAX_OBJECT_BYTES=16777216
|
|
23
|
+
OSS_ALLOW_LEGACY_MANIFEST_FALLBACK=false
|
|
25
24
|
|
|
26
25
|
# Optional external hardware revision service
|
|
27
26
|
ABELIEN_HARDWARE_REVISE_URL=
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npx 可安装的多 agent skill harness:**通用内核 + 可插拔域包**。
|
|
|
10
10
|
|
|
11
11
|
内核对领域不感知,随包分发 10 个 bundle。产品层:[abelien-workspace](skills/abelien-workspace/SKILL.md)(旅程、版本与确认)·
|
|
12
12
|
[abelien-guide](skills/abelien-guide/SKILL.md)(对话调度与沟通)· [abelien-clarify](skills/abelien-clarify/SKILL.md)(需求澄清只读快照)。
|
|
13
|
-
领域层:[abelien-hardware](skills/abelien-hardware/SKILL.md)(
|
|
13
|
+
领域层:[abelien-hardware](skills/abelien-hardware/SKILL.md)(OSS 候选检索与修订)·
|
|
14
14
|
[abelien-hardware-selection](skills/abelien-hardware-selection/SKILL.md)(本地三级分类选型)·
|
|
15
15
|
[abelien-algorithm](skills/abelien-algorithm/SKILL.md)(基于已验证硬件、官方资料优先的联网算法选型)·
|
|
16
16
|
[abelien-appearance](skills/abelien-appearance/SKILL.md) 与 [abelien-structure](skills/abelien-structure/SKILL.md)(外观与机械结构)·
|
|
@@ -153,18 +153,18 @@ node skills/abelien-harness/scripts/ab.mjs --workdir <作品工作目录> workfl
|
|
|
153
153
|
|
|
154
154
|
PRD 以用户指定的飞书模板 revision 191 为结构依据,保留七块总览、逐条需求清单与图片引用;从 A1 起每轮登记/修改/撤回需求,保留 ID、来源与历史,选型和检查回来后再更新关联行。定义与写入语义集中在 [PRD 契约](skills/abelien-workspace/references/prd-contract.md),模板随 workspace 安装。产品写入/回读接口尚未接入,不能把规则声明说成自动写入已实现。
|
|
155
155
|
|
|
156
|
-
`user-journey-mock`、专属 workspace mock 能力和 draft/quote 样例状态机已移除,旧记录与 [MVP 实录](docs/mvp/journey.md) 仅用于历史核对,不再提供运行入口。当前 eval 共五条场景:`user-journey-entry` 只验证入口暂停,不表示产品 E2E 通过;`user-journey-cancelled` 验证取消是**终态**(落 `cancelled` 后 `advance` 与再次 `cancel` 都被拒);`user-journey-hardware-verified` 与 `user-journey-hardware-pending-confirmation` 经**场景 http 桩**端到端驱动硬件阶段的接线(Agent 槽位真的进了请求体、选型资源落库、draft 记下 id 与 status)与门禁(`verified` 过门落 `selected`;`needs_confirmation` 不再被拒——不执行算法,以 `selected_pending_confirmation` 正常完成,仍不宣称 `verified`;`failed`/`unknown` 依旧 `GUARD_FAILED`);`user-journey-hardware-candidates` 驱动**候选提案**路径(本地 `hardware.search` 按受控三级路径读
|
|
156
|
+
`user-journey-mock`、专属 workspace mock 能力和 draft/quote 样例状态机已移除,旧记录与 [MVP 实录](docs/mvp/journey.md) 仅用于历史核对,不再提供运行入口。当前 eval 共五条场景:`user-journey-entry` 只验证入口暂停,不表示产品 E2E 通过;`user-journey-cancelled` 验证取消是**终态**(落 `cancelled` 后 `advance` 与再次 `cancel` 都被拒);`user-journey-hardware-verified` 与 `user-journey-hardware-pending-confirmation` 经**场景 http 桩**端到端驱动硬件阶段的接线(Agent 槽位真的进了请求体、选型资源落库、draft 记下 id 与 status)与门禁(`verified` 过门落 `selected`;`needs_confirmation` 不再被拒——不执行算法,以 `selected_pending_confirmation` 正常完成,仍不宣称 `verified`;`failed`/`unknown` 依旧 `GUARD_FAILED`);`user-journey-hardware-candidates` 驱动**候选提案**路径(本地 `hardware.search` 按受控三级路径读 OSS,`hardware.finalize` 归一化为提案),三条实况断言锁 Catalog/索引/Wiki 各被真实读一次,且 draft 不带 `hardwareSelectionId`(候选不产生正式选型)。桩是评估进程内的假服务,**不**证明选型质量,也**不**证明服务端已就位。
|
|
157
157
|
基础需求足够后推进首版;guide 在宿主实际展示条件满足时通过可选选择题卡片邀请交互细化并告知可“随时收尾”。PRD 从已保存需求起可读,不强制展开或增加文档确认关卡。收尾切入同一作品的[成果体验](skills/abelien-workspace/references/user-journey.md#result-experience):收起全部编辑面板,有可运行仿真就进入仿真,否则按真实播放器能力提供 Three.js 状态动作演示;保留 PRD 查看/草稿或确认版导出及返回编辑入口。展示模式与方案确认独立,不能用收尾、演示状态或草稿导出触发 workflow 完成。宿主 UI/播放器仍须实际接入,历史入口测试不证明体验已实现。
|
|
158
158
|
|
|
159
159
|
### 真实硬件阶段
|
|
160
160
|
|
|
161
|
-
另有独立的 `user-journey-hardware` 阶段流程:输入 clarify 交回的 Requirements(context / reaction[] / limits[],每条须带 `source ∈ {user,system}`、非空 `text` 与全局唯一 `id`,limits 另有 `strength ∈ {hard,preference}`;格式不合规在读取任何可信召回之前即失败),在 agent 暂停点按需加载同级 `abelien-hardware-selection` 的三级分类规则,再将槽位交给 `hardware.select`——它是该域包 `domain.json` 声明的 `{type:"module"}` 本地 adapter(`scripts/select.mjs`),不连网络、无服务端 URL。主流程先
|
|
161
|
+
另有独立的 `user-journey-hardware` 阶段流程:输入 clarify 交回的 Requirements(context / reaction[] / limits[],每条须带 `source ∈ {user,system}`、非空 `text` 与全局唯一 `id`,limits 另有 `strength ∈ {hard,preference}`;格式不合规在读取任何可信召回之前即失败),在 agent 暂停点按需加载同级 `abelien-hardware-selection` 的三级分类规则,再将槽位交给 `hardware.select`——它是该域包 `domain.json` 声明的 `{type:"module"}` 本地 adapter(`scripts/select.mjs`),不连网络、无服务端 URL。主流程先 OSS 搜索、再 Agent 证据判断、最后本地 `hardware.select`;未知不通过门禁。契约见选型域 selection-service-contract;verified 不是工程实测。算法与外观真实阶段尚未接到该流程。分类规则快照的来源见下文「快照来源」。
|
|
162
162
|
|
|
163
|
-
###
|
|
163
|
+
### OSS 候选检索工具
|
|
164
164
|
|
|
165
|
-
`hardware.search` 独立读取候选 Wiki,正式选型仍通过 `hardware.select`;
|
|
165
|
+
`hardware.search` 独立读取候选 Wiki,正式选型仍通过 `hardware.select`;OSS 结果不自动通过硬件选型门禁。
|
|
166
166
|
|
|
167
|
-
发布搜索索引前,从同一份 `_manifest.json` 和 Markdown 构建分类索引;完整 Wiki 无需复制。先做不连接
|
|
167
|
+
发布搜索索引前,从同一份 `_manifest.json` 和 Markdown 构建分类索引;完整 Wiki 无需复制。先做不连接 OSS 的校验:
|
|
168
168
|
|
|
169
169
|
```bash
|
|
170
170
|
npm run publish:hardware-search-index -- \
|
|
@@ -184,16 +184,16 @@ npm run publish:hardware-search-index -- \
|
|
|
184
184
|
|
|
185
185
|
如果旧上传器只上传了 Wiki Markdown、云端尚无 `_manifest.json`,首次加 `--bootstrap-manifest`;发布器会先逐个验证全部远端 Wiki 后才创建 Manifest。后续正常发布不再需要该参数。
|
|
186
186
|
|
|
187
|
-
也可分别运行 `npm run verify:hardware-search-index` 和 `npm run smoke:hardware-search`。搜索默认要求索引存在;缺少 `_catalog.json` 会返回 `WIKI_SEARCH_INDEX_MISSING`,不会静默下载整个分类。迁移期可显式设置 `
|
|
187
|
+
也可分别运行 `npm run verify:hardware-search-index` 和 `npm run smoke:hardware-search`。搜索默认要求索引存在;缺少 `_catalog.json` 会返回 `WIKI_SEARCH_INDEX_MISSING`,不会静默下载整个分类。迁移期可显式设置 `OSS_ALLOW_LEGACY_MANIFEST_FALLBACK=true`,但响应会标记 `legacy_manifest_full_scan`,不应作为长期生产配置。格式见 [search-index-format.md](skills/abelien-hardware/references/search-index-format.md),发布操作见 [search-index-release.md](skills/abelien-hardware/references/search-index-release.md)。
|
|
188
188
|
|
|
189
189
|
在本仓库内启动硬件阶段:
|
|
190
190
|
|
|
191
191
|
```bash
|
|
192
|
-
export
|
|
193
|
-
export
|
|
194
|
-
export
|
|
195
|
-
export
|
|
196
|
-
export
|
|
192
|
+
export CAD_STORAGE_REGION='cn-hangzhou'
|
|
193
|
+
export CAD_STORAGE_ENDPOINT='https://oss-cn-hangzhou.aliyuncs.com'
|
|
194
|
+
export CAD_STORAGE_BUCKET='your-bucket'
|
|
195
|
+
export CAD_STORAGE_ACCESS_KEY='...'
|
|
196
|
+
export CAD_STORAGE_SECRET_KEY='...'
|
|
197
197
|
export ABELIEN_HARDWARE_REVISE_URL='https://your-selector.example/revise'
|
|
198
198
|
node skills/abelien-harness/scripts/ab.mjs workflow run user-journey-hardware --input '{"requirements":{"context":{"text":"放在桌面上","source":"user"},"reaction":[{"id":"r-turn","text":"有人靠近时转头看向对方","source":"user"}],"limits":[{"id":"l-net","text":"不能联网","source":"user","strength":"hard"}]}}'
|
|
199
199
|
# 返回 awaiting_agent 后,按请求读取 skills/abelien-hardware/SKILL.md,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: abelien-algorithm
|
|
3
|
-
description:
|
|
3
|
+
description: 为产品 reaction 联网检索并选择有来源的端侧算法、模型、库或成熟云服务。需求明确后即可检索实现资料(与硬件选型并行),硬件登记后补查厂商资料并逐 reaction 绑定到已选型号;不用于硬件选型、代码实现或服务部署。
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility:
|
|
6
6
|
- claude-code
|
|
@@ -12,25 +12,33 @@ metadata:
|
|
|
12
12
|
|
|
13
13
|
# Abelien Algorithm
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
本包分两步完成算法与实现选型(P2-03 算法并行车道,2026-10-14):
|
|
16
|
+
|
|
17
|
+
1. **研究(不依赖硬件)**:需求明确后就为每个 reaction 检索实现资料,与硬件选型同时进行;候选写明资源需求(算力、内存、接口、传感器、联网),不猜硬件型号。
|
|
18
|
+
2. **绑定(硬件登记后)**:读取已登记的 `hardware-selection`(id 与 revision),补查已选型号的厂商资料,每个 reaction 绑定到具体 `component_id` 并复核兼容。硬件尚未 verified 也可以绑定,结果保持待确认。`selected_models[]` 为空或缺少厂商/型号时停止并返回具体缺口,不能根据类别名猜设备。
|
|
19
|
+
|
|
20
|
+
车道在哪个阶段做哪一步由 workspace 的 `workspace.lanes-next` 决定(见[意图路由 §4.1](../../docs/architecture/intent-routing.md))。
|
|
16
21
|
|
|
17
22
|
与同级 [structure](../abelien-structure/SKILL.md) 可在各自依赖满足后分别推进:将摄像头视野、拾音/发声开口、散热、动作范围等有依据的结构要求交回;结构反馈遮挡、空间或运动冲突时重判受影响绑定。换硬件须回 hardware 并重新核对版本。算法选型成功不代表装配或设备行为已经实测通过。
|
|
18
23
|
|
|
19
24
|
## 渐进加载
|
|
20
25
|
|
|
21
26
|
1. 每次研究先读[联网检索与排序规则](references/research-policy.md)。
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
27
|
+
2. 准备提交候选或绑定时再读[算法选型服务契约](references/selection-service-contract.md)。
|
|
28
|
+
3. 研究:`algorithm.research`(`purpose=implementation`,查询带 `reaction_id`)→ 读正文 → `algorithm.candidates` 提交每个 reaction 的候选(格式见 [algorithm-candidates.v1](schemas/algorithm-candidates.v1.json)),保存为 `status=proposed`。
|
|
29
|
+
4. 绑定:`algorithm.research`(`purpose=hardware`,查询带 `component_id`)→ `algorithm.finalize`(`operation=bind`,`research` 格式见 [algorithm-bindings.v1](schemas/algorithm-bindings.v1.json))。来源只写 `research_id` 与 `page_id`,回执由 Harness 从自己存下的正文填写。
|
|
30
|
+
5. 宿主在每个阶段开跑前用只读的 `algorithm.lane-state` 查当前需求有没有已提议的候选、候选有没有绑定到当前硬件,映射成 `workspace.lanes-next` 的 artifacts。
|
|
31
|
+
6. 已有的 `user-journey-algorithm` workflow(先有 verified 硬件再研究)保持可用,供不走车道的宿主使用。
|
|
24
32
|
|
|
25
33
|
## 核心边界
|
|
26
34
|
|
|
27
|
-
-
|
|
35
|
+
- 研究步骤先看宿主给出的库内已适配算法(2026-09-16 决定:库内优先、库外再联网),再按算法/模型官方资料 → Hugging Face → 云服务厂商官方资料检索;绑定步骤先查已选型号的硬件厂商官方资料。搜索结果页、博客和聚合文章只能用于发现线索,不能单独支持最终选择。
|
|
28
36
|
- 必须明确 `edge`、`cloud` 或 `hybrid`。离线、隐私、网络、延迟、费用或数据地域限制属于硬约束,不得为了找到候选而静默改成云端。
|
|
29
37
|
- 端侧候选要核对处理器架构、OS/固件、runtime、算子、RAM、Flash/存储、加速器、输入输出格式及外设接口;没有精确设备实测时,不能承诺真实性能。
|
|
30
38
|
- 交互类需求可以比较本地模型和云端 API,但“模型仓库存在”不等于“已有可调用云服务”,“当前 Agent 能调用模型”也不等于用户设备具备该能力。
|
|
31
39
|
- 发现、兼容复核、集成、部署和实测是五种不同状态。本包只完成前两项并保存版本化选型结果。
|
|
32
40
|
|
|
33
|
-
`algorithm.finalize`
|
|
41
|
+
`algorithm.finalize` 不访问网络;它回读真实硬件基线,并核对来源回执,检查完整 reaction、型号/版本绑定和硬约束覆盖。只有元数据或 Agent 自述“已回读”不会获得 `verified`。回执来自可信宿主注入的证据解析器,或(`operation=bind`)来自 `algorithm.research` 自己读取并按 sha256 存下的正文;检索摘要(`text_source=search_snippet`)只用于发现,永远不算证据。具体字段及回执边界见选型服务契约。旧 `algorithm.select` HTTP 能力为兼容已有部署保留。来源不可回读、候选版本不确定或存在阻塞未知项时,结果保持待确认,不伪造验证。
|
|
34
42
|
|
|
35
43
|
## Prismer source documents
|
|
36
44
|
|
|
@@ -1,9 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abelien-algorithm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "算法域包:需求明确后即可检索实现资料(与硬件选型并行),硬件登记后补厂商资料并逐 reaction 绑定、复核兼容",
|
|
5
|
+
"requires": ["abelien-harness"],
|
|
6
|
+
"resources": ["algorithm-selection", "algorithm-research"],
|
|
6
7
|
"capabilities": {
|
|
8
|
+
"algorithm.research": {
|
|
9
|
+
"description": "执行 Agent 的检索计划并保存证据:purpose=implementation 只凭需求检索实现资料(可与硬件选型并行),purpose=hardware 检索已选型号的厂商资料;Volc 检索(每次最多 5 条)与公开 HTTPS 页面安全直读,正文按 sha256 存证;每条付费检索先存 sent 再发送,重跑复用已完成检索、结果未知时要求对账而不重发;同一请求完成后重复运行直接返回已有结果",
|
|
10
|
+
"adapter": {
|
|
11
|
+
"type": "module",
|
|
12
|
+
"path": "scripts/research.mjs",
|
|
13
|
+
"export": "researchAlgorithms"
|
|
14
|
+
},
|
|
15
|
+
"input": { "from": "input" },
|
|
16
|
+
"resultContract": {
|
|
17
|
+
"nonEmptyStrings": ["id", "status", "schema", "request_digest", "purpose"],
|
|
18
|
+
"arrays": ["reactions", "searches", "pages", "unknowns"],
|
|
19
|
+
"statusValues": ["collected"]
|
|
20
|
+
},
|
|
21
|
+
"produces": "algorithm-research",
|
|
22
|
+
"checkpoint": true,
|
|
23
|
+
"checkpointContract": {
|
|
24
|
+
"nonEmptyStrings": ["id", "status", "schema", "request_digest", "purpose"],
|
|
25
|
+
"arrays": ["reactions", "searches", "pages", "unknowns"],
|
|
26
|
+
"statusValues": ["in_progress", "collected"]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"algorithm.candidates": {
|
|
30
|
+
"description": "核验 Agent 基于 implementation 研究为每个 reaction 提出的候选实现:引用须逐字出现在本次研究存下的正文,候选只能引用为自己 reaction 检索的页面,库内算法须来自研究输入的库清单;每个 reaction 要么有候选、要么写明未解决原因;保存为 status=proposed,不依赖硬件",
|
|
31
|
+
"adapter": {
|
|
32
|
+
"type": "module",
|
|
33
|
+
"path": "scripts/candidates.mjs",
|
|
34
|
+
"export": "proposeAlgorithmCandidates"
|
|
35
|
+
},
|
|
36
|
+
"input": { "from": "input" },
|
|
37
|
+
"resultContract": {
|
|
38
|
+
"nonEmptyStrings": ["id", "status", "schema", "collected_id"],
|
|
39
|
+
"arrays": ["candidates", "unresolved", "unknowns"],
|
|
40
|
+
"statusValues": ["proposed"]
|
|
41
|
+
},
|
|
42
|
+
"produces": "algorithm-research"
|
|
43
|
+
},
|
|
44
|
+
"algorithm.lane-state": {
|
|
45
|
+
"description": "只读:按本草稿已存的资源回答当前需求有没有已提议的候选(落点、reaction、limits 与研究时一致),以及这些候选有没有绑定到给定的硬件选型 id 与 revision;宿主把结果映射成 workspace.lanes-next 的 artifacts",
|
|
46
|
+
"adapter": {
|
|
47
|
+
"type": "module",
|
|
48
|
+
"path": "scripts/lane-state.mjs",
|
|
49
|
+
"export": "algorithmLaneState"
|
|
50
|
+
},
|
|
51
|
+
"input": { "from": "input" },
|
|
52
|
+
"resultContract": {
|
|
53
|
+
"nonEmptyStrings": ["requirements_digest"]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
7
56
|
"algorithm.select": {
|
|
8
57
|
"description": "复核 Agent 联网研究证据,选择端侧、云端或混合实现并形成版本化算法选型",
|
|
9
58
|
"adapter": {
|
|
@@ -29,7 +78,7 @@
|
|
|
29
78
|
"produces": "algorithm-selection"
|
|
30
79
|
},
|
|
31
80
|
"algorithm.finalize": {
|
|
32
|
-
"description": "把 Agent
|
|
81
|
+
"description": "把 Agent 基于硬件型号和官方联网证据做出的算法绑定归一化为版本化选型资源;operation=bind 时候选取自 algorithm.candidates,来源回执从 Harness 自己存下的研究正文解析,硬件基线尚未 verified 时结果固定为 needs_confirmation",
|
|
33
82
|
"adapter": {
|
|
34
83
|
"type": "module",
|
|
35
84
|
"path": "scripts/finalize-selection.mjs",
|
|
@@ -56,7 +105,12 @@
|
|
|
56
105
|
"initial": "researched",
|
|
57
106
|
"states": ["researched", "selected"],
|
|
58
107
|
"transitions": [
|
|
59
|
-
{
|
|
108
|
+
{
|
|
109
|
+
"from": "researched",
|
|
110
|
+
"to": "selected",
|
|
111
|
+
"on": "confirmSelection",
|
|
112
|
+
"guard": { "status": "verified" }
|
|
113
|
+
}
|
|
60
114
|
]
|
|
61
115
|
}
|
|
62
116
|
},
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
# 联网检索与排序规则
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
只在算法研究与绑定步骤中读取。研究对象是用户 reaction 在本产品上的实现,不是泛泛推荐热门模型。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 两个步骤的输入
|
|
6
|
+
|
|
7
|
+
**研究(`algorithm.research` purpose=implementation,与硬件选型并行)**只需要需求:每个 reaction 的触发与反应、落点和 limits。不读取、不猜测硬件型号;候选的资源需求(算力、内存、存储、runtime、联网、接口、传感器)按来源原文记录,原文没写的填 null。离线、隐私、延迟、费用等硬约束从这一步就用来筛选。宿主给出的库内已适配算法优先,库外再联网。
|
|
8
|
+
|
|
9
|
+
**绑定(`algorithm.research` purpose=hardware → `algorithm.finalize` operation=bind)**在硬件登记后进行,按下面的门槛读取硬件资源。硬件尚未 verified 时照常核对,结果保持待确认。
|
|
10
|
+
|
|
11
|
+
## 绑定的输入门槛
|
|
6
12
|
|
|
7
13
|
先通过 `ab resource get <hardwareSelectionId>` 读取完整资源,并逐项确认:
|
|
8
14
|
|
|
9
|
-
- kind 为 `hardware-selection
|
|
15
|
+
- kind 为 `hardware-selection`;body.status 为 `verified`,否则(bind)结果只能是待确认;
|
|
10
16
|
- 资源 revision 与 workflow 输入版本一致;
|
|
11
17
|
- `selected_models[]` 给出稳定 `component_id`,并有足以查找官方资料的厂商和准确型号;
|
|
12
18
|
- reaction 包含输入、期望输出、场景及离线、隐私、延迟、精度、功耗、成本等硬约束。
|
|
@@ -15,6 +21,8 @@
|
|
|
15
21
|
|
|
16
22
|
## 来源顺序
|
|
17
23
|
|
|
24
|
+
研究步骤从第 2 项开始(尚无硬件);绑定步骤先补第 1 项,再引用研究步骤已读的第 2–4 项。
|
|
25
|
+
|
|
18
26
|
1. **硬件厂商官方资料**:产品页、datasheet、SDK/runtime 文档、官方 model zoo、官方示例和兼容矩阵。先确认硬件能够运行什么。
|
|
19
27
|
2. **实现官方资料**:模型或算法维护方的版本化文档、发布记录、模型卡和许可。确认实现本身的 I/O、依赖与限制。
|
|
20
28
|
3. **Hugging Face**:按任务标签、准确硬件/runtime 关键词和 reaction 关键词搜索。记录 repo ID、revision/commit、pipeline tag、framework、license、文件规模和模型卡声明;下载量或点赞只能作为次级排序信息。
|
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
本文件只在向 `algorithm.finalize` 提交联网研究结果时读取。Harness 不实现搜索引擎、Hugging Face 或云厂商客户端;联网由宿主 Agent 使用获准工具完成,本地能力负责检查结果形状并保存稳定引用。旧 `algorithm.select` HTTP 能力只为兼容已有部署保留。
|
|
4
4
|
|
|
5
|
+
## 并行车道:research → candidates → bind(P2-03,2026-10-14)
|
|
6
|
+
|
|
7
|
+
宿主按 `workspace.lanes-next` 的步骤调用以下三项;全部是 `ab capability run`,不需要宿主注入证据解析器。Agent 提交的两份内容各有 schema,宿主可原样用作工具参数定义:[`schemas/algorithm-candidates.v1.json`](../schemas/algorithm-candidates.v1.json)(`algorithm.candidates` 去掉 `research_id`)与 [`schemas/algorithm-bindings.v1.json`](../schemas/algorithm-bindings.v1.json)(bind 的 `research`)。字段与脚本里的常量由测试保证一致。
|
|
8
|
+
|
|
9
|
+
### `algorithm.research`
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{ "purpose": "implementation",
|
|
13
|
+
"requirements": { "context": {}, "reaction": [{ "id": "r1", "text": "…" }], "limits": [] },
|
|
14
|
+
"library": [{ "entry_id": "lib-1", "name": "microWakeWord", "category": "语音 · 唤醒词" }],
|
|
15
|
+
"plan": { "queries": [{ "reaction_id": "r1", "query": "offline wake word model microcontroller", "count": 5 }], "max_pages": 8 } }
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- `purpose=implementation`:只凭 clarify 的需求;每条查询带一个需求里的 `reaction_id`,不带 `component_id`。`library` 是宿主给的库内已适配算法(可省略)。
|
|
19
|
+
- `purpose=hardware`:另给 `hardware_selection_id` 与 `hardware_selection_revision`;每条查询带选型资源里的一个 `component_id`。硬件可以尚未 verified。
|
|
20
|
+
- 产出 `algorithm-research`(schema `abelien.algorithm-research.v1`,`status=collected`):`searches[]`、`pages[]`(`id`、`url`、`final_url`、`reaction_id`/`component_id`、`fetched_at`、`text_blob_ref`、`text_sha256`、`text_source`)和 `unknowns[]`。正文读不到的页面保留检索摘要,`text_source=search_snippet`,只用于发现。
|
|
21
|
+
- 付费检索先存 sent 再发送;同一请求完成后重跑直接返回已有结果;停在 sent 而结果未知的检索以 `ALGORITHM_WEB_RECONCILIATION_REQUIRED` 要求对账,不重发。缺 `WEB_SEARCH_API_KEY` 时以 `ALGORITHM_WEB_CONFIG` 在任何发送前失败。
|
|
22
|
+
|
|
23
|
+
### `algorithm.candidates`
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{ "research_id": "algorithm-research:alg-res-…",
|
|
27
|
+
"candidates": [{ "reaction_id": "r1", "implementation_ref": "microWakeWord", "implementation_version": "v2.1.0",
|
|
28
|
+
"implementation_type": "model", "execution_target": "edge", "library_entry_id": "lib-1", "summary": "本地唤醒词检测",
|
|
29
|
+
"needs": { "compute": "TensorFlow Lite Micro", "memory": "about 30 KB of RAM", "storage": null, "runtime": null, "network": null, "interfaces": ["I2S microphone"], "sensors": [] },
|
|
30
|
+
"quotes": [{ "page_id": "p1", "text": "needs about 30 KB of RAM on ESP32-S3 class chips" }] }],
|
|
31
|
+
"unresolved": [{ "reaction_id": "r2", "reason": "…" }], "unknowns": [] }
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- 只接受 `status=collected`、`purpose=implementation` 的研究。引用规范化空白与全半角后须逐字出现在该页存下的正文(至少 8 字);可以引用本次研究读到的任一页,同一份实现资料常常同时支撑几个 reaction。`library_entry_id` 须来自研究输入的库清单。不是库内算法时至少一条引用。
|
|
35
|
+
- `implementation_ref` 是简短名称(≤80 字,不带网址和说明,说明写 `summary`),绑定与 PRD 原样引用;`implementation_version` 只写来源写明的确定版本,没写填 `null`,latest/main 等浮动值拒绝。
|
|
36
|
+
- 每个 reaction 要么至少一个候选,要么写进 `unresolved` 并说明原因。
|
|
37
|
+
- 一次提交里每个候选、每条 unresolved 的问题合并在同一个 `VALIDATION` 里返回(最多 8 条),Agent 一轮改完。
|
|
38
|
+
- 产出 `status=proposed` 的 `algorithm-research`,带 `collected_id`、`candidates[]`(每项标 `evidence`:`page`/`library`/`search_snippet`)与 `unresolved[]`。
|
|
39
|
+
|
|
40
|
+
### `algorithm.finalize` 的 `operation=bind`
|
|
41
|
+
|
|
42
|
+
在下文 select 请求的字段之外给 `operation: "bind"` 与 `proposed_id`(上一步的 proposed 研究)。差别只有四处:
|
|
43
|
+
|
|
44
|
+
1. `research.candidates` 可省略,默认取 proposed 研究里的候选。
|
|
45
|
+
2. 来源只写 `research_id` 与 `page_id`:Harness 从自己存下的正文填写 `url`、`accessed_at`(该页 `fetched_at`)、`content_sha256` 与 `evidence_ref`(`algorithm-research:<研究 id>#<page_id>`),提交里的这四个字段一律丢弃,再按下文的确定性质量门比对。只认 proposed 研究的原研究,以及同一硬件选型 id 与 revision 的 `purpose=hardware` 研究;检索摘要页不算回执,指不到正文页的来源不带回执、保持未验证。宿主若另行注入 `readEvidence`,核对时以宿主为准。
|
|
46
|
+
3. 每条 binding 的 `implementation_ref` 须是该 reaction 已提议的候选之一,否则记一条阻塞未知。
|
|
47
|
+
4. 硬件基线可以不是 verified:照常核对,并追加一条阻塞未知,结果固定为 `needs_confirmation`。
|
|
48
|
+
|
|
49
|
+
结果另带 `operation: "bind"` 与 `proposed_id`。select 请求的行为不变。
|
|
50
|
+
|
|
51
|
+
### `algorithm.lane-state`(只读)
|
|
52
|
+
|
|
53
|
+
输入 `{ requirements, hardware_selection_id?, hardware_selection_revision? }`,输出 `{ requirements_digest, proposed_id, selection_id, selection_status }`。`proposed_id` 是本工作目录里落点、reaction、limits 与当前需求相同(与 research 同一规范化规则)的最新 proposed 研究;`selection_id` 是绑定到这份候选、且硬件选型 id 与 revision 相同的最新 bind 结果。换硬件后候选仍可用、绑定作废;改了 reaction 或 limits 两者都作废。
|
|
54
|
+
|
|
5
55
|
## 请求
|
|
6
56
|
|
|
7
57
|
本地 module adapter 接收:
|