docs: sync README + AGENTS with current pipeline-state + billing webhook code#4
Closed
Sbussiso wants to merge 1 commit into
Closed
docs: sync README + AGENTS with current pipeline-state + billing webhook code#4Sbussiso wants to merge 1 commit into
Sbussiso wants to merge 1 commit into
Conversation
…ook code README and AGENTS had drifted in three places that mattered: - Camera model / heartbeat docs still described the pre-supervisor world where `status` was effectively just online/offline. Code now records real pipeline state (`starting` / `streaming` / `restarting` / `failed` / `error` / `offline`) plus a `last_error` field the API surfaces while the camera is unhealthy. Documented in both the Data Models tables and the Architecture section. - Webhook Handling described a two-event subscription lifecycle. The real handler covers `subscription.active/pastDue`, `paymentAttempt`, `subscriptionItem.canceled/ended/freeTrialEnding`, and `organization.deleted` (which cascades org data), requires `CLERK_WEBHOOK_SECRET` (unsigned requests are rejected), and drives Clerk member limits via PLAN_MEMBER_LIMITS. Also noted the separate `PLAN_LIMITS` table that gates dashboard node/camera quotas. - MCP setup scripts now refuse to overwrite a running client's config and write JSON as UTF-8 without a BOM; both README quick-start and AGENTS setup-scripts section now call that out. No code changes.
|
Hi @Sbussiso, thanks for taking the time to open this PR. OpenSentry is source-available under AGPL-3.0 but does not currently accept external code contributions. This PR is being closed automatically — it is not a reflection of the quality of your work. If you found a bug or have an idea, we would still love to hear about it:
See CONTRIBUTING.md for the full policy. Thanks for your interest in OpenSentry. |
Sbussiso
added a commit
that referenced
this pull request
Apr 26, 2026
The DocsPage.jsx monolith mixed layout chrome, sidebar nav, OS-tab state, copy-to-clipboard helper, and 19 sections of body content in one file. PR diffs against it told reviewers nothing about scope; navigating to "the section that talks about X" required a Cmd-F instead of a file open. Phase 3 item #4 from the tech-debt audit. Layout ------ pages/ ├── DocsPage.jsx ← 130 lines: layout + sidebar + section │ composition under <DocsProvider> └── docs/ ├── context.jsx ← shared `os`, `copied`, copyToClipboard, │ installCommands; OsTabs widget ├── GettingStarted.jsx ├── CloudNodeSetup.jsx ├── Configuration.jsx ├── Deployment.jsx ├── MotionDetection.jsx ├── TerminalDashboard.jsx ├── Dashboard.jsx ├── Recording.jsx ├── CameraGroups.jsx ├── Notifications.jsx ├── Mcp.jsx ← biggest at 251 lines (was the hot spot) ├── Plans.jsx ├── Architecture.jsx ├── SecurityProcedures.jsx ├── Troubleshooting.jsx ├── Faq.jsx ├── ApiReference.jsx ├── ApiRateLimits.jsx └── Resources.jsx ← the no-id "Resources" section Shared state ------------ The pre-split version held three pieces of state most sections needed (OS selection for install snippets, "Copied!" toast flag, install- command map). Threading those into 19 component bodies as props would be noise; React Context is the right shape. DocsProvider is mounted once in DocsPage. OsTabs reads from it internally so callers don't have to thread anything through. Sections that need just the helpers grab `useDocs()`; sections that don't (Faq, Notifications, CameraGroups, Resources) import nothing from context.jsx. No behaviour change ------------------- Every section's JSX is preserved verbatim from the pre-split file — only the surrounding wrapper (function declaration, default export, imports for diagrams / Link / context) is new. The page renders the same content in the same order with the same anchor IDs, so deep links to /docs#mcp etc. keep working unchanged. Build ----- Before: DocsPage chunk = 145.51 KB / 32.61 KB gz After: DocsPage chunk = 146.86 KB / 33.36 KB gz Delta: +1.35 KB raw / +0.75 KB gz — boilerplate from per-file imports + function wrappers + export defaults across 20 new files. Trivial. Tests ----- New tests/pages/DocsPage.test.jsx (4 cases) pins: - DocsPage mounts without crashing under the new context boundary - Every section ID listed in DocsSidebar has a matching <section id> (broken anchor catches at CI time, not in production) - The id-less Resources block survives the rename - The bottom /sign-up CTA renders Suite: 33 → 37 passing. The next maintainer who needs to edit "the FAQ" opens Faq.jsx and sees only that section's content. The reviewer of the PR that touched it sees a diff against one ~95-line file, not against the 1,747-line monolith. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Documentation drift audit — code is the source of truth; docs brought back into line.
Camera.statusnow carriesstarting/streaming/restarting/failed/error/offlineplus alast_errorfield thatto_dict()surfaces while the camera is unhealthy. Data Models tables and the Architecture section in both README and AGENTS updated.app/api/webhooks.pyactually handlessubscription.active/pastDue,paymentAttempt.updated,subscriptionItem.canceled/ended/freeTrialEnding, andorganization.deleted(cascade-deletes the org's nodes, cameras, groups, MCP keys, logs, settings).CLERK_WEBHOOK_SECRETis required — unsigned requests are now rejected. Documented the member-limit table (PLAN_MEMBER_LIMITS) and the separate dashboard-quota table (PLAN_LIMITS).mcp-setup.sh/.ps1refuse to overwrite the config of a client that is currently running, or that configs are now written as UTF-8 without a BOM. Both README Quick Start and AGENTS Setup Scripts sections now call it out.No code changes — docs only.
Test plan
backend/app/models/models.py,backend/app/api/webhooks.py,backend/app/core/plans.py,backend/scripts/mcp-setup.{sh,ps1}to confirm parity