@plasius/schema 1.4.0 → 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
@@ -114,6 +114,7 @@ reporting:
114
114
  ```ts
115
115
  import {
116
116
  FeedbackBugPacketSchema,
117
+ FeedbackCommittedAcceptanceEvidenceSchema,
117
118
  FeedbackPublicSummarySchema,
118
119
  FeedbackRichTextAstSchema,
119
120
  FeedbackReviewPacketSchema,
@@ -227,6 +228,21 @@ hours and review suppression at 30 days; acceptance receipts distinguish bugs
227
228
  from reviews and accept only the five-step bug ladder or exact 30-day review
228
229
  period.
229
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
+
230
246
  All feedback contracts opt in to recursive unknown-field rejection, including
231
247
  direct references and arrays of references. Unshaped references admit only
232
248
  `type` and `id`; shaped references admit only those keys plus their declared
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,