Skip to content

refactor: replace unmaintained chrono with time behind one clock module - #532

Open
hyperpolymath wants to merge 4 commits into
mainfrom
chore/chrono-to-time
Open

hyperpolymath wants to merge 4 commits into
mainfrom
chore/chrono-to-time

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Fixes the root cause of the bridge-gate failure on dependency bumps (echidna 526): RUSTSEC-2026-0543, chrono is unmaintained and every version is affected.

What changed

  • New src/rust/clock.rs: the one place for UTC now, RFC 3339 strings and Unix seconds, on the time crate. Four unit tests, including an exact-format check.
  • chrono removed from Cargo.toml and every call site (12 source files, 4 tests). Diagnostics and integrity fields use time's rfc3339 serde helpers (option variant for Option fields).
  • Cargo.lock and fuzz/Cargo.lock regenerated. chrono still appears in Cargo.lock only through third-party crates (rmcp, schemars); no source imports it, so the bridge reachability scan should classify it Informational.

Choices recorded

  • time over jiff: smaller surface, serde helpers cover the existing fields, no behaviour beyond what chrono gave us was used.
  • Wire change: RFC 3339 strings now end in Z instead of +00:00. Both parse as RFC 3339; the provenance hash input changes only because timestamps differ per run anyway.
  • No deny.toml ignore added: fixed at source rather than exempted.

Checks run locally: cargo clippy --all-targets -D warnings clean, cargo fmt clean, lib tests for clock, diagnostics, integrity, verisim_bridge and proof (50) and the two health integration tests (18) pass.


Generated by Claude Code

@gitnotebooks

gitnotebooks Bot commented Nov 26, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/hyperpolymath/echidna/pull/532

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Improvements
    • Standardised timestamp handling across proof records, health metrics, diagnostics and exports. Timestamps continue to use RFC 3339 formatting, with existing storage behaviour preserved.
    • Health and diagnostic timestamps now support consistent RFC 3339 serialisation and parsing.

The Rust crate replaces Chrono timestamp handling with the time crate and a shared clock module. Diagnostic timestamp fields now use OffsetDateTime. Timestamp creation, formatting, and test fixtures use the shared clock API.

Changes: UTC timestamp migration

Layer / File(s) Summary
Add the shared clock API
Cargo.toml, src/rust/clock.rs, src/rust/lib.rs
The crate adds the time dependency and exports clock helpers for current instants, RFC 3339 strings, and Unix seconds. Tests cover parsing and formatting behaviour.
Update diagnostic timestamp fields
src/rust/diagnostics/corpus_monitor.rs, src/rust/diagnostics/gnn_training.rs, src/rust/diagnostics/health.rs, src/rust/integrity/solver_integrity.rs
Diagnostic timestamp fields use time::OffsetDateTime with RFC 3339 Serde handling. Timestamp creation and parsing use the time APIs.
Migrate timestamp producers and fixtures
src/rust/agent/memory.rs, src/rust/cli/corpus.rs, src/rust/dispatch.rs, src/rust/learning/daemon.rs, src/rust/verification/proof.rs, src/rust/verisim_bridge.rs, tests/*
Proof storage and other timestamp producers use the shared clock for Unix timestamps and RFC 3339 strings. Tests use the same API.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

Merge Risk: Minimal · up to bb2a4 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: replacing the unmaintained chrono dependency with time. It also mentions the single clock module, which the changeset adds in src/rust/clock.rs. The title is concise, …
Description check Passed The description covers the summary, the changes, the testing performed and the reasoning behind the design choices. It states the RUSTSEC motivation, lists the changed files, explains the wire-format …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: replacing the unmaintained chrono dependency with time. It also mentions the single clock module, which the changeset adds in src/rust/clock.rs. The title is concise, specific and matches the diff. It is 71 characters, which is acceptable for a title.

Full details: Description check

Explanation

The description covers the summary, the changes, the testing performed and the reasoning behind the design choices. It states the RUSTSEC motivation, lists the changed files, explains the wire-format change to Z, and reports clippy, fmt and test results. It does not follow the repository template exactly. The RSR Quality Checklist is not ticked or mentioned, and the Screenshots section is absent, though it is optional. The description also does not state whether the SPDX header is present in the new clock.rs file, which is a required checklist item. The Changes section uses a bullet list as the template expects. The description mostly fulfils the template, so it passes, but the checklist and SPDX status should be addressed.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 2e91bf88-fdc0-4bf7-a09d-3a57ec6de59c
Commits

Reviewing files that changed from the base of the PR and between 494d978 and bb2a437.

Files ignored due to path filters: 2

  • Cargo.lock is excluded by !**/*.lock
  • fuzz/Cargo.lock is excluded by !**/*.lock

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 24

  • GitHub Check: scan / shell-secrets
  • GitHub Check: scan / rust-secrets
  • GitHub Check: CodeRabbit
  • GitHub Check: Dogfooding compliance summary
  • GitHub Check: governance / Exemption ratchet
  • GitHub Check: governance / Debt ratchet
  • GitHub Check: governance / Workflow security linter
  • GitHub Check: governance / JS runtimes — deno
  • GitHub Check: governance / JS runtimes — bun
  • GitHub Check: governance / JS runtimes — environment provisions Bun first
  • GitHub Check: governance / Check Workflow Staleness
  • GitHub Check: governance / Security policy checks
  • GitHub Check: governance / Language / package anti-pattern policy
  • GitHub Check: governance / Trusted-base reduction policy
  • GitHub Check: governance / Allowlist Preflight
  • GitHub Check: governance / JS runtimes — pnpm
  • GitHub Check: governance / Licence consistency
  • GitHub Check: hypatia / Hypatia Neurosymbolic Analysis
  • GitHub Check: Rebuild container image (independent runner)
  • GitHub Check: panic-attack assail
  • GitHub Check: Build & verify container image
  • GitHub Check: analyze (javascript-typescript, none)
  • GitHub Check: PR (address)
  • GitHub Check: semgrep-cloud-platform/scan
CI failures not shown inline: 1

GitHub Actions: Cargo Audit / Dependency audit: refactor: replace unmaintained chrono with time behind one clock module

Conclusion: failure

View job details

##[group]Run bash scripts/ci/audit-dependencies.sh
 �[36;1mbash scripts/ci/audit-dependencies.sh�[0m
 shell: /usr/bin/bash -e {0}
 env:
   CARGO_HOME: /home/runner/.cargo
   CARGO_INCREMENTAL: 0
   CARGO_TERM_COLOR: always
 ##[endgroup]
 Cargo.lock: FAILED (vulnerabilities found)
 fuzz/Cargo.lock: FAILED (vulnerabilities found)
 ##[error]Process completed with exit code 1.

chrono is unmaintained (RUSTSEC-2026-0543, no patched version) and failed the
bridge gate on every dependency bump. Route every timestamp through
src/rust/clock.rs (UTC now, RFC 3339 string, Unix seconds) on the time crate,
and serialise the diagnostics and integrity fields with time's rfc3339 serde
helpers. RFC 3339 strings now end in Z instead of +00:00.
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 30, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 30, 2026
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 30, 2026 02:28
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

3 participants