代码变更强制验证
code-change-verification
当变更影响 OpenAI Guardrails Python 仓库中的运行时代码、测试、示例或构建与测试行为时,运行强制验证栈。
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 267
- Forks
- 52
01 前言 Front Matter
- name
- code-change-verification
- description
- Run the mandatory verification stack when changes affect runtime code, tests, examples, or build and test behavior in the OpenAI Guardrails Python repository.
02 资源文件 3
- 参考文档agents/openai.yaml266 B
- 脚本scripts/run.ps11.4 KB
- 脚本scripts/run.sh8.2 KB
03 SKILL.md 正文
Code Change Verification
Overview
Mark eligible work complete only after formatting, linting, both configured type checkers, and the test suite pass. Use this skill for runtime code, tests, examples, packaging, and build or test configuration. Skip it for repository metadata or editorial docs unless the user requests the full stack.
This is a post-review final gate. When $implementation-final-review applies, wait for its clean-review condition before running this broad stack.
Quick start
- Keep this skill at
./.agents/skills/code-change-verification. - Codex on macOS/Linux:
/usr/bin/env -u OPENAI_API_KEY bash .agents/skills/code-change-verification/scripts/run.sh. - Other macOS/Linux environments:
bash .agents/skills/code-change-verification/scripts/run.sh. - Windows:
powershell -ExecutionPolicy Bypass -File .agents/skills/code-change-verification/scripts/run.ps1. - The scripts run
make formatfirst. - They then run
make lint,uv run mypy src tests,uv run pyright, andmake tests. - If any command fails, fix the issue and rerun the complete script.
- Confirm completion only when every command succeeds and the final diff contains no formatter-created surprises.
Start condition and host capacity
- During iterative review, use focused tests and a narrowly targeted static check only when the changed boundary requires one.
- Immediately before starting the complete stack, use available read-only task or process evidence to check whether another repository-wide test, typecheck, build, examples runner, or integration command is already active on the same host.
- When concrete contention is visible, continue useful non-heavy work and check again later. Do not create or wait on a repository lock, host-wide mutex, sentinel file, or user-triggered
finalizestep. - Start automatically once review is clean, the diff is stable, and observable host capacity is available. Lack of host telemetry alone is not a blocker.
Environment and API safety
The verification scripts assume repository dependencies are already installed. Run make sync only for a fresh checkout, after dependency files change, or when dependency resolution fails before checks start.
Repository verification and all child processes must remain in the normal Codex workspace sandbox. Never request elevated sandbox permissions for the verification wrapper, and never retry it with broader host access after a failure.
The ordinary test suite must remain hermetic. In Codex, remove inherited OPENAI_API_KEY from the wrapper environment. Do not run live provider calls as part of this verification stack. If a future test requires a live service, keep it out of the default stack and require explicit user approval, the repository's service-account credential boundary, and a separate report.
Manual workflow
Run these commands from the repository root in this order:
make format
make lint
uv run mypy src tests
uv run pyright
make tests
Do not skip a failing step. After a fix, rerun the complete sequence so the final result applies to one stable diff.
Resources
scripts/run.sh
Runs the required macOS/Linux sequence, executing independent read-only gates concurrently after formatting and stopping sibling processes when one fails.
scripts/run.ps1
Runs the same required sequence on Windows PowerShell and reports the failing command.
04 同仓库更多 Skills
PR 摘要与描述草稿生成
pr-draft-summary
在 openai-guardrails-python 的运行时、测试、示例、构建/测试配置或影响行为的文档发生变更后,生成符合要求的 PR 摘要区块、分支建议、标题及描述草稿。
GitHub 项目维护者评审
maintainer-review
以维护者身份评估 openai-guardrails-python 的 GitHub issue 或拉取请求(PR)。用于核实所声称的需求及其实际影响,比较受支持的替代方案或相互竞争的实现路径,区分代码质量与仓库就绪度,推荐维护者应采取的行动,并在需要补充证据、修改或关闭时起草可直接使用的评论。
兼容性实现策略制定
implementation-strategy
为 openai-guardrails-python 中的运行时和 API 变更选择兼顾兼容性的实施范围。在初始实现前以及每一轮评审反馈后使用,用于决定是打补丁、重置设计、保持兼容性,还是拒绝不受支持的场景。
代码实现启动与交接
implementation-kickoff
启动并推进一个明确调用的 openai-guardrails-python 实现任务,使用全新隔离的 worktree 和本地 PR-ready 交接。获取最新的 origin/main,保持任务变更未提交,在最终审查前将其重放到最新 main 上,运行适用的验证和 $implementation-final-review,使用 $pr-draft-summary 生成完整的 PR 草稿和分支名,然后在适用时创建一个干净的本地提交并附带接管来源。仅在用户明确调用此技能时使用;绝不 push、创建 PR 或修改 GitHub。
代码实施最终评审
implementation-final-review
在实施完成前执行仓库的风险分级独立最终审查。仅在明确调用时,或仓库指令要求在影响行为的实现工作后执行时使用;在最终验证前,审计完整任务 diff、受支持的契约、生命周期与安全边界、复杂性和测试。
发布候选版审查
final-release-review
审查 openai-guardrails-python 的发布计划或最终发布候选版本与前一个远程标签的对比,确定兼容的发布类型,审计运行时与打包风险,检查当前 CI,并生成英文的发布/阻断报告。用于发布前准备度检查,不用于普通 PR 审查或实施工作。