Skip to content

Commit f95d1dd

Browse files
authored
Port live AiGateway service architecture
Port live AiGateway service/dashboard fixes into AIAuditBridge; add dashboard centering/mobile layout fixes, feedback registration, quota persistence, and migration allowlists.
1 parent e4540bb commit f95d1dd

22 files changed

Lines changed: 515 additions & 174 deletions

.github/workflows/monthly-orchestrator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
...targets.map(t => `- ${t}`),
118118
'',
119119
'Only snapshot artifact repositories are in scope for monthly report audits.',
120-
'Each source repository owns its monthly review issue and dispatches CodexAuditBridge with source_repo and issue_number.',
120+
'Each source repository owns its monthly review issue and dispatches AIAuditBridge with source_repo and issue_number.',
121121
'',
122122
'Source of truth for policy and scheduling stays in GitHub Actions.',
123123
'',
@@ -175,6 +175,6 @@ jobs:
175175
echo "- Month: ${{ steps.resolve-month.outputs.month }}"
176176
echo "- Tracking issue: ${{ steps.publish-monthly-issue.outputs.issue_url }}"
177177
echo
178-
echo "CodexAuditBridge execution requires a source repository issue number."
178+
echo "AIAuditBridge execution requires a source repository issue number."
179179
echo "The source repositories create those issues in their own monthly workflows, then dispatch codex_audit.yml with source_repo and issue_number."
180180
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/vps_codex_service_ops.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ jobs:
3939
- name: Run VPS service operation
4040
env:
4141
CODEX_AUDIT_SSH_UNBAN_IP: ${{ inputs.ssh_unban_ip }}
42+
CODEX_AUDIT_SERVICE_ALLOWED_REPOSITORIES: QuantStrategyLab/AIAuditBridge,QuantStrategyLab/CodexAuditBridge
43+
CODEX_AUDIT_SERVICE_ALLOWED_WORKFLOW_REFS: QuantStrategyLab/AIAuditBridge/.github/workflows/codex_audit.yml@refs/heads/main,QuantStrategyLab/AIAuditBridge/.github/workflows/codex_pr_review.yml@refs/heads/main,QuantStrategyLab/AIAuditBridge/.github/workflows/codex_pr_review.yml@refs/pull/*/merge,QuantStrategyLab/CodexAuditBridge/.github/workflows/codex_audit.yml@refs/heads/main,QuantStrategyLab/CodexAuditBridge/.github/workflows/codex_pr_review.yml@refs/heads/main,QuantStrategyLab/CodexAuditBridge/.github/workflows/codex_pr_review.yml@refs/pull/*/merge
44+
CODEX_AUDIT_SERVICE_ALLOWED_REFS: refs/heads/main,refs/pull/*/merge
45+
CODEX_AUDIT_SERVICE_ALLOWED_SOURCE_REPOSITORIES: QuantStrategyLab/AIAuditBridge,QuantStrategyLab/CodexAuditBridge,QuantStrategyLab/CryptoLivePoolPipelines,QuantStrategyLab/HkEquitySnapshotPipelines,QuantStrategyLab/UsEquitySnapshotPipelines,QuantStrategyLab/ResearchSignalContextPipelines
4246
CODEX_AUDIT_SERVICE_MODEL: ${{ vars.CODEX_AUDIT_SERVICE_MODEL }}
4347
CODEX_AUDIT_SERVICE_REASONING_EFFORT: ${{ vars.CODEX_AUDIT_SERVICE_REASONING_EFFORT }}
48+
CODEX_AUDIT_SERVICE_TOKEN: ${{ secrets.CODEX_AUDIT_SERVICE_TOKEN }}
4449
run: bash scripts/deploy_codex_audit_service.sh "${{ inputs.mode }}"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## 中文摘要
44

5-
- 用途:本文档说明如何向 `CodexAuditBridge` 提交低风险、可审阅的变更。
5+
- 用途:本文档说明如何向 `AIAuditBridge` 提交低风险、可审阅的变更。
66
- 主要覆盖:`Ground Rules``Documentation Standards``Branching and Pull Requests``Local Verification`
77
- 阅读顺序:先确认仓库边界和变更范围,再运行适合本仓库的本地校验。
88
- 风险提示:涉及策略、artifact、自动化、密钥、云资源、券商或交易所行为的变更,必须先用测试环境、dry-run 或只读证据验证;不要只凭示例修改生产。
99
- 英文正文保留更完整的命令、字段名和配置键;如果摘要和正文不一致,以正文中的实际命令和配置为准。
1010

11-
Thanks for contributing to `CodexAuditBridge`.
11+
Thanks for contributing to `AIAuditBridge`.
1212

1313
## Ground Rules
1414

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ This avoids hard-coding Codex CLI setup in every source repository and avoids de
3333

3434
## Compatibility governance role
3535

36-
Compatibility governance metadata in this repository is ops/control-plane only:
36+
`QuantStrategyLab/AIAuditBridge` is an ops/control-plane consumer only:
3737

38-
- It aligns audit/review execution contracts across QuantStrategyLab repositories.
38+
- It consumes compatibility governance metadata to align audit/review execution.
3939
- It must **not** participate in trading runtime dependency graphs or strategy/runtime upgrade flows.
40-
- All governance references from this repo should be interpreted as control-plane/tooling compatibility, not runtime coupling.
40+
- All governance references here are for control-plane operation and should not be interpreted as runtime coupling.
4141

4242

4343
## Supported source repositories
@@ -99,12 +99,12 @@ Configure these values in `QuantStrategyLab/AIAuditBridge`:
9999
Run the service host with:
100100

101101
```bash
102-
CODEX_AUDIT_SERVICE_ALLOWED_REPOSITORIES=QuantStrategyLab/AIAuditBridge \
103-
CODEX_AUDIT_SERVICE_ALLOWED_SOURCE_REPOSITORIES='QuantStrategyLab/CryptoLivePoolPipelines,QuantStrategyLab/HkEquitySnapshotPipelines,QuantStrategyLab/UsEquitySnapshotPipelines,QuantStrategyLab/ResearchSignalContextPipelines' \
102+
CODEX_AUDIT_SERVICE_ALLOWED_REPOSITORIES=QuantStrategyLab/AIAuditBridge,QuantStrategyLab/CodexAuditBridge \
103+
CODEX_AUDIT_SERVICE_ALLOWED_SOURCE_REPOSITORIES='QuantStrategyLab/AIAuditBridge,QuantStrategyLab/CodexAuditBridge,QuantStrategyLab/CryptoLivePoolPipelines,QuantStrategyLab/HkEquitySnapshotPipelines,QuantStrategyLab/UsEquitySnapshotPipelines,QuantStrategyLab/ResearchSignalContextPipelines' \
104104
CODEX_AUDIT_SERVICE_AUDIENCE=quant-codex-audit \
105105
CODEX_AUDIT_SERVICE_MODEL=gpt-5.4 \
106106
CODEX_AUDIT_SERVICE_REASONING_EFFORT=auto \
107-
python3 scripts/codex_audit_service.py
107+
python3 -m service.ai_gateway_service
108108
```
109109

110110
Terminate TLS on 443 with the platform load balancer or a reverse proxy and forward `/v1/codex-audit` to the service port. Do not pass GitHub write tokens to this service.

README.zh-CN.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ Codex 执行现在只走 service backend:workflow 从 GitHub-hosted runner 调
3333

3434
## 兼容性治理定位
3535

36-
本仓库中的兼容性治理元数据只用于 ops/control-plane:
36+
`QuantStrategyLab/AIAuditBridge` 只作为 ops/control-plane 的消费侧参与兼容治理
3737

38-
- 对齐 QuantStrategyLab 各仓库的审计/评审执行契约
38+
- 仅消费兼容矩阵和治理元数据,确保审计/评审边界行为一致
3939
- 不参与策略/交易运行时的依赖图、升级决策或 runtime 级联;
4040
- 本仓库中的兼容关系只用于审计与 review 运营(control-plane),不应被源仓库当作交易策略运行时依赖。
4141

42+
4243
## 支持的 source repository
4344

4445
| Source repository | 允许的 task |
@@ -75,11 +76,11 @@ AIAuditBridge 只使用 service backend。workflow 运行在 `ubuntu-latest`,
7576
service host 启动示例:
7677

7778
```bash
78-
CODEX_AUDIT_SERVICE_ALLOWED_REPOSITORIES=QuantStrategyLab/AIAuditBridge \
79-
CODEX_AUDIT_SERVICE_ALLOWED_SOURCE_REPOSITORIES='QuantStrategyLab/CryptoLivePoolPipelines,QuantStrategyLab/HkEquitySnapshotPipelines,QuantStrategyLab/UsEquitySnapshotPipelines,QuantStrategyLab/ResearchSignalContextPipelines' \
79+
CODEX_AUDIT_SERVICE_ALLOWED_REPOSITORIES=QuantStrategyLab/AIAuditBridge,QuantStrategyLab/CodexAuditBridge \
80+
CODEX_AUDIT_SERVICE_ALLOWED_SOURCE_REPOSITORIES='QuantStrategyLab/AIAuditBridge,QuantStrategyLab/CodexAuditBridge,QuantStrategyLab/CryptoLivePoolPipelines,QuantStrategyLab/HkEquitySnapshotPipelines,QuantStrategyLab/UsEquitySnapshotPipelines,QuantStrategyLab/ResearchSignalContextPipelines' \
8081
CODEX_AUDIT_SERVICE_AUDIENCE=quant-codex-audit \
8182
CODEX_AUDIT_SERVICE_MODEL=gpt-5.4 \
82-
python3 scripts/codex_audit_service.py
83+
python3 -m service.ai_gateway_service
8384
```
8485

8586
443/TLS 建议由平台负载均衡或反向代理负责,并把 `/v1/codex-audit` 转发到 service 端口。不要把 GitHub 写 token 传给这个 service。

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## 中文摘要
44

5-
- 用途:本文档说明如何报告 `CodexAuditBridge` 的安全问题,以及密钥或凭证暴露时的处理顺序。
5+
- 用途:本文档说明如何报告 `AIAuditBridge` 的安全问题,以及密钥或凭证暴露时的处理顺序。
66
- 主要覆盖:`Reporting a Vulnerability``Secret and Credential Exposure``Scope Notes`
77
- 阅读顺序:发现问题后先避免公开泄露,再通过私密渠道提供最小复现信息。
88
- 风险提示:涉及实盘、密钥、权限、Cloud Run、GitHub Actions、交易所或券商 API 的问题,不要开公开 issue 或贴出敏感日志。
99
- 英文正文保留更完整的命令、字段名和配置键;如果摘要和正文不一致,以正文中的实际命令和配置为准。
1010

11-
Thanks for helping keep `CodexAuditBridge` safe.
11+
Thanks for helping keep `AIAuditBridge` safe.
1212

1313
This repository is part of the QuantStrategyLab automation, research, or trading-support surface. Please do **not** open a public issue for vulnerabilities involving credentials, broker or exchange access, cloud resources, workflow tokens, private market data, account identifiers, order execution, or secret material.
1414

cloudflare/ai-gateway-dash/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Cloudflare Worker that serves an operations dashboard for the AiGateway service.
1414
| `AI_GATEWAY_ORIGIN_URL` | VPS origin URL (e.g. `https://43.156.238.238.sslip.io`) |
1515
| `DASHBOARD_API_TOKEN` | Static token for read-only API access |
1616

17+
`DASHBOARD_API_TOKEN` must match the VPS service `CODEX_AUDIT_SERVICE_TOKEN`
18+
so the dashboard can read `/v1/ai/*` endpoints.
19+
1720
## Deploy
1821

1922
```bash

0 commit comments

Comments
 (0)