feat: harden generic preset, add LLM retry, and finish tooling/docs
- PatternDef.validate + Luhn-gated credit-card detection; de-overlap the generic phone/date/IP patterns; presets.swiss unchanged (production behavior) - strip g/y flags from nameHint so .test() is stateless (latent footgun) - openAICompatibleProvider: bounded retry on transient failures (network / timeout / 429 / 5xx), configurable via retries + retryDelayMs - eslint + prettier + vitest coverage (97%); CI runs lint/format/coverage - docs: README badges + new-option docs, SECURITY.md, issue/PR templates 26 tests passing; build emits ESM+CJS+types. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report incorrect behavior (false positive/negative, crash, leak)
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**⚠️ Security/PII-leak issues:** please do NOT file them here — email security@mobiletic.com (see SECURITY.md).
|
||||
|
||||
## Describe the bug
|
||||
|
||||
A clear description of what's wrong.
|
||||
|
||||
## To reproduce
|
||||
|
||||
A minimal code sample or failing test:
|
||||
|
||||
```ts
|
||||
// import { Anonymizer, presets } from '@mobiletic/anonymizer';
|
||||
```
|
||||
|
||||
## Expected behavior
|
||||
|
||||
What you expected to happen.
|
||||
|
||||
## Environment
|
||||
|
||||
- `@mobiletic/anonymizer` version:
|
||||
- Node.js version:
|
||||
- Using an LLM provider? (which endpoint/model, or regex-only):
|
||||
|
||||
## Additional context
|
||||
|
||||
Anything else (input text shape, custom patterns, …). Redact any real PII before posting.
|
||||
23
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
23
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a pattern preset, provider, or capability
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
## What problem does this solve?
|
||||
|
||||
The use case or gap you're hitting (e.g. "no preset for German tax IDs", "want an Anthropic provider").
|
||||
|
||||
## Proposed solution
|
||||
|
||||
What you'd like to see. For a new preset, list the identifier(s) and an example value (synthetic, no real PII).
|
||||
|
||||
## Alternatives considered
|
||||
|
||||
Anything you've tried or other approaches.
|
||||
|
||||
## Additional context
|
||||
|
||||
Links, references, or examples.
|
||||
19
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
19
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Description
|
||||
|
||||
<!-- What does this PR change, and why? -->
|
||||
|
||||
## Type of change
|
||||
|
||||
- [ ] Bug fix
|
||||
- [ ] New feature (pattern preset, provider, …)
|
||||
- [ ] Documentation
|
||||
- [ ] Tooling / chore
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Tests added or updated for the change
|
||||
- [ ] `npm test` passes
|
||||
- [ ] `npm run typecheck` passes
|
||||
- [ ] `npm run lint` and `npm run format:check` pass
|
||||
- [ ] Docs / CHANGELOG updated if behavior or the public API changed
|
||||
- [ ] No runtime dependencies were added to the core
|
||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -19,6 +19,8 @@ jobs:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run format:check
|
||||
- run: npm run typecheck
|
||||
- run: npm test
|
||||
- run: npm run test:coverage
|
||||
- run: npm run build
|
||||
|
||||
Reference in New Issue
Block a user