Skip to content

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

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

hyperpolymath wants to merge 3 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 →

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 46 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: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 319bbbf2-816d-4043-8c88-48ed1f1c1d27
Commits

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

Files ignored due to path filters: 2

  • Cargo.lock is excluded by !**/*.lock
  • fuzz/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 17

  • Cargo.toml
  • src/rust/agent/memory.rs
  • src/rust/cli/corpus.rs
  • src/rust/clock.rs
  • src/rust/diagnostics/corpus_monitor.rs
  • src/rust/diagnostics/gnn_training.rs
  • src/rust/diagnostics/health.rs
  • src/rust/dispatch.rs
  • src/rust/integrity/solver_integrity.rs
  • src/rust/learning/daemon.rs
  • src/rust/lib.rs
  • src/rust/verification/proof.rs
  • src/rust/verisim_bridge.rs
  • tests/corpus_health_integration_test.rs
  • tests/full_health_system_test.rs
  • tests/live_prover_suite.rs
  • tests/s4_loop_closure.rs

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Improvements
    • Standardised timestamp handling across proof records, health metrics and diagnostics. Timestamps continue to use RFC 3339 formatting, with existing storage and behaviour preserved.

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

Merge Risk: Minimal · previous review 494d9 · 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: chrono is replaced by time, and the timestamp calls route through one clock module. The changeset matches this, with the new src/rust/clock.rs, Cargo.toml swap, and ca…
Description check Passed The description covers the summary of the change and its reason (RUSTSEC-2026-0543, chrono unmaintained), a list of key changes, design choices, and the local checks run. It does not follow the reposi…
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: chrono is replaced by time, and the timestamp calls route through one clock module. The changeset matches this, with the new src/rust/clock.rs, Cargo.toml swap, and call-site updates across the source and test files. The title is 71 characters, which is within a reasonable length, and it uses the conventional refactor: prefix.

Full details: Description check

Explanation

The description covers the summary of the change and its reason (RUSTSEC-2026-0543, chrono unmaintained), a list of key changes, design choices, and the local checks run. It does not follow the repository template. It has no explicit Testing section (test results appear under Choices recorded and the checks paragraph), no Screenshots section, and no ticked RSR Quality Checklist. It also does not state the issue link with 'Closes #N'. The Cargo.lock regeneration and the wire-format change to Z are well described.

Resolution

Optional improvements: add the template headings (Summary, Changes, RSR Quality Checklist, Testing, Screenshots). Link the related issue with 'Closes #N' if one exists. Tick the checklist items that apply, such as the SPDX headers on the new src/rust/clock.rs file, which the description does not mention. Move the test results into the Testing section. Note the bridge-gate and deed or CHANGELOG items as not applicable, if they are.

  • 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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T14:47:11.647445Z
We couldn’t complete this review. Comment @codex review to try again.
494d978 Draft marked ready
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.
@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