archsight 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 (122) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +24 -0
  3. data/CODE_OF_CONDUCT.md +10 -0
  4. data/CONTRIBUTING.md +186 -0
  5. data/Dockerfile +39 -0
  6. data/LICENSE.txt +201 -0
  7. data/README.md +170 -0
  8. data/SECURITY.md +27 -0
  9. data/exe/archsight +9 -0
  10. data/lib/archsight/annotations/aggregators.rb +109 -0
  11. data/lib/archsight/annotations/annotation.rb +168 -0
  12. data/lib/archsight/annotations/architecture_annotations.rb +59 -0
  13. data/lib/archsight/annotations/backup_annotations.rb +21 -0
  14. data/lib/archsight/annotations/computed.rb +264 -0
  15. data/lib/archsight/annotations/email_recipient.rb +35 -0
  16. data/lib/archsight/annotations/generated_annotations.rb +17 -0
  17. data/lib/archsight/annotations/git_annotations.rb +21 -0
  18. data/lib/archsight/annotations/relation_resolver.rb +160 -0
  19. data/lib/archsight/cli.rb +120 -0
  20. data/lib/archsight/configuration.rb +36 -0
  21. data/lib/archsight/database.rb +183 -0
  22. data/lib/archsight/documentation.rb +171 -0
  23. data/lib/archsight/graph.rb +113 -0
  24. data/lib/archsight/helpers.rb +210 -0
  25. data/lib/archsight/linter.rb +77 -0
  26. data/lib/archsight/mcp/analyze_resource_tool.rb +222 -0
  27. data/lib/archsight/mcp/base.rb +48 -0
  28. data/lib/archsight/mcp/query_tool.rb +113 -0
  29. data/lib/archsight/mcp/resource_doc_tool.rb +87 -0
  30. data/lib/archsight/mcp.rb +6 -0
  31. data/lib/archsight/query/ast.rb +279 -0
  32. data/lib/archsight/query/errors.rb +39 -0
  33. data/lib/archsight/query/evaluator.rb +707 -0
  34. data/lib/archsight/query/lexer.rb +289 -0
  35. data/lib/archsight/query/parser.rb +506 -0
  36. data/lib/archsight/query.rb +68 -0
  37. data/lib/archsight/renderer.rb +134 -0
  38. data/lib/archsight/resources/application_component.rb +346 -0
  39. data/lib/archsight/resources/application_interface.rb +54 -0
  40. data/lib/archsight/resources/application_service.rb +222 -0
  41. data/lib/archsight/resources/base.rb +300 -0
  42. data/lib/archsight/resources/business_actor.rb +195 -0
  43. data/lib/archsight/resources/business_constraint.rb +32 -0
  44. data/lib/archsight/resources/business_process.rb +37 -0
  45. data/lib/archsight/resources/business_product.rb +206 -0
  46. data/lib/archsight/resources/business_requirement.rb +56 -0
  47. data/lib/archsight/resources/compliance_evidence.rb +42 -0
  48. data/lib/archsight/resources/data_object.rb +49 -0
  49. data/lib/archsight/resources/motivation_goal.rb +37 -0
  50. data/lib/archsight/resources/motivation_outcome.rb +33 -0
  51. data/lib/archsight/resources/motivation_stakeholder.rb +38 -0
  52. data/lib/archsight/resources/strategy_capability.rb +38 -0
  53. data/lib/archsight/resources/technology_artifact.rb +154 -0
  54. data/lib/archsight/resources/technology_interface.rb +34 -0
  55. data/lib/archsight/resources/technology_node.rb +42 -0
  56. data/lib/archsight/resources/technology_service.rb +35 -0
  57. data/lib/archsight/resources/technology_system_software.rb +37 -0
  58. data/lib/archsight/resources/view.rb +51 -0
  59. data/lib/archsight/resources.rb +49 -0
  60. data/lib/archsight/template.rb +49 -0
  61. data/lib/archsight/version.rb +5 -0
  62. data/lib/archsight/web/application.rb +290 -0
  63. data/lib/archsight/web/doc/archimate.md +215 -0
  64. data/lib/archsight/web/doc/computed_annotations.md +316 -0
  65. data/lib/archsight/web/doc/icons.md +303 -0
  66. data/lib/archsight/web/doc/index.md.erb +74 -0
  67. data/lib/archsight/web/doc/modeling.md +200 -0
  68. data/lib/archsight/web/doc/search.md +227 -0
  69. data/lib/archsight/web/doc/togaf.md +255 -0
  70. data/lib/archsight/web/doc/tool.md +90 -0
  71. data/lib/archsight/web/public/css/artifact.css +985 -0
  72. data/lib/archsight/web/public/css/base.css +201 -0
  73. data/lib/archsight/web/public/css/graph.css +106 -0
  74. data/lib/archsight/web/public/css/highlight.min.css +10 -0
  75. data/lib/archsight/web/public/css/iconoir.css +22 -0
  76. data/lib/archsight/web/public/css/instance.css +329 -0
  77. data/lib/archsight/web/public/css/layout.css +421 -0
  78. data/lib/archsight/web/public/css/mermaid-layers.css +188 -0
  79. data/lib/archsight/web/public/css/pico.min.css +4 -0
  80. data/lib/archsight/web/public/favicon.ico +0 -0
  81. data/lib/archsight/web/public/img/archimate.png +0 -0
  82. data/lib/archsight/web/public/img/togaf-high-level.png +0 -0
  83. data/lib/archsight/web/public/js/graph-zoom.js +18 -0
  84. data/lib/archsight/web/public/js/highlight.min.js +3899 -0
  85. data/lib/archsight/web/public/js/htmx.min.js +1 -0
  86. data/lib/archsight/web/public/js/mermaid-init.js +88 -0
  87. data/lib/archsight/web/public/js/mermaid.min.js +2811 -0
  88. data/lib/archsight/web/public/js/sparkline.js +42 -0
  89. data/lib/archsight/web/public/js/svg-pan-zoom.min.js +3 -0
  90. data/lib/archsight/web/public/js/svg-zoom-controls.js +93 -0
  91. data/lib/archsight/web/views/index.haml +12 -0
  92. data/lib/archsight/web/views/partials/artifact/_activity.haml +55 -0
  93. data/lib/archsight/web/views/partials/artifact/_agentic.haml +25 -0
  94. data/lib/archsight/web/views/partials/artifact/_deployment.haml +29 -0
  95. data/lib/archsight/web/views/partials/artifact/_git_info.haml +16 -0
  96. data/lib/archsight/web/views/partials/artifact/_language_stats.haml +53 -0
  97. data/lib/archsight/web/views/partials/artifact/_links.haml +24 -0
  98. data/lib/archsight/web/views/partials/artifact/_project_estimate.haml +26 -0
  99. data/lib/archsight/web/views/partials/artifact/_repositories.haml +55 -0
  100. data/lib/archsight/web/views/partials/artifact/_team.haml +83 -0
  101. data/lib/archsight/web/views/partials/artifact/_workflow.haml +69 -0
  102. data/lib/archsight/web/views/partials/components/_activity.haml +37 -0
  103. data/lib/archsight/web/views/partials/components/_git.haml +17 -0
  104. data/lib/archsight/web/views/partials/components/_jira.haml +18 -0
  105. data/lib/archsight/web/views/partials/components/_languages.haml +29 -0
  106. data/lib/archsight/web/views/partials/components/_owner.haml +15 -0
  107. data/lib/archsight/web/views/partials/components/_repositories.haml +37 -0
  108. data/lib/archsight/web/views/partials/components/_status.haml +23 -0
  109. data/lib/archsight/web/views/partials/instance/_detail.haml +99 -0
  110. data/lib/archsight/web/views/partials/instance/_graph.haml +6 -0
  111. data/lib/archsight/web/views/partials/instance/_list.haml +84 -0
  112. data/lib/archsight/web/views/partials/instance/_relations.haml +43 -0
  113. data/lib/archsight/web/views/partials/instance/_requirements.haml +41 -0
  114. data/lib/archsight/web/views/partials/instance/_view_detail.haml +57 -0
  115. data/lib/archsight/web/views/partials/layout/_content.haml +40 -0
  116. data/lib/archsight/web/views/partials/layout/_error.haml +22 -0
  117. data/lib/archsight/web/views/partials/layout/_head.haml +24 -0
  118. data/lib/archsight/web/views/partials/layout/_navigation.haml +20 -0
  119. data/lib/archsight/web/views/partials/layout/_sidebar.haml +27 -0
  120. data/lib/archsight/web/views/search.haml +53 -0
  121. data/lib/archsight.rb +17 -0
  122. metadata +311 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 637000840e445d9e4582fde99804c50b034adb6696235d957078a5ad40ecfdfb
4
+ data.tar.gz: 69b13da005d885a1ee2424b37e6d8668bd775e9affff6960a221bd283a33693a
5
+ SHA512:
6
+ metadata.gz: ca3fd8eb1b454d6db4c82904ebea6753c9404186f0e8fd26a3fd90c1b7d10e0037062c16f40057d403467ea1235e9d981c1ae10feb9182c33c2a74c72f0b6b15
7
+ data.tar.gz: 85719b9c9f422871c3d96250d276341f7566f53cc24193efdfa8ce3a29ee92c45d674965340e99835eb3c940acecfb947c57f0560ddea28ec2135f020d52aa6d
data/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2026-01-07
4
+
5
+ Initial release. Extracted from internal architecture tooling.
6
+
7
+ ### Features
8
+
9
+ - **Resource Modeling**: 20+ ArchiMate-inspired resource types (TechnologyArtifact, ApplicationComponent, ApplicationInterface, BusinessRequirement, etc.)
10
+ - **Query Language**: Full-featured query DSL with operators (==, !=, =~, >, <), relation queries (->/<-/~>/<~), logical operators (AND/OR/NOT), and sub-queries
11
+ - **Web Interface**: Browse, search, and visualize architecture resources with interactive GraphViz diagrams
12
+ - **MCP Server**: AI assistant integration via Model Context Protocol with query, analyze_resource, and resource_doc tools
13
+ - **Computed Annotations**: Aggregate values across resource relations (sum, count, min, max, avg, concat)
14
+ - **Validation (Lint)**: YAML syntax checking, resource kind validation, relation reference verification
15
+ - **Template Generation**: Generate YAML templates for any resource type
16
+ - **Docker Support**: Production-ready container with health checks
17
+ - **Dark Mode**: Full dark mode support in web interface
18
+
19
+ ### Documentation
20
+
21
+ - Modeling guide with resource types and relations
22
+ - Query language reference
23
+ - Computed annotations guide
24
+ - ArchiMate and TOGAF alignment documentation
@@ -0,0 +1,10 @@
1
+ # Code of Conduct
2
+
3
+ "archsight" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
4
+
5
+ * Participants will be tolerant of opposing views.
6
+ * Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
7
+ * When interpreting the words and actions of others, participants should always assume good intentions.
8
+ * Behaviour which can be reasonably considered harassment will not be tolerated.
9
+
10
+ If you have any concerns about behaviour within this project, please [open a GitHub issue](https://github.com/ionos-cloud/archsight/issues) or contact the maintainers directly.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,186 @@
1
+ # Contributing to Archsight
2
+
3
+ Thank you for your interest in contributing to Archsight! This guide will help you get started.
4
+
5
+ ## Development Setup
6
+
7
+ ### Prerequisites
8
+
9
+ - Ruby 3.2 or later
10
+ - Bundler
11
+ - GraphViz (for visualization features)
12
+
13
+ ### Installation
14
+
15
+ ```bash
16
+ git clone https://github.com/ionos-cloud/archsight.git
17
+ cd archsight
18
+ bundle install
19
+ ```
20
+
21
+ ### Running Locally
22
+
23
+ ```bash
24
+ # Run tests
25
+ bundle exec rake test
26
+
27
+ # Start web server with example data
28
+ ./exe/archsight web --resources examples/archsight
29
+
30
+ # Lint example resources
31
+ ./exe/archsight lint --resources examples/archsight
32
+
33
+ # Generate a resource template
34
+ ./exe/archsight template ApplicationComponent
35
+
36
+ # Interactive console
37
+ ./exe/archsight console --resources examples/archsight
38
+ ```
39
+
40
+ ### Type Checking
41
+
42
+ The project uses RBS type definitions with Steep:
43
+
44
+ ```bash
45
+ bundle exec steep check
46
+ ```
47
+
48
+ ### Linting
49
+
50
+ ```bash
51
+ bundle exec rubocop
52
+ ```
53
+
54
+ ### Code Coverage
55
+
56
+ After running tests, coverage reports are generated in the `coverage/` directory:
57
+
58
+ ```bash
59
+ bundle exec rake test
60
+ open coverage/index.html # View HTML report
61
+ ```
62
+
63
+ Coverage is grouped by component: Core, Query, Resources, Annotations, MCP, and Web.
64
+
65
+ ## Code Style and Conventions
66
+
67
+ ### Ruby Style
68
+
69
+ - Follow the RuboCop configuration in `.rubocop.yml`
70
+ - Use compact class/module definitions: `class Archsight::Query::Lexer` instead of nested modules
71
+ - Prefer single-line class definitions where the parent namespace is already defined
72
+
73
+ ### Resource Types
74
+
75
+ When adding new resource types:
76
+
77
+ ```ruby
78
+ class Archsight::Resources::MyResource < Archsight::Resources::Base
79
+ include_annotations :git, :architecture, :generated
80
+
81
+ icon 'box' # Iconoir icon name
82
+
83
+ annotation 'custom/field',
84
+ description: 'Custom field description',
85
+ enum: ['value1', 'value2']
86
+
87
+ relation :realizes, :businessRequirements, :BusinessRequirement
88
+ end
89
+ ```
90
+
91
+ ### Annotations
92
+
93
+ - Use namespaced paths: `category/field` (e.g., `activity/status`, `repository/git`)
94
+ - Provide descriptions for all annotations
95
+ - Use `enum` for fields with fixed values
96
+ - Use `computed` for aggregated values
97
+
98
+ ### Tests
99
+
100
+ - Add tests for new features in the `test/` directory
101
+ - Use Minitest with the existing test helpers
102
+ - The `MockDatabase` helper is available for unit tests
103
+ - Example resources in `examples/archsight/` can be used for integration tests
104
+
105
+ ## Pull Request Process
106
+
107
+ 1. **Fork and Branch**: Create a feature branch from `main`
108
+
109
+ ```bash
110
+ git checkout -b feature/my-feature
111
+ ```
112
+
113
+ 2. **Make Changes**: Implement your feature or fix
114
+
115
+ 3. **Test**: Ensure all tests pass
116
+
117
+ ```bash
118
+ bundle exec rake test
119
+ bundle exec rubocop
120
+ bundle exec steep check
121
+ ```
122
+
123
+ 4. **Commit**: Write clear commit messages
124
+
125
+ ```text
126
+ Add support for new annotation type
127
+
128
+ - Added category/field annotation to ResourceType
129
+ - Updated documentation
130
+ - Added tests for new functionality
131
+ ```
132
+
133
+ 5. **Push and PR**: Open a pull request against `main`
134
+ - Describe what the PR does
135
+ - Reference any related issues
136
+ - Include test coverage for new features
137
+
138
+ ## Issue Reporting Guidelines
139
+
140
+ ### Bug Reports
141
+
142
+ Include:
143
+
144
+ - Ruby version (`ruby -v`)
145
+ - Archsight version
146
+ - Steps to reproduce
147
+ - Expected vs actual behavior
148
+ - Relevant YAML resource files (if applicable)
149
+
150
+ ### Feature Requests
151
+
152
+ Include:
153
+
154
+ - Use case description
155
+ - Proposed solution (if any)
156
+ - Examples of how the feature would be used
157
+
158
+ ## Project Structure
159
+
160
+ ```text
161
+ archsight/
162
+ ├── exe/archsight # CLI executable
163
+ ├── lib/
164
+ │ ├── archsight.rb # Entry point
165
+ │ └── archsight/
166
+ │ ├── cli.rb # Thor CLI commands
167
+ │ ├── configuration.rb # Configuration management
168
+ │ ├── database.rb # YAML loader and resource registry
169
+ │ ├── query/ # Query language implementation
170
+ │ │ ├── lexer.rb # Tokenizer
171
+ │ │ ├── parser.rb # AST builder
172
+ │ │ └── evaluator.rb # Query execution
173
+ │ ├── resources/ # Resource type definitions
174
+ │ ├── annotations/ # Annotation modules
175
+ │ ├── mcp/ # MCP server implementation
176
+ │ └── web/ # Sinatra web application
177
+ │ ├── doc/ # Documentation (markdown)
178
+ │ └── views/ # Haml templates
179
+ ├── examples/archsight/ # Self-documenting example resources
180
+ ├── sig/ # RBS type definitions
181
+ └── test/ # Test suite
182
+ ```
183
+
184
+ ## Questions?
185
+
186
+ Open an issue on GitHub: <https://github.com/ionos-cloud/archsight/issues>
data/Dockerfile ADDED
@@ -0,0 +1,39 @@
1
+ FROM ruby:4.0-alpine3.23
2
+
3
+ # Install system dependencies required for building gems
4
+ RUN apk add --no-cache \
5
+ build-base \
6
+ git \
7
+ libffi-dev \
8
+ yaml-dev \
9
+ graphviz
10
+
11
+ # Set working directory
12
+ WORKDIR /app
13
+
14
+ # Copy gemspec and Gemfile for dependency installation
15
+ COPY archsight.gemspec Gemfile Gemfile.lock* ./
16
+ COPY lib/archsight/version.rb lib/archsight/version.rb
17
+
18
+ # Install Ruby dependencies
19
+ RUN bundle install --jobs 4
20
+
21
+ # Copy application code
22
+ COPY . .
23
+
24
+ # Create volume mount point for resources
25
+ RUN mkdir -p /resources
26
+
27
+ # Set resources directory environment variable
28
+ ENV ARCHSIGHT_RESOURCES_DIR=/resources
29
+ ENV APP_ENV=production
30
+
31
+ # Expose port for web server
32
+ EXPOSE 4567
33
+
34
+ # Health check
35
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
36
+ CMD wget --no-verbose --tries=1 --spider http://localhost:4567/ || exit 1
37
+
38
+ # Default command - use the archsight CLI
39
+ CMD ["bundle", "exec", "exe/archsight", "web", "--port", "4567"]
data/LICENSE.txt ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,170 @@
1
+ # Archsight
2
+
3
+ [![CI](https://github.com/ionos-cloud/archsight/actions/workflows/ci.yml/badge.svg)](https://github.com/ionos-cloud/archsight/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/archsight.svg)](https://badge.fury.io/rb/archsight)
5
+
6
+ *Bringing enterprise architecture into focus.*
7
+
8
+ Ruby gem for visualizing and managing enterprise architecture documentation using YAML resources with GraphViz visualization. Inspired by ArchiMate 3.2.
9
+
10
+ ## Installation
11
+
12
+ Add to your Gemfile:
13
+
14
+ ```ruby
15
+ gem 'archsight'
16
+ ```
17
+
18
+ Or install directly:
19
+
20
+ ```bash
21
+ gem install archsight
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ### Option 1: CLI
27
+
28
+ ```bash
29
+ # Start web server (looks for resources in current directory)
30
+ archsight web
31
+
32
+ # Start with custom resources path
33
+ archsight web --resources /path/to/resources
34
+
35
+ # Or use environment variable
36
+ ARCHSIGHT_RESOURCES_DIR=/path/to/resources archsight web
37
+ ```
38
+
39
+ Access at: <http://localhost:4567>
40
+
41
+ ### Option 2: Docker
42
+
43
+ ```bash
44
+ docker build -t archsight .
45
+ docker run -p 4567:4567 -v "/path/to/resources:/resources" archsight
46
+ ```
47
+
48
+ Access at: <http://localhost:4567>
49
+
50
+ **Notes:**
51
+
52
+ - The volume mount `-v "/path/to/resources:/resources"` mounts your resources directory
53
+ - Resources are accessible at `/resources` inside the container
54
+ - Live YAML updates are reflected without rebuilding
55
+ - Health check verifies the service is running
56
+
57
+ ## CLI Commands
58
+
59
+ ```bash
60
+ archsight web [--resources PATH] [--port PORT] # Start web server
61
+ archsight lint [--resources PATH] # Validate YAML and relations
62
+ archsight template KIND # Generate YAML template for a resource type
63
+ archsight console [--resources PATH] # Interactive Ruby console
64
+ archsight version # Show version
65
+ ```
66
+
67
+ ## Features
68
+
69
+ ### MCP Server
70
+
71
+ The tool includes an MCP (Model Context Protocol) server that enables AI assistants to query and analyze the architecture data programmatically.
72
+
73
+ **Start the server:**
74
+
75
+ ```bash
76
+ archsight web
77
+ ```
78
+
79
+ **Add to Claude Code:**
80
+
81
+ ```bash
82
+ claude mcp add --transport sse ionos-architecture http://localhost:4567/mcp/sse
83
+ ```
84
+
85
+ **Available tools:**
86
+
87
+ - `query` - Search and filter resources using the query language
88
+ - `analyze_resource` - Get detailed resource information and impact analysis
89
+ - `resource_doc` - Get documentation for resource kinds
90
+
91
+ ### Web Interface
92
+
93
+ **Browse & Search:**
94
+
95
+ - Browse resources by type (Products, Services, Components, Requirements, etc.)
96
+ - Search by name or tag using the [query language](lib/archsight/web/doc/search.md)
97
+ - Filter by annotations (quality attributes, status, frameworks)
98
+
99
+ **Visualization:**
100
+
101
+ - Interactive GraphViz diagrams showing relationships
102
+ - Zoom/pan controls for large diagrams
103
+ - Dark mode support
104
+ - Layer-based color scheme (Business, Application, Technology, Data)
105
+
106
+ ### Validation
107
+
108
+ Validate YAML syntax and verify all relationship references:
109
+
110
+ ```bash
111
+ archsight lint
112
+ ```
113
+
114
+ **Checks:**
115
+
116
+ - YAML syntax correctness
117
+ - Resource kind definitions exist
118
+ - All relation references point to existing resources
119
+ - Prevents broken links between resources
120
+
121
+ ## Documentation
122
+
123
+ Detailed documentation is available in the web interface under the Help menu:
124
+
125
+ | Guide | Description |
126
+ |-------|-------------|
127
+ | [Modeling Guide](lib/archsight/web/doc/modeling.md) | How to model architecture using resource types and relations |
128
+ | [Query Language](lib/archsight/web/doc/search.md) | Full query syntax reference for searching resources |
129
+ | [Computed Annotations](lib/archsight/web/doc/computed_annotations.md) | Aggregating values across relations |
130
+ | [ArchiMate Reference](lib/archsight/web/doc/archimate.md) | ArchiMate concepts and mapping |
131
+ | [TOGAF Reference](lib/archsight/web/doc/togaf.md) | TOGAF alignment and concepts |
132
+
133
+ ## Architecture
134
+
135
+ ### Technology Stack
136
+
137
+ - **Web Framework**: Sinatra
138
+ - **Templating**: Haml
139
+ - **Styling**: Pico CSS v2.x
140
+ - **Interactivity**: HTMX
141
+ - **Icons**: Iconoir (1,671+ icons)
142
+ - **Visualization**: GraphViz (@hpcc-js/wasm for client-side SVG)
143
+
144
+ ### Directory Structure
145
+
146
+ ```text
147
+ archsight/
148
+ ├── exe/archsight # CLI executable
149
+ ├── lib/
150
+ │ ├── archsight.rb # Entry point
151
+ │ └── archsight/
152
+ │ ├── cli.rb # Thor CLI
153
+ │ ├── configuration.rb # Resources path config
154
+ │ ├── database.rb # YAML loader and validator
155
+ │ ├── query/ # Query language (lexer, parser, evaluator)
156
+ │ ├── resources/ # Resource types (20+)
157
+ │ ├── annotations/ # Annotation modules
158
+ │ ├── mcp/ # MCP server tools
159
+ │ └── web/ # Sinatra app, views, assets
160
+ │ └── doc/ # Documentation (markdown)
161
+ └── test/ # Test suite
162
+ ```
163
+
164
+ ## Contributing
165
+
166
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style guidelines, and pull request process.
167
+
168
+ ## License
169
+
170
+ Apache 2.0 License. See LICENSE.txt for details.
data/SECURITY.md ADDED
@@ -0,0 +1,27 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ | ------- | ------------------ |
7
+ | 0.1.x | :white_check_mark: |
8
+
9
+ ## Reporting a Vulnerability
10
+
11
+ If you discover a security vulnerability in archsight, please report it responsibly:
12
+
13
+ 1. **Do not** open a public GitHub issue for security vulnerabilities
14
+ 2. Email the maintainers with details of the vulnerability
15
+ 3. Include steps to reproduce the issue if possible
16
+ 4. Allow reasonable time for a fix before public disclosure
17
+
18
+ We will acknowledge receipt within 48 hours and provide an estimated timeline for a fix.
19
+
20
+ ## Security Considerations
21
+
22
+ Archsight processes YAML files from the local filesystem. When deploying the web interface:
23
+
24
+ - Run behind a reverse proxy with authentication in production environments
25
+ - Limit access to trusted users who should have visibility into architecture data
26
+ - The tool does not execute arbitrary code from YAML files
27
+ - GraphViz rendering is performed client-side using WebAssembly
data/exe/archsight ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
5
+
6
+ require "archsight"
7
+ require "archsight/cli"
8
+
9
+ Archsight::CLI.start(ARGV)