arkgate 4.8.4 → 4.8.6

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 (70) hide show
  1. package/CHANGELOG.md +69 -2
  2. package/README.md +20 -11
  3. package/bin/lib/agent-homes.mjs +41 -6
  4. package/bin/lib/analysis-engine.mjs +8 -8
  5. package/bin/lib/ark-order-invariants.mjs +199 -13
  6. package/bin/lib/ark-order-sensors.mjs +4 -0
  7. package/bin/lib/ark-order-types.mjs +3 -0
  8. package/bin/lib/check-args.mjs +2 -0
  9. package/bin/lib/diagnostic-catalog.mjs +7 -3
  10. package/bin/lib/first-run-help.mjs +4 -4
  11. package/bin/lib/remediation.mjs +20 -5
  12. package/bin/lib/skill-catalog-apply.mjs +18 -1
  13. package/bin/lib/skill-install.mjs +4 -3
  14. package/bin/lib/upgrade-whats-new.mjs +1 -1
  15. package/dist/{diagnosticCatalog-DgTs0abp.d.ts → diagnosticCatalog-D_DI7qrZ.d.ts} +1 -1
  16. package/dist/eslint/index.cjs +5 -5
  17. package/dist/eslint/index.js +5 -5
  18. package/dist/index.cjs +17 -17
  19. package/dist/index.d.ts +5 -3
  20. package/dist/index.js +13 -13
  21. package/dist/nestjs/index.cjs +5 -5
  22. package/dist/nestjs/index.d.ts +1 -1
  23. package/dist/nestjs/index.js +5 -5
  24. package/dist/order/index.cjs +1 -1
  25. package/dist/order/index.d.ts +69 -9
  26. package/dist/order/index.js +1 -1
  27. package/dist/runtime/index.cjs +15 -15
  28. package/dist/runtime/index.d.ts +27 -4
  29. package/dist/runtime/index.js +15 -15
  30. package/dist/{types-D95drJ3_.d.ts → types-DrqsOiTY.d.ts} +21 -6
  31. package/docs/README.md +6 -4
  32. package/docs/agent-guide.md +6 -4
  33. package/docs/ai-gates.md +18 -4
  34. package/docs/arkorder.md +228 -0
  35. package/docs/configuration.md +14 -5
  36. package/docs/develop.md +10 -4
  37. package/docs/diagnostics.md +41 -4
  38. package/docs/enthusiast/how-to-agent-gates.md +1 -1
  39. package/docs/package-surface.md +14 -9
  40. package/docs/product-voice.md +3 -3
  41. package/docs/use.md +1 -1
  42. package/package.json +2 -1
  43. package/server.json +2 -2
  44. package/templates/agent-skills/README.md +1 -1
  45. package/templates/agent-skills/ark-adopt/SKILL.md +4 -4
  46. package/templates/agent-skills/ark-architect/SKILL.md +1 -1
  47. package/templates/agent-skills/ark-autopilot/SKILL.md +4 -4
  48. package/templates/agent-skills/ark-contract/SKILL.md +1 -1
  49. package/templates/agent-skills/ark-coverage/SKILL.md +3 -2
  50. package/templates/agent-skills/ark-explain/SKILL.md +3 -2
  51. package/templates/agent-skills/ark-explore/SKILL.md +3 -2
  52. package/templates/agent-skills/ark-fix/SKILL.md +1 -1
  53. package/templates/agent-skills/ark-loop/SKILL.md +1 -1
  54. package/templates/agent-skills/ark-place/SKILL.md +8 -8
  55. package/templates/agent-skills/ark-runtime/SKILL.md +3 -0
  56. package/templates/agent-skills/ark-think/SKILL.md +2 -2
  57. package/templates/agent-skills/ark-upgrade/SKILL.md +3 -3
  58. package/templates/skills/ark-adopt.md +4 -4
  59. package/templates/skills/ark-architect.md +1 -1
  60. package/templates/skills/ark-autopilot.md +4 -4
  61. package/templates/skills/ark-contract.md +1 -1
  62. package/templates/skills/ark-coverage.md +3 -2
  63. package/templates/skills/ark-explain.md +3 -2
  64. package/templates/skills/ark-explore.md +3 -2
  65. package/templates/skills/ark-fix.md +1 -1
  66. package/templates/skills/ark-loop.md +1 -1
  67. package/templates/skills/ark-place.md +8 -8
  68. package/templates/skills/ark-runtime.md +3 -0
  69. package/templates/skills/ark-think.md +2 -2
  70. package/templates/skills/ark-upgrade.md +3 -3
@@ -43,7 +43,7 @@ Atomic multi-file work uses **`ark_prepare_change`** with the same matched `proj
43
43
 
44
44
  ## Dual plane — layers + extras (mandatory, except /ark-runtime)
45
45
 
46
- Label findings **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Absence of extras is valid and silent. Extra skip clusters (`ARKRUN_*` / `ARKORDER_*`) are **`/ark-autopilot`**. Never invent `mechanical-safe` kinds. Do not invent `/ark-run` or `/ark-order`. Skills never enforce.
46
+ Label findings **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. Absence of extras is valid and silent. Extra skip clusters (`ARKRUN_*` / `ARKORDER_*`) are **`/ark-autopilot`**. When ArkOrder is on: later ξ is `proposeRelease` then `apply`; `refreshSigma`; ingest residual `absorb | escalate_up | hold`; capacity pack as data; in-memory `ReleaseStore`; ArkRun `decisionTape`. Never invent `mechanical-safe` kinds. Do not invent `/ark-run` or `/ark-order`. Skills never enforce.
47
47
 
48
48
  ## Subagent fan-out (optional, host-dependent)
49
49
 
@@ -24,8 +24,8 @@ description: "Where does new code go? Names the folder from the rules file and w
24
24
  `compositionRoots` alias). Extra off → do not introduce the kernel. Enable it
25
25
  via `/ark-adopt`. Skills never enforce.
26
26
  - When `arkOrder` is on: factory only in `arkOrder.planeRoots`; Domain stays plane-free;
27
- freeze ξ with `release()`. Extra off do not introduce the plane. Enable it via
28
- `/ark-adopt`. Skills never enforce.
27
+ first freeze ξ with `release()`; later ξ is `proposeRelease` then `apply`. Extra off
28
+ → do not introduce the plane. Enable it via `/ark-adopt`. Skills never enforce.
29
29
 
30
30
  ## Autonomy contract
31
31
 
@@ -113,8 +113,8 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
113
113
  |-------|------------------|----------------|-----------------|
114
114
  | **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
115
115
  | **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
116
- | **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
117
- | **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
116
+ | **ArkRun** (extra) | Kernel usage + complete declarations; information package `decisionTape` `{ xiHash, event, residual }` | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
117
+ | **ArkOrder** (extra) | Operational pattern (ξ vs s). Valve: first `release()`, later ξ is `proposeRelease` then `apply`; `refreshSigma`; ingest residual `absorb \| escalate_up \| hold` + `reasonCode`; capacity pack as data; in-memory `ReleaseStore` | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
118
118
 
119
119
  **Rules for every report / answer:**
120
120
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).
@@ -123,7 +123,7 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
123
123
  4. Missing layer home: add it via **`/ark-adopt`** in this session if needed, then write the file; never invent `mechanical-safe`.
124
124
  5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
125
125
  6. Absence of `arkRun` is **valid**. Do not introduce the kernel speculatively. Skills never enforce this extra.
126
- 7. Absence of `arkOrder` is **valid**. When on: Domain stays plane-free; freeze ξ with `release()`; never `update`/`patch`/`set` the pattern. Import `createOrderPlane` from `arkgate/order` (same npm package). No `/ark-order` skill.
126
+ 7. Absence of `arkOrder` is **valid**. When on: Domain stays plane-free; first freeze ξ with `release()`; later ξ is `proposeRelease` then `apply`; never `update`/`patch`/`set` the pattern. Import `createOrderPlane` from `arkgate/order` (same npm package). No `/ark-order` skill.
127
127
 
128
128
 
129
129
  ### Place + ArkRules
@@ -138,16 +138,16 @@ When `arkRun` is present on the architecture config:
138
138
  - Domain-role files stay kernel-free (`ARKRUN_KERNEL_IN_DOMAIN`). Import from `arkgate/runtime` (or `arkgate/nestjs`). `@arkgate/runtime` is deprecated.
139
139
  - List `uses` / `reactsTo` / `raises` / `sends` when `requireDeclarations` is on. Adding an existing call-site literal to the declaration list is the only mechanical-safe ArkRun edit; inventing a new emit / handle / depend is judgment.
140
140
  - Do not import a homemade bus (`EventEmitter`, queue clients) in `managedLayers` — send on the kernel transport (`local` / `localBlocking` / `broker`; `ephemeral` defaults true). No shipped cloud SDKs.
141
- - In-memory stores are **not** production durability. Doctor `arkRun` is `notAScore`.
141
+ - In-memory stores are **not** production durability. Doctor `arkRun` is `notAScore`. Information package may carry `decisionTape` `{ xiHash, event, residual }` (`appendDecisionTape`). Not a bus. Not durable.
142
142
  - Absence of the extra: place with **[Layer]** + **[ArkRules]** only. Enable advisory extra via `/ark-adopt`; evaluate a hand-rolled bus via `/ark-runtime`. Do not invent `/ark-run`.
143
143
  - Skills never enforce.
144
144
 
145
145
  ### Place + ArkOrder
146
146
  When `arkOrder` is present on the architecture config:
147
147
  - Import `createOrderPlane` from `arkgate/order` (same npm package). Domain-role files stay plane-free.
148
- - Freeze ξ with `release()`; derive s with `project()`; field `ingest()` never mints a pattern; `proposeRelease()` needs a non-empty blast. There is no `update`/`patch`/`set`.
148
+ - First freeze ξ with `release()`; later ξ change is `proposeRelease` then `apply` (`ARKORDER_UNVALVED_RELEASE`). `refreshSigma` for saldo. Field `ingest()` returns `absorb | escalate_up | hold` bound to `xiHash` + `reasonCode`; never a Release. Capacity pack as data; `createMemoryReleaseStore`; `ingestTravelAction`; ArkRun `decisionTape`. No `update`/`patch`/`set`.
149
149
  - Call the factory only inside `arkOrder.planeRoots`. Empty roots in `enforced` mode is `ARKORDER_MISSING_PLANE`.
150
- - Named slow keys live in `arkOrder.xiKeys`. A managed-layer Prisma/pg write of those keys is `ARKORDER_XI_FIELD_WRITE` — absorb with `ingest` or change the pattern with `proposeRelease`.
150
+ - Named slow keys live in `arkOrder.xiKeys`. A managed-layer Prisma/pg write of those keys is `ARKORDER_XI_FIELD_WRITE` — absorb with `ingest` or change the pattern with `proposeRelease` then `apply`.
151
151
  - Skip clusters (`ARKORDER_MISSING_PLANE` / `ARKORDER_KERNEL_IN_DOMAIN` / `ARKORDER_GENERIC_UPDATE` / `ARKORDER_TOO_MANY_PARAMS` / `ARKORDER_INGEST_WRITES_XI` / `ARKORDER_XI_FIELD_WRITE`): place this artifact, then grind via `/ark-autopilot`. Extra not on → `/ark-adopt`. Do not invent `/ark-order`.
152
152
  - Absence of the extra is valid. Do not invent `/ark-order`. Skills never enforce.
153
153
 
@@ -106,6 +106,9 @@ the same files or weaken the gate.
106
106
  public bind. Snapshots / `requestGraph` (process or technical + Mermaid) are tooling, not a
107
107
  score. `getDependencyInformationPackage()` never includes factories, live instances, or
108
108
  input DTOs.
109
+ - Information package may carry `decisionTape` `{ xiHash, event, residual }` via
110
+ `appendDecisionTape`. Shadow / compare / replay that snapshot in-memory (not a bus, not
111
+ durable). This is still **[ArkRun]** — do not turn the tape into an ArkOrder skill.
109
112
  - In-memory stores lose state on restart — **not** production durability. Note bounded history
110
113
  (`maxHistorySize` 1000) if the hand-rolled version retained everything.
111
114
  6. **Delete the hand-rolled version** once call sites are moved — the point is
@@ -77,8 +77,8 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
77
77
  |-------|------------------|----------------|-----------------|
78
78
  | **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
79
79
  | **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
80
- | **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
81
- | **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
80
+ | **ArkRun** (extra) | Kernel usage + complete declarations; information package `decisionTape` `{ xiHash, event, residual }` | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
81
+ | **ArkOrder** (extra) | Operational pattern (ξ vs s). Valve: first `release()`, later ξ is `proposeRelease` then `apply`; `refreshSigma`; ingest residual `absorb \| escalate_up \| hold` + `reasonCode`; capacity pack as data; in-memory `ReleaseStore` | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
82
82
 
83
83
  **Rules for every report / answer:**
84
84
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).
@@ -86,7 +86,7 @@ Never invent gate verdicts from these suggestions. Missing residual is honest em
86
86
  | Skills customized after install | Preserved by default. Preview `skillDrift` shows counts. **`--refresh-skills`** rewrites customized *skills* only with consent. |
87
87
  | Conflicted managed assets | Still need `--accept-conflicts`. Never silent overwrite of true edits. |
88
88
  | Multiple checkouts / monorepo packages | One `expectedRoot` per project; upgrade **each** pin; restart MCP after bump; prefer project-local CLI until identity matched **and** process version aligns. |
89
- | Stale `~/.claude/skills` or `~/.grok/skills` | Shared homes should be the newest ArkGate on the machine (additive; never downgrade). Refresh: `--install-agent-gates --skills-only --agent-homes --force`. Project skills may lag with the pin. |
89
+ | Stale `~/.claude/skills`, `~/.grok/skills`, or `~/.gemini/config/skills` | Shared homes should be the newest ArkGate on the machine (additive; never downgrade). Refresh: `--install-agent-gates --skills-only --agent-homes --force`. Project skills may lag with the pin. Antigravity’s global catalog still refreshes when the project `.agents/skills` already exists. |
90
90
  | Active host not in `--tools` / manifest | Preview `hostSelection` notes it and suggests `--tools` expansion. |
91
91
 
92
92
  **Post-apply:** read `postUpgradeChecks` (advisory). Confirm pin↔CLI, run doctor (compass + deepModuleCoach),
@@ -124,8 +124,8 @@ ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; yo
124
124
  |-------|------------------|----------------|-----------------|
125
125
  | **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
126
126
  | **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
127
- | **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
128
- | **ArkOrder** (extra) | Operational pattern (ξ vs s) | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
127
+ | **ArkRun** (extra) | Kernel usage + complete declarations; information package `decisionTape` `{ xiHash, event, residual }` | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
128
+ | **ArkOrder** (extra) | Operational pattern (ξ vs s). Valve: first `release()`, later ξ is `proposeRelease` then `apply`; `refreshSigma`; ingest residual `absorb \| escalate_up \| hold` + `reasonCode`; capacity pack as data; in-memory `ReleaseStore` | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
129
129
 
130
130
  **Rules for every report / answer:**
131
131
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).