Repository navigation
fix(findings): order occurrence history by scan start time - #1772
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. No blocking findings in this owner-level merge-safety review. The shared timestamp parser brings occurrence bounds into line with the finding index, while preserving original timestamp text and deterministic scan-ID tie breaks.
Validated 28 SDK history/renderer tests with the CI-pinned Bun 1.3.14, 20 real-SQLite occurrence reads covering offsets, microseconds, ties and linked identities, all five portable plugin checks, SDK types/formatting, and the plugin build. The original base produced incorrect bounds in 18 of those SQLite reads. Local saved-scan integration was blocked by existing filesystem ownership validation; the full seeded SDK run was stopped after 111 passes and one such failure, so this is not a full-suite pass.
There was a problem hiding this comment.
🟢 Approval recommended
The narrow change implements the intended ordering with focused regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Corrects finding-history bounds by ordering scans by parsed start time, breaking ties by scan ID while preserving the original knownSince text.
Changes:
- Reuses the existing timestamp parser for occurrence ordering.
- Adds regressions for mixed offsets, microseconds, and equal instants.
- Replaces SDK fixture placeholders with valid timestamps.
| File | Description |
|---|---|
| sdk/typescript/tests-ts/workbench-scan-history.test.ts | Uses valid timestamps in history fixtures and expectations. |
| plugins/codex-security/tests/test_workbench_scan_history.py | Adds timestamp-ordering regressions. |
| plugins/codex-security/scripts/workbench_scan_history.py | Sorts history by parsed instant and scan ID. |
Review effort: Balanced
Summary
Finding history can report the wrong first and last scan when saved start times use different UTC offsets. Order occurrences by their parsed start instant and use the scan ID to break ties, preserving the original
knownSincetimestamp text.Changes
Testing
build:ci, source compatibility, and source-check tests.pnpm run test --seed 12345andpnpm run test, random seed5326350): each run finished with 5,200 passed, 67 skipped, and 11 authentication-fixture failures. Every failure matches the Git-root diagnostic reproduced by focused controls on the unmodified base commit; neither full-suite run passed.Risk and rollout
No schema migration or stored timestamp rewrite. This uses the existing parser's precision and error behavior: malformed timestamps or mixed timezone-aware and timezone-naive values now surface parser/comparison errors during occurrence-history lookup.
Public disclosure review