Skip to content

fix(B-0891): fix-fwd 4 tsc errors in zflash test-harness PoC (exactOptionalPropertyTypes + noUncheckedIndexedAccess)#5726

Merged
AceHack merged 1 commit into
mainfrom
otto-cli/b0891-tsc-fixfwd-exactoptional-poc-2026-05-28
May 28, 2026
Merged

fix(B-0891): fix-fwd 4 tsc errors in zflash test-harness PoC (exactOptionalPropertyTypes + noUncheckedIndexedAccess)#5726
AceHack merged 1 commit into
mainfrom
otto-cli/b0891-tsc-fixfwd-exactoptional-poc-2026-05-28

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 28, 2026

Summary

Fix-fwd for PR #5724 (zflash test-harness PoC) which race-merged through with non-required lint(tsc tools) failure per blocked-green-ci-investigate-threads.md auto-merge-race-with-follow-up-commit anti-pattern.

Fixes

4 errors under TS strict mode (exactOptionalPropertyTypes + noUncheckedIndexedAccess):

File Line Error Fix
run.ts 88, 95 isoPath: string | undefined not assignable to optional isoPath?: string reify positional[0] into typed local + explicit undefined check before return
run.ts 174 message: undefined fails exactOptionalPropertyTypes conditional return — omit message field when passing
scenarios.test.ts 68 { ...SCENARIOS[0] } widens because indexed access returns Scenario | undefined reify first into typed local + assert before spread

Gate verification

  • bunx tsc --noEmit (tools/zflash) → 0 errors
  • bun test tools/zflash/test-harness/ → 12 pass / 0 fail / 26 expect()
  • Commit canary HEAD~1=61 HEAD=61

Composes-with

🤖 Generated with Claude Code

…tionalPropertyTypes + noUncheckedIndexedAccess)

PR #5724 (zflash test-harness PoC) race-merged through with non-required
lint(tsc tools) failure per blocked-green-ci-investigate-threads.md
auto-merge-race-with-follow-up-commit anti-pattern. Fix-fwd lands the
tsc-clean substrate.

4 errors fixed:

1. run.ts:88 / 95 — array-index returns string | undefined under
   noUncheckedIndexedAccess; reify positional[0] into typed local + check
   undefined explicitly before returning ParsedArgs
2. run.ts:174 — message: undefined fails exactOptionalPropertyTypes;
   refactored to conditional return that omits message field when not set
3. scenarios.test.ts:68 — { ...SCENARIOS[0] } widens because SCENARIOS[0]
   is Scenario | undefined; reify first into typed local + assert before
   spread

Gate verification:
- bunx tsc --noEmit (tools/zflash) → 0 errors
- bun test tools/zflash/test-harness/ → 12 pass / 0 fail / 26 expect

Substrate-honest framing: race-merged content stays on main as substrate;
fix-fwd lands the correction per substrate-honest discipline per
auto-merge-race documentation in blocked-green-ci-investigate-threads.md.

Composes with: PR #5724 (B-0891 PoC); blocked-green-ci-investigate-threads
rule (Auto-merge-race-with-follow-up-commit anti-pattern); zeta-expected-
branch.md race-window-caveat (isolated worktree workflow).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 28, 2026 08:55
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AceHack AceHack enabled auto-merge (squash) May 28, 2026 08:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fix-forwards strict TypeScript errors in the zflash test-harness PoC after the prior scaffold merged with tsc failures.

Changes:

  • Reifies indexed array access before using values as required strings.
  • Omits optional message when a scenario passes to satisfy exactOptionalPropertyTypes.
  • Adds a guard before spreading the first scenario in tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tools/zflash/test-harness/run.ts Fixes strict optional/indexed access handling in CLI parsing and result construction.
tools/zflash/test-harness/scenarios.test.ts Guards SCENARIOS[0] before duplicating it for invariant testing.

@AceHack AceHack merged commit 01eeaee into main May 28, 2026
32 of 33 checks passed
@AceHack AceHack deleted the otto-cli/b0891-tsc-fixfwd-exactoptional-poc-2026-05-28 branch May 28, 2026 08:59
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.

2 participants