@sanqianx/project-knowledge 5.0.19 → 5.0.20

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 (200) hide show
  1. package/.agents/plugins/marketplace.json +3 -3
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/CHANGELOG.md +5 -0
  4. package/LICENSE +201 -201
  5. package/NOTICE +5 -5
  6. package/README.md +349 -349
  7. package/_modules/knowledge-engine/README.md +4 -0
  8. package/_modules/knowledge-engine/src/analysis-failures.js +39 -0
  9. package/_modules/knowledge-engine/src/analysis-worker.js +6 -2
  10. package/_modules/knowledge-engine/src/coordinator.js +7 -0
  11. package/_modules/knowledge-engine/src/headless-analyzer.js +2 -1
  12. package/_modules/knowledge-engine/src/server.js +1 -1
  13. package/_site/_test/agent-capture-mcp-ui-test.js +67 -67
  14. package/_site/_test/ai-profile-test.js +75 -75
  15. package/_site/_test/ai-vendor-presets-test.js +91 -91
  16. package/_site/_test/automatic-context-test.js +70 -70
  17. package/_site/_test/bin-cli-test.js +230 -230
  18. package/_site/_test/bridge-adapter-test.js +95 -95
  19. package/_site/_test/bridge-consumer-service-test.js +310 -310
  20. package/_site/_test/candidate-bin-content-test.js +35 -35
  21. package/_site/_test/candidate-product-assets-test.js +13 -13
  22. package/_site/_test/candidate-release-contract-test.js +14 -14
  23. package/_site/_test/capture-hook-dedup-test.js +158 -158
  24. package/_site/_test/claude-executable-discovery-test.js +28 -28
  25. package/_site/_test/claude-session-lifecycle-sweep-test.js +252 -252
  26. package/_site/_test/cli-instance-management-test.js +62 -62
  27. package/_site/_test/client-capture-restart-e2e-test.js +189 -189
  28. package/_site/_test/codex-conversation-projection-test.js +60 -60
  29. package/_site/_test/codex-marketplace-scoped-path-test.js +186 -186
  30. package/_site/_test/codex-notify-capture-e2e-test.js +101 -101
  31. package/_site/_test/codex-notify-fanout-test.js +134 -134
  32. package/_site/_test/codex-notify-upgrade-test.js +253 -253
  33. package/_site/_test/commit-boundary-freeze-test.js +147 -147
  34. package/_site/_test/commit-conversation-binding-test.js +4 -4
  35. package/_site/_test/configuration-generation-test.js +22 -22
  36. package/_site/_test/context-pack-test.js +200 -200
  37. package/_site/_test/conversation-api-test.js +10 -10
  38. package/_site/_test/conversation-origin-test.js +15 -15
  39. package/_site/_test/cross-repo-isolation-e2e-test.js +187 -187
  40. package/_site/_test/embedding-config-test.js +32 -32
  41. package/_site/_test/fixtures/fake-browser-exit.js +10 -10
  42. package/_site/_test/fixtures/fake-browser-hang.js +10 -10
  43. package/_site/_test/fixtures/integration-busy-worker.cjs +6 -6
  44. package/_site/_test/fixtures/make-git-repos.js +92 -92
  45. package/_site/_test/fixtures/retrieval-gold-queries.json +32 -32
  46. package/_site/_test/fresh-hook-reimport-test.js +53 -53
  47. package/_site/_test/fresh-product-data-test.js +56 -56
  48. package/_site/_test/git-path-compatibility-test.js +80 -80
  49. package/_site/_test/git-validation-test.js +81 -81
  50. package/_site/_test/hook-worktree-test.js +42 -42
  51. package/_site/_test/index-builder-test.js +41 -41
  52. package/_site/_test/index-error-display-contract-test.js +10 -10
  53. package/_site/_test/integration-adapters-test.js +67 -67
  54. package/_site/_test/integration-capture-setup-test.js +118 -118
  55. package/_site/_test/integration-runtime-binding-a2-test.js +566 -566
  56. package/_site/_test/integration-runtime-binding-a3-test.js +227 -227
  57. package/_site/_test/integration-runtime-binding-test.js +473 -473
  58. package/_site/_test/integration-status-scan-test.js +29 -29
  59. package/_site/_test/kb-framework-test.js +57 -57
  60. package/_site/_test/kbpath-follow-test.js +63 -63
  61. package/_site/_test/knowledge-db-test.js +144 -144
  62. package/_site/_test/knowledge-engine-client-test.js +109 -109
  63. package/_site/_test/knowledge-maintenance-test.js +40 -40
  64. package/_site/_test/knowledge-panel-ui-contract-test.js +112 -0
  65. package/_site/_test/knowledge-scopes-test.js +37 -37
  66. package/_site/_test/knowledge-storage-location-test.js +28 -28
  67. package/_site/_test/launcher-readiness-test.js +80 -80
  68. package/_site/_test/legacy-claude-session-alias-test.js +106 -106
  69. package/_site/_test/legacy-routes-removed-test.js +47 -47
  70. package/_site/_test/legacy-workbench-exclusion-test.js +92 -92
  71. package/_site/_test/live-gateway-test.js +48 -48
  72. package/_site/_test/local-marketplace-test.js +16 -16
  73. package/_site/_test/log-redaction-test.js +58 -58
  74. package/_site/_test/markdown-maintenance-test.js +11 -11
  75. package/_site/_test/model-context-windows-test.js +89 -89
  76. package/_site/_test/module-agent-start-proxy-test.js +65 -65
  77. package/_site/_test/module-artifact-integrity-test.js +27 -27
  78. package/_site/_test/module-boundary-test.js +30 -30
  79. package/_site/_test/module-bridge-eventbridge-test.js +202 -202
  80. package/_site/_test/module-dynamic-port-test.js +118 -118
  81. package/_site/_test/module-index-proxy-test.js +33 -33
  82. package/_site/_test/module-model-configuration-test.js +44 -44
  83. package/_site/_test/module-process-lifecycle-test.js +35 -35
  84. package/_site/_test/module-stream-proxy-test.js +34 -34
  85. package/_site/_test/module-terminal-restart-test.js +63 -63
  86. package/_site/_test/module-wiring-unbind-race-test.js +59 -59
  87. package/_site/_test/native-context-integrations-test.js +86 -86
  88. package/_site/_test/orphaned-claim-recovery-test.js +80 -80
  89. package/_site/_test/package-boundary-test.js +43 -42
  90. package/_site/_test/package-startup-test.js +56 -56
  91. package/_site/_test/packaged-ui-smoke-test.js +88 -88
  92. package/_site/_test/pr-consumer-contract-test.js +55 -55
  93. package/_site/_test/product-brand-contract-test.js +25 -25
  94. package/_site/_test/product-diagnostics-ui-test.js +93 -93
  95. package/_site/_test/product-import-ui-test.js +104 -104
  96. package/_site/_test/product-progress-status-test.js +12 -1
  97. package/_site/_test/project-remove-running-guard-test.js +79 -79
  98. package/_site/_test/project-store-test.js +90 -90
  99. package/_site/_test/registry-events-test.js +38 -38
  100. package/_site/_test/release-version-sync-test.js +115 -115
  101. package/_site/_test/requirement-binding-test.js +113 -113
  102. package/_site/_test/runtime-endpoint-test.js +64 -64
  103. package/_site/_test/scanner-test.js +83 -83
  104. package/_site/_test/server-security-test.js +96 -96
  105. package/_site/_test/sessions-stream-test.js +93 -93
  106. package/_site/_test/shared-scope-root-binding-test.js +67 -67
  107. package/_site/_test/simple-import-test.js +98 -98
  108. package/_site/_test/startup-analysis-disabled-test.js +6 -6
  109. package/_site/_test/team-knowledge-store-sparse-checkout-test.js +196 -196
  110. package/_site/_test/team-knowledge-store-test.js +132 -132
  111. package/_site/_test/test-server-cleanup-test.js +35 -35
  112. package/_site/_test/test-server-module-isolation-test.js +37 -37
  113. package/_site/_test/tracking-start-test.js +35 -35
  114. package/_site/_test/workbench-context-receipts-test.js +22 -22
  115. package/_site/_test/workspace-ui-contract-test.js +31 -31
  116. package/_site/_test/zcode-capture-integration-test.js +108 -108
  117. package/_site/lib/ai-vendor-presets.js +83 -83
  118. package/_site/lib/ai-workspace.js +3 -3
  119. package/_site/lib/atomic-file.js +204 -204
  120. package/_site/lib/bridge-adapter.js +260 -260
  121. package/_site/lib/capture-hook-config.js +108 -108
  122. package/_site/lib/claude-cli-runner.js +89 -89
  123. package/_site/lib/cli-instances.js +43 -43
  124. package/_site/lib/codex-context-status.js +17 -17
  125. package/_site/lib/codex-notify-config.js +193 -193
  126. package/_site/lib/commit-conversation-binder.js +12 -12
  127. package/_site/lib/commit-reconciler.js +38 -38
  128. package/_site/lib/context-pack-builder.js +299 -299
  129. package/_site/lib/conversation-exclusions.js +204 -204
  130. package/_site/lib/conversation-query-service.js +17 -17
  131. package/_site/lib/data-dir.js +13 -13
  132. package/_site/lib/embedding-service.js +85 -85
  133. package/_site/lib/engine-connection.js +93 -93
  134. package/_site/lib/engine-knowledge-client.js +72 -72
  135. package/_site/lib/folder-picker-output.js +3 -3
  136. package/_site/lib/git-path.js +14 -14
  137. package/_site/lib/github-team-store.js +3 -3
  138. package/_site/lib/index-builder.js +157 -157
  139. package/_site/lib/integration-status-scan.js +99 -99
  140. package/_site/lib/integration-status-worker.js +14 -14
  141. package/_site/lib/kb-framework.js +15 -15
  142. package/_site/lib/knowledge-db.js +363 -363
  143. package/_site/lib/knowledge-schema.js +121 -121
  144. package/_site/lib/live-gateway.js +78 -78
  145. package/_site/lib/llm-client.js +12 -12
  146. package/_site/lib/model-context-windows.js +82 -82
  147. package/_site/lib/module-bridge.js +874 -874
  148. package/_site/lib/module-port-resolver.js +57 -57
  149. package/_site/lib/post-commit-automation.js +54 -54
  150. package/_site/lib/product-data.js +35 -35
  151. package/_site/lib/project-lifecycle-service.js +14 -14
  152. package/_site/lib/project-registry-store.js +129 -129
  153. package/_site/lib/prompt-registry.js +148 -148
  154. package/_site/lib/registry-events.js +16 -16
  155. package/_site/lib/requirement-adapters.js +10 -10
  156. package/_site/lib/requirement-binder.js +112 -112
  157. package/_site/lib/runtime-control.js +89 -89
  158. package/_site/lib/runtime-endpoint.js +5 -5
  159. package/_site/lib/zcode-context-integration.js +60 -60
  160. package/_site/scripts/codex-notify-fanout.cjs +95 -95
  161. package/_site/scripts/install-module-candidates.js +69 -69
  162. package/_site/scripts/pack-module-candidates.js +89 -89
  163. package/_site/scripts/sync-product-content.js +28 -28
  164. package/_site/scripts/sync-release-version.js +164 -164
  165. package/_site/scripts/vendor-modules.js +49 -49
  166. package/_site/scripts/verify-module-runtime.js +50 -50
  167. package/_site/scripts/verify-product-runtime.js +36 -36
  168. package/_site/scripts/verify-retrieval-gold.js +83 -83
  169. package/_site/server.js +15 -15
  170. package/_site/start.bat +26 -26
  171. package/_site/stop.bat +11 -11
  172. package/bin/project-knowledge-integrations.js +254 -254
  173. package/bin/project-knowledge-kb.js +67 -67
  174. package/bin/project-knowledge-mcp.js +8 -8
  175. package/bin/project-knowledge.js +170 -170
  176. package/claude-prompts.json +21 -21
  177. package/docs/README.zh-CN.md +205 -205
  178. package/docs/assets/architecture.svg +181 -181
  179. package/docs/assets/logo.svg +49 -49
  180. package/docs/fresh-v5-start.md +42 -42
  181. package/docs/leader-glm-workbench-playbook.md +122 -122
  182. package/docs/project-registry-schema.md +11 -11
  183. package/docs/release-5.0.16-acceptance.md +176 -176
  184. package/docs/release-5.0.17-acceptance.md +117 -117
  185. package/docs/release-5.0.19-acceptance.md +39 -25
  186. package/docs/team-knowledge-mode-a-plan.md +73 -73
  187. package/module-runtime-manifest.json +53 -33
  188. package/package.json +3 -2
  189. package/plugins/project-knowledge/.claude-plugin/plugin.json +1 -1
  190. package/plugins/project-knowledge/.codex-plugin/plugin.json +1 -1
  191. package/plugins/project-knowledge/.mcp.json +1 -1
  192. package/plugins/project-knowledge/opencode/project-knowledge.md +3 -3
  193. package/plugins/project-knowledge/skills/project-knowledge/SKILL.md +28 -28
  194. package/templates/change.md +30 -30
  195. package/templates/project-readme.md +18 -18
  196. package/ui/index.html +1 -1
  197. package/ui/knowledge-panel.html +118 -0
  198. package/ui/product.css +8 -0
  199. package/ui/product.js +146 -4
  200. package/vendor-manifest.json +55 -54
@@ -1,182 +1,182 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1180 620" role="img" aria-label="Architecture">
2
- <defs>
3
- <linearGradient id="card" x1="0" y1="0" x2="0" y2="1">
4
- <stop offset="0" stop-color="#1a2330"/>
5
- <stop offset="1" stop-color="#141c26"/>
6
- </linearGradient>
7
- <linearGradient id="cardHover" x1="0" y1="0" x2="0" y2="1">
8
- <stop offset="0" stop-color="#1f2a3a"/>
9
- <stop offset="1" stop-color="#192331"/>
10
- </linearGradient>
11
- <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
12
- <path d="M 0 0 L 10 5 L 0 10 z" fill="#7492a5"/>
13
- </marker>
14
- </defs>
15
-
16
- <rect width="1180" height="620" fill="#0c1118"/>
17
-
18
- <!-- Title -->
19
- <text x="590" y="42" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="17" font-weight="600" fill="#e3ebf5" letter-spacing="-0.2">How project-knowledge works</text>
20
- <text x="590" y="62" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="11.5" fill="#94a3b8">Local-first pipeline · every byte stays under your home directory</text>
21
-
22
- <!-- Layer labels -->
23
- <g font-family="ui-monospace, Consolas, monospace" font-size="9.5" fill="#64748b" letter-spacing="1.5" font-weight="600">
24
- <text x="28" y="150">USER · UI</text>
25
- <text x="28" y="282">SERVER</text>
26
- <text x="28" y="438">DATA · GIT</text>
27
- <text x="28" y="582">EXTERNAL</text>
28
- </g>
29
-
30
- <!-- Layer 1: User-facing -->
31
- <g transform="translate(120,86)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
32
- <g>
33
- <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
34
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Browser Dashboard</text>
35
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">127.0.0.1:5757</text>
36
- <g font-size="10.5" fill="#94a3b8">
37
- <text x="16" y="60">· Project sidebar</text>
38
- <text x="16" y="76">· Supervision cards</text>
39
- <text x="16" y="92">· Runs / Drafts review</text>
40
- <text x="16" y="108">· Claude workbench</text>
41
- </g>
42
- </g>
43
-
44
- <g transform="translate(264,0)">
45
- <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
46
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">CLI daemon</text>
47
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">start · stop · status · --fg</text>
48
- <g font-size="10.5" fill="#94a3b8">
49
- <text x="16" y="60">· Port fallback 5757–5776</text>
50
- <text x="16" y="76">· PID file in os.tmpdir()</text>
51
- <text x="16" y="92">· Auto-open browser</text>
52
- <text x="16" y="108">· Survives terminal close</text>
53
- </g>
54
- </g>
55
-
56
- <g transform="translate(528,0)">
57
- <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
58
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Post-commit hook</text>
59
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">.git/hooks/post-commit</text>
60
- <g font-size="10.5" fill="#94a3b8">
61
- <text x="16" y="60">· Fires on git commit</text>
62
- <text x="16" y="76">· Triggers scan + analysis</text>
63
- <text x="16" y="92">· Injects KB reading rule</text>
64
- <text x="16" y="108"> into project's CLAUDE.md</text>
65
- </g>
66
- </g>
67
-
68
- <g transform="translate(792,0)">
69
- <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
70
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Claude Code / agents</text>
71
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">reads KB indexes first</text>
72
- <g font-size="10.5" fill="#94a3b8">
73
- <text x="16" y="60">· Reads GOAL.md</text>
74
- <text x="16" y="76">· Reads modules/00-index.md</text>
75
- <text x="16" y="92">· Reads changes/00-index.md</text>
76
- <text x="16" y="108">· Opens only top-matched files</text>
77
- </g>
78
- </g>
79
- </g>
80
-
81
- <!-- Layer 2: Server -->
82
- <g transform="translate(120,220)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
83
- <rect width="1044" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
84
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Local HTTP server · Node.js · 127.0.0.1 only</text>
85
-
86
- <g font-size="10">
87
- <g transform="translate(16,40)">
88
- <rect width="148" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
89
- <text x="74" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">scanner.js</text>
90
- <text x="74" y="26" font-size="9" fill="#64748b" text-anchor="middle">git state walker</text>
91
- </g>
92
- <g transform="translate(176,40)">
93
- <rect width="170" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
94
- <text x="85" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">analysis-orchestrator</text>
95
- <text x="85" y="26" font-size="9" fill="#64748b" text-anchor="middle">commit / initial</text>
96
- </g>
97
- <g transform="translate(358,40)">
98
- <rect width="160" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
99
- <text x="80" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">context-pack-builder</text>
100
- <text x="80" y="26" font-size="9" fill="#64748b" text-anchor="middle">prompt assembly</text>
101
- </g>
102
- <g transform="translate(530,40)">
103
- <rect width="132" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
104
- <text x="66" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">kb-framework</text>
105
- <text x="66" y="26" font-size="9" fill="#64748b" text-anchor="middle">layout / validate</text>
106
- </g>
107
- <g transform="translate(674,40)">
108
- <rect width="120" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
109
- <text x="60" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">draft-apply</text>
110
- <text x="60" y="26" font-size="9" fill="#64748b" text-anchor="middle">review / merge</text>
111
- </g>
112
- <g transform="translate(806,40)">
113
- <rect width="222" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
114
- <text x="111" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">github-team-store</text>
115
- <text x="111" y="26" font-size="9" fill="#64748b" text-anchor="middle">Gitea OAuth · sparse checkout</text>
116
- </g>
117
- </g>
118
- <text x="16" y="100" font-size="10" font-family="ui-monospace, Consolas, monospace" fill="#64748b">REST + WebSocket on a single port · SPA shell from _site/index.html</text>
119
- </g>
120
-
121
- <!-- Layer 3: Data + git -->
122
- <g transform="translate(120,376)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
123
- <g>
124
- <rect width="252" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
125
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">~/.project-knowledge/</text>
126
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">or $KB_DATA_DIR</text>
127
- <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
128
- <text x="16" y="62">projects.json</text>
129
- <text x="16" y="78">ai-profiles.json</text>
130
- <text x="16" y="94">knowledge-store.json</text>
131
- <text x="16" y="110">logs/ · _ai/ · projects/</text>
132
- </g>
133
- </g>
134
- <g transform="translate(264,0)">
135
- <rect width="252" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
136
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Your Git projects</text>
137
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">local paths · local repos</text>
138
- <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
139
- <text x="16" y="62">git status / log / branch</text>
140
- <text x="16" y="78">HEAD metadata</text>
141
- <text x="16" y="94">.git/hooks/post-commit</text>
142
- <text x="16" y="110">CLAUDE.md (managed block)</text>
143
- </g>
144
- </g>
145
- <g transform="translate(528,0)">
146
- <rect width="636" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
147
- <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Generated knowledge base (per project)</text>
148
- <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">bilingual · module + change docs · reviewed drafts only</text>
149
- <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
150
- <text x="16" y="62"> &lt;kbPath&gt;/GOAL.md</text>
151
- <text x="16" y="78"> modules/00-index.md · changes/00-index.md</text>
152
- <text x="16" y="94"> modules/&lt;area&gt;.md · changes/release-v*.md</text>
153
- <text x="16" y="110"> drafts/&lt;pending&gt;.md (reviewable before apply)</text>
154
- </g>
155
- </g>
156
- </g>
157
-
158
- <!-- Layer 4: External -->
159
- <g transform="translate(120,520)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
160
- <rect width="1044" height="44" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
161
- <text x="16" y="20" font-size="12" font-weight="600" fill="#cbd5e1">Anthropic-compatible LLM API</text>
162
- <text x="200" y="20" font-size="10.5" fill="#94a3b8" font-family="ui-monospace, Consolas, monospace">Claude · GLM · DeepSeek · Kimi · self-hosted — any provider exposing the Anthropic Messages API shape</text>
163
- <text x="200" y="36" font-size="9.5" fill="#64748b">Keys stored locally in ai-profiles.json · never leave your machine except in the request body itself</text>
164
- </g>
165
-
166
- <!-- Connectors -->
167
- <g stroke="#7492a5" stroke-width="1.2" fill="none" marker-end="url(#arrow)" opacity="0.55">
168
- <!-- User -> Server -->
169
- <line x1="246" y1="202" x2="246" y2="216"/>
170
- <line x1="510" y1="202" x2="510" y2="216"/>
171
- <line x1="774" y1="202" x2="774" y2="216"/>
172
- <!-- Server -> Data -->
173
- <line x1="246" y1="344" x2="246" y2="372"/>
174
- <line x1="510" y1="344" x2="510" y2="372"/>
175
- <line x1="774" y1="344" x2="774" y2="372"/>
176
- <!-- Server -> External -->
177
- <line x1="640" y1="344" x2="640" y2="516"/>
178
- <!-- User agents <-> Server (read KB) -->
179
- <line x1="918" y1="202" x2="918" y2="216"/>
180
- <line x1="918" y1="468" x2="918" y2="496" stroke-dasharray="3,3" opacity="0.4"/>
181
- </g>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1180 620" role="img" aria-label="Architecture">
2
+ <defs>
3
+ <linearGradient id="card" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0" stop-color="#1a2330"/>
5
+ <stop offset="1" stop-color="#141c26"/>
6
+ </linearGradient>
7
+ <linearGradient id="cardHover" x1="0" y1="0" x2="0" y2="1">
8
+ <stop offset="0" stop-color="#1f2a3a"/>
9
+ <stop offset="1" stop-color="#192331"/>
10
+ </linearGradient>
11
+ <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
12
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#7492a5"/>
13
+ </marker>
14
+ </defs>
15
+
16
+ <rect width="1180" height="620" fill="#0c1118"/>
17
+
18
+ <!-- Title -->
19
+ <text x="590" y="42" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="17" font-weight="600" fill="#e3ebf5" letter-spacing="-0.2">How project-knowledge works</text>
20
+ <text x="590" y="62" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="11.5" fill="#94a3b8">Local-first pipeline · every byte stays under your home directory</text>
21
+
22
+ <!-- Layer labels -->
23
+ <g font-family="ui-monospace, Consolas, monospace" font-size="9.5" fill="#64748b" letter-spacing="1.5" font-weight="600">
24
+ <text x="28" y="150">USER · UI</text>
25
+ <text x="28" y="282">SERVER</text>
26
+ <text x="28" y="438">DATA · GIT</text>
27
+ <text x="28" y="582">EXTERNAL</text>
28
+ </g>
29
+
30
+ <!-- Layer 1: User-facing -->
31
+ <g transform="translate(120,86)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
32
+ <g>
33
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
34
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Browser Dashboard</text>
35
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">127.0.0.1:5757</text>
36
+ <g font-size="10.5" fill="#94a3b8">
37
+ <text x="16" y="60">· Project sidebar</text>
38
+ <text x="16" y="76">· Supervision cards</text>
39
+ <text x="16" y="92">· Runs / Drafts review</text>
40
+ <text x="16" y="108">· Claude workbench</text>
41
+ </g>
42
+ </g>
43
+
44
+ <g transform="translate(264,0)">
45
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
46
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">CLI daemon</text>
47
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">start · stop · status · --fg</text>
48
+ <g font-size="10.5" fill="#94a3b8">
49
+ <text x="16" y="60">· Port fallback 5757–5776</text>
50
+ <text x="16" y="76">· PID file in os.tmpdir()</text>
51
+ <text x="16" y="92">· Auto-open browser</text>
52
+ <text x="16" y="108">· Survives terminal close</text>
53
+ </g>
54
+ </g>
55
+
56
+ <g transform="translate(528,0)">
57
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
58
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Post-commit hook</text>
59
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">.git/hooks/post-commit</text>
60
+ <g font-size="10.5" fill="#94a3b8">
61
+ <text x="16" y="60">· Fires on git commit</text>
62
+ <text x="16" y="76">· Triggers scan + analysis</text>
63
+ <text x="16" y="92">· Injects KB reading rule</text>
64
+ <text x="16" y="108"> into project's CLAUDE.md</text>
65
+ </g>
66
+ </g>
67
+
68
+ <g transform="translate(792,0)">
69
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
70
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Claude Code / agents</text>
71
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">reads KB indexes first</text>
72
+ <g font-size="10.5" fill="#94a3b8">
73
+ <text x="16" y="60">· Reads GOAL.md</text>
74
+ <text x="16" y="76">· Reads modules/00-index.md</text>
75
+ <text x="16" y="92">· Reads changes/00-index.md</text>
76
+ <text x="16" y="108">· Opens only top-matched files</text>
77
+ </g>
78
+ </g>
79
+ </g>
80
+
81
+ <!-- Layer 2: Server -->
82
+ <g transform="translate(120,220)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
83
+ <rect width="1044" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
84
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Local HTTP server · Node.js · 127.0.0.1 only</text>
85
+
86
+ <g font-size="10">
87
+ <g transform="translate(16,40)">
88
+ <rect width="148" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
89
+ <text x="74" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">scanner.js</text>
90
+ <text x="74" y="26" font-size="9" fill="#64748b" text-anchor="middle">git state walker</text>
91
+ </g>
92
+ <g transform="translate(176,40)">
93
+ <rect width="170" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
94
+ <text x="85" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">analysis-orchestrator</text>
95
+ <text x="85" y="26" font-size="9" fill="#64748b" text-anchor="middle">commit / initial</text>
96
+ </g>
97
+ <g transform="translate(358,40)">
98
+ <rect width="160" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
99
+ <text x="80" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">context-pack-builder</text>
100
+ <text x="80" y="26" font-size="9" fill="#64748b" text-anchor="middle">prompt assembly</text>
101
+ </g>
102
+ <g transform="translate(530,40)">
103
+ <rect width="132" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
104
+ <text x="66" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">kb-framework</text>
105
+ <text x="66" y="26" font-size="9" fill="#64748b" text-anchor="middle">layout / validate</text>
106
+ </g>
107
+ <g transform="translate(674,40)">
108
+ <rect width="120" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
109
+ <text x="60" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">draft-apply</text>
110
+ <text x="60" y="26" font-size="9" fill="#64748b" text-anchor="middle">review / merge</text>
111
+ </g>
112
+ <g transform="translate(806,40)">
113
+ <rect width="222" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
114
+ <text x="111" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">github-team-store</text>
115
+ <text x="111" y="26" font-size="9" fill="#64748b" text-anchor="middle">Gitea OAuth · sparse checkout</text>
116
+ </g>
117
+ </g>
118
+ <text x="16" y="100" font-size="10" font-family="ui-monospace, Consolas, monospace" fill="#64748b">REST + WebSocket on a single port · SPA shell from _site/index.html</text>
119
+ </g>
120
+
121
+ <!-- Layer 3: Data + git -->
122
+ <g transform="translate(120,376)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
123
+ <g>
124
+ <rect width="252" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
125
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">~/.project-knowledge/</text>
126
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">or $KB_DATA_DIR</text>
127
+ <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
128
+ <text x="16" y="62">projects.json</text>
129
+ <text x="16" y="78">ai-profiles.json</text>
130
+ <text x="16" y="94">knowledge-store.json</text>
131
+ <text x="16" y="110">logs/ · _ai/ · projects/</text>
132
+ </g>
133
+ </g>
134
+ <g transform="translate(264,0)">
135
+ <rect width="252" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
136
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Your Git projects</text>
137
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">local paths · local repos</text>
138
+ <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
139
+ <text x="16" y="62">git status / log / branch</text>
140
+ <text x="16" y="78">HEAD metadata</text>
141
+ <text x="16" y="94">.git/hooks/post-commit</text>
142
+ <text x="16" y="110">CLAUDE.md (managed block)</text>
143
+ </g>
144
+ </g>
145
+ <g transform="translate(528,0)">
146
+ <rect width="636" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
147
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Generated knowledge base (per project)</text>
148
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">bilingual · module + change docs · reviewed drafts only</text>
149
+ <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
150
+ <text x="16" y="62"> &lt;kbPath&gt;/GOAL.md</text>
151
+ <text x="16" y="78"> modules/00-index.md · changes/00-index.md</text>
152
+ <text x="16" y="94"> modules/&lt;area&gt;.md · changes/release-v*.md</text>
153
+ <text x="16" y="110"> drafts/&lt;pending&gt;.md (reviewable before apply)</text>
154
+ </g>
155
+ </g>
156
+ </g>
157
+
158
+ <!-- Layer 4: External -->
159
+ <g transform="translate(120,520)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
160
+ <rect width="1044" height="44" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
161
+ <text x="16" y="20" font-size="12" font-weight="600" fill="#cbd5e1">Anthropic-compatible LLM API</text>
162
+ <text x="200" y="20" font-size="10.5" fill="#94a3b8" font-family="ui-monospace, Consolas, monospace">Claude · GLM · DeepSeek · Kimi · self-hosted — any provider exposing the Anthropic Messages API shape</text>
163
+ <text x="200" y="36" font-size="9.5" fill="#64748b">Keys stored locally in ai-profiles.json · never leave your machine except in the request body itself</text>
164
+ </g>
165
+
166
+ <!-- Connectors -->
167
+ <g stroke="#7492a5" stroke-width="1.2" fill="none" marker-end="url(#arrow)" opacity="0.55">
168
+ <!-- User -> Server -->
169
+ <line x1="246" y1="202" x2="246" y2="216"/>
170
+ <line x1="510" y1="202" x2="510" y2="216"/>
171
+ <line x1="774" y1="202" x2="774" y2="216"/>
172
+ <!-- Server -> Data -->
173
+ <line x1="246" y1="344" x2="246" y2="372"/>
174
+ <line x1="510" y1="344" x2="510" y2="372"/>
175
+ <line x1="774" y1="344" x2="774" y2="372"/>
176
+ <!-- Server -> External -->
177
+ <line x1="640" y1="344" x2="640" y2="516"/>
178
+ <!-- User agents <-> Server (read KB) -->
179
+ <line x1="918" y1="202" x2="918" y2="216"/>
180
+ <line x1="918" y1="468" x2="918" y2="496" stroke-dasharray="3,3" opacity="0.4"/>
181
+ </g>
182
182
  </svg>
@@ -1,50 +1,50 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 160" role="img" aria-label="project-knowledge logo">
2
- <defs>
3
- <linearGradient id="bg" x1="0" y1="0" x2="560" y2="160" gradientUnits="userSpaceOnUse">
4
- <stop offset="0" stop-color="#0c1118"/>
5
- <stop offset="1" stop-color="#141c26"/>
6
- </linearGradient>
7
- <linearGradient id="core" x1="80" y1="40" x2="120" y2="120" gradientUnits="userSpaceOnUse">
8
- <stop offset="0" stop-color="#dff8ff"/>
9
- <stop offset=".55" stop-color="#7dd3fc"/>
10
- <stop offset="1" stop-color="#2f7d64"/>
11
- </linearGradient>
12
- <linearGradient id="book" x1="78" y1="92" x2="148" y2="128" gradientUnits="userSpaceOnUse">
13
- <stop offset="0" stop-color="#f8fafc"/>
14
- <stop offset="1" stop-color="#b8c6d8"/>
15
- </linearGradient>
16
- <filter id="glow" x="-40%" y="-40%" width="180%" height="180%">
17
- <feGaussianBlur stdDeviation="3.5"/>
18
- </filter>
19
- </defs>
20
- <rect width="560" height="160" rx="18" fill="url(#bg)"/>
21
- <!-- Logo mark -->
22
- <g transform="translate(36,28)">
23
- <!-- Glow halo -->
24
- <circle cx="60" cy="52" r="42" fill="#7492a5" opacity="0.18" filter="url(#glow)"/>
25
- <!-- Book base -->
26
- <path d="M22 78 L98 78 L98 118 Q60 110 22 118 Z" fill="url(#book)" opacity="0.92"/>
27
- <path d="M60 84 L60 116" stroke="#7492a5" stroke-width="1.2" opacity="0.55"/>
28
- <!-- Core orb -->
29
- <circle cx="60" cy="52" r="26" fill="url(#core)"/>
30
- <!-- Orbiting nodes -->
31
- <circle cx="60" cy="14" r="4.5" fill="#7dd3fc"/>
32
- <circle cx="100" cy="36" r="4.5" fill="#75b798"/>
33
- <circle cx="100" cy="68" r="4.5" fill="#c5a15d"/>
34
- <circle cx="20" cy="36" r="4.5" fill="#60a5fa"/>
35
- <circle cx="20" cy="68" r="4.5" fill="#d36d6d"/>
36
- <!-- Connectors -->
37
- <g stroke="#7492a5" stroke-width="1.1" opacity="0.55" fill="none">
38
- <line x1="60" y1="14" x2="60" y2="26"/>
39
- <line x1="100" y1="36" x2="84" y2="46"/>
40
- <line x1="100" y1="68" x2="84" y2="58"/>
41
- <line x1="20" y1="36" x2="36" y2="46"/>
42
- <line x1="20" y1="68" x2="36" y2="58"/>
43
- </g>
44
- </g>
45
- <!-- Wordmark -->
46
- <g transform="translate(184,52)" fill="#e3ebf5" font-family="-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif">
47
- <text x="0" y="28" font-size="34" font-weight="700" letter-spacing="-0.5">project-knowledge</text>
48
- <text x="2" y="58" font-size="15" font-weight="500" fill="#7492a5" letter-spacing="0.5">Local KB · Git-aware · AI-reviewed</text>
49
- </g>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 160" role="img" aria-label="project-knowledge logo">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="560" y2="160" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#0c1118"/>
5
+ <stop offset="1" stop-color="#141c26"/>
6
+ </linearGradient>
7
+ <linearGradient id="core" x1="80" y1="40" x2="120" y2="120" gradientUnits="userSpaceOnUse">
8
+ <stop offset="0" stop-color="#dff8ff"/>
9
+ <stop offset=".55" stop-color="#7dd3fc"/>
10
+ <stop offset="1" stop-color="#2f7d64"/>
11
+ </linearGradient>
12
+ <linearGradient id="book" x1="78" y1="92" x2="148" y2="128" gradientUnits="userSpaceOnUse">
13
+ <stop offset="0" stop-color="#f8fafc"/>
14
+ <stop offset="1" stop-color="#b8c6d8"/>
15
+ </linearGradient>
16
+ <filter id="glow" x="-40%" y="-40%" width="180%" height="180%">
17
+ <feGaussianBlur stdDeviation="3.5"/>
18
+ </filter>
19
+ </defs>
20
+ <rect width="560" height="160" rx="18" fill="url(#bg)"/>
21
+ <!-- Logo mark -->
22
+ <g transform="translate(36,28)">
23
+ <!-- Glow halo -->
24
+ <circle cx="60" cy="52" r="42" fill="#7492a5" opacity="0.18" filter="url(#glow)"/>
25
+ <!-- Book base -->
26
+ <path d="M22 78 L98 78 L98 118 Q60 110 22 118 Z" fill="url(#book)" opacity="0.92"/>
27
+ <path d="M60 84 L60 116" stroke="#7492a5" stroke-width="1.2" opacity="0.55"/>
28
+ <!-- Core orb -->
29
+ <circle cx="60" cy="52" r="26" fill="url(#core)"/>
30
+ <!-- Orbiting nodes -->
31
+ <circle cx="60" cy="14" r="4.5" fill="#7dd3fc"/>
32
+ <circle cx="100" cy="36" r="4.5" fill="#75b798"/>
33
+ <circle cx="100" cy="68" r="4.5" fill="#c5a15d"/>
34
+ <circle cx="20" cy="36" r="4.5" fill="#60a5fa"/>
35
+ <circle cx="20" cy="68" r="4.5" fill="#d36d6d"/>
36
+ <!-- Connectors -->
37
+ <g stroke="#7492a5" stroke-width="1.1" opacity="0.55" fill="none">
38
+ <line x1="60" y1="14" x2="60" y2="26"/>
39
+ <line x1="100" y1="36" x2="84" y2="46"/>
40
+ <line x1="100" y1="68" x2="84" y2="58"/>
41
+ <line x1="20" y1="36" x2="36" y2="46"/>
42
+ <line x1="20" y1="68" x2="36" y2="58"/>
43
+ </g>
44
+ </g>
45
+ <!-- Wordmark -->
46
+ <g transform="translate(184,52)" fill="#e3ebf5" font-family="-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif">
47
+ <text x="0" y="28" font-size="34" font-weight="700" letter-spacing="-0.5">project-knowledge</text>
48
+ <text x="2" y="58" font-size="15" font-weight="500" fill="#7492a5" letter-spacing="0.5">Local KB · Git-aware · AI-reviewed</text>
49
+ </g>
50
50
  </svg>
@@ -1,42 +1,42 @@
1
- # v5 从头开始
2
-
3
- 本版按用户确认不再迁移以前的知识库数据。旧文件留在原位置,但新版不会读取它们;没有对用户代码仓库或旧知识目录执行删除。
4
-
5
- ## 更新
6
-
7
- ```bash
8
- project-knowledge stop
9
- npm install -g @sanqianx/project-knowledge@latest --registry=https://registry.npmjs.org/
10
- project-knowledge-integrations update
11
- project-knowledge
12
- ```
13
-
14
- 需要 Node ≥22 和 Git。默认使用 `~/.project-knowledge-v5`,四模块的托管数据也在此目录内。若环境变量 `KB_DATA_DIR` 仍指向旧目录,请取消该设置或改为新的空目录。不要把旧 `projects.json`、设置或引擎状态复制进新目录。
15
-
16
- 5.0.6 修复首次启动被未登记的旧工作台会话误拦截:仅有日志、默认提示词及孤立会话的目录可以创建空的新登记,孤立会话保留原字节但不会恢复或触发任务。实际旧项目、设置、引擎状态或维护任务仍拒绝迁移,错误列出具体目录和冲突项。后台启动命令等待 HTTP 就绪后才报成功;启动失败直接在终端显示原因并返回非零退出码,不提前打开浏览器。
17
-
18
- 在“系统状态”重新配置模型与后台默认模型、embedding 和知识根目录,然后在“领域与项目”导入代码目录及新的空知识目录。原代码目录无需移动。若残留旧知识库托管 Hook,导入预检会要求明确确认替换;不会覆盖第三方 Hook。导入建立 HEAD 基线,不分析已有历史。
19
-
20
- 如果模块是自己独立启动的旧进程,请在它原来的终端中停止后重启新版外壳。外壳不会擅自杀死其他服务;版本或运行期鉴权不一致时显示具体连接阶段,不接管旧服务数据。
21
-
22
- 5.0.1 修复旧版 Git 的项目导入失败(日志中的路径包含
23
- `--path-format=absolute` 和换行)。升级 5.0.0 → 5.0.1 不需要清空新版数据或
24
- 重新配置模型。失败项目可以直接重试导入;原代码、第三方 Hook 与旧知识文件不删除。
25
- 导入失败会在弹窗保留错误码和操作 ID,系统诊断默认查询“系统与所有项目”,
26
- 可按操作 ID 查找导入事务的真实失败阶段和原始错误。
27
-
28
- ## 解绑与恢复
29
-
30
- 5.0.7 的命令不区分大小写,`STOP` 与 `stop` 相同。未知命令不会误启动。
31
- `status` 和 `stop` 默认只控制当前数据目录;`status --all` 查看可控制的本机实例,
32
- `stop --port 5804` 指定停止目标,`--data "D:/data/knowledge"` 明确选择数据目录。
33
- 停止通过本机控制通道等待外壳及其托管模块退出,不再使用共享临时 PID 或盲杀。
34
- 未验证或正在启动的实例不会误报已停止,独立启动的模块也不会被结束。
35
-
36
- “解绑并保留数据”从项目列表移除登记、取消未开始任务并卸下本项目托管 Hook,保留代码、知识、会话及证据。实际分析或索引写入尚未结束时仍禁止解绑,防止丢失写入状态。队列本身不再被当成正在运行。
37
-
38
- 删除的是旧版本兼容路径,不是新版的故障恢复能力:v5 自身的重启恢复、提交去重、并发限制、失败重试和索引修复仍有效。`upgrade-recovery` 不再存在。
39
-
40
- ## 回归范围
41
-
42
- 旧格式迁移专用测试随旧实现删除,替换为旧目录拒绝且原字节不变、空状态启动、连接失败诊断与恢复、旧托管 Hook 的显式替换和回滚测试。真实提交链路继续由引擎 Git/Hook/journal/晋升/索引回归和五服务网页回归覆盖。模型替身和真实模型的结果分开记录;旧版本真实调用记录不计为本版通过。
1
+ # v5 从头开始
2
+
3
+ 本版按用户确认不再迁移以前的知识库数据。旧文件留在原位置,但新版不会读取它们;没有对用户代码仓库或旧知识目录执行删除。
4
+
5
+ ## 更新
6
+
7
+ ```bash
8
+ project-knowledge stop
9
+ npm install -g @sanqianx/project-knowledge@latest --registry=https://registry.npmjs.org/
10
+ project-knowledge-integrations update
11
+ project-knowledge
12
+ ```
13
+
14
+ 需要 Node ≥22 和 Git。默认使用 `~/.project-knowledge-v5`,四模块的托管数据也在此目录内。若环境变量 `KB_DATA_DIR` 仍指向旧目录,请取消该设置或改为新的空目录。不要把旧 `projects.json`、设置或引擎状态复制进新目录。
15
+
16
+ 5.0.6 修复首次启动被未登记的旧工作台会话误拦截:仅有日志、默认提示词及孤立会话的目录可以创建空的新登记,孤立会话保留原字节但不会恢复或触发任务。实际旧项目、设置、引擎状态或维护任务仍拒绝迁移,错误列出具体目录和冲突项。后台启动命令等待 HTTP 就绪后才报成功;启动失败直接在终端显示原因并返回非零退出码,不提前打开浏览器。
17
+
18
+ 在“系统状态”重新配置模型与后台默认模型、embedding 和知识根目录,然后在“领域与项目”导入代码目录及新的空知识目录。原代码目录无需移动。若残留旧知识库托管 Hook,导入预检会要求明确确认替换;不会覆盖第三方 Hook。导入建立 HEAD 基线,不分析已有历史。
19
+
20
+ 如果模块是自己独立启动的旧进程,请在它原来的终端中停止后重启新版外壳。外壳不会擅自杀死其他服务;版本或运行期鉴权不一致时显示具体连接阶段,不接管旧服务数据。
21
+
22
+ 5.0.1 修复旧版 Git 的项目导入失败(日志中的路径包含
23
+ `--path-format=absolute` 和换行)。升级 5.0.0 → 5.0.1 不需要清空新版数据或
24
+ 重新配置模型。失败项目可以直接重试导入;原代码、第三方 Hook 与旧知识文件不删除。
25
+ 导入失败会在弹窗保留错误码和操作 ID,系统诊断默认查询“系统与所有项目”,
26
+ 可按操作 ID 查找导入事务的真实失败阶段和原始错误。
27
+
28
+ ## 解绑与恢复
29
+
30
+ 5.0.7 的命令不区分大小写,`STOP` 与 `stop` 相同。未知命令不会误启动。
31
+ `status` 和 `stop` 默认只控制当前数据目录;`status --all` 查看可控制的本机实例,
32
+ `stop --port 5804` 指定停止目标,`--data "D:/data/knowledge"` 明确选择数据目录。
33
+ 停止通过本机控制通道等待外壳及其托管模块退出,不再使用共享临时 PID 或盲杀。
34
+ 未验证或正在启动的实例不会误报已停止,独立启动的模块也不会被结束。
35
+
36
+ “解绑并保留数据”从项目列表移除登记、取消未开始任务并卸下本项目托管 Hook,保留代码、知识、会话及证据。实际分析或索引写入尚未结束时仍禁止解绑,防止丢失写入状态。队列本身不再被当成正在运行。
37
+
38
+ 删除的是旧版本兼容路径,不是新版的故障恢复能力:v5 自身的重启恢复、提交去重、并发限制、失败重试和索引修复仍有效。`upgrade-recovery` 不再存在。
39
+
40
+ ## 回归范围
41
+
42
+ 旧格式迁移专用测试随旧实现删除,替换为旧目录拒绝且原字节不变、空状态启动、连接失败诊断与恢复、旧托管 Hook 的显式替换和回滚测试。真实提交链路继续由引擎 Git/Hook/journal/晋升/索引回归和五服务网页回归覆盖。模型替身和真实模型的结果分开记录;旧版本真实调用记录不计为本版通过。