test strategy for a collection product · lesson 6 of 7 · sources checked 2026-11-30
the release gate and the permitted live canary
This lesson joins the results of each test layer in one release gate, and writes the record of a small canary on a permitted target.
this page is not legal advice.
purpose
Each test of a collector proves a small part, and a release must not go out on one green test. A live test also puts load on a site that belongs to a different party. Thus a release must have one written decision, and each live attempt must have a written permission.
objectives
- List the inputs of a release gate and the proof that each input must give.
- Refuse a release when an input fails or inspects nothing.
- Write the five items of the record of a permitted live canary.
- Explain why a comparison in the same window gives fewer false alarms than a comparison with the time before.
- Name the actions that follow a block or a refusal of a canary.
new terms
- permitted live canary
- A canary on a target whose owner gave permission, with a scope, a rate cap, a consent record, and a stop condition.
- pass rule
- The rule that states which class each control client and the release client must get on the lab detection target.
how it works
A release gate is one check at the end of the test plan.
The gate reads the result of each test layer, and it gives one verdict: accept or refuse.
After an accept, a canary runs on lab targets.
A permitted live canary runs only after that, and only on a target whose owner gives permission.
the inputs of the gate
The gate reads five inputs. Each input gives the version of its own test data, so that the verdict names what it tested:
- The positive controls of the benchmark harness. Each is a client with a known result: a known-good client must pass, and a known-bad client must fail.
- The pass rule on the lab detection target. The release client must keep its expected class.
- The replay suite. The extractor must give the expected record from each stored response.
- The set of each upstream contract test. Each stored shape must agree with the extractor.
- The report of the shadow on the response. Each difference between the old and the new extractor has a class.
For example, a gate verdict reads "accept, controls v7, lab target v3, records r12, shapes v19, shadow report s4". A later reader can then find each input of the decision.
I run the gate on each merge, not only on a release tag. A full test only on a tag lets changes build up between merges, and a fault then has many possible causes.
each input must show that it inspected something
A check over an empty set finds no fault, and thus it is green. For example, the contract set loads zero stored shapes after a path change, and it reports "0 failed". The gate must read this result as empty, not as a pass.
Thus each input carries a count of the items that it examined. A count of zero refuses the release. A non-vacuity assertion in the test of each input gives the same guard. A missing input also refuses the release. The proof that a guard can fail is in Add one case without a regression.
the canary after the gate
A canary on lab targets comes first. It sends no load to a third party, and it can run at each release. For example, it runs the search flow on a lab copy of one target class.
A live canary runs only on a target that permits automated access. The permission comes from its terms, its robots file, a declared path, or a written agreement. The canary sends a small, declared, slow volume. The owner of the target can see its traffic.
the rules of engagement as a model
status of this section: from a public sourceNIST defines the rules of engagement as "detailed guidelines and constraints regarding the execution of information security testing". The rules come before the start of the test. They give the test team the authority for defined activities with no further permission NIST CSRC, source 1.
the record of a live canary
The record of a live canary has the same form. It holds five items:
- The scope: the target, the paths, and the flows that the canary can use.
- The rate cap: the volume cap of the canary. It is the maximum count of attempts in one hour, for example 30. You set it with the owner of the target.
- The consent record: who gave the permission, when, and for which scope and rate. Your attorney examines it before the first attempt.
- The stop condition: the events that end the canary at once.
- The comparison: the old version runs in the same window, on the same target class. The two versions share one rate cap.
The record gives the questions.
same window or before and after
A canary must find a fall of the pass rate. It must also find a false pass: a page that the collector accepts, but that has the wrong content. A canary that checks only one of these two edges misses the other.
A comparison with the hours before the release has a problem. The target also changes over time. A change of the target then looks like a fall that the release caused. When the old version runs in the same window, the time effect is in both results, and the difference shows the release only.
A longer window gives more statistical power, but it also adds more time effect to a comparison with the time before. The chart in the section "Data" shows this for the two designs.
a block ends the canary
A block, a refusal, or a fall that the stop condition names ends the release step. The next action is one of these:
- a diagnosis of the own system;
- a slower pace, or a lower volume cap;
- the declared path;
- a stop.
For example, the target answers with the status 429. The canary stops at once, and the team examines its own rate against the cap.
A canary never changes its exit, its identity, or its client class to get past a block. The consent record does not cover such a change.
the two sides
| automation side | detection side |
|---|---|
| One gate stops a release that fails any test layer, or that inspected nothing. A live canary without a record is an untracked attempt on a third party. | The owner of a permitted target sees the canary traffic. The consent record says which rate and scope the owner accepted. |
design decisions
| option | gain | cost | when it is correct |
|---|---|---|---|
| Gate on each merge | A fault has one recent cause. | Each merge waits for the full gate. | For each change to the collector |
| Gate only on a release tag | Fewer gate runs | Changes build up between tags, and a fault has many causes. | Never as the only gate |
| Canary on lab targets only | No load on a third party | The lab does not show a change of a real target. | When no target gives permission |
| Permitted live canary | It shows the release on a real target. | It is load on the target, and it must have a record and consent. | Only after the gate and the lab canary pass |
| Comparison in the same window | The time effect cancels. | The old version must run in the same window. | For each live canary |
| Comparison with the time before | No second version runs. | A change of the target looks like a fall. | Never as the only comparison |
diagram
the release gate: inputs, the check that each input inspected something, the verdict, and the canary
code example
The example reads synthetic results of four test layers. The fifth input, the shadow report, is missing. The contract set loaded zero shapes.
Read the result of each test layer, refuse an empty or missing result, and write the gate verdict with the input versions.
// Release gate evaluator. All values are synthetic.
type Result = {
testLayer: string;
version: string; // version of the test input
inspected: number; // count of items that the check examined
failed: number; // count of items that failed the check
};
const release = "collector 2.4.0 (synthetic)";
const required = ["harness controls", "pass rule", "replay suite", "contract set", "shadow report"];
const results: Result[] = [
{ testLayer: "harness controls", version: "controls v7", inspected: 2, failed: 0 },
{ testLayer: "pass rule", version: "lab target v3", inspected: 3, failed: 0 },
{ testLayer: "replay suite", version: "records r12", inspected: 412, failed: 0 },
{ testLayer: "contract set", version: "shapes v19", inspected: 0, failed: 0 },
];
const reasons: string[] = [];
for (const name of required) {
const r = results.find((x) => x.testLayer === name);
if (!r) {
reasons.push(`${name}: no result`);
continue;
}
const state = r.inspected === 0 ? "EMPTY" : r.failed > 0 ? "FAIL" : "pass";
console.log(`${name.padEnd(17)} ${r.version.padEnd(19)} inspected ${String(r.inspected).padStart(3)} ${state}`);
if (state === "EMPTY") reasons.push(`${name}: inspected nothing`);
if (state === "FAIL") reasons.push(`${name}: ${r.failed} failed`);
}
console.log(`release: ${release}`);
console.log(reasons.length === 0 ? "verdict: accept" : "verdict: refuse");
for (const why of reasons) console.log(` reason: ${why}`);output
One line for each input with its version, its count, and its state, then the verdict and each reason.
harness controls controls v7 inspected 2 pass
pass rule lab target v3 inspected 3 pass
replay suite records r12 inspected 412 pass
contract set shapes v19 inspected 0 EMPTY
release: collector 2.4.0 (synthetic)
verdict: refuse
reason: contract set: inspected nothing
reason: shadow report: no resultThe output shows that the gate refuses the release for two reasons, although no input reports a failed item.
data
canary alarms by window length: the old version in the same window against before-after
status of this figure: simulated
band: interval, level 0.95
source: Lab result of this course: Monte Carlo of two canary designs; date 2026-11-13; sample of 5,000; condition: One-sided two-proportion z test at level 0.05. All inputs are invented lab values, and the size of the hourly time effect is invented. These are teaching values for one host.
data table
| series | window length | % | interval |
|---|---|---|---|
| same window, false alarm | 1 h | 5.34 | 4.75 to 6 (level 0.95) |
| same window, false alarm | 2 h | 4.68 | 4.12 to 5.31 (level 0.95) |
| same window, false alarm | 4 h | 4.46 | 3.92 to 5.07 (level 0.95) |
| same window, false alarm | 8 h | 4.58 | 4.03 to 5.2 (level 0.95) |
| same window, false alarm | 24 h | 5.28 | 4.69 to 5.94 (level 0.95) |
| before-after, false alarm | 1 h | 5.7 | 5.09 to 6.38 (level 0.95) |
| before-after, false alarm | 2 h | 6.82 | 6.15 to 7.56 (level 0.95) |
| before-after, false alarm | 4 h | 9.74 | 8.94 to 10.6 (level 0.95) |
| before-after, false alarm | 8 h | 15.76 | 14.77 to 16.8 (level 0.95) |
| before-after, false alarm | 24 h | 30.72 | 29.45 to 32.02 (level 0.95) |
| same window, detection of a fall | 1 h | 23.84 | 22.67 to 25.05 (level 0.95) |
| same window, detection of a fall | 2 h | 36.18 | 34.85 to 37.53 (level 0.95) |
| same window, detection of a fall | 4 h | 58.82 | 57.44 to 60.18 (level 0.95) |
| same window, detection of a fall | 8 h | 83.72 | 82.67 to 84.72 (level 0.95) |
| same window, detection of a fall | 24 h | 99.8 | 99.63 to 99.9 (level 0.95) |
| before-after, detection of a fall | 1 h | 25.84 | 24.64 to 27.08 (level 0.95) |
| before-after, detection of a fall | 2 h | 38.3 | 36.96 to 39.66 (level 0.95) |
| before-after, detection of a fall | 4 h | 58.48 | 57.1 to 59.84 (level 0.95) |
| before-after, detection of a fall | 8 h | 74.02 | 72.78 to 75.22 (level 0.95) |
| before-after, detection of a fall | 24 h | 83.08 | 82.01 to 84.1 (level 0.95) |
With the old version in the same window, false alarms stay at one low level for each window length. With a comparison to the time before, false alarms grow with the window, because the time effect adds up.
failure modes
| problem | cause | correction |
|---|---|---|
| The gate accepts a release with a broken contract set. | The set loaded no shapes and reported zero failures. | Refuse each input with a count of zero. |
| The gate accepts a release with no shadow report. | The gate reads only the inputs that exist. | Give the gate a fixed list of necessary inputs. |
| A fault has many possible causes. | The full gate runs only on a release tag. | Run the gate on each merge. |
| The canary reports a fall that the release did not cause. | The canary compares with the hours before, and the target changed. | Run the old version in the same window. |
| The canary misses a false pass. | It checks only a pass that becomes a fail. | Check both edges. |
| A live canary has no record of its permission. | The team started it before the consent record. | Start a live canary only with a complete record. |
| A blocked canary goes on. | The record has no stop condition. | Write the stop condition, and stop at a block or a refusal. |
check questions
List the five inputs of the release gate, and give the proof that each input must give.
sample answer
The positive controls of the harness: the known-good client passes and the known-bad client fails. The pass rule on the lab target: the release client keeps its expected class. The replay suite: the extractor gives the expected record from each stored response. The contract set: each stored shape agrees with the extractor. The shadow report: each difference between the old and the new extractor has a class. Each input also gives the version of its test data and the count of items that it examined.
The contract set reports 0 examined items and 0 failed items. All other inputs pass. What is the gate verdict?
- Accept, because no item failed.
- Accept, but write a note for the next release.
- Refuse, because the contract set inspected nothing.
answer
c. Refuse, because the contract set inspected nothing.
A check over an empty set finds no fault. A count of zero refuses the release in the same way as a failed item.
A live canary record gives the scope, the consent record, the stop condition, and a comparison in the same window. Which item is missing?
- The rate cap
- The name of the release client
- The count of past blocks
answer
a. The rate cap
The record has five items: the scope, the rate cap, the consent record, the stop condition, and the comparison. The rate cap is the maximum count of attempts in one hour, which you set with the owner of the target.
One canary compares with the old version in the same window. A second canary compares with the hours before the release. Explain why the first gives fewer false alarms.
sample answer
The target also changes over time. In a comparison with the hours before, a change of the target looks like a fall that the release caused. This effect grows with a longer window. When the old version runs in the same window, the time effect is in both results, and the difference shows the release only.
A permitted live canary gets a block from the target. Name the actions that can follow.
sample answer
The block ends the release step. The next action is a diagnosis of the own system, a slower pace or a lower volume cap, the declared path, or a stop. The canary does not change its exit, its identity, or its client class.
exercise
exercise Do this task on paper. A team wants to release a new collector version. Use these synthetic records:
| input or record item | value |
|---|---|
| Positive controls of the harness | 2 examined, 0 failed |
| Pass rule on the lab target | 3 examined, 0 failed |
| Replay suite | 380 examined, 2 failed |
| Contract set | 41 examined, 0 failed |
| Shadow report | 0 examined |
| Canary scope | One permitted target, the search flow only |
| Canary rate cap | Not written |
| Consent record | Written permission of the owner, with the scope |
| Stop condition | A block or a refusal |
| Comparison | The pass rate of the day before |
- Write the gate verdict and each reason for it.
- Find each item of the canary record that is missing or weak.
- Write the correction for each such item.
sample answer
The answer uses the ten synthetic records of the task.
The gate refuses the release. The replay suite has 2 failed items, and the shadow report examined nothing.
The canary record has three faults. The rate cap is not written, and the consent record gives no rate. The correction for both is a rate cap that the owner accepts in writing. The comparison uses the day before, so a change of the target can look like a fall. The correction is the old version in the same window. The scope and the stop condition are complete.
sources
- Rules of Engagement (ROE), glossary, NIST CSRC, documentation, read 2026-11-22
- My model of the release gate, of its five inputs, and of the record of a permitted live canary, 2026-11 (not public).