@plasius/schema 1.3.1 → 1.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.
package/README.md CHANGED
@@ -45,6 +45,46 @@ uses `dist-cjs/*.js` with `type: module`, it must generate
45
45
  `dist-cjs/package.json` with `{ "type": "commonjs" }` and validate this in
46
46
  `pack:check` before publish.
47
47
 
48
+ ### Private-artifact policy
49
+
50
+ Signed contributor agreements and contributor acceptance records belong only
51
+ in the approved access-controlled system outside source control. The
52
+ zero-dependency repository gate inspects path metadata without opening,
53
+ hashing, copying, or logging suspected private artifacts:
54
+
55
+ ```bash
56
+ npm run privacy:check
57
+ npm run test:privacy
58
+ npm run build
59
+ npm run pack:check
60
+ ```
61
+
62
+ `privacy:check` checks both filesystem metadata and the proposed Git index. It
63
+ rejects CSV files, contributor/CLA registry variants, contributor acceptance,
64
+ signature, and submission record categories, signed CLA/contributor agreement
65
+ storage, and paths that combine privacy and registry markers. Explicit public
66
+ process, template, schema, validator, and policy files remain allowed only as
67
+ terminal path components; matching private-record categories used as
68
+ directories fail closed regardless of their descendants.
69
+ Unicode compatibility normalization occurs before separator folding so
70
+ hierarchical, case-variant, and compatibility-separated protected paths cannot
71
+ evade the same path-only classification. An unstaged deletion remains a
72
+ failure until the deletion is staged. Invalid Git worktree metadata, symbolic
73
+ links, and non-regular entries fail closed, and failures report only rule IDs
74
+ and counts.
75
+
76
+ `pack:check` requires the exact `dist`, `THIRD_PARTY_NOTICES.md`, and `unicode`
77
+ `package.json.files` entries, then retains prefix-stripped raw member identities
78
+ and cardinality while comparing the canonical `npm pack --dry-run` manifest
79
+ with the package's exact public allowlist. Duplicate members, raw aliases, and
80
+ many-to-one normalization collisions fail without logging member values. The
81
+ same zero-dependency inventory policy runs over the digest-verified sealed
82
+ tarball immediately before publication. The isolated npm cache is removed
83
+ whether the check passes or fails. CI runs the repository gate before
84
+ dependency installation; release preparation and publication repeat the gate.
85
+ These path controls are defense in depth and do not replace secret scanning,
86
+ access controls, or incident response.
87
+
48
88
  ---
49
89
 
50
90
  ## Player-system event contracts
@@ -74,6 +114,7 @@ reporting:
74
114
  ```ts
75
115
  import {
76
116
  FeedbackBugPacketSchema,
117
+ FeedbackCommittedAcceptanceEvidenceSchema,
77
118
  FeedbackPublicSummarySchema,
78
119
  FeedbackRichTextAstSchema,
79
120
  FeedbackReviewPacketSchema,
@@ -152,6 +193,12 @@ build-time dependency `@unicode/unicode-15.1.0@1.6.17`; run
152
193
  [ADR-0007](./docs/adrs/adr-0007-pinned-unicode-feedback-profile.md) and
153
194
  [third-party notices](./THIRD_PARTY_NOTICES.md).
154
195
 
196
+ The three typed feedback subpaths publish both modern `exports.types` entries
197
+ and exact `typesVersions` fallbacks. This keeps their declarations resolvable
198
+ for consumers that still compile CommonJS with classic TypeScript
199
+ `moduleResolution: "node"`, without opening a wildcard route for unknown
200
+ subpaths.
201
+
155
202
  Validated reusable fragments retain exact `type` and `version` metadata when
156
203
  embedded in parent contracts. This makes the output of the encrypted-envelope,
157
204
  derived-analysis, and game-diagnostics schemas directly composable into their
@@ -181,6 +228,21 @@ hours and review suppression at 30 days; acceptance receipts distinguish bugs
181
228
  from reviews and accept only the five-step bug ladder or exact 30-day review
182
229
  period.
183
230
 
231
+ `FeedbackCommittedAcceptanceEvidenceSchema` is a separate, durable proof that
232
+ the control-plane commit for one immutable packet completed. It contains only
233
+ the canonical packet UUID, `bug`/`review` kind, and the packet's canonical
234
+ server-owned UTC acceptance time. Canonical timestamp validation rejects
235
+ impossible calendar or clock values as ordinary closed validation failures; it
236
+ does not expose the rejected value or a native date exception. It cannot
237
+ express a control-state key, reservation, idempotency value, reporter
238
+ pseudonym, request metadata, Blob locator, content hash, narrative, ciphertext,
239
+ or pixels, and its PII audit is empty. Only a trusted delivery worker may
240
+ construct this evidence after an atomic control-plane commit; it is not an
241
+ intake request. Report processors must select packets through this evidence
242
+ rather than by enumerating packet storage, preventing an immutable Blob written
243
+ before a failed commit from entering aggregates. See
244
+ [ADR-0011](./docs/adrs/adr-0011-identifier-free-feedback-acceptance-evidence.md).
245
+
184
246
  All feedback contracts opt in to recursive unknown-field rejection, including
185
247
  direct references and arrays of references. Unshaped references admit only
186
248
  `type` and `id`; shaped references admit only those keys plus their declared
@@ -485,8 +547,9 @@ prerelease identity, artifact digests, or npm registry integrity differ.
485
547
  The read-only validation job installs dependencies, validates the package,
486
548
  builds an SBOM, and seals an immutable tarball. The `production` job runs no
487
549
  package lifecycle or dependency code; it verifies the exact artifact hand-off
488
- and publishes that tarball through npm OIDC with provenance. No npm write token
489
- or fallback is configured. The trusted publisher must be bound to
490
- `Plasius-LTD/schema`, `cd.yml`, `production`, and `npm publish`. Rollback is to
491
- disable `cd.yml`; never restore token-based publication.
550
+ and rechecks the collision-free exact raw-member inventory before publishing
551
+ that tarball through npm OIDC with provenance. No npm write token or fallback
552
+ is configured. The trusted publisher must be bound to `Plasius-LTD/schema`,
553
+ `cd.yml`, `production`, and `npm publish`. Rollback is to disable `cd.yml`;
554
+ never restore token-based publication.
492
555
  <!-- END PLASIUS RELEASE INTEGRITY -->
package/dist/index.cjs CHANGED
@@ -53,6 +53,7 @@ __export(index_exports, {
53
53
  FeedbackAnalysisReceiptSchema: () => FeedbackAnalysisReceiptSchema,
54
54
  FeedbackBugPacketSchema: () => FeedbackBugPacketSchema,
55
55
  FeedbackBugSubmissionRequestSchema: () => FeedbackBugSubmissionRequestSchema,
56
+ FeedbackCommittedAcceptanceEvidenceSchema: () => FeedbackCommittedAcceptanceEvidenceSchema,
56
57
  FeedbackContextSchema: () => FeedbackContextSchema,
57
58
  FeedbackDailySatisfactionReportSchema: () => FeedbackDailySatisfactionReportSchema,
58
59
  FeedbackDerivedAnalysisSchema: () => FeedbackDerivedAnalysisSchema,
@@ -3614,6 +3615,7 @@ var BASE64URL_ALPHABET2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0
3614
3615
  var BUG_HOUR_WINDOW_PATTERN = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3])$/;
3615
3616
  var REVIEW_DAY_WINDOW_PATTERN = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/;
3616
3617
  var RECONCILIATION_WINDOW_PATTERN = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3]):(?:[0-5]\d)$/;
3618
+ var CANONICAL_SERVER_UTC_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
3617
3619
  var strictOptions = {
3618
3620
  version: FEEDBACK_CONTRACT_VERSION,
3619
3621
  piiEnforcement: "strict",
@@ -3621,6 +3623,16 @@ var strictOptions = {
3621
3623
  identity: "exact"
3622
3624
  };
3623
3625
  var uuidField = () => field.string().validator((value) => OPAQUE_UUID_V4_PATTERN.test(value)).description("Opaque UUID generated for the feedback workflow");
3626
+ var isCanonicalServerUtc = (value) => {
3627
+ if (typeof value !== "string" || !CANONICAL_SERVER_UTC_PATTERN.test(value)) {
3628
+ return false;
3629
+ }
3630
+ const timestamp = Date.parse(value);
3631
+ return Number.isFinite(timestamp) && new Date(timestamp).toISOString() === value;
3632
+ };
3633
+ var canonicalServerUtcField = () => field.dateTimeISO().validator(isCanonicalServerUtc).description(
3634
+ "Canonical millisecond-precision UTC timestamp supplied by the trusted server"
3635
+ );
3624
3636
  var draftIdField = () => field.string().validator((value) => OPAQUE_UUID_V4_PATTERN.test(value)).description("Opaque identifier for one short-lived structured draft").PID({
3625
3637
  classification: "low",
3626
3638
  action: "none",
@@ -4284,6 +4296,15 @@ var FeedbackReviewPacketSchema = createSchema(
4284
4296
  schemaValidator: (value) => value.analysis === void 0 || isAnalysisProjectionConsistent(value.analysis)
4285
4297
  }
4286
4298
  );
4299
+ var FeedbackCommittedAcceptanceEvidenceSchema = createSchema(
4300
+ {
4301
+ packetId: uuidField(),
4302
+ packetKind: field.string().enum(["bug", "review"]),
4303
+ acceptedAt: canonicalServerUtcField()
4304
+ },
4305
+ "feedback-committed-acceptance-evidence",
4306
+ strictOptions
4307
+ );
4287
4308
  var FeedbackGameReconstructionManifestSchema = createSchema(
4288
4309
  {
4289
4310
  reconstructionId: uuidField(),
@@ -4775,6 +4796,7 @@ var FeedbackMaterializationManifestSchema = createSchema(
4775
4796
  FeedbackAnalysisReceiptSchema,
4776
4797
  FeedbackBugPacketSchema,
4777
4798
  FeedbackBugSubmissionRequestSchema,
4799
+ FeedbackCommittedAcceptanceEvidenceSchema,
4778
4800
  FeedbackContextSchema,
4779
4801
  FeedbackDailySatisfactionReportSchema,
4780
4802
  FeedbackDerivedAnalysisSchema,