sanitization: close gate gaps (pytest CI, intl phone, semantic enforcement)#1
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the commons-gate gaps surfaced while publishing the Matilde package (built from this template):
pytestbut only installedanthropic("No module named pytest" failed every run). Install pytest.--require-semantic) — a content-bearing change with noANTHROPIC_API_KEYfails loudly instead of silently passing deterministic-only. Repos must set the Actions secret (onboarding already lists this; CONTRIBUTING updated).intl-phonedetector (E.164) —us-phoneonly matched North-American formatting.TDD:
test_detects_international_phonered→green; 14/14 pass. Smoke: gate hard-fails on+442079460958.🤖 Generated with Claude Code