✨ feat(spx): issue marker 支持第三种类型 prototype
- --type 三选一 spec|plan|prototype,marker 行写 <!-- spx:prototype=路径 -->,
与 spec/plan 共用同一套增量更新逻辑;类型→state 字段的映射收成一张表
- 同步写 state JSON 的 prototypeFile(pattern 要求 dir/.../x.json)
- 顺手补上 b62e58d 漏掉的 prototypeSessionId / prototypeProfilePath:
schema 与 knownStateFields 都没有它们,带原型会话的工单一 merge
就会被 additionalProperties 拒掉
Claude-Session: https://claude.ai/code/session_01Kgmb1LvrPmFX3NoUDB4zZC
This commit is contained in:
1 parent
814e0e8f5a
commit
def5f4e88c
5 files changed
+89
-8
No files matched your search
@@ -71,11 +71,14 @@ func TestValidateAcceptsFullState(t *testing.T) {
|
||||
"implementSessionId":"impl-1",
|
||||
"reviewSessionId":"rev-1",
|
||||
"testSessionId":"test-1",
|
||||
"prototypeSessionId":"proto-1",
|
||||
"profilePath":"/home/x/.claude/settings.json",
|
||||
"brainstormProfilePath":"/home/x/.claude/profiles/brainstorm.json",
|
||||
"testProfilePath":"/home/x/.claude/profiles/test.json",
|
||||
"prototypeProfilePath":"/home/x/.claude/profiles/prototype.json",
|
||||
"specFile":"docs/superpowers/specs/foo.md",
|
||||
"planFile":"docs/superpowers/plans/foo.md",
|
||||
"prototypeFile":"docs/prototype/login/figma-plugin/manifest.json",
|
||||
"prDiffFile":"docs/pr-diff/pr-42-issue-7.md",
|
||||
"pr":"42",
|
||||
"prMerged":true,
|
||||
@@ -91,6 +94,13 @@ func TestValidateAcceptsFullState(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateRejectsBadPrototypeFile(t *testing.T) {
|
||||
err := Validate([]byte(`{"prototypeFile":"docs/prototype/login/figma-plugin/manifest.md"}`))
|
||||
if err == nil {
|
||||
t.Fatal("非 .json 路径应当被 prototypeFile pattern 拒绝")
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateAcceptsBrainstormProfilePathOnly(t *testing.T) {
|
||||
if err := Validate([]byte(`{"brainstormProfilePath":"/home/x/.claude/profiles/brainstorm.json"}`)); err != nil {
|
||||
t.Fatalf("仅含 brainstormProfilePath 应当通过校验,得到: %v", err)
|
||||
|
||||
Reference in new issue
Block a user