Release 0.35.0: detection-quality overhaul + self-improving weights - #16
Merged
Conversation
Detection (evidence-driven, see research catalogs in the extension repo): - New `structure` metric — enumeration/list-intro/participial-tail/negative- parallelism scaffolding of instruction-tuned writing. Paraphrase-robust and stable across model generations; the assistant register (~40% before) is now caught. - Fixed two inverted signals: `voice` no longer scores passive as AI (GPT-4o uses agentless passive at ~half the human rate; RU/UK/DE passive+nominal is ordinary register) — now nominalization-led; `punctuation` no longer scores ;/:/—/« » as AI (marks of careful human editing; it fired on classic prose). - Anti-evasion normalization: strip zero-width, fold homoglyphs in Latin- majority words (genuine Cyrillic/Greek preserved). RAID homoglyph attack collapses token detectors 42-76pp; this defeats it. - Weights rebalanced off dead metrics; AI-cliche dict gains the 2025-2026 assistant register (feeds detection + humanization). Self-improving weights (training/): - The detector is a transparent single-layer model: metric vector × per-metric weight. `train_weights.py` fits those weights from a labelled corpus (numpy, non-negative simplex, L2-regularised toward current, shrinkage by evidence, held-out gate). Ships only the fitted numbers in detector_weights.json — no runtime ML. `.github/workflows/retrain.yml` re-fits and opens a PR when it improves. Bootstrap = current weights (no behaviour change on release). Media provenance: - Fixed false-positive class: human Description/Title/Comment/Software chunks were read as AI. Generic keys now require a real generation-parameter value; only tool-unique keys (parameters/workflow/sd-metadata/invokeai_metadata/ sui_image_params/dream) are conclusive. +ComfyUI class_type/SwarmUI + 2026 generators. Also: decancel RNG made match-first-then-coin (adding dict entries no longer shifts unrelated replacements). Versions synced across py/js/php ports. Tests: 2313 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- retrain.yml: open the PR via the pre-installed gh CLI instead of the third-party peter-evans/create-pull-request action, removing the CWE-829 unpinned-tag supply-chain alert (nothing to pin, no third-party surface). - detectors.py: build the invisible/bidi-character strip regex from \u escape sequences instead of literal bidi controls, clearing bandit B613 (trojan-source, High). Runtime behaviour unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.35.0 — evidence-driven detection overhaul, a false-positive fix in media provenance, and a new self-improving weights pipeline. All Python tests pass (2313). Bootstrap weights equal the current hand-tuned ones, so there is no behaviour change on merge — the training loop improves them over time via reviewed PRs.
Detection
structuremetric — enumeration / list-intro / participial-tail / negative-parallelism scaffolding. Paraphrase-robust; the 2025-2026 chat "assistant register" (~40% before) is now caught.voiceno longer scores passive as AI (GPT-4o uses agentless passive at ~half the human rate);punctuationno longer scores;:—« »as AI (they were firing on well-edited human prose).Self-improving weights —
training/The detector is a transparent single-layer model (metric vector × per-metric weight).
train_weights.pyfits those weights fromcorpus.jsonl(numpy, non-negative simplex, L2-regularised toward current, shrinkage by evidence, held-out gate) and ships only the fitted numbers indetector_weights.json— no runtime ML, fully diffable..github/workflows/retrain.ymlre-fits and opens a PR when it improves. Seetraining/README.md.Media provenance
Fixed a false-positive class: a human photo carrying a
Description/Title/Comment/Softwarechunk was reported as AI. Generic keys now require a real generation-parameter value; only tool-unique keys are conclusive. +ComfyUIclass_type/SwarmUI + 2026 generators.Release / publish (maintainer)
Versions synced across py/js/php. Merging + creating a GitHub Release tagged
v0.35.0triggerspublish.yml→ PyPI. Rotate the leaked PyPI token first and store the new one as thePYPI_API_TOKENrepo secret.🤖 Generated with Claude Code