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
@@ -0,0 +1,147 @@
1
+ # Rebaseline 2025 local workspace
2
+
3
+ This directory is the local/private work area for the 2025+ rebaseline corpus.
4
+ It is intentionally ignored by default so vendor text, licensed corpora, and
5
+ review notes do not slip into the public repository.
6
+
7
+ Tracked files in this folder are scaffolding only:
8
+
9
+ - `.gitignore` keeps collected rows local unless explicitly allowlisted.
10
+ - `intake.example.jsonl` is a tiny repo-owned fixture for smoke testing the
11
+ intake helper. It is not benchmark evidence.
12
+ - `prompts.template.jsonl` contains repo-owned Korean prompt anchors for the
13
+ pilot. Copy rows into a local prompt/run sheet before generation.
14
+ - `intake.local.example.jsonl` is a 25-row Korean pilot skeleton. It validates
15
+ as metadata only; replace placeholder hashes locally before using it as
16
+ evidence.
17
+ - `sources.ko-public.jsonl` is a source inventory for collecting larger Korean
18
+ public-web human controls into ignored private files. It stores URLs and
19
+ license notes only, not page text.
20
+ - `human-controls.public.jsonl` is a 250-row Korean web human-control candidate
21
+ manifest with 50 rows in each tracked Korean register. It contains source
22
+ metadata and `sha256` digests only; the raw extracts stay in ignored
23
+ `private/` intake files. It is false-positive intake evidence, not a public
24
+ performance claim.
25
+ - `rebaseline-2026.scored.public.jsonl` is the #155 claim-ready public manifest
26
+ for the 2026-05-22 KO+EN modern-model rebaseline. It contains 600 generated
27
+ positive rows plus 200 human controls, all hash-only with deterministic score
28
+ metadata and no raw text.
29
+
30
+ ## Local intake flow
31
+
32
+ Create a local file such as `intake.local.jsonl` with one JSON object per row.
33
+ Rows use the schema from `docs/research/2025-rebaseline-plan.md`.
34
+
35
+ ```bash
36
+ npm run benchmark:rebaseline:intake -- \
37
+ --input artifacts/rebaseline-2025/intake.local.jsonl \
38
+ --public-output artifacts/rebaseline-2025/manifest.public.jsonl \
39
+ --private-output artifacts/rebaseline-2025/private/generations.private.jsonl \
40
+ --require-source-review
41
+
42
+ node scripts/rebaseline-summary.mjs \
43
+ --input artifacts/rebaseline-2025/manifest.public.jsonl \
44
+ --json
45
+ ```
46
+
47
+ The intake helper computes missing `text_hash` values. If a row carries `text`
48
+ but `redistribution` is `metadata-only`, `private`, `no-redistribution`,
49
+ `hash-only`, or an unrecognized value, the public manifest keeps only metadata
50
+ and the hash. The full text is written to the private output path.
51
+ `--require-source-review` fails any non-public row that lacks `source_review`
52
+ or `reviewer_notes`; use it before sharing a pilot report.
53
+
54
+ To smoke-check the tracked 25-row skeleton:
55
+
56
+ ```bash
57
+ npm run benchmark:rebaseline:intake -- \
58
+ --input artifacts/rebaseline-2025/intake.local.example.jsonl \
59
+ --dry-run \
60
+ --require-source-review
61
+ ```
62
+
63
+ To validate the tracked web human-control candidates:
64
+
65
+ ```bash
66
+ node scripts/rebaseline-summary.mjs \
67
+ --input artifacts/rebaseline-2025/human-controls.public.jsonl \
68
+ --json
69
+ ```
70
+
71
+ To collect more Korean public-web candidates into the private workspace:
72
+
73
+ ```bash
74
+ npm run benchmark:rebaseline:web -- \
75
+ --input artifacts/rebaseline-2025/sources.ko-public.jsonl \
76
+ --output artifacts/rebaseline-2025/private/web-human-controls.generated.private.jsonl \
77
+ --target-per-register 50 \
78
+ --max-per-source 12 \
79
+ --collected-at 2026-05-22
80
+ ```
81
+
82
+ This script deliberately writes raw text only under `private/`. The repository
83
+ uses MIT for its own code and documentation, but that license does not relicense
84
+ third-party web pages. Keep web extracts hash-only unless the exact row has a
85
+ redistribution review that permits publishing the text.
86
+
87
+ To run the private KatFish KO calibration after downloading `essay.jsonl`, `abstract.jsonl`, and `poetry.jsonl` into `artifacts/rebaseline-2025/private/katfish/`:
88
+
89
+ ```bash
90
+ npm run benchmark:katfish-ko -- --write --basename katfish-ko-latest
91
+ ```
92
+
93
+ The command writes only aggregate metrics to `docs/benchmarks/`; it must not
94
+ commit KatFish raw rows unless a license review explicitly allows it.
95
+
96
+ To refresh their deterministic score/outcome fields from a private raw-text
97
+ intake file:
98
+
99
+ ```bash
100
+ npm run benchmark:rebaseline:score -- \
101
+ --input artifacts/rebaseline-2025/private/web-human-controls.generated.private.jsonl \
102
+ --output artifacts/rebaseline-2025/human-controls.public.jsonl \
103
+ --scored-at 2026-05-22
104
+ ```
105
+
106
+ ## 2026 modern-model claim flow
107
+
108
+ The #155 claim-ready flow uses ignored raw model output and then commits only a
109
+ hash-only scored manifest:
110
+
111
+ ```bash
112
+ npm run benchmark:rebaseline:generate-modern -- \
113
+ --per-cell 100 \
114
+ --batch-size 50 \
115
+ --generated-at 2026-05-22
116
+
117
+ npm run benchmark:rebaseline:claim-manifest -- \
118
+ --scored-at 2026-05-22
119
+
120
+ node scripts/rebaseline-summary.mjs \
121
+ --input artifacts/rebaseline-2025/rebaseline-2026.scored.public.jsonl \
122
+ --write \
123
+ --basename rebaseline-latest \
124
+ --require-claim-ready
125
+ ```
126
+
127
+ `benchmark:rebaseline:generate-modern` writes raw model text under
128
+ `private/modern-generations.private.jsonl`; do not commit that file. The
129
+ checked-in claim surface is `rebaseline-2026.scored.public.jsonl` plus
130
+ `docs/benchmarks/rebaseline-latest.{md,json}`.
131
+
132
+ ## What can be committed
133
+
134
+ Do commit:
135
+
136
+ - source inventory and protocols under `docs/research/`
137
+ - hash-only candidate manifests that pass strict provenance review
138
+ - sanitized reports under `docs/benchmarks/` after review
139
+ - repo-owned examples with `redistribution: "repo-ok"`
140
+
141
+ Do not commit:
142
+
143
+ - raw KatFish/Modu/learner-corpus text until the license review explicitly says
144
+ redistribution is allowed
145
+ - vendor-generated samples copied from a UI if the provider terms do not allow
146
+ redistribution
147
+ - human reviewer notes containing private names, accounts, or unpublished text