Skip to content

chore: add unused code checks - #687

Open
memebattle-dev wants to merge 10 commits into
masterfrom
feat/issue-632-unused-code
Open

memebattle-dev wants to merge 10 commits into
masterfrom
feat/issue-632-unused-code

Conversation

@memebattle-dev

@memebattle-dev memebattle-dev commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add Knip 6 configuration for the six original JavaScript/TypeScript apps, excluding CAS and shared packages; the new CAS frontend is not added to the checking scope
  • add root and per-app unused_code:check / unused_code:remove commands and a dedicated unused-code CI job
  • remove unused files, exports, and dependencies found during baseline cleanup
  • sync with master at 2c800da in merge commit 8bf5558, resolving the root lockfile conflict while preserving Knip 6.32.2, the base toolchain and new CAS frontend dependencies

Validation

  • original implementation verified that a temporary unused TypeScript fixture makes pnpm unused_code:check fail and unused_code:remove removes it; no synthetic artifacts retained
  • current merge: pnpm install --frozen-lockfile, pnpm unused_code:check, pnpm fmt:check, pnpm lint:check, pnpm test:ci, and git diff --check pass
  • pnpm ts-check passes before the Blog build; after the build it reports three TS2344 locale constraint errors in generated .next/types/validator.ts (lines 81, 94, 103). An independently installed base at 2c800da reproduces identical diagnostics
  • the base's full test run encountered a CAS frontend assertion failure; its isolated CAS rerun passed. The merged PR's full test run passed
  • independent review of the complete frozen merge and PR diffs passed without security or logic blockers; the committed tree matches the reviewed tree
  • GitHub verifies the pushed head 8bf5558a14bf34403f4269b47f5c854717fbb244 is mergeable; all completed CI checks pass, including unused-code, typechecks, unit tests, images and Ligretto E2E. Only Storybook remains waiting for protected-environment approval

Risks

  • unused_code:remove uses Knip fix mode with file removal enabled; generated diffs must be reviewed before retention
  • dynamic database drivers and generated Adonis schema files use narrow configuration exclusions
  • the earlier lockfile regeneration updated yaml 2.8.2 to 2.9.0 and corresponding peer snapshots; this merge preserves that resolution
  • Storybook deployment requires protected-environment approval; the worker cannot approve it

Fixes #632

@memebattle-dev

memebattle-dev commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Resolved the lockfile merge conflict in 8bf5558 by syncing master at 2c800da. Preserved Knip 6.32.2, the six-app checking scope and the upstream CAS dependencies. Frozen installation, unused-code checks, formatting, lint, repository tests and independent review passed. Post-build local typechecking reproduces the same three generated Blog route-type errors on the independently installed base. GitHub confirms the pushed branch is mergeable. All completed CI checks now pass, including typechecks and Ligretto E2E; only Storybook awaits protected-environment approval. No application behavior was changed by the conflict resolution.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Resolved the new master conflicts in 3968ebd (master c4ccc47); GitHub confirms the branch is mergeable. The six-app Knip scope is preserved; CAS source and fixtures remain unchanged.

Validation: frozen install, lint, formatting and unused-code checks pass. All 312 tests pass with VITEST_MAX_WORKERS=2 pnpm -r --workspace-concurrency=1 --no-bail run test:ci; the parallel root command still intermittently fails the unchanged CAS Dashboard empty-name assertion. Typechecking retains the three generated Blog errors previously reproduced on master. Independent read-only static review of the complete resulting PR diff found no actionable defects; sandbox restrictions prevented that reviewer from executing commands. Local Ligretto E2E remains blocked by browser/backend prerequisites, so the new CI run is the remaining verification. No unrelated test or application fixes were included.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Investigated the Ligretto E2E cancellation on 3968ebd: GitHub confirms the 10-minute job timeout, and all 12 retained test traces show /api/auth/me returning HTTP 500 (Invalid status code: undefined) before gameplay begins. The relevant authentication/client code is unchanged from master; the existing CAS transport-error shape mismatch can explain this, but the original upstream error was not logged, so no regression attributable to this PR is established. A current read-only probe of https://cas.mems.fun/health from the worker also fails to connect on port 443; this is not a probe from the GitHub runner. No source changes or blind reruns made. E2E remains blocked pending CAS availability; once restored, the smallest next step is a targeted rerun of job 110491434876. Storybook deployment separately awaits protected-environment approval, which this account cannot grant.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

CAS health now returns HTTP 200 from the worker. Reran only the previously timed-out Ligretto E2E job: run 36898496345, attempt 2, completed successfully with the PR head unchanged. The remaining Storybook deployment still requires protected-environment approval.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Resolved the new master conflicts in c86080f, preserving the six-app Knip scope and upstream dependencies. Independently reran lint, formatting, unused-code checks and the repository test suite: all pass (389 tests); typechecking retains only the three previously verified Blog generated-validator errors. Independent read-only review found no actionable defects. Local full Ligretto E2E remains blocked by backend prerequisites; the new CI run is the remaining browser verification.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Resolved the new master conflict in 715ae41, preserving the six-app Knip scope and upstream changes. Independently reran lint, formatting, unused-code checks and root pnpm test:ci successfully (389 tests). An earlier serial run timed out in one unchanged CAS Dashboard test; the subsequent root run passed. Typechecking retains the three verified baseline Blog errors. Independent read-only static review found no actionable defects; its execution sandbox was unavailable, so it reviewed the supplied complete diff. CAS sources and fixtures match master. Local Ligretto browser verification remains blocked by Chromium/backend prerequisites; new CI is pending.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Investigated the current Ligretto E2E timeout (run 39301350093): retained browser traces consistently show POST /api/auth/me returning HTTP 500, "Unexpected end of JSON input", before gameplay loads. Retries exhaust the 10-minute job limit. Relevant authentication code, tests and workflow match master; no regression attributable to this PR is evidenced. CAS /health currently returns 200, but that does not verify the legacy POST /auth/temp-token contract consumed by Ligretto; the original upstream response is absent from CI artifacts. The published CAS API no longer advertises that path, which raises a compatibility concern but does not prove the POST response. Blocked pending CAS-owner verification of that legacy endpoint or a compatible CI environment. No speculative source changes, timeout increase or blind rerun made.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Resolved the new master conflict in 0bb882a, preserving the six-app Knip scope and upstream CAS/auth changes. Independently reran lint, formatting and unused-code checks successfully. Root tests recorded 434 passes and one unchanged CAS empty-name assertion failure; the complete affected 30-test suite then passed in a targeted coordinator rerun without edits. Typechecking retains only the three established Blog errors (11 packages pass). Independent read-only static review of the complete final diff found no actionable defects or secrets; its command sandbox was unavailable. No speculative fix for the previously documented Ligretto authentication blocker was included. New CI is pending.

@memebattle-dev

memebattle-dev commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Resolved the new master conflicts in 0f75ca9, preserving upstream auth configuration/test scripts and the approved six-app Knip scope. Added the upstream database test directory to Knip entrypoints; CAS and shared packages match master. Independently reran lint, formatting and unused-code checks successfully. Root tests recorded 570 passes but could not run the core Postgres suite because Docker Compose is unavailable; core unit/functional suites separately pass 32/32. Typechecking retains the three verified baseline Blog errors (11 packages pass). Independent read-only static review of the complete resulting PR diff found no actionable defects or secrets; repository execution was unavailable to that reviewer. Previous-head (0bb882a) Ligretto CI artifacts reproduce the documented legacy auth failure: all 17 retained traces show /api/auth/me returning HTTP 500, Unexpected end of JSON input. No speculative auth changes or CI bypass included. New CI is pending.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Resolved the new master dependency conflicts in d4f08e0, preserving the approved six-app Knip scope and upstream auth migration unchanged. Independently reran lint, formatting and unused-code checks successfully. Root tests record 570 passes but cannot run the core Postgres suite because Docker Compose is unavailable; core unit/functional suites separately pass 43/43. Typechecking retains the three established baseline Blog errors. Independent read-only static review of the complete final PR diff found no actionable defects or secrets; its command sandbox was unavailable. Upstream master now pauses Ligretto E2E pending frontend migration #817; this merge preserves that upstream decision, rather than claiming browser verification. New CI is pending.

@memebattle-dev

memebattle-dev commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Integrated master 5f2d6f8 in ea52c1a, preserving upstream Zod and the approved six-app Knip scope. CAS and shared packages match that base. Independently reran lint, formatting and unused-code checks successfully; core unit/functional tests pass 43/43. Root tests still fail on missing Docker Compose and an unchanged auth timeout assertion (503 versus 200); both matching auth tests pass in an isolated rerun without edits. Typechecking retains the three established Blog errors. Independent read-only static review found no defects; its execution sandbox was unavailable. PostgreSQL store tests and browser E2E remain unverified locally. Master advanced again during verification to d80ced3 (#846), causing another conflict; that follow-up is now in progress in the existing task thread. No new-head CI checks are reported yet.

@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Integrated master d80ced3 in 1d81847, preserving the approved Knip scope. Coordinator lint, formatting and unused-code checks pass. Root tests failed on unavailable Docker Compose and CAS/Worker tests; isolated coordinator reruns pass 51/51 and 4/4 without changes. Typechecking retains the three established Blog errors. Independent static full-diff review found no defects or secrets; sandbox execution was unavailable. The newer master has already introduced another merge conflict, so this is not merge-ready and no current-head CI checks are reported.

This branch is waiting to be deployed

1 waiting (outdated) deployment
storybook-pr — d4f08e07 Waiting Oct 24, 2026 by memebattle-dev via build-storybook #193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup unused code checks

1 participant