检查
- 作者仓库星标 3,063
- 许可证 NOASSERTION
- 作者仓库 qlty
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @qltysh · NOASSERTION
- 上下文用量评级
- 中等消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
根据用户输入解析目标:PR 编号/PR URL → `gh pr view <N> --json title,body,headRefName,baseRefName,author,files` 和 `gh pr diff <N>`。分支名称 → `git fetch origin main && git diff origin/main...<branch>` 和 `git log origin/main..<branch> --oneline`。无输入→当前分支:`git fetch origin main && git diff origin/main...HEAD`和`git log origin/main..HEAD --oneline`。首先阅读 PR 描述并提交消息。意图很重要:公关
对于 PR 涉及的每个类别,使用 file:line、行为之前、行为之后、三个用户细分中的哪一个中断以及严重性(阻止者/风险/注释)生成结果。不要仅仅指出差异 - 浏览现有用户的实际体验。
对于风险最高的发现,请针对_每个受影响的细分市场_逐一分析具体场景。写出会中断的 `.qlty/qlty.toml` 片段或 CLI 调用,说明用户之前看到的内容以及现在看到的内容。这是捕获像#2762这样的事件的步骤——它迫使你从“测试通过”进入“每个部分击中了什么?”
对于每个发现,PR 是否:将新的严格行为置于选择加入标志(如`--skip-source-fetch`)后面,默认保留旧行为?在重命名的字段上添加`#[serde(alias = "old_name")]`?新版本上的碰撞`config_version`和破门检查?
使用此形状将结果返回为回复中的最后一件事。其后不应该有任何其他内容——报告是技能的输出。如果发现的结果为零,仍会发出带有“结论:安全”和“已检查并清除类别”列表的报告,以便调用者知道检查已运行。
# Backwards-compatibility review for a qlty PR
Your job is to identify whether the target PR (or branch) introduces
behavior changes that would break existing qlty users when they upgrade,
and return a structured findings report in your reply.
The target is whatever the user named (a PR number, PR URL, or branch). If
the user didn't specify anything, default to the current branch vs.
`origin/main`.
## Who gets hurt by a BC break in this repo
Keep these three user segments in mind. The severity of a finding depends
on which segment it affects.
### 1. Developers running qlty locally
Individual developers download a qlty CLI version and often don't run
`qlty upgrade` regularly, so their local version can be months behind main.
They mostly invoke `qlty check` and `qlty fmt` against a `.qlty/qlty.toml`
that's checked into their repo. A BC break here causes friction for one
developer at a time — annoying but recoverable. Severity baseline: **risky**
unless unusually disruptive.
### 2. Customers running qlty in their CI
Customers run `qlty coverage publish` and `qlty coverage complete` inside
their CI pipelines on every build. Pipelines are hard to change in a hurry:
a BC break here fails every build for every customer on the affected
version, often silently (they don't notice until coverage stops showing up,
or a release is blocked by red CI). This is the **highest-stakes** category.
Severity baseline for a confirmed break: **blocker**. Be especially
sensitive to anything that changes exit codes, error vs. warning behavior,
or required inputs on `qlty coverage *` commands.
### 3. Qlty Cloud's hosted builds
Qlty Cloud runs builds on behalf of customers and invokes the qlty CLI
directly. The commands currently relied on include `qlty sources fetch`,
`qlty config validate`, `qlty fmt --skip-source-fetch`, `qlty init`,
`qlty install`, and `qlty build`. A BC break that affects any of these
commands, or the config/source formats they depend on, causes a **Qlty
Cloud outage** — every customer's builds fail at once until we can ship a
coordinated fix. Severity baseline for a confirmed break here: **blocker**,
with extra urgency in the report.
A single finding can hit more than one of these. Call out each affected
segment explicitly.
## Step 1 — Load the diff
Resolve the target from the user input:
- PR number / PR URL → `gh pr view <N> --json title,body,headRefName,baseRefName,author,files` and `gh pr diff <N>`.
- Branch name → `git fetch origin main && git diff origin/main...<branch>` and `git log origin/main..<branch> --oneline`.
- No input → current branch: `git fetch origin main && git diff origin/main...HEAD` and `git log origin/main..HEAD --oneline`.
Read the PR description and commit messages first. Intent matters: a PR
captioned "fix bug where X silently failed" is exactly the #2762 pattern —
that's a red flag unless the fix is gated behind an opt-in flag.
## Step 2 — For each category below, check the diff
For every category the PR touches, produce a finding with **file:line**,
**before behavior**, **after behavior**, **which of the three user segments
breaks**, and **severity** (blocker / risky / note). Don't just point at a
diff — walk through what an existing user actually experiences.
### a. Behavior changes on existing command paths
The #2762 pattern. Silent failures becoming hard errors, added network/IO
on a command's hot path, new validation that rejects previously-accepted
input. Grep signals: new `bail!`, `ensure!`, `return Err`, `?` on
previously-swallowed results, `unwrap_or_default()` being removed,
`fetch_sources`, `load_config`, `validate_` added to a command flow.
Ask: _what does a user with a 6-month-old working setup see now?_
### b. CLI flag surface (qlty-cli/src/commands/\*\*)
Any `#[arg]` / `#[clap]` removed or renamed; `default_value` changed;
optional↔required changes; `value_enum` variant removed; subcommand
removed or renamed; new positional argument shifting existing args;
`hide = true` flags being removed (flag but rarely a blocker).
### c. qlty.toml schema (qlty-config/src/config/\*\*)
serde fields renamed or removed without `#[serde(alias)]`; `Option<T>` →
`T`; type changes; `#[serde(deny_unknown_fields)]` added; default changes;
`config_version` handling that would reject a `config_version = "0"` file;
TOML merge semantics in `qlty-config/src/toml_merge.rs`.
### d. Output formats
`qlty-coverage/src/print.rs`, any `print_*_as_json`, `serde_json::to_*`,
`Serialize` derives on output types. Field renames/removals, numeric
format changes, wire format changes in `qlty-types` protos. Also text
output that scripts parse (CI log patterns, summary lines).
### e. Exit codes
`std::process::exit`, `CommandError` vs `CommandSuccess`, `?` propagation
into `main`. A command starting to return non-zero where it used to return
zero (or vice versa) is a blocker for CI-segment users.
### f. Environment variables
`std::env::var` call sites. `QLTY_*` renamed or removed; precedence order
between env and flag changed; auth token resolution in
`qlty-coverage/src/token.rs`.
### g. Source fetching / cache layout
Changes to `.qlty/sources/` / `.qlty/cache/` / `~/.qlty/` layout;
`GitSource` / `LocalSource` / `DefaultSource` / `SourcesList` changes to
what counts as cached, when fetches happen, credential resolution, source
resolution order.
### h. Plugin behavior
`plugin.toml` schema changes in `qlty-plugins/plugins/*/plugin.toml` or
the loader in `qlty-check`; `drivers`, `prepare_script`, `affects_cache`
semantics; download URL patterns (breaking these kills offline caches).
### i. Telemetry / logging defaults
Log levels changing `debug!` → `warn!` / `error!` (visible in CI logs);
event shape changes for Sentry/analytics (lower severity).
## Step 3 — Trace the worst-case user for each segment
For the riskiest findings, walk through a concrete scenario _per affected
segment_. Write out the `.qlty/qlty.toml` snippet or CLI invocation that
would break, say what the user saw before, and what they see now. This is
the step that catches incidents like #2762 — it forces you past "the tests
pass" into "what does each segment hit?"
For segment 3 (Qlty Cloud), check whether the change would affect any of
the qlty commands listed above that Qlty Cloud relies on. If the answer is
yes, the PR needs a coordinated Qlty Cloud update before it ships — flag
that explicitly in the mitigation suggestion.
## Step 4 — Check for mitigations
For each finding, does the PR:
- Gate the new strict behavior behind an opt-in flag (like
`--skip-source-fetch`), default preserving old behavior?
- Add `#[serde(alias = "old_name")]` on renamed fields?
- Bump `config_version` and gate breaking checks on the new version?
- Emit a warning (not an error) with a deprecation window?
- Call out a coordinated Qlty Cloud update if segment 3 is affected?
- Update CHANGELOG / migration docs?
No mitigation + confirmed break ⇒ escalate to **blocker**.
## Step 5 — Output the report
Return the findings as the last thing in your reply, using this shape.
Nothing else should come after it — the report is the skill's output.
```
## Backwards-compatibility review
**Target:** <PR #N / branch <name> / current branch>
**Verdict:** <safe / risky — needs mitigation / blocker — do not merge as-is>
**Affected user segments:** <local devs / CI users / Qlty Cloud — segments with findings>
### Findings
**[severity]** `path/to/file.rs:123` — <category>
- Before: ...
- After: ...
- Who breaks: <segment(s) + concrete scenario>
- Suggested mitigation: ...
<repeat, most severe first>
### Categories checked and clear
<list of categories from Step 2 where nothing was found>
### Notes for reviewer
<optional: anything the reviewer should verify manually>
```
If there are zero findings, still emit the report with "Verdict: safe" and
the "Categories checked and clear" list, so the caller knows the check ran.
## Scope / non-goals
- Don't critique code quality, test coverage, or style — only compatibility.
- Don't flag purely additive changes (new optional flag, new optional field,
new subcommand) unless they shadow or conflict with existing behavior.
- Internal refactors (moving code between private crates, renaming private
fns) are out of scope unless they change observable behavior.
- Don't post to GitHub, don't edit files, don't commit — just analyze and
return the report.
- Be specific. "This might break something" is useless. "Customers with
`[[source]] repository = ...` entries hit exit 1 now because
`workspace.load_config` at `coverage/publish.rs:185` propagates the error
where `unwrap_or_default()` used to swallow it — this breaks segment 2
(CI) and segment 3 (Qlty Cloud, which invokes `qlty sources fetch`)" is
the bar.
按说明文件中的顺序排列。
谁会因本回购协议中的 BC 中断而受到伤害
1.开发者本地运行qlty
2. 客户在其 CI 中运行 qlty
3. Qlty Cloud 的托管构建
第 1 步 — 加载差异
文件/命令 -> origin/main · qlty upgrade · qlty check · qlty fmt · .qlty/qlty.toml · qlty coverage publish · qlty coverage complete · qlty coverage *
内容校验值 -> 7955dedb45c4
当前原文的自动摘译,尚未人工审校。
谁会因本回购协议中的 BC 中断而受到伤害
请记住这三个用户群。发现的严重程度取决于它影响的部分。
1.开发者本地运行qlty
个人开发人员下载 qlty CLI 版本,并且通常不会定期运行
qlty upgrade,因此他们的本地版本可能比主版本晚几个月。他们主要针对签入其存储库的.qlty/qlty.toml调用qlty check和qlty fmt。这里的 BC 中断一次会给一名开发人员带来摩擦——令人烦恼但可以恢复。严重程度基线:有风险2. 客户在其 CI 中运行 qlty
客户在每次构建时在其 CI 管道内运行
qlty coverage publish和qlty coverage complete。管道很难很快改变:BC 中断会让受影响版本上的每个客户的每个构建都失败,通常是默默地(直到覆盖范围停止显示,或者发布被红色 CI 阻止时,他们才会注意到)。这是风险最高的类别。3. Qlty Cloud 的托管构建
Qlty Cloud 代表客户运行构建并直接调用 qlty CLI。目前依赖的命令包括
qlty sources fetch、qlty config validate、qlty fmt --skip-source-fetch、qlty init、qlty install、qlty build。影响任何这些命令或它们所依赖的配置/源格式的 BC 中断会导致 Qlty