declare_metric and update_metric duplicated the resolve-params + backfill_metric + insert-MetricDeclaration sequence; extracted into resolve_backfill_and_store_metric so the declare-vs-rename difference is expressed only in caller-side logic. Also extracted auto_declare_params's per-candidate insertion body into try_insert_auto_param so the candidate-building and insertion steps read as separate concerns. Reimplemented directly against current main (ticket 085) after the original worktree agent's branch was based on a stale pre-consolidation snapshot module layout that no longer matches main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TeyhRfMYjMditek6geDRoQ