Skip to content

📝 Document the session-gate exemption to the load* loader convention - #3318

Open
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/docsloaders-document-the-session-gate-30bf39
Open

posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/docsloaders-document-the-session-gate-30bf39

Conversation

@posthog-eu

@posthog-eu posthog-eu Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Description

Documents the session-gate exemption to the load* loader naming convention, and enforces the convention in check:structure.

Problem

  • The loader placement rule in CLAUDE.md told contributors two incompatible things in one sentence: every loader uses a load* prefix, then named getCurrent*, getActive*, and require* session gates as the gates a loader should call.
  • 7 of 28 exported loaders skipped the prefix. This cost the team, not users — no runtime behavior changes. Contributors and coding agents reading a self-contradicting rule guessed differently each time, and check:structure validated only file names, so nothing caught the drift.

Changes

  • CLAUDE.md: states the exemption. The session gates keep their getCurrent* / getActive* / require* names because get* vs require* encodes whether the gate returns null or redirects — real information a rename would lose. Those three prefixes are the only exemption; every other loader uses load*.
  • Rename getSeatUsageloadSeatUsage: it is a plain read with no gate behavior, so it takes the load* prefix. Updated its three call sites in members-page.tsx and settings/billing/page.tsx.
  • check:structure: now checks every value exported from a loaders.ts file against the allowed prefixes, so the convention cannot drift again. Passes on all 28 exports.

Fixes RAL-1637.

Checklist

Please check off all the following items with an "x" in the boxes before requesting a review.

  • I have performed a self-review of my code
  • My code follows the code style of this project
  • I have commented my code, particularly in hard-to-understand areas

Created with PostHog Desktop from this inbox report, addressing RAL-1637.

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
app Ready Ready Preview Sep 18, 2026 7:31pm UTC
landing Ready Ready Preview Sep 18, 2026 7:31pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 19689def-b947-4877-82e9-badfaf8a0dbd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The loader placement rule in CLAUDE.md said every loader uses a `load*`
prefix, then named `getCurrent*`, `getActive*`, and `require*` session
gates in the same sentence. The session gates keep those names because
`get*` vs `require*` encodes whether the gate returns null or redirects.

- State the session-gate exemption in CLAUDE.md.
- Rename `getSeatUsage` to `loadSeatUsage` (a plain read, not a gate) and
  its call sites.
- Add the loader export-name rule to check:structure so the convention
  cannot drift again.

Generated-By: PostHog Desktop
Task-Id: 33240b31-a6f7-4e54-83fc-d41a5113cef0
@posthog-eu
posthog-eu Bot force-pushed the posthog-self-driving/docsloaders-document-the-session-gate-30bf39 branch from e2d992e to 0445b74 Compare September 18, 2026 19:27
@posthog-eu
posthog-eu Bot marked this pull request as ready for review September 18, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants