@marsken/dsh-studio 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
 
7
7
  | 项 | 值 |
8
8
  | --- | --- |
9
- | dsh-studio | `package.json` `version: 0.1.20` |
9
+ | dsh-studio | `package.json` `version: 0.1.22` |
10
10
  | DeepSeek Harness | `0.2.2-rc.1`(`dsh --version`) |
11
11
  | Node | `v24.22.2`(Linux 目标机);本机 Windows `v24.19.0` |
12
12
  | 目标系统 | Ubuntu 24.04,`dsh web` 监听 `18080`,nginx `:80` 反代并注入 `dsh-auth-*` cookie |
package/docs/publish.md CHANGED
@@ -127,6 +127,8 @@ token 只写进临时 npmrc(放在仓库外或 `tmp/` 且不提交),发完
127
127
  | --- | --- | --- |
128
128
  | `0.1.0` | 2026-11-13 | 首个公开版:看板 / 需求 / 用例回归 / 效能 / 设计评审四期 |
129
129
  | `0.1.1` | 2026-11-13 | 补三张 README 截图(npm 页可看图);默认值与文档去掉公司内网信息 |
130
+ | `0.1.22` | 2026-11-15 | 缺陷严重级按用例优先级(回归升级)+ 角色模板编辑界面 |
131
+ | `0.1.21` | 2026-11-15 | 需求基线可回滚(版本 +1、签字作废、留痕) |
130
132
  | `0.1.20` | 2026-11-15 | 拆卡时提示「有后端但功能点没覆盖后端」 |
131
133
  | `0.1.19` | 2026-11-15 | 需求澄清三问 + 拆卡门禁;修补答保存不上的白名单漏字段 |
132
134
  | `0.1.17` | 2026-11-15 | 截图补到 10 张,且有脚本可重跑 |
package/index.js CHANGED
@@ -29,6 +29,7 @@ export const inject = ['tools', 'systemPrompt']
29
29
 
30
30
  import { ACCESS_ROLE_LABEL, ACCESS_ROLES, ADMIN_ROUTES, ARTIFACT_KINDS, ARTIFACT_STATUS, CASE_HTTP_METHODS, CASE_PRIORITIES, CASE_RESULTS, CASE_TYPE_LABEL, CASE_TYPES, cleanId, CODE_PREFIX, CODING_FILE_CHANGES, CODING_REVIEW_STATUS, codingSummary, COLUMN_STRATEGIES, DEFAULT_ROLES, defaultColumns, defaultConfig, defaultDeployEnvs, defaultTemplates, DEPLOY_ENV_KINDS, FALLBACK_AGENT_MODEL, hashLocalPassword, INTAKE_HTML, ISOLATION_MODES, LEGACY_BLOCKED_STATUS, LEVEL_RANK, LOCAL_DEFAULT_PASSWORD, mergeCoding, mergeConfig, mergeSection, MINE_HTML, nextRequirementCode, nextTaskCode, normalizePatch, normalizeStrategy, publicArtifact, publicCases, publicChecklist, publicComments, PRIORITIES, ROLE_LABELS, canonicalAuthor, RELEASE_STATUSES, RELEASE_STATUS_LABEL, REQ_DOC_KIND_LABEL, REQ_DOC_KINDS, REQ_DOC_STATUS, REQ_REVIEW_LABEL, REQ_REVIEW_STATUS, REQ_STATUS_LABEL, REQ_STATUSES, ROLE_IDS, ROLE_LEVEL, SANDBOX_MODES, sanitizeAcceptanceItem, sanitizeAccess, sanitizeAllowHosts, sanitizeArtifact, sanitizeArtifacts, sanitizeBaseline, sanitizeBots, sanitizeBugSource, sanitizeCase, sanitizeCaseHttp, sanitizeCaseRun, sanitizeCases, sanitizeChangedFile, sanitizeChangedFiles, sanitizeChecklist, sanitizeChecklistItem, sanitizeCoding, sanitizeColumns, sanitizeCommit, sanitizeCommits, sanitizeCosts, sanitizeDeployEnvs, sanitizeEnvs, sanitizeExperts, sanitizeIterations, sanitizeLdap, sanitizeLocalAuth, sanitizeProjects, sanitizeReqDoc, sanitizeReqDocs, sanitizeRelease, sanitizeRequirement, sanitizeRequirementChange, sanitizeRequirementHistory, sanitizeRequirementPoint, sanitizeRequirementPoints, sanitizeRequirementPool, sanitizeRequirementQuestions, sanitizeRequirementReview, sanitizeRequirements, sanitizeServices, sanitizeSla, sanitizeTeams, sanitizeTemplates, sanitizeTesting, sanitizeTestRun, sanitizeTestRuns, sanitizeUsers, sanitizeWorkProjects, seedExperts, SEVERITIES, STATUS_HTML, STATUS_IDS, STATUS_SET, STATUSES, TASK_TYPES, text, verifyLocalPassword, worktreeRoot } from './src/host/domain.js'
31
31
  import { Dispatcher, RUN_LOG, attachRunLog, claimDispatchLock, clearAgentFailure, configureDispatcher, noteAgentFailure, parseMentions, runSummary } from './src/host/dispatcher.js'
32
+ import { bugSeverityFor } from './src/host/bugs.js'
32
33
  import { sanitizeLimits } from './src/host/limits.js'
33
34
  import { attachWebhooks, sanitizeWebhooks } from './src/host/webhooks.js'
34
35
  import { buildDashboard, codingVerifyLine, commentTask, configureExecutor, ensureReqFolder, larkCliReady, invalidateLarkProbe, larkProbeCache, mutateReqDoc, probeEnv, pullFeishuDoc, requirementGate, requirementMatrix, requirementProgress, requirementRollup, runCommand, runSuite, runTaskCases, saveRequirement, syncArtifact, syncRequirementArtifacts, taskExitGate, updateTask, verifyCodingRecord } from './src/host/executor.js'
@@ -1425,9 +1426,9 @@ async function autoBugFromCase(store, task, item, by) {
1425
1426
  const bug = await createTask(store, {
1426
1427
  title: `[用例失败] ${item.title}`,
1427
1428
  type: 'bug',
1428
- severity: 'p2',
1429
+ // 严重级别跟着用例优先级走:p0 → p0,p3 → p3;已完成/待验收的卡上失败算回归,升一级
1430
+ ...bugSeverityFor(item.priority, task.status),
1429
1431
  status: 'dev_ready',
1430
- priority: 'normal',
1431
1432
  requirement: [
1432
1433
  `来源:${task.code === '' ? task.id : task.code}「${task.title}」的测试用例`,
1433
1434
  `用例:${item.title}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marsken/dsh-studio",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "DSH Studio: role-based multi-agent workspace (product / architect / developer / QA) with a live work board, GitLab + Feishu connection settings, all configurable from the web GUI.",
6
6
  "main": "index.js",
@@ -0,0 +1,20 @@
1
+ // 自动建缺陷卡时的严重级别:按失败用例自己的优先级来,别再一律 p2。
2
+ // 纯函数,方便单测;建卡在 index.js 的 autoBugFromCase。
3
+
4
+ export const SEVERITY_ORDER = ['p0', 'p1', 'p2', 'p3']
5
+
6
+ /**
7
+ * @param casePriority 用例优先级(p0-p3,缺省按 p2)
8
+ * @param cardStatus 卡当前所在列;已验收/已完成上失败说明是回归,严重级别升一级
9
+ */
10
+ export function bugSeverityFor(casePriority, cardStatus) {
11
+ const raw = String(casePriority ?? '').trim().toLowerCase()
12
+ let index = SEVERITY_ORDER.indexOf(raw)
13
+ if (index < 0) index = SEVERITY_ORDER.indexOf('p2')
14
+ // 「已完成/待验收的卡跑失败了」比开发中的失败更要紧:往上升一级(p0 封顶)
15
+ const regression = cardStatus === 'done' || cardStatus === 'accept'
16
+ if (regression && index > 0) index -= 1
17
+ const severity = SEVERITY_ORDER[index]
18
+ const priority = severity === 'p0' ? 'urgent' : severity === 'p3' ? 'relaxed' : 'normal'
19
+ return { severity, priority, regression }
20
+ }
@@ -1245,6 +1245,16 @@ export async function syncRequirementArtifacts(store, requirementId) {
1245
1245
  return report
1246
1246
  }
1247
1247
 
1248
+ /** 回滚时给文档版本号 +1:v1.0 → v1.1;已经是 -rN 的就继续 +1。 */
1249
+ function bumpDocVersion(version) {
1250
+ const text = String(version ?? '').trim()
1251
+ const plain = /^v(\d+)\.(\d+)$/.exec(text)
1252
+ if (plain !== null) return 'v' + plain[1] + '.' + (Number(plain[2]) + 1)
1253
+ const rolled = /-r(\d+)$/.exec(text)
1254
+ if (rolled !== null) return text.replace(/-r\d+$/, '-r' + (Number(rolled[1]) + 1))
1255
+ return (text === '' ? 'v1.0' : text) + '-r1'
1256
+ }
1257
+
1248
1258
  /** 需求文档的增删改与「评审通过、冻结为基线」。 */
1249
1259
  export async function mutateReqDoc(store, body) {
1250
1260
  const requirementId = String(body.id ?? '')
@@ -1281,6 +1291,30 @@ export async function mutateReqDoc(store, body) {
1281
1291
  by: String(body.by ?? '人').slice(0, 40),
1282
1292
  })
1283
1293
  if (requirement.status === 'draft') requirement.status = 'active'
1294
+ } else if (action === 'rollback') {
1295
+ // 回到基线正文:版本号 +1、签字作废、留一条历史——回滚是实质变更,不能悄悄改。
1296
+ const baseline = requirement.baseline
1297
+ if (baseline === null || baseline === undefined) throw new Error('这条需求还没有基线,先挑一份文档「设为基线」再回滚')
1298
+ const target = requirement.docs.find(item => item.id === baseline.docId) ?? requirement.docs[0]
1299
+ if (target === undefined) throw new Error('基线对应的文档已经删了,没法回滚')
1300
+ const by = String(body.by ?? '人').trim().slice(0, 40) || '人'
1301
+ const previousVersion = String(target.version ?? '')
1302
+ target.content = baseline.content
1303
+ target.version = bumpDocVersion(target.version)
1304
+ target.status = 'baseline'
1305
+ target.at = Date.now()
1306
+ for (const doc of requirement.docs) if (doc.id !== target.id && doc.status === 'baseline') doc.status = 'draft'
1307
+ requirement.baseline = sanitizeBaseline({ ...baseline, version: target.version, content: target.content, at: Date.now(), by })
1308
+ const hadSignoff = requirement.signoff !== null && requirement.signoff !== undefined
1309
+ requirement.signoff = null
1310
+ requirement.history = [...(requirement.history ?? []), {
1311
+ at: Date.now(),
1312
+ by,
1313
+ field: 'PRD 回滚',
1314
+ from: previousVersion,
1315
+ to: baseline.version,
1316
+ note: hadSignoff ? '回滚到基线,原验收签字作废' : '回滚到基线',
1317
+ }]
1284
1318
  } else if (action === 'clear-baseline') {
1285
1319
  requirement.baseline = null
1286
1320
  for (const doc of requirement.docs) if (doc.status === 'baseline') doc.status = 'review'