arkgate 4.7.6 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +28 -3
  2. package/README.md +8 -9
  3. package/bin/lib/analysis-engine.mjs +6 -6
  4. package/bin/lib/ark-order-error.mjs +18 -0
  5. package/bin/lib/ark-order-facts.mjs +53 -0
  6. package/bin/lib/ark-order-invariants.mjs +160 -0
  7. package/bin/lib/ark-order-sensors.mjs +118 -0
  8. package/bin/lib/ark-order-types.mjs +11 -0
  9. package/bin/lib/ark-run-sensors.mjs +13 -5
  10. package/bin/lib/config-contract.mjs +16 -72
  11. package/bin/lib/config-extras.mjs +151 -0
  12. package/bin/lib/diagnostic-catalog.mjs +7 -2
  13. package/bin/lib/extra-merge-teeth.mjs +8 -2
  14. package/bin/lib/install-migrate.mjs +4 -2
  15. package/bin/lib/managed-upgrade.mjs +1 -1
  16. package/bin/lib/mcp-adoption.mjs +9 -3
  17. package/bin/lib/remediation.mjs +48 -9
  18. package/bin/lib/resolved-candidate-facts.mjs +43 -0
  19. package/bin/lib/skill-install.mjs +17 -2
  20. package/bin/lib/start-preview.mjs +1 -0
  21. package/bin/lib/status-manifest.mjs +1 -1
  22. package/bin/lib/write-path-capabilities.mjs +2 -2
  23. package/dist/{configTypes-CgJimx9o.d.ts → configTypes-BdCe_gvv.d.ts} +22 -6
  24. package/dist/diagnosticCatalog-RiKPUFRG.d.ts +2307 -0
  25. package/dist/eslint/index.cjs +7 -6
  26. package/dist/eslint/index.d.ts +33 -2
  27. package/dist/eslint/index.js +7 -6
  28. package/dist/index.cjs +35 -35
  29. package/dist/index.d.ts +271 -2554
  30. package/dist/index.js +35 -35
  31. package/dist/nestjs/index.cjs +18 -0
  32. package/dist/nestjs/index.d.ts +24 -0
  33. package/dist/nestjs/index.js +18 -0
  34. package/dist/order/index.cjs +1 -0
  35. package/dist/order/index.d.ts +79 -0
  36. package/dist/order/index.js +1 -0
  37. package/dist/runtime/index.cjs +25 -0
  38. package/dist/runtime/index.d.ts +497 -0
  39. package/dist/runtime/index.js +25 -0
  40. package/dist/types-C9KApBzX.d.ts +1237 -0
  41. package/dist/types-DCSlrRnV.d.ts +181 -0
  42. package/docs/README.md +4 -4
  43. package/docs/agent-guide.md +1 -1
  44. package/docs/ai-gates.md +9 -2
  45. package/docs/configuration.md +13 -6
  46. package/docs/develop.md +4 -3
  47. package/docs/diagnostics.md +57 -3
  48. package/docs/package-surface.md +20 -16
  49. package/docs/product-voice.md +2 -1
  50. package/package.json +21 -2
  51. package/schemas/ark.config.schema.json +54 -2
  52. package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
  53. package/server.json +2 -2
  54. package/templates/agent-skills/README.md +1 -1
  55. package/templates/agent-skills/ark-adopt/SKILL.md +2 -2
  56. package/templates/agent-skills/ark-contract/SKILL.md +1 -1
  57. package/templates/agent-skills/ark-place/SKILL.md +15 -6
  58. package/templates/agent-skills/ark-runtime/SKILL.md +10 -15
  59. package/templates/skills/ark-adopt.md +2 -2
  60. package/templates/skills/ark-contract.md +1 -1
  61. package/templates/skills/ark-place.md +15 -6
  62. package/templates/skills/ark-runtime.md +10 -15
@@ -0,0 +1,181 @@
1
+ import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-BdCe_gvv.js';
2
+
3
+ /**
4
+ * Policy types for the Ark kernel.
5
+ *
6
+ * Policies allow declaring architectural rules that can be checked at runtime.
7
+ * Supports both hard policies (must never be violated) and soft policies (warnings).
8
+ */
9
+ type PolicySeverity = 'hard' | 'soft';
10
+ type PolicyEnforcementMode = 'runtime' | 'static' | 'runtime-and-static' | 'advisory';
11
+ /**
12
+ * Represents a single violation of a policy.
13
+ */
14
+ interface PolicyViolation {
15
+ /** Name of the policy that was violated */
16
+ policyName: string;
17
+ /** Severity level of the policy */
18
+ severity: PolicySeverity;
19
+ /** Human-readable explanation of the violation */
20
+ message: string;
21
+ /** Optional additional structured details */
22
+ details?: unknown;
23
+ }
24
+ /**
25
+ * A Policy defines a rule that can be evaluated against a context.
26
+ *
27
+ * @template Context - The shape of data the policy evaluates (e.g. { registry, events })
28
+ */
29
+ interface Policy<Context = unknown> {
30
+ /** Unique name of the policy (used in violations and reporting) */
31
+ readonly name: string;
32
+ /** Whether this is a hard rule (enforced strictly) or soft (advisory) */
33
+ readonly severity: PolicySeverity;
34
+ /** Optional tags for policy classification (e.g. 'layer', 'naming') */
35
+ readonly tags?: readonly string[];
36
+ readonly owner?: string;
37
+ readonly version?: string;
38
+ readonly rationale?: string;
39
+ readonly enforcementMode?: PolicyEnforcementMode;
40
+ readonly deprecated?: boolean | string;
41
+ readonly replacedBy?: string;
42
+ /**
43
+ * Evaluates the policy against the given context.
44
+ * Return true / [] for pass, false / single violation / array for failure.
45
+ */
46
+ check(context: Context): boolean | PolicyViolation | PolicyViolation[];
47
+ }
48
+
49
+ /**
50
+ * Core domain primitives for Ark.
51
+ * These types are the foundation for all governance concepts.
52
+ */
53
+ /**
54
+ * Semantic intent names follow a convention:
55
+ * - Domain.* for domain events and entities
56
+ * - Application.* for use-cases / orchestration
57
+ * - Adapter.* for integration points
58
+ * - Workflow.* for sagas and processes
59
+ * - Job.* for background jobs and scheduling
60
+ * - Presentation.* for UI/API adapters
61
+ * - Reporting.* for read models and projections
62
+ * - Metadata.* for extensibility contracts
63
+ * - Security.* / Audit.* / Observability.* for cross-cutting kernel concerns
64
+ * - Kernel.* for Ark-owned governance signals
65
+ */
66
+ type IntentName = `Domain.${string}` | `Application.${string}` | `Adapter.${string}` | `Workflow.${string}` | `Job.${string}` | `Presentation.${string}` | `Reporting.${string}` | `Metadata.${string}` | `Security.${string}` | `Audit.${string}` | `Observability.${string}` | `Kernel.${string}`;
67
+ type CorrelationId = string;
68
+ interface EventMetadata {
69
+ occurredAt: string;
70
+ source: string;
71
+ kernelInstanceId?: string;
72
+ eventVersion?: string;
73
+ schemaVersion?: string;
74
+ allowInterception?: boolean;
75
+ interceptions?: Array<{
76
+ interceptorId: string;
77
+ timestamp: string;
78
+ }>;
79
+ correlationId?: CorrelationId;
80
+ causationId?: string;
81
+ traceId?: string;
82
+ spanId?: string;
83
+ parentSpanId?: string;
84
+ [key: string]: unknown;
85
+ }
86
+ interface DomainEvent<Name extends IntentName = IntentName, Payload = unknown> {
87
+ intent: Name;
88
+ payload: Payload;
89
+ metadata: EventMetadata;
90
+ }
91
+
92
+ /**
93
+ * Intent-specific types for the Ark kernel.
94
+ *
95
+ * Intents provide semantic naming for every important concept in the system
96
+ * (domain events, application operations, adapters, workflows).
97
+ */
98
+
99
+ /**
100
+ * An IntentCreator is a callable that creates a strongly-typed DomainEvent
101
+ * when invoked with a payload.
102
+ *
103
+ * It also carries the semantic `name`.
104
+ *
105
+ * @example
106
+ * const OrderPlaced = defineIntent<'Domain.Order.OrderPlaced', { orderId: string }>('Domain.Order.OrderPlaced');
107
+ * const event = OrderPlaced({ orderId: 'o-1' });
108
+ */
109
+ interface IntentCreator<Name extends IntentName, Payload = unknown> {
110
+ /**
111
+ * Creates a DomainEvent for this intent.
112
+ */
113
+ (payload: Payload): DomainEvent<Name, Payload>;
114
+ /**
115
+ * The fully-qualified semantic name of the intent (e.g. "Domain.Order.OrderPlaced").
116
+ */
117
+ readonly name: Name;
118
+ }
119
+ /** Kind of relationship between two intents. */
120
+ type IntentRelationshipKind = 'dependsOn' | 'produces';
121
+ /**
122
+ * Relationship declarations between intents.
123
+ * Used for dependency analysis and graph generation.
124
+ */
125
+ interface IntentRelationship {
126
+ from: string;
127
+ to: string;
128
+ kind: IntentRelationshipKind;
129
+ }
130
+
131
+ /**
132
+ * Architecture layer profiles.
133
+ *
134
+ * A profile turns semantic names such as `Domain.Order.Placed` into governed
135
+ * layer names and dependency rules.
136
+ */
137
+
138
+ interface ArchitectureLayer {
139
+ name: string;
140
+ prefixes: string[];
141
+ /**
142
+ * Custom matcher for teams whose intent names don't follow prefix conventions.
143
+ * Checked before any prefix matching, in layer declaration order. A layer may
144
+ * use `match` alone (with `prefixes: []`), prefixes alone, or both.
145
+ */
146
+ match?: (name: string) => boolean;
147
+ description?: string;
148
+ order?: number;
149
+ }
150
+ type ArchitectureRule = ArkConfigRule;
151
+ interface ArchitectureProfile {
152
+ name: string;
153
+ layers: ArchitectureLayer[];
154
+ rules: ArchitectureRule[];
155
+ resolveLayer(name: string): string | undefined;
156
+ }
157
+ interface CreateArchitectureProfileOptions {
158
+ name: string;
159
+ layers: ArchitectureLayer[];
160
+ rules?: ArchitectureRule[];
161
+ }
162
+ interface CreateArchitectureProfileFromArkConfigOptions {
163
+ /** Runtime profile name. Default: config.name or "ark.config.json". */
164
+ name?: string;
165
+ }
166
+ type ArchitectureLayerConfig = ArkConfigLayer;
167
+ type ArkCheckConfig = Omit<ArkConfig, '$schema' | 'schemaVersion' | 'rules'> & {
168
+ $schema?: string;
169
+ schemaVersion?: ArkConfig['schemaVersion'];
170
+ rules?: ArchitectureRule[];
171
+ };
172
+ interface CreateElevenLayerArkConfigOptions {
173
+ /** Source root used in generated file patterns. Default: "src". */
174
+ rootDir?: string;
175
+ /** Include entries for ark-check. Default: [rootDir]. */
176
+ include?: string[];
177
+ /** Mark generated layers optional. Default: true. */
178
+ optionalLayers?: boolean;
179
+ }
180
+
181
+ export type { ArchitectureLayer as A, CreateArchitectureProfileFromArkConfigOptions as C, DomainEvent as D, EventMetadata as E, IntentName as I, PolicyViolation as P, ArchitectureLayerConfig as a, ArchitectureProfile as b, ArchitectureRule as c, ArkCheckConfig as d, CreateArchitectureProfileOptions as e, CreateElevenLayerArkConfigOptions as f, PolicySeverity as g, PolicyEnforcementMode as h, Policy as i, IntentCreator as j, IntentRelationship as k, CorrelationId as l, IntentRelationshipKind as m };
package/docs/README.md CHANGED
@@ -57,13 +57,13 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
57
57
  | Area | Path |
58
58
  |------|------|
59
59
  | Release notes (by version) | [releases/](releases/) · npm [CHANGELOG.md](../CHANGELOG.md) (Unreleased + 4.6.x) · [pre-4.6 archive](archive/CHANGELOG-pre-4.6.md) |
60
- | Epic plans | [plans/](plans/) — maintainer seeds, not required to use the package. Live: [alive-in-six-months](plans/alive-in-six-months/README.md) (`AL01`–`AL04` done; `AL05` parked). [arkrun](plans/arkrun/README.md) (Phase RN; `RN01`–`RN17` done; shipped **4.7.0** + companion **4.7.4**; ADRs [0020](adr/0020-arkrun-gated-extra-plane.md)–[0024](adr/0024-arkrun-transport-ports.md) accepted). [one-catalog-one-root](plans/one-catalog-one-root/README.md) (Phase HS; `HS01`–`HS05` done; shipped **4.7.1**). |
60
+ | Epic plans | [plans/](plans/) — maintainer seeds, not required to use the package. Live: [alive-in-six-months](plans/alive-in-six-months/README.md) (`AL01`–`AL04` done; `AL05` parked). [arkrun](plans/arkrun/README.md) (Phase RN; `RN01`–`RN17` done; shipped **4.7.0** + companion **4.7.4**; ADRs [0020](adr/0020-arkrun-gated-extra-plane.md)–[0024](adr/0024-arkrun-transport-ports.md) accepted). [one-catalog-one-root](plans/one-catalog-one-root/README.md) (Phase HS; `HS01`–`HS05` done; shipped **4.7.1**). [arkorder](plans/arkorder/README.md) (Phase OR; `OR01`–`OR07` done; shipped **4.8.0**; extra **inside** package `arkgate` as `arkgate/order`; ADRs [0027](adr/0027-arkorder-gated-extra-plane.md)–[0031](adr/0031-one-package-extras-deprecate-companion.md)). |
61
61
  | Claims audit | [audit/claims-matrix.md](audit/claims-matrix.md) |
62
62
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
63
63
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
64
64
 
65
- Current published: [releases/4.7.5.md](releases/4.7.5.md) (`arkgate@4.7.5` on npm `latest`).
66
- Prior: [releases/4.7.4.md](releases/4.7.4.md) · [4.7.3](releases/4.7.3.md) · [4.7.2](releases/4.7.2.md) · [4.7.1](releases/4.7.1.md) · [4.7.0](releases/4.7.0.md) · [4.6.7](releases/4.6.7.md) · [4.6.6](releases/4.6.6.md) · [4.6.5](releases/4.6.5.md) · [4.6.4](releases/4.6.4.md) · [4.6.3](releases/4.6.3.md) · [4.6.2](releases/4.6.2.md) · [4.6.1](releases/4.6.1.md) · [4.6.0](releases/4.6.0.md).
65
+ Current published: [releases/4.8.0.md](releases/4.8.0.md) (`arkgate@4.8.0` on npm `latest`; does not close `K01`).
66
+ Prior: [releases/4.7.6.md](releases/4.7.6.md) · [4.7.5](releases/4.7.5.md) · [4.7.4](releases/4.7.4.md) · [4.7.3](releases/4.7.3.md) · [4.7.2](releases/4.7.2.md) · [4.7.1](releases/4.7.1.md) · [4.7.0](releases/4.7.0.md) · [4.6.7](releases/4.6.7.md) · [4.6.6](releases/4.6.6.md) · [4.6.5](releases/4.6.5.md) · [4.6.4](releases/4.6.4.md) · [4.6.3](releases/4.6.3.md) · [4.6.2](releases/4.6.2.md) · [4.6.1](releases/4.6.1.md) · [4.6.0](releases/4.6.0.md).
67
67
  Older notes: [releases/](releases/). Config: [configuration.md](configuration.md).
68
68
 
69
69
  ---
@@ -74,4 +74,4 @@ Older notes: [releases/](releases/). Config: [configuration.md](configuration.md
74
74
  2. **One primary flow** — `start` → doctor → optional guided work.
75
75
  3. **Honest hardness** — host write guarantees differ; a **required GitHub status context** running the merge CLI is the shared hard boundary.
76
76
  4. **History is not the product** — version archaeology lives under `releases/` and `plans/`, not the front door.
77
- 5. **Common language** — first-contact copy uses ordinary software words (import rules, the write doesn’t land, required CI). ArkGate is import rules; ArkRules is policies; ArkRun is an experimental runtime. Voice: [product-voice.md](product-voice.md).
77
+ 5. **Common language** — first-contact copy uses ordinary software words (import rules, the write doesn’t land, required CI). ArkGate is import rules; ArkRules is policies; ArkRun is an experimental runtime; ArkOrder is an optional pattern extra in the same npm package. Voice: [product-voice.md](product-voice.md).
@@ -631,7 +631,7 @@ npx arkgate-check --install-agent-gates --tools claude,cursor,codex,grok,antigra
631
631
  | Cursor | `.cursor/mcp.json` + `.cursor/rules/ark.mdc` | **Repo:** `.agents/skills/<name>/SKILL.md` (same catalog as Codex). Do not also copy into `.cursor/commands/` or `$CODEX_HOME/skills` — Cursor lists every path it scans. |
632
632
  | OpenAI Codex | `.codex/config.toml` (project primary, relative `--root .`; configured on disk is not runtime-active until restart + `ark_identity` match); optional legacy `$CODEX_HOME/config.toml` fallback uses absolute roots and scoped secondaries — see [ai-gates.md](ai-gates.md) | **Repo:** `.agents/skills/<name>/SKILL.md`; **home:** `$CODEX_HOME/skills/<name>/SKILL.md` (`--codex-home`) |
633
633
  | **Grok Build** | `.grok/hooks/ark-write-gate.json` + `.grok/config.toml` / `.mcp.json` | **Repo:** `.grok/skills/<name>/SKILL.md`; **home:** `$GROK_HOME/skills` (default `~/.grok/skills`, `--grok-home`) |
634
- | Google Antigravity | `.agents/hooks.json` (+ `GEMINI.md` for shared Gemini consumers) | `.agents/skills/<name>/SKILL.md` |
634
+ | Google Antigravity | `.agents/hooks.json` + `.agents/mcp_config.json` (+ `GEMINI.md` for shared Gemini consumers) | `.agents/skills/<name>/SKILL.md` |
635
635
  | OpenCode | `opencode.json` MCP (`type: local`; advisory) | `.opencode/skills/<name>/SKILL.md` |
636
636
 
637
637
  This is a path reference, not a guarantee table. Full copy-paste setups:
package/docs/ai-gates.md CHANGED
@@ -63,7 +63,8 @@ npx arkgate-check --install-agent-gates
63
63
 
64
64
  The command writes templates for `.mcp.json`, Claude hooks, Cursor MCP/rules,
65
65
  GitHub Actions, `AGENTS.md`, Codex `.codex/hooks.json` plus a TOML snippet under `docs/`, and (when
66
- selected) Grok Build project files under `.grok/`, Antigravity `.agents/hooks.json`, and OpenCode
66
+ selected) Grok Build project files under `.grok/`, Antigravity `.agents/hooks.json` plus
67
+ `.agents/mcp_config.json`, and OpenCode
67
68
  `opencode.json` MCP registration. It skips existing files unless
68
69
  you pass `--force`, so review and commit only the templates that match your project.
69
70
 
@@ -577,6 +578,11 @@ Antigravity loads project hooks from **`.agents/hooks.json`** (also
577
578
  `~/.gemini/config/hooks.json` for user-global). Official PreToolUse **`decision: "deny"`** is a
578
579
  hard block for matched tools.
579
580
 
581
+ Workspace MCP is **`.agents/mcp_config.json`** (also `~/.gemini/config/mcp_config.json` /
582
+ `~/.gemini/antigravity/mcp_config.json` for user-global). Antigravity does **not** load
583
+ repo-root `.mcp.json`. Opening a repo does not write these files — run the installer, trust
584
+ project hooks, then refresh MCP (`/mcp`) or restart.
585
+
580
586
  Install:
581
587
 
582
588
  ```bash
@@ -588,9 +594,10 @@ npx ark-check --install-agent-gates --tools agy
588
594
  | File | Role |
589
595
  |------|------|
590
596
  | `.agents/hooks.json` | Named hook `ark-write-gate` with PreToolUse on write tools |
597
+ | `.agents/mcp_config.json` | Official workspace MCP (`mcpServers.ark` stdio) |
591
598
  | `GEMINI.md` | Instruction rule for Gemini CLI / legacy consumers sharing the tree |
592
599
  | `.agents/skills/*/SKILL.md` | Agent Skills catalog (shared path with Codex) |
593
- | `AGENTS.md` + `.mcp.json` + CI | Shared with other hosts |
600
+ | `AGENTS.md` + `.mcp.json` + CI | Shared with other hosts (`.mcp.json` is not the Antigravity MCP path) |
594
601
 
595
602
  **Write tools covered:** `write_to_file`, `replace_file_content`, `multi_replace_file_content`.
596
603
  `ark-mcp --hook` accepts the Antigravity stdin shape (`toolCall.name` / `toolCall.args` with
@@ -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.2",
13
+ "schemaVersion": "1.3",
14
14
  "include": ["src"],
15
15
  "layers": [],
16
16
  "rules": []
@@ -20,10 +20,12 @@ The CLI, MCP server, and ESLint plugin all use the same parser, migration, defau
20
20
  `$schema` is for editor completion. `schemaVersion` controls ArkGate's runtime contract and is
21
21
  independent from the npm package version. Schema **`1.1`** is additive over `1.0` and adds the
22
22
  optional top-level **`arkRules`** map (ADR 0012). Schema **`1.2`** is additive over `1.1` and
23
- adds the optional top-level **`arkRun`** extra (ADR 0020). Absence of `arkRules` or `arkRun`
24
- changes no Layers / ArkRules verdict. Per-layer structure/invariant files use sibling schema
25
- `arkgate/schema/arkrules` (`schemas/ark.arkrules.schema.json`). ArkRun v1 stays **inline**
26
- (no sibling file).
23
+ adds the optional top-level **`arkRun`** extra (ADR 0020). Schema **`1.3`** is additive over
24
+ `1.2` and adds the optional top-level **`arkOrder`** extra (ADR 0027). Absence of `arkRules`,
25
+ `arkRun`, or `arkOrder` changes no Layers / ArkRules verdict. Per-layer structure/invariant
26
+ files use sibling schema `arkgate/schema/arkrules` (`schemas/ark.arkrules.schema.json`).
27
+ ArkRun and ArkOrder v1 stay **inline** (no sibling file). The plane factory is
28
+ `arkgate/order` in the same npm package — not a second install.
27
29
 
28
30
  For offline editor completion, point `$schema` at the installed file instead:
29
31
 
@@ -41,7 +43,7 @@ The same schema is exported through the stable package subpaths `arkgate/schema`
41
43
  ## Compatibility and migration
42
44
 
43
45
  Configs without `schemaVersion` are the legacy shape shipped through ArkGate 1.x and early 2.x.
44
- The loader deterministically projects them through `unversioned → 1.0 → 1.1 → 1.2` in memory by adding
46
+ The loader deterministically projects them through `unversioned → 1.0 → 1.1 → 1.2 → 1.3` in memory by adding
45
47
  contract metadata and the established defaults. It never rewrites the user's file during a check.
46
48
  Newly generated
47
49
  configs always contain the metadata, and unsupported future versions fail at
@@ -96,6 +98,11 @@ Top-level fields:
96
98
  is a policy-delta **weakening**. Enforced extra teeth share the CLI / MCP / hook /
97
99
  preflight / CI verdict and arm only when the layer plane is classified (same ≥50%
98
100
  governed and ≥1 populated-layer floor as ArkRules).
101
+ - **`arkOrder`** (optional, schema `1.3+`) — inline ArkOrder extra (`mode`, `planeRoots`,
102
+ `managedLayers`, `maxXiKeys`). Absence is silent. Unknown keys fail closed.
103
+ Import `createOrderPlane` from `arkgate/order` (same package). Empty `planeRoots` in
104
+ `enforced` mode fails closed (`ARKORDER_MISSING_PLANE`). Demotion or deletion is a
105
+ policy-delta **weakening**. Haken: few slow keys (ξ); field ingest never mints a pattern.
99
106
 
100
107
  Layer fields:
101
108
 
package/docs/develop.md CHANGED
@@ -176,10 +176,11 @@ Gates need **no** runtime kernel. Optional **`arkRun`** on `ark.config.json` (sc
176
176
  is a *gate* extra: kernel usage + complete declarations on the same write/CI plane as
177
177
  Layers and ArkRules. Absence is silent. Compact starters leave it off.
178
178
 
179
- The companion **ArkRun** kernel (`@arkgate/runtime`) is experimental, a separate package,
179
+ The **ArkRun** kernel (`arkgate/runtime`) is experimental, an opt-in extra of package `arkgate`,
180
180
  and not the day-zero product. `createStrictArkKernel` is the factory (per instance; no
181
- process-wide singleton). The kernel is not bundled in the `arkgate` tarball. Built-in
182
- stores are in-memory **reference only** — not production durability; `K01` stays parked.
181
+ process-wide singleton). The kernel ships as `arkgate/runtime` in the same tarball.
182
+ `@arkgate/runtime` is deprecated. Built-in stores are in-memory **reference only** —
183
+ not production durability; `K01` stays parked.
183
184
  See [configuration.md](configuration.md), [package-surface.md](package-surface.md), and
184
185
  [production-hardening.md](production-hardening.md).
185
186
 
@@ -51,6 +51,11 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
51
51
  | [`ARKRUN_UNDECLARED_HANDLE`](#ARKRUN_UNDECLARED_HANDLE) | arkrun | Handle name not in reactsTo |
52
52
  | [`ARKRUN_UNDECLARED_DEPEND`](#ARKRUN_UNDECLARED_DEPEND) | arkrun | Depend name not in uses |
53
53
  | [`ARKRUN_TRANSPORT_BYPASS`](#ARKRUN_TRANSPORT_BYPASS) | arkrun | Homemade broker or emitter import |
54
+ | [`ARKORDER_MISSING_PLANE`](#ARKORDER_MISSING_PLANE) | arkorder | No createOrderPlane in plane roots |
55
+ | [`ARKORDER_KERNEL_IN_DOMAIN`](#ARKORDER_KERNEL_IN_DOMAIN) | arkorder | Domain-role layer imports the order plane |
56
+ | [`ARKORDER_GENERIC_UPDATE`](#ARKORDER_GENERIC_UPDATE) | arkorder | Generic update of ξ |
57
+ | [`ARKORDER_TOO_MANY_PARAMS`](#ARKORDER_TOO_MANY_PARAMS) | arkorder | Too many slow keys |
58
+ | [`ARKORDER_INGEST_WRITES_XI`](#ARKORDER_INGEST_WRITES_XI) | arkorder | ingest assigned into ξ |
54
59
  | [`INVALID_CHANGE_PATH`](#INVALID_CHANGE_PATH) | preflight | Unsafe change path |
55
60
  | [`DUPLICATE_CHANGE_PATH`](#DUPLICATE_CHANGE_PATH) | preflight | Duplicate path in change set |
56
61
  | [`DELETE_TARGET_MISSING`](#DELETE_TARGET_MISSING) | preflight | Delete target missing |
@@ -290,7 +295,7 @@ Live adapters specialize `nextAction` with the call-site name or specifier when
290
295
  **No kernel factory in composition roots**
291
296
 
292
297
  - **Why:** The ArkRun extra is on but no createArkKernel / createStrictArkKernel / createArkKernelFromConfig / createStrictArkKernelFromConfig factory was found in arkRun.compositionRoots, so agents can skip the kernel while the write gate stays green.
293
- - **Fix:** Import createStrictArkKernel from @arkgate/runtime (never a removed arkgate/runtime shim) and call it in a composition root listed in arkRun.compositionRoots, then preflight again. Never mechanical-safe — factory placement is a design decision.
298
+ - **Fix:** Import createStrictArkKernel from arkgate/runtime (same npm package; @arkgate/runtime is deprecated) and call it in a composition root listed in arkRun.compositionRoots, then preflight again. Never mechanical-safe — factory placement is a design decision.
294
299
 
295
300
  <a id="ARKRUN_KERNEL_IN_DOMAIN"></a>
296
301
 
@@ -298,8 +303,8 @@ Live adapters specialize `nextAction` with the call-site name or specifier when
298
303
 
299
304
  **Domain-role layer imports the kernel**
300
305
 
301
- - **Why:** A Domain-role layer imports @arkgate/runtime or kernel types. Domain stays kernel-free; composition roots and adapters own the factory.
302
- - **Fix:** Move the kernel import out of the Domain-role layer into a composition root or adapter. Import from @arkgate/runtime, never a removed arkgate/runtime shim, then preflight again. Never mechanical-safe.
306
+ - **Why:** A Domain-role layer imports arkgate/runtime, @arkgate/runtime, or kernel types. Domain stays kernel-free; composition roots and adapters own the factory.
307
+ - **Fix:** Move the kernel import out of the Domain-role layer into a composition root or adapter. Import from arkgate/runtime (same npm package; @arkgate/runtime is deprecated), then preflight again. Never mechanical-safe.
303
308
 
304
309
  <a id="ARKRUN_DIRECT_NEW"></a>
305
310
 
@@ -346,6 +351,55 @@ Live adapters specialize `nextAction` with the call-site name or specifier when
346
351
  - **Why:** A managed layer imports a closed broker/queue/emitter specifier (EventEmitter, queue clients, …) instead of the ArkRun kernel transport.
347
352
  - **Fix:** Send through the ArkRun kernel transport instead of importing that broker or emitter, then preflight again. Never mechanical-safe — homemade buses stay judgment.
348
353
 
354
+ ## ArkOrder (opt-in extra)
355
+
356
+ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest never mints a pattern.
357
+
358
+ <a id="ARKORDER_MISSING_PLANE"></a>
359
+
360
+ ### `ARKORDER_MISSING_PLANE`
361
+
362
+ **No createOrderPlane in plane roots**
363
+
364
+ - **Why:** The ArkOrder extra is on but no createOrderPlane factory was found in arkOrder.planeRoots, so agents can skip the pattern plane while the write gate stays green.
365
+ - **Fix:** Import createOrderPlane from arkgate/order and call it in a plane root listed in arkOrder.planeRoots, then preflight again. Never mechanical-safe — factory placement is a design decision.
366
+
367
+ <a id="ARKORDER_KERNEL_IN_DOMAIN"></a>
368
+
369
+ ### `ARKORDER_KERNEL_IN_DOMAIN`
370
+
371
+ **Domain-role layer imports the order plane**
372
+
373
+ - **Why:** A Domain-role layer imports arkgate/order. Domain stays plane-free; planeRoots own the factory.
374
+ - **Fix:** Move the arkgate/order import out of the Domain-role layer into a plane root or adapter, then preflight again. Never mechanical-safe.
375
+
376
+ <a id="ARKORDER_GENERIC_UPDATE"></a>
377
+
378
+ ### `ARKORDER_GENERIC_UPDATE`
379
+
380
+ **Generic update of ξ**
381
+
382
+ - **Why:** A call to update/patch/set on the order plane rewrites the slow pattern. Haken slaving forbids generic ξ mutation.
383
+ - **Fix:** Use release() to freeze ξ or proposeRelease() for a pattern change with blast radius, then preflight again. Never mechanical-safe.
384
+
385
+ <a id="ARKORDER_TOO_MANY_PARAMS"></a>
386
+
387
+ ### `ARKORDER_TOO_MANY_PARAMS`
388
+
389
+ **Too many slow keys**
390
+
391
+ - **Why:** ξ has more keys than arkOrder.maxXiKeys. Haken requires a few slow modes, not a dump of microstate.
392
+ - **Fix:** Cut ξ to the slow keys that actually slave the rest, then preflight again. Never mechanical-safe.
393
+
394
+ <a id="ARKORDER_INGEST_WRITES_XI"></a>
395
+
396
+ ### `ARKORDER_INGEST_WRITES_XI`
397
+
398
+ **ingest assigned into ξ**
399
+
400
+ - **Why:** An ingest() result is written into a Release or ξ store. ingest may absorb or escalate; it never mints a pattern.
401
+ - **Fix:** Keep ingest results as absorb/escalate only. Change ξ with proposeRelease + release. Never mechanical-safe.
402
+
349
403
  ## Atomic preflight and change sets
350
404
 
351
405
  <a id="INVALID_CHANGE_PATH"></a>
@@ -3,7 +3,13 @@
3
3
  **Write. Check. Ship.**
4
4
  **When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.**
5
5
  That is the product wedge (host hook + required CI). Skills name the next step after that.
6
- **Not the wedge:** the optional in-process **ArkRun** runtime (`@arkgate/runtime`).
6
+ **Not the wedge:** the optional in-process **ArkRun** runtime (`arkgate/runtime`).
7
+
8
+ The check that must agree everywhere is small ([ADR 0026](adr/0026-gate-waist-facts-in-verdict-out.md)):
9
+ `ark.config.json` + resolved-candidate-facts → one analysis-result (`valid`).
10
+ CLI, MCP, hook, ESLint, and CI are adapters around that waist. Doctor advisory
11
+ sections project those facts; they are not a second check and never flip `valid`.
12
+ Skills name the next step after the check.
7
13
 
8
14
  **Public product site:** [arkgate.online](https://www.arkgate.online/) (promise + only flow).
9
15
  In-repo `docs/` remains the package/agent reference. Source: GitHub; distribution: npm.
@@ -44,7 +50,7 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
44
50
  | **Report parity and snapshot evidence (4.2)** | `ark-check --report` → advisory sections (`data-advisory="contractHealth\|ambientState\|parseHealth\|arkRun"`, nested `governanceWeight`) + layer wall badges; `.ark/reports/*.json` | 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. Snapshots add best-effort Git `HEAD`/branch/dirty provenance without a shell; unavailable Git is explicit. Evolution renders the Ark score delta only when both snapshots name the same ArkGate version, while retaining raw facts across versions. Thin `arkRun` on `latest.json` is `notAScore` residual honesty for `ark status`. |
45
51
  | **MCP project identity (4.2)** | `ark_identity`; `arkgate/schema/project-identity` or `arkgate/schema/ark.project-identity.schema.json`; root API constants/helpers/types | Schema `1.0`. `projectId` hashes canonical root + config path and stays stable across contract edits/restarts; runtime id/start time are separate. Every project-bound tool result and error carries `projectIdentity`, `binding` (`matched` / `unverified` / `mismatch`), and `authoritative`. Canonical out-of-root config/file evidence fails before project data. |
46
52
  | **MCP tools and compatibility resource** | `arkgate-mcp`; `ark_manifest`; `ark_status`; `ark://manifest` | Tool names and primary argument shapes are stable within a major. Every tool accepts additive `project.expectedRoot` / optional `expectedProjectId`. The initial handshake requires the exact project root; a contained descendant is authoritative only together with the matching project id. Legacy tool calls remain callable but `unverified` and non-authoritative. `ark_manifest` is the authoritative contract surface after binding. **`ark_status`** returns the status manifest envelope (parity with `ark status --json`). Standard `resources/read` cannot portably carry the expectation, so `ark://manifest` remains compatibility-only and always unverified/non-authoritative. The server never retargets from input. |
47
- | **`ark.config.json`** | Layer globs, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`arkRules`** map (schema `1.1+`); optional **`arkRun`** extra (schema `1.2+`) | Versioned by `schemaVersion`; unknown fields fail closed and migrations preserve the previous supported major. Absence of `arkRules` or `arkRun` is byte-for-byte silent on Layers / ArkRules verdicts. Enforced `arkRun` extra teeth share the CLI / MCP / hook / preflight / CI verdict and arm only when the layer plane is classified (same ArkRules floor). |
53
+ | **`ark.config.json`** | Layer globs, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`arkRules`** map (schema `1.1+`); optional **`arkRun`** extra (schema `1.2+`); optional **`arkOrder`** extra (schema `1.3+`) | Versioned by `schemaVersion`; unknown fields fail closed and migrations preserve the previous supported major. Absence of `arkRules`, `arkRun`, or `arkOrder` is byte-for-byte silent on Layers / ArkRules verdicts. Enforced extra teeth share the CLI / MCP / hook / preflight / CI verdict and arm only when the layer plane is classified (same ArkRules floor). |
48
54
  | **ArkRules inventory / under-contract (4.0; layer context 4.2)** | `ark-check --rules-inventory [--json]`; doctor `rulesUnderContract`; MCP `ark_rules_inventory` | Additive. Honest counts (inventoried / under-contract / frozen) — **never a score**. When configured layer evidence exists it overrides filename role guesses: a Domain file named `handler` is not a controller candidate. Test/fixture/seed/migration/exclusion surfaces plus narrow development-identity, PostgreSQL OID, and technical I/O constants are silent. Without layer evidence, backward-compatible path/content heuristics remain. Structure/invariant diagnostics use adapter `1.4` provenance. |
49
55
  | **`arkgate/schema/project-identity`** or **`arkgate/schema/ark.project-identity.schema.json`** | MCP canonical project, contract, runtime, expectation, and binding envelope | Schema `1.0`. Initial `expectedRoot` must be the exact project root. A contained descendant can match only when `expectedProjectId` is also present and correct; id-only matching stays non-authoritative. Mismatch codes are `PROJECT_ROOT_MISMATCH`, `PROJECT_ID_MISMATCH`, and `INVALID_PROJECT_EXPECTATION`. |
50
56
  | **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. |
@@ -65,10 +71,10 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
65
71
  | **Agent contract projection** | CLI `ark agents-md [--write] [--check] [--stdout] [--json]`; install/upgrade AGENTS templates; root API `buildAgentProjectionBlock` / `mergeAgentProjectionDocument` | Schema `1.0` (projection markers). Version-stamped managed block (`arkgateVersion` + contract summary + diagnostic short list). **Non-authoritative** — not a gate input; enforcement is ark-check / hooks / CI. Content-identity merge preserves customized regions outside markers. Drift: `--check` vs package version. |
66
72
  | **Agent Skills packaging** | `templates/agent-skills/<name>/SKILL.md` (+ package README); root API `ARK_SKILL_NAMES` / `validateAgentSkillsPackage`; `npm run check:agent-skills` | Schema `1.0` (package contract). Same **13** skill names as flat templates; Agent Skills–compatible layout for `npx skills add`. No new skill names. Layout is generated 1:1 from `templates/skills/*.md`. |
67
73
  | **`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`). |
68
- | **`arkgate/schema/resolved-candidate-facts`** or **`arkgate/schema/ark.resolved-candidate-facts.schema.json`** | Versioned parity-capable input for `analyzeResolvedProject` / `preflightResolvedChange` | Schema `1.2` is additive: optional `classShapes` (1.1) plus ArkRun `arkRunKernelCalls` / `arkRunManagedNews` / `arkRunCompositionRootHits` / `arkRunDeclarations` (RN03–RN04). `1.0`/`1.1` payloads remain loadable. 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, candidate tree/facts hashes, and (when present) ArkRun call-site and declaration evidence. Tier-1 sensors emit `ARKRUN_*` diagnostics from those facts: advisory never flips `valid`; enforced blocks. |
74
+ | **`arkgate/schema/resolved-candidate-facts`** or **`arkgate/schema/ark.resolved-candidate-facts.schema.json`** | Versioned parity-capable input for `analyzeResolvedProject` / `preflightResolvedChange` | Schema `1.2` is additive: optional `classShapes` (1.1) plus ArkRun `arkRunKernelCalls` / `arkRunManagedNews` / `arkRunCompositionRootHits` / `arkRunDeclarations` (RN03–RN04) and ArkOrder `arkOrderPlaneCalls` / `arkOrderGenericUpdates` / `arkOrderRootHits` (OR05). `1.0`/`1.1` payloads remain loadable. 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, candidate tree/facts hashes, and (when present) ArkRun/ArkOrder call-site evidence. Tier-1 sensors emit `ARKRUN_*` / `ARKORDER_*` diagnostics from those facts: advisory never flips `valid`; enforced blocks. Extra absence is silent. |
69
75
  | **Config JSON Schema** | `arkgate/schema` or `arkgate/schema/ark.config.schema.json` | Stable package resource subpaths for editor completion and contract tooling. |
70
76
  | **Agent skills** | `/ark-*` templates; install via `--install-agent-gates` (often `--skills-only` on top of compact) **or** Agent Skills ecosystem path | **Day zero** is the compact router from `ark start` / `start --apply` + doctor — not the full skill pack. Skill *names* (frozen **13**) 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]`. **4.2:** repo catalogs are content-idempotent; the optional shared Codex home catalog is monotonic across 4.2.0+ installers. Pre-4.2 writers are outside that protocol and must be upgraded first. A durable pending-catalog journal preserves the floor across an interrupted install and is cleared only by its owning same/newer recovery. **4.3:** Agent Skills–compatible layout at `templates/agent-skills/<name>/SKILL.md` (1:1 with flat `templates/skills/*.md`); install via `npx skills add ./node_modules/arkgate/templates/agent-skills` (or the GitHub tree). Domain `ARK_SKILL_NAMES` + `validateAgentSkillsPackage`; drift `npm run check:agent-skills`. Skills never enforce. |
71
- | **ESLint subpath** | `arkgate/eslint` | Config-driven layer/import/purity rules plus ArkRun import/`new` envelope (`ark/no-arkrun-kernel-in-domain`, `ark/no-arkrun-direct-new`, `ark/no-arkrun-transport-bypass`) when `arkRun` is on; loads consumer `ark.config.json`. Absence of the extra is silent. Missing-root and undeclared-* stay CLI/MCP. |
77
+ | **ESLint subpath** | `arkgate/eslint` | Config-driven layer/import/purity rules plus ArkRun import/`new` envelope (`ark/no-arkrun-kernel-in-domain`, `ark/no-arkrun-direct-new`, `ark/no-arkrun-transport-bypass`) when `arkRun` is on, and ArkOrder envelope (`ark/no-arkorder-kernel-in-domain`, `ark/no-arkorder-generic-update`) when `arkOrder` is on; loads consumer `ark.config.json`. Absence of an extra is silent. Missing-root / missing-plane and undeclared-* stay CLI/MCP. |
72
78
  | **GitHub Action** | `pedroknigge/arkgate` (see `action.yml`) | The `uses:` tag/SHA selects the checker source; `version` remains an optional exact npm compatibility override. |
73
79
  | **Package metadata** | `arkgate/package.json` | Stable resource subpath for tooling that needs the installed manifest. |
74
80
 
@@ -166,25 +172,22 @@ product claims**. Static architecture enforcement does not depend on them.
166
172
 
167
173
  | Surface | Import path | Notes |
168
174
  |---------|-------------|--------|
169
- | **ArkRun kernel** | **`@arkgate/runtime`** | Public brand **ArkRun**. Separate 0.x companion; `createStrictArkKernel` is the factory (each call is an isolated instance; no process-wide `getKernel()` singleton). Not bundled in the `arkgate` tarball (ADR 0004 / 0021). Published under the `experimental` dist-tag as `@arkgate/runtime@0.1.0-experimental.0`. Install `@arkgate/runtime@experimental`. Verify with `npm view @arkgate/runtime dist-tags --json`. Root `publish-npm.yml` publishes it when that companion version is unpublished; companion-only: `publish-runtime.yml`. The first npm copy also received a `latest` dist-tag pointing at the same 0.x (npm default); that is not a production-durability claim. Event bus, intents, policies, sagas, event buffer, projections, and strict helpers. Managed components declare `uses` / `reactsTo` / `raises` / `sends` on `register()`; `getDependencyInformationPackage()` is a JSON snapshot of ids, lifetime, and declarations and never includes factories, live instances, or input DTOs (ADR 0023). `requestGraph()` slices that snapshot into **process** or **technical** graphs with optional `nodeIds`, `degreesOfSeparation`, and include/exclude query; `formatArkRunGraphMermaid()` (also `graph.mermaid`) is a helper string, never a score. `send()` is the transport port (local / localBlocking / broker); missing broker falls back to in-process local delivery, `ephemeral` defaults true, and **no cloud SDKs ship** in the package (ADR 0024). Opt-in `startInspector()` / `startArkRunInspector()` binds **`127.0.0.1` only**, refuses `NODE_ENV=production`, lazy-loads HTTP, and serves JSON snapshots, SSE, and `/graph` slices of the information package (no public / authless bind). Built-in stores are **InMemory reference only**. Branding ArkRun is not a production-durability claim. |
170
- | **NestJS adapter** | `@arkgate/runtime/nestjs` | Experimental optional peer `@nestjs/common` for the ArkRun kernel. Root `arkgate/nestjs` and `arkgate/runtime` forwarders were **removed in AR04 / ArkGate 4** — import the companion package directly. |
175
+ | **ArkRun kernel** | **`arkgate/runtime`** | Public brand **ArkRun**. Same npm package `arkgate` (ADR 0031). Factory `createStrictArkKernel` (each call is an isolated instance; no process-wide `getKernel()` singleton). Root export does **not** include the factory. Optional extra `arkRun` on schema `1.2+`. Event bus, intents, policies, sagas, event buffer, projections, and strict helpers. Managed components declare `uses` / `reactsTo` / `raises` / `sends` on `register()`; `getDependencyInformationPackage()` is a JSON snapshot of ids, lifetime, and declarations and never includes factories, live instances, or input DTOs (ADR 0023). `requestGraph()` slices that snapshot into **process** or **technical** graphs with optional `nodeIds`, `degreesOfSeparation`, and include/exclude query; `formatArkRunGraphMermaid()` (also `graph.mermaid`) is a helper string, never a score. `send()` is the transport port (local / localBlocking / broker); missing broker falls back to in-process local delivery, `ephemeral` defaults true, and **no cloud SDKs ship** in the package (ADR 0024). Opt-in `startInspector()` / `startArkRunInspector()` binds **`127.0.0.1` only**, refuses `NODE_ENV=production`, lazy-loads HTTP, and serves JSON snapshots, SSE, and `/graph` slices of the information package (no public / authless bind). Built-in stores are **InMemory reference only**. Branding ArkRun is not a production-durability claim. **`@arkgate/runtime` is deprecated** leftover 0.x (`experimental` dist-tag). |
176
+ | **NestJS adapter** | **`arkgate/nestjs`** | Experimental optional peer `@nestjs/common` for the ArkRun kernel. Same npm package. `@arkgate/runtime/nestjs` is deprecated. |
177
+ | **ArkOrder plane** | **`arkgate/order`** | Public brand **ArkOrder**. Same npm package `arkgate` (ADR 0030) — not `@arkgate/order`. Factory `createOrderPlane`. Four verbs: `release` / `project` / `ingest` / `proposeRelease`. No `update`. Haken: few slow keys; ingest never mints a pattern; empty blast fails closed. Root `arkgate` export does **not** include the factory. Optional extra `arkOrder` on schema `1.3`. In-memory; not durable. Does not replace ArkRun. |
171
178
 
172
179
  ---
173
180
 
174
181
  ## Recommended imports
175
182
 
176
183
  ```ts
177
- // Preferred ArkRun factory each call is a new isolated instance (no getKernel() singleton)
178
- import { createStrictArkKernel, createStrictArkKernelFromConfig } from '@arkgate/runtime';
179
-
180
- // Nest adapter
181
- import { ArkModule, InjectArk } from '@arkgate/runtime/nestjs';
184
+ import { createAICodeGate } from 'arkgate';
185
+ import { createStrictArkKernel, createStrictArkKernelFromConfig } from 'arkgate/runtime';
186
+ import { ArkModule, InjectArk } from 'arkgate/nestjs';
187
+ import { createOrderPlane } from 'arkgate/order';
182
188
  ```
183
189
 
184
- These imports describe the intended package boundary. Install with
185
- `npm install @arkgate/runtime@experimental` and verify
186
- `npm view @arkgate/runtime dist-tags --json`. Root `arkgate/runtime` / `arkgate/nestjs`
187
- forwarders were **removed in 4.0.0** (AR04).
190
+ One install: `npm install arkgate`. `@arkgate/runtime` is deprecated.
188
191
 
189
192
  See [production-hardening.md](https://github.com/pedroknigge/arkgate/blob/main/docs/production-hardening.md) for requirements an eventual
190
193
  production deployment would need to satisfy; it is not a readiness certification.
@@ -215,7 +218,8 @@ production deployment would need to satisfy; it is not a readiness certification
215
218
  ## Release notes (maintainers)
216
219
 
217
220
  Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
218
- (current published: [4.7.6.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.7.6.md);
221
+ (current published: [4.8.0.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.0.md);
222
+ prior published: [4.7.6.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.7.6.md);
219
223
  prior published: [4.7.5.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.7.5.md);
220
224
  prior published: [4.7.3.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.7.3.md);
221
225
  prior published: [4.7.2.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.7.2.md);
@@ -18,7 +18,7 @@ The same check fails the pull request.
18
18
 
19
19
  **ArkRules** is optional policies inside a layer.
20
20
 
21
- **ArkRun** is an optional runtime (`@arkgate/runtime`). Experimental. In-memory.
21
+ **ArkRun** is an optional runtime (`arkgate/runtime`). Experimental. In-memory.
22
22
  Not Postgres.
23
23
 
24
24
  ```text
@@ -96,6 +96,7 @@ These are product law, not vibe:
96
96
 
97
97
  - **Write. Check. Ship.** ArkGate is the wedge. ArkRules and ArkRun never determine the `arkgate` package shape.
98
98
  - The check is deterministic. No LLM pass/fail. Skills and `AGENTS.md` never replace the check.
99
+ - Doctor and status advisory surfaces project existing facts. They are not a second check and never flip the deny.
99
100
  - No numeric architecture / trust / depth score. Lights and counts, never Excellent/Good.
100
101
  - Green imports ≠ elegant design. Leftover design work is **needs a refactor**, not “done”.
101
102
  - No silent auto-reshape. Invoke of a command is the approval.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.7.6",
3
+ "version": "4.8.0",
4
4
  "description": "When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -17,6 +17,21 @@
17
17
  "import": "./dist/eslint/index.js",
18
18
  "require": "./dist/eslint/index.cjs"
19
19
  },
20
+ "./order": {
21
+ "types": "./dist/order/index.d.ts",
22
+ "import": "./dist/order/index.js",
23
+ "require": "./dist/order/index.cjs"
24
+ },
25
+ "./runtime": {
26
+ "types": "./dist/runtime/index.d.ts",
27
+ "import": "./dist/runtime/index.js",
28
+ "require": "./dist/runtime/index.cjs"
29
+ },
30
+ "./nestjs": {
31
+ "types": "./dist/nestjs/index.d.ts",
32
+ "import": "./dist/nestjs/index.js",
33
+ "require": "./dist/nestjs/index.cjs"
34
+ },
20
35
  "./schema": "./schemas/ark.config.schema.json",
21
36
  "./schema/ark.config.schema.json": "./schemas/ark.config.schema.json",
22
37
  "./schema/analysis-result": "./schemas/ark.analysis-result.schema.json",
@@ -155,11 +170,15 @@
155
170
  "typescript-ark-host": "npm:typescript@6.0.3"
156
171
  },
157
172
  "peerDependencies": {
158
- "typescript": ">=5.0.0 <8"
173
+ "typescript": ">=5.0.0 <8",
174
+ "@nestjs/common": ">=9"
159
175
  },
160
176
  "peerDependenciesMeta": {
161
177
  "typescript": {
162
178
  "optional": true
179
+ },
180
+ "@nestjs/common": {
181
+ "optional": true
163
182
  }
164
183
  },
165
184
  "overrides": {