@sunaiva/gate 1.1.0 → 1.1.2

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 (56) hide show
  1. package/BUSINESS_LICENSE.md +70 -70
  2. package/CHANGELOG.md +254 -148
  3. package/README.md +451 -451
  4. package/README.md.bak-v1.0.0-stale-MIT +59 -0
  5. package/SUPPORT.md +75 -0
  6. package/TIER_DEFINITIONS.md +161 -0
  7. package/dist/config/loader.d.ts.map +1 -1
  8. package/dist/config/loader.js +1 -1
  9. package/dist/config/loader.js.map +1 -1
  10. package/dist/engine/backend-client.d.ts.map +1 -1
  11. package/dist/engine/backend-client.js +2 -2
  12. package/dist/engine/backend-client.js.map +1 -1
  13. package/dist/engine/hmac-verifier.d.ts +19 -0
  14. package/dist/engine/hmac-verifier.d.ts.map +1 -1
  15. package/dist/engine/hmac-verifier.js +1 -3
  16. package/dist/engine/hmac-verifier.js.map +1 -1
  17. package/dist/engine/immutability.d.ts.map +1 -1
  18. package/dist/engine/immutability.js.map +1 -1
  19. package/dist/engine/pattern-matcher.d.ts.map +1 -1
  20. package/dist/engine/pattern-matcher.js.map +1 -1
  21. package/dist/engine/rule-engine.d.ts.map +1 -1
  22. package/dist/engine/rule-engine.js +5 -3
  23. package/dist/engine/rule-engine.js.map +1 -1
  24. package/dist/engine/session-state.d.ts.map +1 -1
  25. package/dist/engine/session-state.js.map +1 -1
  26. package/dist/engine/ship-confidence-gate.d.ts +48 -0
  27. package/dist/engine/ship-confidence-gate.d.ts.map +1 -1
  28. package/dist/engine/ship-confidence-gate.js +2 -2
  29. package/dist/engine/ship-confidence-gate.js.map +1 -1
  30. package/dist/index.js +27 -23
  31. package/dist/rules/rules.json +168 -200
  32. package/dist/tools/audit.d.ts.map +1 -1
  33. package/dist/tools/audit.js.map +1 -1
  34. package/dist/tools/bypass.d.ts.map +1 -1
  35. package/dist/tools/bypass.js +1 -1
  36. package/dist/tools/bypass.js.map +1 -1
  37. package/dist/tools/export-attestation.d.ts +45 -0
  38. package/dist/tools/export-attestation.d.ts.map +1 -0
  39. package/dist/tools/export-attestation.js +152 -0
  40. package/dist/tools/export-attestation.js.map +1 -0
  41. package/dist/tools/ship-confidence.d.ts +6 -0
  42. package/dist/tools/ship-confidence.d.ts.map +1 -1
  43. package/dist/tools/ship-confidence.js.map +1 -1
  44. package/dist/tools/update.d.ts.map +1 -1
  45. package/dist/tools/update.js +1 -1
  46. package/dist/tools/update.js.map +1 -1
  47. package/dist/tools/validate.d.ts.map +1 -1
  48. package/dist/tools/validate.js +1 -1
  49. package/dist/tools/validate.js.map +1 -1
  50. package/dist/types/backend.d.ts +1 -1
  51. package/dist/types/backend.d.ts.map +1 -1
  52. package/dist/types/backend.js +1 -1
  53. package/dist/types/backend.js.map +1 -1
  54. package/package.json +83 -73
  55. package/dist/index.d.ts.map +0 -1
  56. package/dist/index.js.map +0 -1
@@ -1,70 +1,70 @@
1
- # Business Source License — `@sunaiva/gate`
2
-
3
- This package is published under the **Business Source License 1.1 (BUSL-1.1)**.
4
- The full BUSL-1.1 legal text lives in [`LICENSE`](./LICENSE) and at
5
- <https://mariadb.com/bsl11/>. This document is a plain-language summary so
6
- contributors and prospective customers know what they can and cannot do.
7
-
8
- ## What you can do today, for free
9
-
10
- The following uses are licensed at no cost the moment you `npx @sunaiva/gate`:
11
-
12
- - **Evaluation, exploration, and proof-of-concept work** in any environment.
13
- - **Internal development, testing, staging, and CI** runs — including running
14
- the gate inside team workflows that never touch external paying customers.
15
- - **Personal, hobbyist, academic, and research use** of any kind.
16
- - **Forking, modifying, and redistributing the source code** under the same
17
- BUSL-1.1 terms, with attribution preserved.
18
-
19
- ## What requires a commercial license
20
-
21
- You need a paid license from Sunaiva Digital if you use this package to
22
- provide a service to **third-party paying customers in production** (i.e.
23
- running it in the critical path of a revenue-generating product before the
24
- Change Date below). Contact **kinan@sunaiva.ai** for pricing.
25
-
26
- ## Change Date and Change License
27
-
28
- - **Change Date**: **2030-05-10** (4 years after the first publication of
29
- `@sunaiva/gate` on the npm registry — version `1.0.0`, 2026-05-10).
30
- - **Change License**: **Apache License, Version 2.0** (chosen for its broad
31
- compatibility, explicit patent grant, and standing as the most common
32
- conversion target for BUSL-licensed projects).
33
- - **Current version**: `1.1.0` ("Foundation Release"), 2026-05-12 — the first
34
- release with the full constitutional rule set enforced locally and the Ship
35
- Confidence Gate MCP tool wired. The `1.0.x` releases are deprecated on npm
36
- (see [`CHANGELOG.md`](./CHANGELOG.md)).
37
-
38
- On the Change Date, this version of `@sunaiva/gate` automatically converts to
39
- Apache-2.0 with no further action required from anyone. Each future minor or
40
- patch release ships under BUSL-1.1 with its own 4-year clock from its own
41
- publication date.
42
-
43
- ## Why BUSL-1.1?
44
-
45
- Sunaiva Gate is a **thin, public wrapper** over a deliberately proprietary
46
- backend. The wrapper code — the rule engine, hook adapter, and CLI — is open
47
- so anyone can inspect, audit, and extend it. The backend services that
48
- deliver premium rules, witness validation, signed proof envelopes, and
49
- on-chain attestation remain **private commercial infrastructure** and are
50
- not distributed under this license at all.
51
-
52
- BUSL-1.1 lets us publish the wrapper openly today, give every user real
53
- constitutional enforcement out of the box, and still preserve the commercial
54
- runway needed to fund the backend's development.
55
-
56
- ## Backend status is unaffected by the Change Date
57
-
58
- The backend services are **not** shipped under BUSL-1.1. They are
59
- proprietary infrastructure operated by Sunaiva Digital. Their licensing
60
- status is **independent** of any clock in this repository. When the
61
- `@sunaiva/gate` wrapper converts to Apache-2.0 on 2030-05-10, the backend
62
- remains commercial and proprietary — only the wrapper code's licence
63
- changes. Customers relying on backend-tier features will continue to need a
64
- paid Sunaiva subscription regardless of the wrapper's licence state.
65
-
66
- ## Questions
67
-
68
- - General licensing questions: **kinan@sunaiva.ai**
69
- - Security concerns: **security@sunaivadigital.com**
70
- - Commercial / paid tiers: **support@sunaivadigital.com**
1
+ # Business Source License — `@sunaiva/gate`
2
+
3
+ This package is published under the **Business Source License 1.1 (BUSL-1.1)**.
4
+ The full BUSL-1.1 legal text lives in [`LICENSE`](./LICENSE) and at
5
+ <https://mariadb.com/bsl11/>. This document is a plain-language summary so
6
+ contributors and prospective customers know what they can and cannot do.
7
+
8
+ ## What you can do today, for free
9
+
10
+ The following uses are licensed at no cost the moment you `npx @sunaiva/gate`:
11
+
12
+ - **Evaluation, exploration, and proof-of-concept work** in any environment.
13
+ - **Internal development, testing, staging, and CI** runs — including running
14
+ the gate inside team workflows that never touch external paying customers.
15
+ - **Personal, hobbyist, academic, and research use** of any kind.
16
+ - **Forking, modifying, and redistributing the source code** under the same
17
+ BUSL-1.1 terms, with attribution preserved.
18
+
19
+ ## What requires a commercial license
20
+
21
+ You need a paid license from Sunaiva Digital if you use this package to
22
+ provide a service to **third-party paying customers in production** (i.e.
23
+ running it in the critical path of a revenue-generating product before the
24
+ Change Date below). Contact **kinan@sunaiva.ai** for pricing.
25
+
26
+ ## Change Date and Change License
27
+
28
+ - **Change Date**: **2030-05-10** (4 years after the first publication of
29
+ `@sunaiva/gate` on the npm registry — version `1.0.0`, 2026-05-10).
30
+ - **Change License**: **Apache License, Version 2.0** (chosen for its broad
31
+ compatibility, explicit patent grant, and standing as the most common
32
+ conversion target for BUSL-licensed projects).
33
+ - **Current version**: `1.1.0` ("Foundation Release"), 2026-05-12 — the first
34
+ release with the full constitutional rule set enforced locally and the Ship
35
+ Confidence Gate MCP tool wired. The `1.0.x` releases are deprecated on npm
36
+ (see [`CHANGELOG.md`](./CHANGELOG.md)).
37
+
38
+ On the Change Date, this version of `@sunaiva/gate` automatically converts to
39
+ Apache-2.0 with no further action required from anyone. Each future minor or
40
+ patch release ships under BUSL-1.1 with its own 4-year clock from its own
41
+ publication date.
42
+
43
+ ## Why BUSL-1.1?
44
+
45
+ Sunaiva Gate is a **thin, public wrapper** over a deliberately proprietary
46
+ backend. The wrapper code — the rule engine, hook adapter, and CLI — is open
47
+ so anyone can inspect, audit, and extend it. The backend services that
48
+ deliver premium rules, witness validation, signed proof envelopes, and
49
+ on-chain attestation remain **private commercial infrastructure** and are
50
+ not distributed under this license at all.
51
+
52
+ BUSL-1.1 lets us publish the wrapper openly today, give every user real
53
+ constitutional enforcement out of the box, and still preserve the commercial
54
+ runway needed to fund the backend's development.
55
+
56
+ ## Backend status is unaffected by the Change Date
57
+
58
+ The backend services are **not** shipped under BUSL-1.1. They are
59
+ proprietary infrastructure operated by Sunaiva Digital. Their licensing
60
+ status is **independent** of any clock in this repository. When the
61
+ `@sunaiva/gate` wrapper converts to Apache-2.0 on 2030-05-10, the backend
62
+ remains commercial and proprietary — only the wrapper code's licence
63
+ changes. Customers relying on backend-tier features will continue to need a
64
+ paid Sunaiva subscription regardless of the wrapper's licence state.
65
+
66
+ ## Questions
67
+
68
+ - General licensing questions: **kinan@sunaiva.ai**
69
+ - Security concerns: **support@sunaiva.ai**
70
+ - Commercial / paid tiers: **support@sunaiva.ai**
package/CHANGELOG.md CHANGED
@@ -1,148 +1,254 @@
1
- # Changelog
2
-
3
- All notable changes to `@sunaiva/gate` follow the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
-
5
- ---
6
-
7
- ## [1.1.0] — 2026-05-12 — "Foundation Release"
8
-
9
- First publicly-supported release. Closes all 7 CRITICAL findings from the signed
10
- Ship-Confidence verdict on `1.0.1` (`01KRDBCEYF2CAB21G6Y3E9VVH5`, RED), restores
11
- the constitutional enforcement promise the README has always made, and ships the
12
- paid-tier Ship Confidence Gate integration as a real MCP tool rather than a
13
- README claim.
14
-
15
- ### Added
16
- - **MCP server runtime with 6 tools**: `validate_action`, `log_bypass`,
17
- `get_rules`, `update_rules`, `get_audit_log`, and (NEW) `ship_confidence_check`.
18
- - **Ship-confidence gate** TypeScript port of the Genesis Python hook
19
- `.claude/hooks/ship_confidence_gate.py` v1.2.0, exposed both as the
20
- `ship_confidence_check` MCP tool and as the `--ship-confidence <artifact-id>`
21
- CLI flag.
22
- - **Cross-vendor HMAC-SHA256 verdict verification** with byte-compatible
23
- canonical-JSON encoding to the `sunaiva-ship-confidence` Python skill
24
- (sorted keys, `","`/`":"` separators, constant-time signature compare).
25
- - **Premium backend client** (`src/engine/backend-client.ts`) — optional HTTP +
26
- JWT path to `https://gate.sunaiva.dev/api/v1/match` for evaluating the 68
27
- premium rules server-side. Opt-in via `SUNAIVA_GATE_BACKEND_URL` +
28
- `SUNAIVA_GATE_API_TOKEN`. Backend errors fail-OPEN per-rule (never blocks the
29
- user on Sunaiva outage).
30
- - **Constitutional immutability guards** — load-time re-merge plus write-time
31
- rejection. The 32 constitutional rules cannot be disabled via `update_rules`
32
- and cannot be bypassed via `log_bypass`, even if `~/.sunaiva/gate-config.json`
33
- is hand-edited.
34
- - **`--smoke-test` CLI flag** pre-deployment self-check with three canned
35
- evaluations (allow / block / block) and an explicit `Constitutional rules —
36
- 32` count line. Exit 0 = HEALTHY, 1 = DEGRADED, 5 = missing required files.
37
- - **Bundle invariant tests** `tests/bundle.test.ts` asserts the package ships
38
- with exactly 32 constitutional rules (patterns intact) and 68 premium stubs
39
- (patterns replaced with `"[server-side]"`).
40
- - **Audit ledger fields** every entry now records `tier`, `audit_status`,
41
- `evidence`, and an `event_type` discriminator so paid-tier ship-confidence
42
- events and free-tier local evaluations are queryable separately.
43
- - **Kill-switch** (`DISABLE_SUNAIVA_GATE=1`) — short-circuits every
44
- `validate_action` to `allowed: true` with a structured response shape and
45
- unconditional stderr disclosure.
46
- - **Dry-run mode** (`SUNAIVA_GATE_DRY_RUN=1`) evaluates rules normally but
47
- never blocks; response includes `dry_run: true` and `would_have_blocked: [...]`.
48
- - **Premium-skipped notice** when premium rules are active but no backend
49
- is configured, the first event per session prints
50
- `[sunaiva-gate v1.1.0] N premium rules skipped (no backend configured).`
51
- to stderr and records `skipped_premium: [rule_ids]` in the audit log.
52
- - `CHANGELOG.md` (this file) and `tests/version-consistency.test.ts`
53
- preventing future version drift between `package.json`, `src/index.ts`,
54
- and `src/tools/validate.ts`.
55
-
56
- ### Changed
57
- - **`DEFAULT_CONFIG.active_rules`** expanded from 5 constitutional IDs to all
58
- 32 — the package now boots with the full constitutional set active by default.
59
- - **License model documented**: BUSL-1.1 wrapper, Change Date **2030-05-10**,
60
- Change License **Apache-2.0**. The premium backend remains proprietary and is
61
- not affected by the BUSL clock.
62
- - **Tier model published**: Free / Pro / Enterprise per
63
- [`TIER_DEFINITIONS.md`](./TIER_DEFINITIONS.md). The per-call pricing claims
64
- from the 1.0.x README (`$0.005/$0.02/$0.25 per call`) and the legacy
65
- "Pro / Shield / Shield+TEE" tier names are **struck**.
66
-
67
- ### Fixed
68
- - **C1** `rules.json` now ships inside the npm tarball at `dist/rules/rules.json`
69
- with all 32 constitutional patterns intact. Previous releases loaded from
70
- `~/.sunaiva/rules.json` only, which the strip-patterns build step had emptied
71
- to `"[server-side]"` placeholders on the install path.
72
- - **C2** `update_rules({disable: ['fin-001']})` now returns a structured
73
- `CONSTITUTIONAL_RULE_IMMUTABLE` error and persists nothing. Previously the
74
- call was honoured silently.
75
- - **C3** `log_bypass({rule_id: 'fin-001'})` now returns a structured
76
- `CONSTITUTIONAL_RULE_CANNOT_BE_BYPASSED` error and writes nothing to the
77
- bypass log. Previously the bypass was recorded.
78
- - **C4** — Premium rules now produce a one-time-per-session stderr notice
79
- when skipped and increment `skipped_premium` in every audit entry, instead
80
- of being silently dropped.
81
- - **C5**Unhandled exceptions in the gate's own code now exit with code **3**
82
- and write a `decision: 'error'` audit entry, instead of exiting 0 (fail-open).
83
- Opt-in legacy behaviour available via `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR=1`.
84
- - **C6** Malformed input now exits with code **4** and writes a
85
- `decision: 'invalid_input'` audit entry, instead of exiting 0 (fail-open).
86
- Same opt-in escape hatch as C5.
87
- - **C7** Ship Confidence Gate behaviour is no longer an unbacked README claim;
88
- it is the `ship_confidence_check` MCP tool plus the `--ship-confidence` CLI
89
- flag, with audit entries tagged `tier: "paid" | "free"`.
90
-
91
- ### Tests
92
- - 30/30 backend-client + version-consistency tests pass.
93
- - 18/18 ship-confidence-gate Python parity tests pass (TypeScript port).
94
- - 19/19 ship-confidence-gate TypeScript port tests pass.
95
- - Bundle invariant assertions confirm 32 constitutional rules + 68 premium
96
- stubs in the published tarball.
97
-
98
- ### Migration from 1.0.x
99
- - **`1.0.0` and `1.0.1` were never production-ready** and are deprecated on npm
100
- with the message:
101
- `"PREVIEW BUILD - DO NOT USE. Use @sunaiva/gate@1.1.0 for the production-ready release."`
102
- - Drop-in upgrade: bump the dependency to `1.1.0`. No MCP config changes
103
- required. The MCP server name (`sunaiva-gate`) and tool surface are backward
104
- compatible — only new tools are added.
105
- - If you were depending on the 1.0.x fail-open exit code for malformed input,
106
- set `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR=1` to restore the legacy behaviour.
107
-
108
- ---
109
-
110
- ## [1.0.1] — UNRELEASED
111
-
112
- Iteration build. Not published to npm. Superseded by 1.1.0.
113
-
114
- The signed Ship-Confidence verdict on this commit
115
- (`01KRDBCEYF2CAB21G6Y3E9VVH5`, RED) flagged 7 CRITICAL gaps between the
116
- README's promises and the actual implementation. All seven are closed in 1.1.0.
117
- Roadmap detail: [`ROADMAP_1_1_0.md`](./ROADMAP_1_1_0.md).
118
-
119
- ---
120
-
121
- ## [1.0.0] — 2026-05-10 — DEPRECATED
122
-
123
- First publish-to-npm. Deprecated immediately on the npm registry per the
124
- runbook in [`PUBLISH_RUNBOOK.md`](./PUBLISH_RUNBOOK.md).
125
-
126
- ### Deprecated
127
- - npm deprecation message:
128
- `"PREVIEW BUILD - DO NOT USE. Missing tests, support paths, verification commands. Use @sunaiva/gate@1.1.0 for the production-ready release."`
129
-
130
- ### What was missing
131
- - `dist/rules/rules.json` not bundled constitutional rules loaded from
132
- `~/.sunaiva/rules.json` only (C1).
133
- - Constitutional rules disable-able via `update_rules` (C2).
134
- - Constitutional rules bypass-able via `log_bypass` (C3).
135
- - Premium rules silently dropped with no audit count or user notice (C4).
136
- - Fail-open on unhandled exceptions (C5).
137
- - Fail-open on malformed input (C6).
138
- - Ship Confidence Gate behaviour absent from the npm surface (C7).
139
-
140
- See [`ROADMAP_1_1_0.md`](./ROADMAP_1_1_0.md) for the full finding-by-finding
141
- work plan that produced 1.1.0.
142
-
143
- ---
144
-
145
- *Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) ·
146
- Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html) ·
147
- License: [BUSL-1.1](./BUSINESS_LICENSE.md) (Change Date 2030-05-10, Change
148
- License Apache-2.0).*
1
+ # Changelog
2
+
3
+ All notable changes to `@sunaiva/gate` follow the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ ---
6
+
7
+ ## [Unreleased] — 2026-05-27 — "Build-pipeline P00 fix"
8
+
9
+ ### Fixed
10
+ - **`scripts/strip-patterns.js` — critical build-pipeline bug (P00)**: the strip script was
11
+ replacing `detection_pattern` with `"[server-side]"` for ALL 100 rules including the 32
12
+ constitutional rules. Constitutional rules require their `detection_pattern` to be visible
13
+ in the published dist so the local rule-engine can evaluate them without a backend connection.
14
+ The fix: constitutional rules (`enforcement === "constitutional"`) now pass through unchanged;
15
+ only `backend_required === true` (premium) rules get their pattern replaced.
16
+ Any `npm run build` prior to this fix would have produced a `dist/rules/rules.json` where
17
+ all 32 constitutional rules had `detection_pattern: "[server-side]"`, causing them to be
18
+ silently skipped by the local engine (same failure class as `failure_054`).
19
+
20
+ ### Added
21
+ - **`tests/strip-patterns.test.ts`** — 12 tests covering source + dist rules.json integrity:
22
+ correct constitutional/premium counts, no constitutional rule stripped, no overlap between
23
+ constitutional and premium sets, all required fields present. Regression guard for the P00 bug.
24
+
25
+ ### Changed
26
+ - **`rules/rules.json` (source)** all 68 non-constitutional rules now carry
27
+ `"backend_required": true` matching the dist/ baseline. This is the canonical source for
28
+ which rules are premium; `strip-patterns.js` uses it to decide what to strip.
29
+
30
+ ---
31
+
32
+ ## [1.1.1] 2026-05-25 "Constitutional Cleanup + Sunaiva Core rebrand"
33
+
34
+ Metadata-only patch release. No functional behaviour changes same gate, same
35
+ 100 rules (32 constitutional + 68 premium), same Ship-Confidence integration,
36
+ same smoke-test verdict (HEALTHY). Closes Rule 43.1 (Sunaiva canonical ship
37
+ pathway, hardwired 2026-05-16) by removing all references to the forbidden
38
+ public GitHub source repo from the published package surface, AND completes
39
+ the **Sunaiva Core brand rebrand** (locked 2026-05-23: primary domain
40
+ `sunaivacore.io`, parent `sunaiva.ai`, support mailbox `support@sunaiva.ai`).
41
+
42
+ ### Changed
43
+ - **Support / docs URLs scrubbed** of `github.com/Kinan27/sunaiva-gate` AND
44
+ rebranded to Sunaiva Core domain package.json `repository` field removed;
45
+ `bugs.email` now `support@sunaiva.ai`; `homepage` updated to
46
+ `https://sunaivacore.io/products/gate`. The same scrub applied to
47
+ `dist/index.js` `--help` / `--smoke-test` output, the README support table,
48
+ the BUSINESS_LICENSE.md contacts, and the SUPPORT.md routing. Sunaiva
49
+ products list at the Anthropic Official Registry via DNS-TXT (namespace
50
+ `com.sunaivacore.gate`) there is no public source repo by design
51
+ (Rule 43.1, post-`failure_051` 2026-05-14).
52
+ - **Backend URL updated** — `DEFAULT_BACKEND_URL` in both `dist/types/backend.{js,d.ts}`
53
+ and `dist/version-pin/registry.js` changed from `mcp.sunaivacore.io/v1/gatehooks` to
54
+ `mcp.sunaivacore.io/v1/gatehooks` per the Sunaiva MCP Command lane endpoint
55
+ ownership decision (Kinan directive 2026-05-25).
56
+ - **In-toto attestation URIs updated** — `BUILD_TYPE` and `BUILDER_ID` in
57
+ `dist/installer/attestation/intoto.js` re-rooted from `sunaivadigital.com`
58
+ to `sunaivacore.io`.
59
+ - **`files` array tightened** to ship only the v1.1.0 production-verified
60
+ paths (`dist/index.{js,d.ts}`, `dist/config/**`, `dist/engine/**`,
61
+ `dist/tools/**`, `dist/types/**`, `dist/rules/**`). Half-baked v1.2.0 sprint
62
+ scaffolding present in the working-tree dist/ (events/, paranoia/,
63
+ installer/, bypass/, compliance/, cost/, diff/, explain/, rollback/,
64
+ timelock/, version-pin/) is **deliberately excluded** from the npm tarball
65
+ those features will land properly in a future release once their
66
+ TypeScript source is reconstructed and their entrypoint wiring is verified
67
+ end-to-end. Shipping them half-wired would re-introduce the `failure_054`
68
+ pattern (343 unit tests green, production entrypoint = security theater).
69
+ - **`PKG_VERSION` constant** bumped `1.1.0` `1.1.1` in `dist/index.js`.
70
+
71
+ ### Fixed
72
+ - Stale "PREVIEW BUILD - DO NOT USE" deprecation message on the public npm
73
+ registry will be cleared on publish of this release (deprecation message
74
+ was attached to `1.0.0` after the credential-leak incident and inherited
75
+ by `1.1.0` even though `1.1.0` was the Foundation Release that closed
76
+ the leak's CRITICAL findings). Both `1.0.0` and `1.1.0` remain deprecated
77
+ per their original messages; `1.1.1` is the first un-deprecated production
78
+ release.
79
+
80
+ ### Added
81
+ - **`SUPPORT.md`**formal email-based support model (no public issue tracker per
82
+ Rule 43.1) with target response times by category, bug-report template, security
83
+ disclosure protocol, self-service triage steps. Closes the v1.1.0 README's
84
+ reference to a `SUPPORT.md` that was never shipped.
85
+ - **`TIER_DEFINITIONS.md`** formal tier ladder (Free / Starter / Pro recommended /
86
+ Power / Enterprise) with feature differentiation matrix and upgrade/downgrade
87
+ flow. **Feature scope only dollar figures live at
88
+ https://sunaivacore.io/pricing** (single source of truth across all Sunaiva
89
+ Core products, owned by the Sunaiva MCP Command lane). The npm package
90
+ intentionally does NOT embed dollar figures so it never ships stale pricing.
91
+ The MCP server itself remains free forever; paid tiers gate dashboard access
92
+ + premium rules + team features.
93
+
94
+ ### Unchanged (verified)
95
+ - 100-rule library, 32 constitutional + 68 premium, byte-identical to v1.1.0
96
+ - All 6 MCP tools (`validate_action`, `log_bypass`, `get_rules`,
97
+ `update_rules`, `get_audit_log`, `ship_confidence_check`)
98
+ - Ship Confidence Gate (TypeScript port of Python hook v1.2.0)
99
+ - Premium backend client + JWT path to `mcp.sunaivacore.io/v1/gatehooks`
100
+ - Constitutional immutability guard (load + write time)
101
+ - Audit ledger (`~/.sunaiva/audit/audit.jsonl`)
102
+ - Kill-switch (`DISABLE_SUNAIVA_GATE=1`), dry-run (`SUNAIVA_GATE_DRY_RUN=1`)
103
+ - BUSL-1.1 license, Change Date `2030-05-10`, Change License `Apache-2.0`
104
+
105
+ ### Smoke-test verdict
106
+ `npx @sunaiva/gate --smoke-test` returns `Status: HEALTHY` with all 10 checks
107
+ green, including live evaluations of `git push origin main` (HARD block via
108
+ gov-001), `rm -rf /` (gov-002), `stripe.charges.create` (fin-001), and
109
+ `ls -la` (ALLOW).
110
+
111
+ ---
112
+
113
+ ## [1.1.0] — 2026-05-12 — "Foundation Release"
114
+
115
+ First publicly-supported release. Closes all 7 CRITICAL findings from the signed
116
+ Ship-Confidence verdict on `1.0.1` (`01KRDBCEYF2CAB21G6Y3E9VVH5`, RED), restores
117
+ the constitutional enforcement promise the README has always made, and ships the
118
+ paid-tier Ship Confidence Gate integration as a real MCP tool rather than a
119
+ README claim.
120
+
121
+ ### Added
122
+ - **MCP server runtime with 6 tools**: `validate_action`, `log_bypass`,
123
+ `get_rules`, `update_rules`, `get_audit_log`, and (NEW) `ship_confidence_check`.
124
+ - **Ship-confidence gate** — TypeScript port of the Genesis Python hook
125
+ `.claude/hooks/ship_confidence_gate.py` v1.2.0, exposed both as the
126
+ `ship_confidence_check` MCP tool and as the `--ship-confidence <artifact-id>`
127
+ CLI flag.
128
+ - **Cross-vendor HMAC-SHA256 verdict verification** with byte-compatible
129
+ canonical-JSON encoding to the `sunaiva-ship-confidence` Python skill
130
+ (sorted keys, `","`/`":"` separators, constant-time signature compare).
131
+ - **Premium backend client** (`src/engine/backend-client.ts`)optional HTTP +
132
+ JWT path to `https://mcp.sunaivacore.io/v1/gatehooks` for evaluating the 68
133
+ premium rules server-side. Opt-in via `SUNAIVA_GATE_BACKEND_URL` +
134
+ `SUNAIVA_GATE_API_TOKEN`. Backend errors fail-OPEN per-rule (never blocks the
135
+ user on Sunaiva outage).
136
+ - **Constitutional immutability guards** — load-time re-merge plus write-time
137
+ rejection. The 32 constitutional rules cannot be disabled via `update_rules`
138
+ and cannot be bypassed via `log_bypass`, even if `~/.sunaiva/gate-config.json`
139
+ is hand-edited.
140
+ - **`--smoke-test` CLI flag** pre-deployment self-check with three canned
141
+ evaluations (allow / block / block) and an explicit `Constitutional rules —
142
+ 32` count line. Exit 0 = HEALTHY, 1 = DEGRADED, 5 = missing required files.
143
+ - **Bundle invariant tests** — `tests/bundle.test.ts` asserts the package ships
144
+ with exactly 32 constitutional rules (patterns intact) and 68 premium stubs
145
+ (patterns replaced with `"[server-side]"`).
146
+ - **Audit ledger fields** — every entry now records `tier`, `audit_status`,
147
+ `evidence`, and an `event_type` discriminator so paid-tier ship-confidence
148
+ events and free-tier local evaluations are queryable separately.
149
+ - **Kill-switch** (`DISABLE_SUNAIVA_GATE=1`) — short-circuits every
150
+ `validate_action` to `allowed: true` with a structured response shape and
151
+ unconditional stderr disclosure.
152
+ - **Dry-run mode** (`SUNAIVA_GATE_DRY_RUN=1`) — evaluates rules normally but
153
+ never blocks; response includes `dry_run: true` and `would_have_blocked: [...]`.
154
+ - **Premium-skipped notice** — when premium rules are active but no backend
155
+ is configured, the first event per session prints
156
+ `[sunaiva-gate v1.1.0] N premium rules skipped (no backend configured).`
157
+ to stderr and records `skipped_premium: [rule_ids]` in the audit log.
158
+ - `CHANGELOG.md` (this file) and `tests/version-consistency.test.ts`
159
+ preventing future version drift between `package.json`, `src/index.ts`,
160
+ and `src/tools/validate.ts`.
161
+
162
+ ### Changed
163
+ - **`DEFAULT_CONFIG.active_rules`** expanded from 5 constitutional IDs to all
164
+ 32 — the package now boots with the full constitutional set active by default.
165
+ - **License model documented**: BUSL-1.1 wrapper, Change Date **2030-05-10**,
166
+ Change License **Apache-2.0**. The premium backend remains proprietary and is
167
+ not affected by the BUSL clock.
168
+ - **Tier model published**: Free / Pro / Enterprise per
169
+ [`TIER_DEFINITIONS.md`](./TIER_DEFINITIONS.md). The per-call pricing claims
170
+ from the 1.0.x README (`$0.005/$0.02/$0.25 per call`) and the legacy
171
+ "Pro / Shield / Shield+TEE" tier names are **struck**.
172
+
173
+ ### Fixed
174
+ - **C1** — `rules.json` now ships inside the npm tarball at `dist/rules/rules.json`
175
+ with all 32 constitutional patterns intact. Previous releases loaded from
176
+ `~/.sunaiva/rules.json` only, which the strip-patterns build step had emptied
177
+ to `"[server-side]"` placeholders on the install path.
178
+ - **C2** — `update_rules({disable: ['fin-001']})` now returns a structured
179
+ `CONSTITUTIONAL_RULE_IMMUTABLE` error and persists nothing. Previously the
180
+ call was honoured silently.
181
+ - **C3** — `log_bypass({rule_id: 'fin-001'})` now returns a structured
182
+ `CONSTITUTIONAL_RULE_CANNOT_BE_BYPASSED` error and writes nothing to the
183
+ bypass log. Previously the bypass was recorded.
184
+ - **C4** — Premium rules now produce a one-time-per-session stderr notice
185
+ when skipped and increment `skipped_premium` in every audit entry, instead
186
+ of being silently dropped.
187
+ - **C5** — Unhandled exceptions in the gate's own code now exit with code **3**
188
+ and write a `decision: 'error'` audit entry, instead of exiting 0 (fail-open).
189
+ Opt-in legacy behaviour available via `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR=1`.
190
+ - **C6** — Malformed input now exits with code **4** and writes a
191
+ `decision: 'invalid_input'` audit entry, instead of exiting 0 (fail-open).
192
+ Same opt-in escape hatch as C5.
193
+ - **C7** — Ship Confidence Gate behaviour is no longer an unbacked README claim;
194
+ it is the `ship_confidence_check` MCP tool plus the `--ship-confidence` CLI
195
+ flag, with audit entries tagged `tier: "paid" | "free"`.
196
+
197
+ ### Tests
198
+ - 30/30 backend-client + version-consistency tests pass.
199
+ - 18/18 ship-confidence-gate Python parity tests pass (TypeScript port).
200
+ - 19/19 ship-confidence-gate TypeScript port tests pass.
201
+ - Bundle invariant assertions confirm 32 constitutional rules + 68 premium
202
+ stubs in the published tarball.
203
+
204
+ ### Migration from 1.0.x
205
+ - **`1.0.0` and `1.0.1` were never production-ready** and are deprecated on npm
206
+ with the message:
207
+ `"PREVIEW BUILD - DO NOT USE. Use @sunaiva/gate@1.1.0 for the production-ready release."`
208
+ - Drop-in upgrade: bump the dependency to `1.1.0`. No MCP config changes
209
+ required. The MCP server name (`sunaiva-gate`) and tool surface are backward
210
+ compatible — only new tools are added.
211
+ - If you were depending on the 1.0.x fail-open exit code for malformed input,
212
+ set `SUNAIVA_GATE_FAIL_OPEN_ON_ERROR=1` to restore the legacy behaviour.
213
+
214
+ ---
215
+
216
+ ## [1.0.1] — UNRELEASED
217
+
218
+ Iteration build. Not published to npm. Superseded by 1.1.0.
219
+
220
+ The signed Ship-Confidence verdict on this commit
221
+ (`01KRDBCEYF2CAB21G6Y3E9VVH5`, RED) flagged 7 CRITICAL gaps between the
222
+ README's promises and the actual implementation. All seven are closed in 1.1.0.
223
+ Roadmap detail: [`ROADMAP_1_1_0.md`](./ROADMAP_1_1_0.md).
224
+
225
+ ---
226
+
227
+ ## [1.0.0] — 2026-05-10 — DEPRECATED
228
+
229
+ First publish-to-npm. Deprecated immediately on the npm registry per the
230
+ runbook in [`PUBLISH_RUNBOOK.md`](./PUBLISH_RUNBOOK.md).
231
+
232
+ ### Deprecated
233
+ - npm deprecation message:
234
+ `"PREVIEW BUILD - DO NOT USE. Missing tests, support paths, verification commands. Use @sunaiva/gate@1.1.0 for the production-ready release."`
235
+
236
+ ### What was missing
237
+ - `dist/rules/rules.json` not bundled — constitutional rules loaded from
238
+ `~/.sunaiva/rules.json` only (C1).
239
+ - Constitutional rules disable-able via `update_rules` (C2).
240
+ - Constitutional rules bypass-able via `log_bypass` (C3).
241
+ - Premium rules silently dropped with no audit count or user notice (C4).
242
+ - Fail-open on unhandled exceptions (C5).
243
+ - Fail-open on malformed input (C6).
244
+ - Ship Confidence Gate behaviour absent from the npm surface (C7).
245
+
246
+ See [`ROADMAP_1_1_0.md`](./ROADMAP_1_1_0.md) for the full finding-by-finding
247
+ work plan that produced 1.1.0.
248
+
249
+ ---
250
+
251
+ *Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) ·
252
+ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html) ·
253
+ License: [BUSL-1.1](./BUSINESS_LICENSE.md) (Change Date 2030-05-10, Change
254
+ License Apache-2.0).*