# Senior Airflow playbook

Compressed reference for the senior-only Airflow extension. Pair with [cheat-sheet.md](./cheat-sheet.md), [GLOSSARY.md](./GLOSSARY.md), and [repo-airflow-map.md](./repo-airflow-map.md).

## The senior shift
Intermediate understanding is: "I know DAGs, scheduling, operators, executors, XCom, and the repo’s generated-DAG setup."

Senior understanding is: "I can explain what Airflow truly owns here, how scheduling semantics affect correctness, how generated DAGs behave like an API contract, why green DAGs can still hide bad data, and where architecture boundaries matter during debugging and design review."

## Six senior lenses
1. **Truthfulness beats slogans** — say what Airflow really owns here, and what Spark/Kubernetes/CDC still own.
2. **Time semantics are correctness semantics** — logical date, intervals, catchup, and backfill change what a run really means.
3. **Generated DAGs are a contract surface** — `rules.yaml`, templates, validations, and drift checks are the real authoring API.
4. **Green is not always good** — separate liveness from correctness.
5. **Architecture is about boundaries** — executor, triggerer, Spark, and Kubernetes each own different failure/debug surfaces.
6. **Senior answers name consequences** — not just mechanism, but what breaks or becomes safer in production.

## Senior review checklist
- What layer really owns this failure or change: Airflow, generator, Spark, Kubernetes, CDC, or warehouse logic?
- What data interval does this run actually own, and how does that affect correctness?
- Is a config/template change invoking the right contract surface?
- Does a “successful” run also have correctness evidence, or only liveness evidence?
- Is orchestration clarifying ownership, or hiding it behind too many layers?

## Interview answer shapes
### What does Airflow really own here?
It owns orchestration, run/task state, scheduling, control-plane wiring, and alerting — not the whole data platform.

### Why is scheduling a senior topic?
Because interval semantics affect correctness, replay behavior, and how you interpret failed or late runs.

### Why do generated DAGs matter so much?
Because the real contract surface is rules + templates + validations + drift checks, not one rendered `.py` file.

### Why is a green DAG not enough?
Because successful orchestration does not guarantee correct data; validation and idempotency protect that second half.
