Read a shrink against the item's own path, so a moved directory starts its size history again (hq issue 368)
A reading now keeps the path it was measured at, and the peak is read only from readings at the item's path now. Before, an agent's home that moved to its own account was compared with the operator's home it left, and data-shrank was raised for data that was never lost. Existing readings take their item's path now, so a shrink that is real stays raised.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
-- A reading says the path it was measured at (novox/hq issue 368).
|
||||
--
|
||||
-- A shrink is read against the largest reading of the last seven days. Readings were kept by machine,
|
||||
-- module and item only, so when an item's path moved — on 2026-10-10 an agent's home moved from the
|
||||
-- operator's own home to the agent account's (ADR 0266) — the new, fresh directory was read against
|
||||
-- the old one's size, and `data-shrank` was raised for data that was never lost. A reading now keeps
|
||||
-- its path, and the peak is read only from readings at the item's path now: a moved item starts its
|
||||
-- size history again, and moving back to a path reads it against what that path held.
|
||||
--
|
||||
-- **Every reading kept so far is taken to be at its item's path now.** Where it was really measured
|
||||
-- is not on record; taking the path now keeps every item's history, so a shrink that is real stays
|
||||
-- raised. An item whose path moved before this migration stays compared with its old directory until
|
||||
-- those readings leave the seven-day window. Readings of an item no longer kept keep no path, and are
|
||||
-- read for nothing.
|
||||
--
|
||||
-- Numbered 0092, past 0091, the highest on main or any open branch when this was written.
|
||||
alter table data_reading add column path text;
|
||||
|
||||
update data_reading r set path = d.path
|
||||
from data_item d
|
||||
where d.machine = r.machine and d.module = r.module and d.item = r.item;
|
||||
Reference in New Issue
Block a user