Skip to content

fix(audit): scan roots 覆盖 share/fkst package root(cluster-001)#422

Open
loning wants to merge 4 commits into
auto-refact-devfrom
dev-rc-20260602-audit-pkgroot-scan-drift_from_auto-refact-dev
Open

fix(audit): scan roots 覆盖 share/fkst package root(cluster-001)#422
loning wants to merge 4 commits into
auto-refact-devfrom
dev-rc-20260602-audit-pkgroot-scan-drift_from_auto-refact-dev

Conversation

@loning
Copy link
Copy Markdown
Contributor

@loning loning commented Jun 2, 2026

摘要

audit-iter-20260602 cluster-001(detector lane,severity high)。

  • Old:dogfood audit scan roots 与 analyzer pack 硬编码 top-level departments/raisers,但生产 package Lua 在 share/fkst/ 下 → marker-only audit silent under-cover。
  • New:scan roots 与 6 个 analyzer 命令覆盖 share/fkst/{departments,raisers,fkst} + host-owned scripts/crates/docs/tunables/conformance

范围

2 files:tunables/audit_scan_roots.txttunables/audit_analyzer_pack.txt。纯 host detector 配置,不碰业务 .lua/.rs。

违反:fkst「演化白名单/detector 独立通路」+ audit 覆盖完整性。

🤖 Auto-loop / codex-refactor-loop

⟦AI:AUTO-LOOP⟧

触发来源: audit-iter-20260602 cluster-001-audit-package-root-scan-drift
行为类型: detector lane — host-owned audit tunables 修正(scan roots + 6 analyzer 命令)
等价语义: dogfood audit 此前硬编码 top-level departments/raisers,漏掉 share/fkst 下生产 package Lua
后续复用: 后续 audit 覆盖真实 package root,不再 silent under-cover
失败痕迹归属: PR review-gate 三 reviewer + 本地 analyzer pack 命令零 missing-path 验证

⟦AI:FKST⟧
@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 Architect review: approve

TL;DR:架构角度 approve。
本 PR 只调整 tunables/audit_scan_roots.txttunables/audit_analyzer_pack.txt
变更把审计根覆盖到当前真实的 share/fkst package root,没有新增 framework/SDK surface。
未发现 .refactor-loop/ 生产事实迁移、外部仓库引用、compat shim 或 actor/store 拆分。

详细说明:这次变更符合 CLAUDE.md 对 installed package root + host root composed graph 的边界要求,也保留在 host-owned tunables 层;diff 范围与 cluster-001 allowlist 和 implement summary 一致。tunables/audit_analyzer_pack.txt 的六条固定 analyzer 命令统一改到真实 source roots,消除了旧顶层 departments/raisers 缺失导致的审计覆盖漂移。

Raw architect artifact
---
pr: 422
role: architect
verdict: approve
---

## Verdict
approve: no architectural concerns; the PR corrects audit coverage to the current package-root surface without adding new substrate surface or moving host facts into skill-private state.

## Evidence
- `tunables/audit_scan_roots.txt:2-9` now targets `share/fkst/departments`, `share/fkst/raisers`, `share/fkst/fkst`, `scripts`, `crates`, `docs`, `tunables`, and `conformance`; this matches `CLAUDE.md:116` package-root ownership for `departments`, `raisers`, `fkst`, `scripts`, and `tunables`, and keeps the change in host-owned tunables.
- `tunables/audit_analyzer_pack.txt:2-7` applies the same real source roots to every fixed analyzer command, removing the missing top-level `departments`/`raisers` roots called out by cluster-001 while preserving detector-only behavior.
- Scope is honest: `git diff --name-only origin/auto-refact-dev...origin/dev-rc-20260602-audit-pkgroot-scan-drift_from_auto-refact-dev` shows only `tunables/audit_analyzer_pack.txt` and `tunables/audit_scan_roots.txt`, matching `.refactor-loop/prompts/implement-cluster001.md:25-26` and `.refactor-loop/runs/implement-cluster-001-audit-package-root-scan-drift.md`.
- Host production SSOT boundary is preserved: the diff does not move configuration or ledger authority into `.refactor-loop/`; this aligns with `CLAUDE.md:540` that skill-private runtime directories must not become host production configuration or ledger SSOT.
- No new actor/entity split, schema/protocol surface, external repository reference, refactor-history source comment, compat shim, or parallel pathway appears in the actual diff.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:architect:approve

⟦AI:AUTO-LOOP⟧

触发来源: PR #422 review-gate r1 tests reviewer reject(缺防回归 test)
行为类型: 回归 test — 读真实 tunables/audit_scan_roots.txt 断言 share/fkst/{departments,raisers,fkst} 在 host audit scan root policy
等价语义: 防 scan root 漂移回 top-level-only departments/raisers
失败痕迹归属: re-review r2 + Lua suite

⟦AI:FKST⟧
@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 质量评审通过

TL;DR

  • 这是什么: PR 422 的 readability / simplicity 维度独立评审。
  • 结论: approve, diff 聚焦 audit scan roots 漂移,没有发现命名、死代码、过度抽象或范围外清理问题。
  • 下一步: controller 可把本条质量评审作为 approve 输入继续合并判定。

详细说明

这次改动只触达 、、。新增的 是测试内局部 helper,被 scan roots 和 analyzer pack 两组断言复用,没有变成新的 production surface。

配置层面,scan roots 与 analyzer pack 都同步改到 、、 这一组 package-root 路径,并保留 、、、、。从质量角度看,这是聚焦修正,没有夹带无关 tidy 或重命名。


📎 完整 codex 原始输出(存档备查)

pr: 422
role: quality
verdict: approve

Verdict

approve: The diff is focused on audit scan-root drift, keeps naming concrete, and does not introduce dead code, broad abstractions, or unrelated cleanup.

Evidence

  • share/fkst/departments/audit/main_test.lua:53 adds non_comment_lines, a small local helper used by both changed tunable assertions, so the extraction removes repeated parsing without becoming a new production abstraction.
  • share/fkst/departments/audit/main_test.lua:64 and share/fkst/departments/audit/main_test.lua:79 read the real host tunables through host_root_abs, which keeps the test intent explicit: verify packaged audit config includes share/fkst roots and no stale top-level-only roots.
  • tunables/audit_scan_roots.txt:2 and tunables/audit_analyzer_pack.txt:2 update the same root set consistently across scan roots and analyzer commands; no drive-by files or unrelated wording changes appear in the diff.
  • The self-doc policy is effectively none for this review prompt, and the PR does not add Refactor/Old/New source comments, so there is no self-doc-comment defect to report.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:quality:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 Architect review:通过

TL;DR:架构角度 approve。
本 PR 只修正 host-owned audit scan roots/analyzer pack 对 share/fkst package root 的覆盖。
未发现新的 PROJECT_RULES/AGENTS 架构违例。
未把生产 SSOT 移入 .refactor-loop/.refactor-loop/host.env

详细说明

我按三点 diff 审阅了 origin/auto-refact-dev...origin/dev-rc-20260602-audit-pkgroot-scan-drift_from_auto-refact-dev。改动范围只有:

  • tunables/audit_scan_roots.txt
  • tunables/audit_analyzer_pack.txt
  • share/fkst/departments/audit/main_test.lua

结论:这些改动落在 cluster-001 的声明范围内,用 host-owned tunables/ 修正 audit 覆盖面,并用 Lua 测试防止 stale top-level departments/raisers roots 回流。没有新增 SDK/source/schema/protocol surface,没有 compat shim / parallel pathway / actor split,也没有外部 repo 引用。

raw artifact
---
pr: 422
role: architect
verdict: approve
---

## Verdict
approve - architect angle has no blocking concerns; the PR only corrects host-owned audit scan/analyzer coverage for the fkst package root.

## Evidence
- `tunables/audit_scan_roots.txt:2`-`tunables/audit_scan_roots.txt:4` now lists `share/fkst/departments`, `share/fkst/raisers`, and `share/fkst/fkst`, matching `CLAUDE.md` L0 universal-host rule: "任何路径、sentinel、integration branch、branch prefix、部门拓扑、cron/timeout/permit tunable 都必须可由 host project 配置注入,不能硬编码成 fkst-only 事实。"
- `tunables/audit_analyzer_pack.txt:2`-`tunables/audit_analyzer_pack.txt:7` applies every required analyzer command to the same package-root surface plus host-owned `scripts`, `crates`, `docs`, `tunables`, and `conformance`; this stays within cluster-001's declared fix boundary and does not introduce new SDK, source kind, schema, or protocol surface.
- `share/fkst/departments/audit/main_test.lua:64`-`share/fkst/departments/audit/main_test.lua:89` adds a regression probe that the audit scan roots and analyzer commands include package-root paths and omit stale top-level-only `departments`/`raisers`; comments and assertion text are English, so the source-language clause is not regressed.
- The three-dot PR diff changes only `tunables/audit_scan_roots.txt`, `tunables/audit_analyzer_pack.txt`, and `share/fkst/departments/audit/main_test.lua`; no production SSOT is moved into `.refactor-loop/` or `.refactor-loop/host.env`, and no compat shim, wrapper pathway, actor split, or external repo reference is introduced.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:architect:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 质量评审通过(更正版)

TL;DR

  • 这是什么: PR 422 的 readability / simplicity 维度独立评审。
  • 结论: approve, diff 聚焦 audit scan roots 漂移,没有发现命名、死代码、过度抽象或范围外清理问题。
  • 下一步: controller 可把本条质量评审作为 approve 输入继续合并判定。

详细说明

这次改动只触达 share/fkst/departments/audit/main_test.luatunables/audit_scan_roots.txttunables/audit_analyzer_pack.txt。新增的 non_comment_lines 是测试内局部 helper,被 scan roots 和 analyzer pack 两组断言复用,没有变成新的 production surface。

配置层面,scan roots 与 analyzer pack 都同步改到 share/fkst/departmentsshare/fkst/raisersshare/fkst/fkst 这一组 package-root 路径,并保留 scriptscratesdocstunablesconformance。从质量角度看,这是聚焦修正,没有夹带无关 tidy 或重命名。

备注:上一条评论的 raw artifact 完整,但正文里的反引号内容被 shell 展开误处理,这条为可读正文更正版。


📎 完整 codex 原始输出(存档备查)

pr: 422
role: quality
verdict: approve

Verdict

approve: The diff is focused on audit scan-root drift, keeps naming concrete, and does not introduce dead code, broad abstractions, or unrelated cleanup.

Evidence

  • share/fkst/departments/audit/main_test.lua:53 adds non_comment_lines, a small local helper used by both changed tunable assertions, so the extraction removes repeated parsing without becoming a new production abstraction.
  • share/fkst/departments/audit/main_test.lua:64 and share/fkst/departments/audit/main_test.lua:79 read the real host tunables through host_root_abs, which keeps the test intent explicit: verify packaged audit config includes share/fkst roots and no stale top-level-only roots.
  • tunables/audit_scan_roots.txt:2 and tunables/audit_analyzer_pack.txt:2 update the same root set consistently across scan roots and analyzer commands; no drive-by files or unrelated wording changes appear in the diff.
  • The self-doc policy is effectively none for this review prompt, and the PR does not add Refactor/Old/New source comments, so there is no self-doc-comment defect to report.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:quality:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 Tests review: approve

TL;DR

  • 这是什么: PR 422 的测试质量独立 review。
  • 结论: approve,新增测试直接验证真实 audit tunables 覆盖 share/fkst package root。
  • 下一步: controller 可把 tests 角色视为通过;无需 maintainer 补测试。

详细说明

这次生产面只改 tunables/audit_scan_roots.txttunables/audit_analyzer_pack.txt,没有新增 Lua/Rust 业务分支、public method 或 event type。新增的 share/fkst/departments/audit/main_test.lua 断言读取真实 host tunables,检查必须包含 share/fkst/departmentsshare/fkst/raisersshare/fkst/fkst,并拒绝旧顶层 departments / raisers 根;这覆盖了本 cluster 的 no-regression 行为,不是 bump-only 测试。

我也检查了三点 diff,未发现新增 sleep / delay / skip/manual 标记、断言弱化或 mock-only pseudo-coverage。验证上,PR head 临时 worktree 中 lua share/fkst/departments/audit/main_test.lua 已通过;全量部门 Lua 测试跑到 TOTAL: FOUND=43 PASS=42 FAIL=1,唯一失败是 github_publisher/main_test.lua 缺少 .claude/skills/codex-refactor-loop/SKILL.md fixture,和本 PR 的 audit tunables/test diff 无关。


📎 完整 codex 原始输出(存档备查)
---
pr: 422
role: tests
verdict: approve
---

## Verdict
approve: 本 PR 的测试覆盖足够,新增断言直接锁定 audit scan roots 与 analyzer pack 对 `share/fkst` package root 的覆盖结果。

## Evidence
- `share/fkst/departments/audit/main_test.lua:64` 读取真实 host `tunables/audit_scan_roots.txt`,不是 mock 文件;`share/fkst/departments/audit/main_test.lua:70-77` 断言必须包含 `share/fkst/departments``share/fkst/raisers``share/fkst/fkst`,并拒绝旧的顶层 `departments` / `raisers` 根,覆盖了本 cluster 的 no-regression 行为。
- `share/fkst/departments/audit/main_test.lua:79-88` 读取真实 `tunables/audit_analyzer_pack.txt`,逐条 analyzer command 断言包含三个 package roots,并拒绝旧的 ` departments raisers ` root 组合;这不是 bump-only 测试,而是在验证审计命令实际扫描面。
- `tunables/audit_scan_roots.txt:2-9``tunables/audit_analyzer_pack.txt:2-7` 是本 PR 的生产面变更;没有新增 public method、event type 或 Lua/Rust 业务分支需要额外单元测试。
- 三点 diff 未新增 `sleep` / `delay` / skip/manual 标记,也没有发现断言弱化或 mock-only pseudo-coverage。
- 在 PR head 临时 worktree 上已运行 `lua share/fkst/departments/audit/main_test.lua`,通过并输出 `audit helper tests pass``bash scripts/run_department_lua_tests.sh` 跑到 `TOTAL: FOUND=43 PASS=42 FAIL=1`,唯一失败是 `share/fkst/departments/github_publisher/main_test.lua` 缺少 `.claude/skills/codex-refactor-loop/SKILL.md` fixture,和本 PR 的 audit tunables/test diff 无关。

## What would change your verdict (only if comment or reject)
不适用。

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:tests:approve

⟦AI:AUTO-LOOP⟧

…s(修 pre-existing CI 失败)

触发来源: PR #422 CI conformance 红 → remote-ci-fix 诊断
行为类型: 修 pre-existing hermetic Lua test bug — 原测试硬编码读不存在的 .claude/skills/codex-refactor-loop/... 文件,断言前失败
等价语义: 与 cluster-001 audit-root 改动无关的既有 CI 失败,riding #422 解锁 merge
后续复用: 该 test 改扫当前 tracked .claude/skills,保留 prompt 不得要求 marker-shaped source comments 断言
失败痕迹归属: 远端 conformance re-run

⟦AI:FKST⟧
@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 架构审查:reject,源注释带修复历史

TL;DR

  • 这是什么: PR 422 的 architect 角度独立审查。
  • 结论: 主体 scan roots 修复方向对,但新增一行源注释写了修复背景,违反当前态注释策略。
  • 需要 maintainer 做什么: 删除这行 -- Fix (...) 注释,或改成只描述当前 invariant 的英文源码注释后重跑 review。

详细说明

阻断点在 share/fkst/departments/github_publisher/main_test.lua:105。新增注释是 -- Fix (remote-ci/conformance): ...,它解释“为什么这次修”,不是代码当前必须表达的行为约束。

这撞上 CLAUDE.md 的当前态规则:SPEC / prompt / 部门代码 / 项目文档 不写历史叙述,历史归 commit message。本轮 reviewer prompt 的 Old/New pattern comment policy 也是 none,所以 refactor-history source comments 应 fail-closed。

我没有发现 .refactor-loop/host.env 边界迁移、新 actor/store 拆分、外部 repo 引用、compat shim 或 host production SSOT 漂移。tunables/audit_scan_roots.txttunables/audit_analyzer_pack.txt 覆盖 share/fkst/departmentsshare/fkst/raisersshare/fkst/fkst 的方向符合 cluster-001。


📎 完整 codex 原始输出(存档备查)
---
pr: 422
role: architect
verdict: reject
---

## Verdict
reject: the scan-root fix is architecturally aligned, but the PR introduces a refactor-history source comment in a department Lua test.

## Evidence
- `share/fkst/departments/github_publisher/main_test.lua:105` adds `-- Fix (remote-ci/conformance): hermetic CI checkouts only expose the skills that are tracked in this repo.` This is a fix-history/rationale comment in source, not current-state behavior documentation. CLAUDE.md clause: `**不写历史叙述,只写当前态**:SPEC / prompt / 部门代码 / 项目文档**不写**"Per X YYYY-MM-DD" / "曾经是 X 现改为 Y" / "## History" —— 这些都在 commit message 里。**但保留反面示例**(\`❌ 会发生什么坏事\`),反面是防护不是叙述。` The reviewer prompt also sets Old/New pattern comment policy to `none`, so refactor-history source comments should be rejected rather than preserved in code.

## What would change your verdict
Remove the added `-- Fix (remote-ci/conformance): ...` comment, or replace it with a source comment that describes only the current invariant without fix/refactor/history framing. No other architect-angle change is required.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:architect:reject

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 质量审查结论: comment

TL;DR

  • 这是什么: PR 422 的 code quality 独立审查,只看可读性、命名、复杂度、死代码和范围。
  • 结论是什么: audit scan-root 主改动可读且集中,没有看到死代码或过度抽象。
  • 需要下一步: 建议把 github_publisher 的 hermetic 测试修复拆出,或在 PR 里说明它是 CI 可审查性的必要修复。

详细说明

tunables/audit_scan_roots.txt:2share/fkst/departments/audit/main_test.lua:53 这组改动表达清楚: scan root 明确覆盖 share/fkst/departmentsshare/fkst/raisersshare/fkst/fkst,新增的 non_comment_lines helper 也有直接调用点,没有引入新的抽象层。

唯一质量侧提示是 share/fkst/departments/github_publisher/main_test.lua:105: 这里把 hermetic source scan 从单个 .claude/skills/codex-refactor-loop 放宽到所有 tracked .claude/skills。这可能是正确的 CI 修复,但它属于 github_publisher 测试环境修复,不直接属于 audit scan-root drift。按本轮 checklist 的“无 unrelated drive-by changes”,我给 comment 而不是 approve


📎 完整 codex 原始输出(存档备查)
---
pr: 422
role: quality
verdict: comment
---

## Verdict
comment: The audit scan-root change is readable and scoped, but the PR includes a small cross-department hermetic test cleanup that should be called out as a drive-by change.

## Evidence
- `tunables/audit_scan_roots.txt:2` keeps the scan-root intent explicit by naming `share/fkst/departments`, `share/fkst/raisers`, and `share/fkst/fkst` directly; no new abstraction or confusing naming was introduced.
- `share/fkst/departments/audit/main_test.lua:53` adds `non_comment_lines`, a small reachable helper used by the new assertions at lines 74 and 80; no dead private helper is introduced.
- `share/fkst/departments/audit/main_test.lua:64` adds focused regression assertions for the host-owned audit tunables, and the added block stays simple enough to review inline.
- `share/fkst/departments/github_publisher/main_test.lua:105` changes a github_publisher hermetic source scan from `.claude/skills/codex-refactor-loop` to all tracked `.claude/skills`. That may be a valid CI fix, but it is outside the audit scan-root drift described by this PR and should be split or explicitly justified as a required pre-existing test repair.

## What would change your verdict
Move the `share/fkst/departments/github_publisher/main_test.lua` hermetic scan fix to its own PR/commit, or add a clear PR rationale that this test change is required for the audit scan-root PR to be reviewable in CI.

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:quality:comment

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented Jun 2, 2026

🤖 tests reviewer r3:通过

TL;DR


详细说明

测试不是 bump-only。share/fkst/departments/audit/main_test.lua 直接读取 host tunables,要求 audit_scan_roots.txt 和每条 audit_analyzer_pack.txt 命令都覆盖 share/fkst/departments, share/fkst/raisers, share/fkst/fkst,同时拒绝旧的裸 departments / raisers roots 回归。

我也检查了新增 diff:没有新增 sleep / delay 测试节奏,没有新增 skip/manual category,没有把强断言弱化成非空类断言。在 PR head 临时 worktree 跑了 FKST_TEST_ISOLATED=1 bash scripts/run_department_lua_tests.sh,结果 TOTAL: FOUND=43 PASS=43 FAIL=0


📎 完整 codex 原始输出(存档备查)
---
pr: 422
role: tests
verdict: approve
---

## Verdict
approve: 本次 diff 的测试覆盖和测试质量足够,新增配置回归面有直接断言保护。

## Evidence
- `share/fkst/departments/audit/main_test.lua:64`: 测试直接读取 host `tunables/audit_scan_roots.txt`,不是只验证 helper 不报错。
- `share/fkst/departments/audit/main_test.lua:65`: `required_audit_package_roots` 明确要求 `share/fkst/departments`, `share/fkst/raisers`, `share/fkst/fkst` 三个 package root,覆盖 cluster-001 的核心回归面。
- `share/fkst/departments/audit/main_test.lua:74`: 测试逐行拒绝旧的裸 `departments` / `raisers` scan roots,能防止配置退回旧 top-level root。
- `share/fkst/departments/audit/main_test.lua:79`: 测试逐条检查 `audit_analyzer_pack.txt` 命令,要求每条 analyzer command 都覆盖三个 package root,不是只检查文件里出现过一次 token。
- `share/fkst/departments/audit/main_test.lua:87`: 测试拒绝 analyzer command 回到 `" departments raisers "` 旧组合,给本次 scan drift 留下 source-regression 断言。
- `share/fkst/departments/github_publisher/main_test.lua:275`: 相关变更只是让 prompt contract scan 遍历 tracked `.claude/skills` 文件,后续 `assert_lacks` 仍然验证 forbidden prompt contract 文案,没有把断言放松成非空检查。
- 稳定性检查: diff 未新增 `sleep` / `delay` pacing,未新增 skip/manual category,未看到断言弱化。
- 验证命令: 在 PR head 临时 worktree 运行 `FKST_TEST_ISOLATED=1 bash scripts/run_department_lua_tests.sh`,结果 `TOTAL: FOUND=43 PASS=43 FAIL=0`。

⟦AI:AUTO-LOOP⟧
REVIEW_DONE:422:tests:approve

⟦AI:AUTO-LOOP⟧

…itect reject)

触发来源: PR #422 review-gate r3 architect reject
行为类型: 删 share/fkst/departments/github_publisher/main_test.lua:105 的 refactor-history 源码注释(违反 CLAUDE.md 不写历史叙述 + HOST_REFACTOR_COMMENT_POLICY=none)
等价语义: 保留测试逻辑(扫 tracked .claude/skills),仅删历史注释
后续复用: 注释纪律
失败痕迹归属: re-review r4
注: controller 已 revert fix codex 越界的 Tier II root_cleanliness_guard.sh 改动(对真实 CI 失败不必要,且 Tier II 需深度共识)

⟦AI:FKST⟧
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant