Skip to content

chore: 技术债清扫收尾——.pyc 出库 + escalate-test-issue.py 语法修复(ADR-0061/ADR-0070) - #478

Merged
randypanding merged 2 commits into
mainfrom
chore/392-pyc-out-and-syntax-fix
Aug 31, 2026
Merged

chore: 技术债清扫收尾——.pyc 出库 + escalate-test-issue.py 语法修复(ADR-0061/ADR-0070)#478
randypanding merged 2 commits into
mainfrom
chore/392-pyc-out-and-syntax-fix

Conversation

@randypanding

@randypanding randypanding commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Card: #392
ADR: ADR-0061(测试产物拓扑——.pyc 构建产物出库,防复发 .gitignore 已在位)+ ADR-0070(整洁关卡组——死代码/语法缺陷清理,行为保持)

变更(#392 卡收尾)

  1. .pyc 编译产物出库git rm --cached 3 个误提交文件
  2. escalate-test-issue.py 语法修复:L97 f-string 内层 ASCII 双引号改「」(与 .github/scripts 旧副本风格一致)——修复前 py_compile 失败、脚本完全不可运行(chore: 近一周 PR 技术债清扫——构建产物出库 + 死代码移除(行为保持) #392 卡「另报」项)

卡内已完成项(先前 PR,不在本 PR 范围)

  • metrics.py 死变量移除 ✓(pyflakes 零告警实证)
  • dashboard-update.py TemporaryDirectory isdir 恒真防御 ✓(isdir 已不存在)
  • sli-report.sh if False 死分支 ✓(grep 零命中实证)

验证

  • python3 -m pyflakes scripts/escalate-test-issue.py 零告警;py_compile 通过
  • make gates-pr 全绿(bash -n / yaml 解析 / 治理自测 19 项)

不碰:gate/verdict/drift 语义、pinned SHA、REPOS.yaml、workflows YAML、trae 备份产物。

Summary by CodeRabbit

  • Bug Fixes
    • 修复问题升级脚本生成说明文本时的引号语法错误。
    • 确保生成的内容语义保持不变,并可正常使用。

…R-0070)

- git rm --cached 3 个误提交的 .pyc(specs/IR-0004/suite/__pycache__ ×2、specs/ISSUE-263/suite/__pycache__ ×1,源自 #230/#336/#338;.gitignore 防复发已在位)
- scripts/escalate-test-issue.py L97 f-string 内层 ASCII 引号改「」(#392 卡另报的语法错误——修复前 py_compile 失败,脚本不可运行)

卡内其余三项(metrics.py 死变量 / dashboard-update.py isdir 防御 / sli-report.sh 死分支)已在先前 PR 完成,本 PR 仅收尾。
Copilot AI lite review requested due to automatic review settings August 30, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Remove tracked Python bytecode and restore escalation script syntax

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Restores the test-error escalation script by fixing an invalid f-string quotation.
• Removes three generated bytecode files already covered by repository ignore rules.
• Preserves escalation behavior while completing ADR-0061 and ADR-0070 cleanup.
Diagram

graph TD
  A["Python Sources"] --> B["Python Runtime"] --> C["Bytecode Cache"] --> D["Ignore Rules"]
  E["Escalation Script"] --> F["Syntax Checks"]
  E --> G["Issue API"]
Loading
High-Level Assessment

The chosen approach is optimal: fix the malformed literal without changing behavior, and remove generated bytecode from the index while relying on existing ignore rules to prevent recurrence.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
escalate-test-issue.pyFix invalid quotation in escalation issue body +1/-1

Fix invalid quotation in escalation issue body

• Replaces nested ASCII double quotes with Chinese corner brackets inside the f-string. This restores Python parsing while preserving the generated issue text and escalation semantics.

scripts/escalate-test-issue.py

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • .trae-html-share-packages/scripts/create-cloudbird-agent-app.html.zip is excluded by !**/*.zip
  • .trae-html-share-packages/scripts/create-verifier-app.html.zip is excluded by !**/*.zip

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f84729c7-9789-4667-b2ee-511c6afd597b

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fde86a8c-a530-4661-a293-fff3318c9ed8

📥 Commits

Reviewing files that changed from the base of the PR and between cdf5492 and ea50735.

⛔ Files ignored due to path filters (3)
  • specs/IR-0004/suite/__pycache__/test_spec_ir0004.cpython-311-pytest-9.1.1.pyc is excluded by !**/*.pyc
  • specs/IR-0004/suite/__pycache__/test_spec_ir0004.cpython-311.pyc is excluded by !**/*.pyc
  • specs/ISSUE-263/suite/__pycache__/test_ir263_artifacts.cpython-311.pyc is excluded by !**/*.pyc
📒 Files selected for processing (1)
  • scripts/escalate-test-issue.py

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

修正 create_issue 生成的 Issue 正文中的嵌套引号,避免 Python f-string 语法冲突。

Changes

Issue 正文生成修复

Layer / File(s) Summary
修复 Issue 正文引号
scripts/escalate-test-issue.py
将“发现错误”文本的嵌套双引号替换为中文引号,保持原有语义并使脚本语法有效。

Suggested labels: bug, tech-debt

Merge Risk: ⚪ Minimal · up to ea507

This PR fixes an otherwise non-runnable test-escalation script and removes tracked Python bytecode artifacts without changing product behavior; no actionable merge-blocking risk remains after normal checks.

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning 标题使用了有效的 Conventional Commits 前缀 chore,且与技术债清理和语法修复相关。但标题长度为 72 个字符,超过 50 个字符的要求。 将标题缩短至不超过 50 个字符,同时保留有效前缀和主要变更信息。例如:chore: 修复测试问题并清理技术债
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/392-pyc-out-and-syntax-fix

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

@coderabbitai coderabbitai Bot added bug Something isn't working tech-debt labels Aug 30, 2026
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Informational

1. Missing ADR-0082 red-team sign-off 📘 Rule violation § Compliance
Description
This PR deletes files under specs/*/suite/**, which the checklist treats as spec/test-design
changes, but the PR metadata contains no explicit confirmation that the ADR-0082 red-team audit was
completed. The deletion therefore lacks the required audit evidence before merge.
Code

specs/IR-0004/suite/pycache/test_spec_ir0004.cpython-311-pytest-9.1.1.pyc[1]

-
Relevance

● Weak

Directly matches this PR's stated intent to remove committed .pyc build artifacts; not a real
compliance gap.

PR-#338
PR-#336

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed-file list includes three deleted files under specs/.../suite/, satisfying the rule's
applicability condition, while the supplied PR description mentions ADR-0061 and ADR-0070 but
contains no ADR-0082 red-team audit sign-off.

Rule 2855405: Require ADR-0082 red team audit sign-off for spec and test design changes
specs/IR-0004/suite/pycache/test_spec_ir0004.cpython-311-pytest-9.1.1.pyc[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR modifies files under `specs/*/suite/**` without explicit ADR-0082 red-team audit sign-off in the PR metadata.

## Issue Context
The compliance requirement applies to spec and test-design path changes, including deleted suite artifacts. Add a completed audit confirmation or an approval/comment from an identified red-team reviewer.

## Fix Focus Areas
- specs/IR-0004/suite/__pycache__/test_spec_ir0004.cpython-311-pytest-9.1.1.pyc[1-1]
- specs/IR-0004/suite/__pycache__/test_spec_ir0004.cpython-311.pyc[1-1]
- specs/ISSUE-263/suite/__pycache__/test_ir263_artifacts.cpython-311.pyc[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 22 rules
Review mode: 🚀 Fast: 变更仅涉及删除三个已生成的 .pyc 文件和修复脚本中一处字符串语法错误,逻辑影响局部且无高风险路径。

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@randypanding

Copy link
Copy Markdown
Contributor Author

状态说明(2026-08-30,PM 清扫会话)

本 PR 为 #392 技术债卡收尾(.pyc 出库 + escalate-test-issue.py 语法修复),本地 gates-pr 全绿、t14/g060/hygiene/org-gate 等 CI 全绿。

唯一待过关卡:adversary 红队审计(specs/** 路径变更触发,ADR-0082)。已按流程 4 次派发 CI-Workflows adversary 审计(target=specs/IR-0004,target_ref=本 PR head ea50735):

  • run 33303033958:LLM 应答不可解析(provider 瞬时故障,exit 3 infra)
  • run 33303199016 / 33303458918 / 33303768165:LLM provider 持续 HTTP 429 限流(exit 4)

审计被 LLM 网关限流阻塞(infra,非套件缺陷)。provider 恢复后重派即可:

gh workflow run adversary --repo Cloudbird-Software/CI-Workflows \
  -f target=specs/IR-0004 -f target_repo=Cloudbird-Software/.github \
  -f target_ref=<head_sha> -f pr_repo=Cloudbird-Software/.github \
  -f pr_number=478 -f head_sha=<head_sha>

审计 success 后走 adversary-relay 写回 survived check,再重跑本 PR 的 gate job(当前 RED 即消)。

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
@randypanding
randypanding merged commit 7a96193 into main Aug 31, 2026
16 of 18 checks passed
@randypanding
randypanding deleted the chore/392-pyc-out-and-syntax-fix branch August 31, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tech-debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants