arkgate 4.8.5 → 4.8.7

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 (71) hide show
  1. package/CHANGELOG.md +56 -2
  2. package/README.md +16 -9
  3. package/bin/ark-mcp-runtime.mjs +8 -2
  4. package/bin/lib/analysis-engine.mjs +5 -5
  5. package/bin/lib/ark-order-invariants.mjs +163 -14
  6. package/bin/lib/ark-order-types.mjs +3 -0
  7. package/bin/lib/diagnostic-catalog.mjs +5 -4
  8. package/bin/lib/doctor-human.mjs +9 -0
  9. package/bin/lib/doctor-plan.mjs +5 -1
  10. package/bin/lib/html-report.mjs +4 -2
  11. package/bin/lib/layer-description.mjs +27 -0
  12. package/bin/lib/prepare-write.mjs +7 -1
  13. package/bin/lib/remediation.mjs +11 -5
  14. package/dist/{configTypes-dy5PfTqS.d.ts → configTypes-0eHpocR3.d.ts} +4 -0
  15. package/dist/{diagnosticCatalog-DMO30svh.d.ts → diagnosticCatalog-wDAH08gH.d.ts} +3 -3
  16. package/dist/eslint/index.cjs +1 -1
  17. package/dist/eslint/index.d.ts +1 -1
  18. package/dist/eslint/index.js +1 -1
  19. package/dist/index.cjs +19 -19
  20. package/dist/index.d.ts +5 -4
  21. package/dist/index.js +20 -20
  22. package/dist/nestjs/index.cjs +5 -5
  23. package/dist/nestjs/index.d.ts +3 -3
  24. package/dist/nestjs/index.js +5 -5
  25. package/dist/order/index.cjs +1 -1
  26. package/dist/order/index.d.ts +61 -10
  27. package/dist/order/index.js +1 -1
  28. package/dist/runtime/index.cjs +11 -11
  29. package/dist/runtime/index.d.ts +6 -6
  30. package/dist/runtime/index.js +11 -11
  31. package/dist/{types-BuM8WNqe.d.ts → types-BK47clMl.d.ts} +1 -1
  32. package/dist/{types-CzE6LMaW.d.ts → types-CwZ_oz1N.d.ts} +22 -7
  33. package/docs/README.md +5 -4
  34. package/docs/agent-guide.md +2 -0
  35. package/docs/ai-gates.md +5 -2
  36. package/docs/arkorder.md +32 -14
  37. package/docs/configuration.md +28 -5
  38. package/docs/develop.md +7 -2
  39. package/docs/diagnostics.md +15 -5
  40. package/docs/package-surface.md +18 -12
  41. package/docs/product-voice.md +3 -3
  42. package/docs/use.md +1 -1
  43. package/package.json +1 -1
  44. package/server.json +2 -2
  45. package/templates/agent-skills/README.md +1 -1
  46. package/templates/agent-skills/ark-adopt/SKILL.md +22 -5
  47. package/templates/agent-skills/ark-architect/SKILL.md +1 -1
  48. package/templates/agent-skills/ark-autopilot/SKILL.md +4 -4
  49. package/templates/agent-skills/ark-contract/SKILL.md +1 -1
  50. package/templates/agent-skills/ark-coverage/SKILL.md +3 -2
  51. package/templates/agent-skills/ark-explain/SKILL.md +3 -2
  52. package/templates/agent-skills/ark-explore/SKILL.md +3 -2
  53. package/templates/agent-skills/ark-fix/SKILL.md +1 -1
  54. package/templates/agent-skills/ark-loop/SKILL.md +1 -1
  55. package/templates/agent-skills/ark-place/SKILL.md +25 -12
  56. package/templates/agent-skills/ark-runtime/SKILL.md +3 -0
  57. package/templates/agent-skills/ark-think/SKILL.md +2 -2
  58. package/templates/agent-skills/ark-upgrade/SKILL.md +2 -2
  59. package/templates/skills/ark-adopt.md +22 -5
  60. package/templates/skills/ark-architect.md +1 -1
  61. package/templates/skills/ark-autopilot.md +4 -4
  62. package/templates/skills/ark-contract.md +1 -1
  63. package/templates/skills/ark-coverage.md +3 -2
  64. package/templates/skills/ark-explain.md +3 -2
  65. package/templates/skills/ark-explore.md +3 -2
  66. package/templates/skills/ark-fix.md +1 -1
  67. package/templates/skills/ark-loop.md +1 -1
  68. package/templates/skills/ark-place.md +25 -12
  69. package/templates/skills/ark-runtime.md +3 -0
  70. package/templates/skills/ark-think.md +2 -2
  71. package/templates/skills/ark-upgrade.md +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,60 @@
3
3
  All notable changes to ArkGate (`arkgate`; formerly `ark-runtime-kernel`) are documented here or
4
4
  in the immutable pre-2.0 archive linked below.
5
5
 
6
+ ## 4.8.7 — 2026-08-31
7
+
8
+ **Patch** over **4.8.6**. Phase **LD** — layer description projection. Optional
9
+ `layers[].description` is an **app-context caption** (what this folder is in the
10
+ product), not architecture jargon. Place, doctor, coverage, and the HTML report
11
+ show it when present. Caption-only edits do not change `policyHash`.
12
+ **No required config migration.** No `schemaVersion` bump. Does not close `K01` / `Z09`.
13
+ No new skill names. Do not npm-publish from this item until the maintainer tag.
14
+
15
+ **Status: prepared** (tree ready; npm `latest` remains **4.8.6** until publish).
16
+
17
+ ### Added
18
+ - Public name for existing `layers[].description`. Example:
19
+ `"Purchase requests — from asked to received."`
20
+ - Place / prepare-write / MCP JSON, doctor JSON + human, coverage JSON, and the
21
+ HTML Purpose column project the caption when present.
22
+ - `/ark-adopt` writes the caption from the product map or glossary; `/ark-place`
23
+ prints it next to layer name + globs.
24
+
25
+ ### Changed
26
+ - `policyHash` omits `layers[].description` the same way it omits `stewards`.
27
+ Caption-only is neutral. Absence stays silent: never a residual, never a
28
+ score, never `--strict-config` fail.
29
+
30
+ ## 4.8.6 — 2026-08-31
31
+
32
+ **Patch** over **4.8.5**. Phase **LV** — ArkOrder valved loop. First `release()`
33
+ freezes ξ; later pattern change is `proposeRelease` then `apply`. σ identity is
34
+ not ξ identity. ingest returns a closed residual. Capacity is data. ArkRun
35
+ carries the decision tape. **No required config migration.** Does not close
36
+ `K01` / `Z09`. No `/ark-order` skill.
37
+
38
+ **Status: published** (on npm `latest`; see `docs/releases/4.8.6.md`).
39
+
40
+ ### Added
41
+ - **`apply(ProposeResult)`** on `createOrderPlane`. Unvalved second freeze of a
42
+ different ξ fails `ARKORDER_UNVALVED_RELEASE` at runtime (not a lexical sensor).
43
+ - **`xiHash` / `sigmaHash` / `refreshSigma`** — saldo refresh does not mint a pattern.
44
+ - **Ingest residual** `absorb | escalate_up | hold` bound to `xiHash` + event
45
+ identity. Closed `reasonCode`: `not-in-pattern` | `stale-sigma` | `pack` |
46
+ `capacity`. `proposed_patch` only on `escalate_up`. `IngestEscalate.target` remains.
47
+ - **Capacity pack as data** (`kind` / `sigmaKey` / `payloadKey` / `op`). No user
48
+ predicates. Over-cap is residual, not a homemade kind.
49
+ - **ArkRun decision tape** on the information package (`{ xiHash, event, residual }`).
50
+ Component snapshot API unchanged. `shadow` / `compare` / `replay` in-process.
51
+ - **`ReleaseStore` port** with in-memory default. Optional catalog digest keyed by
52
+ `catalogReleaseId`. Not durable. Not K01.
53
+ - Thin gallery bridge: absorb may `send`; `escalate_up` human may `raises`.
54
+
55
+ ### Changed
56
+ - Public sentence: **ArkOrder freezes the pattern through a valve. ArkRun is how
57
+ the residual travels.** Skills `/ark-adopt` `/ark-place` `/ark-autopilot` deepen.
58
+ Doctor / status remain `notAScore`.
59
+
6
60
  ## 4.8.5 — 2026-08-31
7
61
 
8
62
  **Patch** over **4.8.4**. Phase **XP** (ArkOrder × ArkRun) plus Antigravity skill
@@ -11,7 +65,7 @@ now has a canonical page. The runtime half (shadow / replay / compare) is
11
65
  ArkRun and in-memory. **No required config migration.** Does not close `K01` /
12
66
  `Z09`.
13
67
 
14
- **Status: prepared** (not yet on npm `latest`).
68
+ **Status: published** (see `docs/releases/4.8.5.md`).
15
69
 
16
70
  ### Added
17
71
  - **`docs/arkorder.md`:** named APIs adopters were redesigning (`createOrderPlane`,
@@ -41,7 +95,7 @@ ArkRun and in-memory. **No required config migration.** Does not close `K01` /
41
95
 
42
96
  ## 4.8.4 — 2026-08-30
43
97
 
44
- **Status: published** (on npm `latest`; see `docs/releases/4.8.4.md`).
98
+ **Status: published** (see `docs/releases/4.8.4.md`).
45
99
 
46
100
  **Patch** over **4.8.3**. Invariant coverage stops hiding its own limits: the scan budget and the
47
101
  test globs are config, every discarded file is counted in the diagnostic, and coverage stops
package/README.md CHANGED
@@ -29,13 +29,15 @@ Works with Cursor, Claude, Codex, and Grok.
29
29
 
30
30
  </div>
31
31
 
32
- > **ArkGate 4.8.4** is on npm `latest`. Write. Check. Ship. Adopted = required GitHub
32
+ > **ArkGate 4.8.6** is on npm `latest`.
33
+ > Write. Check. Ship. Adopted = required GitHub
33
34
  > status running `arkgate-check --strict-merge`, or an explicit `advisory-only` stance.
34
35
  > Status is compact (`arkgate-check --doctor`; `--all` for Details). Optional **ArkRun**
35
36
  > (`arkgate/runtime`) is an in-memory runtime — not Postgres. Optional **ArkOrder**
36
- > (`arkgate/order`) stops the agent rewriting the few slow product decisions as CRUD.
37
+ > (`arkgate/order`) stops the agent rewriting the few slow product decisions as CRUD;
38
+ > later pattern change is `proposeRelease` then `apply`.
37
39
  > `@arkgate/runtime` is deprecated.
38
- > [4.8.4](docs/releases/4.8.4.md) · [4.8.3](docs/releases/4.8.3.md) · [4.8.2](docs/releases/4.8.2.md) · [4.8.1](docs/releases/4.8.1.md) · [4.8.0](docs/releases/4.8.0.md) · [Docs hub](docs/README.md) · [Voice](docs/product-voice.md)
40
+ > [4.8.6](docs/releases/4.8.6.md) · [4.8.5](docs/releases/4.8.5.md) · [4.8.4](docs/releases/4.8.4.md) · [4.8.3](docs/releases/4.8.3.md) · [4.8.2](docs/releases/4.8.2.md) · [4.8.1](docs/releases/4.8.1.md) · [4.8.0](docs/releases/4.8.0.md) · [Docs hub](docs/README.md) · [Voice](docs/product-voice.md)
39
41
 
40
42
  ---
41
43
 
@@ -104,7 +106,7 @@ once you adopt. The other three are optional.
104
106
  | **Before merge** | `arkgate-check` as a **required** CI status | Always (ArkGate) |
105
107
  | **ArkRules** | Optional policies *inside* a layer | When you ask |
106
108
  | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off unless you turn it on |
107
- | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`) | Off unless you turn it on |
109
+ | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`). Valve: first `release()`, later ξ is `proposeRelease` then `apply` | Off unless you turn it on |
108
110
 
109
111
  Layers (who may import whom) always run. ArkRules, ArkRun, and ArkOrder change no
110
112
  inter-layer verdict when absent. Label leftovers **`[Layer]`** vs **`[ArkRules]`** vs
@@ -280,10 +282,13 @@ because “what may be the plan” was never a rule.
280
282
 
281
283
  **ArkOrder** (`arkgate/order`) is that rule. Off unless you add `arkOrder`.
282
284
  Name the slow keys (`xiKeys`: plan, protocol, cost-code bound — not `projectId`).
283
- Posting an invoice is absorbed. Changing plan is a new release, with a blast
284
- radius. A generic `update` of the plan does not land. A use-case that PATCHes
285
- those keys through Prisma is named. Same npm package.
285
+ Posting an invoice is absorbed. Changing plan is `proposeRelease` then `apply`.
286
+ `refreshSigma`; ingest residual `absorb | escalate_up | hold` + `reasonCode`;
287
+ capacity pack as data; in-memory `ReleaseStore`; `ingestTravelAction`; ArkRun
288
+ `decisionTape`. A generic `update` of the plan does not land. A use-case that
289
+ PATCHes those keys through Prisma is named. Same npm package.
286
290
  In-memory. Not durable. Does not replace ArkRun.
291
+ **ArkOrder freezes the pattern through a valve. ArkRun is how the residual travels.**
287
292
 
288
293
  Copy [examples/arkorder-billing/](examples/arkorder-billing/) and rename the
289
294
  three keys. Compact starters leave it off. Details:
@@ -304,8 +309,10 @@ three keys. Compact starters leave it off. Details:
304
309
  | Config · package surface · TS | [configuration](docs/configuration.md) · [package-surface](docs/package-surface.md) · [typescript-support](docs/typescript-support.md) |
305
310
  | Brownfield | [docs/brownfield-adoption.md](docs/brownfield-adoption.md) |
306
311
  | Security | [SECURITY.md](SECURITY.md) |
307
- | Current tree (4.8.5 prepared) | [docs/releases/4.8.5.md](docs/releases/4.8.5.md) · [CHANGELOG](CHANGELOG.md) |
308
- | Current published (4.8.4 on npm `latest`) | [docs/releases/4.8.4.md](docs/releases/4.8.4.md) |
312
+ | Current tree (4.8.7 prepared) | [docs/releases/4.8.7.md](docs/releases/4.8.7.md) · [CHANGELOG](CHANGELOG.md) |
313
+ | Current published (4.8.6 on npm `latest`) | [docs/releases/4.8.6.md](docs/releases/4.8.6.md) |
314
+ | Prior published (4.8.5) | [docs/releases/4.8.5.md](docs/releases/4.8.5.md) |
315
+ | Prior published (4.8.4) | [docs/releases/4.8.4.md](docs/releases/4.8.4.md) |
309
316
  | Prior published (4.8.3) | [docs/releases/4.8.3.md](docs/releases/4.8.3.md) |
310
317
  | Prior published (4.8.2) | [docs/releases/4.8.2.md](docs/releases/4.8.2.md) |
311
318
  | Prior published (4.8.1) | [docs/releases/4.8.1.md](docs/releases/4.8.1.md) |
@@ -27,6 +27,7 @@ import { effectiveCapabilityDeny, stableSerialize } from './lib/analysis-engine.
27
27
  import { createImportTargetResolver } from './lib/import-resolve.mjs';
28
28
  import { validateWithAutoPatch, resolveImportFileAbs } from './lib/auto-patch.mjs';
29
29
  import { composePrepareWrite } from './lib/prepare-write.mjs';
30
+ import { placementDescriptionFields } from './lib/layer-description.mjs';
30
31
  import { loadArkConfigContract } from './lib/config-contract.mjs';
31
32
  import { loadEffectiveArkRulesFromDisk } from './lib/effective-contract-load.mjs';
32
33
  import {
@@ -1925,6 +1926,7 @@ export async function runArkMcp({ hookInput } = {}) {
1925
1926
  'Place a file in the architecture: filePath is required (fail-closed without it — never invents components/*.tsx or defaults to Presentation). ' +
1926
1927
  'Returns layer, mayImport / mustNotImport, forbiddenGlobals, and goldenPattern ' +
1927
1928
  '(load-bearing for NEW code when .ark/golden-pattern.json exists — adopt generates it). ' +
1929
+ 'When the matched layer has layers[].description, the JSON includes description; the field is omitted when absent. ' +
1928
1930
  'Call BEFORE writing a new file. ' +
1929
1931
  'Prefer ark_prepare_write when you already have the source snippet (place+validate+autoPatch in one call).',
1930
1932
  inputSchema: {
@@ -1950,7 +1952,8 @@ export async function runArkMcp({ hookInput } = {}) {
1950
1952
  'mechanical-safe autoPatch + judgmentBrief when judgment is needed + contentHash for host commit. ' +
1951
1953
  'Also returns the versioned new/worsened designDelta for the proposed full file. ' +
1952
1954
  'Composes ark_place + write-gate — call BEFORE Write/Edit when you have the snippet. ' +
1953
- 'Returns { filePath, layer, valid, violations?, autoPatch?, judgmentBrief?, contentHash, ... }.',
1955
+ 'When the matched layer has layers[].description, the JSON includes description; the field is omitted when absent. ' +
1956
+ 'Returns { filePath, layer, description?, valid, violations?, autoPatch?, judgmentBrief?, contentHash, ... }.',
1954
1957
  inputSchema: {
1955
1958
  type: 'object',
1956
1959
  properties: {
@@ -2393,6 +2396,9 @@ export async function runArkMcp({ hookInput } = {}) {
2393
2396
  // `allowed:false` denies) — which layers it may and must not import.
2394
2397
  // Q03: when present, attach optional `.ark/golden-pattern.json` (advisory for NEW code only).
2395
2398
  function placeResult(filePath, description) {
2399
+ // Input `description` is the pre-existing "what you are building" hint — not
2400
+ // layers[].description — and must not be copied onto the caption key (ADR 0035 D5).
2401
+ void description;
2396
2402
  const golden = loadGoldenPattern(args.root);
2397
2403
  const withGolden = (placement) => attachGoldenToPlacement(placement, golden);
2398
2404
 
@@ -2433,7 +2439,7 @@ export async function runArkMcp({ hookInput } = {}) {
2433
2439
  filePath,
2434
2440
  layer: layerName,
2435
2441
  governed: true,
2436
- description: layerMeta?.description,
2442
+ ...placementDescriptionFields(layerMeta),
2437
2443
  forbiddenGlobals: layerMeta?.forbiddenGlobals ?? [],
2438
2444
  ...(layerMeta?.mayImportInfrastructure ? { mayImportInfrastructure: true } : {}),
2439
2445
  mayImport,