@oddessentials/repo-standards 4.4.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/config/standards.csharp-dotnet.azure-devops.json +377 -12
- package/dist/config/standards.csharp-dotnet.github-actions.json +378 -13
- package/dist/config/standards.csharp-dotnet.json +435 -13
- package/dist/config/standards.go.azure-devops.json +367 -10
- package/dist/config/standards.go.github-actions.json +368 -11
- package/dist/config/standards.go.json +425 -11
- package/dist/config/standards.json +1470 -81
- package/dist/config/standards.python.azure-devops.json +383 -10
- package/dist/config/standards.python.github-actions.json +384 -11
- package/dist/config/standards.python.json +441 -11
- package/dist/config/standards.rust.azure-devops.json +370 -10
- package/dist/config/standards.rust.github-actions.json +371 -11
- package/dist/config/standards.rust.json +428 -11
- package/dist/config/standards.schema.json +24 -2
- package/dist/config/standards.typescript-js.azure-devops.json +387 -11
- package/dist/config/standards.typescript-js.github-actions.json +388 -12
- package/dist/config/standards.typescript-js.json +445 -12
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-version-unchanged.sh +50 -0
- package/scripts/validate-schema.ts +46 -0
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"checklist": {
|
|
3
3
|
"core": [
|
|
4
|
+
{
|
|
5
|
+
"ciHints": {
|
|
6
|
+
"azure-devops": {
|
|
7
|
+
"notes": "Run CRLF detection early in pipeline before other checks.",
|
|
8
|
+
"stage": "quality"
|
|
9
|
+
},
|
|
10
|
+
"github-actions": {
|
|
11
|
+
"job": "ci",
|
|
12
|
+
"notes": "Add .gitattributes check as first step in CI job."
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"description": "Enforce line endings at the Git layer using .gitattributes. Mark text files with appropriate EOL handling (eol=lf for shell scripts, eol=auto for most files) and binary files as binary to prevent corruption. This prevents 'works locally, fails in CI' issues caused by CRLF/LF mismatches.",
|
|
16
|
+
"id": "gitattributes-eol",
|
|
17
|
+
"label": "Git Attributes (Line Endings)",
|
|
18
|
+
"stack": {
|
|
19
|
+
"exampleConfigFiles": [
|
|
20
|
+
".gitattributes",
|
|
21
|
+
".editorconfig"
|
|
22
|
+
],
|
|
23
|
+
"exampleTools": [
|
|
24
|
+
"git"
|
|
25
|
+
],
|
|
26
|
+
"machineCheck": {
|
|
27
|
+
"command": "git ls-files --eol | grep -E 'w/crlf.*\\.(sh|bash|py)$' && exit 1 || exit 0",
|
|
28
|
+
"description": "Verify no CRLF in shell/script files",
|
|
29
|
+
"expectExitCode": 0
|
|
30
|
+
},
|
|
31
|
+
"notes": "Use .gitattributes as the authority for EOL; .editorconfig is supplementary for editor display. Mark *.sh, *.bash as eol=lf. After adding .gitattributes, run 'git add --renormalize .' to fix existing files. Windows contributors should set core.autocrlf=false.",
|
|
32
|
+
"optionalFiles": [
|
|
33
|
+
".editorconfig"
|
|
34
|
+
],
|
|
35
|
+
"requiredFiles": [
|
|
36
|
+
".gitattributes"
|
|
37
|
+
],
|
|
38
|
+
"verification": "Run 'git ls-files --eol' and verify no unexpected CRLF in LF-only files."
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"ciHints": {
|
|
43
|
+
"azure-devops": {
|
|
44
|
+
"notes": "Run CRLF detection as the first quality check before linting or testing.",
|
|
45
|
+
"stage": "quality"
|
|
46
|
+
},
|
|
47
|
+
"github-actions": {
|
|
48
|
+
"job": "ci",
|
|
49
|
+
"notes": "Add CRLF detection step before main CI steps."
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"description": "Fail CI early for Linux-executed files containing CRLF line endings. Shell scripts, Python files, and other interpreted files fail silently or with cryptic errors when they contain \\r characters. Detect this before running deeper CI steps.",
|
|
53
|
+
"id": "crlf-detection",
|
|
54
|
+
"label": "CRLF Detection in CI",
|
|
55
|
+
"stack": {
|
|
56
|
+
"exampleConfigFiles": [],
|
|
57
|
+
"exampleTools": [
|
|
58
|
+
"file",
|
|
59
|
+
"grep"
|
|
60
|
+
],
|
|
61
|
+
"machineCheck": {
|
|
62
|
+
"command": "git ls-files --eol | grep -E 'w/crlf.*\\.(sh|js|ts|mjs|cjs)$' && exit 1 || exit 0",
|
|
63
|
+
"description": "Detect CRLF in script files",
|
|
64
|
+
"expectExitCode": 0
|
|
65
|
+
},
|
|
66
|
+
"notes": "Check for CRLF in .sh, .js, .ts, .json files early in CI. Use 'file' command or grep for \\r to detect issues before they cause cryptic failures.",
|
|
67
|
+
"verification": "Run 'git ls-files --eol | grep w/crlf' and verify no unexpected CRLF files."
|
|
68
|
+
}
|
|
69
|
+
},
|
|
4
70
|
{
|
|
5
71
|
"ciHints": {
|
|
6
72
|
"azure-devops": {
|
|
@@ -183,6 +249,40 @@
|
|
|
183
249
|
"verification": "Check that the canonical version field follows SemVer, and trigger the configured release workflow (for example, a dry run of semantic-release or standard-version) to confirm it generates the expected next version, updates package.json or VERSION, and creates/updates CHANGELOG.md with commit-based entries."
|
|
184
250
|
}
|
|
185
251
|
},
|
|
252
|
+
{
|
|
253
|
+
"ciHints": {
|
|
254
|
+
"azure-devops": {
|
|
255
|
+
"notes": "Run the version guard in PR validation jobs before merge.",
|
|
256
|
+
"stage": "quality"
|
|
257
|
+
},
|
|
258
|
+
"github-actions": {
|
|
259
|
+
"job": "ci",
|
|
260
|
+
"notes": "Run the version guard in PR workflows against the base ref."
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
264
|
+
"id": "version-guard",
|
|
265
|
+
"label": "Version Guard (Automated Releases)",
|
|
266
|
+
"stack": {
|
|
267
|
+
"exampleConfigFiles": [
|
|
268
|
+
"scripts/check-version-unchanged.sh",
|
|
269
|
+
".github/workflows/ci.yml",
|
|
270
|
+
"azure-pipelines.yml"
|
|
271
|
+
],
|
|
272
|
+
"exampleTools": [
|
|
273
|
+
"semantic-release",
|
|
274
|
+
"git"
|
|
275
|
+
],
|
|
276
|
+
"notes": "Add a CI step that runs scripts/check-version-unchanged.sh against the PR base ref. This blocks manual edits to package.json version when semantic-release owns versioning. Optionally wire the same script into a pre-push hook for fast feedback.",
|
|
277
|
+
"optionalFiles": [
|
|
278
|
+
"VERSION"
|
|
279
|
+
],
|
|
280
|
+
"requiredFiles": [
|
|
281
|
+
"package.json"
|
|
282
|
+
],
|
|
283
|
+
"verification": "Run the guard with the PR base ref (for example, origin/main) and confirm it fails when package.json version changes."
|
|
284
|
+
}
|
|
285
|
+
},
|
|
186
286
|
{
|
|
187
287
|
"ciHints": {
|
|
188
288
|
"azure-devops": {
|
|
@@ -217,6 +317,37 @@
|
|
|
217
317
|
"verification": "Trigger the release pipeline and confirm all artifacts share the same version number and tag."
|
|
218
318
|
}
|
|
219
319
|
},
|
|
320
|
+
{
|
|
321
|
+
"ciHints": {
|
|
322
|
+
"azure-devops": {
|
|
323
|
+
"notes": "Set HUSKY=0 or equivalent in release pipeline to disable hooks.",
|
|
324
|
+
"stage": "release"
|
|
325
|
+
},
|
|
326
|
+
"github-actions": {
|
|
327
|
+
"job": "release",
|
|
328
|
+
"notes": "Set HUSKY=0 or equivalent in release job to disable hooks."
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"description": "Release automation must bypass local developer hooks (HUSKY=0, --no-verify) and rely solely on CI gates for validation. This ensures idempotent, reproducible releases that don't fail due to hook environment differences.",
|
|
332
|
+
"id": "release-hook-bypass",
|
|
333
|
+
"label": "Release Hook Bypass",
|
|
334
|
+
"stack": {
|
|
335
|
+
"exampleConfigFiles": [
|
|
336
|
+
".github/workflows/release.yml"
|
|
337
|
+
],
|
|
338
|
+
"exampleTools": [
|
|
339
|
+
"semantic-release",
|
|
340
|
+
"husky"
|
|
341
|
+
],
|
|
342
|
+
"machineCheck": {
|
|
343
|
+
"command": "grep -r 'HUSKY=0\\|--no-verify' .github/workflows/ || echo 'WARNING: No hook bypass in release workflow'",
|
|
344
|
+
"description": "Verify release workflows disable hooks",
|
|
345
|
+
"expectExitCode": 0
|
|
346
|
+
},
|
|
347
|
+
"notes": "In release workflows, set HUSKY=0 environment variable to disable husky hooks. Release commits from semantic-release should bypass commitlint since they're generated. CI gates already validated the code.",
|
|
348
|
+
"verification": "Check release workflow for HUSKY=0 or --no-verify flags."
|
|
349
|
+
}
|
|
350
|
+
},
|
|
220
351
|
{
|
|
221
352
|
"ciHints": {
|
|
222
353
|
"azure-devops": {
|
|
@@ -343,26 +474,85 @@
|
|
|
343
474
|
{
|
|
344
475
|
"ciHints": {
|
|
345
476
|
"azure-devops": {
|
|
477
|
+
"notes": "Hooks and CI must invoke identical verification commands. Use npm run verify or equivalent.",
|
|
346
478
|
"stage": "quality"
|
|
347
479
|
},
|
|
348
480
|
"github-actions": {
|
|
349
|
-
"job": "ci"
|
|
481
|
+
"job": "ci",
|
|
482
|
+
"notes": "Hooks and CI must invoke identical verification commands. Use npm run verify or equivalent."
|
|
350
483
|
}
|
|
351
484
|
},
|
|
352
|
-
"description": "Use git hooks to run linting, formatting,
|
|
485
|
+
"description": "Use git hooks to run linting, formatting, and commit linting before changes are committed. Hooks should CHECK by default (not auto-fix), be fast, and scope to changed files only. Use a single entry hook mechanism (e.g., Husky as entry point calling pre-commit or lint-staged).",
|
|
353
486
|
"id": "pre-commit-hooks",
|
|
354
487
|
"label": "Pre-Commit Hooks",
|
|
355
488
|
"stack": {
|
|
356
489
|
"exampleConfigFiles": [
|
|
357
490
|
".husky/",
|
|
358
|
-
"package.json"
|
|
491
|
+
"package.json",
|
|
492
|
+
"lint-staged.config.js"
|
|
359
493
|
],
|
|
360
494
|
"exampleTools": [
|
|
361
495
|
"husky",
|
|
362
496
|
"lint-staged"
|
|
363
497
|
],
|
|
364
|
-
"notes": "
|
|
365
|
-
"verification": "
|
|
498
|
+
"notes": "Use Husky as the entry hook mechanism calling lint-staged. Hooks should CHECK (--check flags) not auto-fix to keep developers aware of issues. Scope to staged files only for speed. Invoke hooks through the repo toolchain (npx) not global installs to ensure environment pinning. Never let hook enforcement drift from CI.",
|
|
499
|
+
"verification": "Run 'npm run verify' (or equivalent) and confirm the same checks run in both hooks and CI."
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"ciHints": {
|
|
504
|
+
"azure-devops": {
|
|
505
|
+
"notes": "CI should call the same verify script that hooks use locally.",
|
|
506
|
+
"stage": "quality"
|
|
507
|
+
},
|
|
508
|
+
"github-actions": {
|
|
509
|
+
"job": "ci",
|
|
510
|
+
"notes": "CI should call the same verify script that hooks use locally."
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
"description": "Local hooks and CI must invoke identical verification commands to prevent 'works locally, fails in CI' issues. Use a single canonical verify entrypoint (e.g., npm run verify) that both hooks and CI call.",
|
|
514
|
+
"id": "hook-ci-parity",
|
|
515
|
+
"label": "Hook/CI Parity",
|
|
516
|
+
"stack": {
|
|
517
|
+
"exampleConfigFiles": [
|
|
518
|
+
"package.json"
|
|
519
|
+
],
|
|
520
|
+
"exampleTools": [
|
|
521
|
+
"npm scripts"
|
|
522
|
+
],
|
|
523
|
+
"notes": "Define a 'verify' script in package.json that runs all checks (lint, format:check, typecheck). Both .husky/pre-commit and CI should call 'npm run verify'. Never add checks to CI that don't run locally.",
|
|
524
|
+
"requiredScripts": [
|
|
525
|
+
"verify"
|
|
526
|
+
],
|
|
527
|
+
"verification": "Compare hook commands with CI commands and confirm they invoke the same scripts."
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"ciHints": {
|
|
532
|
+
"azure-devops": {
|
|
533
|
+
"notes": "Also run secret scanning in CI as a safety net for commits that bypassed hooks.",
|
|
534
|
+
"stage": "quality"
|
|
535
|
+
},
|
|
536
|
+
"github-actions": {
|
|
537
|
+
"job": "ci",
|
|
538
|
+
"notes": "Enable GitHub secret scanning and also run gitleaks in CI."
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
"description": "Scan staged diffs for credentials, API keys, and secrets before they reach the remote repository. Catch secrets at commit time rather than after they're pushed.",
|
|
542
|
+
"id": "secret-scanning-precommit",
|
|
543
|
+
"label": "Pre-commit Secret Scanning",
|
|
544
|
+
"stack": {
|
|
545
|
+
"exampleConfigFiles": [
|
|
546
|
+
".gitleaks.toml",
|
|
547
|
+
".secrets.baseline"
|
|
548
|
+
],
|
|
549
|
+
"exampleTools": [
|
|
550
|
+
"gitleaks",
|
|
551
|
+
"detect-secrets",
|
|
552
|
+
"trufflehog"
|
|
553
|
+
],
|
|
554
|
+
"notes": "Add gitleaks or detect-secrets to pre-commit hooks. Scan only staged changes for speed. Configure allowlists for false positives in .gitleaks.toml.",
|
|
555
|
+
"verification": "Run 'gitleaks protect --staged' and verify it catches test secrets."
|
|
366
556
|
}
|
|
367
557
|
},
|
|
368
558
|
{
|
|
@@ -616,6 +806,88 @@
|
|
|
616
806
|
],
|
|
617
807
|
"verification": "LICENSE file is present in the repository root; CODE_OF_CONDUCT.md and CONTRIBUTING.md are present for contribution guidance."
|
|
618
808
|
}
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"ciHints": {
|
|
812
|
+
"azure-devops": {
|
|
813
|
+
"notes": "CI should call the canonical verify command, not duplicate check logic.",
|
|
814
|
+
"stage": "quality"
|
|
815
|
+
},
|
|
816
|
+
"github-actions": {
|
|
817
|
+
"job": "ci",
|
|
818
|
+
"notes": "CI should call the canonical verify command, not duplicate check logic."
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
"description": "Provide one canonical 'verify' command per repository/stack that all stages call with appropriate flags. This prevents duplication, drift, and ensures consistency between local development and CI.",
|
|
822
|
+
"id": "canonical-verify",
|
|
823
|
+
"label": "Canonical Verify Entrypoint",
|
|
824
|
+
"stack": {
|
|
825
|
+
"exampleConfigFiles": [
|
|
826
|
+
"package.json"
|
|
827
|
+
],
|
|
828
|
+
"exampleTools": [
|
|
829
|
+
"npm scripts"
|
|
830
|
+
],
|
|
831
|
+
"notes": "Define 'npm run verify' that runs lint, format:check, typecheck, and test. Pre-commit hooks call 'npm run verify:quick' (lint + format only). CI calls 'npm run verify' (full suite). Never duplicate verification logic across multiple scripts.",
|
|
832
|
+
"requiredScripts": [
|
|
833
|
+
"verify"
|
|
834
|
+
],
|
|
835
|
+
"verification": "package.json contains a 'verify' script that orchestrates all checks."
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"ciHints": {
|
|
840
|
+
"azure-devops": {
|
|
841
|
+
"notes": "Ensure CI reads from authoritative configs, not duplicated settings.",
|
|
842
|
+
"stage": "quality"
|
|
843
|
+
},
|
|
844
|
+
"github-actions": {
|
|
845
|
+
"job": "ci",
|
|
846
|
+
"notes": "Ensure CI reads from authoritative configs, not duplicated settings."
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
"description": "Each configuration rule must live in exactly one authoritative config file. Avoid duplication across .editorconfig, linter configs, and CI definitions. Document which file is authoritative for each concern.",
|
|
850
|
+
"id": "config-authority",
|
|
851
|
+
"label": "Config File Authority Rules",
|
|
852
|
+
"stack": {
|
|
853
|
+
"exampleConfigFiles": [
|
|
854
|
+
".gitattributes",
|
|
855
|
+
".editorconfig",
|
|
856
|
+
"eslint.config.js",
|
|
857
|
+
"tsconfig.json"
|
|
858
|
+
],
|
|
859
|
+
"exampleTools": [],
|
|
860
|
+
"notes": "Authority mapping: .gitattributes for EOL (Git layer), .editorconfig for editor display, eslint.config.js for lint rules, tsconfig.json for TS compiler options, prettier for formatting. Never duplicate rules across files.",
|
|
861
|
+
"verification": "Review configs and confirm no rule is defined in multiple places with potential for drift."
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"ciHints": {
|
|
866
|
+
"azure-devops": {
|
|
867
|
+
"notes": "CI should read skip paths from config files, not hardcode them in pipeline.",
|
|
868
|
+
"stage": "quality"
|
|
869
|
+
},
|
|
870
|
+
"github-actions": {
|
|
871
|
+
"job": "ci",
|
|
872
|
+
"notes": "CI should read skip paths from config files, not hardcode them in pipeline."
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
"description": "Encode path exclusions and skip rules deterministically in config files, not through ad-hoc human judgment. Make it clear which paths are excluded from checks and why.",
|
|
876
|
+
"id": "explicit-skip-paths",
|
|
877
|
+
"label": "Explicit Skip Paths",
|
|
878
|
+
"stack": {
|
|
879
|
+
"exampleConfigFiles": [
|
|
880
|
+
".eslintignore",
|
|
881
|
+
".prettierignore",
|
|
882
|
+
"eslint.config.js"
|
|
883
|
+
],
|
|
884
|
+
"exampleTools": [
|
|
885
|
+
"eslint",
|
|
886
|
+
"prettier"
|
|
887
|
+
],
|
|
888
|
+
"notes": "Define ignores in eslint.config.js (ignores array) and .prettierignore. Document why each path is excluded (generated code, vendor, etc.). Avoid ad-hoc --ignore-path flags in scripts.",
|
|
889
|
+
"verification": "Review ignore configs and confirm all exclusions are documented and intentional."
|
|
890
|
+
}
|
|
619
891
|
}
|
|
620
892
|
],
|
|
621
893
|
"optionalEnhancements": [
|
|
@@ -857,6 +1129,140 @@
|
|
|
857
1129
|
"verification": "For web-facing apps, run the configured accessibility tooling (for example, axe, pa11y, or Lighthouse accessibility audits) against key pages and confirm that critical issues are resolved."
|
|
858
1130
|
}
|
|
859
1131
|
},
|
|
1132
|
+
{
|
|
1133
|
+
"ciHints": {
|
|
1134
|
+
"azure-devops": {
|
|
1135
|
+
"notes": "Run AI drift detection in a scheduled nightly pipeline separate from main CI.",
|
|
1136
|
+
"stage": "nightly"
|
|
1137
|
+
},
|
|
1138
|
+
"github-actions": {
|
|
1139
|
+
"job": "nightly",
|
|
1140
|
+
"notes": "Use scheduled workflow (cron) to run AI drift detection nightly."
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
"description": "Run nightly or scheduled checks comparing AI-generated outputs against pinned baselines to detect model drift, prompt drift, or code changes affecting AI behavior. Attribute regressions to code changes vs model updates vs prompt changes.",
|
|
1144
|
+
"id": "ai-drift-detection",
|
|
1145
|
+
"label": "AI Drift Detection",
|
|
1146
|
+
"stack": {
|
|
1147
|
+
"exampleConfigFiles": [
|
|
1148
|
+
"__snapshots__/",
|
|
1149
|
+
"ai-baselines/"
|
|
1150
|
+
],
|
|
1151
|
+
"exampleTools": [
|
|
1152
|
+
"jest snapshots",
|
|
1153
|
+
"custom baseline comparator"
|
|
1154
|
+
],
|
|
1155
|
+
"notes": "Pin AI outputs as baseline snapshots. Nightly runs compare current outputs against baselines. When drift detected, investigate: was it a code change, model update, or prompt change? Log model version, prompt hash, and code SHA for attribution.",
|
|
1156
|
+
"verification": "Run AI baseline tests and confirm outputs match pinned baselines or drift is intentional."
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
"ciHints": {
|
|
1161
|
+
"azure-devops": {
|
|
1162
|
+
"notes": "Run schema validation tests as part of quality gates.",
|
|
1163
|
+
"stage": "quality"
|
|
1164
|
+
},
|
|
1165
|
+
"github-actions": {
|
|
1166
|
+
"job": "ci",
|
|
1167
|
+
"notes": "Include AI output schema validation in CI test suite."
|
|
1168
|
+
}
|
|
1169
|
+
},
|
|
1170
|
+
"description": "Validate all AI-generated outputs against strict JSON schemas or type definitions at system boundaries. Reject invalid outputs early rather than letting malformed data propagate through the system.",
|
|
1171
|
+
"id": "ai-schema-enforcement",
|
|
1172
|
+
"label": "AI Output Schema Enforcement",
|
|
1173
|
+
"stack": {
|
|
1174
|
+
"exampleConfigFiles": [
|
|
1175
|
+
"src/schemas/",
|
|
1176
|
+
"*.schema.json"
|
|
1177
|
+
],
|
|
1178
|
+
"exampleTools": [
|
|
1179
|
+
"zod",
|
|
1180
|
+
"ajv",
|
|
1181
|
+
"TypeScript"
|
|
1182
|
+
],
|
|
1183
|
+
"notes": "Define strict schemas for AI outputs using Zod or JSON Schema. Parse and validate AI responses at integration boundaries. Fail fast on schema violations rather than handling partial/invalid data.",
|
|
1184
|
+
"verification": "Review AI integration code and confirm all AI outputs are validated against schemas."
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"ciHints": {
|
|
1189
|
+
"azure-devops": {
|
|
1190
|
+
"notes": "Run AI golden tests as part of the test stage.",
|
|
1191
|
+
"stage": "test"
|
|
1192
|
+
},
|
|
1193
|
+
"github-actions": {
|
|
1194
|
+
"job": "ci",
|
|
1195
|
+
"notes": "Include AI golden contract tests in CI test suite."
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
"description": "Validate AI tool-generated patches, configs, and code against exact expected formats. Test that AI outputs respect forbidden paths, file patterns, and format constraints through golden contract tests.",
|
|
1199
|
+
"id": "ai-golden-tests",
|
|
1200
|
+
"label": "AI Golden Contract Tests",
|
|
1201
|
+
"stack": {
|
|
1202
|
+
"exampleConfigFiles": [
|
|
1203
|
+
"__fixtures__/ai-outputs/",
|
|
1204
|
+
"*.golden.json"
|
|
1205
|
+
],
|
|
1206
|
+
"exampleTools": [
|
|
1207
|
+
"jest",
|
|
1208
|
+
"vitest"
|
|
1209
|
+
],
|
|
1210
|
+
"notes": "Create golden test fixtures for AI-generated patches and configs. Test that outputs match exact formats, don't touch forbidden paths (node_modules, .git), and respect file naming conventions.",
|
|
1211
|
+
"verification": "Run golden tests and confirm AI outputs match expected fixtures exactly."
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"ciHints": {
|
|
1216
|
+
"azure-devops": {
|
|
1217
|
+
"notes": "Run AI safety tests as part of security stage on main branch.",
|
|
1218
|
+
"stage": "security"
|
|
1219
|
+
},
|
|
1220
|
+
"github-actions": {
|
|
1221
|
+
"job": "security",
|
|
1222
|
+
"notes": "Run AI safety checks on main branch merges."
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
"description": "Test AI integrations for prompt injection resistance, input sanitization, output filtering, and data exfiltration prevention. Include adversarial test cases that attempt to manipulate AI behavior.",
|
|
1226
|
+
"id": "ai-safety-checks",
|
|
1227
|
+
"label": "AI Adversarial & Safety Testing",
|
|
1228
|
+
"stack": {
|
|
1229
|
+
"exampleConfigFiles": [
|
|
1230
|
+
"tests/ai-safety/"
|
|
1231
|
+
],
|
|
1232
|
+
"exampleTools": [
|
|
1233
|
+
"jest",
|
|
1234
|
+
"custom adversarial tests"
|
|
1235
|
+
],
|
|
1236
|
+
"notes": "Create adversarial test suite with prompt injection attempts, malicious input patterns, and exfiltration scenarios. Test that AI outputs are sanitized before use in sensitive contexts (SQL, shell, HTML).",
|
|
1237
|
+
"verification": "Run AI safety test suite and confirm all adversarial cases are handled safely."
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
"ciHints": {
|
|
1242
|
+
"azure-devops": {
|
|
1243
|
+
"notes": "Verify AI provenance logging is implemented in quality checks.",
|
|
1244
|
+
"stage": "quality"
|
|
1245
|
+
},
|
|
1246
|
+
"github-actions": {
|
|
1247
|
+
"job": "ci",
|
|
1248
|
+
"notes": "Check AI provenance logging implementation in CI."
|
|
1249
|
+
}
|
|
1250
|
+
},
|
|
1251
|
+
"description": "Log AI provider, model version, prompt template version, parameters, and tool versions for all AI operations. Enable attribution of outputs to specific model+prompt combinations for debugging and compliance.",
|
|
1252
|
+
"id": "ai-provenance-tracking",
|
|
1253
|
+
"label": "AI Provenance & Audit Logging",
|
|
1254
|
+
"stack": {
|
|
1255
|
+
"exampleConfigFiles": [
|
|
1256
|
+
"src/ai/provenance.ts"
|
|
1257
|
+
],
|
|
1258
|
+
"exampleTools": [
|
|
1259
|
+
"OpenTelemetry",
|
|
1260
|
+
"custom logging"
|
|
1261
|
+
],
|
|
1262
|
+
"notes": "Log for each AI call: provider (OpenAI, Anthropic), model ID, prompt template hash/version, temperature, timestamp, request ID. Store provenance alongside outputs for debugging 'why did AI do X?'",
|
|
1263
|
+
"verification": "Review AI integration code and confirm provenance is logged for all AI calls."
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
860
1266
|
{
|
|
861
1267
|
"ciHints": {
|
|
862
1268
|
"azure-devops": {
|
|
@@ -938,27 +1344,41 @@
|
|
|
938
1344
|
},
|
|
939
1345
|
"migrationGuide": [
|
|
940
1346
|
{
|
|
941
|
-
"description": "
|
|
1347
|
+
"description": "Configure .gitattributes for cross-platform line ending correctness and establish the canonical verify entrypoint before adding any checks. This prevents 'works locally, fails in CI' issues from day one.",
|
|
1348
|
+
"focusIds": [
|
|
1349
|
+
"gitattributes-eol",
|
|
1350
|
+
"canonical-verify",
|
|
1351
|
+
"hook-ci-parity",
|
|
1352
|
+
"config-authority"
|
|
1353
|
+
],
|
|
1354
|
+
"notes": "Start here to avoid debugging cryptic CRLF failures later. Use .gitattributes as the authority for EOL (not .editorconfig). Run 'git add --renormalize .' after adding .gitattributes to fix existing files.",
|
|
1355
|
+
"step": 0,
|
|
1356
|
+
"title": "Foundation: Line Endings and Hook Entry Point"
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"description": "Add pre-commit hooks with secret scanning, formatting, and linting. Hooks should CHECK (not auto-fix) and scope to changed files only for speed.",
|
|
942
1360
|
"focusIds": [
|
|
943
1361
|
"pre-commit-hooks",
|
|
1362
|
+
"secret-scanning-precommit",
|
|
944
1363
|
"linting",
|
|
945
1364
|
"code-formatter"
|
|
946
1365
|
],
|
|
947
|
-
"notes": "Keep hooks fast
|
|
1366
|
+
"notes": "Keep hooks fast by scoping to staged files. Use Husky as entry point calling lint-staged or pre-commit. Hooks should check, not fix, to keep developers aware of issues.",
|
|
948
1367
|
"step": 1,
|
|
949
1368
|
"title": "Establish Local Safety Nets First"
|
|
950
1369
|
},
|
|
951
1370
|
{
|
|
952
|
-
"description": "Introduce CI quality gates that mirror local
|
|
1371
|
+
"description": "Introduce CI quality gates that mirror local hooks exactly. Add CRLF detection early in pipeline. Treat existing violations as warnings where possible.",
|
|
953
1372
|
"focusIds": [
|
|
1373
|
+
"crlf-detection",
|
|
954
1374
|
"ci-quality-gates",
|
|
955
1375
|
"linting",
|
|
956
1376
|
"code-formatter",
|
|
957
1377
|
"commit-linting"
|
|
958
1378
|
],
|
|
959
|
-
"notes": "Use diff-based tools
|
|
1379
|
+
"notes": "CI must call the same verify scripts that hooks use. Add CRLF detection before other checks to fail fast on line ending issues. Use diff-based tools so only new violations break builds.",
|
|
960
1380
|
"step": 2,
|
|
961
|
-
"title": "Mirror Local Checks in CI
|
|
1381
|
+
"title": "Mirror Local Checks in CI with CRLF Detection"
|
|
962
1382
|
},
|
|
963
1383
|
{
|
|
964
1384
|
"description": "Enable type-checking, coverage thresholds, and dependency/vulnerability scanning with gradual enforcement.",
|
|
@@ -983,9 +1403,22 @@
|
|
|
983
1403
|
"complexity-analysis",
|
|
984
1404
|
"accessibility-auditing"
|
|
985
1405
|
],
|
|
986
|
-
"notes": "Tackle recommended items in order of business value; backend-only repos can skip web-focused checks like accessibility.
|
|
1406
|
+
"notes": "Tackle recommended items in order of business value; backend-only repos can skip web-focused checks like accessibility.",
|
|
987
1407
|
"step": 4,
|
|
988
1408
|
"title": "Layer in Docs, Governance, and Recommended Checks"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"description": "For repos using or building with generative AI, add drift detection, schema enforcement, golden contract tests, safety testing, and provenance tracking.",
|
|
1412
|
+
"focusIds": [
|
|
1413
|
+
"ai-drift-detection",
|
|
1414
|
+
"ai-schema-enforcement",
|
|
1415
|
+
"ai-golden-tests",
|
|
1416
|
+
"ai-safety-checks",
|
|
1417
|
+
"ai-provenance-tracking"
|
|
1418
|
+
],
|
|
1419
|
+
"notes": "Skip this step if your repo has no AI/ML components. For AI-heavy repos: add nightly drift detection to catch model changes, enforce strict schemas at AI output boundaries, and log provenance for debugging 'why did AI do X?'",
|
|
1420
|
+
"step": 5,
|
|
1421
|
+
"title": "AI/ML Governance (If Applicable)"
|
|
989
1422
|
}
|
|
990
1423
|
],
|
|
991
1424
|
"qualityGatePolicy": {
|
|
@@ -995,5 +1428,5 @@
|
|
|
995
1428
|
},
|
|
996
1429
|
"stack": "typescript-js",
|
|
997
1430
|
"stackLabel": "TypeScript / JavaScript",
|
|
998
|
-
"version":
|
|
1431
|
+
"version": 5
|
|
999
1432
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -41,8 +41,8 @@ var import_node_fs = require("fs");
|
|
|
41
41
|
var import_node_path = require("path");
|
|
42
42
|
|
|
43
43
|
// src/version.ts
|
|
44
|
-
var STANDARDS_VERSION = "
|
|
45
|
-
var STANDARDS_SCHEMA_VERSION =
|
|
44
|
+
var STANDARDS_VERSION = "5.0.0";
|
|
45
|
+
var STANDARDS_SCHEMA_VERSION = 5;
|
|
46
46
|
|
|
47
47
|
// src/index.ts
|
|
48
48
|
var __filename2 = (0, import_node_url.fileURLToPath)(importMetaUrl);
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../node_modules/tsup/assets/cjs_shims.js","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../node_modules/tsup/assets/cjs_shims.js","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '5.0.0';\nexport const STANDARDS_SCHEMA_VERSION = 5;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;;;ADZ9D,sBAA8B;AAC9B,qBAA6B;AAC7B,uBAA8B;;;AEOvB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;;;AFQxC,IAAMA,kBAAa,+BAAc,aAAe;AAChD,IAAM,gBAAY,0BAAQA,WAAU;AAKpC,IAAM,YAAY,UAAU,SAAS,KAAK;AAC1C,IAAM,YAAY,gBACd,uBAAK,WAAW,MAAM,QAAQ,QAC9B,uBAAK,WAAW,QAAQ;AAGrB,SAAS,iBAA6B;AAC3C,QAAM,eAAW,uBAAK,WAAW,gBAAgB;AACjD,SAAO,KAAK,UAAM,6BAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,aACd,OACA,IACoB;AACpB,QAAM,SAAS,KAAK,IAAI,EAAE,KAAK;AAC/B,QAAM,OAAO,aAAa,KAAK,GAAG,MAAM;AACxC,QAAM,eAAW,uBAAK,WAAW,IAAI;AACrC,SAAO,KAAK,UAAM,6BAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,sBAA0C;AACxD,QAAM,OAAO,eAAe;AAC5B,SAAO,OAAO,KAAK,KAAK,MAAM;AAChC;AAGO,SAAS,yBAA8C;AAC5D,QAAM,OAAO,eAAe;AAC5B,SAAO,KAAK;AACd;AAOO,SAAS,aACd,OACA,IACoB;AACpB,SAAO,aAAa,OAAO,EAAE;AAC/B;AAOO,SAAS,YAAwB;AACtC,SAAO,eAAe;AACxB;","names":["__filename"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -156,8 +156,8 @@ interface StackChecklistJson {
|
|
|
156
156
|
* Consumers should import from here instead of package.json to avoid
|
|
157
157
|
* ESM/CJS interop issues.
|
|
158
158
|
*/
|
|
159
|
-
declare const STANDARDS_VERSION = "
|
|
160
|
-
declare const STANDARDS_SCHEMA_VERSION =
|
|
159
|
+
declare const STANDARDS_VERSION = "5.0.0";
|
|
160
|
+
declare const STANDARDS_SCHEMA_VERSION = 5;
|
|
161
161
|
|
|
162
162
|
/** Load the master spec JSON from the packaged dist directory */
|
|
163
163
|
declare function loadMasterSpec(): MasterJson;
|
package/dist/index.d.ts
CHANGED
|
@@ -156,8 +156,8 @@ interface StackChecklistJson {
|
|
|
156
156
|
* Consumers should import from here instead of package.json to avoid
|
|
157
157
|
* ESM/CJS interop issues.
|
|
158
158
|
*/
|
|
159
|
-
declare const STANDARDS_VERSION = "
|
|
160
|
-
declare const STANDARDS_SCHEMA_VERSION =
|
|
159
|
+
declare const STANDARDS_VERSION = "5.0.0";
|
|
160
|
+
declare const STANDARDS_SCHEMA_VERSION = 5;
|
|
161
161
|
|
|
162
162
|
/** Load the master spec JSON from the packaged dist directory */
|
|
163
163
|
declare function loadMasterSpec(): MasterJson;
|
package/dist/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { readFileSync } from "fs";
|
|
|
4
4
|
import { join, dirname } from "path";
|
|
5
5
|
|
|
6
6
|
// src/version.ts
|
|
7
|
-
var STANDARDS_VERSION = "
|
|
8
|
-
var STANDARDS_SCHEMA_VERSION =
|
|
7
|
+
var STANDARDS_VERSION = "5.0.0";
|
|
8
|
+
var STANDARDS_SCHEMA_VERSION = 5;
|
|
9
9
|
|
|
10
10
|
// src/index.ts
|
|
11
11
|
var __filename2 = fileURLToPath(import.meta.url);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/version.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport type {\n MasterJson,\n StackChecklistJson,\n StackId,\n CiSystem,\n} from \"./types.js\";\nimport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION } from \"./version.js\";\n\n// Re-export types for consumers\nexport type { MasterJson, StackChecklistJson, StackId, CiSystem };\n\n// Re-export version info (stable API contract)\nexport { STANDARDS_VERSION, STANDARDS_SCHEMA_VERSION };\n\n// ESM equivalent of __dirname\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Path to config directory:\n// - When running from src/ (dev/test): use repo root config/\n// - When running from dist/ (installed): use dist/config/\nconst isDevMode = __dirname.includes(\"src\");\nconst configDir = isDevMode\n ? join(__dirname, \"..\", \"config\")\n : join(__dirname, \"config\");\n\n/** Load the master spec JSON from the packaged dist directory */\nexport function loadMasterSpec(): MasterJson {\n const filePath = join(configDir, \"standards.json\");\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** Load a stack-specific checklist (optionally filtered by CI system) */\nexport function loadBaseline(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n const suffix = ci ? `.${ci}` : \"\";\n const file = `standards.${stack}${suffix}.json`;\n const filePath = join(configDir, file);\n return JSON.parse(readFileSync(filePath, \"utf8\"));\n}\n\n/** List all supported stacks (derived from the master spec) */\nexport function listSupportedStacks(): readonly StackId[] {\n const spec = loadMasterSpec();\n return Object.keys(spec.stacks) as StackId[];\n}\n\n/** List all supported CI systems (derived from the master spec) */\nexport function listSupportedCiSystems(): readonly CiSystem[] {\n const spec = loadMasterSpec();\n return spec.ciSystems as CiSystem[];\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadBaseline - loads stack-specific standards checklist.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getStandards(\n stack: StackId,\n ci?: CiSystem,\n): StackChecklistJson {\n return loadBaseline(stack, ci);\n}\n\n/**\n * PUBLIC API CONTRACT (semver-governed)\n * Alias for loadMasterSpec - loads the master standards schema.\n * Breaking changes to this function signature require a major version bump.\n */\nexport function getSchema(): MasterJson {\n return loadMasterSpec();\n}\n","/**\n * AUTO-GENERATED at build time by scripts/build.ts\n * DO NOT EDIT MANUALLY\n *\n * This module provides version information for the repo-standards package.\n * Consumers should import from here instead of package.json to avoid\n * ESM/CJS interop issues.\n */\n\nexport const STANDARDS_VERSION = '5.0.0';\nexport const STANDARDS_SCHEMA_VERSION = 5;\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,MAAM,eAAe;;;ACOvB,IAAM,oBAAoB;AAC1B,IAAM,2BAA2B;;;ADQxC,IAAMA,cAAa,cAAc,YAAY,GAAG;AAChD,IAAMC,aAAY,QAAQD,WAAU;AAKpC,IAAM,YAAYC,WAAU,SAAS,KAAK;AAC1C,IAAM,YAAY,YACd,KAAKA,YAAW,MAAM,QAAQ,IAC9B,KAAKA,YAAW,QAAQ;AAGrB,SAAS,iBAA6B;AAC3C,QAAM,WAAW,KAAK,WAAW,gBAAgB;AACjD,SAAO,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,aACd,OACA,IACoB;AACpB,QAAM,SAAS,KAAK,IAAI,EAAE,KAAK;AAC/B,QAAM,OAAO,aAAa,KAAK,GAAG,MAAM;AACxC,QAAM,WAAW,KAAK,WAAW,IAAI;AACrC,SAAO,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;AAClD;AAGO,SAAS,sBAA0C;AACxD,QAAM,OAAO,eAAe;AAC5B,SAAO,OAAO,KAAK,KAAK,MAAM;AAChC;AAGO,SAAS,yBAA8C;AAC5D,QAAM,OAAO,eAAe;AAC5B,SAAO,KAAK;AACd;AAOO,SAAS,aACd,OACA,IACoB;AACpB,SAAO,aAAa,OAAO,EAAE;AAC/B;AAOO,SAAS,YAAwB;AACtC,SAAO,eAAe;AACxB;","names":["__filename","__dirname"]}
|