You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--type svelte is not a recognized ripgrep type. Default ripgrep ships no svelte filetype; the command exits with unrecognized file type: svelte. The outer || then prints "OK" on every PR, regardless of violations.
Shell logic conflates "no matches" with "command failed." The &&/|| pair fires "OK" both when the inner pipeline returns empty AND when ripgrep errored.
Fix
rg -g '*.svelte' --type-add 'svelte:*.svelte'':global\(' src/{entities,widgets,pages,routes} -A 1 \
| rg -P "$PRIMITIVE_CLASSES" \
| tee /tmp/rule24-hits.txt
test! -s /tmp/rule24-hits.txt &&echo"OK: no upper-layer reaches into primitive internals"|| { echo"FAIL: upper-layer Svelte file overrides a primitive class via :global()";exit 1; }
Or simpler with -q:
if rg -g '*.svelte'':global\(' src/{entities,widgets,pages,routes} -A 1 | rg -qP "$PRIMITIVE_CLASSES";thenecho"FAIL: ..."&&exit 1
elseecho"OK: ..."fi
Also fix in same edit
The forbidden-class regex misses consumer-supplied class names forwarded to a primitive root (.panel-action, .update-btn, .theme-toggle, .notify-toggle, .pane-icon, .error-alert, .tab-badge, .timeline-toggle, .kind, .close, .filter-group). These are the dominant violation pattern in PR feat(ui): integrate shared/ui primitives into widgets/pages (#82 #83 #84) #85; the listed regex catches none of them. Add either explicit names or a structural rule: "any :global(.SOMETHING) whose target is also passed via class=\"SOMETHING\" to a primitive root in the same file."
The "Existing violations (known debt)" list omits pages/home/ui/HomePage.svelte (.error-alert) and writes paths without the FSD ui/ segment.
Acceptance
Running the verification snippet locally on this repo correctly:
returns non-zero + prints FAIL when there's a violation,
returns zero + prints OK when there's none.
Added to CI as a check (separate issue if scope grows).
Existing-violations list refreshed with a fresh grep, including pages/.
Source: PRD-018 SC-2 audit, finding [Arch-C1].
.claude/rules/24-shared-ui-ownership.md:127The "Verification" snippet in rule 24 reads:
Two problems:
--type svelteis not a recognized ripgrep type. Default ripgrep ships nosveltefiletype; the command exits withunrecognized file type: svelte. The outer||then prints "OK" on every PR, regardless of violations.&&/||pair fires "OK" both when the inner pipeline returns empty AND when ripgrep errored.Fix
Or simpler with
-q:Also fix in same edit
.panel-action,.update-btn,.theme-toggle,.notify-toggle,.pane-icon,.error-alert,.tab-badge,.timeline-toggle,.kind,.close,.filter-group). These are the dominant violation pattern in PR feat(ui): integrate shared/ui primitives into widgets/pages (#82 #83 #84) #85; the listed regex catches none of them. Add either explicit names or a structural rule: "any:global(.SOMETHING)whose target is also passed viaclass=\"SOMETHING\"to a primitive root in the same file."pages/home/ui/HomePage.svelte(.error-alert) and writes paths without the FSDui/segment.Acceptance
FAILwhen there's a violation,OKwhen there's none.pages/.Audit traceability
.claude/rules/24-shared-ui-ownership.md