Add self-harm/intent + self-harm/instructions OpenAI signals (#535) master
* Add self-harm/intent and self-harm/instructions signals Round out the omni-moderation self-harm coverage that the prior commit left lopsided. OpenAI scores both subcategories for text *and* image inputs; we had neither. New signal classes (4): - OpenAiSelfHarmIntentTextSignal / OpenAiSelfHarmIntentImageSignal - OpenAiSelfHarmInstructionsTextSignal / OpenAiSelfHarmInstructionsImageSignal Plus matching SignalType enum entries, integrationForSignalType cases, SignalArgsByType / RuntimeSignalArgsByType entries, IoC registration, and the two new category names in OpenAiModelName + OpenAiImageModelName. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Expose self-harm/intent + instructions signals to GraphQL + client Same shape as the previous fix on PR #534: the four new self-harm subcategory signal types need to round-trip through both hand-maintained mirrors or the dashboard can't see them. - server/graphql/modules/signal.ts: add the four OPEN_AI_SELF_HARM_{INTENT,INSTRUCTIONS}_{TEXT,IMAGE}_MODEL types to the SDL enum. - client/src/models/signal.ts: add the same four to the OpenAi case in integrationForSignalType. - Regenerate codegen. The coverage test added in PR #534 catches this regression class on new SignalType additions; it now exercises 33 enum values (was 29). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add docstrings to self-harm/intent + instructions signal classes Matches the docstring style applied to the base PR's image signals. Raises this PR's docstring coverage above CodeRabbit's 80% pre-merge threshold by documenting each of the four new signal classes (self-harm/intent text+image, self-harm/instructions text+image) and their run() methods. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Apply factory pattern to self-harm subcategory signals Mirrors the cleanup from PR #534: the 4 self-harm subcategory signal classes (2 text + 2 image) collapse to ~20-line factory calls instead of ~110-line class definitions each. - Adds `makeOpenAiTextModerationSignal` alongside the existing image factory introduced in #534. - Both factories now share a single internal `makeOpenAiModerationSignal` parameterized by input scalar + run impl, so the class body lives in one place (was duplicated twice in #534's first cut). - Factories moved into `openAiModerationSignalFactory.ts` — keeps `openAIModerationUtils.ts` under the 500-line lint limit (the second factory pushed it to 510) and organizes the file boundary cleanly: utils = lib functions, factory = class generator. The 4 self-harm subcategory signal files (text + image variants for `self-harm/intent` and `self-harm/instructions`) now just import the appropriate factory and pass a config object. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix bad import --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Juan Mrad <juansmrad@gmail.com>