Skip to content

fix: correct surface run bounds for unordered samples - #74

Merged
steipete merged 1 commit into
mainfrom
fix/surface-run-timestamps
Sep 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/surface-run-timestamps

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes incorrect or negative surface-run durations when sample files are not in chronological order, and prevents invalid timestamps in intermediate samples from being silently imported.

User Impact

RPC and Control UI imports now record the full time span of all samples. Equivalent timestamp offsets normalize to UTC before run IDs are built, so re-importing the same new run using a different offset is rejected as a duplicate.

Why This Change Was Made

The importer previously parsed only the first start and last finish. It now validates every interval and uses the earliest start and latest finish while preserving sample order and measurements. Existing canonical UTC IDs remain unchanged; historical records are not rewritten.

Evidence

  • Reproduced against the Node CLI with synthetic artifacts before the fix: an unordered batch selected a later start and earlier finish, and malformed or reversed intermediate intervals were accepted.
  • Regression coverage exercises unordered and overlapping samples, offset normalization and duplicate detection, invalid intermediate timestamps, and absence of data writes on rejection.
  • npm test: 206 passed; npm run check, per-file syntax checks, and actionlint -color=false: passed.
  • No live gateway or channel credentials were used; this change concerns importing already-produced artifacts.

@steipete
steipete merged commit 40accf7 into main Sep 16, 2026
7 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged as 40accf7.

Validation: npm test passed all 206 tests; npm run check, individual syntax checks for all 62 scripts, and actionlint -color=false passed locally. Synthetic CLI regressions reproduced unordered/overlapping run bounds, timestamp-offset normalization, and invalid intermediate intervals before the fix. Independent review found no actionable P0–P2 findings.

Exact PR head a6e8a63 passed CI, CodeQL, and Main Surface RTT, including the real loopback Gateway RPC and mocked browser/Gateway measurement and import lanes. No retries were needed. Historical records were not rewritten.

@steipete
steipete deleted the fix/surface-run-timestamps branch September 16, 2026 03:57
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