Skip to content

Interval settings load: union-wrapped intervals, missing good-value tests (#323 follow-ups) #336

Closed

Description

@scuttletoby

Follow-ups from the correctness lens on #323 (merged): #323 (comment)

  1. Union-wrapped intervals are treated as plain intervals (packages/shared/src/forkSettingsIntervals.ts:53, used at :122). A future field such as NullOr(DurationFromMillis) or Union([DurationFromMillis, Literal("off")]) (where null/"off" means "never") would have its valid value dropped on load and deleted on the next save. Same on rollback: an older build reading a newer file. Fix: only treat the bare interval schema as an interval, or check each union member; add a test with such a field.
  2. No test pins that a good value is never dropped. These mutations stayed green: upper bound lowered to 200 s (a saved 10-minute interval would be dropped every load); the hasOwn guard removed (every clean load warns about missing intervals).
  3. Untested branches: the walk's record and union branches, and the "unchanged value is never refused" exemption (mutations M4, M9, M12 stayed green).
  4. Nit: the load warning goes through Effect's default console logger, not the server logger; the read-only report command no longer flags such a file and returns ok: true.

Each item: a test that fails without its fix first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions