@ecoma-io/archkeep 0.13.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/LICENSE +202 -0
- package/README.md +262 -0
- package/cli.mjs +2792 -0
- package/index.mjs +85 -0
- package/lsp.mjs +81 -0
- package/nx.mjs +24 -0
- package/package.json +81 -0
- package/presets/clean-architecture.json +78 -0
- package/presets/ddd-bounded-contexts.json +88 -0
- package/presets/hexagonal.json +68 -0
- package/presets/layered.json +92 -0
- package/presets/modular-monolith.json +85 -0
- package/presets/vertical-slice.json +68 -0
- package/src/analysis/analyze.mjs +218 -0
- package/src/analysis/contract.md +259 -0
- package/src/analysis/go.mjs +414 -0
- package/src/analysis/manifest-util.mjs +68 -0
- package/src/analysis/python.mjs +1266 -0
- package/src/analysis/registry.mjs +74 -0
- package/src/analysis/rust.mjs +674 -0
- package/src/analysis/source-util.mjs +230 -0
- package/src/analysis/typescript.mjs +1034 -0
- package/src/analysis/vue.mjs +156 -0
- package/src/architecture-intent/intent-fingerprint.mjs +29 -0
- package/src/architecture-intent/judge.mjs +539 -0
- package/src/architecture-intent/model.mjs +703 -0
- package/src/architecture-intent/selectors.mjs +170 -0
- package/src/canonical.mjs +48 -0
- package/src/commands/README.md +266 -0
- package/src/commands/adr.mjs +248 -0
- package/src/commands/check.mjs +989 -0
- package/src/commands/context-command.mjs +212 -0
- package/src/commands/context.mjs +790 -0
- package/src/commands/custom-rules.mjs +428 -0
- package/src/commands/debt.mjs +218 -0
- package/src/commands/diff.mjs +523 -0
- package/src/commands/discover.mjs +159 -0
- package/src/commands/drift.mjs +473 -0
- package/src/commands/edge-constraints.mjs +355 -0
- package/src/commands/explain.mjs +359 -0
- package/src/commands/fitness.mjs +226 -0
- package/src/commands/graph.mjs +297 -0
- package/src/commands/health.mjs +213 -0
- package/src/commands/history.mjs +614 -0
- package/src/commands/impact.mjs +226 -0
- package/src/commands/plan-context-command.mjs +496 -0
- package/src/commands/policy.mjs +138 -0
- package/src/commands/provenance-command.mjs +352 -0
- package/src/commands/provenance.mjs +159 -0
- package/src/commands/reconcile.mjs +219 -0
- package/src/commands/report.mjs +553 -0
- package/src/commands/snapshot-meta.mjs +107 -0
- package/src/commands/waivers.mjs +240 -0
- package/src/config.mjs +1308 -0
- package/src/containment.mjs +234 -0
- package/src/custom-rules/evidence.mjs +340 -0
- package/src/custom-rules/host.mjs +1023 -0
- package/src/custom-rules/values.mjs +43 -0
- package/src/entry-point.mjs +55 -0
- package/src/errors.mjs +36 -0
- package/src/eslint-config.mjs +542 -0
- package/src/go-work.mjs +394 -0
- package/src/governance/adr-registry.mjs +539 -0
- package/src/governance/clock.mjs +69 -0
- package/src/governance/debt-ledger.mjs +274 -0
- package/src/governance/discovery-proposal.mjs +423 -0
- package/src/governance/fitness-registry.mjs +504 -0
- package/src/governance/fitness-rules.mjs +668 -0
- package/src/governance/metrics.mjs +392 -0
- package/src/governance/preset-fingerprints.json +16 -0
- package/src/governance/profile-registry.mjs +366 -0
- package/src/governance/provenance-record.mjs +177 -0
- package/src/governance/reconcile-candidates.mjs +301 -0
- package/src/governance/reconcile-score.mjs +503 -0
- package/src/governance/row-schema.mjs +208 -0
- package/src/governance/verdict.mjs +127 -0
- package/src/governance/waiver.mjs +105 -0
- package/src/graph/create-dependencies.mjs +96 -0
- package/src/intent/intent-manifest.json +347 -0
- package/src/intent/mask-non-code.mjs +640 -0
- package/src/lsp/boundary-config.mjs +225 -0
- package/src/lsp/diagnose.mjs +202 -0
- package/src/lsp/diagnostics.mjs +241 -0
- package/src/lsp/protocol.mjs +215 -0
- package/src/lsp/server.mjs +922 -0
- package/src/lsp/workspace-index.mjs +891 -0
- package/src/nx-json.mjs +95 -0
- package/src/options.mjs +611 -0
- package/src/process.mjs +91 -0
- package/src/providers/moon.mjs +733 -0
- package/src/providers/native/README.md +204 -0
- package/src/providers/native/coverage.mjs +74 -0
- package/src/providers/native/differential.fixtures.mjs +1277 -0
- package/src/providers/native/discover.mjs +431 -0
- package/src/providers/native/graph.mjs +234 -0
- package/src/providers/native/index.mjs +152 -0
- package/src/providers/native/model.mjs +755 -0
- package/src/providers/nx.mjs +178 -0
- package/src/report/README.md +89 -0
- package/src/report/adr-text.mjs +129 -0
- package/src/report/context-text.mjs +109 -0
- package/src/report/debt-text.mjs +105 -0
- package/src/report/diff-text.mjs +219 -0
- package/src/report/discover-text.mjs +186 -0
- package/src/report/drift-text.mjs +194 -0
- package/src/report/envelope-shape.mjs +161 -0
- package/src/report/evidence.mjs +157 -0
- package/src/report/explain-text.mjs +159 -0
- package/src/report/graph-text.mjs +116 -0
- package/src/report/health-text.mjs +123 -0
- package/src/report/history-text.mjs +204 -0
- package/src/report/impact-text.mjs +128 -0
- package/src/report/json.mjs +173 -0
- package/src/report/plan-context-text.mjs +159 -0
- package/src/report/provenance-text.mjs +78 -0
- package/src/report/reconcile-text.mjs +159 -0
- package/src/report/report-text.mjs +264 -0
- package/src/report/sarif.mjs +953 -0
- package/src/report/text.mjs +823 -0
- package/src/report/waivers-text.mjs +100 -0
- package/src/rules/README.md +123 -0
- package/src/rules/index.mjs +962 -0
- package/src/rules/match.mjs +1708 -0
- package/src/rules/messages.mjs +73 -0
- package/src/rules/reachability.mjs +224 -0
- package/src/rules/specifiers.mjs +300 -0
- package/src/rules/tags.mjs +238 -0
- package/src/rules/topology.mjs +333 -0
- package/src/tsconfig-paths.mjs +237 -0
- package/src/verdict.mjs +145 -0
- package/src/workspace.mjs +580 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Archkeep
|
|
2
|
+
|
|
3
|
+
**Architecture governance for polyglot repositories** — a deterministic
|
|
4
|
+
authority that keeps the architecture your team declared aligned with the code
|
|
5
|
+
your team keeps changing. Dependency graphs and module boundaries for Go, Rust,
|
|
6
|
+
Python, TypeScript, JavaScript and Vue, with Nx and Moon as first-class
|
|
7
|
+
integrations. Coding agents read the same verdicts, machine-readably, through
|
|
8
|
+
the `arch-*` skills. The system boundary — what Archkeep is and what it is not —
|
|
9
|
+
is owned by [architecture-authority.md](https://github.com/ecoma-io/archkeep/blob/main/docs/doctrine/architecture-authority.md).
|
|
10
|
+
|
|
11
|
+
## Why it exists
|
|
12
|
+
|
|
13
|
+
ESLint reads JavaScript, TypeScript and Vue. In a polyglot repository, the
|
|
14
|
+
languages it cannot parse carry their `layer:` and `scope:` tags with **no
|
|
15
|
+
enforcer behind them**: a Go import that crosses a boundary passes lint, because
|
|
16
|
+
ESLint answers "File ignored because no matching configuration was supplied"
|
|
17
|
+
for `.go`. The dependency graph is silent the same way — `nx affected` only
|
|
18
|
+
knows a dependency exists when it is an edge in the project graph, and Nx infers
|
|
19
|
+
no edge for a Go import, a Cargo path dependency, or a `pyproject.toml` path
|
|
20
|
+
dependency. An under-selecting `affected` and an absent boundary rule look
|
|
21
|
+
exactly like a clean workspace, which is why the silence goes unnoticed (the
|
|
22
|
+
measurement: [why.md](https://github.com/ecoma-io/archkeep/blob/main/docs/doctrine/why.md)).
|
|
23
|
+
|
|
24
|
+
Archkeep closes both gaps with one analysis, served three ways — a CLI
|
|
25
|
+
(`archkeep check`), a language server (`archkeep-lsp`), and an Nx plugin
|
|
26
|
+
(`@ecoma-io/archkeep/nx`) — with the same verdict in each.
|
|
27
|
+
|
|
28
|
+
## It works in under a minute
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
npm install -D @ecoma-io/archkeep
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`archkeep.json` at the repository root declares the projects and their tags —
|
|
35
|
+
the `coverage.exempt` row names the boundary law itself, which no project owns:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"projects": {
|
|
40
|
+
"declared": [
|
|
41
|
+
{ "name": "billing-core", "root": "libs/billing/core", "tags": ["scope:billing"] },
|
|
42
|
+
{ "name": "shared-ui", "root": "libs/shared/ui", "tags": ["scope:shared"] }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"coverage": {
|
|
46
|
+
"exempt": [
|
|
47
|
+
{
|
|
48
|
+
"path": "module-boundaries.config.mjs",
|
|
49
|
+
"reason": "The boundary law, not owned by a project"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`module-boundaries.config.mjs` at the same root holds the constraint table —
|
|
57
|
+
the same shape `@nx/enforce-module-boundaries` takes, so one table feeds both
|
|
58
|
+
enforcers:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
export const depConstraints = [
|
|
62
|
+
{
|
|
63
|
+
sourceTag: "scope:billing",
|
|
64
|
+
onlyDependOnLibsWithTags: ["scope:billing", "scope:shared"],
|
|
65
|
+
description: "Billing services must not reach outside their scope",
|
|
66
|
+
remediation: "Move the shared logic into a scope:shared library",
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
export const moduleBoundaryOptions = {
|
|
71
|
+
allow: [],
|
|
72
|
+
buildTargets: ["build"],
|
|
73
|
+
enforceBuildableLibDependency: false,
|
|
74
|
+
allowCircularSelfDependency: false,
|
|
75
|
+
checkDynamicDependenciesExceptions: [],
|
|
76
|
+
ignoredCircularDependencies: [],
|
|
77
|
+
banTransitiveDependencies: false,
|
|
78
|
+
checkNestedExternalImports: false,
|
|
79
|
+
};
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The import resolver reads the workspace's `tsconfig.base.json` for path
|
|
83
|
+
mappings, so `@shared/button` maps to the UI source:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"compilerOptions": {
|
|
88
|
+
"paths": { "@shared/button": ["libs/shared/ui/src/button.ts"] }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A `billing-core` file importing `@shared/button` is legal (the constraint
|
|
94
|
+
row allows it) — and had a `billing-core` file imported into a project tagged
|
|
95
|
+
outside `scope:billing` or `scope:shared`, the same constraint would be an
|
|
96
|
+
`onlyTagsConstraintViolation`, exit 1. Now check the tree:
|
|
97
|
+
|
|
98
|
+
```shell
|
|
99
|
+
archkeep check
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
policy module-boundaries.config.mjs — fingerprint 3f9c…
|
|
104
|
+
|
|
105
|
+
✔ no boundary violations (1 import in 2 files across 2 projects; 1 file exempted from coverage by archkeep.json's coverage.exempt)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
A clean run states what it inspected — the import, file and project counts are
|
|
109
|
+
the load-bearing half, so "no violations" is a claim about coverage as much as
|
|
110
|
+
about correctness. The exempt suffix names the boundary law itself, which is
|
|
111
|
+
not owned by any project.
|
|
112
|
+
|
|
113
|
+
The import resolver uses the workspace's own `typescript` (a peer dependency,
|
|
114
|
+
resolved from your tree, never bundled). A TypeScript-free Go/Rust/Python
|
|
115
|
+
workspace pays nothing: resolution keys off the manifests that exist.
|
|
116
|
+
|
|
117
|
+
## Who it is for
|
|
118
|
+
|
|
119
|
+
**Human teams** run `archkeep check` in CI and gate on its exit code. The verdict
|
|
120
|
+
is deterministic and evidence-based: same tree, same config, same answer — no
|
|
121
|
+
machine-specific toolchain result, no model in the loop, and every verdict names
|
|
122
|
+
what it inspected beside what it found
|
|
123
|
+
([exit-codes.md](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/exit-codes.md)).
|
|
124
|
+
|
|
125
|
+
**Coding agents** read the same authority through the five `arch-*` skills —
|
|
126
|
+
`arch-context` before an edit, `arch-change` during, `arch-check` after,
|
|
127
|
+
`arch-review` on a change or PR, and `arch-migrate` to bring a repository that
|
|
128
|
+
declares no architecture under one. The agent is a consumer of the verdict, never
|
|
129
|
+
its authority: the commands it runs are read-only, and the constraint table is
|
|
130
|
+
a file it cannot edit ([overview.md](https://github.com/ecoma-io/archkeep/blob/main/docs/skills/overview.md)).
|
|
131
|
+
|
|
132
|
+
## What it does
|
|
133
|
+
|
|
134
|
+
- **Deterministic graph** — a project graph from any provider: Nx, Moon, or the
|
|
135
|
+
native discovery that needs neither
|
|
136
|
+
([graph.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/graph.md)).
|
|
137
|
+
- **Boundary check** — every import judged against the constraint table, with
|
|
138
|
+
`file:line:column` evidence for each violation
|
|
139
|
+
([violations.md](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/violations.md)).
|
|
140
|
+
- **Drift and intent** — a tracked `architecture-intent.json` declares what the
|
|
141
|
+
architecture must be; `drift` and `check` compare the observed graph against
|
|
142
|
+
it, and an unverifiable intent is a no-verdict, never a pass
|
|
143
|
+
([drift.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/drift.md)).
|
|
144
|
+
- **Evolution** — `graph` snapshots the architecture, `diff` compares two
|
|
145
|
+
snapshots, `history` describes the evolution across a directory of them
|
|
146
|
+
([diff.md](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/diff.md)).
|
|
147
|
+
- **Waivers, profiles, fitness, ADR** — term-bound waivers, named law profiles
|
|
148
|
+
selected at check time, declared quality gates judged per run, and recorded
|
|
149
|
+
architecture decisions a constraint row can lean on
|
|
150
|
+
([waivers.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/waivers.md) ·
|
|
151
|
+
[profiles.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/profiles.md) ·
|
|
152
|
+
[fitness-functions.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/fitness-functions.md) ·
|
|
153
|
+
[adr.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/adr.md)).
|
|
154
|
+
- **Custom rules** — the policy's `customRules` list declares your own rules
|
|
155
|
+
as committed WebAssembly artifacts, written in any language whose toolchain
|
|
156
|
+
emits core wasm. Four typed SDKs ship from this repository on the same
|
|
157
|
+
version chain as the engine — `archkeep-rule-sdk` on crates.io (Rust),
|
|
158
|
+
`@ecoma-io/archkeep-rule-sdk` on npm (AssemblyScript), `archkeep-rule-sdk` on
|
|
159
|
+
PyPI (Python, via a RustPython carrier), and a Go module built with TinyGo —
|
|
160
|
+
and each one's README carries its build story and its measured limits. The
|
|
161
|
+
contract, not the SDK, is the interface: any toolchain emitting a core-wasm
|
|
162
|
+
module with no imports is equally valid. Each rule receives the run's
|
|
163
|
+
observed facts and answers in the same four-verdict vocabulary as everything
|
|
164
|
+
else: a finding exits 1 under `custom/<rule>/<finding>`, a rule that could
|
|
165
|
+
not judge exits 3, and an artifact that will not load (missing, hash
|
|
166
|
+
mismatch, undeclared imports) refuses the run — never a silent skip
|
|
167
|
+
([custom-rules.md](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/custom-rules.md),
|
|
168
|
+
[writing one](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/custom-rules.md)).
|
|
169
|
+
- **Shipped policy packs** — Clean Architecture, hexagonal, layered modular
|
|
170
|
+
monolith and DDD bounded contexts, as ready-made profile registries under
|
|
171
|
+
this package's `presets/` directory. Copy one into your workspace, or point
|
|
172
|
+
the `profiles` option straight at it; either way it is enforced by the same
|
|
173
|
+
path a registry you wrote yourself is
|
|
174
|
+
([presets.md](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/presets.md)).
|
|
175
|
+
- **Machine-readable JSON** — `--format json` wraps any verdict in a versioned
|
|
176
|
+
envelope (`schemaVersion`, `status`, `exitCode`, `coverage`); every field
|
|
177
|
+
name is a public contract
|
|
178
|
+
([json-output.md](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/json-output.md)).
|
|
179
|
+
- **Language server** — `archkeep-lsp` publishes one diagnostic per violation in
|
|
180
|
+
any LSP client; an empty diagnostic list means "no violation", nothing else
|
|
181
|
+
([vscode.md](https://github.com/ecoma-io/archkeep/blob/main/docs/integrations/vscode.md)).
|
|
182
|
+
|
|
183
|
+
## Support
|
|
184
|
+
|
|
185
|
+
- **Languages** — Go, Rust, Python, TypeScript and JavaScript, and Vue. Analysis
|
|
186
|
+
from source, never a build: nothing shells out to `go`, `cargo`, `uv` or `tsc`
|
|
187
|
+
([languages.md](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/languages.md)).
|
|
188
|
+
- **Workspaces** — any repository: Nx registers the plugin in `nx.json` and
|
|
189
|
+
reuses Nx's project graph; Moon workspaces are recognised automatically; any
|
|
190
|
+
other tree uses `archkeep.json` and the native provider
|
|
191
|
+
([nx.md](https://github.com/ecoma-io/archkeep/blob/main/docs/integrations/nx.md) ·
|
|
192
|
+
[moon.md](https://github.com/ecoma-io/archkeep/blob/main/docs/integrations/moon.md)).
|
|
193
|
+
- **Agents** — Claude Code, Codex and opencode run the `arch-*` skills, which
|
|
194
|
+
are host-independent ([supported-hosts.md](https://github.com/ecoma-io/archkeep/blob/main/docs/skills/supported-hosts.md)).
|
|
195
|
+
|
|
196
|
+
## Install and quick start
|
|
197
|
+
|
|
198
|
+
`npm install -D @ecoma-io/archkeep` (or pnpm / yarn / bun), create
|
|
199
|
+
`archkeep.json` and `module-boundaries.config.mjs` as above, then `archkeep check`.
|
|
200
|
+
|
|
201
|
+
In CI, both findings (1) and "no verdict" (3) must fail the build — the
|
|
202
|
+
distinction is the point. `archkeep check || true` is wrong: it turns "could
|
|
203
|
+
not look" into "looked and found nothing". Distinguish explicitly:
|
|
204
|
+
|
|
205
|
+
```shell
|
|
206
|
+
archkeep check
|
|
207
|
+
case $? in
|
|
208
|
+
0) echo "clean" ;;
|
|
209
|
+
1) echo "boundary violations"; exit 1 ;;
|
|
210
|
+
3) echo "the checker could not reach a verdict"; exit 1 ;;
|
|
211
|
+
*) echo "usage error"; exit 1 ;;
|
|
212
|
+
esac
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Exit codes: 0 clean — and every selected file was analyzed; 1 findings;
|
|
216
|
+
2 usage error; 3 no verdict
|
|
217
|
+
([exit-codes.md](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/exit-codes.md) ·
|
|
218
|
+
[ci.md](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/ci.md)).
|
|
219
|
+
|
|
220
|
+
Ten minutes end to end, most of it spent deciding what your tags mean:
|
|
221
|
+
[**Getting started →**](https://github.com/ecoma-io/archkeep/blob/main/docs/getting-started/installation.md). `graph`, `diff`,
|
|
222
|
+
`history`, `drift`, `impact`, `explain`, `context` and the rest of the
|
|
223
|
+
seventeen-command surface are in the [CLI reference](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/cli.md).
|
|
224
|
+
|
|
225
|
+
## Documentation map
|
|
226
|
+
|
|
227
|
+
| Topic | Read |
|
|
228
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
229
|
+
| Getting started | [Installation](https://github.com/ecoma-io/archkeep/blob/main/docs/getting-started/installation.md) → [first project](https://github.com/ecoma-io/archkeep/blob/main/docs/getting-started/first-project.md) → [first policy](https://github.com/ecoma-io/archkeep/blob/main/docs/getting-started/first-policy.md) |
|
|
230
|
+
| Concepts | [The engine](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/architecture.md) · [boundaries](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/boundaries.md) · [drift](https://github.com/ecoma-io/archkeep/blob/main/docs/concepts/drift.md) · [intent](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/architecture-intent.md) |
|
|
231
|
+
| Reference | [CLI and flags](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/cli.md) · [configuration](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/configuration.md) · [exit codes](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/exit-codes.md) · [JSON output](https://github.com/ecoma-io/archkeep/blob/main/docs/reference/json-output.md) |
|
|
232
|
+
| Using it | [Checking](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/checking.md) · [CI](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/ci.md) · [troubleshooting](https://github.com/ecoma-io/archkeep/blob/main/docs/usage/troubleshooting.md) |
|
|
233
|
+
| Agents | [The `arch-*` protocol](https://github.com/ecoma-io/archkeep/blob/main/docs/skills/overview.md) |
|
|
234
|
+
| Building on it | [Architecture](https://github.com/ecoma-io/archkeep/blob/main/docs/development/architecture.md) · [contributing](https://github.com/ecoma-io/archkeep/blob/main/CONTRIBUTING.md) |
|
|
235
|
+
|
|
236
|
+
## Status and deliberate limits
|
|
237
|
+
|
|
238
|
+
CI proves both halves run on this repository's own source — the same `check`
|
|
239
|
+
command runs against this tree's tag vocabulary, which shares nothing with the
|
|
240
|
+
workspace the tool was written against.
|
|
241
|
+
|
|
242
|
+
Three refusals, by design (full list:
|
|
243
|
+
[architecture-authority.md](https://github.com/ecoma-io/archkeep/blob/main/docs/doctrine/architecture-authority.md)):
|
|
244
|
+
|
|
245
|
+
- **It never infers targets.** Projects and targets stay hand-written in each
|
|
246
|
+
`project.json`; this tool adds the missing dependency edges only, so what a
|
|
247
|
+
target does has one source of truth. (The one derivation the Moon provider
|
|
248
|
+
performs — inferring the workspace layout's `libsDir`/`appsDir` prefixes from
|
|
249
|
+
project root paths — is about where source lives, never what a target runs.)
|
|
250
|
+
- **It never shells out.** Resolvers read only tracked manifest and source
|
|
251
|
+
files, so the graph computes on a lint-only CI runner with no Go, Cargo or uv
|
|
252
|
+
installed.
|
|
253
|
+
- **There is no language off-switch.** Every report of a disabled language
|
|
254
|
+
would be byte-for-byte identical to that language having no violations, and
|
|
255
|
+
each analyzer already costs nothing in a workspace without that language.
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
[Apache License 2.0](https://github.com/ecoma-io/archkeep/blob/main/LICENSE) — © Mai Ngọc Hóa (John Martin) and the
|
|
260
|
+
Archkeep contributors. This README ships inside the tarball; the
|
|
261
|
+
repository-level landing page with the full capability index is
|
|
262
|
+
[`README.md`](https://github.com/ecoma-io/archkeep).
|