Skip to content

eb6ef0d7 fix: resolve script spec audit errors#3213

Open
crazysmile-PhD wants to merge 8 commits into
babalae:mainfrom
crazysmile-PhD:revert-2-codex/fix-audit-errors-in-repository
Open

eb6ef0d7 fix: resolve script spec audit errors#3213
crazysmile-PhD wants to merge 8 commits into
babalae:mainfrom
crazysmile-PhD:revert-2-codex/fix-audit-errors-in-repository

Conversation

@crazysmile-PhD
Copy link
Copy Markdown

已根據 script spec audit 的 ERROR 項完成修復。

本次 commit:

eb6ef0d7 fix: resolve script spec audit errors

主要處理內容如下:

  1. 統一 combat 腳本作者署名格式為 //作者:xxx

    • 對包含原作者、修改者、名稱等資訊的項目,已拆成獨立註解行,避免資訊遺失。
  2. 同步 pathing JSON 的 info.name

    • 已使 21 個 pathing JSON 的 info.name 與檔案名稱 stem 一致。
    • 未重命名 pathing 檔案。
  3. 修正 README 大小寫

    • repo/js/ComputerBlower/readme.md
    • 已重命名為:
    • repo/js/ComputerBlower/README.md
  4. 補齊缺失的 JS README

    • 已為 32 個缺 README 且存在資源目錄的 JS 腳本新增保守 README。
    • README 內容包含腳本用途、資源用途與注意事項。
    • 資源說明依據檔名、目錄名與 main.js 引用進行保守推斷。
  5. repo/js/FollowsPet 未自動建立空 main.js

    • 為避免產生不可執行的假修復,沒有新增空 main.js。
    • 已新增 repo/js/FollowsPet/TODO.md,提示維護者確認應補充有效 main.js、歸檔或移除該目錄。

未處理項:

  • SCRIPT_SPEC_AUDIT_REPORT.md 中的 WARNING 與 MANUAL_REVIEW 項未處理,符合本次只處理 ERROR 的範圍要求。

測試:

  • git diff --cached --check 通過。
  • python3 tools/audit_script_specs.py . --report /tmp/SCRIPT_SPEC_AUDIT_REPORT_final2.md || true 已執行,僅剩 repo/js/FollowsPet 缺 main.js,已轉人工確認。
  • 已對本次修改的 21 個 JSON 檔案進行解析校驗,全部通過。

### Motivation

The repository already has automation for generating `repo.json` and validating pathing JSON structure, but it does not have a dedicated audit layer for README-defined script submission conventions.

This PR adds a separate script-spec audit tool to detect naming, metadata, README, manifest, combat signature, and pathing consistency issues without replacing the existing build pipeline.

### Changes

- Add `tools/audit_script_specs.py`.
- Generate `docs/SCRIPT_SPEC_AUDIT_REPORT.md`.
- Scan the following script areas:
  - `repo/combat`
  - `repo/pathing`
  - `repo/js`
- Report findings using:
  - `ERROR`
  - `WARNING`
  - `MANUAL_REVIEW`
- Add repository-level reporting for category mismatches such as `repo/pathing/食材与炼金`.
- Add legacy/pathing special-case handling so historical or non-standard pathing routes are not all treated as hard failures.
- Improve pathing quantity detection so valid units such as `只`, `朵`, `条`, and `株` are not incorrectly reported as missing quantity.
- Fail early when required scan roots are missing to avoid false “no issues found” results.

### Scope of Checks

#### combat

- Strict author signature format: `//作者:name`
- Non-standard author signature detection
- Comment style
- Dungeon-only suffix candidates
- Role shorthand naming candidates for manual review

#### pathing

- Filename numbering
- Quantity suffix detection
- Material-directory consistency
- `README.md` casing
- JSON parseability
- `info.name` / `name` consistency with filename
- Special-case handling for historical or non-material routes

#### js

- `manifest.json` presence
- `main.js` presence
- `README.md` casing
- Folder naming warnings
- Resource documentation checks

### Testing

- `python -m py_compile tools/audit_script_specs.py`
- `python tools/audit_script_specs.py . --report docs/SCRIPT_SPEC_AUDIT_REPORT.md`
- `python tools/audit_script_specs.py . --report docs/SCRIPT_SPEC_AUDIT_REPORT.md --fail-on-errors`

The generated report includes scan counts, severity counts, rule-level counts, repository-level issues, special-case exclusions, and detailed findings.
已根據 script spec audit 的 ERROR 項完成修復。

本次 commit:

`eb6ef0d7 fix: resolve script spec audit errors`

主要處理內容如下:

1. 統一 combat 腳本作者署名格式為 `//作者:xxx`
   - 對包含原作者、修改者、名稱等資訊的項目,已拆成獨立註解行,避免資訊遺失。

2. 同步 pathing JSON 的 `info.name`
   - 已使 21 個 pathing JSON 的 `info.name` 與檔案名稱 stem 一致。
   - 未重命名 pathing 檔案。

3. 修正 README 大小寫
   - `repo/js/ComputerBlower/readme.md`
   - 已重命名為:
   - `repo/js/ComputerBlower/README.md`

4. 補齊缺失的 JS README
   - 已為 32 個缺 README 且存在資源目錄的 JS 腳本新增保守 README。
   - README 內容包含腳本用途、資源用途與注意事項。
   - 資源說明依據檔名、目錄名與 main.js 引用進行保守推斷。

5. `repo/js/FollowsPet` 未自動建立空 `main.js`
   - 為避免產生不可執行的假修復,沒有新增空 main.js。
   - 已新增 `repo/js/FollowsPet/TODO.md`,提示維護者確認應補充有效 main.js、歸檔或移除該目錄。

未處理項:

- `SCRIPT_SPEC_AUDIT_REPORT.md` 中的 WARNING 與 MANUAL_REVIEW 項未處理,符合本次只處理 ERROR 的範圍要求。

測試:

- `git diff --cached --check` 通過。
- `python3 tools/audit_script_specs.py . --report /tmp/SCRIPT_SPEC_AUDIT_REPORT_final2.md || true` 已執行,僅剩 `repo/js/FollowsPet` 缺 main.js,已轉人工確認。
- 已對本次修改的 21 個 JSON 檔案進行解析校驗,全部通過。
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5627cfb2-9c55-46d7-a700-005eed0ea130

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant