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
@@ -1,4 +1,4 @@
1
- import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-dy5PfTqS.js';
1
+ import { a as ArkConfigRule, f as ArkConfigLayer, A as ArkConfig } from './configTypes-0eHpocR3.js';
2
2
 
3
3
  /**
4
4
  * Policy types for the Ark kernel.
@@ -1,4 +1,4 @@
1
- import { i as Policy, P as PolicyViolation, I as IntentName, j as IntentCreator, k as IntentRelationship, b as ArchitectureProfile, D as DomainEvent, E as EventMetadata, h as PolicyEnforcementMode, A as ArchitectureLayer, c as ArchitectureRule, d as ArkCheckConfig } from './types-BuM8WNqe.js';
1
+ import { i as Policy, P as PolicyViolation, I as IntentName, j as IntentCreator, k as IntentRelationship, b as ArchitectureProfile, D as DomainEvent, E as EventMetadata, h as PolicyEnforcementMode, A as ArchitectureLayer, c as ArchitectureRule, d as ArkCheckConfig } from './types-BK47clMl.js';
2
2
 
3
3
  /**
4
4
  * PolicyEngine
@@ -862,20 +862,35 @@ type ArkRunInformationPackageComponent = {
862
862
  sends: string[];
863
863
  extendedInfo?: ArkRunExtendedInfo;
864
864
  };
865
+ declare const ARK_RUN_DECISION_TAPE_RESIDUAL_KINDS: readonly ["absorb", "escalate_up", "hold"];
866
+ type ArkRunDecisionTapeResidualKind = (typeof ARK_RUN_DECISION_TAPE_RESIDUAL_KINDS)[number];
867
+ /** Additive Order residual tape (ADR 0034 D6). Not a bus. Not durable. */
868
+ type ArkRunDecisionTapeRecord = {
869
+ xiHash: string;
870
+ event: {
871
+ kind: string;
872
+ payload?: Record<string, string | number | boolean | null>;
873
+ };
874
+ residual: {
875
+ kind: ArkRunDecisionTapeResidualKind;
876
+ reasonCode?: string;
877
+ eventId?: string;
878
+ target?: string;
879
+ };
880
+ };
865
881
  type DependencyInformationPackage = {
866
882
  schemaVersion: typeof ARK_RUN_INFORMATION_PACKAGE_SCHEMA_VERSION;
867
883
  kernelInstanceId: string;
868
884
  components: ArkRunInformationPackageComponent[];
885
+ /** Optional; omitted keeps the 4.8.x component snapshot shape. */
886
+ decisionTape?: ArkRunDecisionTapeRecord[];
869
887
  };
870
- /**
871
- * Build a JSON-serializable snapshot from unknown component records.
872
- * Only id, lifetime, the four declaration lists, and optional extendedInfo
873
- * survive — extra keys (factory, instance, DTO payloads) are dropped.
874
- */
875
888
  declare function buildDependencyInformationPackage(input: {
876
889
  kernelInstanceId?: unknown;
877
890
  components?: unknown;
891
+ decisionTape?: unknown;
878
892
  }): DependencyInformationPackage;
893
+ declare function appendDecisionTape(pack: DependencyInformationPackage, record: unknown): DependencyInformationPackage;
879
894
 
880
895
  /**
881
896
  * ArkRun requestGraph slices (RN13). Tooling only — never a gate verdict.
@@ -1234,4 +1249,4 @@ interface CreateArkKernelFromConfigOptions extends Omit<CreateArkKernelOptions,
1234
1249
  }
1235
1250
  type ArkKernelConfig = ArkCheckConfig;
1236
1251
 
1237
- export { ARK_RUN_INSPECTOR_EVENTS_PATH as $, type ArkKernel as A, type OutboxStatus as B, type CreateArkKernelOptions as C, type DefineIntentOptions as D, type EventContractRegistry as E, type OutboxRecord as F, type GraphEdge as G, type ObservabilityDriftReport as H, IntentRegistry as I, ARK_RUN_COMPONENT_LIFETIMES as J, ARK_RUN_EPHEMERAL_DEFAULT as K, ARK_RUN_GRAPH_DEFAULT_SLICE as L, type MetadataRegistry as M, ARK_RUN_GRAPH_NODE_KINDS as N, type ObservabilityReporter as O, type ProjectionRegistry as P, ARK_RUN_GRAPH_PROCESS_EDGE_KINDS as Q, type ReadModelStore as R, type SagaContext as S, type TraceRecordType as T, ARK_RUN_GRAPH_SCHEMA_VERSION as U, ARK_RUN_GRAPH_SLICES as V, type WorkflowStore as W, ARK_RUN_GRAPH_TECHNICAL_EDGE_KINDS as X, ARK_RUN_INFORMATION_PACKAGE_SCHEMA_VERSION as Y, ARK_RUN_INSPECTOR_DEFAULT_HOST as Z, ARK_RUN_INSPECTOR_DEFAULT_PORT as _, type DependencyGraph as a, InvalidArkRunSendOptionError as a$, ARK_RUN_INSPECTOR_GRAPH_PATH as a0, ARK_RUN_INSPECTOR_SCHEMA_VERSION as a1, ARK_RUN_INSPECTOR_SNAPSHOT_PATH as a2, ARK_RUN_INSPECTOR_SSE_EVENT as a3, ARK_RUN_INSPECTOR_TRANSPORT_FALLBACK as a4, ARK_RUN_TRANSPORT_KINDS as a5, type ArkManifestArchitecture as a6, type ArkManifestData as a7, type ArkManifestEntityLink as a8, type ArkManifestGraph as a9, type ArkRunInspectorSnapshotInput as aA, type ArkRunInspectorSource as aB, type ArkRunInspectorTransportFacts as aC, type ArkRunPublisher as aD, type ArkRunRegisterOptions as aE, type ArkRunRegistrationHandle as aF, type ArkRunSendOptions as aG, type ArkRunSendPlan as aH, type ArkRunSendPlanInput as aI, type ArkRunSendResult as aJ, type ArkRunTransportKind as aK, type AuditRecordInput as aL, type AuditRecordType as aM, type EntityMeta as aN, type EventContractIssue as aO, type EventHandler as aP, type EventInterceptionInfo as aQ, type EventInterceptor as aR, type EventInterceptorContext as aS, type EventPayloadPatch as aT, type EventPayloadSchema as aU, type EventPublisher as aV, type EventSchemaField as aW, type EventSchemaFieldType as aX, type FieldMeta as aY, type GraphNode as aZ, InvalidArkRunGraphQueryError as a_, type ArkManifestIntent as aa, type ArkManifestPolicy as ab, type ArkManifestProjection as ac, type ArkRunBrokerAdapter as ad, type ArkRunComponentLifetime as ae, type ArkRunDeliveredVia as af, type ArkRunExtendedInfo as ag, type ArkRunGraph as ah, type ArkRunGraphEdge as ai, type ArkRunGraphEdgeKind as aj, type ArkRunGraphMatch as ak, type ArkRunGraphMatchInput as al, type ArkRunGraphNode as am, type ArkRunGraphNodeKind as an, type ArkRunGraphProcessEdgeKind as ao, type ArkRunGraphQuery as ap, type ArkRunGraphResolvedQuery as aq, type ArkRunGraphSlice as ar, type ArkRunGraphTechnicalEdgeKind as as, type ArkRunInformationPackageComponent as at, type ArkRunInspectorBind as au, ArkRunInspectorBindError as av, type ArkRunInspectorBindInput as aw, type ArkRunInspectorHandle as ax, ArkRunInspectorProductionError as ay, type ArkRunInspectorSnapshot as az, type AuditStore as b, type ObservabilityFlow as b0, type ObservedLayerFlowMode as b1, type OutboxStore as b2, type PolicyEvaluationResult as b3, type ProjectionCheckpoint as b4, type ProjectionDefinition as b5, type PublishedEventRecord as b6, type RetryPolicy as b7, type SagaStatus as b8, type SagaStep as b9, type StartArkRunInspectorOptions as ba, type TraceSink as bb, type Unsubscribe as bc, type WorkflowDefinition as bd, type WorkflowStatus as be, type WorkflowStep as bf, arkRunGraphQueryFromSearchParams as bg, arkRunInspectorUrl as bh, buildArkRunInspectorSnapshot as bi, buildDependencyInformationPackage as bj, closeArkRunGraphQuery as bk, closedArkRunEphemeral as bl, closedArkRunTransportKind as bm, formatArkRunGraphMermaid as bn, formatArkRunInspectorSseEvent as bo, isArkRunInspectorLoopbackHost as bp, isArkRunInspectorProductionEnv as bq, requestArkRunGraph as br, resolveArkRunInspectorBind as bs, resolveArkRunSendPlan as bt, startArkRunInspector as bu, type AuditRecord as c, type AuditQuery as d, type CreateAuditTrailOptions as e, type AuditTrail as f, type EventContract as g, type EventContractValidationResult as h, type CreateProjectionRegistryOptions as i, type EventBufferStore as j, type EventBufferRecord as k, type EventBufferStatus as l, type EventBusOptions as m, type EventBus as n, type CreateObservabilityReporterOptions as o, PolicyEngine as p, type ArkManifest as q, type WorkflowSnapshot as r, type SagaDefinition as s, type CreateWorkflowEngineOptions as t, type SagaInstance as u, type WorkflowEngine as v, type DependencyInformationPackage as w, type ArkKernelConfig as x, type CreateArkKernelFromConfigOptions as y, type TraceRecord as z };
1252
+ export { ARK_RUN_INSPECTOR_EVENTS_PATH as $, type ArkKernel as A, type OutboxStatus as B, type CreateArkKernelOptions as C, type DefineIntentOptions as D, type EventContractRegistry as E, type OutboxRecord as F, type GraphEdge as G, type ObservabilityDriftReport as H, IntentRegistry as I, ARK_RUN_COMPONENT_LIFETIMES as J, ARK_RUN_EPHEMERAL_DEFAULT as K, ARK_RUN_GRAPH_DEFAULT_SLICE as L, type MetadataRegistry as M, ARK_RUN_GRAPH_NODE_KINDS as N, type ObservabilityReporter as O, type ProjectionRegistry as P, ARK_RUN_GRAPH_PROCESS_EDGE_KINDS as Q, type ReadModelStore as R, type SagaContext as S, type TraceRecordType as T, ARK_RUN_GRAPH_SCHEMA_VERSION as U, ARK_RUN_GRAPH_SLICES as V, type WorkflowStore as W, ARK_RUN_GRAPH_TECHNICAL_EDGE_KINDS as X, ARK_RUN_INFORMATION_PACKAGE_SCHEMA_VERSION as Y, ARK_RUN_INSPECTOR_DEFAULT_HOST as Z, ARK_RUN_INSPECTOR_DEFAULT_PORT as _, type DependencyGraph as a, InvalidArkRunSendOptionError as a$, ARK_RUN_INSPECTOR_GRAPH_PATH as a0, ARK_RUN_INSPECTOR_SCHEMA_VERSION as a1, ARK_RUN_INSPECTOR_SNAPSHOT_PATH as a2, ARK_RUN_INSPECTOR_SSE_EVENT as a3, ARK_RUN_INSPECTOR_TRANSPORT_FALLBACK as a4, ARK_RUN_TRANSPORT_KINDS as a5, type ArkManifestArchitecture as a6, type ArkManifestData as a7, type ArkManifestEntityLink as a8, type ArkManifestGraph as a9, type ArkRunInspectorSnapshotInput as aA, type ArkRunInspectorSource as aB, type ArkRunInspectorTransportFacts as aC, type ArkRunPublisher as aD, type ArkRunRegisterOptions as aE, type ArkRunRegistrationHandle as aF, type ArkRunSendOptions as aG, type ArkRunSendPlan as aH, type ArkRunSendPlanInput as aI, type ArkRunSendResult as aJ, type ArkRunTransportKind as aK, type AuditRecordInput as aL, type AuditRecordType as aM, type EntityMeta as aN, type EventContractIssue as aO, type EventHandler as aP, type EventInterceptionInfo as aQ, type EventInterceptor as aR, type EventInterceptorContext as aS, type EventPayloadPatch as aT, type EventPayloadSchema as aU, type EventPublisher as aV, type EventSchemaField as aW, type EventSchemaFieldType as aX, type FieldMeta as aY, type GraphNode as aZ, InvalidArkRunGraphQueryError as a_, type ArkManifestIntent as aa, type ArkManifestPolicy as ab, type ArkManifestProjection as ac, type ArkRunBrokerAdapter as ad, type ArkRunComponentLifetime as ae, type ArkRunDeliveredVia as af, type ArkRunExtendedInfo as ag, type ArkRunGraph as ah, type ArkRunGraphEdge as ai, type ArkRunGraphEdgeKind as aj, type ArkRunGraphMatch as ak, type ArkRunGraphMatchInput as al, type ArkRunGraphNode as am, type ArkRunGraphNodeKind as an, type ArkRunGraphProcessEdgeKind as ao, type ArkRunGraphQuery as ap, type ArkRunGraphResolvedQuery as aq, type ArkRunGraphSlice as ar, type ArkRunGraphTechnicalEdgeKind as as, type ArkRunInformationPackageComponent as at, type ArkRunInspectorBind as au, ArkRunInspectorBindError as av, type ArkRunInspectorBindInput as aw, type ArkRunInspectorHandle as ax, ArkRunInspectorProductionError as ay, type ArkRunInspectorSnapshot as az, type AuditStore as b, type ObservabilityFlow as b0, type ObservedLayerFlowMode as b1, type OutboxStore as b2, type PolicyEvaluationResult as b3, type ProjectionCheckpoint as b4, type ProjectionDefinition as b5, type PublishedEventRecord as b6, type RetryPolicy as b7, type SagaStatus as b8, type SagaStep as b9, type StartArkRunInspectorOptions as ba, type TraceSink as bb, type Unsubscribe as bc, type WorkflowDefinition as bd, type WorkflowStatus as be, type WorkflowStep as bf, appendDecisionTape as bg, arkRunGraphQueryFromSearchParams as bh, arkRunInspectorUrl as bi, buildArkRunInspectorSnapshot as bj, buildDependencyInformationPackage as bk, closeArkRunGraphQuery as bl, closedArkRunEphemeral as bm, closedArkRunTransportKind as bn, formatArkRunGraphMermaid as bo, formatArkRunInspectorSseEvent as bp, isArkRunInspectorLoopbackHost as bq, isArkRunInspectorProductionEnv as br, requestArkRunGraph as bs, resolveArkRunInspectorBind as bt, resolveArkRunSendPlan as bu, startArkRunInspector as bv, type AuditRecord as c, type AuditQuery as d, type CreateAuditTrailOptions as e, type AuditTrail as f, type EventContract as g, type EventContractValidationResult as h, type CreateProjectionRegistryOptions as i, type EventBufferStore as j, type EventBufferRecord as k, type EventBufferStatus as l, type EventBusOptions as m, type EventBus as n, type CreateObservabilityReporterOptions as o, PolicyEngine as p, type ArkManifest as q, type WorkflowSnapshot as r, type SagaDefinition as s, type CreateWorkflowEngineOptions as t, type SagaInstance as u, type WorkflowEngine as v, type DependencyInformationPackage as w, type ArkKernelConfig as x, type CreateArkKernelFromConfigOptions as y, type TraceRecord as z };
package/docs/README.md CHANGED
@@ -46,7 +46,7 @@ Product site: [arkgate.online](https://www.arkgate.online/) · npm: [`arkgate`](
46
46
  |-----|------------|
47
47
  | [CONTRIBUTING.md](../CONTRIBUTING.md) | Setup, rules, PR/release |
48
48
  | [ROADMAP.md](../ROADMAP.md) | Live implementation queue (one `doing` at a time). History: [archive/roadmap-history.md](archive/roadmap-history.md) |
49
- | [adr/](adr/README.md) | Architecture decisions ([0032](adr/0032-writes-via-aggregate-sensor.md) writes-via-aggregate · [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) ArkOrder runtime half) |
49
+ | [adr/](adr/README.md) | Architecture decisions ([0032](adr/0032-writes-via-aggregate-sensor.md) writes-via-aggregate · [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) ArkOrder runtime half · [0034](adr/0034-arkorder-valved-loop.md) valved loop) |
50
50
  | [SECURITY.md](../SECURITY.md) · [threat-model.md](threat-model.md) | Security |
51
51
 
52
52
  ---
@@ -58,13 +58,14 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
58
58
  | Area | Path |
59
59
  |------|------|
60
60
  | 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) |
61
- | 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)). [arkorder-arkrun](plans/arkorder-arkrun/README.md) (Phase XP; `XP01`–`XP08` done on tree; **4.8.5** prepared; ADR [0033](adr/0033-arkorder-runtime-half-is-arkrun.md)). |
61
+ | 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)). [arkorder-arkrun](plans/arkorder-arkrun/README.md) (Phase XP; `XP01`–`XP08` done; shipped **4.8.5**; ADR [0033](adr/0033-arkorder-runtime-half-is-arkrun.md)). [arkorder-valve-loop](plans/arkorder-valve-loop/README.md) (Phase LV; `LV01`–`LV09` done; shipped **4.8.6**; [ADR 0034](adr/0034-arkorder-valved-loop.md); does not close K01). [layer-description-projection](plans/layer-description-projection/README.md) (Phase LD; `LD01`–`LD06` done on tree; **4.8.7** prepared; [ADR 0035](adr/0035-layer-description-projection.md); project `layers[].description`; no schema bump). |
62
62
  | Claims audit | [audit/claims-matrix.md](audit/claims-matrix.md) |
63
63
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
64
64
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
65
65
 
66
- Current tree: [releases/4.8.5.md](releases/4.8.5.md) (`arkgate@4.8.5`, prepared). Current published: [releases/4.8.4.md](releases/4.8.4.md) (`arkgate@4.8.4` on npm `latest`; does not close `K01`).
67
- Prior: [releases/4.8.3.md](releases/4.8.3.md) · [releases/4.8.2.md](releases/4.8.2.md) · [releases/4.8.1.md](releases/4.8.1.md) · [4.8.0](releases/4.8.0.md) · [4.7.6](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).
66
+ Current published: [releases/4.8.6.md](releases/4.8.6.md) (`arkgate@4.8.6` on npm `latest`; does not close `K01`).
67
+ Tree: [releases/4.8.7.md](releases/4.8.7.md) (`arkgate@4.8.7` prepared).
68
+ Prior: [releases/4.8.5.md](releases/4.8.5.md) · [releases/4.8.4.md](releases/4.8.4.md) · [releases/4.8.3.md](releases/4.8.3.md) · [releases/4.8.2.md](releases/4.8.2.md) · [releases/4.8.1.md](releases/4.8.1.md) · [4.8.0](releases/4.8.0.md) · [4.7.6](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).
68
69
  Older notes: [releases/](releases/). Config: [configuration.md](configuration.md).
69
70
 
70
71
  ---
@@ -507,6 +507,8 @@ npx ark-check --promote <ruleId> --apply # write mode "enforced" into that
507
507
  **`--sensors`** lists every sensor ArkGate ships — ArkRules, ArkRun and
508
508
  ArkOrder — with its plane, its tier and whether it can *ever* be enforced, so
509
509
  Tier-2 shows up before you write the rule rather than after you wait for a run.
510
+ ArkOrder: `proposeRelease` then `apply`; `refreshSigma`; ingest residual;
511
+ capacity pack; `ReleaseStore`; ArkRun `decisionTape`. No `/ark-order` skill.
510
512
  It also says *how*: only the ArkRules plane is promoted per rule; ArkRun and
511
513
  ArkOrder are switched by the plane-level `arkRun.mode` / `arkOrder.mode`, and
512
514
  `--promote --apply` writes ArkRules documents only.
package/docs/ai-gates.md CHANGED
@@ -33,8 +33,11 @@ Prefer fail-closed honesty over fake hard guarantees on advisory hosts.
33
33
  Everything below uses the same `ark.config.json` as `arkgate-check` / `ark-check` (CI) — one
34
34
  rules file shared by every surface. From **4.0**, optional **ArkRules** (`arkRules` map +
35
35
  `arkrules/*.json`) ride the **same** write path, doctor, and CI adapter; absence of ArkRules
36
- does not change inter-layer verdicts. Label residual **`[Layer]`** vs **`[ArkRules]`**. See
37
- [configuration ArkRules](configuration.md#arkrules-intra-layer-opt-in).
36
+ does not change inter-layer verdicts. Optional ArkRun / ArkOrder extras ride that envelope
37
+ when on (`proposeRelease` then `apply`). Absence is silent. Label residual **`[Layer]`** vs
38
+ **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**. See
39
+ [configuration — ArkRules](configuration.md#arkrules-intra-layer-opt-in) ·
40
+ [ArkOrder](arkorder.md).
38
41
 
39
42
  Generate the layer contract once:
40
43
 
package/docs/arkorder.md CHANGED
@@ -8,12 +8,13 @@ Import: `arkgate/order` (same npm package `arkgate`). Off until you add
8
8
  `arkOrder` on schema `1.3`. Absence is silent. In-memory. Not durable. It is
9
9
  a library plus sensors, not a service. Does **not** replace ArkRun.
10
10
 
11
- First-contact copy: freeze / four verbs / no `update`. Haken (ξ vs s) lives
12
- below.
11
+ First-contact copy: freeze through a valve / no `update`. Haken (ξ vs s) lives
12
+ below. **ArkOrder freezes the pattern through a valve. ArkRun is how the residual travels.**
13
13
 
14
14
  Canonical plan seed: [plans/arkorder/README.md](plans/arkorder/README.md).
15
15
  ADRs: [0027](adr/0027-arkorder-gated-extra-plane.md)–[0030](adr/0030-opt-in-extras-same-npm-package.md),
16
- [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) (runtime half is ArkRun).
16
+ [0033](adr/0033-arkorder-runtime-half-is-arkrun.md) (runtime half is ArkRun),
17
+ [0034](adr/0034-arkorder-valved-loop.md) (valved loop; public verbs in 4.8.6).
17
18
  Config: [configuration.md](configuration.md). Surface:
18
19
  [package-surface.md](package-surface.md#experimental-opt-in-surfaces).
19
20
 
@@ -24,7 +25,7 @@ Config: [configuration.md](configuration.md). Surface:
24
25
  | Is | Is not |
25
26
  |----|--------|
26
27
  | A **library** (`createOrderPlane`) plus **static sensors** | A running service, daemon, or hosted plane |
27
- | Four verbs: `release` / `project` / `ingest` / `proposeRelease` | A generic `update` / `patch` / `set` |
28
+ | Valved verbs: `release` / `project` / `ingest` / `proposeRelease` / `apply` / `refreshSigma` | A generic `update` / `patch` / `set` |
28
29
  | Opt-in extra on `ark.config.json` | Always-on; compact starters leave it off |
29
30
  | Consumer-named slow keys (`xiKeys`) | A construction OS, BIM, or FirmPack |
30
31
  | Same npm tarball | not `@arkgate/order` |
@@ -49,10 +50,10 @@ They already exist:
49
50
 
50
51
  | Ask | API | Since |
51
52
  |-----|-----|-------|
52
- | Escalation as a first-class concept | `IngestResult = IngestAbsorb \| IngestEscalate` (`kind`, `reason`) | 4.8.0 |
53
+ | Escalation as a first-class concept | `IngestResult` residual `absorb \| escalate_up \| hold` (`reasonCode`, `IngestEscalate.target`) | 4.8.0 / 4.8.6 |
53
54
  | Projection at the boundary | `Projector = (release, sigma) => Projection` | 4.8.0 |
54
55
  | Cap on badly designed slow parameters | `DEFAULT_MAX_XI_KEYS = 7`, `maxXiKeys`, `ARKORDER_TOO_MANY_PARAMS`, `ARKORDER_EMPTY_XI`, `ARKORDER_NESTED_XI` | 4.8.0 |
55
- | Valved proposals, never direct mutation | `ProposeResult { nextXi, blastRadius, invalidations }` | 4.8.0 |
56
+ | Valved proposals, never direct mutation | `ProposeResult` then `apply` (`ARKORDER_UNVALVED_RELEASE`) | 4.8.0 / 4.8.6 |
56
57
  | Typed cell schema | `XiSchema` / `XiPropertySchema` | 4.8.0 |
57
58
  | Named slow keys on the write path | `arkOrder.xiKeys`; `ARKORDER_XI_FIELD_WRITE` | 4.8.3 |
58
59
  | Factory isolation | `createOrderPlane` from `arkgate/order` only | 4.8.0 |
@@ -60,13 +61,20 @@ They already exist:
60
61
  | σ freshness, never ξ | `sigmaMaxAgeMs` / `σ.freshUntil`; `ARKORDER_XI_TTL`, `ARKORDER_STALE_SIGMA` | 4.8.5 |
61
62
  | Escalate to a person | `IngestEscalate.target` including `human` | 4.8.5 |
62
63
  | Shadow / replay / compare | ArkRun `shadowInformationPackage` / `compareInformationPackages` / `replayInformationPackages` | 4.8.5 |
64
+ | Decision tape | ArkRun information package `decisionTape` `{ xiHash, event, residual }` | 4.8.6 |
65
+ | σ vs ξ identity | `xiHash` / `sigmaHash` / `refreshSigma` | 4.8.6 |
66
+ | Capacity as data | `ConstraintPack.capacity` (`kind` / `sigmaKey` / `payloadKey` / `op`) | 4.8.6 |
67
+ | Store port | `ReleaseStore` / `createMemoryReleaseStore` in-memory default — not durable, not K01 | 4.8.6 |
68
+ | Thin travel helper | `ingestTravelAction` absorb→`send` / escalate_up human→`raises` | 4.8.6 |
63
69
 
64
70
  Nothing here is a hosted runtime. Nothing here can be “down”. A degraded-mode
65
71
  contract would defend against an outage that cannot happen.
66
72
 
67
73
  ---
68
74
 
69
- ## Four verbs
75
+ ## Valved loop
76
+
77
+ **ArkOrder freezes the pattern through a valve. ArkRun is how the residual travels.**
70
78
 
71
79
  ```ts
72
80
  import { createOrderPlane } from 'arkgate/order';
@@ -76,26 +84,32 @@ const plane = createOrderPlane({
76
84
  xiSchema, // JSON Schema object; additionalProperties false
77
85
  maxXiKeys, // default 7
78
86
  clocks, // injected; Domain must not call Date.now
79
- packs, // data, not user predicates
87
+ packs, // data, not user predicates (capacity is kind/sigmaKey/payloadKey/op)
80
88
  informationBudget, // optional { cannotObserve: ['ledger'] } — not a config key
81
89
  sigmaMaxAgeMs, // optional σ freshness; never on ξ — not a config key
90
+ store, // optional ReleaseStore; default in-memory is not durable
91
+ catalogDigest, // optional; keyed by ξ.catalogReleaseId — SKU set does not enter the hash
82
92
  });
83
93
 
84
- plane.release(xi, sigma); // freeze, version, hash. No in-place mutate
94
+ plane.release(xi, sigma); // first freeze only
85
95
  plane.project(); // derive allowed s + invalidations
86
- plane.ingest(event); // absorb or escalate. Never returns a Release
96
+ plane.ingest(event); // residual absorb | escalate_up | hold. Never a Release
87
97
  plane.proposeRelease(delta); // blast radius. Empty blast = domain error
98
+ plane.apply(proposal); // valve: later ξ change
99
+ plane.refreshSigma(sigma); // saldo / clocks; xiHash unchanged
88
100
  ```
89
101
 
90
102
  There is no `update()`. Calling `update` / `patch` / `set` on the plane throws
91
103
  `ARKORDER_FORBIDDEN_METHOD` and, on the write path, emits
92
- `ARKORDER_GENERIC_UPDATE`.
104
+ `ARKORDER_GENERIC_UPDATE`. A second `release()` whose ξ differs fails
105
+ `ARKORDER_UNVALVED_RELEASE`.
93
106
 
94
107
  | Field write | Verb |
95
108
  |-------------|------|
96
- | Invoice, seat within cap, timesheet, daily log | `ingest` → absorb |
97
- | Over cap / invariant pressure | `ingest` → escalate |
98
- | Change plan / protocol / cost-code bound | `proposeRelease` then `release` |
109
+ | Invoice, seat within cap, timesheet, daily log | `ingest` → absorb (`ingestTravelAction` may `send`) |
110
+ | Over cap (capacity pack) / stale σ | `ingest` → hold |
111
+ | Kind not in h(ξ) | `ingest` escalate_up (`target: human`; `ingestTravelAction` may `raises`) |
112
+ | Change plan / protocol / cost-code bound | `proposeRelease` then `apply` |
99
113
  | PATCH the slow key through Prisma/Drizzle | `ARKORDER_XI_FIELD_WRITE` |
100
114
 
101
115
  Copy [examples/arkorder-billing/](../examples/arkorder-billing/) and rename the
@@ -199,6 +213,10 @@ Durability (`K01`) stays parked. In-memory is the honesty line.
199
213
 
200
214
  If a “slow parameter” changes with every click, it is not an order parameter.
201
215
 
216
+ The valved loop ships in **4.8.6** ([ADR 0034](adr/0034-arkorder-valved-loop.md)).
217
+ In-memory `ReleaseStore` is **not** durable. Doctor / status `arkOrder` stays
218
+ `notAScore`. This does **not** close `K01` / `Z09`. No `/ark-order` skill.
219
+
202
220
  ---
203
221
 
204
222
  ## Next step
@@ -131,8 +131,10 @@ Top-level fields:
131
131
  `enforced` mode fails closed (`ARKORDER_MISSING_PLANE`). `xiKeys` are the 3–5 slow
132
132
  names the product already knows (plan, protocol, cost-code bound). Empty `xiKeys`
133
133
  leaves `ARKORDER_XI_FIELD_WRITE` silent. Membership ids are not keys. Factory options
134
- `informationBudget` and `sigmaMaxAgeMs` belong on `createOrderPlane`, not this extra
135
- object. Demotion or deletion is a policy-delta **weakening**. Field ingest never mints
134
+ `informationBudget`, `sigmaMaxAgeMs`, `store` (`ReleaseStore`), and capacity packs
135
+ belong on `createOrderPlane`, not this extra object. Later ξ is `proposeRelease`
136
+ then `apply`; `refreshSigma`; ingest residual `absorb | escalate_up | hold`.
137
+ Demotion or deletion is a policy-delta **weakening**. Field ingest never mints
136
138
  a pattern.
137
139
 
138
140
  **Activation is one shape.** ArkRun and ArkOrder both use `mode` + `managedLayers`.
@@ -142,7 +144,28 @@ name different factories: `arkRun.kernelRoots` (`compositionRoots` alias) vs
142
144
 
143
145
  Layer fields:
144
146
 
145
- - `name`, `patterns`, `exclude`, `description`
147
+ - `name`, `patterns`, `exclude`
148
+ - **`layers[].description`** (optional) — **app-context caption**: one product sentence for what
149
+ this folder is *in the app*, not architecture jargon. `/ark-place` prints it next to
150
+ the layer name and globs; doctor, coverage, and the HTML report show the same text.
151
+ Changing the sentence does **not** change `policyHash` (same strip as `stewards`) and
152
+ does **not** need a weakening ack. Absence is silent: never fails `--strict-config`,
153
+ never invents a doctor residual, never flips `valid`. Empty string is invalid JSON for
154
+ the field (`minLength: 1`). Compact starters may omit it. `/ark-adopt` writes it when
155
+ the product map or glossary names the house; it does not invent captions. No
156
+ `/ark-describe`.
157
+
158
+ ```json
159
+ "layers": [
160
+ {
161
+ "name": "Application",
162
+ "patterns": ["src/application/**"],
163
+ "description": "Purchase requests — from asked to received."
164
+ }
165
+ ]
166
+ ```
167
+
168
+ That sentence is product copy. Not “Rich domain model, business rules, and domain events.”
146
169
  - `intentPrefixes`, `forbiddenGlobals`, `mayImportInfrastructure`, `optional`
147
170
  - `reserved` / `allowEmpty` — future houses whose globs match nothing yet. `--strict-config` does not fail; `CONFIG_LAYER_PATTERN_NO_MATCHES` (typo warning) is skipped. A typo warning fires only when the glob is not reserved.
148
171
  - `capabilities: { deny: [...] }` — opt-in effect walls over the seven capability ids
@@ -246,7 +269,7 @@ See [brownfield adoption](brownfield-adoption.md#nextjs-honesty-default-overlays
246
269
  | **Structure sensors** | Intra-layer heuristics | Only `mode: "enforced"` |
247
270
  | **Invariants** | Catalog + coverage evidence (not a business runtime) | Only enforced + proven-uncovered |
248
271
  | **ArkRun** (opt-in extra) | Kernel usage + complete declarations | Only `arkRun.mode: "enforced"` when classified |
249
- | **ArkOrder** (opt-in extra) | Frozen pattern + four verbs (no `update`) | Only `arkOrder.mode: "enforced"` when classified |
272
+ | **ArkOrder** (opt-in extra) | Frozen pattern; first freeze `release()`, later ξ is `proposeRelease` then `apply` (no `update`) | Only `arkOrder.mode: "enforced"` when classified |
250
273
 
251
274
  Absence of `arkRules`, `arkRun`, or `arkOrder` adds **no** extra merge teeth. **Advisory** structure sensors, advisory
252
275
  invariants, advisory ArkRun, and advisory ArkOrder also add **no** merge teeth (FG-ARKRULES-ADVISORY-ONLY / ADR 0020 / ADR 0027) — packing every starter
@@ -351,7 +374,7 @@ changing either contract changes its hash and invalidates the acknowledgement.
351
374
 
352
375
  Optional `stewards` lists **GitHub handles or emails** who may **loosen** the contract or
353
376
  **grow** the baseline (`pedroknigge` or `pedroknigge@users.noreply.github.com` — not
354
- `Pedro Knigge`). The field is metadata — it does not change the policy hash. The lock
377
+ `Pedro Knigge`). The field is metadata — it does not change the policy hash. `layers[].description` is stripped the same way (caption-only edits do not change `policyHash` and do not need a weakening ack; `contractHash` still fingerprints the raw config). The lock
355
378
  matches `--author`, then `GITHUB_ACTOR` / `ARK_STEWARD`, then `GIT_AUTHOR_EMAIL`. A
356
379
  noreply GitHub mail and the handle are the same person. Git `user.name` is not identity.
357
380
 
package/docs/develop.md CHANGED
@@ -202,9 +202,14 @@ The plane is `arkgate/order` in package `arkgate`, not a second install.
202
202
  stays plane-free. Empty `planeRoots` in `enforced` mode fails closed
203
203
  (`ARKORDER_MISSING_PLANE`). In-memory. Not durable. Does not replace ArkRun.
204
204
 
205
+ First freeze is `release()`. Later pattern change is `proposeRelease` then
206
+ `apply` (`ARKORDER_UNVALVED_RELEASE`). `refreshSigma`; ingest residual
207
+ `absorb | escalate_up | hold` + `reasonCode`; capacity pack as data;
208
+ `createMemoryReleaseStore`; `ingestTravelAction`; ArkRun `decisionTape`.
209
+
205
210
  Copy [examples/arkorder-billing/](../examples/arkorder-billing/) (`plan` / `cycle` /
206
- `tenancy`) and rename the keys. Posting an invoice is absorbed; changing plan is a
207
- new release. See [configuration.md](configuration.md) and
211
+ `tenancy`) and rename the keys. Posting an invoice is absorbed; changing plan is
212
+ `proposeRelease` then `apply`. See [configuration.md](configuration.md) and
208
213
  [package-surface.md](package-surface.md).
209
214
 
210
215
  ---
@@ -57,6 +57,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
57
57
  | [`ARKORDER_GENERIC_UPDATE`](#ARKORDER_GENERIC_UPDATE) | arkorder | Generic update of ξ |
58
58
  | [`ARKORDER_TOO_MANY_PARAMS`](#ARKORDER_TOO_MANY_PARAMS) | arkorder | Too many slow keys |
59
59
  | [`ARKORDER_INGEST_WRITES_XI`](#ARKORDER_INGEST_WRITES_XI) | arkorder | ingest assigned into ξ |
60
+ | [`ARKORDER_UNVALVED_RELEASE`](#ARKORDER_UNVALVED_RELEASE) | arkorder | Unvalved second freeze of ξ |
60
61
  | [`INVALID_CHANGE_PATH`](#INVALID_CHANGE_PATH) | preflight | Unsafe change path |
61
62
  | [`DUPLICATE_CHANGE_PATH`](#DUPLICATE_CHANGE_PATH) | preflight | Duplicate path in change set |
62
63
  | [`DELETE_TARGET_MISSING`](#DELETE_TARGET_MISSING) | preflight | Delete target missing |
@@ -395,7 +396,7 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
395
396
  **Generic update of ξ**
396
397
 
397
398
  - **Why:** A call to update/patch/set on the order plane rewrites the slow pattern. Haken slaving forbids generic ξ mutation.
398
- - **Fix:** Use release() to freeze ξ or proposeRelease() for a pattern change with blast radius, then preflight again. Never mechanical-safe.
399
+ - **Fix:** Use release() for the first freeze of ξ. Later pattern change is proposeRelease then apply(ProposeResult). Never update/patch/set. Never mechanical-safe.
399
400
 
400
401
  <a id="ARKORDER_TOO_MANY_PARAMS"></a>
401
402
 
@@ -412,8 +413,8 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
412
413
 
413
414
  **ingest assigned into ξ**
414
415
 
415
- - **Why:** An ingest() result is written into a Release or ξ store. ingest may absorb or escalate; it never mints a pattern.
416
- - **Fix:** Keep ingest results as absorb/escalate only. Change ξ with proposeRelease + release. Never mechanical-safe.
416
+ - **Why:** An ingest() result is written into a Release or ξ store. ingest may absorb, escalate_up, or hold; it never mints a pattern.
417
+ - **Fix:** Keep ingest results as absorb/escalate_up/hold only. Change ξ with proposeRelease then apply(ProposeResult). Never mechanical-safe.
417
418
 
418
419
  <a id="ARKORDER_XI_FIELD_WRITE"></a>
419
420
 
@@ -422,7 +423,7 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
422
423
  **Slow key written around the order plane**
423
424
 
424
425
  - **Why:** A managed-layer file imports a persistence driver and writes a declared arkOrder.xiKeys name. Field events absorb or escalate; they do not PATCH the slow pattern.
425
- - **Fix:** Keep invoices, seats, hours, and logs on ingest. Change the slow key with proposeRelease + release, then preflight again. Never mechanical-safe.
426
+ - **Fix:** Keep invoices, seats, hours, and logs on ingest. Change the slow key with proposeRelease then apply(ProposeResult), then preflight again. Never mechanical-safe.
426
427
 
427
428
  <a id="ARKORDER_INFORMATION_BUDGET"></a>
428
429
 
@@ -449,7 +450,16 @@ Haken slaving: few slow keys (ξ) determine derived fast state. Field ingest nev
449
450
  **σ is stale**
450
451
 
451
452
  - **Why:** ingest ran after σ.freshUntil (or sigmaMaxAgeMs). ξ does not TTL.
452
- - **Fix:** Refresh σ and ingest again, or freeze a new release if the pattern changed. Never mechanical-safe.
453
+ - **Fix:** Call refreshSigma and ingest again, or proposeRelease then apply(ProposeResult) if the pattern changed. Never mechanical-safe.
454
+
455
+ <a id="ARKORDER_UNVALVED_RELEASE"></a>
456
+
457
+ ### `ARKORDER_UNVALVED_RELEASE`
458
+
459
+ **Unvalved second freeze of ξ**
460
+
461
+ - **Why:** release() ran after a pattern was already frozen and the new ξ differs. First freeze is release(); later pattern change is proposeRelease then apply.
462
+ - **Fix:** Change ξ with proposeRelease then apply(ProposeResult). release() is only the first freeze. Never mechanical-safe.
453
463
 
454
464
  ## Atomic preflight and change sets
455
465
 
@@ -51,14 +51,15 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
51
51
  | **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`. |
52
52
  | **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. |
53
53
  | **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. |
54
- | **`ark.config.json`** | Layer globs, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`coverage`** controls (`testGlobs`, `maxFiles`); 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 `coverage`, `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). |
54
+ | **`ark.config.json`** | Layer globs, optional `layers[].description`, rules, include/exclude, forbiddenGlobals, intent prefixes, `peerIsolation`, `dynamicImportAllowlist`, `safety` thresholds; optional **`coverage`** controls (`testGlobs`, `maxFiles`); 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 `coverage`, `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). |
55
+ | **Layer caption (`layers[].description`, 4.8.7)** | Optional string on each layer. Projected onto `ark_place` / prepare-write / MCP place JSON, doctor JSON + human, coverage JSON, and the HTML Purpose column when present. `/ark-adopt` writes it from the product map or glossary; `/ark-place` prints it next to layer name + globs. | Existing optional field — **no `schemaVersion` bump**, no new key, no 14th skill. Copy is **app context** (a product sentence such as `Purchase requests — from asked to received.`), not architecture jargon. Stripped from `policyHash` like `stewards`; caption-only edits are neutral. Absence is silent: never a residual, never a score, never `--strict-config` fail, never flips `valid`. Compact starters may omit. |
55
56
  | **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. |
56
57
  | **`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`. |
57
58
  | **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. |
58
59
  | **Managed upgrade self-service honesty (4.5 / DF05)** | `ark upgrade [--json]` → `selfService` (+ human “Self-service honesty” lines) | Additive, advisory. Answers without a maintainer: write-path activation labels per selected host (`hard`\|`advisory`\|`unavailable`) and customized content-identity preserve (`customizedPaths` / `customizedContentPreserved`). Soft hosts never hard; upgrade never invents `hardWriteActive` from disk alone. Always `notAScore: true`. Not a gate input; not part of `planDigest`. |
59
60
  | **Product honesty readiness split (4.1.1)** | doctor JSON `productHonesty` | Additive. `unfinished` / `headline` / `primaryNextAction` / `reasonIds` remain; EH adds `contractReadiness` (`ready`\|`partial`\|`not-ready`), `localWriteBoundary` (`advisory`\|`hard`\|`unverified`\|`unknown`), `architectureReasonIds`, `environmentResidualIds` / `environmentResiduals`. Soft-write hosts stay in evidence without alone forcing global **Not finished**. `notAScore: true` always. |
60
61
  | **Policy transition analysis (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. |
61
- | **Team parliament (law vs feature)** | Optional `stewards` on `ark.config.json` (GitHub handle or email); CLI `--changed` / `--against` / `--base` / `--contract-diff` / `--contract-session` / `--persona` / `--author`; check JSON `teamParliament`; `ark status --vs`; write-gate mixed-batch deny | Additive. Law files must not mix with product source. Loosen / baseline-grow are steward-only when `stewards` is set. `--against` ratchets vs the base-ref baseline. `--changed` scans touched sources. `stewards` is excluded from policy hash. Identity is handle or email, not git `user.name`. No org plane. |
62
+ | **Team parliament (law vs feature)** | Optional `stewards` on `ark.config.json` (GitHub handle or email); CLI `--changed` / `--against` / `--base` / `--contract-diff` / `--contract-session` / `--persona` / `--author`; check JSON `teamParliament`; `ark status --vs`; write-gate mixed-batch deny | Additive. Law files must not mix with product source. Loosen / baseline-grow are steward-only when `stewards` is set. `--against` ratchets vs the base-ref baseline. `--changed` scans touched sources. `stewards` and `layers[].description` are excluded from policy hash. Identity is handle or email, not git `user.name`. No org plane. |
62
63
  | **Atomic change preflight (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. |
63
64
  | **Architecture change map (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. |
64
65
  | **Structural convergence (3.1.0)** | `analyzeArchitectureConvergence(...)`; map-enabled `preflightChange(...)`; existing CLI/MCP preflight adapters | Additive `convergence` result with stable `satisfied`, `missing`, `contradictory`, and `unplanned` findings. Uses the supplied/current project tree as base and the explicit complete change set as candidate; no implicit Git or LLM input. `readOnly: true`; `behavioralCompletion: "not-evaluated"`. Structural mismatch makes preflight invalid. |
@@ -161,21 +162,24 @@ The type-only root exports are also semver-supported:
161
162
  - Config contract: `ArkConfig`, `ArkConfigLoadResult`.
162
163
 
163
164
  Runtime-kernel factories, `CAPABILITY_IDS`, `collectCapabilityUses`, and Domain capability mapping
164
- helpers are deliberately absent from this root. Use `@arkgate/runtime` for the experimental
165
- **ArkRun** kernel, and `analyzeProject(...).ir.capabilityUses` for public capability evidence.
165
+ helpers are deliberately absent from this root. Use `arkgate/runtime` for the
166
+ **ArkRun** kernel (experimental here means **durability**: in-memory stores, not
167
+ Postgres), and `analyzeProject(...).ir.capabilityUses` for public capability evidence.
166
168
 
167
169
  ---
168
170
 
169
171
  ## Experimental opt-in surfaces
170
172
 
171
- These APIs are implemented for evaluation and compatibility, but they are **not production-ready
172
- product claims**. Static architecture enforcement does not depend on them.
173
+ **Experimental** names **durability** (in-memory stores, not Postgres) not the extras
174
+ themselves. ArkRun and ArkOrder are opt-in extras of package `arkgate`. These APIs are
175
+ implemented for evaluation and compatibility; they are **not** production durability
176
+ claims. Static architecture enforcement does not depend on them.
173
177
 
174
178
  | Surface | Import path | Notes |
175
179
  |---------|-------------|--------|
176
- | **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). **Shadow / replay / compare** (`shadowInformationPackage`, `compareInformationPackages`, `replayInformationPackages`) are in-memory helpers on that snapshot — not durable, not a second bus (ADR 0033). 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). |
180
+ | **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). **Shadow / replay / compare** (`shadowInformationPackage`, `compareInformationPackages`, `replayInformationPackages`) are in-memory helpers on that snapshot — not durable, not a second bus (ADR 0033). **Decision tape** `decisionTape` `{ xiHash, event, residual }` via `appendDecisionTape` (ADR 0034). 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). |
177
181
  | **NestJS adapter** | **`arkgate/nestjs`** | Experimental optional peer `@nestjs/common` for the ArkRun kernel. Same npm package. `@arkgate/runtime/nestjs` is deprecated. |
178
- | **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. Factory options (not config keys): `informationBudget.cannotObserve`, `sigmaMaxAgeMs` (freshness on σ, never ξ). `IngestEscalate.target` includes `human`. Root `arkgate` export does **not** include the factory. Optional extra `arkOrder` on schema `1.3`. In-memory; not durable. Does not replace ArkRun. Runtime half (shadow/replay/compare) is ArkRun (ADR 0033). Canonical: [ArkOrder](arkorder.md). |
182
+ | **ArkOrder plane** | **`arkgate/order`** | Public brand **ArkOrder**. Same npm package `arkgate` (ADR 0030) — not `@arkgate/order`. Factory `createOrderPlane`. Valved verbs: `release` / `project` / `ingest` / `proposeRelease` / `apply` / `refreshSigma`. No `update`. First freeze is `release()`; later ξ change is `apply` (`ARKORDER_UNVALVED_RELEASE`). Haken: few slow keys; ingest residual `absorb | escalate_up | hold` + closed `reasonCode`; empty blast fails closed. Capacity pack as data (`kind` / `sigmaKey` / `payloadKey` / `op`). Factory options (not config keys): `informationBudget.cannotObserve`, `sigmaMaxAgeMs`, `store` (`ReleaseStore` / `createMemoryReleaseStore`), `catalogDigest`. Thin travel: `ingestTravelAction` absorb→`send` / escalate_up human→`raises`. `IngestEscalate.target` includes `human`. Root `arkgate` export does **not** include the factory. Optional extra `arkOrder` on schema `1.3`. In-memory; not durable; does not close K01. Does not replace ArkRun. Runtime half (shadow/replay/compare + `decisionTape` / `appendDecisionTape`) is ArkRun (ADR 0033 / 0034). Canonical: [ArkOrder](arkorder.md). |
179
183
 
180
184
  ---
181
185
 
@@ -241,16 +245,18 @@ production deployment would need to satisfy; it is not a readiness certification
241
245
  | Break CLI JSON field, MCP tool rename, or required `ark.config` field | **major** |
242
246
  | New optional config field, new CLI flag, additive JSON | **minor** |
243
247
  | Bugfix with no contract change | **patch** |
244
- | Additive experimental ArkRun kernel API | `@arkgate/runtime` prerelease/minor |
245
- | Remove deprecated `arkgate/runtime` / `arkgate/nestjs` forwarding shims | **Done (AR04)** — use `@arkgate/runtime` / `@arkgate/runtime/nestjs` |
248
+ | Additive experimental ArkRun kernel API | `arkgate/runtime` patch/minor (`@arkgate/runtime` is deprecated) |
249
+ | Remove deprecated `arkgate/runtime` / `arkgate/nestjs` forwarding shims | **Done (AR04)** — use `arkgate/runtime` / `arkgate/nestjs` |
246
250
 
247
251
  ---
248
252
 
249
253
  ## Release notes (maintainers)
250
254
 
251
255
  Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
252
- (current tree prepared: [4.8.5.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.5.md);
253
- current published: [4.8.4.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.4.md);
256
+ (current tree prepared: [4.8.7.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.7.md);
257
+ current published: [4.8.6.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.6.md);
258
+ prior published: [4.8.5.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.5.md);
259
+ prior published: [4.8.4.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.4.md);
254
260
  prior published: [4.8.3.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.3.md);
255
261
  prior published: [4.8.2.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.2.md);
256
262
  prior published: [4.8.1.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.1.md);
@@ -77,7 +77,7 @@ Three beats when a line teaches:
77
77
  | The agent imported Infrastructure from Domain. The write didn’t land. Next: `/ark-place`. | Ship it 🚀 crush the spaghetti |
78
78
  | Import rules pass. The tree still needs a refactor. Next: one small change. | You don’t need to understand anything |
79
79
  | ArkRun is experimental. In-memory. Data is gone on restart. | The kernel is production-ready |
80
- | The agent PATCHed the billing plan as if it were a seat count. The write didn’t land. Next: a new release, not `update`. | Freeze ξ. Four verbs. Haken slaving. |
80
+ | The agent PATCHed the billing plan as if it were a seat count. The write didn’t land. Next: `proposeRelease` then `apply`, not `update`. | Freeze ξ. Four verbs. Haken slaving. |
81
81
  | Status: one light, one next step. | Become an architect in 60 seconds |
82
82
 
83
83
  **Brands, then the common word:** ArkGate, ArkRules, ArkRun, ArkOrder. Gloss once.
@@ -90,7 +90,7 @@ Three beats when a line teaches:
90
90
  | `arkgate-check --doctor` — **status**, one next step | control plane, coach, doctor as the product name |
91
91
  | optional policies inside a layer | dual plane, intra-layer sensors, Saturday tidy |
92
92
  | experimental runtime / in-memory / not Postgres | production kernel, durable runtime, training wheels |
93
- | the few slow product decisions / billing plan vs seats / that PUT doesn’t land | four verbs, freeze a pattern, Haken, slaving, ξ vs s, extra plane, construction OS |
93
+ | the few slow product decisions / billing plan vs seats / that PUT doesn’t land / `proposeRelease` then `apply` | four verbs, freeze a pattern, Haken, slaving, ξ vs s, extra plane, construction OS |
94
94
 
95
95
  Command names stay command names (`--doctor` is a flag). If a word is not here,
96
96
  cut it or put it below the fold (develop, JSON, ADRs).
@@ -111,7 +111,7 @@ These are product law, not vibe:
111
111
  - Host write hardness differs. Required CI is the shared hard line.
112
112
  - ArkRun stores are **in-memory**. Not production durability. Do not imply otherwise.
113
113
  - Absence of ArkRules, ArkRun, or ArkOrder is silent. Label leftovers **`[Layer]`** vs **`[ArkRules]`** vs **`[ArkRun]`** vs **`[ArkOrder]`**.
114
- - ArkOrder is in-memory and not durable. It does not replace ArkRun. Do not imply a second npm package.
114
+ - ArkOrder is in-memory and not durable. It does not replace ArkRun. Do not imply a second npm package. Later pattern change is `proposeRelease` then `apply`.
115
115
 
116
116
  Full engineering queue: [ROADMAP.md](../ROADMAP.md). Do not narrate phase ids in consumer copy.
117
117
 
package/docs/use.md CHANGED
@@ -81,7 +81,7 @@ The config only binds when the write doesn’t land and CI is required.
81
81
  | **ArkGate** (layers) | Import rules. The write doesn’t land. The PR fails. | Always — this is the product |
82
82
  | **ArkRules** | Optional policies *inside* a layer. | Off until you turn it on (start may ship advisory templates) |
83
83
  | **ArkRun** | Optional experimental runtime (`arkgate/runtime`) | Off. In-memory. Not Postgres. |
84
- | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`). Library + sensors, [not a service](arkorder.md). | Off. Name `xiKeys` (plan / protocol, not `projectId`). Invoices and seats still flow. In-memory. Not durable. |
84
+ | **ArkOrder** | Stops the agent rewriting the few slow product decisions as CRUD (`arkgate/order`). Library + sensors, [not a service](arkorder.md). Valve: `proposeRelease` then `apply`; `refreshSigma`; ingest residual; capacity pack; `ReleaseStore`; ArkRun `decisionTape`. ArkOrder freezes the pattern through a valve. ArkRun is how the residual travels. | Off. Name `xiKeys` (plan / protocol, not `projectId`). Invoices and seats still flow. In-memory. Not durable. |
85
85
 
86
86
  Start always gives you **layers**. Compact starters do **not** turn on ArkRun or
87
87
  ArkOrder. No extras is fine — only ArkGate runs. Leftovers are labeled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.8.5",
3
+ "version": "4.8.7",
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",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/pedroknigge/arkgate",
7
7
  "source": "github"
8
8
  },
9
- "version": "4.8.5",
9
+ "version": "4.8.7",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.8.5",
14
+ "version": "4.8.7",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"
@@ -7,7 +7,7 @@
7
7
  This directory is the **Agent Skills–compatible** packaging of the same **13**
8
8
  `/ark-*` skills shipped as flat templates for Ark install. **No new skill names.**
9
9
 
10
- Package version when last generated context: **arkgate@4.8.5**
10
+ Package version when last generated context: **arkgate@4.8.6**
11
11
  Schema: agent-skills package contract `1.0`
12
12
 
13
13
  ## Skills (frozen catalog)