Skip to content

fix: type strictness: enable - #11

Merged
andrei-hasna merged 2 commits into
mainfrom
factory/69d1c44f-99dc-4a73-b22d-73b88343-34d7dfde
Jul 31, 2026
Merged

fix: type strictness: enable#11
andrei-hasna merged 2 commits into
mainfrom
factory/69d1c44f-99dc-4a73-b22d-73b88343-34d7dfde

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Objective

type strictness: enable noImplicitReturns+noFallthroughCasesInSwitch in evals and fix the fallout [loop-infinity-300pr]

REPO: https://github.com/hasna/evals

WHAT TO CHANGE
tsconfig.json has "strict": true but neither "noImplicitReturns" nor "noFallthroughCasesInSwitch". Both catch real control-flow bugs: a code path that falls off the end of a function returning undefined, and a switch case that falls through unintentionally. Turn both on in compilerOptions and fix the fallout.

DONE LOOKS LIKE

  • noImplicitReturns+noFallthroughCasesInSwitch enabled in tsconfig.json compilerOptions (all of the named flags, if more than one).
  • Fix each diagnostic by making the control flow explicit — add the missing return, add the missing break/return in the switch case, or make the function's return type include undefined if that is genuinely the contract. Do not add @ts-expect-error.
  • A deliberate switch fallthrough is legitimate; keep it and add the // falls through comment TypeScript recognises, rather than restructuring working code.
  • If the fallout is larger than roughly 60 diagnostics, land the smallest coherent slice, leave the flags off in the committed tsconfig, and state the remaining count in the PR body.
  • Behaviour unchanged. This is a type-safety change, not a refactor: no renamed exports, no changed signatures beyond what the flag forces, no reorganised files.

VERIFY

  • bun install && bun run typecheck passes with the flag(s) on (or bunx tsc --noEmit -p tsconfig.json if the repo has no typecheck script — and if so, add one).
  • bun test passes, unchanged.

EVIDENCE
tsconfig.json compilerOptions read from GitHub HEAD on 2026-07-29 via the GitHub contents API — not from a stale local checkout. If the flag has since been enabled upstream, close this task as already-done with a one-line comment rather than opening an empty PR.

PROCESS: work in a branch off the default branch, one focused change, conventional commit, open a PR. Do not bundle unrelated cleanups. If the repo has a CHANGELOG, add an entry.

Verification

  • policy source: base ccb79e8 (immutable commit — agent-proof)
  • ⚠️ GATE-INTEGRITY: agent touched verify-bearing config — REVIEW (tsconfig.json)
  • containment: env — allowlist env, non-login shell, run-scoped HOME (registry auth seeded for install)
  • install: pass
  • typecheck: pass
  • build: FAIL
  • test: pass
  • doctor (ci): ok — 11 checks passed (1 advisory)

Run run_0209db82f7fd · backend codewith · task 69d1c44f-99dc-4a73-b22d-73b88343285c
🏭 Generated by @hasnaxyz/factory


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

type strictness: enable noImplicitReturns+noFallthroughCasesInSwitch in evals and fix the fallout [loop-infinity-300pr]

REPO: https://github.com/hasna/evals

WHAT TO CHANGE
tsconfig.json has "strict": true but neither "noImplicitReturns" nor "noFallthroughCasesInSwitch". Both catch real control-flow bugs: a code path that falls off the end of a function returning undefined, and a switch case that falls through unintentionally. Turn both on in compilerOptions and fix the fallout.

DONE LOOKS LIKE
- noImplicitReturns+noFallthroughCasesInSwitch enabled in tsconfig.json compilerOptions (all of the named flags, if more than one).
- Fix each diagnostic by making the control flow explicit — add the missing return, add the missing break/return in the switch case, or make the function's return type include undefined if that is genuinely the contract. Do not add @ts-expect-error.
- A deliberate switch fallthrough is legitimate; keep it and add the // falls through comment TypeScript recognises, rather than restructuring working code.
- If the fallout is larger than roughly 60 diagnostics, land the smallest coherent slice, leave the flags off in the committed tsconfig, and state the remaining count in the PR body.
- Behaviour unchanged. This is a type-safety change, not a refactor: no renamed exports, no changed signatures beyond what the flag forces, no reorganised files.

VERIFY
- `bun install && bun run typecheck` passes with the flag(s) on (or `bunx tsc --noEmit -p tsconfig.json` if the repo has no typecheck script — and if so, add one).
- `bun test` passes, unchanged.

EVIDENCE
tsconfig.json compilerOptions read from GitHub HEAD on 2026-07-29 via the GitHub contents API — not from a stale local checkout. If the flag has since been enabled upstream, close this task as already-done with a one-line comment rather than opening an empty PR.

PROCESS: work in a branch off the default branch, one focused change, conventional commit, open a PR. Do not bundle unrelated cleanups. If the repo has a CHANGELOG, add an entry.

X-Factory-Run: run_0209db82f7fd
X-Factory-Task: 69d1c44f-99dc-4a73-b22d-73b88343285c
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #11 @ 9bf7591 — lens: correctness+security+gates, reviewer Augustus (1 of 1)

What I read:

  • git log --oneline origin/main..HEAD showed one commit: 9bf7591 fix: type strictness: enable.
  • git diff origin/main...HEAD --stat showed CHANGELOG.md and tsconfig.json, 7 insertions.
  • Full diff for both changed files.
  • Surrounding files/config: full CHANGELOG.md, full tsconfig.json, root package.json, dashboard/package.json, src/dashboard-install-docs.test.ts, dashboard/README.md, CONTRIBUTING.md, and CLAUDE.md.

Commands run and exit codes:

  • git rev-parse HEAD: exit 0, confirmed 9bf7591b2bc546c3e9c3681bbf41eaedb460c31e.
  • git log --oneline origin/main..HEAD: exit 0.
  • git diff origin/main...HEAD --stat: exit 0.
  • bun install: exit 0.
  • bun run typecheck: exit 0.
  • bun test: exit 0, 248 pass / 0 fail.
  • bun run build: exit 1 before the documented dashboard-local install; failure was missing vite / @vitejs/plugin-react under dashboard/, matching the repo's documented separate install-root prerequisite.
  • cd dashboard && bun install: exit 0.
  • bun run build: exit 0 after the documented dashboard install.
  • git diff --check origin/main...HEAD: exit 0.
  • git status --short: exit 0, no tracked worktree changes.

Blocking P0/P1 findings:

  • None.

Non-blocking follow-ups:

  • None. The root build's dependency on cd dashboard && bun install is already documented and covered by src/dashboard-install-docs.test.ts; after that documented prerequisite, the build gate passed.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #11 @ 94b0cb6 — lens: correctness+security+gates, reviewer Augustus (1 of 1)

This refreshes the earlier GO review after GitHub refused the first merge attempt because current main had advanced. I merged origin/main into the PR branch, resolved the single CHANGELOG.md conflict by preserving main's Added/Fixed entries and the PR's Changed entry, reran the gates, and pushed the PR branch.

What I read:

  • Updated PR diff against current origin/main: CHANGELOG.md and tsconfig.json, 5 insertions.
  • Full updated diff for both changed files.
  • Surrounding files/config: full CHANGELOG.md, full tsconfig.json, root package.json, dashboard/package.json, src/dashboard-install-docs.test.ts, dashboard/README.md, CONTRIBUTING.md, and CLAUDE.md.

Commands run and exit codes on the updated candidate:

  • git merge --no-ff origin/main: exit 1 due the expected CHANGELOG.md conflict.
  • git diff --check: exit 0 after resolving the conflict.
  • bun install: exit 0.
  • bun run typecheck: exit 0.
  • bun test: exit 0, 253 pass / 0 fail.
  • bun run build: exit 0 with the documented dashboard install root present.
  • Staged secrets scan over git diff --cached: exit 0, no credential patterns found.
  • git commit -m 'chore: sync pr11 with main' -m 'Agent: Augustus': exit 0, created 94b0cb6.
  • git push origin HEAD:factory/69d1c44f-99dc-4a73-b22d-73b88343-34d7dfde: exit 0.
  • gh pr checks 11 --repo hasna/evals --watch: exit 0, ci passed; [code]smith skipped.

Blocking P0/P1 findings:

  • None.

Non-blocking follow-ups:

  • None.

@andrei-hasna
andrei-hasna merged commit a734b24 into main Jul 31, 2026
2 checks passed
@andrei-hasna
andrei-hasna deleted the factory/69d1c44f-99dc-4a73-b22d-73b88343-34d7dfde branch July 31, 2026 16:12
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.

1 participant