skip to content

diagnose a collector from its results · lesson 2 of 9 · sources checked 2026-11-22

the attempt record: facets and steps

This lesson designs the record of each attempt at three grains, and tests each facet before a diagnosis uses it.

status of this lesson: documented in my test system

purpose

A diagnosis can read only what the record stores. A facet that the record does not store cannot point to a layer. A facet with the same value on almost each attempt cannot point to a layer either.

objectives

  1. Design an attempt record at the three grains: run, attempt, and step.
  2. Map each question of a diagnosis to one facet of the record.
  3. Write null for "not observed", and store a blocking layer only with its basis.
  4. Test each field with a positive control, and measure the variance of each facet.
  5. Classify a response into one terminal state from its facets, not from its status.

new terms

hypothesis ledger
The record of each hypothesis of a diagnosis, its predicted facets, its test, its result, and its decision.
layer basis
The evidence that gave a blocking layer: a signature, a probe, a page verdict, or a label by convention.

how it works

The record has one job: each question of a diagnosis must find a facet in it. A diagnosis that asks a question with no facet can only guess.

three grains

The record has three grains. A run is one set of attempts of one configuration. Each grain holds its own fields:

  • The run: one field for each factor of the configuration, the version manifest, and the results of the positive controls.
  • The attempt: the result of one try, with the fields below.
  • The step: the action, the status, and the facets of its response.

The attempt holds the availability fact apart from the outcome class. Thus a tool that did not start is not a fail.

The attempt also holds the blocking layer with its basis, and the stage reached.

The other fields of the attempt are the vendor that protects the page and the vendor whose rule blocked. They are also the egress, the transport, the timing, the request index, and the bytes.

For example, an attempt of a checkout flow has five step rows. Its stage reached is the cart, and the row of the checkout step holds the status 403.

Here, the record serves a diagnosis only. More detail on the telemetry design of the whole system is in Telemetry design for a collection system (not yet published). More detail on the stage record is in The oracle for a flow: stages and the stage reached (not yet published).

one facet for each question

A hypothesis ledger holds each hypothesis of a diagnosis, the facets that it predicts, its test, and its result. More detail is in The diagnosis loop and the hypothesis ledger (not yet published). Before a test, write the facet that answers each question of the ledger.

For example, the question "did the site show a challenge?" must have a facet that records a challenge marker. A site can put that marker in a response header.

One detection vendor documents such a marker. A response of its challenge page has the cf-mitigated header, set to challenge. The page states that challenge is the only valid value, and that the header is set for all types of its challenge page Cloudflare, source 1.

The same page states that the content type of a challenge is text/html for each requested resource type. Thus a request for JSON that gets HTML back is a second facet of the same question.

null means not observed

Write null when the record did not observe a facet. A false or an empty text says that the record looked and found nothing. For example, challengeSeen: null means "the probe did not run", and challengeSeen: false means "the probe ran and found no challenge".

A diagnosis that reads null as false finds a pass that nobody saw.

a layer only with its basis

Store a blocking layer only with its layer basis: a signature, a probe, a page verdict, or a label by convention. A label by convention is a guess that a rule wrote. For example, a rule can write "IP" for each block with status 403. That label carries less weight than a block page with a known signature.

test each field before you trust it

Each field gets a positive control: a lab page that sets a known value. For example, a lab page that always sends a challenge header must give challengeSeen: true. If the field stays null, the field is broken, not the site.

Then measure the variance of each facet over a set of attempts. Count the different values of the facet. A facet with one value on almost each attempt cannot separate two hypotheses.

the record of the benchmark platform

The benchmark platform, my test system, stores facets on each attempt. Examples are the outcome class, the page verdict, the tool version, and a label of the test page.

The blocking layer stands on failed attempts only. The HTTP status stands only as a number in the reason text of a block signature. The chart in the section "Data" counts the different values of each facet.

from facets to a terminal state

A classifier puts each response into one terminal state from its facets. The status alone never decides, because a page with status 200 can be a challenge. The classifier reads the facets in this order:

  1. No page: navigation error.
  2. A challenge marker: challenge.
  3. A block signature: hard block.
  4. A verify form and no result template: verify wall. A verify wall asks for a login or a verification step in place of the content.
  5. The content assertion finds the result template, and the result count is 0: true empty. A true empty is a real page with no results.
  6. The template and one or more results: pass.

Each other set of facets is "unknown", and a person reads it. The code example shows this order.

the two sides

automation sidedetection side
A facet that the record does not store cannot point to a layer. A facet with one value on almost each attempt also cannot point to a layer.A detection team designs the same record for its own decisions: the rule, the score, the action, and the basis. The variance of its own facets shows which rules decide.

design decisions

optiongaincostwhen it is correct
One flat row for each attemptSimple queriesA flow failure has no position.For a single page with no flow
Three grains: run, attempt, and stepEach question finds its grain.More tables and joinsFor each flow of more than one step
null for "not observed"A missing probe does not look like a pass.Each query must handle null.Always
A layer with its basisA guess shows as a guess.One more fieldAlways
A status classifierLittle codeA challenge with status 200 reads as a pass.Never as the only classifier
A classifier on facetsEach terminal state has a reason.Each state must have its own facets.For each target with a flow

diagram

The first diagram shows the three grains of the record.

the attempt record at three grains

  1. RunOne field for each factor of the configuration, the version manifest, and the results of the positive controls
  2. AttemptAvailability, outcome class, blocking layer with its basis, stage reached, vendor fields, egress, transport, timing, request index, and bytes
  3. StepThe action, the status, and the facets of the response
Each grain answers its own questions: the run gives the configuration, the attempt gives the result, and the step gives the position.source: My model of the attempt record

The second diagram shows the order in which the classifier reads the facets.

the facet funnel: each facet narrows a response to one terminal state

The status is not a branch. Only the facets decide the terminal state.source: My model of the semantic classifier

code example

The first example is a schema at three grains with a validator. The run is synthetic.

m49-x02-record.tstypescript

An attempt record at three grains, and a validator for null, the layer basis, and the factor fields.

// An attempt record at three grains (run, attempt, step), with a validator.
// All records are synthetic. null means "not observed".

type Basis = "signature" | "probe" | "page-verdict" | "convention";
type Layer = "transport" | "ip" | "fingerprint" | "behavior" | "challenge" | "attestation" | "coherence";

type Step = { action: string; status: number | null; facets: Record<string, string | number | boolean | null> };
type Attempt = {
  id: string;
  availability: "started" | "tool-failed" | "gateway-refused";
  outcome: string | null;
  blockingLayer: Layer | null;
  layerBasis: Basis | null;
  stageReached: string | null;
  challengeSeen: boolean | null;
  steps: Step[];
};
type Run = { id: string; factors: Record<string, string | null>; manifest: Record<string, string>; controls: Record<string, "pass" | "fail">; attempts: Attempt[] };

const FACTORS = ["client", "build", "addressClass", "sessionState", "pace", "entryPath"];

function validate(run: Run): string[] {
  const issues: string[] = [];
  for (const f of FACTORS) {
    if (!(f in run.factors)) issues.push(`run ${run.id}: no field for factor ${f}`);
  }
  if (Object.keys(run.manifest).length === 0) issues.push(`run ${run.id}: empty version manifest`);
  for (const a of run.attempts) {
    if (a.blockingLayer !== null && a.layerBasis === null) issues.push(`attempt ${a.id}: layer ${a.blockingLayer} has no basis`);
    if (a.availability !== "started" && a.outcome !== null) issues.push(`attempt ${a.id}: availability ${a.availability} but an outcome is set`);
    a.steps.forEach((s, i) => {
      for (const [k, v] of Object.entries(s.facets)) {
        if (v === "") issues.push(`attempt ${a.id} step ${i}: facet ${k} is "", write null for "not observed"`);
      }
    });
  }
  return issues;
}

const run: Run = {
  id: "run-a",
  factors: { client: "browser", build: "build-1", addressClass: "datacenter", sessionState: "fresh", pace: "slow" },
  manifest: { tool: "1.4.0", browser: "build-1" },
  controls: { positive: "pass" },
  attempts: [
    { id: "a1", availability: "started", outcome: "pass", blockingLayer: null, layerBasis: null, stageReached: "confirm", challengeSeen: false,
      steps: [{ action: "open list", status: 200, facets: { resultCount: 12 } }] },
    { id: "a2", availability: "started", outcome: "hard-block", blockingLayer: "ip", layerBasis: null, stageReached: "list", challengeSeen: null,
      steps: [{ action: "open item", status: 403, facets: { blockSignature: "" } }] },
    { id: "a3", availability: "gateway-refused", outcome: "fail", blockingLayer: null, layerBasis: null, stageReached: null, challengeSeen: null, steps: [] },
  ],
};

const issues = validate(run);
for (const line of issues) console.log(line);
console.log(`result: ${issues.length} issues in run ${run.id}`);

output

One line for each issue of the synthetic run, and the count of issues.

run run-a: no field for factor entryPath
attempt a2: layer ip has no basis
attempt a2 step 0: facet blockSignature is "", write null for "not observed"
attempt a3: availability gateway-refused but an outcome is set
result: 4 issues in run run-a

The output shows four issues. A factor field is missing, and a layer has no basis. A facet has an empty text in place of null, and an attempt that did not start has an outcome.

The second example tests each field with a positive control, and counts the different values of each facet.

m49-x03-facet-check.tstypescript

A positive-control test for each field, and the variance of each facet over a set of synthetic attempts.

// Facet check: a positive control for each field, and the variance of each facet.
// The attempts are synthetic. A positive control row has a known expected value.
type Value = string | number | boolean | null;
type Row = Record<string, Value>;

const CONTROLS: [string, Value][] = [
  // field, expected value on the lab page of the positive control
  ["challengeSeen", true],
  ["blockSignature", "lab-block"],
  ["resultCount", 5],
];
const TOP_SHARE_LIMIT = 0.95; // example limit, not a measurement

function checkControls(controlRow: Row): string[] {
  const faults: string[] = [];
  for (const [field, expected] of CONTROLS) {
    const got = field in controlRow ? controlRow[field] : null;
    if (got !== expected) faults.push(`field ${field}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(got)}`);
  }
  return faults;
}

function variance(attempts: Row[], facet: string): { count: number; topShare: number } {
  const counts = new Map<Value, number>();
  for (const a of attempts) {
    const v = facet in a ? a[facet] : null;
    counts.set(v, (counts.get(v) ?? 0) + 1);
  }
  const top = Math.max(...counts.values());
  return { count: counts.size, topShare: Math.round((top / attempts.length) * 100) / 100 };
}

const controlRow: Row = { challengeSeen: null, blockSignature: "lab-block", resultCount: 5 };
const attempts: Row[] = [
  { status: 200, pageVerdict: "pass", challengeSeen: false },
  { status: 200, pageVerdict: "bot", challengeSeen: false },
  { status: 200, pageVerdict: "bot", challengeSeen: false },
  { status: 200, pageVerdict: "pass", challengeSeen: false },
];

for (const line of checkControls(controlRow)) console.log(line);
for (const facet of ["status", "pageVerdict", "challengeSeen"]) {
  const { count, topShare } = variance(attempts, facet);
  const note = topShare >= TOP_SHARE_LIMIT ? "  <- cannot separate hypotheses" : "";
  console.log(`${facet}: distinct values ${count}, top value share ${topShare.toFixed(2)}${note}`);
}

output

One line for each fault of a positive control, then the count of distinct values and the top value share of each facet.

field challengeSeen: expected true, got null
status: distinct values 1, top value share 1.00  <- cannot separate hypotheses
pageVerdict: distinct values 2, top value share 0.50
challengeSeen: distinct values 1, top value share 1.00  <- cannot separate hypotheses

The output shows one broken field: the lab page of the positive control sets a challenge, but the field stays null. Two facets have one value with a top share at or above the example limit of 0.95. Thus they cannot separate two hypotheses.

The third example is the classifier. Each response is a synthetic response of a lab page.

m49-x04-classify.tstypescript

A semantic classifier that puts each response into one terminal state from its facets, not from its status.

// A semantic classifier: a response goes to one terminal state from its facets.
// The status is one facet among others, never the decision alone.
// All responses are synthetic responses of a lab page.

type Facets = {
  navigated: boolean;        // false: the browser got no page
  status: number | null;
  challengeMarker: boolean;  // a challenge header or a challenge page
  blockSignature: boolean;   // a known block page
  verifyForm: boolean;       // the page asks for a login or a verification step
  templateFound: boolean;    // the content assertion finds the result template
  resultCount: number | null;
};
type State = "navigation error" | "challenge" | "hard block" | "verify wall" | "true empty" | "pass" | "unknown";

function classify(f: Facets): State {
  if (!f.navigated) return "navigation error";
  if (f.challengeMarker) return "challenge";
  if (f.blockSignature) return "hard block";
  if (f.verifyForm && !f.templateFound) return "verify wall";
  if (f.templateFound && f.resultCount === 0) return "true empty";
  if (f.templateFound && (f.resultCount ?? 0) > 0) return "pass";
  return "unknown";
}

const base: Facets = { navigated: true, status: 200, challengeMarker: false, blockSignature: false, verifyForm: false, templateFound: true, resultCount: 8 };
const cases: [string, Facets][] = [
  ["r1", base],
  ["r2", { ...base, challengeMarker: true, templateFound: false, resultCount: null }],
  ["r3", { ...base, status: 403, blockSignature: true, templateFound: false, resultCount: null }],
  ["r4", { ...base, verifyForm: true, templateFound: false, resultCount: null }],
  ["r5", { ...base, resultCount: 0 }],
  ["r6", { ...base, navigated: false, status: null, templateFound: false, resultCount: null }],
  ["r7", { ...base, templateFound: false, resultCount: null }],
];
for (const [id, f] of cases) console.log(`${id} status ${f.status ?? "null"}: ${classify(f)}`);

output

One line for each synthetic response, with its status and its terminal state.

r1 status 200: pass
r2 status 200: challenge
r3 status 403: hard block
r4 status 200: verify wall
r5 status 200: true empty
r6 status null: navigation error
r7 status 200: unknown

The output shows that five responses with status 200 go to five different terminal states.

data

distinct values of each facet in the stored attempts

status of this figure: measured by me

distinct values of each facet in the stored attemptstool version14target page label13detector list10site signals, attempt detail10site signals, table(classes)7oracle class4outcome class3blocking layer3page verdict3block signature class2http status2content assertion verdict2page verdict stage2challenge seen, oracle class1challenge seen, probe0unit: values

source: Benchmark platform, data (my test system): facet inventory of the stored attempts of one period; date 2026-11-03; sample of 34,935; condition: 13 public test pages, not commercial sites. Timing, error class, and availability reason are out: no count of values for an attempt. One platform only.

data table
distinct values of each facet in the stored attempts
facetvalues
tool version14
target page label13
detector list10
site signals, attempt detail10
site signals, table (classes)7
oracle class4
outcome class3
blocking layer3
page verdict3
block signature class2
http status2
content assertion verdict2
page verdict stage2
challenge seen, oracle class1
challenge seen, probe0
Count of different values that each facet takes. Most facets take 4 values or fewer. The chart gives counts, not the share of attempts that carry a value.

The chart is a measurement of the stored attempts of the benchmark platform on public test pages. Most facets take few values, and the challenge facets have almost no variance. Thus in this data, a challenge facet cannot point to a layer.

failure modes

problemcausecorrection
A real pass reads as a block.The classifier reads a stale navigation status, not the content.Let the content assertion decide, not the status.
A challenge page counts as a pass.The status 200 decides the state.Read the challenge marker before the status.
A missing probe looks like a pass.The record writes false or an empty text for "not observed".Write null, and handle it in each query.
A guess looks like a finding.The record stores a layer with no basis.Store the layer basis with each layer.
A broken field blames the site.Nobody tested the field.Run a positive control for each field before a diagnosis.
A flow failure has no position.The record has no step rows.Store one row for each step and the stage reached on each attempt.

check questions

  1. Which grain of the attempt record holds the version manifest?

    1. The step
    2. The run
    3. The attempt
    answer

    b. The run

    The run holds one field for each factor of the configuration, the version manifest, and the results of the positive controls.

  2. Your hypothesis ledger asks if the site showed a challenge. Give one facet that can answer the question.

    sample answer

    A facet that records a challenge marker, for example a response header that a site sets on a challenge page. A second facet is an HTML response to a request for JSON.

  3. A probe of the challenge state did not run on an attempt. Which value goes into the field?

    1. false
    2. An empty text
    3. null
    answer

    c. null

    null means not observed. false and an empty text say that the record looked and found nothing.

  4. A facet has the same value on almost each attempt. What can a diagnosis do with it?

    1. It cannot use the facet to separate two hypotheses.
    2. It can use the facet as the strongest evidence.
    3. It can use the facet as the layer basis.
    answer

    a. It cannot use the facet to separate two hypotheses.

    A facet with one value on almost each attempt has no variance. Thus it cannot point to a layer.

  5. A response has status 200, a challenge marker, and no result template. Which terminal state does the classifier give?

    1. pass
    2. challenge
    3. true empty
    4. verify wall
    answer

    b. challenge

    The classifier reads the challenge marker before the status. A page with status 200 can be a challenge.

exercise

exercise Do this task on paper, with the synthetic step records in the table. Do not send a request to a site.

responsepagechallenge markerblock signatureverify formresult templateresult countstatus
1yesnononoyes0200
2yesyesnonononull200
3yesnonoyesnonull200
4yesnoyesnononull403
5nonononononullnull

A classifier on the status alone gives pass for status 200, hard block for 403, and navigation error for no status.

  1. Read the facets of each response in the order of the classifier.
  2. Write the terminal state of each response.
  3. Write the state that a classifier on the status alone gives to each response.
  4. Mark each response where the two states differ.
sample answer

The answer uses the five synthetic responses of the table.

Response 1 is a true empty. Response 2 is a challenge, response 3 is a verify wall, response 4 is a hard block, and response 5 is a navigation error.

A classifier on the status alone gives a pass to responses 1, 2, and 3, because each has status 200. Thus the two states differ for responses 1, 2, and 3. Responses 4 and 5 get the same state from both classifiers.

sources

  1. Detect a Challenge Page response, Cloudflare, documentation, read 2026-11-22
  2. My model of the attempt record at three grains, the layer basis, and the semantic classifier, 2026-11 (not public).
  3. Benchmark platform, data (my test system): the facets of the stored attempts, 2026-11 (not public).