arkgate 4.8.9 → 4.8.11

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 (53) hide show
  1. package/CHANGELOG.md +111 -3
  2. package/README.md +5 -4
  3. package/bin/ark-check-runtime.mjs +8 -2
  4. package/bin/ark-check.mjs +3 -0
  5. package/bin/ark.mjs +18 -10
  6. package/bin/lib/adapter-contract-types.mjs +137 -0
  7. package/bin/lib/adapter-contract.mjs +4 -180
  8. package/bin/lib/adapter-finding-refs.mjs +63 -0
  9. package/bin/lib/agent-projection-formatters.mjs +151 -0
  10. package/bin/lib/agent-projection-merge.mjs +148 -0
  11. package/bin/lib/agent-projection-types.mjs +42 -0
  12. package/bin/lib/agent-projection.mjs +3 -309
  13. package/bin/lib/analysis-engine.mjs +6 -6
  14. package/bin/lib/architecture-scan.mjs +91 -4
  15. package/bin/lib/ark-order-facts.mjs +11 -4
  16. package/bin/lib/arkrule-file-hints.mjs +255 -20
  17. package/bin/lib/arkrules-sensors.mjs +364 -68
  18. package/bin/lib/baseline-key.mjs +45 -1
  19. package/bin/lib/config-contract.mjs +9 -3
  20. package/bin/lib/diagnostic-catalog.mjs +1 -0
  21. package/bin/lib/doctor-human.mjs +3 -3
  22. package/bin/lib/doctor-next-actions.mjs +3 -1
  23. package/bin/lib/field-install.mjs +23 -2
  24. package/bin/lib/first-run-help.mjs +69 -5
  25. package/bin/lib/project-root.mjs +70 -4
  26. package/bin/lib/resolved-candidate-facts.mjs +82 -1
  27. package/bin/lib/rules-inventory.mjs +7 -3
  28. package/bin/lib/upstream-report.mjs +330 -0
  29. package/bin/lib/violations.mjs +51 -15
  30. package/dist/{diagnosticCatalog-BrkOiwCk.d.ts → diagnosticCatalog-DiflIock.d.ts} +30 -41
  31. package/dist/eslint/index.cjs +4 -7
  32. package/dist/eslint/index.js +4 -7
  33. package/dist/index.cjs +28 -31
  34. package/dist/index.d.ts +52 -13
  35. package/dist/index.js +28 -31
  36. package/dist/nestjs/index.cjs +1 -1
  37. package/dist/nestjs/index.js +1 -1
  38. package/dist/runtime/index.cjs +11 -11
  39. package/dist/runtime/index.d.ts +1 -1
  40. package/dist/runtime/index.js +11 -11
  41. package/docs/README.md +3 -3
  42. package/docs/agent-guide.md +25 -1
  43. package/docs/ai-gates.md +8 -0
  44. package/docs/brownfield-adoption.md +30 -0
  45. package/docs/configuration.md +14 -1
  46. package/docs/diagnostics.md +10 -0
  47. package/docs/package-surface.md +5 -3
  48. package/docs/use.md +11 -0
  49. package/package.json +3 -2
  50. package/schemas/ark.config.schema.json +3 -2
  51. package/server.json +2 -2
  52. package/templates/agent-skills/ark-explore/SKILL.md +22 -1
  53. package/templates/skills/ark-explore.md +22 -1
package/docs/README.md CHANGED
@@ -71,9 +71,9 @@ These are **not** the day-to-day product path. They stay in the repo for evidenc
71
71
  | Field adoption kit (scaffolding, not closed) | [field/](field/) |
72
72
  | Runtime hardening (experimental) | [production-hardening.md](production-hardening.md) |
73
73
 
74
- Prepared: [releases/4.8.9.md](releases/4.8.9.md) (`arkgate@4.8.9`; not published).
75
- Current published: [releases/4.8.8.md](releases/4.8.8.md) (`arkgate@4.8.8` on npm `latest`; does not close `K01`).
76
- Prior published: [releases/4.8.7.md](releases/4.8.7.md) (`arkgate@4.8.7`).
74
+ Prepared: [releases/4.8.11.md](releases/4.8.11.md) (`arkgate@4.8.11`; not published).
75
+ Current published: [releases/4.8.10.md](releases/4.8.10.md) (`arkgate@4.8.10` on npm `latest`; does not close `K01`).
76
+ Prior published: [releases/4.8.9.md](releases/4.8.9.md) (`arkgate@4.8.9`).
77
77
  Prior: [releases/4.8.6.md](releases/4.8.6.md) · [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).
78
78
  Older notes: [releases/](releases/). Config: [configuration.md](configuration.md).
79
79
 
@@ -93,11 +93,26 @@ Default loop for each agent session (product language — no inventing residual)
93
93
  `unavailable`, run `ark-check --doctor` (and `--json` for the full 15-lens map) before treating
94
94
  residual as complete. When mode is `full`, status residual ids are a subset of doctor residual
95
95
  for the same facts.
96
+ 5. **Report ArkGate defects to upstream (human confirms first)** — if you find a bug, a false
97
+ green, a false red, a missing doc, or improvable behavior **in ArkGate itself** (the `arkgate`
98
+ package — not leftover design in the consumer app), run **`arkgate report` / `ark report`**
99
+ (existing dual bins — not a new skill). Default prints a draft GitHub issue for **upstream**
100
+ `pedroknigge/arkgate` (`package.json` `bugs.url`) with the installed arkgate version and an
101
+ optional last-check snippet. **Ask the human to confirm send.** Create only with `--submit`
102
+ **and** `--i-confirm-submit` (after they said yes) or a TTY `Type submit to send`. `--yes`
103
+ does not submit. One finding per invocation (`--finding <ref>`); otherwise one bundled field
104
+ report (`--title` is editable). If `gh` is missing or not logged in, the CLI prints the draft
105
+ plus the exact `gh issue create --repo pedroknigge/arkgate` command and exits 2. Never auto-file.
106
+ Never file ArkGate defects on the consumer product repo. This is not `ark-check --report` (HTML).
96
107
 
97
108
  ```bash
98
109
  npx ark status --json --expected-root /abs/project/root
99
110
  # mode !== full → full residual map:
100
111
  npx ark-check --doctor --json
112
+ # draft an upstream issue (nothing created yet):
113
+ npx ark report
114
+ # after the human says yes — one finding, upstream only:
115
+ npx ark report --submit --i-confirm-submit
101
116
  ```
102
117
 
103
118
  `--doctor --json` is a stable envelope (4.6.5+): `{ "schemaVersion": "1.0", "envelope": "doctor", "ok": boolean, "doctor": { … } }`.
@@ -1096,7 +1111,7 @@ edges are not denied by that rule.
1096
1111
  - **`allowedCrossSlice`** (4.8.4): `[{ "from": "features/checkout", "to": "features/catalog" }]` — one directed slice→slice edge the repo declares on purpose. The reverse still denies.
1097
1112
  - **The denial names its reason:** `cross-slice edge a → b` (a fact about the code) vs `unclassifiable path (…)`, `no slice folders`, `no path evidence` (facts about the evidence ArkGate had).
1098
1113
  - Promoting a genuinely shared slice to its own layer remains the recommended model; the two declarations exist so ArkGate can enforce a repo that deliberately chose otherwise.
1099
- - Enforced by `ark-check`, `arkgate/eslint`, and `ark-mcp` (path-aware edges and path-less intent refs share the same SoT).
1114
+ - Enforced by `ark-check`, `arkgate/eslint`, and `ark-mcp` (path-aware edges and path-less intent refs at declared event/saga/publish-metadata sites share the same SoT).
1100
1115
  - Fixes are **judgment** (not mechanical-safe).
1101
1116
 
1102
1117
  Agents can generate a config from the project's actual directory layout instead of inventing layer mappings:
@@ -1147,6 +1162,15 @@ Example config:
1147
1162
  plus intent/publish evidence. It uses the nearest `tsconfig.json` unless `--tsconfig` is set;
1148
1163
  importless type references are out.
1149
1164
 
1165
+ Intent-prefix checks (`LAYER_INTENT_REFERENCE_VIOLATION` on the candidate, write-hook
1166
+ `LAYER_REFERENCE_VIOLATION` / `UNKNOWN_INTENT`) apply only at declared intent-reference sites:
1167
+ `publish` / `subscribe` / `defineIntent` / `registerHandler` arguments, `intent` / `onEvent` /
1168
+ `reactsTo` properties, and publish `metadata.source` (or the 2nd/3rd-arg `source` object). A
1169
+ string that merely matches a layer prefix — including a kernel DType name such as
1170
+ `Management.EvmInspection.Data` — is not an intent reference. `looksLikeArkIntent` still
1171
+ classifies names; it is not a scan of every quoted string. There is no `kernel.dtypePrefixes`
1172
+ exemption list. Real event and saga string refs still fail closed.
1173
+
1150
1174
  Each run parses the full candidate and ignores retired `.cache/ark-check.json`; `--no-cache` is a
1151
1175
  no-op. Z07 owns the identity-keyed snapshot after exact cold/warm parity.
1152
1176
 
package/docs/ai-gates.md CHANGED
@@ -894,3 +894,11 @@ Adopting Ark on an existing codebase with violations? Freeze them once and ratch
894
894
  npx ark-check --update-baseline # writes .ark-baseline.json — commit it
895
895
  npx ark-check --baseline # only NEW violations fail
896
896
  ```
897
+
898
+ `--update-baseline` also patches existing check **invocations** so CI keeps using the
899
+ new freeze file: `package.json` scripts and GitHub workflow `run:` lines that already
900
+ call `ark-check` / `arkgate-check` via `npx`, `pnpm`, `yarn`, `npm`, or `node`. Those
901
+ writes are outside the three law files (`ark.config.json`, `arkrules/`,
902
+ `.ark-baseline.json`) and are announced (`Synced --baseline into: …`). The matcher
903
+ does **not** append `--baseline` to YAML that only *names* the check — a
904
+ `concurrency.group` such as `ark-check-${{ github.ref }}`, or a job id `ark-check:`.
@@ -135,6 +135,36 @@ If Ark still refuses (a single edge dominates), the contract is still wrong —
135
135
  step 3; don't `--force` past it. From now `ark-check --baseline` fails only on NEW
136
136
  violations — the ratchet only moves toward zero.
137
137
 
138
+ `ARKRULE_SCOPE_EMPTY` is a **config diagnostic**, not code debt. It is **not freezable**
139
+ (even with `--force`). There is no `allowEmptyScope` key: an enforced rule whose
140
+ `appliesTo` matches zero governed files is incomplete analysis and must not look green.
141
+
142
+ ### Law then product (when a rule needs a folder that does not exist yet)
143
+
144
+ `mixed-law-and-product` still requires law files (`ark.config.json`, `arkrules/`,
145
+ `.ark-baseline.json`) to travel without product. When the product folder is not there
146
+ yet, do **not** freeze the empty-scope finding. Sequence:
147
+
148
+ 1. **Law PR (advisory or placeholder):** declare the ArkRule as `advisory`, *or* point
149
+ `appliesTo` at a tracked placeholder path that already exists. Empty enforced scope
150
+ fails the gate and cannot be baselined.
151
+ 2. **Product PR:** add the folder and the code so `appliesTo` matches governed files.
152
+ 3. **Law PR (promote):** raise the rule to `enforced` (hash-bound policy acknowledgement
153
+ when required). The ratchet then protects the now-visible scope.
154
+
155
+ ### STRUCTURE freeze keys include the sensor
156
+
157
+ New `ARKRULE_STRUCTURE` keys are `ARKRULE_STRUCTURE|<file>|<layer>||<sensor>` (and
158
+ `<sensor>:<symbol>` when a class/method symbol is known). A freeze for
159
+ `orchestration-only` on a file must not silence `thin-adapter` or `writes-via-aggregate`
160
+ on the same file.
161
+
162
+ **v1 empty-target keys** (`ARKRULE_STRUCTURE|<file>|<layer>||`) still load as frozen
163
+ residual, but they are **exact-match only**. They do not prefix-match every later sensor
164
+ on that file — hidden new debt must not look green. After upgrade they go stale; re-freeze
165
+ in a law PR (`--update-baseline --force --contract-session --author <steward>` as
166
+ applicable) so new keys carry the sensor. Do not treat stale v1 rows as a wildcard mute.
167
+
138
168
  ## 5. Burn down, in order
139
169
 
140
170
  `summary.edges` is the burn-down order. Prefer `ark-check --plan`: it tags each step
@@ -90,7 +90,13 @@ Top-level fields:
90
90
  which files count as tests, replacing the built-in `*.test.*` / `tests/` name heuristic),
91
91
  `maxFiles` (evidence file budget, default `400`) and `coverageRoots` (path prefixes where the
92
92
  project declares its runner actually executes tests). Absence is silent and changes no verdict.
93
- Unknown keys fail closed. When the budget is hit, `INVARIANT_UNCOVERED` reports the numbers
93
+ Unknown keys fail closed. **`maxFiles` also bounds structural-hint preload** for
94
+ `orchestration-only`, `thin-adapter`, and `writes-via-aggregate` (the hint loader reuses
95
+ coverage contents when present). There is no separate `arkrules.hintBudget`. When eligible
96
+ governed files exceed that budget, the loader emits `ARKRULE_HINT_BUDGET_EXHAUSTED` with
97
+ exact hinted/governed counts and per-sensor reviewed N/M of scope; `--strict-config` fails
98
+ if an enforced hint sensor cannot see its scope. `--doctor` names this coupling.
99
+ When the coverage budget is hit, `INVARIANT_UNCOVERED` reports the numbers
94
100
  (files loaded, tests retained, files discarded at the cap) and names `coverage.maxFiles` as
95
101
  the knob that raises it — coverage never claims "never had tests" because of our own cap.
96
102
  `maxFiles` is clamped to a hard ceiling of 20000 (the config validator has no
@@ -447,6 +453,13 @@ Write-gate ApplyPatch denies a batch that mixes law files with product source. H
447
453
  never hit PreToolUse are unchanged. Local `pnpm` gates should call `--changed --base`, not
448
454
  only full-tree `--strict-merge`.
449
455
 
456
+ `--changed` honors the touched-file list for **file-local** ArkRules structure sensors
457
+ (class shape, orchestration-only, thin-adapter, writes-via-aggregate) and for
458
+ structural-hint preload. Import-edge, layer, and cycle sensors still evaluate the full
459
+ governed graph. That is a bound on the existing scan, not a second analysis engine, and
460
+ it does not turn a full-tree run into a seconds-long one. A `--changed` pass is not a
461
+ full-tree structural verdict.
462
+
450
463
  MCP clients can call `ark_policy_delta` with the previous `baseConfig`, an optional candidate
451
464
  contract (the current project contract is the default), and the same optional acknowledgement.
452
465
  It invokes the public classifier directly, is read-only, and marks a blocking result as an MCP
@@ -43,6 +43,7 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
43
43
  | [`ARKRULE_STRUCTURE`](#ARKRULE_STRUCTURE) | arkrules | ArkRule structure sensor failed |
44
44
  | [`ARKRULE_INVARIANT`](#ARKRULE_INVARIANT) | arkrules | ArkRule invariant failed |
45
45
  | [`ARKRULE_SCOPE_EMPTY`](#ARKRULE_SCOPE_EMPTY) | arkrules | ArkRule appliesTo matched zero files |
46
+ | [`ARKRULE_HINT_BUDGET_EXHAUSTED`](#ARKRULE_HINT_BUDGET_EXHAUSTED) | arkrules | Structural-hint budget exhausted |
46
47
  | [`INVARIANT_UNCOVERED`](#INVARIANT_UNCOVERED) | arkrules | Invariant without coverage evidence |
47
48
  | [`INVARIANT_COVERAGE_OUTSIDE_ROOTS`](#INVARIANT_COVERAGE_OUTSIDE_ROOTS) | arkrules | Covering test outside the declared coverage roots |
48
49
  | [`ARKRUN_MISSING_ROOT`](#ARKRUN_MISSING_ROOT) | arkrun | No kernel factory in composition roots |
@@ -279,6 +280,15 @@ Link form for agents: `docs/diagnostics.md#RULE_ID` (exact-case HTML anchors bel
279
280
  - **Why:** An ArkRule’s appliesTo globs matched no governed files — the rule cannot observe what it claims to protect.
280
281
  - **Fix:** Fix appliesTo globs so they match governed files, or remove the rule. Enforced empty scope fails; advisory empty scope warns.
281
282
 
283
+ <a id="ARKRULE_HINT_BUDGET_EXHAUSTED"></a>
284
+
285
+ ### `ARKRULE_HINT_BUDGET_EXHAUSTED`
286
+
287
+ **Structural-hint budget exhausted**
288
+
289
+ - **Why:** `orchestration-only`, `thin-adapter`, and `writes-via-aggregate` only evaluate files the hint loader preloaded. When eligible governed files exceed that budget (`coverage.maxFiles`, default `400` — there is no `arkrules.hintBudget`), those sensors never saw the rest of their scope. Enforced + unreviewed is not green. The finding names exact hinted/governed counts and per-sensor reviewed N/M of scope.
290
+ - **Fix:** Raise `coverage.maxFiles` in ark.config.json (this cap also bounds structural-hint preload; `--doctor` names the coupling) so hinted/governed counts match, then re-run with `--strict-config`. An enforced hint sensor that cannot see its scope fails strict.
291
+
282
292
  <a id="INVARIANT_UNCOVERED"></a>
283
293
 
284
294
  ### `INVARIANT_UNCOVERED`
@@ -37,7 +37,8 @@ hardening guide remains repository-hosted rather than duplicated in the gate tar
37
37
 
38
38
  | Surface | How you use it | Stability notes |
39
39
  |---------|----------------|-----------------|
40
- | **CLI** | `arkgate` / `arkgate-check` (aliases `ark` / `ark-check`); optional ArkRun **`ark-dashboard`** / **`arkgate-dashboard`** | Flags and human text may improve; **JSON output shapes** for `--json` (check, doctor, plan, coverage, recommend, **status**, **agents-md**) are stable within a major. Additive fields OK; removals/renames are major. From 4.2, `--require-gates` implies strict config and verifies semantic Ark AGENTS, project-rooted MCP/compact Codex registration, and fail-closed CI rather than file presence alone. `ark status --json` is the unified status snapshot. `ark agents-md` is the version-matched agent projection (non-authoritative). **Dashboard bins** poll an ArkRun inspector snapshot (ANSI + interval polling; `--url` / `--interval`); they are not a gate verdict. The main CLI also accepts `ark dashboard` / `arkgate dashboard` as a passthrough to those bins. |
40
+ | **CLI** | `arkgate` / `arkgate-check` (aliases `ark` / `ark-check`); optional ArkRun **`ark-dashboard`** / **`arkgate-dashboard`** | Flags and human text may improve; **JSON output shapes** for `--json` (check, doctor, plan, coverage, recommend, **status**, **agents-md**, **report**) are stable within a major. Additive fields OK; removals/renames are major. From 4.2, `--require-gates` implies strict config and verifies semantic Ark AGENTS, project-rooted MCP/compact Codex registration, and fail-closed CI rather than file presence alone. `ark status --json` is the unified status snapshot. `ark agents-md` is the version-matched agent projection (non-authoritative). **`arkgate report` / `ark report`** drafts an upstream GitHub issue for `pedroknigge/arkgate` (`package.json` `bugs.url`) — never the consumer repo. **Dashboard bins** poll an ArkRun inspector snapshot (ANSI + interval polling; `--url` / `--interval`); they are not a gate verdict. The main CLI also accepts `ark dashboard` / `arkgate dashboard` as a passthrough to those bins. |
41
+ | **Upstream report CLI (4.8.10)** | `arkgate report` / `ark report` on the existing dual bins (no new bin, no new skill) | Default prints a draft for **upstream** `pedroknigge/arkgate` (`package.json` `bugs.url`) with the arkgate version and optional last-check snippet. Create only with `--submit` **and** `--i-confirm-submit` (after HITL) or TTY `Type submit to send`. `--yes` does not submit. Missing/unauthenticated `gh`: print the draft plus the exact `gh issue create --repo pedroknigge/arkgate` command, exit 2. Never files against the consumer repo. Not `ark-check --report` (HTML architecture report). |
41
42
  | **Host write boundaries** | Generated trusted PreToolUse/preToolUse hooks + `ark-mcp --hook`; inspect with doctor/status | Hard is always operation-scoped and runtime-evidenced. From 4.6.3, Codex CLI and local ChatGPT Desktop/App Server can hard-block a complete `apply_patch` sent as `tool_input.command`; `.codex/hooks.json` on disk remains unverified until a fresh covered invocation. Hosted tools, specialized hook opt-outs, shell/direct writes, incomplete reconstruction, and humans rely on required CI. Repair envelopes may emit, but Codex reinjection is not guaranteed. |
42
43
  | **Programmatic gate API** | `import { analyzeProject, loadContract, createAICodeGate, ... } from 'arkgate'` | The root export is the static gate/config/analysis contract listed below. It intentionally contains no runtime-kernel implementation. |
43
44
  | **Improvement compass (4.4; status honesty 4.5)** | `ark-check --doctor --json` → `doctor.improvementCompass`; human doctor section **Improvement compass (not a score)**; HTML report `data-advisory="improvementCompass"`. **`ark status --json` / MCP `ark_status`** project a thin `improvementCompass` residual map with explicit honesty **`mode`**: `full` \| `subset` \| `unavailable` (always `notAScore: true`). When `mode` is `full`, status residual lens **ids** are a **subset of** doctor residual for the same facts (report snapshot stores the thin slice after `--report`). Incomplete or missing session facts → `subset` / `unavailable` + `reasonCode` / `reason` — **never invent green residual**. Residual never flips `valid` / strict-merge / `goal.met`. When status mode ≠ full, run doctor for full 15-lens detail. | Additive schema `1.0`. Closed **15** lens ids (`soc`, `cohesion`, `coupling`, `srp`, `dip`, `ocp`, `encapsulation`, `modularity`, `scalability`, `resilience`, `security`, `maintainability`, `testability`, `domain`, `stack`) with status `ok` \| `residual` \| `not-instrumented` \| `out-of-scope`, evidence refs, optional `nextAction`, capped `topResidual`, always **`notAScore: true`**. Projection from existing smells / walls / cohesion / ArkRules / design-weak only — **never** a gate input. Out-of-scope locked for scalability, resilience, and app security (no residual invent from missing SAST/APM). Root API: `buildImprovementCompass` / `IMPROVEMENT_LENS_IDS`; status: `projectStatusImprovementCompass` / `STATUS_COMPASS_MODES`. |
@@ -265,8 +266,9 @@ production deployment would need to satisfy; it is not a readiness certification
265
266
  ## Release notes (maintainers)
266
267
 
267
268
  Ship notes for a version live under [releases/](https://github.com/pedroknigge/arkgate/tree/main/docs/releases)
268
- (current tree candidate: [4.8.9.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.9.md), prepared and not published;
269
- current published: [4.8.8.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.8.md);
269
+ (current published: [4.8.10.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.10.md);
270
+ prior published: [4.8.9.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.9.md);
271
+ prior published: [4.8.8.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.8.md);
270
272
  prior published: [4.8.7.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.7.md);
271
273
  prior published: [4.8.6.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.6.md);
272
274
  prior published: [4.8.5.md](https://github.com/pedroknigge/arkgate/blob/main/docs/releases/4.8.5.md);
package/docs/use.md CHANGED
@@ -163,12 +163,23 @@ Short loop so agents do not invent residual or re-run doctor every message:
163
163
  **`unavailable`** (or compass facts are missing), run `npx ark-check --doctor` (add `--json` for
164
164
  the full 15-lens map) before treating residual as complete. When mode is **`full`**, status
165
165
  residual ids are a safe subset of doctor residual for the same facts.
166
+ 5. **If ArkGate itself is wrong** — run `npx arkgate report` (alias `ark report`). Default prints
167
+ a draft GitHub issue for **upstream** `pedroknigge/arkgate` (`package.json` `bugs.url`) with
168
+ the arkgate version and last-check snippet. **Ask the human to confirm send.** Create only
169
+ with `--submit` and `--i-confirm-submit` (or TTY `Type submit to send`). `--yes` does not
170
+ submit. If `gh` is missing, the command prints the draft plus `gh issue create --repo
171
+ pedroknigge/arkgate …` and exits 2. Never auto-file. Never file ArkGate defects on the
172
+ consumer product repo. Not `arkgate-check --report` (HTML).
166
173
 
167
174
  ```bash
168
175
  npx ark status --json --expected-root /abs/project/root
169
176
  # when mode is not full:
170
177
  npx ark-check --doctor
171
178
  npx ark-check --doctor --json # doctor.improvementCompass
179
+ # draft an upstream issue (nothing created yet):
180
+ npx ark report
181
+ # after the human says yes — one finding, upstream only:
182
+ npx ark report --submit --i-confirm-submit
172
183
  ```
173
184
 
174
185
  Details: [agent-guide — Session recipe](agent-guide.md#session-recipe-agent-turn) ·
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.8.9",
3
+ "version": "4.8.11",
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",
@@ -188,7 +188,8 @@
188
188
  "qs": "6.15.3",
189
189
  "vite": "6.4.3",
190
190
  "postcss": "8.5.23",
191
- "fast-uri": "3.1.5",
191
+ "fast-uri": "3.1.7",
192
+ "browserslist": "4.28.8",
192
193
  "nanoid": "3.3.18",
193
194
  "brace-expansion@2": "2.1.4",
194
195
  "brace-expansion@5": "5.0.9",
@@ -837,7 +837,7 @@
837
837
  "coverage": {
838
838
  "type": "object",
839
839
  "additionalProperties": false,
840
- "description": "Invariant coverage scan controls. testGlobs replaces the built-in test-name heuristic; maxFiles raises or lowers the evidence file budget; coverageRoots declares where the project runs its tests, so a covering test found outside them is reported instead of silently certifying an invariant.",
840
+ "description": "Invariant coverage scan controls. testGlobs replaces the built-in test-name heuristic; maxFiles raises or lowers the evidence file budget and also bounds structural-hint preload for orchestration-only, thin-adapter, and writes-via-aggregate (default 400; there is no arkrules.hintBudget); coverageRoots declares where the project runs its tests, so a covering test found outside them is reported instead of silently certifying an invariant.",
841
841
  "properties": {
842
842
  "testGlobs": {
843
843
  "type": "array",
@@ -850,7 +850,8 @@
850
850
  },
851
851
  "maxFiles": {
852
852
  "type": "integer",
853
- "minimum": 1
853
+ "minimum": 1,
854
+ "description": "Evidence file budget (default 400) and structural-hint preload cap for orchestration-only, thin-adapter, and writes-via-aggregate. Raise this when hinted/governed counts show truncated sensors. There is no separate arkrules.hintBudget."
854
855
  },
855
856
  "coverageRoots": {
856
857
  "type": "array",
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.9",
9
+ "version": "4.8.11",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.8.9",
14
+ "version": "4.8.11",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"
@@ -19,6 +19,7 @@ description: Map import rules and leftover design. No apply. CLI is a sensor; yo
19
19
  - Doctor #1: if ENFORCE + empty plan A and gates are already installed → **Shape** (`/ark-explore` then `/ark-autopilot`). Do not say install-agent-gates.
20
20
  - Distinguish **missing** skills vs **stale** catalog. Installed ≠ stale.
21
21
  - Hook green is not tree green (scripted edits bypass PreToolUse).
22
+ - Bug / false green / false red / missing doc / improvable behavior **in ArkGate itself** → draft one upstream GitHub issue (`pedroknigge/arkgate` or the installed package `repository.url`), **ask the human to confirm send**, then `gh issue create`. Never auto-file. Never file ArkGate defects on the consumer product repo.
22
23
 
23
24
  ## Autonomy contract
24
25
 
@@ -27,7 +28,24 @@ incomplete. **Do not write** config or product code (that is `/ark-adopt` / `/ar
27
28
  **CLI budget:** one doctor / coverage; then open ≥12 files across ≥4 dirs; then the map.
28
29
 
29
30
  **Still never:** weaken the config; invent `mechanical-safe` kinds; claim healthy because
30
- plan A is empty while leftover design work remains.
31
+ plan A is empty while leftover design work remains; auto-file GitHub issues; file ArkGate
32
+ defects on the consumer product repo; skip the human confirm step.
33
+
34
+ ## Report ArkGate defects (ask first)
35
+
36
+ This skill maps **this** tree. If recon shows a bug, false green, false red, missing doc, or
37
+ improvable behavior **in ArkGate itself** (the `arkgate` package — not leftover design in the
38
+ consumer app):
39
+
40
+ 1. Draft one GitHub issue for **upstream** (`pedroknigge/arkgate`, or `package.json`
41
+ `repository.url` of the installed `arkgate` package).
42
+ 2. **Ask the human in the loop to confirm send.** Do not create the issue until they say yes.
43
+ 3. If confirmed, `gh issue create` with the logged-in account. One finding per issue. Include
44
+ repro commands, version, and measured evidence.
45
+ 4. Never auto-file, batch-spam, or skip confirm. Never file ArkGate defects on the consumer
46
+ product repo.
47
+
48
+ Reporting is not applying product code. Stay map-only on this tree.
31
49
 
32
50
  Use when you need a decision-grade map or the **Primary post-green door**; hand off to
33
51
  `/ark-autopilot` to apply. Day-to-day place + gate work does not require this skill.
@@ -431,6 +449,9 @@ Optional: **Diff vs naive sensor-only read** (what reading the tree changed).
431
449
  - Mode respected: no multi-week roadmap in recon mode; dual-plan seed capped at 3–5 B bets.
432
450
  - Clear handoff: `/ark-adopt` | `/ark-autopilot` | `/ark-place` | CLI | `stop`.
433
451
  - No gate weakening; no false ENFORCE claim; no README echo as primary content.
452
+ - If you found a bug / false green / false red / missing doc / improvable behavior in the
453
+ **ArkGate package**, you drafted one upstream issue, asked the human to confirm, and did not
454
+ `gh issue create` until they said yes. Never filed it on the consumer repo.
434
455
 
435
456
  ## Completion contract (skill incomplete if missing)
436
457
 
@@ -19,6 +19,7 @@ description: Map import rules and leftover design. No apply. CLI is a sensor; yo
19
19
  - Doctor #1: if ENFORCE + empty plan A and gates are already installed → **Shape** (`/ark-explore` then `/ark-autopilot`). Do not say install-agent-gates.
20
20
  - Distinguish **missing** skills vs **stale** catalog. Installed ≠ stale.
21
21
  - Hook green is not tree green (scripted edits bypass PreToolUse).
22
+ - Bug / false green / false red / missing doc / improvable behavior **in ArkGate itself** → draft one upstream GitHub issue (`pedroknigge/arkgate` or the installed package `repository.url`), **ask the human to confirm send**, then `gh issue create`. Never auto-file. Never file ArkGate defects on the consumer product repo.
22
23
 
23
24
  ## Autonomy contract
24
25
 
@@ -27,7 +28,24 @@ incomplete. **Do not write** config or product code (that is `/ark-adopt` / `/ar
27
28
  **CLI budget:** one doctor / coverage; then open ≥12 files across ≥4 dirs; then the map.
28
29
 
29
30
  **Still never:** weaken the config; invent `mechanical-safe` kinds; claim healthy because
30
- plan A is empty while leftover design work remains.
31
+ plan A is empty while leftover design work remains; auto-file GitHub issues; file ArkGate
32
+ defects on the consumer product repo; skip the human confirm step.
33
+
34
+ ## Report ArkGate defects (ask first)
35
+
36
+ This skill maps **this** tree. If recon shows a bug, false green, false red, missing doc, or
37
+ improvable behavior **in ArkGate itself** (the `arkgate` package — not leftover design in the
38
+ consumer app):
39
+
40
+ 1. Draft one GitHub issue for **upstream** (`pedroknigge/arkgate`, or `package.json`
41
+ `repository.url` of the installed `arkgate` package).
42
+ 2. **Ask the human in the loop to confirm send.** Do not create the issue until they say yes.
43
+ 3. If confirmed, `gh issue create` with the logged-in account. One finding per issue. Include
44
+ repro commands, version, and measured evidence.
45
+ 4. Never auto-file, batch-spam, or skip confirm. Never file ArkGate defects on the consumer
46
+ product repo.
47
+
48
+ Reporting is not applying product code. Stay map-only on this tree.
31
49
 
32
50
  Use when you need a decision-grade map or the **Primary post-green door**; hand off to
33
51
  `/ark-autopilot` to apply. Day-to-day place + gate work does not require this skill.
@@ -431,6 +449,9 @@ Optional: **Diff vs naive sensor-only read** (what reading the tree changed).
431
449
  - Mode respected: no multi-week roadmap in recon mode; dual-plan seed capped at 3–5 B bets.
432
450
  - Clear handoff: `/ark-adopt` | `/ark-autopilot` | `/ark-place` | CLI | `stop`.
433
451
  - No gate weakening; no false ENFORCE claim; no README echo as primary content.
452
+ - If you found a bug / false green / false red / missing doc / improvable behavior in the
453
+ **ArkGate package**, you drafted one upstream issue, asked the human to confirm, and did not
454
+ `gh issue create` until they said yes. Never filed it on the consumer repo.
434
455
 
435
456
  ## Completion contract (skill incomplete if missing)
436
457