docs(schedule-bundle): scope the overlay limitation and pin the overridden row name
The overlay alternative now says only its insert form fails to override a shipped row, since an id-targeted --patch overlay does set one. The composed assertion compares the overridden row's package name with the shipped layer's name instead of asserting a string.
This commit is contained in:
1 parent
1065f0afd1
commit
7b3bc172de
4 files changed
+7
-6
No files matched your search
+2
-2
@@ -12,8 +12,8 @@
|
||||
en: 360867ff77c6b727
|
||||
zh: 4eb4b47439c21d5d
|
||||
/agent-note-schedule-as-an-opt-in-optional-bundle/alternatives-considered:
|
||||
en: cef562365cc8ab3a
|
||||
zh: 2d43ba5839b97474
|
||||
en: 1782c8ecdbe6bf87
|
||||
zh: dd6997d067257562
|
||||
/agent-note-schedule-as-an-opt-in-optional-bundle/consequences:
|
||||
en: 8ea1d9aaf25f1702
|
||||
zh: 32e721347ea55475
|
||||
+1
-1
@@ -22,7 +22,7 @@ Enabling the bundle turns on `time-context` (a per-step clock reading with the s
|
||||
|
||||
**Ship Schedule on by default.** Every Web session then pays four tool schemas in each request header and one durable user message per eligible step, and a conversation that never creates a reminder pays both costs. The arrangement also left the capability without an off switch on the product surface.
|
||||
|
||||
**Keep a `--patch` overlay file.** An overlay is a launch-time argument rather than a product-surface switch, so a person using the shipped Web profile cannot reach it. It also cannot set fields on the shipped rows: `applyEntryPatches` appends an `insert` list without de-duplicating ids, and the Loader keeps one entry per id with the last declaration winning, so an overlay that re-declares `time-context` and `schedule` replaces the Web bundle's rows instead of overriding them.
|
||||
**Keep a `--patch` overlay file.** An overlay is a launch-time argument rather than a product-surface switch, so a person using the shipped Web profile cannot reach it. Re-declaring the rows through its `insert` list does not override them: `applyEntryPatches` appends that list without de-duplicating ids, and the Loader collapses the composed list to one entry per id with the last declaration winning, so the overlay replaces the Web bundle's rows instead of setting fields on them.
|
||||
|
||||
**Extract the three rows out of the Web composition into the bundle.** The bundle would insert the rows instead of overriding them, so a profile that also declares one of those ids would have two declarations for it, of which the Loader keeps only the last. The disabled rows are what an override-style switch targets.
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ Status: implemented
|
||||
|
||||
**默认发布 Schedule。** 那样每个 Web 会话都要在每个请求头中带上四个工具 schema,并在每个符合条件的步骤追加一条持久 user 消息,从不创建提醒的对话也要承担这两项成本。这种安排还让该能力在产品界面上没有关闭开关。
|
||||
|
||||
**保留一个 `--patch` overlay 文件。** overlay 是启动时的参数,而不是产品界面上的开关,因此使用随发行版 `web` profile 的人无法触及它。它也无法给出厂条目设值:`applyEntryPatches` 追加 `insert` 列表时不对 id 去重,而 Loader 每个 id 只保留一个条目、最后一个声明生效,因此重新声明 `time-context` 与 `schedule` 的 overlay 会替换 Web Bundle 的条目,而不是覆盖它们。
|
||||
**保留一个 `--patch` overlay 文件。** overlay 是启动时的参数,而不是产品界面上的开关,因此使用随发行版 `web` profile 的人无法触及它。通过它的 `insert` 列表重新声明这些条目并不能覆盖它们:`applyEntryPatches` 追加该列表时不对 id 去重,而 Loader 会把组合出的列表按 id 收敛为一个条目、最后一个声明生效,因此该 overlay 会替换 Web Bundle 的条目,而不是给它们设值。
|
||||
|
||||
**把这三行从 Web 组合中抽出、移入 bundle。** 这样 bundle 会插入这些行而不是覆盖它们;某个 profile 若也声明了这些 id,同一个 id 就会有两份声明,而 Loader 只保留最后一份。按需开关针对的正是这些禁用行。
|
||||
|
||||
|
||||
@@ -54,12 +54,13 @@ describe('optional bundles', () => {
|
||||
const topLevelIds = composed.flatMap(entry => typeof entry.id === 'string' ? [entry.id] : [])
|
||||
expect(topLevelIds).toHaveLength(new Set(topLevelIds).size)
|
||||
// An id-targeted patch reaches a row another layer inserted: the id resolves to exactly one top-level
|
||||
// row that keeps its declared package name.
|
||||
// row, and the override keeps the package the shipped layer declared on it.
|
||||
const shippedComposed = composeEntries([...shipped])
|
||||
for (const patch of patches) {
|
||||
if (patch.insert !== undefined || typeof patch.id !== 'string') continue
|
||||
const matches = composed.filter(entry => entry.id === patch.id)
|
||||
expect(matches).toHaveLength(1)
|
||||
expect(typeof matches[0]?.name).toBe('string')
|
||||
expect(matches[0]?.name).toBe(shippedComposed.find(entry => entry.id === patch.id)?.name)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user