@classytic/supplier-performance 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +7 -106
  2. package/package.json +12 -10
package/CHANGELOG.md CHANGED
@@ -1,106 +1,7 @@
1
- # Changelog
2
-
3
-
4
- ## 0.4.0 — 2026-08-17
5
-
6
- ### Changed
7
- - Supplier-score model and score service updated; engine types and repositories aligned (10 src files)
8
-
9
- ## 1.0.0 - 2026-07-29
10
-
11
- ### Changed
12
- - **License:** relicensed from MIT to the **Classytic Source-Available License** (Community & Commercial). Evaluation/development use remains free; production use now requires a commercial license from Classytic LLC. See `LICENSE`.
13
- - Major bump marks the license change; versions published before 1.0.0 remain under their original MIT terms.
14
-
15
- ## 0.3.2 - 2026-07-22 (unpublished)
16
-
17
- ### Changed
18
- - Internal: `InProcess*Bus` is now a thin subclass of `@classytic/primitives/event-infra`'s shared `InProcessEventBus` (dedup / error-isolation / close semantics unchanged); `MemoryOutboxStore` re-exported from the shared runtime where applicable. No public API, event-name, or wire-envelope change. Requires `@classytic/primitives >=0.13.0`.
19
-
20
- ## [0.3.1] — 2026-07-16
21
-
22
- ### Fixed
23
-
24
- - injectTenantField no longer force-indexes the tenant field: the compound
25
- prepend makes the tenant the leading key of every index, so the bare single
26
- was a redundant prefix paid on every insert (PACKAGE_RULES P11.1, fleet
27
- index audit). A dedicated tenant index is still created when a schema
28
- declares no compounds to prepend. Index-declaration change only.
29
-
30
- ## [0.3.0] — unpublished (2026-07-15)
31
-
32
- ### Changed — kit refresh (peer floors: mongokit >=3.22.0, repo-core >=0.13.0, primitives >=0.11.0)
33
-
34
- - Verified clean against the mongokit 3.22 sweep (no FSM boilerplate, no
35
- fences needed). Clean registry install; suite green.
36
-
37
- ## 0.2.1
38
-
39
- Patch — outbox support, §P8.1 session guard, awaited publish, tenant-isolation fix.
40
-
41
- ## 0.2.0
42
-
43
- Stack upgrade + tenant-isolation fix + PACKAGE_RULES compliance + real test
44
- coverage. No new features.
45
-
46
- ### Fixed (security)
47
-
48
- - **Cross-tenant leak — `multiTenantPlugin` was never wired.** Both
49
- repositories were constructed with only `methodRegistryPlugin()`, so reads
50
- and writes were NOT tenant-scoped despite the schema carrying an
51
- `organizationId` field. The engine now derives one resolved tenant config
52
- (via repo-core's `resolveTenantConfig`) and wires `multiTenantPlugin` on
53
- every repo — scoping is enforced at POLICY priority and missing
54
- `organizationId` throws (fail-closed). A `tenant-plugin-probe` integration
55
- test plus an end-to-end isolation test guard this.
56
-
57
- ### Changed (breaking)
58
-
59
- - **Peers:** `@classytic/mongokit` `>=3.13.0` → `>=3.16.0`; **added**
60
- `@classytic/repo-core >=0.6.0` (rule 11 — the code imports
61
- `@classytic/repo-core/tenant` and `/errors`); **added** `zod >=4.0.0`
62
- (event catalog). `@classytic/primitives` stays `>=0.5.0` (devDep bumped to
63
- `^0.7.2`).
64
- - **Tenant config clean break.** Dropped the legacy
65
- `{ tenantFieldType, multiTenant }` shape and the `'string'` default. Tenant
66
- config is now a repo-core `TenantConfig` (or boolean), defaulting to
67
- repo-core's standard `fieldType: 'objectId'`, `required: true`. Hosts with
68
- string/UUID org ids pass `{ fieldType: 'string' }`. Mongokit-runtime knobs
69
- (`skipWhen`, `resolveContext`, `allowDataInjection`, `onMismatch`,
70
- `skipOperations`) forward through the `tenant` object.
71
- - **Errors.** Removed `RecordEventValidationError extends Error`. Validation now
72
- throws `SupplierPerformanceValidationError implements HttpError` (status 400,
73
- code `supplier_performance.validation.invalid_input`) so arc serializes it
74
- correctly.
75
-
76
- ### Added
77
-
78
- - **Zod event catalog (rule 18):** `supplierPerformanceEventDefinitions`
79
- exported from the package root AND the new `./events` subpath; per-event Zod
80
- schemas (`z.iso.datetime()` timestamps), a no-drift invariant test, and
81
- safeParse happy/rejection tests.
82
- - **Cancellation / retry threading:** `SupplierPerformanceContext` now carries
83
- `signal` / `retryPolicy`, forwarded to repo calls via `repoOptionsFromCtx`.
84
- - **Test coverage** raised from one unit file to five files / 21 tests:
85
- event-catalog no-drift, tenant probe + isolation, computeScore aggregation +
86
- idempotency (re-run does not double-aggregate, exactly one snapshot row),
87
- model-collision policy.
88
-
89
- ### Build hygiene
90
-
91
- - `tsconfig.json`: enabled `exactOptionalPropertyTypes`; disabled
92
- `declarationMap` and `sourceMap` (no source leaks). `InProcessSupplierPerformanceBus`
93
- gained `close()`. `CHANGELOG.md` added to published `files`.
94
-
95
- ### Notes (verified, intentionally NOT changed)
96
-
97
- - **No outbox / P8 dispatch machinery.** Durable delivery is host-composed
98
- (§5.5 / §16); only a transport is wired, so publish failures are swallowed
99
- (rule 14). Not a gap.
100
- - **No capabilities boot gate.** The package uses no transactions — every verb
101
- is a single-doc read/write/upsert — so the gate (transactions-only) does not
102
- apply.
103
- - **No rating-state CAS.** Scorecards are recomputable snapshots, not a state
104
- machine; `computeScore` idempotency rests on the unique index + upsert.
105
- - **`recordEvent` dedup stays host-owned** by design (hosts key differently:
106
- PO-line vs PO+SKU). The kernel does not enforce a metric-dedup unique index.
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.4.1 — 2026-11-28
6
+
7
+ - Peer floors raised to what the package is tested against: `@classytic/mongokit >=3.47.0`, `@classytic/primitives >=0.39.0`, `@classytic/repo-core >=0.39.0`, `mongoose >=9.13.1`. Consumers: none to change.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/supplier-performance",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Framework-agnostic supplier performance engine — on-time-delivery, defect, and price-variance tracking with append-only event log + cached scorecards. Powered by MongoDB via @classytic/mongokit. Zero framework deps — usable from Arc, Express, Nest, Next.js, or raw Node.",
5
5
  "author": "Classytic",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -34,10 +34,12 @@
34
34
  },
35
35
  "exports": {
36
36
  ".": {
37
+ "@classytic/source": "./src/index.ts",
37
38
  "types": "./dist/index.d.ts",
38
39
  "default": "./dist/index.js"
39
40
  },
40
41
  "./events": {
42
+ "@classytic/source": "./src/events.ts",
41
43
  "types": "./dist/events.d.ts",
42
44
  "default": "./dist/events.js"
43
45
  }
@@ -60,20 +62,20 @@
60
62
  "release": "npm run push -- main && npm run release:tag && npm publish"
61
63
  },
62
64
  "peerDependencies": {
63
- "@classytic/mongokit": ">=3.33.0",
64
- "@classytic/primitives": ">=0.23.0",
65
- "@classytic/repo-core": ">=0.24.0",
66
- "mongoose": ">=9.4.1",
65
+ "@classytic/mongokit": ">=3.47.0",
66
+ "@classytic/primitives": ">=0.39.0",
67
+ "@classytic/repo-core": ">=0.39.0",
68
+ "mongoose": ">=9.13.1",
67
69
  "zod": ">=4.0.0"
68
70
  },
69
71
  "devDependencies": {
70
72
  "@classytic/dev-tools": "^0.2.0",
71
- "@classytic/mongokit": "^3.33.0",
72
- "@classytic/primitives": ">=0.23.0",
73
- "@classytic/repo-core": ">=0.24.0",
73
+ "@classytic/mongokit": "^3.47.0",
74
+ "@classytic/primitives": "^0.39.0",
75
+ "@classytic/repo-core": "^0.39.0",
74
76
  "@types/node": "^25.5.0",
75
- "mongodb-memory-server": "^10.2.3",
76
- "mongoose": "^9.4.1",
77
+ "mongodb-memory-server": "^11.4.0",
78
+ "mongoose": "^9.13.1",
77
79
  "publint": "^0.3.23",
78
80
  "tsdown": "^0.22.14",
79
81
  "typescript": "^5.8.2",