Repository navigation
Parse result and store models under strictNullChecks - #413
Merged
jtklein-agents merged 1 commit intoNov 27, 2026
Conversation
typecheckAlignment returns a TypecheckedAlignment with dataType, numSequences, fileFormat, hasInvariantSites and typecheckingComplete required, and AlignmentParseResult carries it. Store fields that stay undefined until load widen their readers' types; lookups that cannot miss throw a plain Error. strict tsc: 149 -> 118 errors, none in the touched non-test files. Refs #408 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jtklein-agents
merged commit Nov 27, 2026
2d38081
into
spec/406-strict-typescript
6 of 7 checks passed
10 tasks
jtklein-agents
deleted the
408-parse-result-and-store-models-under-strictnullchecks
branch
November 27, 2026 15:00
jtklein-agents
added a commit
that referenced
this pull request
Nov 27, 2026
* Type-check main process and app files under strictNullChecks (#409) processHelpers optional-chains the stdout/stderr pipes, modelSelection throws explicitly on a missing best-model match (same catch, same user message), paths falls back on pop(), bootstrap spreads instead of [].concat. --strict errors: 149 -> 142, zero in these files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Turn on strictFunctionTypes (#411) OptionSelect is generic over its value type, and every prop type that embeds it names the real type. Handlers registered with ipcMain.handle take IpcMainInvokeEvent. The unhandled-error bridge event has a typed payload. Option gains an Input type parameter so part start and end accept the text OptionTextField hands them. Closes #407 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Type the parse result and store models under strictNullChecks (#413) typecheckAlignment returns a TypecheckedAlignment with dataType, numSequences, fileFormat, hasInvariantSites and typecheckingComplete required, and AlignmentParseResult carries it. Store fields that stay undefined until load widen their readers' types; lookups that cannot miss throw a plain Error. strict tsc: 149 -> 118 errors, none in the touched non-test files. Refs #408 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Turn on strict mode and type-check the tests under it (#410) tsconfig sets "strict": true and drops the flags it implies. Test files use `!` where a lookup is known to hit; the null-parent Runs use `{} as RunParent`. Strict surfaced a clash between the store's optional hoverInfo and the option components' required one, and Input's astralTree prop; both are loosened to match the store, with no runtime change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #408
Summary
The parse result has its fields set, and the store models now pass
strictNullChecks. The flag itself is still off.Alignment.dataType,fileFormatandconvertedFromkeepundefineduntil the alignment loads. The types that copydataTypenow allowundefinedtoo:AlignmentLike(in both files),PartitionAlignment,AlignmentOwner,RunOwner, andRun.dataType(which returnsDataType | undefined). Code that reads them checks forundefinedfirst.Lookups that can't miss (
Run.analysisOptionand thesetModelFromStringregexes) now throw a plainErrorthat names the missing value, or use onematchwith a guard. The only!in production code is the protein matrixexec. It has a comment, and its behaviour is unchanged because #403 owns that case.Behaviour changes, all in states that should not happen:
typecheckAlignment: no sequence matches a data type (e.g. onlyTand-)dataTypeundefinedUserFixErrorrunModelTest: no modeltest binary in the binaries listbinaryName: undefinedto the main processrunModelTest:modelTestCanRunis falseastralArgs: no ASTRAL tree-i undefined-ileft outpartitionType/getPartitionTypebefore the alignment is parsedundefined''[{ value: undefined }][]Evidence
Before:
tsc --noEmit -p tsconfig.json --strict→ 149 errors, 31 of them in the files this PR touches:After: 118 errors, 0 in the non-test files this PR touches.
App.tsxstill has its 4 pre-existingstrictFunctionTypeserrors, and this PR does not touch it.Before: an alignment whose sequences match no data type loads with
dataTypeundefined.After:
src/common/typecheckAlignment.test.tspasses:yarn lint,yarn typecheckandyarn testall pass (73 files, 499 tests).Merge Danger
Door: two-way
The change is mostly types. A revert restores the old behaviour.
Blast Radius: alignment-loading
An alignment whose sequences match no data type now fails to load with an error, where before it loaded with no data type. Every other behaviour change is in a state that a parsed alignment or a configured binaries list rules out.
🤖 Generated with Claude Code