patina-cli 3.11.0 → 4.0.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 (193) hide show
  1. package/.patina.default.yaml +29 -29
  2. package/CHANGELOG.md +53 -0
  3. package/NOTICE +21 -0
  4. package/README.md +117 -224
  5. package/README_JA.md +134 -77
  6. package/README_KR.md +132 -74
  7. package/README_ZH.md +137 -80
  8. package/SKILL.md +11 -20
  9. package/artifacts/rebaseline-2025/README.md +147 -0
  10. package/artifacts/rebaseline-2025/human-controls.public.jsonl +250 -0
  11. package/artifacts/rebaseline-2025/intake.example.jsonl +2 -0
  12. package/artifacts/rebaseline-2025/intake.local.example.jsonl +25 -0
  13. package/artifacts/rebaseline-2025/prompts.template.jsonl +7 -0
  14. package/artifacts/rebaseline-2025/sources.ko-public.jsonl +39 -0
  15. package/assets/brand/patina-badge.svg +18 -0
  16. package/assets/brand/patina-mark.svg +8 -0
  17. package/assets/demo/README.md +79 -0
  18. package/core/scoring.md +12 -12
  19. package/core/standalone-prompt.md +3 -1
  20. package/core/stylometry.md +93 -22
  21. package/docs/API.md +1554 -0
  22. package/docs/AUTHENTICATION.md +50 -26
  23. package/docs/AUTHENTICATION_KR.md +54 -29
  24. package/docs/BRANDING.md +9 -8
  25. package/docs/CLI.md +55 -14
  26. package/docs/COOKBOOK.md +8 -21
  27. package/docs/DEMO.md +32 -5
  28. package/docs/EXIT-CODES.md +2 -3
  29. package/docs/FALSE-POSITIVES.md +63 -0
  30. package/docs/FAQ.md +9 -1
  31. package/docs/FAQ_KR.md +3 -1
  32. package/docs/FLAG-PARITY.md +33 -47
  33. package/docs/ISSUE-WAVES.md +57 -0
  34. package/docs/PATTERNS-EN.md +67 -3
  35. package/docs/PATTERNS-JA.md +68 -2
  36. package/docs/PATTERNS-KO.md +70 -7
  37. package/docs/PATTERNS-ZH.md +67 -3
  38. package/docs/PATTERNS.md +5 -5
  39. package/docs/RESEARCH-DOCS-PLATFORM.md +54 -0
  40. package/docs/ROADMAP.md +46 -66
  41. package/docs/TRANSLATIONESE-KO.md +51 -0
  42. package/docs/audits/2026-05-deep-research.md +3 -1
  43. package/docs/benchmarks/README.md +51 -0
  44. package/docs/benchmarks/detector-comparison.json +69 -9
  45. package/docs/benchmarks/detector-comparison.md +10 -5
  46. package/docs/benchmarks/katfish-ko-latest.json +657 -0
  47. package/docs/benchmarks/katfish-ko-latest.md +77 -0
  48. package/docs/benchmarks/latest.json +1183 -108
  49. package/docs/benchmarks/latest.md +84 -60
  50. package/docs/benchmarks/lexicon-freshness-en-2026-05-22.json +1121 -0
  51. package/docs/benchmarks/lexicon-freshness-en-2026-05-22.md +136 -0
  52. package/docs/benchmarks/rebaseline-latest.json +381 -0
  53. package/docs/benchmarks/rebaseline-latest.md +121 -0
  54. package/docs/benchmarks/register-stratified-latest.json +164 -0
  55. package/docs/benchmarks/register-stratified-latest.md +99 -0
  56. package/docs/benchmarks/register-stratified.md +43 -0
  57. package/docs/integrations/github-action.md +44 -11
  58. package/docs/integrations/playground.md +58 -0
  59. package/docs/integrations/pre-commit.md +5 -5
  60. package/docs/integrations/release.md +5 -3
  61. package/docs/integrations/static-sites.md +83 -0
  62. package/docs/research/2025-rebaseline-plan.md +71 -2
  63. package/docs/research/2026-rebaseline.md +102 -0
  64. package/docs/research/adversarial-mps.md +41 -0
  65. package/docs/research/ai-human-metrics.md +35 -23
  66. package/docs/research/human-eval-panel.md +42 -0
  67. package/docs/research/judge-agreement.md +24 -0
  68. package/docs/research/ko-2025-corpus-sources.md +135 -0
  69. package/docs/research/lexicon-freshness-audit.md +64 -0
  70. package/docs/research/zh-ja-lexicon-calibration.md +60 -0
  71. package/docs/social/patina-launch-copy.md +173 -100
  72. package/docs/social/patina-launch-execution.md +94 -0
  73. package/docs/social/patina-launch-korean-first.md +83 -0
  74. package/docs/social/signs-of-ai-writing.md +26 -0
  75. package/docs/social/signs-of-ai-writing_KR.md +26 -0
  76. package/lexicon/ai-en.md +21 -24
  77. package/lexicon/ai-ja.md +158 -0
  78. package/lexicon/ai-ko.md +9 -9
  79. package/lexicon/ai-zh.md +158 -0
  80. package/lexicon/provenance/ai-en.json +970 -0
  81. package/lexicon/provenance/ai-ja.json +542 -0
  82. package/lexicon/provenance/ai-ko.json +866 -0
  83. package/lexicon/provenance/ai-zh.json +542 -0
  84. package/package.json +49 -8
  85. package/patterns/en-communication.md +5 -0
  86. package/patterns/en-content.md +5 -0
  87. package/patterns/en-filler.md +5 -0
  88. package/patterns/en-language.md +29 -1
  89. package/patterns/en-structure.md +5 -0
  90. package/patterns/en-style.md +5 -0
  91. package/patterns/en-viral-hook.md +42 -2
  92. package/patterns/ja-communication.md +5 -0
  93. package/patterns/ja-content.md +5 -0
  94. package/patterns/ja-filler.md +5 -0
  95. package/patterns/ja-language.md +33 -1
  96. package/patterns/ja-structure.md +12 -0
  97. package/patterns/ja-style.md +5 -0
  98. package/patterns/ja-viral-hook.md +41 -2
  99. package/patterns/ko-communication.md +5 -0
  100. package/patterns/ko-content.md +5 -0
  101. package/patterns/ko-filler.md +5 -0
  102. package/patterns/ko-language.md +33 -1
  103. package/patterns/ko-structure.md +25 -6
  104. package/patterns/ko-style.md +5 -0
  105. package/patterns/ko-viral-hook.md +38 -2
  106. package/patterns/zh-communication.md +5 -0
  107. package/patterns/zh-content.md +5 -0
  108. package/patterns/zh-filler.md +5 -0
  109. package/patterns/zh-language.md +37 -1
  110. package/patterns/zh-structure.md +12 -0
  111. package/patterns/zh-style.md +5 -0
  112. package/patterns/zh-viral-hook.md +38 -2
  113. package/playground/README.md +55 -0
  114. package/playground/analytics.js +4 -0
  115. package/playground/analyzer.js +883 -0
  116. package/playground/app.js +157 -0
  117. package/playground/data/lexicons.js +343 -0
  118. package/playground/index.html +138 -0
  119. package/playground/styles.css +267 -0
  120. package/profiles/namuwiki.md +111 -0
  121. package/scripts/adversarial-mps-report.mjs +201 -0
  122. package/scripts/badge-json.mjs +79 -0
  123. package/scripts/benchmark-report.mjs +56 -9
  124. package/scripts/check-release-metadata.mjs +0 -2
  125. package/scripts/detector-comparison.mjs +7 -7
  126. package/scripts/generate-playground-data.mjs +77 -0
  127. package/scripts/katfish-calibration.mjs +464 -0
  128. package/scripts/lexicon-freshness.mjs +485 -0
  129. package/scripts/lint.mjs +1 -1
  130. package/scripts/precommit-score.mjs +4 -3
  131. package/scripts/prose-score.mjs +81 -5
  132. package/scripts/rebaseline-intake.mjs +242 -0
  133. package/scripts/rebaseline-score.mjs +268 -0
  134. package/scripts/rebaseline-summary.mjs +773 -0
  135. package/scripts/rebaseline-web-collect.mjs +410 -0
  136. package/scripts/update-benchmark-ranges.mjs +1 -0
  137. package/src/api.js +69 -105
  138. package/src/auth.js +50 -2
  139. package/src/backends/claude-cli.js +19 -4
  140. package/src/backends/codex-cli.js +19 -3
  141. package/src/backends/contract.js +230 -1
  142. package/src/backends/gemini-cli.js +18 -5
  143. package/src/backends/index.js +87 -12
  144. package/src/backends/kimi-cli.js +161 -0
  145. package/src/cli.js +577 -567
  146. package/src/commands/doctor.js +2 -2
  147. package/src/config.js +29 -0
  148. package/src/errors.js +53 -1
  149. package/src/features/discourse-tells.js +68 -0
  150. package/src/features/index.js +82 -8
  151. package/src/features/lexicon.js +40 -6
  152. package/src/features/markup-leakage.js +69 -0
  153. package/src/features/segment.js +41 -0
  154. package/src/features/signal-strength.js +81 -0
  155. package/src/features/stylometry.js +231 -1
  156. package/src/features/translationese.js +127 -0
  157. package/src/loader.js +76 -0
  158. package/src/logger.js +22 -23
  159. package/src/model-defaults.js +55 -0
  160. package/src/ouroboros.js +31 -0
  161. package/src/output.js +102 -90
  162. package/src/prompt-builder.js +103 -68
  163. package/src/providers.js +51 -4
  164. package/src/scoring.js +210 -2
  165. package/src/security.js +75 -0
  166. package/tests/fixtures/live-quality/en/public-docs-01.md +26 -0
  167. package/tests/fixtures/live-quality/ko/public-docs-01.md +26 -0
  168. package/tests/fixtures/suspect-zones/expected-ranges.json +207 -16
  169. package/tests/fixtures/suspect-zones/ja/ai/ja-ai-04-lexicon.md +11 -0
  170. package/tests/fixtures/suspect-zones/ja/natural/ja-nat-04-lexicon-cold.md +11 -0
  171. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-02.md +4 -5
  172. package/tests/fixtures/suspect-zones/ko/ai/ko-ai-07-ko-diagnostic.md +11 -0
  173. package/tests/fixtures/suspect-zones/zh/ai/zh-ai-04-lexicon.md +11 -0
  174. package/tests/fixtures/suspect-zones/zh/natural/zh-nat-04-lexicon-cold.md +11 -0
  175. package/tests/quality/README.md +188 -11
  176. package/tests/quality/adversarial-mps/fixtures.jsonl +10 -0
  177. package/tests/quality/benchmark.mjs +39 -1
  178. package/tests/quality/dogfood.mjs +5 -3
  179. package/tests/quality/live-fixtures.jsonl +2 -0
  180. package/tests/quality/live-quality.mjs +596 -0
  181. package/tests/quality/ranking-metrics.mjs +136 -0
  182. package/tests/quality/rebaseline-manifest.example.jsonl +5 -0
  183. package/vercel.json +53 -0
  184. package/SKILL-MAX.md +0 -455
  185. package/docs/internal/HARNESS.md +0 -14
  186. package/docs/internal/README.md +0 -14
  187. package/docs/internal/WARP.md +0 -23
  188. package/patina-max/SKILL.md +0 -523
  189. package/patina-max/composite.py +0 -457
  190. package/src/cache.js +0 -106
  191. package/src/commands/init.js +0 -208
  192. package/src/manifest.js +0 -162
  193. package/src/max-mode.js +0 -207
@@ -4,6 +4,11 @@ language: zh
4
4
  name: 结构模式
5
5
  version: 1.1.0
6
6
  patterns: 5
7
+ corpus-snapshot:
8
+ id: bootstrap-patterns-pre-provenance
9
+ status: needs-quarterly-refresh
10
+ source: maintainer-curated pattern packs before quarterly corpus snapshot tracking
11
+ last_validated: null
7
12
  phase: structure
8
13
  ---
9
14
 
@@ -57,6 +62,13 @@ phase: structure
57
62
  **Semantic Risk:** LOW
58
63
  **Preservation Note:** 自然化翻译腔时,保留原句的施事、受事、因果、比较和条件限制;不要为了顺口而改变谁做了什么。
59
64
 
65
+ **Context rewrite guard (issue #352):** When literal phrasing appears around an em dash, colon, slash, comma splice, or parenthetical aside, do not replace only the punctuation. Read the whole sentence and rebuild the clause relation in natural Chinese. A literal "无 TUI 设置" should become a clause such as "不用 TUI 就能全自动安装时..." when that is the intended condition; an em dash should become a causal, contrastive, or appositive clause only when the original meaning supports that relation.
66
+
67
+ **Context rewrite example:**
68
+ > 如果想要完全自动、无 TUI 设置,请添加自律模式参数。
69
+ >
70
+ > → 如果想不用 TUI 就完成全自动安装,请添加自律模式参数。
71
+
60
72
  **Burstiness 指引:** 修正翻译腔时,替换后的句子长度不要整齐划一。有的缩短,有的展开,让节奏变化。
61
73
 
62
74
  **修改前:**
@@ -4,6 +4,11 @@ language: zh
4
4
  name: 风格模式
5
5
  version: 1.0.0
6
6
  patterns: 6
7
+ corpus-snapshot:
8
+ id: bootstrap-patterns-pre-provenance
9
+ status: needs-quarterly-refresh
10
+ source: maintainer-curated pattern packs before quarterly corpus snapshot tracking
11
+ last_validated: null
7
12
  dedupe-with:
8
13
  - source: "zh-style:13"
9
14
  target: "zh-filler:22"
@@ -3,13 +3,18 @@ pack: zh-viral-hook
3
3
  language: zh
4
4
  name: 病毒钩子模式
5
5
  version: 1.0.0
6
- patterns: 8
6
+ patterns: 9
7
+ corpus-snapshot:
8
+ id: bootstrap-patterns-pre-provenance
9
+ status: needs-quarterly-refresh
10
+ source: maintainer-curated pattern packs before quarterly corpus snapshot tracking
11
+ last_validated: null
7
12
  score_only: true
8
13
  ---
9
14
 
10
15
  # 病毒钩子模式(仅评分)
11
16
 
12
- 本模式包**仅用于评分(`--score`)和审计(`--audit`)**,不会在重写时主动修改。它捕捉社交媒体(微信、小红书、抖音、微博等)营销文案中常见的"AI 网红风"信号——数字震撼钩子、标题党悬念结尾、回避验证的权威断言、呼吸优化短句堆叠、夸张互动词汇、伪统计引用、头衔堆叠和未来自我承诺。
17
+ 本模式包**仅用于评分(`--score`)和审计(`--audit`)**,不会在重写时主动修改。它捕捉社交媒体(微信、小红书、抖音、微博等)营销文案中常见的"AI 网红风"信号——数字震撼钩子、标题党悬念结尾、回避验证的权威断言、呼吸优化短句堆叠、夸张互动词汇、伪统计引用、头衔堆叠、未来自我承诺,以及独立成段、伪深刻的格言式收尾短句。
13
18
 
14
19
  命中本包不代表内容一定是 AI 生成的——人类作者也常用这些模式。但当几种模式同时出现时,评分就会与读者直觉一致:"这看起来像 AI 润色过的营销文案"。
15
20
 
@@ -214,3 +219,34 @@ score_only: true
214
219
  > 改写前:朋友,先收藏这篇。一年后的你一定会感谢现在的自己。
215
220
  >
216
221
  > 改写后:如果你下个月要做计划,可以保存这份清单。
222
+
223
+ ---
224
+
225
+ ### 9. 格言式收尾 / 独立判断短句(伪深刻"金句")
226
+
227
+ **关注词汇:**(结构性模式——按形式判断,不看具体词汇)
228
+
229
+ **问题:** 一句很短(约 10 字以内)、语法完整的判断句被单独放在一行或一段,借这种"留白 + 收束"的排版制造庄重感和深刻感——典型的伪深刻"金句""mic drop"。一篇里出现 2 句以上,或每段都用这样一句收尾时,就成了 AI 网红长文的强信号。它靠的是**形式**(独立、短、斩钉截铁),而不是某个特定词汇。
230
+
231
+ **触发条件:** 出现独立成行/成段、语法完整、约 10 字以内的判断式短句,且其作用是修辞性收束(金句、点题),而非传递新信息。一篇出现 1 句即可记为低信号,2 句及以上信号显著。
232
+
233
+ **严重度标尺:**
234
+ - Low:全篇仅 1 句独立格言短句。
235
+ - Medium:出现 2 句独立格言短句。
236
+ - High:出现 3 句及以上,或几乎每个段落都以一句这样的短句收尾。
237
+
238
+ **排除条件:**
239
+ - 诗、歌词、韵文
240
+ - 本就简短的备忘、通知、提示、对问题的一两句回答
241
+ - 有意为之且后文有具体支撑的格言(不是空泛点题,而是引出论据)
242
+ - 对话、引语
243
+ - 标题、小标题
244
+
245
+ **Semantic Risk:** LOW —— 仅评分,重写时不动。
246
+ **Preservation Note:** 该模式默认仅评分不重写;若用户明确要求降调,保留这句话真正想表达的判断或重点,把它并回相邻段落或补上具体支撑,而不是简单删掉,以免抹掉作者的核心观点。
247
+ **改写前 / 改写后示例(手动降信号):**
248
+ > 改写前:增长是结果,不是目标。
249
+ > 真正重要的从来不是数字。
250
+ > 对称会变成陷阱。
251
+ >
252
+ > 改写后:我们今年没有把月活当成首要指标,而是盯着留存率和复购,因为一味追规模上次让我们烧掉了两个季度的预算。
@@ -0,0 +1,55 @@
1
+ # patina playground
2
+
3
+ Static, audit-only web playground for `patina.vibetip.help`.
4
+
5
+ - No build step.
6
+ - No runtime server.
7
+ - No LLM rewrite or key proxying.
8
+ - Deterministic browser-side scoring for `ko`, `en`, `zh`, and `ja`.
9
+ - Vercel Web Analytics page-view telemetry for traffic counts; pasted text is not sent.
10
+
11
+ ## Local preview
12
+
13
+ Serve the repository root so `vercel.json`-style root paths can resolve brand and social assets:
14
+
15
+ ```bash
16
+ npx http-server .
17
+ # or
18
+ python3 -m http.server 8080
19
+ ```
20
+
21
+ Then open `http://localhost:8080/playground/`.
22
+
23
+ ## Data refresh
24
+
25
+ The browser bundle is generated from the checked-in markdown lexicons:
26
+
27
+ ```bash
28
+ npm run playground:data
29
+ node scripts/generate-playground-data.mjs --check
30
+ ```
31
+
32
+ Commit both lexicon markdown changes and `playground/data/lexicons.js` together.
33
+
34
+ ## Vercel wiring
35
+
36
+ Deploy the repository root with the `vercel.json` in this repo. The root route rewrites `/` to the clean `/playground` static entry and keeps `/assets/social/patina-og.svg` available for OG cards.
37
+
38
+ Production domain:
39
+
40
+ ```text
41
+ patina.vibetip.help
42
+ ```
43
+
44
+ DNS should point at Vercel, e.g. `A patina -> 76.76.21.21` or the CNAME Vercel shows for the project.
45
+
46
+ Web Analytics is enabled with `playground/analytics.js` plus Vercel's same-origin
47
+ `/_vercel/insights/script.js`, so the CSP keeps `script-src 'self'` and does not
48
+ need inline-script relaxation.
49
+
50
+ ## Verification
51
+
52
+ ```bash
53
+ node --test tests/unit/playground.test.js
54
+ npm run lint:syntax
55
+ ```
@@ -0,0 +1,4 @@
1
+ /* global window */
2
+ window.va = window.va || function queueVercelAnalytics(...args) {
3
+ (window.vaq = window.vaq || []).push(args);
4
+ };