netark-mcp 3.2.0__py3-none-any.whl

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 (66) hide show
  1. netark_mcp/__init__.py +3 -0
  2. netark_mcp/_core/memory/index/TAXONOMY.json +157 -0
  3. netark_mcp/_core/schemas/artifact_header.schema.json +241 -0
  4. netark_mcp/_core/schemas/code_hygiene_ast.py +328 -0
  5. netark_mcp/_core/schemas/codebook_compiler.py +338 -0
  6. netark_mcp/_core/schemas/context_node.schema.json +252 -0
  7. netark_mcp/_core/schemas/doc_initializer.py +277 -0
  8. netark_mcp/_core/schemas/hook_lifecycle.py +330 -0
  9. netark_mcp/_core/schemas/mcp_tools_core.py +396 -0
  10. netark_mcp/_core/schemas/netark_guard_core.py +397 -0
  11. netark_mcp/_core/schemas/ribc_gate.py +266 -0
  12. netark_mcp/_core/schemas/schema_validator.py +378 -0
  13. netark_mcp/_core/schemas/topology_graph.py +405 -0
  14. netark_mcp/_core/schemas/workspace_placement_guard.py +364 -0
  15. netark_mcp/_core/scripts/auto_update_map.py +349 -0
  16. netark_mcp/_core/scripts/netark_guard_daemon.py +394 -0
  17. netark_mcp/_core/scripts/netark_init.py +356 -0
  18. netark_mcp/_core/scripts/netark_mcp_server.py +279 -0
  19. netark_mcp/_core/scripts/sync_doc_metadata.py +378 -0
  20. netark_mcp/_core/templates/hosts/agy/AGENTS.md.tpl +23 -0
  21. netark_mcp/_core/templates/hosts/claude/CLAUDE.md.tpl +21 -0
  22. netark_mcp/_core/templates/hosts/pi/AGENTS.md.tpl +35 -0
  23. netark_mcp/_core/templates/hosts/pi/agents/architect.md +14 -0
  24. netark_mcp/_core/templates/hosts/pi/agents/auditor.md +13 -0
  25. netark_mcp/_core/templates/hosts/pi/agents/challenger.md +16 -0
  26. netark_mcp/_core/templates/hosts/pi/agents/scout.md +14 -0
  27. netark_mcp/_core/templates/hosts/pi/agents/worker.md +19 -0
  28. netark_mcp/_core/templates/hosts/pi/auth.example.json.tpl +10 -0
  29. netark_mcp/_core/templates/hosts/pi/custom-models.json.tpl +20 -0
  30. netark_mcp/_core/templates/hosts/pi/enterprise-policy.json.tpl +14 -0
  31. netark_mcp/_core/templates/hosts/pi/extensions/epistemic-gate.ts +351 -0
  32. netark_mcp/_core/templates/hosts/pi/extensions/epistemic-library-tools.ts +318 -0
  33. netark_mcp/_core/templates/hosts/pi/extensions/guard-shell-parser.ts +269 -0
  34. netark_mcp/_core/templates/hosts/pi/extensions/model-router.ts +3252 -0
  35. netark_mcp/_core/templates/hosts/pi/extensions/ribc-spec-gate.ts +136 -0
  36. netark_mcp/_core/templates/hosts/pi/extensions/session-handover.ts +112 -0
  37. netark_mcp/_core/templates/hosts/pi/extensions/subagent/agents.ts +157 -0
  38. netark_mcp/_core/templates/hosts/pi/extensions/subagent/index.ts +1150 -0
  39. netark_mcp/_core/templates/hosts/pi/extensions/web-research.ts +591 -0
  40. netark_mcp/_core/templates/hosts/pi/extensions/workspace-guard.ts +354 -0
  41. netark_mcp/_core/templates/hosts/pi/models.json.tpl +860 -0
  42. netark_mcp/_core/templates/hosts/pi/prompts/dream.md +19 -0
  43. netark_mcp/_core/templates/hosts/pi/prompts/handover.md +13 -0
  44. netark_mcp/_core/templates/hosts/pi/prompts/team.md +20 -0
  45. netark_mcp/_core/templates/hosts/pi/role-models.json.tpl +10 -0
  46. netark_mcp/_core/templates/hosts/pi/settings.json.tpl +17 -0
  47. netark_mcp/_core/templates/mcp/HOOK_CONTRACT.md +52 -0
  48. netark_mcp/_core/templates/mcp/README.zh-TW.md +111 -0
  49. netark_mcp/_core/templates/memory/en/000_SOUL.md +63 -0
  50. netark_mcp/_core/templates/memory/en/100_ARCH_RULES.md +75 -0
  51. netark_mcp/_core/templates/memory/en/200_DECISIONS.md +64 -0
  52. netark_mcp/_core/templates/memory/en/HANDOVER.md +61 -0
  53. netark_mcp/_core/templates/memory/en/LEDGER.md +55 -0
  54. netark_mcp/_core/templates/memory/zh-TW/000_SOUL.md +63 -0
  55. netark_mcp/_core/templates/memory/zh-TW/100_ARCH_RULES.md +75 -0
  56. netark_mcp/_core/templates/memory/zh-TW/200_DECISIONS.md +64 -0
  57. netark_mcp/_core/templates/memory/zh-TW/HANDOVER.md +61 -0
  58. netark_mcp/_core/templates/memory/zh-TW/LEDGER.md +55 -0
  59. netark_mcp/_core/templates/skills/root-cause-debugging/SKILL.md +30 -0
  60. netark_mcp/_core/templates/skills/safe-refactoring/SKILL.md +23 -0
  61. netark_mcp/cli.py +32 -0
  62. netark_mcp-3.2.0.dist-info/METADATA +382 -0
  63. netark_mcp-3.2.0.dist-info/RECORD +66 -0
  64. netark_mcp-3.2.0.dist-info/WHEEL +4 -0
  65. netark_mcp-3.2.0.dist-info/entry_points.txt +2 -0
  66. netark_mcp-3.2.0.dist-info/licenses/LICENSE +201 -0
netark_mcp/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """NetArk MCP — Zero-Dependency Deterministic AI Coding Harness & Memory Governance."""
2
+
3
+ __version__ = "3.2.0"
@@ -0,0 +1,157 @@
1
+ {
2
+ "$schema": "https://netark.local/schemas/taxonomy.schema.json",
3
+ "version": "1.0.0",
4
+ "domains": {
5
+ "000": {
6
+ "title": "Core Constitution & Soul (核心憲法與靈魂)",
7
+ "label": "Core Constitution & Soul",
8
+ "track_default": "official",
9
+ "always_pin": true,
10
+ "subdomains": {}
11
+ },
12
+ "100": {
13
+ "title": "System Architecture & Security Guardrails (系統架構與安全護欄)",
14
+ "label": "System Architecture & Security Guardrails",
15
+ "track_default": "official",
16
+ "always_pin": true,
17
+ "subdomains": {}
18
+ },
19
+ "200": {
20
+ "title": "Architecture Decisions & Epistemic Governance (架構決策與認識論治理)",
21
+ "label": "Architecture Decisions & Epistemic Governance",
22
+ "track_default": "official",
23
+ "always_pin": false,
24
+ "subdomains": {}
25
+ },
26
+ "300": {
27
+ "title": "Core Domain Logic & Active Ledger (核心領域邏輯與活躍台帳)",
28
+ "label": "Core Domain Logic & Active Ledger",
29
+ "track_default": "both",
30
+ "always_pin": false,
31
+ "subdomains": {
32
+ "310": {
33
+ "title": "Library Wiki & Knowledge Graph Notes (知識庫 Wiki 與圖譜筆記)",
34
+ "label": "Library Wiki & Knowledge Graph Notes",
35
+ "track_default": "wiki",
36
+ "always_pin": false
37
+ },
38
+ "320": {
39
+ "title": "Domain Workflows & SOPs (領域工作流程與標準作業程序)",
40
+ "label": "Domain Workflows & SOPs",
41
+ "track_default": "wiki",
42
+ "always_pin": false
43
+ },
44
+ "330": {
45
+ "title": "Domain Glossaries & Ontologies (領域詞彙表與本體庫)",
46
+ "label": "Domain Glossaries & Ontologies",
47
+ "track_default": "wiki",
48
+ "always_pin": false
49
+ },
50
+ "340": {
51
+ "title": "Code Quality & Anti-Pattern Registry (代碼品質與反模式標籤庫)",
52
+ "label": "Code Quality & Anti-Pattern Registry",
53
+ "track_default": "wiki",
54
+ "always_pin": false
55
+ }
56
+ }
57
+ },
58
+ "310": {
59
+ "title": "Library Wiki & Knowledge Graph Notes (知識庫 Wiki 與圖譜筆記)",
60
+ "label": "Library Wiki & Knowledge Graph Notes",
61
+ "track_default": "wiki",
62
+ "always_pin": false,
63
+ "parent": "300"
64
+ },
65
+ "320": {
66
+ "title": "Domain Workflows & SOPs (領域工作流程與標準作業程序)",
67
+ "label": "Domain Workflows & SOPs",
68
+ "track_default": "wiki",
69
+ "always_pin": false,
70
+ "parent": "300"
71
+ },
72
+ "330": {
73
+ "title": "Domain Glossaries & Ontologies (領域詞彙表與本體庫)",
74
+ "label": "Domain Glossaries & Ontologies",
75
+ "track_default": "wiki",
76
+ "always_pin": false,
77
+ "parent": "300"
78
+ },
79
+ "340": {
80
+ "title": "Code Quality & Anti-Pattern Registry (代碼品質與反模式標籤庫)",
81
+ "label": "Code Quality & Anti-Pattern Registry",
82
+ "track_default": "wiki",
83
+ "always_pin": false,
84
+ "parent": "300"
85
+ },
86
+ "400": {
87
+ "title": "Data Schemas & Storage Protocols (資料綱要與儲存協定)",
88
+ "label": "Data Schemas & Storage Protocols",
89
+ "track_default": "both",
90
+ "always_pin": false,
91
+ "subdomains": {}
92
+ },
93
+ "500": {
94
+ "title": "Agentic Harness & Prompt Contracts (代理控制軛與提示詞契約)",
95
+ "label": "Agentic Harness & Prompt Contracts",
96
+ "track_default": "official",
97
+ "always_pin": false,
98
+ "subdomains": {
99
+ "510": {
100
+ "title": "Model Pool & Routing Strategy (模型池與路由策略)",
101
+ "label": "Model Pool & Routing Strategy",
102
+ "track_default": "both",
103
+ "always_pin": false
104
+ }
105
+ }
106
+ },
107
+ "510": {
108
+ "title": "Model Pool & Routing Strategy (模型池與路由策略)",
109
+ "label": "Model Pool & Routing Strategy",
110
+ "track_default": "both",
111
+ "always_pin": false,
112
+ "parent": "500"
113
+ },
114
+ "600": {
115
+ "title": "Verification Oracles & Testing (驗證神諭與測試基準)",
116
+ "label": "Verification Oracles & Testing",
117
+ "track_default": "both",
118
+ "always_pin": false,
119
+ "subdomains": {}
120
+ },
121
+ "700": {
122
+ "title": "Operations, Telemetry & Runtime (維運、遙測與執行期治理)",
123
+ "label": "Operations, Telemetry & Runtime",
124
+ "track_default": "both",
125
+ "always_pin": false,
126
+ "subdomains": {}
127
+ },
128
+ "800": {
129
+ "title": "External Integrations & Tooling (外部整合與工具鏈)",
130
+ "label": "External Integrations & Tooling",
131
+ "track_default": "wiki",
132
+ "always_pin": false,
133
+ "subdomains": {}
134
+ },
135
+ "900": {
136
+ "title": "Episodic Handover & Historical Archives (情節交接與歷史封存)",
137
+ "label": "Episodic Handover & Historical Archives",
138
+ "track_default": "both",
139
+ "always_pin": false,
140
+ "subdomains": {
141
+ "910": {
142
+ "title": "Episodic Handover & Session State (情節交接與會話狀態)",
143
+ "label": "Episodic Handover & Session State",
144
+ "track_default": "wiki",
145
+ "always_pin": false
146
+ }
147
+ }
148
+ },
149
+ "910": {
150
+ "title": "Episodic Handover & Session State (情節交接與會話狀態)",
151
+ "label": "Episodic Handover & Session State",
152
+ "track_default": "wiki",
153
+ "always_pin": false,
154
+ "parent": "900"
155
+ }
156
+ }
157
+ }
@@ -0,0 +1,241 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://netark.local/schemas/artifact_header.schema.json",
4
+ "title": "NetArk Agentic Harness Artifact Governance Header Schema",
5
+ "description": "Agentic Harness 記憶節點與架構產出物治理標頭:定義節點 ID、產出類型、存取層級、驗證狀態、跨模型對抗審查與獨立驗證斷言 (Verification Oracle)。",
6
+ "type": "object",
7
+ "required": [
8
+ "node_id",
9
+ "artifact_type",
10
+ "status",
11
+ "created_at",
12
+ "updated_at",
13
+ "author"
14
+ ],
15
+ "properties": {
16
+ "node_id": {
17
+ "type": "string",
18
+ "pattern": "^MEM-[0-9]{4}-[0-9]{4}$",
19
+ "description": "唯一記憶節點 ID (例如: MEM-2026-0001)"
20
+ },
21
+ "artifact_type": {
22
+ "type": "string",
23
+ "enum": [
24
+ "constitution",
25
+ "rule",
26
+ "adr",
27
+ "blueprint",
28
+ "spec",
29
+ "audit",
30
+ "wiki",
31
+ "note",
32
+ "sop",
33
+ "glossary",
34
+ "digest"
35
+ ],
36
+ "description": "節點類型:正式公文軌 (constitution, rule, adr, blueprint, spec, audit) 或 圖書館 Wiki 軌 (wiki, note, sop, glossary, digest)"
37
+ },
38
+ "access_tier": {
39
+ "type": "string",
40
+ "enum": [
41
+ "standard",
42
+ "restricted",
43
+ "immutable"
44
+ ],
45
+ "description": "存取保護層級:standard(一般記憶節點)、restricted(受保護之邊界與路由規則)、immutable(不可變核心憲法)"
46
+ },
47
+ "priority": {
48
+ "type": "string",
49
+ "enum": [
50
+ "normal",
51
+ "high",
52
+ "critical"
53
+ ]
54
+ },
55
+ "status": {
56
+ "type": "string",
57
+ "enum": [
58
+ "draft",
59
+ "reviewing",
60
+ "stub_ready",
61
+ "verified",
62
+ "archived",
63
+ "deprecated"
64
+ ],
65
+ "description": "生命週期狀態:stub_ready 代表空殼介面與紅燈測試已就緒;進入 verified 或 archived 前,author.model 與 reviewer.model 必須為不同模型,且通過 verification_oracle"
66
+ },
67
+ "created_at": {
68
+ "type": "string",
69
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
70
+ },
71
+ "updated_at": {
72
+ "type": "string",
73
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
74
+ },
75
+ "author": {
76
+ "type": "object",
77
+ "required": [
78
+ "role",
79
+ "model"
80
+ ],
81
+ "properties": {
82
+ "role": {
83
+ "type": "string"
84
+ },
85
+ "model": {
86
+ "type": "string"
87
+ }
88
+ },
89
+ "description": "提案角色與產出模型"
90
+ },
91
+ "reviewer": {
92
+ "type": ["object", "null"],
93
+ "properties": {
94
+ "role": {
95
+ "type": "string"
96
+ },
97
+ "model": {
98
+ "type": "string"
99
+ },
100
+ "verdict": {
101
+ "type": "string",
102
+ "enum": [
103
+ "PENDING",
104
+ "APPROVED",
105
+ "CHALLENGED",
106
+ "REJECTED"
107
+ ]
108
+ }
109
+ },
110
+ "description": "跨模型對抗審查角色與模型 (Anti-Sycophancy: verified 狀態時不得與 author.model 相同)"
111
+ },
112
+ "content_checksum": {
113
+ "type": "string",
114
+ "description": "正文 16 碼 sha256 雜湊值"
115
+ },
116
+ "epistemic_stats": {
117
+ "type": "object",
118
+ "description": "內文認知標籤統計快照"
119
+ },
120
+ "summary_1line": {
121
+ "type": "string",
122
+ "description": "單行摘要"
123
+ },
124
+ "tags": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "string"
128
+ },
129
+ "description": "標籤列表"
130
+ },
131
+ "epistemic_profile": {
132
+ "type": ["object", "null"],
133
+ "required": [
134
+ "fact_count",
135
+ "inferred_count",
136
+ "hypothesis_count",
137
+ "unverified_count"
138
+ ],
139
+ "properties": {
140
+ "fact_count": {
141
+ "type": "integer",
142
+ "minimum": 0
143
+ },
144
+ "inferred_count": {
145
+ "type": "integer",
146
+ "minimum": 0
147
+ },
148
+ "hypothesis_count": {
149
+ "type": "integer",
150
+ "minimum": 0
151
+ },
152
+ "unverified_count": {
153
+ "type": "integer",
154
+ "minimum": 0
155
+ }
156
+ },
157
+ "description": "內文認知標籤統計,由驗證器自動核對內文實際出現的 [FACT]/[INFERRED]/[HYPOTHESIS]/[UNVERIFIED] 標籤"
158
+ },
159
+ "verification_oracle": {
160
+ "type": ["object", "null"],
161
+ "required": [
162
+ "type",
163
+ "command",
164
+ "expected_exit_code",
165
+ "falsifiable_criterion"
166
+ ],
167
+ "properties": {
168
+ "type": {
169
+ "type": "string",
170
+ "enum": [
171
+ "schema_check",
172
+ "pytest",
173
+ "bash_assert",
174
+ "ast_check"
175
+ ]
176
+ },
177
+ "command": {
178
+ "type": "string",
179
+ "minLength": 3
180
+ },
181
+ "expected_exit_code": {
182
+ "type": "integer"
183
+ },
184
+ "falsifiable_criterion": {
185
+ "type": "string",
186
+ "minLength": 10,
187
+ "description": "可證偽條件:明確定義什麼情況下本節點斷言失效或驗證失敗"
188
+ }
189
+ },
190
+ "description": "獨立外部驗證斷言 (Verification Oracle),防止單一 LLM 自寫自審"
191
+ },
192
+ "scope_profile": {
193
+ "type": ["object", "null"],
194
+ "properties": {
195
+ "complexity_tier": {
196
+ "type": "string",
197
+ "enum": ["atomic", "composite"]
198
+ },
199
+ "new_modules_count": {
200
+ "type": "integer",
201
+ "minimum": 0
202
+ },
203
+ "target_files_count": {
204
+ "type": "integer",
205
+ "minimum": 0
206
+ },
207
+ "requires_new_algorithm": {
208
+ "type": "boolean"
209
+ }
210
+ },
211
+ "additionalProperties": false
212
+ }
213
+ },
214
+ "allOf": [
215
+ {
216
+ "if": {
217
+ "properties": {
218
+ "artifact_type": {
219
+ "enum": [
220
+ "constitution",
221
+ "rule",
222
+ "adr",
223
+ "blueprint",
224
+ "spec",
225
+ "audit"
226
+ ]
227
+ }
228
+ }
229
+ },
230
+ "then": {
231
+ "required": [
232
+ "access_tier",
233
+ "priority",
234
+ "reviewer",
235
+ "epistemic_profile",
236
+ "verification_oracle"
237
+ ]
238
+ }
239
+ }
240
+ ]
241
+ }