You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Example [COOP](https://github.com/roostorg/coop) integration plugin. Reference r
10
10
11
11
-**Integration:**`COOP_INTEGRATION_EXAMPLE`
12
12
-**Signal 1 – Random Signal Selection** (`RANDOM_SIGNAL_SELECTION`): Returns `true` or `false` at random. The probability (0–100%) comes from the org’s integration config (“True percentage”). Set e.g. `70` in Org settings → Integrations; the signal returns `true` about 70% of the time. Use this to test config saving and boolean conditions.
13
-
-**Signal 2 – Random Score** (`RANDOM_SCORE`): Returns a random number between 0 and 1. No integration config needed. In the rule builder you set a **threshold** (e.g. `0.5`) and choose **above** or **below**. Use this to test numeric score conditions (e.g. “score ≥ 0.5” or “score <0.3”).
13
+
-**Signal 2 – Random Score** (`RANDOM_SCORE`): Returns a random number from **0 up to (but not including) 100**—the same 0–100 style as “True percentage,” so thresholds feel consistent. No integration config needed. In the rule builder set a **threshold** (e.g. `50`) and choose **above** or **below**. Use this to test numeric score conditions (e.g. “score ≥ 50” or “score <30”).
14
14
15
15
## Install
16
16
@@ -61,17 +61,17 @@ Restart the COOP server so it loads the plugin.
61
61
1.**Org settings → Integrations** – you should see “COOP Integration Example”. Open it and set **True percentage (0–100)** (e.g. `70`) for Random Signal Selection. Save.
62
62
2.**Rules (routing or enforcement)** – when adding a condition:
63
63
-**Random Signal Selection**: Pick that signal; the condition uses your configured percentage (true/false).
64
-
-**Random Score**: Pick “Random Score”, then set a **threshold** (e.g. `0.5`) and choose **above** or **below**. The rule compares the random score to your threshold.
64
+
-**Random Score**: Pick “Random Score”, then set a **threshold**on the 0–100 scale (e.g. `50`) and choose **above** or **below**. The rule compares the random score to your threshold.
65
65
66
66
## Contract
67
67
68
68
This package implements the COOP plugin contract from `@roostorg/types`:
69
69
70
70
-**Default export:**`CoopIntegrationPlugin` with `manifest` and `createSignals(context)`.
-**Manifest:**`id`, `name`, `version`, `requiresConfig`, `configurationFields`, `signalTypeIds`, `modelCard` (must include every section id in `REQUIRED_MODEL_CARD_SECTION_IDS` from `@roostorg/types`; call `assertModelCardHasRequiredSections(modelCard)` when registering).
-`RANDOM_SCORE`: `run()` returns `{ outputType: { scalarType: 'NUMBER' }, score: number }` in [0, 1]; no config. Threshold is set in the rule (above/below).
74
+
-`RANDOM_SCORE`: `run()` returns `{ outputType: { scalarType: 'NUMBER' }, score: number }` in **[0, 100)** (`Math.random() * 100`); no config. Threshold is set in the rule on the same scale (above/below).
Copy file name to clipboardExpand all lines: package.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@roostorg/coop-integration-example",
3
-
"version": "1.0.0",
3
+
"version": "2.0.0",
4
4
"description": "Example package to show how a custom integration and signal can be used in COOP this is meant to be a reference repository and provide basic determination",
'Example plugin with two signals: one uses org config (boolean), one returns a numeric score so you can set a threshold in the rule (over/under).',
33
+
'This reference integration does not use a trained model. Outputs are randomly generated for demonstration and testing of COOP rules, configuration, and UI only.',
34
34
},
35
+
],
36
+
},
37
+
{
38
+
id: 'policyAndTaxonomy',
39
+
title: 'Policy and Taxonomy',
40
+
fields: [
41
+
{
42
+
label: 'Scope',
43
+
value:
44
+
'Not a content policy engine. Signals are placeholders: boolean “coin flip” with configurable probability and a numeric random score for threshold exercises in rules.',
45
+
},
46
+
],
47
+
},
48
+
{
49
+
id: 'annotationMethodology',
50
+
title: 'Annotation Methodology',
51
+
fields: [
52
+
{
53
+
label: 'Method',
54
+
value:
55
+
'No human or automated labeling pipeline. Values are produced with Math.random() (or equivalent logic) at evaluation time.',
56
+
},
57
+
],
58
+
},
59
+
{
60
+
id: 'performanceBenchmarks',
61
+
title: 'Performance and Benchmarks',
62
+
fields: [
63
+
{
64
+
label: 'Benchmarks',
65
+
value:
66
+
'No precision, recall, or latency benchmarks apply. Do not use performance claims from this package in production decisions.',
67
+
},
68
+
],
69
+
},
70
+
{
71
+
id: 'biasAndLimitations',
72
+
title: 'Bias and Limitations',
73
+
fields: [
74
+
{
75
+
label: 'Limitations',
76
+
value:
77
+
'Outputs are uncorrelated with input content. Unsuitable for safety, compliance, or moderation decisions. For integration testing and developer learning only.',
78
+
},
79
+
],
80
+
},
81
+
{
82
+
id: 'implementationGuidance',
83
+
title: 'Implementation Guidance',
84
+
fields: [
35
85
{
36
86
label: 'Signals',
37
-
value: `${SIGNAL_TYPE_RANDOM_SELECTION} (boolean, config-driven) and ${SIGNAL_TYPE_RANDOM_SCORE} (number 0–1, threshold in rule).`,
87
+
value: `${SIGNAL_TYPE_RANDOM_SELECTION} (boolean; org config truePercentage 0–100). ${SIGNAL_TYPE_RANDOM_SCORE} (number 0–100; set threshold and above/below in the rule).`,
88
+
},
89
+
{
90
+
label: 'Configuration',
91
+
value:
92
+
'Random Signal Selection requires org integration config (true percentage). Random Score requires no integration config.',
93
+
},
94
+
{
95
+
label: 'Versioning',
96
+
value:
97
+
'modelCard.version and manifest.version identify this integration plugin release. They are independent of the @roostorg/types dependency major version (e.g. 2.x).',
@@ -158,11 +221,11 @@ function createRandomScoreDescriptor(
158
221
id: {type: SIGNAL_TYPE_RANDOM_SCORE},
159
222
displayName: 'Random Score',
160
223
description:
161
-
'Returns a random number between 0 and 1. Set a threshold in the rule (e.g. 0.5) and choose "above" or "below" to test numeric conditions.',
224
+
'Returns a random number from 0 up to (but not including) 100. Set a threshold in the rule (e.g. 50) and choose "above" or "below" to test numeric conditions.',
162
225
docsUrl: null,
163
226
recommendedThresholds: {
164
-
highPrecisionThreshold: 0.5,
165
-
highRecallThreshold: 0.5,
227
+
highPrecisionThreshold: 50,
228
+
highRecallThreshold: 50,
166
229
},
167
230
supportedLanguages: 'ALL',
168
231
pricingStructure: {type: 'FREE'},
@@ -178,8 +241,7 @@ function createRandomScoreDescriptor(
0 commit comments