Parent umbrella issue: #495
Source audit: Weekly tech debt audit: dispatch - 2026-07-01
Source audit date: 2026-07-01
Original recommendation
Schema validation accepts optional string fields with null values, but downstream code may not
Evidence: src/lib/groomer/schema.ts lines 230-241 — proposedTitle and proposedBody accept null as equivalent to "not provided". However, the downstream run.ts calls computeTitleBodyMutations() which explicitly checks undefined, not null:
const proposedTitle = typeof output.proposedTitle === "string" ? output.proposedTitle : undefined;
Because null is treated as "not a string", proposedTitle will correctly become undefined. But the proposedBody check in computeTitleBodyMutations has the same pattern, making null handling correct despite the type confusion. This is low risk but indicates schema-outbound type drift that could bite future refactoring.
Matched top finding
Evidence: src/lib/groomer/schema.ts lines 230-241 — proposedTitle and proposedBody accept null as equivalent to "not provided". However, the downstream run.ts calls computeTitleBodyMutations() which explicitly checks undefined, not null:
const proposedTitle = typeof output.proposedTitle === "string" ? output.proposedTitle : undefined;
Because null is treated as "not a string", proposedTitle will correctly become undefined. But the proposedBody check in computeTitleBodyMutations has the same pattern, making null handling correct despite the type confusion. This is low risk but indicates schema-outbound type drift that could bite future refactoring.
Parent umbrella issue: #495
Source audit: Weekly tech debt audit: dispatch - 2026-07-01
Source audit date: 2026-07-01
Original recommendation
Schema validation accepts optional string fields with null values, but downstream code may not
Evidence:
src/lib/groomer/schema.tslines 230-241 —proposedTitleandproposedBodyacceptnullas equivalent to "not provided". However, the downstreamrun.tscallscomputeTitleBodyMutations()which explicitly checksundefined, notnull:Because
nullis treated as "not a string",proposedTitlewill correctly becomeundefined. But theproposedBodycheck incomputeTitleBodyMutationshas the same pattern, making null handling correct despite the type confusion. This is low risk but indicates schema-outbound type drift that could bite future refactoring.Matched top finding
Evidence:
src/lib/groomer/schema.tslines 230-241 —proposedTitleandproposedBodyacceptnullas equivalent to "not provided". However, the downstreamrun.tscallscomputeTitleBodyMutations()which explicitly checksundefined, notnull:Because
nullis treated as "not a string",proposedTitlewill correctly becomeundefined. But theproposedBodycheck incomputeTitleBodyMutationshas the same pattern, making null handling correct despite the type confusion. This is low risk but indicates schema-outbound type drift that could bite future refactoring.