measurement-controls
Check a benchmark, A/B or eval metric measures what it claims: control arms, oracles that can fail, pooled correlations, small x/N. Use when setting up an experiment or a metric says improved.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 59
- Forks
- 6
01 前言 Front Matter
- name
- measurement-controls
- created
- 1793923200000
- modified
- 1794009600000
- reviewed
- 1793923200000
- description
- Check a benchmark, A/B or eval metric measures what it claims: control arms, oracles that can fail, pooled correlations, small x/N. Use when setting up an experiment or a metric says improved.
- allowed-tools
- Read, Grep, Glob, TodoWrite
02 资源文件 1
- 参考文档REFERENCE.md7.2 KB
03 SKILL.md 正文
Measurement Controls
A measurement fails most expensively when it returns a confident, well-formed answer about something it never observed. Nothing in the run contradicts it, so the finding ships. Each numbered section is one way a control, an oracle or a metric produces that answer, and the check that exposes it.
When to Use This Skill
| Use this skill when... | Use something else when... |
|---|---|
| Setting up an A/B, an A/A′, or a "did X change the output?" control | Timing a change against a baseline → benchmark-controls |
| An oracle or scorer is about to turn artifacts into verdicts | Auditing whether a green suite tests what it aims at → test-strategy-review |
| A metric says "improved" and a person still complains | Finding weak assertions by mutating code → mutation-testing |
| Correlating two variables, or reporting a rate as x/N | A tool's empty result is about to gate an action → agent-patterns-plugin:tool-result-traps |
| Locating a defect in a long artifact (video, audio, logs, rows) | |
| Claiming an operation is "lossless", "exact" or "byte-identical" |
1. A control's two arms differ only in the variable
A comparison control answers "did X change the output?" only while X is the only difference. If the arms also differ in a label, filename, extra step or timestamp, and the compared artifact carries it, the control reports "different" whatever X did. A control that cannot fail has not tested anything. Canonical break: a container format that embeds the generating parameters makes two files differ unconditionally; hash the decoded stream.
- Enumerate what differs between the arms besides the variable: step counts, labels, output paths, seeds, timestamps, run order.
- Ask whether the compared artifact carries any of it. Containers, embedded metadata, EXIF and log headers do. Compare decoded content.
- Prove it can report "same": run A/A′ with the variable removed and confirm an identical digest. If not, every past verdict from it is void.
- Keep the arms otherwise byte-identical, output prefix included.
Two gates, not one:
| Gate | Asks |
|---|---|
| A == A′ | Can the comparison report "same"? (determinism) |
| B ≠ A in what the system receives | Was the variable applied at all? |
Diff the input the system actually receives (the converted request, the resolved config), not the source file you edited: a value overridden downstream is inert. Prove the gate refuses a deliberately broken variant.
The instrument, build-time checks and a few more ways a control lies (stale bytecode, a result cache, a test that re-implements its subject, a control that cannot pass) are in REFERENCE.md.
2. Gate the oracle on a known-good case
An oracle can be wrong in the direction that produces a finding. Before an oracle scores a failure case, make it recover a case already known to have succeeded. An instrument no better than chance on the known-good case cannot certify a failure anywhere. The known-good case is usually free: a project chasing a defect has examples where the thing worked.
- Name a case known to have worked, independently of the instrument, and name the channel it is known-good for. A case validated on one axis is not validated on another.
- Score it. Require a high hit rate and more than one distinct answer. An oracle answering one label for everything scores 2/4 on an alternating two-class script by coincidence; without the degeneracy check, 50% reads as borderline-usable when it is a constant.
- Read the raw answer, not the gated verdict. Scoring only the items the oracle was confident about lets it pass by declining everything it would get wrong.
- Take ground truth from the artifact's own record (plan, manifest, the input that produced it), never the current tree.
- Refuse in the tool, not in a comment someone has to remember, and keep a disqualified oracle as a selectable arm: a gate that has only ever passed something has not been shown to discriminate.
- When the oracle reports a surprising negative, re-run the gate before believing it. A negative from an ungated instrument is a claim about the instrument.
3. A pooled correlation or rate can be a grouping artifact
Correlating over several groups stacked together can produce a large r that
reports only that the groups differ in both variables. Before believing a
correlation, ask what else varies along with both axes. Report the
within-group coefficient next to the pooled one.
- Name the groups before computing anything: lines per render, renders per arm, files per repo, runs per machine, warm vs cold.
- Tabulate each group's mean on both axes. If the groups differ on both, the pooled coefficient is contaminated before you compute it.
- Compute
rwithin each group and report both. A pooled figure alone is not a result. - Read the intercept. If the effect is at full strength when the proposed cause is absent, the cause is not the cause.
- Mind the independence. A surviving within-group
rat small n is suggestive, never established. - Record the dead correlation with its numbers. Omitting it invites its rediscovery. A pre-registered hypothesis protects against fishing, not against confounding.
The same law for a rate: x/N over observations that are not independent inflates n by the group size, and lets a systematic failure score partial credit (a constant answer earns 2/4 on an alternating truth).
- Print the per-group outcome vector before any ratio (
A A A A, not2/4). The vector shows the failure mode. - Ask whether a partial score is reachable. Classify groups into named
states and count states, with a
mixedbucket you look at. A taxonomy with no escape hatch confirms itself. - Score a deliberately degenerate arm (all one label). If it earns more than zero, the metric rewards collapse.
- Label a pooled figure not-for-quoting where it must still be computed.
- Report n in units of the thing measured once. Do not state a clean structural rule from a dozen groups; that is the same small-sample error.
4. Locate the event by content, not by formula
A probe that computes where to look from an index formula measures whatever sits at that index, precisely. Find the event by scanning for it, then measure. An index derived from arithmetic is a hypothesis about the artifact's layout.
- Name the boundary the report means, in the artifact's own terms, before measuring. "The seam" can have two referents.
- Scan; do not compute. One pass of a per-step statistic, then
argmax. It finds the true location and events nobody knew to look for. - Choose the statistic that matches the phenomenon. A small change over a large area is caught by area, not amplitude; the wrong one ranks arms in reverse.
- Localise with a picture before quantifying: a difference map says what changed.
- Sanity-check the located index against the artifact's structure.
- Sampling is the wrong instrument for a local defect. A defect that occupies one adjacent pair cannot be found by sampling frames, rows or log lines; scan every pair. Approving from a sample is a claim about the sample, so name which sample. A stated limitation is not a mitigation.
Calibrating with an injected signal, control-testing the failing arm, and diffing by identity: REFERENCE.md.
5. Measure the quantity that decides the user's verdict
An evaluator measures one quantity; the user experiences a phenomenon. Before a metric gates work, establish that it measures what decides the user's verdict. An accurate, well-controlled metric about the wrong half manufactures progress.
- Write down the user's verdict procedure before choosing the metric: what does the person judging this actually do?
- A column that declines most inputs is a coverage failure. Count the declines and report them next to the headline.
- One human observation outranks any number of runs of an unvalidated instrument. Where a validation set is unfilled, say so in the result.
- When human and instrument disagree, reconcile; do not pick. The disagreement points at the quantity nobody measures yet.
- A metric earns authority per axis. A validation transfers to the axis and the comparison it was taken on (between-arm is weaker than absolute), no further. Say which axis a number is about next to the number.
- After any human review, ask which quantity they just used, not only whether they agreed with the number.
6. Verify each layer against its own stem
A placement check that correlates a source against a mixed result answers "is this where I put it" only while the window holds that source alone. Sum each layer separately and verify each against its own stem. "The layers do not overlap" is a property of today's content, not of the checker.
- One stem per layer, keyed off each item's layer tag, not off a hand-maintained exclusion list. The exclusion list is the author having noticed the problem for one case.
- When a check newly fails on something you did not change, suspect the check.
- Two instruments disagreeing is how you find it; neither number is trustworthy alone.
7. A per-stream guarantee is not a per-file guarantee
"Lossless", "byte-identical", "no re-encode" are claims about one code path, and a file carries several streams. A guarantee is scoped to the stream the code actually copies. Name which stream, and measure the others.
- Name the streams before believing the promise: video, audio, subtitles, timecode, metadata; or rows, sequences, constraints; or contents, modes, mtimes.
- Measure the stream the promise was not about, by content. Header durations and metadata are what the buggy path also produced.
- Probe across the range, not at the start. An accumulating error is invisible at the origin, and the aggregate (total length, row count) passes while every part is wrong. Verify per join.
- Handle both signs (pad and trim) when fixing a drift.
- Scope the claim in the docstring: "video copied byte-for-byte, audio re-encoded once", never a bare "lossless".
Related
- REFERENCE.md — the instrument as an arm, checks that cannot fail, calibration, and where each law bites outside media
benchmark-controls— timing-specific control hazardsmutation-testing— the mutation table that proves a check can failagent-patterns-plugin:tool-result-traps— empty or well-formed tool output that is not the answer it looks likedocumentation-plugin:docs-claim-hygiene— writing a measurement down with its scopecode-quality-plugin:code-derived-facts— guards that must use a looser, independent pattern
Distilled from rules in the laurigates/comfyui-nodes repository, whose dated instances (video, audio and attribution experiments) are the provenance for each law.
04 同仓库更多 Skills
kitty-show-image
Show the user an image with a note on what to judge, via a file send or a labelled kitty tab. Use when the user must see an image, or icat fails with no /dev/tty.
kitty-session-persistence
Snapshot and restore kitty terminal sessions on macOS. Use when surviving WindowServer hangs without losing tabs, configuring snapshots, or restoring after a force-reboot.
kitty-remote-control
Safe kitty remote control from an agent — read panes with kitty @ ls/get-text, notify, and never mutate the live terminal unasked. Use when running inside kitty.
docs-reference-check
Dangling doc-reference gate: flag markdown naming repo paths or relative links that no longer exist. Use when docs cite moved/deleted files, or wiring a doc-drift lint.
youtube-upload
Upload a video to YouTube via the Data API v3 and edit its title, description, tags or thumbnail afterwards. Use when publishing or retitling a YouTube video.
youtube-studio-share
Share a private YouTube video with a whole Google Workspace organization by scripting YouTube Studio in the browser. Use when a video must be org-only.