Skip to content

test(analytics): cover the production recalibration fold - #2735

Open
kavemang wants to merge 3 commits into
ryanbr:mainfrom
kavemang:agent/baseline-epoch-production-tests-2708
Open

kavemang wants to merge 3 commits into
ryanbr:mainfrom
kavemang:agent/baseline-epoch-production-tests-2708

Conversation

@kavemang

@kavemang kavemang commented Oct 8, 2026 •

Copy link
Copy Markdown

What this PR does

The recalibration tests call epochDropDiagnostic, an unused helper that independently repeats the production cutoff rule. Remove that helper and run the assertions directly through the unchanged epoch-aware Baselines.foldHistory.

Compare the full baseline state with a fold of only the retained suffix, covering strict midnight and one-second-after-midnight cutoffs, discarded missing/outlying nights, empty retained history and disabled recalibration. Preserve the reported three-night calibration case and verify that a fourth retained night makes the baseline usable. Keep the existing file path and restore the fold's documentation attachment.

Type of change

  • Refactor / cleanup
  • CI / tooling (regression tests)

How it was tested

  • Local full StrandAnalytics package suite: 2,137 tests passed, zero failures, swift test --jobs 1 with cached dependencies and installed snapshot-enabled SQLite. The six production recalibration cases also passed independently through the package test target.
  • A private strict-boundary mutation (< to <=) was rejected by three of the six methods, with seven failed assertions, including the preserved calibration case.
  • Source hygiene and whitespace pass. Core Tools (153 tests) and diff-scoped i18n pass.
  • Removing the test-only declaration requires the corresponding derived parity metadata update. python3 Tools/parity_ledger.py --refresh-derived --base origin/main passed its guarded offline ratchet against the exact base (289 remaining known findings). The six-line snapshot diff removes one unpaired function and one test-only finding, with no disposition changes.
  • Verified the corrected head b148754a1b4558debe474a4d21833a2010b63e31: the complete expected 17-check roster passed and was confirmed twice unchanged. All eight package checks, three tools package checks, parity governance, Tools Python, hygiene and i18n succeeded.
  • Native Apple CI at that head built universal macOS Strand and iOS NOOPiOS successfully. The macOS StrandTests suite ran 2,267 tests, with two skipped and zero failures. iOS validation is compile-only; its test step is skipped by design. No warning names the changed Baselines source/test files in the inspected Apple build logs.
  • These checks validate the preserved PR head, rather than a merge with the newer main branch; CI's merge-current-main steps were skipped. Both original commits remain unchanged.

Android has no epochDropDiagnostic twin to remove; both platforms' shipped scoring formulas and cutoff behavior are unchanged. This removes only test-only Apple API and improves assertions on the actual Apple production fold. No real strap testing is relevant to this pure analytics test change.

Checklist

  • Swift package tests pass locally (full StrandAnalytics suite)
  • No warnings naming the changed Baselines files in inspected native CI logs
  • No hardcoded hex frame bytes
  • Follows docs/CONTRIBUTING.md
  • No generated output or secrets committed

Related issues

Refs #2708

@kavemang
kavemang marked this pull request as ready for review October 11, 2026 01:19
Regenerate derived parity authority against the merged declarations while
retaining production fold regression tests and removing the unused helper.

Refs #2708
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.

1 participant