archgraph-argo 0.12.2 → 0.12.4
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.
|
@@ -33,8 +33,8 @@ const EA_TEMPLATE_PATH_CANDIDATES = [
|
|
|
33
33
|
['.opencode', 'EA-model-template.qea'],
|
|
34
34
|
['eatool', 'EA-model-template.qea'],
|
|
35
35
|
['EA-model-template.qea'],
|
|
36
|
-
['Argo.feap'],
|
|
37
36
|
];
|
|
37
|
+
const EA_MODEL_EXTENSIONS = new Set(['.qea', '.feap', '.eap']);
|
|
38
38
|
const WINDOWS_RESERVED_NAMES = new Set([
|
|
39
39
|
'CON', 'PRN', 'AUX', 'NUL',
|
|
40
40
|
'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9',
|
|
@@ -379,7 +379,7 @@ async function callTool(name, args = {}, progressToken = null, dependencies = un
|
|
|
379
379
|
return toolResult({
|
|
380
380
|
status: report.status,
|
|
381
381
|
workspaceRoot: workspace.workspaceRoot,
|
|
382
|
-
|
|
382
|
+
targetEaName: workspace.targetEaName,
|
|
383
383
|
createdFiles: workspace.createdFiles,
|
|
384
384
|
updatedFiles: workspace.updatedFiles,
|
|
385
385
|
removedFiles: workspace.removedFiles,
|
|
@@ -387,7 +387,7 @@ async function callTool(name, args = {}, progressToken = null, dependencies = un
|
|
|
387
387
|
workspaceBootstrap: {
|
|
388
388
|
status: 'ok',
|
|
389
389
|
workspaceRoot: workspace.workspaceRoot,
|
|
390
|
-
|
|
390
|
+
targetEaName: workspace.targetEaName,
|
|
391
391
|
createdFiles: workspace.createdFiles,
|
|
392
392
|
updatedFiles: workspace.updatedFiles,
|
|
393
393
|
removedFiles: workspace.removedFiles,
|
|
@@ -481,13 +481,18 @@ async function initializeWorkspace(workspaceRoot) {
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
const templateSourcePath = resolveTemplateSourcePath(workspaceRoot);
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
484
|
+
const targetEaName = buildEaTargetFileName(workspaceName);
|
|
485
|
+
const targetEaPath = path.join(workspaceRoot, targetEaName);
|
|
486
|
+
const existingEaFiles = listExistingEaModelFiles(workspaceRoot);
|
|
487
|
+
if (existingEaFiles.length === 0) {
|
|
488
|
+
// No EA model file in the workspace: bootstrap a project-named .qea from the
|
|
489
|
+
// template (EA 17.2+ .qea/SQLite). Never generate a legacy .feap anymore.
|
|
490
|
+
await fs.promises.copyFile(templateSourcePath, targetEaPath);
|
|
491
|
+
createdFiles.push(normalizeRelativePath(targetEaName));
|
|
492
|
+
} else if (existingEaFiles.includes(targetEaName)) {
|
|
493
|
+
skippedSteps.push(`${normalizeRelativePath(targetEaName)} already exists`);
|
|
489
494
|
} else {
|
|
490
|
-
skippedSteps.push(
|
|
495
|
+
skippedSteps.push(`EA model already present (${existingEaFiles.join(', ')}); skip bootstrapping ${normalizeRelativePath(targetEaName)}`);
|
|
491
496
|
}
|
|
492
497
|
|
|
493
498
|
for (const handoffPath of HANDOFF_FILES_TO_RESET) {
|
|
@@ -509,7 +514,7 @@ async function initializeWorkspace(workspaceRoot) {
|
|
|
509
514
|
return {
|
|
510
515
|
workspaceRoot,
|
|
511
516
|
qeaFullProjection,
|
|
512
|
-
|
|
517
|
+
targetEaName,
|
|
513
518
|
createdFiles,
|
|
514
519
|
updatedFiles,
|
|
515
520
|
removedFiles,
|
|
@@ -543,12 +548,24 @@ function resolveGraphDefaultSourcePath() {
|
|
|
543
548
|
throw new Error(`Unable to locate default SystemArchitecture template. Checked: bundled ${BUNDLED_GRAPH_DEFAULT_SEGMENTS.join('/')}`);
|
|
544
549
|
}
|
|
545
550
|
|
|
546
|
-
function
|
|
551
|
+
function listExistingEaModelFiles(workspaceRoot) {
|
|
552
|
+
let names = [];
|
|
553
|
+
try {
|
|
554
|
+
names = fs.readdirSync(workspaceRoot).filter(name =>
|
|
555
|
+
EA_MODEL_EXTENSIONS.has(path.extname(name).toLowerCase()),
|
|
556
|
+
);
|
|
557
|
+
} catch {
|
|
558
|
+
/* treat an unreadable root as having no EA model file */
|
|
559
|
+
}
|
|
560
|
+
return names.sort();
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
function buildEaTargetFileName(workspaceName) {
|
|
547
564
|
const sanitized = sanitizeFileName(workspaceName) || 'workspace';
|
|
548
565
|
const safeBaseName = WINDOWS_RESERVED_NAMES.has(sanitized.toUpperCase())
|
|
549
566
|
? `${sanitized}_workspace`
|
|
550
567
|
: sanitized;
|
|
551
|
-
return `${safeBaseName}.
|
|
568
|
+
return `${safeBaseName}.qea`;
|
|
552
569
|
}
|
|
553
570
|
|
|
554
571
|
function sanitizeFileName(value) {
|
|
@@ -135,7 +135,7 @@ async function ensureWorkspaceBootstrap({ checkOnly, workspaceRoot }) {
|
|
|
135
135
|
return {
|
|
136
136
|
status: 'ok',
|
|
137
137
|
workspaceRoot: workspace.workspaceRoot,
|
|
138
|
-
|
|
138
|
+
targetEaName: workspace.targetEaName,
|
|
139
139
|
createdFiles: workspace.createdFiles,
|
|
140
140
|
updatedFiles: workspace.updatedFiles,
|
|
141
141
|
removedFiles: workspace.removedFiles,
|
|
@@ -7,9 +7,9 @@ disable-model-invocation: true
|
|
|
7
7
|
|
|
8
8
|
# ARGO INIT
|
|
9
9
|
|
|
10
|
-
`argo-init` 通过 ARGO MCP 的 `initializeWorkspace` 接口完成确定性初始化:工作区 bootstrap(缺 `SystemArchitecture.json` /
|
|
10
|
+
`argo-init` 通过 ARGO MCP 的 `initializeWorkspace` 接口完成确定性初始化:工作区 bootstrap(缺 `SystemArchitecture.json` / EA 模型文件(`.qea`)自动生成)+ Neo4j 结构投影同步 + **.qea 全量投影(整库清空重建,逻辑同 Neo4j init)** + 语义生命周期初始化 + canonical 校验 + subdiagram_views 一致性,并返回完整报告。**不需要也不应执行任何 WORKSPACE 外脚本**——所有确定性步骤都在 MCP 进程内完成,避免扩大访问面。
|
|
11
11
|
|
|
12
|
-
- 工作区缺少 `design/KG/SystemArchitecture.json` 时自动从部署的 `defaults` 拷贝默认模板;缺 `.feap`
|
|
12
|
+
- 工作区缺少 `design/KG/SystemArchitecture.json` 时自动从部署的 `defaults` 拷贝默认模板;缺 EA 模型文件(仓库根无 `.qea`/`.feap`/`.eap`)时以当前项目名拷贝默认 `.qea` 模板(不再补建遗留 `.feap`)。
|
|
13
13
|
- 本机 Neo4j 连接可用,canonical 意图图完成至少一次 JSON -> Neo4j 初始同步并通过一致性校验;**投影到的 Neo4j 数据库名称必须与本仓库名称一致**(如仓库 archgraph → 库 archgraph),不一致须报告为告警/失败。
|
|
14
14
|
- **.qea 投影**:init 对仓库 EA 文件(仓库根 `.qea`,经 `ARGO_EA_QEA` 或仓库根唯一 `*.qea` 解析)执行整库清空后全量重建;**必须确认投影目标是本仓库自己的 `.qea` 文件**,并报告投影成功/失败与耗时。
|
|
15
15
|
- 语义生命周期:双 gate 未开启时记录 skipped/disabled;开启时执行全量 embedding backfill 与 readiness 对齐。
|
|
@@ -29,7 +29,7 @@ disable-model-invocation: true
|
|
|
29
29
|
|
|
30
30
|
调用 ARGO MCP 工具 `initializeWorkspace`(传入当前工作区根 `workspaceRoot`)。该接口在 MCP 进程内完成全部确定性步骤并返回报告:
|
|
31
31
|
|
|
32
|
-
- `workspaceBootstrap`:缺 `SystemArchitecture.json` / `.
|
|
32
|
+
- `workspaceBootstrap`:缺 `SystemArchitecture.json` / EA 模型文件时自动生成 `.qea`(createdFiles / skippedSteps;仓库根已有 `.qea`/`.feap` 时不重复补建)
|
|
33
33
|
- `mcp`:ARGO MCP 健康(协议 / tools-list / ping)
|
|
34
34
|
- `systemArchitecture`:canonical 校验(元素/关系/视图计数)
|
|
35
35
|
- `subdiagramViews`:subdiagram_views 一致性检查/修复
|
package/package.json
CHANGED