@classytic/supplier-performance 0.2.1 → 0.3.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 (2) hide show
  1. package/CHANGELOG.md +79 -72
  2. package/package.json +82 -82
package/CHANGELOG.md CHANGED
@@ -1,72 +1,79 @@
1
- # Changelog
2
-
3
- ## 0.2.1
4
-
5
- Patch — outbox support, §P8.1 session guard, awaited publish, tenant-isolation fix.
6
-
7
- ## 0.2.0
8
-
9
- Stack upgrade + tenant-isolation fix + PACKAGE_RULES compliance + real test
10
- coverage. No new features.
11
-
12
- ### Fixed (security)
13
-
14
- - **Cross-tenant leak — `multiTenantPlugin` was never wired.** Both
15
- repositories were constructed with only `methodRegistryPlugin()`, so reads
16
- and writes were NOT tenant-scoped despite the schema carrying an
17
- `organizationId` field. The engine now derives one resolved tenant config
18
- (via repo-core's `resolveTenantConfig`) and wires `multiTenantPlugin` on
19
- every repo — scoping is enforced at POLICY priority and missing
20
- `organizationId` throws (fail-closed). A `tenant-plugin-probe` integration
21
- test plus an end-to-end isolation test guard this.
22
-
23
- ### Changed (breaking)
24
-
25
- - **Peers:** `@classytic/mongokit` `>=3.13.0` → `>=3.16.0`; **added**
26
- `@classytic/repo-core >=0.6.0` (rule 11 — the code imports
27
- `@classytic/repo-core/tenant` and `/errors`); **added** `zod >=4.0.0`
28
- (event catalog). `@classytic/primitives` stays `>=0.5.0` (devDep bumped to
29
- `^0.7.2`).
30
- - **Tenant config clean break.** Dropped the legacy
31
- `{ tenantFieldType, multiTenant }` shape and the `'string'` default. Tenant
32
- config is now a repo-core `TenantConfig` (or boolean), defaulting to
33
- repo-core's standard `fieldType: 'objectId'`, `required: true`. Hosts with
34
- string/UUID org ids pass `{ fieldType: 'string' }`. Mongokit-runtime knobs
35
- (`skipWhen`, `resolveContext`, `allowDataInjection`, `onMismatch`,
36
- `skipOperations`) forward through the `tenant` object.
37
- - **Errors.** Removed `RecordEventValidationError extends Error`. Validation now
38
- throws `SupplierPerformanceValidationError implements HttpError` (status 400,
39
- code `supplier_performance.validation.invalid_input`) so arc serializes it
40
- correctly.
41
-
42
- ### Added
43
-
44
- - **Zod event catalog (rule 18):** `supplierPerformanceEventDefinitions`
45
- exported from the package root AND the new `./events` subpath; per-event Zod
46
- schemas (`z.iso.datetime()` timestamps), a no-drift invariant test, and
47
- safeParse happy/rejection tests.
48
- - **Cancellation / retry threading:** `SupplierPerformanceContext` now carries
49
- `signal` / `retryPolicy`, forwarded to repo calls via `repoOptionsFromCtx`.
50
- - **Test coverage** raised from one unit file to five files / 21 tests:
51
- event-catalog no-drift, tenant probe + isolation, computeScore aggregation +
52
- idempotency (re-run does not double-aggregate, exactly one snapshot row),
53
- model-collision policy.
54
-
55
- ### Build hygiene
56
-
57
- - `tsconfig.json`: enabled `exactOptionalPropertyTypes`; disabled
58
- `declarationMap` and `sourceMap` (no source leaks). `InProcessSupplierPerformanceBus`
59
- gained `close()`. `CHANGELOG.md` added to published `files`.
60
-
61
- ### Notes (verified, intentionally NOT changed)
62
-
63
- - **No outbox / P8 dispatch machinery.** Durable delivery is host-composed
64
- (§5.5 / §16); only a transport is wired, so publish failures are swallowed
65
- (rule 14). Not a gap.
66
- - **No capabilities boot gate.** The package uses no transactions — every verb
67
- is a single-doc read/write/upsert — so the gate (transactions-only) does not
68
- apply.
69
- - **No rating-state CAS.** Scorecards are recomputable snapshots, not a state
70
- machine; `computeScore` idempotency rests on the unique index + upsert.
71
- - **`recordEvent` dedup stays host-owned** by design (hosts key differently:
72
- PO-line vs PO+SKU). The kernel does not enforce a metric-dedup unique index.
1
+ # Changelog
2
+
3
+ ## [0.3.0] — unpublished (2026-07-15)
4
+
5
+ ### Changed — kit refresh (peer floors: mongokit >=3.22.0, repo-core >=0.13.0, primitives >=0.11.0)
6
+
7
+ - Verified clean against the mongokit 3.22 sweep (no FSM boilerplate, no
8
+ fences needed). Clean registry install; suite green.
9
+
10
+ ## 0.2.1
11
+
12
+ Patch — outbox support, §P8.1 session guard, awaited publish, tenant-isolation fix.
13
+
14
+ ## 0.2.0
15
+
16
+ Stack upgrade + tenant-isolation fix + PACKAGE_RULES compliance + real test
17
+ coverage. No new features.
18
+
19
+ ### Fixed (security)
20
+
21
+ - **Cross-tenant leak — `multiTenantPlugin` was never wired.** Both
22
+ repositories were constructed with only `methodRegistryPlugin()`, so reads
23
+ and writes were NOT tenant-scoped despite the schema carrying an
24
+ `organizationId` field. The engine now derives one resolved tenant config
25
+ (via repo-core's `resolveTenantConfig`) and wires `multiTenantPlugin` on
26
+ every repo — scoping is enforced at POLICY priority and missing
27
+ `organizationId` throws (fail-closed). A `tenant-plugin-probe` integration
28
+ test plus an end-to-end isolation test guard this.
29
+
30
+ ### Changed (breaking)
31
+
32
+ - **Peers:** `@classytic/mongokit` `>=3.13.0` → `>=3.16.0`; **added**
33
+ `@classytic/repo-core >=0.6.0` (rule 11 — the code imports
34
+ `@classytic/repo-core/tenant` and `/errors`); **added** `zod >=4.0.0`
35
+ (event catalog). `@classytic/primitives` stays `>=0.5.0` (devDep bumped to
36
+ `^0.7.2`).
37
+ - **Tenant config clean break.** Dropped the legacy
38
+ `{ tenantFieldType, multiTenant }` shape and the `'string'` default. Tenant
39
+ config is now a repo-core `TenantConfig` (or boolean), defaulting to
40
+ repo-core's standard `fieldType: 'objectId'`, `required: true`. Hosts with
41
+ string/UUID org ids pass `{ fieldType: 'string' }`. Mongokit-runtime knobs
42
+ (`skipWhen`, `resolveContext`, `allowDataInjection`, `onMismatch`,
43
+ `skipOperations`) forward through the `tenant` object.
44
+ - **Errors.** Removed `RecordEventValidationError extends Error`. Validation now
45
+ throws `SupplierPerformanceValidationError implements HttpError` (status 400,
46
+ code `supplier_performance.validation.invalid_input`) so arc serializes it
47
+ correctly.
48
+
49
+ ### Added
50
+
51
+ - **Zod event catalog (rule 18):** `supplierPerformanceEventDefinitions`
52
+ exported from the package root AND the new `./events` subpath; per-event Zod
53
+ schemas (`z.iso.datetime()` timestamps), a no-drift invariant test, and
54
+ safeParse happy/rejection tests.
55
+ - **Cancellation / retry threading:** `SupplierPerformanceContext` now carries
56
+ `signal` / `retryPolicy`, forwarded to repo calls via `repoOptionsFromCtx`.
57
+ - **Test coverage** raised from one unit file to five files / 21 tests:
58
+ event-catalog no-drift, tenant probe + isolation, computeScore aggregation +
59
+ idempotency (re-run does not double-aggregate, exactly one snapshot row),
60
+ model-collision policy.
61
+
62
+ ### Build hygiene
63
+
64
+ - `tsconfig.json`: enabled `exactOptionalPropertyTypes`; disabled
65
+ `declarationMap` and `sourceMap` (no source leaks). `InProcessSupplierPerformanceBus`
66
+ gained `close()`. `CHANGELOG.md` added to published `files`.
67
+
68
+ ### Notes (verified, intentionally NOT changed)
69
+
70
+ - **No outbox / P8 dispatch machinery.** Durable delivery is host-composed
71
+ (§5.5 / §16); only a transport is wired, so publish failures are swallowed
72
+ (rule 14). Not a gap.
73
+ - **No capabilities boot gate.** The package uses no transactions — every verb
74
+ is a single-doc read/write/upsert — so the gate (transactions-only) does not
75
+ apply.
76
+ - **No rating-state CAS.** Scorecards are recomputable snapshots, not a state
77
+ machine; `computeScore` idempotency rests on the unique index + upsert.
78
+ - **`recordEvent` dedup stays host-owned** by design (hosts key differently:
79
+ PO-line vs PO+SKU). The kernel does not enforce a metric-dedup unique index.
package/package.json CHANGED
@@ -1,82 +1,82 @@
1
- {
2
- "name": "@classytic/supplier-performance",
3
- "version": "0.2.1",
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
- "author": "Classytic",
6
- "license": "MIT",
7
- "homepage": "https://www.npmjs.com/package/@classytic/supplier-performance",
8
- "bugs": {
9
- "url": "https://github.com/classytic/supplier-performance/issues"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/classytic/supplier-performance.git"
14
- },
15
- "keywords": [
16
- "supplier",
17
- "performance",
18
- "scorecard",
19
- "vendor",
20
- "procurement",
21
- "on-time-delivery",
22
- "defect-rate",
23
- "price-variance",
24
- "mongodb",
25
- "classytic"
26
- ],
27
- "type": "module",
28
- "sideEffects": false,
29
- "engines": {
30
- "node": ">=22"
31
- },
32
- "publishConfig": {
33
- "access": "public"
34
- },
35
- "exports": {
36
- ".": {
37
- "types": "./dist/index.d.ts",
38
- "default": "./dist/index.js"
39
- },
40
- "./events": {
41
- "types": "./dist/events.d.ts",
42
- "default": "./dist/events.js"
43
- }
44
- },
45
- "main": "./dist/index.js",
46
- "types": "./dist/index.d.ts",
47
- "files": [
48
- "dist",
49
- "README.md",
50
- "CHANGELOG.md",
51
- "LICENSE"
52
- ],
53
- "scripts": {
54
- "build": "tsdown",
55
- "typecheck": "tsc --noEmit",
56
- "test": "vitest run",
57
- "prepublishOnly": "npm run typecheck && npm run test && npm run build",
58
- "push": "classytic-push",
59
- "release:tag": "node -e \"require('child_process').execSync('npm run push -- v'+require('./package.json').version,{stdio:'inherit'})\"",
60
- "release": "npm run push -- main && npm run release:tag && npm publish"
61
- },
62
- "peerDependencies": {
63
- "@classytic/mongokit": ">=3.16.0",
64
- "@classytic/repo-core": ">=0.6.0",
65
- "@classytic/primitives": ">=0.5.0",
66
- "mongoose": ">=9.4.1",
67
- "zod": ">=4.0.0"
68
- },
69
- "devDependencies": {
70
- "@classytic/dev-tools": "^0.2.0",
71
- "@classytic/mongokit": ">=3.16.0",
72
- "@classytic/repo-core": ">=0.6.0",
73
- "@classytic/primitives": "^0.7.2",
74
- "@types/node": "^25.5.0",
75
- "mongodb-memory-server": "^10.2.3",
76
- "mongoose": "^9.4.1",
77
- "tsdown": "^0.14.2",
78
- "typescript": "^5.8.2",
79
- "vitest": "^3.2.4",
80
- "zod": "^4.0.0"
81
- }
82
- }
1
+ {
2
+ "name": "@classytic/supplier-performance",
3
+ "version": "0.3.0",
4
+ "description": "Framework-agnostic supplier performance engine \u00e2\u20ac\u201d on-time-delivery, defect, and price-variance tracking with append-only event log + cached scorecards. Powered by MongoDB via @classytic/mongokit. Zero framework deps \u00e2\u20ac\u201d usable from Arc, Express, Nest, Next.js, or raw Node.",
5
+ "author": "Classytic",
6
+ "license": "MIT",
7
+ "homepage": "https://www.npmjs.com/package/@classytic/supplier-performance",
8
+ "bugs": {
9
+ "url": "https://github.com/classytic/supplier-performance/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/classytic/supplier-performance.git"
14
+ },
15
+ "keywords": [
16
+ "supplier",
17
+ "performance",
18
+ "scorecard",
19
+ "vendor",
20
+ "procurement",
21
+ "on-time-delivery",
22
+ "defect-rate",
23
+ "price-variance",
24
+ "mongodb",
25
+ "classytic"
26
+ ],
27
+ "type": "module",
28
+ "sideEffects": false,
29
+ "engines": {
30
+ "node": ">=22"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.js"
39
+ },
40
+ "./events": {
41
+ "types": "./dist/events.d.ts",
42
+ "default": "./dist/events.js"
43
+ }
44
+ },
45
+ "main": "./dist/index.js",
46
+ "types": "./dist/index.d.ts",
47
+ "files": [
48
+ "dist",
49
+ "README.md",
50
+ "CHANGELOG.md",
51
+ "LICENSE"
52
+ ],
53
+ "scripts": {
54
+ "build": "tsdown",
55
+ "typecheck": "tsc --noEmit",
56
+ "test": "vitest run",
57
+ "prepublishOnly": "npm run typecheck && npm run test && npm run build",
58
+ "push": "classytic-push",
59
+ "release:tag": "node -e \"require('child_process').execSync('npm run push -- v'+require('./package.json').version,{stdio:'inherit'})\"",
60
+ "release": "npm run push -- main && npm run release:tag && npm publish"
61
+ },
62
+ "peerDependencies": {
63
+ "@classytic/mongokit": ">=3.22.0",
64
+ "@classytic/repo-core": ">=0.13.0",
65
+ "@classytic/primitives": ">=0.11.0",
66
+ "mongoose": ">=9.4.1",
67
+ "zod": ">=4.0.0"
68
+ },
69
+ "devDependencies": {
70
+ "@classytic/dev-tools": "^0.2.0",
71
+ "@classytic/mongokit": "^3.22.1",
72
+ "@classytic/repo-core": "^0.13.0",
73
+ "@classytic/primitives": "^0.11.0",
74
+ "@types/node": "^25.5.0",
75
+ "mongodb-memory-server": "^10.2.3",
76
+ "mongoose": "^9.4.1",
77
+ "tsdown": "^0.14.2",
78
+ "typescript": "^5.8.2",
79
+ "vitest": "^3.2.4",
80
+ "zod": "^4.0.0"
81
+ }
82
+ }