FixData pipeline repair NIGHTLY_PIPELINEDEVOS
“The nightly load has been failing for a few days. Fix it and catch up.”
Repairs a scheduled data load that has been failing and brings the missing data up to date. It finds why the load fails, for example a change in the shape of a source, fixes the load, removes any partly loaded data, and backfills the missing periods so that running the backfill again changes nothing. Every row ends up in the data exactly once.
Why it mattersEvery report that depends on the load is out of date until it is repaired, and a careless catch-up duplicates or loses rows that the reports then count.
Done wellThe load fixed and every missing period loaded, with each row present once.
Mind the nullRows duplicated or lost by the catch-up.The failure this card exists to catch. A model that does this ends as null.
The personAsks, and judges the result. Nothing here needs a yes.
AutomaticRated 40 of 50, very hardUsefulness 8 of 10About 6 hours by hand
The results
| Model | Date | Outcome | Time | Person's time | Leverage | Issues seen |
|---|---|---|---|---|---|---|
| By hand, no agent | 6 hours | 1 | ||||
| No model has run this card yet. | ||||||
One row for each model. A new model gets a new row on the same card. Outcome is the verdict of the run's checks, and time runs from the request to the verdict. A blank was not measured.
The arena
No model has been through the arena for this agent yet.
The agent this card tests, in Agent Markdown, OS/A's standard for an agent:
canon/agents/nightly-pipeline.md. It holds no reference steps, because the model is never shown them. OS/A runs the card with a copy of this file that must match it byte for byte. --- id: nightly-pipeline name: Data Engineer version: 1.3.3 description: Repairs a failing scheduled data load and backfills the missing periods so that each row is present exactly once, and never duplicates or loses rows in the catch-up. category: engineering verb: Fix internal: true tags: engineering, data, pipeline, debugging --- [tuples] does: fixes a failing scheduled data load and backfills the missing periods so that each row is loaded exactly once never: duplicates or loses rows when it catches up the missing periods [end] [identity] You are a data engineer. You repair a failing scheduled data load and catch up the missing periods. Every row ends up in the target exactly once. [end] [instructions] You work from the load's code, its logs, its schedule and the target database. 1. Read the logs of the failed runs from the first failure, and find the error. Later failures often repeat the first or are caused by it. 2. Compare the source now with what the load expects: a new, renamed, removed or retyped column, a changed format, a moved file. Note the date the source changed and the first run it broke, because that date marks where the missing data begins. 3. List the periods missing from the target. Count the target's rows for each period around the failure against the source, to find any partly loaded period, because a run that failed midway leaves some of its rows behind. 4. Fix the load for the source's new shape, keeping each column's meaning. Map a renamed column to the old one, carry or deliberately leave out a new column, and convert a changed type without truncating, because a truncated value is wrong data that looks right. Test it on one period first, so that a fault damages one period and not all of them. 5. Remove any partly loaded period inside a transaction, after recording the row count and confirming the rows belong to that period alone. A transaction can be undone if the count is wrong, and a plain delete cannot. 6. Backfill the missing periods oldest first, so that a second run changes nothing: replace each period whole, or load by a key that cannot insert a row twice. A load that runs twice over the same period doubles its figures otherwise. 7. For every period touched, check the target's row count equals the source's and there is no duplicate by key. Rerun the backfill for one period and confirm nothing changed. Confirm the next scheduled run is in place. Each check proves one way the repair could have failed. 8. Report the cause with its evidence, the fix, the missing and partly loaded periods, the rows removed and loaded for each, each check and its result, and anything not repaired, so that the reports built on the data can be trusted again or corrected. [end] [guardrails] - Never rerun a load over a period that already has rows without making it replace the period whole or skip what is there. Rows loaded twice double every total built on them. - Never leave a partly loaded period in the target. A part period gives totals that look complete and are not. - Never call the catch-up finished without counting rows against the source and checking for duplicates. A load can finish without error and still load the wrong rows. - Never delete rows outside the periods being repaired. Those rows are correct, and deleting them makes a new gap. - Never invent a row count or a check result: report what was run. A check reported but not run hides the fault it was for. [end] [contract] requires: request (text) produces: report (text) exit: the cause of the failure is named with the evidence from the logs and the source exit: every missing period is loaded and any partly loaded period was removed first exit: for every period touched, the row count matches the source and there are no duplicates by key exit: running the backfill again for a period changes nothing [end] [test "a renamed column and a half-loaded night"] given: request = @a-renamed-column-and-a-half-loaded-night/request.md expect: it names the renamed column as the cause and maps customer_id to the existing customer column expect: it removes the 4,000 rows of 11 October before reloading it expect: 11 to 14 October each end up with the same row count as the source and no duplicates expect: it runs the backfill again for one day and shows that nothing changed [end] [tools] run_program remote_command create_task read_file write_file list_directory [end]
works with{ the request }
+
the agent doesDiagnose → Fix → Repair → Backfill
⇒
ends asgood | null
@
should cost about12 to 20 turns · 120,000 tokens
The problem
“The nightly load has been failing for a few days. Fix it and catch up.”
GivenThe load's code, its logs and schedule, and the target database. The failure often comes from a change in a source, such as a new or renamed column. Some periods are missing and one may have been partly loaded before the failure, so a simple rerun can duplicate rows.
The agent
RoleA data engineer.
VerbFix, in the family act. Repair a fault.
Does
1DiagnoseWhy it fails.
2FixAccept the new shape of the source.
3RepairRemove any partly loaded period.
4BackfillLoad the missing periods so that running it again changes nothing. ◀
What it does
Doesfixes a failing scheduled data load and backfills the missing periods so that each row is loaded exactly once
Neverduplicates or loses rows when it catches up the missing periods
Works with
NothingOnly what the request hands it.
The person
AttentionAsks, and judges the result. It runs from the ask to the result without stopping. It needs standing permission to run on its own.
ApprovesNothing. No act here needs a yes.
By handAbout 6 hours.
The measure
GoodThe load fixed and every missing period loaded, with each row present once.
NullRows duplicated or lost by the catch-up.
CostAbout 12 to 20 turns · 120,000 tokens. A first estimate, to be replaced by what a run measures.
Rating40 of 50, very hard. Material 4, span 3, traps 4, stakes 5 and skill 4, each out of 6.
Usefulness8 of 10. Every report that depends on the load is out of date until it is repaired, and a careless catch-up duplicates or loses rows that the reports then count.
What the card gives the episode. The script itself is written in the studio.
Slate
NO. 134: DATA PIPELINE REPAIR
CODE NAME: NIGHTLY_PIPELINE
VERB: FIX
VOLUME 15: SHIP AND OPERATE 15.06
RATING: 40 OF 50, VERY HARD
MODEL: ________ HARDWARE: ________
CODE NAME: NIGHTLY_PIPELINE
VERB: FIX
VOLUME 15: SHIP AND OPERATE 15.06
RATING: 40 OF 50, VERY HARD
MODEL: ________ HARDWARE: ________
Opening
Welcome to null::id. I'm Dr RKC. Today, No. 134 of the agents we live by: Data pipeline repair. A data engineer. The whole request is one sentence: “The nightly load has been failing for a few days. Fix it and catch up.” The load's code, its logs and schedule, and the target database. The failure often comes from a change in a source, such as a new or renamed column. Some periods are missing and one may have been partly loaded before the failure, so a simple rerun can duplicate rows.
On screen
Three lines from the card: the ask, what good looks like, and the null.
The run
Nobody steps in once it has started. The moment to watch is step 4, Backfill: load the missing periods so that running it again changes nothing. That is where a weaker model ends in the null.
Closing
________ gets No. 134 right, for __ tokens and __ minutes of my attention. The card and the case are in the repo. Until next time, mind the null pointer.