Deferred from PR #1790 review.
Original reviewer comment: #1790 (comment)
Context:
outputResult in src/presentation/result-formatter.ts takes data: Record<string, any>. Because any is involved, most call sites don't strictly need a cast to call it with a typed interface — but roughly 20 call sites across the presentation layer nonetheless carry a defensive data as unknown as Record<string, unknown> cast (e.g. presentation/queries-cli/impact.ts, path.ts, inspect.ts, overview.ts, presentation/triage.ts, presentation/owners.ts, presentation/queries-cli/exports.ts).
Greptile's review of PR #1790 flagged this pattern in presentation/audit.ts — the cast there was in fact unneeded and has been removed directly in that PR (verified clean with tsc --noEmit). The broader ask is to widen outputResult's parameter type (e.g. to object or a proper generic) so the type system can verify these call sites without an escape-hatch cast, and then remove the now-redundant casts across the ~20 remaining call sites.
This touches many files outside the scope of PR #1790 (which is limited to ast-analysis/presentation/extractors/cli quality fixes), so it's tracked here as a follow-up.
Deferred from PR #1790 review.
Original reviewer comment: #1790 (comment)
Context:
outputResultinsrc/presentation/result-formatter.tstakesdata: Record<string, any>. Becauseanyis involved, most call sites don't strictly need a cast to call it with a typed interface — but roughly 20 call sites across the presentation layer nonetheless carry a defensivedata as unknown as Record<string, unknown>cast (e.g.presentation/queries-cli/impact.ts,path.ts,inspect.ts,overview.ts,presentation/triage.ts,presentation/owners.ts,presentation/queries-cli/exports.ts).Greptile's review of PR #1790 flagged this pattern in
presentation/audit.ts— the cast there was in fact unneeded and has been removed directly in that PR (verified clean withtsc --noEmit). The broader ask is to widenoutputResult's parameter type (e.g. toobjector a proper generic) so the type system can verify these call sites without an escape-hatch cast, and then remove the now-redundant casts across the ~20 remaining call sites.This touches many files outside the scope of PR #1790 (which is limited to ast-analysis/presentation/extractors/cli quality fixes), so it's tracked here as a follow-up.