Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Code Quality

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install tools
run: |
python -m pip install --upgrade pip
python -m pip install "ruff==0.13.2"

Comment on lines +23 to +27
- name: Ruff lint
run: |
ruff check . \
--line-length 88 \
--target-version py310 \
--extend-exclude plans,docs,templates \
--select F,W,E,ASYNC,C4,Q,I,UP \
--ignore F403,F405,E501,ASYNC230,ASYNC240 \
--per-file-ignores "__init__.py:F401"

- name: Ruff format check
run: ruff format --check . --line-length 88 --exclude plans,docs,templates

syntax:
name: Syntax Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Compile all Python files
run: python -m compileall -q .

metadata:
name: Metadata Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install PyYAML
run: python -m pip install "pyyaml==6.0.2"

- name: Validate metadata.yaml
run: |
python -c "import yaml,sys; yaml.safe_load(open('metadata.yaml',encoding='utf-8')); print('metadata.yaml OK')"

- name: Validate _conf_schema.json
run: |
python -c "import json; json.load(open('_conf_schema.json',encoding='utf-8')); print('_conf_schema.json OK')"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
| summarization_provider_id | 记忆总结 LLM 模型(预留) | 留空使用会话主 LLM |
| auto_memorize | 自动记忆模式开关 | `true` |
| extraction_interval | 每 N 轮对话触发一次记忆提取 | `20` |
| extraction_min_content_length | 对话总长度低于此值时跳过提取 | `500` |
| extraction_min_content_length | 对话总长度低于此值时跳过提取 | `150` |
| global_memory | 全局记忆模式(跨会话召回) | `true` |
| max_memories_per_inject | 每次 LLM 请求注入的最大记忆条数 | `5` |
| memory_domains | 记忆分类域 | `["user_profile", "preferences", "facts", "events", "context"]` |
Expand Down
2 changes: 1 addition & 1 deletion _conf_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"extraction_min_content_length": {
"description": "最小提取内容长度",
"type": "int",
"default": 500,
"default": 150,
"hint": "对话总内容低于此字符数时跳过记忆提取,避免无意义短对话被记忆"
},
"global_memory": {
Expand Down
Loading
Loading