Commit Graph

1 Commits

Author SHA1 Message Date
aa394e8bef refactor(dingtalk-workspace): 内联条目改为 pointer 形态 / convert inline entry to pointer (#141)
## 背景 / Context

钉钉工作台助手此前以**内联**形态登记(市场目录里直接放 24 个文件的完整正文)。这带来两个实际问题:

1. **同一份内容存在多个副本。** 上一次修正 `ask-external` 的审批模式文案时,同样的错误要在市场目录、Agent
私有目录、市场解压目录**四处**分别修改。
2. **与既有 Agent 形态不一致。** `wecom-assistant` / `feishu-orchestrator` 等都是
pointer 形态。

The DingTalk agent was registered inline (24 files of body content
inside the catalog). This duplicated the same content across several
copies — a single copy fix had to be applied in four places — and
diverged from every other agent, which use the pointer form.

## 改动 / Change

正文迁到
[desirecore-agent/dingtalk-workspace](https://github.com/desirecore-agent/dingtalk-workspace),市场侧只留两个文件:

```
agents/dingtalk-workspace/
├── entry.json                  ← pointer,source.ref 钉死上游 commit
└── catalog-metadata.v1.json    ← sidecar
```

**24 files → 2 files**(25 files changed, 72 insertions, 1781 deletions)

## 为什么必须删掉 agent.json 而非并存

`scripts/catalog/validate_catalog_metadata.py:253-261` 用
`inline_path.is_file() == pointer_path.is_file()`
判定——**两者必须恰好存在一个**,都有或都没有都会报 `fixed-sidecar-path` 并使条目掉出目录。

正文也一并清除,理由是另外两条:安装时会**整树复制**(排除清单只有
`upstream`/`.git`/`node_modules`/`.cache`),留下旧副本会与从上游拉取的正文形成两份可能不同步的内容;且与
`redistribution: source-pointer-only` 的声明自相矛盾。

## 证据六项 / Evidence

| 项 | 值 |
| --- | --- |
| `provenance.content` | https + 40 位 SHA
`9e5a4695b07d9d71921202a7a4072140c2135670` |
| `license` | `state: known` + `value: MIT` + `evidencePath: LICENSE` |
| `compliance` | 五项必填齐备 |
| `compliance.reviewedRef === provenance.content.ref` |  |
| `timestamps.reviewedAt.value === compliance.reviewedAt` |  |
| `governance.availability` | `installable` |

一致性比对的三处按既有约定处理:`entry.tags` 用英文 slug 且与 `presentation.tags` 逐字相同;entry
声明了 `license` 故 sidecar 必须 `known` 且 value 相等;`entry.maintainer` 映射到
sidecar 的 `upstreamMaintainer`。`redistribution` 用
`source-pointer-only`(pointer 不分发内容),非 inline 条目的 `allowed`。

## 上游仓库 / Upstream

内容仓库同步修正了审批模式文案(此前 `ask-external` 被写成「交给外部系统裁决」,实际含义是「内置工具与命令放行,仅
MCP、HTTP、脚本等外部工具需审批」,且漏掉 `allow-all`),现全部逐字引用平台内 i18n 文案。另补
`assets/avatar.webp` 与 `agent.json` 的 `avatar.image.path`,使 pointer
安装后仍有图片头像。

## 校验 / Verification

```
validate_catalog_metadata.py --require-complete   exit=0   0 error(s)
validate-i18n.py                                  exit=0   0 error
agents=5(条目未掉出目录)
```

上游可达性已独立验证:`git ls-remote` 取得 40 位 SHA,`git clone` 成功,27
个文件。**先推上游确认可达、再改市场卡片**,避免出现指向不存在 ref 的孤儿 entry。

Co-authored-by: yi-ge <jackyoncode@gmail.com>
2026-09-06 10:26:02 -04:00