sillyspec 3.26.10 → 3.26.13

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.
Files changed (101) hide show
  1. package/.claude/skills/sillyspec-archive/SKILL.md +85 -85
  2. package/.claude/skills/sillyspec-brainstorm/SKILL.md +114 -114
  3. package/.claude/skills/sillyspec-commit/SKILL.md +109 -109
  4. package/.claude/skills/sillyspec-continue/SKILL.md +45 -45
  5. package/.claude/skills/sillyspec-doctor/SKILL.md +76 -76
  6. package/.claude/skills/sillyspec-execute/SKILL.md +200 -200
  7. package/.claude/skills/sillyspec-explore/SKILL.md +95 -95
  8. package/.claude/skills/sillyspec-knowledge/SKILL.md +269 -269
  9. package/.claude/skills/sillyspec-plan/SKILL.md +148 -148
  10. package/.claude/skills/sillyspec-quick/SKILL.md +115 -111
  11. package/.claude/skills/sillyspec-resume/SKILL.md +68 -68
  12. package/.claude/skills/sillyspec-scan/SKILL.md +79 -79
  13. package/.claude/skills/sillyspec-state/SKILL.md +64 -64
  14. package/.claude/skills/sillyspec-status/SKILL.md +54 -54
  15. package/.claude/skills/sillyspec-verify/SKILL.md +83 -83
  16. package/.claude/skills/sillyspec-workspace/SKILL.md +169 -169
  17. package/.gitattributes +2 -0
  18. package/.husky/pre-push +20 -20
  19. package/README.md +203 -201
  20. package/SKILL.md +91 -90
  21. package/package.json +39 -39
  22. package/packages/dashboard/dist/assets/index-Bq_Z2hne.js +7446 -7446
  23. package/packages/dashboard/dist/assets/index-O2W5RV4z.css +1 -1
  24. package/packages/dashboard/dist/index.html +16 -16
  25. package/packages/dashboard/package.json +25 -25
  26. package/packages/dashboard/server/executor.js +95 -86
  27. package/packages/dashboard/server/index.js +663 -601
  28. package/packages/dashboard/server/parser.js +526 -526
  29. package/src/change-risk-profile.js +254 -254
  30. package/src/classify-change.js +109 -109
  31. package/src/config-schema.js +313 -310
  32. package/src/contract-matrix.js +388 -379
  33. package/src/db.js +370 -350
  34. package/src/dispatch/backends/local-agent.js +155 -155
  35. package/src/dispatch/backends/sillyhub-mcp.js +245 -245
  36. package/src/dispatch/probe.js +246 -210
  37. package/src/dispatch/strategy.js +121 -121
  38. package/src/docs-check.js +188 -16
  39. package/src/docs-debt.js +6 -2
  40. package/src/docs-gate.js +1 -0
  41. package/src/doctor-diagnostics.js +898 -711
  42. package/src/endpoint-extractor.js +401 -401
  43. package/src/fs-atomic.js +71 -69
  44. package/src/git-helper.js +82 -79
  45. package/src/hooks/claude-pre-tool-use.cjs +125 -125
  46. package/src/hooks/worktree-guard.js +854 -848
  47. package/src/index.js +251 -20
  48. package/src/init.js +624 -623
  49. package/src/knowledge-match.js +130 -130
  50. package/src/local-detect.js +128 -120
  51. package/src/machine-interface.js +543 -543
  52. package/src/migrate.js +127 -127
  53. package/src/modules.js +7 -5
  54. package/src/progress/change-registry.js +297 -260
  55. package/src/progress/consistency-doctor.js +355 -355
  56. package/src/progress/shared.js +36 -36
  57. package/src/progress/stage-machine.js +589 -550
  58. package/src/progress/step-store.js +261 -261
  59. package/src/progress.js +1285 -1127
  60. package/src/quicklog.js +724 -693
  61. package/src/review-tier.js +77 -77
  62. package/src/run/command.js +1408 -1364
  63. package/src/run/complete-handlers.js +1450 -1399
  64. package/src/run/complete.js +1181 -920
  65. package/src/run/gates.js +878 -755
  66. package/src/run/prompt.js +765 -761
  67. package/src/run/quick-audit.js +155 -146
  68. package/src/run/shared.js +1348 -1215
  69. package/src/run/stage.js +527 -479
  70. package/src/scan-postcheck.js +371 -371
  71. package/src/setup.js +414 -416
  72. package/src/sillyhub-mcp/client.js +597 -529
  73. package/src/spec-dir-typo.js +3 -24
  74. package/src/spec-sync.js +358 -319
  75. package/src/stage-contract.js +871 -897
  76. package/src/stage-review.js +549 -549
  77. package/src/stages/archive.js +156 -155
  78. package/src/stages/brainstorm-auto.js +236 -236
  79. package/src/stages/brainstorm.js +597 -597
  80. package/src/stages/cmd-existence.js +145 -145
  81. package/src/stages/doctor.js +386 -371
  82. package/src/stages/execute.js +1014 -1003
  83. package/src/stages/explore.js +34 -34
  84. package/src/stages/index.js +29 -29
  85. package/src/stages/knowledge.js +498 -498
  86. package/src/stages/plan-postcheck.js +1323 -1302
  87. package/src/stages/plan.js +642 -623
  88. package/src/stages/quick.js +153 -151
  89. package/src/stages/scan.js +607 -607
  90. package/src/stages/status.js +64 -64
  91. package/src/stages/verify.js +264 -264
  92. package/src/sync.js +1325 -1135
  93. package/src/task-review.js +1204 -1019
  94. package/src/taskcard.js +178 -0
  95. package/src/verify-postcheck.js +1199 -1186
  96. package/src/workflow.js +600 -600
  97. package/src/worktree-apply.js +1237 -1136
  98. package/src/worktree-deps.js +453 -353
  99. package/src/worktree.js +1527 -1481
  100. package/templates/workflows/archive-impact.yaml +79 -79
  101. package/templates/workflows/scan-docs.yaml +132 -132
@@ -1,77 +1,77 @@
1
- /**
2
- * SillySpec Review Tier — 审查分级
3
- *
4
- * 决定某阶段的"审查/自检"由「当前 agent 自审」还是「独立审查子代理」执行。
5
- *
6
- * 为什么需要分级:
7
- * scanProfile(决定 maxAgentCalls / 是否禁子代理)只在 scan 阶段生效(run.js:810
8
- * 门控 stageName==='scan');change-risk-profile 的 P0/P1/P2 只管 apply 阻塞与
9
- * verify 证据。两者都不约束 brainstorm/plan/execute/propose 的审查方式。
10
- * 故新选「plan_level / 变更文件数」作为审查分级维度。
11
- *
12
- * 分级结果:
13
- * - tier=self → 当前 agent 自审,CLI 放行(不要求 review.json)
14
- * - tier=independent → 强制独立审查子代理 + review.json,CLI 硬校验
15
- *
16
- * CLI 侧(run.js done gate)与 prompt 注入侧用同一个函数,保证两边判定一致。
17
- * 判定权归 agent 的 plan_level 自主判断(CLI 只做确定性映射,见 classifyReviewTier 注释);
18
- * 无 plan_level 的阶段才退文件数启发式。
19
- */
20
-
21
- import { parseFileChangeList } from './change-list.js'
22
-
23
- /**
24
- * 审查分级阈值:变更文件数 ≤ 此值 → tier=self。
25
- * 依据:≤3 文件的变更通常是单点修复/文案调整,独立审查子代理的仪式成本 > 收益。
26
- */
27
- export const SELF_REVIEW_FILE_THRESHOLD = 3
28
-
29
- /**
30
- * 审查分级
31
- *
32
- * 判定权归 agent 的 plan_level 判定(2026-08-14 tier-plan-level 改造):plan_level 是 agent
33
- * 在 plan step1 按 prompt 分级规则做的自主判断,tier 直接映射它——CLI 不再用文件数启发式
34
- * 推翻 agent 判定(此前 light + 4 文件会被文件数强制 independent,两套标准打架且不透明,
35
- * 实证:agent 判 light 自审通过,完成时 CLI 按 7 文件强制 independent review.json)。
36
- *
37
- * 判定顺序(短路):
38
- * 1. plan_level === 'none' → self(极小变更)
39
- * 2. plan_level === 'light' → self(agent 自主判定轻量,自审)
40
- * 3. plan_level === 'full' → independent(full 语义即大变更需独立审查,CLI 确定性强制)
41
- * 4. 无 plan_level(brainstorm 等阶段 plan.md 未生成)→ 退文件数启发式:
42
- * design.md 变更文件数 ≤ SELF_REVIEW_FILE_THRESHOLD → self,否则 independent
43
- *
44
- * fail-safe:无 plan_level 且 designPath 传了但解析不到文件清单(fileCount=0)按字面 0
45
- * 处理(真无文件变更 = 极小);designPath 完全没传(fileCount=null,无法证明规模)→
46
- * independent(宁严勿松)。
47
- *
48
- * @param {object} [opts]
49
- * @param {string} [opts.planLevel] - plan_level 分类结果(none/light/full)。brainstorm/propose 在 plan 之前,可能拿不到。
50
- * @param {string} [opts.designPath] - design.md 绝对路径,用于算变更文件数
51
- * @returns {{ tier: 'self'|'independent', reason: string, fileCount: number|null }}
52
- */
53
- export function classifyReviewTier({ planLevel, designPath } = {}) {
54
- if (planLevel === 'none') {
55
- return { tier: 'self', reason: 'plan_level=none(极小变更,agent 自主判定自审)', fileCount: null }
56
- }
57
- if (planLevel === 'light') {
58
- return { tier: 'self', reason: 'plan_level=light(agent 自主判定轻量变更,自审)', fileCount: null }
59
- }
60
- if (planLevel === 'full') {
61
- return { tier: 'independent', reason: 'plan_level=full(agent 自主判定大变更,独立审查防确认偏差)', fileCount: null }
62
- }
63
-
64
- let fileCount = null
65
- if (designPath) {
66
- fileCount = parseFileChangeList(designPath).size
67
- }
68
-
69
- if (fileCount !== null && fileCount <= SELF_REVIEW_FILE_THRESHOLD) {
70
- return { tier: 'self', reason: `无 plan_level,变更文件 ${fileCount} ≤ ${SELF_REVIEW_FILE_THRESHOLD}(启发式)`, fileCount }
71
- }
72
-
73
- const reason = fileCount === null
74
- ? '无法解析 design.md 变更文件清单,按正常规模处理(fail-safe)'
75
- : `无 plan_level,变更文件 ${fileCount} > ${SELF_REVIEW_FILE_THRESHOLD}(启发式)`
76
- return { tier: 'independent', reason, fileCount }
77
- }
1
+ /**
2
+ * SillySpec Review Tier — 审查分级
3
+ *
4
+ * 决定某阶段的"审查/自检"由「当前 agent 自审」还是「独立审查子代理」执行。
5
+ *
6
+ * 为什么需要分级:
7
+ * scanProfile(决定 maxAgentCalls / 是否禁子代理)只在 scan 阶段生效(run.js:810
8
+ * 门控 stageName==='scan');change-risk-profile 的 P0/P1/P2 只管 apply 阻塞与
9
+ * verify 证据。两者都不约束 brainstorm/plan/execute/propose 的审查方式。
10
+ * 故新选「plan_level / 变更文件数」作为审查分级维度。
11
+ *
12
+ * 分级结果:
13
+ * - tier=self → 当前 agent 自审,CLI 放行(不要求 review.json)
14
+ * - tier=independent → 强制独立审查子代理 + review.json,CLI 硬校验
15
+ *
16
+ * CLI 侧(run.js done gate)与 prompt 注入侧用同一个函数,保证两边判定一致。
17
+ * 判定权归 agent 的 plan_level 自主判断(CLI 只做确定性映射,见 classifyReviewTier 注释);
18
+ * 无 plan_level 的阶段才退文件数启发式。
19
+ */
20
+
21
+ import { parseFileChangeList } from './change-list.js'
22
+
23
+ /**
24
+ * 审查分级阈值:变更文件数 ≤ 此值 → tier=self。
25
+ * 依据:≤3 文件的变更通常是单点修复/文案调整,独立审查子代理的仪式成本 > 收益。
26
+ */
27
+ export const SELF_REVIEW_FILE_THRESHOLD = 3
28
+
29
+ /**
30
+ * 审查分级
31
+ *
32
+ * 判定权归 agent 的 plan_level 判定(2026-08-14 tier-plan-level 改造):plan_level 是 agent
33
+ * 在 plan step1 按 prompt 分级规则做的自主判断,tier 直接映射它——CLI 不再用文件数启发式
34
+ * 推翻 agent 判定(此前 light + 4 文件会被文件数强制 independent,两套标准打架且不透明,
35
+ * 实证:agent 判 light 自审通过,完成时 CLI 按 7 文件强制 independent review.json)。
36
+ *
37
+ * 判定顺序(短路):
38
+ * 1. plan_level === 'none' → self(极小变更)
39
+ * 2. plan_level === 'light' → self(agent 自主判定轻量,自审)
40
+ * 3. plan_level === 'full' → independent(full 语义即大变更需独立审查,CLI 确定性强制)
41
+ * 4. 无 plan_level(brainstorm 等阶段 plan.md 未生成)→ 退文件数启发式:
42
+ * design.md 变更文件数 ≤ SELF_REVIEW_FILE_THRESHOLD → self,否则 independent
43
+ *
44
+ * fail-safe:无 plan_level 且 designPath 传了但解析不到文件清单(fileCount=0)按字面 0
45
+ * 处理(真无文件变更 = 极小);designPath 完全没传(fileCount=null,无法证明规模)→
46
+ * independent(宁严勿松)。
47
+ *
48
+ * @param {object} [opts]
49
+ * @param {string} [opts.planLevel] - plan_level 分类结果(none/light/full)。brainstorm/propose 在 plan 之前,可能拿不到。
50
+ * @param {string} [opts.designPath] - design.md 绝对路径,用于算变更文件数
51
+ * @returns {{ tier: 'self'|'independent', reason: string, fileCount: number|null }}
52
+ */
53
+ export function classifyReviewTier({ planLevel, designPath } = {}) {
54
+ if (planLevel === 'none') {
55
+ return { tier: 'self', reason: 'plan_level=none(极小变更,agent 自主判定自审)', fileCount: null }
56
+ }
57
+ if (planLevel === 'light') {
58
+ return { tier: 'self', reason: 'plan_level=light(agent 自主判定轻量变更,自审)', fileCount: null }
59
+ }
60
+ if (planLevel === 'full') {
61
+ return { tier: 'independent', reason: 'plan_level=full(agent 自主判定大变更,独立审查防确认偏差)', fileCount: null }
62
+ }
63
+
64
+ let fileCount = null
65
+ if (designPath) {
66
+ fileCount = parseFileChangeList(designPath).size
67
+ }
68
+
69
+ if (fileCount !== null && fileCount <= SELF_REVIEW_FILE_THRESHOLD) {
70
+ return { tier: 'self', reason: `无 plan_level,变更文件 ${fileCount} ≤ ${SELF_REVIEW_FILE_THRESHOLD}(启发式)`, fileCount }
71
+ }
72
+
73
+ const reason = fileCount === null
74
+ ? '无法解析 design.md 变更文件清单,按正常规模处理(fail-safe)'
75
+ : `无 plan_level,变更文件 ${fileCount} > ${SELF_REVIEW_FILE_THRESHOLD}(启发式)`
76
+ return { tier: 'independent', reason, fileCount }
77
+ }