# 04: Dependency-wiring checks up front

**What to build:** Before writing anything, the Autofill module validates how each preset set wires its Dependent Answers. A wiring mistake becomes a clear configuration error, so it can't show up as scattered gaps in the Survey.

A run returns a configuration error, with nothing written, when either of these is true:

- A Dependent Answer depends on a key that doesn't exist in its preset set.
- A Dependent Answer depends on a key that comes at or after it in execution order. This also catches fractional question keys, which `Object.entries` places after all integer keys.

Parent spec: `.scratch/autofill-module/spec.md`

**Blocked by:** 03 (Dependent Answers in Autofill)

**Status:** resolved

- [x] Tested: a missing dependency key returns a configuration error naming the Dependent Answer and the missing key. No writes happen.
- [x] Tested: a dependency at or after its dependent returns a configuration error. No writes happen.
- [x] Tested: a fractional key placed between integer keys (e.g. 7, 7.5, 8, where 8 depends on 7.5) is caught.
- [x] Every existing preset set passes the checks.
- [x] Typecheck and the full test suite pass.

## Comments

Resolved on `feat/autofill-module` in 930acc8 (review fixes in 3878798).
