zymor 0.2.0__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.
- zymor-0.2.0/.env.example +3 -0
- zymor-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +64 -0
- zymor-0.2.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
- zymor-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +47 -0
- zymor-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +28 -0
- zymor-0.2.0/.github/dependabot.yml +12 -0
- zymor-0.2.0/.github/workflows/ci.yml +39 -0
- zymor-0.2.0/.github/workflows/release.yml +49 -0
- zymor-0.2.0/.gitignore +35 -0
- zymor-0.2.0/CHANGELOG.md +38 -0
- zymor-0.2.0/CODE_OF_CONDUCT.md +27 -0
- zymor-0.2.0/CONTRIBUTING.md +59 -0
- zymor-0.2.0/GLOSSARY.md +37 -0
- zymor-0.2.0/LICENSE +202 -0
- zymor-0.2.0/PKG-INFO +185 -0
- zymor-0.2.0/README.en.md +160 -0
- zymor-0.2.0/README.md +161 -0
- zymor-0.2.0/SECURITY.md +28 -0
- zymor-0.2.0/assets/README.md +34 -0
- zymor-0.2.0/assets/favicon.svg +7 -0
- zymor-0.2.0/assets/zymor-horizontal-dark.svg +34 -0
- zymor-0.2.0/assets/zymor-horizontal-light.svg +32 -0
- zymor-0.2.0/assets/zymor-icon-dark.svg +22 -0
- zymor-0.2.0/assets/zymor-icon-light.svg +22 -0
- zymor-0.2.0/docs/development/release.md +80 -0
- zymor-0.2.0/docs/development/repository-workflow.md +146 -0
- zymor-0.2.0/docs/guide/dream.md +86 -0
- zymor-0.2.0/docs/guide/mcp-integration.md +78 -0
- zymor-0.2.0/docs/guide/quickstart.md +82 -0
- zymor-0.2.0/docs/guide/rules.md +49 -0
- zymor-0.2.0/docs/guide/troubleshooting.md +67 -0
- zymor-0.2.0/pyproject.toml +46 -0
- zymor-0.2.0/src/zymor/__init__.py +3 -0
- zymor-0.2.0/src/zymor/__main__.py +4 -0
- zymor-0.2.0/src/zymor/assembly.py +425 -0
- zymor-0.2.0/src/zymor/atlas.py +205 -0
- zymor-0.2.0/src/zymor/cli.py +1050 -0
- zymor-0.2.0/src/zymor/config.py +263 -0
- zymor-0.2.0/src/zymor/dream/__init__.py +27 -0
- zymor-0.2.0/src/zymor/dream/arbitration.py +833 -0
- zymor-0.2.0/src/zymor/dream/decay.py +95 -0
- zymor-0.2.0/src/zymor/dream/engine.py +298 -0
- zymor-0.2.0/src/zymor/dream/evidence.py +272 -0
- zymor-0.2.0/src/zymor/dream/nrem.py +1227 -0
- zymor-0.2.0/src/zymor/dream/persona.py +997 -0
- zymor-0.2.0/src/zymor/dream/promote.py +110 -0
- zymor-0.2.0/src/zymor/dream/rem.py +348 -0
- zymor-0.2.0/src/zymor/dream/state.py +264 -0
- zymor-0.2.0/src/zymor/dream/types.py +281 -0
- zymor-0.2.0/src/zymor/embeddings.py +272 -0
- zymor-0.2.0/src/zymor/errors.py +95 -0
- zymor-0.2.0/src/zymor/invalidation.py +293 -0
- zymor-0.2.0/src/zymor/llm.py +349 -0
- zymor-0.2.0/src/zymor/maintenance.py +118 -0
- zymor-0.2.0/src/zymor/mcp_server.py +1217 -0
- zymor-0.2.0/src/zymor/model/__init__.py +1 -0
- zymor-0.2.0/src/zymor/model/event.py +169 -0
- zymor-0.2.0/src/zymor/model/focus.py +148 -0
- zymor-0.2.0/src/zymor/model/node.py +362 -0
- zymor-0.2.0/src/zymor/promotion.py +277 -0
- zymor-0.2.0/src/zymor/retrieval.py +1028 -0
- zymor-0.2.0/src/zymor/rule_checks.py +178 -0
- zymor-0.2.0/src/zymor/security.py +80 -0
- zymor-0.2.0/src/zymor/store/__init__.py +1 -0
- zymor-0.2.0/src/zymor/store/audit.py +35 -0
- zymor-0.2.0/src/zymor/store/index.py +755 -0
- zymor-0.2.0/src/zymor/store/nodes.py +161 -0
- zymor-0.2.0/src/zymor/tasktype.py +19 -0
- zymor-0.2.0/src/zymor/tokenizer.py +125 -0
- zymor-0.2.0/src/zymor/util/__init__.py +0 -0
- zymor-0.2.0/src/zymor/util/fs.py +51 -0
- zymor-0.2.0/src/zymor/util/ids.py +30 -0
- zymor-0.2.0/src/zymor/util/time.py +56 -0
- zymor-0.2.0/src/zymor/util/yamlutil.py +82 -0
- zymor-0.2.0/src/zymor/vault.py +340 -0
- zymor-0.2.0/src/zymor/write_service.py +2110 -0
- zymor-0.2.0/tests/test_open_smoke.py +123 -0
- zymor-0.2.0/uv.lock +1365 -0
zymor-0.2.0/.env.example
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a reproducible bug in Zymor
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for reporting. Please do not include secrets, API keys, or private vault contents.
|
|
10
|
+
- type: input
|
|
11
|
+
id: version
|
|
12
|
+
attributes:
|
|
13
|
+
label: Version / commit
|
|
14
|
+
description: Output of `zymor --version` or the commit SHA.
|
|
15
|
+
placeholder: "0.1.0 / 598d775"
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: dropdown
|
|
19
|
+
id: surface
|
|
20
|
+
attributes:
|
|
21
|
+
label: Surface
|
|
22
|
+
options:
|
|
23
|
+
- CLI
|
|
24
|
+
- MCP server
|
|
25
|
+
- dream engine
|
|
26
|
+
- retrieval / index
|
|
27
|
+
- write protocol
|
|
28
|
+
- docs / packaging
|
|
29
|
+
- other
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: steps
|
|
34
|
+
attributes:
|
|
35
|
+
label: Reproduction steps
|
|
36
|
+
description: Minimal commands, files, or vault structure needed to reproduce.
|
|
37
|
+
placeholder: |
|
|
38
|
+
1. zymor init
|
|
39
|
+
2. zymor remember ...
|
|
40
|
+
3. zymor search ...
|
|
41
|
+
validations:
|
|
42
|
+
required: true
|
|
43
|
+
- type: textarea
|
|
44
|
+
id: expected
|
|
45
|
+
attributes:
|
|
46
|
+
label: Expected behavior
|
|
47
|
+
validations:
|
|
48
|
+
required: true
|
|
49
|
+
- type: textarea
|
|
50
|
+
id: actual
|
|
51
|
+
attributes:
|
|
52
|
+
label: Actual behavior / logs
|
|
53
|
+
description: Redact secrets and personal paths.
|
|
54
|
+
validations:
|
|
55
|
+
required: true
|
|
56
|
+
- type: checkboxes
|
|
57
|
+
id: checks
|
|
58
|
+
attributes:
|
|
59
|
+
label: Checklist
|
|
60
|
+
options:
|
|
61
|
+
- label: I searched existing issues.
|
|
62
|
+
required: true
|
|
63
|
+
- label: I removed secrets and private data from this report.
|
|
64
|
+
required: true
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Security report
|
|
4
|
+
url: https://github.com/Gyanano/zymor/security/advisories/new
|
|
5
|
+
about: Please report vulnerabilities privately, not in a public issue.
|
|
6
|
+
- name: Documentation
|
|
7
|
+
url: https://github.com/Gyanano/zymor/tree/main/docs
|
|
8
|
+
about: Check the user guide before opening a usage question.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a capability or design change
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
For memory-model, storage-format, MCP-tool, or public-CLI changes, describe the design impact first.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Problem
|
|
14
|
+
description: What is hard or impossible today?
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: proposal
|
|
19
|
+
attributes:
|
|
20
|
+
label: Proposed behavior
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: alternatives
|
|
25
|
+
attributes:
|
|
26
|
+
label: Alternatives considered
|
|
27
|
+
- type: dropdown
|
|
28
|
+
id: scope
|
|
29
|
+
attributes:
|
|
30
|
+
label: Scope
|
|
31
|
+
options:
|
|
32
|
+
- small / local
|
|
33
|
+
- memory model or storage format
|
|
34
|
+
- MCP or public CLI
|
|
35
|
+
- docs / tooling
|
|
36
|
+
- needs design discussion
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
- type: checkboxes
|
|
40
|
+
id: checks
|
|
41
|
+
attributes:
|
|
42
|
+
label: Checklist
|
|
43
|
+
options:
|
|
44
|
+
- label: I searched existing issues and discussions.
|
|
45
|
+
required: true
|
|
46
|
+
- label: I understand this may need an issue-first design discussion.
|
|
47
|
+
required: true
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## What changed
|
|
2
|
+
|
|
3
|
+
<!-- One or two sentences. Link the issue below. -->
|
|
4
|
+
|
|
5
|
+
Closes #
|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
<!-- The problem this solves, not only the implementation. -->
|
|
10
|
+
|
|
11
|
+
## Verification
|
|
12
|
+
|
|
13
|
+
<!-- Commands and results. Do not include secrets. -->
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
uv sync --extra dev
|
|
17
|
+
uv run pytest tests/test_open_smoke.py -q
|
|
18
|
+
uv run ruff check src tests
|
|
19
|
+
uv run mypy src/zymor
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Checklist
|
|
23
|
+
|
|
24
|
+
- [ ] Behavior change has a test or a clear reason why it does not.
|
|
25
|
+
- [ ] CLI / MCP / config changes have docs updates.
|
|
26
|
+
- [ ] User-visible changes are in `CHANGELOG.md`.
|
|
27
|
+
- [ ] No secrets, private vaults, datasets, or generated caches are included.
|
|
28
|
+
- [ ] AI-assisted work was reviewed by the submitter.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
name: ruff + mypy + smoke (Python ${{ matrix.python-version }})
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
python-version: ["3.12", "3.13"]
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v7
|
|
27
|
+
- uses: astral-sh/setup-uv@v7
|
|
28
|
+
with:
|
|
29
|
+
enable-cache: true
|
|
30
|
+
- name: Install Python
|
|
31
|
+
run: uv python install ${{ matrix.python-version }}
|
|
32
|
+
- name: Sync dependencies
|
|
33
|
+
run: uv sync --extra dev --python ${{ matrix.python-version }}
|
|
34
|
+
- name: Ruff
|
|
35
|
+
run: uv run ruff check src tests
|
|
36
|
+
- name: Mypy
|
|
37
|
+
run: uv run mypy src/zymor
|
|
38
|
+
- name: Smoke tests
|
|
39
|
+
run: uv run pytest tests/test_open_smoke.py -q
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: release-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
name: Build distributions
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
- uses: astral-sh/setup-uv@v7
|
|
22
|
+
with:
|
|
23
|
+
enable-cache: true
|
|
24
|
+
- name: Verify tag matches project version
|
|
25
|
+
run: |
|
|
26
|
+
version=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
27
|
+
test "v$version" = "$GITHUB_REF_NAME"
|
|
28
|
+
- name: Build sdist and wheel
|
|
29
|
+
run: uv build
|
|
30
|
+
- uses: actions/upload-artifact@v7
|
|
31
|
+
with:
|
|
32
|
+
name: dist
|
|
33
|
+
path: dist/
|
|
34
|
+
|
|
35
|
+
publish:
|
|
36
|
+
name: Publish to PyPI
|
|
37
|
+
needs: build
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
environment:
|
|
40
|
+
name: pypi
|
|
41
|
+
url: https://pypi.org/p/zymor
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/download-artifact@v8
|
|
46
|
+
with:
|
|
47
|
+
name: dist
|
|
48
|
+
path: dist/
|
|
49
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
zymor-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
.venv/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
.mypy_cache/
|
|
11
|
+
.uv/
|
|
12
|
+
|
|
13
|
+
.env
|
|
14
|
+
.env.local
|
|
15
|
+
|
|
16
|
+
.zymor/
|
|
17
|
+
eval-runs/
|
|
18
|
+
|
|
19
|
+
# prototype workspaces (throwaway; results files stay tracked)
|
|
20
|
+
prototypes/fts5-bench/corpus_sample/
|
|
21
|
+
prototypes/eval-smoke/.venv/
|
|
22
|
+
prototypes/eval-smoke/data/
|
|
23
|
+
prototypes/eval-smoke/runs/
|
|
24
|
+
prototypes/eval-smoke/logs/
|
|
25
|
+
prototypes/eval-smoke/official/
|
|
26
|
+
prototypes/**/*.sqlite3
|
|
27
|
+
prototypes/**/node_modules/
|
|
28
|
+
|
|
29
|
+
.DS_Store
|
|
30
|
+
Thumbs.db
|
|
31
|
+
prototypes/fts5-bench/data/
|
|
32
|
+
prototypes/eval-smoke/profiles/
|
|
33
|
+
prototypes/eval-smoke/tmp/
|
|
34
|
+
prototypes/fts5-bench/summary.partial.json
|
|
35
|
+
prototypes/formal-check/__pycache__/
|
zymor-0.2.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 与语义化版本。
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-10-28
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- 跨项目 L3 晋升:`zymor promote <id> [--dry-run] [--yes]`,校验 verified/confidence/verify_count/hit_count/applies_to/evidence/未决冲突,写用户库副本并保留 provenance 与去重;NREM 自动晋升带 `cross-project` 标签的节点(`promotion.auto_enabled` 可关)。节点新增 `projects` provenance;`zymor adopt ID` 记录当前项目确认复用用户库节点,第二次采纳自动打 `cross-project-verified` 标签;`promotion.min_projects` 可设多项目门槛,`--force` 覆盖。
|
|
10
|
+
- 失效锚定:节点新增可选 `anchors` 字段;`zymor anchor <id> --file PATH` 绑定文件 sha256,`--package MANIFEST:PACKAGE` 绑定 package.json/pyproject 依赖版本,`--api MANIFEST:KEY` 绑定本地 JSON/TOML 版本清单中的外部 API 版本;`zymor stale [--deprecate]` 检查/标记失效节点(deprecated + Tombstone + evidence);`memory_search` 与 `memory_context` 默认排除 stale(search 加 `include_stale` 可查看),`memory_read` 返回 `stale` 与 `stale_reasons`。
|
|
11
|
+
- 上下文状态标签:`memory_context` 只注入 verified L4 并标 `[verified]`;L2 胶囊行标 `[status]`。
|
|
12
|
+
- 捕获/做梦自动化:`memory_close` 自动向 L0 追加 `system_note` 关闭事件;`dream.auto_after_close=true` 时 MCP `memory_close` 自动跑 NREM+仲裁。
|
|
13
|
+
- 检索:FTS5 索引同时写入 snake_case/camelCase 子词,查询生成 `原词 OR 子词`;`meta.tokenizer` 升到 `cjk-bigram-v2-identifiers`,版本不符自动重建索引;新增可选 embedding 向量索引(`zymor index embed`)与 `memory_semantic_search`/`zymor semantic`;`search --semantic` / `include_semantic` 融合词法与向量命中。
|
|
14
|
+
- MCP:新增 `memory_promote`、`memory_adopt`、`memory_stale` 三个写工具,Agent 可直接跨项目晋升/采纳/检查失效。
|
|
15
|
+
- 检索:新增 `memory_rules` / `zymor rules`,直接返回 verified L3 规则(task_type 过滤、token 预算 400),供 Agent 在会话开始/任务切换时加载项目约定;新增 `memory_rule_check` / `zymor rule-check`,按规则正文 `## 检查` 的 contains/absent/regex 约束做只读校验。
|
|
16
|
+
- 开源发布工程:最小功能冒烟测试、GitHub Actions CI(ruff / mypy / Python 3.12 + 3.13)、Dependabot(uv + GitHub Actions)、CodeQL、main/tag ruleset、PyPI Trusted Publishing workflow。
|
|
17
|
+
- 协作与发布文档:中英双语 README、主题自适应 Logo、CONTRIBUTING、SECURITY、CODE_OF_CONDUCT、issue/PR 模板、仓库工作流与发布指南。
|
|
18
|
+
|
|
19
|
+
## [0.1.0] - 2026-10-27
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- v0 记忆内核:L0 事件流、L1 焦点、L2 胶囊、L3 知识节点、L4 人格 facet;Memory Node schema 与校验;双库 vault 布局;SQLite FTS5 索引(CJK bigram 外部分词,可重建缓存)。
|
|
24
|
+
- 检索与上下文组装:评分公式、过滤、`memory_search/read/browse/links`、跨库合并、`memory_context`、ATLAS 与 catalog 生成、检索审计与预算。
|
|
25
|
+
- 写入协议:写作门控、去重四动作(new / append-evidence / supersede / conflict)、状态机、L1→L2 胶囊、L0 捕获、失调队列、隐私删除。
|
|
26
|
+
- 做梦引擎:NREM 巩固、认知失调仲裁、REM 跨域联想、L4 人格提炼、预算/锁/水位线、胶囊闲置降权、晨间追问与 `zymor answer`。
|
|
27
|
+
- MCP Server:11 个工具(只读模式 5 个)、resources(atlas/catalog/node)、prompts(boot/review)、stdio 与 Streamable HTTP(静态 Bearer token)、敏感信息检测与脱敏、`instructions` 短协议。
|
|
28
|
+
- 工程与文档:v0 规格、形式化模型、研究资产、用户手册、CI(Windows/Ubuntu × Python 3.12/3.13)、CHANGELOG、Apache-2.0。
|
|
29
|
+
|
|
30
|
+
### Known limitations
|
|
31
|
+
|
|
32
|
+
- 无 OpenAI 兼容通道:headline 分数与竞品复跑未产出;只提交 local-protocol harness 冒烟(不可解释)。
|
|
33
|
+
- MCP-only 捕获依赖 Agent 调用 `memory_log`;无宿主桥。
|
|
34
|
+
- 无常驻做梦守护进程;REM/人格质量仅用脚本化假 LLM 验证;P6 人工荒谬率待抽检。
|
|
35
|
+
- 仲裁不执行本地命令;跨项目 L3→用户库晋升未实现;胶囊降权为每次 run 的离散步进。
|
|
36
|
+
|
|
37
|
+
[0.1.0]: https://github.com/Gyanano/zymor/releases/tag/v0.1.0
|
|
38
|
+
[0.2.0]: https://github.com/Gyanano/zymor/releases/tag/v0.2.0
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project adopts the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
|
|
4
|
+
|
|
5
|
+
## Our pledge
|
|
6
|
+
|
|
7
|
+
We want participation in Zymor to be a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
8
|
+
|
|
9
|
+
## Expected behavior
|
|
10
|
+
|
|
11
|
+
- Be respectful and constructive.
|
|
12
|
+
- Assume good intent; critique ideas, not people.
|
|
13
|
+
- Give and accept actionable feedback.
|
|
14
|
+
- Respect privacy and do not publish others' private information.
|
|
15
|
+
- Do not use sexualized language or imagery, or unwelcome attention.
|
|
16
|
+
|
|
17
|
+
## Unacceptable behavior
|
|
18
|
+
|
|
19
|
+
Harassment, threats, discriminatory language, deliberate intimidation, doxxing, and sustained disruption are not acceptable.
|
|
20
|
+
|
|
21
|
+
## Reporting
|
|
22
|
+
|
|
23
|
+
Report incidents privately via GitHub's **Security → Report a vulnerability** flow or directly to the maintainer (`@Gyanano`). Reports will be reviewed and handled as confidentially as possible. Maintainers may remove comments, close issues, or block accounts that violate this policy.
|
|
24
|
+
|
|
25
|
+
## Attribution
|
|
26
|
+
|
|
27
|
+
This policy is based on the Contributor Covenant 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct/.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Contributing to Zymor
|
|
2
|
+
|
|
3
|
+
Thanks for your interest. This project favors small, verifiable changes over large rewrites.
|
|
4
|
+
|
|
5
|
+
## Before you start
|
|
6
|
+
|
|
7
|
+
- For bugs, open an issue using the bug report template.
|
|
8
|
+
- For features, open a feature request first and describe the problem, not only the solution.
|
|
9
|
+
- For security issues, do **not** open a public issue; follow [`SECURITY.md`](SECURITY.md).
|
|
10
|
+
- For design changes that affect the memory model, storage format, MCP tools, or public CLI, open an issue first and get agreement before writing code.
|
|
11
|
+
|
|
12
|
+
## Development setup
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
uv sync --extra dev
|
|
16
|
+
uv run pytest tests/test_open_smoke.py -q
|
|
17
|
+
uv run ruff check src tests
|
|
18
|
+
uv run mypy src/zymor
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The public repository ships a minimal functional smoke suite. Full evaluation harnesses and datasets are intentionally not part of the open-source release.
|
|
22
|
+
|
|
23
|
+
## Branch and commits
|
|
24
|
+
|
|
25
|
+
- Branch from `main`: `feat/<short-name>`, `fix/<short-name>`, `docs/<short-name>`, `chore/<short-name>`.
|
|
26
|
+
- Use [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `docs:`, `test:`, `refactor:`, `chore:`.
|
|
27
|
+
- Keep commits reviewable; avoid mixing refactors and behavior changes.
|
|
28
|
+
- Do not commit secrets, local vaults, `.env.local`, datasets, or generated caches.
|
|
29
|
+
- AI-assisted contributions are welcome; you are responsible for reviewing and testing the result.
|
|
30
|
+
|
|
31
|
+
## Pull requests
|
|
32
|
+
|
|
33
|
+
A good PR:
|
|
34
|
+
|
|
35
|
+
- links the issue (`Closes #123`);
|
|
36
|
+
- states the behavior change and how it was verified;
|
|
37
|
+
- adds or updates a test when behavior changes;
|
|
38
|
+
- updates user-facing docs when CLI/MCP behavior changes;
|
|
39
|
+
- updates `CHANGELOG.md` for user-visible changes;
|
|
40
|
+
- passes CI (`ruff`, `mypy`, smoke tests).
|
|
41
|
+
|
|
42
|
+
The maintainer merges with squash merge. Please do not force-push a branch after review starts unless asked.
|
|
43
|
+
|
|
44
|
+
## Code and documentation rules
|
|
45
|
+
|
|
46
|
+
- Code comments are intentionally sparse; prefer self-explanatory code and short interface docstrings.
|
|
47
|
+
- Documentation is the source of current behavior: update it instead of describing history.
|
|
48
|
+
- Do not add network calls, API keys, or provider-specific endpoints to tests.
|
|
49
|
+
- Do not add evaluation data or test reports to this repository.
|
|
50
|
+
|
|
51
|
+
## Review and release
|
|
52
|
+
|
|
53
|
+
- One maintainer review is required while the project has a single maintainer; this may become two approvals later.
|
|
54
|
+
- Releases follow [Semantic Versioning](https://semver.org/) and [Keep a Changelog](https://keepachangelog.com/).
|
|
55
|
+
- Release tags use `vMAJOR.MINOR.PATCH`; release notes come from `CHANGELOG.md`.
|
|
56
|
+
|
|
57
|
+
## Community
|
|
58
|
+
|
|
59
|
+
By participating you agree to follow [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
|
zymor-0.2.0/GLOSSARY.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Zymor 术语表
|
|
2
|
+
|
|
3
|
+
一个词条只写「它是什么」,不写实现方案。实现细节在 `project documentation`。
|
|
4
|
+
|
|
5
|
+
| 术语 | 定义 |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| Zymor | 本项目:与宿主无关的 Agent 记忆系统,由分层记忆、做梦引擎与可移植知识库组成。中文对外名「织梦师」。 |
|
|
8
|
+
| 宿主 / Harness | 运行 Agent 的框架或应用(DSH、Claude Code、Cursor、Codex 等);Zymor 通过 MCP 与它们解耦。 |
|
|
9
|
+
| 事件(Event) | L0 感知流中的一条原始记录(用户消息、助手消息、工具调用或结果),append-only,不进入上下文。 |
|
|
10
|
+
| 焦点文件(Focus File) | 每个会话一个的 L1 工作记忆文件,包含当前目标、活跃假设、已排除路径等,是唯一全量挂载层。 |
|
|
11
|
+
| 胶囊(Capsule) | L2 层的情景记忆节点,承载跨天/周任务的状态;平时只暴露一句话摘要。 |
|
|
12
|
+
| 心智 facet(Facet) | L4 层的心智节点,描述在特定任务情境下应如何行事的可执行规则,含正例与反例。 |
|
|
13
|
+
| WikiLink / 双链 | 正文中的 `[[mem_...]]` 引用;索引器据此建立双向链接关系。 |
|
|
14
|
+
| 记忆库(Vault) | 一个自包含的记忆目录(全局库或项目库):Markdown 为事实源,SQLite 索引为可重建缓存。 |
|
|
15
|
+
| 两速写入(Two-Speed Write) | L0 事件逐条追加、不调用 LLM;记忆节点只在显式写入或做梦提取时产生,不做每轮实时抽取。 |
|
|
16
|
+
| 写作门控(Salience Gate) | 写入前判断「值不值得记」的清单:丢弃常识、易得事实与一次性噪音,保留踩坑因果、取舍、用户偏好与跨任务经验。 |
|
|
17
|
+
| 失调队列(Dissonance Queue) | 新记忆与旧记忆冲突、尚未裁决时记录的待办队列,由做梦仲裁或晨间追问消费。 |
|
|
18
|
+
| 晨间追问(Morning Questions) | 做梦无法自行裁决的问题,在下一次会话通过 `memory_context` 呈现给用户确认。 |
|
|
19
|
+
| 探针(Probe) | 针对公开基准不覆盖的差异能力(做梦、墓碑、唤醒度、渐进披露、胶囊唤醒、跨域链接)设计的内部回归测试。 |
|
|
20
|
+
| 记忆节点(Memory Node) | 记忆的最小可检索单元:一条结论及其元数据、证据来源;以带 YAML frontmatter 的 Markdown 文件承载。 |
|
|
21
|
+
| 认知分类(Category) | 记忆节点的类型:情景 episodic(发生过什么、为何决策)、陈述 semantic(领域事实)、程序 procedural(SOP 与做法)、心智 axioms(思维模型与偏好)。 |
|
|
22
|
+
| L0 感知流 | 未经整理的原始交互与工具事件;不进入上下文,只作为做梦的原料。 |
|
|
23
|
+
| L1 焦点工作台 | 当前任务的活跃目标、假设与临时状态;唯一全量进入上下文的记忆层。 |
|
|
24
|
+
| L2 情景胶囊 | 跨天/周的长线任务状态;平时只暴露一句话摘要,命中时展开。 |
|
|
25
|
+
| L3 知识库 | 经实战验证与做梦提炼的长期知识;按需渐进式读取,不常驻上下文。 |
|
|
26
|
+
| L4 情境心智 | 跨任务稳定的人格与思维偏好(论证方式、审美、沟通风格),按任务情境动态挂载。 |
|
|
27
|
+
| 做梦(Dream Cycle) | 异步的记忆维护过程:清洗与巩固 → 矛盾仲裁 → 跨域联想 → 人格提炼。 |
|
|
28
|
+
| 巩固(Consolidation) | 把一次性经验转成更稳定、更通用记忆的过程:置信度与稳定性提升、跨层晋升。 |
|
|
29
|
+
| 唤醒度(Arousal) | 记忆的新奇/待验证程度,决定近期是否被优先召回;随验证转化为置信度。 |
|
|
30
|
+
| 置信度(Confidence) | 一条记忆被证实为真的程度。 |
|
|
31
|
+
| 墓碑(Tombstone) | 被证伪的记忆及其纠正记录:保留「此路不通」的教训,避免重蹈覆辙。 |
|
|
32
|
+
| 认知失调(Dissonance) | 新信息与既有记忆冲突、尚未裁决的状态。 |
|
|
33
|
+
| 渐进式披露(Progressive Disclosure) | 检索策略:先暴露目录与摘要,按需逐层深入,直到命中正文。 |
|
|
34
|
+
| 上下文组装(Context Assembly) | 任务开始时决定哪些记忆进入上下文、以多少 token 预算进入的过程。 |
|
|
35
|
+
| MCP | Model Context Protocol;Zymor 与宿主对接的标准协议。 |
|
|
36
|
+
| 评估基线 | 一组固定基准与固定协议,用于给 Zymor 打分,并与主流记忆框架同表对比。 |
|
|
37
|
+
| Zymor 探针 | 自建的、针对做梦/冲突/遗忘等差异能力的小型评测任务。 |
|
zymor-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|