You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: close four label-enforcement bypasses (review round 1) (#2112)
* fix(registry-moderation): enforce image-content automated-block labels
hateful-imagery, explicit-imagery, and graphic-violence are declared as
automated-block labels in the labeler policy fixture but were absent from
AUTOMATED_BLOCKS, so the evaluator and RELEASE_BLOCK_VALUES ignored them --
a policy-blocked release stayed installable. Add the three, plus
content-warning to WARNINGS (the same un-synced image-label batch), export
both sets, and add a labeler-side parity test that fails whenever the
fixture and package classification drift.
* fix(registry-client): send an explicitly empty accept-labelers header
DiscoveryClient treated acceptLabelers: "" as absent (`|| onResponseMeta`
and `if (acceptLabelers)`), so a config meaning "accept no labelers" was
dropped and the aggregator applied its trusted defaults. Switch to
`!== undefined` checks so an empty string still goes on the wire while an
omitted option still sends no header.
* fix(aggregator): honor reviewer override pair in release enforcement SQL
buildReleaseEnforcementSql excluded a release whenever any live automated
block row existed, but the hydrated evaluator suppresses a source's
automated blocks when that same source has an exact-CID assessment-passed +
assessment-overridden pair (spec §10). A post-override re-assessment that
re-issues a live automated block was therefore dropped from latest-selection
even though the evaluator treats it as eligible. Split the release-URI block
branch so automated blocks carry the same-source exact-CID override
exception while the manual security-yanked / !takedown blocks and the
package/publisher cascade keep firing unconditionally.
* fix(aggregator): keep enforcement labels when capping view label arrays
capLabels sliced a view's labels at LABELS_MAX_LENGTH in hydration order, so
a subject carrying more than 64 labels could lose its only hard block; a
client evaluating the truncated view would then treat the release as
installable. Order labels by enforcement priority (hard blocks, then
assessment states, then informational) before slicing so blocks survive, and
log an error in the pathological case where blocks alone exceed the cap
(the kept slice is still all blocks, so the release stays blocked).
* fix(registry-moderation): add image labels to ModerationLabelValue union
The exported nominal union drifted from the runtime sets when the
image-content labels were added: hateful-imagery, explicit-imagery,
graphic-violence, and content-warning are classified at runtime but were
missing from ModerationLabelValue, so the type contract understated the
values the labeler can issue. Add all four.
* fix(aggregator): validate release/package SQL aliases
buildReleaseEnforcementSql interpolates the caller-supplied
aliases.release / aliases.package directly into raw SQL. Callers pass
compile-time constants today, but the builder is exported, so validate both
aliases against an identifier-plus-trailing-dot shape and throw a TypeError
on mismatch before they reach the query text.
* fix(aggregator): validate the package enforcement builder's SQL alias
buildPackageEnforcementSql interpolates its caller-supplied alias into raw
SQL the same way the release builder does, but the release-builder guard
added earlier did not cover it. Apply the same assertAlias check right after
the alias default so the exported package primitive rejects a malformed
alias too.
Sends an explicitly empty `atproto-accept-labelers` header when `DiscoveryClient` is configured with `acceptLabelers: ""`, so "accept no labelers" is honored instead of being dropped and letting the aggregator apply its trusted defaults. Omitting the option entirely still sends no header.
Blocks releases labeled `hateful-imagery`, `explicit-imagery`, or `graphic-violence` -- these automated-block labels were issuable by the labeler but silently ignored by release evaluation and enforcement, leaving a policy-blocked release installable. Also recognizes the `content-warning` label as a non-blocking warning, and exposes the `AUTOMATED_BLOCKS` and `WARNINGS` label-value sets for consumers that classify labels directly.
0 commit comments