the life cycle of a target and the long tail · lesson 9 of 9 · sources checked 2026-11-22
change and retirement
This lesson decides when a target changes its method or retires, and writes a retirement record with an exit condition that a check can read.
this page is not legal advice.
purpose
A target that nobody retires keeps its cost and its risk. Its jobs and its checks send requests, and its stored data stays with no reason. A retirement record ends this work in a fixed order and keeps the reason for a later review.
objectives
- List the reasons that start a retirement.
- Do a deeper look at the other options before a retirement.
- Write the retirement steps in their order.
- Give each retention class of a retired target its data action.
- Write an exit condition as data that a scheduled check can read.
new terms
- retirement record
- The record of the stop of a target, with the reason, the notice, the data actions, and the exit condition.
- retention class
- A group of data with one retention period, one store, and one deletion method.
- legal hold
- A flag that stops each deletion of the held data until a person lifts it.
- exit condition
- The event that makes the operator examine a stopped or excluded target again.
how it works
A target can change in two ways. The site can change, or the agreement for the target can change. After a change, the operator has two outputs: a change of the method, or a retirement.
retirement reasons from practice
status of this section: from my practiceI retire a target for three reasons:
- the agreement for the target ends;
- a stop is communicated, for example a message that says to stop;
- the target is gone, for example a page that answers "gone" or a name that no longer resolves.
Before a retirement, I take a deeper look at what can still be done inside the rules.
other reasons
Other changes can also start a retirement, for example these:
- a legal change for the data or for the site;
- a cost above the limit of the agreement;
- a loss of the permission for the target;
- a move of the data to an app or behind a login wall.
A move to a login wall can be a decision of the site. The operator then retires the target or uses a declared path that the site offers. The operator never goes around the wall.
the deeper look
The deeper look asks one question: can a change inside the rules serve the target? It comes before a retirement, because a slower pace, a volume cap, or the declared path can keep the target.
For example, a site can offer a feed after it adds a login wall. The method then changes to the feed, and the target stays in operation.
A change of the method is never a new attempt through a different exit, and never a change of the client to pass a check. When no change inside the rules can serve the target, it retires.
the retirement steps
Do the steps in this order:
- Notify the customer, with the reason and the date of the stop.
- Stop the jobs of the target.
- Stop the canary of the target.
- Apply the data action of each retention class.
- Write the exit condition as data.
- Close the retirement record.
For example, the notice comes first, because the customer can then plan for the stop. The canary stops with the jobs. A canary that runs after the stop sends requests for a target that has no use.
data actions
Each retention class has one data action. For example, the raw pages are deleted at the stop. The delivered records are kept until a date of the agreement. A legal hold stops each deletion of the held data, also when its class says "delete".
The record lists each data set, its class, and its action. An attorney of the reader examines the data actions, because they depend on the law and the agreement. More detail on the legal questions is in Compliance by design and Compliance controls in code (not yet published).
the exit condition
An exit condition says when to examine the target again. Write it as data, not as prose: a field and a value. For example, the field agreement with the value renewed.
A good exit condition names a fact that a check can see. For example, the field feed with the value available fits a target that moved behind a login wall. The words "when the site changes again" are not a fact that a check can read.
A scheduled check reads the field each week. Prose in a record is read by nobody after the stop. A field is read by the check each time.
the two sides
| automation side | detection side |
|---|---|
| A retirement record stops the cost and the legal risk of a target that the product cannot serve inside its rules. The exit condition says when to examine the target again. | A move to an app or a login wall can be a decision of the site against collection. The retirement record is the correct answer of the operator to that decision. |
design decisions
| option | gain | cost | when it is correct |
|---|---|---|---|
| Keep the target with no change | No work now | The jobs give no data and keep their cost. | Never after a retirement reason |
| Change the method inside the rules | The target stays in operation. | Work to build the new method | When the deeper look finds a declared path or a feed |
| Retire with a record | Cost and risk stop, and the reason stays. | The customer loses the data of the target. | When no change inside the rules serves the target |
| An exit condition as prose | Fast to write | Nobody reads it after the stop. | Never |
| An exit condition as data | A scheduled check reads it. | A field and a check to keep | Each retirement |
diagram
retirement: from a retirement reason to a record with an exit condition
code example
The example retires one synthetic lab target. It records the notice first, then stops the schedule and the canary, and gives each data set its data action. A legal hold changes one action to "hold". Then a check reads the exit condition with two synthetic facts.
Record the notice, stop the schedule and the canary of a target, and apply the data action of each retention class. Then write a record with the exit condition as data.
// Retirement job with synthetic data: record the notice, stop the schedule and the canary,
// apply the data action of each retention class, and write the exit condition as data.
type Action = "delete" | "keep-until" | "hold";
type DataSet = { name: string; retentionClass: string; legalHold: boolean };
type Target = { id: string; schedule: "on" | "off"; canary: "on" | "off"; data: DataSet[] };
type ExitCondition = { field: string; equals: string };
// Each retention class has one data action. A legal hold stops each deletion.
const CLASS_ACTION: Record<string, { action: Action; until?: string }> = {
"raw-pages": { action: "delete" },
"delivered-records": { action: "keep-until", until: "2027-06-30" },
};
function retire(t: Target, reason: string, stopDate: string, exit: ExitCondition) {
const steps = [`notice to the customer: ${reason}, stop on ${stopDate}`]; // the notice comes first
t.schedule = "off";
t.canary = "off";
steps.push("schedule stopped", "canary stopped");
const dataActions = t.data.map((d) => {
const rule = CLASS_ACTION[d.retentionClass];
if (!rule) throw new Error(`${d.name}: no data action for class ${d.retentionClass}`);
const act = d.legalHold ? { action: "hold" as Action } : rule;
return { data: d.name, class: d.retentionClass, ...act };
});
steps.push("data actions applied", "exit condition written");
return { target: t.id, reason, steps, schedule: t.schedule, canary: t.canary, dataActions,
exitCondition: exit };
}
// A scheduled check reads the exit condition as data, not as prose.
function examineAgain(rec: { exitCondition: ExitCondition }, facts: Record<string, string>) {
return facts[rec.exitCondition.field] === rec.exitCondition.equals;
}
const target: Target = {
id: "lab-target-07", schedule: "on", canary: "on",
data: [
{ name: "page-store", retentionClass: "raw-pages", legalHold: false },
{ name: "record-exports", retentionClass: "delivered-records", legalHold: false },
{ name: "held-pages", retentionClass: "raw-pages", legalHold: true },
],
};
const record = retire(target, "agreement ended", "2027-01-15", { field: "agreement", equals: "renewed" });
console.log(JSON.stringify(record, null, 2));
console.log("examine again (agreement ended):", examineAgain(record, { agreement: "ended" }));
console.log("examine again (agreement renewed):", examineAgain(record, { agreement: "renewed" }));output
The retirement record as JSON, and then the result of the check for two synthetic facts.
{
"target": "lab-target-07",
"reason": "agreement ended",
"steps": [
"notice to the customer: agreement ended, stop on 2027-01-15",
"schedule stopped",
"canary stopped",
"data actions applied",
"exit condition written"
],
"schedule": "off",
"canary": "off",
"dataActions": [
{
"data": "page-store",
"class": "raw-pages",
"action": "delete"
},
{
"data": "record-exports",
"class": "delivered-records",
"action": "keep-until",
"until": "2027-06-30"
},
{
"data": "held-pages",
"class": "raw-pages",
"action": "hold"
}
],
"exitCondition": {
"field": "agreement",
"equals": "renewed"
}
}
examine again (agreement ended): false
examine again (agreement renewed): trueThe output shows the notice as the first step. The held pages keep the action "hold", although their class says "delete". The check gives "true" only for the fact that meets the exit condition.
failure modes
| problem | cause | correction |
|---|---|---|
| A retired target still sends requests to the site. | The jobs stopped, but the canary did not. | Stop the canary in the same step as the jobs. |
| Held data is deleted at a retirement. | The data action of the class ran with no check of the legal hold. | Let a legal hold stop each deletion of the held data. |
| Nobody examines a retired target again after the agreement is renewed. | The exit condition is prose that no check reads. | Write the exit condition as a field and a value, and read it with a scheduled check. |
| The customer learns about the stop from missing data. | The notice came after the stop, or never. | Notify the customer first, with the reason and the date. |
| A target retires when a feed could serve it. | Nobody did the deeper look. | Do the deeper look before each retirement. |
| The exit condition never becomes true. | The condition names a state that no check can see. | Name a field that a check can read, for example the state of the agreement. |
| Stored data of a retired target stays with no reason. | The record has no data action for a retention class. | Give each data set its class and its action in the record. |
check questions
List the three retirement reasons from practice, and two other reasons.
sample answer
From practice: the agreement for the target ends, a stop is communicated, or the target is gone. Other reasons are a legal change, a cost above the limit of the agreement, and a loss of permission. A move to an app or behind a login wall is a fourth.
A site adds a login wall, and it also offers a feed for the same data. What is the result of the deeper look?
- Retire the target at once.
- Change the method to the feed, and keep the target in operation.
- Send the attempts through a different exit.
answer
b. Change the method to the feed, and keep the target in operation.
The deeper look asks if a change inside the rules can serve the target. A feed that the site offers is such a change. A new exit is never a change of the method.
Which step comes first in a retirement?
- Stop the canary.
- Apply the data actions.
- Notify the customer.
answer
c. Notify the customer.
The notice comes first, with the reason and the date, so that the customer can plan for the stop.
The class of a data set says "delete at the stop", and the data set has a legal hold. What is its data action?
- Hold the data, because the legal hold stops each deletion.
- Delete the data, because the class says so.
- Move the data to a different class.
answer
a. Hold the data, because the legal hold stops each deletion.
A legal hold stops each deletion of the held data, also when its class says "delete".
Write an exit condition for a target whose agreement ended, and say why you write it as data.
sample answer
The field agreement with the value renewed. A scheduled check reads a field each time, but nobody reads prose in a record after the stop.
exercise
exercise Do this task on paper. Use the retirement steps and the data actions of "How it works". The target is synthetic, and its agreement ended. The deeper look found no change inside the rules.
| data set | retention class | legal hold |
|---|---|---|
| page-store | raw pages: delete at the stop | no |
| record-exports | delivered records: keep until the date of the agreement | no |
| held-pages | raw pages: delete at the stop | yes |
- Write the retirement steps in their order.
- Write the data action of each data set.
- Write one exit condition as a field and a value.
sample answer
The answer uses the synthetic target of the task.
The steps are: notify the customer, stop the jobs, stop the canary, apply the data actions, write the exit condition, and close the record.
The page-store data is deleted. The record-exports data is kept until the date of the agreement. The held-pages data is held, because the legal hold stops its deletion.
One correct exit condition is the field agreement with the value renewed.
sources
- My model of the retirement steps, the data actions, and the exit condition as data, 2026-11 (not public).