@riddledc/riddle-proof 0.7.187 → 0.7.189

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/dist/cli.cjs CHANGED
@@ -16406,6 +16406,68 @@ function profileHasRouteExitAffordanceReceipt(receipts) {
16406
16406
  return routeFields.some((name) => setupReturnSummaryValue(receipt, [name]) !== void 0) || haystack.includes("route=") || haystack.includes("browserpath=");
16407
16407
  });
16408
16408
  }
16409
+ function profileHasOfflineAudioMetricsReceipt(receipts) {
16410
+ const metricFields = [
16411
+ "mixPeak",
16412
+ "mixRms",
16413
+ "maxPeak",
16414
+ "avgRms",
16415
+ "audioPeak",
16416
+ "audioRms",
16417
+ "offlinePeak",
16418
+ "offlineRms",
16419
+ "peak",
16420
+ "rms"
16421
+ ];
16422
+ return receipts.some((receipt) => metricFields.some((name) => {
16423
+ const value = cliFiniteNumber(setupReturnSummaryValue(receipt, [name]));
16424
+ return value !== void 0 && value > 0;
16425
+ }));
16426
+ }
16427
+ function profileHasActiveRouteLocalProofReceipt(receipts) {
16428
+ return receipts.some((receipt) => {
16429
+ const route = cliString(setupReturnSummaryValue(receipt, ["route", "browserPath", "path"]));
16430
+ if (!route) return false;
16431
+ const proofVersion = cliString(setupReturnSummaryValue(receipt, ["proofVersion", "proof_version", "proofKind", "proof_kind"]));
16432
+ const globalCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["globalCount", "activeGlobalCount", "activeGlobals.length"]));
16433
+ const globalNames = setupReturnSummaryValue(receipt, ["globalNames", "activeGlobals"]);
16434
+ const enabled = setupReturnSummaryValue(receipt, ["enabled", "proofEnabled", "proof_enabled"]) === true;
16435
+ const ready = setupReturnSummaryValue(receipt, ["ready", "proofReady", "proof_ready"]) === true;
16436
+ const supportsProofFeature = setupReturnSummaryValue(receipt, ["supportsOfflineAudio", "supportsProof", "proofSupported"]) === true;
16437
+ return Boolean(
16438
+ proofVersion || enabled || ready || supportsProofFeature || globalCount !== void 0 && globalCount > 0 || Array.isArray(globalNames) && globalNames.length > 0
16439
+ );
16440
+ });
16441
+ }
16442
+ function profileLowerSummaryValue(receipt, names) {
16443
+ return names.map((name) => cliString(setupReturnSummaryValue(receipt, [name]))?.toLowerCase()).find((value) => Boolean(value)) || "";
16444
+ }
16445
+ function profileHasTerminalLossReceipt(receipts) {
16446
+ return receipts.some((receipt) => {
16447
+ const status = profileLowerSummaryValue(receipt, ["status", "state", "phase"]);
16448
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome", "terminalOutcome", "terminal"]);
16449
+ const lastFlightLost = setupReturnSummaryValue(receipt, ["lastFlightLost", "lost"]) === true;
16450
+ const outOfBounds = setupReturnSummaryValue(receipt, ["lastFlightOutOfBounds", "outOfBounds"]) === true;
16451
+ const storedTo = cliString(receipt.return_stored_to) || "";
16452
+ const label = cliString(receipt.label) || "";
16453
+ const path7 = cliString(receipt.path) || cliString(receipt.function_name) || "";
16454
+ const haystack = `${storedTo} ${label} ${path7}`.toLowerCase();
16455
+ const labelsLoss = haystack.includes("loss") || haystack.includes("lost") || haystack.includes("terminal");
16456
+ if (!labelsLoss && !lastFlightLost && !outOfBounds) return false;
16457
+ return lastFlightLost || outOfBounds || ["over", "lost", "loss", "failed", "failure", "game_over", "gameover"].includes(status) || ["lost", "loss", "failed", "failure", "game_over", "gameover"].includes(outcome);
16458
+ });
16459
+ }
16460
+ function profileHasControlledLaunchReceipt(receipts, expected) {
16461
+ return receipts.some((receipt) => {
16462
+ const shotKind = profileLowerSummaryValue(receipt, ["lastShotKind", "shotKind", "kind"]);
16463
+ const shotStatus = profileLowerSummaryValue(receipt, ["lastShotStatus", "shotStatus"]);
16464
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome"]);
16465
+ if (expected === "success") {
16466
+ return shotKind === "success" && (!shotStatus || shotStatus === "success" || outcome === "success");
16467
+ }
16468
+ return ["failure", "failed", "miss", "lost", "loss"].includes(shotKind) || ["failure", "failed", "miss", "lost", "loss"].includes(shotStatus) || ["failure", "failed", "miss", "lost", "loss"].includes(outcome);
16469
+ });
16470
+ }
16409
16471
  function profilePackReceiptStatus(result, metadata, receipt) {
16410
16472
  const text = receipt.toLowerCase();
16411
16473
  const setupSummary = profileSetupSummaryRecord(result);
@@ -16456,6 +16518,11 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16456
16518
  const hasTextAbsence = profileHasPassedCheck(result, ["text_absent", "selector_text_absent"]);
16457
16519
  const hasMeasuredStateChange = hasNaturalInput || hasCanvasChange || valueReceipts.some((item) => setupReturnSummaryValue(item, ["changed"]) === true || setupReturnSummaryValue(item, ["nonWhiteDelta", "darkDelta", "pixelDelta", "movementDelta"]) !== void 0);
16458
16520
  const hasRouteExitAffordanceReceipt = profileHasRouteExitAffordanceReceipt(valueReceipts);
16521
+ const hasOfflineAudioMetricsReceipt = profileHasOfflineAudioMetricsReceipt(valueReceipts);
16522
+ const hasActiveRouteLocalProofReceipt = profileHasActiveRouteLocalProofReceipt(valueReceipts);
16523
+ const hasTerminalLossReceipt = profileHasTerminalLossReceipt(valueReceipts);
16524
+ const hasControlledFailureLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "failure");
16525
+ const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
16459
16526
  const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
16460
16527
  if (text.includes("artifact link") || text.includes("artifact path")) {
16461
16528
  return profileReceiptSignalStatus(profileResultHasArtifact(result), "artifact references listed", "no artifact references found");
@@ -16471,6 +16538,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16471
16538
  if (text.includes("setup action")) {
16472
16539
  return profileReceiptSignalStatus(hasSetupReceipts, "setup receipts present", "setup receipts missing");
16473
16540
  }
16541
+ if (text.includes("active") && (text.includes("route-local") || text.includes("route local")) && (text.includes("proof helper") || text.includes("proof api") || text.includes("proof state"))) {
16542
+ return profileReceiptSignalStatus(
16543
+ hasActiveRouteLocalProofReceipt,
16544
+ "active route-local proof receipt present",
16545
+ "active route-local proof receipt missing"
16546
+ );
16547
+ }
16474
16548
  if (text.includes("declared state contract")) {
16475
16549
  return profileReceiptSignalStatus(hasStateContract, "state contract metadata or receipts present", "state contract evidence missing");
16476
16550
  }
@@ -16494,6 +16568,27 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16494
16568
  if (text.includes("invalid state")) {
16495
16569
  return profileReceiptSignalStatus(hasStateContract || hasInvalidStateReceipt, "invalid-state receipt present", "invalid-state receipt missing");
16496
16570
  }
16571
+ if ((text.includes("loss") || text.includes("lost")) && text.includes("terminal")) {
16572
+ return profileReceiptSignalStatus(
16573
+ hasTerminalLossReceipt,
16574
+ "terminal loss receipt present",
16575
+ "terminal loss receipt missing"
16576
+ );
16577
+ }
16578
+ if (text.includes("controlled") && text.includes("launch") && (text.includes("failure") || text.includes("failed") || text.includes("miss"))) {
16579
+ return profileReceiptSignalStatus(
16580
+ hasControlledFailureLaunchReceipt,
16581
+ "controlled failure launch receipt present",
16582
+ "controlled failure launch receipt missing"
16583
+ );
16584
+ }
16585
+ if (text.includes("controlled") && text.includes("launch") && text.includes("success")) {
16586
+ return profileReceiptSignalStatus(
16587
+ hasControlledSuccessLaunchReceipt,
16588
+ "controlled success launch receipt present",
16589
+ "controlled success launch receipt missing"
16590
+ );
16591
+ }
16497
16592
  if (text.includes("through visible ui") || text.includes("visible ui action") || text.includes("ui-routed") || text.includes("ui routed") || text.includes("visible") && text.includes("route") && text.includes("exit") && text.includes("action") || text.includes("visible") && text.includes("mode") && text.includes("exit") && text.includes("action")) {
16498
16593
  return profileReceiptSignalStatus(
16499
16594
  visibleUiActionCount > 0,
@@ -16567,6 +16662,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16567
16662
  if (text.includes("input dispatch") || text.includes("pointer") || text.includes("touch") || text.includes("key event") || text.includes("trusted-event")) {
16568
16663
  return profileReceiptSignalStatus(inputDispatchCount > 0 || hasNaturalInput, "input dispatch evidence present", "input dispatch evidence missing");
16569
16664
  }
16665
+ if (text.includes("offline audio") || text.includes("audio") && text.includes("metric")) {
16666
+ return profileReceiptSignalStatus(
16667
+ hasOfflineAudioMetricsReceipt,
16668
+ "offline audio metric receipt present",
16669
+ "offline audio metric receipt missing"
16670
+ );
16671
+ }
16570
16672
  if (text.includes("measured") || text.includes("state-change") || text.includes("pixel delta") || text.includes("movement receipt") || text.includes("canvas hash")) {
16571
16673
  return profileReceiptSignalStatus(hasMeasuredStateChange, "measured-change evidence present", "measured-change evidence missing");
16572
16674
  }
package/dist/cli.js CHANGED
@@ -611,6 +611,68 @@ function profileHasRouteExitAffordanceReceipt(receipts) {
611
611
  return routeFields.some((name) => setupReturnSummaryValue(receipt, [name]) !== void 0) || haystack.includes("route=") || haystack.includes("browserpath=");
612
612
  });
613
613
  }
614
+ function profileHasOfflineAudioMetricsReceipt(receipts) {
615
+ const metricFields = [
616
+ "mixPeak",
617
+ "mixRms",
618
+ "maxPeak",
619
+ "avgRms",
620
+ "audioPeak",
621
+ "audioRms",
622
+ "offlinePeak",
623
+ "offlineRms",
624
+ "peak",
625
+ "rms"
626
+ ];
627
+ return receipts.some((receipt) => metricFields.some((name) => {
628
+ const value = cliFiniteNumber(setupReturnSummaryValue(receipt, [name]));
629
+ return value !== void 0 && value > 0;
630
+ }));
631
+ }
632
+ function profileHasActiveRouteLocalProofReceipt(receipts) {
633
+ return receipts.some((receipt) => {
634
+ const route = cliString(setupReturnSummaryValue(receipt, ["route", "browserPath", "path"]));
635
+ if (!route) return false;
636
+ const proofVersion = cliString(setupReturnSummaryValue(receipt, ["proofVersion", "proof_version", "proofKind", "proof_kind"]));
637
+ const globalCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["globalCount", "activeGlobalCount", "activeGlobals.length"]));
638
+ const globalNames = setupReturnSummaryValue(receipt, ["globalNames", "activeGlobals"]);
639
+ const enabled = setupReturnSummaryValue(receipt, ["enabled", "proofEnabled", "proof_enabled"]) === true;
640
+ const ready = setupReturnSummaryValue(receipt, ["ready", "proofReady", "proof_ready"]) === true;
641
+ const supportsProofFeature = setupReturnSummaryValue(receipt, ["supportsOfflineAudio", "supportsProof", "proofSupported"]) === true;
642
+ return Boolean(
643
+ proofVersion || enabled || ready || supportsProofFeature || globalCount !== void 0 && globalCount > 0 || Array.isArray(globalNames) && globalNames.length > 0
644
+ );
645
+ });
646
+ }
647
+ function profileLowerSummaryValue(receipt, names) {
648
+ return names.map((name) => cliString(setupReturnSummaryValue(receipt, [name]))?.toLowerCase()).find((value) => Boolean(value)) || "";
649
+ }
650
+ function profileHasTerminalLossReceipt(receipts) {
651
+ return receipts.some((receipt) => {
652
+ const status = profileLowerSummaryValue(receipt, ["status", "state", "phase"]);
653
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome", "terminalOutcome", "terminal"]);
654
+ const lastFlightLost = setupReturnSummaryValue(receipt, ["lastFlightLost", "lost"]) === true;
655
+ const outOfBounds = setupReturnSummaryValue(receipt, ["lastFlightOutOfBounds", "outOfBounds"]) === true;
656
+ const storedTo = cliString(receipt.return_stored_to) || "";
657
+ const label = cliString(receipt.label) || "";
658
+ const path2 = cliString(receipt.path) || cliString(receipt.function_name) || "";
659
+ const haystack = `${storedTo} ${label} ${path2}`.toLowerCase();
660
+ const labelsLoss = haystack.includes("loss") || haystack.includes("lost") || haystack.includes("terminal");
661
+ if (!labelsLoss && !lastFlightLost && !outOfBounds) return false;
662
+ return lastFlightLost || outOfBounds || ["over", "lost", "loss", "failed", "failure", "game_over", "gameover"].includes(status) || ["lost", "loss", "failed", "failure", "game_over", "gameover"].includes(outcome);
663
+ });
664
+ }
665
+ function profileHasControlledLaunchReceipt(receipts, expected) {
666
+ return receipts.some((receipt) => {
667
+ const shotKind = profileLowerSummaryValue(receipt, ["lastShotKind", "shotKind", "kind"]);
668
+ const shotStatus = profileLowerSummaryValue(receipt, ["lastShotStatus", "shotStatus"]);
669
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome"]);
670
+ if (expected === "success") {
671
+ return shotKind === "success" && (!shotStatus || shotStatus === "success" || outcome === "success");
672
+ }
673
+ return ["failure", "failed", "miss", "lost", "loss"].includes(shotKind) || ["failure", "failed", "miss", "lost", "loss"].includes(shotStatus) || ["failure", "failed", "miss", "lost", "loss"].includes(outcome);
674
+ });
675
+ }
614
676
  function profilePackReceiptStatus(result, metadata, receipt) {
615
677
  const text = receipt.toLowerCase();
616
678
  const setupSummary = profileSetupSummaryRecord(result);
@@ -661,6 +723,11 @@ function profilePackReceiptStatus(result, metadata, receipt) {
661
723
  const hasTextAbsence = profileHasPassedCheck(result, ["text_absent", "selector_text_absent"]);
662
724
  const hasMeasuredStateChange = hasNaturalInput || hasCanvasChange || valueReceipts.some((item) => setupReturnSummaryValue(item, ["changed"]) === true || setupReturnSummaryValue(item, ["nonWhiteDelta", "darkDelta", "pixelDelta", "movementDelta"]) !== void 0);
663
725
  const hasRouteExitAffordanceReceipt = profileHasRouteExitAffordanceReceipt(valueReceipts);
726
+ const hasOfflineAudioMetricsReceipt = profileHasOfflineAudioMetricsReceipt(valueReceipts);
727
+ const hasActiveRouteLocalProofReceipt = profileHasActiveRouteLocalProofReceipt(valueReceipts);
728
+ const hasTerminalLossReceipt = profileHasTerminalLossReceipt(valueReceipts);
729
+ const hasControlledFailureLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "failure");
730
+ const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
664
731
  const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
665
732
  if (text.includes("artifact link") || text.includes("artifact path")) {
666
733
  return profileReceiptSignalStatus(profileResultHasArtifact(result), "artifact references listed", "no artifact references found");
@@ -676,6 +743,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
676
743
  if (text.includes("setup action")) {
677
744
  return profileReceiptSignalStatus(hasSetupReceipts, "setup receipts present", "setup receipts missing");
678
745
  }
746
+ if (text.includes("active") && (text.includes("route-local") || text.includes("route local")) && (text.includes("proof helper") || text.includes("proof api") || text.includes("proof state"))) {
747
+ return profileReceiptSignalStatus(
748
+ hasActiveRouteLocalProofReceipt,
749
+ "active route-local proof receipt present",
750
+ "active route-local proof receipt missing"
751
+ );
752
+ }
679
753
  if (text.includes("declared state contract")) {
680
754
  return profileReceiptSignalStatus(hasStateContract, "state contract metadata or receipts present", "state contract evidence missing");
681
755
  }
@@ -699,6 +773,27 @@ function profilePackReceiptStatus(result, metadata, receipt) {
699
773
  if (text.includes("invalid state")) {
700
774
  return profileReceiptSignalStatus(hasStateContract || hasInvalidStateReceipt, "invalid-state receipt present", "invalid-state receipt missing");
701
775
  }
776
+ if ((text.includes("loss") || text.includes("lost")) && text.includes("terminal")) {
777
+ return profileReceiptSignalStatus(
778
+ hasTerminalLossReceipt,
779
+ "terminal loss receipt present",
780
+ "terminal loss receipt missing"
781
+ );
782
+ }
783
+ if (text.includes("controlled") && text.includes("launch") && (text.includes("failure") || text.includes("failed") || text.includes("miss"))) {
784
+ return profileReceiptSignalStatus(
785
+ hasControlledFailureLaunchReceipt,
786
+ "controlled failure launch receipt present",
787
+ "controlled failure launch receipt missing"
788
+ );
789
+ }
790
+ if (text.includes("controlled") && text.includes("launch") && text.includes("success")) {
791
+ return profileReceiptSignalStatus(
792
+ hasControlledSuccessLaunchReceipt,
793
+ "controlled success launch receipt present",
794
+ "controlled success launch receipt missing"
795
+ );
796
+ }
702
797
  if (text.includes("through visible ui") || text.includes("visible ui action") || text.includes("ui-routed") || text.includes("ui routed") || text.includes("visible") && text.includes("route") && text.includes("exit") && text.includes("action") || text.includes("visible") && text.includes("mode") && text.includes("exit") && text.includes("action")) {
703
798
  return profileReceiptSignalStatus(
704
799
  visibleUiActionCount > 0,
@@ -772,6 +867,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
772
867
  if (text.includes("input dispatch") || text.includes("pointer") || text.includes("touch") || text.includes("key event") || text.includes("trusted-event")) {
773
868
  return profileReceiptSignalStatus(inputDispatchCount > 0 || hasNaturalInput, "input dispatch evidence present", "input dispatch evidence missing");
774
869
  }
870
+ if (text.includes("offline audio") || text.includes("audio") && text.includes("metric")) {
871
+ return profileReceiptSignalStatus(
872
+ hasOfflineAudioMetricsReceipt,
873
+ "offline audio metric receipt present",
874
+ "offline audio metric receipt missing"
875
+ );
876
+ }
775
877
  if (text.includes("measured") || text.includes("state-change") || text.includes("pixel delta") || text.includes("movement receipt") || text.includes("canvas hash")) {
776
878
  return profileReceiptSignalStatus(hasMeasuredStateChange, "measured-change evidence present", "measured-change evidence missing");
777
879
  }
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.187",
3
+ "version": "0.7.189",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",