# FormField lifecycle contract

- **Outcome:** The canonical `FormField` factory keeps its positional API and existing DOM while providing idempotent `mount()`, focused in-place `update(next)`, and idempotent `destroy()` with safe remounting.
- **Status:** IDLE
- **Task ID:** D5-FORMFIELD-01
- **Source request:** Delivery 5 FormField lifecycle slice from current `origin/master`; work directly without delegation, external models, or skills. Preserve all public behavior and DOM identity. Add the lifecycle contract only where appropriate, test compatibility, identity through update, repeated lifecycle calls, cleanup, and remount. Update truthful inventory, report, and plan records; run focused tests, full admin suite, lint, production build, inventory/gate, and factory gate with dependencies installed. Commit locally; do not land.
- **Acceptance criteria:** FormField's positional API, rendered classes, label, input, tooltip behavior, state mutation, and callback behavior remain compatible. `update(next)` preserves root/input identity and updates supported form state in place. Repeated lifecycle calls are safe. Destroy removes DOM event handlers and hides any active FormField tooltip. Remount restores original node and handlers. The generated inventory records FormField's three lifecycle methods and increases the lifecycle-capable total. All requested gates pass cleanly.
- **Preserved WIP/ref/path:** Clean isolated worktree branch `formfield-lifecycle-slice` from `origin/master` at `5a8c7783e58d5b6fd668d23d019ce5f41808b859`; no pre-existing local changes.
- **Constraints:** Change only canonical `admin/src/components/FormField.js`, its focused lifecycle test, generated inventory records, and plan registry. Do not change `Input.js`, page behavior, unrelated components, generated build assets, or public DOM/API identity. Do not land.
- **Execution steps:** Study landed Input, Textarea, Select, Badge, ProgressBar, and Modal sources/tests. Implement the smallest FormField lifecycle seam and focused tests. Regenerate inventory. Run all requested quality gates with dependencies installed. Commit the local slice and record exact results.
- **Current receipt:** `npm ci` and `composer install --no-interaction --prefer-dist` completed. Focused FormField lifecycle tests pass (1 file, 4 tests). Full admin suite passes (46 files, 650 tests). JavaScript lint and production build pass. Inventory regeneration and UI gate pass: 123 modules, 54 components, 16 pages, zero unclassified modules, zero direction violations, 41 lifecycle-capable modules, and two baseline duplicate IDs. Full factory gate passes with zero warnings, errors, failures, blocks, reports, or coverage gaps. Changes are committed locally only; no landing was performed.
- **Next executable action:** None within this local-only slice; retain the commit for review or later landing.
