Skip to content

ci(lint): describe the query-options test ratchet as one-sided - #27115

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-26586-lint-ratchet-comment
Oct 28, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/issue-26586-lint-ratchet-comment

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #26586

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:只改 .github/workflows/lint.yml 里 Engine query-options erasure ratchet 这一步上方的一段注释,把测试代码那个汇总数字从「只降不升」改写成脚本现在的真实行为。
  • 为什么改:chore(scripts): ten ratchet baselines become one-sided — a decrease passes and is reported #26549 之后这个 ratchet 是单向的:超过上限变红,下降照样通过并打印报告,一次降到 0 按死扫描拒绝;旧注释还写着两向时代的说法,会误导下一个读者。
  • 风险与回滚:零运行时风险,只动注释;YAML 解析前后完全一致,任何 step、if:、命令都没变;回滚就是 revert 这一个 commit。
  • 先看:.github/workflows/lint.yml 第 4191–4195 行(唯一的改动块)。
  • 两分钟验证:git diff origin/main -- .github/workflows/lint.yml,预期只看到 5 行注释替换 3 行注释,没有任何非 # 行。
  • 需要你做的:这是 Tier H(.github/workflows/**),需要一位 GOVERNED_APPROVERS 批准,或由你亲手合并。

What changes

Item 2 of #26586 only. The comment above the Engine query-options erasure ratchet step still called the aggregate test-code number "decrease-only". Since #26549 the reader is one-sided, and the comment now says what the code does: growth past the ceiling reds, a fall passes and is reported, and a fall to zero is refused as a dead scan. Items 1 and 3 landed via #26701; item 4 asks for no change and stays with the maintainer. No step, if:, command or other comment is touched.

Tests

None — comment-only change in a workflow file; nothing executable moved (the parsed YAML is identical before and after).

Acceptance notes

The wording was measured against the reader, scripts/check-query-options-erasure-ratchet.mjs (the step runs pnpm check:query-options-erasure, which is that script's --self-test then the scan), on origin/main 76e90df6:

  • Growth reds: diffRatchet pushes an error when testSites > testCeiling ("test surface grew CEILING → N site(s)").
  • A fall passes and is reported: ratchetDownReport adds a line when testSites < testCeiling ("test surface fell … Passing; until --update records it …"), printed under "decrease(s) (passing, reported)", never as an error.
  • A fall to zero is refused: testSurfaceCollapse returns a refusal when the ceiling is above 0 and the run measured 0 sites, and the main path exits 2 on it.
  • Before chore(scripts): ten ratchet baselines become one-sided — a decrease passes and is reported #26549 the fall was an error: its diff removes the else if (testSites < testCeiling) error branch ("ratchet DOWN: run …") and the self-test row that expected one error for a test-surface shrink; the current self-test row "test-surface shrink passes (one-sided)" expects zero.

Verification

YAML parse and comment-only proof

python3 with yaml.safe_load on the new file and on git show HEAD:.github/workflows/lint.yml before the commit: parsed ok, semantically identical: True. git diff -U0 filtered to changed lines that are not comments: none.

Derived gates (dispatch-gates --commands, 42 commands)

Run on head 5a94fec3 (after merging origin/main), each exit captured before any pipe; all 42 exit 0. The first pass on 9be4825d (before the merge) was also 42 of 42 exit 0.

node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-merged-branch-reaper-outcome.mjs :: exit 0
node scripts/check-merged-branch-reaper-outcome.mjs --self-test :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-step-collectors.mjs :: exit 0
node scripts/check-step-collectors.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/scheduled-full-run.mjs --self-test :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/ci-failure.mjs --self-test :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:aggregator-roster :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:declared-population-live :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:node-version :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
pnpm check:pm-expected-skips :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-post-stamped :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pnpm-acquisition :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:required-contexts :: exit 0
pnpm check:select-gate-families :: exit 0
pnpm check:shard-attestation :: exit 0
pnpm check:stall-guard-budget :: exit 0
pnpm check:stall-guard-headroom :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:workflow-status-functions :: exit 0
pnpm check:workflow-step-name-quoting :: exit 0

dispatch-gates --ran (exit 0): 42 derived famil(ies) accounted for — 42 run, 0 NOT-MEASURED (a DERIVED zero — all 42 recorded an exit code and none of them is 3).

The 6 workflow-valued families the derivation lists as NOT MEASURED locally (they take a value only a CI run has: required-contexts --verify-required-set, the shard-attestation emit/verify legs) and every CI-only family are left to the PR's check-runs.


Generated by Claude Code

The comment above the `Engine query-options erasure ratchet` step still
called the aggregate test-code number decrease-only. Since #26549 the
reader is one-sided: growth past the ceiling reds, a fall passes and is
reported, and a fall to zero is refused as a dead scan. Comment only.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYpxei8vxY22nkCLVj1
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 28, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review October 28, 2026 06:27
@os-zhuang
os-zhuang enabled auto-merge October 28, 2026 06:27
@os-zhuang
os-zhuang added this pull request to the merge queue Oct 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5a94fec32038974f72d21cd3cc10603db4f3b802
Local-runs: none
Scope: .github/workflows/lint.yml + scripts/check-query-options-erasure-ratchet.mjs, package.json (the check:query-options-erasure script), scripts/check-slot-lookup-ratchet.mjs

This record was rendered by a contract-review subagent at CONTRACT_REVIEW_TIER and adopted by devx seat 2. Inputs: card #26586 (body and all 8 comments), PR #27115 (body, file list), the net diff origin/main...origin/claude/issue-26586-lint-ratchet-comment, the cited code read with git show at the head, and the check-runs on the head.

① Derived judgments

  • Net diff. One file, one hunk: 5 comment lines replace 3 in the block above the Engine query-options erasure ratchet step (.github/workflows/lint.yml, L4277-4284 at this head). Every changed line is a # line at the block's 6-space indent; name:, id:, continue-on-error: true, the if: steps.gate-families.outputs.query_options_erasure != 'skip' predicate and run: pnpm check:query-options-erasure are untouched. The implementation claim ("comment text only, no step, if:, command or other comment") is right against the tree.
  • Accept set. Unchanged. The step runs the same command behind the same gate-families predicate, and the reader (scripts/check-query-options-erasure-ratchet.mjs) and its baseline are byte-identical between origin/main and the head. Right.
  • Public surface. None: no package, schema, skill, ADR or published doc is in the diff. Right.
  • Branch shape. One implementation commit (9be4825dad) plus a merge of origin/main (a27f889a05, which is the merge base); no rebase, no force-push, and the merge contributes nothing to the net diff. Right.
  • Claims the hunk re-asserts, read in the cited code. "Same ratchet mechanism as slot-lookup for the non-test residual" stays true: scripts/check-slot-lookup-ratchet.mjs L20 declares itself ONE-SIDED (test(floors): floors set at today's measured value and two-sided baselines red on every legitimate deletion — ui package counts in ~8 places, CLI command counts, catalog entries pinned 4×, slot-lookup-class baselines that fail on a decrease #26444) and both self-tests carry the row "a fall passes (one-sided)". "Runs its own --self-test first" stays true: package.json L129 chains --self-test && before the scan. Right.
  • Gate verdicts (check-runs on the head). 61 check-runs, all completed: 45 success, 16 skipped, 0 failure, 0 cancelled. The lanes that read this file are green: Lint & Repo Gates, Lint · CI, release & engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, Lint · PM dispatch-gates, Lint · repo & tooling gates, Lint · docs & code guards, Lint · ESLint. The 16 skips are the opt-in and push-only families (Build Core, Test Core shards, Build Docs, dogfood, temporal conformance, packed-tarball, 18.x harness, Check Changeset, Check PR Size, Auto Label, schedule gate) a comment-only workflow change does not pay for. No gate the comment describes reds. Right.

② Semver level

skip-changeset label on the PR; Clause-②: no on the PR body and on the claim; Metadata-protocol: none. The diff publishes nothing (a comment in a workflow file), so no changeset is owed and skip-changeset is the right declaration. The Clause-②: line matches: nothing narrows.

③ Boundary flags

  • open_questions 1 — keep the zero-collapse clause (A) or trim to the increase/decrease asymmetry (B). A, as recommended. testSurfaceCollapse (L227-236) returns a refusal when the ceiling is above 0 and the run measured 0 sites, and the main path exits 2 on it (L1181-1185) before diffRatchet runs. Without the clause, "a fall passes and is reported" would be read to cover a fall to 0, which the reader refuses, and the comment would be wrong for exactly the case test(floors): floors set at today's measured value and two-sided baselines red on every legitimate deletion — ui package counts in ~8 places, CLI command counts, catalog entries pinned 4×, slot-lookup-class baselines that fail on a decrease #26444 added. Answered: keep.
  • open_questions 2 — the worktree deviation and the trailer pair. Accept as recorded. The remote branch is the designated claude/issue-26586-lint-ratchet-comment; the commit carries the model-free pair AGENTS.md L457-460 requires (Claude-Session: and Co-authored-by: Claude), which outranks the harness reminder. The file-surface guard held: nothing outside the one comment block moved.
  • Card item 4 (no change asked; the maintainer's ruling on a narrowed detector). Not this PR's to answer and the tree does not touch it. The PR body carries Fixes #26586, so the card closes on merge: the release note at landing must carry the item 4 question forward (answer it or re-file it) or it is lost with the card. Escalated to the landing seat; not a defect in the tree.
  • Tier H. .github/workflows/** is governed; the PR lands only with a GOVERNED_APPROVERS approval or the maintainer's hand. Two APPROVED reviews from os-zhuang are on the PR; whether that login is in GOVERNED_APPROVERS is the merge guard's reading, not this record's.

④ Design judgment

.github/workflows/lint.yml is the only hits file. The scenario it is accepted against is card #26586 item 2: the comment must describe what pnpm check:query-options-erasure does since #26549. Each sentence of the new wording, against scripts/check-query-options-erasure-ratchet.mjs at the head:

  1. "growth past its ceiling reds." diffRatchet L279-291 pushes an error when testSites is above testCeiling ("test surface grew ... Raising this number is a reviewed edit"), and the main path exits 1 on any error (L1198-1210). Self-test row L750 "test-surface growth fails" expects 1 error. True.
  2. "a fall passes and is reported." ratchetDownReport L319-324 adds a line when testSites is below testCeiling ("test surface fell ... Passing; until --update records it ... licenses N new test-code erasure(s)"), printed at L1196-1199 under "decrease(s) (passing, reported)"; the fall is never an error (self-test L751 expects 0 errors, L762 expects 1 report line, L770 pins the headroom text). True.
  3. "a fall to zero is refused as a dead scan." testSurfaceCollapse L227-236 (DEAD-SCAN REFUSAL 2) returns a refusal when the ceiling is above 0 and the run measured 0; the main path prints it and exits 2 at L1181-1185. Self-test battery 6 (L786-790) drives it in both directions. The edge the sentence does not spell out, a ceiling already at 0 with 0 sites (L228, L790), is not a fall, so the wording is not wrong for it. True.
  4. "(chore(scripts): ten ratchet baselines become one-sided — a decrease passes and is reported #26549)." The script's own docblocks cite the card test(floors): floors set at today's measured value and two-sided baselines red on every legitimate deletion — ui package counts in ~8 places, CLI command counts, catalog entries pinned 4×, slot-lookup-class baselines that fail on a decrease #26444; the comment cites the landing PR chore(scripts): ten ratchet baselines become one-sided — a decrease passes and is reported #26549, as card ci(gates): after #26444 made ten baselines one-sided, two ledgers stay two-sided and two comments still describe the old two-sided ratchet #26586 and its triage do. Both resolve to the same change. Observation, no fix.
  5. "Runs its own --self-test first." Unchanged and true: package.json L129, and the --self-test arm at L1235-1244 exits 0 only when selfTest() reaches its verdict.

Attempts to break it: (a) could "one-sided" now contradict the retained "same ratchet mechanism as slot-lookup"? No, slot-lookup is one-sided by the same card. (b) Does the comment say anything about the non-test residual's direction that the code contradicts? No, it leaves that to the slot-lookup sentence; slot-lookup's own step comment in lint.yml never says one-sided, a pre-existing gap in another hunk and not a finding against this one. (c) Can comment-only lines at the block's indent change the parsed workflow? No. (d) Is the old wording really stale on main? Yes: origin/main still reads "decrease-only", and PR #26549 removed the else if error branch for testSites below testCeiling (the current self-test row L751 expects zero errors for the shrink).

No must-fix. No should-fix.

Implemented-by: claude/issue-26586-lint-ratchet-comment
Reviewed-by: session_01QSeKYmTYfaPbLQD4BJfomW

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 — ACCEPT · domain:devx#2 · head 5a94fec320 · 2026-10-28T06:35Z

维护者速读

  • 改了什么:lint.yml 中 Engine query-options erasure ratchet 步骤上方的一段注释,把「只降不升」改为「单向」:超过上限报红;下降放行并报告;一次降到 0 视为扫描失效,拒绝。
  • 为什么改:chore(scripts): ten ratchet baselines become one-sided — a decrease passes and is reported #26549 已把这条棘轮改成单向,旧注释描述的是双向时代的行为,会误导读注释的人。
  • 风险与回滚:只改注释,没有任何步骤、条件或命令变动;回滚即 revert。
  • 先看:.github/workflows/lint.yml 约 L4277–4284。
  • 两分钟验证:对照 scripts/check-query-options-erasure-ratchet.mjs 的 diffRatchet(超上限报错)、ratchetDownReport(下降报告)、testSurfaceCollapse(降到 0 拒绝)。
  • 需要你做的:无。os-zhuang 已批准并入队。

席位意见:合入。达档契约复核 PASS(6462431405),无 must-fix、无 should-fix;新措辞逐句与读取脚本一致。

Shape: → main, Fixes #26586. Label skip-changeset, assignee os-justin. 1 file, +5/−3, comment lines only. Report: os-dev-report 6462301119.

Seat's own read: the three claims match the reader on origin/main.

  • Growth past the ceiling reds.
  • A fall passes and is reported.
  • A fall to zero is refused (testSurfaceCollapse, L227–234).

Gates: at head 5a94fec320, 61 check-runs: 45 success, 16 skipped, 0 failure.

Landing: Tier H. os-zhuang (GOVERNED_APPROVERS) approved this head, readied it and armed auto-merge, so it is in the queue by the maintainer side's hand.

Card item 4. It asked whether a narrowed detector whose counts fall, and that no longer reds a production run, is acceptable. The reader's existing answer is testSurfaceCollapse: a fall to zero in one run is refused as a dead scan, and a partial fall passes and is reported. This PR closes the card with Fixes. If a guard against a partial narrowing is wanted, that is a new card that cites this note. Nothing is filed now: no partial-narrowing incident has been measured.


Generated by Claude Code

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

Labels

ci/cd size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(gates): after #26444 made ten baselines one-sided, two ledgers stay two-sided and two comments still describe the old two-sided ratchet

3 participants