Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
744e998
feat: canonicalize disclosure asset types
jaywedgeworth22 Jun 29, 2026
5da3bb2
feat: add chamber-aware review asset type combobox
jaywedgeworth22 Jun 29, 2026
2331de1
feat: audit ingestion decisions
jaywedgeworth22 Jun 29, 2026
0ce705a
fix: preserve asset type compatibility edges
jaywedgeworth22 Jun 29, 2026
0591091
Add admin market data diagnostics
jaywedgeworth22 Jun 29, 2026
ce7014b
Add cross-app capabilities manifest
jaywedgeworth22 Jun 29, 2026
e99944b
Wire @jaywedgeworth22/congress-trading-shared shared package
jaywedgeworth22 Jun 29, 2026
14375fc
Merge remote-tracking branch 'origin/cursor/congress-trading-shared' …
jaywedgeworth22 Jun 30, 2026
49c34d6
fix: make shared package installable in ci
jaywedgeworth22 Jun 30, 2026
2e613cb
chore: harden app update workflows
jaywedgeworth22 Jun 30, 2026
b0eb4e9
Merge remote-tracking branch 'origin/codex/admin-market-status-202606…
jaywedgeworth22 Jun 30, 2026
62eb81e
Merge remote-tracking branch 'origin/codex/crossapp-contract-manifest…
jaywedgeworth22 Jun 30, 2026
3f74933
Merge branch 'codex/app-update-hardening-20260629' into codex/congres…
jaywedgeworth22 Jun 30, 2026
21a8134
chore: pin shared package to current main
jaywedgeworth22 Jun 30, 2026
b1c8075
fix: install private shared package in ci
jaywedgeworth22 Jun 30, 2026
14e9ee5
fix: authenticate private git dependency in ci
jaywedgeworth22 Jun 30, 2026
7ec0422
fix: use deploy key for shared package ci install
jaywedgeworth22 Jun 30, 2026
cb3f8cf
chore: defer codeql until code scanning is enabled
jaywedgeworth22 Jun 30, 2026
5346829
fix: address integration review feedback
jaywedgeworth22 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: npm

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 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 👍 / 👎.

directory: "/app"
schedule:
interval: daily
time: "08:00"
open-pull-requests-limit: 10
groups:
cloudflare:
patterns:
- "@cloudflare/*"
- "wrangler"
- "hono"
testing:
patterns:
- "vitest"
- "@playwright/*"
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,35 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: npm
cache-dependency-path: app/package-lock.json

- name: Configure private GitHub dependencies
env:
SHARED_PACKAGE_DEPLOY_KEY: ${{ secrets.SHARED_PACKAGE_DEPLOY_KEY }}
GH_PAT: ${{ secrets.GH_PAT }}
run: |
if [ -n "$SHARED_PACKAGE_DEPLOY_KEY" ]; then
mkdir -p "$HOME/.ssh"
printf '%s\n' "$SHARED_PACKAGE_DEPLOY_KEY" > "$HOME/.ssh/congress_trading_shared"
chmod 600 "$HOME/.ssh/congress_trading_shared"
ssh-keyscan github.com >> "$HOME/.ssh/known_hosts"
git config --global core.sshCommand "ssh -i $HOME/.ssh/congress_trading_shared -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes"
git config --global url."ssh://git@github.com/".insteadOf "https://github.com/"
git config --global url."ssh://git@github.com/".insteadOf "git@github.com:"
git ls-remote ssh://git@github.com/jaywedgeworth22/congress-trading-shared.git HEAD >/dev/null
elif [ -n "$GH_PAT" ]; then
git config --global credential.helper store
printf 'https://x-access-token:%s@github.com\n' "$GH_PAT" > "$HOME/.git-credentials"
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git ls-remote https://github.com/jaywedgeworth22/congress-trading-shared.git HEAD >/dev/null
else
echo "::error::SHARED_PACKAGE_DEPLOY_KEY or GH_PAT with read access to jaywedgeworth22/congress-trading-shared is required for npm ci."
exit 1
fi

- name: Install dependencies
run: npm ci

Expand All @@ -34,3 +59,6 @@ jobs:

- name: Test
run: npm test

- name: Audit
run: npm audit
100 changes: 44 additions & 56 deletions .github/workflows/codex-autofix.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Codex Autofix

# Autonomous responder to the Codex PR reviewer (chatgpt-codex-connector[bot]).
# Calls the shared reusable workflow in congress-trading-shared; the prompt
# (repo-specific behaviour) stays here so it's auditable in-repo.
#
# Roles are DISTINCT so the two bots never compete to "review first":
# • Codex = reviewer — fires on every push, posts P1/P2 suggestions.
# • Claude = fixer — fires ONLY when Codex posts feedback, addresses it,
# then pushes. The push makes Codex review again →
# clean ping-pong, capped to avoid an infinite loop.
#
# Prerequisites (one-time, see the PR description):
# Prerequisites:
# 1. Secret ANTHROPIC_API_KEY (Settings → Secrets and variables → Actions).
# 2. A token whose pushes RE-TRIGGER CI + Codex. The default GITHUB_TOKEN does
# NOT re-trigger workflows, so EITHER install the Claude GitHub App
Expand Down Expand Up @@ -40,65 +42,51 @@ concurrency:

jobs:
autofix:
# Only when the Codex bot posted the feedback (review / inline comment / PR
# comment), or a maintainer dispatched it manually. issue_comment must be on
# a PR (issue.pull_request != null), never a plain issue.
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_review' && github.event.review.user.login == 'chatgpt-codex-connector[bot]') ||
(github.event_name == 'pull_request_review_comment' && github.event.comment.user.login == 'chatgpt-codex-connector[bot]') ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null && github.event.comment.user.login == 'chatgpt-codex-connector[bot]')
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
uses: jaywedgeworth22/congress-trading-shared/.github/workflows/codex-autofix-reusable.yml@main
with:
allowed_bots: "chatgpt-codex-connector,chatgpt-codex-connector[bot]"
prompt: |
You are the autonomous fixer that responds to the Codex PR reviewer
(chatgpt-codex-connector[bot]) on THIS pull request. You do NOT review
the PR yourself — Codex is the reviewer; you only address its feedback.

- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
# The whole policy lives in the prompt so behavior is auditable in-repo.
prompt: |
You are the autonomous fixer that responds to the Codex PR reviewer
(chatgpt-codex-connector[bot]) on THIS pull request. You do NOT review
the PR yourself — Codex is the reviewer; you only address its feedback.
Repo: Congress.Trade (Cloudflare Worker; the app lives in `app/`).
Verify before committing: `cd app && npm run typecheck && npm test`.
Read app/AGENTS.md and app/CLAUDE.md first — follow them as the source
of truth (migrations, deploy gates, do-not-deploy rules). The git
author email MUST be 12656028+jaywedgeworth22@users.noreply.github.com.
Do NOT deploy, run remote D1 migrations, or run production crawlers.

Repo: Congress.Trade (Cloudflare Worker; the app lives in `app/`).
Verify before committing: `cd app && npm run typecheck && npm test`.
Read app/AGENTS.md and app/CLAUDE.md first — follow them as the source
of truth (migrations, deploy gates, do-not-deploy rules). The git
author email MUST be 12656028+jaywedgeworth22@users.noreply.github.com.
Do NOT deploy, run remote D1 migrations, or run production crawlers.

Do this:
1. ROUND CAP: count commits on the PR branch whose message contains
"[codex-autofix]". If there are already 10 or more, STOP: post one PR
comment summarizing the remaining open Codex items and asking the
maintainer how to proceed, then end without further changes.
2. Read the PR's review threads. Separate OUTDATED threads (anchored to
code already changed — usually already fixed) from genuinely NEW,
non-outdated Codex items.
3. For each NEW item: if it is a clear correctness bug OR a simple
cosmetic/doc fix, fix it. If it is ambiguous or architecturally
significant, do NOT guess — post a PR comment asking the maintainer,
and skip it.
4. If `git merge origin/main` is needed (branch behind main), merge it
and resolve conflicts. If a migration is added, add SQL under
app/migrations/ and update POST /api/admin/migrate per app/AGENTS.md.
5. Run `cd app && npm run typecheck && npm test`. Only commit if it
passes. Commit message must start with "[codex-autofix] ". Push to
the PR branch.
6. When the PR is functional and you have addressed the actionable
items, ensure auto-merge is enabled:
`gh pr merge <PR> --squash --auto`. Do NOT use --admin and do NOT
try to bypass any required check.
7. Be frugal with PR comments — only comment to ask the maintainer a
question, to report the round cap was hit, or to flag a finding you
are intentionally not fixing. The diff is the record otherwise.
claude_args: |
--max-turns 60
--allowedTools "Edit,Write,Read,Bash"
allowed_bots: "chatgpt-codex-connector,chatgpt-codex-connector[bot]"
Do this:
1. ROUND CAP: count commits on the PR branch whose message contains
"[codex-autofix]". If there are already 10 or more, STOP: post one PR
comment summarizing the remaining open Codex items and asking the
maintainer how to proceed, then end without further changes.
2. Read the PR's review threads. Separate OUTDATED threads (anchored to
code already changed — usually already fixed) from genuinely NEW,
non-outdated Codex items.
3. For each NEW item: if it is a clear correctness bug OR a simple
cosmetic/doc fix, fix it. If it is ambiguous or architecturally
significant, do NOT guess — post a PR comment asking the maintainer,
and skip it.
4. If `git merge origin/main` is needed (branch behind main), merge it
and resolve conflicts. If a migration is added, add SQL under
app/migrations/ and update POST /api/admin/migrate per app/AGENTS.md.
5. Run `cd app && npm run typecheck && npm test`. Only commit if it
passes. Commit message must start with "[codex-autofix] ". Push to
the PR branch.
6. When the PR is functional and you have addressed the actionable
items, ensure auto-merge is enabled:
`gh pr merge <PR> --squash --auto`. Do NOT use --admin and do NOT
try to bypass any required check.
7. Be frugal with PR comments — only comment to ask the maintainer a
question, to report the round cap was hit, or to flag a finding you
are intentionally not fixing. The diff is the record otherwise.
secrets:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GH_PAT: ${{ secrets.GH_PAT }}
102 changes: 102 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Deploy Preview

on:
push:
branches: [staging]
workflow_dispatch: {}

# Never run two preview deploys at once; let an in-flight deploy finish.
concurrency:
group: deploy-preview
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
Comment thread
jaywedgeworth22 marked this conversation as resolved.
issues: write
pull-requests: write
defaults:
run:
working-directory: app
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: app/package-lock.json

- name: Configure private GitHub dependencies
env:
SHARED_PACKAGE_DEPLOY_KEY: ${{ secrets.SHARED_PACKAGE_DEPLOY_KEY }}
GH_PAT: ${{ secrets.GH_PAT }}
run: |
if [ -n "$SHARED_PACKAGE_DEPLOY_KEY" ]; then
mkdir -p "$HOME/.ssh"
printf '%s\n' "$SHARED_PACKAGE_DEPLOY_KEY" > "$HOME/.ssh/congress_trading_shared"
chmod 600 "$HOME/.ssh/congress_trading_shared"
ssh-keyscan github.com >> "$HOME/.ssh/known_hosts"
git config --global core.sshCommand "ssh -i $HOME/.ssh/congress_trading_shared -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes"
git config --global url."ssh://git@github.com/".insteadOf "https://github.com/"
git config --global url."ssh://git@github.com/".insteadOf "git@github.com:"
git ls-remote ssh://git@github.com/jaywedgeworth22/congress-trading-shared.git HEAD >/dev/null
elif [ -n "$GH_PAT" ]; then
git config --global credential.helper store
printf 'https://x-access-token:%s@github.com\n' "$GH_PAT" > "$HOME/.git-credentials"
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git ls-remote https://github.com/jaywedgeworth22/congress-trading-shared.git HEAD >/dev/null
else
echo "::error::SHARED_PACKAGE_DEPLOY_KEY or GH_PAT with read access to jaywedgeworth22/congress-trading-shared is required for npm ci."
exit 1
fi

- name: Install dependencies
run: npm ci

- name: Build isolated preview config
run: |
cp wrangler.preview.example.toml wrangler.preview.toml
python - <<'PY'
from pathlib import Path
import os

path = Path("wrangler.preview.toml")
text = path.read_text()
replacements = {
"PREVIEW_D1_DATABASE_ID": os.environ["PREVIEW_D1_DATABASE_ID"],
"PREVIEW_KV_NAMESPACE_ID": os.environ["PREVIEW_KV_NAMESPACE_ID"],
"https://congress-trade-preview.<your-workers-subdomain>.workers.dev": os.environ["PREVIEW_APP_BASE_URL"],
}
for old, new in replacements.items():
text = text.replace(old, new)
path.write_text(text)
PY
env:
PREVIEW_D1_DATABASE_ID: ${{ secrets.PREVIEW_D1_DATABASE_ID }}
PREVIEW_KV_NAMESPACE_ID: ${{ secrets.PREVIEW_KV_NAMESPACE_ID }}
PREVIEW_APP_BASE_URL: ${{ vars.PREVIEW_APP_BASE_URL || 'https://congress-trade-preview.workers.dev' }}

- name: Deploy to Cloudflare Workers (preview)
id: deploy
run: |
DEPLOY_URL=$(bash scripts/deploy-preview.sh 2>&1 | tee /dev/stderr | grep -o 'https://[^ ]*\.workers\.dev' | tail -1 || true)
echo "deploy_url=${DEPLOY_URL:-${PREVIEW_APP_BASE_URL}}" >> "$GITHUB_OUTPUT"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
PREVIEW_APP_BASE_URL: ${{ vars.PREVIEW_APP_BASE_URL || 'https://congress-trade-preview.workers.dev' }}

- name: Comment deploy URL
if: github.event_name == 'push'
run: |
URL="${{ steps.deploy.outputs.deploy_url }}"
PR_NUMBER="$(gh pr list --head staging --json number -q '.[0].number')"
if [ -n "$PR_NUMBER" ]; then
gh pr comment "$PR_NUMBER" --body "Preview deployed: ${URL}"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deploy

on:
workflow_dispatch:
inputs:
confirm:
description: "Type deploy-production to deploy congress.trade"
required: true
type: string

# Never run two deploys at once; let an in-flight deploy finish rather than
# cancel it mid-deploy.
concurrency:
group: deploy-production
cancel-in-progress: false

jobs:
deploy:
if: github.event.inputs.confirm == 'deploy-production'
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: app
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: app/package-lock.json

- name: Configure private GitHub dependencies
env:
SHARED_PACKAGE_DEPLOY_KEY: ${{ secrets.SHARED_PACKAGE_DEPLOY_KEY }}
GH_PAT: ${{ secrets.GH_PAT }}
run: |
if [ -n "$SHARED_PACKAGE_DEPLOY_KEY" ]; then
mkdir -p "$HOME/.ssh"
printf '%s\n' "$SHARED_PACKAGE_DEPLOY_KEY" > "$HOME/.ssh/congress_trading_shared"
chmod 600 "$HOME/.ssh/congress_trading_shared"
ssh-keyscan github.com >> "$HOME/.ssh/known_hosts"
git config --global core.sshCommand "ssh -i $HOME/.ssh/congress_trading_shared -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes"
git config --global url."ssh://git@github.com/".insteadOf "https://github.com/"
git config --global url."ssh://git@github.com/".insteadOf "git@github.com:"
git ls-remote ssh://git@github.com/jaywedgeworth22/congress-trading-shared.git HEAD >/dev/null
elif [ -n "$GH_PAT" ]; then
git config --global credential.helper store
printf 'https://x-access-token:%s@github.com\n' "$GH_PAT" > "$HOME/.git-credentials"
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git ls-remote https://github.com/jaywedgeworth22/congress-trading-shared.git HEAD >/dev/null
else
echo "::error::SHARED_PACKAGE_DEPLOY_KEY or GH_PAT with read access to jaywedgeworth22/congress-trading-shared is required for npm ci."
exit 1
fi

- name: Install dependencies
run: npm ci
Comment thread
jaywedgeworth22 marked this conversation as resolved.

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test

- name: Deploy to Cloudflare Workers
run: bash scripts/ship.sh
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}

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 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 👍 / 👎.

Loading
Loading