@sha3/code 1.0.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/AGENTS.md +75 -0
- package/README.md +554 -0
- package/ai/adapters/codex.md +7 -0
- package/ai/adapters/copilot.md +7 -0
- package/ai/adapters/cursor.md +7 -0
- package/ai/adapters/windsurf.md +8 -0
- package/ai/constitution.md +12 -0
- package/bin/code-standards.mjs +47 -0
- package/biome.json +37 -0
- package/index.mjs +11 -0
- package/lib/cli/parse-args.mjs +416 -0
- package/lib/cli/post-run-guidance.mjs +43 -0
- package/lib/cli/run-init.mjs +123 -0
- package/lib/cli/run-profile.mjs +46 -0
- package/lib/cli/run-refactor.mjs +152 -0
- package/lib/cli/run-verify.mjs +67 -0
- package/lib/constants.mjs +167 -0
- package/lib/contract/load-rule-catalog.mjs +12 -0
- package/lib/contract/render-agents.mjs +79 -0
- package/lib/contract/render-contract-json.mjs +7 -0
- package/lib/contract/resolve-contract.mjs +52 -0
- package/lib/paths.mjs +50 -0
- package/lib/profile.mjs +108 -0
- package/lib/project/ai-instructions.mjs +28 -0
- package/lib/project/biome-ignore.mjs +14 -0
- package/lib/project/managed-files.mjs +105 -0
- package/lib/project/package-metadata.mjs +132 -0
- package/lib/project/prompt-files.mjs +111 -0
- package/lib/project/template-resolution.mjs +70 -0
- package/lib/refactor/materialize-refactor-context.mjs +106 -0
- package/lib/refactor/preservation-questions.mjs +33 -0
- package/lib/refactor/public-contract-extractor.mjs +22 -0
- package/lib/refactor/render-analysis-summary.mjs +50 -0
- package/lib/refactor/source-analysis.mjs +74 -0
- package/lib/utils/fs.mjs +220 -0
- package/lib/utils/prompts.mjs +63 -0
- package/lib/utils/text.mjs +43 -0
- package/lib/verify/change-audit-verifier.mjs +140 -0
- package/lib/verify/change-context.mjs +36 -0
- package/lib/verify/error-handling-verifier.mjs +164 -0
- package/lib/verify/explain-rule.mjs +54 -0
- package/lib/verify/issue-helpers.mjs +132 -0
- package/lib/verify/project-layout-verifier.mjs +259 -0
- package/lib/verify/project-verifier.mjs +267 -0
- package/lib/verify/readme-public-api.mjs +237 -0
- package/lib/verify/readme-verifier.mjs +216 -0
- package/lib/verify/render-json-report.mjs +3 -0
- package/lib/verify/render-text-report.mjs +34 -0
- package/lib/verify/source-analysis.mjs +126 -0
- package/lib/verify/source-rule-verifier.mjs +453 -0
- package/lib/verify/testing-verifier.mjs +113 -0
- package/lib/verify/tooling-verifier.mjs +82 -0
- package/lib/verify/typescript-style-verifier.mjs +407 -0
- package/package.json +55 -0
- package/profiles/default.profile.json +40 -0
- package/profiles/schema.json +96 -0
- package/prompts/init-contract.md +25 -0
- package/prompts/init-phase-2-implement.md +25 -0
- package/prompts/init-phase-3-verify.md +23 -0
- package/prompts/init.prompt.md +24 -0
- package/prompts/refactor-contract.md +26 -0
- package/prompts/refactor-phase-2-rebuild.md +25 -0
- package/prompts/refactor-phase-3-verify.md +24 -0
- package/prompts/refactor.prompt.md +26 -0
- package/resources/ai/AGENTS.md +18 -0
- package/resources/ai/adapters/codex.md +5 -0
- package/resources/ai/adapters/copilot.md +5 -0
- package/resources/ai/adapters/cursor.md +5 -0
- package/resources/ai/adapters/windsurf.md +5 -0
- package/resources/ai/contract.schema.json +68 -0
- package/resources/ai/rule-catalog.json +878 -0
- package/resources/ai/rule-catalog.schema.json +66 -0
- package/resources/ai/templates/adapters/codex.template.md +7 -0
- package/resources/ai/templates/adapters/copilot.template.md +7 -0
- package/resources/ai/templates/adapters/cursor.template.md +7 -0
- package/resources/ai/templates/adapters/windsurf.template.md +7 -0
- package/resources/ai/templates/agents.project.template.md +141 -0
- package/resources/ai/templates/examples/demo/src/billing/billing.service.ts +73 -0
- package/resources/ai/templates/examples/demo/src/config.ts +3 -0
- package/resources/ai/templates/examples/demo/src/invoice/invoice.errors.ts +51 -0
- package/resources/ai/templates/examples/demo/src/invoice/invoice.service.ts +96 -0
- package/resources/ai/templates/examples/demo/src/invoice/invoice.types.ts +9 -0
- package/resources/ai/templates/examples/rules/async-bad.ts +52 -0
- package/resources/ai/templates/examples/rules/async-good.ts +56 -0
- package/resources/ai/templates/examples/rules/class-first-bad.ts +36 -0
- package/resources/ai/templates/examples/rules/class-first-good.ts +74 -0
- package/resources/ai/templates/examples/rules/constructor-bad.ts +68 -0
- package/resources/ai/templates/examples/rules/constructor-good.ts +71 -0
- package/resources/ai/templates/examples/rules/control-flow-bad.ts +31 -0
- package/resources/ai/templates/examples/rules/control-flow-good.ts +54 -0
- package/resources/ai/templates/examples/rules/errors-bad.ts +42 -0
- package/resources/ai/templates/examples/rules/errors-good.ts +23 -0
- package/resources/ai/templates/examples/rules/functions-bad.ts +48 -0
- package/resources/ai/templates/examples/rules/functions-good.ts +58 -0
- package/resources/ai/templates/examples/rules/returns-bad.ts +38 -0
- package/resources/ai/templates/examples/rules/returns-good.ts +44 -0
- package/resources/ai/templates/examples/rules/testing-bad.ts +34 -0
- package/resources/ai/templates/examples/rules/testing-good.ts +54 -0
- package/resources/ai/templates/rules/architecture.md +41 -0
- package/resources/ai/templates/rules/async.md +13 -0
- package/resources/ai/templates/rules/class-first.md +45 -0
- package/resources/ai/templates/rules/control-flow.md +13 -0
- package/resources/ai/templates/rules/errors.md +18 -0
- package/resources/ai/templates/rules/functions.md +29 -0
- package/resources/ai/templates/rules/naming.md +13 -0
- package/resources/ai/templates/rules/readme.md +36 -0
- package/resources/ai/templates/rules/returns.md +13 -0
- package/resources/ai/templates/rules/testing.md +18 -0
- package/resources/ai/templates/rules.project.template.md +66 -0
- package/resources/ai/templates/skills/change-synchronization/SKILL.md +42 -0
- package/resources/ai/templates/skills/feature-shaping/SKILL.md +45 -0
- package/resources/ai/templates/skills/http-api-conventions/SKILL.md +171 -0
- package/resources/ai/templates/skills/init-workflow/SKILL.md +52 -0
- package/resources/ai/templates/skills/readme-authoring/SKILL.md +51 -0
- package/resources/ai/templates/skills/refactor-workflow/SKILL.md +50 -0
- package/resources/ai/templates/skills/simplicity-audit/SKILL.md +41 -0
- package/resources/ai/templates/skills/test-scope-selection/SKILL.md +50 -0
- package/resources/ai/templates/skills.index.template.md +25 -0
- package/standards/architecture.md +72 -0
- package/standards/changelog-policy.md +12 -0
- package/standards/manifest.json +36 -0
- package/standards/readme.md +56 -0
- package/standards/schema.json +124 -0
- package/standards/style.md +106 -0
- package/standards/testing.md +20 -0
- package/standards/tooling.md +38 -0
- package/templates/node-lib/.biomeignore +10 -0
- package/templates/node-lib/.vscode/extensions.json +1 -0
- package/templates/node-lib/.vscode/settings.json +9 -0
- package/templates/node-lib/README.md +172 -0
- package/templates/node-lib/biome.json +37 -0
- package/templates/node-lib/gitignore +6 -0
- package/templates/node-lib/package.json +32 -0
- package/templates/node-lib/scripts/release-publish.mjs +106 -0
- package/templates/node-lib/scripts/run-tests.mjs +65 -0
- package/templates/node-lib/src/config.ts +3 -0
- package/templates/node-lib/src/index.ts +2 -0
- package/templates/node-lib/src/logger.ts +7 -0
- package/templates/node-lib/src/package-info/package-info.service.ts +47 -0
- package/templates/node-lib/test/package-info.test.ts +10 -0
- package/templates/node-lib/tsconfig.build.json +1 -0
- package/templates/node-lib/tsconfig.json +5 -0
- package/templates/node-service/.biomeignore +10 -0
- package/templates/node-service/.vscode/extensions.json +1 -0
- package/templates/node-service/.vscode/settings.json +9 -0
- package/templates/node-service/README.md +244 -0
- package/templates/node-service/biome.json +37 -0
- package/templates/node-service/ecosystem.config.cjs +3 -0
- package/templates/node-service/gitignore +6 -0
- package/templates/node-service/package.json +42 -0
- package/templates/node-service/scripts/release-publish.mjs +106 -0
- package/templates/node-service/scripts/run-tests.mjs +65 -0
- package/templates/node-service/src/app/service-runtime.service.ts +57 -0
- package/templates/node-service/src/app-info/app-info.service.ts +47 -0
- package/templates/node-service/src/config.ts +11 -0
- package/templates/node-service/src/http/http-server.service.ts +66 -0
- package/templates/node-service/src/index.ts +2 -0
- package/templates/node-service/src/logger.ts +7 -0
- package/templates/node-service/src/main.ts +5 -0
- package/templates/node-service/test/service-runtime.test.ts +13 -0
- package/templates/node-service/tsconfig.build.json +1 -0
- package/templates/node-service/tsconfig.json +5 -0
- package/tsconfig/base.json +16 -0
- package/tsconfig/node-lib.json +5 -0
- package/tsconfig/node-service.json +1 -0
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "v2",
|
|
3
|
+
"rules": [
|
|
4
|
+
{
|
|
5
|
+
"id": "single-return",
|
|
6
|
+
"title": "Single Return",
|
|
7
|
+
"summary": "Functions and methods outside src/http/ must use a single return statement.",
|
|
8
|
+
"severity": "error",
|
|
9
|
+
"kind": "style",
|
|
10
|
+
"appliesTo": ["src/**/*.ts", "!src/http/**/*.ts"],
|
|
11
|
+
"deterministic": true,
|
|
12
|
+
"verificationMode": "deterministic",
|
|
13
|
+
"verificationSource": "ast",
|
|
14
|
+
"implementedBy": ["source-rule-verifier"],
|
|
15
|
+
"requiresContext": "full-project",
|
|
16
|
+
"confidence": "high",
|
|
17
|
+
"enforcedBy": ["verify"],
|
|
18
|
+
"examples": { "good": ["ai/examples/rules/returns-good.ts"], "bad": ["ai/examples/rules/returns-bad.ts"] },
|
|
19
|
+
"profileOverrides": [{ "key": "return_policy", "equals": "single_return_strict_no_exceptions" }]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "async-await-only",
|
|
23
|
+
"title": "Async Await Only",
|
|
24
|
+
"summary": "Asynchronous code in src/ must use async/await instead of promise chains.",
|
|
25
|
+
"severity": "error",
|
|
26
|
+
"kind": "style",
|
|
27
|
+
"appliesTo": ["src/**/*.ts"],
|
|
28
|
+
"deterministic": true,
|
|
29
|
+
"verificationMode": "deterministic",
|
|
30
|
+
"verificationSource": "ast",
|
|
31
|
+
"implementedBy": ["source-rule-verifier"],
|
|
32
|
+
"requiresContext": "full-project",
|
|
33
|
+
"confidence": "high",
|
|
34
|
+
"enforcedBy": ["verify"],
|
|
35
|
+
"examples": { "good": ["ai/examples/rules/async-good.ts"], "bad": ["ai/examples/rules/async-bad.ts"] },
|
|
36
|
+
"profileOverrides": [{ "key": "async_style", "equals": "async_await_only" }]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "one-public-class-per-file",
|
|
40
|
+
"title": "One Public Class Per File",
|
|
41
|
+
"summary": "Each source file may expose at most one public class.",
|
|
42
|
+
"severity": "error",
|
|
43
|
+
"kind": "architecture",
|
|
44
|
+
"appliesTo": ["src/**/*.ts"],
|
|
45
|
+
"deterministic": true,
|
|
46
|
+
"verificationMode": "deterministic",
|
|
47
|
+
"verificationSource": "ast",
|
|
48
|
+
"implementedBy": ["source-rule-verifier"],
|
|
49
|
+
"requiresContext": "full-project",
|
|
50
|
+
"confidence": "high",
|
|
51
|
+
"enforcedBy": ["verify"],
|
|
52
|
+
"examples": { "good": ["ai/examples/rules/class-first-good.ts"], "bad": ["ai/examples/rules/class-first-bad.ts"] },
|
|
53
|
+
"profileOverrides": [{ "key": "class_file_policy", "equals": "one_public_class_per_file" }]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "feature-class-only",
|
|
57
|
+
"title": "Feature Files Are Class Files",
|
|
58
|
+
"summary": "Files inside src/<feature>/ must expose exactly one public class, except .types.ts files.",
|
|
59
|
+
"severity": "error",
|
|
60
|
+
"kind": "architecture",
|
|
61
|
+
"appliesTo": ["src/*/**/*.ts"],
|
|
62
|
+
"deterministic": true,
|
|
63
|
+
"verificationMode": "deterministic",
|
|
64
|
+
"verificationSource": "ast",
|
|
65
|
+
"implementedBy": ["source-rule-verifier"],
|
|
66
|
+
"requiresContext": "full-project",
|
|
67
|
+
"confidence": "high",
|
|
68
|
+
"enforcedBy": ["verify"],
|
|
69
|
+
"examples": { "good": ["ai/examples/demo/src/invoice/invoice.service.ts"], "bad": ["ai/examples/rules/class-first-bad.ts"] },
|
|
70
|
+
"profileOverrides": [{ "key": "paradigm", "equals": "class-first" }]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "class-section-order",
|
|
74
|
+
"title": "Class Section Order",
|
|
75
|
+
"summary": "Files that expose a public class must include valid ordered @section markers, omit empty section blocks, and keep @section class directly above export class with no intervening comments.",
|
|
76
|
+
"severity": "error",
|
|
77
|
+
"kind": "style",
|
|
78
|
+
"appliesTo": ["src/**/*.ts"],
|
|
79
|
+
"deterministic": true,
|
|
80
|
+
"verificationMode": "deterministic",
|
|
81
|
+
"verificationSource": "text",
|
|
82
|
+
"implementedBy": ["source-rule-verifier"],
|
|
83
|
+
"requiresContext": "full-project",
|
|
84
|
+
"confidence": "high",
|
|
85
|
+
"enforcedBy": ["verify"],
|
|
86
|
+
"examples": {
|
|
87
|
+
"good": ["ai/examples/rules/class-first-good.ts", "ai/examples/rules/constructor-good.ts"],
|
|
88
|
+
"bad": ["ai/examples/rules/class-first-bad.ts", "ai/examples/rules/constructor-bad.ts"]
|
|
89
|
+
},
|
|
90
|
+
"profileOverrides": [{ "key": "paradigm", "equals": "class-first" }]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "canonical-config-import",
|
|
94
|
+
"title": "Canonical Config Import",
|
|
95
|
+
"summary": "Imports of config.ts must use the config identifier and include the .ts extension.",
|
|
96
|
+
"severity": "error",
|
|
97
|
+
"kind": "architecture",
|
|
98
|
+
"appliesTo": ["src/**/*.ts"],
|
|
99
|
+
"deterministic": true,
|
|
100
|
+
"verificationMode": "deterministic",
|
|
101
|
+
"verificationSource": "ast",
|
|
102
|
+
"implementedBy": ["source-rule-verifier"],
|
|
103
|
+
"requiresContext": "full-project",
|
|
104
|
+
"confidence": "high",
|
|
105
|
+
"enforcedBy": ["verify"],
|
|
106
|
+
"examples": { "good": ["ai/examples/demo/src/billing/billing.service.ts", "ai/examples/demo/src/invoice/invoice.service.ts"], "bad": [] },
|
|
107
|
+
"profileOverrides": []
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "domain-specific-identifiers",
|
|
111
|
+
"title": "Domain Specific Identifiers",
|
|
112
|
+
"summary": "New identifiers must avoid generic names such as data, obj, tmp, val, thing, helper, utils, and common.",
|
|
113
|
+
"severity": "error",
|
|
114
|
+
"kind": "style",
|
|
115
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
116
|
+
"deterministic": true,
|
|
117
|
+
"verificationMode": "deterministic",
|
|
118
|
+
"verificationSource": "ast",
|
|
119
|
+
"implementedBy": ["source-rule-verifier"],
|
|
120
|
+
"requiresContext": "full-project",
|
|
121
|
+
"confidence": "high",
|
|
122
|
+
"enforcedBy": ["verify"],
|
|
123
|
+
"examples": { "good": ["ai/examples/rules/functions-good.ts"], "bad": ["ai/examples/rules/functions-bad.ts"] },
|
|
124
|
+
"profileOverrides": []
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "boolean-prefix",
|
|
128
|
+
"title": "Boolean Prefix",
|
|
129
|
+
"summary": "Boolean variables and properties must start with is, has, can, or should.",
|
|
130
|
+
"severity": "error",
|
|
131
|
+
"kind": "style",
|
|
132
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
133
|
+
"deterministic": true,
|
|
134
|
+
"verificationMode": "deterministic",
|
|
135
|
+
"verificationSource": "ast",
|
|
136
|
+
"implementedBy": ["source-rule-verifier"],
|
|
137
|
+
"requiresContext": "full-project",
|
|
138
|
+
"confidence": "high",
|
|
139
|
+
"enforcedBy": ["verify"],
|
|
140
|
+
"examples": { "good": ["ai/examples/rules/functions-good.ts"], "bad": ["ai/examples/rules/functions-bad.ts"] },
|
|
141
|
+
"profileOverrides": []
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "feature-filename-role",
|
|
145
|
+
"title": "Feature File Naming",
|
|
146
|
+
"summary": "Feature files must use the feature name plus an explicit role suffix such as .service.ts or .types.ts.",
|
|
147
|
+
"severity": "error",
|
|
148
|
+
"kind": "architecture",
|
|
149
|
+
"appliesTo": ["src/**/*.ts"],
|
|
150
|
+
"deterministic": true,
|
|
151
|
+
"verificationMode": "deterministic",
|
|
152
|
+
"verificationSource": "filesystem",
|
|
153
|
+
"implementedBy": ["source-rule-verifier", "project-layout-verifier"],
|
|
154
|
+
"requiresContext": "full-project",
|
|
155
|
+
"confidence": "high",
|
|
156
|
+
"enforcedBy": ["verify"],
|
|
157
|
+
"examples": {
|
|
158
|
+
"good": ["ai/examples/demo/src/invoice/invoice.service.ts", "ai/examples/demo/src/invoice/invoice.types.ts"],
|
|
159
|
+
"bad": ["ai/examples/rules/class-first-bad.ts"]
|
|
160
|
+
},
|
|
161
|
+
"profileOverrides": [{ "key": "architecture", "equals": "feature_folders" }]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "no-module-functions-in-class-files",
|
|
165
|
+
"title": "No Module Functions In Class Files",
|
|
166
|
+
"summary": "Files that expose a public class must not keep helper functions at module scope; that logic must live inside the class as private or static methods.",
|
|
167
|
+
"severity": "error",
|
|
168
|
+
"kind": "architecture",
|
|
169
|
+
"appliesTo": ["src/**/*.ts"],
|
|
170
|
+
"deterministic": true,
|
|
171
|
+
"verificationMode": "deterministic",
|
|
172
|
+
"verificationSource": "ast",
|
|
173
|
+
"implementedBy": ["source-rule-verifier"],
|
|
174
|
+
"requiresContext": "full-project",
|
|
175
|
+
"confidence": "high",
|
|
176
|
+
"enforcedBy": ["verify"],
|
|
177
|
+
"examples": { "good": [], "bad": [] },
|
|
178
|
+
"profileOverrides": [{ "key": "paradigm", "equals": "class-first" }]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "typescript-only",
|
|
182
|
+
"title": "TypeScript Only",
|
|
183
|
+
"summary": "Implementation and test code must stay in TypeScript files only.",
|
|
184
|
+
"severity": "error",
|
|
185
|
+
"kind": "style",
|
|
186
|
+
"appliesTo": ["src/**/*", "test/**/*"],
|
|
187
|
+
"deterministic": true,
|
|
188
|
+
"verificationMode": "deterministic",
|
|
189
|
+
"verificationSource": "filesystem",
|
|
190
|
+
"implementedBy": ["project-verifier"],
|
|
191
|
+
"requiresContext": "full-project",
|
|
192
|
+
"confidence": "high",
|
|
193
|
+
"enforcedBy": ["verify", "biome"],
|
|
194
|
+
"examples": { "good": ["ai/examples/rules/functions-good.ts"], "bad": [] },
|
|
195
|
+
"profileOverrides": []
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "kebab-case-paths",
|
|
199
|
+
"title": "Kebab Case Paths",
|
|
200
|
+
"summary": "Source and test paths must use kebab-case names for files and directories unless explicitly reserved.",
|
|
201
|
+
"severity": "error",
|
|
202
|
+
"kind": "style",
|
|
203
|
+
"appliesTo": ["src/**/*", "test/**/*"],
|
|
204
|
+
"deterministic": true,
|
|
205
|
+
"verificationMode": "deterministic",
|
|
206
|
+
"verificationSource": "filesystem",
|
|
207
|
+
"implementedBy": ["project-layout-verifier"],
|
|
208
|
+
"requiresContext": "full-project",
|
|
209
|
+
"confidence": "high",
|
|
210
|
+
"enforcedBy": ["verify"],
|
|
211
|
+
"examples": { "good": [], "bad": [] },
|
|
212
|
+
"profileOverrides": []
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "singular-feature-folders",
|
|
216
|
+
"title": "Singular Feature Folders",
|
|
217
|
+
"summary": "Feature folder names under src/ must be singular unless they are reserved structural folders.",
|
|
218
|
+
"severity": "error",
|
|
219
|
+
"kind": "architecture",
|
|
220
|
+
"appliesTo": ["src/*"],
|
|
221
|
+
"deterministic": true,
|
|
222
|
+
"verificationMode": "deterministic",
|
|
223
|
+
"verificationSource": "filesystem",
|
|
224
|
+
"implementedBy": ["project-layout-verifier"],
|
|
225
|
+
"requiresContext": "full-project",
|
|
226
|
+
"confidence": "high",
|
|
227
|
+
"enforcedBy": ["verify"],
|
|
228
|
+
"examples": { "good": [], "bad": [] },
|
|
229
|
+
"profileOverrides": [{ "key": "architecture", "equals": "feature_folders" }]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "test-file-naming",
|
|
233
|
+
"title": "Test File Naming",
|
|
234
|
+
"summary": "Tests must live under test/ and use the .test.ts suffix.",
|
|
235
|
+
"severity": "error",
|
|
236
|
+
"kind": "testing",
|
|
237
|
+
"appliesTo": ["test/**/*.ts"],
|
|
238
|
+
"deterministic": true,
|
|
239
|
+
"verificationMode": "deterministic",
|
|
240
|
+
"verificationSource": "filesystem",
|
|
241
|
+
"implementedBy": ["project-layout-verifier", "testing-verifier"],
|
|
242
|
+
"requiresContext": "full-project",
|
|
243
|
+
"confidence": "high",
|
|
244
|
+
"enforcedBy": ["verify"],
|
|
245
|
+
"examples": { "good": [], "bad": [] },
|
|
246
|
+
"profileOverrides": []
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"id": "module-constant-case",
|
|
250
|
+
"title": "Module Constant Case",
|
|
251
|
+
"summary": "Module-level constants must use SCREAMING_SNAKE_CASE except for the canonical config and logger exports.",
|
|
252
|
+
"severity": "error",
|
|
253
|
+
"kind": "style",
|
|
254
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
255
|
+
"deterministic": true,
|
|
256
|
+
"verificationMode": "deterministic",
|
|
257
|
+
"verificationSource": "ast",
|
|
258
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
259
|
+
"requiresContext": "full-project",
|
|
260
|
+
"confidence": "high",
|
|
261
|
+
"enforcedBy": ["verify"],
|
|
262
|
+
"examples": { "good": [], "bad": [] },
|
|
263
|
+
"profileOverrides": []
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"id": "local-constant-case",
|
|
267
|
+
"title": "Local Constant Case",
|
|
268
|
+
"summary": "Local constants must use camelCase names.",
|
|
269
|
+
"severity": "error",
|
|
270
|
+
"kind": "style",
|
|
271
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
272
|
+
"deterministic": true,
|
|
273
|
+
"verificationMode": "deterministic",
|
|
274
|
+
"verificationSource": "ast",
|
|
275
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
276
|
+
"requiresContext": "full-project",
|
|
277
|
+
"confidence": "high",
|
|
278
|
+
"enforcedBy": ["verify"],
|
|
279
|
+
"examples": { "good": [], "bad": [] },
|
|
280
|
+
"profileOverrides": []
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"id": "config-default-export-name",
|
|
284
|
+
"title": "Config Default Export Name",
|
|
285
|
+
"summary": "src/config.ts must export a default object named config.",
|
|
286
|
+
"severity": "error",
|
|
287
|
+
"kind": "architecture",
|
|
288
|
+
"appliesTo": ["src/config.ts"],
|
|
289
|
+
"deterministic": true,
|
|
290
|
+
"verificationMode": "deterministic",
|
|
291
|
+
"verificationSource": "ast",
|
|
292
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
293
|
+
"requiresContext": "full-project",
|
|
294
|
+
"confidence": "high",
|
|
295
|
+
"enforcedBy": ["verify"],
|
|
296
|
+
"examples": { "good": ["ai/examples/demo/src/config.ts"], "bad": [] },
|
|
297
|
+
"profileOverrides": []
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "no-any",
|
|
301
|
+
"title": "No Any",
|
|
302
|
+
"summary": "Explicit any is forbidden in source and tests.",
|
|
303
|
+
"severity": "error",
|
|
304
|
+
"kind": "style",
|
|
305
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
306
|
+
"deterministic": true,
|
|
307
|
+
"verificationMode": "deterministic",
|
|
308
|
+
"verificationSource": "ast",
|
|
309
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
310
|
+
"requiresContext": "full-project",
|
|
311
|
+
"confidence": "high",
|
|
312
|
+
"enforcedBy": ["verify"],
|
|
313
|
+
"examples": { "good": [], "bad": [] },
|
|
314
|
+
"profileOverrides": []
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"id": "explicit-export-return-types",
|
|
318
|
+
"title": "Explicit Export Return Types",
|
|
319
|
+
"summary": "Exported functions and public methods of exported classes must declare explicit return types.",
|
|
320
|
+
"severity": "error",
|
|
321
|
+
"kind": "style",
|
|
322
|
+
"appliesTo": ["src/**/*.ts"],
|
|
323
|
+
"deterministic": true,
|
|
324
|
+
"verificationMode": "deterministic",
|
|
325
|
+
"verificationSource": "ast",
|
|
326
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
327
|
+
"requiresContext": "full-project",
|
|
328
|
+
"confidence": "high",
|
|
329
|
+
"enforcedBy": ["verify"],
|
|
330
|
+
"examples": { "good": [], "bad": [] },
|
|
331
|
+
"profileOverrides": []
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"id": "type-only-imports",
|
|
335
|
+
"title": "Type-only Imports",
|
|
336
|
+
"summary": "Imports used only in type positions must use import type.",
|
|
337
|
+
"severity": "error",
|
|
338
|
+
"kind": "style",
|
|
339
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
340
|
+
"deterministic": true,
|
|
341
|
+
"verificationMode": "deterministic",
|
|
342
|
+
"verificationSource": "combined",
|
|
343
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
344
|
+
"requiresContext": "full-project",
|
|
345
|
+
"confidence": "high",
|
|
346
|
+
"enforcedBy": ["verify"],
|
|
347
|
+
"examples": { "good": [], "bad": [] },
|
|
348
|
+
"profileOverrides": []
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"id": "prefer-types-over-interfaces",
|
|
352
|
+
"title": "Prefer Types Over Interfaces",
|
|
353
|
+
"summary": "Interfaces are forbidden for local modeling unless they are part of the public contract exported from src/index.ts.",
|
|
354
|
+
"severity": "error",
|
|
355
|
+
"kind": "style",
|
|
356
|
+
"appliesTo": ["src/**/*.ts"],
|
|
357
|
+
"deterministic": true,
|
|
358
|
+
"verificationMode": "deterministic",
|
|
359
|
+
"verificationSource": "combined",
|
|
360
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
361
|
+
"requiresContext": "full-project",
|
|
362
|
+
"confidence": "high",
|
|
363
|
+
"enforcedBy": ["verify"],
|
|
364
|
+
"examples": { "good": [], "bad": [] },
|
|
365
|
+
"profileOverrides": [{ "key": "type_contract_policy", "equals": "prefer_types_over_interfaces" }]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"id": "control-flow-braces",
|
|
369
|
+
"title": "Control Flow Braces",
|
|
370
|
+
"summary": "if, else, for, while, and do blocks must always use braces.",
|
|
371
|
+
"severity": "error",
|
|
372
|
+
"kind": "style",
|
|
373
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
374
|
+
"deterministic": true,
|
|
375
|
+
"verificationMode": "deterministic",
|
|
376
|
+
"verificationSource": "ast",
|
|
377
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
378
|
+
"requiresContext": "full-project",
|
|
379
|
+
"confidence": "high",
|
|
380
|
+
"enforcedBy": ["verify"],
|
|
381
|
+
"examples": { "good": ["ai/examples/rules/control-flow-good.ts"], "bad": ["ai/examples/rules/control-flow-bad.ts"] },
|
|
382
|
+
"profileOverrides": [{ "key": "if_requires_braces", "equals": true }]
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"id": "concise-simple-callbacks",
|
|
386
|
+
"title": "Concise Simple Callbacks",
|
|
387
|
+
"summary": "Prefer concise arrow callbacks when Biome already keeps them concise; do not rewrite formatter-stable block callbacks just for style.",
|
|
388
|
+
"severity": "warning",
|
|
389
|
+
"kind": "style",
|
|
390
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
391
|
+
"deterministic": false,
|
|
392
|
+
"verificationMode": "heuristic",
|
|
393
|
+
"verificationSource": "combined",
|
|
394
|
+
"implementedBy": ["policy-guidance"],
|
|
395
|
+
"requiresContext": "full-project",
|
|
396
|
+
"confidence": "medium",
|
|
397
|
+
"enforcedBy": ["guidance"],
|
|
398
|
+
"examples": { "good": [], "bad": [] },
|
|
399
|
+
"profileOverrides": []
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"id": "compact-single-line-constructs",
|
|
403
|
+
"title": "Compact Single Line Constructs",
|
|
404
|
+
"summary": "Prefer compact layouts, but let Biome decide final wrapping instead of forcing single-line constructs the formatter keeps multiline.",
|
|
405
|
+
"severity": "warning",
|
|
406
|
+
"kind": "style",
|
|
407
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
408
|
+
"deterministic": false,
|
|
409
|
+
"verificationMode": "heuristic",
|
|
410
|
+
"verificationSource": "combined",
|
|
411
|
+
"implementedBy": ["policy-guidance"],
|
|
412
|
+
"requiresContext": "full-project",
|
|
413
|
+
"confidence": "medium",
|
|
414
|
+
"enforcedBy": ["guidance"],
|
|
415
|
+
"examples": { "good": [], "bad": [] },
|
|
416
|
+
"profileOverrides": []
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"id": "feature-first-layout",
|
|
420
|
+
"title": "Feature First Layout",
|
|
421
|
+
"summary": "Projects with feature modules must keep domain code under feature folders instead of mixing flat modules at src/ root.",
|
|
422
|
+
"severity": "warning",
|
|
423
|
+
"kind": "architecture",
|
|
424
|
+
"appliesTo": ["src/**/*"],
|
|
425
|
+
"deterministic": false,
|
|
426
|
+
"verificationMode": "heuristic",
|
|
427
|
+
"verificationSource": "filesystem",
|
|
428
|
+
"implementedBy": ["project-layout-verifier"],
|
|
429
|
+
"requiresContext": "full-project",
|
|
430
|
+
"confidence": "medium",
|
|
431
|
+
"enforcedBy": ["verify"],
|
|
432
|
+
"examples": { "good": [], "bad": [] },
|
|
433
|
+
"profileOverrides": [{ "key": "architecture", "equals": "feature_folders" }]
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"id": "restricted-shared-boundaries",
|
|
437
|
+
"title": "Restricted Shared Boundaries",
|
|
438
|
+
"summary": "src/app and src/shared should exist only when real composition or cross-feature sharing justifies them.",
|
|
439
|
+
"severity": "warning",
|
|
440
|
+
"kind": "architecture",
|
|
441
|
+
"appliesTo": ["src/app/**", "src/shared/**"],
|
|
442
|
+
"deterministic": false,
|
|
443
|
+
"verificationMode": "heuristic",
|
|
444
|
+
"verificationSource": "combined",
|
|
445
|
+
"implementedBy": ["project-layout-verifier"],
|
|
446
|
+
"requiresContext": "full-project",
|
|
447
|
+
"confidence": "medium",
|
|
448
|
+
"enforcedBy": ["verify"],
|
|
449
|
+
"examples": { "good": [], "bad": [] },
|
|
450
|
+
"profileOverrides": []
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"id": "cross-feature-entrypoint-imports",
|
|
454
|
+
"title": "Cross Feature Entrypoint Imports",
|
|
455
|
+
"summary": "Cross-feature imports must go through an explicit feature entrypoint rather than another feature's internal file.",
|
|
456
|
+
"severity": "error",
|
|
457
|
+
"kind": "architecture",
|
|
458
|
+
"appliesTo": ["src/**/*.ts"],
|
|
459
|
+
"deterministic": true,
|
|
460
|
+
"verificationMode": "deterministic",
|
|
461
|
+
"verificationSource": "combined",
|
|
462
|
+
"implementedBy": ["project-layout-verifier"],
|
|
463
|
+
"requiresContext": "full-project",
|
|
464
|
+
"confidence": "high",
|
|
465
|
+
"enforcedBy": ["verify"],
|
|
466
|
+
"examples": { "good": [], "bad": [] },
|
|
467
|
+
"profileOverrides": []
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"id": "types-file-justification",
|
|
471
|
+
"title": "Types File Justification",
|
|
472
|
+
"summary": "Dedicated .types.ts files should only exist when they contain substantial shared feature types.",
|
|
473
|
+
"severity": "warning",
|
|
474
|
+
"kind": "architecture",
|
|
475
|
+
"appliesTo": ["src/**/*.types.ts"],
|
|
476
|
+
"deterministic": false,
|
|
477
|
+
"verificationMode": "heuristic",
|
|
478
|
+
"verificationSource": "combined",
|
|
479
|
+
"implementedBy": ["project-layout-verifier"],
|
|
480
|
+
"requiresContext": "full-project",
|
|
481
|
+
"confidence": "medium",
|
|
482
|
+
"enforcedBy": ["verify"],
|
|
483
|
+
"examples": { "good": [], "bad": [] },
|
|
484
|
+
"profileOverrides": []
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"id": "ambiguous-feature-filenames",
|
|
488
|
+
"title": "Ambiguous Feature Filenames",
|
|
489
|
+
"summary": "Feature code must not use ambiguous file names such as helpers.ts, utils.ts, or common.ts.",
|
|
490
|
+
"severity": "error",
|
|
491
|
+
"kind": "architecture",
|
|
492
|
+
"appliesTo": ["src/**/*.ts"],
|
|
493
|
+
"deterministic": true,
|
|
494
|
+
"verificationMode": "deterministic",
|
|
495
|
+
"verificationSource": "filesystem",
|
|
496
|
+
"implementedBy": ["project-layout-verifier"],
|
|
497
|
+
"requiresContext": "full-project",
|
|
498
|
+
"confidence": "high",
|
|
499
|
+
"enforcedBy": ["verify"],
|
|
500
|
+
"examples": { "good": [], "bad": [] },
|
|
501
|
+
"profileOverrides": []
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"id": "plain-error-default",
|
|
505
|
+
"title": "Plain Error Default",
|
|
506
|
+
"summary": "Plain Error must be used by default; custom error types require a real control-flow consumer.",
|
|
507
|
+
"severity": "warning",
|
|
508
|
+
"kind": "workflow",
|
|
509
|
+
"appliesTo": ["src/**/*.ts"],
|
|
510
|
+
"deterministic": false,
|
|
511
|
+
"verificationMode": "heuristic",
|
|
512
|
+
"verificationSource": "combined",
|
|
513
|
+
"implementedBy": ["policy-guidance"],
|
|
514
|
+
"requiresContext": "full-project",
|
|
515
|
+
"confidence": "medium",
|
|
516
|
+
"enforcedBy": ["guidance"],
|
|
517
|
+
"examples": { "good": ["ai/examples/rules/errors-good.ts"], "bad": ["ai/examples/rules/errors-bad.ts"] },
|
|
518
|
+
"profileOverrides": []
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"id": "typed-error-must-be-used",
|
|
522
|
+
"title": "Typed Error Must Be Used",
|
|
523
|
+
"summary": "Custom error types must be consumed by logic that distinguishes them from plain failures.",
|
|
524
|
+
"severity": "error",
|
|
525
|
+
"kind": "workflow",
|
|
526
|
+
"appliesTo": ["src/**/*.ts"],
|
|
527
|
+
"deterministic": true,
|
|
528
|
+
"verificationMode": "deterministic",
|
|
529
|
+
"verificationSource": "combined",
|
|
530
|
+
"implementedBy": ["error-handling-verifier"],
|
|
531
|
+
"requiresContext": "full-project",
|
|
532
|
+
"confidence": "high",
|
|
533
|
+
"enforcedBy": ["verify"],
|
|
534
|
+
"examples": { "good": ["ai/examples/rules/errors-good.ts"], "bad": ["ai/examples/rules/errors-bad.ts"] },
|
|
535
|
+
"profileOverrides": []
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"id": "no-silent-catch",
|
|
539
|
+
"title": "No Silent Catch",
|
|
540
|
+
"summary": "Catch blocks must rethrow, transform, or report errors instead of silently swallowing them; reporting currently means throw, console.warn, console.error, or promise-style .catch handling.",
|
|
541
|
+
"severity": "error",
|
|
542
|
+
"kind": "workflow",
|
|
543
|
+
"appliesTo": ["src/**/*.ts"],
|
|
544
|
+
"deterministic": true,
|
|
545
|
+
"verificationMode": "deterministic",
|
|
546
|
+
"verificationSource": "ast",
|
|
547
|
+
"implementedBy": ["error-handling-verifier"],
|
|
548
|
+
"requiresContext": "full-project",
|
|
549
|
+
"confidence": "high",
|
|
550
|
+
"enforcedBy": ["verify"],
|
|
551
|
+
"examples": { "good": ["ai/examples/rules/errors-good.ts"], "bad": ["ai/examples/rules/errors-bad.ts"] },
|
|
552
|
+
"profileOverrides": []
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"id": "actionable-error-messages",
|
|
556
|
+
"title": "Actionable Error Messages",
|
|
557
|
+
"summary": "Error messages should include actionable context rather than empty or generic text.",
|
|
558
|
+
"severity": "warning",
|
|
559
|
+
"kind": "workflow",
|
|
560
|
+
"appliesTo": ["src/**/*.ts"],
|
|
561
|
+
"deterministic": false,
|
|
562
|
+
"verificationMode": "heuristic",
|
|
563
|
+
"verificationSource": "ast",
|
|
564
|
+
"implementedBy": ["error-handling-verifier"],
|
|
565
|
+
"requiresContext": "full-project",
|
|
566
|
+
"confidence": "medium",
|
|
567
|
+
"enforcedBy": ["verify"],
|
|
568
|
+
"examples": { "good": ["ai/examples/rules/errors-good.ts"], "bad": ["ai/examples/rules/errors-bad.ts"] },
|
|
569
|
+
"profileOverrides": []
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"id": "managed-files-read-only",
|
|
573
|
+
"title": "Managed Files Are Read Only",
|
|
574
|
+
"summary": "Managed contract and tooling files must not be edited during normal feature work.",
|
|
575
|
+
"severity": "audit",
|
|
576
|
+
"kind": "workflow",
|
|
577
|
+
"appliesTo": ["AGENTS.md", "ai/*.md", "ai/contract.json", "tooling config files"],
|
|
578
|
+
"deterministic": false,
|
|
579
|
+
"verificationMode": "audit",
|
|
580
|
+
"verificationSource": "git-diff",
|
|
581
|
+
"implementedBy": ["change-audit-verifier"],
|
|
582
|
+
"requiresContext": "changed-files",
|
|
583
|
+
"confidence": "medium",
|
|
584
|
+
"enforcedBy": ["verify"],
|
|
585
|
+
"examples": { "good": [], "bad": [] },
|
|
586
|
+
"profileOverrides": []
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"id": "behavior-change-tests",
|
|
590
|
+
"title": "Behavior Changes Need Tests",
|
|
591
|
+
"summary": "Behavior changes must update or add tests, and tests should focus on observable behavior.",
|
|
592
|
+
"severity": "audit",
|
|
593
|
+
"kind": "testing",
|
|
594
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
595
|
+
"deterministic": false,
|
|
596
|
+
"verificationMode": "audit",
|
|
597
|
+
"verificationSource": "git-diff",
|
|
598
|
+
"implementedBy": ["testing-verifier"],
|
|
599
|
+
"requiresContext": "changed-files",
|
|
600
|
+
"confidence": "medium",
|
|
601
|
+
"enforcedBy": ["verify"],
|
|
602
|
+
"examples": { "good": ["ai/examples/rules/testing-good.ts"], "bad": ["ai/examples/rules/testing-bad.ts"] },
|
|
603
|
+
"profileOverrides": [{ "key": "testing_policy", "equals": "tests_required_for_behavior_change" }]
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"id": "node-test-runner-only",
|
|
607
|
+
"title": "Node Test Runner Only",
|
|
608
|
+
"summary": "Test files must use node:test instead of alternative runners.",
|
|
609
|
+
"severity": "error",
|
|
610
|
+
"kind": "testing",
|
|
611
|
+
"appliesTo": ["test/**/*.ts"],
|
|
612
|
+
"deterministic": true,
|
|
613
|
+
"verificationMode": "deterministic",
|
|
614
|
+
"verificationSource": "ast",
|
|
615
|
+
"implementedBy": ["testing-verifier"],
|
|
616
|
+
"requiresContext": "full-project",
|
|
617
|
+
"confidence": "high",
|
|
618
|
+
"enforcedBy": ["verify"],
|
|
619
|
+
"examples": { "good": [], "bad": [] },
|
|
620
|
+
"profileOverrides": []
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"id": "assert-strict-preferred",
|
|
624
|
+
"title": "Assert Strict Preferred",
|
|
625
|
+
"summary": "Tests must use node:assert/strict for assertions.",
|
|
626
|
+
"severity": "error",
|
|
627
|
+
"kind": "testing",
|
|
628
|
+
"appliesTo": ["test/**/*.ts"],
|
|
629
|
+
"deterministic": true,
|
|
630
|
+
"verificationMode": "deterministic",
|
|
631
|
+
"verificationSource": "ast",
|
|
632
|
+
"implementedBy": ["testing-verifier"],
|
|
633
|
+
"requiresContext": "full-project",
|
|
634
|
+
"confidence": "high",
|
|
635
|
+
"enforcedBy": ["verify"],
|
|
636
|
+
"examples": { "good": [], "bad": [] },
|
|
637
|
+
"profileOverrides": []
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"id": "no-ts-ignore-bypass",
|
|
641
|
+
"title": "No TS Ignore Bypass",
|
|
642
|
+
"summary": "TypeScript and Biome ignore directives must not be used to bypass real issues in source or tests.",
|
|
643
|
+
"severity": "error",
|
|
644
|
+
"kind": "testing",
|
|
645
|
+
"appliesTo": ["src/**/*.ts", "test/**/*.ts"],
|
|
646
|
+
"deterministic": true,
|
|
647
|
+
"verificationMode": "deterministic",
|
|
648
|
+
"verificationSource": "text",
|
|
649
|
+
"implementedBy": ["testing-verifier"],
|
|
650
|
+
"requiresContext": "full-project",
|
|
651
|
+
"confidence": "high",
|
|
652
|
+
"enforcedBy": ["verify"],
|
|
653
|
+
"examples": { "good": [], "bad": [] },
|
|
654
|
+
"profileOverrides": []
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"id": "test-determinism-guards",
|
|
658
|
+
"title": "Test Determinism Guards",
|
|
659
|
+
"summary": "Tests should avoid uncontrolled time, randomness, real network calls, and un-restored process.env mutation.",
|
|
660
|
+
"severity": "warning",
|
|
661
|
+
"kind": "testing",
|
|
662
|
+
"appliesTo": ["test/**/*.ts"],
|
|
663
|
+
"deterministic": false,
|
|
664
|
+
"verificationMode": "heuristic",
|
|
665
|
+
"verificationSource": "combined",
|
|
666
|
+
"implementedBy": ["testing-verifier"],
|
|
667
|
+
"requiresContext": "full-project",
|
|
668
|
+
"confidence": "medium",
|
|
669
|
+
"enforcedBy": ["verify"],
|
|
670
|
+
"examples": { "good": [], "bad": [] },
|
|
671
|
+
"profileOverrides": []
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"id": "readme-sections",
|
|
675
|
+
"title": "README Required Sections",
|
|
676
|
+
"summary": "README.md must keep the required sections for setup, API, config, troubleshooting, and AI workflow.",
|
|
677
|
+
"severity": "error",
|
|
678
|
+
"kind": "documentation",
|
|
679
|
+
"appliesTo": ["README.md"],
|
|
680
|
+
"deterministic": true,
|
|
681
|
+
"verificationMode": "deterministic",
|
|
682
|
+
"verificationSource": "readme",
|
|
683
|
+
"implementedBy": ["readme-verifier"],
|
|
684
|
+
"requiresContext": "full-project",
|
|
685
|
+
"confidence": "high",
|
|
686
|
+
"enforcedBy": ["verify"],
|
|
687
|
+
"examples": { "good": [], "bad": [] },
|
|
688
|
+
"profileOverrides": []
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"id": "readme-no-placeholder-language",
|
|
692
|
+
"title": "README No Placeholder Language",
|
|
693
|
+
"summary": "README content must not look like a scaffold placeholder or contain TODO-style filler text.",
|
|
694
|
+
"severity": "warning",
|
|
695
|
+
"kind": "documentation",
|
|
696
|
+
"appliesTo": ["README.md"],
|
|
697
|
+
"deterministic": false,
|
|
698
|
+
"verificationMode": "heuristic",
|
|
699
|
+
"verificationSource": "readme",
|
|
700
|
+
"implementedBy": ["readme-verifier"],
|
|
701
|
+
"requiresContext": "full-project",
|
|
702
|
+
"confidence": "medium",
|
|
703
|
+
"enforcedBy": ["verify"],
|
|
704
|
+
"examples": { "good": [], "bad": [] },
|
|
705
|
+
"profileOverrides": []
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"id": "readme-config-coverage",
|
|
709
|
+
"title": "README Config Coverage",
|
|
710
|
+
"summary": "README must document each top-level configuration key exposed from src/config.ts.",
|
|
711
|
+
"severity": "error",
|
|
712
|
+
"kind": "documentation",
|
|
713
|
+
"appliesTo": ["README.md", "src/config.ts"],
|
|
714
|
+
"deterministic": true,
|
|
715
|
+
"verificationMode": "deterministic",
|
|
716
|
+
"verificationSource": "combined",
|
|
717
|
+
"implementedBy": ["readme-verifier"],
|
|
718
|
+
"requiresContext": "full-project",
|
|
719
|
+
"confidence": "high",
|
|
720
|
+
"enforcedBy": ["verify"],
|
|
721
|
+
"examples": { "good": [], "bad": [] },
|
|
722
|
+
"profileOverrides": []
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"id": "readme-runnable-examples",
|
|
726
|
+
"title": "README Runnable Examples",
|
|
727
|
+
"summary": "README must include plausible runnable code or command examples instead of abstract placeholders.",
|
|
728
|
+
"severity": "warning",
|
|
729
|
+
"kind": "documentation",
|
|
730
|
+
"appliesTo": ["README.md"],
|
|
731
|
+
"deterministic": false,
|
|
732
|
+
"verificationMode": "heuristic",
|
|
733
|
+
"verificationSource": "readme",
|
|
734
|
+
"implementedBy": ["readme-verifier"],
|
|
735
|
+
"requiresContext": "full-project",
|
|
736
|
+
"confidence": "medium",
|
|
737
|
+
"enforcedBy": ["verify"],
|
|
738
|
+
"examples": { "good": [], "bad": [] },
|
|
739
|
+
"profileOverrides": []
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"id": "required-scripts",
|
|
743
|
+
"title": "Required Scripts",
|
|
744
|
+
"summary": "Generated projects must expose the required standards, lint, format, typecheck, test, and check scripts.",
|
|
745
|
+
"severity": "error",
|
|
746
|
+
"kind": "workflow",
|
|
747
|
+
"appliesTo": ["package.json"],
|
|
748
|
+
"deterministic": true,
|
|
749
|
+
"verificationMode": "deterministic",
|
|
750
|
+
"verificationSource": "package-json",
|
|
751
|
+
"implementedBy": ["tooling-verifier"],
|
|
752
|
+
"requiresContext": "full-project",
|
|
753
|
+
"confidence": "high",
|
|
754
|
+
"enforcedBy": ["verify"],
|
|
755
|
+
"examples": { "good": [], "bad": [] },
|
|
756
|
+
"profileOverrides": []
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"id": "standards-check-script",
|
|
760
|
+
"title": "Standards Check Script",
|
|
761
|
+
"summary": "npm run standards:check must execute code-standards verify.",
|
|
762
|
+
"severity": "error",
|
|
763
|
+
"kind": "workflow",
|
|
764
|
+
"appliesTo": ["package.json"],
|
|
765
|
+
"deterministic": true,
|
|
766
|
+
"verificationMode": "deterministic",
|
|
767
|
+
"verificationSource": "package-json",
|
|
768
|
+
"implementedBy": ["tooling-verifier"],
|
|
769
|
+
"requiresContext": "full-project",
|
|
770
|
+
"confidence": "high",
|
|
771
|
+
"enforcedBy": ["verify"],
|
|
772
|
+
"examples": { "good": [], "bad": [] },
|
|
773
|
+
"profileOverrides": []
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
"id": "package-exports-alignment",
|
|
777
|
+
"title": "Package Exports Alignment",
|
|
778
|
+
"summary": "Generated projects must stay aligned with @sha3/code biome and tsconfig exports.",
|
|
779
|
+
"severity": "error",
|
|
780
|
+
"kind": "workflow",
|
|
781
|
+
"appliesTo": ["package.json", "biome.json", "tsconfig.json"],
|
|
782
|
+
"deterministic": true,
|
|
783
|
+
"verificationMode": "deterministic",
|
|
784
|
+
"verificationSource": "combined",
|
|
785
|
+
"implementedBy": ["tooling-verifier"],
|
|
786
|
+
"requiresContext": "full-project",
|
|
787
|
+
"confidence": "high",
|
|
788
|
+
"enforcedBy": ["verify"],
|
|
789
|
+
"examples": { "good": [], "bad": [] },
|
|
790
|
+
"profileOverrides": []
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
"id": "simplicity-audit",
|
|
794
|
+
"title": "Simplicity Audit",
|
|
795
|
+
"summary": "Projects should avoid needless layers, wrappers, and extra files when a smaller direct implementation would suffice.",
|
|
796
|
+
"severity": "audit",
|
|
797
|
+
"kind": "architecture",
|
|
798
|
+
"appliesTo": ["src/**/*.ts"],
|
|
799
|
+
"deterministic": false,
|
|
800
|
+
"verificationMode": "audit",
|
|
801
|
+
"verificationSource": "combined",
|
|
802
|
+
"implementedBy": ["policy-guidance"],
|
|
803
|
+
"requiresContext": "full-project",
|
|
804
|
+
"confidence": "medium",
|
|
805
|
+
"enforcedBy": ["guidance"],
|
|
806
|
+
"examples": { "good": [], "bad": [] },
|
|
807
|
+
"profileOverrides": []
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"id": "no-speculative-abstractions",
|
|
811
|
+
"title": "No Speculative Abstractions",
|
|
812
|
+
"summary": "Factories, options types, wrappers, and helper layers should not exist without a real current consumer or complexity reduction.",
|
|
813
|
+
"severity": "warning",
|
|
814
|
+
"kind": "architecture",
|
|
815
|
+
"appliesTo": ["src/**/*.ts"],
|
|
816
|
+
"deterministic": false,
|
|
817
|
+
"verificationMode": "heuristic",
|
|
818
|
+
"verificationSource": "combined",
|
|
819
|
+
"implementedBy": ["policy-guidance"],
|
|
820
|
+
"requiresContext": "full-project",
|
|
821
|
+
"confidence": "medium",
|
|
822
|
+
"enforcedBy": ["guidance"],
|
|
823
|
+
"examples": { "good": [], "bad": [] },
|
|
824
|
+
"profileOverrides": []
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"id": "single-responsibility-heuristic",
|
|
828
|
+
"title": "Single Responsibility Heuristic",
|
|
829
|
+
"summary": "Long functions and methods should be split when they appear to mix multiple responsibilities.",
|
|
830
|
+
"severity": "warning",
|
|
831
|
+
"kind": "style",
|
|
832
|
+
"appliesTo": ["src/**/*.ts"],
|
|
833
|
+
"deterministic": false,
|
|
834
|
+
"verificationMode": "heuristic",
|
|
835
|
+
"verificationSource": "ast",
|
|
836
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
837
|
+
"requiresContext": "full-project",
|
|
838
|
+
"confidence": "medium",
|
|
839
|
+
"enforcedBy": ["verify"],
|
|
840
|
+
"examples": { "good": [], "bad": [] },
|
|
841
|
+
"profileOverrides": [{ "key": "function_size_policy", "equals": "max_30_lines_soft" }]
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"id": "large-class-heuristic",
|
|
845
|
+
"title": "Large Class Heuristic",
|
|
846
|
+
"summary": "Very large classes should be decomposed into smaller cohesive units instead of accumulating unrelated responsibilities in one file.",
|
|
847
|
+
"severity": "warning",
|
|
848
|
+
"kind": "architecture",
|
|
849
|
+
"appliesTo": ["src/**/*.ts"],
|
|
850
|
+
"deterministic": false,
|
|
851
|
+
"verificationMode": "heuristic",
|
|
852
|
+
"verificationSource": "ast",
|
|
853
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
854
|
+
"requiresContext": "full-project",
|
|
855
|
+
"confidence": "medium",
|
|
856
|
+
"enforcedBy": ["verify"],
|
|
857
|
+
"examples": { "good": [], "bad": [] },
|
|
858
|
+
"profileOverrides": []
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"id": "comments-policy-audit",
|
|
862
|
+
"title": "Comments Policy Audit",
|
|
863
|
+
"summary": "Non-trivial logic should include explicit comments when the profile requires extensive comments.",
|
|
864
|
+
"severity": "audit",
|
|
865
|
+
"kind": "style",
|
|
866
|
+
"appliesTo": ["src/**/*.ts"],
|
|
867
|
+
"deterministic": false,
|
|
868
|
+
"verificationMode": "audit",
|
|
869
|
+
"verificationSource": "combined",
|
|
870
|
+
"implementedBy": ["typescript-style-verifier"],
|
|
871
|
+
"requiresContext": "full-project",
|
|
872
|
+
"confidence": "medium",
|
|
873
|
+
"enforcedBy": ["verify"],
|
|
874
|
+
"examples": { "good": [], "bad": [] },
|
|
875
|
+
"profileOverrides": [{ "key": "comments_policy", "equals": "extensive" }]
|
|
876
|
+
}
|
|
877
|
+
]
|
|
878
|
+
}
|