Skip to content

fix(domain): keep the duplicate-member scan switch over a string - #10685

Closed
Davmunrey wants to merge 1 commit into
morluto:mainfrom
Davmunrey:fix/json-dup-switch
Closed

Davmunrey wants to merge 1 commit into
morluto:mainfrom
Davmunrey:fix/json-dup-switch

Conversation

@Davmunrey

Copy link
Copy Markdown
Contributor

Summary

npm run check:ci:deep fails on main (f3b697d) in typed lint:

src/domain/jsonDuplicateMember.ts:44:13: typescript(switch-exhaustiveness-check): Switch is not exhaustive. Cases not matched: undefined

findDuplicateJsonMember, added in #10552, switches on text[index]. Under noUncheckedIndexedAccess that value is string | undefined. The loop bound keeps index inside the text, so text.charAt(index) yields the same character as a plain string, and the switch no longer has an unmatched undefined case. Behavior is unchanged.

The Deep static lane runs only for full PR qualification, so this error reached main and would fail that lane for any labeled PR.

Evidence and regression coverage

  • On main, oxlint --type-aware src/domain/jsonDuplicateMember.ts reports the error above. After the change it reports none (exit 0).
  • The full npm run check:ci:deep run on main was clean except for this error: Typed lint reported 7374 files, 1 errors, and knip, metadata, jscpd, TODO scan, architecture guards, test discovery and the Python tests passed.
  • src/domain/jsonDuplicateMember.test.ts and the ASAR header tests that consume the scan pass: 25 passed.

Validation performed

  • oxlint --type-aware src/domain/jsonDuplicateMember.ts: no errors.
  • npm run test:local -- src/artifacts/AsarHeader*.test.ts src/domain/jsonDuplicateMember.test.ts: 25 passed.
  • npm run check:fast passed.

Author readiness

Human owner: @Davmunrey

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

`npm run check:ci:deep` fails on main in typed lint:

  src/domain/jsonDuplicateMember.ts:44:13: typescript(switch-exhaustiveness-check):
  Switch is not exhaustive. Cases not matched: undefined

findDuplicateJsonMember switches on `text[index]`, which is
`string | undefined` under noUncheckedIndexedAccess. The loop bound keeps
index inside the text, so `text.charAt(index)` yields the same character
as a plain string and the switch no longer has an unmatched undefined
case. Behavior is unchanged.

The Deep static lane runs only for full PR qualification, so this error
from morluto#10552 reached main and would fail that lane for any labeled PR.

Validation: `oxlint --type-aware src/domain/jsonDuplicateMember.ts`
reports the error on main and passes after; jsonDuplicateMember and
ASAR header tests pass; check:fast passes.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T23:24:53.782478Z
We couldn’t complete this review. Comment @codex review to try again.
791e313 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This focused change appears safe to merge.

Summary

Replaces text[index] with text.charAt(index) so the switch receives a plain string.

  • The duplicate-member scan feeds its switch a string.

Reviews (2) · Last reviewed commit: "fix(domain): keep the duplicate-member s..." · Reviewed by Greptile

@Davmunrey

Copy link
Copy Markdown
Contributor Author

Ready to merge: full CI is green on this head, Greptile's latest review is 5/5 with no open threads, and it merges into main 42cab26 without conflicts.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Thanks. Closing as already resolved: on current main the switch in findDuplicateJsonMember (src/domain/jsonDuplicateMember.ts) has a default: branch, which covers the undefined case that switch-exhaustiveness-check reported. The charAt change is no longer needed.

@N0zoM1z0 N0zoM1z0 closed this Nov 21, 2026
@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants