Adapted from the serious-queue repository docs. Private repo.
Rule-based sentence/story "seriousness" scorer, user preference tracker, and story queue matcher for collaborative writing platforms. Standalone, pluggable, zero dependencies beyond Node.
serious (≥60) / nonserious (≤40) / mixed.import { sentenceSeriousness, initStoryProfile, updateStoryProfile,
initUserProfile, updateUserProfile, pickStoriesForUser } from 'serious-queue';
sentenceSeriousness('However, the magistrate insisted the evidence be cataloged before dusk.');
// → high (serious)
const story = initStoryProfile('story-123');
updateStoryProfile(story, prevSentence, newSentence);
console.log(story.StSS, story.band); // score + 'serious'|'nonserious'|'mixed'
const user = initUserProfile('user-42');
updateUserProfile(user, [72, 68, 70]); // USP drifts toward their style
const chosen = pickStoriesForUser(user, candidates, { epsilon: 0.15, limit: 3 });
Minimal pub/sub for observability: onScoreSentence, onUpdateStory, onUpdateUser, onPickStories — via registerHook/notifyPickStories.
Weights in src/weights.js, lexicons in src/lexicons.js (slang/meme/profanity lists, locale-extensible). Band thresholds, story window size (default 30), queue epsilon/perAuthorMax/limit all configurable. Anti-gaming handled: caps penalty bypasses known acronyms, spam influence reduced, extreme lengths lightly penalized.
npm install && npm run demo # smoke test with assertions
black-candle-technologies/serious-queue (private)