@ixo/action-protocol 0.9.1 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.2
4
+
5
+ - Add an owner-only `surveyReview` to the browser review view for mainnet Youth Voice collection 13530.
6
+ - Keep claim operations, their payloads, capability levels, and runtime receipts unchanged.
7
+ - A private review contains only questions, answers, and response states. An unavailable review cannot permit approval.
8
+ - Existing runtimes keep their current operation contract. Deploy the new browser parser with the Hub view extension.
9
+
3
10
  ## 0.9.1
4
11
 
5
12
  A patch release: two inputs are widened, nothing is narrowed, and the wire
package/README.md CHANGED
@@ -39,6 +39,19 @@ Callers declare the envelope version they parse with `?version=2` on
39
39
 
40
40
  ## Applications and claims (`ixo.bid.submit.v1`, `ixo.claim.submit.v1`, 0.7.0)
41
41
 
42
+ ### Private Youth Voice review (0.9.2)
43
+
44
+ The owner's authenticated browser view may include `surveyReview: {status, rows}` for mainnet collection 13530.
45
+ Each row contains `question`, `answer`, and the recorded response `status`.
46
+ The Hub reads the private VFS capture as the owner and verifies the oracle signature, current issuer key, capture commitment, and source hashes.
47
+ An unavailable review has no rows and cannot permit approval. The Hub repeats the verification before admission.
48
+ The browser shows this review instead of the attestation summary, including after submission. It never falls back to technical fields.
49
+ The operation, its summary/data equality rule, wire level, submitted claim, and runtime receipts remain unchanged.
50
+ The private review carries no salt, capability, or storage locator. It is not a second claim payload.
51
+ Deploy the browser parser with this view extension; existing runtime polling responses do not receive the new field.
52
+
53
+ ### Submission fields
54
+
42
55
  - `summary`: one row per answer of `data`, `{field, label, value}`. `field`
43
56
  is the answer's path (object keys and array indices joined with `.`, e.g.
44
57
  `shops.1.name`); `value` is exactly `submissionDisplayValue(answer)`: a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/action-protocol",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Shared wire contract between IXO Auth Hub, oracle runtimes and channel gateways for reviewed action cards (operations, capabilities, outcomes, receipts).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/index.d.ts CHANGED
@@ -248,7 +248,15 @@ export type ActionReviewView = {
248
248
  * with `operation.collectionId`.
249
249
  */
250
250
  collectionName?: string | null;
251
+ /** Private, owner-authenticated review only. Never part of the submitted claim. */
252
+ surveyReview?: SurveyReview | null;
251
253
  };
254
+ export type SurveyReview = {
255
+ status: 'ready' | 'unavailable';
256
+ rows: { question: string; answer: string; status: string }[];
257
+ };
258
+ /** The reserved mainnet Youth Voice collection, including malformed claims that must fail closed. */
259
+ export function isYouthSurveyClaim(operation: ActionOperationV1): boolean;
252
260
  export type TransferDisplay = {
253
261
  denom: string;
254
262
  symbol: string;
package/src/index.js CHANGED
@@ -462,6 +462,11 @@ export function parseReceipt(input) {
462
462
  return fail("receipt.kind");
463
463
  }
464
464
 
465
+ export function isYouthSurveyClaim(operation) {
466
+ return operation?.kind === 'ixo.claim.submit.v1' &&
467
+ operation.network === 'ixo mainnet' && operation.collectionId === '13530';
468
+ }
469
+
465
470
  export function parseReviewView(input) {
466
471
  const view = object(input, "view");
467
472
  exact(
@@ -486,11 +491,31 @@ export function parseReviewView(input) {
486
491
  "chainTx",
487
492
  "networkFee",
488
493
  "collectionName",
494
+ "surveyReview",
489
495
  ],
490
496
  "view",
491
497
  );
492
498
  parseReference(view.reference);
493
499
  parseOperation(view.operation);
500
+ if (view.surveyReview !== undefined && view.surveyReview !== null) {
501
+ if (!isYouthSurveyClaim(view.operation)) fail('view.surveyReview');
502
+ const review = object(view.surveyReview, 'view.surveyReview');
503
+ exact(review, ['status', 'rows'], 'view.surveyReview');
504
+ if (!['ready', 'unavailable'].includes(review.status) ||
505
+ !Array.isArray(review.rows) || review.rows.length > 100 ||
506
+ (review.status === 'ready' ? review.rows.length === 0 : review.rows.length !== 0))
507
+ fail('view.surveyReview');
508
+ for (const row of review.rows) {
509
+ object(row, 'view.surveyReview.row');
510
+ exact(row, ['question', 'answer', 'status'], 'view.surveyReview.row');
511
+ str(row.question, 'view.surveyReview.question', 1, 25000);
512
+ str(row.answer, 'view.surveyReview.answer', 0, 12000);
513
+ if (!['answered', 'explicitly_skipped', 'declined', 'dont_know', 'ambiguous',
514
+ 'contradictory', 'interrupted', 'unintelligible', 'redacted'].includes(row.status))
515
+ fail('view.surveyReview.status');
516
+ }
517
+ if (review.status !== 'ready' && view.canApprove) fail('view.surveyReview.canApprove');
518
+ }
494
519
  // 0.6.0: the Hub-computed chain transaction display (chain tx cards only).
495
520
  if (view.chainTx !== undefined && view.chainTx !== null) {
496
521
  if (view.operation?.kind !== CHAIN_TX_KIND) fail("view.chainTx");