Skip to content

feat: upgrade dsh to 0.1.1-rc.2 with credentials migration (issue #38) - #41

Merged
FlashingChen merged 3 commits into
mainfrom
FlashingChen/he-value-for-version-in-users-coderstory-.dsh-.c
Aug 27, 2026
Merged

FlashingChen merged 3 commits into
mainfrom
FlashingChen/he-value-for-version-in-users-coderstory-.dsh-.c

Conversation

@FlashingChen

Copy link
Copy Markdown
Owner

背景

上游 DeepSeek Harness 已升至 0.1.1-rc.2dsh-credentials-local 改为 versioned 格式(version: 1 数字 + refs:)。旧 flat 文件在新版报 unknown top-level key,新版 version: "1" 字符串在旧版报 must be a string,形成两头不兼容(Issue #38)。

本 PR 做什么

  • 升级捆绑运行时scripts/bundle-runtime.mjs DSH_VERSION 0.1.0-rc.6 → 0.1.1-rc.2resources/rt + runtime-manifest.json 已重打,Node v24.10.0 / pnpm 11.22.0 不变
  • 防呆迁移:新增 src/core/credentials-migration.ts(复刻上游 renderFlatLayoutMigration 校验)detectCredentialsFormat / migrateFlat / fixVersionStringIssue / backupAndMigrate(先备份 .bak-* 再校验写入,幂等)
  • 诊断与 IPCdiagnostics 新增 credentialsFormatipc 新增 credentials:status/migrate/open-backup 三通道,main 加来源校验 + 路径穿越校验
  • UI 横幅renderer/index.html 顶部黄色 banner + renderer.ts checkCredentialsMigration/doMigrateCredentials(flat→推荐迁移,unknown→提示手动检查,支持稍后)
  • 单测:新增 tests/credentials-migration.test.mjs 6 用例,106/106 通过

防呆策略(与计划一致)

  • 自带始终最新单 rt 目录,不双版本;检测 flat→推荐横幅+备份+一键迁移,不静默不阻断
  • flat 定义:无 version、无 %|---|... 指令、所有顶层 key 为合法 credentialRef 且值为非空字符串
  • version: "1" 字符串陷阱自动修正为数字 1
  • 失败不丢数据:原子写入+备份,错误透传到 UI + 诊断块

验证

  • Mac:npm run buildtsc --noEmit 0 错 node --test 106/106
  • Win 192.168.0.139npm run buildnode --test 106/106,dsh --profile web --dump-config 504 行正常
  • 冒烟 scripts/smoke-windows.mjs 10 场景:missing/empty/flat→versioned/幂等/"1"字符串/单引号/损坏/多余key/回滚/诊断 10/10
  • resources/nd 已清理至 tracked 9 文件

计划文档

plans/upgrade-dsh-0.1.1-rc.2.md 已更新为“已验证”

Closes #38

…roof banner (issue #38)

- scripts/bundle-runtime.mjs: 0.1.0-rc.6 -> 0.1.1-rc.2
- resources/rt: lock/bump, manifest updated
- add src/core/credentials-migration.ts (flat -> versioned, backups, string version fix)
- diagnostics: add Credentials format field
- IPC + preload + main: credentials status/migrate/openBackup handlers
- renderer: banner + checks, migration flow
- tests: credentials-migration.test.mjs (6 cases)
- plan: plans/upgrade-dsh-0.1.1-rc.2.md
@FlashingChen
FlashingChen merged commit 0e827f7 into main Aug 27, 2026
1 check passed
@FlashingChen
FlashingChen deleted the FlashingChen/he-value-for-version-in-users-coderstory-.dsh-.c branch August 27, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[反馈][匿名][问题] he value for "version" in /Users/coderstory/.dsh/.credentials.yaml must be a string at parseCredentialsDocument

1 participant