continuity-plane 0.1.0a1__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 (67) hide show
  1. continuity_plane-0.1.0a1/LICENSE +202 -0
  2. continuity_plane-0.1.0a1/NOTICE +5 -0
  3. continuity_plane-0.1.0a1/PKG-INFO +156 -0
  4. continuity_plane-0.1.0a1/README.md +126 -0
  5. continuity_plane-0.1.0a1/THIRD_PARTY_NOTICES.md +30 -0
  6. continuity_plane-0.1.0a1/continuity_plane/__init__.py +21 -0
  7. continuity_plane-0.1.0a1/continuity_plane/artifact_store.py +318 -0
  8. continuity_plane-0.1.0a1/continuity_plane/assertion_provenance.py +418 -0
  9. continuity_plane-0.1.0a1/continuity_plane/authorization_audit.py +807 -0
  10. continuity_plane-0.1.0a1/continuity_plane/checkpoint.py +532 -0
  11. continuity_plane-0.1.0a1/continuity_plane/claim_evidence_gate.py +419 -0
  12. continuity_plane-0.1.0a1/continuity_plane/cli.py +281 -0
  13. continuity_plane-0.1.0a1/continuity_plane/codegraph_verification.py +700 -0
  14. continuity_plane-0.1.0a1/continuity_plane/collaboration_notifications.py +1262 -0
  15. continuity_plane-0.1.0a1/continuity_plane/compiled_skill_packet.py +318 -0
  16. continuity_plane-0.1.0a1/continuity_plane/database/migrations/001_postgres_state.up.sql +62 -0
  17. continuity_plane-0.1.0a1/continuity_plane/decision_evidence_projection.py +1003 -0
  18. continuity_plane-0.1.0a1/continuity_plane/durable_continuation.py +625 -0
  19. continuity_plane-0.1.0a1/continuity_plane/durable_operation.py +651 -0
  20. continuity_plane-0.1.0a1/continuity_plane/durable_state_migration.py +309 -0
  21. continuity_plane-0.1.0a1/continuity_plane/effect_scope_gate.py +377 -0
  22. continuity_plane-0.1.0a1/continuity_plane/execution_packet.py +586 -0
  23. continuity_plane-0.1.0a1/continuity_plane/experiment_lifecycle.py +157 -0
  24. continuity_plane-0.1.0a1/continuity_plane/external_state_provider.py +532 -0
  25. continuity_plane-0.1.0a1/continuity_plane/human_governance.py +790 -0
  26. continuity_plane-0.1.0a1/continuity_plane/idea_continuity.py +110 -0
  27. continuity_plane-0.1.0a1/continuity_plane/idea_review.py +794 -0
  28. continuity_plane-0.1.0a1/continuity_plane/obsidian_vault.py +490 -0
  29. continuity_plane-0.1.0a1/continuity_plane/postgres_state_store.py +365 -0
  30. continuity_plane-0.1.0a1/continuity_plane/project_graph_projection.py +728 -0
  31. continuity_plane-0.1.0a1/continuity_plane/relationship_impact_projection.py +633 -0
  32. continuity_plane-0.1.0a1/continuity_plane/retrieval_routing.py +769 -0
  33. continuity_plane-0.1.0a1/continuity_plane/sanitizer.py +136 -0
  34. continuity_plane-0.1.0a1/continuity_plane/schema_governance.py +238 -0
  35. continuity_plane-0.1.0a1/continuity_plane/schemas/m4-01/spdx-license-ids-3.28.0.json +737 -0
  36. continuity_plane-0.1.0a1/continuity_plane/shared_state_mcp.py +1092 -0
  37. continuity_plane-0.1.0a1/continuity_plane/shared_state_migration.py +511 -0
  38. continuity_plane-0.1.0a1/continuity_plane/shared_work_ledger.py +1068 -0
  39. continuity_plane-0.1.0a1/continuity_plane/skill_catalog.py +360 -0
  40. continuity_plane-0.1.0a1/continuity_plane/skill_compatibility.py +703 -0
  41. continuity_plane-0.1.0a1/continuity_plane/skill_manifest_set.py +549 -0
  42. continuity_plane-0.1.0a1/continuity_plane/skill_resolver.py +721 -0
  43. continuity_plane-0.1.0a1/continuity_plane/source_registry.py +359 -0
  44. continuity_plane-0.1.0a1/continuity_plane/sqlite_state_store.py +1645 -0
  45. continuity_plane-0.1.0a1/continuity_plane/sqlite_work_ledger.py +456 -0
  46. continuity_plane-0.1.0a1/continuity_plane/state_events.py +1311 -0
  47. continuity_plane-0.1.0a1/continuity_plane/state_mcp.py +3576 -0
  48. continuity_plane-0.1.0a1/continuity_plane/state_store.py +266 -0
  49. continuity_plane-0.1.0a1/continuity_plane/templates/MASTER.en.md +31 -0
  50. continuity_plane-0.1.0a1/continuity_plane/templates/MASTER.md +28 -0
  51. continuity_plane-0.1.0a1/continuity_plane/templates/STATUS.en.md +19 -0
  52. continuity_plane-0.1.0a1/continuity_plane/templates/STATUS.md +17 -0
  53. continuity_plane-0.1.0a1/continuity_plane/templates/__init__.py +1 -0
  54. continuity_plane-0.1.0a1/continuity_plane/templates/project.yaml +16 -0
  55. continuity_plane-0.1.0a1/continuity_plane/typed_state.py +1523 -0
  56. continuity_plane-0.1.0a1/continuity_plane/verification_profile.py +1042 -0
  57. continuity_plane-0.1.0a1/continuity_plane.egg-info/PKG-INFO +156 -0
  58. continuity_plane-0.1.0a1/continuity_plane.egg-info/SOURCES.txt +65 -0
  59. continuity_plane-0.1.0a1/continuity_plane.egg-info/dependency_links.txt +1 -0
  60. continuity_plane-0.1.0a1/continuity_plane.egg-info/entry_points.txt +2 -0
  61. continuity_plane-0.1.0a1/continuity_plane.egg-info/requires.txt +10 -0
  62. continuity_plane-0.1.0a1/continuity_plane.egg-info/top_level.txt +1 -0
  63. continuity_plane-0.1.0a1/pyproject.toml +55 -0
  64. continuity_plane-0.1.0a1/setup.cfg +4 -0
  65. continuity_plane-0.1.0a1/tests/test_public_benchmark.py +18 -0
  66. continuity_plane-0.1.0a1/tests/test_public_contracts.py +120 -0
  67. continuity_plane-0.1.0a1/tests/test_public_smoke.py +42 -0
@@ -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.
@@ -0,0 +1,5 @@
1
+ Continuity Plane
2
+ Copyright 2026 SkyHua and Continuity Plane contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0.
5
+ 本产品按 Apache License 2.0 授权,法律文本以 LICENSE 中的英文原文为准。
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: continuity-plane
3
+ Version: 0.1.0a1
4
+ Summary: Durable task state, bounded context, evidence, and collaboration control for long-running AI-assisted work
5
+ Author: Continuity Plane contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Documentation, https://github.com/skyhua0224/continuity-plane#readme
8
+ Project-URL: Issues, https://github.com/skyhua0224/continuity-plane/issues
9
+ Project-URL: Source, https://github.com/skyhua0224/continuity-plane
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: NOTICE
20
+ License-File: THIRD_PARTY_NOTICES.md
21
+ Requires-Dist: PyYAML<7,>=6.0.3
22
+ Requires-Dist: jsonschema<5,>=4.25.1
23
+ Provides-Extra: postgres
24
+ Requires-Dist: psycopg[binary]<4,>=3.3.4; extra == "postgres"
25
+ Provides-Extra: dev
26
+ Requires-Dist: build<2,>=1.3; extra == "dev"
27
+ Requires-Dist: psycopg[binary]<4,>=3.3.4; extra == "dev"
28
+ Requires-Dist: ruff<1,>=0.12; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # Continuity Plane
32
+
33
+ [![Managed with Continuity Plane](docs/assets/managed-with-continuity-plane.svg)](https://github.com/skyhua0224/continuity-plane)
34
+
35
+ Continuity Plane 是面向长期 AI 辅助软件工作的 provider-neutral 控制面。它把任务、
36
+ 决定、约束、证据、checkpoint、上下文组合和协作状态放在聊天窗口之外,支持压缩、
37
+ 任务切换、进程崩溃和多人交接后的确定性恢复。
38
+
39
+ [English README](README.en.md)
40
+
41
+ ## 你可能遇到的事故
42
+
43
+ | 场景 | 痛点 | 详情 |
44
+ |---|---|---|
45
+ | 压缩与长 Session | 刚刚还在修测试,压缩后却重答旧问题,甚至把做完的工作重新做一遍 | [场景详情](docs/use-cases.md#压缩后像换了一个人) |
46
+ | 多 Session 与部署竞态 | 两边都以为自己可以部署,直到 main、CI 和环境互相覆盖才发现冲突 | [场景详情](docs/use-cases.md#同一仓库的多个-session-会互相踩踏) |
47
+ | 多人和多 Agent | 别人已经在本地做完的东西不可见,协作者只能重复实现、重复查资料 | [场景详情](docs/use-cases.md#多人和多-agent-不知道别人已经做了什么) |
48
+ | Idea 与任务切换 | 一句临时想法让 Agent 离开主线,回来时找不到原任务的落点 | [场景详情](docs/use-cases.md#临时-idea-很容易把主线带跑) |
49
+ | 大型项目 | 几百个模块和跨仓依赖堆在一起,人和 AI 都不知道改动会影响哪里 | [场景详情](docs/use-cases.md#大型项目里人和-ai-都不知道哪里是哪里) |
50
+ | Memory、Skill、文档漂移 | 旧路径、旧决定和旧规则在压缩后重新冒出来 | [场景详情](docs/use-cases.md#memoryskill-和文档会漂移) |
51
+
52
+ ## 已测结果
53
+
54
+ | 场景 | 结果 | 详情 |
55
+ |---|---|---|
56
+ | 压缩恢复 | input tokens `-40.25%`;近上限历史 `-95.06%`;quality `3/3` | [压缩实测](docs/benchmarks.md#压缩与恢复) |
57
+ | 代码检索 | input `-50.02%`;tool calls `-57.89%`;wall time `-27.41%`;quality `3/3` | [检索实测](docs/benchmarks.md#代码检索) |
58
+ | Skill 装载 | source bytes `-96.54%`;quality `3/3` | [Skill 实测](docs/benchmarks.md#skill-装载) |
59
+ | 多 Session 协调 | duplicate tool calls `-55.88%`;parallel wall time `-22.65%` | [协作实测](docs/benchmarks.md#多-session-协作) |
60
+ | 一致性 | E0-E9 `10/10`;双 Session `1000/1000`;authority violation `0` | [一致性实测](docs/benchmarks.md#一致性与限制) |
61
+ | 大型项目视图 | 2,000 nodes / 5,000 edges;scale p95 `187.459764 ms` | [图形视图](docs/project-views.md) |
62
+
63
+ 这些是匹配任务和当前 fixture 的场景级结果,不能合成为所有用户的统一节省率。
64
+ 用户 token、窗口有效利用率和两次压缩之间的有效工作量,按 accepted Work 归一化,
65
+ 并在 host trace 可见时计量。[完整方法和限制](docs/benchmarks.md)。
66
+
67
+ ## 架构概览
68
+
69
+ ```text
70
+ Agent / IDE / CI / 人类控制台
71
+ |
72
+ v
73
+ Execution Packet
74
+ |
75
+ +--------+---------+
76
+ | |
77
+ Typed State Evidence index
78
+ revision + CAS hash + validity
79
+ | |
80
+ +--------+---------+
81
+ |
82
+ append-only events
83
+ |
84
+ checkpoint + replay canary
85
+ |
86
+ SQLite 默认
87
+ ```
88
+
89
+ Memory、检索系统、代码图和 reviewer 只能提供候选信息;active task、完成状态和外部
90
+ 副作用必须经过 State MCP 的 authorization、expected revision/CAS 和 validator。
91
+
92
+ ## 快速开始
93
+
94
+ 要求 Python 3.11 或更高版本。在目标项目目录执行:
95
+
96
+ ```bash
97
+ python -m pip install .
98
+ continuity init --root . --project-id my-project --display-name "My Project"
99
+ continuity verify --root .
100
+ continuity doctor --root .
101
+ continuity state show --root .
102
+ ```
103
+
104
+ 初始化会创建 `.continuity/`、SQLite 状态库以及项目自己的 `MASTER.md`、`STATUS.md`
105
+ 和英文模板。项目应自行决定 `project_id` 与 `display_name`。
106
+
107
+ ## 安装模式
108
+
109
+ | 模式 | 外部服务 | 适用场景 | 详情 |
110
+ |---|---|---|---|
111
+ | `local-embedded` | 无 | 个人项目、离线开发、本机多 Session | [配置](docs/configuration.md) |
112
+ | `forge-coordinated` | 已有 Git forge | 普通开源团队协作 | [配置](docs/configuration.md#profiles) |
113
+ | 个人 PostgreSQL | 本地或私有 PostgreSQL | SQL 检查、备份、本地 worker | [配置](docs/configuration.md#profiles) |
114
+ | 个人 Docmost | Docmost + connector | 图表、审批、历史观察 | [图形化产品](docs/visual-products.md) |
115
+ | `shared-strong` | 显式 State MCP 服务 | 跨设备唯一 claim、lease 和 CAS | [配置](docs/configuration.md#profiles) |
116
+
117
+ 默认路径是 `local-embedded`。PostgreSQL、Docmost 和 shared-strong 都是可选增强。
118
+
119
+ ## 权威边界
120
+
121
+ - `Typed State`:当前任务、owner、revision、决定、约束和门禁;
122
+ - `Event Log`:append-only 状态变化、supersedes 和 hash chain;
123
+ - `Checkpoint`:压缩、切换、交接和崩溃后的恢复点;
124
+ - `Evidence`:当前源码、标准、官方文档和测试的 provenance;
125
+ - `MASTER.md`:项目级治理意图;`STATUS.md`:当前恢复路由;
126
+ - Docmost:可选的人类控制台,动作受 State MCP 约束;
127
+ - Obsidian:生成的只读视图;
128
+ - SQLite:默认本地 authority;PostgreSQL:显式选择的 adapter。
129
+
130
+ ## 文档
131
+
132
+ - [完整使用教程](USAGE.md)
133
+ - [架构说明](docs/architecture.md)
134
+ - [配置说明](docs/configuration.md)
135
+ - [Python API](docs/api.md)
136
+ - [实测方法](docs/benchmarks.md)
137
+ - [使用场景](docs/use-cases.md)
138
+ - [大型项目视图](docs/project-views.md)
139
+ - [Docmost 与 Obsidian 图形化产品计划](docs/visual-products.md)
140
+ - [English README](README.en.md)
141
+ - [贡献指南](CONTRIBUTING.md)
142
+ - [安全策略](SECURITY.md)
143
+
144
+ ## Release 与许可证
145
+
146
+ 当前 alpha 通过 [GitHub Releases](https://github.com/skyhua0224/continuity-plane/releases)
147
+ 提供 wheel、source archive 和 SHA256SUMS。PyPI Trusted Publishing 尚未配置,因此
148
+ 当前不要使用 `pip install continuity-plane`;详见 [发布说明](CHANGELOG.md)。
149
+
150
+ Continuity Plane 使用 [Apache-2.0](LICENSE)。badge、README 署名、应用 UI 标签和
151
+ telemetry 都是可选的,法律归属以 LICENSE 和 NOTICE 为准。
152
+
153
+ ## 当前状态
154
+
155
+ Linux x86_64 已完成 clean-room 安装和本地 alpha 验证。Windows/macOS 原生矩阵、
156
+ 完整 Docmost connector、Obsidian Canvas/Bases 和 shared-strong 部署仍在后续计划中。
@@ -0,0 +1,126 @@
1
+ # Continuity Plane
2
+
3
+ [![Managed with Continuity Plane](docs/assets/managed-with-continuity-plane.svg)](https://github.com/skyhua0224/continuity-plane)
4
+
5
+ Continuity Plane 是面向长期 AI 辅助软件工作的 provider-neutral 控制面。它把任务、
6
+ 决定、约束、证据、checkpoint、上下文组合和协作状态放在聊天窗口之外,支持压缩、
7
+ 任务切换、进程崩溃和多人交接后的确定性恢复。
8
+
9
+ [English README](README.en.md)
10
+
11
+ ## 你可能遇到的事故
12
+
13
+ | 场景 | 痛点 | 详情 |
14
+ |---|---|---|
15
+ | 压缩与长 Session | 刚刚还在修测试,压缩后却重答旧问题,甚至把做完的工作重新做一遍 | [场景详情](docs/use-cases.md#压缩后像换了一个人) |
16
+ | 多 Session 与部署竞态 | 两边都以为自己可以部署,直到 main、CI 和环境互相覆盖才发现冲突 | [场景详情](docs/use-cases.md#同一仓库的多个-session-会互相踩踏) |
17
+ | 多人和多 Agent | 别人已经在本地做完的东西不可见,协作者只能重复实现、重复查资料 | [场景详情](docs/use-cases.md#多人和多-agent-不知道别人已经做了什么) |
18
+ | Idea 与任务切换 | 一句临时想法让 Agent 离开主线,回来时找不到原任务的落点 | [场景详情](docs/use-cases.md#临时-idea-很容易把主线带跑) |
19
+ | 大型项目 | 几百个模块和跨仓依赖堆在一起,人和 AI 都不知道改动会影响哪里 | [场景详情](docs/use-cases.md#大型项目里人和-ai-都不知道哪里是哪里) |
20
+ | Memory、Skill、文档漂移 | 旧路径、旧决定和旧规则在压缩后重新冒出来 | [场景详情](docs/use-cases.md#memoryskill-和文档会漂移) |
21
+
22
+ ## 已测结果
23
+
24
+ | 场景 | 结果 | 详情 |
25
+ |---|---|---|
26
+ | 压缩恢复 | input tokens `-40.25%`;近上限历史 `-95.06%`;quality `3/3` | [压缩实测](docs/benchmarks.md#压缩与恢复) |
27
+ | 代码检索 | input `-50.02%`;tool calls `-57.89%`;wall time `-27.41%`;quality `3/3` | [检索实测](docs/benchmarks.md#代码检索) |
28
+ | Skill 装载 | source bytes `-96.54%`;quality `3/3` | [Skill 实测](docs/benchmarks.md#skill-装载) |
29
+ | 多 Session 协调 | duplicate tool calls `-55.88%`;parallel wall time `-22.65%` | [协作实测](docs/benchmarks.md#多-session-协作) |
30
+ | 一致性 | E0-E9 `10/10`;双 Session `1000/1000`;authority violation `0` | [一致性实测](docs/benchmarks.md#一致性与限制) |
31
+ | 大型项目视图 | 2,000 nodes / 5,000 edges;scale p95 `187.459764 ms` | [图形视图](docs/project-views.md) |
32
+
33
+ 这些是匹配任务和当前 fixture 的场景级结果,不能合成为所有用户的统一节省率。
34
+ 用户 token、窗口有效利用率和两次压缩之间的有效工作量,按 accepted Work 归一化,
35
+ 并在 host trace 可见时计量。[完整方法和限制](docs/benchmarks.md)。
36
+
37
+ ## 架构概览
38
+
39
+ ```text
40
+ Agent / IDE / CI / 人类控制台
41
+ |
42
+ v
43
+ Execution Packet
44
+ |
45
+ +--------+---------+
46
+ | |
47
+ Typed State Evidence index
48
+ revision + CAS hash + validity
49
+ | |
50
+ +--------+---------+
51
+ |
52
+ append-only events
53
+ |
54
+ checkpoint + replay canary
55
+ |
56
+ SQLite 默认
57
+ ```
58
+
59
+ Memory、检索系统、代码图和 reviewer 只能提供候选信息;active task、完成状态和外部
60
+ 副作用必须经过 State MCP 的 authorization、expected revision/CAS 和 validator。
61
+
62
+ ## 快速开始
63
+
64
+ 要求 Python 3.11 或更高版本。在目标项目目录执行:
65
+
66
+ ```bash
67
+ python -m pip install .
68
+ continuity init --root . --project-id my-project --display-name "My Project"
69
+ continuity verify --root .
70
+ continuity doctor --root .
71
+ continuity state show --root .
72
+ ```
73
+
74
+ 初始化会创建 `.continuity/`、SQLite 状态库以及项目自己的 `MASTER.md`、`STATUS.md`
75
+ 和英文模板。项目应自行决定 `project_id` 与 `display_name`。
76
+
77
+ ## 安装模式
78
+
79
+ | 模式 | 外部服务 | 适用场景 | 详情 |
80
+ |---|---|---|---|
81
+ | `local-embedded` | 无 | 个人项目、离线开发、本机多 Session | [配置](docs/configuration.md) |
82
+ | `forge-coordinated` | 已有 Git forge | 普通开源团队协作 | [配置](docs/configuration.md#profiles) |
83
+ | 个人 PostgreSQL | 本地或私有 PostgreSQL | SQL 检查、备份、本地 worker | [配置](docs/configuration.md#profiles) |
84
+ | 个人 Docmost | Docmost + connector | 图表、审批、历史观察 | [图形化产品](docs/visual-products.md) |
85
+ | `shared-strong` | 显式 State MCP 服务 | 跨设备唯一 claim、lease 和 CAS | [配置](docs/configuration.md#profiles) |
86
+
87
+ 默认路径是 `local-embedded`。PostgreSQL、Docmost 和 shared-strong 都是可选增强。
88
+
89
+ ## 权威边界
90
+
91
+ - `Typed State`:当前任务、owner、revision、决定、约束和门禁;
92
+ - `Event Log`:append-only 状态变化、supersedes 和 hash chain;
93
+ - `Checkpoint`:压缩、切换、交接和崩溃后的恢复点;
94
+ - `Evidence`:当前源码、标准、官方文档和测试的 provenance;
95
+ - `MASTER.md`:项目级治理意图;`STATUS.md`:当前恢复路由;
96
+ - Docmost:可选的人类控制台,动作受 State MCP 约束;
97
+ - Obsidian:生成的只读视图;
98
+ - SQLite:默认本地 authority;PostgreSQL:显式选择的 adapter。
99
+
100
+ ## 文档
101
+
102
+ - [完整使用教程](USAGE.md)
103
+ - [架构说明](docs/architecture.md)
104
+ - [配置说明](docs/configuration.md)
105
+ - [Python API](docs/api.md)
106
+ - [实测方法](docs/benchmarks.md)
107
+ - [使用场景](docs/use-cases.md)
108
+ - [大型项目视图](docs/project-views.md)
109
+ - [Docmost 与 Obsidian 图形化产品计划](docs/visual-products.md)
110
+ - [English README](README.en.md)
111
+ - [贡献指南](CONTRIBUTING.md)
112
+ - [安全策略](SECURITY.md)
113
+
114
+ ## Release 与许可证
115
+
116
+ 当前 alpha 通过 [GitHub Releases](https://github.com/skyhua0224/continuity-plane/releases)
117
+ 提供 wheel、source archive 和 SHA256SUMS。PyPI Trusted Publishing 尚未配置,因此
118
+ 当前不要使用 `pip install continuity-plane`;详见 [发布说明](CHANGELOG.md)。
119
+
120
+ Continuity Plane 使用 [Apache-2.0](LICENSE)。badge、README 署名、应用 UI 标签和
121
+ telemetry 都是可选的,法律归属以 LICENSE 和 NOTICE 为准。
122
+
123
+ ## 当前状态
124
+
125
+ Linux x86_64 已完成 clean-room 安装和本地 alpha 验证。Windows/macOS 原生矩阵、
126
+ 完整 Docmost connector、Obsidian Canvas/Bases 和 shared-strong 部署仍在后续计划中。
@@ -0,0 +1,30 @@
1
+ # 第三方声明
2
+
3
+ [English](THIRD_PARTY_NOTICES.en.md)
4
+
5
+ Continuity Plane 使用或与以下第三方组件互操作。各组件仍遵循自己的许可证。
6
+
7
+ ## 运行时依赖
8
+
9
+ | 组件 | 用途 | 许可证 | 来源 |
10
+ |---|---|---|---|
11
+ | PyYAML | YAML 解析 | MIT | <https://github.com/yaml/pyyaml> |
12
+ | jsonschema | JSON Schema 验证 | MIT | <https://github.com/python-jsonschema/jsonschema> |
13
+ | psycopg | 可选 PostgreSQL adapter | LGPL-3.0-only | <https://github.com/psycopg/psycopg> |
14
+
15
+ 项目不把这些 Python 包源码 vendor 到仓库。安装器根据声明的依赖解析它们,
16
+ PostgreSQL 依赖保持可选。
17
+
18
+ ## SPDX License Identifier Snapshot
19
+
20
+ Skill validator 包含一份 SPDX license identifier 生成快照,来源为
21
+ `spdx/license-list-data` revision
22
+ `c4a7237ec8f4654e867546f9f409749300f1bf4c`。快照只保存 identifier 和
23
+ provenance metadata,不包含完整许可证正文。
24
+
25
+ 来源:<https://github.com/spdx/license-list-data>
26
+
27
+ ## 开发工具
28
+
29
+ 构建、测试、lint、审计和发布工具属于开发依赖,不进入 runtime wheel。它们的
30
+ 许可证由各自发行包提供。
@@ -0,0 +1,21 @@
1
+ """Provider-neutral context control-plane primitives."""
2
+
3
+ from .source_registry import (
4
+ ProvenanceError,
5
+ SourceRegistry,
6
+ build_provenance,
7
+ validate_provenance,
8
+ )
9
+ from .sanitizer import SanitizationError, SanitizationFinding, SanitizationResult, sanitize_text, validate_admission
10
+
11
+ __all__ = [
12
+ "ProvenanceError",
13
+ "SourceRegistry",
14
+ "build_provenance",
15
+ "validate_provenance",
16
+ "SanitizationError",
17
+ "SanitizationFinding",
18
+ "SanitizationResult",
19
+ "sanitize_text",
20
+ "validate_admission",
21
+ ]