@sunaiva/gate 1.0.0 → 1.1.0

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 (76) hide show
  1. package/BUSINESS_LICENSE.md +70 -0
  2. package/CHANGELOG.md +148 -0
  3. package/LICENSE +0 -0
  4. package/README.md +411 -27
  5. package/dist/config/defaults.d.ts +22 -1
  6. package/dist/config/defaults.d.ts.map +1 -1
  7. package/dist/config/defaults.js +56 -8
  8. package/dist/config/defaults.js.map +1 -1
  9. package/dist/config/loader.d.ts +0 -0
  10. package/dist/config/loader.d.ts.map +1 -1
  11. package/dist/config/loader.js +24 -6
  12. package/dist/config/loader.js.map +1 -1
  13. package/dist/engine/backend-client.d.ts +58 -0
  14. package/dist/engine/backend-client.d.ts.map +1 -0
  15. package/dist/engine/backend-client.js +287 -0
  16. package/dist/engine/backend-client.js.map +1 -0
  17. package/dist/engine/hmac-verifier.d.ts +33 -0
  18. package/dist/engine/hmac-verifier.d.ts.map +1 -0
  19. package/dist/engine/hmac-verifier.js +161 -0
  20. package/dist/engine/hmac-verifier.js.map +1 -0
  21. package/dist/engine/immutability.d.ts +59 -0
  22. package/dist/engine/immutability.d.ts.map +1 -0
  23. package/dist/engine/immutability.js +129 -0
  24. package/dist/engine/immutability.js.map +1 -0
  25. package/dist/engine/pattern-matcher.d.ts +13 -0
  26. package/dist/engine/pattern-matcher.d.ts.map +1 -1
  27. package/dist/engine/pattern-matcher.js +85 -17
  28. package/dist/engine/pattern-matcher.js.map +1 -1
  29. package/dist/engine/rule-engine.d.ts +62 -1
  30. package/dist/engine/rule-engine.d.ts.map +1 -1
  31. package/dist/engine/rule-engine.js +222 -12
  32. package/dist/engine/rule-engine.js.map +1 -1
  33. package/dist/engine/session-state.d.ts +0 -0
  34. package/dist/engine/session-state.d.ts.map +1 -1
  35. package/dist/engine/session-state.js +8 -2
  36. package/dist/engine/session-state.js.map +1 -1
  37. package/dist/engine/ship-confidence-gate.d.ts +184 -0
  38. package/dist/engine/ship-confidence-gate.d.ts.map +1 -0
  39. package/dist/engine/ship-confidence-gate.js +768 -0
  40. package/dist/engine/ship-confidence-gate.js.map +1 -0
  41. package/dist/index.d.ts +0 -0
  42. package/dist/index.d.ts.map +0 -0
  43. package/dist/index.js +289 -2
  44. package/dist/index.js.map +1 -1
  45. package/dist/rules/categories.json +0 -0
  46. package/dist/rules/presets.json +0 -0
  47. package/dist/rules/rules.json +200 -100
  48. package/dist/tools/audit.d.ts +6 -0
  49. package/dist/tools/audit.d.ts.map +1 -1
  50. package/dist/tools/audit.js +43 -6
  51. package/dist/tools/audit.js.map +1 -1
  52. package/dist/tools/bypass.d.ts +0 -0
  53. package/dist/tools/bypass.d.ts.map +1 -1
  54. package/dist/tools/bypass.js +50 -6
  55. package/dist/tools/bypass.js.map +1 -1
  56. package/dist/tools/rules.d.ts +0 -0
  57. package/dist/tools/rules.d.ts.map +0 -0
  58. package/dist/tools/rules.js +0 -0
  59. package/dist/tools/rules.js.map +0 -0
  60. package/dist/tools/ship-confidence.d.ts +11 -0
  61. package/dist/tools/ship-confidence.d.ts.map +1 -0
  62. package/dist/tools/ship-confidence.js +42 -0
  63. package/dist/tools/ship-confidence.js.map +1 -0
  64. package/dist/tools/update.d.ts +0 -0
  65. package/dist/tools/update.d.ts.map +1 -1
  66. package/dist/tools/update.js +45 -9
  67. package/dist/tools/update.js.map +1 -1
  68. package/dist/tools/validate.d.ts +0 -0
  69. package/dist/tools/validate.d.ts.map +1 -1
  70. package/dist/tools/validate.js +56 -4
  71. package/dist/tools/validate.js.map +1 -1
  72. package/dist/types/backend.d.ts +69 -0
  73. package/dist/types/backend.d.ts.map +1 -0
  74. package/dist/types/backend.js +18 -0
  75. package/dist/types/backend.js.map +1 -0
  76. package/package.json +11 -3
package/README.md CHANGED
@@ -2,17 +2,156 @@
2
2
 
3
3
  **Stop documenting rules your agents ignore. Start enforcing them.**
4
4
 
5
- Sunaiva Gate is an MCP server that enforces validation rules on AI agent actions. 100 battle-tested rules across 9 categories. Constitutional rules that never bend. Audit trail for every decision.
5
+ `@sunaiva/gate` is an MCP server that intercepts AI agent actions before they
6
+ execute and blocks the ones that violate your rules. It runs locally, in
7
+ process, with zero external dependencies on the Free tier — the rules are baked
8
+ into the package and enforced by a deterministic engine.
6
9
 
7
- ## Install
10
+ ```bash
11
+ npx @sunaiva/gate
12
+ ```
13
+
14
+ > **Status**: `1.1.0` "Foundation Release" — first publicly-supported release.
15
+ > Closes all 7 CRITICAL findings from the signed Ship-Confidence verdict on
16
+ > `1.0.1`. Full changelog: [`CHANGELOG.md`](./CHANGELOG.md). Roadmap that led
17
+ > here: [`ROADMAP_1_1_0.md`](./ROADMAP_1_1_0.md).
18
+
19
+ ---
20
+
21
+ ## 60-second quickstart
8
22
 
9
23
  ```bash
24
+ # 1. Install (no signup, no API key, no DNS records)
10
25
  npx @sunaiva/gate
26
+
27
+ # 2. Verify it loaded
28
+ npx @sunaiva/gate --smoke-test
29
+ # → ✓ Gate loaded — 100 rules
30
+ # → ✓ Constitutional rules — 32 (cannot be disabled, enforced locally)
31
+ # → ✓ Premium rules — 68 (require backend service)
32
+ # → Status: HEALTHY
33
+ # → Version: 1.1.0
34
+
35
+ # 3. Add to your MCP client (Claude Code, Cursor, Windsurf, Cline)
36
+ # settings — see "MCP configuration" below.
37
+ ```
38
+
39
+ That is the entire onboarding. The 32 constitutional rules are active on first
40
+ boot; no other configuration is required.
41
+
42
+ ---
43
+
44
+ ## What's free, forever
45
+
46
+ The 1.1.0 Free tier (BUSL-1.1) ships with everything below baked into the npm
47
+ package. No backend, no telemetry, no API key required.
48
+
49
+ - **32 constitutional rules enforced locally** across five categories —
50
+ financial-safety, data-protection, action-governance, security, and
51
+ communication-safety. Detection patterns ship intact inside the package at
52
+ `dist/rules/rules.json`.
53
+ - **Severity ladder**: `block` / `warn-then-block` / `warn`.
54
+ - **Approval-token workflow** — drop a JSON token at
55
+ `data/deploy_queue/APPROVAL_TOKENS/<artifact>.json` and the gate honours it
56
+ once, within a 1-hour TTL. This is the free-tier escape valve for one-shot
57
+ manual unblocks.
58
+ - **Local audit log** at `~/.sunaiva/audit/audit.jsonl` (lifetime, no rotation
59
+ cap). Every entry records `tier`, `audit_status`, `evidence`, and
60
+ `event_type` for queryable history.
61
+ - **Kill-switch** — `DISABLE_SUNAIVA_GATE=1` short-circuits every
62
+ `validate_action` to `allowed: true` with unconditional stderr disclosure.
63
+ - **Dry-run mode** — `SUNAIVA_GATE_DRY_RUN=1` evaluates rules normally and
64
+ records `would_have_blocked: [...]` without ever blocking.
65
+ - **Constitutional immutability** — the 32 rules cannot be disabled via
66
+ `update_rules` and cannot be bypassed via `log_bypass`, even if
67
+ `~/.sunaiva/gate-config.json` is hand-edited (the loader re-merges on every
68
+ read).
69
+ - **Fail-CLOSED by default** — uncaught exceptions exit 3, malformed input
70
+ exits 4. Both write a structured audit entry. Opt-in legacy fail-open via
71
+ `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR=1`.
72
+ - **MCP integration** — Claude Code, Cursor, Copilot, Windsurf, Cline via the
73
+ standard `mcpServers` config.
74
+
75
+ The Free tier is BUSL-1.1 licensed and converts to **Apache-2.0** on
76
+ **2030-05-10**. You can fork it, modify it, embed it in internal CI, and ship
77
+ it in non-production workflows today — no contract, no signup, no credit card.
78
+
79
+ ---
80
+
81
+ ## What you get with Pro — `$79/mo` recommended, BYOK
82
+
83
+ Pro adds the things a deterministic local engine cannot do on its own. Full
84
+ tier matrix and pricing rationale: [`TIER_DEFINITIONS.md`](./TIER_DEFINITIONS.md).
85
+
86
+ - **68 additional premium rules** (100 total) evaluated server-side via the
87
+ premium backend at `https://gate.sunaiva.dev/api/v1/match`. Detection
88
+ patterns are proprietary and stay in our infrastructure.
89
+ - **Signed Ship-Confidence verdicts** — HMAC-SHA256, 60-minute freshness
90
+ window. The `ship_confidence_check` MCP tool verifies the signature in
91
+ constant time and returns `allowed: true` only when the verdict is
92
+ `GREEN`, fresh, and untampered.
93
+ - **`sunaiva-ship-confidence` skill integration** — three independent
94
+ verification layers (cross-provider spec verification, property-based
95
+ testing with Hypothesis, adversarial audit via garak + DeepTeam) that
96
+ emit signed verdicts the Gate honours automatically in CI.
97
+ - **Dashboard** — rules tab, audit tab, settings tab, billing tab. Cloud
98
+ audit sync with 90-day retention.
99
+ - **BYOK** — bring your own `ANTHROPIC_API_KEY` and `OPENROUTER_API_KEY`.
100
+ You pay your own inference bill. We never see your tokens.
101
+ - **Email support** — `support@sunaivadigital.com`, 2-business-day SLA
102
+ target.
103
+ - **Stripe-managed billing** with the founders coupon `KINANFOUNDER2026`
104
+ (100% off, first 10 redemptions, per Rule 30).
105
+
106
+ Enterprise (SSO, on-prem, multi-tenant org dashboard, named CSM) is
107
+ quote-to-cash — see [`TIER_DEFINITIONS.md`](./TIER_DEFINITIONS.md) §3.
108
+
109
+ ---
110
+
111
+ ## Architecture
112
+
113
+ ```
114
+ ┌────────────────────────────────────────────────────────────────┐
115
+ │ Your project (Claude Code / Cursor / Windsurf / Cline) │
116
+ │ │
117
+ │ ┌──────────────────────────────────────────────────────┐ │
118
+ │ │ MCP client invokes a tool │ │
119
+ │ │ e.g. Bash("git push origin main") │ │
120
+ │ └────────────────────────┬─────────────────────────────┘ │
121
+ └────────────────────────────┼───────────────────────────────────┘
122
+
123
+ ┌────────────────────────────────────────────────────────────────┐
124
+ │ @sunaiva/gate (MCP server, stdio transport) │
125
+ │ │
126
+ │ ┌──────────────────────────────────────────────────────┐ │
127
+ │ │ validate_action │ │
128
+ │ │ │ │ │
129
+ │ │ ├─► Constitutional rules (32) — pattern matched │ │
130
+ │ │ │ LOCALLY against dist/rules/rules.json │ │
131
+ │ │ │ ─────────────────────────────► block/warn │ │
132
+ │ │ │ │ │
133
+ │ │ └─► Premium rules (68) — only if backend set │ │
134
+ │ │ POST https://gate.sunaiva.dev/api/v1/match │ │
135
+ │ │ (JWT auth via SUNAIVA_GATE_API_TOKEN) │ │
136
+ │ │ ─────────────────────────────► block/warn │ │
137
+ │ │ (fail-OPEN per-rule on backend error) │ │
138
+ │ └──────────────────────────────────────────────────────┘ │
139
+ │ │
140
+ │ audit log ─► ~/.sunaiva/audit/audit.jsonl │
141
+ └────────────────────────────────────────────────────────────────┘
11
142
  ```
12
143
 
13
- ## MCP Configuration
144
+ The Free tier path (constitutional rules) has zero network dependencies. The
145
+ Pro path is opt-in — set `SUNAIVA_GATE_BACKEND_URL` and the engine starts
146
+ POSTing actions to the backend for the premium-rule subset; without it, those
147
+ rules are skipped (recorded as `skipped_premium` in the audit, surfaced once
148
+ per session as a stderr notice).
14
149
 
15
- Add to your Claude Code or Cursor MCP settings:
150
+ ---
151
+
152
+ ## MCP configuration
153
+
154
+ Add to your client's MCP settings:
16
155
 
17
156
  ```json
18
157
  {
@@ -25,43 +164,288 @@ Add to your Claude Code or Cursor MCP settings:
25
164
  }
26
165
  ```
27
166
 
28
- ## Tools
167
+ Restart your MCP client. The first tool call will trigger the gate.
168
+
169
+ ---
170
+
171
+ ## MCP tool reference
172
+
173
+ | Tool | What it does |
174
+ |------|--------------|
175
+ | `validate_action` | Check a proposed action against all active rules. Returns `{allowed, violations[], warnings[], skipped_premium[], dry_run?, would_have_blocked?, stamp}`. The workhorse — every PreToolUse hook calls this. |
176
+ | `log_bypass` | Record an intentional rule bypass for the audit log. **Rejects constitutional rules** with a structured `CONSTITUTIONAL_RULE_CANNOT_BE_BYPASSED` error. |
177
+ | `get_rules` | List active rules; supports filtering by `category` or `preset`. |
178
+ | `update_rules` | Enable / disable rules. **Rejects disable attempts against constitutional rules** with a structured `CONSTITUTIONAL_RULE_IMMUTABLE` error. |
179
+ | `get_audit_log` | Return recent gate decisions from `~/.sunaiva/audit/audit.jsonl` with `tier`, `audit_status`, `evidence`, `event_type` fields. |
180
+ | `ship_confidence_check` | **Paid-tier production-deploy gate.** Accepts a signed verdict path or artifact ID; verifies HMAC-SHA256 against `SHIP_CONFIDENCE_SIGNING_KEY`; returns `{allowed, tier: "paid"\|"free", reason, evidence}`. Tagged in the audit ledger so you can measure the free-→paid upgrade funnel. |
181
+
182
+ Total: **6 MCP tools**. The `ship_confidence_check` tool is the ported
183
+ TypeScript implementation of `.claude/hooks/ship_confidence_gate.py` v1.2.0,
184
+ byte-compatible with the Python skill's canonical-JSON HMAC format.
185
+
186
+ ---
187
+
188
+ ## Environment variables
189
+
190
+ | Variable | Default | Purpose |
191
+ |----------|---------|---------|
192
+ | `DISABLE_SUNAIVA_GATE` | unset | Set to `1` to short-circuit every `validate_action` to `allowed: true`. Unconditionally logs to stderr. |
193
+ | `SUNAIVA_GATE_DRY_RUN` | unset | Set to `1` to evaluate rules normally but never block. Response includes `dry_run: true` and `would_have_blocked: [...]`. |
194
+ | `SUNAIVA_GATE_BACKEND_URL` | unset | Premium backend endpoint. Default for Pro customers: `https://gate.sunaiva.dev/api/v1/match`. When unset, premium rules are skipped (recorded as `skipped_premium`). |
195
+ | `SUNAIVA_GATE_API_TOKEN` | unset | Bearer token (JWT) for the premium backend. Required when `SUNAIVA_GATE_BACKEND_URL` is set. |
196
+ | `SUNAIVA_GATE_BACKEND_TIMEOUT_MS` | `3000` | Backend request timeout. Backend errors fail-OPEN per-rule (logged as `skipped_premium_backend_error`). |
197
+ | `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR` | unset | Set to `1` to restore the 1.0.x fail-open behaviour on uncaught exceptions and malformed input. Default is fail-CLOSED. |
198
+ | `SHIP_CONFIDENCE_SIGNING_KEY` | unset | HMAC-SHA256 key for verifying signed `sunaiva-ship-confidence` verdicts. Required by the `ship_confidence_check` tool. |
199
+ | `SUNAIVA_GATE_AUDIT_PATH` | `~/.sunaiva/audit/audit.jsonl` | Override the audit log path. |
200
+
201
+ ---
202
+
203
+ ## Exit codes
204
+
205
+ | Code | Meaning |
206
+ |------|---------|
207
+ | `0` | Allow / success / smoke-test HEALTHY |
208
+ | `1` | Generic test failure (legacy `--test` flag, smoke-test DEGRADED) |
209
+ | `2` | Block (Claude Code convention) |
210
+ | `3` | Fail-CLOSED internal error (uncaught exception). Opt-in fail-open via `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR=1`. |
211
+ | `4` | Fail-CLOSED invalid input (malformed JSON, empty stdin). Same opt-in escape hatch. |
212
+ | `5` | Smoke-test DEGRADED with missing required files (e.g. `dist/rules/rules.json` absent). |
213
+
214
+ ---
215
+
216
+ ## Killing the gate (and why we tell you how)
217
+
218
+ `@sunaiva/gate` discloses its kill-switch in every block and warn message:
219
+
220
+ ```
221
+ [sunaiva-gate v1.1.0] BLOCK — rule: dat-001 (recursive root deletion)
222
+ Escape: export DISABLE_SUNAIVA_GATE=1
223
+ Audit: ~/.sunaiva/audit/audit.jsonl
224
+ ```
225
+
226
+ The escape hint is a deliberate security-disclosure design. An enforcement
227
+ product that hides its own bypass is one that gets routed around in production
228
+ without anyone knowing. The kill-switch invocation is itself logged to the
229
+ audit ledger as `decision: 'bypass_kill_switch'`, so disabling the gate is
230
+ visible to anyone who reads the audit.
231
+
232
+ ```bash
233
+ export DISABLE_SUNAIVA_GATE=1 # All actions allowed (logged)
234
+ unset DISABLE_SUNAIVA_GATE # Back to normal enforcement
235
+ ```
236
+
237
+ Use dry-run instead of the kill-switch when you want to *measure* what the
238
+ gate would block without actually blocking anything:
29
239
 
30
- | Tool | Description |
31
- |------|-------------|
32
- | `validate_action` | Check if a proposed action passes all active rules |
33
- | `log_bypass` | Record an intentional rule bypass (non-constitutional only) |
34
- | `get_rules` | List active rules, filter by category or preset |
35
- | `update_rules` | Enable/disable rules (constitutional rules cannot be disabled) |
36
- | `get_audit_log` | View recent gate decisions |
240
+ ```bash
241
+ export SUNAIVA_GATE_DRY_RUN=1
242
+ # response.dry_run: true
243
+ # response.would_have_blocked: [{rule_id, name, severity}, ...]
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Decision model — warn-then-block escalation
249
+
250
+ Constitutional rules block on the first match. Standard rules (the
251
+ non-constitutional subset) implement a session-state escalation:
252
+
253
+ - **First match in a session** → `warn` (action allowed, message printed).
254
+ - **Subsequent matches in the same session** → `block`.
255
+
256
+ This avoids one-time false-positive noise while still catching repeated
257
+ violations. The session counter is reset when the MCP server process restarts.
258
+ Confidence is derived from keyword-count thresholds: `≥3` keywords matched →
259
+ `high`, `1-2` → `medium`, `0` → `low` (low confidence is filtered out before
260
+ the response).
261
+
262
+ ---
263
+
264
+ ## Smoke test
265
+
266
+ ```bash
267
+ $ npx @sunaiva/gate --smoke-test
268
+ ✓ Gate loaded — 100 rules
269
+ ✓ Constitutional rules — 32 (cannot be disabled, enforced locally)
270
+ ✓ Premium rules — 68 (require backend service)
271
+ ✓ Presets file — 5 presets available
272
+ ✓ Live eval (git push origin main) — HARD block via gov-001
273
+ ✓ Live eval (ls -la) — ALLOW
274
+ ✓ Live eval (rm -rf /) — HARD block via dat-001
275
+ ✓ Live eval (stripe.charges.create) — HARD block via fin-001
276
+ ✓ Immutability guard — ACTIVE (32 constitutional rules pinned)
277
+ ✓ MCP server — ready (not started in smoke test)
278
+ Status: HEALTHY
279
+ Version: 1.1.0
280
+ Issues: https://github.com/Kinan27/sunaiva-gate/issues
281
+ ```
282
+
283
+ Exit codes: `0` = HEALTHY, `1` = DEGRADED, `5` = missing required files.
284
+
285
+ ---
37
286
 
38
287
  ## Presets
39
288
 
40
- - **minimal** (5 rules) absolute non-negotiables
41
- - **essential** (15 rules) — recommended starting point
42
- - **developer-safety** (25 rules) for AI coding agents
43
- - **financial-protection** (24 rules) — all financial + resource rules
44
- - **full-suite** (100 rules) everything
289
+ `get_rules` accepts a `preset` argument that filters the active set:
290
+
291
+ | Preset | Rules | Use case |
292
+ |--------|-------|----------|
293
+ | `minimal` | 5 | Absolute non-negotiables only |
294
+ | `essential` | 15 | Recommended starting point |
295
+ | `developer-safety` | 25 | AI coding agents (Cursor / Windsurf / Cline / Aider) |
296
+ | `financial-protection` | 24 | All financial + resource rules |
297
+ | `full-suite` | 100 | Everything — Free constitutional set + Pro premium set |
298
+
299
+ Presets read from `dist/rules/presets.json`. Premium presets require
300
+ `SUNAIVA_GATE_BACKEND_URL` to be set; without it the premium rules are skipped
301
+ with a `skipped_premium` audit entry.
302
+
303
+ ---
304
+
305
+ ## Ship Confidence Gate (paid tier)
306
+
307
+ The `ship_confidence_check` MCP tool is the deploy-time gate for high-blast-
308
+ radius commands (`npm publish`, `wrangler deploy`, `gh repo create --public`,
309
+ `netlify deploy --prod`). It checks for authorization in two tiers:
310
+
311
+ ### Paid path — signed verdict
312
+ 1. The `sunaiva-ship-confidence` Python skill runs three verification layers
313
+ against your product (spec verification, property-based testing,
314
+ adversarial audit).
315
+ 2. It emits a signed verdict at
316
+ `data/ship_confidence_verdicts/<artifact>.signed.json`.
317
+ 3. The `ship_confidence_check` tool verifies:
318
+ - HMAC-SHA256 signature is valid (constant-time compare, byte-compatible
319
+ with the Python skill's canonical-JSON encoding).
320
+ - `level == "GREEN"` (YELLOW and RED hard-block).
321
+ - Signed within the last 60 minutes
322
+ (configurable via `VERDICT_MAX_AGE_MINUTES`).
323
+ 4. On all-pass: returns `{allowed: true, tier: "paid", ...}` and writes an
324
+ audit entry tagged `tier: "paid"` with the verdict ID and evidence.
325
+
326
+ ### Free fallback — approval token
327
+ If no signed verdict is found (or `SHIP_CONFIDENCE_SIGNING_KEY` is not set),
328
+ the tool falls back to a one-time approval token at
329
+ `data/deploy_queue/APPROVAL_TOKENS/<artifact>.json` written within the last
330
+ hour. Tagged `tier: "free"` in the audit ledger with an upgrade hint pointing
331
+ at the paid skill.
332
+
333
+ ```bash
334
+ # CLI form for use in CI:
335
+ npx @sunaiva/gate --ship-confidence @sunaiva/gate@1.1.0
336
+ # Exit 0 = allow, 2 = block, 3 = internal error (fail-OPEN logged)
337
+ ```
338
+
339
+ ---
340
+
341
+ ## Constitutional rules cannot be disabled or bypassed
342
+
343
+ This is the package's hard guarantee. The 32 constitutional rules are
344
+ re-merged into `active_rules` on every config load — even if
345
+ `~/.sunaiva/gate-config.json` is hand-edited to remove them — and:
346
+
347
+ - `update_rules({disable: ['fin-001']})` returns
348
+ `{error: "CONSTITUTIONAL_RULE_IMMUTABLE", rule_ids: [...]}`. No state
349
+ change.
350
+ - `log_bypass({rule_id: 'fin-001'})` returns
351
+ `{error: "CONSTITUTIONAL_RULE_CANNOT_BE_BYPASSED", rule_id: ...}`. Nothing
352
+ written to the bypass log.
353
+
354
+ The kill-switch (`DISABLE_SUNAIVA_GATE=1`) is the only way to disable
355
+ constitutional enforcement, and it is loud — stderr disclosure on every
356
+ block, audit-ledger entry on every short-circuit. There are no quiet
357
+ bypasses.
358
+
359
+ ---
360
+
361
+ ## Known limitations — what 1.1.0 does NOT have
362
+
363
+ We shipped `1.0.1` with seven CRITICAL gaps flagged by our own signed
364
+ Ship-Confidence verdict on our own commit (`01KRDBCEYF2CAB21G6Y3E9VVH5`, RED).
365
+ 1.1.0 closes all seven. What is honestly **not** in 1.1.0 yet:
366
+
367
+ - **Sunaiva-Managed inference** — no flat-fee tier that includes LLM calls.
368
+ BYOK only in v1. Revisit at 50+ Pro customers.
369
+ - **UI verification layer** (Playwright walkthroughs / computer-use) —
370
+ designed in
371
+ `data/ship_confidence_skill_upgrade_2026_05_11.md`, not yet shipped.
372
+ Folded into Pro at no extra cost when it lands.
373
+ - **Multi-tenant dashboard / "Pro Team" tier** — Pro is single-seat in v1.
374
+ Team management is Enterprise. A self-serve "Pro Team" tier waits until
375
+ 10+ customers ask for it.
376
+ - **On-prem / VPC deployment** — Enterprise-only roadmap item. Helm chart
377
+ and Terraform module designs exist; not yet packaged.
378
+ - **Per-call / metered pricing** — abandoned. Subscription wins.
379
+ - **On-chain attestation (ERC-8004)** — aspirational. Deferred to v2.x.
380
+
381
+ Full deferred-feature list:
382
+ [`TIER_DEFINITIONS.md` §4](./TIER_DEFINITIONS.md).
383
+
384
+ ---
385
+
386
+ ## Cross-platform
387
+
388
+ - **Linux** — native.
389
+ - **WSL** — native.
390
+ - **macOS** — native.
391
+ - **Windows** — native Node, plus a Python shim for clients that invoke the
392
+ legacy `hooks/sunaiva_gate_hook.py` PreToolUse path.
393
+
394
+ ---
45
395
 
46
396
  ## Privacy
47
397
 
48
- Your data stays where you choose:
49
- - **Managed** zero config, Gemini Flash included
50
- - **BYOK** bring your own API key (Gemini, Claude, OpenRouter)
51
- - **Local** Ollama/LM Studio, nothing leaves your machine
398
+ Your data stays where you choose. The Free tier makes **zero** external network
399
+ callsconstitutional rules are evaluated locally against patterns shipped
400
+ inside the package. The Pro path is opt-in: when you set
401
+ `SUNAIVA_GATE_BACKEND_URL`, the engine POSTs only the proposed action text
402
+ and rule IDs to the backend; we never see your code, your secrets, or your
403
+ filesystem. BYOK means your `ANTHROPIC_API_KEY` and `OPENROUTER_API_KEY` go
404
+ direct from your machine to those providers — they do not transit Sunaiva.
405
+
406
+ ---
52
407
 
53
408
  ## License
54
409
 
55
- **Business Source License 1.1 (BUSL-1.1)**
410
+ [BUSL-1.1](./BUSINESS_LICENSE.md) — free for evaluation, internal development,
411
+ hobby and academic use. Commercial license required if you embed the Gate in
412
+ the critical path of a third-party paying-customer product before the
413
+ **Change Date of 2030-05-10**, after which the wrapper converts to
414
+ **Apache-2.0** automatically. The premium backend stays proprietary regardless
415
+ of the Change Date.
56
416
 
57
417
  - Licensor: Sunaiva Digital
58
- - Change Date: 2030-05-09 (4 years from publication)
59
- - Change License: Apache License, Version 2.0
418
+ - Change Date: **2030-05-10**
419
+ - Change License: **Apache License, Version 2.0**
420
+
421
+ ---
422
+
423
+ ## Support
424
+
425
+ | Need | Where |
426
+ |------|-------|
427
+ | Bug or crash | [Open an issue](https://github.com/Kinan27/sunaiva-gate/issues/new?template=bug.yml) |
428
+ | Feature request | [Open an issue](https://github.com/Kinan27/sunaiva-gate/issues/new?template=feature.yml) |
429
+ | Security vulnerability | Email `security@sunaivadigital.com` (do not file publicly) |
430
+ | Licensing | `kinan@sunaiva.ai` |
431
+ | Commercial / paid tier | `support@sunaivadigital.com` |
432
+ | General discussion | [GitHub Discussions](https://github.com/Kinan27/sunaiva-gate/discussions) |
433
+
434
+ Full support guide: [`SUPPORT.md`](./SUPPORT.md).
435
+
436
+ When reporting bugs, include the output of `npx @sunaiva/gate --smoke-test`
437
+ and `node --version`.
438
+
439
+ ---
60
440
 
61
- Until the Change Date, use is permitted for non-commercial purposes and internal evaluation. Production use requires a commercial license from Sunaiva Digital.
441
+ ## Contributing
62
442
 
63
- Full BUSL 1.1 text: https://mariadb.com/bsl11/
443
+ Pull requests welcome. For substantial changes, please open an issue first to
444
+ discuss the proposal. Constitutional rule additions require a corresponding
445
+ test fixture in `tests/bundle.test.ts` and a passing dogfood Ship-Confidence
446
+ verdict on the change.
64
447
 
65
448
  ---
66
449
 
67
- Built by [Sunaiva Digital](https://sunaivadigital.com). Patent-protected validation infrastructure.
450
+ *Built by a team whose own hooks killed their development for nine hours.
451
+ We fixed it. Then we shipped the fix. Then we signed the proof.*
@@ -1,9 +1,30 @@
1
1
  /**
2
- * Default configuration values for @sunaiva/gate
2
+ * Default configuration values for @sunaiva/gate.
3
+ *
4
+ * The active_rules list defaults to the full constitutional set
5
+ * (every rule with `enforcement: "constitutional"` in rules.json).
6
+ * This guarantees that even a user with no on-disk config gets the
7
+ * full local enforcement layer out of the box. Constitutional rules
8
+ * cannot be disabled via `update_rules` (enforced by B4's immutability
9
+ * guard) — they are listed here for explicitness and so that the in-
10
+ * memory config matches the on-disk default that getConfig() writes.
11
+ *
12
+ * To keep this list in sync with rules/rules.json, see
13
+ * `scripts/verify-bundle.js` which asserts that every constitutional
14
+ * rule ID appears in DEFAULT_CONFIG.active_rules at pack time.
3
15
  */
4
16
  export declare const CONFIG_DIR: string;
5
17
  export declare const CONFIG_PATH: string;
6
18
  export declare const AUDIT_LOG_PATH: string;
19
+ /**
20
+ * Every constitutional rule ID (enforcement === "constitutional") shipped
21
+ * in rules/rules.json. Kept as a frozen array so it can be referenced
22
+ * by B4's immutability guard and by the bundle-verify script.
23
+ *
24
+ * UPDATE PROCEDURE: when rules.json gains a new constitutional rule,
25
+ * add its ID here. The verify-bundle script will flag a mismatch.
26
+ */
27
+ export declare const CONSTITUTIONAL_RULE_IDS: readonly string[];
7
28
  export declare const DEFAULT_CONFIG: GateConfig;
8
29
  export declare const MANAGED_API_BASE = "https://api.sunaiva.ai/v1/gate";
9
30
  export interface ModelConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,UAAU,QAA8B,CAAC;AACtD,eAAO,MAAM,WAAW,QAAuC,CAAC;AAChE,eAAO,MAAM,cAAc,QAAkC,CAAC;AAE9D,eAAO,MAAM,cAAc,EAAE,UAe5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAAmC,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,OAAO,CAAC;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACpD,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,eAAO,MAAM,UAAU,QAA8B,CAAC;AACtD,eAAO,MAAM,WAAW,QAAuC,CAAC;AAChE,eAAO,MAAM,cAAc,QAAkC,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAiCnD,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,UAS5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAAmC,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,OAAO,CAAC;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACpD,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -1,20 +1,68 @@
1
1
  /**
2
- * Default configuration values for @sunaiva/gate
2
+ * Default configuration values for @sunaiva/gate.
3
+ *
4
+ * The active_rules list defaults to the full constitutional set
5
+ * (every rule with `enforcement: "constitutional"` in rules.json).
6
+ * This guarantees that even a user with no on-disk config gets the
7
+ * full local enforcement layer out of the box. Constitutional rules
8
+ * cannot be disabled via `update_rules` (enforced by B4's immutability
9
+ * guard) — they are listed here for explicitness and so that the in-
10
+ * memory config matches the on-disk default that getConfig() writes.
11
+ *
12
+ * To keep this list in sync with rules/rules.json, see
13
+ * `scripts/verify-bundle.js` which asserts that every constitutional
14
+ * rule ID appears in DEFAULT_CONFIG.active_rules at pack time.
3
15
  */
4
16
  import { homedir } from "os";
5
17
  import { join } from "path";
6
18
  export const CONFIG_DIR = join(homedir(), ".sunaiva");
7
19
  export const CONFIG_PATH = join(CONFIG_DIR, "gate-config.json");
8
20
  export const AUDIT_LOG_PATH = join(CONFIG_DIR, "audit.jsonl");
21
+ /**
22
+ * Every constitutional rule ID (enforcement === "constitutional") shipped
23
+ * in rules/rules.json. Kept as a frozen array so it can be referenced
24
+ * by B4's immutability guard and by the bundle-verify script.
25
+ *
26
+ * UPDATE PROCEDURE: when rules.json gains a new constitutional rule,
27
+ * add its ID here. The verify-bundle script will flag a mismatch.
28
+ */
29
+ export const CONSTITUTIONAL_RULE_IDS = Object.freeze([
30
+ "cmp-002",
31
+ "com-001",
32
+ "com-002",
33
+ "com-005",
34
+ "com-006",
35
+ "com-007",
36
+ "com-009",
37
+ "com-011",
38
+ "dat-001",
39
+ "dat-002",
40
+ "dat-004",
41
+ "dat-010",
42
+ "fin-001",
43
+ "fin-002",
44
+ "fin-003",
45
+ "fin-004",
46
+ "fin-008",
47
+ "fin-009",
48
+ "gov-001",
49
+ "gov-002",
50
+ "gov-004",
51
+ "gov-005",
52
+ "gov-006",
53
+ "gov-008",
54
+ "gov-012",
55
+ "know-009",
56
+ "sec-001",
57
+ "sec-002",
58
+ "sec-004",
59
+ "sec-006",
60
+ "sec-010",
61
+ "sec-011",
62
+ ]);
9
63
  export const DEFAULT_CONFIG = {
10
64
  api_key: "",
11
- active_rules: [
12
- "fin-001",
13
- "gov-001",
14
- "gov-002",
15
- "dat-001",
16
- "gov-008",
17
- ],
65
+ active_rules: [...CONSTITUTIONAL_RULE_IDS],
18
66
  active_preset: "minimal",
19
67
  enforcement_mode: "enforce",
20
68
  model: {
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,OAAO,EAAE,EAAE;IACX,YAAY,EAAE;QACZ,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;KACV;IACD,aAAa,EAAE,SAAS;IACxB,gBAAgB,EAAE,SAAS;IAC3B,KAAK,EAAE;QACL,QAAQ,EAAE,SAAS;KACpB;IACD,cAAc,EAAE,cAAc;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,gCAAgC,CAAC"}
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACtE,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,CAAC,GAAG,uBAAuB,CAAC;IAC1C,aAAa,EAAE,SAAS;IACxB,gBAAgB,EAAE,SAAS;IAC3B,KAAK,EAAE;QACL,QAAQ,EAAE,SAAS;KACpB;IACD,cAAc,EAAE,cAAc;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,gCAAgC,CAAC"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AACA,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEzF,wBAAgB,SAAS,IAAI,UAAU,CAMtC;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAGhD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAGvB,wBAAgB,SAAS,IAAI,UAAU,CAgBtC;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAGhD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C"}
@@ -1,13 +1,31 @@
1
+ /**
2
+ * Config loader. Constitutional rule IDs are RE-MERGED into active_rules
3
+ * on every load — see `enforceConstitutionalActive` in immutability.ts.
4
+ * This means a user can hand-edit `~/.sunaiva/gate-config.json` to remove
5
+ * constitutional rules and the next runtime load will simply re-add them
6
+ * (in-memory only — the on-disk file is left untouched).
7
+ */
1
8
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
2
- import { CONFIG_DIR, CONFIG_PATH, DEFAULT_CONFIG } from "./defaults.js";
9
+ import { CONFIG_DIR, CONFIG_PATH, DEFAULT_CONFIG, } from "./defaults.js";
10
+ import { enforceConstitutionalActive } from "../engine/immutability.js";
3
11
  export function getConfig() {
12
+ let loaded;
4
13
  try {
5
- if (existsSync(CONFIG_PATH))
6
- return JSON.parse(readFileSync(CONFIG_PATH, "utf-8"));
14
+ if (existsSync(CONFIG_PATH)) {
15
+ loaded = JSON.parse(readFileSync(CONFIG_PATH, "utf-8"));
16
+ }
17
+ else {
18
+ saveConfig(DEFAULT_CONFIG);
19
+ loaded = { ...DEFAULT_CONFIG };
20
+ }
7
21
  }
8
- catch { }
9
- saveConfig(DEFAULT_CONFIG);
10
- return { ...DEFAULT_CONFIG };
22
+ catch {
23
+ saveConfig(DEFAULT_CONFIG);
24
+ loaded = { ...DEFAULT_CONFIG };
25
+ }
26
+ // ALWAYS re-merge constitutional active_rules — user tampering of the
27
+ // on-disk file cannot disable a constitutional rule.
28
+ return enforceConstitutionalActive(loaded);
11
29
  }
12
30
  export function saveConfig(cfg) {
13
31
  mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAEzF,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC;QACH,IAAI,UAAU,CAAC,WAAW,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACrF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3B,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAe;IACxC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACxD,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,EAAE,CAAC,YAAY,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,UAAU,EACV,WAAW,EACX,cAAc,GAEf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,MAAM,UAAU,SAAS;IACvB,IAAI,MAAkB,CAAC;IACvB,IAAI,CAAC;QACH,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC5B,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,cAAc,CAAC,CAAC;YAC3B,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;QACjC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,UAAU,CAAC,cAAc,CAAC,CAAC;QAC3B,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;IACjC,CAAC;IACD,sEAAsE;IACtE,qDAAqD;IACrD,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAe;IACxC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACxD,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,EAAE,CAAC,YAAY,CAAC;AAClC,CAAC"}