skip to content

the target as configuration · lesson 2 of 6 · sources checked 2026-11-22

the profile store

This lesson keeps each target profile in a versioned store, where each edit passes a validator, a test against recorded pages, and a review.

status of this lesson: from a public source

purpose

A target profile changes often: a new extractor version, a slower pace, a new owner. When each change goes straight to the collector, one typing error can stop the work or fill the data with wrong records. A profile store puts a gate between the edit and the collector, and it keeps each earlier version.

objectives

  1. Describe the store as data that one general reader reads, with no code branch for each target.
  2. Put each edit through a validator, a test against recorded pages, and a review by a second person.
  3. Stamp the version of the target profile on each attempt record.
  4. Keep one source for each fact that two target profiles share.

new terms

profile store
The store that keeps each version of each target profile with its review and its test result.

how it works

The store keeps each version of each target profile. It can hold the versions as data files, or as a program that makes data. The collector has one general reader for the store. It has no code branch for each target name.

rules as data, not as code

status of this section: documented in my test system

In the benchmark platform, my test system, the success oracle rules for each target first lived in the worker code. The code kept them in a map with the host name as the key. Thus each new target was a release of code.

The correction moved the rules into data in a catalog. One general reader reads the data, and a target with no rule gets a general floor. For example, a new target then gets a data row and no release of code.

the gate of each edit

Each edit goes through three steps before it gets a version:

  1. The validator refuses an empty field with no default source, an unknown field, and an unknown value.
  2. The test runs the new version against recorded pages of the target. It compares the extracted records with the expected records.
  3. A second person reviews the diff and approves it. The person who made the edit cannot approve it.

Each step has a different reach. The validator sees only the form of the values. The test sees a fault only when a recorded page shows it.

The review sees a wrong value that is inside the permitted set, for example a pace of 2 seconds in place of 20 seconds. The lab result of such a gate is in The target profile.

recorded pages for the test

In WARC 1.1, a WARC file is the simple concatenation of one or more WARC records IIPC, source 1. In the standard:

  • a response record holds a complete response;
  • a request record holds the details of a complete request;
  • each record has the fields WARC-Record-ID, Content-Length, WARC-Date, and WARC-Type.

A recorded page in this form gives the test what the target sent. The test of the store reads only these stored pages. It sends no request to the target. Thus it shows a fault of the extractor, but no new decision of the defender on the live target.

the version stamp on each attempt

Each attempt record names the version of the target profile that made it. For example, a record holds "profileVersion": 7 beside the target name and the verdict.

When the verdicts change, a query on the stamp shows which version was active. Without the stamp, a stored result cannot be traced to the configuration that made it.

one source for each shared fact

Two target profiles can share a fact, for example the list of status classes that end an attempt with no new try. Two copies of that list can drift apart. Then one part of the system calls a failure final, and a second part tries again. Keep the list in one place, and let each target profile refer to it.

the two sides

automation sidedetection side
A store with versions lets an operator change one target and go back to the last good version. Logic in code for each host makes each new target a release of code.The detection side has the same problem with the remote configuration of each site. A change with no version and no test can block real users on one site. More detail is in The collection script: signals, build, delivery, and legal inputs and Release a rule in count mode (not yet published).

design decisions

optiongaincostwhen it is correct
Rules in code for each targetNo store to buildEach new target is a release of code.Only for a small number of targets
Data files in the repositoryThe normal code review applies.People who are not engineers cannot edit them easily.For a small team of engineers
A store with a gate and versionsEach edit has a test, a review, and a way back.You must build and run the store.When many people edit many targets
A test against recorded pagesNo load on the target, and a repeatable resultA new layout of the target is not in the old pages.For each edit of the extractor version or the oracle
A review by a second personIt sees wrong values that are inside the permitted set.Each edit waits for a person.For each edit that goes to the collector

diagram

The first diagram shows the path of an edit through the store.

the profile store: from an edit to a new version that each attempt record names

An edit gets a version only after the three steps of the gate. A refusal gives a reason and goes back to the editor.source: My model of the profile store

The second diagram puts the target profile beside the remote configuration of the detection side.

A matrix with two columns, the target profile of the operator and the remote configuration of a site. The rows compare the unit, the content, the editor, the version, and the effect of a change with no test.

the same object on two sides: a target profile and a remote configuration
propertytarget profile of the operatorremote configuration of a site
UnitOne targetOne protected site
ContentMethod, pace, caps, oracle, ownerRules, thresholds, and exceptions
Who edits itThe operatorThe detection team
VersionOne version for each changeOne version for each release
A change with no testWrong records or more loadBlocks of real users on the site
The two objects have the same problems: a version, a test, and an owner.source: My model of the target profile and the remote configuration

code example

The example is a store gate. It holds two synthetic recorded pages and four synthetic edits. It gives a version only when the three steps pass. Its validator checks only the empty fields and the method value.

m51-x02-store-gate.tstypescript

Give a version to an edit of a target profile only after the validator, a test, and a review pass.

// Store gate: an edit of a target profile gets a version only after the
// validator, a test against recorded lab pages, and a review.
// All data is synthetic. The recorded pages and the edits are in the code.
type Profile = Record<string, string | number | undefined>;
type Page = { id: number; body: Record<string, string>; expected: { title: string; price: string } };
type Edit = { name: string; author: string; reviewer: string; profile: Profile };
type Result = { result: "accepted"; version: number } | { result: "refused"; step: string; reasons: string[] };
const REQUIRED = ["method", "extractorVersion", "dataContract", "dailyCostCap", "owner", "legalStatus"];
const METHODS = new Set(["declared-feed", "http-client", "browser"]);

function validate(p: Profile): string[] {
  const faults = REQUIRED.filter((k) => p[k] === undefined || p[k] === "").map((k) => `${k}: empty, and no default source`);
  if (!METHODS.has(String(p.method))) faults.push(`method: unknown value ${p.method}`);
  return faults;
}
// Two synthetic extractor versions: 1 reads "price", 2 reads "amount".
function extract(version: string, body: Record<string, string>) {
  const field = version.startsWith("1.") ? "price" : "amount";
  return { title: body.title, price: body[field] ?? "(none)" };
}
function test(p: Profile, pages: Page[]): string[] {
  const misses: string[] = [];
  for (const page of pages) {
    const got = extract(String(p.extractorVersion), page.body);
    if (got.title !== page.expected.title || got.price !== page.expected.price)
      misses.push(`page ${page.id}: expected price ${page.expected.price}, got ${got.price}`);
  }
  return misses;
}
function gate(edit: Edit, pages: Page[], store: Profile[]): Result {
  const faults = validate(edit.profile);
  if (faults.length > 0) return { result: "refused", step: "validator", reasons: faults };
  const misses = test(edit.profile, pages);
  if (misses.length > 0) return { result: "refused", step: "test", reasons: misses };
  if (edit.reviewer === "" || edit.reviewer === edit.author)
    return { result: "refused", step: "review", reasons: ["no second person"] };
  store.push(edit.profile);
  return { result: "accepted", version: store.length };
}
const pages: Page[] = [
  { id: 1, body: { title: "Lamp", price: "12.00" }, expected: { title: "Lamp", price: "12.00" } },
  { id: 2, body: { title: "Desk", price: "80.00" }, expected: { title: "Desk", price: "80.00" } },
];
const base: Profile = {
  method: "http-client", paceSeconds: 20, extractorVersion: "1.4.0", dataContract: "product-record 3",
  dailyCostCap: 20, owner: "team-a", legalStatus: "decided-go",
};
const edits: Edit[] = [
  { name: "edit 1", author: "ana", reviewer: "ben", profile: { ...base, paceSeconds: 30 } },
  { name: "edit 2", author: "ana", reviewer: "ben", profile: { ...base, owner: "" } },
  { name: "edit 3", author: "ben", reviewer: "cy", profile: { ...base, extractorVersion: "2.0.0" } },
  { name: "edit 4", author: "cy", reviewer: "cy", profile: { ...base, paceSeconds: 2 } },
];
const target = process.argv[2] ?? "shop.example";
const store: Profile[] = [];
for (const e of edits) {
  const r = gate(e, pages, store);
  console.log(`${target} ${e.name}: ${r.result === "accepted" ? `accepted, version ${r.version}` : `refused at the ${r.step}`}`);
  if (r.result === "refused") for (const reason of r.reasons) console.log(`  ${reason}`);
}

output

The result of each edit: its version, or the step that refuses it and the reasons.

shop.example edit 1: accepted, version 1
shop.example edit 2: refused at the validator
  owner: empty, and no default source
shop.example edit 3: refused at the test
  page 1: expected price 12.00, got (none)
  page 2: expected price 80.00, got (none)
shop.example edit 4: refused at the review
  no second person

The output shows that only edit 1 gets a version. Edit 2 stops at the validator. Edit 3 stops at the test, because version 2 of the extractor reads a different field. Edit 4 stops at the review, because its author is also its reviewer.

data

per-target oracle definitions in the code of one platform, in three periods

status of this figure: documented in my test system

per-target oracle definitions in the code of one platform, in three periods169101417early 1early 2early 3middle 1middle 2latedefinitions

source: Benchmark platform, code: per-target oracle definitions in one source file (my test system); date 2026-11-12; sample of 17; condition: General form: no host name of a target, and no count of runs. The count is of definitions in the code at six points of its history.

data table
per-target oracle definitions in the code of one platform, in three periods
period and pointdefinitions
early 11
early 26
early 39
middle 110
middle 214
late17
Count of per-target definitions in one source file, at six points in order of time: three early, two middle, and one late. Of 9 later changes, 5 corrected an earlier definition. This is a count of code, not of runs.

The chart counts oracle definitions in one code file of the benchmark platform. The set grew over time. Some later changes corrected an earlier definition, and each such change was a change of the code.

failure modes

problemcausecorrection
Each new target is a release of code.The rules for each target live in code, with a branch for each host name.Move the rules into data, and use one general reader.
An edit passes the validator but breaks the records of one layout.The recorded pages hold no page of that layout.Add recorded pages of each layout of the target to the test.
A pace of 2 seconds in place of 20 seconds goes to the collector.The value is inside the permitted range, and nobody reviewed the diff.Ask for a review by a second person for each edit.
Nobody can say which configuration made a stored result.The attempt records carry no version of the target profile.Stamp the version on each attempt record.
One part of the system tries again after a failure that a second part calls final.Two copies of one list drifted apart.Keep one source for the list, and let each target profile refer to it.

check questions

  1. Describe a store that keeps the rules of each target as data, and say what a new target then costs.

    sample answer

    The store keeps each version of each target profile as data, or as a program that makes data. The collector has one general reader for the store and no code branch for each target name. A target with no rule gets a general floor. Thus a new target gets a data row and no release of code.

  2. An edit changes the pace from 20 seconds to 2 seconds. The value is inside the permitted range, and no recorded page shows a fault. Which step of the gate can stop it?

    1. The validator
    2. The review by a second person
    3. The test against recorded pages
    answer

    b. The review by a second person

    The validator sees only the form of the values, and the test sees a fault only when a recorded page shows it. A person who reads the diff can see a wrong value inside the permitted set.

  3. What can a test against recorded pages not show?

    1. A new decision of the defender on the live target
    2. A fault of the extractor on a recorded layout
    3. A record that does not agree with the expected record
    answer

    a. A new decision of the defender on the live target

    The test reads only stored pages and sends no request to the target. Thus it shows a fault of the extractor, but no new decision of the defender.

  4. The verdicts of a target change in one week. Which value on each attempt record shows which version of the target profile was active?

    1. The name of the target
    2. The time of the attempt only
    3. The version stamp of the target profile
    answer

    c. The version stamp of the target profile

    Each attempt record names the version of the target profile that made it. A query on the stamp shows which version was active.

  5. Two target profiles each keep a copy of the list of status classes that end an attempt with no new try. Explain the risk, and give the correction.

    sample answer

    The two copies can drift apart. Then one part of the system calls a failure final, and a second part tries again. Keep the list in one place, and let each target profile refer to it.

exercise

exercise Do this task on paper. Use the gate of the section "How it works" and these four synthetic edits. All values are synthetic.

editauthorreviewervalidator resulttest against recorded pages
1anabenno faulteach record agrees
2anaanano faulteach record agrees
3benanaempty owner fieldnot run
4bencyno fault3 records do not agree
  1. For each edit, write the first step of the gate that refuses it, or write "accepted".
  2. For each refusal, write the reason.
  3. Write which edits get a new version.
sample answer

The answer uses the order of the gate: validator, test, review.

Edit 1 is accepted. Edit 2 passes the validator and the test, but the review refuses it, because the person who made an edit cannot approve it. Edit 3 stops at the validator, because the owner field is empty and has no default source. Edit 4 stops at the test, because 3 records do not agree with the expected records. Only edit 1 gets a new version.

sources

  1. WARC 1.1, IIPC, standard, read 2026-11-22
  2. My model of the profile store, its gate, and the version stamp, 2026-11 (not public).
  3. Benchmark platform, code: the move of the oracle rules for each target from code into data (not public).