mingjing 0.11.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. mingjing-0.11.9/CHANGELOG.md +165 -0
  2. mingjing-0.11.9/LICENSE +108 -0
  3. mingjing-0.11.9/MANIFEST.in +12 -0
  4. mingjing-0.11.9/PKG-INFO +278 -0
  5. mingjing-0.11.9/README.md +268 -0
  6. mingjing-0.11.9/config/__init__.py +0 -0
  7. mingjing-0.11.9/config/budget.json +59 -0
  8. mingjing-0.11.9/config/diseases.yaml +2797 -0
  9. mingjing-0.11.9/config/diseases_schema.json +111 -0
  10. mingjing-0.11.9/config/remedies.yaml +171 -0
  11. mingjing-0.11.9/extensions/hermes/README.md +15 -0
  12. mingjing-0.11.9/extensions/hermes/__init__.py +541 -0
  13. mingjing-0.11.9/extensions/hermes/__pycache__/__init__.cpython-312.pyc +0 -0
  14. mingjing-0.11.9/extensions/hermes/__pycache__/_extractors.cpython-312.pyc +0 -0
  15. mingjing-0.11.9/extensions/hermes/__pycache__/_payload_builders.cpython-312.pyc +0 -0
  16. mingjing-0.11.9/extensions/hermes/__pycache__/probe_uni.cpython-312.pyc +0 -0
  17. mingjing-0.11.9/extensions/hermes/_extractors.py +132 -0
  18. mingjing-0.11.9/extensions/hermes/_payload_builders.py +272 -0
  19. mingjing-0.11.9/extensions/hermes/_python_base.py +52 -0
  20. mingjing-0.11.9/extensions/hermes/after-install.md +115 -0
  21. mingjing-0.11.9/extensions/hermes/plugin.yaml +28 -0
  22. mingjing-0.11.9/extensions/hermes/probe_uni.py +356 -0
  23. mingjing-0.11.9/extensions/hermes/skills/mingjing/SKILL.md +391 -0
  24. mingjing-0.11.9/extensions/langchain/MANIFEST.in +5 -0
  25. mingjing-0.11.9/extensions/langchain/README.md +140 -0
  26. mingjing-0.11.9/extensions/langchain/dist/ming_probe_langchain-0.11.9-py3-none-any.whl +0 -0
  27. mingjing-0.11.9/extensions/langchain/dist/ming_probe_langchain-0.11.9.tar.gz +0 -0
  28. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__init__.py +17 -0
  29. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/__init__.cpython-312.pyc +0 -0
  30. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/_payload_builders.cpython-312.pyc +0 -0
  31. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/_python_base.cpython-312.pyc +0 -0
  32. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/health.cpython-312.pyc +0 -0
  33. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/probe_langchain.cpython-312.pyc +0 -0
  34. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/probe_langchain_callback.cpython-312.pyc +0 -0
  35. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/__pycache__/probe_uni.cpython-312.pyc +0 -0
  36. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/_auto.py +65 -0
  37. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/_payload_builders.py +233 -0
  38. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/_python_base.py +49 -0
  39. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/health.py +287 -0
  40. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/probe_langchain.py +306 -0
  41. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/probe_langchain_callback.py +226 -0
  42. mingjing-0.11.9/extensions/langchain/ming_probe_langchain/probe_uni.py +143 -0
  43. mingjing-0.11.9/extensions/langchain/ming_probe_langchain.egg-info/PKG-INFO +86 -0
  44. mingjing-0.11.9/extensions/langchain/ming_probe_langchain.egg-info/SOURCES.txt +16 -0
  45. mingjing-0.11.9/extensions/langchain/ming_probe_langchain.egg-info/dependency_links.txt +1 -0
  46. mingjing-0.11.9/extensions/langchain/ming_probe_langchain.egg-info/top_level.txt +1 -0
  47. mingjing-0.11.9/extensions/langchain/ming_probe_langchain.pth +1 -0
  48. mingjing-0.11.9/extensions/langchain/pyproject.toml +3 -0
  49. mingjing-0.11.9/extensions/langchain/setup.py +39 -0
  50. mingjing-0.11.9/extensions/openclaw/README.md +30 -0
  51. mingjing-0.11.9/extensions/openclaw/index.js +32 -0
  52. mingjing-0.11.9/extensions/openclaw/openclaw.plugin.json +27 -0
  53. mingjing-0.11.9/extensions/openclaw/probe-runtime.js +770 -0
  54. mingjing-0.11.9/extensions/openclaw/sdk-resolver.js +51 -0
  55. mingjing-0.11.9/extensions/openclaw/skills/mingjing/SKILL.md +468 -0
  56. mingjing-0.11.9/filters/__init__.py +0 -0
  57. mingjing-0.11.9/filters/pro.yaml +50 -0
  58. mingjing-0.11.9/mingjing.egg-info/PKG-INFO +278 -0
  59. mingjing-0.11.9/mingjing.egg-info/SOURCES.txt +199 -0
  60. mingjing-0.11.9/mingjing.egg-info/dependency_links.txt +1 -0
  61. mingjing-0.11.9/mingjing.egg-info/entry_points.txt +2 -0
  62. mingjing-0.11.9/mingjing.egg-info/top_level.txt +3 -0
  63. mingjing-0.11.9/pyproject.toml +27 -0
  64. mingjing-0.11.9/setup.cfg +4 -0
  65. mingjing-0.11.9/setup.sh +35 -0
  66. mingjing-0.11.9/src/__init__.py +1 -0
  67. mingjing-0.11.9/src/ab_filter.py +87 -0
  68. mingjing-0.11.9/src/adapters/__init__.py +0 -0
  69. mingjing-0.11.9/src/adapters/_go_builders.go +58 -0
  70. mingjing-0.11.9/src/adapters/_js_base.js +34 -0
  71. mingjing-0.11.9/src/adapters/_payload_builders.py +274 -0
  72. mingjing-0.11.9/src/adapters/_python_base.py +58 -0
  73. mingjing-0.11.9/src/adapters/backfill_opencode.py +178 -0
  74. mingjing-0.11.9/src/adapters/daemon_opencode.py +145 -0
  75. mingjing-0.11.9/src/adapters/probe_autogpt.py +142 -0
  76. mingjing-0.11.9/src/adapters/probe_crewai.py +178 -0
  77. mingjing-0.11.9/src/adapters/probe_langchain.js +102 -0
  78. mingjing-0.11.9/src/adapters/probe_langchain.py +448 -0
  79. mingjing-0.11.9/src/adapters/probe_langchain_callback.py +354 -0
  80. mingjing-0.11.9/src/adapters/probe_langchain_go.go +154 -0
  81. mingjing-0.11.9/src/adapters/probe_lit.js +83 -0
  82. mingjing-0.11.9/src/adapters/probe_lit.py +71 -0
  83. mingjing-0.11.9/src/adapters/probe_llamaindex.py +185 -0
  84. mingjing-0.11.9/src/adapters/probe_openclaw.js +108 -0
  85. mingjing-0.11.9/src/adapters/probe_opencode_wrapper.go +427 -0
  86. mingjing-0.11.9/src/adapters/probe_opencode_wrapper.py +429 -0
  87. mingjing-0.11.9/src/adapters/probe_openhands.py +171 -0
  88. mingjing-0.11.9/src/adapters/probe_tusunsun.js +424 -0
  89. mingjing-0.11.9/src/adapters/probe_vercel.js +101 -0
  90. mingjing-0.11.9/src/anchor.py +94 -0
  91. mingjing-0.11.9/src/archiver.py +470 -0
  92. mingjing-0.11.9/src/archiver_backup.py +38 -0
  93. mingjing-0.11.9/src/archiver_confirm.py +50 -0
  94. mingjing-0.11.9/src/archiver_daemon.py +33 -0
  95. mingjing-0.11.9/src/archiver_exclude.py +28 -0
  96. mingjing-0.11.9/src/archiver_schema.py +126 -0
  97. mingjing-0.11.9/src/archiver_score.py +30 -0
  98. mingjing-0.11.9/src/archiver_triage.py +54 -0
  99. mingjing-0.11.9/src/archiver_ttl.py +37 -0
  100. mingjing-0.11.9/src/archiver_util.py +54 -0
  101. mingjing-0.11.9/src/bridge.py +127 -0
  102. mingjing-0.11.9/src/cli.py +378 -0
  103. mingjing-0.11.9/src/cli_admin.py +314 -0
  104. mingjing-0.11.9/src/cli_archive.py +93 -0
  105. mingjing-0.11.9/src/cli_disease.py +328 -0
  106. mingjing-0.11.9/src/cli_health.py +286 -0
  107. mingjing-0.11.9/src/cli_ops.py +156 -0
  108. mingjing-0.11.9/src/cli_replay.py +268 -0
  109. mingjing-0.11.9/src/cli_report.py +705 -0
  110. mingjing-0.11.9/src/cli_triage.py +227 -0
  111. mingjing-0.11.9/src/cluster_archiver.py +273 -0
  112. mingjing-0.11.9/src/cluster_archiver_daemon.py +64 -0
  113. mingjing-0.11.9/src/cluster_pool.py +83 -0
  114. mingjing-0.11.9/src/cluster_reflector.py +44 -0
  115. mingjing-0.11.9/src/config_loader.py +194 -0
  116. mingjing-0.11.9/src/coverage_scan.py +59 -0
  117. mingjing-0.11.9/src/credential_vault.py +78 -0
  118. mingjing-0.11.9/src/fingerprint.py +43 -0
  119. mingjing-0.11.9/src/lit_crossval.py +50 -0
  120. mingjing-0.11.9/src/lit_dx.py +95 -0
  121. mingjing-0.11.9/src/lit_lite.py +382 -0
  122. mingjing-0.11.9/src/lit_rule.py +250 -0
  123. mingjing-0.11.9/src/migrations/__init__.py +0 -0
  124. mingjing-0.11.9/src/migrations/migrate.py +140 -0
  125. mingjing-0.11.9/src/ming.py +602 -0
  126. mingjing-0.11.9/src/ming_push.py +78 -0
  127. mingjing-0.11.9/src/otel_bridge.py +222 -0
  128. mingjing-0.11.9/src/otel_exporter.py +199 -0
  129. mingjing-0.11.9/src/plugin_runner.py +358 -0
  130. mingjing-0.11.9/src/plugins/__init__.py +0 -0
  131. mingjing-0.11.9/src/plugins/lit_lite/__init__.py +0 -0
  132. mingjing-0.11.9/src/plugins/lit_lite/lit_lite.skill.yaml +38 -0
  133. mingjing-0.11.9/src/plugins/web_dashboard/__init__.py +0 -0
  134. mingjing-0.11.9/src/plugins/web_dashboard/data.json +7247 -0
  135. mingjing-0.11.9/src/plugins/web_dashboard/index.html +969 -0
  136. mingjing-0.11.9/src/plugins/web_dashboard/server.py +1030 -0
  137. mingjing-0.11.9/src/plugins/web_dashboard/web_dashboard.skill.yaml +26 -0
  138. mingjing-0.11.9/src/plugins/web_dashboard/web_exporter.py +1830 -0
  139. mingjing-0.11.9/src/probe_go.go +265 -0
  140. mingjing-0.11.9/src/probe_integrity.py +127 -0
  141. mingjing-0.11.9/src/probe_node.js +201 -0
  142. mingjing-0.11.9/src/probe_platform.py +452 -0
  143. mingjing-0.11.9/src/probe_uni.py +366 -0
  144. mingjing-0.11.9/src/probe_validator.py +131 -0
  145. mingjing-0.11.9/src/query_bridge.py +375 -0
  146. mingjing-0.11.9/src/remedy_engine.py +207 -0
  147. mingjing-0.11.9/src/self_health.py +276 -0
  148. mingjing-0.11.9/src/triage.py +273 -0
  149. mingjing-0.11.9/src/watchdog.py +298 -0
  150. mingjing-0.11.9/src/webhook.py +85 -0
  151. mingjing-0.11.9/tests/test_ab_webhook_coverage.py +203 -0
  152. mingjing-0.11.9/tests/test_always_on.py +135 -0
  153. mingjing-0.11.9/tests/test_anchor_fingerprint.py +94 -0
  154. mingjing-0.11.9/tests/test_archiver_daemons.py +55 -0
  155. mingjing-0.11.9/tests/test_archiver_resilience.py +190 -0
  156. mingjing-0.11.9/tests/test_cli_integration.py +234 -0
  157. mingjing-0.11.9/tests/test_cli_submodules.py +183 -0
  158. mingjing-0.11.9/tests/test_cluster_e2e.py +402 -0
  159. mingjing-0.11.9/tests/test_config_selfhealth.py +188 -0
  160. mingjing-0.11.9/tests/test_disease_coverage.py +644 -0
  161. mingjing-0.11.9/tests/test_integration.py +112 -0
  162. mingjing-0.11.9/tests/test_langchain_health_integration.py +74 -0
  163. mingjing-0.11.9/tests/test_migrate.py +70 -0
  164. mingjing-0.11.9/tests/test_otel.py +262 -0
  165. mingjing-0.11.9/tests/test_plugin_pipeline.py +121 -0
  166. mingjing-0.11.9/tests/test_plugin_runner_p3.py +132 -0
  167. mingjing-0.11.9/tests/test_probe_autogpt_mock.py +117 -0
  168. mingjing-0.11.9/tests/test_probe_crewai_mock.py +124 -0
  169. mingjing-0.11.9/tests/test_probe_integrity.py +138 -0
  170. mingjing-0.11.9/tests/test_probe_langchain_callback.py +259 -0
  171. mingjing-0.11.9/tests/test_probe_langchain_mock.py +283 -0
  172. mingjing-0.11.9/tests/test_probe_lit_mock.py +84 -0
  173. mingjing-0.11.9/tests/test_probe_llamaindex_mock.py +122 -0
  174. mingjing-0.11.9/tests/test_probe_management.py +360 -0
  175. mingjing-0.11.9/tests/test_probe_opencode.py +462 -0
  176. mingjing-0.11.9/tests/test_probe_openhands_mock.py +130 -0
  177. mingjing-0.11.9/tests/test_probe_platform.py +118 -0
  178. mingjing-0.11.9/tests/test_probe_resilience.py +128 -0
  179. mingjing-0.11.9/tests/test_remedy_engine.py +251 -0
  180. mingjing-0.11.9/tests/test_stress_150k.py +286 -0
  181. mingjing-0.11.9/tests/test_stress_short.py +161 -0
  182. mingjing-0.11.9/tests/test_t01_to_t11.py +657 -0
  183. mingjing-0.11.9/tests/test_t30_to_t38.py +538 -0
  184. mingjing-0.11.9/tests/test_triage.py +296 -0
  185. mingjing-0.11.9/tests/test_v092_full.py +347 -0
  186. mingjing-0.11.9/tests/test_v092_integration.py +199 -0
  187. mingjing-0.11.9/tests/test_v093_cluster.py +165 -0
  188. mingjing-0.11.9/tests/test_v093_coverage.py +142 -0
  189. mingjing-0.11.9/tests/test_v093_perf.py +373 -0
  190. mingjing-0.11.9/tests/test_web_security.py +186 -0
  191. mingjing-0.11.9/updocs/00_/345/277/253/351/200/237/344/270/212/346/211/213.md +80 -0
  192. mingjing-0.11.9/updocs/01_/346/236/266/346/236/204/350/256/276/350/256/241.md +122 -0
  193. mingjing-0.11.9/updocs/02_/346/216/242/351/222/210/344/270/216/351/200/202/351/205/215/345/231/250.md +147 -0
  194. mingjing-0.11.9/updocs/03_/350/257/212/346/226/255/347/263/273/347/273/237.md +137 -0
  195. mingjing-0.11.9/updocs/04_/346/225/260/346/215/256/346/250/241/345/236/213.md +106 -0
  196. mingjing-0.11.9/updocs/05_/346/216/245/345/217/243/350/247/204/350/214/203.md +169 -0
  197. mingjing-0.11.9/updocs/06_/350/277/220/347/273/264/346/211/213/345/206/214.md +182 -0
  198. mingjing-0.11.9/updocs/07_/346/265/213/350/257/225/344/275/223/347/263/273.md +121 -0
  199. mingjing-0.11.9/updocs/08_/344/271/276/345/235/244/351/225/234OpenClaw/347/224/250/346/210/267/346/214/207/345/215/227.md +423 -0
  200. mingjing-0.11.9/updocs/README.md +119 -0
  201. mingjing-0.11.9/updocs/requirements.txt +5 -0
@@ -0,0 +1,165 @@
1
+ # Changelog
2
+
3
+ ## [v0.11.9m] — 2026-05-05
4
+
5
+ ### Added
6
+ - Probe management commands (`ming probe list` / `ming probe uninstall`)
7
+ - Safe probe uninstall: backup → stop observation → DB cleanup → file cleanup → VACUUM
8
+ - `--dry-run` mode previews uninstall without executing
9
+ - `--keep-data` flag retains DB records while stopping observation
10
+ - `--force` flag skips interactive confirmation
11
+ - Protected systems guard (`__admin__`, `__self_health__`, `__host__`, `unknown`)
12
+
13
+ ### Changed
14
+ - Version: 0.11.9-alpha → 0.11.9m
15
+
16
+ ## [v0.11.9-alpha] — 2026-05-05
17
+
18
+ ### Added
19
+ - Diagnosis timeline replay (`ming replay --system X --since 1h`)
20
+ - Environment-aware rule thresholds (container/VM/baremetal detection)
21
+ - CPU% calculation in probe_platform via `/proc/stat` jiffies delta
22
+ - `ming admin cleanup` command for stale events/diagnoses
23
+ - Healthbeat independent thread in Hermes plugin
24
+ - KNOWN_PROBES whitelist-based instance filtering (report + web dashboard)
25
+ - QueryBridge: 7 new methods + unified `/api/query` entry + 4 quick endpoints + CLI extensions
26
+ - Always-on mechanism for LIT diagnostics + 20 tusunsun diagnosis rules
27
+ - TLT-058 diagnosis enhancement + SYS-004 adaptive thresholds
28
+ - Resource footprint panel (web dashboard)
29
+ - OpenClaw probe enhancements
30
+
31
+ ### Fixed
32
+ - False Podman detection on bare-metal cgroups v2
33
+ - `unknown` system fallback in diagnosis source → `mingjing`
34
+ - Archiver self-measurement inflating CPU footprint in reports
35
+ - Frontend displaying `__host__`/`unknown`/`all` as instance cards
36
+ - Probe CPU showing 0.0% for `mingjing` system-level instance
37
+ - Web dashboard export thread import caching (added importlib.reload)
38
+ - `mingjing` not rendering as a card in web dashboard
39
+ - 10 diagnosis rule false positives
40
+ - 8 diagnosis rule false positives + orphan process cleanup
41
+ - 5 diagnosis rule SQL bugs
42
+ - LangChain adapter: langchain-core >= 1.0 compatibility (invoke entry patch)
43
+ - LangChain adapter: filled 6 diagnostic gaps (session_id, cache_hit, error, agent_step, relevance, embedding)
44
+ - Dashboard diagnosis caps display: verified 3 / inferred 9
45
+
46
+ ### Removed
47
+ - PRB-083 ("探针离线") and DQT-085 ("数据质量问题-探针缺失") — flawed rules assuming all probes must be online
48
+ - Triage Prism from frontend (replaced by instance card system)
49
+
50
+ ### Changed
51
+ - BSL 1.1 licensing: free for orgs with annual revenue <$100K USD
52
+ - Diseases.yaml rule count: 159 → 157
53
+ - Report/frontend filtering: blacklist → KNOWN_PROBES whitelist
54
+ - Documentation restructured for open-source release
55
+ - Memory optimization across archiver and hot rail processing
56
+
57
+ ## [v0.11.6] — 2026-05-01
58
+
59
+ ### Added
60
+ - Health center CLI: report reorder, ignore/archive/reset commands, instance list
61
+ - Health center web: health reset / archive / ignore trinity + probe status
62
+ - Hermes Agent: `./ming hermes-install` one-click installation + skill registration
63
+ - Web: hash chain break alerts can be dismissed (fixed alert_key + dismiss API)
64
+ - Hermes probe: independent healthbeat thread, `__anchor__` support
65
+ - Hermes probe: synthetic agent_step, OS sampling, event name mapping, deep extract
66
+ - Hermes probe: tool_input_hash + 4-prong strategy
67
+ - Web: system card shows per-system diagnosis count
68
+ - CLI: report added disease summary (dedup + inference chain), `dx list` shows cause
69
+ - Package: probe directory, requirements.txt, user guide, .gitignore
70
+
71
+ ### Refactored
72
+ - archiver.py 586→406 lines: split into schema/triage/score/util modules
73
+ - cli.py + lit_lite.py split for code size compliance
74
+ - CLI UX fixes: port handling, empty query, JSON consistency, time format
75
+ - P3 code style cleanup + probe dead code removal
76
+ - P2 performance/security/dead code optimization
77
+ - P2 archiver 3 tool modules split + P1 full security hardening
78
+ - P0/P1 full code audit: 28 P0 + 30 P1/P2 fixes
79
+
80
+ ### Changed
81
+ - Code budget: archiver.py limit relaxed to <410 lines (atomic transaction boundary)
82
+ - 5 test case fixes + cluster_archiver hash chain bug fix
83
+
84
+ ## [v0.11.5] — 2026-04-30
85
+
86
+ ### Added
87
+ - OpenClaw probe: enhanced event coverage and adapter stability
88
+ - Web dashboard: alert banner dismiss support + toast deduplication
89
+ - `__health__` / `__register__` / `__touch__` synchronized write to events table
90
+
91
+ ### Fixed
92
+ - SYS diagnosis rules: relaxed system filter + corrected field names
93
+ - `data.json` added to .gitignore (auto-generated runtime artifact)
94
+
95
+ ## [v0.11.4] — 2026-04-30
96
+
97
+ ### Added
98
+ - Full probe adapter coverage across all supported frameworks
99
+ - Configurable content truncation for large payloads
100
+ - End-to-end diagnosis pipeline: probe → archiver → diagnosis → web
101
+
102
+ ## [v0.11.3] — 2026-04-29
103
+
104
+ ### Added
105
+ - opencode probe: enhanced event extraction, embedding, and diagnosis gaps
106
+ - Diagnosis engine: improved rule matching and coverage
107
+
108
+ ### Performance
109
+ - Backfill batch write: 36K records from 75min → 1-2min
110
+
111
+ ## [v0.11.1] — 2026-04-28~29
112
+
113
+ ### Added
114
+ - Self-health detection system (Phase 1+2)
115
+ - Remedy engine decoupled from diagnostics
116
+ - Configuration management (Phase 3)
117
+ - Migration system (Phase 4)
118
+ - Privacy controls (Phase 5)
119
+ - OTEL bidirectional translation hub
120
+
121
+ ### Fixed
122
+ - 7 SQL schema issues in diseases.yaml (error_type → json_extract + JSON path fixes)
123
+ - 14 P0/P1 security fixes (exit mechanism, etc.)
124
+ - Code review fixes: obvious bugs + limit relaxations
125
+
126
+ ### Changed
127
+ - **Project renamed: Cosmoscope → Mingjing** — env vars, paths, CLI, deployment files updated
128
+ - Full code review: module structure optimization, redundancy cleanup, style unification
129
+ - MCP → LIT naming migration across codebase
130
+ - Web Dashboard filter enhancements
131
+
132
+ ## [v0.10.5] — 2026-04-29
133
+
134
+ ### Added
135
+ - OTEL bidirectional translation hub implementation
136
+ - Frontend alignment: web_exporter field completion, server.py version switching, new frontend activation
137
+ - Frontend i18n missing fields + diagnosis table header translation
138
+
139
+ ### Docs
140
+ - OTEL upgrade plan v1.0→v1.2 (3 revisions, expert feedback incorporated)
141
+ - Data dictionary and build specification updates
142
+
143
+ ## [v0.10.3] — 2026-04-28
144
+
145
+ ### Added
146
+ - Diagnosis enhancement Phase 1: 96 disease diagnosis & treatment list
147
+ - Adapter Phase 2: field completion, eliminated hardcoding, unified payload builders
148
+ - Benchmark: `bench_continuity.py` + test guide rewrite
149
+ - Smoke test + report generator + frontend Config read-only display + README tuning guide
150
+ - Archive success rate: 98% → 100%
151
+
152
+ ### Docs
153
+ - Diagnosis enhancement plan v1.0→v2.3 (3 revisions, expert opinions incorporated)
154
+ - Performance benchmark report (A: 15min×1000/s, B: 3min×5000/s)
155
+ - Complete documentation supplement
156
+
157
+ ## [v0.10] — 2026-04-27
158
+
159
+ ### Added
160
+ - M9: Open-source preparation complete
161
+ - M10: Production environment verification passed
162
+
163
+ ### Fixed
164
+ - Exit mechanism + 14 P0/P1 security issues
165
+ - mcp_received.jsonl added to .gitignore
@@ -0,0 +1,108 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ -----------------------------------------------------------------------------
7
+
8
+ Parameters
9
+
10
+ Licensor: Chenzheng (wulun811)
11
+
12
+ Licensed Work: 乾坤镜 (Ming) v0.11.9m
13
+ The Licensed Work is (c) 2026 Chenzheng (wulun811).
14
+
15
+ Additional Use Grant: You may make production use of the Licensed Work,
16
+ provided your company's (or organization's) total
17
+ annual gross revenue does not exceed USD 100,000
18
+ in the most recent fiscal year. Non-production use
19
+ (development, testing, evaluation) is permitted
20
+ without revenue restriction.
21
+
22
+ Change Date: 2030-12-31
23
+
24
+ Change License: Apache License, Version 2.0
25
+
26
+ For information about alternative licensing arrangements for the Licensed Work,
27
+ please visit the project's website or contact the Licensor.
28
+
29
+ -----------------------------------------------------------------------------
30
+
31
+ Notice
32
+
33
+ The Business Source License (this document, or the "License") is not an Open
34
+ Source license. However, the Licensed Work will eventually be made available
35
+ under an Open Source License, as stated in this License.
36
+
37
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
38
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
39
+
40
+ -----------------------------------------------------------------------------
41
+
42
+ Business Source License 1.1
43
+
44
+ Terms
45
+
46
+ The Licensor hereby grants you the right to copy, modify, create derivative
47
+ works, redistribute, and make non-production use of the Licensed Work. The
48
+ Licensor may make an Additional Use Grant, above, permitting limited production use.
49
+
50
+ Effective on the Change Date, or the fourth anniversary of the first publicly
51
+ available distribution of a specific version of the Licensed Work under this
52
+ License, whichever comes first, the Licensor hereby grants you rights under
53
+ the terms of the Change License, and the rights granted in the paragraph
54
+ above terminate.
55
+
56
+ If your use of the Licensed Work does not comply with the requirements
57
+ currently in effect as described in this License, you must purchase a
58
+ commercial license from the Licensor, its affiliated entities, or authorized
59
+ resellers, or you must refrain from using the Licensed Work.
60
+
61
+ All copies of the original and modified Licensed Work, and derivative works
62
+ of the Licensed Work, are subject to this License. This License applies
63
+ separately for each version of the Licensed Work and the Change Date may vary
64
+ for each version of the Licensed Work released by Licensor.
65
+
66
+ You must conspicuously display this License on each original or modified copy
67
+ of the Licensed Work. If you receive the Licensed Work in original or
68
+ modified form from a third party, the terms and conditions set forth in this
69
+ License apply to your use of that work.
70
+
71
+ Any use of the Licensed Work in violation of this License will automatically
72
+ terminate your rights under this License for the current and all other
73
+ versions of the Licensed Work.
74
+
75
+ This License does not grant you any right in any trademark or logo of
76
+ Licensor or its affiliates (provided that you may use a trademark or logo of
77
+ Licensor as expressly required by this License).
78
+
79
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
80
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
81
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
82
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
83
+ TITLE.
84
+
85
+ MariaDB hereby grants you permission to use this License's text to license
86
+ your works, and to refer to it using the trademark "Business Source License",
87
+ as long as you comply with the Covenants of Licensor below.
88
+
89
+ Covenants of Licensor
90
+
91
+ In consideration of the right to use this License's text and the "Business
92
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
93
+ other recipients of the licensed work to be provided by Licensor:
94
+
95
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
96
+ or a license that is compatible with GPL Version 2.0 or a later version,
97
+ where "compatible" means that software provided under the Change License can
98
+ be included in a program with software provided under GPL Version 2.0 or a
99
+ later version. Licensor may specify additional Change Licenses without
100
+ limitation.
101
+
102
+ 2. To either: (a) specify an additional grant of rights to use that does not
103
+ impose any additional restriction on the right granted in this License, as
104
+ the Additional Use Grant; or (b) insert the text "None".
105
+
106
+ 3. To specify a Change Date.
107
+
108
+ 4. Not to modify this License in any other way.
@@ -0,0 +1,12 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include setup.sh
5
+ graft config
6
+ graft filters
7
+ graft extensions
8
+ graft updocs
9
+ prune __pycache__
10
+ recursive-exclude *.pyc
11
+ recursive-exclude *.pyo
12
+ prune .git
@@ -0,0 +1,278 @@
1
+ Metadata-Version: 2.4
2
+ Name: mingjing
3
+ Version: 0.11.9
4
+ Summary: 乾坤镜 — AI Agent 诊断折射阵列
5
+ License-Expression: BUSL-1.1
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Dynamic: license-file
10
+
11
+ # 乾坤镜 Mingjing
12
+
13
+ > **AI Agent 诊断折射阵列** — 零侵入观测 LLM 调用、工具执行、记忆检索与 Agent 编排。
14
+
15
+ [![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
16
+ [![License](https://img.shields.io/badge/license-BUSL--1.1-green.svg)](LICENSE)
17
+ [![Version](https://img.shields.io/badge/version-0.11.9m-green.svg)](https://github.com/wulun811/Ming_qiankun/releases)
18
+
19
+ **乾坤镜是 LIT 1.4 的轻量折射阵列,不是独立诊断中台。** 它通过热轨 JSONL 文件 + SQLite/MySQL 持久层,为 LangChain、LlamaIndex、CrewAI、OpenHands、AutoGPT 等 Agent 框架提供无侵入的可观测性(部分适配器尚在适配中)。
20
+
21
+ ---
22
+
23
+ 📖 完整手册:请参阅 [updocs/](updocs/) 目录下的完整文档。
24
+
25
+ ## 5 分钟上手
26
+
27
+ ### 1. 克隆
28
+
29
+ ```bash
30
+ git clone https://github.com/wulun811/Ming_qiankun.git
31
+ cd Ming_qiankun
32
+ ```
33
+
34
+ ### 2. 运行(零依赖)
35
+
36
+ ```bash
37
+ # Standalone 模式 — 纯 Python 标准库,零第三方依赖
38
+ MING_MODE=standalone python src/ming.py start
39
+ ```
40
+
41
+ ### 3. 发射测试事件
42
+
43
+ > **注意**:以下命令必须在 `Ming_qiankun` 项目根目录执行。`sys.path.insert(0, 'src')` 是为让 Python 能找到探针模块。
44
+
45
+ ```bash
46
+ # 打开另一个终端,确保在项目根目录
47
+ python -c "
48
+ import sys; sys.path.insert(0, 'src')
49
+ from probe_uni import ProbeUni
50
+ p = ProbeUni(system='demo', mode='white')
51
+ p.emit('llm_invoke', {
52
+ 'layer_agent': {'step_id': 'test', 'session_id': 's1', 'agent_name': 'demo'},
53
+ 'layer_llm': {'model': 'gpt-4', 'input_tokens': 100, 'output_tokens': 50, 'latency_ms': 230, 'cache_hit': False},
54
+ 'layer_network': {'target_host': 'api.openai.com', 'status_code': 200}
55
+ })
56
+ print('Event emitted!')
57
+ "
58
+ ```
59
+
60
+ ### 4. 查看诊断
61
+
62
+ > **两个入口**:`src/ming.py` 负责服务管理(启动/停止归档器和 Web),`src/cli.py` 负责查询诊断。你也可以用 `python src/cli.py --help` 查看所有命令。
63
+
64
+ ```bash
65
+ python src/cli.py dx list
66
+ ```
67
+
68
+ ### 5. 查看 Web 目镜
69
+
70
+ ```bash
71
+ # 启动 Web 服务(自动导出 + 自动刷新,绑定 127.0.0.1:18088)
72
+ python src/ming.py web start
73
+
74
+ # 局域网访问(绑定 0.0.0.0)
75
+ python src/ming.py web start --port 18088
76
+ # 然后在 server 启动时手动指定 --host 0.0.0.0:
77
+ python src/plugins/web_dashboard/server.py --daemon --host 0.0.0.0 --port 18088 --no-browser
78
+
79
+ # 浏览器打开 http://localhost:18088 或 http://<本机IP>:18088
80
+ ```
81
+
82
+ **自动更新**:Web 服务内置每 30 秒自动导出 data.json + 前端自动刷新,无需手动执行 export 命令。
83
+
84
+ **局域网访问**:
85
+ | 场景 | 命令 | 浏览器地址 |
86
+ |------|------|-----------|
87
+ | 本机仅 | `python src/plugins/web_dashboard/server.py --daemon --port 18088` | `http://localhost:18088` |
88
+ | 局域网开放 | `python src/plugins/web_dashboard/server.py --daemon --host 0.0.0.0 --port 18088 --no-browser` | `http://<本机IP>:18088` |
89
+ | 加认证 | `python src/plugins/web_dashboard/server.py --daemon --host 0.0.0.0 --port 18088 --no-browser --token your-secret` | `http://<本机IP>:18088/?token=your-secret` |
90
+
91
+ ---
92
+
93
+ ## Docker 一键运行
94
+
95
+ ```bash
96
+ docker build -t ming .
97
+ docker run -d --name ming -p 18088:18088 ming
98
+ # 打开 http://localhost:18088
99
+ ```
100
+
101
+ ---
102
+
103
+ ## 架构概览
104
+
105
+ ```
106
+ ┌─────────────┐ JSONL hot files ┌──────────────┐
107
+ │ Probes │ ───────────────────────► │ Archiver │
108
+ │ (无状态) │ │ (唯一写入者) │
109
+ └─────────────┘ └──────┬───────┘
110
+ │ │
111
+ │ LangChain / LlamaIndex │ SQLite / MySQL
112
+ │ CrewAI / OpenHands ▼
113
+ │ AutoGPT / Hermes / MCP ┌──────────────┐
114
+ │ │ Query │
115
+ └────────────────────────────────►│ Bridge │
116
+ └──────┬───────┘
117
+
118
+ ┌─────▼─────┐
119
+ │ Web UI │
120
+ │ / MCP │
121
+ └───────────┘
122
+ ```
123
+
124
+ ### 核心模块
125
+
126
+ | 模块 | 行数 | 职责 |
127
+ |------|------|------|
128
+ | `probe_uni.py` | ~245 | 无状态热轨写入器,零数据库依赖 |
129
+ | `archiver.py` | ~465 | 唯一写入者,顺序扫描 hot → SQLite |
130
+ | `cli.py` | ~259 | 命令行:dx/health/skill/query/status/web |
131
+ | `watchdog.py` | ~163 | 进程守护 + 磁盘告警 |
132
+ | `query_bridge.py` | ~99 | 只读查询接口 |
133
+
134
+ ### 适配器(官方参考实现)
135
+
136
+ | 适配器 | 语言 | 事件类型 |
137
+ |--------|------|----------|
138
+ | LangChain | Python | llm_invoke, tool_call, memory_retrieve (待适配) |
139
+ | LlamaIndex | Python | llm_invoke, memory_retrieve, agent_step (待适配) |
140
+ | CrewAI | Python | agent_step, llm_invoke (待适配) |
141
+ | OpenHands | Python | agent_step, llm_invoke, tool_call (待适配) |
142
+ | AutoGPT | Python | agent_step, llm_invoke (待适配) |
143
+ | Hermes | Python | llm_invoke, tool_call, memory_retrieve |
144
+ | MCP | Python | tool_call, memory_retrieve, llm_invoke |
145
+
146
+ > 所有适配器采用 **monkey-patch + 零第三方依赖** 设计。未安装目标框架时静默降级,不影响主流程。使用第三方框架的适配器需额外安装对应框架。(标记"待适配"的为社区贡献方向,欢迎 PR。)
147
+
148
+ ---
149
+
150
+ ## 双模式
151
+
152
+ | 模式 | 环境变量 | 持久层 | 依赖 |
153
+ |------|----------|--------|------|
154
+ | **Standalone** | `MING_MODE=standalone`(默认) | SQLite | 纯标准库 |
155
+ | **Cluster** | `MING_MODE=cluster` | MySQL | pymysql |
156
+
157
+ ```bash
158
+ # Standalone(默认)
159
+ python src/ming.py start
160
+
161
+ # Cluster
162
+ MING_MODE=cluster \
163
+ WQ_DB_HOST=127.0.0.1 \
164
+ WQ_DB_USER=root \
165
+ WQ_DB_PASSWORD=secret \
166
+ WQ_DB_NAME=ming \
167
+ python src/ming.py start
168
+ ```
169
+
170
+ ---
171
+
172
+ ## 性能调参
173
+
174
+ Standalone 模式下,归档器默认处理 **1000 事件/秒**。通过环境变量可灵活调整:
175
+
176
+ | 环境变量 | 默认值 | 说明 | 典型场景 |
177
+ |----------|--------|------|----------|
178
+ | `WQ_ARCHIVER_BATCH_SIZE` | `1000` | 每次扫描的热轨文件数上限 | 高密度写入:`5000` |
179
+ | `WQ_ARCHIVER_FLUSH_SEC` | `1.0` | 扫描间隔(秒) | 低延迟要求:`0.5` |
180
+ | `WQ_ARCHIVER_VACUUM_HOURS` | `24` | VACUUM 间隔(小时) | 磁盘紧张时:`6` |
181
+
182
+ ### 场景推荐
183
+
184
+ ```bash
185
+ # 场景 1: 默认(大多数用户,1000 events/s)
186
+ MING_MODE=standalone python src/ming.py start
187
+
188
+ # 场景 2: 高吞吐(写入密集,~5000 events/s)
189
+ WQ_ARCHIVER_BATCH_SIZE=5000 \
190
+ WQ_ARCHIVER_FLUSH_SEC=0.5 \
191
+ MING_MODE=standalone python src/ming.py start
192
+
193
+ # 场景 3: 省电模式(低负载设备,~200 events/s)
194
+ WQ_ARCHIVER_BATCH_SIZE=200 \
195
+ WQ_ARCHIVER_FLUSH_SEC=5.0 \
196
+ MING_MODE=standalone python src/ming.py start
197
+ ```
198
+
199
+ > **提示**:调整参数后需重启归档器生效。前端 Config 面板可查看当前配置值(只读)。
200
+
201
+ ---
202
+
203
+ ## 运行测试
204
+
205
+ ```bash
206
+ # 全量测试
207
+ python -m pytest tests/ -v
208
+
209
+ # 仅适配器 Mock 测试
210
+ python -m pytest tests/test_probe_*_mock.py -v
211
+ ```
212
+
213
+ 当前状态:**389 passed, 2 skipped, 0 failed**
214
+
215
+ ---
216
+
217
+ ## 代码量预算
218
+
219
+ 乾坤镜采用分类预算制,配置见 [`config/budget.json`](config/budget.json):
220
+
221
+ | 分类 | 预算 | 说明 |
222
+ |------|------|------|
223
+ | core_base | 1,500 行 | 探针 + 归档器 + CLI + 查询 |
224
+ | cluster_extension | 600 行 | Cluster 扩展(可选) |
225
+ | plugin_layer | 1,000 行 | 插件层(可替换) |
226
+ | adapter_layer | 1,200 行 | 适配器 + 基类 |
227
+ | test_layer | 无上限 | 测试代码单独统计 |
228
+
229
+ ---
230
+
231
+ ## 目录结构
232
+
233
+ ```
234
+ ├── src/ # 源代码
235
+ │ ├── ming.py # 统一入口
236
+ │ ├── probe_uni.py # 探针
237
+ │ ├── archiver.py # 归档器
238
+ │ ├── cli.py # CLI
239
+ │ ├── adapters/ # 适配器
240
+ │ └── plugins/ # 插件
241
+ ├── tests/ # 测试
242
+ ├── config/ # 配置
243
+ │ └── budget.json # 代码量预算
244
+ ├── updocs/ # 文档(架构+探针+诊断+数据+接口+运维+测试)
245
+ └── .github/workflows/ # CI/CD
246
+ ```
247
+
248
+ ---
249
+
250
+ ## 贡献
251
+
252
+ 见 [CONTRIBUTING.md](CONTRIBUTING.md)。
253
+
254
+ ### 铁律(违反即 P0)
255
+
256
+ - **Standalone 零第三方依赖**:仅 Python 标准库
257
+ - **Cluster 唯一额外依赖**:仅 `pymysql`
258
+ - **探针纯粹**:`probe_uni.py` 不 import sqlite3/pymysql
259
+ - **唯一写入者**:只有归档器可写入持久层
260
+ - **只读对外**:查询模块使用只读连接
261
+
262
+ ---
263
+
264
+ ## 许可
265
+
266
+ Business Source License 1.1 — 全球年收入低于 10 万美元的公司和个人可免费生产使用。非生产用途(开发、测试、评估)无收入限制。详见 [LICENSE](LICENSE) 文件。
267
+
268
+ ---
269
+
270
+ ## 作者
271
+
272
+ - **陈正 (Chenzheng)** · [@wulun811](https://github.com/wulun811)
273
+ - 官方邮箱:zhulong007ai@163.com
274
+ - 灵感始于:**诛仙协议 / THEOCLAST Protocol (TCL)**
275
+
276
+ ---
277
+
278
+ **乾坤镜 v0.11.9m — 为社区而生。**