#!/usr/bin/env python3 """Measure the trust signals a draft pays, and what they cost the writer. Readers judge credibility by costly signals: details that could be checked, numbers that could be wrong, commitments that expose the writer. Free signals (generic praise, safe hedges, uniform confidence) are worthless precisely because they cost nothing. The accurate human detectors of AI text (Russell et al. 2025) key on this layer, not on banned words. These are measurements, not verdicts. A poem scores zero specifics and is not worse for it; a launch post scoring zero specifics is a finding. The skill decides what a number means for this genre; this script only counts. Usage: python3 signals.py [--lang ja] [--json] """ import argparse import json import re import statistics import sys from pathlib import Path HEDGES = r"\b(might|may|could|perhaps|possibly|arguably|potentially|seems?|somewhat|likely|probably|tend(?:s)? to|in some cases|to some extent|it could be argued)\b" CERTAINTY = r"\b(definitely|certainly|always|never|must|undeniably|clearly|obviously|of course|without a doubt)\b" FIRST_PERSON = r"\b(I|I'm|I've|I'd|my|me|we|our)\b" SECOND_PERSON = r"\b(you|your|you're|you've)\b" ADMISSION = r"\b(I was wrong|we were wrong|I don't know|I'm not sure|didn't work|failed|my mistake|I missed|we missed|turned out I|I had to throw|embarrassing|uncomfortable|I still can't|was a fantasy|took us .{0,20} to notice|we broke|our fault)\b" def clean(text): text = re.sub(r"```.*?```", " ", text, flags=re.S) return re.sub(r"^#{1,6}\s.*$", " ", text, flags=re.M) def sentences(text, lang="en"): if lang in ("ja", "zh", "cjk"): # Split on Japanese/Chinese sentence terminators or English punctuation parts = re.split(r"(?<=[。!?.!?])\s*", clean(text).replace("\n", " ")) return [s.strip() for s in parts if len(s.strip()) >= 5] else: parts = re.split(r"(?<=[.!?])\s+", clean(text).replace("\n", " ")) return [s.strip() for s in parts if len(s.split()) >= 3] def proper_nouns(text): # capitalized tokens not at sentence start: rough named-entity proxy hits = re.findall(r"(?