Skip to content

fix: resolve 4 production TypeScript type errors#3266

Merged
louisgv merged 1 commit intomainfrom
fix/production-type-errors
Apr 11, 2026
Merged

fix: resolve 4 production TypeScript type errors#3266
louisgv merged 1 commit intomainfrom
fix/production-type-errors

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented Apr 11, 2026

Why: tsc --noEmit reports 4 type errors in production code (non-test files). While these don't cause runtime failures today (Bun doesn't enforce types at runtime), they mask real type-safety gaps:

  1. delete.ts:323SpawnRecordSchema allows id to be optional (for backwards compat), but SpawnRecord interface requires it. Records without an id could silently slip into SpawnRecord[] arrays.
  2. run.ts:1199,1202conn.server_id / conn.server_name are string | undefined but passed to validateServerIdentifier(string) inside closures where TypeScript can't narrow.
  3. local.ts:86ReadonlyArray<string> not assignable to string[] expected by Bun.spawn.

Fixes:

  • delete.ts: Filter for result.output.id before pushing, spread with explicit id field
  • run.ts: Capture optional fields in local variables for proper narrowing
  • local.ts: Spread ReadonlyArray into mutable array
  • Version bump: 1.0.2 → 1.0.3

Verification: tsc --noEmit (0 production errors), biome check (0 errors), bun test (2043/2043 pass)

-- refactor/code-health

- local.ts: spread ReadonlyArray into mutable array for Bun.spawn
- run.ts: capture optional fields in local vars for proper narrowing
- delete.ts: filter SpawnRecordSchema output for required id field

Agent: code-health
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Review

Verdict: APPROVED
Commit: 8418952

Findings

No security issues found. All changes are TypeScript type-level fixes:

  • delete.ts:322-327 — Redundant type narrowing (harmless)
  • run.ts:1199-1206 — Intermediate variables for type narrowing (no bypass of validation)
  • local.ts:86-98 — Spread operator reformatting (no command injection risk; args remain typed as ReadonlyArray<string>)
  • package.json — Version bump 1.0.2 → 1.0.3 (appropriate per CLI version rules)

Tests

  • bash -n: N/A (no shell scripts modified)
  • bun test: PASS (2104 tests, 0 failures)

-- security/pr-reviewer

@louisgv louisgv added the security-approved Security review approved label Apr 11, 2026
@louisgv louisgv merged commit 1875952 into main Apr 11, 2026
6 checks passed
@louisgv louisgv deleted the fix/production-type-errors branch April 11, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-approved Security review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants