Skip to content

fix(aggregator): validate credential lifecycle ISO dates - #5093

Merged
dezren39 merged 2 commits into
mainfrom
queue/8071-4955-credential-lifecycle-dates
Nov 7, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/8071-4955-credential-lifecycle-dates

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Require ISO-valid measuredAt and present expiresAt values in isCredentialLifecycleRow.
  • Cover garbage/impossible date rejection, sanitizer drop accounting, and a valid generated row.

Fixes #4955

Verification

  • bun test — 1,391 passed.
  • bunx tsc --noEmit — blocked by an existing HealthView.conflicts type mismatch in test/overview.test.ts.
  • The PR's single generic basic check is passing; no aggregator test workflow ran. pm-aggregator-tests.yml and pm-stack-tests.yml currently trigger on pushes to main, not pull_request events.

@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 19:32
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cecc3443-d28f-4513-9956-0f74949b6ebb
Commits

Reviewing files that changed from the base of the PR and between be7346d and 9daf5d0.

Files selected for processing: 2

  • pm-stack/aggregator/src/credential-lifecycle.ts
  • pm-stack/aggregator/test/credential-lifecycle.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T05:28:17.508248Z 9daf5d0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 requested a balanced review from Copilot November 3, 2026 19:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open issues
What changed in this PR

Tightens validation of credential lifecycle rows by enforcing ISO-8601 date strings for measuredAt (always) and expiresAt (when present), and adds tests to ensure invalid dates are rejected and dropped rows are counted.

Changes:

  • Enforce isIsoDate(...) validation for measuredAt and expiresAt in isCredentialLifecycleRow.
  • Add tests covering invalid date formats/impossible dates and sanitizer drop accounting.
File Description
pm-stack/​aggregator/​src/​credential-lifecycle.ts Strengthens lifecycle row validation by requiring ISO-valid timestamps.
pm-stack/​aggregator/​test/​credential-lifecycle.test.ts Adds coverage for invalid lifecycle rows being rejected and counted as dropped during sanitization.

Review effort: Lite

Comment on lines +96 to +98
isIsoDate(row.measuredAt) &&
(row.credentialId === undefined || typeof row.credentialId === "string") &&
(row.expiresAt === undefined || (typeof row.expiresAt === "string" && Number.isFinite(Date.parse(row.expiresAt)))) &&
(row.expiresAt === undefined || isIsoDate(row.expiresAt)) &&
isIsoDate(row.measuredAt) &&
(row.credentialId === undefined || typeof row.credentialId === "string") &&
(row.expiresAt === undefined || (typeof row.expiresAt === "string" && Number.isFinite(Date.parse(row.expiresAt)))) &&
(row.expiresAt === undefined || isIsoDate(row.expiresAt)) &&
…ntial-lifecycle-dates

# Conflicts:
#	pm-stack/aggregator/src/credential-lifecycle.ts
@dezren39
dezren39 merged commit 8fe359a into main Nov 7, 2026
4 of 5 checks passed
@dezren39
dezren39 deleted the queue/8071-4955-credential-lifecycle-dates branch November 7, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants