zero-slop 2.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +193 -0
- package/SKILL.md +803 -0
- package/data/corpus/community-register/README.md +14 -0
- package/data/corpus/community-register/judgment/communicative-drift.txt +1 -0
- package/data/corpus/community-register/judgment/reflexive-agreement.txt +1 -0
- package/data/corpus/community-register/judgment/rhetorical-scale-mismatch.txt +1 -0
- package/data/corpus/must-not-flag/README.md +49 -0
- package/data/corpus/must-not-flag/esl-engineer-email.txt +7 -0
- package/data/corpus/must-not-flag/exec-memo.txt +9 -0
- package/data/corpus/must-not-flag/federalist.txt +5 -0
- package/data/corpus/must-not-flag/gettysburg.txt +1 -0
- package/data/corpus/must-not-flag/grant-abstract.txt +5 -0
- package/data/corpus/must-not-flag/ml-methods.txt +1 -0
- package/data/corpus/must-not-flag/personal-essay.txt +1 -0
- package/data/corpus/must-not-flag/press-release.txt +7 -0
- package/data/corpus/must-not-flag/recipe.txt +11 -0
- package/data/corpus/must-not-flag/sre-runbook.txt +1 -0
- package/data/corpus/must-not-flag/technical-postmortem.txt +1 -0
- package/data/corpus/must-not-flag/terse-engineer-note.txt +1 -0
- package/data/corpus/must-not-flag-shape/README.md +22 -0
- package/data/corpus/must-not-flag-shape/aphorism-list.txt +9 -0
- package/data/corpus/must-not-flag-shape/changelog.txt +13 -0
- package/data/corpus/must-not-flag-shape/dialogue.txt +19 -0
- package/data/corpus/must-not-flag-shape/lyrics.txt +15 -0
- package/data/corpus/must-not-flag-shape/poem.txt +8 -0
- package/data/corpus/must-not-flag-shape/sms-transcript.txt +15 -0
- package/data/corpus/performed-register/README.md +38 -0
- package/data/corpus/performed-register/judgment/detection-fragile.txt +1 -0
- package/data/corpus/performed-register/judgment/draft-cheap-signal.txt +1 -0
- package/data/corpus/performed-register/judgment/ear-chiasmus.txt +1 -0
- package/data/corpus/performed-register/judgment/fight-against-tagline.txt +1 -0
- package/data/corpus/performed-register/judgment/fine-beat.txt +1 -0
- package/data/corpus/performed-register/judgment/glow-finishing.txt +1 -0
- package/data/corpus/performed-register/judgment/jargon-compression.txt +1 -0
- package/data/corpus/performed-register/judgment/not-perfect-honest.txt +1 -0
- package/data/corpus/performed-register/judgment/punctuation-convict.txt +1 -0
- package/data/corpus/performed-register/judgment/recipe-ingredients.txt +1 -0
- package/data/corpus/performed-register/judgment/replay-lands.txt +1 -0
- package/data/corpus/performed-register/judgment/rhymes-with.txt +1 -0
- package/data/corpus/performed-register/judgment/rhythm-prints.txt +1 -0
- package/data/corpus/performed-register/judgment/same-leak.txt +1 -0
- package/data/corpus/performed-register/judgment/tools-work.txt +1 -0
- package/data/corpus/performed-register/judgment/tuning-gradients.txt +1 -0
- package/data/corpus/performed-register/judgment/verdict-arithmetic.txt +1 -0
- package/data/corpus/performed-register/judgment/whole-product.txt +1 -0
- package/data/corpus/performed-register/judgment/words-cheap.txt +1 -0
- package/data/corpus/performed-register/mechanical/argue-with-artifact.txt +1 -0
- package/data/corpus/performed-register/mechanical/bill-lands.txt +1 -0
- package/data/corpus/performed-register/mechanical/billed-to-reader.txt +1 -0
- package/data/corpus/performed-register/mechanical/economics-brutal.txt +1 -0
- package/data/corpus/performed-register/mechanical/has-receipts.txt +1 -0
- package/data/corpus/performed-register/mechanical/hired-adversary.txt +1 -0
- package/data/corpus/performed-register/mechanical/hyperbole-universal.txt +1 -0
- package/data/corpus/performed-register/mechanical/metaphor-sender-name.txt +1 -0
- package/data/corpus/performed-register/mechanical/minding-own-business.txt +1 -0
- package/data/corpus/performed-register/mechanical/on-the-tin.txt +1 -0
- package/data/corpus/performed-register/mechanical/opens-the-hood.txt +1 -0
- package/data/corpus/performed-register/mechanical/turns-out-payoff.txt +1 -0
- package/data/corpus/performed-register/mechanical/vibe-check.txt +1 -0
- package/data/corpus/performed-register/mechanical/vibe-isnt-a-vibe.txt +1 -0
- package/data/corpus/performed-register/mechanical/vibe-number-attached.txt +1 -0
- package/data/corpus/performed-register/mechanical/where-slop-lives.txt +1 -0
- package/data/learned-log.md +339 -0
- package/data/learned.json +128 -0
- package/data/patterns.json +2298 -0
- package/package.json +54 -0
- package/references/copy-desk.md +87 -0
- package/references/evidence.md +382 -0
- package/references/overcorrection.md +77 -0
- package/references/platforms.md +102 -0
- package/references/readalong.md +118 -0
- package/references/rewrite-moves.md +177 -0
- package/references/tells.md +190 -0
- package/scripts/calibrate.py +274 -0
- package/scripts/learn.py +1588 -0
- package/scripts/predictability.py +227 -0
- package/scripts/rerank.py +150 -0
- package/scripts/safeio.py +146 -0
- package/scripts/slopscore.py +1352 -0
- package/scripts/version_check.py +104 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""version_check — is this copy of the skill the latest release?
|
|
3
|
+
|
|
4
|
+
The skill runs step 0 of its loop through this so a stale install tells on itself
|
|
5
|
+
and points at the one-line update, instead of silently de-slopping with an old tell
|
|
6
|
+
list. It compares the version in SKILL.md against the latest GitHub release and
|
|
7
|
+
prints what to run if a newer one exists.
|
|
8
|
+
|
|
9
|
+
python3 scripts/version_check.py # human-readable, always prints
|
|
10
|
+
python3 scripts/version_check.py --quiet # print only if an update exists (step 0)
|
|
11
|
+
python3 scripts/version_check.py --json # machine-readable
|
|
12
|
+
|
|
13
|
+
Two promises this keeps. It sends **only a version query** — never a draft or any
|
|
14
|
+
word from it — so the check does not expose writing. And
|
|
15
|
+
it fails open: no network, a timeout, any error, and it exits 0 with a quiet note,
|
|
16
|
+
because a de-slop run must never break over a missing changelog. Set
|
|
17
|
+
`ZS_NO_UPDATE_CHECK=1` to skip it entirely.
|
|
18
|
+
"""
|
|
19
|
+
import argparse
|
|
20
|
+
import json
|
|
21
|
+
import os
|
|
22
|
+
import re
|
|
23
|
+
import sys
|
|
24
|
+
import urllib.request
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
28
|
+
RELEASES = "https://api.github.com/repos/manavmishra/ZeroSlop/releases/latest"
|
|
29
|
+
TIMEOUT = 2.5
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def local_version():
|
|
33
|
+
"""The version this copy declares, from SKILL.md's frontmatter."""
|
|
34
|
+
try:
|
|
35
|
+
text = (ROOT / "SKILL.md").read_text()
|
|
36
|
+
except (OSError, UnicodeDecodeError):
|
|
37
|
+
return None
|
|
38
|
+
m = re.search(r'^\s*version:\s*"?([\d.]+)"?', text, re.M)
|
|
39
|
+
return m.group(1) if m else None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _tuple(v):
|
|
43
|
+
match = re.fullmatch(r"v?(\d+)\.(\d+)\.(\d+)(?:[-+][0-9A-Za-z.-]+)?", v or "")
|
|
44
|
+
return tuple(int(match.group(i)) for i in range(1, 4)) if match else None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def latest_version():
|
|
48
|
+
"""The newest published release tag, or None if it cannot be reached.
|
|
49
|
+
|
|
50
|
+
Sends one GET to the public releases API and reads the tag. No auth, no body,
|
|
51
|
+
nothing about the draft — just 'what is the latest tag'.
|
|
52
|
+
"""
|
|
53
|
+
if os.getenv("ZS_NO_UPDATE_CHECK", "").lower() in {"1", "true", "yes", "on"}:
|
|
54
|
+
return None
|
|
55
|
+
try:
|
|
56
|
+
req = urllib.request.Request(RELEASES, headers={"Accept": "application/vnd.github+json",
|
|
57
|
+
"User-Agent": "zero-slop-version-check"})
|
|
58
|
+
with urllib.request.urlopen(req, timeout=TIMEOUT) as r:
|
|
59
|
+
tag = json.load(r).get("tag_name", "")
|
|
60
|
+
return tag.lstrip("vV") or None
|
|
61
|
+
except Exception:
|
|
62
|
+
return None # fail open: offline, rate-limited, or no release yet
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def install_hint():
|
|
66
|
+
"""The right update command for how this copy was installed."""
|
|
67
|
+
if (ROOT / ".git").exists():
|
|
68
|
+
return "git -C %s pull" % ROOT
|
|
69
|
+
return "npx skills add manavmishra/ZeroSlop --global # re-run to update"
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def check():
|
|
73
|
+
local = local_version()
|
|
74
|
+
latest = latest_version()
|
|
75
|
+
local_semver, latest_semver = _tuple(local), _tuple(latest)
|
|
76
|
+
behind = bool(local_semver and latest_semver and latest_semver > local_semver)
|
|
77
|
+
return {"local": local, "latest": latest, "update_available": behind,
|
|
78
|
+
"command": install_hint() if behind else None,
|
|
79
|
+
"checked": latest is not None}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def main(argv=None):
|
|
83
|
+
parser = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
|
84
|
+
mode = parser.add_mutually_exclusive_group()
|
|
85
|
+
mode.add_argument("--quiet", action="store_true")
|
|
86
|
+
mode.add_argument("--json", action="store_true")
|
|
87
|
+
args = parser.parse_args(argv)
|
|
88
|
+
r = check()
|
|
89
|
+
if args.json:
|
|
90
|
+
print(json.dumps(r))
|
|
91
|
+
return 0
|
|
92
|
+
if r["update_available"]:
|
|
93
|
+
print(f"Zero Slop {r['latest']} is out — you have {r['local']}. Update:\n {r['command']}")
|
|
94
|
+
elif not args.quiet:
|
|
95
|
+
if not r["checked"]:
|
|
96
|
+
local = r["local"] or "version unknown"
|
|
97
|
+
print(f"Zero Slop {local} — could not check for updates (offline or rate-limited).")
|
|
98
|
+
else:
|
|
99
|
+
print(f"Zero Slop {r['local']} is the latest release.")
|
|
100
|
+
return 0
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if __name__ == "__main__":
|
|
104
|
+
sys.exit(main())
|