patina-cli 3.11.0

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.
Files changed (180) hide show
  1. package/.patina.default.yaml +211 -0
  2. package/CHANGELOG.md +265 -0
  3. package/LICENSE +21 -0
  4. package/README.md +319 -0
  5. package/README_JA.md +254 -0
  6. package/README_KR.md +253 -0
  7. package/README_ZH.md +254 -0
  8. package/SKILL-MAX.md +455 -0
  9. package/SKILL.md +730 -0
  10. package/assets/brand/patina-icon.svg +9 -0
  11. package/assets/brand/patina-logo.svg +17 -0
  12. package/assets/social/patina-before-after.svg +46 -0
  13. package/assets/social/patina-og.svg +31 -0
  14. package/bin/patina.js +9 -0
  15. package/core/scoring.md +657 -0
  16. package/core/standalone-prompt.md +364 -0
  17. package/core/stylometry.md +754 -0
  18. package/core/voice.md +163 -0
  19. package/docs/AUTHENTICATION.md +105 -0
  20. package/docs/AUTHENTICATION_KR.md +105 -0
  21. package/docs/BRANDING.md +37 -0
  22. package/docs/CLI.md +80 -0
  23. package/docs/COMPARISON.md +38 -0
  24. package/docs/COOKBOOK.md +173 -0
  25. package/docs/DEMO.md +40 -0
  26. package/docs/ETHICS.md +27 -0
  27. package/docs/EXAMPLES.md +130 -0
  28. package/docs/EXAMPLES_KR.md +130 -0
  29. package/docs/EXIT-CODES.md +25 -0
  30. package/docs/FAQ.md +67 -0
  31. package/docs/FAQ_KR.md +65 -0
  32. package/docs/FLAG-PARITY.md +53 -0
  33. package/docs/GLOSSARY.md +123 -0
  34. package/docs/PATTERNS-EN.md +718 -0
  35. package/docs/PATTERNS-JA.md +706 -0
  36. package/docs/PATTERNS-KO.md +707 -0
  37. package/docs/PATTERNS-ZH.md +706 -0
  38. package/docs/PATTERNS.md +22 -0
  39. package/docs/ROADMAP.md +315 -0
  40. package/docs/audits/2026-05-deep-research.md +290 -0
  41. package/docs/benchmarks/detector-comparison.json +442 -0
  42. package/docs/benchmarks/detector-comparison.md +65 -0
  43. package/docs/benchmarks/latest.json +988 -0
  44. package/docs/benchmarks/latest.md +112 -0
  45. package/docs/integrations/docker.md +19 -0
  46. package/docs/integrations/github-action.md +59 -0
  47. package/docs/integrations/pre-commit.md +77 -0
  48. package/docs/integrations/release.md +43 -0
  49. package/docs/internal/HARNESS.md +14 -0
  50. package/docs/internal/README.md +14 -0
  51. package/docs/internal/WARP.md +23 -0
  52. package/docs/research/2025-rebaseline-plan.md +89 -0
  53. package/docs/research/ai-human-metrics.md +380 -0
  54. package/docs/social/gstack-cardnews.html +236 -0
  55. package/docs/social/gstack-cardnews.md +88 -0
  56. package/docs/social/gstack-thread.md +106 -0
  57. package/docs/social/patina-launch-copy.md +227 -0
  58. package/docs/superpowers/specs/2026-04-03-meaning-preservation-design.md +299 -0
  59. package/lexicon/ai-en.md +162 -0
  60. package/lexicon/ai-ko.md +159 -0
  61. package/package.json +100 -0
  62. package/patina-max/SKILL.md +523 -0
  63. package/patina-max/composite.py +457 -0
  64. package/patterns/en-communication.md +89 -0
  65. package/patterns/en-content.md +133 -0
  66. package/patterns/en-filler.md +113 -0
  67. package/patterns/en-language.md +163 -0
  68. package/patterns/en-structure.md +173 -0
  69. package/patterns/en-style.md +139 -0
  70. package/patterns/en-viral-hook.md +211 -0
  71. package/patterns/ja-communication.md +101 -0
  72. package/patterns/ja-content.md +153 -0
  73. package/patterns/ja-filler.md +123 -0
  74. package/patterns/ja-language.md +190 -0
  75. package/patterns/ja-structure.md +142 -0
  76. package/patterns/ja-style.md +147 -0
  77. package/patterns/ja-viral-hook.md +216 -0
  78. package/patterns/ko-communication.md +98 -0
  79. package/patterns/ko-content.md +154 -0
  80. package/patterns/ko-filler.md +105 -0
  81. package/patterns/ko-language.md +182 -0
  82. package/patterns/ko-structure.md +147 -0
  83. package/patterns/ko-style.md +146 -0
  84. package/patterns/ko-viral-hook.md +211 -0
  85. package/patterns/zh-communication.md +101 -0
  86. package/patterns/zh-content.md +153 -0
  87. package/patterns/zh-filler.md +118 -0
  88. package/patterns/zh-language.md +173 -0
  89. package/patterns/zh-structure.md +145 -0
  90. package/patterns/zh-style.md +159 -0
  91. package/patterns/zh-viral-hook.md +216 -0
  92. package/profiles/academic.md +53 -0
  93. package/profiles/blog.md +81 -0
  94. package/profiles/casual-conversation.md +105 -0
  95. package/profiles/code-comment.md +104 -0
  96. package/profiles/commit-message.md +99 -0
  97. package/profiles/default.md +62 -0
  98. package/profiles/email.md +52 -0
  99. package/profiles/formal.md +98 -0
  100. package/profiles/instructional.md +80 -0
  101. package/profiles/legal.md +57 -0
  102. package/profiles/marketing.md +56 -0
  103. package/profiles/medical.md +53 -0
  104. package/profiles/narrative.md +79 -0
  105. package/profiles/release-notes.md +98 -0
  106. package/profiles/social.md +56 -0
  107. package/profiles/technical.md +53 -0
  108. package/scripts/benchmark-report.mjs +252 -0
  109. package/scripts/check-release-metadata.mjs +48 -0
  110. package/scripts/detector-comparison.mjs +267 -0
  111. package/scripts/lint.mjs +40 -0
  112. package/scripts/precommit-score.mjs +31 -0
  113. package/scripts/prose-score.mjs +186 -0
  114. package/scripts/update-benchmark-ranges.mjs +108 -0
  115. package/src/api.js +330 -0
  116. package/src/auth.js +105 -0
  117. package/src/backends/claude-cli.js +112 -0
  118. package/src/backends/codex-cli.js +121 -0
  119. package/src/backends/contract.js +21 -0
  120. package/src/backends/gemini-cli.js +135 -0
  121. package/src/backends/index.js +159 -0
  122. package/src/cache.js +106 -0
  123. package/src/cli.js +1280 -0
  124. package/src/commands/doctor.js +229 -0
  125. package/src/commands/init.js +208 -0
  126. package/src/config.js +126 -0
  127. package/src/errors.js +53 -0
  128. package/src/features/index.js +96 -0
  129. package/src/features/lexicon.js +90 -0
  130. package/src/features/segment.js +49 -0
  131. package/src/features/stylometry.js +50 -0
  132. package/src/loader.js +103 -0
  133. package/src/logger.js +70 -0
  134. package/src/manifest.js +162 -0
  135. package/src/max-mode.js +207 -0
  136. package/src/ouroboros.js +233 -0
  137. package/src/output.js +480 -0
  138. package/src/prompt-builder.js +409 -0
  139. package/src/providers.js +100 -0
  140. package/src/scoring.js +531 -0
  141. package/src/security.js +133 -0
  142. package/tests/fixtures/suspect-zones/en/ai/en-ai-01.md +16 -0
  143. package/tests/fixtures/suspect-zones/en/ai/en-ai-02.md +16 -0
  144. package/tests/fixtures/suspect-zones/en/ai/en-ai-03.md +17 -0
  145. package/tests/fixtures/suspect-zones/en/ai/en-ai-04.md +15 -0
  146. package/tests/fixtures/suspect-zones/en/ai/en-ai-05.md +16 -0
  147. package/tests/fixtures/suspect-zones/en/ai/en-ai-06-chat-register.md +16 -0
  148. package/tests/fixtures/suspect-zones/en/natural/en-nat-01.md +15 -0
  149. package/tests/fixtures/suspect-zones/en/natural/en-nat-02.md +15 -0
  150. package/tests/fixtures/suspect-zones/en/natural/en-nat-03.md +15 -0
  151. package/tests/fixtures/suspect-zones/en/natural/en-nat-04.md +15 -0
  152. package/tests/fixtures/suspect-zones/en/natural/en-nat-05.md +15 -0
  153. package/tests/fixtures/suspect-zones/expected-ranges.json +939 -0
  154. package/tests/fixtures/suspect-zones/ja/ai/ja-ai-01.md +11 -0
  155. package/tests/fixtures/suspect-zones/ja/ai/ja-ai-02.md +11 -0
  156. package/tests/fixtures/suspect-zones/ja/ai/ja-ai-03.md +11 -0
  157. package/tests/fixtures/suspect-zones/ja/natural/ja-nat-01.md +11 -0
  158. package/tests/fixtures/suspect-zones/ja/natural/ja-nat-02.md +11 -0
  159. package/tests/fixtures/suspect-zones/ja/natural/ja-nat-03.md +11 -0
  160. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-01.md +14 -0
  161. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-02.md +16 -0
  162. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-03.md +15 -0
  163. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-04.md +15 -0
  164. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-05.md +16 -0
  165. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-06-chat-register.md +16 -0
  166. package/tests/fixtures/suspect-zones/ko/natural/ko-nat-01.md +15 -0
  167. package/tests/fixtures/suspect-zones/ko/natural/ko-nat-02.md +15 -0
  168. package/tests/fixtures/suspect-zones/ko/natural/ko-nat-03.md +15 -0
  169. package/tests/fixtures/suspect-zones/ko/natural/ko-nat-04.md +14 -0
  170. package/tests/fixtures/suspect-zones/ko/natural/ko-nat-05.md +15 -0
  171. package/tests/fixtures/suspect-zones/zh/ai/zh-ai-01.md +11 -0
  172. package/tests/fixtures/suspect-zones/zh/ai/zh-ai-02.md +11 -0
  173. package/tests/fixtures/suspect-zones/zh/ai/zh-ai-03.md +11 -0
  174. package/tests/fixtures/suspect-zones/zh/natural/zh-nat-01.md +11 -0
  175. package/tests/fixtures/suspect-zones/zh/natural/zh-nat-02.md +11 -0
  176. package/tests/fixtures/suspect-zones/zh/natural/zh-nat-03.md +11 -0
  177. package/tests/quality/README.md +121 -0
  178. package/tests/quality/benchmark.mjs +306 -0
  179. package/tests/quality/detectors.manual.example.json +31 -0
  180. package/tests/quality/dogfood.mjs +44 -0
package/README.md ADDED
@@ -0,0 +1,319 @@
1
+ <p align="center">
2
+ <a href="README_KR.md"><b>한국어</b></a> ·
3
+ <a href="README_ZH.md"><b>中文</b></a> ·
4
+ <a href="README_JA.md"><b>日本語</b></a> ·
5
+ <b>English</b>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <img src="assets/brand/patina-logo.svg" alt="patina — Strip the AI packaging. Keep the meaning." width="440">
10
+ </p>
11
+
12
+ <h1 align="center">patina</h1>
13
+
14
+ <p align="center">
15
+ <strong>Strip the AI packaging. Keep the meaning.</strong>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://github.com/devswha/patina/actions/workflows/test.yml"><img alt="Tests" src="https://github.com/devswha/patina/actions/workflows/test.yml/badge.svg"></a>
20
+ <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
21
+ <a href="#quick-start"><img alt="Skill: Claude Code | Codex | Cursor | OpenCode" src="https://img.shields.io/badge/Skill-Claude%20Code%20%7C%20Codex%20%7C%20Cursor%20%7C%20OpenCode-blueviolet"></a>
22
+ <a href="https://github.com/devswha/patina"><img alt="Languages: KO | EN | ZH | JA" src="https://img.shields.io/badge/Languages-KO%20%7C%20EN%20%7C%20ZH%20%7C%20JA-green"></a>
23
+ <a href="CHANGELOG.md"><img alt="Version 3.11.0" src="https://img.shields.io/badge/version-3.11.0-blue"></a>
24
+ </p>
25
+
26
+ patina looks for AI-sounding patterns in Korean, English, Chinese, and Japanese, then rewrites them without changing the claim. Use it as a skill for [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Codex CLI](https://github.com/openai/codex), [Cursor](https://cursor.sh), and OpenCode, or run it as a standalone Node.js CLI.
27
+
28
+ It is not a black-box paraphraser. patina is **pattern-based and auditable**: it shows what changed, why it changed, and whether the original claims were preserved.
29
+
30
+ ## Demo
31
+
32
+ **Before** *(AI-sounding)*:
33
+ > Coffee has emerged as a **pivotal cultural phenomenon** that has **fundamentally transformed** social interactions across the globe. This beloved beverage serves as a catalyst for community building, fosters meaningful connections, and facilitates cross-cultural dialogue.
34
+
35
+ **After** *(`/patina --lang en` — same claims, AI packaging removed)*:
36
+ > Coffee has quietly changed how people meet. Sit across from someone long enough, and something like a real connection tends to form — even between people from very different cultures.
37
+
38
+ > **MPS = 100** · cultural transformation ✓ · community building ✓ · meaningful connections ✓ · cross-cultural dialogue ✓
39
+
40
+ **More demo slices**
41
+
42
+ | Input type | AI packaging removed | Preserved meaning |
43
+ |---|---|---|
44
+ | Korean marketing | “혁신적인 솔루션”, “새로운 패러다임” | 30 Notion templates, workflow fit, copy-and-edit usage |
45
+ | Academic | “획기적인 성과”, broad significance claims | 60 GitHub projects, 72h→10m setup time, p<0.01, limits noted |
46
+ | Technical | “핵심적인 역할”, future-standard hype | GPU management, one-command provisioning, 5× result caveat |
47
+
48
+ Try it quickly: [30-second terminal demo](docs/DEMO.md). More examples: [Before/After Gallery](docs/EXAMPLES.md) ([한국어](docs/EXAMPLES_KR.md)).
49
+ Brand assets: [logo](assets/brand/patina-logo.svg), [icon](assets/brand/patina-icon.svg),
50
+ [social preview](assets/social/patina-og.svg), and [before/after card](assets/social/patina-before-after.svg).
51
+ Usage notes: [BRANDING.md](docs/BRANDING.md).
52
+
53
+ ## At a Glance
54
+
55
+ | | |
56
+ |---|---|
57
+ | **160 patterns** | 40 KO + 40 EN + 40 ZH + 40 JA (each incl. 8 score-only viral-hook) — see [PATTERNS.md](docs/PATTERNS.md) |
58
+ | **Editing hotspot recall** | 91% Korean [84.0–95.4%] (n=100) / 76% English [66.7–83.3%] (n=100), binomial 95% CI |
59
+ | **Benchmark report** | Reproducible ko/en/zh/ja suspect-zone benchmark: [latest.md](docs/benchmarks/latest.md) · [latest.json](docs/benchmarks/latest.json) · [detector comparison](docs/benchmarks/detector-comparison.md) |
60
+ | **False positives** | 13–25% point-estimate range across human registers *(not a CI; boundary intrinsic to encyclopedic register, [documented](core/stylometry.md))* |
61
+ | **Modes** | rewrite · audit · score · diff · ouroboros |
62
+ | **Free tier** | Yes — via `codex` CLI (no API key) |
63
+ | **Determinism** | Scoring formula is deterministic; LLM severity assignment ±8–10 pt per run ([scoring.md §8](core/scoring.md)) |
64
+ | **License** | MIT |
65
+
66
+ ## Quick Start
67
+
68
+ ### As a Claude Code or Codex CLI skill
69
+
70
+ ```bash
71
+ curl -fsSL https://raw.githubusercontent.com/devswha/patina/main/install.sh | bash
72
+ ```
73
+
74
+ The installer wires patina into Claude Code, [Codex CLI](https://github.com/openai/codex), Cursor, and OpenCode. It resolves the repository HEAD to a concrete commit before checkout; set `PATINA_REF=<tag-or-full-sha>` when you need a fully pinned install. Then:
75
+
76
+ ```
77
+ /patina --lang en
78
+
79
+ [paste your text here]
80
+ ```
81
+
82
+ Rewrite with a specific tone:
83
+
84
+ ```
85
+ /patina --tone narrative
86
+
87
+ [paste your essay draft here]
88
+ ```
89
+
90
+ Auto-detect and apply the best-fit tone:
91
+
92
+ ```
93
+ /patina --tone auto --lang en
94
+
95
+ [paste your text here]
96
+ ```
97
+
98
+ ### As a standalone CLI
99
+
100
+ Requires Node.js ≥ 18. After the npm release is cut, use the package directly:
101
+
102
+ ```bash
103
+ npx patina-cli init --defaults
104
+ npx patina-cli doctor
105
+ npx patina-cli --lang en input.txt
106
+ ```
107
+
108
+ Until then, or when you want to hack on the repo:
109
+
110
+ ```bash
111
+ git clone https://github.com/devswha/patina.git
112
+ cd patina && npm install && npm link
113
+ patina --lang en input.txt
114
+ ```
115
+
116
+ Or try stdin after linking:
117
+
118
+ ```bash
119
+ printf '%s\n' 'Coffee has emerged as a pivotal cultural phenomenon that has fundamentally transformed social interactions across the globe.' \
120
+ | patina --lang en --backend codex-cli
121
+ ```
122
+
123
+ > 🆓 **No API key required** if you have any of [`codex`](https://github.com/openai/codex), [`claude`](https://docs.anthropic.com/en/docs/claude-code), or [`gemini`](https://github.com/google-gemini/gemini-cli) CLIs logged in. Pick one with `--backend codex-cli | claude-cli | gemini-cli`, declare an explicit fallback chain such as `--backend claude-cli,codex-cli`, or let the model heuristic route automatically (`--model claude-*` → claude-cli, etc.). See [AUTHENTICATION.md](docs/AUTHENTICATION.md) for the full backend list.
124
+
125
+ ### CI integrations
126
+
127
+ Patina also ships a no-key, deterministic CI check for prose review:
128
+
129
+ ```yaml
130
+ # .github/workflows/patina.yml
131
+ steps:
132
+ - uses: actions/checkout@v6
133
+ - uses: devswha/patina-action@main # use @v1 after npm publish + action tag
134
+ with:
135
+ patina-package: github:devswha/patina # remove after patina-cli@latest is on npm
136
+ report-threshold: 30
137
+ comment: true
138
+ ```
139
+
140
+ Docker image publishing is tracked separately from the npm release path. Until
141
+ the GHCR image is published, build the local image when you need a container:
142
+
143
+ ```bash
144
+ docker build -t patina:local .
145
+ printf '%s\n' 'Coffee has emerged as a pivotal cultural phenomenon.' \
146
+ | docker run --rm -i -e PATINA_API_KEY patina:local --lang en --provider openai
147
+ ```
148
+
149
+ Pre-commit, Husky, Lefthook, Docker, and release workflow notes live in [docs/integrations/](docs/integrations/).
150
+
151
+ ## Intended Use
152
+
153
+ Use Patina for post-AI editing, audit trails, and voice cleanup when the author is allowed to use AI assistance. It does not promise that text was “originally human,” and it should not be used for academic honor-code evasion, publisher disclosure circumvention, plagiarism laundering, or detector-bypass claims. See [ETHICS.md](docs/ETHICS.md).
154
+
155
+ ## Modes
156
+
157
+ ```
158
+ patina --lang <ko|en|zh|ja> [mode] [--profile <name>] input.txt
159
+ ```
160
+
161
+ | Flag | What it does |
162
+ |------|-------------|
163
+ | *(default)* | Rewrite |
164
+ | `--audit` | Detect AI patterns only |
165
+ | `--score` | 0–100 AI-likeness score with category breakdown |
166
+ | `--score --exit-on <n>` | Keep CI strict: exit code `3` when `overall > n` (`--gate` is kept as an alias) |
167
+ | `--diff` | Show changes pattern by pattern |
168
+ | `--ouroboros` | Iterate the rewrite until score converges (with MPS rollback) |
169
+ | `--lang <ko\|en\|zh\|ja>` | Select language (default: `ko`) |
170
+ | `--profile <name>` | Tone preset: `blog`, `academic`, `technical`, `formal`, `social`, `email`, `legal`, `medical`, `marketing`, `narrative`, `instructional`, `casual-conversation`, `code-comment`, `commit-message`, `release-notes` |
171
+ | `--tone <name>` | Tone category: `casual`, `professional`, `academic`, `narrative`, `marketing`, `instructional`, `auto` |
172
+ | `--batch` | Treat positional args as a list of files (e.g. `--batch docs/*.md`) |
173
+ | `--format json\|text\|markdown` | Select machine-readable JSON, plain text, or default Markdown output |
174
+ | `--quiet` | Suppress status, warning, and progress logs on stderr |
175
+ | `--json-logs` | Emit stderr logs as NDJSON with `level`, `event`, `model`, and `latency_ms` fields |
176
+ | `--prompt-mode strict\|minimal\|auto` | Choose full pattern-pack prompting, compressed prompting, or backend-aware auto |
177
+ | `--variants <1-5>` | Generate multiple rewrite variants with the same facts and meaning anchors |
178
+
179
+ `patina --help` for the full flag list. `patina doctor --json` checks Node/backend/tmux/API-key readiness without making an LLM call, and `patina init` writes a project `.patina.yaml`.
180
+
181
+ Dev-native profile shortcuts are available for Markdown-heavy engineering workflows:
182
+ `code-comment` tightens inline comments/docstrings, `commit-message` rewrites Git history text around intent and verification, and `release-notes` turns changelog bullets into user-impact notes with migration risks visible.
183
+
184
+ ### Score-only patterns
185
+
186
+ `--score` and `--audit` measure a slightly broader set of signals than `--rewrite` does. The viral-hook packs (`ko/en/zh/ja-viral-hook`, 8 patterns each: shock-number hooks, clickbait closings, source-skipping authority claims, breath-optimized short-sentence stacking, hyperbolic engagement lexicon, fake-stat citations, stacked credentials, future-self/parasocial promises) are **detection-only**.
187
+
188
+ They appear in score and audit output so the benchmark matches human intuition for SNS-style marketing copy across all four languages. `--rewrite`/`--diff`/`--ouroboros` skip them because those signals are often intentional rhetoric. Real-world demos: [`examples/viral-hook/`](examples/viral-hook/).
189
+
190
+ ### Prompt-mode tuning (v3.11)
191
+
192
+ `--prompt-mode strict|minimal|auto` lets you trade off between the full pattern packs (~34KB structured prompt) and a compressed casual instruction (~3KB). `auto` picks per backend — Gemini does better on minimal (it gets over-constrained by long structured prompts), while Claude leverages the full packs and Codex is roughly insensitive. case-05 documents the A/B.
193
+
194
+ ### Multiple stylistic variants (v3.11)
195
+
196
+ `--variants <1-5>` asks the model for N voice variants of the rewrite in one call (e.g., V1 casual, V2 direct, V3 measured) — facts, numbers, and causation stay identical across variants. Each comes back as `## Variant N` so you can pick the voice you want.
197
+
198
+ ### Short-text scoring boost (v3.11)
199
+
200
+ For inputs ≤200 chars or ≤3 paragraphs, register-sensitive categories (`language`, `style`, `viral-hook`) get a 1.5× severity multiplier so single-paragraph voice shifts surface in the score. case-04 found these were undercounted by the long-text formula.
201
+
202
+ ### Self-audit isolation (v3.11)
203
+
204
+ In rewrite mode, the model emits its self-audit notes inside `[SELF_AUDIT]`/`[/SELF_AUDIT]` tags wrapped around a `[BODY]`/`[/BODY]` block (or `[VARIANT n]` blocks when `--variants > 1`). patina strips the audit before showing the user, so raw output is clean — earlier versions sometimes leaked phrases like "남아 있는 AI 티" or "Phase 3" preambles into the user-facing text.
205
+
206
+ ### Machine-readable output and exit codes
207
+
208
+ `--format json` wraps every mode in a stable envelope with `overall`, `categories[]`, `tone`, `mps`, `gateResult`, and the cleaned `output` body. `--json-logs` keeps stderr machine-readable as NDJSON, while `--quiet` silences status/warning/progress logs for scripts that only want stdout. `--format markdown` is the default; `--format text` keeps the user-facing body without the YAML tone footer. Exit codes are standardized in [EXIT-CODES.md](docs/EXIT-CODES.md): `0` success, `1` runtime/backend, `2` input/usage, `3` score gate exceeded, `4` MAX MPS fallback/all-candidates-failed.
209
+
210
+ ### Score weight drift detection (v3.11)
211
+
212
+ `--score` runs cross-check the Weight column the model emits against your config's `category-weights`. If the model invents a category (e.g., `discord`) or substitutes a different number, `[patina]` warnings hit stderr — observability only, the weight check itself doesn't alter the score. A deterministic shadow score from `src/features/*` is also recorded; when it differs from the LLM score by more than 20 points, patina warns and uses the more pessimistic value for gates.
213
+
214
+ `--save-run <dir>` now writes manifest schema v2: result entries include prompt and response hashes, available input/output token counts, temperature/seed, score details, per-call cost when a provider returns it, and Ouroboros iteration logs.
215
+
216
+ For repeat benchmarks, opt into the HTTP response cache with `--cache <dir>` or `PATINA_CACHE_DIR`. Cache keys include prompt, model, temperature, and API host; `--cache-ttl <sec>` controls expiry and `--no-cache` bypasses it for fresh runs. Patina prints hit/miss/write stats at the end of cached runs.
217
+
218
+ Use `--voice-sample <path>` or `voice-sample: <path>` in config to anchor rewrites to 1–3 paragraphs you wrote. Profile and tone still set the requested register; the sample only teaches cadence, specificity, POV, and sentence texture, and the prompt explicitly forbids importing sample facts.
219
+
220
+ ## Tones
221
+
222
+ `--tone` selects a named voice axis applied on top of pattern rewriting. Resolution order: `--tone` CLI > `tone:` config > `profile:` config.
223
+
224
+ | Tone | Intended for | Key behaviors |
225
+ |------|-------------|---------------|
226
+ | `casual` | Blog posts, social content, personal notes | Contractions, first-person, emoticons OK, low formality |
227
+ | `professional` | Work emails, reports, business writing | Clear and concise, formal but not stiff; legal/medical sub-profiles force fidelity floor |
228
+ | `academic` | Papers, research summaries, technical analysis | Objective, evidence-oriented, minimal first-person |
229
+ | `narrative` | Personal essays, memoir, experience-based writing | First-person anchor, scene detail, emotional presence, time flow |
230
+ | `marketing` | Ad copy, landing pages, product announcements | Short impact sentences, persuasive, CTA-friendly |
231
+ | `instructional` | Tutorials, how-to guides, technical docs | Imperative verbs, numbered structure, hedging suppressed |
232
+
233
+ `--tone auto` runs heuristic detection (lexical + structural signals) and selects the best-fit tone. zh/ja with any tone (including `auto`) emits a warning and falls back to profile-only mode — Phase 4.5b heuristics only cover ko/en.
234
+
235
+ ### MAX mode
236
+
237
+ Run the same text through Claude, Codex, and Gemini independently. The lowest AI-score result that passes MPS ≥ 70 wins:
238
+
239
+ ```
240
+ /patina-max
241
+
242
+ [paste your text here]
243
+ ```
244
+
245
+ `/patina-max` uses tmux panes for parallel local-CLI dispatch when `dispatch: omc` is enabled. If tmux is unavailable, pass `--dispatch direct` for the no-tmux path; it runs the selected models sequentially and can take roughly one model timeout per model. When `dispatch: omc` falls back automatically outside tmux, Patina prints the expected sequential-vs-parallel wall-clock warning.
246
+
247
+ Standalone CLI MAX (`patina --models ...`) caps HTTP fanout at `min(models, 3)` by default to avoid quota storms on free-tier providers. Pass `--max-concurrency <n>` to tune the cap, or `--max-concurrency 0` only when you intentionally want unlimited parallel requests.
248
+
249
+ ## How It Works
250
+
251
+ ```
252
+ Input
253
+
254
+ [Step 4.5] Semantic anchor extraction (claims, polarity, causation, numbers)
255
+ [Step 4.6] Stylometric pre-pass (burstiness CV + MATTR; zh/ja character-token fallback)
256
+ [Step 4.7] AI-lexicon overlap (~108 EN / 102 KO entries)
257
+ [Phase 1] Structure scan + anchor verification
258
+ [Phase 2] Sentence rewrite + anchor verification
259
+ [Phase 3] Self-audit (polarity, regression, MPS)
260
+
261
+ Natural-sounding text (meaning verified)
262
+ ```
263
+
264
+ If meaning drifts at any verification step, the change is retried or rolled back.
265
+
266
+ **Calibration** *(500-paragraph corpus, reproducible via `.omc/research/v3_8_remeasure.py`)*: 76% editing-hotspot recall on HC3 ChatGPT (en) [66.7–83.3%] and 91% on paired ko/AI corpus [84.0–95.4%], each n=100 with binomial 95% CI. Human-prose false positives are reported separately as a 13–25% point-estimate range across registers, not as a confidence interval. Acceptance gates: AI ≥ 75%, max FP ≤ 25%. See [stylometry.md](core/stylometry.md) for the algorithm.
267
+
268
+ ## Configuration
269
+
270
+ ```yaml
271
+ # .patina.default.yaml
272
+ version: "3.11.0"
273
+ language: ko # ko | en | zh | ja
274
+ profile: default
275
+ output: rewrite # rewrite | diff | audit | score
276
+ tone: # casual | professional | academic | narrative | marketing | instructional | auto
277
+ max-models: [claude, gemini]
278
+ ```
279
+
280
+ Pattern packs are auto-discovered by language prefix. `.patina.yaml` in the working directory overrides defaults. List keys that extend detection (`blocklist`, `allowlist`, `skip-patterns`) merge additively across default/global/project configs; provider lists such as `max-models` replace so users can choose an exact backend set.
281
+
282
+ ## Documentation
283
+
284
+ - **[Cookbook](docs/COOKBOOK.md)** — practical recipes (Hugo batch scoring, GitHub Actions, MAX-mode comparison, false-positive triage, custom profiles, pre-commit)
285
+ - **[Glossary](docs/GLOSSARY.md)** — short definitions for MPS, fidelity, burstiness, MATTR, modes, and other recurring terms
286
+ - **[Demo](docs/DEMO.md)** — terminal transcript and multi-genre before/after snapshots
287
+ - **[Patterns](docs/PATTERNS.md)** — full 160-pattern catalog
288
+ - **[Authentication](docs/AUTHENTICATION.md)** ([한국어](docs/AUTHENTICATION_KR.md)) — backends, providers, free-tier setup
289
+ - **[GitHub Action](docs/integrations/github-action.md)** — PR hotspot comments without a live model key
290
+ - **[Pre-commit](docs/integrations/pre-commit.md)** — pre-commit, Husky, and Lefthook score-only recipes
291
+ - **[Docker](docs/integrations/docker.md)** — GHCR image usage and release tags
292
+ - **[Release workflow](docs/integrations/release.md)** — npm provenance + GHCR publishing checklist
293
+ - **[CLI Contract](docs/CLI.md)** — score gate, JSON/text/Markdown output, and automation-safe surfaces
294
+ - **[Flag Parity](docs/FLAG-PARITY.md)** — standalone CLI vs `/patina` vs `/patina-max` option support
295
+ - **[Exit Codes](docs/EXIT-CODES.md)** — process code contract for CI and editor integrations
296
+ - **[Ethics](docs/ETHICS.md)** — intended use, non-use, and disclosure stance
297
+ - **[FAQ](docs/FAQ.md)** ([한국어](docs/FAQ_KR.md)) — detector-bypass concerns, MPS, false positives, contribution starting points
298
+ - **[Comparison](docs/COMPARISON.md)** — factual comparison with common paraphraser/humanizer tools
299
+ - **[Branding](docs/BRANDING.md)** — canonical logo/social assets and OG setup notes
300
+ - **[Design](DESIGN.md)** — product/brand source of truth for repo-native SVG and README surfaces
301
+ - **[Roadmap](docs/ROADMAP.md)** — quality, benchmark, product, community, and launch priorities
302
+ - **[Benchmark Report](docs/benchmarks/latest.md)** — latest reproducible suspect-zone benchmark summary
303
+ - **[Detector Comparison Harness](docs/benchmarks/detector-comparison.md)** — offline/manual comparison protocol for third-party detectors
304
+ - **[AI/Human Metrics Research](docs/research/ai-human-metrics.md)** — benchmark design notes for measuring AI-like writing signals
305
+ - **[2025+ Re-baseline Plan](docs/research/2025-rebaseline-plan.md)** — evidence gate before broader model-era claims
306
+ - **[Launch Copy](docs/social/patina-launch-copy.md)** — Show HN, Reddit, X, Korean community drafts
307
+ - **[Stylometry](core/stylometry.md)** — burstiness + MATTR + AI-lexicon algorithm
308
+ - **[Scoring](core/scoring.md)** — AI-likeness + fidelity + MPS
309
+ - **[Changelog](CHANGELOG.md)** — release notes and methodology
310
+ - **[Contributing](CONTRIBUTING.md)** ([한국어](CONTRIBUTING_KR.md)) — pattern submissions, false-positive triage, benchmark fixtures, versioning
311
+ - **[Governance](GOVERNANCE.md)** / **[Maintainers](MAINTAINERS.md)** — lightweight project decision rules
312
+
313
+ ## Acknowledgements
314
+
315
+ Inspired by [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh)'s plugin architecture (patterns are plugins, profiles are themes), [Wikipedia's "Signs of AI writing"](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing) catalog, and [blader/humanizer](https://github.com/blader/humanizer).
316
+
317
+ ## License
318
+
319
+ MIT
package/README_JA.md ADDED
@@ -0,0 +1,254 @@
1
+ **[한국어](README_KR.md)** | **[English](README.md)** | **[中文](README_ZH.md)** | 日本語
2
+
3
+ # patina
4
+
5
+ [![Tests](https://github.com/devswha/patina/actions/workflows/test.yml/badge.svg)](https://github.com/devswha/patina/actions/workflows/test.yml)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Skill](https://img.shields.io/badge/Skill-Claude%20Code%20%7C%20Codex%20%7C%20Cursor%20%7C%20OpenCode-blueviolet)](#クイックスタート)
8
+ [![Multi-language](https://img.shields.io/badge/Languages-KO%20%7C%20EN%20%7C%20ZH%20%7C%20JA-green)](https://github.com/devswha/patina)
9
+ [![Version](https://img.shields.io/badge/version-3.11.0-blue)](CHANGELOG.md)
10
+
11
+ > **AI の装飾だけを剥がし、意味はそのまま。**
12
+
13
+ patina は、韓国語・英語・中国語・日本語の文章から AI っぽさの強いパターンを見つけ、意味を変えずに書き換えます。[Claude Code](https://docs.anthropic.com/en/docs/claude-code)、[Codex CLI](https://github.com/openai/codex)、[Cursor](https://cursor.sh)、OpenCode 向けのスキルとして使うことも、スタンドアロン Node.js CLI として実行することもできます。
14
+
15
+ 一般的なパラフレーザーのようなブラックボックスではありません。patina は **パターンベースで監査可能**で、何をなぜ変更したか、原文の主張が保たれているかを示します。
16
+
17
+ ## デモ
18
+
19
+ **修正前** *(AI 風の文章)*:
20
+ > コーヒーは、世界中の社会的交流を**根本的に変革した****中核的な文化現象**として台頭してきました。この愛される飲料はコミュニティ構築の触媒として機能し、意義ある繋がりを促進し、異文化間の対話を導いています。
21
+
22
+ **修正後** *(`/patina --lang ja` — 同じ内容、AI 装飾のみ除去)*:
23
+ > コーヒーは、人の会い方をかなり変えてきたと思う。誰かと向かい合って座っているうちに自然と関係ができるし、文化が違う人同士でも会話が生まれやすくなる。
24
+
25
+ > **MPS = 100** · 社会的交流の変革 ✓ · コミュニティ構築 ✓ · 意義ある繋がり ✓ · 異文化間の対話 ✓
26
+
27
+ ## 概要
28
+
29
+ | | |
30
+ |---|---|
31
+ | **160 パターン** | 韓国語 40 + 英語 40 + 中国語 40 + 日本語 40 (各8個のスコア専用 viral-hook を含む) — [PATTERNS.md](docs/PATTERNS.md) |
32
+ | **編集ホットスポット再現率** | 韓国語 91% [84.0–95.4%] (n=100) / 英語 76% [66.7–83.3%] (n=100), binomial 95% CI |
33
+ | **誤検出率** | 人間文章レジスター別 13–25% の点推定範囲 *(CI ではない;百科事典体の本質的限界、[文書化済み](core/stylometry.md))* |
34
+ | **モード** | rewrite · audit · score · diff · ouroboros |
35
+ | **無料利用** | 可能 — `codex` CLI 経由 (API キー不要) |
36
+ | **決定性** | スコアリング式は決定的、LLM の severity 判定段階に ±8–10pt の変動 ([scoring.md §8](core/scoring.md)) |
37
+ | **ライセンス** | MIT |
38
+
39
+ ## クイックスタート
40
+
41
+ ### Claude Code または Codex CLI スキルとして
42
+
43
+ ```bash
44
+ curl -fsSL https://raw.githubusercontent.com/devswha/patina/main/install.sh | bash
45
+ ```
46
+
47
+ インストーラは Claude Code、[Codex CLI](https://github.com/openai/codex)、Cursor、OpenCode に一括で接続します。checkout 前に repository HEAD を具体的な commit に解決します。完全に固定したインストールが必要な場合は `PATINA_REF=<tag-or-full-sha>` を設定してください。続いて:
48
+
49
+ ```
50
+ /patina --lang ja
51
+
52
+ [ここにテキストを貼り付け]
53
+ ```
54
+
55
+ 特定のトーンで書き換え:
56
+
57
+ ```
58
+ /patina --tone narrative
59
+
60
+ [ここにエッセイの下書きを貼り付け]
61
+ ```
62
+
63
+ 最適なトーンを自動検出:
64
+
65
+ ```
66
+ /patina --tone auto --lang en
67
+
68
+ [ここにテキストを貼り付け]
69
+ ```
70
+
71
+ > 注意:v1 では `--tone`(`auto` 含む)は ko/en のみ対応。zh/ja では警告を出して profile-only モードにフォールバックします。
72
+
73
+ ### スタンドアロン CLI として
74
+
75
+ Node.js ≥ 18 が必要です。
76
+
77
+ ```bash
78
+ git clone https://github.com/devswha/patina.git
79
+ cd patina && npm install && npm link
80
+ patina --lang ja input.txt
81
+ ```
82
+
83
+ link 後に stdin でも試せます:
84
+
85
+ ```bash
86
+ printf '%s\n' 'コーヒーは、世界中の社会的交流を根本的に変えた重要な文化現象として浮上しました。' \
87
+ | patina --lang ja --backend codex-cli
88
+ ```
89
+
90
+ > 🆓 **API キー不要** — [`codex`](https://github.com/openai/codex)、[`claude`](https://docs.anthropic.com/en/docs/claude-code)、[`gemini`](https://github.com/google-gemini/gemini-cli) のいずれか CLI にログイン済みであれば OK。`--backend codex-cli | claude-cli | gemini-cli` で直接選択するか、`--model claude-*` / `--model gemini-*` のようにモデル名でルーティングできます。全バックエンドは [AUTHENTICATION.md](docs/AUTHENTICATION.md) を参照。
91
+
92
+ ### CI integrations
93
+
94
+ Patina には、live model key なしで使える deterministic な prose review CI チェックもあります:
95
+
96
+ ```yaml
97
+ # .github/workflows/patina.yml
98
+ steps:
99
+ - uses: actions/checkout@v6
100
+ - uses: devswha/patina-action@main # npm publish + Action タグ後は @v1 を使用
101
+ with:
102
+ patina-package: github:devswha/patina # patina-cli@latest が npm に出たら削除
103
+ report-threshold: 30
104
+ comment: true
105
+ ```
106
+
107
+ Pre-commit、Husky、Lefthook、Docker、release workflow のメモは [docs/integrations/](docs/integrations/) にあります。
108
+
109
+ ## 想定用途
110
+
111
+ Patina は、著者が AI 支援を使ってよい場面で、AI 後編集、audit trail、voice cleanup を行うためのツールです。テキストが「もともと人間によって書かれた」ことを約束するものではなく、学業上の honor-code 回避、出版社 disclosure の迂回、盗用の洗浄、detector-bypass 主張に使うべきではありません。[ETHICS.md](docs/ETHICS.md) を参照してください。
112
+
113
+ ## モード
114
+
115
+ ```
116
+ patina --lang <ko|en|zh|ja> [モード] [--profile <名前>] input.txt
117
+ ```
118
+
119
+ | フラグ | 機能 |
120
+ |--------|------|
121
+ | *(デフォルト)* | 書き換え |
122
+ | `--audit` | AI パターン検出のみ |
123
+ | `--score` | 0–100 AI 類似度スコア + カテゴリ別内訳 |
124
+ | `--score --exit-on <n>` | CI を厳格に保つ: `overall > n` の場合は終了コード `3`(`--gate` は alias) |
125
+ | `--diff` | 変更箇所をパターンごとに表示 |
126
+ | `--ouroboros` | スコア収束まで反復(MPS ロールバック付き) |
127
+ | `--lang <ko\|en\|zh\|ja>` | 言語選択(デフォルト:`ko`) |
128
+ | `--profile <名前>` | トーンプリセット:`blog`, `academic`, `technical`, `formal`, `social`, `email`, `legal`, `medical`, `marketing`, `narrative`, `instructional`, `casual-conversation` |
129
+ | `--tone <名前>` | トーンカテゴリ:`casual`, `professional`, `academic`, `narrative`, `marketing`, `instructional`, `auto` |
130
+ | `--batch` | 位置引数をファイル一覧として処理(例:`--batch docs/*.md`) |
131
+ | `--format json\|text\|markdown` | JSON、プレーンテキスト、デフォルト Markdown 出力を選択 |
132
+ | `--prompt-mode strict\|minimal\|auto` | 完全なパターンパック、圧縮プロンプト、またはバックエンド別 auto を選択 |
133
+ | `--variants <1-5>` | 同じ事実と意味アンカーを保った複数の rewrite バリアントを生成 |
134
+
135
+ 全オプションは `patina --help`。
136
+
137
+ ### スコア専用パターン
138
+
139
+ `--score`と`--audit`は`--rewrite`より少し広い範囲のシグナルを測定します。viral-hook パック(`ko/en/zh/ja-viral-hook`、各8パターン: 数字ショックフック、クリックベイト末尾、出典を飛ばした権威主張、息継ぎに最適化された短文の積み重ね、誇張されたエンゲージメント語彙、偽統計引用、肩書き積み上げ、未来の自分への約束)は**検出専用**です。
140
+
141
+ これらのシグナルはスコアと監査にだけ現れ、4言語のSNSマーケティングコピーに対するユーザーの直感とベンチマークを揃えるために使います。`--rewrite`/`--diff`/`--ouroboros` は、意図的な修辞であることが多いので対象外です。実例: [`examples/viral-hook/`](examples/viral-hook/).
142
+
143
+ ### プロンプトモード調整 (v3.11)
144
+
145
+ `--prompt-mode strict|minimal|auto` では、完全なパターンパック(約34KBの構造化プロンプト)と圧縮されたカジュアル指示(約3KB)のどちらを使うかを調整できます。`auto` はバックエンドごとに選択します — Gemini は minimal の方が良く(長い構造化プロンプトで過度に制約されるため)、Claude は完全なパックを活用し、Codex はおおむね影響を受けません。case-05 が A/B を記録しています。
146
+
147
+ ### 複数の文体バリアント (v3.11)
148
+
149
+ `--variants <1-5>` は、1回の呼び出しで N 個のリライト音声バリアントを求めます(例: V1 casual、V2 direct、V3 measured)。事実、数値、因果関係はすべてのバリアントで同一に保たれます。各結果は `## Variant N` として返るため、必要な声色を選べます。
150
+
151
+ ### 短文スコアリング補正 (v3.11)
152
+
153
+ 入力が200文字以下、または3段落以下の場合、register に敏感なカテゴリ(`language`、`style`、`viral-hook`)へ 1.5 倍の severity multiplier を適用し、単一段落の声色変化もスコアに反映されるようにします。case-04 では、長文向けの式がこれらを過小評価していたことが確認されました。
154
+
155
+ ### セルフ監査の分離 (v3.11)
156
+
157
+ rewrite モードでは、モデルは `[BODY]`/`[/BODY]` ブロック(`--variants > 1` の場合は `[VARIANT n]` ブロック)を囲む `[SELF_AUDIT]`/`[/SELF_AUDIT]` タグの中にセルフ監査メモを出力します。patina はユーザーに表示する前に監査部分を取り除くため、出力はクリーンです — 以前のバージョンでは "남아 있는 AI 티" や "Phase 3" のような前置きがユーザー向けテキストに漏れることがありました。
158
+
159
+ ### Machine-readable output and exit codes
160
+
161
+ `--format json` は、すべてのモードを `overall`、`categories[]`、`tone`、`mps`、`gateResult`、クリーンな `output` 本文を含む安定した envelope で包みます。`--format markdown` がデフォルトで、`--format text` は YAML tone footer なしのユーザー向け本文だけを保持します。終了コードは [EXIT-CODES.md](docs/EXIT-CODES.md) にまとまっています: `0` success、`1` runtime/backend、`2` input/usage、`3` score gate exceeded、`4` MAX MPS fallback/all-candidates-failed。
162
+
163
+ ### スコア重みドリフト検出 (v3.11)
164
+
165
+ `--score` 実行時は、モデルが出力した Weight 列を設定の `category-weights` と照合します。モデルが存在しないカテゴリ(例: `discord`)を作ったり、別の数値に置き換えたりした場合、stderr に `[patina]` 警告が出ます — これは観測用であり、スコア自体は変更しません。
166
+
167
+ ## トーン
168
+
169
+ `--tone` はパターン書き換えの上に重ねる、名前付きの声色軸です。優先順位:`--tone` CLI > `tone:` 設定 > `profile:` 設定。
170
+
171
+ | トーン | 用途 | 主な特徴 |
172
+ |--------|------|----------|
173
+ | `casual` | ブログ、SNS、個人メモ | 短縮形、一人称、絵文字 OK、低い形式度 |
174
+ | `professional` | 業務メール、レポート、ビジネス文書 | 明確で簡潔、形式的だが堅すぎない(legal/medical サブプロファイルは fidelity 下限を強制) |
175
+ | `academic` | 論文、研究要旨、技術分析 | 客観的、根拠重視、一人称は最小限 |
176
+ | `narrative` | 個人エッセイ、回想録、体験談 | 一人称基点、シーンの細部、感情の存在感 |
177
+ | `marketing` | 広告コピー、ランディングページ、製品告知 | 短くインパクトのある文、説得力、CTA 親和 |
178
+ | `instructional` | チュートリアル、ハウツー、技術ドキュメント | 命令形動詞、番号付き構造、推測表現を抑制 |
179
+
180
+ `--tone auto` はヒューリスティック(語彙 + 構造シグナル)で最適なトーンを自動選択します。zh/ja では `auto` を含む全トーン指定時に警告を出して profile-only モードにフォールバックします — Phase 4.5b ヒューリスティックは ko/en のみ対応のためです。
181
+
182
+ ### MAX モード
183
+
184
+ 同じテキストを Claude、Codex、Gemini に独立に通します。MPS ≥ 70 を満たす中で最もスコアが低い(最も人間らしい)結果が採用されます:
185
+
186
+ ```
187
+ /patina-max
188
+
189
+ [ここにテキストを貼り付け]
190
+ ```
191
+
192
+ ## 仕組み
193
+
194
+ ```
195
+ 入力
196
+
197
+ [ステップ 4.5] セマンティックアンカー抽出 (主張、極性、因果、数値)
198
+ [ステップ 4.6] 文体統計プリパス (burstiness CV + MATTR)
199
+ [ステップ 4.7] AI 語彙オーバーラップ (英 ~108 / 韓 102 項目)
200
+ [フェーズ 1] 構造スキャン + アンカー検証
201
+ [フェーズ 2] 文章リライト + アンカー検証
202
+ [フェーズ 3] セルフ監査 (極性、回帰、MPS)
203
+
204
+ 自然なテキスト(意味検証済み)
205
+ ```
206
+
207
+ 各検証ステップで意味が損なわれた場合、変更は再試行またはロールバックされます。
208
+
209
+ **キャリブレーション** *(500 段落コーパス、`.omc/research/v3_8_remeasure.py` で再現可能)*:HC3 ChatGPT (en) 編集ホットスポット再現率 76% [66.7–83.3%]、paired ko/AI コーパス 91% [84.0–95.4%](各 n=100、binomial 95% CI)。人間文章の誤検出はレジスター別 13–25% の点推定範囲として別に報告します。受け入れ基準:AI ≥ 75%、最大 FP ≤ 25%。アルゴリズムは [stylometry.md](core/stylometry.md)。
210
+
211
+ ## 設定
212
+
213
+ ```yaml
214
+ # .patina.default.yaml
215
+ version: "3.11.0"
216
+ language: ko # ko | en | zh | ja
217
+ profile: default
218
+ output: rewrite # rewrite | diff | audit | score
219
+ tone: # casual | professional | academic | narrative | marketing | instructional | auto
220
+ max-models: [claude, gemini]
221
+ ```
222
+
223
+ パターンパックは言語プレフィックスで自動検出されます。作業ディレクトリの `.patina.yaml` がデフォルトを上書きします。検出を拡張するリストキー(`blocklist`、`allowlist`、`skip-patterns`)は default/global/project 設定の間で追加的にマージされ、`max-models` などの provider リストはユーザーが正確なバックエンド集合を選べるように置き換えられます。
224
+
225
+ ## ドキュメント
226
+
227
+ - **[Glossary](docs/GLOSSARY.md)** — MPS、fidelity、burstiness、MATTR、モードなどの反復用語の短い定義
228
+ - **[Demo](docs/DEMO.md)** — ターミナル transcript と複数ジャンルの before/after スナップショット
229
+ - **[Patterns](docs/PATTERNS.md)** — 160 パターンカタログ
230
+ - **[Authentication](docs/AUTHENTICATION.md)** — バックエンド、プロバイダ、無料ティア設定
231
+ - **[CLI Contract](docs/CLI.md)** — score gate、終了コード、自動化に安全なインターフェイス
232
+ - **[Flag Parity](docs/FLAG-PARITY.md)** — standalone CLI、`/patina`、`/patina-max` のオプション対応範囲
233
+ - **[Ethics](docs/ETHICS.md)** — 想定用途、禁止用途、disclosure 方針
234
+ - **[FAQ](docs/FAQ.md)** — detector-bypass の懸念、MPS、誤検出、貢献の始め方
235
+ - **[Comparison](docs/COMPARISON.md)** — 一般的な paraphraser/humanizer ツールとの事実ベース比較
236
+ - **[Branding](docs/BRANDING.md)** — canonical logo/social assets と OG 設定メモ
237
+ - **[Design](DESIGN.md)** — repo-native SVG と README surface の製品/ブランド基準
238
+ - **[Roadmap](docs/ROADMAP.md)** — 品質、ベンチマーク、プロダクト、コミュニティ、ローンチ優先事項
239
+ - **[Benchmark Report](docs/benchmarks/latest.md)** — 最新の再現可能な suspect-zone ベンチマーク要約
240
+ - **[AI/Human Metrics Research](docs/research/ai-human-metrics.md)** — AI-like writing signals 測定用ベンチマーク設計メモ
241
+ - **[Launch Copy](docs/social/patina-launch-copy.md)** — Show HN、Reddit、X、韓国コミュニティ向け下書き
242
+ - **[Stylometry](core/stylometry.md)** — burstiness + MATTR + AI 語彙アルゴリズム
243
+ - **[Scoring](core/scoring.md)** — AI 類似度 + 忠実度 + MPS
244
+ - **[Changelog](CHANGELOG.md)** — リリースノートと方法論
245
+ - **[Contributing](CONTRIBUTING.md)** — パターン提出、誤検出 triage、ベンチマーク fixture、バージョン管理
246
+ - **[Governance](GOVERNANCE.md)** / **[Maintainers](MAINTAINERS.md)** — 軽量なプロジェクト意思決定ルール
247
+
248
+ ## 着想元
249
+
250
+ [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) のプラグインアーキテクチャ(パターンがプラグイン、プロファイルがテーマ)、[Wikipedia: Signs of AI writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing)、[blader/humanizer](https://github.com/blader/humanizer)。
251
+
252
+ ## ライセンス
253
+
254
+ MIT