Skip to content

Add club analytics and group management workspace - #341

Open
BASIC-BIT wants to merge 44 commits into
mainfrom
codex/club-staff-workspace
Open

BASIC-BIT wants to merge 44 commits into
mainfrom
codex/club-staff-workspace

Conversation

@BASIC-BIT

@BASIC-BIT BASIC-BIT commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

[AGENT] Adds the club staff workspace for group analytics and management. Home uses activity bars and total-membership history; Analytics provides membership movement, local-day drilldown, and instance history with peak and time-weighted average population. Staff roles and category visibility control access independently of VRChat permissions.

The management screens cover members, Posts, instances, explicit invitation lists, and scheduled actions. Execution rechecks human and bot authority, respects shared request budgets and the 15-minute deadline, and never automatically retries uncertain submitted writes. Failure notifications use in-app delivery and deployment-enabled SES email, disabled by default.

Validation includes backend and worker suites, web tests/typechecking, production web and documentation builds, desktop/mobile fixture checks, and real local Clerk browser flows for staff invitation acceptance and analytics navigation/preferences. Synthetic test integrations are blocked, kill-switched, and unassigned; disposable test data and accounts were cleaned up.

BASIC approved the remaining exact copy on September 16. Live VRChat behavior and a configured email-delivery smoke test remain outstanding. The implementation status and release-review documents list those proof boundaries. No hosted deployment, real group management action, or email delivery was performed during implementation.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

PR verification report

All configured preview and verification checks passed.

Check Result Evidence
Mutation data flow PASSED Open artifact
Hosted data flow PASSED Open artifact
Public route screenshots PASSED Open artifact
Public route image diff PASSED Open artifact
Storybook screenshots PASSED Open artifact
Storybook image diff PASSED Open artifact
Changed visual baselines (2)
desktop-chromium / community-telemetry
desktop-chromium / community-telemetry
mobile-chromium / community-telemetry
mobile-chromium / community-telemetry

Updated from Baseline Checks run 36087622680, attempt 1 for e178590. This comment is updated in place.

@BASIC-BIT
BASIC-BIT marked this pull request as ready for review September 15, 2026 04:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T03:03:53.939756Z e178590 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

[AGENT]

Claude Review

Claude review for commit 7625af2f2e4cc0a522a9913099cb60b23a004122 is unavailable because the skip-claude-review label is applied.

This is not a current review or approval.

@BASIC-BIT

Copy link
Copy Markdown
Owner Author

[AGENT] @codex review

Please review the current head, 4d08839. The follow-up fixes MDX placeholder escaping in the release-review document; the full local documentation verification now passes. Please retain any valid findings from the initial implementation review.

@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown

Greptile Summary

This PR introduces a comprehensive club workspace spanning analytics, staff roles and visibility, provider-backed management operations, invitations, scheduled actions, and failure notifications. It also expands telemetry retention and worker execution infrastructure.

  • Adds category-filtered analytics, local-day drilldowns, instance history, and dashboard preferences.
  • Adds staff roles, bearer invitation links, delegated permissions, and owner-controlled visibility.
  • Adds durable, budget-aware provider reads and writes for members, posts, instances, and invitation batches.
  • Adds in-app and SES failure notification infrastructure.
  • Removes age-based raw telemetry compaction and adds extensive backend, worker, web, and browser coverage.
  • The review found blocking gaps in email consent, authorized-but-unsent operation handling, and preservation of post role restrictions, plus one explicit public-copy rule violation.

Confidence Score: 2/5

The PR is not safe to merge until email consent is enforced, authorized-but-unsent operations remain recoverable, post role restrictions survive editing, and the public-copy rule violation is corrected.

Three concrete behavior gaps can respectively send unrequested email, permanently strand a provider action that was never attempted, and broaden a restricted post's audience; an explicit repository copy requirement is also violated.

Files Needing Attention: convex/clubNotifications.ts, workers/group-telemetry/club-operation-jobs.mjs, workers/group-telemetry/club-read-jobs.mjs, apps/web/src/app/account/communities/[slug]/telemetry/community-telemetry-dashboard.tsx

Important Files Changed

Filename Overview
convex/clubNotifications.ts Adds permission-filtered in-app notifications and SES claim handling, but email eligibility lacks the stated recipient-level opt-in.
workers/group-telemetry/club-operation-jobs.mjs Adds budgeted and reauthorized operation execution, but marks work submitted before final checks can still prevent transport.
workers/group-telemetry/club-read-jobs.mjs Adds narrow provider projections, but the posts projection loses role restrictions required for safe editing.
convex/clubOperations.ts Implements the durable operation state machine, authorization, deadlines, dependencies, and terminal outcomes.
convex/clubStaff.ts Implements owner and delegated staff authority, role management, invitations, and category visibility.
convex/clubAnalytics.ts Implements category-gated analytics queries, bounded ranges, pagination, summaries, and preferences.
apps/web/src/app/account/communities/[slug]/telemetry/community-telemetry-dashboard.tsx Applies category-aware telemetry rendering but introduces a public-facing glyph forbidden by repository policy.
convex/schema.ts Adds the persistence model and indexes for club roles, operations, notifications, reads, invitations, and membership history.

Sequence Diagram

sequenceDiagram
  participant Staff as Club staff UI
  participant Convex as Convex operation queue
  participant Worker as Telemetry worker
  participant VRChat as VRChat provider
  Staff->>Convex: Enqueue reviewed operation
  Convex-->>Worker: Claim payload and deadline
  Worker->>VRChat: Read current authority and target state
  Worker->>Convex: Reauthorize human, feature, and provider grants
  Convex-->>Worker: Mark submitted
  Worker->>Worker: Final budget and deadline checks
  alt Checks pass
    Worker->>VRChat: Single write attempt
    Worker->>Convex: Record outcome
  else Checks expire
    Worker->>Convex: Record indeterminate without write
  end
Loading
Prompt To Fix All With AI
### Issue 1
convex/clubNotifications.ts:143-152
**Email ignores recipient consent**

The PR describes operation email as opt-in, but this path sends to any authorized user with a verified address once the deployment-wide switch is enabled. Recipients have no preference with which to decline these messages, so enabling delivery sends unsolicited failure emails to every qualifying user. Add and enforce recipient-level consent before returning an address.

### Issue 2
workers/group-telemetry/club-operation-jobs.mjs:30-35
**Unsent actions become indeterminate**

`submitted` is set immediately after server authorization, before the budget wrapper's final reservation, deadline, and capacity checks. If authorization consumes the remaining window, those checks prevent `provider.request` from running, but the operation is still completed as terminally indeterminate. Staff are then told the outcome is unknown and cannot retry even though no provider write was attempted. Keep the action recoverable until the transport attempt begins, or represent the authorized-but-unsent state separately.

### Issue 3
workers/group-telemetry/club-read-jobs.mjs:62-78
**Post restrictions are discarded**

This provider-post projection drops `roleIds`, while the edit screen rebuilds the replacement payload from the projected post. Opening a role-restricted post from Published posts therefore creates an edit without its original role allowlist, which can broaden the post's audience unexpectedly. Project and validate `roleIds` through this read path and cover editing an existing restricted post.

### Issue 4
apps/web/src/app/account/communities/[slug]/telemetry/community-telemetry-dashboard.tsx:117
**Formatter uses banned punctuation**

The changed formatter emits an em dash as user-facing fallback text. This violates the repository directive that public-facing copy must never use an em dash. Replace it with approved fallback wording before merging.

```suggestion
    ? "Not available"
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "docs(clubs): refresh release verificatio..." | Re-trigger Greptile

Comment thread convex/clubNotifications.ts
Comment thread workers/group-telemetry/club-operation-jobs.mjs
Comment thread workers/group-telemetry/club-read-jobs.mjs
@BASIC-BIT

Copy link
Copy Markdown
Owner Author

[AGENT] @codex review

Please review current head 1af5b9e, including the post-role restriction and authorized-but-unsent fixes. All four earlier threads have individual dispositions. The email requirement is deployment-enabled transactional failure notification per locked Q31-Q33, not recipient-level subscription opt-in.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1af5b9e3e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/app/account/communities/[slug]/club-posts.tsx
Comment thread convex/http.ts
Comment thread workers/group-telemetry/club-read-jobs.mjs
Comment thread convex/clubProviderReads.ts
@BASIC-BIT

Copy link
Copy Markdown
Owner Author

[AGENT] @codex review

Please review current head 2a72d36. The HTTP epoch argument contract now has real HTTP-through-mutation coverage, pending provider reads wake the collector, and delayed reads refresh authority or return an explicit stale-data failure. Linux telemetry baselines were updated from inspected CI output. The separate exact-copy approval thread remains open pending BASIC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a72d3610d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubProviderReads.ts Outdated
Comment thread convex/clubMembership.ts Outdated
Comment thread convex/clubOperations.ts
Comment thread convex/events.ts
Comment thread apps/web/src/app/account/communities/[slug]/club-operation-model.ts Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-scheduled.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3e7f97eda

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubStaff.ts Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-members.tsx
Comment thread apps/web/src/app/account/communities/[slug]/club-analytics-model.ts
Comment thread convex/communityTelemetry.ts Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-connection.tsx Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-workspace-model.ts
@BASIC-BIT

Copy link
Copy Markdown
Owner Author

[AGENT] @codex review

Please review current head f12e60e. The only change since the completed 4ffbabc review is explicit URL navigation synchronization in the profile-submission test. Fresh Baseline Checks run 35065907898 and CodeQL passed, including the previously failing data-flow check. The exact-copy approval thread remains open pending BASIC.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: f12e60e337

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7625af2f2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubOperations.ts
Comment thread docs/planning/group-instance-analytics/operation-notifications.md Outdated
Comment thread convex/clubNotifications.ts Outdated
@BASIC-BIT BASIC-BIT added the skip-claude-review Skip the bounded Claude PR review label Sep 23, 2026
@BASIC-BIT

Copy link
Copy Markdown
Owner Author

[AGENT] @codex review

Please review current head fb0af9a. The closure-retry and browser-clock findings are fixed, independently reviewed, and resolved. Freshness now uses server remaining lifetime, unique query attempts, and monotonic aging, including remount, cached-result, and pending-completion cases. Local evidence includes 70 browser checks, 887 backend tests, 9 focused web tests, both typechecks, lint, and docs verification. The separate submitted-result authentication finding remains open with an explicit pending-authorization disposition; its proposal is not applied.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb0af9a278

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/app/account/communities/[slug]/club-members.tsx Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-analytics.tsx Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-provider-read.ts Outdated
Comment thread convex/communityTelemetry.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8766084cac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/_communityTelemetryPublic.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0eacfd31fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/communityTelemetry.ts Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-analytics.tsx Outdated
Comment thread convex/clubOperations.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38054900ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubOperations.ts Outdated
Comment thread convex/clubAnalytics.ts Outdated
Comment thread convex/clubInvitations.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db3bddd6dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubAnalytics.ts Outdated
Comment thread convex/clubProviderReads.ts
Comment thread convex/clubAnalytics.ts
Comment thread convex/clubAnalytics.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfe03571c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubStaff.ts Outdated
Comment thread convex/clubOperations.ts
Comment thread convex/clubStaff.ts Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-invitation-batches.tsx Outdated
Comment thread apps/web/src/app/account/communities/[slug]/club-workspace-model.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e178590ac3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread convex/clubAnalytics.ts
Comment on lines +645 to +649
.filter((session) =>
session.integrationId === state.integration!._id &&
(args.kind === "live"
? liveObservedAt(session) !== null
: args.kind === "past" ? session.state === "closed" : true),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter closed sessions before paginating

When kind is past, pagination is performed across every session before open sessions are removed. If the newest page consists of open sessions while older closed sessions exist, this returns an empty page with isDone: false, so a caller can incorrectly present no past instances until it follows one or more empty continuation pages. Query the indexed closed-session set before applying the requested page size.

Useful? React with 👍 / 👎.

Comment on lines +27 to +31
const result = await new ClubProvider({ client: provider, groupId: assignment.vrchatGroupId, expectedUserId, clock }).readPage("audit", {
n: 100, offset: scan.nextOffset, startDate: new Date(scan.startAt).toISOString(), endDate: new Date(scan.endAt).toISOString(),
});
const events = normalizeMembershipAuditPage(result.items, { groupId: scope.groupId, startAt: scan.startAt, endAt: scan.endAt });
await control.send("membership_scan_page", { ...scope, scanId: scan.scanId, pageNumber: scan.nextPage, events, sourceCount: result.items.length, exhausted: result.nextOffset === null });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reconcile mutable audit pages before certifying coverage

When a scan spans multiple provider pages, each page is fetched on a later poll using a raw offset, so audit entries inserted between polls shift the remaining offsets and can make the worker duplicate some rows while permanently skipping others. Nevertheless, the first response with nextOffset === null is submitted as exhausted, causing ingestBatch to certify the entire window and report incomplete joins/departures, including false zeros, as complete. The canonical membership contract already calls out that changing offset pagination requires overlap or reconciliation, so add that evidence before marking coverage complete.

AGENTS.md reference: AGENTS.md:L115-L119

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-claude-review Skip the bounded Claude PR review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant