@riddledc/riddle-proof 0.7.188 → 0.7.190

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
@@ -16424,6 +16424,68 @@ function profileHasOfflineAudioMetricsReceipt(receipts) {
16424
16424
  return value !== void 0 && value > 0;
16425
16425
  }));
16426
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
+ }
16471
+ function profileHasRecoveredStateReceipt(receipts) {
16472
+ return receipts.some((receipt) => {
16473
+ const storedTo = cliString(receipt.return_stored_to) || "";
16474
+ const label = cliString(receipt.label) || "";
16475
+ const path7 = cliString(receipt.path) || cliString(receipt.function_name) || "";
16476
+ const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
16477
+ const haystack = `${storedTo} ${label} ${path7} ${summary}`.toLowerCase();
16478
+ const labelsRecovery = haystack.includes("recover") || haystack.includes("repaired") || haystack.includes("repair") || haystack.includes("try fix") || haystack.includes("tryfix") || haystack.includes("after-fix") || haystack.includes("fixed");
16479
+ if (!labelsRecovery) return false;
16480
+ const status = profileLowerSummaryValue(receipt, ["status", "state", "phase"]);
16481
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome", "result"]);
16482
+ const hasRecoveredState = ["valid", "success", "recovered", "fixed", "ready"].includes(status) || ["valid", "success", "recovered", "fixed", "ready"].includes(outcome);
16483
+ const hasValid = setupReturnSummaryValue(receipt, ["hasValid", "valid", "isValid"]) === true;
16484
+ const hasInvalid = setupReturnSummaryValue(receipt, ["hasInvalid", "invalid", "isInvalid"]);
16485
+ const success = setupReturnSummaryValue(receipt, ["success", "recovered", "fixed"]) === true;
16486
+ return hasRecoveredState || success || hasValid && hasInvalid === false;
16487
+ });
16488
+ }
16427
16489
  function profilePackReceiptStatus(result, metadata, receipt) {
16428
16490
  const text = receipt.toLowerCase();
16429
16491
  const setupSummary = profileSetupSummaryRecord(result);
@@ -16475,6 +16537,11 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16475
16537
  const hasMeasuredStateChange = hasNaturalInput || hasCanvasChange || valueReceipts.some((item) => setupReturnSummaryValue(item, ["changed"]) === true || setupReturnSummaryValue(item, ["nonWhiteDelta", "darkDelta", "pixelDelta", "movementDelta"]) !== void 0);
16476
16538
  const hasRouteExitAffordanceReceipt = profileHasRouteExitAffordanceReceipt(valueReceipts);
16477
16539
  const hasOfflineAudioMetricsReceipt = profileHasOfflineAudioMetricsReceipt(valueReceipts);
16540
+ const hasActiveRouteLocalProofReceipt = profileHasActiveRouteLocalProofReceipt(valueReceipts);
16541
+ const hasTerminalLossReceipt = profileHasTerminalLossReceipt(valueReceipts);
16542
+ const hasControlledFailureLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "failure");
16543
+ const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
16544
+ const hasRecoveredStateReceipt = profileHasRecoveredStateReceipt(valueReceipts);
16478
16545
  const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
16479
16546
  if (text.includes("artifact link") || text.includes("artifact path")) {
16480
16547
  return profileReceiptSignalStatus(profileResultHasArtifact(result), "artifact references listed", "no artifact references found");
@@ -16490,6 +16557,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16490
16557
  if (text.includes("setup action")) {
16491
16558
  return profileReceiptSignalStatus(hasSetupReceipts, "setup receipts present", "setup receipts missing");
16492
16559
  }
16560
+ if (text.includes("active") && (text.includes("route-local") || text.includes("route local")) && (text.includes("proof helper") || text.includes("proof api") || text.includes("proof state"))) {
16561
+ return profileReceiptSignalStatus(
16562
+ hasActiveRouteLocalProofReceipt,
16563
+ "active route-local proof receipt present",
16564
+ "active route-local proof receipt missing"
16565
+ );
16566
+ }
16493
16567
  if (text.includes("declared state contract")) {
16494
16568
  return profileReceiptSignalStatus(hasStateContract, "state contract metadata or receipts present", "state contract evidence missing");
16495
16569
  }
@@ -16513,6 +16587,34 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16513
16587
  if (text.includes("invalid state")) {
16514
16588
  return profileReceiptSignalStatus(hasStateContract || hasInvalidStateReceipt, "invalid-state receipt present", "invalid-state receipt missing");
16515
16589
  }
16590
+ if ((text.includes("loss") || text.includes("lost")) && text.includes("terminal")) {
16591
+ return profileReceiptSignalStatus(
16592
+ hasTerminalLossReceipt,
16593
+ "terminal loss receipt present",
16594
+ "terminal loss receipt missing"
16595
+ );
16596
+ }
16597
+ if (text.includes("controlled") && text.includes("launch") && (text.includes("failure") || text.includes("failed") || text.includes("miss"))) {
16598
+ return profileReceiptSignalStatus(
16599
+ hasControlledFailureLaunchReceipt,
16600
+ "controlled failure launch receipt present",
16601
+ "controlled failure launch receipt missing"
16602
+ );
16603
+ }
16604
+ if (text.includes("controlled") && text.includes("launch") && text.includes("success")) {
16605
+ return profileReceiptSignalStatus(
16606
+ hasControlledSuccessLaunchReceipt,
16607
+ "controlled success launch receipt present",
16608
+ "controlled success launch receipt missing"
16609
+ );
16610
+ }
16611
+ if (text.includes("recovery action") || text.includes("recover action") || text.includes("try fix") || (text.includes("retry") || text.includes("repair")) && text.includes("action")) {
16612
+ return profileReceiptSignalStatus(
16613
+ visibleUiActionCount > 0 && hasRecoveredStateReceipt,
16614
+ "visible recovery-action receipt present",
16615
+ "visible recovery-action receipt missing"
16616
+ );
16617
+ }
16516
16618
  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")) {
16517
16619
  return profileReceiptSignalStatus(
16518
16620
  visibleUiActionCount > 0,
package/dist/cli.js CHANGED
@@ -629,6 +629,68 @@ function profileHasOfflineAudioMetricsReceipt(receipts) {
629
629
  return value !== void 0 && value > 0;
630
630
  }));
631
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
+ }
676
+ function profileHasRecoveredStateReceipt(receipts) {
677
+ return receipts.some((receipt) => {
678
+ const storedTo = cliString(receipt.return_stored_to) || "";
679
+ const label = cliString(receipt.label) || "";
680
+ const path2 = cliString(receipt.path) || cliString(receipt.function_name) || "";
681
+ const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
682
+ const haystack = `${storedTo} ${label} ${path2} ${summary}`.toLowerCase();
683
+ const labelsRecovery = haystack.includes("recover") || haystack.includes("repaired") || haystack.includes("repair") || haystack.includes("try fix") || haystack.includes("tryfix") || haystack.includes("after-fix") || haystack.includes("fixed");
684
+ if (!labelsRecovery) return false;
685
+ const status = profileLowerSummaryValue(receipt, ["status", "state", "phase"]);
686
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome", "result"]);
687
+ const hasRecoveredState = ["valid", "success", "recovered", "fixed", "ready"].includes(status) || ["valid", "success", "recovered", "fixed", "ready"].includes(outcome);
688
+ const hasValid = setupReturnSummaryValue(receipt, ["hasValid", "valid", "isValid"]) === true;
689
+ const hasInvalid = setupReturnSummaryValue(receipt, ["hasInvalid", "invalid", "isInvalid"]);
690
+ const success = setupReturnSummaryValue(receipt, ["success", "recovered", "fixed"]) === true;
691
+ return hasRecoveredState || success || hasValid && hasInvalid === false;
692
+ });
693
+ }
632
694
  function profilePackReceiptStatus(result, metadata, receipt) {
633
695
  const text = receipt.toLowerCase();
634
696
  const setupSummary = profileSetupSummaryRecord(result);
@@ -680,6 +742,11 @@ function profilePackReceiptStatus(result, metadata, receipt) {
680
742
  const hasMeasuredStateChange = hasNaturalInput || hasCanvasChange || valueReceipts.some((item) => setupReturnSummaryValue(item, ["changed"]) === true || setupReturnSummaryValue(item, ["nonWhiteDelta", "darkDelta", "pixelDelta", "movementDelta"]) !== void 0);
681
743
  const hasRouteExitAffordanceReceipt = profileHasRouteExitAffordanceReceipt(valueReceipts);
682
744
  const hasOfflineAudioMetricsReceipt = profileHasOfflineAudioMetricsReceipt(valueReceipts);
745
+ const hasActiveRouteLocalProofReceipt = profileHasActiveRouteLocalProofReceipt(valueReceipts);
746
+ const hasTerminalLossReceipt = profileHasTerminalLossReceipt(valueReceipts);
747
+ const hasControlledFailureLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "failure");
748
+ const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
749
+ const hasRecoveredStateReceipt = profileHasRecoveredStateReceipt(valueReceipts);
683
750
  const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
684
751
  if (text.includes("artifact link") || text.includes("artifact path")) {
685
752
  return profileReceiptSignalStatus(profileResultHasArtifact(result), "artifact references listed", "no artifact references found");
@@ -695,6 +762,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
695
762
  if (text.includes("setup action")) {
696
763
  return profileReceiptSignalStatus(hasSetupReceipts, "setup receipts present", "setup receipts missing");
697
764
  }
765
+ if (text.includes("active") && (text.includes("route-local") || text.includes("route local")) && (text.includes("proof helper") || text.includes("proof api") || text.includes("proof state"))) {
766
+ return profileReceiptSignalStatus(
767
+ hasActiveRouteLocalProofReceipt,
768
+ "active route-local proof receipt present",
769
+ "active route-local proof receipt missing"
770
+ );
771
+ }
698
772
  if (text.includes("declared state contract")) {
699
773
  return profileReceiptSignalStatus(hasStateContract, "state contract metadata or receipts present", "state contract evidence missing");
700
774
  }
@@ -718,6 +792,34 @@ function profilePackReceiptStatus(result, metadata, receipt) {
718
792
  if (text.includes("invalid state")) {
719
793
  return profileReceiptSignalStatus(hasStateContract || hasInvalidStateReceipt, "invalid-state receipt present", "invalid-state receipt missing");
720
794
  }
795
+ if ((text.includes("loss") || text.includes("lost")) && text.includes("terminal")) {
796
+ return profileReceiptSignalStatus(
797
+ hasTerminalLossReceipt,
798
+ "terminal loss receipt present",
799
+ "terminal loss receipt missing"
800
+ );
801
+ }
802
+ if (text.includes("controlled") && text.includes("launch") && (text.includes("failure") || text.includes("failed") || text.includes("miss"))) {
803
+ return profileReceiptSignalStatus(
804
+ hasControlledFailureLaunchReceipt,
805
+ "controlled failure launch receipt present",
806
+ "controlled failure launch receipt missing"
807
+ );
808
+ }
809
+ if (text.includes("controlled") && text.includes("launch") && text.includes("success")) {
810
+ return profileReceiptSignalStatus(
811
+ hasControlledSuccessLaunchReceipt,
812
+ "controlled success launch receipt present",
813
+ "controlled success launch receipt missing"
814
+ );
815
+ }
816
+ if (text.includes("recovery action") || text.includes("recover action") || text.includes("try fix") || (text.includes("retry") || text.includes("repair")) && text.includes("action")) {
817
+ return profileReceiptSignalStatus(
818
+ visibleUiActionCount > 0 && hasRecoveredStateReceipt,
819
+ "visible recovery-action receipt present",
820
+ "visible recovery-action receipt missing"
821
+ );
822
+ }
721
823
  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")) {
722
824
  return profileReceiptSignalStatus(
723
825
  visibleUiActionCount > 0,
@@ -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.188",
3
+ "version": "0.7.190",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",