Skip to content

Add per-request recognizer allowlist + list accessors - #338

Merged
martsokha merged 2 commits into
mainfrom
feat/recognizer-allowlist
Jul 31, 2026
Merged

Add per-request recognizer allowlist + list accessors#338
martsokha merged 2 commits into
mainfrom
feat/recognizer-allowlist

Conversation

@martsokha

Copy link
Copy Markdown
Member

Summary

  • Wire selects deployment NER/LLM recognizers by name instead of just a boolean toggle. RecognizerParams.{ner,llm} become Option<ProviderSelection>: true runs the whole lineup, false skips it, ["a","b"] runs only the named recognizers. Empty allowlist and unknown names fail the analyzer compile with the available names in the error message.
  • New Engine::ner_recognizers() / Engine::llm_recognizers() returning impl ExactSizeIterator<Item = RegisteredRecognizer<'_>> so hosts can list what's registered without leaking backend credentials or connection details. Each recognizer gains an optional description field for the UI.
  • Bumps elide a29a152e → 6c0331db (adds OcrBackend::recognize_batch with a sequential default). Refactors BentoNer and BentoOcr so post_recognize does the full encode-transport-decode hop inside one function, and recognize delegates to recognize_batch for single-request dispatch.

Test plan

  • cargo check --workspace --all-features
  • cargo clippy --workspace --all-features --all-targets (no warnings)
  • cargo test --workspace --all-features
  • RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc --workspace --all-features --no-deps
  • cargo deny check

🤖 Generated with Claude Code

Wire selects deployment NER/LLM recognizers by name instead of
just a boolean toggle. `RecognizerParams.{ner,llm}` become
`Option<ProviderSelection>`: `true` runs the whole lineup,
`false` skips it, `["a","b"]` runs only the named recognizers.
Empty allowlist and unknown names fail the analyzer compile
with the available names in the error.

Adds `Engine::{ner,llm}_recognizers()` returning
`impl ExactSizeIterator<Item = RegisteredRecognizer<'_>>` so
hosts can list what's configured without leaking backend
credentials or connection details. Each recognizer gains an
optional `description` field for the UI.

Bumps elide a29a152e -> 6c0331db (adds OcrBackend::recognize_batch
with a sequential default). Refactors BentoNer and BentoOcr so
post_recognize does the full encode-transport-decode hop inside
one function, and `recognize` delegates to `recognize_batch` for
single-request dispatch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@martsokha martsokha added feat request for or implementation of a new feature engine redaction engine, pipeline runtime, orchestration, configuration recognition pattern, NER, LLM, and OCR backends (elide::recognition::*) ontology entities, policies, contexts labels Jul 31, 2026
@martsokha martsokha self-assigned this Jul 31, 2026
Collapse engine's public module surface from 9 to 5: `entity`
absorbs the old `primitive` module; `plan` absorbs `annotation`;
`file` promotes `Document` / `FileMetadata` to root; `llm` and
`ner` merge into one flat `provider` module (no name clashes
since types are already `Llm*` / `Ner*` prefixed). `modality`
stays standalone. `EntityRecord` re-exports from `entity`.

Simplify the selection helper: replace the `Named` extractor
closure with a small trait implemented in-file; replace the
five-positional-parameter `select` with three, using a plain
`&'static str` for the field-name interpolation (Kind struct
dropped).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@martsokha
martsokha merged commit cfa4009 into main Jul 31, 2026
6 checks passed
@martsokha
martsokha deleted the feat/recognizer-allowlist branch July 31, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine redaction engine, pipeline runtime, orchestration, configuration feat request for or implementation of a new feature ontology entities, policies, contexts recognition pattern, NER, LLM, and OCR backends (elide::recognition::*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant