Editing a policy must re-derive the verdicts it invalidates #246

Closed
opened 2026-08-25 11:19:12 +01:00 by naps62-yolo · 0 comments
Owner

#241 made the three operator actions that change a title's effective policy
re-derive stored verdicts: editing overrides, moving a title to a root with a
different policy, and pointing a root at a different policy. DESIGN.md §5.1 now
states that contract.

PUT /api/policies/{id} has the same gap one level up, and #241 flagged it
rather than widening its own scope. Editing a policy's contents — its language
rule, its size bands, its HDR handling — changes the effective policy of every
title under every root that points at it, and re-derives nothing. The stored
verdicts §9.3's deck and the daemon's manual-grab gate read are then computed
under a rule that no longer exists.

This is the largest blast radius of the four: a root repoint moves one library,
a policy edit moves every library that shares the policy.

crates/arr-api/src/reclassify.rs already has the pieces — movie, series
and the root walker #241 added, with the skip rules in one place and rows
whose verdict does not move left unwritten. This needs the same walk driven from
a policy id rather than a root id.

Scope: editing a policy re-derives the verdicts of every title under every root
that points at it, and §5.1's new paragraph is extended to name this fourth
action alongside the three it already lists — it currently says "the three
operator actions", which will be wrong once this lands.

Worth confirming while implementing: whether inline is still the right shape at
this size. #241 argued inline is affordable because re-evaluation is pure and
in-memory and unchanged rows are not rewritten. That argument holds for one
library; check it still holds when a policy is shared by several.

#241 made the three operator actions that change a title's *effective* policy re-derive stored verdicts: editing overrides, moving a title to a root with a different policy, and pointing a root at a different policy. DESIGN.md §5.1 now states that contract. `PUT /api/policies/{id}` has the same gap one level up, and #241 flagged it rather than widening its own scope. Editing a policy's *contents* — its language rule, its size bands, its HDR handling — changes the effective policy of every title under every root that points at it, and re-derives nothing. The stored verdicts §9.3's deck and the daemon's manual-grab gate read are then computed under a rule that no longer exists. This is the largest blast radius of the four: a root repoint moves one library, a policy edit moves every library that shares the policy. `crates/arr-api/src/reclassify.rs` already has the pieces — `movie`, `series` and the `root` walker #241 added, with the skip rules in one place and rows whose verdict does not move left unwritten. This needs the same walk driven from a policy id rather than a root id. Scope: editing a policy re-derives the verdicts of every title under every root that points at it, and §5.1's new paragraph is extended to name this fourth action alongside the three it already lists — it currently says "the three operator actions", which will be wrong once this lands. Worth confirming while implementing: whether inline is still the right shape at this size. #241 argued inline is affordable because re-evaluation is pure and in-memory and unchanged rows are not rewritten. That argument holds for one library; check it still holds when a policy is shared by several.
naps62-yolo added this to the Feedback pass 2 milestone 2026-08-25 11:19:12 +01:00
naps62-yolo added the area/apidifficulty/moderatetype/bug labels 2026-08-25 11:19:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/arr#246