feat(0.27.1): stance guard — ideologically antagonistic asks never share a cluster #11

Merged
navigator merged 1 commit from feat/stance-guard into main 2026-07-10 00:21:39 -03:00
Owner

Complements #9 (real embeddings) with the layer embeddings cannot provide: policy DIRECTION. Motivating analysis: proposals that morally fight for the same goal (mais saúde) but are ideologically antagonistic in the means (vender o SUS vs fortalecer o SUS; privatizar vs proibir privatização) measure closer than true paraphrases — merging them poisons the consensus signal and the SLA.

  • Auditable pt-BR axis lexicon + negation flip (stance.rs), direction_signature per proposal (migration 0517), merge veto in ingest with audit log.
  • 10 CI unit tests + end-to-end integration test (no model needed) + layered calibration gates with the real model.
  • Updates issue #10 context (the V2 NLI upgrade remains the long-term path; this guard is the precision-first floor).
Complements #9 (real embeddings) with the layer embeddings cannot provide: policy DIRECTION. Motivating analysis: proposals that morally fight for the same goal (mais saúde) but are ideologically antagonistic in the means (vender o SUS vs fortalecer o SUS; privatizar vs proibir privatização) measure closer than true paraphrases — merging them poisons the consensus signal and the SLA. - Auditable pt-BR axis lexicon + negation flip (stance.rs), direction_signature per proposal (migration 0517), merge veto in ingest with audit log. - 10 CI unit tests + end-to-end integration test (no model needed) + layered calibration gates with the real model. - Updates issue #10 context (the V2 NLI upgrade remains the long-term path; this guard is the precision-first floor).
feat(0.27.1-stance-guard): direction veto — antagonistic asks never share a cluster
All checks were successful
ci / fmt (pull_request) Successful in 10s
ci / boundaries (pull_request) Successful in 17s
ci / clippy (pull_request) Successful in 3m3s
ci / test (pull_request) Successful in 5m55s
security / deny (pull_request) Successful in 7s
security / audit (pull_request) Successful in 8s
security / secrets (pull_request) Successful in 7s
ci / coverage (pull_request) Successful in 4m23s
ci / fmt (push) Successful in 7s
ci / boundaries (push) Successful in 16s
ci / clippy (push) Successful in 4m24s
ci / test (push) Successful in 7m12s
security / deny (push) Successful in 10s
security / audit (push) Successful in 10s
security / secrets (push) Successful in 8s
ci / coverage (push) Successful in 4m19s
7af40cc853
Measured on pt-BR civic pairs (calibration tests): "privatizar os postos
do SUS" vs "proibir a privatização dos postos do SUS" sit at cosine
0.015 — BELOW every legitimate paraphrase (0.072-0.089) — and opposite
budget directions at 0.046. Sentence embedders encode topic, not policy
direction; no distance threshold can separate stance, and a merged
antagonistic cluster would fire an SLA for a self-contradictory demand.

- stance.rs: precision-first auditable lexicon of policy axes (scale,
  public/private, permit/forbid, open/close, staff) + negators that flip
  the axis they precede ("proibir a privatização" asserts public+).
  Pure, deterministic, 10 unit tests that run in CI without any model.
- Migration 0517: consensus_embedding.direction_signature text[] —
  crate-owned derived data, written at ingest.
- ingest: an antagonistic signature against any sampled cluster member
  vetoes the merge and forms a new cluster (audit-logged). False-veto is
  the cheap error: a split keeps both demands alive; a wrong merge
  corrupts both.
- Layered defense asserted end-to-end: the motivating pair ("vender o
  SUS" vs "valorizar radiologistas do SUS", 0.107) is stopped by the
  threshold; negation and budget pairs are stopped by the veto; CI
  integration test proves "aumentar X" vs "não aumentar X" form
  separate clusters.
- sqlx offline cache regenerated (workspace .sqlx).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
brasil/democracia-social!11
No description provided.