♻️ refactor(vscode): 对齐 state schema 与 knownStateFields 漂移

This commit is contained in:
2026-07-16 01:55:35 +08:00
parent b45257a38d
commit a3e557f9ee
5 changed files with 63 additions and 20 deletions
+11 -1
View File
@@ -70,14 +70,18 @@ func TestValidateAcceptsFullState(t *testing.T) {
"sessionId":"abc",
"implementSessionId":"impl-1",
"reviewSessionId":"rev-1",
"testSessionId":"test-1",
"profilePath":"/home/x/.claude/settings.json",
"brainstormProfilePath":"/home/x/.claude/profiles/brainstorm.json",
"testProfilePath":"/home/x/.claude/profiles/test.json",
"specFile":"docs/superpowers/specs/foo.md",
"planFile":"docs/superpowers/plans/foo.md",
"prDiffFile":"docs/pr-diff/pr-42-issue-7.md",
"pr":"42",
"prMerged":true,
"prMergedAt":"2026-07-16T01:00:00Z",
"branch":"feature/abc",
"worktreePath":".worktrees/foo",
"worktreePath":"/home/x/Sources/worktree/proj/slug",
"implementStatus":"done",
"color":"terminal.ansiBlue",
"autoReview":true
@@ -86,3 +90,9 @@ func TestValidateAcceptsFullState(t *testing.T) {
t.Fatalf("完整合法 state 应当通过校验,得到: %v", err)
}
}
func TestValidateAcceptsBrainstormProfilePathOnly(t *testing.T) {
if err := Validate([]byte(`{"brainstormProfilePath":"/home/x/.claude/profiles/brainstorm.json"}`)); err != nil {
t.Fatalf("仅含 brainstormProfilePath 应当通过校验,得到: %v", err)
}
}