Skip to content

docs: sync README + AGENTS with current pipeline-state + billing webhook code#4

Closed
Sbussiso wants to merge 1 commit into
masterfrom
claude/sharp-mendel-U1PI8
Closed

docs: sync README + AGENTS with current pipeline-state + billing webhook code#4
Sbussiso wants to merge 1 commit into
masterfrom
claude/sharp-mendel-U1PI8

Conversation

@Sbussiso

Copy link
Copy Markdown
Contributor

Summary

Documentation drift audit — code is the source of truth; docs brought back into line.

  • Camera pipeline state: Camera.status now carries starting / streaming / restarting / failed / error / offline plus a last_error field that to_dict() surfaces while the camera is unhealthy. Data Models tables and the Architecture section in both README and AGENTS updated.
  • Clerk webhook handler: docs described a two-event subscription lifecycle, but app/api/webhooks.py actually handles subscription.active/pastDue, paymentAttempt.updated, subscriptionItem.canceled/ended/freeTrialEnding, and organization.deleted (cascade-deletes the org's nodes, cameras, groups, MCP keys, logs, settings). CLERK_WEBHOOK_SECRET is required — unsigned requests are now rejected. Documented the member-limit table (PLAN_MEMBER_LIMITS) and the separate dashboard-quota table (PLAN_LIMITS).
  • MCP setup scripts: docs didn't mention that mcp-setup.sh / .ps1 refuse 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

  • Re-read updated sections against backend/app/models/models.py, backend/app/api/webhooks.py, backend/app/core/plans.py, backend/scripts/mcp-setup.{sh,ps1} to confirm parity

…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.
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot closed this Apr 14, 2026
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>
@Sbussiso Sbussiso deleted the claude/sharp-mendel-U1PI8 branch April 26, 2026 06:43
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.

2 participants