Skip to content

feat(validators): central registry + sync to Paramify#15

Open
21tmccauley wants to merge 1 commit into
mainfrom
feat/validator-registry-and-sync
Open

feat(validators): central registry + sync to Paramify#15
21tmccauley wants to merge 1 commit into
mainfrom
feat/validator-registry-and-sync

Conversation

@21tmccauley

Copy link
Copy Markdown
Collaborator

What & why

Revamps how validators are stored and builds the sync that pushes them to Paramify and wires them to evidence sets — the second half of the "when a user adds fetchers to their manifest, they can upload and associate these validators" story.

Storage model

  • Validators are first-class, deduplicated objects in a central validators/<category>/<key>.yaml registry, validated by the new framework/schemas/validator_schema.json.
  • The fetcher↔validator link lives on the validator (evidence_sets: [<reference_id>, …]), mirroring Paramify's own model — a validator shared across fetchers is one file with multiple entries, never a copy.
  • The unused inline validators block was removed from fetcher_schema.json (no code parsed it; 0 fetchers used it).

Sync (repo → Paramify)

  • uploaders/paramify_validators/syncer.py: client (POST/PATCH /validators, POST /evidence/{id}/associate) + reconcile engine.
  • CLI: paramify validators sync [--manifest] [--update] [--dry-run] and paramify upload --with-validators.
  • Create-or-skip, never clobber: an existing validator is not modified unless --update (these ship as ~80% templates customers tune). Associate on create only. --dry-run makes no writes.
  • Per-instance Paramify ids are resolved at sync time and cached in a gitignored .paramify/ lock — never in the shared registry.

Not in this PR

  • Importer (Paramify export → registry files) — separate PR, as discussed.
  • Live-tenant smoke test — needs a token; all verification here is dry-run / mocked.

Testing

  • 231 tests pass (new: test_validators_registry.py, test_validator_sync.py, test_validator_api.py); ruff + mypy clean on all new/changed files.
  • Includes fixes from a 3-subagent code review: duplicate-create on a GET /validators failure (now fails closed), association-failure isolation, four schema-permissiveness gaps, combined ok/exit-code, and crash guards.
  • Note: tests/test_executor.py and tests/test_redaction.py carry pre-existing ruff I001 warnings unrelated to this PR (untouched here).

One behavior to confirm in review

upload --with-validators runs the sync even after a partially-failed upload (scoped to the sets the run produced). Documented in docs/validators_design.md — kept for now, with the conservative/precise alternatives noted.

Full model + v0.6.0 API mapping: docs/validators_design.md.

🤖 Generated with Claude Code

Revamp how validators are stored, and add the path to push them to
Paramify and associate them to evidence sets.

Storage: validators are now first-class, deduplicated objects in a
central validators/<category>/<key>.yaml registry (validator_schema.json),
each owning its fetcher link via an evidence_sets list of reference_ids —
a validator shared across fetchers is one file, never a copy. The dead,
unused inline `validators` block is removed from fetcher_schema.json.

Sync: uploaders/paramify_validators/ + `paramify validators sync` and
`paramify upload --with-validators` (framework/api facade). Create-or-skip
by default — a customer's tuned validator is never PATCHed unless --update;
associates on create only; --dry-run previews with no writes. Per-instance
Paramify ids live in a gitignored lock, not the shared registry.

Seeded validators/aws/alb_encryption_in_transit.yaml as the first entry.

231 tests pass; ruff + mypy clean on new code. Incorporates fixes from a
3-agent review (duplicate-create-on-list-failure, association isolation,
schema strictness, combined exit/JSON ok, crash guards).

Importer (Paramify export -> registry files) is deferred to a separate PR.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@21tmccauley

Copy link
Copy Markdown
Collaborator Author

Need to test in a stage environment with real data before we merge

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