From 75b6dbf0d7d9bb0d8d404a8ad24e0168094ed331 Mon Sep 17 00:00:00 2001 From: alphabee Date: Sun, 22 Mar 2026 03:06:49 +0900 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20codex=20reviewer=20=EC=88=98?= =?UTF-8?q?=EB=8F=99=20=ED=8A=B8=EB=A6=AC=EA=B1=B0=20->=20github=20action?= =?UTF-8?q?=20=EC=9C=BC=EB=A1=9C=20auto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codex-review.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/codex-review.yml diff --git a/.github/workflows/codex-review.yml b/.github/workflows/codex-review.yml new file mode 100644 index 0000000..760569d --- /dev/null +++ b/.github/workflows/codex-review.yml @@ -0,0 +1,21 @@ +# .github/workflows/codex-review.yml +name: Codex Auto Review + +on: + pull_request: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Add Codex review comment + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "@codex review" + }) \ No newline at end of file From 3f112db835a55cfbf880f8f3748a8887ba23b656 Mon Sep 17 00:00:00 2001 From: alphabee Date: Sun, 22 Mar 2026 03:15:37 +0900 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20permissions=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codex-review.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codex-review.yml b/.github/workflows/codex-review.yml index 760569d..9b1410c 100644 --- a/.github/workflows/codex-review.yml +++ b/.github/workflows/codex-review.yml @@ -1,10 +1,13 @@ -# .github/workflows/codex-review.yml name: Codex Auto Review on: pull_request: types: [opened] +permissions: + issues: write + pull-requests: write + jobs: comment: runs-on: ubuntu-latest From ca11760778f87df7c9f01eb8ee6ef0dc7a10e826 Mon Sep 17 00:00:00 2001 From: alphabee Date: Sun, 22 Mar 2026 03:20:12 +0900 Subject: [PATCH 3/5] pull_request -> pull_request_target --- .github/workflows/codex-review.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codex-review.yml b/.github/workflows/codex-review.yml index 9b1410c..2c54d29 100644 --- a/.github/workflows/codex-review.yml +++ b/.github/workflows/codex-review.yml @@ -1,7 +1,7 @@ name: Codex Auto Review on: - pull_request: + pull_request_target: types: [opened] permissions: @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Add Codex review comment - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, + await github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, owner: context.repo.owner, repo: context.repo.repo, body: "@codex review" From edd3ea7ea41285ddd16a412bcd8c1f864846a952 Mon Sep 17 00:00:00 2001 From: alphabee Date: Sun, 22 Mar 2026 03:43:50 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EB=8D=94=EB=AF=B8=20AGENTS=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=EC=B6=94=ED=9B=84=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=9A=94=EB=A7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..416653d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,87 @@ +# AGENTS.md + +## Review guidelines + +- Always write review comments in Korean. +- Keep technical terms in English when they are standard in software engineering or machine learning. +- Be concise, but explain why the issue matters and how to fix it. +- Prioritize real bugs, regressions, security issues, deployment risks, and ML/data issues over style nitpicks. +- Avoid commenting on trivial formatting unless it can cause misunderstanding. + +## Project context + +This repository is for an AI-Ops / MLOps style platform that includes: +- FastAPI backend +- OpenStack-related deployment/infrastructure integration +- ML-based prediction and anomaly detection pipelines +- Docker / GitHub Actions / self-hosted runner based deployment +- Database and metrics processing logic + +When reviewing code, use this context and focus on operational safety and production reliability. + +## What to focus on + +### 1. Backend / API correctness +- Check for broken FastAPI route logic, invalid request/response handling, and exception paths. +- Flag missing validation, weak error handling, and inconsistent response formats. +- Check whether authentication or authorization-related logic is missing or bypassable. +- Watch for blocking I/O or heavy computation inside request handlers. + +### 2. ML / data pipeline risks +- Look for possible data leakage between train/validation/test. +- Check whether feature generation uses future information accidentally. +- Flag inconsistent preprocessing between training and inference. +- Check whether saved model artifacts, metadata, and scalers stay in sync. +- Watch for silent fallback behavior that could hide model failure. +- Flag suspicious metric calculations or evaluation logic. +- Check whether anomaly thresholds, smoothing, aggregation, or time-window logic can produce misleading alerts. + +### 3. Time-series / forecasting issues +- Be sensitive to ordering bugs, timestamp alignment problems, resampling errors, and off-by-one mistakes. +- Flag train/test splits that ignore temporal order. +- Check whether forward fill, interpolation, clipping, normalization, or lag feature generation can distort real behavior. +- Watch for target leakage through rolling statistics or future-dependent transformations. + +### 4. Infra / deployment safety +- Check whether Docker, GitHub Actions, and deployment logic can break production unexpectedly. +- Flag risky shell commands, destructive cleanup, and commands that may impact unrelated containers or files. +- Check for mistakes in image tags, registry login flow, compose commands, and self-hosted runner cleanup. +- Watch for secrets accidentally exposed in logs, code, workflow files, or exception messages. + +### 5. Database / persistence +- Flag schema mismatches, unsafe migrations, missing transactions, and inconsistent model persistence behavior. +- Check whether writes are idempotent where needed. +- Watch for race conditions or duplicate inserts in metric/history/alert flows. + +### 6. Security +- Flag hardcoded secrets, tokens, endpoints, or credentials. +- Flag missing permission checks. +- Flag dangerous deserialization, shell injection risks, path traversal risks, and unsafe subprocess usage. +- Be strict about logging sensitive operational data. + +## Review style + +For each important issue: +- State the problem clearly in Korean. +- Explain why it is risky. +- Suggest a concrete fix. +- If severity is high, say so explicitly. + +Preferred tone example: +- "이 부분은 `train/test leakage` 가능성이 있습니다." +- "현재 구현은 예측 시점 이후의 정보를 참조할 수 있어 시계열 평가가 왜곡될 수 있습니다." +- "이 workflow 단계는 self-hosted runner 환경에서 과도하게 파괴적일 수 있습니다." + +## What to ignore unless severe + +- Minor naming preferences +- Personal style preferences +- Formatting differences already handled by formatter/linter +- Non-critical refactors that do not affect correctness, safety, or maintainability + +## Extra instructions + +- When possible, prefer comments on correctness, reliability, and production impact. +- For ML-related pull requests, review like a careful ML engineer, not just a general code reviewer. +- For deployment-related pull requests, review like a cautious DevOps engineer. +- If a change looks intentional but risky, call out the risk without assuming the author is wrong. \ No newline at end of file From 232b7dcc91599c7f1594118cabdd1f812e99f439 Mon Sep 17 00:00:00 2001 From: alphabee Date: Sun, 22 Mar 2026 04:11:29 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EA=B9=83=ED=97=88=EB=B8=8C=EC=95=A1?= =?UTF-8?q?=EC=85=98=20down=20->=20PR=20temp=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ .github/workflows/codex-review.yml | 24 ------------------------ 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/codex-review.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9271020..3695ea8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -26,3 +26,5 @@ closes # ## 리뷰 요청 사항 + +## @codex review 수동 트리거 댓글로 작성 요망 diff --git a/.github/workflows/codex-review.yml b/.github/workflows/codex-review.yml deleted file mode 100644 index 2c54d29..0000000 --- a/.github/workflows/codex-review.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Codex Auto Review - -on: - pull_request_target: - types: [opened] - -permissions: - issues: write - pull-requests: write - -jobs: - comment: - runs-on: ubuntu-latest - steps: - - name: Add Codex review comment - uses: actions/github-script@v8 - with: - script: | - await github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "@codex review" - }) \ No newline at end of file