jumbo-cli 3.19.0 → 3.20.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/dist/application/context/relations/audit/AmbiguousRelationNodeFinding.d.ts +6 -0
- package/dist/application/context/relations/audit/AmbiguousRelationNodeFinding.d.ts.map +1 -0
- package/dist/application/context/relations/audit/AmbiguousRelationNodeFinding.js +2 -0
- package/dist/application/context/relations/audit/AmbiguousRelationNodeFinding.js.map +1 -0
- package/dist/application/context/relations/audit/AuditRelationsController.d.ts +13 -0
- package/dist/application/context/relations/audit/AuditRelationsController.d.ts.map +1 -0
- package/dist/application/context/relations/audit/AuditRelationsController.js +15 -0
- package/dist/application/context/relations/audit/AuditRelationsController.js.map +1 -0
- package/dist/application/context/relations/audit/AuditRelationsRequest.d.ts +6 -0
- package/dist/application/context/relations/audit/AuditRelationsRequest.d.ts.map +1 -0
- package/dist/application/context/relations/audit/AuditRelationsRequest.js +2 -0
- package/dist/application/context/relations/audit/AuditRelationsRequest.js.map +1 -0
- package/dist/application/context/relations/audit/DanglingRelationFinding.d.ts +8 -0
- package/dist/application/context/relations/audit/DanglingRelationFinding.d.ts.map +1 -0
- package/dist/application/context/relations/audit/DanglingRelationFinding.js +2 -0
- package/dist/application/context/relations/audit/DanglingRelationFinding.js.map +1 -0
- package/dist/application/context/relations/audit/IRelationNodeCatalog.d.ts +5 -0
- package/dist/application/context/relations/audit/IRelationNodeCatalog.d.ts.map +1 -0
- package/dist/application/context/relations/audit/IRelationNodeCatalog.js +2 -0
- package/dist/application/context/relations/audit/IRelationNodeCatalog.js.map +1 -0
- package/dist/application/context/relations/audit/InactiveOnlyRelationNodeFinding.d.ts +8 -0
- package/dist/application/context/relations/audit/InactiveOnlyRelationNodeFinding.d.ts.map +1 -0
- package/dist/application/context/relations/audit/InactiveOnlyRelationNodeFinding.js +2 -0
- package/dist/application/context/relations/audit/InactiveOnlyRelationNodeFinding.js.map +1 -0
- package/dist/application/context/relations/audit/IsolatedRelationNodeFinding.d.ts +7 -0
- package/dist/application/context/relations/audit/IsolatedRelationNodeFinding.d.ts.map +1 -0
- package/dist/application/context/relations/audit/IsolatedRelationNodeFinding.js +2 -0
- package/dist/application/context/relations/audit/IsolatedRelationNodeFinding.js.map +1 -0
- package/dist/application/context/relations/audit/RelationAuditPolicy.d.ts +15 -0
- package/dist/application/context/relations/audit/RelationAuditPolicy.d.ts.map +1 -0
- package/dist/application/context/relations/audit/RelationAuditPolicy.js +131 -0
- package/dist/application/context/relations/audit/RelationAuditPolicy.js.map +1 -0
- package/dist/application/context/relations/audit/RelationAuditResult.d.ts +30 -0
- package/dist/application/context/relations/audit/RelationAuditResult.d.ts.map +1 -0
- package/dist/application/context/relations/audit/RelationAuditResult.js +2 -0
- package/dist/application/context/relations/audit/RelationAuditResult.js.map +1 -0
- package/dist/application/context/relations/audit/RelationAuditSummary.d.ts +13 -0
- package/dist/application/context/relations/audit/RelationAuditSummary.d.ts.map +1 -0
- package/dist/application/context/relations/audit/RelationAuditSummary.js +2 -0
- package/dist/application/context/relations/audit/RelationAuditSummary.js.map +1 -0
- package/dist/application/context/relations/audit/RelationNodeCatalogEntry.d.ts +8 -0
- package/dist/application/context/relations/audit/RelationNodeCatalogEntry.d.ts.map +1 -0
- package/dist/application/context/relations/audit/RelationNodeCatalogEntry.js +2 -0
- package/dist/application/context/relations/audit/RelationNodeCatalogEntry.js.map +1 -0
- package/dist/application/host/IApplicationContainer.d.ts +4 -0
- package/dist/application/host/IApplicationContainer.d.ts.map +1 -1
- package/dist/domain/relations/Constants.d.ts +8 -0
- package/dist/domain/relations/Constants.d.ts.map +1 -1
- package/dist/domain/relations/Constants.js +8 -0
- package/dist/domain/relations/Constants.js.map +1 -1
- package/dist/infrastructure/context/relations/audit/SqliteRelationNodeCatalog.d.ts +11 -0
- package/dist/infrastructure/context/relations/audit/SqliteRelationNodeCatalog.d.ts.map +1 -0
- package/dist/infrastructure/context/relations/audit/SqliteRelationNodeCatalog.js +36 -0
- package/dist/infrastructure/context/relations/audit/SqliteRelationNodeCatalog.js.map +1 -0
- package/dist/infrastructure/host/HostBuilder.d.ts.map +1 -1
- package/dist/infrastructure/host/HostBuilder.js +8 -0
- package/dist/infrastructure/host/HostBuilder.js.map +1 -1
- package/dist/presentation/cli/commands/registry/generated-commands.d.ts.map +1 -1
- package/dist/presentation/cli/commands/registry/generated-commands.js +6 -0
- package/dist/presentation/cli/commands/registry/generated-commands.js.map +1 -1
- package/dist/presentation/cli/commands/relations/audit/RelationAuditOutputBuilder.d.ts +11 -0
- package/dist/presentation/cli/commands/relations/audit/RelationAuditOutputBuilder.d.ts.map +1 -0
- package/dist/presentation/cli/commands/relations/audit/RelationAuditOutputBuilder.js +91 -0
- package/dist/presentation/cli/commands/relations/audit/RelationAuditOutputBuilder.js.map +1 -0
- package/dist/presentation/cli/commands/relations/audit/relations.audit.d.ts +8 -0
- package/dist/presentation/cli/commands/relations/audit/relations.audit.d.ts.map +1 -0
- package/dist/presentation/cli/commands/relations/audit/relations.audit.js +58 -0
- package/dist/presentation/cli/commands/relations/audit/relations.audit.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { RelationAuditCheck } from "../../../../../domain/relations/Constants.js";
|
|
2
|
+
import { TerminalOutputBuilder } from "../../../output/TerminalOutputBuilder.js";
|
|
3
|
+
import { Symbols } from "../../../rendering/StyleConfig.js";
|
|
4
|
+
export class RelationAuditOutputBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.builder = new TerminalOutputBuilder();
|
|
7
|
+
}
|
|
8
|
+
build(result) {
|
|
9
|
+
this.builder.reset();
|
|
10
|
+
const lines = ["Relation Graph Audit"];
|
|
11
|
+
if (result.entityType)
|
|
12
|
+
lines.push(`Entity type: ${result.entityType}`);
|
|
13
|
+
if (result.requestedChecks.includes(RelationAuditCheck.SUMMARY)) {
|
|
14
|
+
lines.push("", "Summary");
|
|
15
|
+
lines.push(` Nodes: ${result.summary.nodes.count}`);
|
|
16
|
+
this.appendCounts(lines, result.summary.nodes.byEntityType, " ");
|
|
17
|
+
lines.push(` Relations: ${result.summary.relations.count}`);
|
|
18
|
+
lines.push(" By relation type:");
|
|
19
|
+
this.appendCounts(lines, result.summary.relations.byRelationType, " ");
|
|
20
|
+
lines.push(" By strength:");
|
|
21
|
+
this.appendCounts(lines, result.summary.relations.byStrength, " ");
|
|
22
|
+
lines.push(" By status:");
|
|
23
|
+
this.appendCounts(lines, result.summary.relations.byStatus, " ");
|
|
24
|
+
}
|
|
25
|
+
if (result.requestedChecks.includes(RelationAuditCheck.DANGLING)) {
|
|
26
|
+
lines.push("", `Dangling relations (${result.findings.dangling.count})`);
|
|
27
|
+
this.appendEmpty(lines, result.findings.dangling.count);
|
|
28
|
+
for (const finding of result.findings.dangling.items) {
|
|
29
|
+
const missing = finding.missingEndpoints
|
|
30
|
+
.map((endpoint) => `${endpoint.entityType}:${endpoint.entityId}`)
|
|
31
|
+
.join(", ");
|
|
32
|
+
lines.push(` ${finding.relationId}: missing ${missing}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (result.requestedChecks.includes(RelationAuditCheck.ISOLATED)) {
|
|
36
|
+
lines.push("", `Isolated entities (${result.findings.isolated.count})`);
|
|
37
|
+
this.appendEmpty(lines, result.findings.isolated.count);
|
|
38
|
+
for (const finding of result.findings.isolated.items) {
|
|
39
|
+
lines.push(` ${finding.entityType}:${finding.entityId} [${finding.lifecycleState}]`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (result.requestedChecks.includes(RelationAuditCheck.INACTIVE_ONLY)) {
|
|
43
|
+
lines.push("", `Inactive-only entities (${result.findings.inactiveOnly.count})`);
|
|
44
|
+
this.appendEmpty(lines, result.findings.inactiveOnly.count);
|
|
45
|
+
for (const finding of result.findings.inactiveOnly.items) {
|
|
46
|
+
lines.push(` ${finding.entityType}:${finding.entityId} [${finding.lifecycleState}] relations: ${finding.relationIds.join(", ")}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (result.requestedChecks.includes(RelationAuditCheck.AMBIGUOUS_ID)) {
|
|
50
|
+
lines.push("", `Ambiguous entity IDs (${result.findings.ambiguousId.count})`);
|
|
51
|
+
this.appendEmpty(lines, result.findings.ambiguousId.count);
|
|
52
|
+
for (const finding of result.findings.ambiguousId.items) {
|
|
53
|
+
const typedIds = finding.entityTypes.map((entityType) => `${entityType}:${finding.entityId}`);
|
|
54
|
+
lines.push(` ${finding.entityId}: ${typedIds.join(", ")}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
this.builder.addPrompt(lines.join("\n"));
|
|
58
|
+
return this.builder.build();
|
|
59
|
+
}
|
|
60
|
+
buildStructuredOutput(result) {
|
|
61
|
+
this.builder.reset();
|
|
62
|
+
this.builder.addData({
|
|
63
|
+
requestedChecks: [...result.requestedChecks],
|
|
64
|
+
filter: { entityType: result.entityType },
|
|
65
|
+
summary: result.summary,
|
|
66
|
+
findings: result.findings,
|
|
67
|
+
});
|
|
68
|
+
return this.builder.build();
|
|
69
|
+
}
|
|
70
|
+
buildFailureError(error) {
|
|
71
|
+
this.builder.reset();
|
|
72
|
+
const message = error instanceof Error ? error.message : error;
|
|
73
|
+
this.builder.addPrompt(`${Symbols.cross} Failed to audit relations: ${message}`);
|
|
74
|
+
this.builder.addData({ error: "Failed to audit relations", message });
|
|
75
|
+
return this.builder.build();
|
|
76
|
+
}
|
|
77
|
+
appendCounts(lines, counts, indent) {
|
|
78
|
+
const entries = Object.entries(counts);
|
|
79
|
+
if (entries.length === 0) {
|
|
80
|
+
lines.push(`${indent}None`);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const [label, count] of entries)
|
|
84
|
+
lines.push(`${indent}${label}: ${count}`);
|
|
85
|
+
}
|
|
86
|
+
appendEmpty(lines, count) {
|
|
87
|
+
if (count === 0)
|
|
88
|
+
lines.push(" None");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=RelationAuditOutputBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationAuditOutputBuilder.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/relations/audit/RelationAuditOutputBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,MAAM,OAAO,0BAA0B;IAAvC;QACmB,YAAO,GAAG,IAAI,qBAAqB,EAAE,CAAC;IA6FzD,CAAC;IA3FC,KAAK,CAAC,MAA2B;QAC/B,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACvC,IAAI,MAAM,CAAC,UAAU;YAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAEvE,IAAI,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;YAChE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YACrD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACpE,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;YAC7D,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;YAClC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CA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F,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IAEO,YAAY,CAAC,KAAe,EAAE,MAAwC,EAAE,MAAc;QAC5F,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,MAAM,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QACD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,KAAK,KAAK,KAAK,EAAE,CAAC,CAAC;IAClF,CAAC;IAEO,WAAW,CAAC,KAAe,EAAE,KAAa;QAChD,IAAI,KAAK,KAAK,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IApplicationContainer } from "../../../../../application/host/IApplicationContainer.js";
|
|
2
|
+
import { CommandMetadata } from "../../registry/CommandMetadata.js";
|
|
3
|
+
export declare const metadata: CommandMetadata;
|
|
4
|
+
export declare function relationsAudit(options: {
|
|
5
|
+
check?: string[] | string;
|
|
6
|
+
entityType?: string;
|
|
7
|
+
}, container: IApplicationContainer): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=relations.audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relations.audit.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/relations/audit/relations.audit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AAOjG,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGpE,eAAO,MAAM,QAAQ,EAAE,eAqBtB,CAAC;AAEF,wBAAsB,cAAc,CAClC,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3D,SAAS,EAAE,qBAAqB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Renderer } from "../../../rendering/Renderer.js";
|
|
2
|
+
import { RelationAuditOutputBuilder } from "./RelationAuditOutputBuilder.js";
|
|
3
|
+
export const metadata = {
|
|
4
|
+
description: "Audit relation graph coverage and disconnected context",
|
|
5
|
+
category: "relations",
|
|
6
|
+
options: [
|
|
7
|
+
{
|
|
8
|
+
flags: "-c, --check <checks...>",
|
|
9
|
+
description: "Checks: dangling, isolated, inactive-only, ambiguous-id, summary (all by default)",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
flags: "--entity-type <type>",
|
|
13
|
+
description: "Filter findings and summary data by relation endpoint entity type",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
examples: [
|
|
17
|
+
{ command: "jumbo relations audit", description: "Run every relation graph audit check" },
|
|
18
|
+
{ command: "jumbo relations audit --check dangling isolated", description: "Find missing endpoints and isolated entities" },
|
|
19
|
+
{ command: "jumbo relations audit --check summary --entity-type component", description: "Summarize component graph coverage" },
|
|
20
|
+
{ command: "jumbo relations audit --format json", description: "Return the stable audit result as JSON" },
|
|
21
|
+
],
|
|
22
|
+
related: ["relations list", "relations traverse", "relations path"],
|
|
23
|
+
requiresProject: true,
|
|
24
|
+
};
|
|
25
|
+
export async function relationsAudit(options, container) {
|
|
26
|
+
const renderer = Renderer.getInstance();
|
|
27
|
+
const outputBuilder = new RelationAuditOutputBuilder();
|
|
28
|
+
try {
|
|
29
|
+
const checks = options.check
|
|
30
|
+
? (Array.isArray(options.check) ? options.check : [options.check]).map((check) => check.toLowerCase())
|
|
31
|
+
: undefined;
|
|
32
|
+
const request = {
|
|
33
|
+
checks: checks,
|
|
34
|
+
entityType: options.entityType,
|
|
35
|
+
};
|
|
36
|
+
const result = await container.auditRelationsController.handle(request);
|
|
37
|
+
const output = renderer.getConfig().format === "text"
|
|
38
|
+
? outputBuilder.build(result)
|
|
39
|
+
: outputBuilder.buildStructuredOutput(result);
|
|
40
|
+
const dataSection = output.getSections().find((section) => section.type === "data");
|
|
41
|
+
if (renderer.getConfig().format === "text")
|
|
42
|
+
renderer.info(output.toHumanReadable());
|
|
43
|
+
else if (dataSection)
|
|
44
|
+
renderer.data(dataSection.content);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const output = outputBuilder.buildFailureError(error instanceof Error ? error : String(error));
|
|
48
|
+
if (renderer.getConfig().format === "text")
|
|
49
|
+
renderer.error(output.toHumanReadable());
|
|
50
|
+
else {
|
|
51
|
+
const dataSection = output.getSections().find((section) => section.type === "data");
|
|
52
|
+
if (dataSection)
|
|
53
|
+
renderer.data(dataSection.content);
|
|
54
|
+
}
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=relations.audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relations.audit.js","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/relations/audit/relations.audit.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACvC,WAAW,EAAE,wDAAwD;IACrE,QAAQ,EAAE,WAAW;IACrB,OAAO,EAAE;QACP;YACE,KAAK,EAAE,yBAAyB;YAChC,WAAW,EAAE,mFAAmF;SACjG;QACD;YACE,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE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