archgraph-argo 0.1.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.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +115 -0
  3. package/argo/package.json +8 -0
  4. package/argo/rules/intent-architecture-global-rule.md +45 -0
  5. package/argo/schema/ImplementationToCodingHandoff.schema.json +252 -0
  6. package/argo/schema/ImplementationToIntentTraceProposal.schema.json +180 -0
  7. package/argo/schema/IntentToImplementationHandoff.schema.json +75 -0
  8. package/argo/schema/SystemArchitecture.schema.json +378 -0
  9. package/argo/schema/archimate3.2.pdf +0 -0
  10. package/argo/scripts/ARCHITECTURE.md +57 -0
  11. package/argo/scripts/archimate32-rules.js +12301 -0
  12. package/argo/scripts/argo-mcp-server.js +629 -0
  13. package/argo/scripts/argo-paths.js +77 -0
  14. package/argo/scripts/ensureArgoHarnessEnvironment.js +340 -0
  15. package/argo/scripts/generateArchitectureDiffPlantuml.js +466 -0
  16. package/argo/scripts/graph-rag/ARCHITECTURE.md +192 -0
  17. package/argo/scripts/graph-rag/canonicalProjectionAuthority.js +45 -0
  18. package/argo/scripts/graph-rag/defaultSemanticRetrieval.js +969 -0
  19. package/argo/scripts/graph-rag/embeddingQualificationGate.js +59 -0
  20. package/argo/scripts/graph-rag/externalProductionConfig.js +74 -0
  21. package/argo/scripts/graph-rag/liveEmbeddingIndexGate.js +129 -0
  22. package/argo/scripts/graph-rag/liveEmbeddingNeo4jBoundary.js +137 -0
  23. package/argo/scripts/graph-rag/liveEmbeddingProviderClient.js +49 -0
  24. package/argo/scripts/graph-rag/liveEmbeddingProviderConfig.js +481 -0
  25. package/argo/scripts/graph-rag/mutationEmbeddingVectorLifecycle.js +1261 -0
  26. package/argo/scripts/graph-rag/neo4jNativeRetrieval.js +37 -0
  27. package/argo/scripts/graph-rag/productionGraphRagRuntime.js +1624 -0
  28. package/argo/scripts/graph-rag/semantic-persistence/ARCHITECTURE.md +51 -0
  29. package/argo/scripts/graph-rag/semantic-persistence/productionSemanticBackfill.js +241 -0
  30. package/argo/scripts/graph-rag/semantic-persistence/productionSemanticCheckpointStore.js +99 -0
  31. package/argo/scripts/graph-rag/semantic-persistence/productionSemanticNeo4jAdapter.js +149 -0
  32. package/argo/scripts/graph-rag/semantic-persistence/productionSemanticProjectionStore.js +171 -0
  33. package/argo/scripts/graph-rag/semanticOperatorError.js +38 -0
  34. package/argo/scripts/graph-rag/semanticOperatorJourney.js +459 -0
  35. package/argo/scripts/graph-rag/semanticReadinessAttestationStore.js +398 -0
  36. package/argo/scripts/graph-rag/systemMetadataCommandAdapter.js +269 -0
  37. package/argo/scripts/graph-semantics.js +220 -0
  38. package/argo/scripts/neo4j-system-architecture-store.js +777 -0
  39. package/argo/scripts/repositoryArgoEnvironment.js +101 -0
  40. package/argo/scripts/runArchitectureTests.js +583 -0
  41. package/argo/scripts/semanticOperatorJourneyCli.js +91 -0
  42. package/argo/scripts/syncSystemArchitectureToNeo4j.js +67 -0
  43. package/argo/scripts/systemarchitecture-mcp-server.js +2965 -0
  44. package/argo/scripts/test-executors/_template.js +58 -0
  45. package/argo/scripts/test-executors/default.js +199 -0
  46. package/argo/scripts/validateStageHandoff.js +459 -0
  47. package/argo/scripts/validateSystemArchitecture.js +254 -0
  48. package/argo/scripts/validateTraceProposal.js +181 -0
  49. package/argo/scripts/validator-mcp-server.js +377 -0
  50. package/argo/skills/argo-init/SKILL.md +110 -0
  51. package/bin/argo-deploy.js +12 -0
  52. package/install-argo.ps1 +112 -0
  53. package/package.json +28 -0
  54. package/vendor/neo4j-driver-6.2.0.tgz +0 -0
@@ -0,0 +1,91 @@
1
+ const path = require('node:path');
2
+ const {
3
+ semanticOperatorErrorPayload,
4
+ } = require('./graph-rag/semanticOperatorError.js');
5
+ const {
6
+ getWorkspaceRoot,
7
+ } = require('./argo-paths.js');
8
+
9
+ async function runSemanticOperatorCommand({ command, options = {}, journey }) {
10
+ if (!journey) {
11
+ throw new TypeError('journey is required');
12
+ }
13
+ if (command === 'init') return journey.startNewProject(options);
14
+ if (command === 'backfill') return journey.runExplicitBackfill(options);
15
+ if (command === 'readiness') return journey.verifyReadiness(options);
16
+ if (command === 'query') return journey.query(options);
17
+ if (command === 'snapshot') return journey.readFullSnapshot();
18
+ throw new Error(`Unknown semantic operator command: ${command}`);
19
+ }
20
+
21
+ async function runCliProcess({
22
+ argv = [],
23
+ dependencies = {},
24
+ stdout = process.stdout,
25
+ stderr = process.stderr,
26
+ } = {}) {
27
+ const command = argv[0];
28
+ const parsedOptions = parseOptions(argv.slice(1));
29
+ const repositoryRoot = dependencies.repositoryRoot
30
+ || getWorkspaceRoot();
31
+ const options = {
32
+ ...parsedOptions,
33
+ approvedConfigurationRequest: {
34
+ repositoryRoot,
35
+ useCase: 'production-semantic-query',
36
+ },
37
+ };
38
+ const {
39
+ createDefaultProductionSemanticOperatorJourney,
40
+ } = require('./systemarchitecture-mcp-server.js');
41
+ const createSemanticOperatorJourney = dependencies.createSemanticOperatorJourney
42
+ || createDefaultProductionSemanticOperatorJourney;
43
+ try {
44
+ const journey = await createSemanticOperatorJourney({ repositoryRoot });
45
+ const result = await runSemanticOperatorCommand({ command, options, journey });
46
+ stdout.write(`${JSON.stringify(result)}\n`);
47
+ return { exitCode: 0, result };
48
+ } catch (error) {
49
+ const result = {
50
+ status: 'failed',
51
+ error: semanticOperatorErrorPayload(error),
52
+ };
53
+ stderr.write(`${JSON.stringify(result)}\n`);
54
+ return { exitCode: 1, result };
55
+ }
56
+ }
57
+
58
+ async function main(argv = process.argv.slice(2)) {
59
+ const outcome = await runCliProcess({ argv });
60
+ process.exitCode = outcome.exitCode;
61
+ }
62
+
63
+ function parseOptions(args) {
64
+ const options = {};
65
+ for (let index = 0; index < args.length; index += 1) {
66
+ const argument = args[index];
67
+ if (argument === '--automatic-backfill') options.automaticBackfillOptIn = true;
68
+ else if (argument === '--explicit-opt-in') options.explicitOptIn = true;
69
+ else if (argument === '--resume') options.resume = true;
70
+ else if (argument === '--request-json') {
71
+ index += 1;
72
+ return JSON.parse(args[index]);
73
+ }
74
+ }
75
+ return options;
76
+ }
77
+
78
+ if (require.main === module) {
79
+ main().catch(error => {
80
+ process.stderr.write(`${JSON.stringify({
81
+ status: 'failed',
82
+ error: semanticOperatorErrorPayload(error),
83
+ })}\n`);
84
+ process.exit(1);
85
+ });
86
+ }
87
+
88
+ module.exports = {
89
+ runCliProcess,
90
+ runSemanticOperatorCommand,
91
+ };
@@ -0,0 +1,67 @@
1
+ const {
2
+ DEFAULT_GRAPH_PATH,
3
+ getNeo4jConfig,
4
+ syncArchitectureToNeo4j,
5
+ verifyArchitectureSync,
6
+ } = require('./neo4j-system-architecture-store.js');
7
+
8
+ async function main() {
9
+ const args = parseArgs(process.argv.slice(2));
10
+ const architecturePath = args.architecturePath || DEFAULT_GRAPH_PATH;
11
+ const config = getNeo4jConfig({
12
+ database: args.database,
13
+ });
14
+
15
+ const result = args.verifyOnly
16
+ ? await verifyArchitectureSync({ architecturePath, ...config })
17
+ : await syncArchitectureToNeo4j({ architecturePath, ...config });
18
+
19
+ const verification = args.verifyOnly ? result : result.verification;
20
+ if (!verification.matches) {
21
+ console.error('Neo4j sync verification failed.');
22
+ console.error(JSON.stringify(verification, null, 2));
23
+ process.exit(1);
24
+ }
25
+
26
+ const output = {
27
+ mode: args.verifyOnly ? 'verify' : 'sync',
28
+ architecturePath,
29
+ database: config.database,
30
+ databaseProvision: verification.databaseProvision || (result && result.databaseProvision) || null,
31
+ uri: config.uri,
32
+ counts: verification.actual,
33
+ matches: verification.matches,
34
+ };
35
+
36
+ console.log(JSON.stringify(output, null, 2));
37
+ }
38
+
39
+ function parseArgs(argv) {
40
+ const args = {};
41
+
42
+ for (let index = 0; index < argv.length; index += 1) {
43
+ const token = argv[index];
44
+ if (token === '--verify') {
45
+ args.verifyOnly = true;
46
+ continue;
47
+ }
48
+ if (token === '--architecture-path') {
49
+ args.architecturePath = argv[index + 1];
50
+ index += 1;
51
+ continue;
52
+ }
53
+ if (token === '--database') {
54
+ args.database = argv[index + 1];
55
+ index += 1;
56
+ continue;
57
+ }
58
+ throw new Error(`Unsupported argument: ${token}`);
59
+ }
60
+
61
+ return args;
62
+ }
63
+
64
+ main().catch(error => {
65
+ console.error(String(error && error.stack ? error.stack : error));
66
+ process.exit(1);
67
+ });