@sanqianx/project-knowledge 4.7.0 → 5.0.0
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.
- package/.agents/plugins/marketplace.json +17 -17
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +836 -799
- package/README.md +58 -41
- package/_modules/knowledge-engine/README.md +91 -0
- package/_modules/knowledge-engine/package.json +38 -0
- package/_modules/knowledge-engine/src/analysis-contract.js +25 -0
- package/_modules/knowledge-engine/src/analysis-worker.js +54 -0
- package/_modules/knowledge-engine/src/bin.js +52 -0
- package/_modules/knowledge-engine/src/bridge-client.js +24 -0
- package/_modules/knowledge-engine/src/coordinator.js +263 -0
- package/_modules/knowledge-engine/src/headless-analyzer.js +75 -0
- package/_modules/knowledge-engine/src/memories.js +85 -0
- package/_modules/knowledge-engine/src/retrieval.js +116 -0
- package/_modules/knowledge-engine/src/runtime/README.md +7 -0
- package/_modules/knowledge-engine/src/runtime/atomic-file.js +204 -0
- package/_modules/knowledge-engine/src/runtime/automation-config.js +140 -0
- package/_modules/knowledge-engine/src/runtime/commit-conversation-binder.js +249 -0
- package/_modules/knowledge-engine/src/runtime/commit-processing-ledger.js +26 -0
- package/_modules/knowledge-engine/src/runtime/commit-prompt.js +202 -0
- package/_modules/knowledge-engine/src/runtime/commit-reconciler.js +432 -0
- package/_modules/knowledge-engine/src/runtime/content-hash.js +4 -0
- package/_modules/knowledge-engine/src/runtime/contracts.js +279 -0
- package/_modules/knowledge-engine/src/runtime/conversation-exclusions.js +204 -0
- package/_modules/knowledge-engine/src/runtime/conversation-store.js +387 -0
- package/_modules/knowledge-engine/src/runtime/evidence-bundle.js +228 -0
- package/_modules/knowledge-engine/src/runtime/git-runner.js +62 -0
- package/_modules/knowledge-engine/src/runtime/knowledge-promotion.js +444 -0
- package/_modules/knowledge-engine/src/runtime/knowledge-retrieval-service.js +402 -0
- package/_modules/knowledge-engine/src/runtime/layout.js +44 -0
- package/_modules/knowledge-engine/src/runtime/markdown-knowledge-indexer.js +230 -0
- package/_modules/knowledge-engine/src/runtime/scanner.js +298 -0
- package/_modules/knowledge-engine/src/server.js +154 -0
- package/_modules/knowledge-engine/src/store.js +236 -0
- package/_modules/knowledge-engine/ui/app.css +172 -0
- package/_modules/knowledge-engine/ui/app.js +297 -0
- package/_modules/knowledge-engine/ui/index.html +95 -0
- package/_site/README.md +30 -30
- package/_site/_test/ai-profile-resolver-test.js +137 -137
- package/_site/_test/automation-queue-test.js +14 -14
- package/_site/_test/automation-ui-test.js +40 -40
- package/_site/_test/background-task-registry-test.js +43 -43
- package/_site/_test/baseline-schema-test.js +91 -91
- package/_site/_test/chat-claudecodeui-match-test.js +92 -92
- package/_site/_test/claude-executable-discovery-test.js +62 -62
- package/_site/_test/claude-workbench-test.js +170 -170
- package/_site/_test/codex-conversation-projection-test.js +2 -1
- package/_site/_test/commit-conversation-binding-test.js +95 -95
- package/_site/_test/commit-evidence-test.js +110 -110
- package/_site/_test/conversation-api-test.js +109 -109
- package/_site/_test/conversation-store-test.js +136 -136
- package/_site/_test/desktop-browser-compat-test.js +28 -28
- package/_site/_test/desktop-hook-runtime-regression-test.js +204 -204
- package/_site/_test/explicit-commit-processor-test.js +37 -37
- package/_site/_test/fixtures/make-git-repos.js +12 -1
- package/_site/_test/folder-picker-output-test.js +19 -19
- package/_site/_test/fresh-hook-reimport-test.js +53 -0
- package/_site/_test/fresh-product-data-test.js +42 -0
- package/_site/_test/full-integration-e2e-test.js +165 -165
- package/_site/_test/git-validation-test.js +2 -2
- package/_site/_test/hook-runtime-endpoint-test.js +88 -88
- package/_site/_test/hook-status-repair-api-test.js +152 -152
- package/_site/_test/hook-trigger-test.js +85 -85
- package/_site/_test/import-preflight-api-test.js +234 -233
- package/_site/_test/index-writer-concurrency-test.js +135 -135
- package/_site/_test/integration-adapters-test.js +171 -171
- package/_site/_test/integration-surface-coverage-test.js +164 -164
- package/_site/_test/knowledge-language-control-test.js +170 -170
- package/_site/_test/knowledge-promotion-recovery-test.js +260 -260
- package/_site/_test/knowledge-query-test.js +54 -54
- package/_site/_test/knowledge-retrieval-service-test.js +77 -77
- package/_site/_test/knowledge-storage-startup-test.js +52 -52
- package/_site/_test/knowledge-store-logs-supervision-test.js +89 -89
- package/_site/_test/logging-api-test.js +89 -89
- package/_site/_test/logging-sse-no-gap-test.js +88 -88
- package/_site/_test/logging-ui-test.js +106 -104
- package/_site/_test/markdown-delta-overlay-test.js +85 -85
- package/_site/_test/markdown-maintenance-api-test.js +75 -75
- package/_site/_test/mcp-server-test.js +149 -149
- package/_site/_test/module-artifact-integrity-test.js +27 -0
- package/_site/_test/module-boundary-test.js +30 -0
- package/_site/_test/module-bridge-eventbridge-test.js +7 -0
- package/_site/_test/module-model-configuration-test.js +44 -0
- package/_site/_test/module-process-lifecycle-test.js +24 -0
- package/_site/_test/module-stream-proxy-test.js +34 -0
- package/_site/_test/non-release-ci-test.js +34 -34
- package/_site/_test/offline-boundary-isolation-test.js +32 -32
- package/_site/_test/packaged-ui-smoke-test.js +11 -9
- package/_site/_test/path-consistency-test.js +151 -151
- package/_site/_test/pending-sweep-test.js +9 -9
- package/_site/_test/post-commit-automation-test.js +87 -87
- package/_site/_test/product-diagnostics-ui-test.js +75 -0
- package/_site/_test/product-import-ui-test.js +92 -0
- package/_site/_test/project-delete-recovery-test.js +64 -64
- package/_site/_test/project-goal-editor-test.js +144 -144
- package/_site/_test/project-lifecycle-transaction-test.js +106 -106
- package/_site/_test/prompt-settings-test.js +115 -115
- package/_site/_test/protected-architecture-gate-test.js +122 -122
- package/_site/_test/refactor-characterization-test.js +36 -36
- package/_site/_test/release-version-sync-test.js +1 -1
- package/_site/_test/requirement-recorder-test.js +173 -173
- package/_site/_test/run-all-tests.js +159 -156
- package/_site/_test/shared-contracts-test.js +58 -58
- package/_site/_test/startup-analysis-disabled-test.js +10 -10
- package/_site/_test/storage-foundation-test.js +78 -78
- package/_site/_test/structured-logger-test.js +101 -101
- package/_site/_test/tracking-start-test.js +109 -108
- package/_site/_test/workbench-permission-test.js +117 -117
- package/_site/_test/workspace-ui-contract-test.js +28 -43
- package/_site/lib/ai-profile-resolver.js +78 -78
- package/_site/lib/ai-workspace.js +101 -101
- package/_site/lib/automation-config.js +140 -140
- package/_site/lib/bridge-adapter.js +1 -0
- package/_site/lib/bridge-consumer-service.js +402 -402
- package/_site/lib/claude-cli-runner.js +1510 -1510
- package/_site/lib/commit-conversation-binder.js +234 -234
- package/_site/lib/commit-processing-ledger.js +27 -27
- package/_site/lib/commit-prompt.js +202 -202
- package/_site/lib/commit-reconciler.js +406 -406
- package/_site/lib/contracts.js +284 -279
- package/_site/lib/conversation-query-service.js +144 -144
- package/_site/lib/conversation-store.js +385 -385
- package/_site/lib/data-dir.js +6 -74
- package/_site/lib/engine-connection.js +67 -0
- package/_site/lib/evidence-bundle.js +228 -228
- package/_site/lib/folder-picker-output.js +21 -21
- package/_site/lib/git-runner.js +62 -62
- package/_site/lib/github-team-store.js +1172 -1172
- package/_site/lib/hook-manager.js +203 -202
- package/_site/lib/index-service.js +173 -173
- package/_site/lib/integration-installer.js +908 -907
- package/_site/lib/kb-framework.js +176 -176
- package/_site/lib/kb-validator.js +124 -124
- package/_site/lib/knowledge-promotion.js +435 -435
- package/_site/lib/knowledge-retrieval-service.js +401 -401
- package/_site/lib/knowledge-tool-runtime.js +359 -359
- package/_site/lib/llm-client.js +161 -161
- package/_site/lib/markdown-knowledge-indexer.js +230 -230
- package/_site/lib/module-bridge.js +191 -36
- package/_site/lib/post-commit-automation.js +87 -87
- package/_site/lib/product-data.js +24 -0
- package/_site/lib/project-lifecycle-service.js +535 -497
- package/_site/lib/project-store.js +268 -262
- package/_site/lib/requirement-recorder.js +278 -278
- package/_site/lib/runtime-endpoint.js +155 -155
- package/_site/lib/scanner.js +298 -298
- package/_site/lib/server-app.js +1579 -1520
- package/_site/lib/settings-store.js +133 -113
- package/_site/lib/storage-layout.js +162 -162
- package/_site/lib/structured-logger.js +574 -574
- package/_site/scripts/folder-picker.ps1 +156 -156
- package/_site/scripts/hook-trigger.js +157 -156
- package/_site/scripts/install-module-candidates.js +69 -0
- package/_site/scripts/pack-module-candidates.js +72 -0
- package/_site/scripts/sync-release-version.js +2 -2
- package/_site/scripts/vendor-modules.js +47 -0
- package/_site/scripts/verify-module-runtime.js +45 -0
- package/_site/scripts/verify-product-runtime.js +34 -0
- package/bin/project-knowledge-mcp.js +194 -194
- package/docs/README.zh-CN.md +42 -29
- package/docs/fresh-v5-start.md +28 -0
- package/docs/project-registry-schema.md +22 -22
- package/docs/testing-strategy.md +33 -33
- package/module-runtime-manifest.json +220 -0
- package/package.json +14 -9
- package/plugins/project-knowledge/.claude-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.codex-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.mcp.json +1 -1
- package/plugins/project-knowledge/opencode/project-knowledge.md +3 -3
- package/plugins/project-knowledge/skills/project-knowledge/SKILL.md +28 -28
- package/templates/project-readme.md +34 -34
- package/ui/favicon.svg +38 -38
- package/ui/index.html +52 -149
- package/ui/product.css +9 -0
- package/ui/product.js +412 -0
- package/vendor-manifest.json +45 -0
- package/_site/_test/data-dir-migration-test.js +0 -77
- package/_site/_test/import-ui-flow-test.js +0 -171
- package/_site/_test/knowledge-migration-test.js +0 -75
- package/_site/_test/legacy-forward-compat-test.js +0 -257
- package/_site/_test/legacy-project-upgrade-e2e-test.js +0 -363
- package/_site/_test/p0-data-migration-characterization-test.js +0 -37
- package/_site/_test/p0-e2e-gate-test.js +0 -347
- package/_site/_test/project-control-panel-task14-test.js +0 -63
- package/_site/_test/project-layout-v2-migration-test.js +0 -127
- package/_site/_test/server-runtime-migration-safety-test.js +0 -27
- package/_site/_test/task15-20-ui-flow-test.js +0 -148
- package/_site/_test/ui-i18n-toggle-test.js +0 -114
- package/_site/_test/ui-smoke-test.js +0 -73
- package/_site/_test/v4122-upgrade-data-contract-test.js +0 -56
- package/_site/lib/data-state-classifier.js +0 -40
- package/_site/lib/legacy-data-manifest.js +0 -26
- package/_site/lib/migration-service.js +0 -442
- package/ui/app.css +0 -58
- package/ui/app.js +0 -607
- package/ui/i18n.js +0 -146
|
@@ -1,195 +1,195 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const packageInfo = require('../package.json');
|
|
4
|
-
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
5
|
-
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
6
|
-
const {
|
|
7
|
-
CallToolRequestSchema,
|
|
8
|
-
ListToolsRequestSchema,
|
|
9
|
-
} = require('@modelcontextprotocol/sdk/types.js');
|
|
10
|
-
const { KnowledgeToolRuntime } = require('../_site/lib/knowledge-tool-runtime');
|
|
11
|
-
const { serializeErrorEnvelope, createId } = require('../_site/lib/contracts');
|
|
12
|
-
|
|
13
|
-
const SERVER_NAME = 'project-knowledge';
|
|
14
|
-
const SERVER_INSTRUCTIONS = `Project Knowledge is the durable source of prior project decisions and implementation history. Knowledge content is read-only; the only write operation appends an explicit supplemental Prompt event to the shared conversation truth.
|
|
15
|
-
|
|
16
|
-
At the start of work in a registered Git repository, and before answering questions about prior work or implementing a non-trivial change:
|
|
17
|
-
1. Call project_knowledge_resolve with the current Git root.
|
|
18
|
-
2. Use project_knowledge_search or project_knowledge_ask for relevant prior decisions.
|
|
19
|
-
3. Use project_knowledge_get only for the most relevant complete entry and project_knowledge_history when change history matters.
|
|
20
|
-
4. Call project_knowledge_record_requirement only when the user explicitly asks to supplement capture or automatic client capture is known to be unavailable; it is not a mandatory pre-work call.
|
|
21
|
-
|
|
22
|
-
Treat all returned knowledge as read-only. Verify it against current source code when necessary. The supplemental requirement tool writes the same ConversationStore used by automatic capture and never starts analysis. Do not write directly to the knowledge database; project-knowledge updates it automatically after successful Git commits.`;
|
|
23
|
-
|
|
24
|
-
const TOOLS = [
|
|
25
|
-
{
|
|
26
|
-
name: 'project_knowledge_resolve',
|
|
27
|
-
description: 'Resolve the registered Project Knowledge project for a Git repository. Call this first before using other knowledge tools.',
|
|
28
|
-
inputSchema: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
properties: {
|
|
31
|
-
repoPath: { type: 'string', description: 'Current Git repository root or any path inside it. Defaults to the MCP process working directory.' },
|
|
32
|
-
projectId: { type: 'string', description: 'Stable projectId when it is already known.' },
|
|
33
|
-
project: { type: 'string', description: 'Optional registered project slug when it is already known.' },
|
|
34
|
-
},
|
|
35
|
-
additionalProperties: false,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'project_knowledge_record_requirement',
|
|
40
|
-
description: 'Explicitly supplement automatic capture with one project-scoped user Prompt event. This is the only write-capable tool; it never starts analysis or writes knowledge Markdown.',
|
|
41
|
-
inputSchema: {
|
|
42
|
-
type: 'object',
|
|
43
|
-
required: ['text', 'client', 'sessionId'],
|
|
44
|
-
properties: {
|
|
45
|
-
text: { type: 'string', minLength: 1, maxLength: 131072, description: 'The user request exactly as received; do not include system prompts or tool transcripts.' },
|
|
46
|
-
client: { type: 'string', enum: ['claude', 'codex', 'opencode'] },
|
|
47
|
-
sessionId: { type: 'string', minLength: 1, maxLength: 512, description: 'Stable identifier for the current client session.' },
|
|
48
|
-
conversationId: { type: 'string', minLength: 1, maxLength: 512 },
|
|
49
|
-
projectId: { type: 'string', description: 'Stable projectId returned by project_knowledge_resolve.' },
|
|
50
|
-
repoPath: { type: 'string', description: 'Current Git root. Used for exact project resolution when projectId is omitted.' },
|
|
51
|
-
explicitCommit: { type: 'string', description: 'Optional Git commit explicitly associated with this requirement.' },
|
|
52
|
-
},
|
|
53
|
-
anyOf: [{ required: ['projectId'] }, { required: ['repoPath'] }],
|
|
54
|
-
additionalProperties: false,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'project_knowledge_search',
|
|
59
|
-
description: 'Search durable project knowledge using the current project and its explicitly related-project scope. This tool is read-only.',
|
|
60
|
-
inputSchema: {
|
|
61
|
-
type: 'object',
|
|
62
|
-
required: ['query'],
|
|
63
|
-
properties: {
|
|
64
|
-
query: { type: 'string', minLength: 1 },
|
|
65
|
-
repoPath: { type: 'string', description: 'Current Git repository root or a path inside it.' },
|
|
66
|
-
projectId: { type: 'string', description: 'Stable projectId returned by project_knowledge_resolve.' },
|
|
67
|
-
project: { type: 'string', description: 'Optional registered project slug.' },
|
|
68
|
-
limit: { type: 'integer', minimum: 1, maximum: 30, default: 8 },
|
|
69
|
-
},
|
|
70
|
-
additionalProperties: false,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'project_knowledge_ask',
|
|
75
|
-
description: 'Return a compact answer with citations from durable project knowledge. This tool is read-only.',
|
|
76
|
-
inputSchema: {
|
|
77
|
-
type: 'object',
|
|
78
|
-
required: ['query'],
|
|
79
|
-
properties: {
|
|
80
|
-
query: { type: 'string', minLength: 1 },
|
|
81
|
-
repoPath: { type: 'string' },
|
|
82
|
-
projectId: { type: 'string' },
|
|
83
|
-
project: { type: 'string' },
|
|
84
|
-
limit: { type: 'integer', minimum: 1, maximum: 30, default: 8 },
|
|
85
|
-
},
|
|
86
|
-
additionalProperties: false,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'project_knowledge_get',
|
|
91
|
-
description: 'Read one complete knowledge entry selected from search results. This tool is read-only and scope checked.',
|
|
92
|
-
inputSchema: {
|
|
93
|
-
type: 'object',
|
|
94
|
-
required: ['entry'],
|
|
95
|
-
properties: {
|
|
96
|
-
entry: { type: 'string', minLength: 1, description: 'Entry identifier returned by search.' },
|
|
97
|
-
space: { type: 'string', description: 'Optional scoped knowledge space identifier.' },
|
|
98
|
-
repoPath: { type: 'string' },
|
|
99
|
-
projectId: { type: 'string' },
|
|
100
|
-
project: { type: 'string' },
|
|
101
|
-
},
|
|
102
|
-
additionalProperties: false,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: 'project_knowledge_history',
|
|
107
|
-
description: 'Read recent durable change history for the current project and its allowed scope. This tool is read-only.',
|
|
108
|
-
inputSchema: {
|
|
109
|
-
type: 'object',
|
|
110
|
-
properties: {
|
|
111
|
-
repoPath: { type: 'string' },
|
|
112
|
-
projectId: { type: 'string' },
|
|
113
|
-
project: { type: 'string' },
|
|
114
|
-
limit: { type: 'integer', minimum: 1, maximum: 100, default: 20 },
|
|
115
|
-
},
|
|
116
|
-
additionalProperties: false,
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
];
|
|
120
|
-
|
|
121
|
-
function toolContent(result) {
|
|
122
|
-
return {
|
|
123
|
-
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
124
|
-
structuredContent: result,
|
|
125
|
-
isError: false,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function callTool(runtime, name, args) {
|
|
130
|
-
if (name === 'project_knowledge_resolve') return runtime.resolveProject(args);
|
|
131
|
-
if (name === 'project_knowledge_record_requirement') return runtime.recordRequirement(args);
|
|
132
|
-
if (name === 'project_knowledge_search') return runtime.search(args);
|
|
133
|
-
if (name === 'project_knowledge_ask') return runtime.ask(args);
|
|
134
|
-
if (name === 'project_knowledge_get') return runtime.get(args);
|
|
135
|
-
if (name === 'project_knowledge_history') return runtime.history(args);
|
|
136
|
-
throw new Error(`unknown tool: ${name}`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function createServer(options = {}) {
|
|
140
|
-
const runtime = options.runtime || new KnowledgeToolRuntime();
|
|
141
|
-
const server = new Server(
|
|
142
|
-
{ name: SERVER_NAME, version: packageInfo.version },
|
|
143
|
-
{
|
|
144
|
-
capabilities: { tools: { listChanged: false } },
|
|
145
|
-
instructions: SERVER_INSTRUCTIONS,
|
|
146
|
-
},
|
|
147
|
-
);
|
|
148
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
149
|
-
server.setRequestHandler(CallToolRequestSchema, async request => {
|
|
150
|
-
const name = String(request.params?.name || '');
|
|
151
|
-
const args = request.params?.arguments && typeof request.params.arguments === 'object'
|
|
152
|
-
? request.params.arguments
|
|
153
|
-
: {};
|
|
154
|
-
try {
|
|
155
|
-
return toolContent(await callTool(runtime, name, args));
|
|
156
|
-
} catch (error) {
|
|
157
|
-
const operationId = createId('op');
|
|
158
|
-
return {
|
|
159
|
-
content: [{ type: 'text', text: JSON.stringify(serializeErrorEnvelope(error, operationId)) }],
|
|
160
|
-
isError: true,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
return { server, runtime };
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
async function main() {
|
|
168
|
-
const { server, runtime } = createServer();
|
|
169
|
-
const transport = new StdioServerTransport();
|
|
170
|
-
let closing = false;
|
|
171
|
-
const close = async () => {
|
|
172
|
-
if (closing) return;
|
|
173
|
-
closing = true;
|
|
174
|
-
await runtime.close();
|
|
175
|
-
await server.close();
|
|
176
|
-
};
|
|
177
|
-
process.once('SIGINT', () => close().finally(() => process.exit(0)));
|
|
178
|
-
process.once('SIGTERM', () => close().finally(() => process.exit(0)));
|
|
179
|
-
await server.connect(transport);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (require.main === module) {
|
|
183
|
-
main().catch(error => {
|
|
184
|
-
process.stderr.write(`[project-knowledge-mcp] ${JSON.stringify(serializeErrorEnvelope(error, createId('op')))}\n`);
|
|
185
|
-
process.exit(1);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
module.exports = {
|
|
190
|
-
callTool,
|
|
191
|
-
createServer,
|
|
192
|
-
SERVER_INSTRUCTIONS,
|
|
193
|
-
SERVER_NAME,
|
|
194
|
-
TOOLS,
|
|
195
|
-
};
|
|
2
|
+
|
|
3
|
+
const packageInfo = require('../package.json');
|
|
4
|
+
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
5
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
6
|
+
const {
|
|
7
|
+
CallToolRequestSchema,
|
|
8
|
+
ListToolsRequestSchema,
|
|
9
|
+
} = require('@modelcontextprotocol/sdk/types.js');
|
|
10
|
+
const { KnowledgeToolRuntime } = require('../_site/lib/knowledge-tool-runtime');
|
|
11
|
+
const { serializeErrorEnvelope, createId } = require('../_site/lib/contracts');
|
|
12
|
+
|
|
13
|
+
const SERVER_NAME = 'project-knowledge';
|
|
14
|
+
const SERVER_INSTRUCTIONS = `Project Knowledge is the durable source of prior project decisions and implementation history. Knowledge content is read-only; the only write operation appends an explicit supplemental Prompt event to the shared conversation truth.
|
|
15
|
+
|
|
16
|
+
At the start of work in a registered Git repository, and before answering questions about prior work or implementing a non-trivial change:
|
|
17
|
+
1. Call project_knowledge_resolve with the current Git root.
|
|
18
|
+
2. Use project_knowledge_search or project_knowledge_ask for relevant prior decisions.
|
|
19
|
+
3. Use project_knowledge_get only for the most relevant complete entry and project_knowledge_history when change history matters.
|
|
20
|
+
4. Call project_knowledge_record_requirement only when the user explicitly asks to supplement capture or automatic client capture is known to be unavailable; it is not a mandatory pre-work call.
|
|
21
|
+
|
|
22
|
+
Treat all returned knowledge as read-only. Verify it against current source code when necessary. The supplemental requirement tool writes the same ConversationStore used by automatic capture and never starts analysis. Do not write directly to the knowledge database; project-knowledge updates it automatically after successful Git commits.`;
|
|
23
|
+
|
|
24
|
+
const TOOLS = [
|
|
25
|
+
{
|
|
26
|
+
name: 'project_knowledge_resolve',
|
|
27
|
+
description: 'Resolve the registered Project Knowledge project for a Git repository. Call this first before using other knowledge tools.',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
repoPath: { type: 'string', description: 'Current Git repository root or any path inside it. Defaults to the MCP process working directory.' },
|
|
32
|
+
projectId: { type: 'string', description: 'Stable projectId when it is already known.' },
|
|
33
|
+
project: { type: 'string', description: 'Optional registered project slug when it is already known.' },
|
|
34
|
+
},
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'project_knowledge_record_requirement',
|
|
40
|
+
description: 'Explicitly supplement automatic capture with one project-scoped user Prompt event. This is the only write-capable tool; it never starts analysis or writes knowledge Markdown.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
required: ['text', 'client', 'sessionId'],
|
|
44
|
+
properties: {
|
|
45
|
+
text: { type: 'string', minLength: 1, maxLength: 131072, description: 'The user request exactly as received; do not include system prompts or tool transcripts.' },
|
|
46
|
+
client: { type: 'string', enum: ['claude', 'codex', 'opencode'] },
|
|
47
|
+
sessionId: { type: 'string', minLength: 1, maxLength: 512, description: 'Stable identifier for the current client session.' },
|
|
48
|
+
conversationId: { type: 'string', minLength: 1, maxLength: 512 },
|
|
49
|
+
projectId: { type: 'string', description: 'Stable projectId returned by project_knowledge_resolve.' },
|
|
50
|
+
repoPath: { type: 'string', description: 'Current Git root. Used for exact project resolution when projectId is omitted.' },
|
|
51
|
+
explicitCommit: { type: 'string', description: 'Optional Git commit explicitly associated with this requirement.' },
|
|
52
|
+
},
|
|
53
|
+
anyOf: [{ required: ['projectId'] }, { required: ['repoPath'] }],
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'project_knowledge_search',
|
|
59
|
+
description: 'Search durable project knowledge using the current project and its explicitly related-project scope. This tool is read-only.',
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
required: ['query'],
|
|
63
|
+
properties: {
|
|
64
|
+
query: { type: 'string', minLength: 1 },
|
|
65
|
+
repoPath: { type: 'string', description: 'Current Git repository root or a path inside it.' },
|
|
66
|
+
projectId: { type: 'string', description: 'Stable projectId returned by project_knowledge_resolve.' },
|
|
67
|
+
project: { type: 'string', description: 'Optional registered project slug.' },
|
|
68
|
+
limit: { type: 'integer', minimum: 1, maximum: 30, default: 8 },
|
|
69
|
+
},
|
|
70
|
+
additionalProperties: false,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'project_knowledge_ask',
|
|
75
|
+
description: 'Return a compact answer with citations from durable project knowledge. This tool is read-only.',
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
required: ['query'],
|
|
79
|
+
properties: {
|
|
80
|
+
query: { type: 'string', minLength: 1 },
|
|
81
|
+
repoPath: { type: 'string' },
|
|
82
|
+
projectId: { type: 'string' },
|
|
83
|
+
project: { type: 'string' },
|
|
84
|
+
limit: { type: 'integer', minimum: 1, maximum: 30, default: 8 },
|
|
85
|
+
},
|
|
86
|
+
additionalProperties: false,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'project_knowledge_get',
|
|
91
|
+
description: 'Read one complete knowledge entry selected from search results. This tool is read-only and scope checked.',
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
required: ['entry'],
|
|
95
|
+
properties: {
|
|
96
|
+
entry: { type: 'string', minLength: 1, description: 'Entry identifier returned by search.' },
|
|
97
|
+
space: { type: 'string', description: 'Optional scoped knowledge space identifier.' },
|
|
98
|
+
repoPath: { type: 'string' },
|
|
99
|
+
projectId: { type: 'string' },
|
|
100
|
+
project: { type: 'string' },
|
|
101
|
+
},
|
|
102
|
+
additionalProperties: false,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'project_knowledge_history',
|
|
107
|
+
description: 'Read recent durable change history for the current project and its allowed scope. This tool is read-only.',
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
repoPath: { type: 'string' },
|
|
112
|
+
projectId: { type: 'string' },
|
|
113
|
+
project: { type: 'string' },
|
|
114
|
+
limit: { type: 'integer', minimum: 1, maximum: 100, default: 20 },
|
|
115
|
+
},
|
|
116
|
+
additionalProperties: false,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
function toolContent(result) {
|
|
122
|
+
return {
|
|
123
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
124
|
+
structuredContent: result,
|
|
125
|
+
isError: false,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function callTool(runtime, name, args) {
|
|
130
|
+
if (name === 'project_knowledge_resolve') return runtime.resolveProject(args);
|
|
131
|
+
if (name === 'project_knowledge_record_requirement') return runtime.recordRequirement(args);
|
|
132
|
+
if (name === 'project_knowledge_search') return runtime.search(args);
|
|
133
|
+
if (name === 'project_knowledge_ask') return runtime.ask(args);
|
|
134
|
+
if (name === 'project_knowledge_get') return runtime.get(args);
|
|
135
|
+
if (name === 'project_knowledge_history') return runtime.history(args);
|
|
136
|
+
throw new Error(`unknown tool: ${name}`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function createServer(options = {}) {
|
|
140
|
+
const runtime = options.runtime || new KnowledgeToolRuntime();
|
|
141
|
+
const server = new Server(
|
|
142
|
+
{ name: SERVER_NAME, version: packageInfo.version },
|
|
143
|
+
{
|
|
144
|
+
capabilities: { tools: { listChanged: false } },
|
|
145
|
+
instructions: SERVER_INSTRUCTIONS,
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
149
|
+
server.setRequestHandler(CallToolRequestSchema, async request => {
|
|
150
|
+
const name = String(request.params?.name || '');
|
|
151
|
+
const args = request.params?.arguments && typeof request.params.arguments === 'object'
|
|
152
|
+
? request.params.arguments
|
|
153
|
+
: {};
|
|
154
|
+
try {
|
|
155
|
+
return toolContent(await callTool(runtime, name, args));
|
|
156
|
+
} catch (error) {
|
|
157
|
+
const operationId = createId('op');
|
|
158
|
+
return {
|
|
159
|
+
content: [{ type: 'text', text: JSON.stringify(serializeErrorEnvelope(error, operationId)) }],
|
|
160
|
+
isError: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return { server, runtime };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function main() {
|
|
168
|
+
const { server, runtime } = createServer();
|
|
169
|
+
const transport = new StdioServerTransport();
|
|
170
|
+
let closing = false;
|
|
171
|
+
const close = async () => {
|
|
172
|
+
if (closing) return;
|
|
173
|
+
closing = true;
|
|
174
|
+
await runtime.close();
|
|
175
|
+
await server.close();
|
|
176
|
+
};
|
|
177
|
+
process.once('SIGINT', () => close().finally(() => process.exit(0)));
|
|
178
|
+
process.once('SIGTERM', () => close().finally(() => process.exit(0)));
|
|
179
|
+
await server.connect(transport);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (require.main === module) {
|
|
183
|
+
main().catch(error => {
|
|
184
|
+
process.stderr.write(`[project-knowledge-mcp] ${JSON.stringify(serializeErrorEnvelope(error, createId('op')))}\n`);
|
|
185
|
+
process.exit(1);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
module.exports = {
|
|
190
|
+
callTool,
|
|
191
|
+
createServer,
|
|
192
|
+
SERVER_INSTRUCTIONS,
|
|
193
|
+
SERVER_NAME,
|
|
194
|
+
TOOLS,
|
|
195
|
+
};
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
# project-knowledge
|
|
2
2
|
|
|
3
|
-
本地、由 Git Commit
|
|
4
|
-
|
|
3
|
+
本地、由 Git Commit 驱动的智脑知识服务。Markdown 是知识事实源;vector-hub
|
|
4
|
+
提供可重建的派生索引。外壳只负责导航、归属、接线与状态投影。
|
|
5
5
|
|
|
6
6
|
## 安装与运行
|
|
7
7
|
|
|
8
|
+
v5 不再兼容或迁移旧知识库数据。停止旧版后重新设置模型、知识根目录并导入
|
|
9
|
+
项目;默认新数据目录为 `~/.project-knowledge-v5`。旧文件保留但不读取。
|
|
10
|
+
详见 [从头开始](fresh-v5-start.md)。
|
|
11
|
+
|
|
8
12
|
新机器完整安装只需三条命令:
|
|
9
13
|
|
|
10
14
|
```bash
|
|
11
|
-
npm install -g project-knowledge
|
|
15
|
+
npm install -g @sanqianx/project-knowledge@latest
|
|
12
16
|
project-knowledge-integrations install
|
|
13
17
|
project-knowledge
|
|
14
18
|
```
|
|
15
19
|
|
|
16
|
-
1. `npm install -g project-knowledge`
|
|
17
|
-
|
|
20
|
+
1. `npm install -g @sanqianx/project-knowledge@latest` 安装外壳、固定版本的
|
|
21
|
+
工作台、vector-hub、event-bridge,以及包内 knowledge-engine。
|
|
18
22
|
2. `project-knowledge-integrations install` 是一次性的 Integration Setup,
|
|
19
23
|
对检测到的每个客户端(Claude Code / Codex / OpenCode)同时安装两类
|
|
20
24
|
相互独立、分别上报状态的能力:
|
|
@@ -23,8 +27,8 @@ project-knowledge
|
|
|
23
27
|
Git 工作区里的 Agent 对话捕捉进已导入项目的「开发对话」。
|
|
24
28
|
同时注册 host 级 `project-knowledge` Bridge consumer。全程无需打开任何
|
|
25
29
|
客户端 UI;第三方 hooks 与配置完整保留;Codex notify 冲突只上报不覆盖。
|
|
26
|
-
3. `project-knowledge`
|
|
27
|
-
|
|
30
|
+
3. `project-knowledge` 启动全新的 v5 本地服务。重新配置模型、知识根目录并导入
|
|
31
|
+
项目,不迁移旧登记、会话、知识、索引或未完成任务。
|
|
28
32
|
|
|
29
33
|
注意事项:
|
|
30
34
|
|
|
@@ -44,26 +48,24 @@ project-knowledge status
|
|
|
44
48
|
project-knowledge stop
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
需要 Node.js
|
|
48
|
-
|
|
51
|
+
需要 Node.js 22+ 与 `PATH` 中的 Git。4.8.0 仅交付 npm 网页版本,不提供新版
|
|
52
|
+
Windows 安装包或桌面自动更新。
|
|
49
53
|
|
|
50
54
|
## 唯一分析流程
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
知识引擎是唯一分析执行者:
|
|
53
57
|
|
|
54
58
|
```text
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
程序 startup --------+ trigger: git-hook | startup
|
|
59
|
+
Git Hook → event-bridge journal → 引擎持久化认领 → 隔离 Agent 分析
|
|
60
|
+
→ staging 校验 → 知识晋升 → vector-hub 索引 → 检索
|
|
58
61
|
```
|
|
59
62
|
|
|
60
63
|
导入只建立 Git tracking baseline、创建项目元数据并安装/验证 Hook;不运行 AI、
|
|
61
64
|
不扫描全仓推测需求、不生成 TODO 知识。空仓库导入后的第一个 Commit会被处理。
|
|
62
65
|
|
|
63
|
-
Hook
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
同一个 in-flight reconciliation。
|
|
66
|
+
Hook 向 bridge journal 写入提交证据,通知只负责唤醒。通知丢失仍由 journal
|
|
67
|
+
消费及启动对账恢复;Hook 故障不阻塞提交。同项目严格串行、失败即停;不同项目
|
|
68
|
+
最多两个并发分析,重复事件不会重做已完成提交。关闭浏览器不停止后台维护。
|
|
67
69
|
|
|
68
70
|
## 知识与索引安全
|
|
69
71
|
|
|
@@ -76,8 +78,8 @@ Promotion 使用 backup、hash 与 durable journal。只有 Markdown promotion
|
|
|
76
78
|
成功后才推进 lastAnalyzedCommit 并把 index 标为 dirty。索引失败不会回滚真实
|
|
77
79
|
Markdown,也不会重跑 AI;启动和维护流程会重试 dirty index。
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
vector-hub 是唯一派生索引服务,外壳不再执行第二套索引写入。索引失败独立显示
|
|
82
|
+
“知识已更新,索引待修复”,修复索引不重跑模型、不撤销有效知识。
|
|
81
83
|
|
|
82
84
|
应用不会创建、修改、刷新或删除 `CLAUDE.md`。
|
|
83
85
|
|
|
@@ -96,24 +98,24 @@ project-knowledge-kb get --project <projectId> --entry modules/auth.md --json
|
|
|
96
98
|
project-knowledge-kb history --project <projectId> --json
|
|
97
99
|
```
|
|
98
100
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
只读查询不会创建或修改配置。索引不可用时回退到真实 Markdown。项目、所属领域、
|
|
102
|
+
整个智脑是包含范围;未确认记忆不能作为长期偏好注入任务。
|
|
101
103
|
|
|
102
104
|
## 存储合同
|
|
103
105
|
|
|
104
|
-
内部数据默认在 `~/.project-knowledge/`,可用 `KB_DATA_DIR` 修改。用户必须先设置
|
|
106
|
+
内部数据默认在 `~/.project-knowledge-v5/`,可用 `KB_DATA_DIR` 修改。用户必须先设置
|
|
105
107
|
global knowledge root,再导入项目;它只影响未来导入。每个项目导入时固化绝对
|
|
106
108
|
knowledgePath,修改 global root 不会移动已有项目。
|
|
107
109
|
|
|
108
110
|
```text
|
|
109
|
-
~/.project-knowledge/
|
|
111
|
+
~/.project-knowledge-v5/
|
|
110
112
|
├── settings.json
|
|
111
113
|
├── projects.json # 仅 ID、顺序、最小显示快照
|
|
112
114
|
├── projects/<projectId>/
|
|
113
115
|
│ ├── config.json # 固定 repoPath/knowledgePath
|
|
114
116
|
│ ├── state.json # tracking/claim/index/Hook 状态
|
|
115
117
|
│ └── requirements.jsonl # 按需创建
|
|
116
|
-
├──
|
|
118
|
+
├── knowledge-engine/ # 持久化 claim、run、journal 游标
|
|
117
119
|
├── cache/
|
|
118
120
|
├── runtime/
|
|
119
121
|
├── logs/{app,projects,hooks}/
|
|
@@ -138,15 +140,24 @@ settings、per-project config/state、最小 registry 与旧 index。验证路
|
|
|
138
140
|
Commit pointer、日志和索引后才激活,completion marker 最后写。任何阶段中断都
|
|
139
141
|
保留旧 reader、用户知识、历史日志、配置与 backup,允许安全重试。
|
|
140
142
|
|
|
141
|
-
##
|
|
143
|
+
## 产品 UI
|
|
144
|
+
|
|
145
|
+
一级导航为智脑首页、开始工作、知识检索、长期记忆、领域与项目、活动记录。
|
|
146
|
+
开始工作嵌入真实工作台,保留消息流、中止、权限和会话恢复,不重复实现聊天。
|
|
147
|
+
在“领域与项目”点击“导入项目”,确认代码目录、知识目录及领域;部分接线失败
|
|
148
|
+
保留项目,只重试失败模块。系统状态集中展示四模块健康、模型配置与诊断。
|
|
149
|
+
|
|
150
|
+
加入智脑不会搬动已有项目知识。领域共享知识及已确认记忆与项目知识并存。
|
|
151
|
+
凭据由 Workbench 统一管理;维护默认模型独立于聊天临时切换,运行凭据不进
|
|
152
|
+
引擎状态、日志或浏览器消息。
|
|
142
153
|
|
|
143
|
-
|
|
154
|
+
活动记录保留结构化日志能力:
|
|
144
155
|
|
|
145
156
|
- trace/debug/info/warn/error/fatal 六级;
|
|
146
157
|
- 本地日期、项目、component、event、operation、Commit、全文过滤;
|
|
147
158
|
- newest-first cursor 分页、暂停/自动刷新、按当前条件导出;
|
|
148
159
|
- operation flow、结构化 error/stack、logger degraded 状态;
|
|
149
|
-
- Hook
|
|
160
|
+
- Hook/索引/项目状态、统一的浅深主题。
|
|
150
161
|
|
|
151
162
|
日志使用 `log/v2` JSONL,按天和 50 MiB segment 轮转;默认保留 365 天,`0`
|
|
152
163
|
表示不按时间删除,并受总容量策略约束。写入、查询、error 与 export 全部递归脱敏。
|
|
@@ -167,8 +178,10 @@ npm test --prefix desktop
|
|
|
167
178
|
npm pack --dry-run --json
|
|
168
179
|
```
|
|
169
180
|
|
|
170
|
-
|
|
171
|
-
|
|
181
|
+
自动回归覆盖真实 Git Hook、空格/中文路径、提交证据、promotion/index、查询、
|
|
182
|
+
恢复与日志。产品浏览器验收只检查 1920×1080 桌面视口,模型和 embedding 为
|
|
183
|
+
可控替身;真实模型与真实索引抽测分别报告。完整故障组合和用户已有数据的最终
|
|
184
|
+
切换另行验收,不用可点击页面代替真实链路通过。
|
|
172
185
|
|
|
173
186
|
## 许可证
|
|
174
187
|
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
在“系统状态”重新配置模型与后台默认模型、embedding 和知识根目录,然后在“领域与项目”导入代码目录及新的空知识目录。原代码目录无需移动。若残留旧知识库托管 Hook,导入预检会要求明确确认替换;不会覆盖第三方 Hook。导入建立 HEAD 基线,不分析已有历史。
|
|
17
|
+
|
|
18
|
+
如果模块是自己独立启动的旧进程,请在它原来的终端中停止后重启新版外壳。外壳不会擅自杀死其他服务;版本或运行期鉴权不一致时显示具体连接阶段,不接管旧服务数据。
|
|
19
|
+
|
|
20
|
+
## 解绑与恢复
|
|
21
|
+
|
|
22
|
+
“解绑并保留数据”从项目列表移除登记、取消未开始任务并卸下本项目托管 Hook,保留代码、知识、会话及证据。实际分析或索引写入尚未结束时仍禁止解绑,防止丢失写入状态。队列本身不再被当成正在运行。
|
|
23
|
+
|
|
24
|
+
删除的是旧版本兼容路径,不是新版的故障恢复能力:v5 自身的重启恢复、提交去重、并发限制、失败重试和索引修复仍有效。`upgrade-recovery` 不再存在。
|
|
25
|
+
|
|
26
|
+
## 回归范围
|
|
27
|
+
|
|
28
|
+
旧格式迁移专用测试随旧实现删除,替换为旧目录拒绝且原字节不变、空状态启动、连接失败诊断与恢复、旧托管 Hook 的显式替换和回滚测试。真实提交链路继续由引擎 Git/Hook/journal/晋升/索引回归和五服务网页回归覆盖。模型替身和真实模型的结果分开记录;旧版本真实调用记录不计为本版通过。
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# Project Registry Schema
|
|
2
|
-
|
|
3
|
-
Status: current
|
|
4
|
-
Date: 2026-06-21
|
|
5
|
-
|
|
6
|
-
`projects.json` stores local project configuration. The current KB layout marker is:
|
|
7
|
-
|
|
8
|
-
```json
|
|
9
|
-
{
|
|
10
|
-
"kbSchemaVersion": "minimal"
|
|
11
|
-
}
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Relevant Fields
|
|
15
|
-
|
|
16
|
-
| Field | Default | Notes |
|
|
17
|
-
|---|---|---|
|
|
18
|
-
| `slug` | required | Registry key and project identifier |
|
|
19
|
-
| `displayName` | slug | UI label |
|
|
20
|
-
| `gitPath` | required | Source repository path |
|
|
21
|
-
| `kbPath` | generated from knowledge-store root | Final minimal KB location |
|
|
22
|
-
| `kbSchemaVersion` | `"minimal"` | Current KB framework marker |
|
|
1
|
+
# Project Registry Schema
|
|
2
|
+
|
|
3
|
+
Status: current
|
|
4
|
+
Date: 2026-06-21
|
|
5
|
+
|
|
6
|
+
`projects.json` stores local project configuration. The current KB layout marker is:
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{
|
|
10
|
+
"kbSchemaVersion": "minimal"
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Relevant Fields
|
|
15
|
+
|
|
16
|
+
| Field | Default | Notes |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `slug` | required | Registry key and project identifier |
|
|
19
|
+
| `displayName` | slug | UI label |
|
|
20
|
+
| `gitPath` | required | Source repository path |
|
|
21
|
+
| `kbPath` | generated from knowledge-store root | Final minimal KB location |
|
|
22
|
+
| `kbSchemaVersion` | `"minimal"` | Current KB framework marker |
|
|
23
23
|
| `goalStatus` | `"not-created"` | Review state of `GOAL.md` |
|
|
24
24
|
| `trackingStartCommit` | current `HEAD` on first import | Baseline commit for incremental KB tracking; commits before it are not analyzed |
|
|
25
25
|
| `trackingStartedAt` | current timestamp on first import | Time the tracking baseline was established |
|