Skip to content

Fail closed when withheld country list is missing or TES country-codes Err - #148

Open
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/vf-withheld-country-fail-closed-c335
Open

Fail closed when withheld country list is missing or TES country-codes Err#148
Pitchfork-and-Torch wants to merge 1 commit into
xai-org:mainfrom
Pitchfork-and-Torch:cursor/vf-withheld-country-fail-closed-c335

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Bug

Country-scoped legal/local takedown allowed the post when the viewer country was missing. TES get_takedown_country_codes (withheldInCountries) was never fetched, so a country list that lived only on that RPC never reached the Drop rules. An empty reason country or a Failed country-codes read assembled as “not withheld”.

This is not #113 (account vs request country). This is not #110 (safety-label applicable_countries). This is not #134 (TES flag RPC Failed dropped from the hydrated set).

Fix

Honor TES withheld-in-countries on DropLegalTakendownPostRule. Treat an empty reason country as worldwide (xx). If the withhold list is country-scoped and the viewer country is unknown, Drop. A Failed get_takedown_country_codes read assembles as xx so the legal rule fail-closes. Genuine NotFound / empty list stays un-withheld.

Author self-view is unchanged.

Proof

  • Entry: TES get_takedown_country_codes / takedown_reasons.country_code
  • Sink: DropLegalTakendownPostRule / DropLocalLawsTakendownPostRule
  • Break: country-codes RPC unused; unknown viewer + DE withhold Allowed; Failed list → empty → Allow
  • Viewer effect: DE-withheld post (or a Failed country-list read) still serves on Home / For You
  • Twin: media allow-list already drops unknown country (xx); legal withhold did not

Tests

  • legal_takedown_country_scoped_drops_without_viewer_country (fails on unmodified main)
  • legal_takedown_empty_country_is_worldwide
  • withheld_in_countries_drops_matching_viewer
  • withheld_in_countries_allows_other_country
  • assemble_fail_closes_withheld_in_countries_err_as_worldwide
  • Standalone decision-table harness: 15 assertions passed

cargo test cannot run. Public dump has no visibility-filtering manifest.

Fork PR: none

…s Err

Country-scoped legal/local takedown allowed when the viewer country was
unknown, and TES withheldInCountries was never hydrated. Empty reason
countries and a Failed get_takedown_country_codes read now withhold.

Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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.

2 participants