Skip to content

sanitization: close gate gaps (pytest CI, intl phone, semantic enforcement)#1

Merged
juniperbevensee merged 2 commits into
mainfrom
dev/juniperbevensee/sanitization-gaps
Jun 17, 2026
Merged

sanitization: close gate gaps (pytest CI, intl phone, semantic enforcement)#1
juniperbevensee merged 2 commits into
mainfrom
dev/juniperbevensee/sanitization-gaps

Conversation

@juniperbevensee

Copy link
Copy Markdown
Collaborator

Fixes the commons-gate gaps surfaced while publishing the Matilde package (built from this template):

  • CI never enforced — the self-test step ran pytest but only installed anthropic ("No module named pytest" failed every run). Install pytest.
  • Semantic layer now required in CI (--require-semantic) — a content-bearing change with no ANTHROPIC_API_KEY fails loudly instead of silently passing deterministic-only. Repos must set the Actions secret (onboarding already lists this; CONTRIBUTING updated).
  • New intl-phone detector (E.164) — us-phone only matched North-American formatting.
  • Semantic config gains a messaging/user-identifier flag example (Signal/Telegram UUID, contact phone) — the right layer for opaque identifiers a regex can't disambiguate.

TDD: test_detects_international_phone red→green; 14/14 pass. Smoke: gate hard-fails on +442079460958.

🤖 Generated with Claude Code

juniperbevensee and others added 2 commits June 17, 2026 14:16
…forcement)

The commons gate had the same gaps found in the Matilde package (which was
built from this template):

- CI bug: the self-test step ran `python -m pytest` but only `anthropic` was
  installed → "No module named pytest" failed the gate on every PR, so it never
  actually enforced. Install pytest.
- CI now passes `--require-semantic`: the LLM layer is a hard requirement, not
  advisory — a content-bearing change with no ANTHROPIC_API_KEY fails loudly
  instead of silently passing deterministic-only. (Repos must set the secret;
  onboarding already lists this step. Documented in CONTRIBUTING.)
- New deterministic `intl-phone` detector (E.164 +<7–15 digits>): the us-phone
  pattern only caught North-American formatting, missing international contacts.
- Semantic config: added a flag example for messaging/user identifiers (Signal
  /Telegram UUID, contact phone, allowlisted user ID) — these belong in
  deployment config/secrets, never in the package. The semantic layer is the
  right home (it distinguishes a user UUID from a dataset version UUID; a
  fail-closed regex can't).

TDD: new test_detects_international_phone (red→green); 14/14 pass. Smoke:
gate hard-fails on +442079460958.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…efault

Shipping a scaffold with red-by-default CI (every clone starts failing until an
admin wires a secret) is bad ergonomics. The semantic layer still runs whenever
ANTHROPIC_API_KEY is present; --require-semantic is documented as the flip-the-
switch hardening to enable once the key is wired (workflow comment + CONTRIBUTING).

Surfaced finding: the template repo has no ANTHROPIC_API_KEY secret, so its
semantic layer has never run in CI — needs wiring to enable enforcement.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@juniperbevensee
juniperbevensee merged commit 703a721 into main Jun 17, 2026
1 check passed
@juniperbevensee
juniperbevensee deleted the dev/juniperbevensee/sanitization-gaps branch June 17, 2026 02:27
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.

1 participant