Repository navigation
Description
Summary
/finalize-pr runs its security review only when the branch diff matches a path regex
(.claude/skills/finalize-pr/SKILL.md:78-79). That regex did not fire for #100 — a branch
whose entire point was hardening the Link atom's href guard. The agent ran a
security-reviewer pass anyway, on judgement, and that pass is the only reason the
protocol-relative-URL gap (//evil.com walking through href.startsWith('/')) was found before
merge. A gate that depends on someone overriding it is not a gate.
Widen the list to cover the client-side surfaces that have since become security-relevant.
Current behavior
src/config/api/|src/Widget\.tsx|src/lib/shape/lexical|src/components/organisms/EventPanel/|src/types/event|package\.json|(^|/)\.env|vite\.config\.ts
(.claude/skills/finalize-pr/SKILL.md:79. There is a second, content-based grep on line 82 for
newly-introduced HTML sinks — dangerouslySetInnerHTML|dompurify|DOMPurify|\.innerHTML — which
catches XSS sinks wherever they land, but nothing else.)
Gaps, each with a concrete reason:
| Missing path | Why it belongs |
|---|---|
src/lib/shape/path.ts |
Home of safePath itself — the repo's single definition of "same-origin route", the guard every untrusted webPath passes through (.claude/rules/data-layer.md:93-113). src/lib/shape/lexical is covered; the URL guard next to it is not. |
src/components/atoms/Link/ |
The atom that turns a data-driven string into an <a href>. Named explicitly in .claude/reports/100-refresh-internal-docs.md §5 as the path worth adding. |
src/styles/globals.css, scripts/postcss-scope-widget.mjs, scripts/assert-css-scoped.mjs, postcss.config.js |
That stylesheet is injected into the host document (vite-plugin-css-injected-by-js), so an unscoped selector restyles a site we don't control — the whole subject of #91/#113, which built a PostCSS scoping plugin and a CI assertion for exactly this. The files that enforce host isolation are unguarded. |
src/App.tsx |
The provider/boundary root — the error boundary, the report-modal host mounted outside it, and the client bootstrap that applies the locale. |
Worth noting the regex is also missing pnpm-lock.yaml (package.json alone misses a transitive
bump); include it if the implementer agrees it isn't noise.
The three-repo constraint
CLAUDE.md:278 states the pipeline spec .claude/docs/workflow-parity.md is kept
byte-identical across SahajAtlasWeb, SahajCloud and WeMeditateWeb (~/Documents/Projects/),
and the file's own header repeats it: "a plain diff across the three copies must show no
differences."
But the trigger paths themselves are an intentional per-repo delta, not shared text —
verify this before planning the port. workflow-parity.md:51 says the step is "Conditional
security review — only when the diff matches the repo's risky-path list", and the
"Intentional per-repo deltas" table (:80) carries one row per repo:
| Concern | SahajCloud | SahajAtlasWeb | WeMeditateWeb |
|---|---|---|---|
| Security-review trigger paths | access plugins, Clients/Managers, endpoints, storage, webhooks, payload.config | api config, Widget entry, lexical/HTML sinks, deps, env, vite config | server/, pages/preview/, wrangler/vite/sentry configs, scripts/, env files |
So the change decomposes into two parts with different porting obligations:
- The regex in
.claude/skills/finalize-pr/SKILL.md— SahajAtlasWeb-only. The siblings do
not get these paths (they have nosrc/lib/shape/, no injected widget stylesheet). - The deltas-table row in
.claude/docs/workflow-parity.md— its SahajAtlasWeb cell
summarises the list being widened, so it must be updated and the identical edit applied to
the SahajCloud and WeMeditateWeb copies of that file, or the byte-identical invariant breaks
and/sync-workflowreports drift on the next audit.
If the implementer concludes the summary cell is general enough not to need touching, that is an
acceptable outcome — but it must be stated explicitly in the report with the diff that proves the
three copies are still identical, not assumed.
Proposed changes
- Extend the path regex at
.claude/skills/finalize-pr/SKILL.md:79with the gaps above. Keep it a
single-linegrep -Ealternation and escape dots as the existing entries do
(src/Widget\.tsx,vite\.config\.ts). - Sanity-check the widened regex against real history before committing it. Both squash commits
are onmain:e1b4a3a(PR docs(claude): refresh stale internal docs and small hygiene batch #111, the docs(claude): refresh stale internal docs and small hygiene batch #100 docs+Link branch) ande730a25(PR fix(ui): scope widget css so it cannot restyle the host page #113,
the fix(ui): scope widget css so it cannot restyle the host page #91 CSS-scoping branch). The widened regex must match both —
git diff --name-only e1b4a3a~1 e1b4a3a | grep -E '<regex>'— and must not match a pure
locale-JSON or Ladle-story change. - Update the SahajAtlasWeb cell of the deltas table in
.claude/docs/workflow-parity.md:80if the
widening makes the summary inaccurate. - Port that
workflow-parity.mdedit byte-for-byte to
~/Documents/Projects/SahajCloud/.claude/docs/workflow-parity.mdand
~/Documents/Projects/WeMeditateWeb/.claude/docs/workflow-parity.md, each on its own branch/PR
in that repo — this repo's PR cannot carry them. - Run
/sync-workflow(read-only audit) afterwards and confirm it reports no drift.
Acceptance criteria
- The regex in
.claude/skills/finalize-pr/SKILL.mdmatchessrc/lib/shape/path.ts,
src/components/atoms/Link/,src/styles/globals.css,postcss.config.js, the two
scripts/*-css-*.mjs/postcss-scope-widget.mjsfiles, andsrc/App.tsx - Demonstrated against real diffs: it fires for the docs(claude): refresh stale internal docs and small hygiene batch #100 branch and the fix(ui): scope widget css so it cannot restyle the host page #91 CSS-scoping
branch, and does not fire for a locale-JSON-only or stories-only diff (paste the
commands and their output in the report) -
.claude/docs/workflow-parity.md:80's SahajAtlasWeb cell is accurate, or the report
states why it needed no change -
diffof.claude/docs/workflow-parity.mdagainst both sibling copies shows no
differences — output pasted in the report - If that file changed: a companion PR exists in SahajCloud and in WeMeditateWeb
carrying the identical edit (link both in the report). These are acceptance criteria, not
follow-ups — an un-ported edit leaves the invariant broken. -
/sync-workflow's read-only audit reports no drift after the ports land - Lint + typecheck +
pnpm test:runpass (no source change expected) - Implementation report written to
.claude/reports/<this-issue-number>-widen-security-review-paths.mdin the main checkout
at/Users/devindra/Documents/Projects/SahajAtlasWeb(.claude/reports/.gitignoreis*,
so a worktree copy would be discarded)
Parallel implementation
This ticket owns these files; no other ticket in this batch touches them:
.claude/skills/finalize-pr/SKILL.md.claude/docs/workflow-parity.md(here and the two sibling repos' copies)
Do not edit .claude/skills/finalize-pr/pr-template.md, .claude/skills/draft-ticket/,
.claude/docs/{architecture,environment}.md or .claude/rules/* — those are owned by the
accent/doc-sweep ticket in this batch. Nothing under src/ changes.
Files affected
.claude/skills/finalize-pr/SKILL.md(:78-79).claude/docs/workflow-parity.md(:80) — plus the SahajCloud and WeMeditateWeb copies
References
.claude/reports/100-refresh-internal-docs.md§5 — "The security review was not triggered
by the finalize skill's path grep … but was run anyway … It found the//evil.comgap. The grep
is worth widening to includesrc/components/atoms/Link/."- docs(claude): refresh stale internal docs and small hygiene batch #100 / PR docs(claude): refresh stale internal docs and small hygiene batch #111 (the diff that should have triggered it), fix(ui): scope widget css so it cannot restyle the host page #91 / PR fix(ui): scope widget css so it cannot restyle the host page #113 (widget CSS scoping)
CLAUDE.md:278and.claude/docs/workflow-parity.md:1-9— the byte-identical invariant.claude/skills/sync-workflow/SKILL.md— the audit that catches drift
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
fix(claude): close the gaps /code-review found in the widened list