{"id":"selective-defense-replaces-universal-validation","text":"Solutions employ selective defense rather than universal validation: they invest in conditions that improve efficiency (early exit, short-circuit) and defaults that encode domain knowledge (Counter zero-default, sentinel initialization), while deliberately omitting input validation — defense serves optimization, not safety.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["selective-condition-checking-not-absent","defaults-encode-domain-knowledge-at-every-layer"],"outlist":[],"label":"Conditions and defaults are both present but serve optimization not validation — the pattern is deliberate selectivity, not absence of defensive thinking"}],"dependents":["selective-defense-explained-by-judge-boundary"],"metadata":{"last_reviewed":"2026-06-07T22:02:22","review_result":"pass"},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"selective-defense-replaces-universal-validation","truth_value":"IN","reason":"SL justification valid","antecedents":["selective-condition-checking-not-absent","defaults-encode-domain-knowledge-at-every-layer"],"label":"Conditions and defaults are both present but serve optimization not validation — the pattern is deliberate selectivity, not absence of defensive thinking"},{"node":"selective-condition-checking-not-absent","truth_value":"IN","reason":"SL justification valid","antecedents":["early-exit-optimizations-pervasive","no-validation-is-deliberate-contract"],"label":"Early-exit checks + no validation checks = the code checks strategically, not defensively"},{"node":"early-exit-optimizations-pervasive","truth_value":"IN","reason":"SL justification valid","antecedents":["three-consecutive-odds-early-exit","path-crossing-early-exit","isomorphic-early-return","first-violation-sufficiency"],"label":"Early exit is the default control flow strategy, not an optimization afterthought"},{"node":"three-consecutive-odds-early-exit","truth_value":"IN","reason":"premise"},{"node":"path-crossing-early-exit","truth_value":"IN","reason":"premise"},{"node":"isomorphic-early-return","truth_value":"IN","reason":"premise"},{"node":"first-violation-sufficiency","truth_value":"IN","reason":"premise"},{"node":"no-validation-is-deliberate-contract","truth_value":"IN","reason":"SL justification valid","antecedents":["solutions-no-input-validation","no-input-validation-convention","solutions-trust-leetcode-preconditions","leetcode-solutions-no-validation-convention"],"label":"Validation omission is a consistent design decision, not accumulated technical debt"},{"node":"solutions-no-input-validation","truth_value":"IN","reason":"premise"},{"node":"no-input-validation-convention","truth_value":"IN","reason":"premise"},{"node":"solutions-trust-leetcode-preconditions","truth_value":"IN","reason":"premise"},{"node":"leetcode-solutions-no-validation-convention","truth_value":"IN","reason":"premise"},{"node":"defaults-encode-domain-knowledge-at-every-layer","truth_value":"IN","reason":"SL justification valid","antecedents":["counter-universal-frequency-primitive","sentinel-initialization-encodes-boundary-conditions"],"label":"Counter's zero-default and sentinel -1/0/None are the same design principle (meaningful defaults) applied at data-structure vs algorithm level"},{"node":"counter-universal-frequency-primitive","truth_value":"IN","reason":"SL justification valid","antecedents":["counter-dominant-frequency-tool","counter-pattern-dominates-frequency-problems","counter-missing-key-returns-zero","counter-subtraction-drops-nonpositive"],"label":"Counter's built-in semantics eliminate boilerplate that manual dicts would require"},{"node":"counter-dominant-frequency-tool","truth_value":"IN","reason":"premise"},{"node":"counter-pattern-dominates-frequency-problems","truth_value":"IN","reason":"premise"},{"node":"counter-missing-key-returns-zero","truth_value":"IN","reason":"premise"},{"node":"counter-subtraction-drops-nonpositive","truth_value":"IN","reason":"premise"},{"node":"sentinel-initialization-encodes-boundary-conditions","truth_value":"IN","reason":"SL justification valid","antecedents":["ascending-check-uses-sentinel-minus-one","k-length-apart-sentinel-minus-one","prev-zero-sentinel","getheight-sentinel-neg1"],"label":"all four use domain-specific sentinels (-1 for \"no previous index\", 0 for \"no previous group\", -1 for \"any subtree unbalanced\") that make the first loop iteration produce the correct vacuous result without an explicit guard"},{"node":"ascending-check-uses-sentinel-minus-one","truth_value":"IN","reason":"premise"},{"node":"k-length-apart-sentinel-minus-one","truth_value":"IN","reason":"premise"},{"node":"prev-zero-sentinel","truth_value":"IN","reason":"premise"},{"node":"getheight-sentinel-neg1","truth_value":"IN","reason":"premise"}]}}