Calendar Day
Wednesday, July 2, 2026 (PR 1 of 2)
Planned Effort
5 story points (Medium–High) — sprint item #9
Companion PR: Wednesday PR 2 (YAML escape fix #6) — independent; can land in either order.
Problem
SessionMetadataDict declares every field as NotRequired, which means mypy provides no shape enforcement at all — any key can be absent and type-checking passes. This defeats the purpose of using TypedDict. The session metadata has known required fields (session ID, creation timestamp, model info) that should be enforced, while truly optional fields (custom title, tags, etc.) can remain NotRequired.
Goal
One merged PR that splits SessionMetadataDict into required and NotRequired fields based on actual session data contracts, fixes all construction sites flagged by mypy strict, and documents which fields are required and why.
Scope
Touch points
SessionMetadataDict definition — promote core identity fields (session ID, timestamps, model info) to required
- Optional: split into
SessionMetadataRequired (base) + SessionMetadataFull (extends with optional fields) if the split is complex
- All construction sites — supply required fields; minimal test updates if needed
- Brief docstring on the TypedDict explaining required vs optional fields
Out of scope
MessageDict shape splitting (T9 — horizon)
ExportStateDict casing alignment (T3 — horizon)
file_activity hardcoded strings (deferred)
Acceptance Criteria
Verification
cd C:\Users\Jasen\CppAliance\claude-code-chat-browser
.\.venv\Scripts\Activate.ps1
mypy .
pytest -q
Manual: remove a required field at a construction site — confirm mypy error, then fix.
Calendar Day
Wednesday, July 2, 2026 (PR 1 of 2)
Planned Effort
5 story points (Medium–High) — sprint item #9
Companion PR: Wednesday PR 2 (YAML escape fix #6) — independent; can land in either order.
Problem
SessionMetadataDictdeclares every field asNotRequired, which means mypy provides no shape enforcement at all — any key can be absent and type-checking passes. This defeats the purpose of using TypedDict. The session metadata has known required fields (session ID, creation timestamp, model info) that should be enforced, while truly optional fields (custom title, tags, etc.) can remainNotRequired.Goal
One merged PR that splits
SessionMetadataDictinto required andNotRequiredfields based on actual session data contracts, fixes all construction sites flagged by mypy strict, and documents which fields are required and why.Scope
Touch points
SessionMetadataDictdefinition — promote core identity fields (session ID, timestamps, model info) to requiredSessionMetadataRequired(base) +SessionMetadataFull(extends with optional fields) if the split is complexOut of scope
MessageDictshape splitting (T9 — horizon)ExportStateDictcasing alignment (T3 — horizon)file_activityhardcoded strings (deferred)Acceptance Criteria
SessionMetadataDictfields split into required andNotRequiredbased on actual contractsmypy --strictcatches missing required fields at all construction sitespytest,mypy --strict, andruffpassVerification
Manual: remove a required field at a construction site — confirm mypy error, then fix.