hyperhive/hive-sh4re/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 1e67f56249 hive-sh4re: one saturating_age for every loose-end producer
`age_seconds` is documented on the LooseEnd enum as saturating to zero on
any clock anomaly, but the derivation was in three places: hive-c0re had a
named `saturating_age` helper with tests, and the in-agent socket server
hand-rolled the same two lines twice, untested.

Move the helper to hive-sh4re::inbox, beside the enum whose contract it
implements and inside the one crate both producers already depend on. Its
three tests move with it (not dropped) and gain two arms: the whole-i64
range, where the saturating_sub is what stops the subtraction overflowing,
and a far-past control so those zeros are the clamp firing rather than the
function bottoming out on large inputs.

The two clamps are not redundant, which is what `to_loose_end`'s doc got
wrong: it credited "saturating" for the zero, but saturating_sub bottoms
out at i64::MIN, still negative. The try_from is what yields 0.

Also cover the two projections themselves, which is the part the shared
helper cannot: that a reminder ages from created_at rather than due_at,
and a todo from updated_at, with a future timestamp reading 0 through
both and a past-timestamp control on each.
2026-09-02 14:20:25 +02:00
..
approvals.rs docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
assets.rs hive-sh4re: drop the nix explanation from the panic message too 2026-08-30 04:19:11 +02:00
bash_task.rs hive-sh4re: split bash-task schema into its own topic module 2026-08-10 22:12:38 +02:00
container.rs feat(#3139): tell a container that gave up from one stopped on purpose 2026-08-10 23:49:33 +02:00
inbox.rs hive-sh4re: one saturating_age for every loose-end producer 2026-09-02 14:20:25 +02:00
journal.rs hive-sh4re: split inbox, container, journal, and schedule wire shapes into their own modules 2026-08-10 23:26:15 +02:00
lib.rs hive-sh4re: split inbox, container, journal, and schedule wire shapes into their own modules 2026-08-10 23:26:15 +02:00
manager.rs docs: repoint eighteen pointers whose section no longer exists 2026-09-02 09:00:23 +02:00
paths.rs move hive-sh4re's harness_dir() into hive-agent-sock, drop the dev-fallback derivation 2026-08-09 19:54:13 +02:00
permissions.rs docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
schedule.rs hive-sh4re: split inbox, container, journal, and schedule wire shapes into their own modules 2026-08-10 23:26:15 +02:00
wire_time.rs hive-sh4re: delete now_unix(), the migration's last call sites are gone 2026-08-02 02:12:19 +02:00