arkgate 3.9.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/README.md +16 -5
- package/bin/ark-check-runtime.mjs +75 -3
- package/bin/ark-mcp-runtime.mjs +94 -0
- package/bin/lib/adapter-contract.mjs +14 -1
- package/bin/lib/analysis-engine.mjs +8 -8
- package/bin/lib/architecture-scan.mjs +35 -2
- package/bin/lib/arkrule-file-hints.mjs +71 -0
- package/bin/lib/arkrules-contract.mjs +382 -0
- package/bin/lib/arkrules-sensors.mjs +411 -0
- package/bin/lib/config-contract.mjs +85 -6
- package/bin/lib/doctor-advisories.mjs +14 -1
- package/bin/lib/doctor-plan.mjs +21 -0
- package/bin/lib/effective-contract-load.mjs +116 -0
- package/bin/lib/field-install.mjs +104 -0
- package/bin/lib/graph-blind.mjs +19 -0
- package/bin/lib/html-report-advisories.mjs +24 -0
- package/bin/lib/install-migrate.mjs +20 -2
- package/bin/lib/invariant-coverage-io.mjs +157 -0
- package/bin/lib/invariant-coverage.mjs +127 -0
- package/bin/lib/policy-delta-io.mjs +33 -0
- package/bin/lib/presets.mjs +241 -1
- package/bin/lib/remediation.mjs +28 -0
- package/bin/lib/resolved-candidate-facts.mjs +14 -1
- package/bin/lib/rules-inventory.mjs +144 -0
- package/bin/lib/rules-under-contract.mjs +66 -0
- package/bin/lib/start-preview.mjs +24 -7
- package/bin/lib/upgrade-command.mjs +48 -2
- package/dist/{configTypes-DAPvBqK6.d.ts → configTypes-CC0FEXoF.d.ts} +16 -3
- package/dist/eslint/index.cjs +2 -2
- package/dist/eslint/index.d.ts +1 -1
- package/dist/eslint/index.js +2 -2
- package/dist/index.cjs +14 -7
- package/dist/index.d.ts +615 -20
- package/dist/index.js +13 -6
- package/docs/README.md +4 -3
- package/docs/agent-guide.md +7 -3
- package/docs/ai-gates.md +6 -1
- package/docs/brownfield-adoption.md +20 -0
- package/docs/configuration.md +37 -4
- package/docs/develop.md +8 -2
- package/docs/enthusiast/README.md +11 -0
- package/docs/package-surface.md +13 -11
- package/docs/product-voice.md +9 -2
- package/docs/use.md +9 -0
- package/package.json +4 -17
- package/schemas/ark.analysis-result.schema.json +9 -1
- package/schemas/ark.arkrules.schema.json +141 -0
- package/schemas/ark.config.schema.json +10 -2
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/server.json +2 -2
- package/templates/arkrules/ApplicationOrchestration.json +14 -0
- package/templates/arkrules/DomainModel.json +32 -0
- package/templates/arkrules/PersistenceAdapters.json +14 -0
- package/templates/arkrules/PresentationAdapters.json +14 -0
- package/templates/skills/ark-adopt.md +28 -1
- package/templates/skills/ark-architect.md +23 -0
- package/templates/skills/ark-autopilot.md +27 -1
- package/templates/skills/ark-contract.md +27 -1
- package/templates/skills/ark-coverage.md +23 -0
- package/templates/skills/ark-explain.md +23 -0
- package/templates/skills/ark-explore.md +26 -1
- package/templates/skills/ark-fix.md +23 -0
- package/templates/skills/ark-loop.md +23 -0
- package/templates/skills/ark-place.md +26 -0
- package/templates/skills/ark-runtime.md +4 -0
- package/templates/skills/ark-think.md +24 -1
- package/templates/skills/ark-upgrade.md +23 -0
- package/compat/nestjs.cjs +0 -2
- package/compat/nestjs.d.ts +0 -2
- package/compat/nestjs.js +0 -1
- package/compat/runtime.cjs +0 -2
- package/compat/runtime.d.ts +0 -2
- package/compat/runtime.js +0 -1
package/docs/README.md
CHANGED
|
@@ -52,13 +52,14 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
|
|
|
52
52
|
| Area | Path |
|
|
53
53
|
|------|------|
|
|
54
54
|
| Release notes (by version) | [releases/](releases/) · [CHANGELOG.md](../CHANGELOG.md) |
|
|
55
|
-
|
|
|
55
|
+
| Epic plans (seeded + shipped) | [plans/](plans/) |
|
|
56
56
|
| Claims audit | [audit/claims-matrix.md](audit/claims-matrix.md) |
|
|
57
57
|
| Field adoption kit (scaffolding, not closed) | [field/](field/) |
|
|
58
58
|
| Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
Prepared major: [releases/4.0.0.md](releases/4.0.0.md) (`arkgate@4.0.0` — layers + optional **ArkRules**).
|
|
61
|
+
Last npm `latest` until publish: [releases/3.9.2.md](releases/3.9.2.md) (`arkgate@3.9.2`).
|
|
62
|
+
Config: [configuration.md](configuration.md) · Agent skills dual-plane: [agent-guide.md](agent-guide.md).
|
|
62
63
|
|
|
63
64
|
---
|
|
64
65
|
|
package/docs/agent-guide.md
CHANGED
|
@@ -19,16 +19,20 @@ the project API is unusable. See the distribution and completeness boundary in
|
|
|
19
19
|
[typescript-support.md](typescript-support.md). Product English and progressive-disclosure rules:
|
|
20
20
|
[product-voice.md](product-voice.md).
|
|
21
21
|
|
|
22
|
-
### Default path (
|
|
22
|
+
### Default path (4.0.0)
|
|
23
23
|
|
|
24
24
|
```text
|
|
25
25
|
ark start → ark start --apply → ark-check --doctor
|
|
26
26
|
day to day: compact router / MCP place + validate + check
|
|
27
27
|
guided work: install skill pack → /ark-autopilot
|
|
28
|
+
optional: arkRules map + arkrules/*.json (intra-layer; starts advisory)
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
Doctor is the **control plane** (status light + primary next action).
|
|
31
|
-
|
|
31
|
+
Doctor is the **control plane** (status light + primary next action). From **4.0.0**, doctor may
|
|
32
|
+
also report **`rulesUnderContract`** (ArkRules counts) and **`packageVersionTruth`** when the
|
|
33
|
+
CLI is ahead of the package.json pin. The compact router from `ark start` is enough for normal
|
|
34
|
+
feature work. Full `/ark-*` skills are **expert depth** and label residual **`[Layer]`** vs
|
|
35
|
+
**`[ArkRules]`** (except experimental `/ark-runtime`):
|
|
32
36
|
|
|
33
37
|
```bash
|
|
34
38
|
npx ark-check --install-agent-gates --skills-only --force
|
package/docs/ai-gates.md
CHANGED
|
@@ -27,7 +27,12 @@ while a required merge status is the one boundary a repository can make every wr
|
|
|
27
27
|
Prefer fail-closed honesty over fake hard guarantees on advisory hosts.
|
|
28
28
|
|
|
29
29
|
Everything below uses the same `ark.config.json` as `arkgate-check` / `ark-check` (CI) — one
|
|
30
|
-
contract shared by every surface.
|
|
30
|
+
contract shared by every surface. From **4.0**, optional **ArkRules** (`arkRules` map +
|
|
31
|
+
`arkrules/*.json`) ride the **same** write path, doctor, and CI adapter; absence of ArkRules
|
|
32
|
+
does not change inter-layer verdicts. Label residual **`[Layer]`** vs **`[ArkRules]`**. See
|
|
33
|
+
[configuration — ArkRules](configuration.md#arkrules-intra-layer-opt-in).
|
|
34
|
+
|
|
35
|
+
Generate the layer contract once:
|
|
31
36
|
|
|
32
37
|
```bash
|
|
33
38
|
npx arkgate-check --init
|
|
@@ -34,6 +34,26 @@ case is every route "violating" app→kernel because the framework's own entrypo
|
|
|
34
34
|
positives, not debt. `--update-baseline` will refuse a lopsided freeze for exactly this
|
|
35
35
|
reason. Fix the contract first (step 3).
|
|
36
36
|
|
|
37
|
+
## 2b. Rules inventory (ArkRules / AR13)
|
|
38
|
+
|
|
39
|
+
When inter-layer edges are already green but business rules still live as spaghetti
|
|
40
|
+
(validation in controllers, magic constants, anemic entities):
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
ark-check --rules-inventory --json
|
|
44
|
+
# MCP: ark_rules_inventory
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Output is **honest counts** (inventoried / under-contract / frozen) — never a score. Route
|
|
48
|
+
extraction through `/ark-fix` or `/ark-loop` (one pilot card at a time) and declaration
|
|
49
|
+
through `/ark-contract` editing `arkrules/<Layer>.json` (ADR 0015 — no new skill names).
|
|
50
|
+
Report residual as **`[Layer]`** (import edges / baseline) vs **`[ArkRules]`** (inventory /
|
|
51
|
+
structure / invariants). Case study shape:
|
|
52
|
+
[arkrules-migration-case-study.md](field/arkrules-migration-case-study.md).
|
|
53
|
+
|
|
54
|
+
**Upgrade note (4.0):** `ark upgrade --no-install` can refresh skills/gates while leaving
|
|
55
|
+
`package.json` on an older pin—doctor exposes `packageVersionTruth` when the CLI is ahead.
|
|
56
|
+
|
|
37
57
|
## 3. Make the contract real (via `/ark-contract`)
|
|
38
58
|
|
|
39
59
|
- **Classify the ungoverned tree.** `ark-check --coverage` leads with `Governed: N%` and
|
package/docs/configuration.md
CHANGED
|
@@ -10,7 +10,7 @@ The CLI, MCP server, and ESLint plugin all use the same parser, migration, defau
|
|
|
10
10
|
```json
|
|
11
11
|
{
|
|
12
12
|
"$schema": "https://unpkg.com/arkgate@2/schemas/ark.config.schema.json",
|
|
13
|
-
"schemaVersion": "1.
|
|
13
|
+
"schemaVersion": "1.1",
|
|
14
14
|
"include": ["src"],
|
|
15
15
|
"layers": [],
|
|
16
16
|
"rules": []
|
|
@@ -18,7 +18,10 @@ The CLI, MCP server, and ESLint plugin all use the same parser, migration, defau
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
`$schema` is for editor completion. `schemaVersion` controls ArkGate's runtime contract and is
|
|
21
|
-
independent from the npm package version.
|
|
21
|
+
independent from the npm package version. Schema **`1.1`** is additive over `1.0` and adds the
|
|
22
|
+
optional top-level **`arkRules`** map (ADR 0012). Absence of `arkRules` changes no inter-layer
|
|
23
|
+
verdict. Per-layer structure/invariant files use sibling schema
|
|
24
|
+
`arkgate/schema/arkrules` (`schemas/ark.arkrules.schema.json`).
|
|
22
25
|
|
|
23
26
|
For offline editor completion, point `$schema` at the installed file instead:
|
|
24
27
|
|
|
@@ -36,8 +39,9 @@ The same schema is exported through the stable package subpaths `arkgate/schema`
|
|
|
36
39
|
## Compatibility and migration
|
|
37
40
|
|
|
38
41
|
Configs without `schemaVersion` are the legacy shape shipped through ArkGate 1.x and early 2.x.
|
|
39
|
-
The loader deterministically projects them
|
|
40
|
-
and the established defaults. It never rewrites the user's file during a check.
|
|
42
|
+
The loader deterministically projects them through `unversioned → 1.0 → 1.1` in memory by adding
|
|
43
|
+
contract metadata and the established defaults. It never rewrites the user's file during a check.
|
|
44
|
+
Newly generated
|
|
41
45
|
configs always contain the metadata, and unsupported future versions fail at
|
|
42
46
|
`$.schemaVersion` instead of being guessed.
|
|
43
47
|
|
|
@@ -78,6 +82,9 @@ Top-level fields:
|
|
|
78
82
|
- `include`, `exclude`, `excludeGenerated`, `frameworkOverlay`
|
|
79
83
|
- `layers`, `rules`, `cyclePolicy`
|
|
80
84
|
- `dynamicImportAllowlist`, `safety`
|
|
85
|
+
- **`arkRules`** (optional, schema `1.1+`) — map of layer name → project-relative path to an
|
|
86
|
+
ArkRules file (e.g. `"DomainModel": "arkrules/DomainModel.json"`). Keys must match a declared
|
|
87
|
+
layer. Missing/invalid referenced files **fail closed**.
|
|
81
88
|
|
|
82
89
|
Layer fields:
|
|
83
90
|
|
|
@@ -108,6 +115,32 @@ Safety fields:
|
|
|
108
115
|
The packaged JSON Schema is authoritative for types, constraints, defaults, and the unknown-key
|
|
109
116
|
policy.
|
|
110
117
|
|
|
118
|
+
## ArkRules (intra-layer, opt-in)
|
|
119
|
+
|
|
120
|
+
Sibling schema export: `arkgate/schema/arkrules` (`schemas/ark.arkrules.schema.json`).
|
|
121
|
+
|
|
122
|
+
Each `arkrules/<Layer>.json` may declare:
|
|
123
|
+
|
|
124
|
+
| Section | Purpose | Modes |
|
|
125
|
+
|---------|---------|--------|
|
|
126
|
+
| `structure[]` | Closed sensor ids (e.g. `aggregate-private-state`, `always-valid-factory`, `thin-adapter`) | `advisory` (default) or `enforced` |
|
|
127
|
+
| `invariants[]` | Stable ids + description + optional coverage (`test` / `symbol`) | `advisory` or `enforced` |
|
|
128
|
+
|
|
129
|
+
**Reporting:** diagnostics carry `evidence.arkruleId` + `evidence.arkruleSource`. Label residual
|
|
130
|
+
**`[Layer]`** (import edges / capabilities) vs **`[ArkRules]`** (structure / invariants) in agent
|
|
131
|
+
output. Doctor JSON: `rulesUnderContract` (counts, never a score).
|
|
132
|
+
|
|
133
|
+
**Promotion:** advisory→enforced is strengthening when coverage evidence exists; demote/delete is
|
|
134
|
+
a hash-bound policy weakening. Empty `appliesTo: []` fails closed; zero-match globs emit
|
|
135
|
+
`ARKRULE_SCOPE_EMPTY` (advisory warn / enforced fail).
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Brownfield candidates (not a score)
|
|
139
|
+
npx arkgate-check --rules-inventory --json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Edit ArkRules through skill `/ark-contract`; extract/implement via `/ark-fix` or `/ark-loop`.
|
|
143
|
+
|
|
111
144
|
## Contract transitions
|
|
112
145
|
|
|
113
146
|
`ark-check --strict-merge` protects the transition into a new contract, not only the resulting
|
package/docs/develop.md
CHANGED
|
@@ -55,12 +55,18 @@ Doctor reports what is actually installed and observed (`writePath` / enforcemen
|
|
|
55
55
|
| Concern | Doc / tool |
|
|
56
56
|
|---------|------------|
|
|
57
57
|
| Layers, rules, globs | [configuration.md](configuration.md) · `ark.config.json` |
|
|
58
|
+
| ArkRules (structure + invariants) | [configuration.md](configuration.md#arkrules-intra-layer-opt-in) · `arkRules` / `arkrules/*` · skill `/ark-contract` |
|
|
59
|
+
| Rules inventory (brownfield) | `arkgate-check --rules-inventory` · MCP `ark_rules_inventory` |
|
|
58
60
|
| Stable package API | [package-surface.md](package-surface.md) |
|
|
59
|
-
| Where new code goes | MCP `ark_place` · skill `/ark-place` |
|
|
61
|
+
| Where new code goes | MCP `ark_place` · skill `/ark-place` (respects layer **and** structure sensors) |
|
|
60
62
|
| Preflight multi-file change | MCP `ark_prepare_change` · `ark preflight --changes …` |
|
|
61
63
|
| Write snippet preflight | MCP `ark_prepare_write` |
|
|
62
64
|
|
|
63
|
-
Prefer prepare/preflight before the host commits disk. Mechanical-safe patches only for proven kinds; judgment stays explicit.
|
|
65
|
+
Prefer prepare/preflight before the host commits disk. Mechanical-safe patches only for proven kinds; judgment stays explicit (all ArkRules structure/invariant fixes are judgment).
|
|
66
|
+
|
|
67
|
+
### Dual-plane labeling
|
|
68
|
+
|
|
69
|
+
Agent skills (except experimental `/ark-runtime`) must label residual as **`[Layer]`** vs **`[ArkRules]`**. Doctor JSON exposes `rulesUnderContract` and, when the CLI is ahead of `package.json`, `packageVersionTruth` (dual-truth after `upgrade --no-install`).
|
|
64
70
|
|
|
65
71
|
---
|
|
66
72
|
|
|
@@ -21,6 +21,17 @@ aliases `ark` / `ark-check` still work).
|
|
|
21
21
|
|
|
22
22
|
`ark start` and `ark-check --plan` will not claim "everything is guarded" while governed coverage is near zero. On Nest/Next/express starters, init also merges **framework filename conventions** into the layer globs so day-one coverage is real.
|
|
23
23
|
|
|
24
|
+
### Two planes (4.0 — optional second plane)
|
|
25
|
+
|
|
26
|
+
| Plane | Plain English |
|
|
27
|
+
|-------|---------------|
|
|
28
|
+
| **Layers** | Who may import whom (always on after start) |
|
|
29
|
+
| **ArkRules** (optional) | Habits *inside* a layer — structure and named invariants as data |
|
|
30
|
+
|
|
31
|
+
You can stay on layers only. When you add ArkRules, start **advisory** and promote only with
|
|
32
|
+
coverage. Residual labels: **`[Layer]`** vs **`[ArkRules]`**. Details:
|
|
33
|
+
[use.md](../use.md) · [configuration](../configuration.md#arkrules-intra-layer-opt-in).
|
|
34
|
+
|
|
24
35
|
## Start here
|
|
25
36
|
|
|
26
37
|
| Type | Document | You will… |
|
package/docs/package-surface.md
CHANGED
|
@@ -34,7 +34,9 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
34
34
|
| **Governance weight (W02)** | `ark-check --doctor --json` → `doctor.contractHealth.governanceWeight` | Additive, **advisory only** — raw facts (`declaredLayers`, `populatedLayers`, `governedFiles`, `rules`, `deniedEdges`, `allowedEdges`, `filesPerLayer`, `rulesPerLayer`) plus a fixed comparative band `weight: heavy | typical | light | unknown` and its fixed `note`. Fixed deterministic thresholds: **heavy** = fewer than 25 governed files per declared layer AND (6+ layers OR 4+ well-formed rules per layer); **light** = at most 2 layers over 150+ governed files; **unknown** = no layers or no governed files; everything else is **typical** (banding uses raw ratios; the reported ratios are rounded for display). `notAScore: true` is explicit: never a composite score, ranking, or gate input; the heavy note asks to justify NEW layers/rules and never suggests deleting working ones. Human doctor prints a line only for `heavy`/`light`. |
|
|
35
35
|
| **Report parity (X01)** | `ark-check --report` → advisory sections (`data-advisory="contractHealth\|ambientState\|parseHealth"`, nested `governanceWeight`) + layer wall badges | The report is a rendering of doctor truth. **Standing rule:** every doctor advisory ships with its report section — enforced by the `reportParity` guard, which enumerates the doctor's advisory keys and fails on any missing section. |
|
|
36
36
|
| **MCP tools** | `arkgate-mcp` / `ark://…` resources | Tool names and primary argument shapes are stable within a major. |
|
|
37
|
-
| **`ark.config.json`** | Layer globs, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds | Versioned by `schemaVersion`; unknown fields fail closed and migrations preserve the previous supported major. |
|
|
37
|
+
| **`ark.config.json`** | Layer globs, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`arkRules`** map (schema `1.1+`) | Versioned by `schemaVersion`; unknown fields fail closed and migrations preserve the previous supported major. Absence of `arkRules` is byte-for-byte silent on inter-layer verdicts. |
|
|
38
|
+
| **ArkRules inventory / under-contract (4.0)** | `ark-check --rules-inventory [--json]`; doctor `rulesUnderContract`; MCP `ark_rules_inventory` | Additive. Honest counts (inventoried / under-contract / frozen) — **never a score**. Structure/invariant diagnostics use adapter `1.4` provenance. |
|
|
39
|
+
| **Package pin dual-truth (4.0)** | doctor JSON `packageVersionTruth`; upgrade JSON/human note when pin behind CLI | Additive, advisory. Surfaces after `upgrade --no-install` when managed CLI is ahead of package.json. |
|
|
38
40
|
| **Policy transition analysis (T01, 3.1.0)** | `analyzePolicyDelta(...)`; MCP `ark_policy_delta`; CLI `--policy-base` / `--policy-base-ref` / `--policy-ack`; check JSON `policyDelta` | Additive schema `1.0`. Classifications and finding ids are deterministic. Weakening/judgment requires an acknowledgement bound to both policy hashes and the exact blocking finding set. |
|
|
39
41
|
| **Atomic change preflight (T02, 3.1.0)** | `preflightChange(...)`; CLI `ark preflight --changes <file> --json`; MCP `ark_prepare_change` | Additive schema `1.0`. One complete governed production-source `{path,content}` / `{path,delete:true}` batch; read-only; returns operation, content/tree/policy/compiler fingerprints and stable graph findings. MCP availability alone is advisory. |
|
|
40
42
|
| **Architecture change map (T03, 3.1.0)** | `arkgate/schema/change-map` or `arkgate/schema/ark.change-map.schema.json`; CLI `ark preflight --change-map <file>`; MCP `ark_prepare_change.changeMap` | Optional strict schema `1.0`. Canonical planned paths + operations + resolved Ark layers + dependencies between planned files. Preflight returns `changeMapHash`; absence is normal and adds no project file. Structural intent only, never behavioral completion. |
|
|
@@ -42,10 +44,11 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
|
|
|
42
44
|
| **Enforcement ladder + fixed journey (T05, 3.1.0)** | `doctor.writePath.enforcementLadder`; hook repair `enforcement`; `npm run eval:change-integrity` | Additive schema `1.0` separates supported/installed/active/bypassable state and evidence. Hard is operation-scoped only for a supported covered hook; MCP is advisory; required CI status stays unverified locally. Fixed no-context fixture proves CLI/MCP/hook/final parity, one casual denial, acceptance behavior, and strict Ark. |
|
|
43
45
|
| **Enforcement state (Z06/Z10)** | `doctor.writePath.enforcementState`; schema/type | Schema `1.1`: runtime observation, operation coverage, and operation-scoped `hard`. Only fresh covered active-host evidence permits `hard:true`; unverified assets and MCP remain non-hard. |
|
|
44
46
|
| **Design delta (Z10)** | `--fail-on-new-smells --base-ref <ref>`; hook/MCP; schema/types | Schema `1.0`: identities, touched paths, stable evidence/verdict. Missing base fails closed; only new/worsened `domain-logic-in-ui` blocks; global doctor smells stay advisory. |
|
|
45
|
-
| **`arkgate/schema/analysis-result`** or **`arkgate/schema/ark.analysis-result.schema.json`** | Public CLI/MCP/hook diagnostic envelope (`schemaVersion`, `mode`, `valid`, `completeness`, `completenessReasons`, `diagnostics`, resolved identities) | Schema `1.3`
|
|
47
|
+
| **`arkgate/schema/analysis-result`** or **`arkgate/schema/ark.analysis-result.schema.json`** | Public CLI/MCP/hook diagnostic envelope (`schemaVersion`, `mode`, `valid`, `completeness`, `completenessReasons`, `diagnostics`, resolved identities) | Schema `1.4` adds optional `evidence.arkruleId` / `evidence.arkruleSource` for ArkRules; `1.3` distinguished `resolved-candidate-facts` from `lexical-compatibility`; partial/unavailable analysis is always non-green, and resolved complete/partial results require policy/resolver/facts/tree identities. `1.2` added completeness and remains accepted alongside consumer-owned 1.0/1.1 values. |
|
|
48
|
+
| **`arkgate/schema/arkrules`** or **`arkgate/schema/ark.arkrules.schema.json`** | Per-layer structure sensors + invariant catalog (ADR 0012) | Schema `1.0`. Opt-in via root `arkRules` map (`ark.config` schema `1.1`). |
|
|
46
49
|
| **`arkgate/schema/resolved-candidate-facts`** or **`arkgate/schema/ark.resolved-candidate-facts.schema.json`** | Versioned parity-capable input for `analyzeResolvedProject` / `preflightResolvedChange` | Schema `1.0` is serializable and deterministic. Tooling owns filesystem/compiler resolution; Domain/Kernel validate and evaluate supplied facts without importing those effects. Facts name resolver/compiler inputs, governed files, dependency evidence, completeness reasons, and candidate tree/facts hashes. |
|
|
47
50
|
| **Config JSON Schema** | `arkgate/schema` or `arkgate/schema/ark.config.schema.json` | Stable package resource subpaths for editor completion and contract tooling. |
|
|
48
|
-
| **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) | **Day zero** is the compact router from `ark start` / `start --apply` + doctor control plane — not the full skill pack. Skill *names* and the guided expert path (`/ark-autopilot` after pack install) are stable; internal skill prose may evolve
|
|
51
|
+
| **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) | **Day zero** is the compact router from `ark start` / `start --apply` + doctor control plane — not the full skill pack. Skill *names* and the guided expert path (`/ark-autopilot` after pack install) are stable; internal skill prose may evolve. **4.0:** all skills except experimental `/ark-runtime` integrate **layers + ArkRules** and must label residual `[Layer]` vs `[ArkRules]`. |
|
|
49
52
|
| **ESLint subpath** | `arkgate/eslint` | Config-driven layer/import rules; loads consumer `ark.config.json`. |
|
|
50
53
|
| **GitHub Action** | `pedroknigge/arkgate` (see `action.yml`) | The `uses:` tag/SHA selects the checker source; `version` remains an optional exact npm compatibility override. |
|
|
51
54
|
| **Package metadata** | `arkgate/package.json` | Stable resource subpath for tooling that needs the installed manifest. |
|
|
@@ -138,8 +141,7 @@ product claims**. Static architecture enforcement does not depend on them.
|
|
|
138
141
|
| Surface | Import path | Notes |
|
|
139
142
|
|---------|-------------|--------|
|
|
140
143
|
| **Runtime kernel** | **`@arkgate/runtime`** | Separate 0.x source package configured for the `experimental` tag. It is not currently present in the npm registry, and the root `publish-npm.yml` workflow does not publish it automatically. Event bus, intents, policies, sagas, event buffer, projections, and strict helpers. Built-in stores are **InMemory reference only**. |
|
|
141
|
-
| **
|
|
142
|
-
| **NestJS adapter** | `@arkgate/runtime/nestjs` | Experimental optional peer `@nestjs/common`; the deprecated `arkgate/nestjs` path forwards here. |
|
|
144
|
+
| **NestJS adapter** | `@arkgate/runtime/nestjs` | Experimental optional peer `@nestjs/common`. Root `arkgate/nestjs` and `arkgate/runtime` forwarders were **removed in AR04 / ArkGate 4** — import the companion package directly. |
|
|
143
145
|
|
|
144
146
|
---
|
|
145
147
|
|
|
@@ -155,8 +157,8 @@ import { ArkModule, InjectArk } from '@arkgate/runtime/nestjs';
|
|
|
155
157
|
|
|
156
158
|
These imports describe the intended package boundary. Before an npm evaluation, verify that a
|
|
157
159
|
separate publication exists with `npm view @arkgate/runtime dist-tags --json`. Until it does,
|
|
158
|
-
build `packages/runtime` in an ArkGate source checkout and install that local folder
|
|
159
|
-
|
|
160
|
+
build `packages/runtime` in an ArkGate source checkout and install that local folder. Root
|
|
161
|
+
`arkgate/runtime` / `arkgate/nestjs` forwarders were **removed in 4.0.0** (AR04).
|
|
160
162
|
|
|
161
163
|
See [production-hardening.md](https://github.com/pedroknigge/arkgate/blob/main/docs/production-hardening.md) for requirements an eventual
|
|
162
164
|
production deployment would need to satisfy; it is not a readiness certification.
|
|
@@ -180,13 +182,13 @@ production deployment would need to satisfy; it is not a readiness certification
|
|
|
180
182
|
| New optional config field, new CLI flag, additive JSON | **minor** |
|
|
181
183
|
| Bugfix with no contract change | **patch** |
|
|
182
184
|
| Additive experimental runtime API | `@arkgate/runtime` prerelease/minor |
|
|
183
|
-
| Remove deprecated `arkgate/runtime` forwarding
|
|
185
|
+
| Remove deprecated `arkgate/runtime` / `arkgate/nestjs` forwarding shims | **Done (AR04)** — use `@arkgate/runtime` / `@arkgate/runtime/nestjs` |
|
|
184
186
|
|
|
185
187
|
---
|
|
186
188
|
|
|
187
189
|
## Release notes (maintainers)
|
|
188
190
|
|
|
189
|
-
Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
|
|
190
|
-
[
|
|
191
|
-
[3.9.2.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/3.9.2.md)).
|
|
191
|
+
Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
|
|
192
|
+
(prepared: [4.0.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.0.0.md);
|
|
193
|
+
last published: [3.9.2.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/3.9.2.md)).
|
|
192
194
|
Publish path: signed annotated tag → GitHub Release → `publish-npm.yml` (see [CONTRIBUTING.md](https://github.com/pedroknigge/arkgate/blob/main/CONTRIBUTING.md)).
|
package/docs/product-voice.md
CHANGED
|
@@ -17,11 +17,12 @@ A track so simple a newcomer enters, so strict a senior trusts — and the AI sh
|
|
|
17
17
|
because the design space is small and honest.
|
|
18
18
|
|
|
19
19
|
- **Gate side:** machine-readable contract + write gate + CI. Deterministic. Fail-closed.
|
|
20
|
-
Green must mean something real.
|
|
20
|
+
Green must mean something real. Two planes: **Layers** (inter) always; **ArkRules** (intra)
|
|
21
|
+
opt-in.
|
|
21
22
|
- **Co-pilot side:** where code belongs, who talks to whom, how; dual plan **A** (edges) +
|
|
22
23
|
**B** (shape); one pilot at a time; never silent judgment codemod; never weaken the contract.
|
|
23
24
|
- **False done is forbidden:** Enforce ≠ elegant design. `design-weak` / residual must not
|
|
24
|
-
read as “healthy finished.”
|
|
25
|
+
read as “healthy finished.” Empty ArkRules inventory is not a score.
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -48,6 +49,10 @@ Examples:
|
|
|
48
49
|
| Term | Use for |
|
|
49
50
|
|------|---------|
|
|
50
51
|
| **contract** | `ark.config.json` layers, rules, include — the machine-readable architecture file |
|
|
52
|
+
| **Layers plane** | Inter-layer edges: imports, placement, purity, isolation |
|
|
53
|
+
| **ArkRules** (opt-in) | Intra-layer structure sensors + domain invariant catalogs as data (`arkrules/*`) |
|
|
54
|
+
| **dual-plane residual** | Label findings **`[Layer]`** vs **`[ArkRules]`** — never blur them |
|
|
55
|
+
| **rulesUnderContract** | Doctor/inventory counts for ArkRules — **never a score** |
|
|
51
56
|
| **gate** / **write gate** | Host boundary that blocks or advises on invalid writes |
|
|
52
57
|
| **edges** | Allowed import graph (plan **A** / remediation) |
|
|
53
58
|
| **baseline** | Frozen known debt; does not make a wrong contract honest |
|
|
@@ -90,6 +95,8 @@ Examples:
|
|
|
90
95
|
| “modes you pick” for Suggest/Adapt/Enforce | Those are **status lights**, not settings |
|
|
91
96
|
| Skill-shopping lists as the default curriculum | Progressive disclosure: one door first |
|
|
92
97
|
| “Healthy / done” while design-weak | False done |
|
|
98
|
+
| “ArkRules prove business correctness” | They enforce *declared* structure/coverage evidence, not arbitrary logic |
|
|
99
|
+
| Blurring import edges with invariants | Always label **`[Layer]`** vs **`[ArkRules]`** |
|
|
93
100
|
|
|
94
101
|
---
|
|
95
102
|
|
package/docs/use.md
CHANGED
|
@@ -38,6 +38,15 @@ Full skill pack is **optional** (expert depth). Day-to-day: compact router + doc
|
|
|
38
38
|
|
|
39
39
|
ArkGate is **not** a web framework, ORM, or app runtime. It is architecture enforcement + co-pilot for AI TypeScript.
|
|
40
40
|
|
|
41
|
+
### Two planes (you choose)
|
|
42
|
+
|
|
43
|
+
| Plane | Plain English | Config |
|
|
44
|
+
|-------|---------------|--------|
|
|
45
|
+
| **Layers** | Who may talk to whom (imports, purity) | `ark.config.json` layers + rules |
|
|
46
|
+
| **ArkRules** (optional) | Habits *inside* a layer (aggregates, factories, named invariants) | `arkRules` + `arkrules/<Layer>.json` |
|
|
47
|
+
|
|
48
|
+
Start always gives you **layers**. ArkRules templates may ship with start/init; they begin **advisory** until you promote them. Doctor may show `rulesUnderContract` counts (not a score).
|
|
49
|
+
|
|
41
50
|
---
|
|
42
51
|
|
|
43
52
|
## Status lights (not settings)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkgate",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "ArkGate — architecture co-pilot for AI TypeScript (write gate, CI gate, plan/loop)",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "ArkGate — architecture co-pilot for AI TypeScript (write gate, CI gate, plan/loop; optional ArkRules)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -12,11 +12,6 @@
|
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
|
-
"./runtime": {
|
|
16
|
-
"types": "./compat/runtime.d.ts",
|
|
17
|
-
"import": "./compat/runtime.js",
|
|
18
|
-
"require": "./compat/runtime.cjs"
|
|
19
|
-
},
|
|
20
15
|
"./eslint": {
|
|
21
16
|
"types": "./dist/eslint/index.d.ts",
|
|
22
17
|
"import": "./dist/eslint/index.js",
|
|
@@ -34,11 +29,8 @@
|
|
|
34
29
|
"./schema/ark.enforcement-state.schema.json": "./schemas/ark.enforcement-state.schema.json",
|
|
35
30
|
"./schema/design-delta": "./schemas/ark.design-delta.schema.json",
|
|
36
31
|
"./schema/ark.design-delta.schema.json": "./schemas/ark.design-delta.schema.json",
|
|
37
|
-
"./
|
|
38
|
-
|
|
39
|
-
"import": "./compat/nestjs.js",
|
|
40
|
-
"require": "./compat/nestjs.cjs"
|
|
41
|
-
},
|
|
32
|
+
"./schema/arkrules": "./schemas/ark.arkrules.schema.json",
|
|
33
|
+
"./schema/ark.arkrules.schema.json": "./schemas/ark.arkrules.schema.json",
|
|
42
34
|
"./package.json": "./package.json"
|
|
43
35
|
},
|
|
44
36
|
"bin": {
|
|
@@ -60,7 +52,6 @@
|
|
|
60
52
|
"!bin/lib/graph-cycles.mjs",
|
|
61
53
|
"!bin/lib/safety-diagnostics.mjs",
|
|
62
54
|
"!bin/lib/ts-resolve.mjs",
|
|
63
|
-
"compat",
|
|
64
55
|
"dist",
|
|
65
56
|
"!dist/**/*.d.cts",
|
|
66
57
|
"schemas",
|
|
@@ -155,13 +146,9 @@
|
|
|
155
146
|
"typescript-ark-host": "npm:typescript@6.0.3"
|
|
156
147
|
},
|
|
157
148
|
"peerDependencies": {
|
|
158
|
-
"@arkgate/runtime": ">=0.1.0-experimental.0 <1",
|
|
159
149
|
"typescript": ">=5.0.0 <8"
|
|
160
150
|
},
|
|
161
151
|
"peerDependenciesMeta": {
|
|
162
|
-
"@arkgate/runtime": {
|
|
163
|
-
"optional": true
|
|
164
|
-
},
|
|
165
152
|
"typescript": {
|
|
166
153
|
"optional": true
|
|
167
154
|
}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
],
|
|
92
92
|
"properties": {
|
|
93
93
|
"schemaVersion": {
|
|
94
|
-
"const": "1.
|
|
94
|
+
"const": "1.4"
|
|
95
95
|
},
|
|
96
96
|
"mode": {
|
|
97
97
|
"enum": [
|
|
@@ -238,6 +238,14 @@
|
|
|
238
238
|
"edgeKind": {
|
|
239
239
|
"type": "string",
|
|
240
240
|
"minLength": 1
|
|
241
|
+
},
|
|
242
|
+
"arkruleId": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"minLength": 1
|
|
245
|
+
},
|
|
246
|
+
"arkruleSource": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"minLength": 1
|
|
241
249
|
}
|
|
242
250
|
}
|
|
243
251
|
},
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/arkgate/schemas/ark.arkrules.schema.json",
|
|
4
|
+
"title": "ArkGate ArkRules (intra-layer contract)",
|
|
5
|
+
"description": "Per-layer structure sensors and invariant catalog consumed by the ArkGate Effective Contract.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schemaVersion",
|
|
10
|
+
"layer"
|
|
11
|
+
],
|
|
12
|
+
"properties": {
|
|
13
|
+
"$schema": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1,
|
|
16
|
+
"default": "https://unpkg.com/arkgate/schemas/ark.arkrules.schema.json"
|
|
17
|
+
},
|
|
18
|
+
"schemaVersion": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"const": "1.0",
|
|
21
|
+
"default": "1.0"
|
|
22
|
+
},
|
|
23
|
+
"layer": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"minLength": 1
|
|
26
|
+
},
|
|
27
|
+
"structure": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"default": [],
|
|
30
|
+
"items": {
|
|
31
|
+
"$ref": "#/$defs/structureEntry"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"invariants": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"default": [],
|
|
37
|
+
"items": {
|
|
38
|
+
"$ref": "#/$defs/invariantEntry"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"$defs": {
|
|
43
|
+
"structureEntry": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": [
|
|
47
|
+
"id",
|
|
48
|
+
"sensor"
|
|
49
|
+
],
|
|
50
|
+
"properties": {
|
|
51
|
+
"id": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"minLength": 1
|
|
54
|
+
},
|
|
55
|
+
"sensor": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"enum": [
|
|
58
|
+
"aggregate-private-state",
|
|
59
|
+
"always-valid-factory",
|
|
60
|
+
"domain-event-on-mutation",
|
|
61
|
+
"orchestration-only",
|
|
62
|
+
"thin-adapter",
|
|
63
|
+
"no-anemic-model",
|
|
64
|
+
"invariant-coverage"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"mode": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"enum": [
|
|
70
|
+
"advisory",
|
|
71
|
+
"enforced"
|
|
72
|
+
],
|
|
73
|
+
"default": "advisory"
|
|
74
|
+
},
|
|
75
|
+
"appliesTo": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"minLength": 1
|
|
80
|
+
},
|
|
81
|
+
"uniqueItems": true
|
|
82
|
+
},
|
|
83
|
+
"description": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"invariantEntry": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"required": [
|
|
93
|
+
"id",
|
|
94
|
+
"description"
|
|
95
|
+
],
|
|
96
|
+
"properties": {
|
|
97
|
+
"id": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"minLength": 1
|
|
100
|
+
},
|
|
101
|
+
"description": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"minLength": 1
|
|
104
|
+
},
|
|
105
|
+
"aggregate": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"minLength": 1
|
|
108
|
+
},
|
|
109
|
+
"coverage": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"properties": {
|
|
113
|
+
"test": {
|
|
114
|
+
"type": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"symbol": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"minLength": 1
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"mode": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"enum": [
|
|
125
|
+
"advisory",
|
|
126
|
+
"enforced"
|
|
127
|
+
],
|
|
128
|
+
"default": "advisory"
|
|
129
|
+
},
|
|
130
|
+
"appliesTo": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"minLength": 1
|
|
135
|
+
},
|
|
136
|
+
"uniqueItems": true
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"schemaVersion": {
|
|
23
23
|
"type": "string",
|
|
24
|
-
"const": "1.
|
|
25
|
-
"default": "1.
|
|
24
|
+
"const": "1.1",
|
|
25
|
+
"default": "1.1"
|
|
26
26
|
},
|
|
27
27
|
"name": {
|
|
28
28
|
"type": "string",
|
|
@@ -624,6 +624,14 @@
|
|
|
624
624
|
"allowInMemory": false,
|
|
625
625
|
"allowDisabledPeerIsolation": false
|
|
626
626
|
}
|
|
627
|
+
},
|
|
628
|
+
"arkRules": {
|
|
629
|
+
"type": "object",
|
|
630
|
+
"additionalProperties": {
|
|
631
|
+
"type": "string",
|
|
632
|
+
"minLength": 1
|
|
633
|
+
},
|
|
634
|
+
"default": {}
|
|
627
635
|
}
|
|
628
636
|
},
|
|
629
637
|
"$defs": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json","title":"ArkGate resolved candidate facts","type":"object","additionalProperties":false,"required":["schemaVersion","completeness","completenessReasons","resolverIdentity","compilerIdentity","compilerOptionsHash","tsconfigHash","candidateTreeHash","evidenceRequirementsHash","files","dependencies","capabilityUses","ambientUses","publishCalls","intentReferences","safetyUses","factsHash"],"properties":{"schemaVersion":{"
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json","title":"ArkGate resolved candidate facts","type":"object","additionalProperties":false,"required":["schemaVersion","completeness","completenessReasons","resolverIdentity","compilerIdentity","compilerOptionsHash","tsconfigHash","candidateTreeHash","evidenceRequirementsHash","files","dependencies","capabilityUses","ambientUses","publishCalls","intentReferences","safetyUses","factsHash"],"properties":{"schemaVersion":{"enum":["1.0","1.1"]},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"}}}},"resolverIdentity":{"type":"string","minLength":1},"compilerIdentity":{"type":"string","minLength":1},"compilerOptionsHash":{"type":"string","minLength":1},"tsconfigHash":{"type":"string","minLength":1},"candidateTreeHash":{"type":"string","minLength":1},"evidenceRequirementsHash":{"type":"string","minLength":1},"projectPackageName":{"type":"string","minLength":1},"files":{"type":"array","uniqueItems":true,"items":{"type":"object","additionalProperties":false,"required":["path","contentHash","parseStatus","parseDiagnosticCount","exportsOnlyTypes","typeOnlyExportNames","hasTopLevelSideEffects"],"properties":{"path":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"contentHash":{"type":"string","minLength":1},"parseStatus":{"enum":["parsed","invalid"]},"parseDiagnosticCount":{"type":"integer","minimum":0},"exportsOnlyTypes":{"type":"boolean"},"typeOnlyExportNames":{"type":"array","items":{"type":"string","minLength":1}},"hasTopLevelSideEffects":{"type":"boolean"}},"allOf":[{"if":{"properties":{"parseStatus":{"const":"parsed"}}},"then":{"properties":{"parseDiagnosticCount":{"const":0}}}},{"if":{"properties":{"parseStatus":{"const":"invalid"}}},"then":{"properties":{"parseDiagnosticCount":{"minimum":1}}}}]}},"dependencies":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","kind","typeOnly","line","resolution"],"properties":{"from":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"specifier":{"type":"string","minLength":1},"kind":{"enum":["import","export","dynamic-import","require"]},"typeOnly":{"type":"boolean"},"line":{"type":"integer","minimum":1},"resolution":{"enum":["resolved-project","resolved-external","unresolved","dynamic"]},"target":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"namedBindings":{"type":"array","items":{"type":"string","minLength":1}},"targetTypeOnlyExports":{"type":"boolean"},"sourcePureTypeModule":{"type":"boolean"},"namedBindingsTypeOnly":{"type":"boolean"},"portProofEligible":{"type":"boolean"}},"allOf":[{"if":{"properties":{"resolution":{"const":"resolved-project"}}},"then":{"required":["target"]},"else":{"not":{"required":["target"]}}},{"if":{"properties":{"resolution":{"const":"dynamic"}}},"else":{"required":["specifier"]}}]}},"capabilityUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol","capability","source"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1},"capability":{"enum":["network","filesystem","clock","randomness","environment","process","persistence"]},"source":{"enum":["ambient-global","import-based"]}}}},"ambientUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1}}}},"publishCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","objectHasIntent","arkPublishCandidate","hasSource"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"rawIntentName":{"type":"string","minLength":1},"objectHasIntent":{"type":"boolean"},"arkPublishCandidate":{"type":"boolean"},"hasSource":{"type":"boolean"},"sourceIntent":{"type":"string","minLength":1}}}},"intentReferences":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","intent"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"intent":{"type":"string","minLength":1}}}},"safetyUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["ts-suppression","any-cast","dynamic-import","dynamic-require","in-memory-store"]},"symbol":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"kind":{"const":"in-memory-store"}}},"then":{"required":["symbol"]},"else":{"not":{"required":["symbol"]}}}]}},"classShapes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","className","exported","hasPublicMutableFields","hasPublicSetters","hasPublicConstructor","hasStaticFactory","mutatingMethods"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"className":{"type":"string","minLength":1},"exported":{"type":"boolean"},"hasPublicMutableFields":{"type":"boolean"},"hasPublicSetters":{"type":"boolean"},"hasPublicConstructor":{"type":"boolean"},"hasStaticFactory":{"type":"boolean"},"dataOnly":{"type":"boolean"},"mutatingMethods":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","referencesGuardOrPublish"],"properties":{"name":{"type":"string","minLength":1},"referencesGuardOrPublish":{"type":"boolean"}}}}}}},"factsHash":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"completeness":{"const":"complete"}}},"then":{"properties":{"completenessReasons":{"maxItems":0},"files":{"items":{"properties":{"parseStatus":{"const":"parsed"}}}}}}},{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}}},"then":{"properties":{"completenessReasons":{"minItems":1}}}}]}
|