Skip to content

Parse result and store models under strictNullChecks #408

Done

Description

@jtklein-agents

Parent

Spec: strict TypeScript

What to build

The parse result and the store models type-check under strictNullChecks, while the flag stays off.

Acceptance criteria

  • typecheckAlignment (src/common/typecheckAlignment.ts) returns a typechecked alignment type in which dataType, numSequences, fileFormat, hasInvariantSites and typecheckingComplete are required, and AlignmentParseResult (src/main/parseAlignment.ts) carries that type. Alignment.loadParsedAlignment copies those fields with no narrowing.
  • Alignment.dataType, fileFormat and convertedFrom stay | undefined until loaded. The types that copy them widen to match: AlignmentLike in AlignmentOptions.ts and in PartOptions.ts, PartitionAlignment in Partition.ts, and the Run.dataType getter (DataType | undefined). Code that reads them narrows; runModelTest guards on modelTestCanRun.
  • No placeholder data type (for example 'unknown') stands in for "not parsed yet".
  • Lookups that can't miss throw a plain Error naming the missing value: Run.analysisOption's find, and each .test()-then-.exec()[0] in Alignment.setModelFromString, which becomes one match with a guard.
  • The protein matrix re.exec( model )[1] in setModelFromString is left behaving as today, since Applying a modeltest result with an unlisted protein matrix throws a TypeError owns it; narrowing it for the compiler keeps the same outcome.
  • InputFile.run is declared run: Owner; with no initializer. RunParent stays required.
  • Option's description/hoverInfo fields, the PartOptions end-position schema test, Run.convertedAlignmentFrom, Run.astralArgs and StoreBase's optional call type-check without !.
  • Production code uses ! only with a one-line comment giving the reason.
  • tsc --noEmit -p tsconfig.json --strict shows zero errors in the non-test files this ticket touches, and a total no higher than before; both counts are in the PR description.
  • yarn verify passes.

Activity

  1. added
    ready-for-agent
    on Nov 27, 2026
  2. jtklein-agents commented on Nov 27, 2026

    @jtklein-agents
    OwnerAuthor

    Merged into spec/406-strict-typescript via #413 (2d38081).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions