Skip to content

feat: 新增 update-triage 自进化流程#254

Merged
Terry-Mao merged 9 commits into
mainfrom
spec/issue-134
Jun 9, 2026
Merged

feat: 新增 update-triage 自进化流程#254
Terry-Mao merged 9 commits into
mainfrom
spec/issue-134

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Closes #134

Summary

  • 新增 update-triage skill 和脚本,用于聚合维护者 triage 修正信号、应用 proposed guidance output,并校验运行期写入范围。
  • 新增手动触发的 GitHub Actions workflow:收集最近 triaged issue 反馈,按新 skill 运行 Codex,应用允许的输出,并仅在 guidance 实际变化时创建或更新固定 feat/update-triage 自进化 PR。
  • 新增 PR body helper,并补充聚合、output application、write-surface validation 和 PR body 生成的 unittest 覆盖。

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_aggregate_triage_feedback.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_apply_triage_guidance_output.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_update_triage_write_surface.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_write_update_triage_pr_body.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests
  • PYTHONPYCACHEPREFIX=/tmp/aicodingflow-pycache python3 -m py_compile .codex-runtime/handoff/implementation-output/.agents/skills/update-triage/scripts/*.py .github/scripts/write_update_triage_pr_body.py
  • git diff --check

Notes

  • 当前 Codex 沙箱中 .agents 为只读,因此新的 .agents/skills/update-triage/... 文件已写入 .codex-runtime/handoff/implementation-output/,供外层 workflow 应用。
  • 本 PR 有意新增 workflow 文件;推送需要外层 workflow 配置的 workflow-file update token。

@github-actions
github-actions Bot requested a review from Terry-Mao as a code owner June 8, 2026 13:18
Comment thread specs/issue-134/product.md Outdated
Comment thread specs/issue-134/product.md Outdated
Comment thread specs/issue-134/product.md Outdated
Comment thread specs/issue-134/product.md Outdated
@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /fix 修复所有 comments

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Applied requested changes on spec/issue-134.

Summary:

Summary

  • 将 issue 134 产品规格中的 open questions 收敛为明确 decisions。
  • 同步技术规格中的候选 issue 范围、维护者身份判定、聚合脚本数据源和 label config 更新边界。
  • 明确 label color 不应在缺少维护者明确指导时被 workflow 主动修改。

Validation

  • git diff --check

#254

@Terry-Mao Terry-Mao added the plan-approved Implementation plan has been approved label Jun 8, 2026
@github-actions github-actions Bot changed the title docs(spec): create issue 134 specs feat: 新增 update-triage 自进化流程 Jun 8, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

发现了会影响 workflow 安全边界和规格承诺的问题,建议修复后再合并。安全审查已并入 inline comments。

Comment thread .github/workflows/update-triage.yml Outdated
Comment thread .agents/skills/update-triage/scripts/apply_guidance_output.py
Comment thread .github/scripts/write_update_triage_pr_body.py Outdated
@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /fix 修复所有 comments

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Applied requested changes on spec/issue-134.

Summary:

Summary

  • update-triage workflow 的手动输入通过 step env 传入 shell,避免输入内容被 runner shell 重新解释。
  • 校验 proposed guidance output 的真实路径仍位于 output 目录内,阻止 symlink parent 逃逸。
  • 中和 update-triage PR body evidence summary 中的 GitHub closing keywords,并补充对应测试。

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_apply_triage_guidance_output.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_write_update_triage_pr_body.py'
  • PYTHONPYCACHEPREFIX=/tmp/aicodingflow-pycache python3 -m py_compile .agents/skills/update-triage/scripts/apply_guidance_output.py .github/scripts/write_update_triage_pr_body.py
  • git diff --check

#254

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

发现 1 个阻塞问题:聚合逻辑没有限定“triage 后”的维护者修正信号,可能把初始 triage 或 triage 前讨论误学习为稳定修正规则。

Comment thread .agents/skills/update-triage/scripts/aggregate_triage_feedback.py
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Applied requested changes on spec/issue-134.

Summary:

Summary

  • 为 update-triage 聚合脚本新增 triaged_at 定位,优先使用 bot triage comment marker,其次使用 bot 添加 triaged label 的 timeline event。
  • 只收集 created_at > triaged_at 的维护者后续信号,并在无法可靠定位 triage 时间时跳过 issue。
  • 同步更新 issue 134 的 product/tech spec 和聚合脚本测试。

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_aggregate_triage_feedback.py'
  • PYTHONPYCACHEPREFIX=/tmp/aicodingflow-pycache python3 -m py_compile .agents/skills/update-triage/scripts/aggregate_triage_feedback.py
  • git diff --check

#254

@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

发现 2 个需要合并前修复的问题:运行期 write-surface guard 仍可能放行额外持久文件;PR body 的 closing keyword 中和只覆盖裸 #123,仍可能通过跨仓库引用或 issue URL 误关闭 issue。

Comment thread .agents/skills/update-triage/scripts/validate_write_surface.py Outdated
Comment thread .github/scripts/write_update_triage_pr_body.py Outdated
@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /fix 修复所有的 comments

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Applied requested changes on spec/issue-134.

Summary:

Summary

  • 收紧 update-triage write-surface guard,只允许精确持久输出文件,避免 companion 目录下额外文件被放行。
  • 扩展 update-triage PR body 的 closing keyword 中和逻辑,覆盖裸 issue、跨仓库 issue 引用和 GitHub issue URL。
  • 补充相关单元测试。

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_update_triage_write_surface.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_write_update_triage_pr_body.py'
  • PYTHONPYCACHEPREFIX=/tmp/aicodingflow-pycache python3 -m py_compile .agents/skills/update-triage/scripts/validate_write_surface.py .github/scripts/write_update_triage_pr_body.py
  • git diff --check

#254

@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

发现 1 个需要合并前修复的问题。此前讨论中已 resolved 的安全输入、symlink parent、triaged_at 过滤和 closing keyword 覆盖问题没有重复评论。

Comment thread .github/workflows/update-triage.yml
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Applied requested changes on spec/issue-134.

Summary:

Summary

  • 将 update-triage workflow 的变更检测和 git add 收紧为 .agents/skills/triage-issue-repo/SKILL.md.github/issue-triage/config.json 两个精确文件。
  • 同步更新 product/tech spec 中的写入范围描述,保持规格、guard 和 workflow 行为一致。

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_update_triage_write_surface.py'
  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_write_update_triage_pr_body.py'
  • PYTHONPYCACHEPREFIX=/tmp/aicodingflow-pycache python3 -m py_compile .agents/skills/update-triage/scripts/validate_write_surface.py .github/scripts/write_update_triage_pr_body.py
  • git diff --check

#254

@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

发现 1 个需要合并前修复的问题:--maintainer-login 的语义与规格不一致,会导致限定维护者输入无法真正收窄学习信号。

Comment thread .agents/skills/update-triage/scripts/aggregate_triage_feedback.py Outdated
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Applied requested changes on spec/issue-134.

Summary:

Summary

  • 修正 update-triage 聚合脚本的 --maintainer-login 语义,使 allowlist 非空时只接受列出的维护者。
  • 增加测试覆盖 allowlist 对 OWNER association 和 org member fallback 的收窄行为。

Validation

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/aicodingflow-tests -p 'test_aggregate_triage_feedback.py'
  • PYTHONPYCACHEPREFIX=/tmp/aicodingflow-pycache python3 -m py_compile .agents/skills/update-triage/scripts/aggregate_triage_feedback.py .github/aicodingflow-tests/test_aggregate_triage_feedback.py
  • git diff --check

#254

@Terry-Mao

Copy link
Copy Markdown
Owner

@kratos-ci-bot /review

Comment thread .github/workflows/update-triage.yml Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

未发现需要阻止合并的 correctness、spec drift 或 security 问题。当前版本已收紧 workflow 创建 PR 条件为 status=changed 且允许文件存在 diff,也修复了 shell input 注入、symlink parent escape、triage_at 后置过滤、maintainer allowlist 收窄和 PR body closing keyword 中和等先前风险;未重复已解决或过时的 prior review 线程。

@Terry-Mao
Terry-Mao merged commit 1bb0263 into main Jun 9, 2026
3 checks passed
@Terry-Mao
Terry-Mao deleted the spec/issue-134 branch June 9, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan-approved Implementation plan has been approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

新增 update-triage SKILL,以及对应的 Github Workflow,解决 triage issue 的仓库级别 SKILL 的自进化

1 participant