Integrate shared package and pending app updates - #113
Conversation
Replace duplicated types (Chamber, Owner, TxType, SecurityRef, MktCapBucket) with imports from the cross-app shared package. Add contracts.ts barrel re-exporting all shared types, schemas, constants, and utilities. Files changed: - src/shared/types.ts — import Chamber/Owner/TxType from shared - src/enrichment/types.ts — import SecurityRef/MktCapBucket from shared - src/enrichment/compute.ts — import marketCapBucket from shared - src/analytics/compute.ts — import bracketMidpoint from shared - src/analytics/sql.ts — import PartyBucket/WINDOW_PRESETS from shared - src/shared/contracts.ts (new) — barrel re-exports for shared package - package.json — add shared package dep Verification: npx tsc --noEmit — 0 errors Docs: docs/rollouts/2026-06-29-congress-trading-shared.md Co-authored-by: Cursor <cursoragent@cursor.com>
…into codex/congress-trading-shared-integration-20260629
…29' into codex/congress-trading-shared-integration-20260629 # Conflicts: # app/src/admin/routes.ts # app/src/shared/types.ts # app/src/ui/dashboardHtml.ts
…-20260629' into codex/congress-trading-shared-integration-20260629
…s-trading-shared-integration-20260629 # Conflicts: # app/package-lock.json # app/package.json
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_7e7dcb14-b7d6-44ec-9e41-ea9a1e267710) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21a81344c4
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb3f8cf3a1
ℹ️ 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".
| <button data-view="review" data-mobile="Review" data-icon="✓" data-admin-tab="true" hidden>Review Queue <span id="reviewCount"></span></button> | ||
| <button data-view="subs" data-mobile="Alerts" data-icon="↗">Subscriptions</button> | ||
| <button data-view="admin" data-mobile="Admin" data-icon="⚙" data-admin-tab="true" hidden>Admin · Cadence</button> | ||
| <button data-view="admin" data-mobile="Admin" data-icon="⚙">Admin · Cadence</button> |
There was a problem hiding this comment.
Clear admin panels when token is removed
Because the Admin tab is no longer part of the data-admin-tab set, applyAdminVisibility() will not move the user away from it when clearAdminToken() removes the saved bearer token. If an operator clears a token while the Admin tab is active, the previously loaded health/diagnostics/user panels remain visible in the DOM without a valid admin context; keep this view in the admin reset path or clear/reload its contents when the token is removed.
Useful? React with 👍 / 👎.
| env: | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }} |
There was a problem hiding this comment.
Fail deploy when migration token is missing
In a GitHub Actions run where ADMIN_TOKEN is absent or renamed, this expands to an empty env var; scripts/ship.sh treats that as optional and skips POST /api/admin/migrate while still exiting successfully. That can deploy production code without applying the canonical idempotent schema path, so add a preflight that fails the workflow when the admin migration token is not available.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,18 @@ | |||
| version: 2 | |||
| updates: | |||
| - package-ecosystem: npm | |||
There was a problem hiding this comment.
Provide Dependabot access to private package auth
GitHub's Dependabot-on-Actions docs state that Dependabot-triggered pull_request runs are treated like fork runs and do not receive normal Actions secrets; this new npm Dependabot config will therefore open PRs whose CI cannot read SHARED_PACKAGE_DEPLOY_KEY or GH_PAT in the private-dependency setup step and exits before npm ci. Add matching Dependabot secrets or route Dependabot PRs through a workflow path that does not require the private package credentials.
Useful? React with 👍 / 👎.
Integrates the shared contract package, admin diagnostics/cross-app manifest updates, and app/workflow hardening.\n\nLocal verification:\n- npm ci\n- npm run typecheck\n- npm test (66 files, 612 tests)
Note
Medium Risk
Production deploy and preview workflows plus Sentry on the Worker entrypoint affect release and observability paths; CI now hard-requires GH_PAT for installs. Capabilities/diagnostics are additive and token-gated.
Overview
Adds
@jaywedgeworth22/congress-trading-shared(pinned GitHub dep) and@sentry/cloudflare, wraps the Worker inSentry.withSentry, and documentsSENTRY_DSNin dev vars.Introduces token-gated
GET /api/export/capabilities(integration contract, import limits, endpoints—no secret echo) plus docs for sibling apps; extends admin diagnostics with provider usage fromsecurities_refand separate price / SPX / performance cache connection rows.GitHub Actions expand materially: CI on Node 22 with
GH_PATfor privatenpm ci,npm audit, new CodeQL, gitleaks (fork/bot guards), manual production deploy (deploy-productionconfirm), staging preview deploy, 5‑minute uptime health → incident issues, Dependabot forapp/, and Codex autofix refactored to a reusable workflow incongress-trading-shared.Dashboard changes: draggable column reorder,
colgroup/width sync, theme in account menu, admin tab always visible with token-based access, review copy (“Resolved Reviews” / “All Filing Decisions”), and assorted table/layout polish.Reviewed by Cursor Bugbot for commit 21a8134. Configure here.