mcp-workflow-core 0.3.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_workflow_core-0.3.0/LICENSE +202 -0
- mcp_workflow_core-0.3.0/MANIFEST.in +8 -0
- mcp_workflow_core-0.3.0/PKG-INFO +187 -0
- mcp_workflow_core-0.3.0/README.md +174 -0
- mcp_workflow_core-0.3.0/mcp_workflow_core.egg-info/PKG-INFO +187 -0
- mcp_workflow_core-0.3.0/mcp_workflow_core.egg-info/SOURCES.txt +26 -0
- mcp_workflow_core-0.3.0/mcp_workflow_core.egg-info/dependency_links.txt +1 -0
- mcp_workflow_core-0.3.0/mcp_workflow_core.egg-info/requires.txt +4 -0
- mcp_workflow_core-0.3.0/mcp_workflow_core.egg-info/top_level.txt +1 -0
- mcp_workflow_core-0.3.0/pyproject.toml +30 -0
- mcp_workflow_core-0.3.0/setup.cfg +4 -0
- mcp_workflow_core-0.3.0/workflow_core/__init__.py +53 -0
- mcp_workflow_core-0.3.0/workflow_core/_version.py +58 -0
- mcp_workflow_core-0.3.0/workflow_core/adapters/__init__.py +12 -0
- mcp_workflow_core-0.3.0/workflow_core/adapters/_base.py +136 -0
- mcp_workflow_core-0.3.0/workflow_core/adapters/gofastmcp.py +36 -0
- mcp_workflow_core-0.3.0/workflow_core/adapters/official_sdk.py +36 -0
- mcp_workflow_core-0.3.0/workflow_core/config.py +115 -0
- mcp_workflow_core-0.3.0/workflow_core/dispatch.py +124 -0
- mcp_workflow_core-0.3.0/workflow_core/documents.py +309 -0
- mcp_workflow_core-0.3.0/workflow_core/errors.py +30 -0
- mcp_workflow_core-0.3.0/workflow_core/fold.py +36 -0
- mcp_workflow_core-0.3.0/workflow_core/frontmatter.py +119 -0
- mcp_workflow_core-0.3.0/workflow_core/library.py +71 -0
- mcp_workflow_core-0.3.0/workflow_core/resources.py +121 -0
- mcp_workflow_core-0.3.0/workflow_core/search.py +109 -0
- mcp_workflow_core-0.3.0/workflow_core/store.py +219 -0
- mcp_workflow_core-0.3.0/workflow_core/validate.py +564 -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,8 @@
|
|
|
1
|
+
# Yayım dosyalarına (sdist) girmeyecekler — 006, FR-005. Wheel zaten yalnız paketi taşır.
|
|
2
|
+
# setuptools varsayılan olarak tests/test*.py dosyalarını sdist'e alıyor; burada kesiliyor.
|
|
3
|
+
prune tests
|
|
4
|
+
prune .sdd
|
|
5
|
+
prune _olcumler
|
|
6
|
+
prune _logs
|
|
7
|
+
exclude .test-komutu
|
|
8
|
+
exclude .gitignore
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-workflow-core
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: MCP sunucularının iş akışı belgeleri için tek motor: listeleme, arama, doğrulama, yazma, kaynak tanımları.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest<10,>=9; extra == "dev"
|
|
11
|
+
Requires-Dist: ruff<0.16,>=0.15; extra == "dev"
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# workflow-core
|
|
15
|
+
|
|
16
|
+
MCP sunucularının iş akışı belgelerini okuyan, arayan, doğrulayan ve MCP kaynağı olarak
|
|
17
|
+
yayımlayan Python kütüphanesi. Sunucu değildir: port dinlemez, araç yayımlamaz. Sunucular
|
|
18
|
+
onu içe aktarır ve üç ayarla yapılandırır.
|
|
19
|
+
|
|
20
|
+
**Durum (2026-09-01):** dört tüketici sunucu motora bağlı ve kopyasız; yol haritasının
|
|
21
|
+
beş fazından dördü geçti. Motor 0.3.0 (230 test, ruff temiz); dağıtım adı
|
|
22
|
+
`mcp-workflow-core`, lisans Apache 2.0, PyPI yayımı onay sahibinin elinde.
|
|
23
|
+
|
|
24
|
+
**Hangi sürümdeyim:** paket sürümü **0.3.0**. Kaynak `pyproject.toml` (`[project]
|
|
25
|
+
version`); `tests/test_surum.py` bu satırı ona bağlar, çalışma anında
|
|
26
|
+
`workflow_core.__version__` aynı numarayı verir. Kuralların sürümü ayrıdır:
|
|
27
|
+
[anayasa](.sdd/CONSTITUTION.md) 1.4.0.
|
|
28
|
+
|
|
29
|
+
## Ne yapar
|
|
30
|
+
|
|
31
|
+
Bir sunucunun belge klasöründeki Markdown iş akışı belgelerini yönetir. Her
|
|
32
|
+
belge bir üst bilgi bloğu (frontmatter) ve zorunlu bölümler taşır; motor bunları:
|
|
33
|
+
|
|
34
|
+
- listeler ve okur,
|
|
35
|
+
- arar (Türkçe harfleri katlayarak: büyük `İ`, aksanlı ve aksansız yazım aynı sonucu
|
|
36
|
+
verir),
|
|
37
|
+
- doğrular (zorunlu alanlar, zorunlu bölümler, gövdede anılan araç adlarının çalışma
|
|
38
|
+
anındaki kayıtta var olup olmadığı, bayatlık),
|
|
39
|
+
- yazar, günceller ve siler (kuru çalıştırma ve arşivle),
|
|
40
|
+
- MCP kaynağı olarak yayımlar.
|
|
41
|
+
|
|
42
|
+
Motor belgeleri çalıştırmaz, okutur. Belge "makinenin yürüteceği kod" değil, "akıllı bir
|
|
43
|
+
asistanın okuyacağı yönerge"dir; koşul, döngü ve karar asistanın işidir.
|
|
44
|
+
|
|
45
|
+
Kullanım, tüketici sunucuda:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from workflow_core import Config, Library
|
|
49
|
+
|
|
50
|
+
library = Library(Config.from_file("workflow.yaml")) # docs_dir, tool_prefix, categories
|
|
51
|
+
library.search("devreye alma") # Türkçe katlamalı arama
|
|
52
|
+
library.validate(registered_tools=canli_arac_listesi, today="2026-08-22")
|
|
53
|
+
library.write("42-yeni-belge", icerik, dry_run=True) # plan döner, disk değişmez
|
|
54
|
+
library.dispatch("get", {"id": "42-yeni-belge"}) # tek giriş: action + params
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
MCP kaynağı olarak yayın çerçeveye göre tek satır: `workflow_core.adapters.gofastmcp`
|
|
58
|
+
ya da `workflow_core.adapters.official_sdk` içinden `register(server, library)`. Onay
|
|
59
|
+
kapısı motorda değil tüketici aracındadır; motor `dry_run` planını ve yıkıcı eylem
|
|
60
|
+
işaretini (`ACTIONS`) verir.
|
|
61
|
+
|
|
62
|
+
## Neden var
|
|
63
|
+
|
|
64
|
+
Aynı motor daha önce üç sunucuya kopyalanmıştı: toplam 1720 satır, paylaşılan satır
|
|
65
|
+
sıfır. Düzeltmeler iki yönde de akmadı; bir kopyada yapılan iyileştirme ötekilere
|
|
66
|
+
gitmedi, orijinaldeki düzeltme kopyalara gitmedi. Faz 0 ölçümü hiçbir kopyanın "en
|
|
67
|
+
zengin" olmadığını gösterdi: doğru davranışlar üçüne dağılmıştı ve arama üçünde de
|
|
68
|
+
Türkçe-güvenli değildi. Birleştirme tek kopyayı seçerek yapılamaz; bu yüzden motor tek
|
|
69
|
+
yerde yazılıyor ve sunucular onu kütüphane olarak alıyor.
|
|
70
|
+
|
|
71
|
+
## Tasarım ilkeleri
|
|
72
|
+
|
|
73
|
+
- **Motor tek, yapılandırma çok.** Sunucuya özel üç şey var: belge klasörünün yolu,
|
|
74
|
+
araç-adı öneki, geçerli kategori listesi. Dördüncüsü gerektiğinde önce "bu gerçekten
|
|
75
|
+
sunucuya mı özel" diye sorulur. Tanınmayan yapılandırma alanı reddedilir.
|
|
76
|
+
- **Alan-özel `if` yok.** Sunucuya özel davranış yapılandırma alanıyla çözülür; alan
|
|
77
|
+
eklemek diff'te görünür, `if` görünmez.
|
|
78
|
+
- **Hiçbir MCP çerçevesine bağlanmaz.** Tüketiciler iki farklı çerçevede çalışıyor; motor
|
|
79
|
+
ikisini de içe aktarmaz, kaynak kaydı çerçeveden bağımsız bir arayüzle sunulur.
|
|
80
|
+
- **Sessiz düşüş yok.** Yedek yola düşüş, kırpma ve yok sayma en az bir uyarı loglar.
|
|
81
|
+
- **Yazma güvenlik zinciriyle.** Kuru çalıştırma motorda, onay tüketici aracında; eski
|
|
82
|
+
sürüm arşivlenir, yazma atomiktir, sonuç geri okunur. `success: true` kanıt değildir.
|
|
83
|
+
- **Kopyalanmaz.** Tüketiciler paketi düzenlenebilir kurulumla (`pip install -e`) alır.
|
|
84
|
+
Düzeltme diske anında akar; çalışan sunucuya yeniden başlatmayla gelir.
|
|
85
|
+
|
|
86
|
+
## Yapılandırma sözleşmesi (taslak)
|
|
87
|
+
|
|
88
|
+
Faz 1'de kesinleşir. Bugünkü niyet:
|
|
89
|
+
|
|
90
|
+
| Alan | Ne | Örnek |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| belge klasörü | iş akışı belgelerinin dizini | `docs/workflows` |
|
|
93
|
+
| araç-adı öneki | doğrulamanın gövdede arayacağı araç adı deseni | `acme_` |
|
|
94
|
+
| kategori listesi | belgelerin alabileceği geçerli kategoriler | `temel, kalite, yasam-dongusu` |
|
|
95
|
+
|
|
96
|
+
Bu üçünün dışındaki her şey ortak koddur.
|
|
97
|
+
|
|
98
|
+
## Tüketici kılavuzu
|
|
99
|
+
|
|
100
|
+
Bir sunucuyu motora bağlamak beş adımdır; her adımın kanıtı yanında yazılı.
|
|
101
|
+
|
|
102
|
+
1. **Kur.** Dağıtım adı `mcp-workflow-core` (PyPI'daki `workflow-core` başka bir
|
|
103
|
+
paketin; içe aktarma adı `workflow_core` aynı): `pip install mcp-workflow-core`, ya da
|
|
104
|
+
aynı makinede kaynaktan düzenlenebilir kurulum `pip install -e <workflow-core dizini>`.
|
|
105
|
+
Düzenlenebilir kurulum diske anında akar, çalışan sunucuya yeniden başlatmayla gelir
|
|
106
|
+
(anayasa, bilinen tuzaklar). Bağımlılık satırına üst sınır yazın (`<0.4`).
|
|
107
|
+
2. **Yapılandır.** Sunucu köküne `workflow.yaml`: `docs_dir`, `tool_prefix`,
|
|
108
|
+
`categories`. Dördüncü alan yazılırsa motor yüklenmez; kategori listesi boş olamaz.
|
|
109
|
+
3. **Sar.** Tek araç + `action`: `library.dispatch(action, params)`. Araç açıklamasını ve
|
|
110
|
+
yıkıcılık işaretini `ACTIONS` tablosundan üret. Onay kapısı sunucunun işidir:
|
|
111
|
+
`confirm` verilmemişse `write` ve `delete` `dry_run=True` ile çağrılır ve plan döner,
|
|
112
|
+
`confirm=True` ile gerçek yazma. Araç listesi canlı kayıttan `registered_tools`,
|
|
113
|
+
kaynağı `tool_source` olarak verilir. Hata zarfı (`ok`, `type`) sarmalayıcıda; motor
|
|
114
|
+
istisna fırlatır.
|
|
115
|
+
4. **Yayımla.** `from workflow_core.adapters.<çerçeve> import register`;
|
|
116
|
+
`register(server, library)` somut listeyi ve `workflow://{id}` şablonunu birlikte
|
|
117
|
+
kaydeder. Somut liste kayıt anının anlık görüntüsüdür: sonradan eklenen belge şablon
|
|
118
|
+
adresle okunur, listeye sunucu yeniden başlatılınca girer. Bu bedel bilinçli (tasarım
|
|
119
|
+
kılavuzu §4); yalnız somut liste kurulursa yeni belge hiç okunamaz.
|
|
120
|
+
5. **Doğrula.** Yeniden başlat, sonra canlı: büyük `İ`'li Türkçe sorgu sonuç döndürüyor
|
|
121
|
+
mu, `validate` notunda araç listesinin kaynağı yazıyor mu, `workflow://<kimlik>`
|
|
122
|
+
okunuyor mu, `dry_run` diske dokunmuyor mu. `success: true` kanıt değildir.
|
|
123
|
+
|
|
124
|
+
**Ret bir karardır, hata değil.** Motor yazmayı ya da silmeyi reddettiğinde istisna
|
|
125
|
+
fırlatmaz; `allowed`, `blocked_by`, `written` / `deleted` taşıyan planı döndürür ve
|
|
126
|
+
sonuca kendi hükmünü koyar. `ok` yalnız "diske yapıldı" demektir: kuru çalıştırmada ve
|
|
127
|
+
rette daima `false`, gerçek koşuda geri okuma doğrulayınca `true`; planın geçip
|
|
128
|
+
geçmeyeceği `allowed` alanında. Zarfı motorun alanlarından türetin, `ok`'u koşulsuz
|
|
129
|
+
yazmayın; hangi sırayla yazarsanız yazın motorun değeri onaysız planı "yapıldı"
|
|
130
|
+
göstermez. İlk bağlantıda reddedilen bir silme koşulsuz `ok` yüzünden başarılı
|
|
131
|
+
görünmüştü (2026-08-25); 0.1.1 kuru çalıştırmada "yapılabilir" anlamında `true` yazınca
|
|
132
|
+
üç sunucuda onaysız plan yapılmış göründü (2026-08-26), 0.2.0 bunu kapattı.
|
|
133
|
+
|
|
134
|
+
Eski motor dosyası bağlantıdan sonra silinir; kopya kalırsa çatallanma geri gelir. İlk
|
|
135
|
+
doğrulamada yeni kurallar uyarı üretir (`missing_verified_on`, frontmatter içi yorum
|
|
136
|
+
satırı); belge uyumu sunucunun işidir, sayılar Faz 1 planının SC-006 tablosunda.
|
|
137
|
+
|
|
138
|
+
## Depo düzeni
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
workflow_core/ motor paketi: yapılandırma, belge modeli, arama, doğrulama, yazma, kaynak, dağıtıcı
|
|
142
|
+
adapters/ çerçeveye dokunan tek yer; çerçeve başına bir dosya
|
|
143
|
+
tests/ pytest: modül başına test + kapanış, sessizlik, adsız çıktı testleri
|
|
144
|
+
korpus/, golden/ deneme belgeleri ve sorgu-beklenti seti
|
|
145
|
+
.sdd/ süreç belgeleri: anayasa, yol haritası, görevler, şartnameler
|
|
146
|
+
features/00N-*/ Faz 0 fark tablosu; Faz 1 şartname, plan, yetenek envanteri
|
|
147
|
+
_olcumler/ gerçek korpus ölçümleri (sürüm kontrolü dışında)
|
|
148
|
+
pyproject.toml paket tanımı, sürümün tek kaynağı, ruff ayarı
|
|
149
|
+
.test-komutu push öncesi kapının koştuğu test komutu
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Geliştirme
|
|
153
|
+
|
|
154
|
+
Python 3.11 gerekir. Sanal ortam aç, paketi düzenlenebilir kur (tüketici sunucular da
|
|
155
|
+
aynı komutla, kendi sanal ortamlarına kurar):
|
|
156
|
+
|
|
157
|
+
```powershell
|
|
158
|
+
python -m venv .venv
|
|
159
|
+
.venv\Scripts\python.exe -m pip install -e ".[dev]" # motor + pytest + ruff
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
```powershell
|
|
163
|
+
python -m pytest tests -q # testler (kaynak ağacından da koşar)
|
|
164
|
+
ruff check . ; ruff format --check . # linter ve biçim
|
|
165
|
+
python .sdd/scripts/sdd.py durum # aktif özellik, kapılar, sıradaki adım
|
|
166
|
+
python .sdd/scripts/sdd.py denetle # belge düzeni denetimi
|
|
167
|
+
python .sdd/scripts/sdd.py sizinti # ortama bağlı iz taraması
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Push öncesi kapı (`pre-push`) testleri ve düzen denetimini kendisi koşar; kırmızı testle
|
|
171
|
+
push yapılamaz.
|
|
172
|
+
|
|
173
|
+
İş akışı şartname odaklıdır: bir iş önce `.sdd/ROADMAP.md`'de durur, `sdd yeni` ile
|
|
174
|
+
şartnamesi açılır, onaylanır, planı yazılır, `sdd kontrol` sıfır dönünce görevleri
|
|
175
|
+
`.sdd/TODO.md`'ye düşer. Onay sohbette değil dosyada verilir.
|
|
176
|
+
|
|
177
|
+
## Belgeler
|
|
178
|
+
|
|
179
|
+
| Dosya | Ne için |
|
|
180
|
+
|---|---|
|
|
181
|
+
| [.sdd/CONSTITUTION.md](.sdd/CONSTITUTION.md) | kural gövdesi, tek nüsha |
|
|
182
|
+
| [.sdd/ROADMAP.md](.sdd/ROADMAP.md) | yön, aşamalar, bilinçli olarak girilmeyen yollar |
|
|
183
|
+
| [.sdd/ARCHITECTURE.md](.sdd/ARCHITECTURE.md) | tarihli mimari kararlar ve reddedilen alternatifler |
|
|
184
|
+
| [.sdd/TODO.md](.sdd/TODO.md) | açık işler |
|
|
185
|
+
| [.sdd/CHANGELOG.md](.sdd/CHANGELOG.md) | tamamlanan dalgalar ve nedenleri |
|
|
186
|
+
| [.sdd/features/001-faz0-davranis-farki/fark-tablosu.md](.sdd/features/001-faz0-davranis-farki/fark-tablosu.md) | Faz 0 çıktısı: kopyaların davranış farkı, hükümler, kusur listesi |
|
|
187
|
+
| [.sdd/features/002-faz1-motor-paketi/plan.md](.sdd/features/002-faz1-motor-paketi/plan.md) | Faz 1 planı: tasarım kararları, yetenek envanteri, kapanış testleri, gerçek korpus ölçümleri |
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# workflow-core
|
|
2
|
+
|
|
3
|
+
MCP sunucularının iş akışı belgelerini okuyan, arayan, doğrulayan ve MCP kaynağı olarak
|
|
4
|
+
yayımlayan Python kütüphanesi. Sunucu değildir: port dinlemez, araç yayımlamaz. Sunucular
|
|
5
|
+
onu içe aktarır ve üç ayarla yapılandırır.
|
|
6
|
+
|
|
7
|
+
**Durum (2026-09-01):** dört tüketici sunucu motora bağlı ve kopyasız; yol haritasının
|
|
8
|
+
beş fazından dördü geçti. Motor 0.3.0 (230 test, ruff temiz); dağıtım adı
|
|
9
|
+
`mcp-workflow-core`, lisans Apache 2.0, PyPI yayımı onay sahibinin elinde.
|
|
10
|
+
|
|
11
|
+
**Hangi sürümdeyim:** paket sürümü **0.3.0**. Kaynak `pyproject.toml` (`[project]
|
|
12
|
+
version`); `tests/test_surum.py` bu satırı ona bağlar, çalışma anında
|
|
13
|
+
`workflow_core.__version__` aynı numarayı verir. Kuralların sürümü ayrıdır:
|
|
14
|
+
[anayasa](.sdd/CONSTITUTION.md) 1.4.0.
|
|
15
|
+
|
|
16
|
+
## Ne yapar
|
|
17
|
+
|
|
18
|
+
Bir sunucunun belge klasöründeki Markdown iş akışı belgelerini yönetir. Her
|
|
19
|
+
belge bir üst bilgi bloğu (frontmatter) ve zorunlu bölümler taşır; motor bunları:
|
|
20
|
+
|
|
21
|
+
- listeler ve okur,
|
|
22
|
+
- arar (Türkçe harfleri katlayarak: büyük `İ`, aksanlı ve aksansız yazım aynı sonucu
|
|
23
|
+
verir),
|
|
24
|
+
- doğrular (zorunlu alanlar, zorunlu bölümler, gövdede anılan araç adlarının çalışma
|
|
25
|
+
anındaki kayıtta var olup olmadığı, bayatlık),
|
|
26
|
+
- yazar, günceller ve siler (kuru çalıştırma ve arşivle),
|
|
27
|
+
- MCP kaynağı olarak yayımlar.
|
|
28
|
+
|
|
29
|
+
Motor belgeleri çalıştırmaz, okutur. Belge "makinenin yürüteceği kod" değil, "akıllı bir
|
|
30
|
+
asistanın okuyacağı yönerge"dir; koşul, döngü ve karar asistanın işidir.
|
|
31
|
+
|
|
32
|
+
Kullanım, tüketici sunucuda:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from workflow_core import Config, Library
|
|
36
|
+
|
|
37
|
+
library = Library(Config.from_file("workflow.yaml")) # docs_dir, tool_prefix, categories
|
|
38
|
+
library.search("devreye alma") # Türkçe katlamalı arama
|
|
39
|
+
library.validate(registered_tools=canli_arac_listesi, today="2026-08-22")
|
|
40
|
+
library.write("42-yeni-belge", icerik, dry_run=True) # plan döner, disk değişmez
|
|
41
|
+
library.dispatch("get", {"id": "42-yeni-belge"}) # tek giriş: action + params
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
MCP kaynağı olarak yayın çerçeveye göre tek satır: `workflow_core.adapters.gofastmcp`
|
|
45
|
+
ya da `workflow_core.adapters.official_sdk` içinden `register(server, library)`. Onay
|
|
46
|
+
kapısı motorda değil tüketici aracındadır; motor `dry_run` planını ve yıkıcı eylem
|
|
47
|
+
işaretini (`ACTIONS`) verir.
|
|
48
|
+
|
|
49
|
+
## Neden var
|
|
50
|
+
|
|
51
|
+
Aynı motor daha önce üç sunucuya kopyalanmıştı: toplam 1720 satır, paylaşılan satır
|
|
52
|
+
sıfır. Düzeltmeler iki yönde de akmadı; bir kopyada yapılan iyileştirme ötekilere
|
|
53
|
+
gitmedi, orijinaldeki düzeltme kopyalara gitmedi. Faz 0 ölçümü hiçbir kopyanın "en
|
|
54
|
+
zengin" olmadığını gösterdi: doğru davranışlar üçüne dağılmıştı ve arama üçünde de
|
|
55
|
+
Türkçe-güvenli değildi. Birleştirme tek kopyayı seçerek yapılamaz; bu yüzden motor tek
|
|
56
|
+
yerde yazılıyor ve sunucular onu kütüphane olarak alıyor.
|
|
57
|
+
|
|
58
|
+
## Tasarım ilkeleri
|
|
59
|
+
|
|
60
|
+
- **Motor tek, yapılandırma çok.** Sunucuya özel üç şey var: belge klasörünün yolu,
|
|
61
|
+
araç-adı öneki, geçerli kategori listesi. Dördüncüsü gerektiğinde önce "bu gerçekten
|
|
62
|
+
sunucuya mı özel" diye sorulur. Tanınmayan yapılandırma alanı reddedilir.
|
|
63
|
+
- **Alan-özel `if` yok.** Sunucuya özel davranış yapılandırma alanıyla çözülür; alan
|
|
64
|
+
eklemek diff'te görünür, `if` görünmez.
|
|
65
|
+
- **Hiçbir MCP çerçevesine bağlanmaz.** Tüketiciler iki farklı çerçevede çalışıyor; motor
|
|
66
|
+
ikisini de içe aktarmaz, kaynak kaydı çerçeveden bağımsız bir arayüzle sunulur.
|
|
67
|
+
- **Sessiz düşüş yok.** Yedek yola düşüş, kırpma ve yok sayma en az bir uyarı loglar.
|
|
68
|
+
- **Yazma güvenlik zinciriyle.** Kuru çalıştırma motorda, onay tüketici aracında; eski
|
|
69
|
+
sürüm arşivlenir, yazma atomiktir, sonuç geri okunur. `success: true` kanıt değildir.
|
|
70
|
+
- **Kopyalanmaz.** Tüketiciler paketi düzenlenebilir kurulumla (`pip install -e`) alır.
|
|
71
|
+
Düzeltme diske anında akar; çalışan sunucuya yeniden başlatmayla gelir.
|
|
72
|
+
|
|
73
|
+
## Yapılandırma sözleşmesi (taslak)
|
|
74
|
+
|
|
75
|
+
Faz 1'de kesinleşir. Bugünkü niyet:
|
|
76
|
+
|
|
77
|
+
| Alan | Ne | Örnek |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| belge klasörü | iş akışı belgelerinin dizini | `docs/workflows` |
|
|
80
|
+
| araç-adı öneki | doğrulamanın gövdede arayacağı araç adı deseni | `acme_` |
|
|
81
|
+
| kategori listesi | belgelerin alabileceği geçerli kategoriler | `temel, kalite, yasam-dongusu` |
|
|
82
|
+
|
|
83
|
+
Bu üçünün dışındaki her şey ortak koddur.
|
|
84
|
+
|
|
85
|
+
## Tüketici kılavuzu
|
|
86
|
+
|
|
87
|
+
Bir sunucuyu motora bağlamak beş adımdır; her adımın kanıtı yanında yazılı.
|
|
88
|
+
|
|
89
|
+
1. **Kur.** Dağıtım adı `mcp-workflow-core` (PyPI'daki `workflow-core` başka bir
|
|
90
|
+
paketin; içe aktarma adı `workflow_core` aynı): `pip install mcp-workflow-core`, ya da
|
|
91
|
+
aynı makinede kaynaktan düzenlenebilir kurulum `pip install -e <workflow-core dizini>`.
|
|
92
|
+
Düzenlenebilir kurulum diske anında akar, çalışan sunucuya yeniden başlatmayla gelir
|
|
93
|
+
(anayasa, bilinen tuzaklar). Bağımlılık satırına üst sınır yazın (`<0.4`).
|
|
94
|
+
2. **Yapılandır.** Sunucu köküne `workflow.yaml`: `docs_dir`, `tool_prefix`,
|
|
95
|
+
`categories`. Dördüncü alan yazılırsa motor yüklenmez; kategori listesi boş olamaz.
|
|
96
|
+
3. **Sar.** Tek araç + `action`: `library.dispatch(action, params)`. Araç açıklamasını ve
|
|
97
|
+
yıkıcılık işaretini `ACTIONS` tablosundan üret. Onay kapısı sunucunun işidir:
|
|
98
|
+
`confirm` verilmemişse `write` ve `delete` `dry_run=True` ile çağrılır ve plan döner,
|
|
99
|
+
`confirm=True` ile gerçek yazma. Araç listesi canlı kayıttan `registered_tools`,
|
|
100
|
+
kaynağı `tool_source` olarak verilir. Hata zarfı (`ok`, `type`) sarmalayıcıda; motor
|
|
101
|
+
istisna fırlatır.
|
|
102
|
+
4. **Yayımla.** `from workflow_core.adapters.<çerçeve> import register`;
|
|
103
|
+
`register(server, library)` somut listeyi ve `workflow://{id}` şablonunu birlikte
|
|
104
|
+
kaydeder. Somut liste kayıt anının anlık görüntüsüdür: sonradan eklenen belge şablon
|
|
105
|
+
adresle okunur, listeye sunucu yeniden başlatılınca girer. Bu bedel bilinçli (tasarım
|
|
106
|
+
kılavuzu §4); yalnız somut liste kurulursa yeni belge hiç okunamaz.
|
|
107
|
+
5. **Doğrula.** Yeniden başlat, sonra canlı: büyük `İ`'li Türkçe sorgu sonuç döndürüyor
|
|
108
|
+
mu, `validate` notunda araç listesinin kaynağı yazıyor mu, `workflow://<kimlik>`
|
|
109
|
+
okunuyor mu, `dry_run` diske dokunmuyor mu. `success: true` kanıt değildir.
|
|
110
|
+
|
|
111
|
+
**Ret bir karardır, hata değil.** Motor yazmayı ya da silmeyi reddettiğinde istisna
|
|
112
|
+
fırlatmaz; `allowed`, `blocked_by`, `written` / `deleted` taşıyan planı döndürür ve
|
|
113
|
+
sonuca kendi hükmünü koyar. `ok` yalnız "diske yapıldı" demektir: kuru çalıştırmada ve
|
|
114
|
+
rette daima `false`, gerçek koşuda geri okuma doğrulayınca `true`; planın geçip
|
|
115
|
+
geçmeyeceği `allowed` alanında. Zarfı motorun alanlarından türetin, `ok`'u koşulsuz
|
|
116
|
+
yazmayın; hangi sırayla yazarsanız yazın motorun değeri onaysız planı "yapıldı"
|
|
117
|
+
göstermez. İlk bağlantıda reddedilen bir silme koşulsuz `ok` yüzünden başarılı
|
|
118
|
+
görünmüştü (2026-08-25); 0.1.1 kuru çalıştırmada "yapılabilir" anlamında `true` yazınca
|
|
119
|
+
üç sunucuda onaysız plan yapılmış göründü (2026-08-26), 0.2.0 bunu kapattı.
|
|
120
|
+
|
|
121
|
+
Eski motor dosyası bağlantıdan sonra silinir; kopya kalırsa çatallanma geri gelir. İlk
|
|
122
|
+
doğrulamada yeni kurallar uyarı üretir (`missing_verified_on`, frontmatter içi yorum
|
|
123
|
+
satırı); belge uyumu sunucunun işidir, sayılar Faz 1 planının SC-006 tablosunda.
|
|
124
|
+
|
|
125
|
+
## Depo düzeni
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
workflow_core/ motor paketi: yapılandırma, belge modeli, arama, doğrulama, yazma, kaynak, dağıtıcı
|
|
129
|
+
adapters/ çerçeveye dokunan tek yer; çerçeve başına bir dosya
|
|
130
|
+
tests/ pytest: modül başına test + kapanış, sessizlik, adsız çıktı testleri
|
|
131
|
+
korpus/, golden/ deneme belgeleri ve sorgu-beklenti seti
|
|
132
|
+
.sdd/ süreç belgeleri: anayasa, yol haritası, görevler, şartnameler
|
|
133
|
+
features/00N-*/ Faz 0 fark tablosu; Faz 1 şartname, plan, yetenek envanteri
|
|
134
|
+
_olcumler/ gerçek korpus ölçümleri (sürüm kontrolü dışında)
|
|
135
|
+
pyproject.toml paket tanımı, sürümün tek kaynağı, ruff ayarı
|
|
136
|
+
.test-komutu push öncesi kapının koştuğu test komutu
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Geliştirme
|
|
140
|
+
|
|
141
|
+
Python 3.11 gerekir. Sanal ortam aç, paketi düzenlenebilir kur (tüketici sunucular da
|
|
142
|
+
aynı komutla, kendi sanal ortamlarına kurar):
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
python -m venv .venv
|
|
146
|
+
.venv\Scripts\python.exe -m pip install -e ".[dev]" # motor + pytest + ruff
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```powershell
|
|
150
|
+
python -m pytest tests -q # testler (kaynak ağacından da koşar)
|
|
151
|
+
ruff check . ; ruff format --check . # linter ve biçim
|
|
152
|
+
python .sdd/scripts/sdd.py durum # aktif özellik, kapılar, sıradaki adım
|
|
153
|
+
python .sdd/scripts/sdd.py denetle # belge düzeni denetimi
|
|
154
|
+
python .sdd/scripts/sdd.py sizinti # ortama bağlı iz taraması
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Push öncesi kapı (`pre-push`) testleri ve düzen denetimini kendisi koşar; kırmızı testle
|
|
158
|
+
push yapılamaz.
|
|
159
|
+
|
|
160
|
+
İş akışı şartname odaklıdır: bir iş önce `.sdd/ROADMAP.md`'de durur, `sdd yeni` ile
|
|
161
|
+
şartnamesi açılır, onaylanır, planı yazılır, `sdd kontrol` sıfır dönünce görevleri
|
|
162
|
+
`.sdd/TODO.md`'ye düşer. Onay sohbette değil dosyada verilir.
|
|
163
|
+
|
|
164
|
+
## Belgeler
|
|
165
|
+
|
|
166
|
+
| Dosya | Ne için |
|
|
167
|
+
|---|---|
|
|
168
|
+
| [.sdd/CONSTITUTION.md](.sdd/CONSTITUTION.md) | kural gövdesi, tek nüsha |
|
|
169
|
+
| [.sdd/ROADMAP.md](.sdd/ROADMAP.md) | yön, aşamalar, bilinçli olarak girilmeyen yollar |
|
|
170
|
+
| [.sdd/ARCHITECTURE.md](.sdd/ARCHITECTURE.md) | tarihli mimari kararlar ve reddedilen alternatifler |
|
|
171
|
+
| [.sdd/TODO.md](.sdd/TODO.md) | açık işler |
|
|
172
|
+
| [.sdd/CHANGELOG.md](.sdd/CHANGELOG.md) | tamamlanan dalgalar ve nedenleri |
|
|
173
|
+
| [.sdd/features/001-faz0-davranis-farki/fark-tablosu.md](.sdd/features/001-faz0-davranis-farki/fark-tablosu.md) | Faz 0 çıktısı: kopyaların davranış farkı, hükümler, kusur listesi |
|
|
174
|
+
| [.sdd/features/002-faz1-motor-paketi/plan.md](.sdd/features/002-faz1-motor-paketi/plan.md) | Faz 1 planı: tasarım kararları, yetenek envanteri, kapanış testleri, gerçek korpus ölçümleri |
|