usedesign 0.2.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 +201 -0
- package/README.md +85 -0
- package/dist/checks.d.ts +29 -0
- package/dist/checks.js +0 -0
- package/dist/checks.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +131 -0
- package/dist/cli.js.map +1 -0
- package/dist/conformance.d.ts +8 -0
- package/dist/conformance.js +92 -0
- package/dist/conformance.js.map +1 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.js +133 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/config.schema.json +61 -0
- package/dist/schema/operation-card.schema.json +984 -0
- package/dist/schema/route-inventory.schema.json +51 -0
- package/dist/validate.d.ts +18 -0
- package/dist/validate.js +259 -0
- package/dist/validate.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
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 2026 Nikita Temnikov
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# usedesign — TypeScript
|
|
2
|
+
|
|
3
|
+
The reference implementation: validates Operation Cards and runs the three checks against a
|
|
4
|
+
repository.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx usedesign validate examples/library/
|
|
8
|
+
npx usedesign check usedesign.config.yaml
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Exit status is `1` when anything reported an error, `0` otherwise, `2` on misuse. That is the
|
|
12
|
+
whole CI contract.
|
|
13
|
+
|
|
14
|
+
## Status
|
|
15
|
+
|
|
16
|
+
**Complete against the corpus, not yet published to npm.** Everything below runs today from a
|
|
17
|
+
clone; `npx usedesign` will work once the package is released, and this README will not claim it
|
|
18
|
+
does before then.
|
|
19
|
+
|
|
20
|
+
| | |
|
|
21
|
+
|---|---|
|
|
22
|
+
| Cards corpus | **14 / 14** |
|
|
23
|
+
| Repository corpus | **20 / 20** |
|
|
24
|
+
| Runtime | Node ≥ 20, no native modules |
|
|
25
|
+
| Dependencies | `ajv`, `ajv-formats`, `yaml`, `fast-xml-parser` |
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install && npm run build
|
|
29
|
+
npm test # both corpora
|
|
30
|
+
node dist/cli.js check ../../tests/fixtures/library-service/usedesign.config.yaml
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The last command is expected to report **six errors** — the fixture is deliberately rotten, and
|
|
34
|
+
a clean run there would mean the checks had stopped working.
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
| Command | What it does |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `validate <path…>` | Cards against the JSON Schema **and** the cross-card rules. `--no-schema` keeps only the latter |
|
|
41
|
+
| `check <config>` | The three invariants: no wild endpoints, no unproven steps, no maturity beyond its evidence |
|
|
42
|
+
| `conformance` | Both corpora. `--cards` / `--checks` to run one |
|
|
43
|
+
|
|
44
|
+
## What validation is, in two halves
|
|
45
|
+
|
|
46
|
+
`validate` runs the published schema and the cross-reference rules, and the split is not
|
|
47
|
+
cosmetic. Measured on the 10 invalid corpus cases:
|
|
48
|
+
|
|
49
|
+
- **7** are caught by the schema — a missing required field, an enum out of range, a malformed
|
|
50
|
+
step id, an interface with no transport;
|
|
51
|
+
- **3** are invisible to it — a test covering a step that does not exist, a UI screen covering a
|
|
52
|
+
step that does not exist, and the same step id used twice.
|
|
53
|
+
|
|
54
|
+
All three of the invisible ones are the same shape: *a name that points at nothing*. A schema can
|
|
55
|
+
say what a field looks like; only a checker holding the whole card can say whether the thing it
|
|
56
|
+
names is there.
|
|
57
|
+
|
|
58
|
+
That second group is the reason this tool exists rather than a bare `ajv` invocation. A schema
|
|
59
|
+
validates *form*; the rules validate *meaning*, and meaning is where cards rot.
|
|
60
|
+
|
|
61
|
+
The schema itself is never vendored: the compiled package carries a copy of the repository's
|
|
62
|
+
`schema/` made at build time, so the tool cannot drift from the schema it claims to implement.
|
|
63
|
+
|
|
64
|
+
## Notes from building it
|
|
65
|
+
|
|
66
|
+
- **Line endings are not content.** A CRLF card handed the YAML parser a dangling carriage
|
|
67
|
+
return after the closing fence; scalars came back with `\r` attached, ids stopped matching
|
|
68
|
+
their pattern, and one card would not parse at all. Every symptom looked like a format problem
|
|
69
|
+
and none of them was. `frontMatter` normalises before parsing.
|
|
70
|
+
- **The three checks are ported line for line from the Python prototype**, including the noise
|
|
71
|
+
suppressions — a dead exclusion is not reported when there are no routes, and a step whose only
|
|
72
|
+
test failed is reported once, not twice. Two implementations that disagree about what to stay
|
|
73
|
+
quiet about are two dialects.
|
|
74
|
+
|
|
75
|
+
## Layout
|
|
76
|
+
|
|
77
|
+
| File | What is in it |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `src/core.ts` | Findings, front matter, config, globbing — no rules |
|
|
80
|
+
| `src/validate.ts` | The schema and the cross-card rules |
|
|
81
|
+
| `src/checks.ts` | The three checks |
|
|
82
|
+
| `src/conformance.ts` | The corpus runners |
|
|
83
|
+
| `src/cli.ts` | Argument handling and output |
|
|
84
|
+
|
|
85
|
+
Rules never live in a helper: a rule that hides inside a utility is a rule nobody reviews.
|
package/dist/checks.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Config, Finding } from "./core.js";
|
|
2
|
+
/**
|
|
3
|
+
* Reduce a route to what identifies it: method and path *shape*.
|
|
4
|
+
*
|
|
5
|
+
* Parameter names are documentation, not identity — a card saying {copyId} and a framework saying
|
|
6
|
+
* :id describe the same route. See design/route-conformance.md §4, including the case this
|
|
7
|
+
* deliberately cannot tell apart.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalise(method: string, path: string): string;
|
|
10
|
+
export interface CheckResult {
|
|
11
|
+
findings: Finding[];
|
|
12
|
+
summary: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare function checkRoutes(config: Config, base: string): CheckResult;
|
|
15
|
+
export interface TestCase {
|
|
16
|
+
classname: string;
|
|
17
|
+
name: string;
|
|
18
|
+
status: "passed" | "failed" | "skipped";
|
|
19
|
+
full: string;
|
|
20
|
+
}
|
|
21
|
+
type Index = Map<string, TestCase[]>;
|
|
22
|
+
/** Resolve a card's test id to report entries. Full-id matching only — never a substring. */
|
|
23
|
+
export declare function findCases(testId: string, byFull: Index, byName: Index): TestCase[];
|
|
24
|
+
export declare function checkCoverage(config: Config, base: string): CheckResult;
|
|
25
|
+
/** `implemented` is one path or several — one example joins two with ' + '. */
|
|
26
|
+
export declare function evidencePaths(value: unknown): string[];
|
|
27
|
+
export declare function checkMaturity(config: Config, base: string, today?: Date): CheckResult;
|
|
28
|
+
export declare const CHECKS: Record<number, (config: Config, base: string) => CheckResult>;
|
|
29
|
+
export {};
|
package/dist/checks.js
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAgB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAA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AAG,sBAAsB,OAAO,6BAA6B,EAC1G,SAAS,CACV,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,IAAI,QAAQ,EAAE,CAAC;gBACpB,QAAQ,CAAC,IAAI,CACX,IAAI,OAAO,CAAC,kBAAkB,EAAE,GAAG,MAAM,iBAAiB,QAAQ,8CAA8C,EAAE,SAAS,CAAC,CAC7H,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC;AACzH,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAkE;IACnF,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,aAAa;CACjB,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* usedesign — the command line.
|
|
4
|
+
*
|
|
5
|
+
* usedesign validate <path…> cards against the schema and the cross-card rules
|
|
6
|
+
* usedesign check <config> the three invariants against the repository
|
|
7
|
+
* usedesign conformance the corpora this implementation must pass
|
|
8
|
+
*/
|
|
9
|
+
import { CHECKS } from "./checks.js";
|
|
10
|
+
import { codesOf } from "./core.js";
|
|
11
|
+
export { CHECKS, codesOf };
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* usedesign — the command line.
|
|
4
|
+
*
|
|
5
|
+
* usedesign validate <path…> cards against the schema and the cross-card rules
|
|
6
|
+
* usedesign check <config> the three invariants against the repository
|
|
7
|
+
* usedesign conformance the corpora this implementation must pass
|
|
8
|
+
*/
|
|
9
|
+
import { CHECKS, checkCoverage, checkMaturity, checkRoutes } from "./checks.js";
|
|
10
|
+
import { codesOf, collectCards, errors, frontMatter, loadConfig, warnings } from "./core.js";
|
|
11
|
+
import { runCardCorpus, runChecksCorpus } from "./conformance.js";
|
|
12
|
+
import { validate, validateSchema } from "./validate.js";
|
|
13
|
+
const USAGE = `usedesign — one description per operation, checked against the repository
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
usedesign validate <path…> validate cards (files or directories)
|
|
17
|
+
usedesign check <config> run the three checks against a usedesign.config.yaml
|
|
18
|
+
usedesign conformance [--cards|--checks]
|
|
19
|
+
run the conformance corpora
|
|
20
|
+
usedesign --help | --version
|
|
21
|
+
|
|
22
|
+
Options:
|
|
23
|
+
--no-schema validate: skip the JSON Schema, keep the cross-card rules
|
|
24
|
+
`;
|
|
25
|
+
function print(findings, prefix = "") {
|
|
26
|
+
for (const finding of findings) {
|
|
27
|
+
console.log(` ${finding.severity === "error" ? "ERROR " : "warning"} ${prefix}${finding}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function summarise(title, findings) {
|
|
31
|
+
print(findings);
|
|
32
|
+
console.log(` → ${title}: ${errors(findings).length} error(s), ${warnings(findings).length} warning(s)\n`);
|
|
33
|
+
return errors(findings).length;
|
|
34
|
+
}
|
|
35
|
+
function commandValidate(paths, withSchema) {
|
|
36
|
+
const files = collectCards(paths);
|
|
37
|
+
const cards = new Map();
|
|
38
|
+
for (const path of files) {
|
|
39
|
+
const fm = frontMatter(path);
|
|
40
|
+
if (fm)
|
|
41
|
+
cards.set(String(fm["id"]), { path, fm });
|
|
42
|
+
}
|
|
43
|
+
const known = new Set(cards.keys());
|
|
44
|
+
let errorCount = 0;
|
|
45
|
+
let warningCount = 0;
|
|
46
|
+
for (const [, { path, fm }] of [...cards.entries()].sort()) {
|
|
47
|
+
const findings = [...(withSchema ? validateSchema(fm) : []), ...validate(fm, path, known)];
|
|
48
|
+
const name = path.split(/[\\/]/).pop();
|
|
49
|
+
print(findings, `${name}: `);
|
|
50
|
+
errorCount += errors(findings).length;
|
|
51
|
+
warningCount += warnings(findings).length;
|
|
52
|
+
}
|
|
53
|
+
console.log(`\n${cards.size} card(s): ${errorCount} error(s), ${warningCount} warning(s)`);
|
|
54
|
+
return errorCount > 0 ? 1 : 0;
|
|
55
|
+
}
|
|
56
|
+
function commandCheck(configPath) {
|
|
57
|
+
const { config, base } = loadConfig(configPath);
|
|
58
|
+
const routes = checkRoutes(config, base);
|
|
59
|
+
const s = routes.summary;
|
|
60
|
+
console.log(`inventory: ${s["served"]} route(s) served${s["produced_by"] ? `, produced by ${s["produced_by"]}` : ""}`);
|
|
61
|
+
console.log(`cards: ${s["declared"]} REST route(s) declared`);
|
|
62
|
+
console.log(`excluded: ${s["excluded"]} route(s)`);
|
|
63
|
+
for (const [pattern, count] of Object.entries(s["hidden_per_rule"])) {
|
|
64
|
+
console.log(` ${pattern} → ${count}`);
|
|
65
|
+
}
|
|
66
|
+
console.log();
|
|
67
|
+
let errorCount = summarise("check 1 (no wild endpoints)", routes.findings);
|
|
68
|
+
const coverage = checkCoverage(config, base);
|
|
69
|
+
const c = coverage.summary;
|
|
70
|
+
console.log(`report: ${c["report_cases"]} test case(s)`);
|
|
71
|
+
console.log(`steps: ${c["proven"]} proven, ${c["unproven"]} not\n`);
|
|
72
|
+
errorCount += summarise("check 2 (no unproven steps)", coverage.findings);
|
|
73
|
+
const maturity = checkMaturity(config, base);
|
|
74
|
+
const m = maturity.summary;
|
|
75
|
+
console.log(`cards: ${m["cards"]} card(s), ${m["paths_checked"]} evidence path(s) checked` +
|
|
76
|
+
(m["code_root"] ? "" : " — no `code_root`, path check NOT RUN"));
|
|
77
|
+
console.log(`horizon: ${m["horizon"]} days\n`);
|
|
78
|
+
errorCount += summarise("check 3 (no inflated maturity)", maturity.findings);
|
|
79
|
+
return errorCount > 0 ? 1 : 0;
|
|
80
|
+
}
|
|
81
|
+
function main(argv) {
|
|
82
|
+
const args = argv.slice(2);
|
|
83
|
+
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
84
|
+
console.log(USAGE);
|
|
85
|
+
return args.length === 0 ? 2 : 0;
|
|
86
|
+
}
|
|
87
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
88
|
+
console.log("usedesign 0.2.0 (SPEC v0.2)");
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
const [command, ...rest] = args;
|
|
92
|
+
const flags = rest.filter((a) => a.startsWith("--"));
|
|
93
|
+
const positional = rest.filter((a) => !a.startsWith("--"));
|
|
94
|
+
switch (command) {
|
|
95
|
+
case "validate":
|
|
96
|
+
if (positional.length === 0) {
|
|
97
|
+
console.error("usedesign validate: name at least one card or directory");
|
|
98
|
+
return 2;
|
|
99
|
+
}
|
|
100
|
+
return commandValidate(positional, !flags.includes("--no-schema"));
|
|
101
|
+
case "check":
|
|
102
|
+
if (positional.length !== 1) {
|
|
103
|
+
console.error("usedesign check: name exactly one usedesign.config.yaml");
|
|
104
|
+
return 2;
|
|
105
|
+
}
|
|
106
|
+
return commandCheck(positional[0]);
|
|
107
|
+
case "conformance": {
|
|
108
|
+
const cardsOnly = flags.includes("--cards");
|
|
109
|
+
const checksOnly = flags.includes("--checks");
|
|
110
|
+
let failed = 0;
|
|
111
|
+
if (!checksOnly)
|
|
112
|
+
failed += runCardCorpus(!flags.includes("--no-schema")).failed;
|
|
113
|
+
if (!cardsOnly)
|
|
114
|
+
failed += runChecksCorpus().failed;
|
|
115
|
+
return failed > 0 ? 1 : 0;
|
|
116
|
+
}
|
|
117
|
+
default:
|
|
118
|
+
console.error(`usedesign: unknown command \`${command}\`\n`);
|
|
119
|
+
console.log(USAGE);
|
|
120
|
+
return 2;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
process.exit(main(process.argv));
|
|
125
|
+
}
|
|
126
|
+
catch (exc) {
|
|
127
|
+
console.error(`usedesign: ${exc.message}`);
|
|
128
|
+
process.exit(2);
|
|
129
|
+
}
|
|
130
|
+
export { CHEC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CAAC,MAAM,CAAC;YACnD,OAAO,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;QAED;YACE,OAAO,CAAC,KAAK,CAAC,gCAAgC,OAAO,MAAM,CAAC,CAAC;YAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,IAAI,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,cAAe,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface CorpusResult {
|
|
2
|
+
passed: number;
|
|
3
|
+
failed: number;
|
|
4
|
+
}
|
|
5
|
+
/** The 14 card cases: does this card mean anything, and if not, why not. */
|
|
6
|
+
export declare function runCardCorpus(withSchema?: boolean): CorpusResult;
|
|
7
|
+
/** The 20 repository cases: do the cards still match what the repository does. */
|
|
8
|
+
export declare function runChecksCorpus(): CorpusResult;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conformance corpora, run by this implementation.
|
|
3
|
+
*
|
|
4
|
+
* An implementation passes when, for each case, it reaches the same verdict AND reports the same
|
|
5
|
+
* diagnostic codes. Agreeing that something is wrong while disagreeing on what is wrong is how
|
|
6
|
+
* dialects start — so a missing code fails the case just as a wrong verdict does.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { basename, join } from "node:path";
|
|
10
|
+
import { parse as parseYaml } from "yaml";
|
|
11
|
+
import { CHECKS } from "./checks.js";
|
|
12
|
+
import { codesOf, errors, Finding, frontMatter, loadConfig, warnings } from "./core.js";
|
|
13
|
+
import { REPO, validate, validateSchema } from "./validate.js";
|
|
14
|
+
const CARDS = join(REPO, "tests", "conformance");
|
|
15
|
+
const CHECKS_CORPUS = join(CARDS, "checks");
|
|
16
|
+
function report(name, problems, reported) {
|
|
17
|
+
if (problems.length > 0) {
|
|
18
|
+
console.log(` FAIL ${name}`);
|
|
19
|
+
for (const problem of problems)
|
|
20
|
+
console.log(` ${problem}`);
|
|
21
|
+
if (reported.length > 0)
|
|
22
|
+
console.log(` reported: ${reported.join(", ")}`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log(` ok ${name}${reported.length > 0 ? ` [${reported.join(", ")}]` : ""}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** The 14 card cases: does this card mean anything, and if not, why not. */
|
|
29
|
+
export function runCardCorpus(withSchema = true) {
|
|
30
|
+
const manifest = parseYaml(readFileSync(join(CARDS, "manifest.yaml"), "utf8"));
|
|
31
|
+
let passed = 0;
|
|
32
|
+
let failed = 0;
|
|
33
|
+
for (const testCase of manifest.cases) {
|
|
34
|
+
const path = join(CARDS, "cases", ...String(testCase.file).split("/"));
|
|
35
|
+
const fm = frontMatter(path);
|
|
36
|
+
const findings = fm
|
|
37
|
+
? [...(withSchema ? validateSchema(fm) : []), ...validate(fm, basename(path))]
|
|
38
|
+
: [new Finding("missing_required_field", "no front matter")];
|
|
39
|
+
const failing = errors(findings);
|
|
40
|
+
const verdict = failing.length > 0 ? "invalid" : "valid";
|
|
41
|
+
const reported = codesOf(failing);
|
|
42
|
+
const warned = codesOf(warnings(findings));
|
|
43
|
+
const problems = [];
|
|
44
|
+
if (verdict !== testCase.expect)
|
|
45
|
+
problems.push(`expected ${testCase.expect}, got ${verdict}`);
|
|
46
|
+
for (const code of testCase.codes ?? []) {
|
|
47
|
+
if (!reported.includes(code))
|
|
48
|
+
problems.push(`missing code \`${code}\``);
|
|
49
|
+
}
|
|
50
|
+
// Warnings are part of the contract too: a rule that only warns is still a rule two
|
|
51
|
+
// implementations must agree about, and until now nothing here compared them.
|
|
52
|
+
for (const code of testCase.warnings ?? []) {
|
|
53
|
+
if (!warned.includes(code))
|
|
54
|
+
problems.push(`missing warning \`${code}\``);
|
|
55
|
+
}
|
|
56
|
+
report(testCase.file, problems, reported);
|
|
57
|
+
problems.length > 0 ? (failed += 1) : (passed += 1);
|
|
58
|
+
}
|
|
59
|
+
console.log(`\ncards conformance: ${passed} passed, ${failed} failed`);
|
|
60
|
+
return { passed, failed };
|
|
61
|
+
}
|
|
62
|
+
/** The 20 repository cases: do the cards still match what the repository does. */
|
|
63
|
+
export function runChecksCorpus() {
|
|
64
|
+
const manifest = parseYaml(readFileSync(join(CHECKS_CORPUS, "manifest.yaml"), "utf8"));
|
|
65
|
+
let passed = 0;
|
|
66
|
+
let failed = 0;
|
|
67
|
+
for (const testCase of manifest.cases) {
|
|
68
|
+
const { config, base } = loadConfig(join(CHECKS_CORPUS, "cases", testCase.dir, "usedesign.config.yaml"));
|
|
69
|
+
const runner = CHECKS[testCase.check ?? 1];
|
|
70
|
+
const { findings } = runner(config, base);
|
|
71
|
+
const failing = errors(findings);
|
|
72
|
+
const verdict = failing.length > 0 ? "fail" : "pass";
|
|
73
|
+
const codes = codesOf(failing);
|
|
74
|
+
const warned = codesOf(warnings(findings));
|
|
75
|
+
const problems = [];
|
|
76
|
+
if (verdict !== testCase.expect)
|
|
77
|
+
problems.push(`expected ${testCase.expect}, got ${verdict}`);
|
|
78
|
+
for (const code of testCase.codes ?? []) {
|
|
79
|
+
if (!codes.includes(code))
|
|
80
|
+
problems.push(`missing code \`${code}\``);
|
|
81
|
+
}
|
|
82
|
+
for (const code of testCase.warnings ?? []) {
|
|
83
|
+
if (!warned.includes(code))
|
|
84
|
+
problems.push(`missing warning \`${code}\``);
|
|
85
|
+
}
|
|
86
|
+
report(testCase.dir, problems, [...codes, ...warned]);
|
|
87
|
+
problems.length > 0 ? (failed += 1) : (passed += 1);
|
|
88
|
+
}
|
|
89
|
+
console.log(`\nchecks conformance: ${passed} passed, ${failed} failed`);
|
|
90
|
+
return { passed, failed };
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=conformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.js","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AACjD,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAE5C,SAAS,MAAM,CAAC,IAAY,EAAE,QAAkB,EAAE,QAAkB;IAClE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAC/B,KAAK,MAAM,OAAO,IAAI,QAAQ;YAAE,OAAO,CAAC,GAAG,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC;QACpE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,QAAQ,CAAC,IAAI,CAAC,IAAI,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