openfeel 1.5.22 → 1.5.24
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.
- package/dist/commands/dev.d.ts +2 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +78 -0
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/flow.d.ts.map +1 -1
- package/dist/commands/flow.js +42 -3
- package/dist/commands/flow.js.map +1 -1
- package/dist/commands/req.d.ts.map +1 -1
- package/dist/commands/req.js +250 -8
- package/dist/commands/req.js.map +1 -1
- package/dist/commands/stage.d.ts +22 -0
- package/dist/commands/stage.d.ts.map +1 -1
- package/dist/commands/stage.js +77 -5
- package/dist/commands/stage.js.map +1 -1
- package/dist/core/dev-status.d.ts +17 -1
- package/dist/core/dev-status.d.ts.map +1 -1
- package/dist/core/dev-status.js +124 -44
- package/dist/core/dev-status.js.map +1 -1
- package/dist/core/flow-archive/grouping.js +2 -2
- package/dist/core/flow-archive/grouping.js.map +1 -1
- package/dist/core/flow-manager.d.ts +35 -2
- package/dist/core/flow-manager.d.ts.map +1 -1
- package/dist/core/flow-manager.js +131 -28
- package/dist/core/flow-manager.js.map +1 -1
- package/dist/core/i18n-data/en.d.ts.map +1 -1
- package/dist/core/i18n-data/en.js +66 -2
- package/dist/core/i18n-data/en.js.map +1 -1
- package/dist/core/i18n-data/zh-CN.d.ts.map +1 -1
- package/dist/core/i18n-data/zh-CN.js +70 -3
- package/dist/core/i18n-data/zh-CN.js.map +1 -1
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +13 -0
- package/dist/core/init.js.map +1 -1
- package/dist/core/metrics.d.ts +16 -1
- package/dist/core/metrics.d.ts.map +1 -1
- package/dist/core/metrics.js +44 -10
- package/dist/core/metrics.js.map +1 -1
- package/dist/core/repo-hygiene.d.ts +65 -0
- package/dist/core/repo-hygiene.d.ts.map +1 -0
- package/dist/core/repo-hygiene.js +162 -0
- package/dist/core/repo-hygiene.js.map +1 -0
- package/dist/core/req/aggregate.d.ts.map +1 -1
- package/dist/core/req/aggregate.js +8 -1
- package/dist/core/req/aggregate.js.map +1 -1
- package/dist/core/req/requirement-ops.d.ts +36 -0
- package/dist/core/req/requirement-ops.d.ts.map +1 -1
- package/dist/core/req/requirement-ops.js +112 -2
- package/dist/core/req/requirement-ops.js.map +1 -1
- package/dist/core/req/types.d.ts +43 -0
- package/dist/core/req/types.d.ts.map +1 -1
- package/dist/core/session.d.ts +11 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +27 -0
- package/dist/core/session.js.map +1 -1
- package/dist/core/template-loader.js +1 -1
- package/dist/core/templates.d.ts +1 -1
- package/dist/core/templates.d.ts.map +1 -1
- package/dist/core/templates.js +11 -6
- package/dist/core/templates.js.map +1 -1
- package/dist/core/update.js +1 -1
- package/dsh/lib/adapters/dashboard.js +29 -2
- package/dsh/lib/adapters/recovery.js +66 -4
- package/dsh/lib/guard.js +13 -0
- package/dsh/lib/surface/prompt.js +1 -1
- package/dsh/lib/tools/index.js +50 -11
- package/dsh/lib/tools/shared.js +14 -0
- package/dsh/package.json +2 -2
- package/package.json +1 -1
|
@@ -58,15 +58,30 @@ export function readHandoff(projectRoot) {
|
|
|
58
58
|
* }}
|
|
59
59
|
*/
|
|
60
60
|
export function readRecovery(projectRoot) {
|
|
61
|
+
const handoffPath = join(projectRoot, '.openfeel', 'users', username(projectRoot), 'dev_last.md');
|
|
61
62
|
const result = {
|
|
62
63
|
stage: null,
|
|
63
64
|
phase: null,
|
|
64
65
|
requirement: null,
|
|
66
|
+
/** 关联需求列表 + 完成度(v1.5.24 / REQ-048;空阶段为 [] / 0-0) */
|
|
67
|
+
requirements: [],
|
|
68
|
+
requirementProgress: { done: 0, total: 0 },
|
|
65
69
|
lastTransition: null,
|
|
66
70
|
lastError: null,
|
|
67
71
|
resumeCount: 0,
|
|
68
72
|
handoff: readHandoff(projectRoot),
|
|
69
|
-
hasDevLast: existsSync(
|
|
73
|
+
hasDevLast: existsSync(handoffPath),
|
|
74
|
+
// v1.5.23 / REQ-044(六期反馈 #3):交接摘要的**位置**也一并给出。
|
|
75
|
+
// 下游项目曾误以为 `.openfeel/dev/current.md` 是自动交接文件(它不会自动更新);
|
|
76
|
+
// 真正的自动块在 `dev_last.md` 的 `<!-- openfeel:auto:begin/end -->`,手写摘要则在
|
|
77
|
+
// `## 交接摘要` / `## 公共交接区`。给出绝对锚点,避免新会话继续看错文件。
|
|
78
|
+
handoffRef: {
|
|
79
|
+
path: `.openfeel/users/${username(projectRoot)}/dev_last.md`,
|
|
80
|
+
autoBlock: '<!-- openfeel:auto:begin/end -->',
|
|
81
|
+
sections: HANDOFF_HEADINGS,
|
|
82
|
+
},
|
|
83
|
+
/** 同一 op 失败 ≥2 次的提示(v1.5.23 / REQ-044 / 六期反馈 #11);无则 null */
|
|
84
|
+
failureHint: null,
|
|
70
85
|
};
|
|
71
86
|
try {
|
|
72
87
|
const flow = JSON.parse(readFileSync(join(projectRoot, '.openfeel', 'flow.json'), 'utf-8'));
|
|
@@ -75,7 +90,31 @@ export function readRecovery(projectRoot) {
|
|
|
75
90
|
if (active) {
|
|
76
91
|
result.stage = active[0];
|
|
77
92
|
result.phase = active[1]?.phase ?? null;
|
|
78
|
-
|
|
93
|
+
// v1.5.24 / REQ-048:关联需求取全部(`requirements[]` 权威,旧 `requirement_id` 兜底),
|
|
94
|
+
// 并给出完成度——单值输出面此前会少报,读的人容易误判「这个阶段只挂了一个需求」。
|
|
95
|
+
const links = Array.isArray(active[1]?.requirements) ? active[1].requirements : [];
|
|
96
|
+
const ids = [];
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
for (const link of links) {
|
|
99
|
+
const id = typeof link?.id === 'string' ? link.id : '';
|
|
100
|
+
if (id === '' || seen.has(id)) continue;
|
|
101
|
+
seen.add(id);
|
|
102
|
+
ids.push(id);
|
|
103
|
+
}
|
|
104
|
+
if (ids.length === 0) {
|
|
105
|
+
const legacy = typeof active[1]?.requirement_id === 'string' ? active[1].requirement_id : '';
|
|
106
|
+
if (legacy !== '') ids.push(legacy);
|
|
107
|
+
}
|
|
108
|
+
const statusById = new Map();
|
|
109
|
+
for (const req of Array.isArray(flow.requirements) ? flow.requirements : []) {
|
|
110
|
+
if (typeof req?.id === 'string') statusById.set(req.id, typeof req.status === 'string' ? req.status : '');
|
|
111
|
+
}
|
|
112
|
+
result.requirements = ids;
|
|
113
|
+
result.requirementProgress = {
|
|
114
|
+
done: ids.filter((id) => statusById.get(id) === 'done').length,
|
|
115
|
+
total: ids.length,
|
|
116
|
+
};
|
|
117
|
+
result.requirement = ids[0] ?? null;
|
|
79
118
|
}
|
|
80
119
|
const log = Array.isArray(flow.log) ? flow.log : [];
|
|
81
120
|
// v1.5.4:活跃阶段的最近失败 / resume 次数(从 200 条日志派生,不新增存储)
|
|
@@ -91,8 +130,7 @@ export function readRecovery(projectRoot) {
|
|
|
91
130
|
}
|
|
92
131
|
for (let i = log.length - 1; i >= 0; i -= 1) {
|
|
93
132
|
const entry = log[i];
|
|
94
|
-
if (entry?.action === 'advance_stage_phase') {
|
|
95
|
-
const detail = entry.detail ?? {};
|
|
133
|
+
if (entry?.action === 'advance_stage_phase') { const detail = entry.detail ?? {};
|
|
96
134
|
result.lastTransition = {
|
|
97
135
|
action: entry.action,
|
|
98
136
|
time: entry.time ?? '',
|
|
@@ -113,6 +151,30 @@ export function readRecovery(projectRoot) {
|
|
|
113
151
|
to: null,
|
|
114
152
|
};
|
|
115
153
|
}
|
|
154
|
+
// v1.5.23 / REQ-044(六期反馈 #11):同一 op 失败 ≥2 次 → 提示沉淀进 KB。
|
|
155
|
+
// 只依赖已落审计的 attempt_fail_*(reason 自 v1.5.23 起写入)。
|
|
156
|
+
const failures = new Map();
|
|
157
|
+
for (const entry of log) {
|
|
158
|
+
if (entry?.action !== 'attempt_fail_retry' && entry?.action !== 'attempt_fail_exhausted') continue;
|
|
159
|
+
const opId = typeof entry.detail?.opId === 'string' ? entry.detail.opId : null;
|
|
160
|
+
if (opId === null) continue;
|
|
161
|
+
const prev = failures.get(opId) ?? { count: 0, reason: null };
|
|
162
|
+
failures.set(opId, {
|
|
163
|
+
count: prev.count + 1,
|
|
164
|
+
reason: typeof entry.detail?.reason === 'string' ? entry.detail.reason : prev.reason,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
for (const [opId, info] of failures) {
|
|
168
|
+
if (info.count >= 2) {
|
|
169
|
+
result.failureHint = {
|
|
170
|
+
opId,
|
|
171
|
+
count: info.count,
|
|
172
|
+
reason: info.reason,
|
|
173
|
+
hint: '同一操作已失败 ≥2 次:修复后考虑 `feel_kb add category=troubleshooting` 沉淀,避免下一轮重踩。',
|
|
174
|
+
};
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
116
178
|
} catch {
|
|
117
179
|
/* 损坏时降级为 handoff only */
|
|
118
180
|
}
|
package/dsh/lib/guard.js
CHANGED
|
@@ -2297,6 +2297,19 @@ function classifyGitCommand(tokens, start, baseDir) {
|
|
|
2297
2297
|
return { kind: 'whole-tree', detail: `git ${subcommand}` };
|
|
2298
2298
|
case 'rm':
|
|
2299
2299
|
case 'mv':
|
|
2300
|
+
// v1.5.23 / REQ-041(六期反馈 #2):`git rm --cached` **只改索引、不写文件内容**,
|
|
2301
|
+
// 是清理「运行态文件被跟踪」的正规手段(`openfeel dev clean` 背后就是它)。
|
|
2302
|
+
// 旧实现把 `--cached` 当普通 flag 丢掉 → 目标命中受保护名单即拒(shell-protected),
|
|
2303
|
+
// 于是 agent 连自助清理都做不到。
|
|
2304
|
+
// 放行范围收窄到 **`.openfeel/**` 内部路径**:这是唯一真实场景,也挡住了
|
|
2305
|
+
// `git rm --cached -r .`(整仓移出索引 + 下一次 commit = 把仓库删空)。
|
|
2306
|
+
// 非内部路径(或 `.` / 通配)仍按「目标写」判定 → 受保护名单照旧生效。
|
|
2307
|
+
if (subcommand === 'rm' && rest.includes('--cached')) {
|
|
2308
|
+
if (positionals.length === 0) return { kind: 'undecidable', detail: 'git rm --cached' };
|
|
2309
|
+
const allInternal = positionals.every((p) => p.replace(/\\/g, '/').startsWith('.openfeel/'));
|
|
2310
|
+
if (allInternal) return { kind: 'readonly', detail: 'git rm --cached(仅索引,.openfeel/**)' };
|
|
2311
|
+
return { kind: 'targets', targets: positionals };
|
|
2312
|
+
}
|
|
2300
2313
|
return positionals.length > 0
|
|
2301
2314
|
? { kind: 'targets', targets: positionals }
|
|
2302
2315
|
: { kind: 'undecidable', detail: `git ${subcommand}` };
|
|
@@ -225,7 +225,7 @@ Feel(你)只做编排、决策与门禁判断。
|
|
|
225
225
|
## 需求分发
|
|
226
226
|
需求是排期层(\`REQ-NNN\`,7 状态:draft/scheduled/in_progress/done/blocked/cancelled/rejected)。
|
|
227
227
|
接取流程:\`feel_req action=next\` → \`claim\` → \`link\` 到阶段 → 阶段推进驱动聚合 → 全部关联阶段 done 时需求自动收口。
|
|
228
|
-
\`done\`
|
|
228
|
+
\`done\` 门(v1.5.23 更正):**关联阶段须已进入 \`exec_running\` 及之后相位**即可完成(阶段是版本容器,不必先 done);另需 \`review\` + \`verify\` 均 pass。general 需求在零关联阶段时走双完成路径。
|
|
229
229
|
**发布前先检查**:归档前先 \`feel_req action=release-check\`(只读);仍有未完成需求时先 \`feel_req action=rollover\` 顺延,或归档时显式 \`allow_unfinished=true\`(缺省拒绝)。
|
|
230
230
|
|
|
231
231
|
## 收尾
|
package/dsh/lib/tools/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
compileParameters,
|
|
33
33
|
envelopeSchema,
|
|
34
34
|
integer,
|
|
35
|
+
optionalArg,
|
|
35
36
|
presentCall,
|
|
36
37
|
pushFlag,
|
|
37
38
|
pushOption,
|
|
@@ -500,7 +501,6 @@ export function createTools(context) {
|
|
|
500
501
|
priority: stringEnum(['high', 'medium', 'low'], 'review_update 的优先级。'),
|
|
501
502
|
blocking: boolean('review_add/review_update 是否阻塞流水线(缺省视为阻塞)。'),
|
|
502
503
|
auto_fix: string('review_add 的自动修复说明;设置后跳过 scheme_pending 直接推进 exec_running。'),
|
|
503
|
-
result: stringEnum(['pass', 'fail'], '未使用,保留占位。'),
|
|
504
504
|
prune_orphans: boolean('repair 时清理键孤儿。'),
|
|
505
505
|
backup: boolean('repair 前备份为 .bak。'),
|
|
506
506
|
project: string('项目根目录。'),
|
|
@@ -641,7 +641,7 @@ export function createTools(context) {
|
|
|
641
641
|
purge: boolean('remove 时同时删除阶段目录(非 TTY 须配 force)。'),
|
|
642
642
|
result: stringEnum(['pass', 'fail'], 'verify 的验证结论(pass 才满足 done 门)。'),
|
|
643
643
|
kind: stringEnum(['test', 'manual', 'build'], 'verify 的验证种类。'),
|
|
644
|
-
by: string('verify
|
|
644
|
+
by: string('verify 的验证者(可省;缺省 = 项目用户 .info.json user)。'),
|
|
645
645
|
note: string('verify 的结论摘要(进入归档摘要)。'),
|
|
646
646
|
evidence: string('verify 的证据(测试命令 / 报告路径)。'),
|
|
647
647
|
project: string('项目根目录。'),
|
|
@@ -741,13 +741,13 @@ export function createTools(context) {
|
|
|
741
741
|
const argv = ['stage', 'verify', stage];
|
|
742
742
|
pushOption(argv, '--result', requireArg(args, 'result', action));
|
|
743
743
|
pushOption(argv, '--kind', requireArg(args, 'kind', action));
|
|
744
|
-
pushOption(argv, '--by',
|
|
744
|
+
pushOption(argv, '--by', optionalArg(args, 'by'));
|
|
745
745
|
pushOption(argv, '--note', requireArg(args, 'note', action));
|
|
746
746
|
pushOption(argv, '--evidence', args.evidence);
|
|
747
747
|
return envelope(action, async () => {
|
|
748
748
|
const out = await cli.write(argv, opts);
|
|
749
749
|
return {
|
|
750
|
-
data: { stage, result: args.result, kind: args.kind,
|
|
750
|
+
data: { stage, result: args.result, kind: args.kind, bySource: optionalArg(args, 'by') === undefined ? 'cli-default' : 'explicit', output: out.text },
|
|
751
751
|
summary: `阶段 ${stage} 验证已记录(${args.kind} / ${args.result})。`,
|
|
752
752
|
};
|
|
753
753
|
});
|
|
@@ -863,9 +863,9 @@ export function createTools(context) {
|
|
|
863
863
|
const feelReq = {
|
|
864
864
|
name: 'feel_req',
|
|
865
865
|
description:
|
|
866
|
-
'需求分发系统(openfeel req,7 状态)。action=add 创建需求(ID 自动分配,**单调计数器 meta.last_req_seq**:归档移走条目后也不复用 ID);list 过滤列表(include_archived=true 合并已随版本归档的需求);show 详情(已归档需求回退读归档文件);board 看板(7 组固定顺序);next 推荐下一个可接取需求;claim 认领(占用校验、无 TTL);release 释放;set 更新白名单字段;link 关联/解绑阶段;advance 显式推进状态(**done
|
|
866
|
+
'需求分发系统(openfeel req,7 状态)。action=add 创建需求(ID 自动分配,**单调计数器 meta.last_req_seq**:归档移走条目后也不复用 ID);list 过滤列表(include_archived=true 合并已随版本归档的需求);show 详情(已归档需求回退读归档文件);board 看板(7 组固定顺序);next 推荐下一个可接取需求;claim 认领(占用校验、无 TTL);release 释放;set 更新白名单字段;link 关联/解绑阶段;advance 显式推进状态(**done 门:关联阶段须已进入 exec_running 及之后相位即可完成——阶段是版本容器,不必先 done**);split 拆分(子需求直接入 scheduled,父需求仅留 parent_id 溯源);review 记录需求审查;verify 记录需求验证(**v1.5.8 完成必审验:done 门额外要求 review.result=pass 且 verification.result=pass**);release-check 发布门(软,只读):列出该版本 done / 未完成 / 其它需求;rollover 顺延:把未完成需求的 target_version 改到新版本并记录 carried_from。',
|
|
867
867
|
parameters: {
|
|
868
|
-
action: stringEnum(['add', 'list', 'show', 'board', 'next', 'claim', 'release', 'set', 'link', 'advance', 'split', 'review', 'verify', 'release-check', 'rollover'], '操作。', { required: true }),
|
|
868
|
+
action: stringEnum(['add', 'list', 'show', 'board', 'next', 'claim', 'release', 'set', 'link', 'advance', 'split', 'review', 'verify', 'complete', 'waive', 'trivial', 'release-check', 'rollover'], '操作。', { required: true }),
|
|
869
869
|
id: string('需求 ID(如 REQ-001)。show/claim/release/set/advance/split/review/verify/rollover 必需(rollover 与 all 互斥)。'),
|
|
870
870
|
title: string('需求标题(add 必需;set 为改标题)。'),
|
|
871
871
|
target_version: string('预估版本(如 v1.3.0;纯展示/过滤维度,非门禁)。'),
|
|
@@ -885,10 +885,13 @@ export function createTools(context) {
|
|
|
885
885
|
into: stringArray('split 的子需求标题列表(至少一项)。'),
|
|
886
886
|
result: stringEnum(['pass', 'fail'], 'review/verify 的结论(pass 才满足 done 门)。'),
|
|
887
887
|
kind: stringEnum(['test', 'manual', 'build'], 'verify 的验证种类。'),
|
|
888
|
-
by: string('review/verify 的审查者 /
|
|
888
|
+
by: string('review/verify 的审查者 / 验证者(可省;缺省 = 项目用户 .info.json user)。'),
|
|
889
889
|
note: string('review/verify 的结论摘要(进入归档摘要)。'),
|
|
890
890
|
evidence: string('verify 的证据(测试命令 / 报告路径)。'),
|
|
891
891
|
independent: boolean('review 是否独立审查(缺省 false = 自我审查,须显式标注 self-review)。'),
|
|
892
|
+
claim: boolean('add 时立即认领(v1.5.23)。'),
|
|
893
|
+
reason: string('waive / trivial 的原因(标记时必需)。'),
|
|
894
|
+
revoke: boolean('waive / trivial 时撤销标记。'),
|
|
892
895
|
project: string('项目根目录。'),
|
|
893
896
|
},
|
|
894
897
|
output: { schema: envelopeSchema(), render: renderEnvelope },
|
|
@@ -903,6 +906,8 @@ export function createTools(context) {
|
|
|
903
906
|
pushOption(argv, '--target-version', args.target_version);
|
|
904
907
|
pushOption(argv, '--priority', args.priority);
|
|
905
908
|
pushOption(argv, '--workflow-mode', args.workflow_mode);
|
|
909
|
+
pushFlag(argv, '--claim', args.claim);
|
|
910
|
+
pushOption(argv, '--stage', args.stage);
|
|
906
911
|
return envelope(action, async () => {
|
|
907
912
|
const out = await cli.write(argv, opts);
|
|
908
913
|
return { data: { output: out.text }, summary: '需求已创建。' };
|
|
@@ -1030,14 +1035,14 @@ export function createTools(context) {
|
|
|
1030
1035
|
const id = requireArg(args, 'id', action);
|
|
1031
1036
|
const argv = ['req', 'review', id];
|
|
1032
1037
|
pushOption(argv, '--result', requireArg(args, 'result', action));
|
|
1033
|
-
pushOption(argv, '--by',
|
|
1038
|
+
pushOption(argv, '--by', optionalArg(args, 'by'));
|
|
1034
1039
|
pushOption(argv, '--note', requireArg(args, 'note', action));
|
|
1035
1040
|
// 独立 / 自我审查**恒显式标注**(自我审查在归档摘要中必须可见)
|
|
1036
1041
|
argv.push(args.independent === true ? '--independent' : '--self');
|
|
1037
1042
|
return envelope(action, async () => {
|
|
1038
1043
|
const out = await cli.write(argv, opts);
|
|
1039
1044
|
return {
|
|
1040
|
-
data: { id, result: args.result,
|
|
1045
|
+
data: { id, result: args.result, bySource: optionalArg(args, 'by') === undefined ? 'cli-default' : 'explicit', independent: args.independent === true, output: out.text },
|
|
1041
1046
|
summary: `需求 ${id} 审查已记录(${args.result}${args.independent === true ? ',独立' : ',自我审查'})。`,
|
|
1042
1047
|
};
|
|
1043
1048
|
});
|
|
@@ -1047,17 +1052,51 @@ export function createTools(context) {
|
|
|
1047
1052
|
const argv = ['req', 'verify', id];
|
|
1048
1053
|
pushOption(argv, '--result', requireArg(args, 'result', action));
|
|
1049
1054
|
pushOption(argv, '--kind', requireArg(args, 'kind', action));
|
|
1050
|
-
pushOption(argv, '--by',
|
|
1055
|
+
pushOption(argv, '--by', optionalArg(args, 'by'));
|
|
1051
1056
|
pushOption(argv, '--note', requireArg(args, 'note', action));
|
|
1052
1057
|
pushOption(argv, '--evidence', args.evidence);
|
|
1053
1058
|
return envelope(action, async () => {
|
|
1054
1059
|
const out = await cli.write(argv, opts);
|
|
1055
1060
|
return {
|
|
1056
|
-
data: { id, result: args.result, kind: args.kind,
|
|
1061
|
+
data: { id, result: args.result, kind: args.kind, bySource: optionalArg(args, 'by') === undefined ? 'cli-default' : 'explicit', output: out.text },
|
|
1057
1062
|
summary: `需求 ${id} 验证已记录(${args.kind} / ${args.result})。`,
|
|
1058
1063
|
};
|
|
1059
1064
|
});
|
|
1060
1065
|
}
|
|
1066
|
+
case 'complete': {
|
|
1067
|
+
// v1.5.23 / REQ-043:一次收口(review + verify + done)
|
|
1068
|
+
const id = requireArg(args, 'id', action);
|
|
1069
|
+
const argv = ['req', 'complete', id];
|
|
1070
|
+
pushOption(argv, '--result', requireArg(args, 'result', action));
|
|
1071
|
+
pushOption(argv, '--kind', optionalArg(args, 'kind'));
|
|
1072
|
+
pushOption(argv, '--note', requireArg(args, 'note', action));
|
|
1073
|
+
pushOption(argv, '--by', optionalArg(args, 'by'));
|
|
1074
|
+
pushOption(argv, '--evidence', args.evidence);
|
|
1075
|
+
argv.push(args.independent === true ? '--independent' : '--self');
|
|
1076
|
+
return envelope(action, async () => {
|
|
1077
|
+
const out = await cli.write(argv, opts);
|
|
1078
|
+
return {
|
|
1079
|
+
data: { id, result: args.result, kind: args.kind ?? 'manual', output: out.text },
|
|
1080
|
+
summary: `需求 ${id} 已收口(${args.result})。`,
|
|
1081
|
+
};
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
case 'waive':
|
|
1085
|
+
case 'trivial': {
|
|
1086
|
+
// v1.5.23 / REQ-043:豁免 / 免审验标记(--revoke 撤销)
|
|
1087
|
+
const id = requireArg(args, 'id', action);
|
|
1088
|
+
const argv = ['req', args.action, id];
|
|
1089
|
+
pushOption(argv, '--reason', optionalArg(args, 'reason'));
|
|
1090
|
+
pushOption(argv, '--by', optionalArg(args, 'by'));
|
|
1091
|
+
pushFlag(argv, '--revoke', args.revoke);
|
|
1092
|
+
return envelope(action, async () => {
|
|
1093
|
+
const out = await cli.write(argv, opts);
|
|
1094
|
+
return {
|
|
1095
|
+
data: { id, revoked: args.revoke === true, output: out.text },
|
|
1096
|
+
summary: args.revoke === true ? `需求 ${id} 的标记已撤销。` : `需求 ${id} 已标记 ${args.action}。`,
|
|
1097
|
+
};
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1061
1100
|
case 'release-check': {
|
|
1062
1101
|
const version = requireArg(args, 'version', action);
|
|
1063
1102
|
return envelope(action, async () => {
|
package/dsh/lib/tools/shared.js
CHANGED
|
@@ -290,6 +290,20 @@ export function requireArg(args, name, action) {
|
|
|
290
290
|
return value.trim();
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
+
/**
|
|
294
|
+
* 取可选的字符串参数(缺省 / 空串 → undefined,由 CLI 侧兜底)。
|
|
295
|
+
*
|
|
296
|
+
* v1.5.23 / REQ-042(六期反馈 #12):`--by` 不再强制模型手填——
|
|
297
|
+
* CLI 会用会话标识兜底(`session:xxxxxxxx`),模型不给也不会写空。
|
|
298
|
+
* @param {Record<string, unknown>} args
|
|
299
|
+
* @param {string} name
|
|
300
|
+
* @returns {string | undefined}
|
|
301
|
+
*/
|
|
302
|
+
export function optionalArg(args, name) {
|
|
303
|
+
const value = args[name];
|
|
304
|
+
return typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined;
|
|
305
|
+
}
|
|
306
|
+
|
|
293
307
|
/**
|
|
294
308
|
* 追加一个可选参数到 argv(存在时才追加)。
|
|
295
309
|
* @param {string[]} argv
|
package/dsh/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openfeel-dsh",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.24",
|
|
4
4
|
"description": "将 OpenFeel 的工作记录与开发流程接入 DeepSeek Harness:记住项目做到哪、下一步做什么,默认自由模式,也可切到按步骤走的流程模式",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"openfeel": {
|
|
38
38
|
"adapter": "dsh",
|
|
39
|
-
"requiresCli": ">=1.5.
|
|
39
|
+
"requiresCli": ">=1.5.24"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"openfeel",
|