@standards-kit/conform 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -0
  3. package/dist/{chunk-P7TIZJ4C.js → chunk-DXIYZR62.js} +2 -2
  4. package/dist/chunk-DXIYZR62.js.map +1 -0
  5. package/dist/{chunk-RXA4FO7L.js → chunk-NADY2H35.js} +12 -8
  6. package/dist/chunk-NADY2H35.js.map +1 -0
  7. package/dist/chunk-O745CMWG.js +29 -0
  8. package/dist/chunk-O745CMWG.js.map +1 -0
  9. package/dist/chunk-RHM53NLG.js +49 -0
  10. package/dist/chunk-RHM53NLG.js.map +1 -0
  11. package/dist/{chunk-KHO6NIAI.js → chunk-YGDEM6K5.js} +24 -10
  12. package/dist/chunk-YGDEM6K5.js.map +1 -0
  13. package/dist/cli.d.ts +2 -0
  14. package/dist/cli.js +49 -38
  15. package/dist/cli.js.map +1 -1
  16. package/dist/{cloudwatch-KSZ4A256.js → cloudwatch-3LTDYG6G.js} +6 -10
  17. package/dist/cloudwatch-3LTDYG6G.js.map +1 -0
  18. package/dist/code/index.d.ts +11 -0
  19. package/dist/code/tools/base.d.ts +51 -0
  20. package/dist/code/tools/comment-utils.d.ts +17 -0
  21. package/dist/code/tools/coverage-run.d.ts +37 -0
  22. package/dist/code/tools/disable-comments.d.ts +42 -0
  23. package/dist/code/tools/eslint.d.ts +99 -0
  24. package/dist/code/tools/gitleaks.d.ts +42 -0
  25. package/dist/code/tools/index.d.ts +13 -0
  26. package/dist/code/tools/knip.d.ts +20 -0
  27. package/dist/code/tools/naming.d.ts +64 -0
  28. package/dist/code/tools/pipaudit.d.ts +24 -0
  29. package/dist/code/tools/pnpmaudit.d.ts +36 -0
  30. package/dist/code/tools/ruff.d.ts +46 -0
  31. package/dist/code/tools/tsc.d.ts +57 -0
  32. package/dist/code/tools/ty.d.ts +34 -0
  33. package/dist/code/tools/vulture.d.ts +32 -0
  34. package/dist/constants.d.ts +69 -0
  35. package/dist/core/index.d.ts +7 -0
  36. package/dist/core/loader.d.ts +42 -0
  37. package/dist/core/registry.d.ts +17 -0
  38. package/dist/core/schema.d.ts +1857 -0
  39. package/dist/core/types.d.ts +95 -0
  40. package/dist/{src-KZRTG3EU.js → core-QRFGIQ42.js} +4 -3
  41. package/dist/dependencies/index.d.ts +13 -0
  42. package/dist/dependencies/mappings.d.ts +17 -0
  43. package/dist/dependencies/output.d.ts +12 -0
  44. package/dist/dependencies/types.d.ts +34 -0
  45. package/dist/{dynamodb-5KVESCVJ.js → dynamodb-HQH3IMAI.js} +6 -10
  46. package/dist/dynamodb-HQH3IMAI.js.map +1 -0
  47. package/dist/{ec2-HKPE6GZV.js → ec2-AEPT735A.js} +6 -10
  48. package/dist/ec2-AEPT735A.js.map +1 -0
  49. package/dist/{ecs-OS3NJZTA.js → ecs-UHKCH5A7.js} +6 -10
  50. package/dist/ecs-UHKCH5A7.js.map +1 -0
  51. package/dist/{elasticache-7TCRHYYM.js → elasticache-5Y6K7GKJ.js} +6 -10
  52. package/dist/elasticache-5Y6K7GKJ.js.map +1 -0
  53. package/dist/{elb-PEDLXW5R.js → elb-CN6ELVM5.js} +6 -10
  54. package/dist/elb-CN6ELVM5.js.map +1 -0
  55. package/dist/{iam-7H5HFWVQ.js → iam-YXMHK2MV.js} +6 -2
  56. package/dist/iam-YXMHK2MV.js.map +1 -0
  57. package/dist/index.d.ts +21 -0
  58. package/dist/index.js +99 -121
  59. package/dist/index.js.map +1 -1
  60. package/dist/infra/arn.d.ts +16 -0
  61. package/dist/infra/checkers/client-factory.d.ts +45 -0
  62. package/dist/infra/checkers/cloudwatch.d.ts +8 -0
  63. package/dist/infra/checkers/dynamodb.d.ts +8 -0
  64. package/dist/infra/checkers/ec2.d.ts +13 -0
  65. package/dist/infra/checkers/ecs.d.ts +13 -0
  66. package/dist/infra/checkers/elasticache.d.ts +13 -0
  67. package/dist/infra/checkers/elb.d.ts +13 -0
  68. package/dist/infra/checkers/gcp/artifactregistry.d.ts +5 -0
  69. package/dist/infra/checkers/gcp/cloudrun.d.ts +5 -0
  70. package/dist/infra/checkers/gcp/iam.d.ts +5 -0
  71. package/dist/infra/checkers/gcp/index.d.ts +17 -0
  72. package/dist/infra/checkers/gcp/secretmanager.d.ts +5 -0
  73. package/dist/infra/checkers/iam.d.ts +8 -0
  74. package/dist/infra/checkers/index.d.ts +26 -0
  75. package/dist/infra/checkers/lambda.d.ts +8 -0
  76. package/dist/infra/checkers/rds.d.ts +13 -0
  77. package/dist/infra/checkers/s3.d.ts +8 -0
  78. package/dist/infra/checkers/secretsmanager.d.ts +8 -0
  79. package/dist/infra/checkers/sns.d.ts +8 -0
  80. package/dist/infra/checkers/sqs.d.ts +8 -0
  81. package/dist/infra/checkers/types.d.ts +28 -0
  82. package/dist/infra/gcp.d.ts +18 -0
  83. package/dist/infra/generate.d.ts +74 -0
  84. package/dist/infra/index.d.ts +59 -0
  85. package/dist/infra/manifest.d.ts +58 -0
  86. package/dist/infra/output.d.ts +8 -0
  87. package/dist/infra/scan.d.ts +25 -0
  88. package/dist/infra/schemas.d.ts +806 -0
  89. package/dist/infra/types.d.ts +8 -0
  90. package/dist/{infra-UXM5XQX3.js → infra-TO54IUSC.js} +21 -19
  91. package/dist/infra-TO54IUSC.js.map +1 -0
  92. package/dist/{lambda-NFB5UILT.js → lambda-YTJOCYV5.js} +6 -10
  93. package/dist/lambda-YTJOCYV5.js.map +1 -0
  94. package/dist/mcp/index.d.ts +7 -0
  95. package/dist/mcp/server.d.ts +18 -0
  96. package/dist/mcp/standards/fetcher.d.ts +29 -0
  97. package/dist/mcp/standards/index.d.ts +4 -0
  98. package/dist/mcp/standards/matcher.d.ts +22 -0
  99. package/dist/mcp/standards/parser.d.ts +46 -0
  100. package/dist/mcp/standards/types.d.ts +32 -0
  101. package/dist/mcp/tools/get-guideline.d.ts +26 -0
  102. package/dist/mcp/tools/get-ruleset.d.ts +26 -0
  103. package/dist/mcp/tools/get-standards.d.ts +27 -0
  104. package/dist/mcp/tools/index.d.ts +4 -0
  105. package/dist/mcp/tools/list-guidelines.d.ts +25 -0
  106. package/dist/{mcp-O5O7XVFG.js → mcp-73FZXT3P.js} +5 -4
  107. package/dist/mcp-73FZXT3P.js.map +1 -0
  108. package/dist/output/index.d.ts +14 -0
  109. package/dist/process/commands/check-branch.d.ts +13 -0
  110. package/dist/process/commands/check-commit.d.ts +14 -0
  111. package/dist/process/commands/index.d.ts +2 -0
  112. package/dist/process/index.d.ts +11 -0
  113. package/dist/process/scan/index.d.ts +5 -0
  114. package/dist/process/scan/remote-fetcher.d.ts +18 -0
  115. package/dist/process/scan/scanner.d.ts +6 -0
  116. package/dist/process/scan/types.d.ts +57 -0
  117. package/dist/process/scan/validators.d.ts +37 -0
  118. package/dist/process/sync/applier.d.ts +10 -0
  119. package/dist/process/sync/differ.d.ts +7 -0
  120. package/dist/process/sync/fetcher.d.ts +14 -0
  121. package/dist/process/sync/index.d.ts +9 -0
  122. package/dist/process/sync/types.d.ts +131 -0
  123. package/dist/process/sync/validator.d.ts +22 -0
  124. package/dist/process/tools/backups.d.ts +32 -0
  125. package/dist/process/tools/base.d.ts +52 -0
  126. package/dist/process/tools/branches.d.ts +41 -0
  127. package/dist/process/tools/changesets.d.ts +53 -0
  128. package/dist/process/tools/ci.d.ts +57 -0
  129. package/dist/process/tools/codeowners.d.ts +68 -0
  130. package/dist/process/tools/commits.d.ts +39 -0
  131. package/dist/process/tools/coverage.d.ts +57 -0
  132. package/dist/process/tools/docs-helpers.d.ts +44 -0
  133. package/dist/process/tools/docs.d.ts +38 -0
  134. package/dist/process/tools/forbidden-files.d.ts +40 -0
  135. package/dist/process/tools/hooks.d.ts +39 -0
  136. package/dist/process/tools/index.d.ts +14 -0
  137. package/dist/process/tools/pr.d.ts +59 -0
  138. package/dist/process/tools/repo.d.ts +65 -0
  139. package/dist/process/tools/tickets.d.ts +42 -0
  140. package/dist/projects/detector.d.ts +16 -0
  141. package/dist/projects/index.d.ts +4 -0
  142. package/dist/projects/templates.d.ts +15 -0
  143. package/dist/projects/tier-loader.d.ts +21 -0
  144. package/dist/projects/types.d.ts +76 -0
  145. package/dist/{rds-KLG5O5SI.js → rds-GZ5RVPIU.js} +6 -10
  146. package/dist/rds-GZ5RVPIU.js.map +1 -0
  147. package/dist/{registry-V65CC7IN.js → registry-JRCQAIHR.js} +3 -2
  148. package/dist/{s3-2DH7PRVR.js → s3-53UELUWT.js} +16 -12
  149. package/dist/s3-53UELUWT.js.map +1 -0
  150. package/dist/s3-S4GXNR7H.js +53 -0
  151. package/dist/s3-S4GXNR7H.js.map +1 -0
  152. package/dist/{scan-EELS42BP.js → scan-RHQWHASY.js} +5 -4
  153. package/dist/{scan-EELS42BP.js.map → scan-RHQWHASY.js.map} +1 -1
  154. package/dist/{secretsmanager-MOOIHLAO.js → secretsmanager-FJKTPIXI.js} +6 -10
  155. package/dist/secretsmanager-FJKTPIXI.js.map +1 -0
  156. package/dist/{sns-Y36LVTWA.js → sns-RV64OMK2.js} +6 -10
  157. package/dist/sns-RV64OMK2.js.map +1 -0
  158. package/dist/{sqs-RRS3GRHK.js → sqs-MHBW6UFC.js} +6 -10
  159. package/dist/sqs-MHBW6UFC.js.map +1 -0
  160. package/dist/{standards-RXK5G4IG.js → standards-XAZKTKYJ.js} +3 -2
  161. package/dist/{sync-RLYBGYNY.js → sync-P3UZECLW.js} +4 -3
  162. package/dist/{sync-RLYBGYNY.js.map → sync-P3UZECLW.js.map} +1 -1
  163. package/dist/validate/guidelines.d.ts +18 -0
  164. package/dist/validate/index.d.ts +5 -0
  165. package/dist/validate/tier.d.ts +17 -0
  166. package/dist/validate/types.d.ts +50 -0
  167. package/dist/{validate-AABLVQJS.js → validate-J5E336GX.js} +53 -84
  168. package/dist/validate-J5E336GX.js.map +1 -0
  169. package/package.json +22 -25
  170. package/dist/chunk-KHO6NIAI.js.map +0 -1
  171. package/dist/chunk-P7TIZJ4C.js.map +0 -1
  172. package/dist/chunk-RXA4FO7L.js.map +0 -1
  173. package/dist/cloudwatch-KSZ4A256.js.map +0 -1
  174. package/dist/dynamodb-5KVESCVJ.js.map +0 -1
  175. package/dist/ec2-HKPE6GZV.js.map +0 -1
  176. package/dist/ecs-OS3NJZTA.js.map +0 -1
  177. package/dist/elasticache-7TCRHYYM.js.map +0 -1
  178. package/dist/elb-PEDLXW5R.js.map +0 -1
  179. package/dist/iam-7H5HFWVQ.js.map +0 -1
  180. package/dist/infra-UXM5XQX3.js.map +0 -1
  181. package/dist/lambda-NFB5UILT.js.map +0 -1
  182. package/dist/mcp-O5O7XVFG.js.map +0 -1
  183. package/dist/rds-KLG5O5SI.js.map +0 -1
  184. package/dist/s3-2DH7PRVR.js.map +0 -1
  185. package/dist/secretsmanager-MOOIHLAO.js.map +0 -1
  186. package/dist/sns-Y36LVTWA.js.map +0 -1
  187. package/dist/sqs-RRS3GRHK.js.map +0 -1
  188. package/dist/validate-AABLVQJS.js.map +0 -1
  189. /package/dist/{registry-V65CC7IN.js.map → core-QRFGIQ42.js.map} +0 -0
  190. /package/dist/{src-KZRTG3EU.js.map → registry-JRCQAIHR.js.map} +0 -0
  191. /package/dist/{standards-RXK5G4IG.js.map → standards-XAZKTKYJ.js.map} +0 -0
package/dist/index.js CHANGED
@@ -14,8 +14,9 @@ import {
14
14
  import {
15
15
  CheckResultBuilder,
16
16
  DomainResultBuilder,
17
- ExitCode
18
- } from "./chunk-P7TIZJ4C.js";
17
+ ExitCode,
18
+ ViolationBuilder
19
+ } from "./chunk-DXIYZR62.js";
19
20
  import {
20
21
  ConfigError,
21
22
  DEFAULT_FORBIDDEN_FILES_IGNORE,
@@ -25,7 +26,7 @@ import {
25
26
  getProjectRoot,
26
27
  loadConfig,
27
28
  loadConfigAsync
28
- } from "./chunk-KHO6NIAI.js";
29
+ } from "./chunk-YGDEM6K5.js";
29
30
  import {
30
31
  AccountIdSchema,
31
32
  AccountKeySchema,
@@ -70,6 +71,14 @@ import {
70
71
  validateMultiAccountManifest,
71
72
  validateStackExport
72
73
  } from "./chunk-M7G73Q6P.js";
74
+ import {
75
+ AWS_DEFAULTS,
76
+ CACHE,
77
+ CONCURRENCY,
78
+ GITHUB_API,
79
+ STANDARDS_REPO,
80
+ TIMEOUTS
81
+ } from "./chunk-RHM53NLG.js";
73
82
 
74
83
  // src/code/tools/base.ts
75
84
  import * as fs from "fs";
@@ -401,7 +410,7 @@ var CoverageRunRunner = class extends BaseToolRunner {
401
410
  const result = await execa(testCommand.cmd, testCommand.args, {
402
411
  cwd: projectRoot,
403
412
  reject: false,
404
- timeout: 10 * 60 * 1e3,
413
+ timeout: TIMEOUTS.codeToolExtended,
405
414
  env: { ...process.env, CI: "true" }
406
415
  });
407
416
  return { exitCode: result.exitCode, stderr: result.stderr, stdout: result.stdout };
@@ -902,7 +911,7 @@ var ESLintRunner = class extends BaseToolRunner {
902
911
  const result = await execa2("npx", ["eslint", ...args], {
903
912
  cwd: projectRoot,
904
913
  reject: false,
905
- timeout: 5 * 60 * 1e3
914
+ timeout: TIMEOUTS.codeTool
906
915
  });
907
916
  const violations = this.parseOutput(result.stdout, projectRoot);
908
917
  if (violations === null && result.exitCode !== 0 && result.stderr) {
@@ -986,7 +995,7 @@ var ESLintRunner = class extends BaseToolRunner {
986
995
  const result = await execa2("npx", ["eslint", "--print-config", sampleFile], {
987
996
  cwd: projectRoot,
988
997
  reject: false,
989
- timeout: 30 * 1e3
998
+ timeout: TIMEOUTS.quick
990
999
  });
991
1000
  if (result.exitCode !== 0) {
992
1001
  return { error: `Failed to read ESLint config: ${result.stderr || "Unknown error"}` };
@@ -1310,7 +1319,7 @@ var GitleaksRunner = class extends BaseToolRunner {
1310
1319
  const result = await execa3("gitleaks", args, {
1311
1320
  cwd: projectRoot,
1312
1321
  reject: false,
1313
- timeout: 5 * 60 * 1e3
1322
+ timeout: TIMEOUTS.codeTool
1314
1323
  });
1315
1324
  return this.processResult(result, elapsed);
1316
1325
  } catch (error) {
@@ -1390,7 +1399,7 @@ var GitleaksRunner = class extends BaseToolRunner {
1390
1399
  await execa3("gitleaks", ["version"], {
1391
1400
  cwd: projectRoot,
1392
1401
  reject: true,
1393
- timeout: 10 * 1e3
1402
+ timeout: TIMEOUTS.versionCheck
1394
1403
  });
1395
1404
  return this.pass(Date.now() - startTime);
1396
1405
  } catch (error) {
@@ -1427,7 +1436,7 @@ var KnipRunner = class extends BaseToolRunner {
1427
1436
  const result = await execa4("npx", ["knip", "--reporter", "json"], {
1428
1437
  cwd: projectRoot,
1429
1438
  reject: false,
1430
- timeout: 5 * 60 * 1e3
1439
+ timeout: TIMEOUTS.codeTool
1431
1440
  });
1432
1441
  const output = result.stdout || result.stderr;
1433
1442
  const violations = this.parseOutput(output, projectRoot);
@@ -1889,13 +1898,13 @@ var PipAuditRunner = class extends BaseToolRunner {
1889
1898
  return await execa5("uvx", args, {
1890
1899
  cwd: projectRoot,
1891
1900
  reject: false,
1892
- timeout: 5 * 60 * 1e3
1901
+ timeout: TIMEOUTS.codeTool
1893
1902
  });
1894
1903
  } catch {
1895
1904
  return await execa5("pip-audit", args.slice(1), {
1896
1905
  cwd: projectRoot,
1897
1906
  reject: false,
1898
- timeout: 5 * 60 * 1e3
1907
+ timeout: TIMEOUTS.codeTool
1899
1908
  });
1900
1909
  }
1901
1910
  }
@@ -2012,7 +2021,7 @@ var PnpmAuditRunner = class extends BaseToolRunner {
2012
2021
  const result = await execa6("pnpm", args, {
2013
2022
  cwd: projectRoot,
2014
2023
  reject: false,
2015
- timeout: 5 * 60 * 1e3
2024
+ timeout: TIMEOUTS.codeTool
2016
2025
  });
2017
2026
  return this.processAuditResult(result, elapsed);
2018
2027
  } catch (error) {
@@ -2190,7 +2199,7 @@ var RuffRunner = class extends BaseToolRunner {
2190
2199
  const result = await execa7("ruff", this.buildCliArgs(), {
2191
2200
  cwd: projectRoot,
2192
2201
  reject: false,
2193
- timeout: 5 * 60 * 1e3
2202
+ timeout: TIMEOUTS.codeTool
2194
2203
  });
2195
2204
  if (this.isBinaryNotFound(result)) {
2196
2205
  return this.skipNotInstalled(Date.now() - startTime);
@@ -2356,7 +2365,7 @@ var TscRunner = class extends BaseToolRunner {
2356
2365
  return execa8("npx", ["tsc", "--noEmit"], {
2357
2366
  cwd: projectRoot,
2358
2367
  reject: false,
2359
- timeout: 5 * 60 * 1e3
2368
+ timeout: TIMEOUTS.codeTool
2360
2369
  });
2361
2370
  }
2362
2371
  processRunResult(result, projectRoot, elapsed) {
@@ -2587,7 +2596,7 @@ var TyRunner = class extends BaseToolRunner {
2587
2596
  const result = await execa9("uvx", ["ty", "check", "--output-format", "concise", "."], {
2588
2597
  cwd: projectRoot,
2589
2598
  reject: false,
2590
- timeout: 5 * 60 * 1e3
2599
+ timeout: TIMEOUTS.codeTool
2591
2600
  });
2592
2601
  return this.handleExitCode(result, projectRoot, elapsed);
2593
2602
  } catch (error) {
@@ -2736,7 +2745,7 @@ var VultureRunner = class _VultureRunner extends BaseToolRunner {
2736
2745
  const result = await execa10("vulture", [".", "--exclude", excludePatterns], {
2737
2746
  cwd: projectRoot,
2738
2747
  reject: false,
2739
- timeout: 5 * 60 * 1e3
2748
+ timeout: TIMEOUTS.codeTool
2740
2749
  });
2741
2750
  if (this.isBinaryNotFound(result)) {
2742
2751
  return this.skipNotInstalled(Date.now() - startTime);
@@ -3150,7 +3159,7 @@ var BackupsRunner = class extends BaseProcessToolRunner {
3150
3159
  }
3151
3160
  getS3Client() {
3152
3161
  return this.s3Client ?? new S3Client({
3153
- region: this.config.region ?? process.env.AWS_REGION ?? "us-east-1"
3162
+ region: this.config.region ?? process.env.AWS_REGION ?? AWS_DEFAULTS.globalRegion
3154
3163
  });
3155
3164
  }
3156
3165
  createExistsViolation() {
@@ -5245,7 +5254,7 @@ var PrRunner = class extends BaseProcessToolRunner {
5245
5254
  /** Fetch a single page of PR files from GitHub API */
5246
5255
  async fetchPrFilesPage(repo, prNumber, page, token) {
5247
5256
  const response = await fetch(
5248
- `https://api.github.com/repos/${repo}/pulls/${prNumber}/files?per_page=100&page=${page}`,
5257
+ `${GITHUB_API.baseUrl}/repos/${repo}/pulls/${prNumber}/files?per_page=${GITHUB_API.perPage}&page=${page}`,
5249
5258
  {
5250
5259
  headers: {
5251
5260
  Authorization: `Bearer ${token}`,
@@ -6656,7 +6665,7 @@ async function scanRepository(repo, config) {
6656
6665
  return aggregateResults(repoInfo, [rulesetsResult, filesResult]);
6657
6666
  }
6658
6667
  async function validateProcess(options) {
6659
- const { loadConfigAsync: loadConfigAsync2 } = await import("./src-KZRTG3EU.js");
6668
+ const { loadConfigAsync: loadConfigAsync2 } = await import("./core-QRFGIQ42.js");
6660
6669
  const { config } = await loadConfigAsync2(options.config);
6661
6670
  const result = await scanRepository(options.repo, config);
6662
6671
  const fs22 = await import("fs");
@@ -6692,7 +6701,7 @@ function formatJson(result) {
6692
6701
  }
6693
6702
  function formatText(result) {
6694
6703
  const lines = [];
6695
- lines.push(`check-my-toolkit v${result.version}`);
6704
+ lines.push(`conform v${result.version}`);
6696
6705
  lines.push(`Config: ${result.configPath}`);
6697
6706
  lines.push("");
6698
6707
  for (const [domainName, domain] of Object.entries(result.domains)) {
@@ -6967,9 +6976,7 @@ import * as fs18 from "fs";
6967
6976
  import * as os from "os";
6968
6977
  import * as path17 from "path";
6969
6978
  import { execa as execa19 } from "execa";
6970
- var DEFAULT_OWNER = "palindrom-ai";
6971
- var DEFAULT_REPO = "standards";
6972
- var CACHE_DIR = path17.join(os.tmpdir(), "cm-standards-cache");
6979
+ var CACHE_DIR = path17.join(os.tmpdir(), CACHE.standardsCacheDir);
6973
6980
  function parseGitHubSource(source) {
6974
6981
  const remainder = source.slice(7);
6975
6982
  const atIndex = remainder.indexOf("@");
@@ -7028,7 +7035,7 @@ function buildGitHubUrl(auth, owner, repo) {
7028
7035
  }
7029
7036
  async function updateExistingRepo(repoDir) {
7030
7037
  try {
7031
- await execa19("git", ["pull", "--ff-only"], { cwd: repoDir, timeout: 3e4 });
7038
+ await execa19("git", ["pull", "--ff-only"], { cwd: repoDir, timeout: TIMEOUTS.git });
7032
7039
  return true;
7033
7040
  } catch {
7034
7041
  fs18.rmSync(repoDir, { recursive: true, force: true });
@@ -7046,12 +7053,12 @@ async function cloneRepo(repoDir, owner, repo, ref) {
7046
7053
  }
7047
7054
  args.push(url, repoDir);
7048
7055
  await execa19("git", args, {
7049
- timeout: 3e4
7056
+ timeout: TIMEOUTS.git
7050
7057
  });
7051
7058
  } catch (error) {
7052
7059
  const message = error instanceof Error ? error.message : String(error);
7053
7060
  if (message.includes("timed out")) {
7054
- throw new StandardsError(`Standards repo clone timed out after 30 seconds`);
7061
+ throw new StandardsError(`Standards repo clone timed out after ${TIMEOUTS.git / 1e3} seconds`);
7055
7062
  }
7056
7063
  throw new StandardsError(`Failed to clone standards repo: ${message}`);
7057
7064
  }
@@ -7086,7 +7093,7 @@ async function fetchStandardsRepoFromSource(source, basePath) {
7086
7093
  return fetchGitHubRepo(parsed.owner, parsed.repo, parsed.ref);
7087
7094
  }
7088
7095
  async function fetchStandardsRepo() {
7089
- return fetchGitHubRepo(DEFAULT_OWNER, DEFAULT_REPO);
7096
+ return fetchGitHubRepo(STANDARDS_REPO.owner, STANDARDS_REPO.repo);
7090
7097
  }
7091
7098
  function getGuidelinesDir(repoPath) {
7092
7099
  return path17.join(repoPath, "guidelines");
@@ -7223,63 +7230,16 @@ ${guideline.content}`;
7223
7230
  }
7224
7231
 
7225
7232
  // src/validate/tier.ts
7226
- import { execSync } from "child_process";
7227
7233
  import * as fs21 from "fs";
7228
7234
  import * as path20 from "path";
7229
7235
  import TOML from "@iarna/toml";
7230
7236
  import chalk4 from "chalk";
7231
- import * as yaml3 from "js-yaml";
7232
7237
 
7233
7238
  // src/validate/types.ts
7234
7239
  var VALID_TIERS = ["production", "internal", "prototype"];
7235
7240
 
7236
7241
  // src/validate/tier.ts
7237
7242
  var DEFAULT_TIER = "internal";
7238
- function findGitRoot(startDir) {
7239
- try {
7240
- const gitRoot = execSync("git rev-parse --show-toplevel", {
7241
- cwd: startDir,
7242
- encoding: "utf-8",
7243
- stdio: ["pipe", "pipe", "pipe"]
7244
- }).trim();
7245
- return gitRoot;
7246
- } catch {
7247
- return null;
7248
- }
7249
- }
7250
- function readFileContent2(filePath) {
7251
- if (!fs21.existsSync(filePath)) {
7252
- return null;
7253
- }
7254
- try {
7255
- return fs21.readFileSync(filePath, "utf-8");
7256
- } catch {
7257
- return null;
7258
- }
7259
- }
7260
- function parseYamlContent(content) {
7261
- try {
7262
- const parsed = yaml3.load(content);
7263
- if (parsed === void 0 || parsed === null) {
7264
- return { metadata: null, sourceDetail: "default (file empty)" };
7265
- }
7266
- return { metadata: parsed, sourceDetail: "repo-metadata.yaml" };
7267
- } catch (error) {
7268
- const parseError = error instanceof Error ? error.message : String(error);
7269
- return { metadata: null, sourceDetail: "default (parse error)", parseError };
7270
- }
7271
- }
7272
- function loadRepoMetadata(projectRoot) {
7273
- const metadataPath = path20.join(projectRoot, "repo-metadata.yaml");
7274
- const content = readFileContent2(metadataPath);
7275
- if (content === null) {
7276
- return { metadata: null, sourceDetail: "default (file not found)" };
7277
- }
7278
- if (!content.trim()) {
7279
- return { metadata: null, sourceDetail: "default (file empty)" };
7280
- }
7281
- return parseYamlContent(content);
7282
- }
7283
7243
  function loadExtendsConfig(configPath) {
7284
7244
  try {
7285
7245
  const content = fs21.readFileSync(configPath, "utf-8");
@@ -7289,24 +7249,48 @@ function loadExtendsConfig(configPath) {
7289
7249
  return null;
7290
7250
  }
7291
7251
  }
7292
- function getTier(metadataResult) {
7293
- const { metadata, sourceDetail } = metadataResult;
7294
- if (!metadata) {
7295
- return { tier: DEFAULT_TIER, source: "default", sourceDetail };
7296
- }
7297
- if (metadata.tier === void 0) {
7298
- return { tier: DEFAULT_TIER, source: "default", sourceDetail: "default (tier not specified)" };
7252
+ function loadTierFromStandardsToml(configPath) {
7253
+ if (!fs21.existsSync(configPath)) {
7254
+ return {
7255
+ tier: DEFAULT_TIER,
7256
+ source: "default",
7257
+ sourceDetail: "default (file not found)"
7258
+ };
7299
7259
  }
7300
- const tier = metadata.tier;
7301
- if (!VALID_TIERS.includes(tier)) {
7260
+ try {
7261
+ const content = fs21.readFileSync(configPath, "utf-8");
7262
+ const parsed = TOML.parse(content);
7263
+ if (!parsed.metadata) {
7264
+ return {
7265
+ tier: DEFAULT_TIER,
7266
+ source: "default",
7267
+ sourceDetail: "default (no metadata)"
7268
+ };
7269
+ }
7270
+ if (parsed.metadata.tier === void 0) {
7271
+ return {
7272
+ tier: DEFAULT_TIER,
7273
+ source: "default",
7274
+ sourceDetail: "default (tier not specified)"
7275
+ };
7276
+ }
7277
+ const tier = parsed.metadata.tier;
7278
+ if (!VALID_TIERS.includes(tier)) {
7279
+ return {
7280
+ tier: DEFAULT_TIER,
7281
+ source: "default",
7282
+ sourceDetail: "default (invalid value)",
7283
+ invalidValue: String(tier)
7284
+ };
7285
+ }
7286
+ return { tier, source: "standards.toml", sourceDetail: "standards.toml" };
7287
+ } catch {
7302
7288
  return {
7303
7289
  tier: DEFAULT_TIER,
7304
7290
  source: "default",
7305
- sourceDetail: "default (invalid value)",
7306
- invalidValue: String(tier)
7291
+ sourceDetail: "default (file not found)"
7307
7292
  };
7308
7293
  }
7309
- return { tier, source: "repo-metadata.yaml", sourceDetail: "repo-metadata.yaml" };
7310
7294
  }
7311
7295
  function findMatchingRulesets(rulesets, tier) {
7312
7296
  const suffix = `-${tier}`;
@@ -7324,6 +7308,7 @@ function createNotFoundResult() {
7324
7308
  valid: false,
7325
7309
  tier: DEFAULT_TIER,
7326
7310
  tierSource: "default",
7311
+ tierSourceDetail: "default (file not found)",
7327
7312
  rulesets: [],
7328
7313
  expectedPattern: `*-${DEFAULT_TIER}`,
7329
7314
  matchedRulesets: [],
@@ -7339,20 +7324,16 @@ function buildResult(options) {
7339
7324
  matchedRulesets,
7340
7325
  invalidTierValue,
7341
7326
  hasEmptyRulesets,
7342
- registryUrl,
7343
- parseError
7327
+ registryUrl
7344
7328
  } = options;
7345
7329
  const warnings = options.warnings ?? [];
7346
7330
  const expectedPattern = `*-${tier}`;
7347
7331
  const valid = rulesets.length === 0 || matchedRulesets.length > 0;
7348
7332
  if (invalidTierValue) {
7349
7333
  warnings.push(
7350
- `Invalid tier '${invalidTierValue}' in repo-metadata.yaml. Valid values are: ${VALID_TIERS.join(", ")}`
7334
+ `Invalid tier '${invalidTierValue}' in standards.toml [metadata]. Valid values are: ${VALID_TIERS.join(", ")}`
7351
7335
  );
7352
7336
  }
7353
- if (parseError) {
7354
- warnings.push(`Failed to parse repo-metadata.yaml: ${parseError}`);
7355
- }
7356
7337
  if (hasEmptyRulesets && registryUrl) {
7357
7338
  warnings.push(
7358
7339
  `[extends] is configured with registry '${registryUrl}' but rulesets is empty - no standards will be inherited`
@@ -7378,26 +7359,21 @@ function validateTierRuleset(options = {}) {
7378
7359
  if (!configPath) {
7379
7360
  return createNotFoundResult();
7380
7361
  }
7381
- const configDir = getProjectRoot(configPath);
7382
- const gitRoot = findGitRoot(configDir);
7383
- const metadataSearchPath = gitRoot ?? configDir;
7384
- const metadataResult = loadRepoMetadata(metadataSearchPath);
7385
- const { tier, source, sourceDetail, invalidValue } = getTier(metadataResult);
7362
+ const tierResult = loadTierFromStandardsToml(configPath);
7386
7363
  const extendsConfig = loadExtendsConfig(configPath);
7387
7364
  const rulesets = extendsConfig?.rulesets ?? [];
7388
- const matchedRulesets = rulesets.length > 0 ? findMatchingRulesets(rulesets, tier) : [];
7365
+ const matchedRulesets = rulesets.length > 0 ? findMatchingRulesets(rulesets, tierResult.tier) : [];
7389
7366
  const hasEmptyRulesets = extendsConfig !== null && rulesets.length === 0;
7390
7367
  const registryUrl = extendsConfig?.registry;
7391
7368
  return buildResult({
7392
- tier,
7393
- source,
7394
- sourceDetail,
7369
+ tier: tierResult.tier,
7370
+ source: tierResult.source,
7371
+ sourceDetail: tierResult.sourceDetail,
7395
7372
  rulesets,
7396
7373
  matchedRulesets,
7397
- invalidTierValue: invalidValue,
7374
+ invalidTierValue: tierResult.invalidValue,
7398
7375
  hasEmptyRulesets,
7399
- registryUrl,
7400
- parseError: metadataResult.parseError
7376
+ registryUrl
7401
7377
  });
7402
7378
  }
7403
7379
  function formatWarnings(warnings) {
@@ -7431,7 +7407,7 @@ function formatFailedValidation(result, sourceDisplay) {
7431
7407
  lines.push("");
7432
7408
  lines.push(
7433
7409
  chalk4.cyan(
7434
- ` Hint: Update repo-metadata.yaml to use a valid tier value: ${VALID_TIERS.join(", ")}`
7410
+ ` Hint: Update standards.toml [metadata].tier to use a valid value: ${VALID_TIERS.join(", ")}`
7435
7411
  )
7436
7412
  );
7437
7413
  }
@@ -7662,19 +7638,19 @@ function isSupportedService(service) {
7662
7638
  return SUPPORTED_SERVICES.includes(service);
7663
7639
  }
7664
7640
  var checkerFactories = {
7665
- s3: async () => (await import("./s3-2DH7PRVR.js")).S3Checker,
7666
- lambda: async () => (await import("./lambda-NFB5UILT.js")).LambdaChecker,
7667
- dynamodb: async () => (await import("./dynamodb-5KVESCVJ.js")).DynamoDBChecker,
7668
- sqs: async () => (await import("./sqs-RRS3GRHK.js")).SQSChecker,
7669
- sns: async () => (await import("./sns-Y36LVTWA.js")).SNSChecker,
7670
- iam: async () => (await import("./iam-7H5HFWVQ.js")).IAMChecker,
7671
- secretsmanager: async () => (await import("./secretsmanager-MOOIHLAO.js")).SecretsManagerChecker,
7672
- logs: async () => (await import("./cloudwatch-KSZ4A256.js")).CloudWatchLogsChecker,
7673
- ecs: async () => (await import("./ecs-OS3NJZTA.js")).ECSChecker,
7674
- rds: async () => (await import("./rds-KLG5O5SI.js")).RDSChecker,
7675
- ec2: async () => (await import("./ec2-HKPE6GZV.js")).EC2Checker,
7676
- elasticache: async () => (await import("./elasticache-7TCRHYYM.js")).ElastiCacheChecker,
7677
- elasticloadbalancing: async () => (await import("./elb-PEDLXW5R.js")).ELBChecker
7641
+ s3: async () => (await import("./s3-53UELUWT.js")).S3Checker,
7642
+ lambda: async () => (await import("./lambda-YTJOCYV5.js")).LambdaChecker,
7643
+ dynamodb: async () => (await import("./dynamodb-HQH3IMAI.js")).DynamoDBChecker,
7644
+ sqs: async () => (await import("./sqs-MHBW6UFC.js")).SQSChecker,
7645
+ sns: async () => (await import("./sns-RV64OMK2.js")).SNSChecker,
7646
+ iam: async () => (await import("./iam-YXMHK2MV.js")).IAMChecker,
7647
+ secretsmanager: async () => (await import("./secretsmanager-FJKTPIXI.js")).SecretsManagerChecker,
7648
+ logs: async () => (await import("./cloudwatch-3LTDYG6G.js")).CloudWatchLogsChecker,
7649
+ ecs: async () => (await import("./ecs-UHKCH5A7.js")).ECSChecker,
7650
+ rds: async () => (await import("./rds-GZ5RVPIU.js")).RDSChecker,
7651
+ ec2: async () => (await import("./ec2-AEPT735A.js")).EC2Checker,
7652
+ elasticache: async () => (await import("./elasticache-5Y6K7GKJ.js")).ElastiCacheChecker,
7653
+ elasticloadbalancing: async () => (await import("./elb-CN6ELVM5.js")).ELBChecker
7678
7654
  };
7679
7655
  var checkerCache = /* @__PURE__ */ new Map();
7680
7656
  async function getChecker(service) {
@@ -7718,9 +7694,8 @@ async function getGcpChecker(service) {
7718
7694
  }
7719
7695
 
7720
7696
  // src/infra/scan.ts
7721
- var DEFAULT_CONCURRENCY = 10;
7722
7697
  async function scanManifest(manifest, manifestPath, options = {}) {
7723
- const concurrency = options.concurrency ?? DEFAULT_CONCURRENCY;
7698
+ const concurrency = options.concurrency ?? CONCURRENCY.infraScan;
7724
7699
  if (isMultiAccountManifest(manifest)) {
7725
7700
  return scanMultiAccountManifest(manifest, manifestPath, options);
7726
7701
  }
@@ -7735,7 +7710,7 @@ async function scanManifest(manifest, manifestPath, options = {}) {
7735
7710
  };
7736
7711
  }
7737
7712
  async function scanMultiAccountManifest(manifest, manifestPath, options = {}) {
7738
- const concurrency = options.concurrency ?? DEFAULT_CONCURRENCY;
7713
+ const concurrency = options.concurrency ?? CONCURRENCY.infraScan;
7739
7714
  const accountResults = {};
7740
7715
  const allResults = [];
7741
7716
  const accountsToScan = filterAccounts(manifest, options.account);
@@ -7891,9 +7866,11 @@ export {
7891
7866
  ArnSchema,
7892
7867
  BaseProcessToolRunner,
7893
7868
  BaseToolRunner,
7869
+ CheckResultBuilder,
7894
7870
  CloudProviderSchema,
7895
7871
  ConfigError,
7896
7872
  DEFAULT_MANIFEST_NAME,
7873
+ DomainResultBuilder,
7897
7874
  ESLintRunner,
7898
7875
  ExitCode,
7899
7876
  GcpResourcePathSchema,
@@ -7919,6 +7896,7 @@ export {
7919
7896
  TscRunner,
7920
7897
  TyRunner,
7921
7898
  VALID_TIERS,
7899
+ ViolationBuilder,
7922
7900
  VultureRunner,
7923
7901
  auditCodeConfig,
7924
7902
  auditProcessConfig,