hersona 0.0.1__tar.gz

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 (156) hide show
  1. hersona-0.0.1/.env.example +13 -0
  2. hersona-0.0.1/.github/ISSUE_TEMPLATE/attribute_request.md +57 -0
  3. hersona-0.0.1/.github/ISSUE_TEMPLATE/bug_report.md +43 -0
  4. hersona-0.0.1/.github/ISSUE_TEMPLATE/feature_request.md +38 -0
  5. hersona-0.0.1/.github/PULL_REQUEST_TEMPLATE.md +47 -0
  6. hersona-0.0.1/.github/workflows/publish.yml +47 -0
  7. hersona-0.0.1/.gitignore +44 -0
  8. hersona-0.0.1/CHANGELOG.md +36 -0
  9. hersona-0.0.1/CONTRIBUTING.md +82 -0
  10. hersona-0.0.1/DISCLAIMER.md +51 -0
  11. hersona-0.0.1/LICENSE +22 -0
  12. hersona-0.0.1/LICENSE-CC0.txt +73 -0
  13. hersona-0.0.1/PKG-INFO +214 -0
  14. hersona-0.0.1/README.ja.md +186 -0
  15. hersona-0.0.1/README.md +185 -0
  16. hersona-0.0.1/ROADMAP.md +236 -0
  17. hersona-0.0.1/attributes/archetype/childhood_friend.yaml +25 -0
  18. hersona-0.0.1/attributes/archetype/gamer_otaku.yaml +25 -0
  19. hersona-0.0.1/attributes/archetype/heroine.yaml +25 -0
  20. hersona-0.0.1/attributes/archetype/hikikomori.yaml +61 -0
  21. hersona-0.0.1/attributes/archetype/idol.yaml +61 -0
  22. hersona-0.0.1/attributes/archetype/mentor.yaml +25 -0
  23. hersona-0.0.1/attributes/archetype/rival.yaml +25 -0
  24. hersona-0.0.1/attributes/archetype/robot_android.yaml +27 -0
  25. hersona-0.0.1/attributes/archetype/shrine_maiden.yaml +27 -0
  26. hersona-0.0.1/attributes/hobby/cooking.yaml +54 -0
  27. hersona-0.0.1/attributes/hobby/gamer.yaml +54 -0
  28. hersona-0.0.1/attributes/hobby/music.yaml +54 -0
  29. hersona-0.0.1/attributes/hobby/reading.yaml +55 -0
  30. hersona-0.0.1/attributes/hobby/sports.yaml +55 -0
  31. hersona-0.0.1/attributes/personality/airhead.yaml +129 -0
  32. hersona-0.0.1/attributes/personality/chuunibyou.yaml +129 -0
  33. hersona-0.0.1/attributes/personality/dandere.yaml +126 -0
  34. hersona-0.0.1/attributes/personality/genki.yaml +127 -0
  35. hersona-0.0.1/attributes/personality/hot_blooded.yaml +130 -0
  36. hersona-0.0.1/attributes/personality/intellectual.yaml +129 -0
  37. hersona-0.0.1/attributes/personality/klutz.yaml +128 -0
  38. hersona-0.0.1/attributes/personality/kuudere.yaml +127 -0
  39. hersona-0.0.1/attributes/personality/mysterious.yaml +130 -0
  40. hersona-0.0.1/attributes/personality/narcissist.yaml +129 -0
  41. hersona-0.0.1/attributes/personality/optimist.yaml +127 -0
  42. hersona-0.0.1/attributes/personality/pessimist.yaml +126 -0
  43. hersona-0.0.1/attributes/personality/playful.yaml +127 -0
  44. hersona-0.0.1/attributes/personality/pragmatist.yaml +130 -0
  45. hersona-0.0.1/attributes/personality/protective.yaml +128 -0
  46. hersona-0.0.1/attributes/personality/serious.yaml +126 -0
  47. hersona-0.0.1/attributes/personality/stoic.yaml +126 -0
  48. hersona-0.0.1/attributes/personality/switch.yaml +127 -0
  49. hersona-0.0.1/attributes/personality/tsundere.yaml +124 -0
  50. hersona-0.0.1/attributes/personality/yandere.yaml +127 -0
  51. hersona-0.0.1/attributes/speech/archaic.yaml +29 -0
  52. hersona-0.0.1/attributes/speech/blunt.yaml +48 -0
  53. hersona-0.0.1/attributes/speech/blunt_en.yaml +36 -0
  54. hersona-0.0.1/attributes/speech/boku_girl.yaml +29 -0
  55. hersona-0.0.1/attributes/speech/british_en.yaml +41 -0
  56. hersona-0.0.1/attributes/speech/casual_en.yaml +38 -0
  57. hersona-0.0.1/attributes/speech/formal_en.yaml +39 -0
  58. hersona-0.0.1/attributes/speech/gyaru.yaml +49 -0
  59. hersona-0.0.1/attributes/speech/kansai_ben.yaml +29 -0
  60. hersona-0.0.1/attributes/speech/keigo.yaml +30 -0
  61. hersona-0.0.1/attributes/speech/kyoto_ben.yaml +67 -0
  62. hersona-0.0.1/attributes/speech/mischievous.yaml +47 -0
  63. hersona-0.0.1/attributes/speech/mixed_dialect.yaml +47 -0
  64. hersona-0.0.1/attributes/speech/onee_kotoba.yaml +29 -0
  65. hersona-0.0.1/attributes/speech/ore_boy.yaml +30 -0
  66. hersona-0.0.1/attributes/speech/princess_speech.yaml +48 -0
  67. hersona-0.0.1/attributes/speech/seductive.yaml +50 -0
  68. hersona-0.0.1/attributes/speech/soft.yaml +48 -0
  69. hersona-0.0.1/attributes/speech/southern_us_en.yaml +41 -0
  70. hersona-0.0.1/attributes/speech/stutter.yaml +43 -0
  71. hersona-0.0.1/attributes/speech/theatrical.yaml +47 -0
  72. hersona-0.0.1/attributes/speech/third_person.yaml +29 -0
  73. hersona-0.0.1/attributes/speech/tomboy.yaml +49 -0
  74. hersona-0.0.1/attributes/speech/washi.yaml +64 -0
  75. hersona-0.0.1/attributes/speech/whispery.yaml +29 -0
  76. hersona-0.0.1/attributes/visual/animal_ears.yaml +55 -0
  77. hersona-0.0.1/attributes/visual/glamorous.yaml +54 -0
  78. hersona-0.0.1/attributes/visual/glasses.yaml +55 -0
  79. hersona-0.0.1/attributes/visual/petite.yaml +54 -0
  80. hersona-0.0.1/attributes/visual/silver_hair.yaml +56 -0
  81. hersona-0.0.1/docs/.nojekyll +0 -0
  82. hersona-0.0.1/docs/BATCH4_DECISIONS.md +78 -0
  83. hersona-0.0.1/docs/DUET_PLAN.md +235 -0
  84. hersona-0.0.1/docs/I18N_DESIGN.md +279 -0
  85. hersona-0.0.1/docs/I18N_FUTURE_WORK.md +163 -0
  86. hersona-0.0.1/docs/IMPLEMENTATION_GUIDE.md +296 -0
  87. hersona-0.0.1/docs/IMPROVEMENT_PLAN.md +322 -0
  88. hersona-0.0.1/docs/PUBLIC_API.md +89 -0
  89. hersona-0.0.1/docs/app/README.md +48 -0
  90. hersona-0.0.1/docs/app/app.js +510 -0
  91. hersona-0.0.1/docs/app/data.json +3535 -0
  92. hersona-0.0.1/docs/app/index.html +185 -0
  93. hersona-0.0.1/docs/app/showcase.json +115 -0
  94. hersona-0.0.1/docs/app/style.css +316 -0
  95. hersona-0.0.1/docs/duet/PHASE0_HERSONA_PREP.md +139 -0
  96. hersona-0.0.1/docs/duet/PHASE1_ORCHESTRATOR.md +336 -0
  97. hersona-0.0.1/docs/duet/PHASE2_DIRECTOR_AND_PARTICIPATION.md +151 -0
  98. hersona-0.0.1/docs/duet/PHASE3_WEB_UI.md +135 -0
  99. hersona-0.0.1/docs/duet/PHASE4_ECOSYSTEM.md +130 -0
  100. hersona-0.0.1/docs/duet/README.md +36 -0
  101. hersona-0.0.1/docs/duet/mockup/index.html +620 -0
  102. hersona-0.0.1/docs/hersona-demo-poster.jpg +0 -0
  103. hersona-0.0.1/docs/hersona-demo.mp4 +0 -0
  104. hersona-0.0.1/docs/hersona-logo.png +0 -0
  105. hersona-0.0.1/docs/index.html +841 -0
  106. hersona-0.0.1/docs/preview.html +651 -0
  107. hersona-0.0.1/hersona/__init__.py +10 -0
  108. hersona-0.0.1/hersona/cli/__init__.py +9 -0
  109. hersona-0.0.1/hersona/cli/__main__.py +7 -0
  110. hersona-0.0.1/hersona/cli/app.py +434 -0
  111. hersona-0.0.1/hersona/core/__init__.py +105 -0
  112. hersona-0.0.1/hersona/core/attach.py +271 -0
  113. hersona-0.0.1/hersona/core/authoring.py +317 -0
  114. hersona-0.0.1/hersona/core/compatibility.py +250 -0
  115. hersona-0.0.1/hersona/core/constants.py +18 -0
  116. hersona-0.0.1/hersona/core/i18n.py +171 -0
  117. hersona-0.0.1/hersona/core/intensity.py +296 -0
  118. hersona-0.0.1/hersona/core/paths.py +32 -0
  119. hersona-0.0.1/hersona/core/recommend.py +505 -0
  120. hersona-0.0.1/hersona/core/weight.py +144 -0
  121. hersona-0.0.1/hersona/data/quiz/recommend_quiz.en.yaml +400 -0
  122. hersona-0.0.1/hersona/data/quiz/recommend_quiz.yaml +257 -0
  123. hersona-0.0.1/hersona/locales/en.yaml +116 -0
  124. hersona-0.0.1/hersona/locales/ja.yaml +114 -0
  125. hersona-0.0.1/pyproject.toml +67 -0
  126. hersona-0.0.1/schema/attribute.schema.json +225 -0
  127. hersona-0.0.1/scripts/_oneoff/add_en_content.py +347 -0
  128. hersona-0.0.1/scripts/_oneoff/gen_quiz_en.py +123 -0
  129. hersona-0.0.1/scripts/_oneoff/gen_v1_attributes.py +1720 -0
  130. hersona-0.0.1/scripts/build_site.py +193 -0
  131. hersona-0.0.1/scripts/migrate_i18n.py +159 -0
  132. hersona-0.0.1/scripts/run_quiz.py +331 -0
  133. hersona-0.0.1/scripts/validate.py +166 -0
  134. hersona-0.0.1/site/README.md +48 -0
  135. hersona-0.0.1/site/app.js +510 -0
  136. hersona-0.0.1/site/data.json +3535 -0
  137. hersona-0.0.1/site/index.html +185 -0
  138. hersona-0.0.1/site/showcase.json +115 -0
  139. hersona-0.0.1/site/style.css +316 -0
  140. hersona-0.0.1/skills/hersona/SKILL.md +507 -0
  141. hersona-0.0.1/skills/hersona-recommend-quiz/SKILL.md +263 -0
  142. hersona-0.0.1/tests/__init__.py +0 -0
  143. hersona-0.0.1/tests/conftest.py +18 -0
  144. hersona-0.0.1/tests/test_attach.py +140 -0
  145. hersona-0.0.1/tests/test_attributes.py +146 -0
  146. hersona-0.0.1/tests/test_authoring.py +167 -0
  147. hersona-0.0.1/tests/test_cli.py +139 -0
  148. hersona-0.0.1/tests/test_compatibility.py +180 -0
  149. hersona-0.0.1/tests/test_i18n.py +111 -0
  150. hersona-0.0.1/tests/test_intensity.py +421 -0
  151. hersona-0.0.1/tests/test_migrate_i18n.py +79 -0
  152. hersona-0.0.1/tests/test_packaging.py +56 -0
  153. hersona-0.0.1/tests/test_public_api.py +39 -0
  154. hersona-0.0.1/tests/test_recommend.py +503 -0
  155. hersona-0.0.1/tests/test_weight.py +128 -0
  156. hersona-0.0.1/uv.lock +631 -0
@@ -0,0 +1,13 @@
1
+ # hersona 環境変数サンプル
2
+ # このファイルを .env にコピーして実際の値を設定してください
3
+
4
+ # LLM プロバイダ(どれか1つ必須)
5
+ OPENAI_API_KEY=sk-replace-me
6
+ ANTHROPIC_API_KEY=sk-ant-replace-me
7
+ MINIMAX_API_KEY=eyJ-replace-me
8
+
9
+ # 任意: 既定プロバイダ上書き
10
+ HERMES_PROVIDER=minimax-oauth
11
+
12
+ # 任意: persona_attach_log 出力先
13
+ HERMES_PERSONA_LOG_DIR=$HOME/.hermes/hersona
@@ -0,0 +1,57 @@
1
+ ---
2
+ about: 新規属性テンプレート追加提案 (attributes/<category>/<name>.yaml)
3
+ title: '[ATTRIBUTE] '
4
+ labels: attribute, needs-triage
5
+ assignees: ''
6
+ ---
7
+
8
+ ## 提案属性
9
+
10
+ - 属性名 (snake_case): ___
11
+ - カテゴリ: personality / speech / archetype のいずれか
12
+ - display_name_ja:
13
+ - display_name_en:
14
+ - weight_dimension: none / mild / moderate / strong のいずれか
15
+ - typical_value_range: 例: `0.4-0.7`
16
+
17
+ ## 属性の根拠
18
+
19
+ - 既存 25 属性で不足する理由: ___
20
+ - アニメ・ゲーム・漫画・クリーチャーで広く見られる特性か: yes / no (理由: ___)
21
+ - 固有名詞・特定作品への依存がないか: yes / no (理由: ___)
22
+
23
+ ## 想定する core_traits / catchphrases / tone
24
+
25
+ v1.0 では 6 フィールド (core_traits / speech_style / second_person / sentence_endings / catchphrases / tone) が任意追加可能。`tsundere` を雛形として参考に。
26
+
27
+ - core_traits (3-7 個): ___
28
+ - speech_style (1 行散文、speech カテゴリのみ): ___
29
+ - second_person (1 行 / 区切り、speech カテゴリのみ): ___
30
+ - sentence_endings (3 個以上、speech カテゴリのみ): ___
31
+ - catchphrases (3-15 個、全カテゴリ): ___
32
+ - tone (1 行散文、全カテゴリ): ___
33
+
34
+ ## 互換性
35
+
36
+ - compatible_archetypes (併用 OK な archetype 名リスト): ___
37
+ - conflicts_with (排他が想定される属性名リスト): ___
38
+ - tags (横断検索タグ): ___
39
+
40
+ ## examples 案 (AI エージェント活用 5 パターン)
41
+
42
+ 1. システムプロンプト注入: ___
43
+ 2. 強度調整 (weight=mild): ___
44
+ 3. 強度調整 (weight=strong): ___
45
+ 4. 互換性チェック (compatible_archetypes との組み合わせ): ___
46
+ 5. NG パターン (conflicts_with 該当との同時付与): ___
47
+
48
+ ## 想定工数
49
+
50
+ - examples / core_traits 設計: N 時間
51
+ - gen_v1_attributes.py への追記: N 時間
52
+ - pytest 80 → 81+ への拡張: N 時間
53
+ - 検証 (validate.py + pytest): N 分
54
+
55
+ ## 関連 Issue
56
+
57
+ Closes # / refs #
@@ -0,0 +1,43 @@
1
+ ---
2
+ about: バグ報告(YAML生成ミス・validate.py 偽陰性・schema 違反等)
3
+ title: '[BUG] '
4
+ labels: bug
5
+ assignees: ''
6
+ ---
7
+
8
+ ## バグの概要
9
+
10
+ ## 再現手順
11
+
12
+ - OS:
13
+ - Python バージョン: `python -V` の出力
14
+ - hersona バージョン: `git describe --tags` の出力
15
+ - 該当ファイル: `attributes/<category>/<name>.yaml` の attribute_name
16
+
17
+ ## 期待動作
18
+
19
+ ## 実際動作
20
+
21
+ ## 最小 YAML 再現例
22
+
23
+ ```yaml
24
+ # 該当部分のみ抜粋
25
+ ```
26
+
27
+ ## validate.py 出力
28
+
29
+ ```
30
+ python scripts/validate.py の出力(raw 貼り付け)
31
+ ```
32
+
33
+ ## pytest 出力 (該当テストがある場合)
34
+
35
+ ```
36
+ pytest tests/test_attributes.py -k <attribute_name> の出力
37
+ ```
38
+
39
+ ## スクリーンショット・エラーログ
40
+
41
+ ## 関連 Issue
42
+
43
+ Closes # / refs #
@@ -0,0 +1,38 @@
1
+ ---
2
+ about: 機能提案(attribute.schema.json 拡張・gen_v1_attributes.py 機能追加・validate.py 機能追加等)
3
+ title: '[FEATURE] '
4
+ labels: enhancement
5
+ assignees: ''
6
+ ---
7
+
8
+ ## 提案する機能
9
+
10
+ ## 課題・動機
11
+
12
+ ## 代替案
13
+
14
+ ## スキーマ影響
15
+
16
+ - [ ] attribute.schema.json への影響あり(破壊的 / 非破壊的)
17
+ - [ ] 影響なし
18
+ - [ ] pyproject.toml への影響あり(依存追加)
19
+
20
+ ## 影響範囲
21
+
22
+ - [ ] `attributes/<category>/<name>.yaml` (25 属性全部 or 一部)
23
+ - [ ] `scripts/_oneoff/gen_v1_attributes.py`
24
+ - [ ] `scripts/validate.py`
25
+ - [ ] `tests/test_attributes.py`
26
+ - [ ] `skills/hersona/SKILL.md` (v3.0.0)
27
+ - [ ] `README.md` / `CONTRIBUTING.md`
28
+
29
+ ## 実装案
30
+
31
+ ## 後方互換性
32
+
33
+ - 既存 25 属性 (personality 10 / speech 8 / archetype 7) の YAML データは維持されるか
34
+ - 既存テスト 80 ケースは影響を受けるか
35
+
36
+ ## 関連 Issue
37
+
38
+ Closes # / refs #
@@ -0,0 +1,47 @@
1
+ ## 変更内容
2
+
3
+ - [ ] 新規属性追加 (`attributes/<category>/<name>.yaml` を `gen_v1_attributes.py` に追記)
4
+ - [ ] 既存属性更新 (修正内容: ____)
5
+ - [ ] schema 拡張 (`schema/attribute.schema.json`)
6
+ - [ ] スクリプト修正 (`scripts/____.py`)
7
+ - [ ] ドキュメント修正 (`README.md` / `CONTRIBUTING.md` / `CHANGELOG.md` / `skills/hersona/SKILL.md`)
8
+ - [ ] テスト追加・修正 (`tests/test_attributes.py`)
9
+ - [ ] その他(詳細: ____)
10
+
11
+ ## 属性追加時のチェックリスト(`gen_v1_attributes.py` に追記する場合のみ)
12
+
13
+ - [ ] `attribute_name` が `^[a-z][a-z0-9_]*$` パターンに一致
14
+ - [ ] ファイル名と `attribute_name` が完全一致
15
+ - [ ] カテゴリ別数量制約 (personality 10 / speech 8 / archetype 7) 維持 (Round 1 確定 25 属性)
16
+ - 増減させる場合は別 Issue で議論 (本 PR では 25 属性の維持を期待)
17
+ - [ ] `attribute_category` が `personality` / `speech` / `archetype` のいずれか
18
+ - [ ] `display_name_ja` / `display_name_en` 両方記載
19
+ - [ ] `weight_dimension` が `none` / `mild` / `moderate` / `strong` のいずれか
20
+ - [ ] `description_ja` / `description_en` 両方記載
21
+ - [ ] `examples` が 1 件以上 (5 件推奨: 注入 / 強度調整 x2 / 互換性 / NG)
22
+ - [ ] `compatible_archetypes` / `conflicts_with` の参照先属性が `attributes/` 配下に実在
23
+ - [ ] 固有名詞・特定作品を含まない (Round 1 仕様遵守)
24
+ - [ ] `_check_uniqueness` (attribute_name 重複) / `_check_category_counts` (数量制約) / `_check_compat_refs` (参照整合) を `gen_v1_attributes.py` 起動時チェックで担保
25
+ - [ ] 任意 6 フィールド (`core_traits` / `speech_style` / `second_person` / `sentence_endings` / `catchphrases` / `tone`) のうち、属性カテゴリに応じて必要なものを投入
26
+ - personality: `core_traits` (3-7 個) + `catchphrases` (1-15 個) + `tone` (1 行)
27
+ - speech: `speech_style` + `second_person` + `sentence_endings` + `catchphrases` + `tone`
28
+ - archetype: `catchphrases` + `tone`
29
+ - [ ] 1 コミット = 1 属性(コミットメッセージ: `feat: <attribute_name> <category> attribute (T3 / Round N)`)
30
+
31
+ ## 既存属性更新の場合
32
+
33
+ - [ ] 更新ファイル: `attributes/<category>/<name>.yaml`
34
+ - [ ] 更新内容(修正前 → 修正後): ____
35
+ - [ ] `gen_v1_attributes.py` の ATTRIBUTES リスト修正が伴っている
36
+ - [ ] 24 残属性の量産は含まない (Round 3 でユーザー承認後に別途着手)
37
+
38
+ ## 検証
39
+
40
+ - [ ] `python scripts/validate.py` 出力: 25 ファイル、エラー 0
41
+ - [ ] `pytest` 出力: 80+ ケース PASS
42
+ - [ ] `git diff --stat` の要約: ____
43
+ - [ ] `gen_v1_attributes.py` 起動時チェック (`_check_uniqueness` / `_check_category_counts` / `_check_compat_refs`) が緑
44
+
45
+ ## 関連 Issue
46
+
47
+ Closes #____ / refs #____
@@ -0,0 +1,47 @@
1
+ # PyPI への自動公開 (Trusted Publishing / OIDC)。
2
+ #
3
+ # 事前設定 (オーナーが PyPI 側で 1 回だけ実施):
4
+ # PyPI → Manage → Publishing → Add a new publisher
5
+ # owner: shiro-0x / repository: hersona / workflow: publish.yml / environment: pypi
6
+ #
7
+ # リリース手順: pyproject.toml の version を上げて `git tag v1.3.0 && git push --tags`
8
+ name: Publish to PyPI
9
+
10
+ on:
11
+ push:
12
+ tags: ["v*"]
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: astral-sh/setup-uv@v5
20
+ - name: Build sdist and wheel
21
+ run: uv build
22
+ - name: Smoke test wheel in clean env
23
+ run: |
24
+ uv venv /tmp/smoke
25
+ uv pip install --python /tmp/smoke/bin/python dist/*.whl
26
+ /tmp/smoke/bin/python -c "
27
+ from hersona.core import render_blend, available_attributes
28
+ assert len(available_attributes()) >= 64
29
+ assert 'tsundere' in render_blend(['tsundere']).prompt
30
+ print('wheel smoke test OK')"
31
+ - uses: actions/upload-artifact@v4
32
+ with:
33
+ name: dist
34
+ path: dist/
35
+
36
+ publish:
37
+ needs: build
38
+ runs-on: ubuntu-latest
39
+ environment: pypi
40
+ permissions:
41
+ id-token: write # Trusted Publishing (OIDC)
42
+ steps:
43
+ - uses: actions/download-artifact@v4
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,44 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.so
5
+ *.egg-info/
6
+ .venv/
7
+ venv/
8
+
9
+ # OS
10
+ .DS_Store
11
+ Thumbs.db
12
+
13
+ # Editor
14
+ .idea/
15
+ .vscode/
16
+ .claude/
17
+ *.swp
18
+
19
+ # Temporary
20
+ *.tmp
21
+ *.bak
22
+ *~
23
+
24
+ # Backup files (e.g. power.yaml.orig)
25
+ *.orig
26
+
27
+ # Secrets / local config
28
+ .env
29
+ .env.local
30
+ .env.*.local
31
+
32
+ # User-authored attributes (ROADMAP ③: ローカル=自由 / 公開は汎用のみ)
33
+ attributes/user/
34
+
35
+ # Python caches
36
+ __pycache__/
37
+ *.pyc
38
+ *.pyo
39
+
40
+ # Tool caches
41
+ .ruff_cache/
42
+ .mypy_cache/
43
+ .pytest_cache/
44
+ .pyright_cache/
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - `weight_for_score(score, *, previous, thresholds, hysteresis)` public API — maps a
12
+ 0–100 continuous score to a `WeightLevel`, with optional hysteresis (the level only
13
+ changes once the score crosses a threshold by ±`hysteresis`). Intended for the duet
14
+ emotion/affection dial.
15
+ - `docs/PUBLIC_API.md` declaring `hersona.core.__all__` as the semver-stable public API.
16
+ `tests/test_public_api.py` keeps the document and `__all__` in sync automatically.
17
+ - PyPI packaging: the wheel now bundles `attributes/` and `schema/` under `hersona/data/`
18
+ (resolved by `hersona/core/paths.py` for both the repo and installed layouts).
19
+ `.github/workflows/publish.yml` publishes to PyPI via Trusted Publishing on `v*` tags.
20
+ `tests/test_packaging.py` regression-tests the bundled contents.
21
+
22
+ ### Changed
23
+ - pyproject: PyPI metadata (English `description` / `keywords` / `classifiers` / `urls`);
24
+ removed the unused `requests` dependency; the dev-only `scripts/` is excluded from the wheel.
25
+
26
+ ## [0.0.1] - 2026-06-13
27
+
28
+ ### Added
29
+ - 64 attribute templates (personality 20 / speech 25 / archetype 9 / visual 5 / hobby 5)
30
+ - `schema/attribute.schema.json` for attribute validation
31
+ - `hersona` CLI (`list` / `show` / `matrix` / `blend` / `recommend` / `create` / `measure`)
32
+ - Compatibility matrix with conflict/compatible resolution
33
+ - Intensity scoring for speech attributes
34
+ - Diagnostic quiz with multilingual support (en/ja)
35
+ - `skills/hersona/SKILL.md` for Hermes Agent integration
36
+ - MIT license for code, CC0 1.0 for attribute templates
@@ -0,0 +1,82 @@
1
+ # コントリビュートガイド
2
+
3
+ hersona プロジェクトへの貢献ありがとうございます。
4
+
5
+ ## hersona v1.0 のアーキテクチャ要約
6
+
7
+ v1.0 では従来の「data/<作品>/<キャラ>.yaml 方式」は廃止し、
8
+ LLM のシステムプロンプトに「属性テンプレート (`attributes/<category>/<name>.yaml`)」
9
+ を直接アタッチする方式に移行しました。
10
+
11
+ - セリフ集の事前収集は不要 (LLM が解釈段階で属性を発現)
12
+ - キャラ別 YAML は不要 (ユーザーが必要属性を割り当てる)
13
+ - 属性テンプレートの追加・改善が本リポジトリの中心作業
14
+
15
+ ## 開発フロー
16
+
17
+ ```
18
+ 属性テンプレート追加 (attribute author) → スキーマ検証 (validator) → PR レビュー
19
+ ```
20
+
21
+ ## 属性テンプレートの追加
22
+
23
+ ### 1. 配置場所の決定
24
+
25
+ `attributes/<category>/<name>.yaml` に配置。`<category>` は以下 3 種:
26
+
27
+ - `personality` — 性格特性 (tsundere, kuudere 等)
28
+ - `speech` — 話し方 (keigo, archaic, kansai_ben 等)
29
+ - `archetype` — 役割 (heroine, mentor, rival 等)
30
+
31
+ `<name>` はスネークケース (例: `tsundere`, `boku_girl`)。
32
+
33
+ ### 2. YAML 生成
34
+
35
+ `schema/attribute.schema.json` に準拠。`scripts/_oneoff/gen_v1_attributes.py`
36
+ が既存 25 属性の雛形なので、これを参考に手作業または LLM で生成可能。
37
+
38
+ 各属性 YAML が持つ主要フィールド:
39
+
40
+ - `attribute_category` / `attribute_name` — 配置と一致
41
+ - `display_name_ja` / `display_name_en` — 表示名
42
+ - `weight_dimension` — 強度軸 (mild / moderate / strong / none)
43
+ - `typical_value_range` — 典型的な強度レンジ
44
+ - `description_ja` / `description_en` — 説明
45
+ - `core_traits` — 性格特性リスト (3-7 個目安)
46
+ - `catchphrases` — 口癖リスト (任意)
47
+ - `tone` — 1 行程度の口調説明 (任意)
48
+ - `examples` — AI エージェント活用例 (5 パターン推奨: 注入 / 強度調整 / 互換性 / NG)
49
+ - `compatible_archetypes` / `conflicts_with` — 他の archetype との関係
50
+ - `tags` — 検索用タグ
51
+
52
+ ### 3. 検証
53
+
54
+ ```bash
55
+ python scripts/validate.py
56
+ ```
57
+
58
+ 全 attributes/ YAML がスキーマと整合するか確認。エラーが出たら修正して再実行。
59
+
60
+ ### 4. コミット・PR
61
+
62
+ ```bash
63
+ git add attributes/<category>/<name>.yaml
64
+ git commit -m "feat(attributes): add <category>/<name>"
65
+ git push origin wt/<branch>
66
+ ```
67
+
68
+ PR テンプレートに従って記載。リブラがレビューしてマージ。
69
+
70
+ ## プルリクエスト
71
+
72
+ PR テンプレートに従って記載。review 待ち。リブラが承認したらマージ。
73
+ PR 1 件 = 1 属性追加が基本。複数追加時は事前 Issue で合意。
74
+
75
+ ## ライセンス方針
76
+
77
+ - `attributes/` 配下のテンプレートは CC0 (public domain dedication) — `LICENSE-CC0.txt` 参照
78
+ - 商用利用可否や LLM 出力の責任は `DISCLAIMER.md` を参照
79
+
80
+ ## 質問・相談
81
+
82
+ GitHub Issue で。ラベル `question` を付けてください。
@@ -0,0 +1,51 @@
1
+ # Disclaimer
2
+
3
+ ## 1. Purpose
4
+
5
+ This repository is a research project for **LLM persona template composition**.
6
+
7
+ The `attributes/` directory ships generic personality / speech / archetype / visual /
8
+ hobby attribute templates. These templates are designed to be combined (blended) at
9
+ runtime to construct LLM persona configurations.
10
+
11
+ ## 2. Intended Use
12
+
13
+ The bundled templates are intended for:
14
+
15
+ - Research into modular LLM persona construction
16
+ - Experimentation with attribute blending
17
+ - Building production LLM systems with configurable personas
18
+
19
+ The bundled templates are **not** intended to reproduce, impersonate, or derive from
20
+ any specific copyrighted character, person, or creative work.
21
+
22
+ ## 3. Licensing
23
+
24
+ - Code (the `hersona` package, CLI, scripts, schema): MIT
25
+ - Attribute templates (`attributes/**/*.yaml`): CC0 1.0 (public domain dedication)
26
+ - Documentation: CC-BY-4.0
27
+
28
+ Users of this repository are responsible for ensuring their own use complies with
29
+ applicable laws and the terms of any third-party services they integrate with.
30
+
31
+ ## 4. LLM Output
32
+
33
+ Outputs produced by LLMs that consume the bundled templates are **not** the work of
34
+ this project and are not endorsed, approved, or licensed by this project. The
35
+ handling (publication, distribution, commercial use) of LLM outputs is the sole
36
+ responsibility of the user.
37
+
38
+ ## 5. No Warranty
39
+
40
+ This repository is provided "as is", without warranty of any kind. The authors are
41
+ not liable for any damages arising from use of this repository.
42
+
43
+ ## 6. Contact
44
+
45
+ To report an issue:
46
+ - GitHub: @shiro-0x
47
+ - Email: seren1001@example.com
48
+
49
+ ---
50
+
51
+ Last updated: 2026-06-11
hersona-0.0.1/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+ ============
3
+
4
+ Copyright (c) 2026 hersona contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,73 @@
1
+ Creative Commons CC0 1.0 Universal
2
+ ====================================
3
+
4
+ CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
5
+ ==================================================
6
+
7
+ This is a human-readable summary of the Legal Code (the full text is at
8
+ <https://creativecommons.org/publicdomain/zero/1.0/legalcode>).
9
+
10
+ No Copyright
11
+ ------------
12
+
13
+ The person who associated a work with this deed has dedicated the work to
14
+ the public domain by waiving all rights worldwide under copyright law,
15
+ including all related and neighboring rights, to the extent allowed by law.
16
+
17
+ You can copy, modify, distribute and perform the work, even for commercial
18
+ purposes, all without asking permission.
19
+
20
+ Other Rights
21
+ ------------
22
+
23
+ The following rights are not affected by CC0, nor are they waived or
24
+ dedicated:
25
+
26
+ - The moral rights of the author (to the extent they exist);
27
+ - Rights that other persons may have in the work itself (such as publicity
28
+ or privacy rights); and
29
+ - Patent or trademark rights of the author.
30
+
31
+ In no way are any of the above rights affected by the following:
32
+
33
+ - The license of the underlying database or dataset from which the work is
34
+ derived; or
35
+ - Your fair dealing or fair use rights, or other applicable copyright
36
+ exceptions and limitations.
37
+
38
+ Notice
39
+ ------
40
+
41
+ Creative Commons is not a party to this public domain dedication. While
42
+ Creative Commons is not a party to this public license, it may apply the
43
+ license to material it publishes; in that case, it will be the only party
44
+ who may enforce the license.
45
+
46
+ When using or citing the work, you should not imply endorsement by
47
+ Creative Commons.
48
+
49
+ ==================================================
50
+
51
+ Full Legal Text: https://creativecommons.org/publicdomain/zero/1.0/legalcode
52
+
53
+ ==================================================
54
+
55
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
56
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
57
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION
58
+ ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
59
+ USE OF THIS DOCUMENT, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
60
+ ITS USE.
61
+
62
+ ==================================================
63
+
64
+ Purpose in this repository
65
+ --------------------------
66
+
67
+ This LICENSE-CC0.txt applies to attribute-template metadata files
68
+ (attributes/**/*.yaml) — i.e. the reusable "personality / speech / archetype"
69
+ attribute catalogs. They are released to the public domain so that downstream
70
+ projects can reuse the attribute vocabulary without attribution friction.
71
+
72
+ The repository's primary LICENSE (MIT) covers the code itself
73
+ (scripts/, schema/*.json, etc.).