fix(wecom-assistant): sidecar 显式声明 installPolicy/updatePolicy / declare install & update policy in sidecar (#116)

## 中文

sidecar 的 `spec` 未声明 `installPolicy` / `updatePolicy`,而 legacy 侧对双缺省派生为
`market` / `market`,导致 `compareMarketCatalogWithLegacy` 判定
`spec.agent.policy` 不一致,**整个 sidecar 被拒**(`sidecarRejected`)并回退
listing-only。

真机取证——客户端市场索引 `cache/market/index.json` 中该条目:

```json
"sidecarRejected": true,
"catalogDiagnostics": [
  {"code": "market.catalog-legacy-mismatch", "field": "governance.availability"},
  {"code": "market.catalog-legacy-mismatch", "field": "spec.agent.policy"}
]
```

本 PR 修掉其中的 `spec.agent.policy`。另一条 `governance.availability`
是**客户端侧的结构性缺陷**,不在本仓库范围:`market-agent-entry.client.schema.json` 等 5 个
market schema 均无 `availability` 字段且 `additionalProperties: false`,因此
pointer 条目的 legacy availability 恒为 `listing-only`,sidecar 声明
`installable` 必然 mismatch。主仓库已另开 PR 修复,客户端发版后本条目即可生效;在此之前旧客户端会降级为
listing-only 展示,不影响可用性。

校验:`validate_catalog_metadata.py` 0 error。

---

## English

The sidecar's `spec` omitted `installPolicy` / `updatePolicy`, while the
legacy side derives `market` / `market` from the double default.
`compareMarketCatalogWithLegacy` therefore flagged `spec.agent.policy`
as inconsistent and **rejected the whole sidecar**, falling back to
listing-only.

Verified against a live client's market index, which showed
`sidecarRejected: true` with diagnostics for both `spec.agent.policy`
and `governance.availability`.

This PR fixes the former. The latter is a **structural gap on the client
side**, outside this repository: none of the five market schemas carry
an `availability` field and all set `additionalProperties: false`, so a
pointer entry's legacy availability is always `listing-only` and any
sidecar declaring `installable` must mismatch. A separate PR in the main
repository addresses that; this entry becomes effective once the client
ships it. Older clients degrade to listing-only, which does not affect
usability.

Validation: 0 errors from `validate_catalog_metadata.py`.
This commit is contained in:
2026-09-04 01:18:03 -04:00
committed by GitHub
parent 2eebcd3d8c
commit 61c82782c4

View File

@@ -103,6 +103,8 @@
"full business coverage",
"reports failures honestly"
]
}
},
"installPolicy": "market",
"updatePolicy": "market"
}
}