Repository navigation
chore(claude): widen the security-review trigger paths - #139
Merged
Merged
Conversation
The path grep in /finalize-pr did not match #100's branch — the one whose entire point was hardening the Link atom's href guard. A security review ran anyway, on judgement, and that is the only reason the protocol-relative-URL gap (//evil.com walking through href.startsWith('/')) was caught before merge. A gate that depends on someone overriding it is not a gate. Adds the client-side surfaces that have since become security-relevant: the same-origin/scheme guard (shape/path.ts, shape/href.ts, atoms/Link/), the host-page CSS isolation that #91/#104 built (styles/globals.css, lib/scope.ts, the PostCSS scoping script + config), the app root, the privacy opt-outs and the reporting seam Sentry hangs off, and the lockfile for a transitive bump that never touches package.json. Deliberately, not maximally: over the last 82 commits on main the widened list fires 54 times against the old 51, and two of those three additions are #111 and #136 — the href-guard branches this exists to catch. Verified to still not fire on a locale-only or stories-only diff. Closes #117 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Pre-existing drift, found while checking this ticket's byte-identical criterion: SahajCloud's #607 (3be34cc0, 2026-07-31) corrected its own cell of the "Lean gate contents" row to `lint + typecheck + typecheck:tests + test:unit` and did not port that edit to the other two copies, so all three have disagreed on line 79 since. Adopting SahajCloud's text here — it is strictly the accurate one — leaves ONE patch to carry to each sibling and lets all three converge. Refs #117 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Ardnived
added a commit
to sydevs/SahajCloud
that referenced
this pull request
Aug 8, 2026
Port of the byte-identical deltas-table row from sydevs/SahajAtlasWeb#139. Only the SahajAtlasWeb cell of the "Security-review trigger paths" row changes; SahajCloud's own cell and every other line are untouched. The spec file is kept byte-identical across the three repos, so this edit has to land here too or /sync-workflow reports drift. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Deploying sahajatlas with
|
| Latest commit: |
fa10594
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c45b046d.sahajatlas.pages.dev |
| Branch Preview URL: | https://chore-security-review-paths.sahajatlas.pages.dev |
Ardnived
added a commit
to sydevs/WeMeditateWeb
that referenced
this pull request
Aug 8, 2026
Two rows of the deltas table, both ported from other repos; nothing about WeMeditateWeb's own workflow changes. - Security-review trigger paths: the SahajAtlasWeb cell, widened in sydevs/SahajAtlasWeb#139. - Lean gate contents: the SahajCloud cell, corrected by that repo's #607 (3be34cc0) and never ported, so all three copies have disagreed on that line since 2026-07-31. The spec is kept byte-identical across the three repos; with this and sydevs/SahajCloud#622 all three match again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Three findings, all accepted. Cost: ONE extra firing across the last 84 commits (54 → 55), measured before accepting. - Unanchor the five module entries so a SPEC travels with its module. The `\.ts` suffixes excluded href.test.ts, path.test.ts, privacy.test.ts and the two report specs — so deleting an assertion triggered nothing, which hollowed out the very paragraph telling readers to prefer an assertion over a path. The pre-existing entries (src/config/api/, src/types/event, shape/lexical, EventDetails/) already behaved this way; the new ones were the inconsistent ones. - Add src/lib/shape/hash — .claude/agents/security-reviewer.md names it beside Widget.tsx as the host trust boundary, "an untrusted input picking a branch, so audit both" (#92). Widget.tsx was listed and hash.ts was not: the same asymmetry as lexical-vs-path that this ticket exists to fix. - Broaden to src/styles/ (vaul.css is the other half of the injected sheet) and add patches/ — a patch is arbitrary code applied to a dependency, and patches/[email protected] exists precisely because vaul leaked a bare @Keyframes into host pages. Also rewrites the "what does not belong here" paragraph, which cited href.test.ts as an example of an excluded surface while href.ts sat in the list two lines above. It now names the genuinely-absent i18n-options.ts and explains the unanchoring rule instead. The deltas-table cell follows the list, so the sibling ports were refreshed. Refs #117 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Ardnived
added a commit
to sydevs/SahajCloud
that referenced
this pull request
Aug 8, 2026
Follows the code-review pass on sydevs/SahajAtlasWeb#139, which widened that repo's list further (host-fragment routing, the rest of the injected stylesheet, dependency patches) and unanchored the module entries so a spec travels with its module. Only the SahajAtlasWeb cell moves. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Ardnived
added a commit
to sydevs/WeMeditateWeb
that referenced
this pull request
Aug 8, 2026
Follows the code-review pass on sydevs/SahajAtlasWeb#139, which widened that repo's list further (host-fragment routing, the rest of the injected stylesheet, dependency patches) and unanchored the module entries so a spec travels with its module. Only the SahajAtlasWeb cell moves. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Deploying sahajatlas-design with
|
| Latest commit: |
fa10594
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://74006083.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://chore-security-review-paths.sahajatlas-design.pages.dev |
Ardnived
added a commit
to sydevs/SahajCloud
that referenced
this pull request
Aug 11, 2026
* docs(claude): widen SahajAtlasWeb's security-review trigger paths Port of the byte-identical deltas-table row from sydevs/SahajAtlasWeb#139. Only the SahajAtlasWeb cell of the "Security-review trigger paths" row changes; SahajCloud's own cell and every other line are untouched. The spec file is kept byte-identical across the three repos, so this edit has to land here too or /sync-workflow reports drift. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs(claude): refresh the ported trigger-paths cell Follows the code-review pass on sydevs/SahajAtlasWeb#139, which widened that repo's list further (host-fragment routing, the rest of the injected stylesheet, dependency patches) and unanchored the module entries so a spec travels with its module. Only the SahajAtlasWeb cell moves. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/finalize-pr's security-review path grep did not match docs(claude): refresh stale internal docs and small hygiene batch #100's branch — the one whose entire point was hardening theLinkatom's href guard. Asecurity-reviewerpass ran anyway, on judgement, and that is the only reason the protocol-relative-URL gap (//evil.comwalking throughhref.startsWith('/')) was caught before merge. A gate that depends on somebody overriding it is not a gate..claude/docs/workflow-parity.mdso the three-repo byte-identical invariant can actually be restored.Changes
.claude/skills/finalize-pr/SKILL.md— the path regex, its comment, the prose above it, and a new note on how to widen it (deliberately, never maximally) plus what deliberately stays out..claude/docs/workflow-parity.md— the SahajAtlasWeb cell of the "Security-review trigger paths" row (80), and the "Lean gate contents" row (79) re-synced from SahajCloud.What was added, and what earns each its place
src/lib/shape/pathsafePath, the repo's single definition of "same-origin route".src/lib/shape/lexicalwas covered and the URL guard beside it was not — backwards.src/lib/shape/hrefisSafeHrefhere; it is the last gate before any JSX<a href>. Ajavascript:string past it runs in the host page's realm.src/components/atoms/Link/.claude/reports/100-refresh-internal-docs.md§5 as the path worth adding.src/lib/shape/hash.claude/agents/security-reviewer.mdnames it besideWidget.tsxas the host trust boundary —claimFragment(mountRoute(…)), "an untrusted input picking a branch, so audit both" (#92).Widget.tsxwas listed; this was not.src/styles/,src/lib/scope,scripts/[^/]*css,postcss.config.jslib/scope.tsnames the scope the PostCSS pass rewrites every selector under, andvaul.cssis the other half of the sheet.src/App.tsxRootBoundary, the report-modal host mounted outside it, the client bootstrap.src/config/privacysrc/lib/reportBrowserClient/Scoperather thanSentry.init(which would hook the host page's global error events). It decides what leaves the visitor's browser.pnpm-lock.yaml,patches/package.json, and arbitrary code applied to a dependency —patches/[email protected]exists precisely because vaul leaked a bare@keyframesinto host pages.The module entries are unanchored on purpose (
src/lib/shape/path, notpath\.ts), so a spec travels with its module. Several of these guards are enforced by an assertion rather than by a reader —href.test.tspins the JSX-anchor inventory to exactly three components,path.test.tspins//evil.comand the tab/LF/CR forms — and deleting one of those assertions is the diff most worth seeing. The pre-existing entries (src/config/api/,src/types/event,src/lib/shape/lexical,EventDetails/) already behaved this way.Deliberately, not maximally
A trigger that fires on everything is worth no more than one that never fires, because it stops being read. Measured over the last 84 commits on
main: the old list fires 51 times, this one 55. Newly caught:e1b4a3a(docs(claude): refresh stale internal docs and small hygiene batch #111) — the docs(claude): refresh stale internal docs and small hygiene batch #100 Link-hardening branch. The whole point of the ticket.31e61bf(refactor(ui): gate every anchor href through one predicate #136) —refactor(ui): gate every anchor href through one predicate.21ca7bd(feat(map): show recurrence + time popover on event pin hover #73) — matched onsrc/styles/globals.css(the.event-pin-popoverchrome), a genuine host-CSS edit.Two candidates were considered and left out:
src/config/i18n-options.ts(its one privacy property,caches: [], is asserted ati18n-options.test.ts:158) andtailwind.config.js(whatever it emits,scripts/assert-css-scoped.mjsfails the build if it escapes the scope). A red gate is faster and surer than a review — the note in SKILL.md now says to prefer adding the assertion over adding the path.Evidence (run against the regex extracted from the committed file, not a copy)
Must fire —
git diff --name-only <c>~1 <c> | grep -E "$RX":#113 did fire before — but only via
package.jsonandsrc/Widget.tsx. A pure CSS-scoping change would not have.Must not fire (all six produce no match):
Verification
pnpm lint)pnpm typecheck)pnpm test:run)src/changed; skill + doc text only.claude/**, matching neither the widened path list nor the content-based HTML-sink grep/code-review: one dispatched pass. Three should-fix findings, all accepted and fixed infa10594(they cost one extra firing across 84 commits, measured before accepting). Nothing dismissed.Three-repo parity
.claude/docs/workflow-parity.mdis kept byte-identical across SahajAtlasWeb, SahajCloud and WeMeditateWeb. Checking that criterion turned up pre-existing drift predating this ticket: SahajCloud's #607 (3be34cc0, 2026-07-31) corrected its own cell of the Lean gate contents row and never ported the edit, so all three have disagreed on line 79 since. Read from each repo'sorigin/main, before this branch:This PR adopts SahajCloud's line-79 text (strictly the accurate one), which leaves one patch per sibling and lets all three converge.
Companion PRs — both open and already carrying the final text:
All three PR branches now hold a byte-identical copy of the file (md5
3fd59b4bc8674854fb619f7aa3773ae7, verified via the contents API). All three must merge for the invariant to hold.Notes for reviewer
grep -Ealternation with dots escaped, as the existing entries do; ERE validity confirmed under BSDgrep -Eand Pythonre.scripts/[^/]*cssis a pattern rather than two literal filenames so the CSS-scoping family survives a rename; repo-wide it matches only the threepostcss-scope-widget.*/assert-css-scoped.mjsfiles.679fad7) so it can be reviewed apart from the widening.Closes #117
🤖 Generated with Claude Code