arkgate 4.7.6 → 4.8.1

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 (67) hide show
  1. package/CHANGELOG.md +37 -3
  2. package/README.md +8 -9
  3. package/bin/lib/analysis-engine.mjs +6 -6
  4. package/bin/lib/architecture-scan.mjs +7 -2
  5. package/bin/lib/ark-order-error.mjs +18 -0
  6. package/bin/lib/ark-order-facts.mjs +53 -0
  7. package/bin/lib/ark-order-invariants.mjs +160 -0
  8. package/bin/lib/ark-order-sensors.mjs +118 -0
  9. package/bin/lib/ark-order-types.mjs +11 -0
  10. package/bin/lib/ark-run-sensors.mjs +13 -5
  11. package/bin/lib/config-contract.mjs +16 -72
  12. package/bin/lib/config-extras.mjs +151 -0
  13. package/bin/lib/diagnostic-catalog.mjs +7 -2
  14. package/bin/lib/extra-merge-teeth.mjs +8 -2
  15. package/bin/lib/install-migrate.mjs +4 -2
  16. package/bin/lib/invariant-coverage-io.mjs +61 -24
  17. package/bin/lib/invariant-coverage.mjs +4 -1
  18. package/bin/lib/managed-upgrade.mjs +1 -1
  19. package/bin/lib/mcp-adoption.mjs +9 -3
  20. package/bin/lib/policy-delta-io.mjs +8 -2
  21. package/bin/lib/remediation.mjs +48 -9
  22. package/bin/lib/resolved-candidate-facts.mjs +43 -0
  23. package/bin/lib/rules-under-contract.mjs +8 -2
  24. package/bin/lib/skill-install.mjs +17 -2
  25. package/bin/lib/start-preview.mjs +1 -0
  26. package/bin/lib/status-manifest.mjs +1 -1
  27. package/bin/lib/write-path-capabilities.mjs +2 -2
  28. package/dist/{configTypes-CgJimx9o.d.ts → configTypes-BdCe_gvv.d.ts} +22 -6
  29. package/dist/diagnosticCatalog-CSF4N3w8.d.ts +2313 -0
  30. package/dist/eslint/index.cjs +7 -6
  31. package/dist/eslint/index.d.ts +33 -2
  32. package/dist/eslint/index.js +7 -6
  33. package/dist/index.cjs +35 -35
  34. package/dist/index.d.ts +271 -2554
  35. package/dist/index.js +35 -35
  36. package/dist/nestjs/index.cjs +18 -0
  37. package/dist/nestjs/index.d.ts +24 -0
  38. package/dist/nestjs/index.js +18 -0
  39. package/dist/order/index.cjs +1 -0
  40. package/dist/order/index.d.ts +79 -0
  41. package/dist/order/index.js +1 -0
  42. package/dist/runtime/index.cjs +25 -0
  43. package/dist/runtime/index.d.ts +497 -0
  44. package/dist/runtime/index.js +25 -0
  45. package/dist/types-C9KApBzX.d.ts +1237 -0
  46. package/dist/types-DCSlrRnV.d.ts +181 -0
  47. package/docs/README.md +4 -4
  48. package/docs/agent-guide.md +1 -1
  49. package/docs/ai-gates.md +9 -2
  50. package/docs/configuration.md +13 -6
  51. package/docs/develop.md +4 -3
  52. package/docs/diagnostics.md +57 -3
  53. package/docs/package-surface.md +20 -16
  54. package/docs/product-voice.md +2 -1
  55. package/package.json +21 -2
  56. package/schemas/ark.config.schema.json +54 -2
  57. package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
  58. package/server.json +2 -2
  59. package/templates/agent-skills/README.md +1 -1
  60. package/templates/agent-skills/ark-adopt/SKILL.md +2 -2
  61. package/templates/agent-skills/ark-contract/SKILL.md +1 -1
  62. package/templates/agent-skills/ark-place/SKILL.md +15 -6
  63. package/templates/agent-skills/ark-runtime/SKILL.md +10 -15
  64. package/templates/skills/ark-adopt.md +2 -2
  65. package/templates/skills/ark-contract.md +1 -1
  66. package/templates/skills/ark-place.md +15 -6
  67. package/templates/skills/ark-runtime.md +10 -15
@@ -136,8 +136,13 @@ export function resolveTools(args) {
136
136
  if (fs.existsSync(path.join(root, '.cursor'))) detected.add('cursor');
137
137
  if (fs.existsSync(path.join(root, '.codex'))) detected.add('codex');
138
138
  if (fs.existsSync(path.join(root, '.grok'))) detected.add('grok');
139
- // Antigravity project hooks (distinct from Codex-only `.agents/skills`).
140
- if (fs.existsSync(path.join(root, '.agents', 'hooks.json'))) detected.add('antigravity');
139
+ // Antigravity project hooks or official workspace MCP (distinct from Codex-only `.agents/skills`).
140
+ if (
141
+ fs.existsSync(path.join(root, '.agents', 'hooks.json')) ||
142
+ fs.existsSync(path.join(root, '.agents', 'mcp_config.json'))
143
+ ) {
144
+ detected.add('antigravity');
145
+ }
141
146
  if (
142
147
  fs.existsSync(path.join(root, 'opencode.json')) ||
143
148
  fs.existsSync(path.join(root, 'opencode.jsonc')) ||
@@ -167,6 +172,16 @@ export function resolveTools(args) {
167
172
  ) {
168
173
  detected.add('grok');
169
174
  }
175
+ // Same idea as Grok env markers: opening Antigravity has no `.agents/hooks.json` yet.
176
+ if (
177
+ envTruthy(process.env.ANTIGRAVITY) ||
178
+ envTruthy(process.env.AGY) ||
179
+ process.env.ANTIGRAVITY_WORKSPACE ||
180
+ process.env.AGY_WORKSPACE ||
181
+ /antigravity/i.test(String(process.env.TERM_PROGRAM ?? ''))
182
+ ) {
183
+ detected.add('antigravity');
184
+ }
170
185
  // No signal at all: fall back to a complete starter set including Grok (field
171
186
  // log: default claude+cursor+codex silently omitted Grok skills for Grok hosts).
172
187
  if (detected.size === 0) {
@@ -29,6 +29,7 @@ const COMPACT_HOST_TEMPLATES = {
29
29
  ],
30
30
  antigravity: (root) => [
31
31
  ['.agents/hooks.json', antigravityHooks(root)],
32
+ ['.agents/mcp_config.json', mcpJson(root)],
32
33
  ['.mcp.json', mcpJson(root)],
33
34
  ],
34
35
  cursor: (root) => [
@@ -246,7 +246,7 @@ export function resolveStatusNextAction(facts, binding, activation, lastCheck, r
246
246
  if (facts.arkRun?.present === true && (facts.arkRun.residual ?? 0) > 0) {
247
247
  return {
248
248
  id: 'review-arkrun-residual',
249
- summary: 'ArkRun residual remains — wire kernel usage or declarations through @arkgate/runtime. Not a score.',
249
+ summary: 'ArkRun residual remains — wire kernel usage or declarations through arkgate/runtime. Not a score.',
250
250
  };
251
251
  }
252
252
  if (facts.adopted === 'required-merge' || facts.adopted === 'advisory-only-acked') {
@@ -464,8 +464,8 @@ export function detectWritePathInventory(root) {
464
464
  ),
465
465
  antigravity: hostRecord(
466
466
  antigravityHook.hard,
467
- // Shared project MCP (.mcp.json) is the common advisory surface; hooks own hard write.
468
- mcpEvidence(root, '.mcp.json'),
467
+ // Official workspace MCP. Shared `.mcp.json` is not loaded by Antigravity.
468
+ mcpEvidence(root, '.agents/mcp_config.json'),
469
469
  antigravityHook.repair,
470
470
  merge
471
471
  ),
@@ -2,11 +2,11 @@
2
2
  * Type vocabulary for the ark.config.json contract (U02 pilot 1).
3
3
  *
4
4
  * Pure declarations only — no runtime values. The loader/validator logic and the
5
- * published JSON Schema live in ./configContract.ts, whose generated CLI artifact
6
- * must stay self-contained: type-only imports/exports are erased on transpile, so
7
- * this split never reaches bin/lib/config-contract.mjs.
5
+ * published JSON Schema live in ./configContract.ts. Extra defaulting lives in
6
+ * ./configExtras.ts (generated sibling `config-extras.mjs`). Type-only imports
7
+ * from this file are erased on transpile.
8
8
  */
9
- type ArkConfigSchemaVersion = '1.0' | '1.1' | '1.2';
9
+ type ArkConfigSchemaVersion = '1.0' | '1.1' | '1.2' | '1.3';
10
10
  type ArkConfigCyclePolicy = 'strict' | 'soft' | 'framework-soft' | 'off';
11
11
  type ArkConfigLayerCapabilities = {
12
12
  deny?: string[];
@@ -60,8 +60,22 @@ type ArkConfigArkRunMode = 'advisory' | 'enforced';
60
60
  type ArkConfigArkRun = {
61
61
  mode: ArkConfigArkRunMode;
62
62
  compositionRoots: string[];
63
+ kernelRoots?: string[];
63
64
  managedLayers: string[];
64
65
  requireDeclarations: boolean;
66
+ ignoreDirectNewForErrors?: boolean;
67
+ };
68
+ /** ADR 0027 — advisory never adds merge teeth; enforced is the extra's merge plane. */
69
+ type ArkConfigArkOrderMode = 'advisory' | 'enforced';
70
+ /**
71
+ * ADR 0027 — optional inline ArkOrder extra (schema 1.3+). Absence is silent.
72
+ * Present objects are fully defaulted by the loader.
73
+ */
74
+ type ArkConfigArkOrder = {
75
+ mode: ArkConfigArkOrderMode;
76
+ planeRoots: string[];
77
+ managedLayers: string[];
78
+ maxXiKeys: number;
65
79
  };
66
80
  type ArkConfig = {
67
81
  $schema: string;
@@ -80,6 +94,8 @@ type ArkConfig = {
80
94
  arkRules?: ArkConfigArkRulesRefs;
81
95
  /** ADR 0020 — optional ArkRun extra (schema 1.2+). Absence changes no Layers/ArkRules verdict. */
82
96
  arkRun?: ArkConfigArkRun;
97
+ /** ADR 0027 — optional ArkOrder extra (schema 1.3+). Absence changes no Layers/ArkRules/ArkRun verdict. */
98
+ arkOrder?: ArkConfigArkOrder;
83
99
  /**
84
100
  * Optional GitHub handles or emails who may loosen the contract or grow the baseline.
85
101
  * Metadata — excluded from policy hash. Absence means no steward lock (policy-ack still applies).
@@ -91,10 +107,10 @@ type ArkConfigIssue = {
91
107
  message: string;
92
108
  };
93
109
  /** Original input version when the loader rewrote schemaVersion toward current. */
94
- type ArkConfigMigratedFrom = 'unversioned' | '1.0' | '1.1' | null;
110
+ type ArkConfigMigratedFrom = 'unversioned' | '1.0' | '1.1' | '1.2' | null;
95
111
  type ArkConfigLoadResult = {
96
112
  config: ArkConfig;
97
113
  migratedFrom: ArkConfigMigratedFrom;
98
114
  };
99
115
 
100
- export type { ArkConfig as A, ArkConfigRule as a, ArkConfigSchemaVersion as b, ArkConfigLoadResult as c, ArkConfigLayer as d, ArkConfigIssue as e, ArkConfigArkRun as f };
116
+ export type { ArkConfig as A, ArkConfigRule as a, ArkConfigSchemaVersion as b, ArkConfigLoadResult as c, ArkConfigIssue as d, ArkConfigArkRun as e, ArkConfigLayer as f, ArkConfigArkOrder as g };