Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dFeature/zentropi signal integration#42

Open
samidh wants to merge 10 commits intoroostorg:mainfrom
zentropi-ai:feature/zentropi-signal-integration
Open

dFeature/zentropi signal integration#42
samidh wants to merge 10 commits intoroostorg:mainfrom
zentropi-ai:feature/zentropi-signal-integration

Conversation

@samidh
Copy link

@samidh samidh commented Feb 10, 2026

Zentropi Signal Integration

Adds full-stack support for the Zentropi Labeler signal, allowing orgs to run content through custom Zentropi
labelers as part of their moderation rules.

What's included

Backend

  • New ZENTROPI integration and ZENTROPI_LABELER signal type
  • Credential storage for Zentropi API key and labeler versions (id + label pairs) in PostgreSQL JSONB
  • DB migration to add labeler_versions column to zentropi_configs
  • Signal implementation that calls the Zentropi /v1/label API and maps the response to a composite score
  • eligibleSubcategories resolver dynamically returns org-specific labeler versions so each org sees only their
    own configured labelers
  • Spot test fix: rules can now be tested regardless of enabled status

Frontend

  • Zentropi integration config page with API key input and labeler version management (add/remove id + label
    pairs)
  • Subcategory picker renders a simple dropdown for flat subcategory lists (e.g. labeler versions) instead of the
    tree-based card gallery
  • Zentropi added to integration configs with logo

Tests

  • 18 unit tests covering signal evaluation, score mapping, error handling, and credential helpers

To Use

  • Register for a free account at https://zentropi.ai and get an API key
  • The Zentropi API is free for anybody to use (subject to generous rate limits)
  • Go to Coop Settings and add the Zentropi Integration
  • Configure with your API key and the version IDs of any labeler you wish to use
  • When creating a Coop rule, select your labeler as a "subcategory" of the Zentropi signal

samidh and others added 7 commits February 10, 2026 06:58
Add Zentropi as a new third-party integration and ZENTROPI_LABELER as
a new signal type across TypeScript enums, GraphQL schema, and
generated types.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add ZentropiCredential type, CRUD operations for per-org API key
storage, and migration to create signal_auth_service.zentropi_configs
table.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Implement ZentropiLabelerSignal and zentropiUtils following the OpenAI
Moderation pattern. Calls POST /v1/label with policy-steerable labeler,
maps label+confidence to a composite 0-1 score, and handles permanent
errors (401/404) vs transient errors (5xx).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Register ZentropiLabelerSignal in instantiateBuiltInSignals, add
cached Zentropi API fetcher (with labeler-aware cache keys), and
add cached credential getter for ZENTROPI integration.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Test score mapping (all four quadrants), signal class metadata,
disabled info, error handling (401/404 permanent, 5xx transient,
missing subcategory), and correct API call parameters.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The Zentropi API returns label as a string ("0"/"1") rather than a
number. The strict equality check (label === 1) would always fail,
causing violating content to receive a safe score. Use Number(label)
to handle both string and number responses.

Also fix test helper makeCredentialGetter to use string | null instead
of string | undefined, since passing undefined explicitly triggers the
JS default parameter value, making the missing-credentials test path
ineffective.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Store labeler versions (id + label pairs) in the Zentropi integration config
alongside the API key. The eligibleSubcategories resolver dynamically returns
org-specific labeler versions, and the subcategory picker renders a dropdown
for flat subcategory lists. Also fixes spot test to work on rules regardless
of their enabled status.
@julietshen julietshen requested review from a team and juanmrad February 10, 2026 21:48
samidh and others added 2 commits February 11, 2026 10:15
…in cached fetchers

- Add ZENTROPI_LABELER to enum_signals_type in migration SQL
- Replace raw fetch() with shared fetchHTTP dependency in getZentropiScores
- Bind fetchHTTP into getZentropiScores in makeCachedFetchers
- Update tests to mock fetchHTTP instead of global.fetch

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ions

Move simple return values (docsUrl, integration, pricingStructure, etc.)
directly into the signal class instead of delegating to single-use
functions in zentropiUtils.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Merge labeler_versions column into the initial CREATE TABLE instead of
a separate ALTER TABLE migration.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vinaysrao1
Copy link
Contributor

@juanmrad and @samidh - is this ready to approve and merge?

@samidh
Copy link
Author

samidh commented Feb 12, 2026

I believe I addressed all the requests, @vinaysrao1

Let me know if any other changes are needed. We are exciting to use Coop ourselves :-)

@vinaysrao1
Copy link
Contributor

Thanks Samidh. I am approving since you have addressed all the requests. Lets wait for Juan's approval as well as he had more comments.

@juanmrad
Copy link
Member

@samidh We still have lint and betterer errors can you please address them and once that is done we can 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.

3 participants