Skip to content

Commit cd8443f

Browse files
committed
fix governance lifecycle drift
1 parent 045e53b commit cd8443f

39 files changed

Lines changed: 566 additions & 537 deletions

‎CLAUDE.md‎

Lines changed: 0 additions & 430 deletions
This file was deleted.

‎README.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ npx @vextjs/devcodex init --codex # 仅 Codex adapter
5959
├── copilot-instructions.md ← 默认 Copilot always-on 总则(新增)
6060
├── instructions/ ← Instructions 约束(12 个,含全部工作流规则)
6161
├── agents/ ← Copilot 自定义 Agent(v1.9.8 起恢复默认分发)
62-
├── skills/ ← Skill 详细检查标准(35 个,按需读取)
62+
├── skills/ ← Skill 详细检查标准(36 个,按需读取,含 spec-governance)
6363
├── prompts/ ← Prompt 模板(26 个)
6464
├── hooks/ ← 宿主生命周期 Hook 配置与运行时
6565
│ ├── devcodex.lifecycle.json
@@ -81,7 +81,7 @@ AGENTS.md ← 与 instructions.md / copilot-instructions.md / CL
8181

8282
`init --claude` 是 Claude Code-only 路径:只写入 `CLAUDE.md`、`.claude/{instructions,skills,prompts,hooks/_runtime,mcp,data}` 与 `.mcp.json`,并同步开启项目级 hooks / MCP / permissions 配置。
8383

84-
`init --codex` 是 Codex-only 路径:只写入 `AGENTS.md`、`.agents/skills/` 与 `.codex/{hooks.json,hooks/_runtime}`。若工作区根已有非空 `AGENTS.md` 或 `.codex/hooks.json` 且内容不同,CLI 会先生成 `.bak.<timestamp>` 备份再覆盖为 DevCodex 受管副本。
84+
`init --codex` 是 Codex-only 路径:只写入 `AGENTS.md`、`.agents/skills/` 与 `.codex/{hooks.json,hooks/_runtime}`。若工作区根已有非空 `AGENTS.md` 或 `.codex/hooks.json` 且内容不同,CLI 会先把备份写入 active-root 的 `.tmp/backups/`,再覆盖为 DevCodex 受管副本。
8585

8686
> ⚠️ 请确保 IDE 的 "Use Instruction Files" 设置已开启(默认开启)。
8787
>
@@ -165,6 +165,7 @@ AGENTS.md ← 与 instructions.md / copilot-instructions.md / CL
165165
- 全工作区任务:写入 `<workspace>/.devcodex/workspace/...`
166166
- `config.json`:`workspace/profile` 作为 base,`<project>/profile` 作为 overlay
167167
- Profile 文档:项目命名空间文件优先,缺失回退到 `workspace/profile`
168+
- CLI / Hook 运行态目录:统一写 active-root;单项目为 `<workspace>/.devcodex/<project>/.memory|.audit-state`,全工作区为 `<workspace>/.devcodex/workspace/.memory|.audit-state`
168169

169170
配套 CLI:
170171

@@ -174,7 +175,7 @@ devcodex migrate-layout apply --manifest <manifest-path>
174175
devcodex migrate-layout rollback --manifest <manifest-path>
175176
```
176177

177-
> 真相源说明:只有在 `layout.json` 已创建后,runtime / MCP 才会按 `.devcodex/workspace` 和 `.devcodex/<project>` 解析;未启用时继续兼容旧的 `<project>/.devcodex/`。
178+
> 真相源说明:只有在 `layout.json` 已创建后,runtime / MCP / profile init 才会按 `.devcodex/workspace` 和 `.devcodex/<project>` 解析;未启用时继续兼容旧的 `<project>/.devcodex/`。启用后不得再向 `<project>/.devcodex/.tmp` 等旧项目内运行态目录写入产物。
178179
179180
## 本地开发
180181

@@ -240,7 +241,7 @@ devcodex/
240241
├── instructions.md # 单源规范文件;安装时按平台生成 copilot-instructions.md / CLAUDE.md / AGENTS.md
241242
├── agents/ # Agent 源文件;Copilot 端默认分发,Claude Code 端不分发
242243
├── instructions/ # 全局 Instructions(12 个,含工作流规则摘要,自动注入)
243-
├── skills/ # Skill 详细检查标准(35 个,按 01-common §按需读取表 路由读取)
244+
├── skills/ # Skill 详细检查标准(36 个,按 01-common §按需读取表 路由读取)
244245
├── prompts/ # Prompt 模板(26 个)
245246
├── hooks/ # Workspace Hooks 配置与分发到 `.github/hooks/_runtime/` 的运行时
246247
├── codex/ # Codex Hook 配置源,分发到 `.codex/hooks.json`
@@ -251,6 +252,8 @@ devcodex/
251252
└── plugin.json # 插件元数据
252253
```
253254

255+
规范治理新增 `spec-governance` Skill:记录类动作先做意图识别,再由 RecordRouter 分流到 `violations / pending-fixes / process-improvements / pending-issues / gap-registry`;规范/控制面/路径/模板/部署/校验链变更后必须执行 SCV(Spec Change Verification),避免修复一处后引入漂移。
256+
254257
&gt; ℹ️ 维护者状态文件(本仓库开发过程中累积的 violations/pending-fixes 记录)保存在 `.devcodex/.maintainer-state/`,**不分发**给用户。
255258

256259
## 客户端支持矩阵(Client Support Matrix)

‎changelogs/unreleased.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
77
---
88

9+
## 2026-05-28
10+
11+
- 修复审查收敛后的文档/Profile 口径漂移:active-root Profile 改为全模式 PC0~PC7 入口检查口径,历史归档页不再维护固定 Skill 数量,并将旧 prod 预检查规则标注为历史阶段规则。
12+
913
## 2026-05-27
1014

15+
- 增强规范治理生命周期:新增 `spec-governance` Skill、RecordRouter 意图驱动记录分流、SCV 规范变更验证链,并补充 validate 防回归校验。
16+
- 修复 workspace-namespace 运行态落点:CLI/Profile/Hook 状态目录与 Codex adapter 备份统一解析到 active-root,新增项目内 `.devcodex/.tmp` 与工作区根临时/备份产物漂移检查,自动 `.gitignore` 覆盖 `.devcodex/*/.tmp/`,并迁移现有临时产物到集中命名空间。
1117
- 修复治理链小修批次:统一 MCP SUMMARY 新建模板、清理已发布 unreleased 残留、同步 Profile scripts 资产清单,并增强 validate 对 release/profile/audit-state 漂移的防回归检查。

‎data/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ data/
5151
- `data/pending-fixes.md`:承载运行时 PF(规范缺口)记录,主要由 PC4 / spec-radar / audit 轻量登记使用
5252
- `data/pending-issues.md`:承载**已确认但不阻断当前任务**的治理改进项,按批次进入后续需求或 bug 修复流程
5353
- `data/process-improvements.md`:只记录“已确认更优的执行策略”,不替代前两者
54+
- `data/violations.md`、`data/pending-fixes.md`、`data/process-improvements.md`、`data/pending-issues.md`、`data/gap-registry.md` 的写入必须先经 `spec-governance` 的 RecordRouter 分流,记录规范化意图、置信度、依据和目标台账

‎data/templates/gap-registry.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313
| 编号 | `GR-NNN` |
1414
| 日期 | `YYYY-MM-DD` |
1515
| 类型 | `维度盲区` / `检测盲点` |
16+
| 规范化意图 | `record.audit-gap` |
17+
| 盲区来源 | audit / validate / Hook / ECR / 用户反馈 |
1618
| 盲点类型 | M1/M2/M3/M4(检测盲点)或 N/A(维度盲区) |
19+
| 未发现原因 | 为什么原检查没有发现 |
1720
| 简述 | 一句话 |
1821
| 建议维度 | 拟新增维度名或 N/A |
22+
| 建议探针 | 建议新增的 grep/validate/test 探针 |
1923

2024
---
2125

2226
## 登记表
2327

24-
| 编号 | 日期 | 类型 | 盲点类型 | 简述 | 建议维度 |
25-
|------|------|------|:--------:|------|---------|
26-
| GR-000 | YYYY-MM-DD | 维度盲区 | N/A | EXAMPLE — 删除本行 | — |
28+
| 编号 | 日期 | 类型 | 规范化意图 | 盲区来源 | 盲点类型 | 未发现原因 | 简述 | 建议维度 | 建议探针 |
29+
|------|------|------|--------------|----------|:--------:|------------|------|----------|----------|
30+
| GR-000 | YYYY-MM-DD | 维度盲区 | record.audit-gap | audit | N/A | 示例原因 | EXAMPLE — 删除本行 | — | 示例探针 |

‎data/templates/pending-fixes.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
| Axis | `A` / `B` / `C` / `A+B` 等多轴组合 |
1616
| 简述 | 一句话描述规范缺陷 |
1717
| 关联 VL | 若为 G5 重复违规,填对应 VL 编号 |
18+
| 规范化意图 | `record.spec-defect` |
19+
| 触发来源 | PC4 / audit / ECR / 用户建议 / validate |
20+
| 缺陷类型 | 缺失 / 冲突 / 滞后 / 外部假设失效 / 完成边界缺失 |
21+
| SCV 要求 | 是否需要 SCV,填 `是` / `否` |
1822
| 状态 | 🔄 / ✅ |
1923

2024
---
2125

2226
## 登记表
2327

24-
| 编号 | G码 | Axis | 简述 | 关联 VL | 状态 |
25-
|------|:---:|:----:|------|:-------:|:----:|
26-
| PF-000 | G1 | A | EXAMPLE — 删除本行 | — | 🔄 |
28+
| 编号 | G码 | Axis | 简述 | 关联 VL | 规范化意图 | 触发来源 | 缺陷类型 | SCV要求 | 状态 |
29+
|------|:---:|:----:|------|:-------:|--------------|----------|----------|:------:|:----:|
30+
| PF-000 | G1 | A | EXAMPLE — 删除本行 | — | record.spec-defect | PC4 | 缺失 | 否 | 🔄 |

‎data/templates/pending-issues.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
| 标题 | 一句话概括问题 |
1515
| 发现时间 | `YYYY-MM-DD` |
1616
| 影响范围 | 受影响的规范/模板/客户端/流程 |
17+
| 规范化意图 | `record.pending-issue` |
18+
| 治理类型 | 规范治理 / 路径治理 / 模板治理 / 验证治理 |
19+
| 排期建议 | 推荐批次或优先级 |
20+
| 关联 PF/VL/GAP | 关联编号,无则 `—` |
1721
| 建议动作 | 后续修复方向或收口方式 |
1822
| 状态 | 🔄 / ✅ |
1923

2024
---
2125

2226
## 登记表
2327

24-
| 编号 | 标题 | 发现时间 | 影响范围 | 建议动作 | 状态 |
25-
|------|------|-----------|----------|----------|:----:|
26-
| ISSUE-000 | EXAMPLE — 删除本行 | YYYY-MM-DD | 示例范围 | 示例动作 | 🔄 |
28+
| 编号 | 标题 | 发现时间 | 影响范围 | 规范化意图 | 治理类型 | 排期建议 | 关联 PF/VL/GAP | 建议动作 | 状态 |
29+
|------|------|-----------|----------|--------------|----------|----------|----------------|----------|:----:|
30+
| ISSUE-000 | EXAMPLE — 删除本行 | YYYY-MM-DD | 示例范围 | record.pending-issue | 规范治理 | 示例批次 | — | 示例动作 | 🔄 |

‎data/templates/process-improvements.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
| 编号 | `PI-NNN` |
1414
| 日期 | `YYYY-MM-DD` |
1515
| 触发场景 | 用户建议的执行策略 |
16+
| 规范化意图 | `record.process-improvement` |
17+
| 策略来源 | 用户建议 / AI 复盘 / audit 建议 |
18+
| 可泛化理由 | 为什么不是一次性偏好 |
19+
| 采纳证据 | 已确认依据或验证结果 |
1620
| 是否纳规 | ✅ 已纳入规范 / 🔄 待评估 |
1721

1822
---
1923

2024
## 登记表
2125

22-
| 编号 | 日期 | 触发场景 | 是否纳规 |
23-
|------|------|---------|:--------:|
24-
| PI-000 | YYYY-MM-DD | EXAMPLE — 删除本行 | 🔄 |
26+
| 编号 | 日期 | 触发场景 | 规范化意图 | 策略来源 | 可泛化理由 | 采纳证据 | 是否纳规 |
27+
|------|------|---------|--------------|----------|------------|----------|:--------:|
28+
| PI-000 | YYYY-MM-DD | EXAMPLE — 删除本行 | record.process-improvement | 用户建议 | 示例理由 | 示例证据 | 🔄 |

‎data/templates/violations.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
| 规范 | 违反的规范编号(如 `S03` / `C11` / `FC4`)| 是 |
1616
| 现象 | 一句话描述违规现象 | 是 |
1717
| 根因 | 规范缺陷 / AI 判断失误 / 用户显式越权 | 是 |
18+
| 规范化意图 | 固定为 `record.violation` | 是 |
19+
| 置信度 | 高 / 中 / 低(低置信度不得写入)| 是 |
20+
| 升级关联 | 关联 PF/GAP/ISSUE 编号,无则 `—` | 否 |
1821
| 处置 | 🔄 处理中 / ✅ 已关闭 | 是 |
1922

2023
---
2124

2225
## 登记表
2326

24-
| 编号 | 日期 | 规范 | 现象 | 根因 | 处置 |
25-
|------|------|------|------|------|:----:|
26-
| VL-000 | YYYY-MM-DD | 示例 | EXAMPLE — 删除本行 | EXAMPLE | 🔄 |
27+
| 编号 | 日期 | 规范 | 现象 | 根因 | 规范化意图 | 置信度 | 升级关联 | 处置 |
28+
|------|------|------|------|------|--------------|--------|----------|:----:|
29+
| VL-000 | YYYY-MM-DD | 示例 | EXAMPLE — 删除本行 | EXAMPLE | record.violation | 高 | — | 🔄 |

‎hooks/_runtime/lifecycle.cjs‎

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const ENFORCEMENT_MODE = (() => {
2929
return mode === 'strict' ? 'strict' : 'safety-only'
3030
})()
3131
const AUTO_ALLOWED_PATH_PATTERNS = [
32-
/^\.devcodex\//,
32+
/^\.devcodex\/(?:workspace|[A-Za-z0-9][A-Za-z0-9._-]*|profile|requirements|bugs|optimizations|scenario-tests|reports|\.memory|\.audit-state)(?:\/|$)/,
3333
/^agents\/devcodex-auto\.agent\.md$/i,
3434
/^instructions\/01-common\.instructions\.md$/i,
3535
/^skills\/cp-gate\/SKILL\.md$/i,
@@ -146,7 +146,10 @@ function inferContextProject() {
146146
const CONTEXT_PROJECT = inferContextProject()
147147
const DEFAULT_SCOPE = LAYOUT.enabled ? (CONTEXT_PROJECT ? 'project' : 'workspace') : 'project'
148148
const STATE_SCOPE_KEY = LAYOUT.enabled ? (CONTEXT_PROJECT || 'workspace') : 'legacy'
149-
const STATE_DIR = path.join(WORKSPACE_ROOT, '.devcodex', '.memory', 'hooks', STATE_SCOPE_KEY)
149+
const ACTIVE_RUNTIME_ROOT = LAYOUT.enabled
150+
? path.join(WORKSPACE_ROOT, '.devcodex', CONTEXT_PROJECT || 'workspace')
151+
: path.join(WORKSPACE_ROOT, '.devcodex')
152+
const STATE_DIR = path.join(ACTIVE_RUNTIME_ROOT, '.memory', 'hooks', STATE_SCOPE_KEY)
150153
const STATE_FILE = path.join(STATE_DIR, 'lifecycle-state.json')
151154
const FINAL_PAYLOAD_FLAG = path.join(STATE_DIR, 'capture-final-payload.flag')
152155
const FINAL_PAYLOAD_LOG = path.join(STATE_DIR, 'captured-final-payloads.ndjson')
@@ -1055,7 +1058,7 @@ function isAutoAllowedPath(p) {
10551058

10561059
function checkAutoWhitelist(payload, platform, state) {
10571060
if (state.executionMode !== EXECUTION_MODE.AUTO) return null
1058-
if (!isSourceCodeMutation(payload, platform)) return null
1061+
if (!isSourceCodeMutation(payload, platform, state)) return null
10591062
const paths = [...new Set(extractToolPaths(payload))]
10601063
if (!paths.length) {
10611064
return {
@@ -1111,49 +1114,84 @@ function checkCpGate(payload, state) {
11111114

11121115
// Source file extensions that indicate code/config being written
11131116
const SOURCE_EXT_RE = /\.(js|ts|tsx|jsx|mjs|cjs|py|go|rs|java|cs|rb|php|c|cpp|h|swift|kt|vue|svelte|css|scss|less|html|sql|sh|bash|zsh|ps1|psm1|json|yaml|yml|toml|ini|xml|env)$/i
1114-
// F-001: 仅放行 DevCodex governance 子路径(.devcodex/ 全域;.claude/.github/ 下的规范子目录);不再无条件放行 .claude/foo.js 这类裸写入
1115-
const DEVCODEX_PATH_RE = /\.devcodex[/\\]|\.(?:claude|github)[/\\](?:instructions|skills|hooks|agents|prompts|settings\.json|settings\.local\.json|data)|(?:^|[\s"'=]|[/\\])AGENTS\.md(?:$|[\s"';|&])|\.agents[/\\](?:skills)|\.codex[/\\](?:hooks\.json|hooks)|(?:^|[\s"'=]|[/\\])codex[/\\](?:hooks\.json|hooks)(?:$|[\s"';|&])/
1117+
// F-001/F-037: only governance deployment paths and the active .devcodex namespace are exempt.
1118+
// This prevents workspace-namespace projects from treating project/.devcodex/.tmp as managed state.
1119+
const DEVCODEX_DEPLOYMENT_PATH_RE = /^(?:\.claude|\.github)\/(?:instructions|skills|hooks|agents|prompts|settings\.json|settings\.local\.json|data)(?:\/|$)|^AGENTS\.md$|^\.agents\/skills(?:\/|$)|^\.codex\/(?:hooks\.json|hooks)(?:\/|$)|^codex\/(?:hooks\.json|hooks)(?:\/|$)/
11161120

1117-
function bashWritesToSourceCode(cmd) {
1118-
if (!cmd || DEVCODEX_PATH_RE.test(cmd)) return false
1121+
function isInsideOrSamePath(child, parent) {
1122+
if (!child || !parent) return false
1123+
const normChild = path.normalize(child).toLowerCase()
1124+
const normParent = path.normalize(parent).toLowerCase()
1125+
return normChild === normParent || normChild.startsWith(normParent + path.sep)
1126+
}
1127+
1128+
function isActiveDevCodexNamespacePath(target, state) {
1129+
if (!target) return false
1130+
const abs = resolveRelativeToContext(target)
1131+
if (isInsideOrSamePath(abs, getActiveNamespaceRoot(state))) return true
1132+
if (LAYOUT.enabled && getActiveScope(state) !== 'workspace') {
1133+
return isInsideOrSamePath(abs, path.join(getWorkspaceNamespaceRoot(), 'profile'))
1134+
}
1135+
return false
1136+
}
1137+
1138+
function isDevCodexManagedPath(target, state) {
1139+
if (!target) return false
1140+
const rel = toWorkspaceRelativePath(target)
1141+
if (DEVCODEX_DEPLOYMENT_PATH_RE.test(rel)) return true
1142+
return isActiveDevCodexNamespacePath(target, state)
1143+
}
1144+
1145+
function payloadTouchesOnlyManagedPaths(payload, state) {
1146+
const paths = [...new Set(extractToolPaths(payload))]
1147+
return paths.length > 0 && paths.every(p => isDevCodexManagedPath(p, state))
1148+
}
1149+
1150+
function bashWritesToSourceCode(cmd, state) {
1151+
if (!cmd) return false
11191152
// Detect output redirect > or >> to a source file
11201153
const redirectRe = />{1,2}\s*['"]?([^\s'";&|]+)/g
11211154
let m
11221155
while ((m = redirectRe.exec(cmd)) !== null) {
11231156
const target = m[1]
1124-
if (SOURCE_EXT_RE.test(target) && !DEVCODEX_PATH_RE.test(target)) return true
1157+
if (SOURCE_EXT_RE.test(target) && !isDevCodexManagedPath(target, state)) return true
11251158
}
11261159
// Detect tee targeting a source file
11271160
const teeRe = /\btee\s+(?:-a\s+)?['"]?([^\s'";&|]+)/g
11281161
while ((m = teeRe.exec(cmd)) !== null) {
11291162
const target = m[1]
1130-
if (SOURCE_EXT_RE.test(target) && !DEVCODEX_PATH_RE.test(target)) return true
1163+
if (SOURCE_EXT_RE.test(target) && !isDevCodexManagedPath(target, state)) return true
11311164
}
11321165
// PowerShell Set-Content / Out-File — extract target path before testing
11331166
const setContentMatch = cmd.match(/\bSet-Content\b\s+(?:-Path\s+)?['"]?([^\s'";&|]+)/i)
1134-
if (setContentMatch && SOURCE_EXT_RE.test(setContentMatch[1]) && !DEVCODEX_PATH_RE.test(setContentMatch[1])) return true
1167+
if (setContentMatch && SOURCE_EXT_RE.test(setContentMatch[1]) && !isDevCodexManagedPath(setContentMatch[1], state)) return true
11351168
const outFileMatch = cmd.match(/\bOut-File\b\s+(?:-FilePath\s+)?['"]?([^\s'";&|]+)/i)
1136-
if (outFileMatch && SOURCE_EXT_RE.test(outFileMatch[1]) && !DEVCODEX_PATH_RE.test(outFileMatch[1])) return true
1169+
if (outFileMatch && SOURCE_EXT_RE.test(outFileMatch[1]) && !isDevCodexManagedPath(outFileMatch[1], state)) return true
11371170
return false
11381171
}
11391172

1140-
function isSourceCodeMutation(payload, platform) {
1173+
function isSourceCodeMutation(payload, platform, state) {
11411174
const toolName = getToolName(payload)
11421175
const lower = toolName.toLowerCase()
11431176

11441177
if (platform === 'claude') {
11451178
// Write/Edit tools
11461179
if (lower === 'write' || lower === 'edit') {
1147-
return !touchesPath(payload, '.devcodex/', '.github/', '.claude/')
1180+
return !payloadTouchesOnlyManagedPaths(payload, state)
11481181
}
11491182
// Bash: detect redirect/tee writes to source files
11501183
if (lower === 'bash') {
1151-
return bashWritesToSourceCode(getCommandText(payload))
1184+
return bashWritesToSourceCode(getCommandText(payload), state)
11521185
}
11531186
return false
11541187
}
11551188

1156-
// Copilot
1189+
// Copilot / Codex / instruction-fallback shell tools
1190+
if (['bash', 'shell_command', 'run_in_terminal', 'powershell'].includes(lower)) {
1191+
return bashWritesToSourceCode(getCommandText(payload), state)
1192+
}
1193+
1194+
// Copilot / Codex patch-style tools
11571195
const copilotWritePatterns = [
11581196
/^apply[_-]?patch$/,
11591197
/^create[_-]?file$/,
@@ -1162,7 +1200,7 @@ function isSourceCodeMutation(payload, platform) {
11621200
/^rewrite[_-]?file$/
11631201
]
11641202
if (!copilotWritePatterns.some(p => p.test(lower))) return false
1165-
return !touchesPath(payload, '.devcodex/', '.github/', '.claude/')
1203+
return !payloadTouchesOnlyManagedPaths(payload, state)
11661204
}
11671205

11681206
function buildCpDenyOutput(state, platform, eventName, gate, toolName) {
@@ -1569,7 +1607,7 @@ async function main() {
15691607
// 3. CP gate — block source code mutations until checkpoints confirmed
15701608
// payload-aware: when tool paths target specific requirement dirs, only that requirement's CP is checked
15711609
const gate = checkCpGate(payload, state)
1572-
if (gate && isSourceCodeMutation(payload, platform)) {
1610+
if (gate && isSourceCodeMutation(payload, platform, state)) {
15731611
state.lastReason = `cp-gate-${gate.phase}`
15741612
saveState(state)
15751613
writeStdout(isStrictEnforcement()

0 commit comments

Comments
 (0)