Skip to content

JSON → YAML, Time calendar hints and durations, cron with seconds - #33

Merged
s12v merged 4 commits into
masterfrom
wave3
Sep 13, 2026
Merged

s12v merged 4 commits into
masterfrom
wave3

Conversation

@s12v

@s12v s12v commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Wave 3, one commit per step:

  • JSON → YAML: a YAML row on the JSON tab — block style, 2-space indent, strings quoted only where a YAML reader would take them for something else (yes, 007, 2024-01-01, a: b, leading/trailing spaces…), multi-line strings as | literal blocks; follows the sort-keys option. Output verified to round-trip through PyYAML.
  • Time: DATETIME rows get a calendar hint — Wednesday · 2019-W09 · day 58 of 365, plus the zone offset on the local row. A Duration row: a bare number reads as seconds (90061 → 1d 1h 1m 1s, with the milliseconds reading in the hint) and the other way 1h 30m, 01:30:00, PT1H30M, 2 days, 3 hours → seconds.
  • Cron: six-field expressions with a leading seconds field (Quartz, Spring). Description (At 04:05:30, At every 10th second past every 5th minute), next runs searched per second and shown with seconds, builder falls to "custom expression".
  • Cipher fix, found by a flaky test: CryptoJS's PKCS#7 unpadding trusts the last byte, so decrypting a legacy MD5-KDF payload through the PBKDF2 path (or with a wrong password) produced a few bytes of noise or an empty string about once in 120 tries instead of falling through. Padding and UTF-8 are now verified before a decrypt counts; a fixed "unlucky" vector pins it.

Tests: 241 (was 218).

A YAML row on the JSON tab: block style, 2-space indent, strings quoted
only where a YAML reader would take them for something else (reserved
words, numbers, dates, indicator characters, leading/trailing spaces),
multi-line strings as | literal blocks. Follows the sort-keys option.
Emitter output verified to round-trip through PyYAML.
CryptoJS's unpadding trusts the last byte, so a wrong key (the PBKDF2
reading of a legacy MD5-KDF payload, or a wrong password) unpadded
cleanly about once in 120 tries and produced a few bytes of noise or an
empty string instead of null — the legacy fallback was then skipped.
Padding and UTF-8 are now checked before a result is accepted; the
round-trip test that failed intermittently gets a fixed vector.
DATETIME rows get a calendar hint ("Wednesday · 2019-W09 · day 58 of
365", plus the zone offset on the local row). A Duration row reads a
bare number as seconds (milliseconds from 13 digits, like the rest of
the tab) and writes it out as "1d 1h 1m 1s"; the other way, "1h 30m",
"01:30:00", "PT1H30M" or "2 days, 3 hours" give seconds.
A leading seconds field (Quartz, Spring and friends) is accepted next to
the classic five: the description reads "At 04:05:30" / "At every 10th
second past every 5th minute", next runs are searched per second and
shown with seconds, and the builder switches to custom expression, since
it writes five fields. cron.parse() now always returns six fields; a
five-field expression gets an implicit second 0.
@s12v
s12v merged commit 1bbc8f9 into master Sep 13, 2026
1 check passed
@s12v
s12v deleted the wave3 branch September 13, 2026 20:51
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.

1 participant