Repository navigation
sdk%build: clear RUSTSEC-2026-0543 and RUSTSEC-2026-0544 - #136
Conversation
|
Note This pull request has no conflicts! 🎊 🎉 🎊 |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
|
✅ Final review complete — no blockers (commit d334234) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The dependency cleanup is correctly scoped, and the available CI evidence shows all build, test, lint, and coverage checks succeeded for the exact head. Two in-scope suggestions remain: the new timestamp conversion clamps pre-UNIX-epoch times to the epoch, and the rewritten runtime formatter lacks focused tests for its output branches.
🟡 2 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.2-sol(effort low) — This is a small, contained dependency-removal change that replaces timestamp and duration formatting with straightforward standard-library logic and includes focused date-boundary tests. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 100% left, weekly 93% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— rust-quality (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `meta/dev/src/bin/bsdk_util/logging.rs`:
- [SUGGESTION] meta/dev/src/bin/bsdk_util/logging.rs:62: Preserve timestamps before the UNIX epoch
`map_or(0, |d| d.as_secs())` converts every `SystemTime` before `UNIX_EPOCH` into `1970-01-01T00:00:00Z`. `SystemTime` supports pre-epoch values, and the previous `Utc::now().format(...)` implementation would preserve them as dates in 1969 or earlier. Because this replacement claims to preserve the timestamp output format, handle the `SystemTimeError` duration as a negative offset with a date conversion that supports negative seconds, or explicitly document and test the intentional clamping behavior.
- [SUGGESTION] meta/dev/src/bin/bsdk_util/logging.rs:104-119: Add focused tests for the rewritten runtime formatter
`format_runtime` was rewritten from `chrono::TimeDelta` to hand-rolled duration arithmetic, but the new tests cover only `utc_timestamp`. The formatter has observable branches for subsecond values, whole seconds, minutes, hours, and days, including the preserved formatting quirk that `60` seconds renders as `1m 0s`. Add a small table test to lock in the claimed output parity independently of the implementation.
|
|
||
| /// Format `time` as `YYYY-MM-DDTHH:MM:SSZ` in UTC. | ||
| fn utc_timestamp(time: SystemTime) -> String { | ||
| let secs = time.duration_since(UNIX_EPOCH).map_or(0, |d| d.as_secs()); |
There was a problem hiding this comment.
⚖️ Disputed (left to the maintainers; not blocking) at
d3342347; see the replies below.
🟡 Suggestion: Preserve timestamps before the UNIX epoch
map_or(0, |d| d.as_secs()) converts every SystemTime before UNIX_EPOCH into 1970-01-01T00:00:00Z. SystemTime supports pre-epoch values, and the previous Utc::now().format(...) implementation would preserve them as dates in 1969 or earlier. Because this replacement claims to preserve the timestamp output format, handle the SystemTimeError duration as a negative offset with a date conversion that supports negative seconds, or explicitly document and test the intentional clamping behavior.
source: gpt-6.2-sol (phase2-reviewer: rust-quality)
There was a problem hiding this comment.
Not changing this. The tool only timestamps its own log lines with the current time, so a time before 1970 does not reach utc_timestamp.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
There was a problem hiding this comment.
Still applies (re-reviewed at dedf4e60): The private call path does not make this impossible: SystemTime::now() may legally return an instant before UNIX_EPOCH, so this replacement still clamps that value instead of preserving the prior formatter behavior. I am keeping this as a suggestion despite the normal current-time path.
There was a problem hiding this comment.
Disputed (re-reviewed at d3342347): We still disagree on this one, and my answer is above, so I'm leaving the call to the maintainers. It no longer blocks this pull request, and I won't raise it again unless a later change brings the problem back.
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
|
|
||
| #[test] | ||
| fn utc_timestamp_crosses_leap_days_and_centuries() { | ||
| for (secs, expected) in [ | ||
| (0, "1970-01-01T00:00:00Z"), | ||
| (951_782_399, "2000-02-28T23:59:59Z"), | ||
| (951_782_400, "2000-02-29T00:00:00Z"), | ||
| (4_107_542_400, "2100-03-01T00:00:00Z"), | ||
| ] { | ||
| assert_eq!(utc_timestamp(UNIX_EPOCH + Duration::from_secs(secs)), expected); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
✅ Resolved at
dedf4e60; see the replies below.
🟡 Suggestion: Add focused tests for the rewritten runtime formatter
format_runtime was rewritten from chrono::TimeDelta to hand-rolled duration arithmetic, but the new tests cover only utc_timestamp. The formatter has observable branches for subsecond values, whole seconds, minutes, hours, and days, including the preserved formatting quirk that 60 seconds renders as 1m 0s. Add a small table test to lock in the claimed output parity independently of the implementation.
| #[cfg(test)] | |
| mod tests { | |
| use super::*; | |
| #[test] | |
| fn utc_timestamp_crosses_leap_days_and_centuries() { | |
| for (secs, expected) in [ | |
| (0, "1970-01-01T00:00:00Z"), | |
| (951_782_399, "2000-02-28T23:59:59Z"), | |
| (951_782_400, "2000-02-29T00:00:00Z"), | |
| (4_107_542_400, "2100-03-01T00:00:00Z"), | |
| ] { | |
| assert_eq!(utc_timestamp(UNIX_EPOCH + Duration::from_secs(secs)), expected); | |
| } | |
| } | |
| } | |
| #[test] | |
| fn format_runtime_matches_previous_output() { | |
| for (millis, expected) in [ | |
| (0, "0.000s"), | |
| (1_500, "1.500s"), | |
| (60_000, "1m 0s"), | |
| (3_725_000, "1h 2m 5s"), | |
| (93_545_000, "1d 1h 59m 5s"), | |
| ] { | |
| assert_eq!(format_runtime(Duration::from_millis(millis)), expected); | |
| } | |
| } |
source: glm-5.3-flash (phase1-reviewer: general, rust-quality)
There was a problem hiding this comment.
Added in dedf4e6 as format_runtime_drops_zero_units, with two more rows (59.999s and 1d 5s, a day with zero hours and minutes). I ran the same table against the chrono version on develop and it passed there too, so the expected strings are that version's output.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
There was a problem hiding this comment.
Resolved (re-reviewed at dedf4e60): The added format_runtime_drops_zero_units table now covers the formatter's observable branches, including subsecond values, the 60-second quirk, multi-unit durations, and omitted zero units.
6b7125f to
dedf4e6
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The dependency remediation is correctly implemented: chrono is removed from bsdk-util, libz-sys is updated, and the generated lock metadata is synchronized. The supplied build, lint, MSRV, platform, and coverage checks succeed; only the review check remains in progress.
🟡 1 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Still open from earlier rounds (1)
- 🟡 Suggestion: Preserve timestamps before the UNIX epoch —
meta/dev/src/bin/bsdk_util/logging.rs:62(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The change is contained but replaces chrono with custom UTC date conversion and runtime formatting logic, requiring validation of behavior across calendar boundaries and dependency-lock updates. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `meta/dev/src/bin/bsdk_util/logging.rs`:
- [SUGGESTION] meta/dev/src/bin/bsdk_util/logging.rs:62: Preserve timestamps before the UNIX epoch
(carried; thread: https://github.com/dashpay/base-sdk/pull/136#discussion_r4608648405)
|
Ready for steward review at dedf4e6 🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta. |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Steward review at dedf4e6: one small push, then I merge. It is a build change in the unpublished dash-dev crate and the lockfiles. It adds no dependency and changes no library code, so I can approve it.
Verified, by me and by an independent review:
Cargo.lockchanges onlylibz-sys1.1.31 to 1.1.33 and dropschronowith the 17 crates only it pulled in.MODULE.bazel.lockchanges only thelibz-sysrepository and the two recorded input hashes.utc_timestampmatchesgmtimefor every day from 1970 to 9999, and the newformat_runtimegives the same strings as theTimeDeltaversion for every runtime the tool can reach.- Both advisories are error-level under
.cargo/deny.tomlas it stands, so droppingchronois the fix that leaves that file alone. - Fork
just comband CI pass on dedf4e6.
Changes (fold them into the one commit and force-push):
rstestfor the two tables (logging.rs:108,logging.rs:120).AGENTS.mdsays parametrized tests userstest, and every table inpkgs/is#[rstest]with#[case]rows (for examplepkgs/num/src/compact.rs:182). Addrstest = { workspace = true }under[dev-dependencies]inmeta/dev/Cargo.toml, write each row as a case, and updateMODULE.bazel.lock(bazel mod deps --lockfile_mode=update), since it records that file's hash.- Plain names in
utc_timestamp(logging.rs:66-75).z,doe,yoe,doyandmpare the algorithm's usual abbreviations, but nothing in the file expands them ("Clever code golf is hard to read", #87). Name them, for exampleday_of_era,year_of_era,day_of_year,month_index. Keep the era comment. - Description only: tick "I have commented my code", since the era comment and the rustdoc are that.
Considered and not asked for
- Timestamps before 1970 (thepastaclaw,
logging.rs:62). I agree with the decline: the only caller passesSystemTime::now()for a debug log line, and extra hardening of dev tooling has been declined before. For the same reason the four-digit year format is not a concern. - Replacing
chronowith another date crate. That would add a dependency to clear an advisory that the standard library already avoids.
After the push: post the ready line. I will check the range from dedf4e6 myself, with no further review round if it holds only these changes.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
Bump `libz-sys` to 1.1.33, which fixes a heap buffer overflow, and drop the unmaintained `chrono` from `bsdk-util`, whose two uses need `std`.
dedf4e6 to
d334234
Compare
|
Ready for steward review at d334234 Fork
1: dedf4e60 ! 1: d3342347 sdk%build: clear RUSTSEC-2026-0543 and RUSTSEC-2026-0544
@@ Cargo.lock: dependencies = [
"ciborium",
"clap",
"dash-num",
+@@ Cargo.lock: dependencies = [
+ "json5",
+ "proc-macro2",
+ "rayon",
++ "rstest",
+ "serde",
+ "serde_json",
+ "syn 2.0.119",
@@ Cargo.lock: dependencies = [
"typenum",
]
@@ meta/dev/Cargo.toml: dash-types = { version = "0.3.0-beta", path = "../../pkgs/t
ciborium = { version = "0.2", optional = true }
clap = { version = "4", default-features = false, features = [
"derive",
+@@ meta/dev/Cargo.toml: sysinfo = { version = "0.33", default-features = false, features = [
+ "system",
+ ], optional = true }
+
++[dev-dependencies]
++rstest = { workspace = true }
++
+ [lints]
+ workspace = true
## meta/dev/src/bin/bsdk_util/logging.rs ##
@@
@@ meta/dev/src/bin/bsdk_util/logging.rs: pub fn print_banner(app: &Application) {
+ let (days, rem) = (secs / 86_400, secs % 86_400);
+ // Days since 1970-01-01 to a proleptic Gregorian date, in 400-year eras
+ // starting on 0000-03-01.
-+ let z = days + 719_468;
-+ let (era, doe) = (z / 146_097, z % 146_097);
-+ let yoe = (doe - doe / 1_460 + doe / 36_524 - doe / 146_096) / 365;
-+ let doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
-+ let mp = (5 * doy + 2) / 153;
-+ let day = doy - (153 * mp + 2) / 5 + 1;
-+ let month = if mp < 10 { mp + 3 } else { mp - 9 };
-+ let year = era * 400 + yoe + u64::from(month <= 2);
++ let days_since_0000_03_01 = days + 719_468;
++ let era = days_since_0000_03_01 / 146_097;
++ let day_of_era = days_since_0000_03_01 % 146_097;
++ let year_of_era = (day_of_era - day_of_era / 1_460 + day_of_era / 36_524 - day_of_era / 146_096) / 365;
++ let day_of_year = day_of_era - (365 * year_of_era + year_of_era / 4 - year_of_era / 100);
++ let month_index = (5 * day_of_year + 2) / 153;
++ let day = day_of_year - (153 * month_index + 2) / 5 + 1;
++ let month = if month_index < 10 {
++ month_index + 3
++ } else {
++ month_index - 9
++ };
++ let year = era * 400 + year_of_era + u64::from(month <= 2);
+ let (hour, minute, second) = (rem / 3_600, rem / 60 % 60, rem % 60);
+ format!("{year:04}-{month:02}-{day:02}T{hour:02}:{minute:02}:{second:02}Z")
+}
@@ meta/dev/src/bin/bsdk_util/logging.rs: pub fn format_runtime(elapsed: std::time:
+mod tests {
+ use super::*;
+
-+ #[test]
-+ fn utc_timestamp_crosses_leap_days_and_centuries() {
-+ for (secs, expected) in [
-+ (0, "1970-01-01T00:00:00Z"),
-+ (951_782_399, "2000-02-28T23:59:59Z"),
-+ (951_782_400, "2000-02-29T00:00:00Z"),
-+ (4_107_542_400, "2100-03-01T00:00:00Z"),
-+ ] {
-+ assert_eq!(utc_timestamp(UNIX_EPOCH + Duration::from_secs(secs)), expected);
-+ }
++ use rstest::rstest;
++
++ #[rstest]
++ #[case::epoch(0, "1970-01-01T00:00:00Z")]
++ #[case::before_leap_day(951_782_399, "2000-02-28T23:59:59Z")]
++ #[case::leap_day(951_782_400, "2000-02-29T00:00:00Z")]
++ #[case::non_leap_century(4_107_542_400, "2100-03-01T00:00:00Z")]
++ fn utc_timestamp_crosses_leap_days_and_centuries(#[case] secs: u64, #[case] expected: &str) {
++ assert_eq!(utc_timestamp(UNIX_EPOCH + Duration::from_secs(secs)), expected);
+ }
+
-+ #[test]
-+ fn format_runtime_drops_zero_units() {
-+ for (millis, expected) in [
-+ (0, "0.000s"),
-+ (1_500, "1.500s"),
-+ (59_999, "59.999s"),
-+ (60_000, "1m 0s"),
-+ (3_725_000, "1h 2m 5s"),
-+ (86_405_000, "1d 5s"),
-+ (93_545_000, "1d 1h 59m 5s"),
-+ ] {
-+ assert_eq!(format_runtime(Duration::from_millis(millis)), expected);
-+ }
++ #[rstest]
++ #[case::zero(0, "0.000s")]
++ #[case::subsecond(1_500, "1.500s")]
++ #[case::under_a_minute(59_999, "59.999s")]
++ #[case::minute(60_000, "1m 0s")]
++ #[case::hours(3_725_000, "1h 2m 5s")]
++ #[case::day_without_hours(86_405_000, "1d 5s")]
++ #[case::every_unit(93_545_000, "1d 1h 59m 5s")]
++ fn format_runtime_drops_zero_units(#[case] millis: u64, #[case] expected: &str) {
++ assert_eq!(format_runtime(Duration::from_millis(millis)), expected);
+ }
+}
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The dependency remediation is correctly scoped: chrono is removed from the binary path, libz-sys is upgraded to the fixed version, and the replacement formatter has focused table coverage. CI reports successful builds, tests, and linting; one non-blocking timestamp behavior-preservation issue remains.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Disputed — left to maintainers (1)
- 🟡 Suggestion: Preserve timestamps before the UNIX epoch —
meta/dev/src/bin/bsdk_util/logging.rs:62(thread)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.2-sol(effort low) — This is a small, well-contained dependency cleanup and logging utility rewrite with straightforward date and duration formatting logic covered by focused tests, and it does not affect a critical surface. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 93% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— rust-quality (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Motivation
Two RustSec advisories published after
develop's last CI run now faillint_cargo's advisories check ondevelopat eda56fb, and so on every open pull request (for example the Lint job of run 44205570927):libz-sys1.1.31 has a heap buffer overflow, fixed in 1.1.33. It comes in throughgit2, whichbuiltuses indash-dev's build script.chronois unmaintained, and no release fixes that. Onlydash-dev'sbsdk-utilbinary uses it, for the log timestamp and the runtime format.Additional Information
One commit, so that each commit passes the advisories check:
libz-sysmoves to 1.1.33 withcargo update -p libz-sys, thenbazel mod deps --lockfile_mode=update.bsdk-utilcomputes its log timestamp fromSystemTimewith the days-to-civil-date conversion, and its runtime fromDuration. The output format is unchanged. Removingchronoalso drops 17 other crates that only it pulled in fromCargo.lock. Nodeny.tomlchange.Breaking Changes
None.
dash-devis not published.How Has This Been Tested?
Checklist
comments and concerns without said assistance. I assume authorship of the code submitted.
Agent disclosure
The code, commit messages and this description were written with Claude Code using Claude Opus 5.5 at
higheffort, running autonomously as an agent on behalf of the author.🤖 Generated with Claude Code