archgraph-argo 0.12.1 → 0.12.3

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
- targetFeapName: workspace.targetFeapName,
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
- targetFeapName: workspace.targetFeapName,
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 targetFeapName = buildTargetFileName(workspaceName);
485
- const targetFeapPath = path.join(workspaceRoot, targetFeapName);
486
- if (!fs.existsSync(targetFeapPath)) {
487
- await fs.promises.copyFile(templateSourcePath, targetFeapPath);
488
- createdFiles.push(normalizeRelativePath(targetFeapName));
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(`${normalizeRelativePath(targetFeapName)} already exists`);
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
- targetFeapName,
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 buildTargetFileName(workspaceName) {
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}.feap`;
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
- targetFeapName: workspace.targetFeapName,
138
+ targetEaName: workspace.targetEaName,
139
139
  createdFiles: workspace.createdFiles,
140
140
  updatedFiles: workspace.updatedFiles,
141
141
  removedFiles: workspace.removedFiles,
@@ -1,22 +1,25 @@
1
1
  ---
2
2
  name: argo-init
3
- description: "通过 ARGO MCP 的 initializeWorkspace 接口完成工作区确定性的初始化(NEO4J 初始同步 + 语义生命周期 + canonical 校验 + subdiagram_views 一致性),无需执行 WORKSPACE 外脚本。Use when the user asks to verify Argo MCP readiness and perform or verify the canonical JSON-to-Neo4j initial sync plus semantic lifecycle init. Keywords: ARGO INIT, harness init, initializeWorkspace, Neo4j initial sync, semantic lifecycle."
3
+ description: "通过 ARGO MCP 的 initializeWorkspace 接口完成工作区确定性的初始化(NEO4J 初始同步 + .qea 全量投影 + 语义生命周期 + canonical 校验 + subdiagram_views 一致性),无需执行 WORKSPACE 外脚本。Use when the user asks to verify Argo MCP readiness and perform or verify the canonical JSON-to-Neo4j initial sync, .qea full projection (target file must be this repo's own .qea), plus semantic lifecycle init. Keywords: ARGO INIT, harness init, initializeWorkspace, Neo4j initial sync, qea projection, semantic lifecycle."
4
4
  argument-hint: scope-or-mode
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
8
8
  # ARGO INIT
9
9
 
10
- `argo-init` 通过 ARGO MCP 的 `initializeWorkspace` 接口完成确定性初始化:工作区 bootstrap(缺 `SystemArchitecture.json` / `.feap` 自动生成)+ Neo4j 结构投影同步 + 语义生命周期初始化 + canonical 校验 + subdiagram_views 一致性,并返回完整报告。**不需要也不应执行任何 WORKSPACE 外脚本**——所有确定性步骤都在 MCP 进程内完成,避免扩大访问面。
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` 时以当前项目名拷贝默认模板。
13
- - 本机 Neo4j 连接可用,canonical 意图图完成至少一次 JSON -> Neo4j 初始同步并通过一致性校验。
12
+ - 工作区缺少 `design/KG/SystemArchitecture.json` 时自动从部署的 `defaults` 拷贝默认模板;缺 EA 模型文件(仓库根无 `.qea`/`.feap`/`.eap`)时以当前项目名拷贝默认 `.qea` 模板(不再补建遗留 `.feap`)。
13
+ - 本机 Neo4j 连接可用,canonical 意图图完成至少一次 JSON -> Neo4j 初始同步并通过一致性校验;**投影到的 Neo4j 数据库名称必须与本仓库名称一致**(如仓库 archgraph → 库 archgraph),不一致须报告为告警/失败。
14
+ - **.qea 投影**:init 对仓库 EA 文件(仓库根 `.qea`,经 `ARGO_EA_QEA` 或仓库根唯一 `*.qea` 解析)执行整库清空后全量重建;**必须确认投影目标是本仓库自己的 `.qea` 文件**,并报告投影成功/失败与耗时。
14
15
  - 语义生命周期:双 gate 未开启时记录 skipped/disabled;开启时执行全量 embedding backfill 与 readiness 对齐。
15
16
 
16
17
  ## Rules
17
18
 
18
19
  - **MUST** 调用 ARGO MCP 工具 `initializeWorkspace`(传当前工作区根)执行确定性初始化,并以其返回报告为最终判断依据。
19
- - **MUST** 报告 `mcp` / `systemArchitecture` / `neo4j` / `semanticLifecycle` / `subdiagramViews` 与整体 `status`。
20
+ - **MUST** 报告 `mcp` / `systemArchitecture` / `neo4j` / `qeaFullProjection` / `semanticLifecycle` / `subdiagramViews` 与整体 `status`。
21
+ - **MUST** 核验并报告:① `.qea` 投影是否成功(`qeaFullProjection.status`),且投影目标 `qeaFullProjection.qea` 是否为**本仓库自己的 .qea 文件**(解析自 `ARGO_EA_QEA` 或仓库根唯一 `*.qea`);目标不是本仓库文件或投影失败 → 报告为告警/失败,不得视为 init 成功。
22
+ - **MUST** 核验并报告:Neo4j 投影目标数据库名(`neo4j.database`)是否**与本仓库名一致**(仓库 basename == 数据库名);不一致 → 报告为告警/失败。
20
23
  - **MUST NOT** 读取、打印或复述 `.env` 中的 secret 值;排查时只允许报告 key 是否存在、ACL 主体。
21
24
  - **MUST NOT** 通过 shell 手工执行 WORKSPACE 外的初始化脚本或一组无关命令来替代 `initializeWorkspace`(除非报告显示底层脚本自身失败需要排查)。
22
25
 
@@ -26,17 +29,21 @@ disable-model-invocation: true
26
29
 
27
30
  调用 ARGO MCP 工具 `initializeWorkspace`(传入当前工作区根 `workspaceRoot`)。该接口在 MCP 进程内完成全部确定性步骤并返回报告:
28
31
 
29
- - `workspaceBootstrap`:缺 `SystemArchitecture.json` / `.feap` 时自动生成(createdFiles / skippedSteps
32
+ - `workspaceBootstrap`:缺 `SystemArchitecture.json` / EA 模型文件时自动生成 `.qea`(createdFiles / skippedSteps;仓库根已有 `.qea`/`.feap` 时不重复补建)
30
33
  - `mcp`:ARGO MCP 健康(协议 / tools-list / ping)
31
34
  - `systemArchitecture`:canonical 校验(元素/关系/视图计数)
32
35
  - `subdiagramViews`:subdiagram_views 一致性检查/修复
33
- - `neo4j`:Neo4j 连通 + 结构投影初始同步 + 一致性校验(initialSync / verification
36
+ - `neo4j`:Neo4j 连通 + 结构投影初始同步 + 一致性校验(initialSync / verification);**并核验投影目标数据库名 == 本仓库名**
37
+ - `qeaFullProjection`:仓库 EA(.qea)整库清空重建 + 一致性(status / qea 目标路径 / ms);**核验 qea 目标 == 本仓库自己的 .qea 文件**
34
38
  - `semanticLifecycle`:语义生命周期初始化(state / alignment / readiness;未开 gate 时 skipped/disabled)
35
39
 
36
40
  ### 2. Interpret The Report
37
41
 
38
42
  - 整体 `status=ok`:环境就绪。
39
- - 任一 section `status=failed` → 整体 `status=failed`,指出失败阶段:`mcp` / `systemArchitecture` / `neo4j` / `semanticLifecycle` / `subdiagramViews`。
43
+ - 任一 section `status=failed` → 整体 `status=failed`,指出失败阶段:`mcp` / `systemArchitecture` / `neo4j` / `qeaFullProjection` / `semanticLifecycle` / `subdiagramViews`。
44
+ - **目标一致性核验(在报告中明确给出)**:
45
+ - `qeaFullProjection.qea` 是否为**本仓库自己的 .qea 文件**(== 解析自 `ARGO_EA_QEA`/仓库根唯一 `*.qea` 的路径);投影成功且目标为本仓库文件才算该 section ok;投影失败或目标非本仓库文件 → 报告告警/失败。
46
+ - `neo4j.database` 是否**与本仓库名(仓库根目录名)一致**;不一致 → 报告告警/失败。
40
47
 
41
48
  ### 3. Handle Secret File Blockers(仅当报告含 secret 相关失败)
42
49
 
@@ -57,7 +64,7 @@ icacls "$env:USERPROFILE\.argo\.env"
57
64
 
58
65
  ### 4. Report Concisely
59
66
 
60
- 输出应直接说明:`mcp` 是否正常、`SystemArchitecture.json` 是否正常、Neo4j 是否连通、是否完成一次初始同步、语义生命周期状态与 alignment、报告路径(`.argo/temp/argo-harness-init-report.json`)。
67
+ 输出应直接说明:`mcp` 是否正常、`SystemArchitecture.json` 是否正常、Neo4j 是否连通且**投影数据库名是否与本仓库名一致**、`.qea` 全量投影是否成功且**目标是否为本仓库 .qea 文件**、是否完成一次初始同步、语义生命周期状态与 alignment、报告路径(`.argo/temp/argo-harness-init-report.json`)。
61
68
 
62
69
  ## Output
63
70
 
@@ -67,11 +74,14 @@ icacls "$env:USERPROFILE\.argo\.env"
67
74
  - overall status: ok / failed
68
75
  - whether mcp health passed
69
76
  - whether neo4j health passed
77
+ - whether .qea full projection passed
70
78
 
71
79
  ### 2. Sync Status
72
80
  - whether initial sync was executed
73
81
  - whether verification matched JSON and Neo4j
74
82
  - current counts summary when available
83
+ - **neo4j 投影数据库名 == 本仓库名?**(是/否,给出名称)
84
+ - **qea 投影目标文件 == 本仓库 .qea?**(是/否,给出路径);投影耗时 ms
75
85
 
76
86
  ### 3. Semantic Lifecycle Status
77
87
  - whether semantic lifecycle init ran, skipped, or failed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "Deploy the ArchGraph ARGO toolchain, skills, and rules (schema, scripts, argo-init skill, global rule) with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {