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
- Name the ten fields of a target profile and the purpose of each field.
- Give each field a type, one source for its default, and a refusal rule.
- Explain why an empty field with no default source must stop the work.
- 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:
| field | what it holds | example value |
|---|---|---|
| Method | The method class: a declared feed, an HTTP client, or a browser | http-client |
| Pace | The minimum time between two requests | 10 seconds |
| Volume cap | The maximum pages in one day | 2,000 pages |
| Web session rules | The maximum pages in one web session | 40 pages |
| Extractor version | The version of the code that takes the records out of a page | 4.2.0 |
| Oracle | The success oracle that gives the verdict of each attempt | record-fields |
| Data contract | The data contract of the records | product-record 3 |
| Cost cap | The maximum cost in one day | 20 units |
| Owner | The person or team that approves each change | team-a |
| Legal status | The open legal question, or the recorded decision | decided-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
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 side | detection 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
| option | gain | cost | when it is correct |
|---|---|---|---|
| One object for each target | Each 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 files | No work now | Nobody sees all decisions, and the files drift. | Only for a test of one day |
| A default for each field | Fewer edits | An 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 fields | Each 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 value | A 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
- VersionA new version for each change, with a diff
- OwnerNo default: a person or team must approve
- MethodNo default: declared feed, HTTP client, or browser
- PaceDefault from the record of the target class
- Volume capDefault from the record of the target class
- Web session rulesDefault from the record of the target class
- Extractor versionNo default
- OracleDefault from the record of the target class
- Data contractNo default
- Cost capNo default
- Legal statusNo default: an open question or a recorded decision
The validator refuses an empty field with no default sourcefail
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.
| property | target profile of the operator | remote configuration of a site |
|---|---|---|
| Unit | One target | One protected site |
| Content | Method, pace, caps, oracle, owner | Rules, thresholds, and exceptions |
| Who edits it | The operator | The detection team |
| Version | One version for each change | One version for each release |
| A change with no test | Wrong records or more load | Blocks of real users on the site |
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.
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 -> 1The 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
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
| series | class of defect | edits |
|---|---|---|
| injected defects | empty field | 81 |
| injected defects | unknown value | 68 |
| injected defects | failed test, new extractor | 108 |
| injected defects | failed test, carried defect | 88 |
| injected defects | no review | 98 |
| injected defects | silent wrong value | 55 |
| caught by the store gate | empty field | 81 |
| caught by the store gate | unknown value | 68 |
| caught by the store gate | failed test, new extractor | 93 |
| caught by the store gate | failed test, carried defect | 0 |
| caught by the store gate | no review | 98 |
| caught by the store gate | silent wrong value | 0 |
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
| problem | cause | correction |
|---|---|---|
| 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
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.
A target profile has no value in its cost cap field. The cost cap has no default source. What does the validator do?
- It uses the cost cap of the target class.
- It accepts the target profile and writes a note.
- 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.
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.
What does a diff of two versions of a target profile show?
- Each field that changed, from its old value to its new value
- The effect of each change on the target
- 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.
Why does each field have only one source for its default?
- Because a default makes the validator faster
- Because two sources can drift apart, and two parts of the system then use two values
- 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
- For each field, write if the validator accepts the value or refuses it.
- For each refusal, write the reason.
- For each empty field, write the default source or "none".
- 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
- My model of the target profile, its ten fields, and the refusal rule, 2026-11 (not public).