mcp-drongo 0.1.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.
- mcp_drongo-0.1.0/.gitignore +12 -0
- mcp_drongo-0.1.0/CHANGELOG.md +11 -0
- mcp_drongo-0.1.0/LICENSE +202 -0
- mcp_drongo-0.1.0/PKG-INFO +153 -0
- mcp_drongo-0.1.0/README.md +128 -0
- mcp_drongo-0.1.0/docs/ACCEPTANCE_TESTS.md +85 -0
- mcp_drongo-0.1.0/docs/ARCHITECTURE.md +110 -0
- mcp_drongo-0.1.0/docs/DEVELOPMENT_PLAN.md +33 -0
- mcp_drongo-0.1.0/docs/PROTOCOL_COMPATIBILITY.md +125 -0
- mcp_drongo-0.1.0/docs/SECURITY_INVARIANTS.md +65 -0
- mcp_drongo-0.1.0/docs/SPEC-v0.1.md +512 -0
- mcp_drongo-0.1.0/docs/THREAT_MODEL.md +73 -0
- mcp_drongo-0.1.0/docs/adr/ADR-001-fail-closed-policy-and-trusted-workspace-binding.md +28 -0
- mcp_drongo-0.1.0/docs/adr/ADR-002-four-layer-integrity-and-probe-trust-gate.md +30 -0
- mcp_drongo-0.1.0/docs/adr/ADR-003-protocol-matrix-id-translation-and-runtime-fsm.md +28 -0
- mcp_drongo-0.1.0/docs/adr/ADR-004-stdio-framing-and-process-group-lifecycle.md +27 -0
- mcp_drongo-0.1.0/docs/adr/ADR-005-atomic-client-sync-ownership-and-compensating-journal.md +28 -0
- mcp_drongo-0.1.0/docs/assets/drongo-logo.svg +6 -0
- mcp_drongo-0.1.0/pyproject.toml +57 -0
- mcp_drongo-0.1.0/src/drongo/__init__.py +3 -0
- mcp_drongo-0.1.0/src/drongo/cli/__init__.py +5 -0
- mcp_drongo-0.1.0/src/drongo/cli/audit.py +94 -0
- mcp_drongo-0.1.0/src/drongo/cli/import_cmd.py +147 -0
- mcp_drongo-0.1.0/src/drongo/cli/lock.py +233 -0
- mcp_drongo-0.1.0/src/drongo/cli/main.py +451 -0
- mcp_drongo-0.1.0/src/drongo/cli/plan.py +442 -0
- mcp_drongo-0.1.0/src/drongo/cli/probe.py +303 -0
- mcp_drongo-0.1.0/src/drongo/cli/servers.py +214 -0
- mcp_drongo-0.1.0/src/drongo/cli/sync_cmd.py +268 -0
- mcp_drongo-0.1.0/src/drongo/cli/tokens.py +75 -0
- mcp_drongo-0.1.0/src/drongo/cli/verify.py +231 -0
- mcp_drongo-0.1.0/src/drongo/cli/wrap.py +318 -0
- mcp_drongo-0.1.0/src/drongo/config/__init__.py +137 -0
- mcp_drongo-0.1.0/src/drongo/config/draft.py +316 -0
- mcp_drongo-0.1.0/src/drongo/config/errors.py +17 -0
- mcp_drongo-0.1.0/src/drongo/config/fs.py +64 -0
- mcp_drongo-0.1.0/src/drongo/config/loader.py +631 -0
- mcp_drongo-0.1.0/src/drongo/config/models.py +126 -0
- mcp_drongo-0.1.0/src/drongo/config/paths.py +119 -0
- mcp_drongo-0.1.0/src/drongo/config/resolver.py +100 -0
- mcp_drongo-0.1.0/src/drongo/config/trust.py +217 -0
- mcp_drongo-0.1.0/src/drongo/integrity/__init__.py +144 -0
- mcp_drongo-0.1.0/src/drongo/integrity/canonical.py +43 -0
- mcp_drongo-0.1.0/src/drongo/integrity/errors.py +55 -0
- mcp_drongo-0.1.0/src/drongo/integrity/gate.py +48 -0
- mcp_drongo-0.1.0/src/drongo/integrity/heuristics.py +270 -0
- mcp_drongo-0.1.0/src/drongo/integrity/l1.py +52 -0
- mcp_drongo-0.1.0/src/drongo/integrity/l2.py +273 -0
- mcp_drongo-0.1.0/src/drongo/integrity/local_exec.py +92 -0
- mcp_drongo-0.1.0/src/drongo/integrity/lockfile.py +341 -0
- mcp_drongo-0.1.0/src/drongo/integrity/tools.py +153 -0
- mcp_drongo-0.1.0/src/drongo/policy/__init__.py +26 -0
- mcp_drongo-0.1.0/src/drongo/policy/engine.py +152 -0
- mcp_drongo-0.1.0/src/drongo/policy/glob.py +92 -0
- mcp_drongo-0.1.0/src/drongo/process/__init__.py +21 -0
- mcp_drongo-0.1.0/src/drongo/process/env.py +36 -0
- mcp_drongo-0.1.0/src/drongo/process/manager.py +156 -0
- mcp_drongo-0.1.0/src/drongo/protocol/__init__.py +99 -0
- mcp_drongo-0.1.0/src/drongo/protocol/errors.py +176 -0
- mcp_drongo-0.1.0/src/drongo/protocol/jsonrpc.py +191 -0
- mcp_drongo-0.1.0/src/drongo/protocol/policy_matrix.py +189 -0
- mcp_drongo-0.1.0/src/drongo/protocol/registry.py +184 -0
- mcp_drongo-0.1.0/src/drongo/protocol/versions.py +44 -0
- mcp_drongo-0.1.0/src/drongo/runtime/__init__.py +38 -0
- mcp_drongo-0.1.0/src/drongo/runtime/launch.py +42 -0
- mcp_drongo-0.1.0/src/drongo/runtime/session.py +794 -0
- mcp_drongo-0.1.0/src/drongo/runtime/state.py +90 -0
- mcp_drongo-0.1.0/src/drongo/runtime/stub.py +76 -0
- mcp_drongo-0.1.0/src/drongo/storage/__init__.py +60 -0
- mcp_drongo-0.1.0/src/drongo/storage/audit.py +75 -0
- mcp_drongo-0.1.0/src/drongo/storage/redact.py +167 -0
- mcp_drongo-0.1.0/src/drongo/storage/state.py +150 -0
- mcp_drongo-0.1.0/src/drongo/sync/__init__.py +65 -0
- mcp_drongo-0.1.0/src/drongo/sync/adapters/__init__.py +29 -0
- mcp_drongo-0.1.0/src/drongo/sync/adapters/base.py +126 -0
- mcp_drongo-0.1.0/src/drongo/sync/adapters/codex_toml.py +170 -0
- mcp_drongo-0.1.0/src/drongo/sync/adapters/json_clients.py +190 -0
- mcp_drongo-0.1.0/src/drongo/sync/atomic.py +67 -0
- mcp_drongo-0.1.0/src/drongo/sync/backup.py +67 -0
- mcp_drongo-0.1.0/src/drongo/sync/digest.py +40 -0
- mcp_drongo-0.1.0/src/drongo/sync/engine.py +935 -0
- mcp_drongo-0.1.0/src/drongo/sync/errors.py +50 -0
- mcp_drongo-0.1.0/src/drongo/sync/journal.py +345 -0
- mcp_drongo-0.1.0/src/drongo/sync/jsonc.py +471 -0
- mcp_drongo-0.1.0/src/drongo/sync/jsonpatch.py +341 -0
- mcp_drongo-0.1.0/src/drongo/sync/lock.py +50 -0
- mcp_drongo-0.1.0/src/drongo/sync/matrix.py +156 -0
- mcp_drongo-0.1.0/src/drongo/sync/state.py +124 -0
- mcp_drongo-0.1.0/src/drongo/transport/__init__.py +19 -0
- mcp_drongo-0.1.0/src/drongo/transport/bridge.py +433 -0
- mcp_drongo-0.1.0/src/drongo/transport/stdio.py +178 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0]
|
|
4
|
+
|
|
5
|
+
- Declarative server and client configuration, workspace trust, profile intersection, and default-deny tool policy.
|
|
6
|
+
- stdio MCP proxy with bidirectional method checks and request-ID translation, isolated upstream environments, process-group cleanup, and structured local auditing.
|
|
7
|
+
- Four-layer integrity lock, explicit probe trust, local executable pins, complete paginated tool snapshots, drift detection, and offline token estimates.
|
|
8
|
+
- Runtime tool filtering and call enforcement, startup verification, serialized re-verification, drift locks, and a zero-tool response for servers outside the effective profile.
|
|
9
|
+
- Format-preserving sync for Codex TOML, Claude Code JSON, and VS Code JSONC, with ownership and concurrent-edit checks, private backups, journaled recovery, and rollback.
|
|
10
|
+
- Client import with secret references and redacted integrity and sync plans. `sync` defaults to all enabled clients and reports launch fields it clears during explicit adoption.
|
|
11
|
+
- Apache-2.0 packaging, Linux and macOS CI on Python 3.12 and 3.13, isolated wheel smoke tests, and Trusted Publishing workflows for TestPyPI and PyPI.
|
mcp_drongo-0.1.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.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: mcp-drongo
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Declarative MCP control plane and runtime security gateway for AI agents.
|
|
5
|
+
Project-URL: Homepage, https://github.com/1an-y/Drongo
|
|
6
|
+
Project-URL: Repository, https://github.com/1an-y/Drongo
|
|
7
|
+
Project-URL: Issues, https://github.com/1an-y/Drongo/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/1an-y/Drongo#documentation
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agents,mcp,model-context-protocol,policy,security
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Operating System :: MacOS
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Security
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Requires-Dist: pyyaml
|
|
22
|
+
Requires-Dist: rfc8785
|
|
23
|
+
Requires-Dist: tomlkit
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<img src="https://raw.githubusercontent.com/1an-y/Drongo/main/docs/assets/drongo-logo.svg" width="112" height="112" alt="Drongo bird with a forked tail">
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
# Drongo
|
|
31
|
+
|
|
32
|
+
*One config. Every MCP.*
|
|
33
|
+
|
|
34
|
+
**Unify · Verify · Protect**
|
|
35
|
+
|
|
36
|
+
Drongo is a declarative Model Context Protocol (MCP) control plane and runtime security gateway. Define your upstream servers once, sync their proxy entries to Codex, Claude Code, and VS Code, and enforce the same tool policy when each client calls them. v0.1 supports stdio servers on Linux and macOS and requires Python 3.12 or later.
|
|
37
|
+
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
Install the console command with [uv](https://docs.astral.sh/uv/).
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
uv tool install mcp-drongo
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For a one-off invocation, uvx needs the package name and the console command.
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
uvx --from mcp-drongo drongo --help
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Create the user configuration.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
drongo init
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
In the generated `drongo.yaml` (normally `~/.config/drongo/drongo.yaml`), add the client you want to import. Adjust the path if you use a different Codex configuration file.
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
clients:
|
|
62
|
+
codex:
|
|
63
|
+
enabled: true
|
|
64
|
+
adapter: codex-toml
|
|
65
|
+
config_path:
|
|
66
|
+
darwin: "${HOME}/.codex/config.toml"
|
|
67
|
+
linux: "${HOME}/.codex/config.toml"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Preview the server definitions, then import the ones in this client by merging its draft. Review the imported commands and export any secret environment variables named on stderr before trusting the server.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
drongo import --client codex
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
drongo import --client codex --write
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The following examples use an imported server named `filesystem`. In `drongo.yaml`, update the default profile with its actual server name and the tools you intend to allow. Retain the defaults generated by `init`.
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
profiles:
|
|
84
|
+
default:
|
|
85
|
+
description: Read-only filesystem tools
|
|
86
|
+
servers: [filesystem]
|
|
87
|
+
allow: ["filesystem.read_*", "filesystem.list_*"]
|
|
88
|
+
deny: []
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A repository can narrow that policy with a `.drongo.yaml` file.
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
schema_version: "0.1"
|
|
95
|
+
profile: default
|
|
96
|
+
extra_deny: ["filesystem.read_sensitive"]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Review the launch configuration before authorizing it. Repeat the trust command for each imported server that you intend to probe. A plan with proposed changes returns status 2.
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
drongo trust server filesystem
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
drongo plan --verbose
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
drongo lock
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Preview the client changes. For an existing entry named `filesystem`, the plan can report an unmanaged-entry conflict until you opt into adoption. Confirm that the imported upstream command, environment references, and settings are in `drongo.yaml` before applying.
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
drongo sync --client codex --dry-run --adopt
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
drongo sync --client codex --adopt
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Without a client selector, `drongo sync` targets every enabled client. When `--adopt` clears an entry's old launch environment or connection fields, it reports the removed field names on stderr. Drongo keeps private backups of changed client files.
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
drongo verify
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
drongo tokens
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Architecture and boundaries
|
|
134
|
+
|
|
135
|
+
- **Unify.** The control plane manages user configuration, workspace trust, lockfiles, and client sync. Client entries launch `drongo wrap <server>`. Each workspace policy is bounded by the user's configured permissions.
|
|
136
|
+
- **Verify.** The integrity engine records launch configuration, reports the level of execution provenance it can establish, and fingerprints the complete tool and capability snapshots.
|
|
137
|
+
- **Protect.** Each stdio session has its own runtime proxy. The proxy checks protocol methods in both directions, validates tools before making them available, and applies default-deny policy to calls. Upstream drift can block the session.
|
|
138
|
+
|
|
139
|
+
### Explicit Non-Guarantees
|
|
140
|
+
|
|
141
|
+
- v0.1 does **not** provide an OS process sandbox. An upstream server runs as your user and can access files and the network with your account's permissions.
|
|
142
|
+
- `version_pinned` covers the declared package version. It does **not** pin transitive dependencies or certify the package's code.
|
|
143
|
+
- Online probes by `plan`, `lock`, and `verify` execute upstream code. Drongo requires trust for probing. Review the command before authorizing it with `drongo trust server`.
|
|
144
|
+
- Client sync uses atomic replacement per file and a recovery journal across files. Other applications can still edit those files independently.
|
|
145
|
+
|
|
146
|
+
## Documentation
|
|
147
|
+
|
|
148
|
+
- [Technical specification](docs/SPEC-v0.1.md)
|
|
149
|
+
- [Architecture](docs/ARCHITECTURE.md) and [threat model](docs/THREAT_MODEL.md)
|
|
150
|
+
- [Acceptance tests](docs/ACCEPTANCE_TESTS.md)
|
|
151
|
+
- [Changelog](CHANGELOG.md)
|
|
152
|
+
|
|
153
|
+
Released under the [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/1an-y/Drongo/main/docs/assets/drongo-logo.svg" width="112" height="112" alt="Drongo bird with a forked tail">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Drongo
|
|
6
|
+
|
|
7
|
+
*One config. Every MCP.*
|
|
8
|
+
|
|
9
|
+
**Unify · Verify · Protect**
|
|
10
|
+
|
|
11
|
+
Drongo is a declarative Model Context Protocol (MCP) control plane and runtime security gateway. Define your upstream servers once, sync their proxy entries to Codex, Claude Code, and VS Code, and enforce the same tool policy when each client calls them. v0.1 supports stdio servers on Linux and macOS and requires Python 3.12 or later.
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
Install the console command with [uv](https://docs.astral.sh/uv/).
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
uv tool install mcp-drongo
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For a one-off invocation, uvx needs the package name and the console command.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
uvx --from mcp-drongo drongo --help
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Create the user configuration.
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
drongo init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In the generated `drongo.yaml` (normally `~/.config/drongo/drongo.yaml`), add the client you want to import. Adjust the path if you use a different Codex configuration file.
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
clients:
|
|
37
|
+
codex:
|
|
38
|
+
enabled: true
|
|
39
|
+
adapter: codex-toml
|
|
40
|
+
config_path:
|
|
41
|
+
darwin: "${HOME}/.codex/config.toml"
|
|
42
|
+
linux: "${HOME}/.codex/config.toml"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Preview the server definitions, then import the ones in this client by merging its draft. Review the imported commands and export any secret environment variables named on stderr before trusting the server.
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
drongo import --client codex
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
drongo import --client codex --write
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The following examples use an imported server named `filesystem`. In `drongo.yaml`, update the default profile with its actual server name and the tools you intend to allow. Retain the defaults generated by `init`.
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
profiles:
|
|
59
|
+
default:
|
|
60
|
+
description: Read-only filesystem tools
|
|
61
|
+
servers: [filesystem]
|
|
62
|
+
allow: ["filesystem.read_*", "filesystem.list_*"]
|
|
63
|
+
deny: []
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
A repository can narrow that policy with a `.drongo.yaml` file.
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
schema_version: "0.1"
|
|
70
|
+
profile: default
|
|
71
|
+
extra_deny: ["filesystem.read_sensitive"]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Review the launch configuration before authorizing it. Repeat the trust command for each imported server that you intend to probe. A plan with proposed changes returns status 2.
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
drongo trust server filesystem
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
drongo plan --verbose
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
drongo lock
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Preview the client changes. For an existing entry named `filesystem`, the plan can report an unmanaged-entry conflict until you opt into adoption. Confirm that the imported upstream command, environment references, and settings are in `drongo.yaml` before applying.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
drongo sync --client codex --dry-run --adopt
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
drongo sync --client codex --adopt
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Without a client selector, `drongo sync` targets every enabled client. When `--adopt` clears an entry's old launch environment or connection fields, it reports the removed field names on stderr. Drongo keeps private backups of changed client files.
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
drongo verify
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
drongo tokens
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Architecture and boundaries
|
|
109
|
+
|
|
110
|
+
- **Unify.** The control plane manages user configuration, workspace trust, lockfiles, and client sync. Client entries launch `drongo wrap <server>`. Each workspace policy is bounded by the user's configured permissions.
|
|
111
|
+
- **Verify.** The integrity engine records launch configuration, reports the level of execution provenance it can establish, and fingerprints the complete tool and capability snapshots.
|
|
112
|
+
- **Protect.** Each stdio session has its own runtime proxy. The proxy checks protocol methods in both directions, validates tools before making them available, and applies default-deny policy to calls. Upstream drift can block the session.
|
|
113
|
+
|
|
114
|
+
### Explicit Non-Guarantees
|
|
115
|
+
|
|
116
|
+
- v0.1 does **not** provide an OS process sandbox. An upstream server runs as your user and can access files and the network with your account's permissions.
|
|
117
|
+
- `version_pinned` covers the declared package version. It does **not** pin transitive dependencies or certify the package's code.
|
|
118
|
+
- Online probes by `plan`, `lock`, and `verify` execute upstream code. Drongo requires trust for probing. Review the command before authorizing it with `drongo trust server`.
|
|
119
|
+
- Client sync uses atomic replacement per file and a recovery journal across files. Other applications can still edit those files independently.
|
|
120
|
+
|
|
121
|
+
## Documentation
|
|
122
|
+
|
|
123
|
+
- [Technical specification](docs/SPEC-v0.1.md)
|
|
124
|
+
- [Architecture](docs/ARCHITECTURE.md) and [threat model](docs/THREAT_MODEL.md)
|
|
125
|
+
- [Acceptance tests](docs/ACCEPTANCE_TESTS.md)
|
|
126
|
+
- [Changelog](CHANGELOG.md)
|
|
127
|
+
|
|
128
|
+
Released under the [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Drongo 确定性验收标准(Acceptance Tests — M00 Freeze)
|
|
2
|
+
|
|
3
|
+
> 唯一事实来源:[`SPEC-v0.1.md`](SPEC-v0.1.md)(v0.1.1 冻结基线 §9)。所有验收项编号与 [`THREAT_MODEL.md`](THREAT_MODEL.md)、[`SECURITY_INVARIANTS.md`](SECURITY_INVARIANTS.md) 保持严格一一对应。
|
|
4
|
+
|
|
5
|
+
## 1. 确定性测试替身规范(`tests/mock_mcp.py`)
|
|
6
|
+
|
|
7
|
+
`M02` 起需提供纯确定性测试替身 `tests/mock_mcp.py`(仅使用标准库运行于独立子进程),至少支持以下可组合故障与协议模式:
|
|
8
|
+
|
|
9
|
+
| 模式 | 行为说明 | 主要服务验收项 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| **乱序与并发响应** | 乱序返回并发 JSON-RPC 请求响应,回显收到的 ID 与方法 | `GT-23` |
|
|
12
|
+
| **多页分页(`nextCursor`)** | 将工具清单拆分为多页(如 3 页或超 100 页无限循环)并可篡改指定页内容 | `GT-24`, 分页熔断 |
|
|
13
|
+
| **Schema 变序与投毒** | 打乱 `inputSchema` 键序、向描述注入 `U+200B`/`U+202E`/Tag 字符或添加未知顶层扩展键 | `GT-01`, `GT-02` |
|
|
14
|
+
| **动态 `list_changed` 与突发通知** | 在运行中途发送 1 次或连续突发 3 次 `notifications/tools/list_changed` 并可切换返回新/旧工具集 | `GT-03`, `GT-21`, `GT-22` |
|
|
15
|
+
| **延迟初始化与卡死阻塞** | 延迟完成 `tools/list` 以构造 `VERIFYING_INITIAL` 窗口;或卡死且屏蔽/忽略 `SIGTERM` | `GT-08`, `GT-20` |
|
|
16
|
+
| **环境变量探针回显** | 在工具返回或状态响应中回显当前子进程 `os.environ` 键集合(不回显真实外部机密,仅用测试假值) | `GT-07` |
|
|
17
|
+
| **服务端反向请求注入** | 主动向客户端方向发送 `sampling/createMessage`、`elicitation/create`、`roots/list` | `GT-26` |
|
|
18
|
+
| **协议版本切换** | 按配置返回白名单内版本或白名单外版本(如 `2026-07-28`) | `GT-30` |
|
|
19
|
+
| **大帧与超限帧发送** | 发送合法大帧(`> 64 KB` 且 `<= 16 MB`)以及超限帧(`> 16 MB`) | `M02` 帧上限校验 |
|
|
20
|
+
|
|
21
|
+
## 2. 30 项 Golden Tests 详细验收契约(`GT-01` ~ `GT-30`)
|
|
22
|
+
|
|
23
|
+
### 2.1 `M01`:配置、工作区绑定与策略引擎(`GT-05`, `GT-16`, `GT-17`)
|
|
24
|
+
|
|
25
|
+
| 编号 | 验收项 | 关联不变量 / 威胁 | 前置条件与步骤 | 核心断言 |
|
|
26
|
+
| --- | --- | --- | --- | --- |
|
|
27
|
+
| **GT-05** | `.drongo.yaml` 禁止 `allow` | `INV-03`, `INV-04` / `T-03` | 1) 在工作区写入 `.drongo.yaml` 含 `allow: ["*"]` 并加载配置;2) 改为合法 `profile` + `extra_deny` 并求有效策略 | 含 `allow` 时配置解析失败且退出码为 `3`;合法 `extra_deny` 与用户上限交集叠加生效,拒绝命中的工具 |
|
|
28
|
+
| **GT-16** | Deny 优先与默认拒绝 | `INV-01` / `T-02` | 使用含 `deny` 与 `allow` 规则的 Profile(如 `coding`)及 `default` Profile(`deny: []`)评估已允许、显式拒绝与未提及工具 | 显式 `deny` 覆盖 `allow` 返回 `DENY`;`default` Profile 中未命中 `allow` 的工具直接返回内置默认 `DENY` |
|
|
29
|
+
| **GT-17** | 恶意工作区切换 Profile 提权 | `INV-03` / `T-03` | 当前仓库未登记在 `trusted-workspaces.json`,其 `.drongo.yaml` 声明 `profile: admin`(拥有比 `defaults.profile` 更宽权限) | 生效权限 $S_{\text{eff}}$ 与 $P_{\text{eff}}$ 严格不超过 `defaults.profile` 的任一工具或 Server |
|
|
30
|
+
|
|
31
|
+
### 2.2 `M02`:协议兼容、传输帧与进程管理(`GT-07`, `GT-08`, `GT-23`, `GT-25`, `GT-26`, `GT-30`)
|
|
32
|
+
|
|
33
|
+
| 编号 | 验收项 | 关联不变量 / 威胁 | 前置条件与步骤 | 核心断言 |
|
|
34
|
+
| --- | --- | --- | --- | --- |
|
|
35
|
+
| **GT-07** | 环境变量隔离 | `INV-13` / `T-09` | 宿主机进程设置敏感变量 `AWS_SECRET_ACCESS_KEY` 等,目标 Server `env_allowlist` 仅含 `["PATH", "LANG"]` | 上游子进程 `environ` 不包含未在 `env_allowlist` 中的任何宿主机敏感变量 |
|
|
36
|
+
| **GT-08** | 卡死探针回收 | `INV-13`, `INV-12` / `T-09` | 启动忽略 `SIGTERM` 且可能派生子孙进程的 `mock_mcp.py` 阻塞探针 | 在 `probe_timeout_ms + 1500ms` 内返回退出码 `4`,且进程组内零孤儿进程残留 |
|
|
37
|
+
| **GT-23** | Request ID 冲突隔离 | `INV-10`, `INV-12` / `T-07` | 客户端并发发送整数 ID(与内部探针序号重叠)以及字符串 ID `"__drongo_1"`,同时触发内部探针请求 | 经 `RequestRegistry` 全量双向转译后,客户端收到精确对应的自身响应,零串包、内部探针响应零泄漏 |
|
|
38
|
+
| **GT-25** | 未授权 `resources/read` 拦截 | `INV-09` / `T-08` | 客户端通过代理发送 `resources/read` 与 `prompts/get` 请求 | 代理本地直接返回 JSON-RPC Error `-32008`(`METHOD_NOT_ALLOWED`),且上游收到对应方法计数严格为 `0` |
|
|
39
|
+
| **GT-26** | 服务端反向请求拦截 | `INV-09` / `T-08` | 上游 `mock_mcp.py` 主动发出 `sampling/createMessage`、`elicitation/create` 与 `roots/list` | 代理直接向 `mock_mcp.py` 回复 JSON-RPC Error `-32008`,客户端零收到反向请求 |
|
|
40
|
+
| **GT-30** | 不兼容协议版本处理 | `INV-08` / `T-08` | 上游在 `initialize` 响应中返回白名单外协议版本(如 `"2026-07-28"`) | 代理拒绝进入 `READY` 状态,返回 `-32009`(`UNSUPPORTED_PROTOCOL_VERSION`) |
|
|
41
|
+
|
|
42
|
+
### 2.3 `M03`:四层完整性引擎与 Token 估算(`GT-01`, `GT-06`, `GT-18`, `GT-19`, `GT-24`)
|
|
43
|
+
|
|
44
|
+
| 编号 | 验收项 | 关联不变量 / 威胁 | 前置条件与步骤 | 核心断言 |
|
|
45
|
+
| --- | --- | --- | --- | --- |
|
|
46
|
+
| **GT-01** | JCS 跨序一致性 | `INV-07` / `T-01` | 先以正常键序锁定,再让上游返回随机打乱 `inputSchema` 键序及空白符的等价工具 JSON | 计算得到的 L3 哈希与 `drongo.lock` 完全一致,`verify` 返回 `0` |
|
|
47
|
+
| **GT-06** | 跨平台 L1 无漂移 | `INV-05`, `INV-04` / `T-04` | 在两组仅 `${HOME}` 与 `${WORKSPACE}` 环境变量值不同的配置下计算 `l1_launch_hash` | 两者计算得到的 `l1_launch_hash` 字节级一致 |
|
|
48
|
+
| **GT-18** | 普通 `env` 值修改触发 L1 漂移 | `INV-05` / `T-04` | 先锁定含 `env.MCP_FS_READONLY: "true"` 的配置,随后将配置改为 `"false"` 后执行 `verify` | 立即检出 L1 漂移,`verify` 返回退出码 `2` |
|
|
49
|
+
| **GT-19** | Secret Reference 修改触发漂移 | `INV-05` / `T-04` | 先锁定 `secrets.GITHUB_PERSONAL_ACCESS_TOKEN: "env:GITHUB_PAT"`,随后改为 `"env:OTHER_TOKEN"` | 立即检出 L1 漂移(同时锁文件与哈希中绝不出现明文密钥值),`verify` 返回 `2` |
|
|
50
|
+
| **GT-24** | 分页工具清单完整性 | `INV-07` / `T-01` | 上游分 3 页返回 `tools/list`(含 `nextCursor`)锁定后,在运行时或再次探测时篡改第 3 页某工具描述 | 探针与代理均完整遍历全部 3 页并精准检出第 3 页工具 L3 漂移(`verify` 返回 `2` / 运行时 `-32002`) |
|
|
51
|
+
|
|
52
|
+
### 2.4 `M04`:运行时安全网关与审计(`GT-02`, `GT-03`, `GT-04`, `GT-20`, `GT-21`, `GT-22`)
|
|
53
|
+
|
|
54
|
+
| 编号 | 验收项 | 关联不变量 / 威胁 | 前置条件与步骤 | 核心断言 |
|
|
55
|
+
| --- | --- | --- | --- | --- |
|
|
56
|
+
| **GT-02** | 静默投毒拦截 | `INV-07` / `T-01` | 上游在某已锁定工具的 `description` 末尾追加不可见字符 `U+200B` | `wrap` 校验检出 L3 漂移,阻断调用并返回 `-32002`(`LOCK_DRIFT`),审计日志记录拦截 |
|
|
57
|
+
| **GT-03** | 动态 Rug Pull 拦截 | `INV-11`, `INV-07` / `T-01` | 会话进入 `READY` 后,上游发送 `notifications/tools/list_changed` 并在重检中返回篡改后的工具定义 | 代理重检检出漂移,不可逆迁入 `DRIFT_LOCKED`,后续所有 `tools/call` 均返回 `-32002` |
|
|
58
|
+
| **GT-04** | 隐藏工具直调防护 | `INV-02` / `T-02` | 客户端跳过 `tools/list`,直接发起 `tools/call` 调用未在 $P_{\text{eff}}$ 放行(或不在已锁定清单)的工具 | 代理按**先检策略再查 L3 清单**顺序本地拦截:策略拒访返 `-32003`(不泄露工具是否存在),策略放行但不在 L3 锁清单返 `-32004`,且上游该工具调用计数为 `0` |
|
|
59
|
+
| **GT-20** | 首次验证完成前禁调 | `INV-11` / `T-06` | `mock_mcp.py` 延迟响应首次 `tools/list`,使代理停留在 `VERIFYING_INITIAL` 时客户端发来 `tools/call` | 代理立即拒绝并返回 `-32007`(`SERVER_NOT_READY`),上游未收到该调用 |
|
|
60
|
+
| **GT-21** | 重检期间禁调 | `INV-11` / `T-06` | 在 `READY` 状态下触发 `list_changed` 且内部重检尚未完成(处于 `REVERIFYING`)时,客户端并发发送 `tools/call` | 代理立即拒绝并返回 `-32007`(`SERVER_NOT_READY`),消除重检并发窗口 |
|
|
61
|
+
| **GT-22** | 连续 `list_changed` 并发串行化 | `INV-11` / `T-06` | 代理处于 `REVERIFYING` 期间连续注入 3 次 `notifications/tools/list_changed` | 不并发派生探针,通过 `reverify_dirty` 标记串行执行再检并最终收敛至 `READY`(或漂移锁定),无竞态、无 ID/任务泄漏 |
|
|
62
|
+
|
|
63
|
+
### 2.5 `M05`:多客户端同步、事务恢复与隐私保护(`GT-09` ~ `GT-15`, `GT-27`, `GT-28`, `GT-29`)
|
|
64
|
+
|
|
65
|
+
| 编号 | 验收项 | 关联不变量 / 威胁 | 前置条件与步骤 | 核心断言 |
|
|
66
|
+
| --- | --- | --- | --- | --- |
|
|
67
|
+
| **GT-09** | Claude Code 非 MCP 无损 | `INV-14` / `T-10` | `.claude.json` 含账号元数据、`projects` 多项目子树与未托管 `mcpServers` 条目;执行托管项 `ADD / UPDATE / REMOVE` | 账号信息、`projects` 子树及非托管 Server 保持字节语义无损;仅写入 `drongo wrap <server>` |
|
|
68
|
+
| **GT-10** | Claude Code 并发覆写拦截 | `INV-15` / `T-10` | 在同步读取 `.claude.json` 计算 CAS SHA-256 与执行写入之间注入外部文件改写 | CAS 校验命中失败,报 `ERR_CONCURRENT_MODIFICATION` 且拒绝覆写外部变更 |
|
|
69
|
+
| **GT-11** | Codex TOML 注释保真 | `INV-14` / `T-10` | `config.toml` 含行首/行内注释、`[model_providers.*]` 与自定义表内调优键;经 `ADD / UPDATE / REMOVE` | `tomlkit` CST 修补后全部注释、`[model_providers.*]` 与非托管自定义键零丢失 |
|
|
70
|
+
| **GT-12** | VS Code JSONC 注释保真 | `INV-14` / `T-10` | `mcp.json` 含 `//`、`/* */`、尾随逗号与 `"inputs"` 数组;分别在首位、中间、末尾位置执行增删改 | 修补后所有 `//`、`/* */` 注释、尾随逗号与 `"inputs"` 完整保留,且结构合法 |
|
|
71
|
+
| **GT-13** | 外部篡改冲突保护 | `INV-15` / `T-10` | 同步托管某条目后,外部手动修改该托管条目参数 | `drongo plan` 返回退出码 `5`(冲突);未传 `--force` 时 `drongo sync` 拒写且返回退出码 `5` |
|
|
72
|
+
| **GT-14** | 批次同步失败自动回滚 | `INV-16` / `T-10` | 执行 `drongo sync --all`,模拟 `claude_code` 写入成功而 `codex` 写入失败 | 自动从 `0600` 备份还原 `.claude.json` 至原 `before_sha256`,Journal 终态进入 `ROLLED_BACK` |
|
|
73
|
+
| **GT-15** | `plan` 脱敏输出 | `INV-17` / `T-11` | 目标客户端含带明文密钥/Header 的未托管条目 | `drongo plan --verbose` 与 `drongo plan --json` 均对密钥值掩码为 `"[REDACTED]"`,严禁输出原文 |
|
|
74
|
+
| **GT-27** | Sync 崩溃与重启恢复 | `INV-16` / `T-10` | 多端同步写入首端后模拟 `SIGKILL` 强杀进程,Journal 停留在 `APPLYING` | 重启后新发起 `drongo sync` 返回退出码 `5` 拒启;执行 `drongo sync --recover` 成功还原首端至原 SHA-256 并闭环 Journal 为 `ROLLED_BACK` |
|
|
75
|
+
| **GT-28** | 回滚期间外部修改冲突 | `INV-16` / `T-10` | 崩溃停留在 `APPLYING` 后,用户外部手动编辑已写入的目标文件;随后执行 `drongo sync --recover` | 发现当前文件 SHA-256 既非 `before_sha256` 亦非 `after_sha256`,拒绝盲目覆盖并迁入 `RECOVERY_REQUIRED`,列出差异与备份路径 |
|
|
76
|
+
| **GT-29** | 备份权限与异常脱敏 | `INV-17` / `T-11` | 执行状态写入、同步备份、审计记录及触发未捕获异常路径 | `DRONGO_STATE_DIR` 与 `backups/` 权限严格为 `0700`,备份/状态/审计文件严格为 `0600`,未捕获异常堆栈与日志无明文密钥 |
|
|
77
|
+
|
|
78
|
+
## 3. 补充规格验收门禁(非 GT 编号硬约束)
|
|
79
|
+
|
|
80
|
+
除 `GT-01` ~ `GT-30` 外,以下来自 [`SPEC-v0.1.md`](SPEC-v0.1.md) 的专项要求在对应里程碑同样作为必测项:
|
|
81
|
+
|
|
82
|
+
1. **M00–M06 静态边界**:`scripts/check_dependencies.py` 必须返回退出码 `0`。
|
|
83
|
+
2. **M02 传输帧极限**:单帧 `> 64 KB` 且 `<= 16 MB` 完整无截断转发;通用单帧 `> 16 MB` 与 `notifications/progress` / `notifications/message` `> 1 MB` 明确拒收;代理 `stdout` 零非 JSON-RPC 字节污染。
|
|
84
|
+
3. **M03 探针信任门禁与 L2 四级输出**:未信任且未锁定的 Server 运行 `plan / lock / verify`(未传 `--trust-new`)必须中止并返回退出码 `6` 且警示“探测将执行该命令”;缺失 `drongo.lock` 时 `verify` 与 `tokens` 均返回退出码 `1`;新机器 `local-exec-pins.json` 为空时不做静默 TOFU;`max_pages = 100` 触发熔断;`drongo.lock`(确定性 JSON)与 CLI 如实输出四级 `guarantee`;`drongo tokens` 按 `math.ceil(len(jcs_bytes) / 4)` 输出 `Estimated Tool Definition Tokens` 与口径说明;未知工具扩展键产生 `static_warnings` 与 Heuristic Warning 标识。M03 边界裁决(`SPEC-v0.1.md` §4.4)的追加必测项:`probe_timeout_ms` 为单 Server 探测总预算,每一页都低于单请求预算的慢速多页累计超预算即熔断返回 `4`;本机无执行体指纹时 `verify` 输出 `UNVERIFIED` 并返回 `2` 且不写入任何记录;`--trust-new` 不覆盖不匹配的指纹;无凭据的 L2 声明(含 `environment_pinned`)`lock` 返回 `3`;`drongo.lock` 含 `tool_def_jcs_bytes` 且非 ASCII 全部转义。
|
|
85
|
+
4. **M04 零工具存根模式与 `drongo hub` 占位**:已定义但不在 $S_{\text{eff}}$ 的 Server 启用零工具存根模式(零子进程启动、`tools/list` 返回 `[]`、`tools/call` 返 `-32003`);`drongo hub` 返回明确未实现提示与 `v0.3` `drongod` 规划说明,退出码 `0`。M04 边界裁决(`SPEC-v0.1.md` §5.6)的追加必测项:校验超时按「锁定会话 → 回收上游进程组 → 应答等待方」的顺序执行;失败处理代码自身异常时等待方仍得到 `-32002`;`wrap` 收到 `SIGTERM` / `SIGINT` 时回收不随 `stdin` 关闭而退出的上游进程组;审计不记录工具调用参数,`--denied-only` 筛选 `outcome == DENIED`。
|