@ifrankwang/openspec-agents 0.128.0 → 0.131.0
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/.mcp-server/cli.mjs +583 -155
- package/README.md +1 -1
- package/assets/agents/openspec-developer.md +1 -1
- package/assets/agents/openspec-reviewer.md +2 -1
- package/assets/workflows/task-simple.yaml +11 -10
- package/assets/workflows/task.yaml +1 -1
- package/dsh/cordis.patch.yml +3 -2
- package/package.json +1 -1
- package/src/core/git.ts +90 -1
- package/src/core/tools/gate.ts +5 -0
- package/src/core/tools/lifecycle.ts +63 -22
- package/src/core/tools/schemas.ts +5 -1
- package/src/core/tools/submit.ts +26 -8
- package/src/core/views.ts +21 -0
- package/src/core/workflow/status.ts +41 -13
|
@@ -12,7 +12,7 @@ import { resolveChildIssueFields } from "./reset.ts"
|
|
|
12
12
|
import { taskListOf, issueChildrenOf } from "../task-children.ts"
|
|
13
13
|
import {
|
|
14
14
|
renderSkillSuggestions, renderEfficiencySteps, renderWorktreeSection,
|
|
15
|
-
renderAgentSummaries, renderTaskItem, formatFilePath, formatSeverity,
|
|
15
|
+
renderAgentSummaries, renderDevSelfCheckDeclaration, renderTaskItem, formatFilePath, formatSeverity,
|
|
16
16
|
isWorktreeReady, renderWorktreeNotReady, interpolateText, renderStateMismatchDiagnostic,
|
|
17
17
|
} from "../views.ts"
|
|
18
18
|
import { resolveMustDoForCaps, SKIP_REASON_FORMAT } from "../tools/gate.ts"
|
|
@@ -547,13 +547,25 @@ function renderAgentWorking(
|
|
|
547
547
|
}
|
|
548
548
|
lines.push(...renderStepSemantics(step, common, stepCtx))
|
|
549
549
|
lines.push(...renderWorktreeSection(state, tg, { showNamespace: true, showPort: true }))
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
//
|
|
554
|
-
//
|
|
550
|
+
// 证据区块注入:展示检查点增量口径的本次变更证据(文件清单 + 区间 diff 命令),与 Worktree 区块
|
|
551
|
+
// 「变更范围」(baseRef..HEAD 整个 change 累计口径)区分,供审查者审查变更内容后按操作指引裁量是否可免
|
|
552
|
+
// 全量工具检查(裁量语义由 workflow 配置单源承载,此处仅渲染事实证据)。
|
|
553
|
+
// - verify_tool(full 分支③有变更 → 全量路径):仅 reviewer-tool + 已预计算变更检测结果
|
|
554
|
+
// (hasNonDocChange=true)时渲染;分支①②提前返回、toolChanges 缺省路径不经过此处,不误伤其他 agent/step。
|
|
555
|
+
// - quality_review(simple 合并审查):toolChanges 已预计算即渲染,不判 hasNonDocChange——simple 无
|
|
556
|
+
// 三分支替换式视图,无变更时也渲染区块(文件清单处显式「未检出」),给「无变更直提」分流显式视觉信号。
|
|
555
557
|
if (step?.id === "verify_tool" && agentToReviewLayer(ctxAgent) === "tool" && toolChanges?.hasNonDocChange) {
|
|
556
|
-
lines.push(...renderToolChangesEvidence(item, tg, toolChanges))
|
|
558
|
+
lines.push(...renderToolChangesEvidence(item, tg, toolChanges, "tool_review"))
|
|
559
|
+
}
|
|
560
|
+
if (step?.id === "quality_review" && toolChanges) {
|
|
561
|
+
lines.push(...renderToolChangesEvidence(item, tg, toolChanges, "merged_review"))
|
|
562
|
+
}
|
|
563
|
+
// simple 合并审查(quality_review)证据注入:渲染提交参数存档的自检申报(self_check_results /
|
|
564
|
+
// test_results),作为分级复验的事实输入——低成本实跑对照、高成本项核验申报+抽样重放均以该申报为
|
|
565
|
+
// 证据源。仅 quality_review step 渲染(消费方是 reviewer);implement 视图与其余 step 视图不受影响
|
|
566
|
+
//(dev 自己刚产出该申报,无需回显)。
|
|
567
|
+
if (step?.id === "quality_review") {
|
|
568
|
+
lines.push(...renderDevSelfCheckDeclaration(item.metadata))
|
|
557
569
|
}
|
|
558
570
|
lines.push(...renderAgentSummaries(readAgentSummaries(item), ctxAgent))
|
|
559
571
|
lines.push(...renderStepContext(item, step, ctxAgent, state, exemptionCtx))
|
|
@@ -799,26 +811,42 @@ function renderToolChildren(item: WorkItem, ctxAgent: string, exemptionCtx?: Exe
|
|
|
799
811
|
return lines
|
|
800
812
|
}
|
|
801
813
|
|
|
802
|
-
/** verify_tool
|
|
803
|
-
*
|
|
814
|
+
/** 变更证据区块的检查点口径措辞:tool_review=verify_tool(full,「工具检查」)、
|
|
815
|
+
* merged_review=quality_review(simple 合并审查,「合并审查」)。verify_tool 文案保持既有原文。 */
|
|
816
|
+
type ChangesEvidenceKind = "tool_review" | "merged_review"
|
|
817
|
+
|
|
818
|
+
const EVIDENCE_KIND_LABELS: Record<ChangesEvidenceKind, { title: string; lastCheck: string }> = {
|
|
819
|
+
tool_review: { title: "自上次工具检查", lastCheck: "上次工具检查" },
|
|
820
|
+
merged_review: { title: "自上次合并审查", lastCheck: "上次合并审查" },
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/** 证据区块:检查点增量口径的本次变更证据(文件清单 + 区间 diff 命令)。verify_tool 分支③(全量路径)
|
|
824
|
+
* 与 quality_review(simple 合并审查)共用,经 kind 区分口径措辞(「自上次工具检查」/「自上次合并审查」)。
|
|
825
|
+
* 有检查点时标注「本次为自上次审查(checkpoint..HEAD)增量区间」,与 Worktree 区块「变更范围」
|
|
804
826
|
* (baseRef..HEAD 整个 change 累计口径)区分;无检查点(首次进入)时标注基线兜底口径,与变更范围一致;
|
|
805
827
|
* 无检查点亦无基线基准时不渲染 diff 命令(无法界定区间)。仅渲染事实证据,不做变更性质判定——
|
|
806
828
|
* 裁量语义由 workflow 配置操作指引单源承载。 */
|
|
807
|
-
function renderToolChangesEvidence(
|
|
829
|
+
function renderToolChangesEvidence(
|
|
830
|
+
item: WorkItem,
|
|
831
|
+
tg: TaskGroupState,
|
|
832
|
+
toolChanges: DetectChangesResult,
|
|
833
|
+
kind: ChangesEvidenceKind,
|
|
834
|
+
): string[] {
|
|
835
|
+
const label = EVIDENCE_KIND_LABELS[kind]
|
|
808
836
|
const checkpoint =
|
|
809
837
|
typeof item.metadata["_tool_review_checkpoint"] === "string" ? item.metadata["_tool_review_checkpoint"] : undefined
|
|
810
838
|
const baseRef = tg.baseRef ?? undefined
|
|
811
839
|
const rangeRef = checkpoint ?? baseRef
|
|
812
|
-
const lines = [
|
|
840
|
+
const lines = [`## 本次变更证据(${label.title})`, ""]
|
|
813
841
|
if (checkpoint) {
|
|
814
842
|
lines.push(
|
|
815
|
-
`- **口径**:
|
|
843
|
+
`- **口径**: 本次为「${label.title}(${checkpoint}..HEAD)」的增量区间(含已提交与未提交的非 openspec 变更);` +
|
|
816
844
|
`与上方「变更范围」(${baseRef ?? "(无)"}..HEAD 整个 change 累计口径)不同`,
|
|
817
845
|
"",
|
|
818
846
|
)
|
|
819
847
|
} else if (baseRef) {
|
|
820
848
|
lines.push(
|
|
821
|
-
`- **口径**: 本次区间以基线(${baseRef}..HEAD
|
|
849
|
+
`- **口径**: 本次区间以基线(${baseRef}..HEAD)兜底,与上方「变更范围」一致(首次进入,无${label.lastCheck}记录;` +
|
|
822
850
|
"含已提交与未提交的非 openspec 变更)",
|
|
823
851
|
"",
|
|
824
852
|
)
|