arkgate 4.8.23 → 4.8.25

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 (201) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +7 -5
  3. package/bin/ark-check-runtime.mjs +41 -91
  4. package/bin/ark-dashboard.mjs +56 -53
  5. package/bin/ark-layer-match.mjs +707 -121
  6. package/bin/ark-mcp-runtime.mjs +448 -169
  7. package/bin/ark-mcp.mjs +68 -4
  8. package/bin/ark-shared.mjs +42 -22
  9. package/bin/ark.mjs +65 -97
  10. package/bin/lib/adapter-contract-types.mjs +5 -0
  11. package/bin/lib/adapter-contract.mjs +15 -0
  12. package/bin/lib/adoption-stance.mjs +2 -2
  13. package/bin/lib/adr-path.mjs +3 -3
  14. package/bin/lib/agent-gates.mjs +0 -61
  15. package/bin/lib/agent-homes.mjs +12 -21
  16. package/bin/lib/agent-projection-command.mjs +9 -5
  17. package/bin/lib/ambient-state.mjs +9 -30
  18. package/bin/lib/analysis-engine.mjs +15 -11
  19. package/bin/lib/architecture-scan.mjs +61 -15
  20. package/bin/lib/ark-order-doctor.mjs +4 -29
  21. package/bin/lib/ark-order-facts.mjs +319 -17
  22. package/bin/lib/ark-order-sensors.mjs +28 -101
  23. package/bin/lib/ark-order-types.mjs +3 -2
  24. package/bin/lib/ark-run-doctor.mjs +17 -28
  25. package/bin/lib/ark-run-facts.mjs +461 -48
  26. package/bin/lib/ark-run-sensors.mjs +6 -4
  27. package/bin/lib/arkgate-pins.mjs +91 -0
  28. package/bin/lib/arkrule-file-hints.mjs +2 -47
  29. package/bin/lib/arkrules-contract.mjs +124 -133
  30. package/bin/lib/arkrules-sensors.mjs +55 -252
  31. package/bin/lib/check-args.mjs +85 -1
  32. package/bin/lib/ci-and-commands.mjs +24 -78
  33. package/bin/lib/ci-merge-boundary.mjs +1 -1
  34. package/bin/lib/class-source-scan.mjs +479 -0
  35. package/bin/lib/clone-detection.mjs +474 -0
  36. package/bin/lib/codex-home.mjs +5 -3
  37. package/bin/lib/config-contract-slices.mjs +739 -0
  38. package/bin/lib/config-contract.mjs +42 -607
  39. package/bin/lib/config-extras.mjs +16 -22
  40. package/bin/lib/config-warnings.mjs +32 -0
  41. package/bin/lib/contract-smells.mjs +33 -15
  42. package/bin/lib/core-ratchet.mjs +0 -2
  43. package/bin/lib/dashboard-cli.mjs +62 -0
  44. package/bin/lib/deep-module-coach.mjs +2 -4
  45. package/bin/lib/deploy-path.mjs +13 -38
  46. package/bin/lib/design-delta.mjs +1 -1
  47. package/bin/lib/design-smells.mjs +2 -2
  48. package/bin/lib/diagnostic-catalog.mjs +23 -9
  49. package/bin/lib/doctor-advisories.mjs +78 -8
  50. package/bin/lib/doctor-green-cite.mjs +1 -1
  51. package/bin/lib/doctor-human.mjs +1 -1
  52. package/bin/lib/doctor-next-actions.mjs +19 -4
  53. package/bin/lib/doctor-plan.mjs +9 -13
  54. package/bin/lib/duplication-io.mjs +572 -0
  55. package/bin/lib/effective-contract-load.mjs +282 -83
  56. package/bin/lib/enforcement-profiles.mjs +40 -4
  57. package/bin/lib/entry-points-io.mjs +424 -0
  58. package/bin/lib/extra-merge-teeth.mjs +36 -0
  59. package/bin/lib/field-install.mjs +38 -14
  60. package/bin/lib/first-run-help.mjs +10 -5
  61. package/bin/lib/flat-parent-importers.mjs +139 -0
  62. package/bin/lib/flat-parent-pilot.mjs +40 -100
  63. package/bin/lib/gate-files.mjs +58 -90
  64. package/bin/lib/git-change-scope.mjs +109 -0
  65. package/bin/lib/github-enforcement.mjs +166 -29
  66. package/bin/lib/golden-pattern.mjs +1 -1
  67. package/bin/lib/hook-templates.mjs +17 -15
  68. package/bin/lib/host-support-matrix.mjs +3 -1
  69. package/bin/lib/html-report-advisories.mjs +4 -0
  70. package/bin/lib/html-report-depth.mjs +2 -2
  71. package/bin/lib/html-report.mjs +2 -2
  72. package/bin/lib/import-graph-projection.mjs +112 -0
  73. package/bin/lib/import-resolve.mjs +13 -1
  74. package/bin/lib/improvement-compass-doctor.mjs +1 -24
  75. package/bin/lib/install-migrate.mjs +50 -73
  76. package/bin/lib/invariant-coverage-io.mjs +4 -3
  77. package/bin/lib/invariant-coverage.mjs +85 -11
  78. package/bin/lib/invariant-probe-cli.mjs +347 -0
  79. package/bin/lib/invariant-probe-io.mjs +165 -0
  80. package/bin/lib/invariant-probe-runner.mjs +268 -0
  81. package/bin/lib/invariant-probe-sites.mjs +174 -0
  82. package/bin/lib/invariant-probe-workspace.mjs +183 -0
  83. package/bin/lib/invariant-probe.mjs +461 -0
  84. package/bin/lib/invariant-tests-path.mjs +16 -22
  85. package/bin/lib/literal-path-drift.mjs +4 -2
  86. package/bin/lib/managed-upgrade.mjs +2 -8
  87. package/bin/lib/mcp-adoption.mjs +13 -6
  88. package/bin/lib/mcp-hook-payload.mjs +403 -63
  89. package/bin/lib/orphan-modules-io.mjs +458 -0
  90. package/bin/lib/orphan-modules.mjs +251 -0
  91. package/bin/lib/outside-importers.mjs +197 -0
  92. package/bin/lib/package-manager.mjs +60 -2
  93. package/bin/lib/parse-health.mjs +1 -1
  94. package/bin/lib/passthrough-commands.mjs +83 -0
  95. package/bin/lib/persistence-write-hint.mjs +106 -0
  96. package/bin/lib/pin-dependent-gates.mjs +117 -0
  97. package/bin/lib/policy-delta-io.mjs +219 -14
  98. package/bin/lib/post-green-path.mjs +1 -1
  99. package/bin/lib/prepare-change.mjs +115 -7
  100. package/bin/lib/prepare-write.mjs +2 -2
  101. package/bin/lib/presets.mjs +59 -73
  102. package/bin/lib/product-copy.mjs +1 -6
  103. package/bin/lib/project-root.mjs +31 -62
  104. package/bin/lib/remediation.mjs +23 -4
  105. package/bin/lib/resolved-candidate-facts.mjs +405 -117
  106. package/bin/lib/rules-inventory.mjs +22 -3
  107. package/bin/lib/rules-under-contract.mjs +247 -9
  108. package/bin/lib/scan-files.mjs +36 -4
  109. package/bin/lib/schema-validation.mjs +130 -0
  110. package/bin/lib/sensor-promote-cli.mjs +2 -11
  111. package/bin/lib/sensor-promote-io.mjs +33 -22
  112. package/bin/lib/sensor-promotion.mjs +1 -1
  113. package/bin/lib/skill-catalog-apply.mjs +1 -1
  114. package/bin/lib/skill-install.mjs +42 -38
  115. package/bin/lib/snippet-analysis.mjs +140 -6
  116. package/bin/lib/source-policy.mjs +34 -0
  117. package/bin/lib/start-install-recovery.mjs +72 -2
  118. package/bin/lib/start-preview.mjs +31 -1
  119. package/bin/lib/states-transitions-presence.mjs +3 -3
  120. package/bin/lib/status-command.mjs +35 -22
  121. package/bin/lib/status-manifest.mjs +50 -30
  122. package/bin/lib/status-transition-catalog.mjs +0 -6
  123. package/bin/lib/suggestions.mjs +3 -3
  124. package/bin/lib/team-parliament-io.mjs +76 -88
  125. package/bin/lib/team-parliament.mjs +21 -10
  126. package/bin/lib/upgrade-behavior-changes.mjs +2 -2
  127. package/bin/lib/upgrade-command.mjs +2 -24
  128. package/bin/lib/upgrade-outcome.mjs +1 -1
  129. package/bin/lib/upstream-report.mjs +21 -10
  130. package/bin/lib/violations.mjs +10 -9
  131. package/bin/lib/weakest-link.mjs +13 -0
  132. package/bin/lib/write-path-capabilities.mjs +6 -4
  133. package/dist/chunk-A5EIY3HI.cjs +5 -0
  134. package/dist/chunk-AHACEKSV.js +16 -0
  135. package/dist/chunk-SVSQVGFJ.js +5 -0
  136. package/dist/chunk-UN5EH4QV.cjs +16 -0
  137. package/dist/{configTypes-Bbf_MFGe.d.ts → configTypes-GPvvdleM.d.cts} +30 -4
  138. package/dist/configTypes-GPvvdleM.d.ts +257 -0
  139. package/dist/eslint/index.cjs +18 -5
  140. package/dist/eslint/index.d.cts +368 -0
  141. package/dist/eslint/index.d.ts +139 -156
  142. package/dist/eslint/index.js +11 -5
  143. package/dist/index.cjs +36 -35
  144. package/dist/index.d.cts +5547 -0
  145. package/dist/index.d.ts +3283 -198
  146. package/dist/index.js +36 -35
  147. package/dist/inspectorListen-6DQVJ4DC.js +1 -0
  148. package/dist/inspectorListen-KGMIQ2TF.cjs +1 -0
  149. package/dist/nestjs/index.cjs +1 -18
  150. package/dist/nestjs/index.d.cts +22 -0
  151. package/dist/nestjs/index.d.ts +1 -3
  152. package/dist/nestjs/index.js +1 -18
  153. package/dist/order/index.cjs +1 -1
  154. package/dist/order/index.d.cts +155 -0
  155. package/dist/order/index.d.ts +15 -3
  156. package/dist/order/index.js +1 -1
  157. package/dist/runtime/index.cjs +13 -30
  158. package/dist/{diagnosticCatalog-35mrwAHe.d.ts → runtime/index.d.cts} +828 -276
  159. package/dist/runtime/index.d.ts +2741 -133
  160. package/dist/runtime/index.js +13 -30
  161. package/dist/{types-Bdj32QwA.d.ts → types-CnauMQQL.d.cts} +607 -163
  162. package/dist/types-CnauMQQL.d.ts +1800 -0
  163. package/docs/README.md +3 -1
  164. package/docs/agent-guide.md +217 -16
  165. package/docs/ai-gates.md +174 -26
  166. package/docs/arkorder.md +32 -15
  167. package/docs/brownfield-adoption.md +5 -1
  168. package/docs/configuration.md +230 -31
  169. package/docs/develop.md +2 -1
  170. package/docs/diagnostics.md +212 -19
  171. package/docs/package-surface.md +35 -9
  172. package/docs/product-voice.md +7 -1
  173. package/package.json +69 -19
  174. package/schemas/ark.analysis-result.schema.json +15 -0
  175. package/schemas/ark.config.schema.json +77 -12
  176. package/schemas/ark.invariant-probe.schema.json +368 -0
  177. package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
  178. package/schemas/ark.status-manifest.schema.json +22 -0
  179. package/server.json +3 -9
  180. package/templates/agent-skills/README.md +1 -1
  181. package/templates/agent-skills/ark-adopt/SKILL.md +5 -1
  182. package/templates/agent-skills/ark-contract/SKILL.md +17 -0
  183. package/templates/agent-skills/ark-coverage/SKILL.md +2 -0
  184. package/templates/agent-skills/ark-explore/SKILL.md +7 -0
  185. package/templates/agent-skills/ark-fix/SKILL.md +20 -0
  186. package/templates/agent-skills/ark-order/SKILL.md +4 -2
  187. package/templates/agent-skills/ark-place/SKILL.md +8 -0
  188. package/templates/agent-skills/ark-runtime/SKILL.md +6 -1
  189. package/templates/arkrules/PersistenceAdapters.json +1 -1
  190. package/templates/arkrules/PresentationAdapters.json +1 -1
  191. package/templates/skills/ark-adopt.md +5 -1
  192. package/templates/skills/ark-contract.md +17 -0
  193. package/templates/skills/ark-coverage.md +2 -0
  194. package/templates/skills/ark-explore.md +7 -0
  195. package/templates/skills/ark-fix.md +20 -0
  196. package/templates/skills/ark-order.md +4 -2
  197. package/templates/skills/ark-place.md +8 -0
  198. package/templates/skills/ark-runtime.md +6 -1
  199. package/bin/lib/ark-order-error.mjs +0 -18
  200. package/bin/lib/ark-order-invariants.mjs +0 -346
  201. package/dist/types-Ik_OakcI.d.ts +0 -183
@@ -1,32 +1,4 @@
1
- import { A as ArkConfig } from '../configTypes-Bbf_MFGe.js';
2
-
3
- type RuleContext$1 = {
4
- report(descriptor: Record<string, unknown>): void;
5
- filename?: string;
6
- physicalFilename?: string;
7
- getFilename?: () => string;
8
- options?: unknown[];
9
- };
10
- type AstNode$1 = {
11
- type?: string;
12
- name?: string;
13
- value?: unknown;
14
- source?: AstNode$1;
15
- callee?: AstNode$1;
16
- object?: AstNode$1;
17
- property?: AstNode$1;
18
- arguments?: AstNode$1[];
19
- importKind?: string;
20
- exportKind?: string;
21
- specifiers?: AstNode$1[];
22
- loc?: {
23
- start?: {
24
- line?: number;
25
- column?: number;
26
- };
27
- };
28
- computed?: boolean;
29
- };
1
+ import { A as ArkConfig } from '../configTypes-GPvvdleM.js';
30
2
 
31
3
  /**
32
4
  * Pure layer-glob matching for ark.config.json.
@@ -48,7 +20,8 @@ type LayerConfig = {
48
20
  * - `path` (default, also the absent value): every literal and every star
49
21
  * binding. `lib/features` plus two stars → `lib/features/projects/rfi`.
50
22
  * Byte-identical to the ids baselines and `allowedCrossSlice` already use.
51
- * - `stars`: last literal segment plus the star bindings.
23
+ * - `stars`: last literal segment plus every star binding (a star before the
24
+ * last literal is kept too: `modules` / `*` / `api` / `*` → `orders/api/v1`).
52
25
  * `lib/features` plus two stars, and `lib/repositories/features` plus two
53
26
  * stars, both → `features/projects/rfi`.
54
27
  * Prefix stripping stays inside `bindAnchoredSlice`. Bare names are unchanged.
@@ -83,15 +56,16 @@ type EdgeRule = {
83
56
  * also when the key is absent) the slice id includes the literal prefix
84
57
  * plus the directories the stars bind (`lib/features/projects/rfi`), so
85
58
  * parallel trees get different ids. With `"stars"` it is the last literal
86
- * plus the star bindings, so the same feature has one id across parallel
59
+ * plus every star binding, so the same feature has one id across parallel
87
60
  * trees.
88
61
  * When omitted, inferred from the layer's glob patterns (segment before a wildcard).
89
62
  */
90
63
  sliceFolders?: string[];
91
64
  /**
92
65
  * How a starred `sliceFolders` prefix is named. Absent and `"path"` keep
93
- * today's ids. `"stars"` is the last literal plus the star bindings, so the
94
- * same feature has one id across parallel trees.
66
+ * today's ids. `"stars"` is the last literal plus every star binding, in
67
+ * path order (`modules` / `*` / `api` / `*` binds `orders/api/v1`), so the same feature
68
+ * has one id across parallel trees.
95
69
  */
96
70
  sliceIdentity?: SliceIdentity;
97
71
  /**
@@ -125,9 +99,12 @@ type EdgeRule = {
125
99
  * `"deny"`: a shared root may not import a slice. `"deny-cross-parent"` leaves
126
100
  * that hop allowed; a whole-graph pass then reports a slice that reaches
127
101
  * another universe only through shared. Absent keeps the hop allowed.
128
- * `allowedCrossSlice` does not excuse `"deny"`.
102
+ * `allowedCrossSlice` does not excuse `"deny"`. The object form
103
+ * `{ mode: "deny-cross-parent", stopAt }` names composition roots the walk
104
+ * never starts at or passes through. Read it through
105
+ * {@link sharedImportsSliceMode} / {@link sharedImportsSliceStopAt}.
129
106
  */
130
- sharedImportsSlice?: 'deny' | 'deny-cross-parent';
107
+ sharedImportsSlice?: SharedImportsSliceSetting;
131
108
  /**
132
109
  * Optional inner wall under this rule's universe wall. Absent: the universe
133
110
  * wall is the whole decision and check output stays byte-identical.
@@ -152,6 +129,10 @@ type SliceAlias = {
152
129
  from: string;
153
130
  /** Child slice id: the universe id plus one child segment. */
154
131
  to: string;
132
+ /** True: this path stays. It is listed, and it is not an owed move. */
133
+ pinned?: boolean;
134
+ /** Doctor label. A label alone does not pin. */
135
+ reason?: string;
155
136
  };
156
137
  type ChildSlices = {
157
138
  sliceFolders: string[];
@@ -159,10 +140,17 @@ type ChildSlices = {
159
140
  commonFolders?: string[];
160
141
  siblings?: ChildSliceSiblings;
161
142
  parentMayImportChild?: boolean;
143
+ /** Text for inner-wall findings (sibling, common → child). Absent: ArkGate default, never the rule message. */
144
+ message?: string;
162
145
  /** Directed child allowances. `*` matches one whole segment. Never a universe excuse. */
163
146
  allowedCrossSlice?: CrossSliceEdge[];
164
147
  /** Unclassified files governed as this child. Debt, not a destination. */
165
148
  sliceAliases?: SliceAlias[];
149
+ /**
150
+ * Filename read at each child root this wall already resolved.
151
+ * `<Layer>` is the only token (`arkrules.<Layer>.json`).
152
+ */
153
+ arkRulesFile?: string;
166
154
  };
167
155
  /** How the child wall treats a sibling crossing. Absent means `deny`. */
168
156
  type ChildSliceSiblingsMode = 'deny' | 'advisory';
@@ -173,8 +161,21 @@ type ChildSliceSiblingsMode = 'deny' | 'advisory';
173
161
  type ChildSliceSiblingsEnforce = {
174
162
  default: ChildSliceSiblingsMode;
175
163
  enforce?: string[];
164
+ /**
165
+ * Anti-growth for advisory crossings against a baseline. Absent: on only when
166
+ * the baseline already records an advisory crossing of this rule. `true`:
167
+ * always when a baseline is in use. `false`: measure only.
168
+ */
169
+ ratchet?: boolean;
176
170
  };
177
171
  type ChildSliceSiblings = ChildSliceSiblingsMode | ChildSliceSiblingsEnforce;
172
+ /** `sharedImportsSlice` string modes. */
173
+ type SharedImportsSliceMode = 'deny' | 'deny-cross-parent';
174
+ /** String mode, or the object form that carries composition-root stops. */
175
+ type SharedImportsSliceSetting = SharedImportsSliceMode | {
176
+ mode: 'deny-cross-parent';
177
+ stopAt: string[];
178
+ };
178
179
  /** A directed slice-to-slice edge the repo declares on purpose (peerIsolation). */
179
180
  type CrossSliceEdge = {
180
181
  /** Importing slice id (`features/checkout`) or bare slice name (`checkout`). */
@@ -204,37 +205,11 @@ declare function patternSpecificity(pattern: string, relPath?: string): number;
204
205
  declare function layerForRelativePath(relPath: string, layers: LayerConfig[] | undefined): string | undefined;
205
206
  declare function isEdgeDenied(rules: EdgeRule[] | undefined, from: string, to: string, options?: EdgeCheckOptions): boolean;
206
207
 
207
- type RuleContext = {
208
- report(descriptor: Record<string, unknown>): void;
209
- /** ESLint 9+ / 10: preferred path on the context object. */
210
- filename?: string;
211
- /** ESLint 8-style physical path when linting with processors / virtual files. */
212
- physicalFilename?: string;
213
- /** ESLint ≤8 API — still present on some hosts; removed in ESLint 10. */
214
- getFilename?: () => string;
215
- /** ESLint 9+ source/scope API. */
216
- sourceCode?: SourceCode;
217
- /** ESLint ≤8 source/scope API. */
218
- getSourceCode?: () => SourceCode;
219
- options?: unknown[];
220
- };
221
- type ScopeVariable = {
222
- defs?: unknown[];
223
- };
224
- type ScopeReference = {
225
- identifier?: AstNode;
226
- resolved?: ScopeVariable | null;
227
- isValueReference?: boolean;
228
- };
229
- type Scope = {
230
- set?: Map<string, ScopeVariable>;
231
- references?: ScopeReference[];
232
- upper?: Scope | null;
233
- };
234
- type SourceCode = {
235
- getScope?: (node: AstNode) => Scope;
236
- };
237
- type RuleListener = Record<string, (node: AstNode) => void>;
208
+ /**
209
+ * Shared ESLint adapter plumbing: context shapes, filename / source helpers, and the
210
+ * adapter-diagnostic report path. Channel routing lives in reportChannels.ts.
211
+ */
212
+
238
213
  type AstNode = {
239
214
  type?: string;
240
215
  name?: string;
@@ -253,14 +228,62 @@ type AstNode = {
253
228
  specifiers?: AstNode[];
254
229
  parent?: AstNode;
255
230
  init?: AstNode;
231
+ id?: AstNode;
232
+ left?: AstNode;
233
+ argument?: AstNode;
234
+ expression?: AstNode;
235
+ quasis?: Array<{
236
+ value?: {
237
+ cooked?: string | null;
238
+ };
239
+ }>;
240
+ expressions?: unknown[];
256
241
  computed?: boolean;
242
+ optional?: boolean;
257
243
  loc?: {
258
244
  start?: {
259
245
  line?: number;
260
246
  column?: number;
261
247
  };
248
+ end?: {
249
+ line?: number;
250
+ column?: number;
251
+ };
262
252
  };
263
253
  };
254
+ type ScopeVariable = {
255
+ defs?: unknown[];
256
+ };
257
+ type ScopeReference = {
258
+ identifier?: AstNode;
259
+ resolved?: ScopeVariable | null;
260
+ isValueReference?: boolean;
261
+ };
262
+ type Scope = {
263
+ set?: Map<string, ScopeVariable>;
264
+ references?: ScopeReference[];
265
+ upper?: Scope | null;
266
+ };
267
+ type SourceCode = {
268
+ getScope?: (node: AstNode) => Scope;
269
+ getText?: () => string;
270
+ text?: string;
271
+ };
272
+ type RuleContext = {
273
+ report(descriptor: Record<string, unknown>): void;
274
+ /** ESLint 9+ / 10: preferred path on the context object. */
275
+ filename?: string;
276
+ /** ESLint 8-style physical path when linting with processors / virtual files. */
277
+ physicalFilename?: string;
278
+ /** ESLint ≤8 API — still present on some hosts; removed in ESLint 10. */
279
+ getFilename?: () => string;
280
+ /** ESLint 9+ source/scope API. */
281
+ sourceCode?: SourceCode;
282
+ /** ESLint ≤8 source/scope API. */
283
+ getSourceCode?: () => SourceCode;
284
+ options?: unknown[];
285
+ };
286
+ type RuleListener = Record<string, (node: AstNode) => void>;
264
287
  type ArkRule = {
265
288
  meta: {
266
289
  type: 'problem';
@@ -272,112 +295,72 @@ type ArkRule = {
272
295
  };
273
296
  create(context: RuleContext): RuleListener;
274
297
  };
275
- type ArkEslintPlugin = {
276
- rules: Record<string, ArkRule>;
277
- configs?: Record<string, unknown>;
278
- };
298
+
299
+ /** Nearest `ark.config.json` at or above the linted file (memoized per directory). */
279
300
  declare function findConfigPath(startFile: string): string | null;
301
+ /**
302
+ * Parse the root config (public helper; throws ArkConfigValidationError on invalid config).
303
+ * Rules use `loadArkContract`, which never throws.
304
+ */
280
305
  declare function loadArkConfig(configPath: string): ArkConfig | null;
281
306
  /**
282
- * Read tsconfig paths/baseUrl for ESLint alias parity (P0-C).
283
- * JSONC-tolerant strip of // and /* comments; supports simple extends of a relative JSON.
284
- * Does not claim full TypeScript resolution (project refs, complex multi-target, wildcards beyond trailing *).
307
+ * Fingerprint of the Ark contract that applies under `startDir` (default: cwd). ESLint
308
+ * hashes `settings`, so a recommended config carrying this value invalidates `--cache`
309
+ * results when ark.config.json or a referenced ArkRules file changes.
285
310
  */
286
- declare function readTsconfigPathAliases(startDir: string): {
311
+ declare function contractFingerprint(startDir?: string): string | null;
312
+
313
+ type TsconfigAlias = {
314
+ /** Pattern text before `*` (whole pattern when it has no `*`). */
315
+ from: string;
316
+ /** First target with the trailing `*` removed (legacy shape). */
317
+ to: string;
318
+ /** Text after `*` in the pattern ('' for trailing-star patterns). */
319
+ suffix: string;
320
+ wildcard: boolean;
321
+ /** All substitution targets, in declaration order. */
322
+ targets: string[];
323
+ };
324
+ type TsconfigAliasSet = {
287
325
  baseUrl: string;
288
- aliases: Array<{
289
- from: string;
290
- to: string;
291
- }>;
326
+ aliases: TsconfigAlias[];
292
327
  };
328
+ /**
329
+ * Read tsconfig paths/baseUrl for ESLint alias parity (P0-C) from the nearest tsconfig.json
330
+ * at or above `startDir`.
331
+ */
332
+ declare function readTsconfigPathAliases(startDir: string): TsconfigAliasSet;
293
333
  /** Resolve relative import specifier to an absolute path candidate (TS-oriented). */
294
334
  declare function resolveRelativeImport(fromFile: string, specifier: string): string | null;
295
335
  /**
296
336
  * Resolve relative or tsconfig path-alias import to an on-disk file.
297
- * Bare packages (no matching alias) return null — CI/TS remain source of truth there.
337
+ * The tsconfig is the one nearest to `fromFile` (same as the CLI). `projectRoot` is only a
338
+ * fallback start directory when `fromFile` is empty. Bare packages return null.
298
339
  */
299
340
  declare function resolveImportSpecifier(fromFile: string, specifier: string, projectRoot?: string | null): string | null;
300
- /**
301
- * Config-driven layer import boundary (primary editor gate).
302
- * Replaces path-token domain/infra heuristics when ark.config.json is present.
303
- * Rule id kept as `no-domain-infra-imports` for recommended-config / upgrade stability.
304
- */
341
+
342
+ type ArkEslintPlugin = {
343
+ meta: {
344
+ name: string;
345
+ version: string;
346
+ };
347
+ rules: Record<string, ArkRule>;
348
+ configs?: Record<string, unknown>;
349
+ };
305
350
  declare const noDomainInfraImports: ArkRule;
306
351
  declare const noRawEventPublish: ArkRule;
307
352
  declare const requirePublishSource: ArkRule;
308
353
  declare const noForbiddenGlobals: ArkRule;
309
354
  declare const noDeniedCapabilities: ArkRule;
310
- declare const noArkRunKernelInDomain: {
311
- meta: {
312
- type: "problem";
313
- docs: {
314
- description: string;
315
- };
316
- messages: Record<string, string>;
317
- schema: unknown[];
318
- };
319
- create(context: RuleContext$1): {
320
- [x: string]: (node: AstNode$1) => void;
321
- };
322
- };
323
- declare const noArkRunDirectNew: {
324
- meta: {
325
- type: "problem";
326
- docs: {
327
- description: string;
328
- };
329
- messages: Record<string, string>;
330
- schema: unknown[];
331
- };
332
- create(context: RuleContext$1): {
333
- [x: string]: (node: AstNode$1) => void;
334
- };
335
- };
336
- declare const noArkRunTransportBypass: {
337
- meta: {
338
- type: "problem";
339
- docs: {
340
- description: string;
341
- };
342
- messages: Record<string, string>;
343
- schema: unknown[];
344
- };
345
- create(context: RuleContext$1): {
346
- [x: string]: (node: AstNode$1) => void;
347
- };
348
- };
349
-
350
- declare const noArkOrderKernelInDomain: {
351
- meta: {
352
- type: "problem";
353
- docs: {
354
- description: "ARKORDER_KERNEL_IN_DOMAIN" | "ARKORDER_GENERIC_UPDATE";
355
- };
356
- messages: {
357
- denied: string;
358
- };
359
- schema: never[];
360
- };
361
- create(context: RuleContext$1): {
362
- [x: string]: (node: AstNode$1) => void;
363
- };
364
- };
365
- declare const noArkOrderGenericUpdate: {
366
- meta: {
367
- type: "problem";
368
- docs: {
369
- description: "ARKORDER_KERNEL_IN_DOMAIN" | "ARKORDER_GENERIC_UPDATE";
370
- };
371
- messages: {
372
- denied: string;
373
- };
374
- schema: never[];
375
- };
376
- create(context: RuleContext$1): {
377
- [x: string]: (node: AstNode$1) => void;
378
- };
379
- };
380
-
355
+ declare const noArkRunKernelInDomain: ArkRule;
356
+ declare const noArkRunDirectNew: ArkRule;
357
+ declare const noArkRunTransportBypass: ArkRule;
358
+ declare const noArkOrderKernelInDomain: ArkRule;
359
+ declare const noArkOrderGenericUpdate: ArkRule;
360
+ declare const arkRulesStructureRule: ArkRule;
361
+ declare const architectureAdvisory: ArkRule;
362
+ declare const rules: Record<string, ArkRule>;
381
363
  declare const plugin: ArkEslintPlugin;
364
+ declare const configs: Record<string, unknown>;
382
365
 
383
- export { plugin as default, findConfigPath, globToRegExp, isEdgeDenied, layerForRelativePath, loadArkConfig, noArkOrderGenericUpdate, noArkOrderKernelInDomain, noArkRunDirectNew, noArkRunKernelInDomain, noArkRunTransportBypass, noDeniedCapabilities, noDomainInfraImports, noForbiddenGlobals, noRawEventPublish, patternSpecificity, plugin, readTsconfigPathAliases, requirePublishSource, resolveImportSpecifier, resolveRelativeImport };
366
+ export { architectureAdvisory, arkRulesStructureRule, configs, contractFingerprint, plugin as default, findConfigPath, globToRegExp, isEdgeDenied, layerForRelativePath, loadArkConfig, noArkOrderGenericUpdate, noArkOrderKernelInDomain, noArkRunDirectNew, noArkRunKernelInDomain, noArkRunTransportBypass, noDeniedCapabilities, noDomainInfraImports, noForbiddenGlobals, noRawEventPublish, patternSpecificity, plugin, readTsconfigPathAliases, requirePublishSource, resolveImportSpecifier, resolveRelativeImport, rules };