@peterxiaoyang/superspec 0.1.8 → 0.1.9

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/README.md CHANGED
@@ -82,6 +82,8 @@ superspec init --scope project
82
82
 
83
83
  这条命令的意思是:把 SuperSpec 当前可用的工作流入口安装到项目里。
84
84
 
85
+ 初始化还会安装托管的 `.codex/hooks.json`。它会让 Codex 在写文件前、工具执行后、子智能体启动和停止时调用 SuperSpec,做检查和记录。
86
+
85
87
  Windows PowerShell 如果拦截 npm 的 `.ps1` 脚本,请改用:
86
88
 
87
89
  ```powershell
@@ -157,6 +159,18 @@ openspec/changes/<变更ID>/.superspec/
157
159
  `.superspec/` 要不要提交到 git,由你的团队决定。
158
160
  如果不提交,删掉后就没有 git 历史可以恢复。
159
161
 
162
+ ## Hook 会做什么
163
+
164
+ SuperSpec 安装的 hook 会在几个关键时机运行:
165
+
166
+ - 写文件前:检查是否会改到 SuperSpec 的过程记录、提前归档、绕过任务检查,或写到当前任务不该写的地方
167
+ - 工具执行后:如果刚跑的是测试或验证命令,就记录这次结果
168
+ - 子智能体启动和停止时:记录这次子智能体运行的基本信息
169
+
170
+ 这些 hook 的默认超时时间是 `120` 秒。这个时间限制的是 hook 自己的检查过程,不限制 `npm test`、构建命令或子智能体本身能运行多久。
171
+
172
+ hook 不是安全沙箱。它能减少误操作、拦住一部分明显会破坏流程记录的写入,并留下审计线索;但不能保证阻止所有绕过,也不能把记录变成不可伪造的安全证明。
173
+
160
174
  ## 重要边界
161
175
 
162
176
  SuperSpec 能让流程更规范,但它不是安全锁。
@@ -175,7 +189,7 @@ SuperSpec 能让流程更规范,但它不是安全锁。
175
189
  - 阻止恶意伪造记录
176
190
  - 替代正式的安全审计、合规审计或法律证明
177
191
 
178
- 也就是说,SuperSpec v1 是“流程纪律工具”,不是“强制安全系统”。
192
+ 也就是说,SuperSpec 目前是“流程纪律 + 审计辅助工具”,不是“强制安全系统”。hook 会增强可见性和一部分写入检查,但它仍然不能替代正式的安全控制。
179
193
 
180
194
  ## 常用命令
181
195
 
@@ -223,6 +237,7 @@ superspec doctor
223
237
 
224
238
  ```text
225
239
  .codex/
240
+ hooks.json
226
241
  skills/superspec-explore/
227
242
  skills/superspec-propose/
228
243
  skills/superspec-apply/
@@ -7,26 +7,26 @@ const EXPECTED_HOOK_MATRIX = [
7
7
  {
8
8
  eventName: "PreToolUse",
9
9
  matcher: "Bash|apply_patch|Edit|Write|mcp__.*",
10
- timeout: 10,
11
- statusMessage: "SuperSpec hook write policy",
10
+ timeout: 120,
11
+ statusMessage: "SuperSpec 写入策略检查",
12
12
  },
13
13
  {
14
14
  eventName: "PostToolUse",
15
15
  matcher: "Bash",
16
- timeout: 30,
17
- statusMessage: "SuperSpec hook runtime evidence",
16
+ timeout: 120,
17
+ statusMessage: "SuperSpec 运行证据记录",
18
18
  },
19
19
  {
20
20
  eventName: "SubagentStart",
21
21
  matcher: ".*",
22
- timeout: 30,
23
- statusMessage: "SuperSpec hook subagent start",
22
+ timeout: 120,
23
+ statusMessage: "SuperSpec 子智能体启动记录",
24
24
  },
25
25
  {
26
26
  eventName: "SubagentStop",
27
27
  matcher: ".*",
28
- timeout: 30,
29
- statusMessage: "SuperSpec hook subagent stop",
28
+ timeout: 120,
29
+ statusMessage: "SuperSpec 子智能体停止记录",
30
30
  },
31
31
  ];
32
32
  function isRecord(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peterxiaoyang/superspec",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "SuperSpec workflow package: guard runtime, generic workflow templates, and Codex adapter payload.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,8 +12,8 @@
12
12
  {
13
13
  "type": "command",
14
14
  "command": "superspec-hook --change \"$SUPERSPEC_CHANGE\"",
15
- "timeout": 10,
16
- "statusMessage": "SuperSpec hook write policy"
15
+ "timeout": 120,
16
+ "statusMessage": "SuperSpec 写入策略检查"
17
17
  }
18
18
  ]
19
19
  }
@@ -25,8 +25,8 @@
25
25
  {
26
26
  "type": "command",
27
27
  "command": "superspec-hook --change \"$SUPERSPEC_CHANGE\"",
28
- "timeout": 30,
29
- "statusMessage": "SuperSpec hook runtime evidence"
28
+ "timeout": 120,
29
+ "statusMessage": "SuperSpec 运行证据记录"
30
30
  }
31
31
  ]
32
32
  }
@@ -38,8 +38,8 @@
38
38
  {
39
39
  "type": "command",
40
40
  "command": "superspec-hook --change \"$SUPERSPEC_CHANGE\"",
41
- "timeout": 30,
42
- "statusMessage": "SuperSpec hook subagent start"
41
+ "timeout": 120,
42
+ "statusMessage": "SuperSpec 子智能体启动记录"
43
43
  }
44
44
  ]
45
45
  }
@@ -51,8 +51,8 @@
51
51
  {
52
52
  "type": "command",
53
53
  "command": "superspec-hook --change \"$SUPERSPEC_CHANGE\"",
54
- "timeout": 30,
55
- "statusMessage": "SuperSpec hook subagent stop"
54
+ "timeout": 120,
55
+ "statusMessage": "SuperSpec 子智能体停止记录"
56
56
  }
57
57
  ]
58
58
  }