nexarch 0.9.19 → 0.9.21
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.
|
@@ -1367,8 +1367,8 @@ export async function initProject(args) {
|
|
|
1367
1367
|
// Build relationships:
|
|
1368
1368
|
// - Root-level deps → wired to the top-level project entity
|
|
1369
1369
|
// - Sub-package deps → wired to each sub-package entity
|
|
1370
|
-
// - Sub-packages that are apps →
|
|
1371
|
-
// - Sub-package deps that resolve to another sub-package →
|
|
1370
|
+
// - Sub-packages that are apps → root composes sub-app
|
|
1371
|
+
// - Sub-package deps that resolve to another sub-package → depends_on
|
|
1372
1372
|
const relationships = [];
|
|
1373
1373
|
const seenRelPairs = new Set();
|
|
1374
1374
|
let relationshipAddAttempts = 0;
|
|
@@ -1403,19 +1403,13 @@ export async function initProject(args) {
|
|
|
1403
1403
|
seenSubKeys.add(`rel:${sp.externalKey}`);
|
|
1404
1404
|
// Wire structural relationship to the top-level project entity:
|
|
1405
1405
|
// - application_component → part_of → root (component within a single deployable app)
|
|
1406
|
-
// - application → root
|
|
1407
|
-
//
|
|
1408
|
-
// application root: sub-app part_of root (treat as a bounded sub-application)
|
|
1406
|
+
// - application → root composes sub-app (ontology only allows application on part_of FROM
|
|
1407
|
+
// for application_component/application_function, not application itself)
|
|
1409
1408
|
if (sp.entityType === "application_component") {
|
|
1410
1409
|
addRel("part_of", sp.externalKey, projectExternalKey);
|
|
1411
1410
|
}
|
|
1412
1411
|
else if (sp.entityType === "application") {
|
|
1413
|
-
|
|
1414
|
-
addRel("composes", projectExternalKey, sp.externalKey);
|
|
1415
|
-
}
|
|
1416
|
-
else {
|
|
1417
|
-
addRel("part_of", sp.externalKey, projectExternalKey);
|
|
1418
|
-
}
|
|
1412
|
+
addRel("composes", projectExternalKey, sp.externalKey);
|
|
1419
1413
|
}
|
|
1420
1414
|
// Wire each sub-package's resolved deps to itself
|
|
1421
1415
|
for (const dep of sp.depSpecs) {
|
|
@@ -1445,7 +1439,7 @@ export async function initProject(args) {
|
|
|
1445
1439
|
try {
|
|
1446
1440
|
const orgRaw = await callMcpProfiled("nexarch_list_entities", { entityTypeCode: "organisation", status: "active", limit: 1, companyId: creds.companyId }, { entityTypeCode: "organisation", limit: 1 });
|
|
1447
1441
|
const orgData = parseToolText(orgRaw);
|
|
1448
|
-
const org = (orgData.entities ?? [])
|
|
1442
|
+
const org = (orgData.entities ?? []).find((e) => e.entityTypeCode === "organisation");
|
|
1449
1443
|
if (org?.entityRef || org?.externalKey)
|
|
1450
1444
|
orgExternalKey = (org.entityRef ?? org.externalKey);
|
|
1451
1445
|
}
|
|
@@ -1740,7 +1734,7 @@ export async function initProject(args) {
|
|
|
1740
1734
|
lines.push(` nexarch add-relationship --from "decision_record:..." --to "${projectExternalKey}" --type decides`);
|
|
1741
1735
|
lines.push("");
|
|
1742
1736
|
lines.push("RELATIONSHIP DIRECTION RULES (for sub-packages):");
|
|
1743
|
-
lines.push(" apps/* (deployable components) →
|
|
1737
|
+
lines.push(" apps/* (deployable components) → parent composes → sub-application");
|
|
1744
1738
|
lines.push(" packages/* (shared libraries) → parent depends_on → library");
|
|
1745
1739
|
lines.push(" Deps wired from manifests are already pre-wired; do not re-add unless key changed.");
|
|
1746
1740
|
if (graphDiff) {
|