fix(B-0891): fix-fwd 4 tsc errors in zflash test-harness PoC (exactOptionalPropertyTypes + noUncheckedIndexedAccess)#5726
Merged
AceHack merged 1 commit intoMay 28, 2026
Conversation
…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>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
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
messagewhen a scenario passes to satisfyexactOptionalPropertyTypes. - 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix-fwd for PR #5724 (zflash test-harness PoC) which race-merged through with non-required
lint(tsc tools)failure perblocked-green-ci-investigate-threads.mdauto-merge-race-with-follow-up-commit anti-pattern.Fixes
4 errors under TS strict mode (
exactOptionalPropertyTypes+noUncheckedIndexedAccess):run.tsisoPath: string | undefinednot assignable to optionalisoPath?: stringpositional[0]into typed local + explicitundefinedcheck before returnrun.tsmessage: undefinedfails exactOptionalPropertyTypesmessagefield when passingscenarios.test.ts{ ...SCENARIOS[0] }widens because indexed access returnsScenario | undefinedfirstinto typed local + assert before spreadGate verification
bunx tsc --noEmit(tools/zflash) → 0 errorsbun test tools/zflash/test-harness/→ 12 pass / 0 fail / 26 expect()Composes-with
blocked-green-ci-investigate-threads.mdauto-merge-race-with-follow-up-commit anti-patternzeta-expected-branch.mdrace-window-caveat (isolated worktree workflow)🤖 Generated with Claude Code