arkgate 4.8.9 → 4.8.10

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 (44) hide show
  1. package/CHANGELOG.md +80 -3
  2. package/README.md +4 -4
  3. package/bin/ark-check-runtime.mjs +2 -2
  4. package/bin/ark.mjs +18 -10
  5. package/bin/lib/analysis-engine.mjs +6 -6
  6. package/bin/lib/architecture-scan.mjs +91 -4
  7. package/bin/lib/ark-order-facts.mjs +11 -4
  8. package/bin/lib/arkrule-file-hints.mjs +255 -20
  9. package/bin/lib/arkrules-sensors.mjs +364 -68
  10. package/bin/lib/baseline-key.mjs +45 -1
  11. package/bin/lib/config-contract.mjs +9 -3
  12. package/bin/lib/diagnostic-catalog.mjs +1 -0
  13. package/bin/lib/doctor-human.mjs +3 -3
  14. package/bin/lib/doctor-next-actions.mjs +3 -1
  15. package/bin/lib/field-install.mjs +23 -2
  16. package/bin/lib/first-run-help.mjs +69 -5
  17. package/bin/lib/resolved-candidate-facts.mjs +82 -1
  18. package/bin/lib/rules-inventory.mjs +7 -3
  19. package/bin/lib/upstream-report.mjs +330 -0
  20. package/bin/lib/violations.mjs +51 -15
  21. package/dist/{diagnosticCatalog-BrkOiwCk.d.ts → diagnosticCatalog-biferT4R.d.ts} +9 -3
  22. package/dist/eslint/index.cjs +4 -7
  23. package/dist/eslint/index.js +4 -7
  24. package/dist/index.cjs +28 -31
  25. package/dist/index.d.ts +7 -4
  26. package/dist/index.js +28 -31
  27. package/dist/nestjs/index.cjs +1 -1
  28. package/dist/nestjs/index.js +1 -1
  29. package/dist/runtime/index.cjs +11 -11
  30. package/dist/runtime/index.d.ts +1 -1
  31. package/dist/runtime/index.js +11 -11
  32. package/docs/README.md +3 -3
  33. package/docs/agent-guide.md +25 -1
  34. package/docs/ai-gates.md +8 -0
  35. package/docs/brownfield-adoption.md +30 -0
  36. package/docs/configuration.md +14 -1
  37. package/docs/diagnostics.md +10 -0
  38. package/docs/package-surface.md +4 -3
  39. package/docs/use.md +11 -0
  40. package/package.json +1 -1
  41. package/schemas/ark.config.schema.json +3 -2
  42. package/server.json +2 -2
  43. package/templates/agent-skills/ark-explore/SKILL.md +22 -1
  44. package/templates/skills/ark-explore.md +22 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,84 @@
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.10 — 2026-09-02
7
+
8
+ **Patch** over **4.8.9**. Amarilla first-aggregate sensors. Incomplete analysis
9
+ never looks green: an enforced sensor that cannot see its scope is not a pass.
10
+ **Write. Check. Ship.** **No required config migration.** No `schemaVersion` bump.
11
+ Does not close `K01` / `Z09`. No new skill names.
12
+
13
+ **Status: prepared** (tree candidate; npm `latest` remains **4.8.9** until the
14
+ signed-tag provenance workflow succeeds).
15
+
16
+ ### Added
17
+ - `arkgate report` / `ark report` on the existing dual bins: draft an upstream GitHub issue for
18
+ `pedroknigge/arkgate` (`package.json` `bugs.url`), never the consumer repo. Default prints the
19
+ draft (arkgate version + last-check snippet). Create only with `--submit` and
20
+ `--i-confirm-submit` (or TTY `Type submit to send`). `--yes` does not submit. Missing or
21
+ unauthenticated `gh` prints the draft and the exact `gh issue create` command, then exits 2.
22
+ Not `ark-check --report` (HTML). Does not close `K01` / `Z09`. No new skill names.
23
+
24
+ ### Fixed
25
+ - Structural-hint budget: when eligible governed files exceed `coverage.maxFiles`
26
+ (default `400`), emit `ARKRULE_HINT_BUDGET_EXHAUSTED` with exact hinted/governed
27
+ counts and per-sensor reviewed N/M of scope. `--strict-config` fails if an
28
+ enforced hint sensor is truncated. No `arkrules.hintBudget` key.
29
+ - `--update-baseline` GitHub rewrite touches only `ark-check` / `arkgate-check`
30
+ invocation lines (`run:` / package scripts). It does not append `--baseline` to
31
+ `concurrency.group` or job-id lines that merely name the check. Writes outside
32
+ the three law files are announced (`Synced --baseline into: …`).
33
+ - DomainModel class sensors: method finder is paren-balanced, so a later broken
34
+ method is visible. Remaining truncation is reported (`shape analysed until
35
+ character N`), not silent green.
36
+ - One shared invariant-word list (`ensureInvariants` / `raise` / `record` / `.push(`).
37
+ Assignment `=` is distinct from `===` / `!==` / `<=` / `>=`. `pendingEvents = []`
38
+ is idiomatic; events-array `.push(` counts as publish. Object literals and
39
+ multiline params are not public fields.
40
+ - `ARKRULE_SCOPE_EMPTY` is not freezable, even with `--force`. It is a config
41
+ diagnostic, not code debt. No `allowEmptyScope` key.
42
+ - `ARKRULE_STRUCTURE` freeze keys include the sensor id (and symbol when present).
43
+ A freeze for `orchestration-only` does not silence `thin-adapter` or
44
+ `writes-via-aggregate` on the same file. v1 empty-target keys remain exact-match
45
+ only.
46
+ - Intent-prefix checks apply only at declared intent-reference sites (`publish` /
47
+ `subscribe` / `defineIntent` / `registerHandler`, `intent` / `onEvent` /
48
+ `reactsTo`, publish `metadata.source`). Not every string literal. No
49
+ `kernel.dtypePrefixes`. A kernel DType such as `Management.EvmInspection.Data`
50
+ does not trip `LAYER_INTENT_REFERENCE_VIOLATION`.
51
+ - A5: `writes-via-aggregate` treats `@/lib/db` (and local `…/db`) as an IO import
52
+ without opening tsconfig. Write tokens require callee `db` / `tx` / `client` /
53
+ `prisma` / `drizzle`; `repo.update(` is not a write. Optional resolved-import
54
+ facts: PersistenceAdapters layer is a driver.
55
+ - IO import hints match `postgres` and `drizzle-orm/postgres-js` (package
56
+ subpaths), in lockstep for ArkRules and ArkOrder. `require()` matches the same
57
+ packages.
58
+ - React/UI `.set()` is not `ARKORDER_GENERIC_UPDATE`. Only `plane` /
59
+ `orderPlane` callees (or a file that constructs `createOrderPlane`) count as ξ
60
+ mutation. `Map` / `URLSearchParams` / `useState` setters stay silent.
61
+ - `--sensors` success is not a validity verdict. Stdout names the contract-only
62
+ skip (`Contract + coverage-evidence only: no TypeScript, no analysis. Not a
63
+ validity verdict.`); `--json` stamps `notAVerdict` / `didNotRun` /
64
+ `partialMode=contract-only`. It does not print `Ark check passed`.
65
+
66
+ ### Changed
67
+ - `coverage.maxFiles` schema description, configuration docs, and diagnostics name
68
+ that the same budget also bounds structural-hint preload for `orchestration-only`,
69
+ `thin-adapter`, and `writes-via-aggregate`.
70
+ - Brownfield: law-then-product PR sequence when a rule’s folder does not exist yet
71
+ (advisory or placeholder path, then product, then promote). STRUCTURE key compat
72
+ for v1 empty-target rows is documented.
73
+ - A10: baseline regenerate note lists
74
+ `ark-check --update-baseline --force --contract-session --author <steward>`.
75
+ Doctor concentration looks at `sensor` / `arkruleId`; orchestration-only
76
+ majority is code debt, not “Fixing the contract”. Short `--help`: `--sensors`
77
+ does not run analysis; `--help --all` lists `--update-baseline` / `--author`.
78
+ AO11 9-vs-7 is not a bug.
79
+ - A11: `--changed` bounds file-local structural sensors and hint load to the
80
+ touched files. Import-edge, layer, and cycle sensors still see the full
81
+ governed graph. Optional process-local hint cache by content hash. Does not
82
+ claim 170s becomes seconds. No second analysis engine.
83
+
6
84
  ## 4.8.9 — 2026-09-01
7
85
 
8
86
  **Patch** over **4.8.8**. Field diagnostic honesty: doctor default homedir, live
@@ -15,8 +93,7 @@ intent-reference checks share the import classifier. Amarilla ArkOrder:
15
93
  **No required config migration.** No `ark.config.json` schema bump. Does not close `K01` / `Z09`.
16
94
  No new skill names.
17
95
 
18
- **Status: prepared** (tree candidate; npm `latest` remains **4.8.8** until the
19
- signed-tag provenance workflow succeeds).
96
+ **Status: published** (on npm `latest`; see `docs/releases/4.8.9.md`).
20
97
 
21
98
  ### Added
22
99
  - Optional `arkOrder.appliesTo` globs (same engine as layers). `managedLayers`
@@ -72,7 +149,7 @@ payload-free inspector monitors. ArkOrder and first-contact docs gain honesty co
72
149
  **No required config migration.** No `ark.config.json` schema bump. Does not close
73
150
  `K01` / `Z09`.
74
151
 
75
- **Status: published** (on npm `latest`; see `docs/releases/4.8.8.md`).
152
+ **Status: published** (see `docs/releases/4.8.8.md`).
76
153
 
77
154
  ### Added
78
155
  - Dual **`ark-dashboard` / `arkgate-dashboard`** bins render the loopback ArkRun
package/README.md CHANGED
@@ -37,7 +37,7 @@ Works with Cursor, Claude, Codex, and Grok.
37
37
 
38
38
  </div>
39
39
 
40
- > **ArkGate 4.8.9** is prepared on this tree; npm `latest` remains **4.8.8**.
40
+ > **ArkGate 4.8.10** is prepared on this tree; npm `latest` remains **4.8.9**.
41
41
  > Write. Check. Ship. Adopted = required GitHub
42
42
  > status running `arkgate-check --strict-merge`, or an explicit `advisory-only` stance.
43
43
  > Status is compact (`arkgate-check --doctor`; `--all` for Details). Optional **ArkRun**
@@ -45,7 +45,7 @@ Works with Cursor, Claude, Codex, and Grok.
45
45
  > (`arkgate/order`) stops the agent rewriting the few slow product decisions as CRUD;
46
46
  > later pattern change is `proposeRelease` then `apply`.
47
47
  > `@arkgate/runtime` is deprecated.
48
- > [4.8.9 prepared](docs/releases/4.8.9.md) · [4.8.8 published](docs/releases/4.8.8.md) · [4.8.7](docs/releases/4.8.7.md) · [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)
48
+ > [4.8.10 prepared](docs/releases/4.8.10.md) · [4.8.9 published](docs/releases/4.8.9.md) · [4.8.8](docs/releases/4.8.8.md) · [4.8.7](docs/releases/4.8.7.md) · [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)
49
49
 
50
50
  ---
51
51
 
@@ -342,8 +342,8 @@ Rename the three keys. Compact starters leave it off. Details:
342
342
  | Config · package surface · TS | [configuration](docs/configuration.md) · [package-surface](docs/package-surface.md) · [typescript-support](docs/typescript-support.md) |
343
343
  | Brownfield | [docs/brownfield-adoption.md](docs/brownfield-adoption.md) |
344
344
  | Security | [SECURITY.md](SECURITY.md) |
345
- | Prepared (4.8.9; not published) | [docs/releases/4.8.9.md](docs/releases/4.8.9.md) · [CHANGELOG](CHANGELOG.md) |
346
- | Current published (4.8.8 on npm `latest`) | [docs/releases/4.8.8.md](docs/releases/4.8.8.md) · [CHANGELOG](CHANGELOG.md) |
345
+ | Prepared (4.8.10; not published) | [docs/releases/4.8.10.md](docs/releases/4.8.10.md) · [CHANGELOG](CHANGELOG.md) |
346
+ | Current published (4.8.9 on npm `latest`) | [docs/releases/4.8.9.md](docs/releases/4.8.9.md) · [CHANGELOG](CHANGELOG.md) |
347
347
  | Prior published (4.8.7) | [docs/releases/4.8.7.md](docs/releases/4.8.7.md) · [CHANGELOG](CHANGELOG.md) |
348
348
  | Prior published (4.8.6) | [docs/releases/4.8.6.md](docs/releases/4.8.6.md) |
349
349
  | Prior published (4.8.5) | [docs/releases/4.8.5.md](docs/releases/4.8.5.md) |
@@ -96,7 +96,7 @@ import {
96
96
  writeArkRulesTemplates,
97
97
  } from './lib/presets.mjs';
98
98
  import { loadArkConfigContract, parseArkConfigJson } from './lib/config-contract.mjs';
99
- import { checkUsage, checkUsageAll } from './lib/first-run-help.mjs';
99
+ import { checkUsage, checkUsageAll, withSensorsPartialModeHonesty } from './lib/first-run-help.mjs';
100
100
  import { createAdapterResult } from './lib/adapter-contract.mjs';
101
101
  import {
102
102
  UNGOVERNED_PROBE_CAP,
@@ -1140,7 +1140,7 @@ async function main() {
1140
1140
 
1141
1141
  if (args.sensors) {
1142
1142
  const { runSensors } = await import('./lib/sensor-promote-cli.mjs');
1143
- await runSensors(args, readConfig);
1143
+ await withSensorsPartialModeHonesty(args, () => runSensors(args, readConfig));
1144
1144
  return;
1145
1145
  }
1146
1146
 
package/bin/ark.mjs CHANGED
@@ -36,6 +36,7 @@ import {
36
36
  import { runStatusCommand } from './lib/status-command.mjs';
37
37
  import { runAgentProjectionCommand } from './lib/agent-projection-command.mjs';
38
38
  import { setupUsage, setupUsageAll, upgradeUsage } from './lib/first-run-help.mjs';
39
+ import { runUpstreamReportCommand } from './lib/upstream-report.mjs';
39
40
 
40
41
  const here = path.dirname(fileURLToPath(import.meta.url));
41
42
  const arkCheck = path.join(here, 'ark-check.mjs');
@@ -45,20 +46,20 @@ Usage: arkgate dashboard [--url <snapshot-url>] [--interval <ms>]
45
46
  Polls an ArkRun inspector; it does not start the kernel.`;
46
47
 
47
48
  function withDashboardHelp(text, detailed) {
49
+ const extra = detailed
50
+ ? ' arkgate dashboard [--url <snapshot-url>] [--interval <ms>]\n arkgate report [--root <project>] [--json] [--title <text>] [--finding <ref>] [--submit] [--i-confirm-submit]\n'
51
+ : '';
52
+ const extraDesc = detailed
53
+ ? ' dashboard ANSI observability TUI (spawns ark-dashboard).\n report Draft an upstream GitHub issue for pedroknigge/arkgate. Create needs --submit plus confirm. --yes does not submit.\n'
54
+ : '';
48
55
  if (detailed) {
49
56
  return text
50
- .replace(
51
- ' arkgate agents-md [--root',
52
- ' arkgate dashboard [--url <snapshot-url>] [--interval <ms>]\n arkgate agents-md [--root'
53
- )
54
- .replace(
55
- ' agents-md Version-matched',
56
- ' dashboard ANSI observability TUI against a running ArkRun inspector (spawns ark-dashboard).\n agents-md Version-matched'
57
- );
57
+ .replace(' arkgate agents-md [--root', `${extra} arkgate agents-md [--root`)
58
+ .replace(' agents-md Version-matched', `${extraDesc} agents-md Version-matched`);
58
59
  }
59
60
  return text.replace(
60
61
  ' arkgate-check --doctor status — one next step\n',
61
- ' arkgate-check --doctor status — one next step\n arkgate dashboard observability TUI (inspector)\n'
62
+ ' arkgate-check --doctor status — one next step\n arkgate dashboard observability TUI (inspector)\n arkgate report draft an upstream GitHub issue\n'
62
63
  );
63
64
  }
64
65
 
@@ -181,7 +182,7 @@ function parseArgs(argv) {
181
182
  else if (!arg.startsWith('-') && args.command === undefined) {
182
183
  args.command = arg;
183
184
  // Dashboard owns its flags (--url/--interval); pass the rest through untouched.
184
- if (arg === 'dashboard') {
185
+ if (arg === 'dashboard' || arg === 'report') {
185
186
  args.passthrough = argv.slice(i + 1);
186
187
  break;
187
188
  }
@@ -946,6 +947,13 @@ async function main() {
946
947
  });
947
948
  }
948
949
 
950
+ if (args.command === 'report') {
951
+ return runUpstreamReportCommand({
952
+ root: args.root, json: args.json, yes: args.yes,
953
+ arkgateVersion: cliVersion(), argv: args.passthrough,
954
+ });
955
+ }
956
+
949
957
  if (args.command === 'agents-md' || args.command === 'agent-projection') {
950
958
  return runAgentProjectionCommand({
951
959
  root: args.root,