Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/monthly_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
GCS_BUCKET: ${{ vars.GCS_BUCKET }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
SELFHOSTED_CODEX_REVIEW_ENABLED: ${{ vars.SELFHOSTED_CODEX_REVIEW_ENABLED || 'true' }}
SELFHOSTED_CODEX_REVIEW_REPOSITORY: ${{ vars.SELFHOSTED_CODEX_REVIEW_REPOSITORY || 'QuantStrategyLab/CryptoCodexAuditBridge' }}
SELFHOSTED_CODEX_REVIEW_REPOSITORY: ${{ vars.SELFHOSTED_CODEX_REVIEW_REPOSITORY || 'QuantStrategyLab/CodexAuditBridge' }}
SELFHOSTED_CODEX_REVIEW_MODE: ${{ vars.SELFHOSTED_CODEX_REVIEW_MODE || 'review_and_fix' }}
SELFHOSTED_CODEX_REVIEW_PROVIDER: ${{ vars.SELFHOSTED_CODEX_REVIEW_PROVIDER || 'auto' }}
SELFHOSTED_CODEX_REVIEW_AUTO_MERGE: ${{ vars.SELFHOSTED_CODEX_REVIEW_AUTO_MERGE || 'false' }}
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
private-key: ${{ secrets.CROSS_REPO_GITHUB_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
CryptoCodexAuditBridge
CodexAuditBridge
permission-actions: write

- name: Trigger Monthly Review Automation
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
if status not in (201, 204):
raise RuntimeError(f"Unexpected Codex dispatch status: {status}")
print(
f"Dispatched CryptoCodexAuditBridge review for issue #{os.environ['ISSUE_NUMBER']} "
f"Dispatched CodexAuditBridge review for issue #{os.environ['ISSUE_NUMBER']} "
f"to {target_repository}"
)

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ Behavior:

## Automated AI Monthly Review

After the monthly report bundle is assembled, the workflow creates a GitHub Issue containing the full `ai_review_input.md` content. The automated review route dispatches `QuantStrategyLab/CryptoCodexAuditBridge`. The bridge owns provider selection through `SELFHOSTED_CODEX_REVIEW_PROVIDER`:
After the monthly report bundle is assembled, the workflow creates a GitHub Issue containing the full `ai_review_input.md` content. The automated review route dispatches `QuantStrategyLab/CodexAuditBridge`. The bridge owns provider selection through `SELFHOSTED_CODEX_REVIEW_PROVIDER`:

- `auto` (default): run the self-hosted Codex path first; if Codex setup or execution fails, post the configured API fallback review from the bridge. Configure both `OPENAI_API_KEY` and `ANTHROPIC_API_KEY` in the bridge for dual-AI fallback. If no API fallback key is configured, fail loudly.
- `codex`: run Codex on the self-hosted VPS runner, post the audit result, and open a PR directly for safe low-risk fixes without API fallback.
Expand All @@ -555,22 +555,22 @@ Review output is posted back to the monthly issue.
### Optional Bridge API Fallback

- `SELFHOSTED_CODEX_REVIEW_PROVIDER`: defaults to `auto`; set to `codex` to disable API fallback, `api` for configured API reviewers, or `openai` / `anthropic` for a single API reviewer.
- `OPENAI_API_KEY`: configure in `CryptoCodexAuditBridge`, not this source repository.
- `ANTHROPIC_API_KEY`: configure in `CryptoCodexAuditBridge`, not this source repository.
- `OPENAI_API_KEY`: configure in `CodexAuditBridge`, not this source repository.
- `ANTHROPIC_API_KEY`: configure in `CodexAuditBridge`, not this source repository.
- `OPENAI_MODEL`: optional bridge repository variable, default `gpt-5.4-mini`.
- `ANTHROPIC_MODEL`: optional bridge repository variable, default `claude-sonnet-4-6`.

The default production configuration does not need model API secrets because it uses Codex through `CryptoCodexAuditBridge`.
The default production configuration does not need model API secrets because it uses Codex through `CodexAuditBridge`.

Setup:

```bash
gh variable set SELFHOSTED_CODEX_REVIEW_PROVIDER --body auto
gh secret set OPENAI_API_KEY --repo QuantStrategyLab/CryptoCodexAuditBridge --body "sk-..."
gh secret set ANTHROPIC_API_KEY --repo QuantStrategyLab/CryptoCodexAuditBridge --body "sk-ant-..."
gh secret set OPENAI_API_KEY --repo QuantStrategyLab/CodexAuditBridge --body "sk-..."
gh secret set ANTHROPIC_API_KEY --repo QuantStrategyLab/CodexAuditBridge --body "sk-ant-..."
```

Source-local legacy AI review workflows are intentionally not kept in this repository. Provider fallback lives in `CryptoCodexAuditBridge`, so this source repository does not need Anthropic/OpenAI secrets.
Source-local legacy AI review workflows are intentionally not kept in this repository. Provider fallback lives in `CodexAuditBridge`, so this source repository does not need Anthropic/OpenAI secrets.

## Dynamic Universe Logic

Expand Down Expand Up @@ -1019,7 +1019,7 @@ Practical review file selection:

Automated AI handoff:

The workflow automatically creates a GitHub Issue with the `monthly-review` label, then dispatches `CryptoCodexAuditBridge`. Provider fallback is handled inside the bridge through `SELFHOSTED_CODEX_REVIEW_PROVIDER`; if the bridge dispatch fails, the workflow fails loudly. See the "Automated AI Monthly Review" section for details.
The workflow automatically creates a GitHub Issue with the `monthly-review` label, then dispatches `CodexAuditBridge`. Provider fallback is handled inside the bridge through `SELFHOSTED_CODEX_REVIEW_PROVIDER`; if the bridge dispatch fails, the workflow fails loudly. See the "Automated AI Monthly Review" section for details.

Manual AI handoff (fallback):

Expand Down
14 changes: 7 additions & 7 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ make monthly-review-briefing

## 自动化 AI 月度审阅

月报 bundle 组装完成后,workflow 会自动创建一个 GitHub Issue,内容为完整的 `ai_review_input.md`。自动审阅路径会 dispatch `QuantStrategyLab/CryptoCodexAuditBridge`,由 bridge 统一决定 provider:
月报 bundle 组装完成后,workflow 会自动创建一个 GitHub Issue,内容为完整的 `ai_review_input.md`。自动审阅路径会 dispatch `QuantStrategyLab/CodexAuditBridge`,由 bridge 统一决定 provider:

- `auto`(默认):先跑 self-hosted Codex 路径;如果 Codex 准备或执行失败,由 bridge 回落到已配置的 API 审阅。要启用双 AI fallback,把 `OPENAI_API_KEY` 和 `ANTHROPIC_API_KEY` 都配置在 bridge;如果没有任何 API fallback key,则明确失败。
- `codex`:只跑 Codex,不使用 API fallback。
Expand All @@ -402,22 +402,22 @@ AI 审阅覆盖范围:
### 可选 Bridge API Fallback

- `SELFHOSTED_CODEX_REVIEW_PROVIDER`:默认 `auto`;设置为 `codex` 可关闭 API fallback,设置为 `api` 可跑已配置的 API reviewers,设置为 `openai` / `anthropic` 可只跑单一 API 审阅。
- `OPENAI_API_KEY`:配置在 `CryptoCodexAuditBridge`,不要配置在当前 source repo。
- `ANTHROPIC_API_KEY`:配置在 `CryptoCodexAuditBridge`,不要配置在当前 source repo。
- `OPENAI_API_KEY`:配置在 `CodexAuditBridge`,不要配置在当前 source repo。
- `ANTHROPIC_API_KEY`:配置在 `CodexAuditBridge`,不要配置在当前 source repo。
- `OPENAI_MODEL`:可选 bridge repo variable,默认 `gpt-5.4-mini`。
- `ANTHROPIC_MODEL`:可选 bridge repo variable,默认 `claude-sonnet-4-6`。

默认生产配置不需要模型 API secrets,因为默认使用 `CryptoCodexAuditBridge` 的 Codex provider。
默认生产配置不需要模型 API secrets,因为默认使用 `CodexAuditBridge` 的 Codex provider。

配置方式示例:

```bash
gh variable set SELFHOSTED_CODEX_REVIEW_PROVIDER --body auto
gh secret set OPENAI_API_KEY --repo QuantStrategyLab/CryptoCodexAuditBridge --body "sk-..."
gh secret set ANTHROPIC_API_KEY --repo QuantStrategyLab/CryptoCodexAuditBridge --body "sk-ant-..."
gh secret set OPENAI_API_KEY --repo QuantStrategyLab/CodexAuditBridge --body "sk-..."
gh secret set ANTHROPIC_API_KEY --repo QuantStrategyLab/CodexAuditBridge --body "sk-ant-..."
```

本仓库不再保留 source-local `ai_review.yml` 或 Claude 自动优化 workflow。provider fallback 统一放在 `CryptoCodexAuditBridge`,因此当前 source repo 不需要配置 Anthropic/OpenAI secrets。
本仓库不再保留 source-local `ai_review.yml` 或 Claude 自动优化 workflow。provider fallback 统一放在 `CodexAuditBridge`,因此当前 source repo 不需要配置 Anthropic/OpenAI secrets。

### Monthly Publish 的 GitHub 配置

Expand Down
4 changes: 2 additions & 2 deletions docs/operator_runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ Boundary rules:

## Monthly Codex Remediation

The monthly publish workflow creates a `monthly-review` issue, then dispatches `CryptoCodexAuditBridge` as the automated review and remediation path. The bridge owns provider selection through `SELFHOSTED_CODEX_REVIEW_PROVIDER`: `auto` is the default and runs the self-hosted Codex path first, falls back to the configured API reviewers when Codex setup or execution fails, and fails loudly when no API fallback key is configured. `codex` disables API fallback; `api` posts a combined API review; `openai` and `anthropic` post a single-provider API review only.
The monthly publish workflow creates a `monthly-review` issue, then dispatches `CodexAuditBridge` as the automated review and remediation path. The bridge owns provider selection through `SELFHOSTED_CODEX_REVIEW_PROVIDER`: `auto` is the default and runs the self-hosted Codex path first, falls back to the configured API reviewers when Codex setup or execution fails, and fails loudly when no API fallback key is configured. `codex` disables API fallback; `api` posts a combined API review; `openai` and `anthropic` post a single-provider API review only.

If the bridge dispatch fails, the monthly publish workflow fails loudly. Source-local legacy AI review workflows are intentionally removed; provider fallback lives in `CryptoCodexAuditBridge`.
If the bridge dispatch fails, the monthly publish workflow fails loudly. Source-local legacy AI review workflows are intentionally removed; provider fallback lives in `CodexAuditBridge`.

## Standard Monthly Flow

Expand Down
8 changes: 4 additions & 4 deletions tests/test_monthly_publish_workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def test_monthly_review_issue_creation_does_not_require_gh_cli(self) -> None:
self.assertNotIn("GITHUB_OUTPUT: ${{ github.output }}", workflow)
self.assertIn("issue_number=", workflow)
self.assertIn("SELFHOSTED_CODEX_REVIEW_REPOSITORY", workflow)
self.assertIn("QuantStrategyLab/CryptoCodexAuditBridge", workflow)
self.assertIn("QuantStrategyLab/CodexAuditBridge", workflow)
self.assertIn("CROSS_REPO_GITHUB_APP_ID", workflow)
self.assertIn("CROSS_REPO_GITHUB_APP_PRIVATE_KEY", workflow)
self.assertIn("actions/create-github-app-token@v3", workflow)
self.assertIn("CryptoCodexAuditBridge", workflow)
self.assertIn("CodexAuditBridge", workflow)
self.assertIn("permission-actions: write", workflow)
self.assertIn("APP_TOKEN", workflow)
self.assertIn("Trigger Monthly Review Automation", workflow)
Expand Down Expand Up @@ -75,11 +75,11 @@ def test_source_local_legacy_ai_workflows_are_removed(self) -> None:
def test_chinese_readme_matches_current_monthly_review_defaults(self) -> None:
readme = README_ZH_PATH.read_text(encoding="utf-8")

self.assertIn("CryptoCodexAuditBridge", readme)
self.assertIn("CodexAuditBridge", readme)
self.assertIn("SELFHOSTED_CODEX_REVIEW_PROVIDER", readme)
self.assertIn("OPENAI_API_KEY", readme)
self.assertIn("ANTHROPIC_API_KEY", readme)
self.assertIn("配置在 `CryptoCodexAuditBridge`", readme)
self.assertIn("配置在 `CodexAuditBridge`", readme)
self.assertIn("必须从 GitHub variable 读取", readme)
self.assertIn("本仓库不再保留 source-local `ai_review.yml`", readme)
self.assertNotIn("只配置 `ANTHROPIC_API_KEY`", readme)
Expand Down