You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[deep-report] Consolidate pkg/parser map[string]any assertions to use pkg/typeutil Lookup helpers #65855
pkg/parser hand-writes the value.(map[string]any) type assertion 87 times across 14 non-test files (161 including tests), even though pkg/typeutil/lookup.go already provides LookupMap, LookupString, and LookupStringPath helpers with consistent, centralized error handling. Only pkg/parser/frontmatter_hash.go currently uses the shared helpers — every other call site duplicates the same ok-check-and-error-message boilerplate independently, so a future fix to one assertion's error message or nil-handling won't propagate to the other 86.
(adjusting call sites that assert on an already-extracted any value to instead look up from the parent map, or adding a typeutil.AsMap(value any) (map[string]any, bool) variant for that shape if needed).
Expected Impact
Removes ~87 duplicated assertion/error-handling blocks in the parser package, so future changes to map-lookup error messages or nil-safety only need to happen once in pkg/typeutil. Reduces review surface for pkg/parser changes and makes the existing typeutil helpers the single source of truth they were presumably designed to be.
Suggested Agent
New Agent (mechanical, file-by-file refactor with go build/go test ./pkg/parser/... verification after each file)
Estimated Effort
Medium (1-4 hours) — mechanical but touches 14 files; some call sites assert on an already-unwrapped any rather than a parent map key, so a small typeutil.AsMap helper may be needed for full coverage.
Data Source
DeepReport Intelligence Briefing analysis, 2026-10-05 (cycle 3), sourced from Typist: Go Type Consistency Analysis discussion (#65837).
Generated by 🔬 Deep Report · claude · agent · 282.7 AIC · ⌖ 7.05 AIC · ⊞ 7.1K · ◷
Activity
github-actions commentedon Oct 7, 2026
This issue was automatically closed because it expired on 2026-10-07T12:51:47.898Z.