diff --git a/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.i18n.yaml b/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.i18n.yaml new file mode 100644 index 0000000000..bc266b2e8c --- /dev/null +++ b/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.i18n.yaml @@ -0,0 +1,16 @@ +# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md +/: + en: 2b61d3edeb5cb9b3 + zh: c8c19ac891de1483 +/automation-tasks-bundle-removed: + en: fb9d856d884313d9 + zh: 6fa0d728f26c5f8e +/automation-tasks-bundle-removed/change: + en: 0a35ea93af06452f + zh: 094dd5f6422bab8d +/automation-tasks-bundle-removed/migration: + en: 04278f963f780cad + zh: f8e49107b3a5df07 diff --git a/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md b/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md new file mode 100644 index 0000000000..d95d2b3b16 --- /dev/null +++ b/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md @@ -0,0 +1,22 @@ +--- +kind: upgrade-guide +description: "The Automation tasks optional bundle is removed; the Web composition mounts Schedule itself." +--- + +# Automation tasks bundle removed + +English | [中文](guide.zh.md) + +## Change + +In v0.2.0-rc.2, switching on Automation tasks in the Plugins page appended `@deepseek-ai/dsh-experimental-schedule-bundle` to `dsh.profile.bundles` in `$DSH_HOME/profiles//package.json`. That bundle inserted the `time-context`, `schedule`, and `ui-schedule` rows. + +The next release removes the bundle. `@deepseek-ai/dsh-web-app` mounts `schedule` and `ui-schedule` in every Web profile, and the `standard`, `cordis`, and `ptc` presets declare the clock reading and the four `schedule_*` tools; `minimal` declares neither ([details](../../../subsystems/schedule.md)). + +Loading a profile removes `@deepseek-ai/dsh-experimental-schedule-bundle` from its `dsh.profile.bundles` and rewrites `package.json`; other manifest fields are kept. Stored tasks and delivery records stay on disk and remain in use. + +## Migration + +1. Start `dsh` once with each affected profile; no manual edit is needed. A profile directory that another tool writes must drop the entry from `dsh.profile.bundles` itself. +2. Keep overrides on `schedule` and `ui-schedule` in `cordis.patch.yml` or a `--patch` overlay; the Web composition carries those rows. A top-level override on `time-context` no longer matches a row, because the clock row belongs to the presets ([time-context](../../../../packages/context/time-context/README.md)); delete it. +3. Confirm: `dsh.profile.bundles` no longer lists the bundle, the Plugins page shows no failed Automation tasks entry, and the sidebar shows Automation tasks with the previously stored reminders. diff --git a/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md b/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md new file mode 100644 index 0000000000..bb6eb314ec --- /dev/null +++ b/docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.zh.md @@ -0,0 +1,22 @@ +--- +kind: upgrade-guide +description: "“自动化任务”可选 bundle 已移除;Web 组合自行挂载 Schedule。" +--- + +# “自动化任务” bundle 已移除 + +[English](guide.md) | 中文 + +## 变更 + +在 v0.2.0-rc.2 中,在插件管理页开启“自动化任务”会把 `@deepseek-ai/dsh-experimental-schedule-bundle` 追加到 `$DSH_HOME/profiles//package.json` 的 `dsh.profile.bundles`。该 bundle 插入 `time-context`、`schedule` 和 `ui-schedule` 三行。 + +下一版本移除该 bundle。`@deepseek-ai/dsh-web-app` 在每个 Web profile 中挂载 `schedule` 和 `ui-schedule`,`standard`、`cordis` 和 `ptc` preset 声明时钟读数和四个 `schedule_*` 工具;`minimal` 两者都不声明([详情](../../../subsystems/schedule.zh.md))。 + +加载 profile 时会从其 `dsh.profile.bundles` 中删除 `@deepseek-ai/dsh-experimental-schedule-bundle` 并重写 `package.json`;其他 manifest 字段保持不变。已存储的任务和投递记录仍保留在磁盘上并继续使用。 + +## 迁移 + +1. 用每个受影响的 profile 启动一次 `dsh`,无需手动编辑。由其他工具写入的 profile 目录需要自行从 `dsh.profile.bundles` 删除该条目。 +2. 保留 `cordis.patch.yml` 或 `--patch` overlay 中针对 `schedule` 和 `ui-schedule` 的覆盖项;Web 组合包含这两行。顶层针对 `time-context` 的覆盖项不再匹配任何行,因为时钟行属于 preset([time-context](../../../../packages/context/time-context/README.zh.md));请删除它。 +3. 确认:`dsh.profile.bundles` 不再列出该 bundle,插件管理页不再显示异常的“自动化任务”条目,且侧栏显示“自动化任务”并列出之前存储的提醒。 diff --git a/packages/boot/app-boot/src/profile.ts b/packages/boot/app-boot/src/profile.ts index da580c762e..bc1fd14804 100644 --- a/packages/boot/app-boot/src/profile.ts +++ b/packages/boot/app-boot/src/profile.ts @@ -199,6 +199,16 @@ const INSTALLATION_OWNED_PROFILE_TUPLES: Record = { headless: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app', '@deepseek-ai/dsh-headless'], } +/** + * Bundles an earlier release shipped and the installation no longer carries; + * loading a profile removes them from its bundle list. + */ +const RETIRED_BUNDLES: ReadonlySet = new Set([ + // The Web composition mounts Schedule itself + // ([upgrade guide](../../../../docs/upgrade-guide/v0.2.0-rc.2/schedule-bundle-retired/guide.md)). + '@deepseek-ai/dsh-experimental-schedule-bundle', +]) + /** The bundle list a `dsh plugin` init uses for a name with no shipped template. */ export const DEFAULT_PROFILE_BUNDLES: readonly string[] = ['@deepseek-ai/dsh-base'] @@ -573,27 +583,28 @@ function sameBundles(left: readonly string[], right: readonly string[]): boolean /** * Normalize an exact installation-owned bundle tuple to its shipped template, - * preserving all other manifest fields. Other bundle lists remain untouched. + * and drop {@link RETIRED_BUNDLES} from any other bundle list, preserving all + * other manifest fields. The manifest is written only when its bundles change. */ -function normalizeShippedProfile(name: string, dir: string, manifest: ProfileManifest): ProfileManifest { +function normalizeProfileManifest(name: string, dir: string, manifest: ProfileManifest): void { + const bundles = manifest.dsh?.profile?.bundles + if (bundles === undefined) return const installationOwned = INSTALLATION_OWNED_PROFILE_TUPLES[name] const template = PROFILE_TEMPLATES[name] - const bundles = manifest.dsh?.profile?.bundles - if (template === undefined || bundles === undefined) return manifest - const isRetiredTuple = installationOwned !== undefined && sameBundles(bundles, installationOwned) - if (!isRetiredTuple) return manifest - const normalized: ProfileManifest = { + const normalized = template !== undefined && installationOwned !== undefined && sameBundles(bundles, installationOwned) + ? template.bundles + : bundles.filter(bundle => !RETIRED_BUNDLES.has(bundle)) + if (sameBundles(normalized, bundles)) return + writeProfileManifest(dir, { ...manifest, dsh: { ...manifest.dsh, profile: { ...manifest.dsh?.profile, - bundles: [...template.bundles], + bundles: [...normalized], }, }, - } - writeProfileManifest(dir, normalized) - return normalized + }) } /** @@ -689,7 +700,8 @@ export function loadProfileDirectory( /** * Load a profile: resolve every `dsh.profile.bundles` entry to its patch - * layer and parse the profile's own patch file. Unreadable or incompatible bundles + * layer and parse the profile's own patch file. The stored bundle list first + * drops retired bundles and a retired installation-owned tuple. Unreadable or incompatible bundles * are skipped and listed in `skippedBundles`; profile manifest and user patch errors still throw. * @param binName - the diagnostic prefix on thrown errors. * @param name - the profile name. @@ -715,7 +727,7 @@ export function loadProfile( initProfile(dir, template.bundles) } removeLinkProjections(dir) - normalizeShippedProfile(name, dir, readProfileManifest(binName, dir)) + normalizeProfileManifest(name, dir, readProfileManifest(binName, dir)) return loadProfileDirectory(binName, dir, installAnchor, options) } diff --git a/packages/boot/app-boot/tests/profile.spec.ts b/packages/boot/app-boot/tests/profile.spec.ts index 2c0aebb8e5..834dc950f0 100644 --- a/packages/boot/app-boot/tests/profile.spec.ts +++ b/packages/boot/app-boot/tests/profile.spec.ts @@ -386,6 +386,23 @@ describe('loadProfile', () => { ]) }) + it('removes a retired bundle from any profile and keeps the rest of the manifest', () => { + const anchor = stageInstallation({ + '@deepseek-ai/dsh-base': { patch: '[]\n' }, + 'custom-bundle': { patch: '[]\n' }, + }) + const home = tmp() + const dir = resolveProfileDir('custom', home) + initProfile(dir, ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-experimental-schedule-bundle', 'custom-bundle']) + writeProfileManifest(dir, { ...readProfileManifest('t', dir), dependencies: { 'custom-bundle': '^1.0.0' } }) + const profile = loadProfile('t', 'custom', anchor, home) + expect(profile.skippedBundles).toEqual([]) + expect(readProfileManifest('t', dir)).toMatchObject({ + dependencies: { 'custom-bundle': '^1.0.0' }, + dsh: { profile: { bundles: ['@deepseek-ai/dsh-base', 'custom-bundle'] } }, + }) + }) + it.each(['missing package', 'invalid manifest', 'not a bundle', 'missing patch', 'invalid patch'])( 'skips a bundle with %s, retains selections, and retries it on reread', async (failure) => { const anchor = stageInstallation({