Summary
During Story 6.2 implementation, a discovery was made that the temp: key discard logic in _extract_and_persist_state_delta (line ~723 of src/adk_secure_sessions/services/encrypted_session.py) is unreachable dead code.
Details
_trim_temp_delta_state removes temp: prefixed keys before _extract_and_persist_state_delta is called, so the temp: key check in the latter method never triggers. This is defensive dead code in a security-sensitive service.
Why it matters
- Dead code in a security-critical path is a maintenance smell — it suggests the control flow isn't fully understood
- Could mask future bugs if the call order changes and the defensive check silently swallows keys that should be persisted
- Minor cognitive overhead for contributors reading the method
Suggested action
- Verify the call order with a test or trace to confirm the code is truly unreachable
- If confirmed unreachable, remove the dead branch
- If the defensive check is intentional (belt-and-suspenders), add a comment explaining why
Origin
Discovered during Story 6.2 (branch feat/docs-6-2-fix-schema-claims). Logged in dev completion notes but out of scope for that docs-only story.
Summary
During Story 6.2 implementation, a discovery was made that the
temp:key discard logic in_extract_and_persist_state_delta(line ~723 ofsrc/adk_secure_sessions/services/encrypted_session.py) is unreachable dead code.Details
_trim_temp_delta_stateremovestemp:prefixed keys before_extract_and_persist_state_deltais called, so thetemp:key check in the latter method never triggers. This is defensive dead code in a security-sensitive service.Why it matters
Suggested action
Origin
Discovered during Story 6.2 (branch
feat/docs-6-2-fix-schema-claims). Logged in dev completion notes but out of scope for that docs-only story.