refactor: The Plan#2275
Draft
charlesvien wants to merge 1 commit into
Draft
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
adamleithp
reviewed
May 22, 2026
| - **R8** No `container.get(...)` inside service methods. Constructor injection only. A circular dep means the boundary is wrong; split or invert via events. | ||
| - **R9** Subscriptions are wired once per feature in `apps/code/src/renderer/features/<feature>/subscriptions.ts`, started at app boot. Components do not start subscriptions ad hoc. | ||
| - **R10** tRPC routers are one-liners. No inline business logic. No reaching past the service to a repository. No router without a backing service. | ||
|
|
Contributor
There was a problem hiding this comment.
Add in templates use Posthog/quill for everything on the rendering layer that's available
Contributor
There was a problem hiding this comment.
Furthermore, should we consider a router? If this becomes the basis of the future, then we need a strong router... I'd suggest tanstack router (or even base the whole thing on tanstack start)... the devtools for the ecosystem is just incredible.
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.

Problem
This is the w.i.p. architectural plan for PostHog Code. It defines what the next version of the codebase looks like, where each kind of code lives, how the pieces talk and the rules every PR (human or agent) follows.
We are doing this because the codebase has drifted into "business logic everywhere", time to move mountains!
Changes
How did you test this?
Publish to changelog?