skip to content

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

the target profile

This lesson joins each decision about one target into one versioned object, with a type, a default source, and a refusal rule for each field.

this page is not legal advice.

purpose

The decisions about one target are often in many places. When nobody can see all of them together, nobody can review them or go back to an earlier set. One object for each target makes each decision visible and testable.

objectives

  1. Name the ten fields of a target profile and the purpose of each field.
  2. Give each field a type, one source for its default, and a refusal rule.
  3. Explain why an empty field with no default source must stop the work.
  4. Compare two versions of a target profile field by field.

new terms

target profile
The versioned object that holds each configuration decision about one target.
silent default arm
A default branch of a switch that accepts an absent case with no error and no record.

how it works

A target profile holds each decision about the work on one target. The operator writes it, and the collector obeys it. It sets only the operator's own system. It holds no way to hide the collector and no way to look like a different client.

the ten fields

I use ten fields:

fieldwhat it holdsexample value
MethodThe method class: a declared feed, an HTTP client, or a browserhttp-client
PaceThe minimum time between two requests10 seconds
Volume capThe maximum pages in one day2,000 pages
Web session rulesThe maximum pages in one web session40 pages
Extractor versionThe version of the code that takes the records out of a page4.2.0
OracleThe success oracle that gives the verdict of each attemptrecord-fields
Data contractThe data contract of the recordsproduct-record 3
Cost capThe maximum cost in one day20 units
OwnerThe person or team that approves each changeteam-a
Legal statusThe open legal question, or the recorded decisiondecided-go

All values in this table are synthetic. The pace and the volume cap set the load of the collector on the target. They are the first fields that you read when you apply the rules of politeness.

a type, a default source, and a refusal rule

Each field has three properties:

  • A type: a set of permitted values, a number range, or a text.
  • One default source. For example, the pace can come from the record of the target class. Some fields have no default source: method, extractor version, data contract, cost cap, owner, and legal status.
  • A refusal rule. The validator refuses an unknown field, a value outside the set or the range, and an empty field with no default source.

One source for each default is important. When two files give a default for the pace, the two values can drift apart. Then two parts of the system use two different paces for one target.

why an empty field stops the work

A field with no value can go to a silent default arm. The code accepts the missing value with no error and no record. For example, an empty oracle field with no default can make each attempt a pass. The operator then measures a configuration that nobody wrote.

Thus the validator refuses the target profile, and the collector does not start work on that target. A refusal costs one edit. A silent default can cost each record of the period.

The legal status field records a question and a decision. Its values are open-question, decided-go, and decided-stop. A person with the authority to decide sets the value. The values use the legal terms of an earlier lesson. More detail is in Compliance controls in code (not yet published).

The value open-question stops the work, as an empty field does. The value decided-stop also stops it. For example, a new target with open-question waits until a person records a decision.

two versions, field by field

Each change makes a new version of the whole target profile. A diff of two versions sorts the field names and shows each field that changed. For example, a diff shows that the pace changed from 10 seconds to 1 second. The diff shows the change. It does not show the effect of the change on the target.

the two sides

automation sidedetection side
A target profile makes each decision about a target visible in one place. A field with no value goes to a silent default, and the operator measures the wrong configuration.A detection team keeps a similar object for each protected site: a remote configuration with rules, thresholds, and exceptions. A change of the pace field changes the traffic that the detection side sees.

design decisions

optiongaincostwhen it is correct
One object for each targetEach decision is in one place, with one version.You must move settings out of code and old files.For each target that the collector reads more than one time
Settings in many filesNo work nowNobody sees all decisions, and the files drift.Only for a test of one day
A default for each fieldFewer editsAn empty field gets a value that nobody chose.Only for fields that are safe at the default, for example the pace of the target class
No default for some fieldsEach such field gets a decision from a person.Each new target must have more edits.For the method, the extractor version, the data contract, the cost cap, the owner, and the legal status
Refuse an unknown valueA typing error stops before work starts.Each new value is a change of the schema.Always

diagram

The first diagram shows the target profile as one object.

one target profile: ten fields, a version, and the default source of each field

  1. VersionA new version for each change, with a diff
  2. OwnerNo default: a person or team must approve
  3. MethodNo default: declared feed, HTTP client, or browser
  4. PaceDefault from the record of the target class
  5. Volume capDefault from the record of the target class
  6. Web session rulesDefault from the record of the target class
  7. Extractor versionNo default
  8. OracleDefault from the record of the target class
  9. Data contractNo default
  10. Cost capNo default
  11. Legal statusNo default: an open question or a recorded decision

The validator refuses an empty field with no default sourcefail

Each field names its default source, or it has none and must have a value.source: My model of the target profile

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 gives a schema of the ten fields and a validator. It checks two synthetic versions of one target profile and prints a diff. The target name is a reserved example name.

m51-x01-profile.tstypescript

Validate two synthetic versions of a target profile against a schema, and print the refusals and a diff.

// Schema and validator of a target profile. All values are synthetic.
type Rule =
  | { kind: "enum"; values: string[]; defaultFrom: string | null }
  | { kind: "number"; min: number; max: number; defaultFrom: string | null }
  | { kind: "text"; defaultFrom: string | null };
type Profile = Record<string, string | number | undefined>;

// One source for each default: the record of the target class, or none.
const SCHEMA: Record<string, Rule> = {
  method: { kind: "enum", values: ["declared-feed", "http-client", "browser"], defaultFrom: null },
  paceSeconds: { kind: "number", min: 2, max: 3600, defaultFrom: "target class" },
  dailyPageCap: { kind: "number", min: 1, max: 50000, defaultFrom: "target class" },
  pagesPerWebSession: { kind: "number", min: 1, max: 200, defaultFrom: "target class" },
  extractorVersion: { kind: "text", defaultFrom: null },
  oracle: { kind: "enum", values: ["record-fields", "render-floor"], defaultFrom: "target class" },
  dataContract: { kind: "text", defaultFrom: null },
  dailyCostCap: { kind: "number", min: 0, max: 500, defaultFrom: null },
  owner: { kind: "text", defaultFrom: null },
  legalStatus: { kind: "enum", values: ["open-question", "decided-go", "decided-stop"], defaultFrom: null },
};

function validate(p: Profile): string[] {
  const refusals: string[] = [];
  for (const key of Object.keys(p)) if (!(key in SCHEMA)) refusals.push(`${key}: unknown field`);
  for (const [key, rule] of Object.entries(SCHEMA)) {
    const v = p[key];
    if (v === undefined || v === "") {
      if (rule.defaultFrom === null) refusals.push(`${key}: empty, and no default source`);
      continue;
    }
    if (rule.kind === "enum" && !rule.values.includes(String(v))) refusals.push(`${key}: unknown value ${v}`);
    if (rule.kind === "number" && (typeof v !== "number" || v < rule.min || v > rule.max))
      refusals.push(`${key}: ${v} is outside ${rule.min} to ${rule.max}`);
  }
  return refusals;
}

function diff(a: Profile, b: Profile): string[] {
  const keys = [...new Set([...Object.keys(a), ...Object.keys(b)])].sort();
  const show = (v: unknown) => (v === undefined || v === "" ? "(empty)" : String(v));
  return keys.filter((k) => a[k] !== b[k]).map((k) => `${k}: ${show(a[k])} -> ${show(b[k])}`);
}

const target = process.argv[2] ?? "shop.example";
const v1: Profile = {
  method: "http-client", paceSeconds: 10, dailyPageCap: 2000, extractorVersion: "4.2.0",
  oracle: "record-fields", dataContract: "product-record 3", dailyCostCap: 20,
  owner: "team-a", legalStatus: "decided-go",
};
const v2: Profile = { ...v1, paceSeconds: 1, extractorVersion: "", oracle: "fast", owner: undefined };

for (const [name, p] of [["version 1", v1], ["version 2", v2]] as const) {
  const r = validate(p);
  console.log(`${target} ${name}: ${r.length === 0 ? "accepted" : "refused"}`);
  for (const line of r) console.log(`  ${line}`);
}
console.log("diff of version 1 and version 2:");
for (const line of diff(v1, v2)) console.log(`  ${line}`);

output

The result of each version, each refusal, and the changed fields.

shop.example version 1: accepted
shop.example version 2: refused
  paceSeconds: 1 is outside 2 to 3600
  extractorVersion: empty, and no default source
  oracle: unknown value fast
  owner: empty, and no default source
diff of version 1 and version 2:
  extractorVersion: 4.2.0 -> (empty)
  oracle: record-fields -> fast
  owner: team-a -> (empty)
  paceSeconds: 10 -> 1

The output shows that version 1 passes, and that version 2 gets four refusals. Version 1 has no value for the web session rules, and the default of the target class applies. The arrow in the diff means "changed to".

data

profile edits with a defect that the store gate caught, by class of defect

status of this figure: measured by me

profile edits with a defect that the store gate caught, by class of defectinjected defectsempty field81unknown value68failed test, new extractor108failed test, carried defect88no review98silent wrong value55unit: editscaught by the store gateempty field81unknown value68failed test, new extractor93failed test, carried defect0no review98silent wrong value0unit: edits

source: Lab result of this course: my store gate run on 1,000 synthetic profile edits; date 2026-11-13; condition: The edit mix is synthetic, so a real team gives a different mix. Each test uses 40 recorded lab pages for each target. Teaching values for one shared lab host.

data table
profile edits with a defect that the store gate caught, by class of defect
seriesclass of defectedits
injected defectsempty field81
injected defectsunknown value68
injected defectsfailed test, new extractor108
injected defectsfailed test, carried defect88
injected defectsno review98
injected defectssilent wrong value55
caught by the store gateempty field81
caught by the store gateunknown value68
caught by the store gatefailed test, new extractor93
caught by the store gatefailed test, carried defect0
caught by the store gateno review98
caught by the store gatesilent wrong value0
1,000 synthetic edits with defects injected at stated rates. The store gate caught all defects of three classes. It missed the carried extractor defects and the silent wrong values. It refused no edit with no injected defect.

The chart comes from a store gate in my lab. The gate has the validator, a test against recorded lab pages, and a check for a review.

The validator catches the defects that the schema can see: an empty field and an unknown value. It cannot see a wrong value that is inside the permitted set.

The test catches a defect only when a recorded page shows it. More detail on the gate is in The profile store.

failure modes

problemcausecorrection
Each attempt on a target is a pass, but the records are empty.The oracle field was empty, and a silent default accepted it.Give the oracle field a default source, or refuse an empty value.
Two parts of the system use two paces for one target.Two files give a default for the pace.Keep one default source for each field.
The collector starts work on a target with an open legal question.The legal status field is not a stop condition.Stop the work for open-question and for decided-stop.
A typing error in a method value sends the work to an unknown path.The validator does not refuse an unknown value.Give each field a set of permitted values.
Nobody can say what changed before the cost went up.The change had no version and no diff.Make a new version for each change, and keep the diff.

check questions

  1. Name the ten fields of a target profile, and write the purpose of the pace and the volume cap.

    sample answer

    The fields are the method, the pace, the volume cap, and the web session rules. The other fields are the extractor version, the oracle, the data contract, the cost cap, the owner, and the legal status. The pace is the minimum time between two requests, and the volume cap is the maximum pages in one day. Together they set the load of the collector on the target.

  2. A target profile has no value in its cost cap field. The cost cap has no default source. What does the validator do?

    1. It uses the cost cap of the target class.
    2. It accepts the target profile and writes a note.
    3. It refuses the profile, because the field is empty and has no default source.
    answer

    c. It refuses the profile, because the field is empty and has no default source.

    The validator refuses an empty field with no default source. Only a field with a default source, for example the pace, can be empty.

  3. Explain why an empty field with no default source must stop the work on a target.

    sample answer

    Such a field can go to a silent default arm, which accepts the absent value with no error and no record. For example, an empty oracle field with no default can make each attempt a pass. The operator measures a configuration that nobody wrote. A refusal costs one edit, and a silent default can cost each record of the period.

  4. What does a diff of two versions of a target profile show?

    1. Each field that changed, from its old value to its new value
    2. The effect of each change on the target
    3. The verdict of each attempt with the new version
    answer

    a. Each field that changed, from its old value to its new value

    A diff shows the change. It does not show the effect of the change on the target.

  5. Why does each field have only one source for its default?

    1. Because a default makes the validator faster
    2. Because two sources can drift apart, and two parts of the system then use two values
    3. Because each field must have a default
    answer

    b. Because two sources can drift apart, and two parts of the system then use two values

    When two files give a default for one field, the values can drift apart. One source keeps one value for each target.

exercise

exercise Do this task on paper. Use the schema of the code example and these synthetic values of a target profile. In the code, the volume cap is dailyPageCap, the web session rules are pagesPerWebSession, and the cost cap is dailyCostCap. All values are synthetic.

  • Method: browser
  • Pace: 5 seconds
  • Volume cap: 80,000 pages
  • Web session rules: no value
  • Extractor version: 2.0.1
  • Oracle: record-fields
  • Data contract: listing-record 1
  • Cost cap: no value
  • Owner: team-b
  • Legal status: open-question
  1. For each field, write if the validator accepts the value or refuses it.
  2. For each refusal, write the reason.
  3. For each empty field, write the default source or "none".
  4. Write if the collector can start work on the target.
sample answer

The answer uses the schema of the code example.

The validator refuses the volume cap, because 80,000 is outside the range 1 to 50,000. It refuses the cost cap, because the field is empty and has no default source. The web session rules are empty, but the default comes from the target class, thus the field passes.

The other values are in their sets or ranges. The legal status open-question is a permitted value, but it stops the work. Thus the collector cannot start work on the target.

sources

  1. My model of the target profile, its ten fields, and the refusal rule, 2026-11 (not public).