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.
- package/CHANGELOG.md +153 -0
- package/README.md +7 -5
- package/bin/ark-check-runtime.mjs +41 -91
- package/bin/ark-dashboard.mjs +56 -53
- package/bin/ark-layer-match.mjs +707 -121
- package/bin/ark-mcp-runtime.mjs +448 -169
- package/bin/ark-mcp.mjs +68 -4
- package/bin/ark-shared.mjs +42 -22
- package/bin/ark.mjs +65 -97
- package/bin/lib/adapter-contract-types.mjs +5 -0
- package/bin/lib/adapter-contract.mjs +15 -0
- package/bin/lib/adoption-stance.mjs +2 -2
- package/bin/lib/adr-path.mjs +3 -3
- package/bin/lib/agent-gates.mjs +0 -61
- package/bin/lib/agent-homes.mjs +12 -21
- package/bin/lib/agent-projection-command.mjs +9 -5
- package/bin/lib/ambient-state.mjs +9 -30
- package/bin/lib/analysis-engine.mjs +15 -11
- package/bin/lib/architecture-scan.mjs +61 -15
- package/bin/lib/ark-order-doctor.mjs +4 -29
- package/bin/lib/ark-order-facts.mjs +319 -17
- package/bin/lib/ark-order-sensors.mjs +28 -101
- package/bin/lib/ark-order-types.mjs +3 -2
- package/bin/lib/ark-run-doctor.mjs +17 -28
- package/bin/lib/ark-run-facts.mjs +461 -48
- package/bin/lib/ark-run-sensors.mjs +6 -4
- package/bin/lib/arkgate-pins.mjs +91 -0
- package/bin/lib/arkrule-file-hints.mjs +2 -47
- package/bin/lib/arkrules-contract.mjs +124 -133
- package/bin/lib/arkrules-sensors.mjs +55 -252
- package/bin/lib/check-args.mjs +85 -1
- package/bin/lib/ci-and-commands.mjs +24 -78
- package/bin/lib/ci-merge-boundary.mjs +1 -1
- package/bin/lib/class-source-scan.mjs +479 -0
- package/bin/lib/clone-detection.mjs +474 -0
- package/bin/lib/codex-home.mjs +5 -3
- package/bin/lib/config-contract-slices.mjs +739 -0
- package/bin/lib/config-contract.mjs +42 -607
- package/bin/lib/config-extras.mjs +16 -22
- package/bin/lib/config-warnings.mjs +32 -0
- package/bin/lib/contract-smells.mjs +33 -15
- package/bin/lib/core-ratchet.mjs +0 -2
- package/bin/lib/dashboard-cli.mjs +62 -0
- package/bin/lib/deep-module-coach.mjs +2 -4
- package/bin/lib/deploy-path.mjs +13 -38
- package/bin/lib/design-delta.mjs +1 -1
- package/bin/lib/design-smells.mjs +2 -2
- package/bin/lib/diagnostic-catalog.mjs +23 -9
- package/bin/lib/doctor-advisories.mjs +78 -8
- package/bin/lib/doctor-green-cite.mjs +1 -1
- package/bin/lib/doctor-human.mjs +1 -1
- package/bin/lib/doctor-next-actions.mjs +19 -4
- package/bin/lib/doctor-plan.mjs +9 -13
- package/bin/lib/duplication-io.mjs +572 -0
- package/bin/lib/effective-contract-load.mjs +282 -83
- package/bin/lib/enforcement-profiles.mjs +40 -4
- package/bin/lib/entry-points-io.mjs +424 -0
- package/bin/lib/extra-merge-teeth.mjs +36 -0
- package/bin/lib/field-install.mjs +38 -14
- package/bin/lib/first-run-help.mjs +10 -5
- package/bin/lib/flat-parent-importers.mjs +139 -0
- package/bin/lib/flat-parent-pilot.mjs +40 -100
- package/bin/lib/gate-files.mjs +58 -90
- package/bin/lib/git-change-scope.mjs +109 -0
- package/bin/lib/github-enforcement.mjs +166 -29
- package/bin/lib/golden-pattern.mjs +1 -1
- package/bin/lib/hook-templates.mjs +17 -15
- package/bin/lib/host-support-matrix.mjs +3 -1
- package/bin/lib/html-report-advisories.mjs +4 -0
- package/bin/lib/html-report-depth.mjs +2 -2
- package/bin/lib/html-report.mjs +2 -2
- package/bin/lib/import-graph-projection.mjs +112 -0
- package/bin/lib/import-resolve.mjs +13 -1
- package/bin/lib/improvement-compass-doctor.mjs +1 -24
- package/bin/lib/install-migrate.mjs +50 -73
- package/bin/lib/invariant-coverage-io.mjs +4 -3
- package/bin/lib/invariant-coverage.mjs +85 -11
- package/bin/lib/invariant-probe-cli.mjs +347 -0
- package/bin/lib/invariant-probe-io.mjs +165 -0
- package/bin/lib/invariant-probe-runner.mjs +268 -0
- package/bin/lib/invariant-probe-sites.mjs +174 -0
- package/bin/lib/invariant-probe-workspace.mjs +183 -0
- package/bin/lib/invariant-probe.mjs +461 -0
- package/bin/lib/invariant-tests-path.mjs +16 -22
- package/bin/lib/literal-path-drift.mjs +4 -2
- package/bin/lib/managed-upgrade.mjs +2 -8
- package/bin/lib/mcp-adoption.mjs +13 -6
- package/bin/lib/mcp-hook-payload.mjs +403 -63
- package/bin/lib/orphan-modules-io.mjs +458 -0
- package/bin/lib/orphan-modules.mjs +251 -0
- package/bin/lib/outside-importers.mjs +197 -0
- package/bin/lib/package-manager.mjs +60 -2
- package/bin/lib/parse-health.mjs +1 -1
- package/bin/lib/passthrough-commands.mjs +83 -0
- package/bin/lib/persistence-write-hint.mjs +106 -0
- package/bin/lib/pin-dependent-gates.mjs +117 -0
- package/bin/lib/policy-delta-io.mjs +219 -14
- package/bin/lib/post-green-path.mjs +1 -1
- package/bin/lib/prepare-change.mjs +115 -7
- package/bin/lib/prepare-write.mjs +2 -2
- package/bin/lib/presets.mjs +59 -73
- package/bin/lib/product-copy.mjs +1 -6
- package/bin/lib/project-root.mjs +31 -62
- package/bin/lib/remediation.mjs +23 -4
- package/bin/lib/resolved-candidate-facts.mjs +405 -117
- package/bin/lib/rules-inventory.mjs +22 -3
- package/bin/lib/rules-under-contract.mjs +247 -9
- package/bin/lib/scan-files.mjs +36 -4
- package/bin/lib/schema-validation.mjs +130 -0
- package/bin/lib/sensor-promote-cli.mjs +2 -11
- package/bin/lib/sensor-promote-io.mjs +33 -22
- package/bin/lib/sensor-promotion.mjs +1 -1
- package/bin/lib/skill-catalog-apply.mjs +1 -1
- package/bin/lib/skill-install.mjs +42 -38
- package/bin/lib/snippet-analysis.mjs +140 -6
- package/bin/lib/source-policy.mjs +34 -0
- package/bin/lib/start-install-recovery.mjs +72 -2
- package/bin/lib/start-preview.mjs +31 -1
- package/bin/lib/states-transitions-presence.mjs +3 -3
- package/bin/lib/status-command.mjs +35 -22
- package/bin/lib/status-manifest.mjs +50 -30
- package/bin/lib/status-transition-catalog.mjs +0 -6
- package/bin/lib/suggestions.mjs +3 -3
- package/bin/lib/team-parliament-io.mjs +76 -88
- package/bin/lib/team-parliament.mjs +21 -10
- package/bin/lib/upgrade-behavior-changes.mjs +2 -2
- package/bin/lib/upgrade-command.mjs +2 -24
- package/bin/lib/upgrade-outcome.mjs +1 -1
- package/bin/lib/upstream-report.mjs +21 -10
- package/bin/lib/violations.mjs +10 -9
- package/bin/lib/weakest-link.mjs +13 -0
- package/bin/lib/write-path-capabilities.mjs +6 -4
- package/dist/chunk-A5EIY3HI.cjs +5 -0
- package/dist/chunk-AHACEKSV.js +16 -0
- package/dist/chunk-SVSQVGFJ.js +5 -0
- package/dist/chunk-UN5EH4QV.cjs +16 -0
- package/dist/{configTypes-Bbf_MFGe.d.ts → configTypes-GPvvdleM.d.cts} +30 -4
- package/dist/configTypes-GPvvdleM.d.ts +257 -0
- package/dist/eslint/index.cjs +18 -5
- package/dist/eslint/index.d.cts +368 -0
- package/dist/eslint/index.d.ts +139 -156
- package/dist/eslint/index.js +11 -5
- package/dist/index.cjs +36 -35
- package/dist/index.d.cts +5547 -0
- package/dist/index.d.ts +3283 -198
- package/dist/index.js +36 -35
- package/dist/inspectorListen-6DQVJ4DC.js +1 -0
- package/dist/inspectorListen-KGMIQ2TF.cjs +1 -0
- package/dist/nestjs/index.cjs +1 -18
- package/dist/nestjs/index.d.cts +22 -0
- package/dist/nestjs/index.d.ts +1 -3
- package/dist/nestjs/index.js +1 -18
- package/dist/order/index.cjs +1 -1
- package/dist/order/index.d.cts +155 -0
- package/dist/order/index.d.ts +15 -3
- package/dist/order/index.js +1 -1
- package/dist/runtime/index.cjs +13 -30
- package/dist/{diagnosticCatalog-35mrwAHe.d.ts → runtime/index.d.cts} +828 -276
- package/dist/runtime/index.d.ts +2741 -133
- package/dist/runtime/index.js +13 -30
- package/dist/{types-Bdj32QwA.d.ts → types-CnauMQQL.d.cts} +607 -163
- package/dist/types-CnauMQQL.d.ts +1800 -0
- package/docs/README.md +3 -1
- package/docs/agent-guide.md +217 -16
- package/docs/ai-gates.md +174 -26
- package/docs/arkorder.md +32 -15
- package/docs/brownfield-adoption.md +5 -1
- package/docs/configuration.md +230 -31
- package/docs/develop.md +2 -1
- package/docs/diagnostics.md +212 -19
- package/docs/package-surface.md +35 -9
- package/docs/product-voice.md +7 -1
- package/package.json +69 -19
- package/schemas/ark.analysis-result.schema.json +15 -0
- package/schemas/ark.config.schema.json +77 -12
- package/schemas/ark.invariant-probe.schema.json +368 -0
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/schemas/ark.status-manifest.schema.json +22 -0
- package/server.json +3 -9
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +5 -1
- package/templates/agent-skills/ark-contract/SKILL.md +17 -0
- package/templates/agent-skills/ark-coverage/SKILL.md +2 -0
- package/templates/agent-skills/ark-explore/SKILL.md +7 -0
- package/templates/agent-skills/ark-fix/SKILL.md +20 -0
- package/templates/agent-skills/ark-order/SKILL.md +4 -2
- package/templates/agent-skills/ark-place/SKILL.md +8 -0
- package/templates/agent-skills/ark-runtime/SKILL.md +6 -1
- package/templates/arkrules/PersistenceAdapters.json +1 -1
- package/templates/arkrules/PresentationAdapters.json +1 -1
- package/templates/skills/ark-adopt.md +5 -1
- package/templates/skills/ark-contract.md +17 -0
- package/templates/skills/ark-coverage.md +2 -0
- package/templates/skills/ark-explore.md +7 -0
- package/templates/skills/ark-fix.md +20 -0
- package/templates/skills/ark-order.md +4 -2
- package/templates/skills/ark-place.md +8 -0
- package/templates/skills/ark-runtime.md +6 -1
- package/bin/lib/ark-order-error.mjs +0 -18
- package/bin/lib/ark-order-invariants.mjs +0 -346
- package/dist/types-Ik_OakcI.d.ts +0 -183
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { A as ArkConfig } from '../configTypes-GPvvdleM.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pure layer-glob matching for ark.config.json.
|
|
5
|
+
*
|
|
6
|
+
* **Canonical algorithm** for CLI, ESLint, and library consumers.
|
|
7
|
+
* The CLI load path uses the generated `bin/ark-layer-match.mjs`
|
|
8
|
+
* (`npm run generate:layer-match` / `npm run check:layer-match`).
|
|
9
|
+
* Behavioral parity tests remain a safety net.
|
|
10
|
+
*/
|
|
11
|
+
type LayerConfig = {
|
|
12
|
+
name: string;
|
|
13
|
+
patterns?: string[];
|
|
14
|
+
exclude?: string[];
|
|
15
|
+
forbiddenGlobals?: string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* How a starred `sliceFolders` prefix becomes a slice id.
|
|
19
|
+
*
|
|
20
|
+
* - `path` (default, also the absent value): every literal and every star
|
|
21
|
+
* binding. `lib/features` plus two stars → `lib/features/projects/rfi`.
|
|
22
|
+
* Byte-identical to the ids baselines and `allowedCrossSlice` already use.
|
|
23
|
+
* - `stars`: last literal segment plus every star binding (a star before the
|
|
24
|
+
* last literal is kept too: `modules` / `*` / `api` / `*` → `orders/api/v1`).
|
|
25
|
+
* `lib/features` plus two stars, and `lib/repositories/features` plus two
|
|
26
|
+
* stars, both → `features/projects/rfi`.
|
|
27
|
+
* Prefix stripping stays inside `bindAnchoredSlice`. Bare names are unchanged.
|
|
28
|
+
*/
|
|
29
|
+
type SliceIdentity = 'path' | 'stars';
|
|
30
|
+
/**
|
|
31
|
+
* Layer-to-layer dependency rule from ark.config.json.
|
|
32
|
+
*
|
|
33
|
+
* - Classic: `{ from, to, allowed: false }` denies **cross-layer** edges only.
|
|
34
|
+
* Same-layer is always allowed without peerIsolation (historical short-circuit).
|
|
35
|
+
* - `peerIsolation: true` + `allowed: false`: deny only when slice ids differ
|
|
36
|
+
* (same **or** cross layer). Same-slice → allow. File imports pass fromPath
|
|
37
|
+
* and toPath. Intent references pass fromPath only (intents are not files);
|
|
38
|
+
* a declared shared root is classified and does not deny. Missing fromPath,
|
|
39
|
+
* no slice folders, or unclassifiable slices → fail-closed.
|
|
40
|
+
*/
|
|
41
|
+
type EdgeRule = {
|
|
42
|
+
from: string;
|
|
43
|
+
to: string;
|
|
44
|
+
allowed?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* When true with `allowed: false`: deny only when importer and importee resolve
|
|
47
|
+
* to different slice ids (parent/name, e.g. features/auth). Works same-layer
|
|
48
|
+
* and cross-layer. See findDeniedEdgeRule.
|
|
49
|
+
*/
|
|
50
|
+
peerIsolation?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Slice parents. A bare name (`["features"]`) is an unanchored one-segment
|
|
53
|
+
* match: `src/features/auth/api.ts` → `features/auth`. The next segment is
|
|
54
|
+
* never a filename. A starred prefix (`lib` / `features` / `*` / `*`) is
|
|
55
|
+
* anchored like `sharedRoots`. With `sliceIdentity` `"path"` (the default,
|
|
56
|
+
* also when the key is absent) the slice id includes the literal prefix
|
|
57
|
+
* plus the directories the stars bind (`lib/features/projects/rfi`), so
|
|
58
|
+
* parallel trees get different ids. With `"stars"` it is the last literal
|
|
59
|
+
* plus every star binding, so the same feature has one id across parallel
|
|
60
|
+
* trees.
|
|
61
|
+
* When omitted, inferred from the layer's glob patterns (segment before a wildcard).
|
|
62
|
+
*/
|
|
63
|
+
sliceFolders?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* How a starred `sliceFolders` prefix is named. Absent and `"path"` keep
|
|
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.
|
|
69
|
+
*/
|
|
70
|
+
sliceIdentity?: SliceIdentity;
|
|
71
|
+
/**
|
|
72
|
+
* Roots the repo declares **shared on purpose** (`["ui", "hooks", "lib/permissions"]`).
|
|
73
|
+
*
|
|
74
|
+
* A file under a declared shared root is *evidence*, not an unclassifiable path:
|
|
75
|
+
* the repo has said this code belongs to no slice, so peerIsolation stops
|
|
76
|
+
* reporting our inability to place it as a violation of their design.
|
|
77
|
+
* Matched as a contiguous run of path segments anywhere in the repo-relative
|
|
78
|
+
* path (so `ui` covers `src/ui/button.tsx`), case-insensitively; a root
|
|
79
|
+
* containing `*` is matched as a glob. A path that still resolves to a slice
|
|
80
|
+
* id keeps its slice — a shared root never shadows a real slice.
|
|
81
|
+
*
|
|
82
|
+
* Note: this only relaxes the *unclassifiable* branch. A genuine cross-slice
|
|
83
|
+
* edge between two different slices still denies.
|
|
84
|
+
*/
|
|
85
|
+
sharedRoots?: string[];
|
|
86
|
+
/**
|
|
87
|
+
* Directed cross-slice edges the repo declares on purpose — same shape as the
|
|
88
|
+
* layer edges in `rules[]`, but between slice ids:
|
|
89
|
+
* `[{ from: "features/checkout", to: "features/catalog" }]`.
|
|
90
|
+
*
|
|
91
|
+
* Each entry allows exactly one direction. Slice ids match either fully
|
|
92
|
+
* (`features/auth`) or by bare slice name (`auth`), case-insensitively — a bare
|
|
93
|
+
* name matches that name under *any* slice folder, so write the full id in a repo
|
|
94
|
+
* with several slice parents. Everything not declared still denies.
|
|
95
|
+
* `*` is a literal character on this list, not a wildcard.
|
|
96
|
+
*/
|
|
97
|
+
allowedCrossSlice?: CrossSliceEdge[];
|
|
98
|
+
/**
|
|
99
|
+
* `"deny"`: a shared root may not import a slice. `"deny-cross-parent"` leaves
|
|
100
|
+
* that hop allowed; a whole-graph pass then reports a slice that reaches
|
|
101
|
+
* another universe only through shared. Absent keeps the hop allowed.
|
|
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}.
|
|
106
|
+
*/
|
|
107
|
+
sharedImportsSlice?: SharedImportsSliceSetting;
|
|
108
|
+
/**
|
|
109
|
+
* Optional inner wall under this rule's universe wall. Absent: the universe
|
|
110
|
+
* wall is the whole decision and check output stays byte-identical.
|
|
111
|
+
* Present: a universe cross-slice deny is `CROSS_PARENT_SLICE`. An edge the
|
|
112
|
+
* universe wall allows may still deny on the child wall.
|
|
113
|
+
*/
|
|
114
|
+
childSlices?: ChildSlices;
|
|
115
|
+
/** Optional override message for scanners / write-gate. */
|
|
116
|
+
message?: string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Inner slice wall. `sliceFolders` names children under the universe.
|
|
120
|
+
* A side with no child id (a flat file, or a `commonFolders` directory) is
|
|
121
|
+
* universe common. `siblings` is `deny`, `advisory`, or `{ default, enforce }`.
|
|
122
|
+
* Cross-parent has no knob. `parentMayImportChild` defaults to false.
|
|
123
|
+
* `allowedCrossSlice` here may use a whole-segment `*`. It clears only a
|
|
124
|
+
* sibling crossing, and only after the universe wall has allowed the edge.
|
|
125
|
+
*/
|
|
126
|
+
/** A folder outside the slice trees, borrowed onto a child id until it moves. */
|
|
127
|
+
type SliceAlias = {
|
|
128
|
+
/** Source path glob. Only files the slice folders do not already classify. */
|
|
129
|
+
from: string;
|
|
130
|
+
/** Child slice id: the universe id plus one child segment. */
|
|
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;
|
|
136
|
+
};
|
|
137
|
+
type ChildSlices = {
|
|
138
|
+
sliceFolders: string[];
|
|
139
|
+
sliceIdentity?: SliceIdentity;
|
|
140
|
+
commonFolders?: string[];
|
|
141
|
+
siblings?: ChildSliceSiblings;
|
|
142
|
+
parentMayImportChild?: boolean;
|
|
143
|
+
/** Text for inner-wall findings (sibling, common → child). Absent: ArkGate default, never the rule message. */
|
|
144
|
+
message?: string;
|
|
145
|
+
/** Directed child allowances. `*` matches one whole segment. Never a universe excuse. */
|
|
146
|
+
allowedCrossSlice?: CrossSliceEdge[];
|
|
147
|
+
/** Unclassified files governed as this child. Debt, not a destination. */
|
|
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;
|
|
154
|
+
};
|
|
155
|
+
/** How the child wall treats a sibling crossing. Absent means `deny`. */
|
|
156
|
+
type ChildSliceSiblingsMode = 'deny' | 'advisory';
|
|
157
|
+
/**
|
|
158
|
+
* Per-subtree sibling enforcement. `default` is everyone not listed.
|
|
159
|
+
* `enforce` names child slice ids or subtree paths. The list never loosens deny.
|
|
160
|
+
*/
|
|
161
|
+
type ChildSliceSiblingsEnforce = {
|
|
162
|
+
default: ChildSliceSiblingsMode;
|
|
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;
|
|
170
|
+
};
|
|
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
|
+
};
|
|
179
|
+
/** A directed slice-to-slice edge the repo declares on purpose (peerIsolation). */
|
|
180
|
+
type CrossSliceEdge = {
|
|
181
|
+
/** Importing slice id (`features/checkout`) or bare slice name (`checkout`). */
|
|
182
|
+
from: string;
|
|
183
|
+
/** Imported slice id or bare slice name. */
|
|
184
|
+
to: string;
|
|
185
|
+
};
|
|
186
|
+
/** Options for path-aware edge checks (peer isolation). */
|
|
187
|
+
type EdgeCheckOptions = {
|
|
188
|
+
/** Repo-relative path of the importing file. */
|
|
189
|
+
fromPath?: string;
|
|
190
|
+
/** Repo-relative path of the imported module. Omit for intent names (not files). */
|
|
191
|
+
toPath?: string;
|
|
192
|
+
/** Layer configs — used to infer sliceFolders when the rule omits them. */
|
|
193
|
+
layers?: LayerConfig[];
|
|
194
|
+
};
|
|
195
|
+
declare function globToRegExp(pattern: string): RegExp;
|
|
196
|
+
/**
|
|
197
|
+
* Rank competing layer globs.
|
|
198
|
+
*
|
|
199
|
+
* Without a path: concrete-segment count + literal length (historical shape).
|
|
200
|
+
* With a path: last matched concrete segment depth dominates so interior
|
|
201
|
+
* domain/persistence folders beat Application/Presentation scatter bags
|
|
202
|
+
* (DL-DOMAIN-SPECIFICITY / NEW-APP-VACUUM-LIB).
|
|
203
|
+
*/
|
|
204
|
+
declare function patternSpecificity(pattern: string, relPath?: string): number;
|
|
205
|
+
declare function layerForRelativePath(relPath: string, layers: LayerConfig[] | undefined): string | undefined;
|
|
206
|
+
declare function isEdgeDenied(rules: EdgeRule[] | undefined, from: string, to: string, options?: EdgeCheckOptions): boolean;
|
|
207
|
+
|
|
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
|
+
|
|
213
|
+
type AstNode = {
|
|
214
|
+
type?: string;
|
|
215
|
+
name?: string;
|
|
216
|
+
value?: unknown;
|
|
217
|
+
source?: AstNode;
|
|
218
|
+
callee?: AstNode;
|
|
219
|
+
object?: AstNode;
|
|
220
|
+
property?: AstNode;
|
|
221
|
+
key?: AstNode;
|
|
222
|
+
arguments?: AstNode[];
|
|
223
|
+
properties?: AstNode[];
|
|
224
|
+
body?: AstNode[];
|
|
225
|
+
declaration?: AstNode;
|
|
226
|
+
importKind?: string;
|
|
227
|
+
exportKind?: string;
|
|
228
|
+
specifiers?: AstNode[];
|
|
229
|
+
parent?: AstNode;
|
|
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[];
|
|
241
|
+
computed?: boolean;
|
|
242
|
+
optional?: boolean;
|
|
243
|
+
loc?: {
|
|
244
|
+
start?: {
|
|
245
|
+
line?: number;
|
|
246
|
+
column?: number;
|
|
247
|
+
};
|
|
248
|
+
end?: {
|
|
249
|
+
line?: number;
|
|
250
|
+
column?: number;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
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>;
|
|
287
|
+
type ArkRule = {
|
|
288
|
+
meta: {
|
|
289
|
+
type: 'problem';
|
|
290
|
+
docs: {
|
|
291
|
+
description: string;
|
|
292
|
+
};
|
|
293
|
+
messages: Record<string, string>;
|
|
294
|
+
schema: unknown[];
|
|
295
|
+
};
|
|
296
|
+
create(context: RuleContext): RuleListener;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/** Nearest `ark.config.json` at or above the linted file (memoized per directory). */
|
|
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
|
+
*/
|
|
305
|
+
declare function loadArkConfig(configPath: string): ArkConfig | null;
|
|
306
|
+
/**
|
|
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.
|
|
310
|
+
*/
|
|
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 = {
|
|
325
|
+
baseUrl: string;
|
|
326
|
+
aliases: TsconfigAlias[];
|
|
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;
|
|
333
|
+
/** Resolve relative import specifier to an absolute path candidate (TS-oriented). */
|
|
334
|
+
declare function resolveRelativeImport(fromFile: string, specifier: string): string | null;
|
|
335
|
+
/**
|
|
336
|
+
* Resolve relative or tsconfig path-alias import to an on-disk file.
|
|
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.
|
|
339
|
+
*/
|
|
340
|
+
declare function resolveImportSpecifier(fromFile: string, specifier: string, projectRoot?: string | null): string | null;
|
|
341
|
+
|
|
342
|
+
type ArkEslintPlugin = {
|
|
343
|
+
meta: {
|
|
344
|
+
name: string;
|
|
345
|
+
version: string;
|
|
346
|
+
};
|
|
347
|
+
rules: Record<string, ArkRule>;
|
|
348
|
+
configs?: Record<string, unknown>;
|
|
349
|
+
};
|
|
350
|
+
declare const noDomainInfraImports: ArkRule;
|
|
351
|
+
declare const noRawEventPublish: ArkRule;
|
|
352
|
+
declare const requirePublishSource: ArkRule;
|
|
353
|
+
declare const noForbiddenGlobals: ArkRule;
|
|
354
|
+
declare const noDeniedCapabilities: ArkRule;
|
|
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>;
|
|
363
|
+
declare const plugin: ArkEslintPlugin;
|
|
364
|
+
declare const configs: Record<string, unknown>;
|
|
365
|
+
|
|
366
|
+
// @ts-ignore
|
|
367
|
+
export = plugin;
|
|
368
|
+
export { architectureAdvisory, arkRulesStructureRule, configs, contractFingerprint, findConfigPath, globToRegExp, isEdgeDenied, layerForRelativePath, loadArkConfig, noArkOrderGenericUpdate, noArkOrderKernelInDomain, noArkRunDirectNew, noArkRunKernelInDomain, noArkRunTransportBypass, noDeniedCapabilities, noDomainInfraImports, noForbiddenGlobals, noRawEventPublish, patternSpecificity, plugin, readTsconfigPathAliases, requirePublishSource, resolveImportSpecifier, resolveRelativeImport, rules };
|