Repository navigation
chore(ui/.claude): delete the nested guard hooks that no session loads - #27923
Conversation
After the monorepo merge `ui/` is no session's project root, so Claude Code reads the root `.claude/settings.json` and never the nested one. The four ui guard hooks (guard-main-checkout, guard-main-checkout-bash, guard-shared-stash, guard-tree-enum, each with its self-test) never fire, yet they read as live guardrails. The root `.claude/hooks/` carries the same four guards with identical verdict logic and wires them in the root settings. Delete the eight files and the `hooks` block of `ui/.claude/settings.json` that wired them; the file keeps its permissions block and stays valid JSON. Move the `ui-claude-tree` specimen in check-governed-merges' self-test to `ui/.claude/skills/verify/SKILL.md`, a surviving file under the row, so the row's Tier H assertions keep their teeth. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cxp4Fjwh9pEpn19fBR
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract-review-claim: session_016WV4d1QkPVVzNz3FJqb2iS · head 28502c6 · 2026-10-30T04:04Z |
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract reviewServed-tier: ① Derived judgmentsDiff on
② Semver levelNo published package changes; ③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS Must-fix: none. Should-fix (not blocking):
|
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS 维护者速读
席位意见:ACCEPT。契约复核 PASS,没有 must-fix。唯一的 should-fix 是从 席位核对
|
Requested by Elon · project thread
Fixes #27260
Part of #26080
Clause-②: no
Metadata-protocol: none
What
After the monorepo merge,
ui/is no session's project root: Claude Code reads the root.claude/settings.json, neverui/.claude/settings.json. So the four nested ui guard hooks never fire, yet they read as live guardrails and cost a governed review on every change.ui/.claude/hooks/*(8 files:guard-main-checkout{,-bash},guard-shared-stash,guard-tree-enum, each.sh+.selftest.sh).hooksblock ofui/.claude/settings.jsonthat wired them (old L37–61). Thepermissionsblock stays; the file is still valid JSON.ui-claude-treespecimen inscripts/pm/check-governed-merges.mjsself-test fromui/.claude/hooks/guard-main-checkout.shtoui/.claude/skills/verify/SKILL.md, a surviving file under the same row, so the row's Tier H assertions (the-ui-claude-tree-specimen-is-governed-by-its-own-row-alone,every-ui-row-lands-Tier-H-the-ui-claude-tree-included) keep their teeth.Out of scope and untouched:
ui/.claude/launch.json,ui/.claude/skills/**, thepermissionsblock, and the synthetic.claude/hooks/*fixtures inui/scripts/__tests__/*.Per-hook coverage (measured on
8c7021dfb)Each ui hook carried a
# copied from objectstack@…header. Compared with comment lines stripped, the verdict logic is identical to the root copy; only issue references and the refusal message wording differ.guard-main-checkout.sh(+ selftest).claude/hooks/guard-main-checkout.sh.claude/settings.jsonPreToolUseEdit|Write|NotebookEditguard-main-checkout-bash.sh(+ selftest).claude/hooks/guard-main-checkout-bash.shBashobjectui#3435vs#5790)guard-shared-stash.sh(+ selftest).claude/hooks/guard-shared-stash.shBashguard-tree-enum.sh(+ selftest).claude/hooks/guard-tree-enum.shBashThe root guards protect the whole checkout,
ui/**included, becauseui/sits inside it. The root self-tests keep running inlint.yml(find .claude/hooks -name '*.selftest.sh', root only), so CI loses no self-test.Readers swept before the edit
ui/.claude/settings.jsonL44/L53/L57/L61: edited (block removed).scripts/pm/check-governed-merges.mjs:4519: specimen moved;:4525reads it throughUI_SPECIMENS.ui/scripts/check-bash32-floor.mjs:242declares.claude/hooks/**as a population root (it is now an empty root;pnpm --dir ui run check:bash32-floorstill finds 5 shell files and passes);ui/scripts/check-governed-queue-guard.mjs:1326(synthetic path string);ui/scripts/dependabot-merge-gate.mjs:232(prose about objectui's old workflow);ui/scripts/__tests__/bash32-floor-wiring.test.ts:126andcheck-shell-escape-residue.test.ts(synthetic fixtures).Gates
node scripts/pm/check-governed-merges.mjs --self-test: 537 assertions before and after, exit 0. Every familydispatch-gates --commandsderives (36) ran green; see the card report.uibash32-floor--self-testand run: exit 0.维护者速读
ui/.claude/hooks/下 8 个守卫脚本,以及ui/.claude/settings.json里接线它们的 hooks 段;治理自测的ui-claude-tree样本改指ui/.claude/skills/verify/SKILL.md。ui/不是任何会话的项目根,这些嵌套 hook 从不触发,却看起来像在保护,每次改动还要走受管评审。.claude/hooks/有同名四个守卫,判定逻辑一致,已在根 settings 接线,保护不减;回滚即 revert 本 PR。check-governed-merges.mjs那一行样本改动。node scripts/pm/check-governed-merges.mjs --self-test仍是 537 条全过;ui/.claude/settings.json仍是合法 JSON。🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cxp4Fjwh9pEpn19fBR