spec-controller 0.1.210 → 0.1.211

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.
Files changed (2) hide show
  1. package/dist/cli.js +1969 -1907
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -11351,6 +11351,10 @@ var init_attribution = __esm({
11351
11351
  });
11352
11352
 
11353
11353
  // ../core/dist/domain/scnTags.js
11354
+ function foreignCodeCarriersOf(error) {
11355
+ const [first, ...rest] = error.namedFeatureFiles;
11356
+ return first === void 0 ? { kind: "none" } : { kind: "carried", files: [first, ...rest] };
11357
+ }
11354
11358
  function hasScenarioCodeErrors(reconciliation) {
11355
11359
  return (reconciliation.scenarioCodeErrors ?? []).length > 0;
11356
11360
  }
@@ -28223,7 +28227,7 @@ var init_model = __esm({
28223
28227
  });
28224
28228
 
28225
28229
  // ../core/dist/render/messages.js
28226
- var QUALITY_CHECK_FAULT_MESSAGES, CoreMessage, SATISFIED, MISSING, DUPLICATE_SCN_CODE, CITED_WITH_NO_SCENARIO, CITING_NO_SCENARIO, RUNNERS_PLACE, IN_ITS_FILE, foreignOpening, aKind, recode, CORE_MESSAGES;
28230
+ var QUALITY_CHECK_FAULT_MESSAGES, CoreMessage, CoreError, SATISFIED, MISSING, DUPLICATE_SCN_CODE, CITED_WITH_NO_SCENARIO, CITING_NO_SCENARIO, RUNNERS_PLACE, IN_ITS_FILE, CORE_MESSAGES;
28227
28231
  var init_messages4 = __esm({
28228
28232
  "../core/dist/render/messages.js"() {
28229
28233
  "use strict";
@@ -28248,155 +28252,165 @@ var init_messages4 = __esm({
28248
28252
  CoreMessage2[CoreMessage2["ProvenanceToolVersion"] = 12] = "ProvenanceToolVersion";
28249
28253
  CoreMessage2[CoreMessage2["ErrorsInTheInputsHeading"] = 13] = "ErrorsInTheInputsHeading";
28250
28254
  CoreMessage2[CoreMessage2["ConfigurationNotReadHeading"] = 14] = "ConfigurationNotReadHeading";
28251
- CoreMessage2[CoreMessage2["ConfigurationNotReadIntro"] = 15] = "ConfigurationNotReadIntro";
28252
- CoreMessage2[CoreMessage2["ConfigurationWrongKind"] = 16] = "ConfigurationWrongKind";
28253
- CoreMessage2[CoreMessage2["ConfigurationUnknownKey"] = 17] = "ConfigurationUnknownKey";
28254
- CoreMessage2[CoreMessage2["RunIntegrityHeading"] = 18] = "RunIntegrityHeading";
28255
- CoreMessage2[CoreMessage2["OneProofNeverRan"] = 19] = "OneProofNeverRan";
28256
- CoreMessage2[CoreMessage2["ProofsNeverRan"] = 20] = "ProofsNeverRan";
28257
- CoreMessage2[CoreMessage2["RunUnsound"] = 21] = "RunUnsound";
28258
- CoreMessage2[CoreMessage2["BrokenEvidenceNotNamed"] = 22] = "BrokenEvidenceNotNamed";
28259
- CoreMessage2[CoreMessage2["BrokenEvidenceWhatBroke"] = 23] = "BrokenEvidenceWhatBroke";
28260
- CoreMessage2[CoreMessage2["BrokenEvidenceNoMessage"] = 24] = "BrokenEvidenceNoMessage";
28261
- CoreMessage2[CoreMessage2["ScenarioCodeErrorsHeading"] = 25] = "ScenarioCodeErrorsHeading";
28262
- CoreMessage2[CoreMessage2["OneScenarioCodeError"] = 26] = "OneScenarioCodeError";
28263
- CoreMessage2[CoreMessage2["ScenarioCodeErrorCount"] = 27] = "ScenarioCodeErrorCount";
28264
- CoreMessage2[CoreMessage2["ScenarioCodeErrorsFraming"] = 28] = "ScenarioCodeErrorsFraming";
28265
- CoreMessage2[CoreMessage2["SeveralScnCodesFraming"] = 29] = "SeveralScnCodesFraming";
28266
- CoreMessage2[CoreMessage2["MisfiledAndSeveralScnCodesFraming"] = 30] = "MisfiledAndSeveralScnCodesFraming";
28267
- CoreMessage2[CoreMessage2["DuplicateScnCodeNotListed"] = 31] = "DuplicateScnCodeNotListed";
28268
- CoreMessage2[CoreMessage2["FeatureFileNoun"] = 32] = "FeatureFileNoun";
28269
- CoreMessage2[CoreMessage2["FeatureCodeNoun"] = 33] = "FeatureCodeNoun";
28270
- CoreMessage2[CoreMessage2["NoFeatureFileJudged"] = 34] = "NoFeatureFileJudged";
28271
- CoreMessage2[CoreMessage2["ScenarioCodesCleanOver"] = 35] = "ScenarioCodesCleanOver";
28272
- CoreMessage2[CoreMessage2["CleanNoCodedScenario"] = 36] = "CleanNoCodedScenario";
28273
- CoreMessage2[CoreMessage2["CleanEachFileOwnCode"] = 37] = "CleanEachFileOwnCode";
28274
- CoreMessage2[CoreMessage2["CleanOthersNoFeatureCode"] = 38] = "CleanOthersNoFeatureCode";
28275
- CoreMessage2[CoreMessage2["ItPronoun"] = 39] = "ItPronoun";
28276
- CoreMessage2[CoreMessage2["ThemPronoun"] = 40] = "ThemPronoun";
28277
- CoreMessage2[CoreMessage2["HoldsVerb"] = 41] = "HoldsVerb";
28278
- CoreMessage2[CoreMessage2["HoldVerb"] = 42] = "HoldVerb";
28279
- CoreMessage2[CoreMessage2["DuplicateFeatureCode"] = 43] = "DuplicateFeatureCode";
28280
- CoreMessage2[CoreMessage2["ForeignScnCodeOneCarrier"] = 44] = "ForeignScnCodeOneCarrier";
28281
- CoreMessage2[CoreMessage2["ForeignScnCodeManyCarriers"] = 45] = "ForeignScnCodeManyCarriers";
28282
- CoreMessage2[CoreMessage2["ForeignScnCodeNoCarrier"] = 46] = "ForeignScnCodeNoCarrier";
28283
- CoreMessage2[CoreMessage2["NoFeatureCode"] = 47] = "NoFeatureCode";
28284
- CoreMessage2[CoreMessage2["ScenarioSeveralScnCodes"] = 48] = "ScenarioSeveralScnCodes";
28285
- CoreMessage2[CoreMessage2["SummaryViewsHeading"] = 49] = "SummaryViewsHeading";
28286
- CoreMessage2[CoreMessage2["RunVerdictHeading"] = 50] = "RunVerdictHeading";
28287
- CoreMessage2[CoreMessage2["VerdictExit"] = 51] = "VerdictExit";
28288
- CoreMessage2[CoreMessage2["ScenarioCodeErrorsHeadline"] = 52] = "ScenarioCodeErrorsHeadline";
28289
- CoreMessage2[CoreMessage2["ScenarioCodeErrorsGloss"] = 53] = "ScenarioCodeErrorsGloss";
28290
- CoreMessage2[CoreMessage2["SeveralScnCodesGloss"] = 54] = "SeveralScnCodesGloss";
28291
- CoreMessage2[CoreMessage2["MisfiledAndSeveralScnCodesGloss"] = 55] = "MisfiledAndSeveralScnCodesGloss";
28292
- CoreMessage2[CoreMessage2["AlsoOutOfBalance"] = 56] = "AlsoOutOfBalance";
28293
- CoreMessage2[CoreMessage2["OutOfBalanceHeadline"] = 57] = "OutOfBalanceHeadline";
28294
- CoreMessage2[CoreMessage2["OutOfBalanceGloss"] = 58] = "OutOfBalanceGloss";
28295
- CoreMessage2[CoreMessage2["UnsoundHeadline"] = 59] = "UnsoundHeadline";
28296
- CoreMessage2[CoreMessage2["UnsoundGloss"] = 60] = "UnsoundGloss";
28297
- CoreMessage2[CoreMessage2["PendingHeadline"] = 61] = "PendingHeadline";
28298
- CoreMessage2[CoreMessage2["PendingGloss"] = 62] = "PendingGloss";
28299
- CoreMessage2[CoreMessage2["BalancedHeadline"] = 63] = "BalancedHeadline";
28300
- CoreMessage2[CoreMessage2["BalancedGloss"] = 64] = "BalancedGloss";
28301
- CoreMessage2[CoreMessage2["NothingToReconcileHeadline"] = 65] = "NothingToReconcileHeadline";
28302
- CoreMessage2[CoreMessage2["NothingToReconcileGloss"] = 66] = "NothingToReconcileGloss";
28303
- CoreMessage2[CoreMessage2["PendingItemsOutstanding"] = 67] = "PendingItemsOutstanding";
28304
- CoreMessage2[CoreMessage2["EvidenceReconciliationHeading"] = 68] = "EvidenceReconciliationHeading";
28305
- CoreMessage2[CoreMessage2["EvidenceReconciliationClaimReconciliationTerm"] = 69] = "EvidenceReconciliationClaimReconciliationTerm";
28306
- CoreMessage2[CoreMessage2["EvidenceReconciliationReconciliationLineTerm"] = 70] = "EvidenceReconciliationReconciliationLineTerm";
28307
- CoreMessage2[CoreMessage2["EvidenceReconciliationEvidenceObligationTerm"] = 71] = "EvidenceReconciliationEvidenceObligationTerm";
28308
- CoreMessage2[CoreMessage2["EvidenceReconciliationEvidenceObservationTerm"] = 72] = "EvidenceReconciliationEvidenceObservationTerm";
28309
- CoreMessage2[CoreMessage2["SubjectColumn"] = 73] = "SubjectColumn";
28310
- CoreMessage2[CoreMessage2["TotalColumn"] = 74] = "TotalColumn";
28311
- CoreMessage2[CoreMessage2["BalancedColumn"] = 75] = "BalancedColumn";
28312
- CoreMessage2[CoreMessage2["OutOfBalanceColumn"] = 76] = "OutOfBalanceColumn";
28313
- CoreMessage2[CoreMessage2["DetailColumn"] = 77] = "DetailColumn";
28314
- CoreMessage2[CoreMessage2["ClaimReconciliationSubject"] = 78] = "ClaimReconciliationSubject";
28315
- CoreMessage2[CoreMessage2["ReconciliationLineSubject"] = 79] = "ReconciliationLineSubject";
28316
- CoreMessage2[CoreMessage2["PendingTally"] = 80] = "PendingTally";
28317
- CoreMessage2[CoreMessage2["EvidenceObservationsHeading"] = 81] = "EvidenceObservationsHeading";
28318
- CoreMessage2[CoreMessage2["EvidenceObservationsSum"] = 82] = "EvidenceObservationsSum";
28319
- CoreMessage2[CoreMessage2["EvidenceObservationsTableHeader"] = 83] = "EvidenceObservationsTableHeader";
28320
- CoreMessage2[CoreMessage2["FitnessRunner"] = 84] = "FitnessRunner";
28321
- CoreMessage2[CoreMessage2["FitnessCiStep"] = 85] = "FitnessCiStep";
28322
- CoreMessage2[CoreMessage2["RunnerLayerNamesNone"] = 86] = "RunnerLayerNamesNone";
28323
- CoreMessage2[CoreMessage2["RunnerLayerUnnamed"] = 87] = "RunnerLayerUnnamed";
28324
- CoreMessage2[CoreMessage2["NoStepCountedAsItsRunnerRunsIt"] = 88] = "NoStepCountedAsItsRunnerRunsIt";
28325
- CoreMessage2[CoreMessage2["RunnerKeyNotALayer"] = 89] = "RunnerKeyNotALayer";
28326
- CoreMessage2[CoreMessage2["ReconcilerStep"] = 90] = "ReconcilerStep";
28327
- CoreMessage2[CoreMessage2["ReconcilerReconciles"] = 91] = "ReconcilerReconciles";
28328
- CoreMessage2[CoreMessage2["ReconcilerRecords"] = 92] = "ReconcilerRecords";
28329
- CoreMessage2[CoreMessage2["StepExcluded"] = 93] = "StepExcluded";
28330
- CoreMessage2[CoreMessage2["NotChecksEntryMatchesNoStep"] = 94] = "NotChecksEntryMatchesNoStep";
28331
- CoreMessage2[CoreMessage2["NotChecksEntryNotAStepName"] = 95] = "NotChecksEntryNotAStepName";
28332
- CoreMessage2[CoreMessage2["StepAccountingHeading"] = 96] = "StepAccountingHeading";
28333
- CoreMessage2[CoreMessage2["StepAccountingTableHeader"] = 97] = "StepAccountingTableHeader";
28334
- CoreMessage2[CoreMessage2["StepAccountingTotal"] = 98] = "StepAccountingTotal";
28335
- CoreMessage2[CoreMessage2["StepAccountingRunnersLabel"] = 99] = "StepAccountingRunnersLabel";
28336
- CoreMessage2[CoreMessage2["StepAccountingReconcilerLabel"] = 100] = "StepAccountingReconcilerLabel";
28337
- CoreMessage2[CoreMessage2["StepAccountingExcludedLabel"] = 101] = "StepAccountingExcludedLabel";
28338
- CoreMessage2[CoreMessage2["StepAccountingNotAppliedLabel"] = 102] = "StepAccountingNotAppliedLabel";
28339
- CoreMessage2[CoreMessage2["StepAccountingNoWorkflowRead"] = 103] = "StepAccountingNoWorkflowRead";
28340
- CoreMessage2[CoreMessage2["StepAccountingPlumbingLabel"] = 104] = "StepAccountingPlumbingLabel";
28341
- CoreMessage2[CoreMessage2["StepAccountingCandidatesTerm"] = 105] = "StepAccountingCandidatesTerm";
28342
- CoreMessage2[CoreMessage2["StepAccountingReconcilerTerm"] = 106] = "StepAccountingReconcilerTerm";
28343
- CoreMessage2[CoreMessage2["StepAccountingExcludedTerm"] = 107] = "StepAccountingExcludedTerm";
28344
- CoreMessage2[CoreMessage2["StepAccountingPlumbingTerm"] = 108] = "StepAccountingPlumbingTerm";
28345
- CoreMessage2[CoreMessage2["StepAccountingAccountedForTerm"] = 109] = "StepAccountingAccountedForTerm";
28346
- CoreMessage2[CoreMessage2["OutOfBalanceByFeatureHeading"] = 110] = "OutOfBalanceByFeatureHeading";
28347
- CoreMessage2[CoreMessage2["ScenarioClaimReconciliationsOutOfBalance"] = 111] = "ScenarioClaimReconciliationsOutOfBalance";
28348
- CoreMessage2[CoreMessage2["GroupedByFeature"] = 112] = "GroupedByFeature";
28349
- CoreMessage2[CoreMessage2["NotGroupedByFeature"] = 113] = "NotGroupedByFeature";
28350
- CoreMessage2[CoreMessage2["PhantomClaimReconciliations"] = 114] = "PhantomClaimReconciliations";
28351
- CoreMessage2[CoreMessage2["UnnamedClaimReconciliations"] = 115] = "UnnamedClaimReconciliations";
28352
- CoreMessage2[CoreMessage2["AndJoiner"] = 116] = "AndJoiner";
28353
- CoreMessage2[CoreMessage2["ByFeatureTableHeader"] = 117] = "ByFeatureTableHeader";
28354
- CoreMessage2[CoreMessage2["NoScnCodeScenarios"] = 118] = "NoScnCodeScenarios";
28355
- CoreMessage2[CoreMessage2["ClaimReconciliationsHeading"] = 119] = "ClaimReconciliationsHeading";
28356
- CoreMessage2[CoreMessage2["ClaimReconciliationTally"] = 120] = "ClaimReconciliationTally";
28357
- CoreMessage2[CoreMessage2["PhantomClaimTally"] = 121] = "PhantomClaimTally";
28358
- CoreMessage2[CoreMessage2["UnnamedClaimTally"] = 122] = "UnnamedClaimTally";
28359
- CoreMessage2[CoreMessage2["ExcludedScnOccurrences"] = 123] = "ExcludedScnOccurrences";
28360
- CoreMessage2[CoreMessage2["UntaggedScenarios"] = 124] = "UntaggedScenarios";
28361
- CoreMessage2[CoreMessage2["SharedScnCodes"] = 125] = "SharedScnCodes";
28362
- CoreMessage2[CoreMessage2["SharedScnCodeScenario"] = 126] = "SharedScnCodeScenario";
28363
- CoreMessage2[CoreMessage2["ClaimColumn"] = 127] = "ClaimColumn";
28364
- CoreMessage2[CoreMessage2["VerdictColumn"] = 128] = "VerdictColumn";
28365
- CoreMessage2[CoreMessage2["ReconcilingItemsColumn"] = 129] = "ReconcilingItemsColumn";
28366
- CoreMessage2[CoreMessage2["CiStepsColumn"] = 130] = "CiStepsColumn";
28367
- CoreMessage2[CoreMessage2["EvidenceCellKey"] = 131] = "EvidenceCellKey";
28368
- CoreMessage2[CoreMessage2["WatermelonItemKey"] = 132] = "WatermelonItemKey";
28369
- CoreMessage2[CoreMessage2["PendingItem"] = 133] = "PendingItem";
28370
- CoreMessage2[CoreMessage2["PendingItemFor"] = 134] = "PendingItemFor";
28371
- CoreMessage2[CoreMessage2["CheckStepNoOutcome"] = 135] = "CheckStepNoOutcome";
28372
- CoreMessage2[CoreMessage2["CheckStepSkipped"] = 136] = "CheckStepSkipped";
28373
- CoreMessage2[CoreMessage2["CheckStepEnded"] = 137] = "CheckStepEnded";
28374
- CoreMessage2[CoreMessage2["AmbiguousNamedStep"] = 138] = "AmbiguousNamedStep";
28375
- CoreMessage2[CoreMessage2["AmbiguousUnnamedStep"] = 139] = "AmbiguousUnnamedStep";
28376
- CoreMessage2[CoreMessage2["ManifestKindList"] = 140] = "ManifestKindList";
28377
- CoreMessage2[CoreMessage2["ManifestKindObject"] = 141] = "ManifestKindObject";
28378
- CoreMessage2[CoreMessage2["ManifestKindString"] = 142] = "ManifestKindString";
28379
- CoreMessage2[CoreMessage2["ManifestKindStringOrNull"] = 143] = "ManifestKindStringOrNull";
28380
- CoreMessage2[CoreMessage2["ManifestKindOfType"] = 144] = "ManifestKindOfType";
28381
- CoreMessage2[CoreMessage2["OutcomeSatisfied"] = 145] = "OutcomeSatisfied";
28382
- CoreMessage2[CoreMessage2["OutcomeMissing"] = 146] = "OutcomeMissing";
28383
- CoreMessage2[CoreMessage2["OutcomeFailing"] = 147] = "OutcomeFailing";
28384
- CoreMessage2[CoreMessage2["OutcomeWatermelon"] = 148] = "OutcomeWatermelon";
28385
- CoreMessage2[CoreMessage2["OutcomeNoScnCode"] = 149] = "OutcomeNoScnCode";
28386
- CoreMessage2[CoreMessage2["OutcomeDuplicateScnCode"] = 150] = "OutcomeDuplicateScnCode";
28387
- CoreMessage2[CoreMessage2["OutcomeCitesUnknownScenario"] = 151] = "OutcomeCitesUnknownScenario";
28388
- CoreMessage2[CoreMessage2["OutcomeCitesNoScenario"] = 152] = "OutcomeCitesNoScenario";
28389
- CoreMessage2[CoreMessage2["OutcomeNoEvidenceObligation"] = 153] = "OutcomeNoEvidenceObligation";
28390
- CoreMessage2[CoreMessage2["OutcomeBroken"] = 154] = "OutcomeBroken";
28391
- CoreMessage2[CoreMessage2["OutcomeBothMissing"] = 155] = "OutcomeBothMissing";
28392
- CoreMessage2[CoreMessage2["ObservationPassed"] = 156] = "ObservationPassed";
28393
- CoreMessage2[CoreMessage2["ObservationFailed"] = 157] = "ObservationFailed";
28394
- CoreMessage2[CoreMessage2["UnnamedClaimGroupCounts"] = 158] = "UnnamedClaimGroupCounts";
28395
- CoreMessage2[CoreMessage2["UnnamedClaimCiSteps"] = 159] = "UnnamedClaimCiSteps";
28396
- CoreMessage2[CoreMessage2["UnnamedClaimFailedNames"] = 160] = "UnnamedClaimFailedNames";
28397
- CoreMessage2[CoreMessage2["SeveralScnCodes"] = 161] = "SeveralScnCodes";
28398
- CoreMessage2[CoreMessage2["SharedScnCode"] = 162] = "SharedScnCode";
28255
+ CoreMessage2[CoreMessage2["RunIntegrityHeading"] = 15] = "RunIntegrityHeading";
28256
+ CoreMessage2[CoreMessage2["OneProofNeverRan"] = 16] = "OneProofNeverRan";
28257
+ CoreMessage2[CoreMessage2["ProofsNeverRan"] = 17] = "ProofsNeverRan";
28258
+ CoreMessage2[CoreMessage2["RunUnsound"] = 18] = "RunUnsound";
28259
+ CoreMessage2[CoreMessage2["BrokenEvidenceNotNamed"] = 19] = "BrokenEvidenceNotNamed";
28260
+ CoreMessage2[CoreMessage2["BrokenEvidenceWhatBroke"] = 20] = "BrokenEvidenceWhatBroke";
28261
+ CoreMessage2[CoreMessage2["BrokenEvidenceNoMessage"] = 21] = "BrokenEvidenceNoMessage";
28262
+ CoreMessage2[CoreMessage2["ScenarioCodeErrorsHeading"] = 22] = "ScenarioCodeErrorsHeading";
28263
+ CoreMessage2[CoreMessage2["FeatureFileNoun"] = 23] = "FeatureFileNoun";
28264
+ CoreMessage2[CoreMessage2["FeatureCodeNoun"] = 24] = "FeatureCodeNoun";
28265
+ CoreMessage2[CoreMessage2["NoFeatureFileJudged"] = 25] = "NoFeatureFileJudged";
28266
+ CoreMessage2[CoreMessage2["ScenarioCodesCleanOver"] = 26] = "ScenarioCodesCleanOver";
28267
+ CoreMessage2[CoreMessage2["CleanNoCodedScenario"] = 27] = "CleanNoCodedScenario";
28268
+ CoreMessage2[CoreMessage2["CleanEachFileOwnCode"] = 28] = "CleanEachFileOwnCode";
28269
+ CoreMessage2[CoreMessage2["CleanOthersNoFeatureCode"] = 29] = "CleanOthersNoFeatureCode";
28270
+ CoreMessage2[CoreMessage2["ItPronoun"] = 30] = "ItPronoun";
28271
+ CoreMessage2[CoreMessage2["ThemPronoun"] = 31] = "ThemPronoun";
28272
+ CoreMessage2[CoreMessage2["HoldsVerb"] = 32] = "HoldsVerb";
28273
+ CoreMessage2[CoreMessage2["HoldVerb"] = 33] = "HoldVerb";
28274
+ CoreMessage2[CoreMessage2["SummaryViewsHeading"] = 34] = "SummaryViewsHeading";
28275
+ CoreMessage2[CoreMessage2["RunVerdictHeading"] = 35] = "RunVerdictHeading";
28276
+ CoreMessage2[CoreMessage2["VerdictExit"] = 36] = "VerdictExit";
28277
+ CoreMessage2[CoreMessage2["ScenarioCodeErrorsHeadline"] = 37] = "ScenarioCodeErrorsHeadline";
28278
+ CoreMessage2[CoreMessage2["ScenarioCodeErrorsGloss"] = 38] = "ScenarioCodeErrorsGloss";
28279
+ CoreMessage2[CoreMessage2["SeveralScnCodesGloss"] = 39] = "SeveralScnCodesGloss";
28280
+ CoreMessage2[CoreMessage2["MisfiledAndSeveralScnCodesGloss"] = 40] = "MisfiledAndSeveralScnCodesGloss";
28281
+ CoreMessage2[CoreMessage2["AlsoOutOfBalance"] = 41] = "AlsoOutOfBalance";
28282
+ CoreMessage2[CoreMessage2["OutOfBalanceHeadline"] = 42] = "OutOfBalanceHeadline";
28283
+ CoreMessage2[CoreMessage2["OutOfBalanceGloss"] = 43] = "OutOfBalanceGloss";
28284
+ CoreMessage2[CoreMessage2["UnsoundHeadline"] = 44] = "UnsoundHeadline";
28285
+ CoreMessage2[CoreMessage2["UnsoundGloss"] = 45] = "UnsoundGloss";
28286
+ CoreMessage2[CoreMessage2["PendingHeadline"] = 46] = "PendingHeadline";
28287
+ CoreMessage2[CoreMessage2["PendingGloss"] = 47] = "PendingGloss";
28288
+ CoreMessage2[CoreMessage2["BalancedHeadline"] = 48] = "BalancedHeadline";
28289
+ CoreMessage2[CoreMessage2["BalancedGloss"] = 49] = "BalancedGloss";
28290
+ CoreMessage2[CoreMessage2["NothingToReconcileHeadline"] = 50] = "NothingToReconcileHeadline";
28291
+ CoreMessage2[CoreMessage2["NothingToReconcileGloss"] = 51] = "NothingToReconcileGloss";
28292
+ CoreMessage2[CoreMessage2["PendingItemsOutstanding"] = 52] = "PendingItemsOutstanding";
28293
+ CoreMessage2[CoreMessage2["EvidenceReconciliationHeading"] = 53] = "EvidenceReconciliationHeading";
28294
+ CoreMessage2[CoreMessage2["EvidenceReconciliationClaimReconciliationTerm"] = 54] = "EvidenceReconciliationClaimReconciliationTerm";
28295
+ CoreMessage2[CoreMessage2["EvidenceReconciliationReconciliationLineTerm"] = 55] = "EvidenceReconciliationReconciliationLineTerm";
28296
+ CoreMessage2[CoreMessage2["EvidenceReconciliationEvidenceObligationTerm"] = 56] = "EvidenceReconciliationEvidenceObligationTerm";
28297
+ CoreMessage2[CoreMessage2["EvidenceReconciliationEvidenceObservationTerm"] = 57] = "EvidenceReconciliationEvidenceObservationTerm";
28298
+ CoreMessage2[CoreMessage2["SubjectColumn"] = 58] = "SubjectColumn";
28299
+ CoreMessage2[CoreMessage2["TotalColumn"] = 59] = "TotalColumn";
28300
+ CoreMessage2[CoreMessage2["BalancedColumn"] = 60] = "BalancedColumn";
28301
+ CoreMessage2[CoreMessage2["OutOfBalanceColumn"] = 61] = "OutOfBalanceColumn";
28302
+ CoreMessage2[CoreMessage2["DetailColumn"] = 62] = "DetailColumn";
28303
+ CoreMessage2[CoreMessage2["ClaimReconciliationSubject"] = 63] = "ClaimReconciliationSubject";
28304
+ CoreMessage2[CoreMessage2["ReconciliationLineSubject"] = 64] = "ReconciliationLineSubject";
28305
+ CoreMessage2[CoreMessage2["PendingTally"] = 65] = "PendingTally";
28306
+ CoreMessage2[CoreMessage2["EvidenceObservationsHeading"] = 66] = "EvidenceObservationsHeading";
28307
+ CoreMessage2[CoreMessage2["EvidenceObservationsSum"] = 67] = "EvidenceObservationsSum";
28308
+ CoreMessage2[CoreMessage2["EvidenceObservationsTableHeader"] = 68] = "EvidenceObservationsTableHeader";
28309
+ CoreMessage2[CoreMessage2["FitnessRunner"] = 69] = "FitnessRunner";
28310
+ CoreMessage2[CoreMessage2["FitnessCiStep"] = 70] = "FitnessCiStep";
28311
+ CoreMessage2[CoreMessage2["RunnerLayerNamesNone"] = 71] = "RunnerLayerNamesNone";
28312
+ CoreMessage2[CoreMessage2["RunnerLayerUnnamed"] = 72] = "RunnerLayerUnnamed";
28313
+ CoreMessage2[CoreMessage2["NoStepCountedAsItsRunnerRunsIt"] = 73] = "NoStepCountedAsItsRunnerRunsIt";
28314
+ CoreMessage2[CoreMessage2["ReconcilerStep"] = 74] = "ReconcilerStep";
28315
+ CoreMessage2[CoreMessage2["ReconcilerReconciles"] = 75] = "ReconcilerReconciles";
28316
+ CoreMessage2[CoreMessage2["ReconcilerRecords"] = 76] = "ReconcilerRecords";
28317
+ CoreMessage2[CoreMessage2["StepExcluded"] = 77] = "StepExcluded";
28318
+ CoreMessage2[CoreMessage2["StepAccountingHeading"] = 78] = "StepAccountingHeading";
28319
+ CoreMessage2[CoreMessage2["StepAccountingTableHeader"] = 79] = "StepAccountingTableHeader";
28320
+ CoreMessage2[CoreMessage2["StepAccountingTotal"] = 80] = "StepAccountingTotal";
28321
+ CoreMessage2[CoreMessage2["StepAccountingRunnersLabel"] = 81] = "StepAccountingRunnersLabel";
28322
+ CoreMessage2[CoreMessage2["StepAccountingReconcilerLabel"] = 82] = "StepAccountingReconcilerLabel";
28323
+ CoreMessage2[CoreMessage2["StepAccountingExcludedLabel"] = 83] = "StepAccountingExcludedLabel";
28324
+ CoreMessage2[CoreMessage2["StepAccountingNotAppliedLabel"] = 84] = "StepAccountingNotAppliedLabel";
28325
+ CoreMessage2[CoreMessage2["StepAccountingNoWorkflowRead"] = 85] = "StepAccountingNoWorkflowRead";
28326
+ CoreMessage2[CoreMessage2["StepAccountingPlumbingLabel"] = 86] = "StepAccountingPlumbingLabel";
28327
+ CoreMessage2[CoreMessage2["StepAccountingCandidatesTerm"] = 87] = "StepAccountingCandidatesTerm";
28328
+ CoreMessage2[CoreMessage2["StepAccountingReconcilerTerm"] = 88] = "StepAccountingReconcilerTerm";
28329
+ CoreMessage2[CoreMessage2["StepAccountingExcludedTerm"] = 89] = "StepAccountingExcludedTerm";
28330
+ CoreMessage2[CoreMessage2["StepAccountingPlumbingTerm"] = 90] = "StepAccountingPlumbingTerm";
28331
+ CoreMessage2[CoreMessage2["StepAccountingAccountedForTerm"] = 91] = "StepAccountingAccountedForTerm";
28332
+ CoreMessage2[CoreMessage2["OutOfBalanceByFeatureHeading"] = 92] = "OutOfBalanceByFeatureHeading";
28333
+ CoreMessage2[CoreMessage2["ScenarioClaimReconciliationsOutOfBalance"] = 93] = "ScenarioClaimReconciliationsOutOfBalance";
28334
+ CoreMessage2[CoreMessage2["GroupedByFeature"] = 94] = "GroupedByFeature";
28335
+ CoreMessage2[CoreMessage2["NotGroupedByFeature"] = 95] = "NotGroupedByFeature";
28336
+ CoreMessage2[CoreMessage2["PhantomClaimReconciliations"] = 96] = "PhantomClaimReconciliations";
28337
+ CoreMessage2[CoreMessage2["UnnamedClaimReconciliations"] = 97] = "UnnamedClaimReconciliations";
28338
+ CoreMessage2[CoreMessage2["AndJoiner"] = 98] = "AndJoiner";
28339
+ CoreMessage2[CoreMessage2["ByFeatureTableHeader"] = 99] = "ByFeatureTableHeader";
28340
+ CoreMessage2[CoreMessage2["NoScnCodeScenarios"] = 100] = "NoScnCodeScenarios";
28341
+ CoreMessage2[CoreMessage2["ClaimReconciliationsHeading"] = 101] = "ClaimReconciliationsHeading";
28342
+ CoreMessage2[CoreMessage2["ClaimReconciliationTally"] = 102] = "ClaimReconciliationTally";
28343
+ CoreMessage2[CoreMessage2["PhantomClaimTally"] = 103] = "PhantomClaimTally";
28344
+ CoreMessage2[CoreMessage2["UnnamedClaimTally"] = 104] = "UnnamedClaimTally";
28345
+ CoreMessage2[CoreMessage2["ExcludedScnOccurrences"] = 105] = "ExcludedScnOccurrences";
28346
+ CoreMessage2[CoreMessage2["UntaggedScenarios"] = 106] = "UntaggedScenarios";
28347
+ CoreMessage2[CoreMessage2["SharedScnCodes"] = 107] = "SharedScnCodes";
28348
+ CoreMessage2[CoreMessage2["SharedScnCodeScenario"] = 108] = "SharedScnCodeScenario";
28349
+ CoreMessage2[CoreMessage2["ClaimColumn"] = 109] = "ClaimColumn";
28350
+ CoreMessage2[CoreMessage2["VerdictColumn"] = 110] = "VerdictColumn";
28351
+ CoreMessage2[CoreMessage2["ReconcilingItemsColumn"] = 111] = "ReconcilingItemsColumn";
28352
+ CoreMessage2[CoreMessage2["CiStepsColumn"] = 112] = "CiStepsColumn";
28353
+ CoreMessage2[CoreMessage2["EvidenceCellKey"] = 113] = "EvidenceCellKey";
28354
+ CoreMessage2[CoreMessage2["WatermelonItemKey"] = 114] = "WatermelonItemKey";
28355
+ CoreMessage2[CoreMessage2["PendingItem"] = 115] = "PendingItem";
28356
+ CoreMessage2[CoreMessage2["PendingItemFor"] = 116] = "PendingItemFor";
28357
+ CoreMessage2[CoreMessage2["CheckStepNoOutcome"] = 117] = "CheckStepNoOutcome";
28358
+ CoreMessage2[CoreMessage2["CheckStepSkipped"] = 118] = "CheckStepSkipped";
28359
+ CoreMessage2[CoreMessage2["CheckStepEnded"] = 119] = "CheckStepEnded";
28360
+ CoreMessage2[CoreMessage2["AmbiguousNamedStep"] = 120] = "AmbiguousNamedStep";
28361
+ CoreMessage2[CoreMessage2["AmbiguousUnnamedStep"] = 121] = "AmbiguousUnnamedStep";
28362
+ CoreMessage2[CoreMessage2["OutcomeSatisfied"] = 122] = "OutcomeSatisfied";
28363
+ CoreMessage2[CoreMessage2["OutcomeMissing"] = 123] = "OutcomeMissing";
28364
+ CoreMessage2[CoreMessage2["OutcomeFailing"] = 124] = "OutcomeFailing";
28365
+ CoreMessage2[CoreMessage2["OutcomeWatermelon"] = 125] = "OutcomeWatermelon";
28366
+ CoreMessage2[CoreMessage2["OutcomeNoScnCode"] = 126] = "OutcomeNoScnCode";
28367
+ CoreMessage2[CoreMessage2["OutcomeDuplicateScnCode"] = 127] = "OutcomeDuplicateScnCode";
28368
+ CoreMessage2[CoreMessage2["OutcomeCitesUnknownScenario"] = 128] = "OutcomeCitesUnknownScenario";
28369
+ CoreMessage2[CoreMessage2["OutcomeCitesNoScenario"] = 129] = "OutcomeCitesNoScenario";
28370
+ CoreMessage2[CoreMessage2["OutcomeNoEvidenceObligation"] = 130] = "OutcomeNoEvidenceObligation";
28371
+ CoreMessage2[CoreMessage2["OutcomeBroken"] = 131] = "OutcomeBroken";
28372
+ CoreMessage2[CoreMessage2["OutcomeBothMissing"] = 132] = "OutcomeBothMissing";
28373
+ CoreMessage2[CoreMessage2["ObservationPassed"] = 133] = "ObservationPassed";
28374
+ CoreMessage2[CoreMessage2["ObservationFailed"] = 134] = "ObservationFailed";
28375
+ CoreMessage2[CoreMessage2["UnnamedClaimGroupCounts"] = 135] = "UnnamedClaimGroupCounts";
28376
+ CoreMessage2[CoreMessage2["UnnamedClaimCiSteps"] = 136] = "UnnamedClaimCiSteps";
28377
+ CoreMessage2[CoreMessage2["UnnamedClaimFailedNames"] = 137] = "UnnamedClaimFailedNames";
28378
+ CoreMessage2[CoreMessage2["SeveralScnCodes"] = 138] = "SeveralScnCodes";
28379
+ CoreMessage2[CoreMessage2["SharedScnCode"] = 139] = "SharedScnCode";
28380
+ CoreMessage2["ConfigurationNotReadIntro"] = "configuration-not-read-intro";
28381
+ CoreMessage2["ConfigurationWrongKind"] = "configuration-wrong-kind";
28382
+ CoreMessage2["ConfigurationUnknownKey"] = "configuration-unknown-key";
28383
+ CoreMessage2["OneScenarioCodeError"] = "one-scenario-code-error";
28384
+ CoreMessage2["ScenarioCodeErrorCount"] = "scenario-code-error-count";
28385
+ CoreMessage2["ScenarioCodeErrorsFraming"] = "scenario-code-errors-framing";
28386
+ CoreMessage2["SeveralScnCodesFraming"] = "several-scn-codes-framing";
28387
+ CoreMessage2["MisfiledAndSeveralScnCodesFraming"] = "misfiled-and-several-scn-codes-framing";
28388
+ CoreMessage2["DuplicateScnCodeNotListed"] = "duplicate-scn-code-not-listed";
28389
+ CoreMessage2["DuplicateFeatureCode"] = "duplicate-feature-code";
28390
+ CoreMessage2["ForeignScnCodeCarried"] = "foreign-scn-code-carried";
28391
+ CoreMessage2["ForeignScnCodeNoCarrier"] = "foreign-scn-code-no-carrier";
28392
+ CoreMessage2["NoFeatureCode"] = "no-feature-code";
28393
+ CoreMessage2["ScenarioSeveralScnCodes"] = "several-scn-codes";
28394
+ CoreMessage2["RunnerKeyNotALayer"] = "runner-key-not-a-layer";
28395
+ CoreMessage2["NotChecksEntryMatchesNoStep"] = "not-checks-entry-matches-no-step";
28396
+ CoreMessage2["NotChecksEntryNotAStepName"] = "not-checks-entry-not-a-step-name";
28397
+ CoreMessage2["ManifestKindList"] = "manifest-kind-list";
28398
+ CoreMessage2["ManifestKindObject"] = "manifest-kind-object";
28399
+ CoreMessage2["ManifestKindString"] = "manifest-kind-string";
28400
+ CoreMessage2["ManifestKindStringOrNull"] = "manifest-kind-string-or-null";
28401
+ CoreMessage2["ManifestKindOfType"] = "manifest-kind-of-type";
28399
28402
  })(CoreMessage || (CoreMessage = {}));
28403
+ (function(CoreError2) {
28404
+ CoreError2["ConfigurationWrongKind"] = "configuration-wrong-kind";
28405
+ CoreError2["ConfigurationUnknownKey"] = "configuration-unknown-key";
28406
+ CoreError2["RunnerKeyNotALayer"] = "runner-key-not-a-layer";
28407
+ CoreError2["NotChecksEntryMatchesNoStep"] = "not-checks-entry-matches-no-step";
28408
+ CoreError2["NotChecksEntryNotAStepName"] = "not-checks-entry-not-a-step-name";
28409
+ CoreError2["DuplicateFeatureCode"] = "duplicate-feature-code";
28410
+ CoreError2["ForeignScnCode"] = "foreign-scn-code";
28411
+ CoreError2["NoFeatureCode"] = "no-feature-code";
28412
+ CoreError2["SeveralScnCodes"] = "several-scn-codes";
28413
+ })(CoreError || (CoreError = {}));
28400
28414
  SATISFIED = "Evidence Observation satisfies its Evidence Obligation";
28401
28415
  MISSING = "Evidence Observation is missing";
28402
28416
  DUPLICATE_SCN_CODE = "Evidence Obligation's @SCN code is carried by another Scenario";
@@ -28404,9 +28418,6 @@ var init_messages4 = __esm({
28404
28418
  CITING_NO_SCENARIO = "evidence observations citing no scenario";
28405
28419
  RUNNERS_PLACE = "`specController.runners` in its `package.json`";
28406
28420
  IN_ITS_FILE = "every coded scenario sits in the file its code names";
28407
- foreignOpening = (file, featureCode, scnId, named) => `${file} carries the feature code @${featureCode}, but holds the scenario @${scnId}, whose feature part names ${named}. A reconciliation's by-feature cut groups on the id, so `;
28408
- aKind = (type) => `a ${type}`;
28409
- recode = (featureCode) => `Re-code the scenario for @${featureCode}`;
28410
28421
  CORE_MESSAGES = {
28411
28422
  [CoreMessage.ReportTitle]: "# Evidence Reconciliation",
28412
28423
  [CoreMessage.RunProvenanceHeading]: "## Run provenance",
@@ -28423,9 +28434,6 @@ var init_messages4 = __esm({
28423
28434
  [CoreMessage.ProvenanceToolVersion]: (version2) => `Tool version: ${version2}`,
28424
28435
  [CoreMessage.ErrorsInTheInputsHeading]: "## Errors in the inputs",
28425
28436
  [CoreMessage.ConfigurationNotReadHeading]: "### Configuration not read",
28426
- [CoreMessage.ConfigurationNotReadIntro]: "The target's package.json holds configuration this run could not use. Each line below says what this run did with its entry, and every account in this report is the one the target gives without it.",
28427
- [CoreMessage.ConfigurationWrongKind]: (entry, is, reads) => `${entry} is ${is} where ${reads} is read, so this run read it as absent.`,
28428
- [CoreMessage.ConfigurationUnknownKey]: (key) => `${key} is not a key the specController block reads, so this run read nothing from it.`,
28429
28437
  [CoreMessage.RunIntegrityHeading]: "## Run integrity: unsound",
28430
28438
  [CoreMessage.OneProofNeverRan]: "1 Evidence Observation never ran to a result, so the behaviour it proves was never exercised.",
28431
28439
  [CoreMessage.ProofsNeverRan]: (count) => `${count} Evidence Observations never ran to a result, so the behaviours they prove were never exercised.`,
@@ -28434,12 +28442,6 @@ var init_messages4 = __esm({
28434
28442
  [CoreMessage.BrokenEvidenceWhatBroke]: (locator) => `${locator} \u2014 what broke:`,
28435
28443
  [CoreMessage.BrokenEvidenceNoMessage]: "(no message reported by the runner)",
28436
28444
  [CoreMessage.ScenarioCodeErrorsHeading]: "### Scenario code errors",
28437
- [CoreMessage.OneScenarioCodeError]: "1 scenario code error",
28438
- [CoreMessage.ScenarioCodeErrorCount]: (count) => `${count} scenario code errors`,
28439
- [CoreMessage.ScenarioCodeErrorsFraming]: (count) => `${count} \u2014 each misfiles a scenario code, so the by-feature cut below cannot be trusted, and the run fails (exit 1). Every account still reconciles as it would if the code were filed correctly.`,
28440
- [CoreMessage.SeveralScnCodesFraming]: (count) => `${count} \u2014 each is a scenario carrying more than one scenario code, so no account was raised for it under any of them, and the run fails (exit 1).`,
28441
- [CoreMessage.MisfiledAndSeveralScnCodesFraming]: (count) => `${count} \u2014 each either misfiles a scenario code, so the by-feature cut below cannot be trusted, or is a scenario carrying more than one scenario code, so no account was raised for it under any of them. The run fails (exit 1).`,
28442
- [CoreMessage.DuplicateScnCodeNotListed]: `A duplicated @SCN code is not listed here: it is reported on its account's rows, as "${DUPLICATE_SCN_CODE}".`,
28443
28445
  [CoreMessage.FeatureFileNoun]: "feature file",
28444
28446
  [CoreMessage.FeatureCodeNoun]: "feature code",
28445
28447
  [CoreMessage.NoFeatureFileJudged]: "No feature file was judged, so no scenario code is vouched for.",
@@ -28451,12 +28453,6 @@ var init_messages4 = __esm({
28451
28453
  [CoreMessage.ThemPronoun]: "them",
28452
28454
  [CoreMessage.HoldsVerb]: "holds",
28453
28455
  [CoreMessage.HoldVerb]: "hold",
28454
- [CoreMessage.DuplicateFeatureCode]: (code, fileCount, files) => `the feature code @${code} is carried by ${fileCount} feature files \u2014 ${files}. A feature code names exactly one feature file: a reconciliation's by-feature cut groups on it, so two files sharing a code report as one row and attribute one file's scenarios to the other. Give one of them a code of its own.`,
28455
- [CoreMessage.ForeignScnCodeOneCarrier]: (file, featureCode, scnId, named, carrier) => `${foreignOpening(file, featureCode, scnId, named)}it counts this scenario under ${carrier}'s row, not ${file}'s. ${recode(featureCode)}, or move it to ${carrier}.`,
28456
- [CoreMessage.ForeignScnCodeManyCarriers]: (file, featureCode, scnId, named, carrierCount, carriers) => `${foreignOpening(file, featureCode, scnId, named)}it counts this scenario under the one row for ${named}, which ${carrierCount} feature files carry \u2014 ${carriers} \u2014 so that row cannot say which of them it belongs to. ${recode(featureCode)}, or move it once a single file carries ${named}.`,
28457
- [CoreMessage.ForeignScnCodeNoCarrier]: (file, featureCode, scnId, named) => `${foreignOpening(file, featureCode, scnId, named)}it opens a row for ${named}, which no feature file carries as its header code, so that row stands for no file. ${recode(featureCode)}.`,
28458
- [CoreMessage.NoFeatureCode]: (file) => `${file} carries no feature code, but its scenarios carry @SCN codes. A feature file is the class its scenarios' codes are filed under: give it a header code of its own, and code its scenarios for it.`,
28459
- [CoreMessage.ScenarioSeveralScnCodes]: (file, scenario, codes) => `${file}'s scenario "${scenario}" carries ${codes.length} @SCN codes \u2014 ${codes.join(", ")}. A scenario is one account, so it raises its evidence obligations under none of them, and a test citing any of them cites a code no scenario carries. Give it one code.`,
28460
28456
  [CoreMessage.SummaryViewsHeading]: "## Summary views",
28461
28457
  [CoreMessage.RunVerdictHeading]: "### Run verdict",
28462
28458
  [CoreMessage.VerdictExit]: (code) => `exit ${code}`,
@@ -28497,13 +28493,10 @@ var init_messages4 = __esm({
28497
28493
  [CoreMessage.RunnerLayerNamesNone]: `no runner: the target declares this layer has none, by setting it to \`null\` under ${RUNNERS_PLACE}.`,
28498
28494
  [CoreMessage.RunnerLayerUnnamed]: `unnamed: the target leaves this layer's runner undeclared: ${RUNNERS_PLACE} is missing or not a block, leaves the layer out, or gives it a value that is neither a string nor \`null\`. A string there names the layer's runner.`,
28499
28495
  [CoreMessage.NoStepCountedAsItsRunnerRunsIt]: "no step counted as its runner runs it.",
28500
- [CoreMessage.RunnerKeyNotALayer]: (key) => `${key} \u2014 not a layer: the runner block is keyed by the four layers, and this key excludes nothing.`,
28501
28496
  [CoreMessage.ReconcilerStep]: (step, whatItIs) => `${step} \u2014 the reconciler: ${whatItIs}.`,
28502
28497
  [CoreMessage.ReconcilerReconciles]: "this step runs the reconciliation this report is",
28503
28498
  [CoreMessage.ReconcilerRecords]: "this step writes the step record the reconciliation reads",
28504
28499
  [CoreMessage.StepExcluded]: (entry) => `${entry} \u2014 excluded: the target names this step a non-check.`,
28505
- [CoreMessage.NotChecksEntryMatchesNoStep]: (key, entry) => `${key} entry ${entry} matches no step of the workflows this run read, so it excludes nothing.`,
28506
- [CoreMessage.NotChecksEntryNotAStepName]: (key, entry) => `${key} entry ${entry} does not name a step as \`<workflow file>:<job id>:<step name>\`, so it excludes nothing.`,
28507
28500
  [CoreMessage.StepAccountingHeading]: "### Step accounting",
28508
28501
  [CoreMessage.StepAccountingTableHeader]: "| Workflow | Job | Steps read | Candidates | Runners | Reconciler | Excluded | GitHub plumbing | Accounted for |",
28509
28502
  [CoreMessage.StepAccountingTotal]: "Total",
@@ -28558,11 +28551,6 @@ var init_messages4 = __esm({
28558
28551
  [CoreMessage.CheckStepEnded]: (scnId, outcome) => `${scnId}: the CI run's record says this check's step ended \`${outcome}\` \u2014 so the check did not run.`,
28559
28552
  [CoreMessage.AmbiguousNamedStep]: (step) => `The step "${step}" is ambiguous \u2014 two or more step definitions match it, so the step never ran.`,
28560
28553
  [CoreMessage.AmbiguousUnnamedStep]: "A step is ambiguous \u2014 two or more step definitions match it, so the step never ran.",
28561
- [CoreMessage.ManifestKindList]: "a list",
28562
- [CoreMessage.ManifestKindObject]: "an object",
28563
- [CoreMessage.ManifestKindString]: aKind("string"),
28564
- [CoreMessage.ManifestKindStringOrNull]: "a string or null",
28565
- [CoreMessage.ManifestKindOfType]: aKind,
28566
28554
  [CoreMessage.OutcomeSatisfied]: SATISFIED,
28567
28555
  [CoreMessage.OutcomeMissing]: MISSING,
28568
28556
  [CoreMessage.OutcomeFailing]: "Evidence Observation is failing",
@@ -28739,886 +28727,104 @@ var init_runVerdict2 = __esm({
28739
28727
  }
28740
28728
  });
28741
28729
 
28742
- // ../core/dist/render/scenarioCodeErrorsSection.js
28743
- function scenarioCodeErrorsFraming(errors, count) {
28744
- switch (scenarioCodeErrorsAre(errors)) {
28745
- case "misfilings":
28746
- return CORE_MESSAGES[CoreMessage.ScenarioCodeErrorsFraming](count);
28747
- case "several-codes":
28748
- return CORE_MESSAGES[CoreMessage.SeveralScnCodesFraming](count);
28749
- case "both":
28750
- return CORE_MESSAGES[CoreMessage.MisfiledAndSeveralScnCodesFraming](count);
28730
+ // ../core/dist/render/messages.en.json
28731
+ var messages_en_default;
28732
+ var init_messages_en = __esm({
28733
+ "../core/dist/render/messages.en.json"() {
28734
+ messages_en_default = {
28735
+ "configuration-not-read-intro": "The target's package.json holds configuration this run could not use. Each line below says what this run did with its entry, and every account in this report is the one the target gives without it.",
28736
+ "configuration-wrong-kind": "{entry} is {is} where {reads} is read, so this run read it as absent.",
28737
+ "configuration-unknown-key": "{key} is not a key the specController block reads, so this run read nothing from it.",
28738
+ "runner-key-not-a-layer": "{key} \u2014 not a layer: the runner block is keyed by the four layers, and this key excludes nothing.",
28739
+ "not-checks-entry-matches-no-step": "{key} entry {entry} matches no step of the workflows this run read, so it excludes nothing.",
28740
+ "not-checks-entry-not-a-step-name": "{key} entry {entry} does not name a step as `<workflow file>:<job id>:<step name>`, so it excludes nothing.",
28741
+ "manifest-kind-list": "a list",
28742
+ "manifest-kind-object": "an object",
28743
+ "manifest-kind-string": "a string",
28744
+ "manifest-kind-string-or-null": "a string or null",
28745
+ "manifest-kind-of-type": "a {type}",
28746
+ "one-scenario-code-error": "1 scenario code error",
28747
+ "scenario-code-error-count": "{count} scenario code errors",
28748
+ "scenario-code-errors-framing": "{count} \u2014 each misfiles a scenario code, so the by-feature cut below cannot be trusted, and the run fails (exit 1). Every account still reconciles as it would if the code were filed correctly.",
28749
+ "several-scn-codes-framing": "{count} \u2014 each is a scenario carrying more than one scenario code, so no account was raised for it under any of them, and the run fails (exit 1).",
28750
+ "misfiled-and-several-scn-codes-framing": "{count} \u2014 each either misfiles a scenario code, so the by-feature cut below cannot be trusted, or is a scenario carrying more than one scenario code, so no account was raised for it under any of them. The run fails (exit 1).",
28751
+ "duplicate-scn-code-not-listed": `A duplicated @SCN code is not listed here: it is reported on its account's rows, as "{outcome}".`,
28752
+ "duplicate-feature-code": "the feature code @{code} is carried by {fileCount} feature files \u2014 {files}. A feature code names exactly one feature file: a reconciliation's by-feature cut groups on it, so two files sharing a code report as one row and attribute one file's scenarios to the other. Give one of them a code of its own.",
28753
+ "foreign-scn-code-carried": "{file} carries the feature code @{featureCode}, but holds the scenario @{scnId}, whose feature part names {named}. A reconciliation's by-feature cut groups on the id, so it counts this scenario under {carrierCount, plural, one {{carriers}'s row, not {file}'s. Re-code the scenario for @{featureCode}, or move it to {carriers}.} other {the one row for {named}, which {carrierCount} feature files carry \u2014 {carriers} \u2014 so that row cannot say which of them it belongs to. Re-code the scenario for @{featureCode}, or move it once a single file carries {named}.}}",
28754
+ "foreign-scn-code-no-carrier": "{file} carries the feature code @{featureCode}, but holds the scenario @{scnId}, whose feature part names {named}. A reconciliation's by-feature cut groups on the id, so it opens a row for {named}, which no feature file carries as its header code, so that row stands for no file. Re-code the scenario for @{featureCode}.",
28755
+ "no-feature-code": "{file} carries no feature code, but its scenarios carry @SCN codes. A feature file is the class its scenarios' codes are filed under: give it a header code of its own, and code its scenarios for it.",
28756
+ "several-scn-codes": `{file}'s scenario "{scenario}" carries {codeCount} @SCN codes \u2014 {codes}. A scenario is one account, so it raises its evidence obligations under none of them, and a test citing any of them cites a code no scenario carries. Give it one code.`
28757
+ };
28751
28758
  }
28759
+ });
28760
+
28761
+ // ../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.7/node_modules/@formatjs/fast-memoize/index.js
28762
+ function memoize(fn, options) {
28763
+ const cache = options && options.cache ? options.cache : cacheDefault;
28764
+ const serializer = options && options.serializer ? options.serializer : serializerDefault;
28765
+ return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
28766
+ cache,
28767
+ serializer
28768
+ });
28752
28769
  }
28753
- function counted(n, noun) {
28754
- return `${n} ${noun}${n === 1 ? "" : "s"}`;
28770
+ function isPrimitive(value) {
28771
+ return value == null || typeof value === "number" || typeof value === "boolean";
28755
28772
  }
28756
- function cleanStatement(featureFiles, featureCodes) {
28757
- const over = CORE_MESSAGES[CoreMessage.ScenarioCodesCleanOver](counted(featureFiles, CORE_MESSAGES[CoreMessage.FeatureFileNoun]), counted(featureCodes, CORE_MESSAGES[CoreMessage.FeatureCodeNoun]));
28758
- if (featureCodes === 0) {
28759
- const them = featureFiles === 1 ? CORE_MESSAGES[CoreMessage.ItPronoun] : CORE_MESSAGES[CoreMessage.ThemPronoun];
28760
- return CORE_MESSAGES[CoreMessage.CleanNoCodedScenario](over, them);
28773
+ function monadic(fn, cache, serializer, arg) {
28774
+ const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
28775
+ let computedValue = cache.get(cacheKey);
28776
+ if (typeof computedValue === "undefined") {
28777
+ computedValue = fn.call(this, arg);
28778
+ cache.set(cacheKey, computedValue);
28761
28779
  }
28762
- if (featureCodes === featureFiles)
28763
- return CORE_MESSAGES[CoreMessage.CleanEachFileOwnCode](over);
28764
- const noFeatureCode = featureFiles - featureCodes;
28765
- const hold = noFeatureCode === 1 ? CORE_MESSAGES[CoreMessage.HoldsVerb] : CORE_MESSAGES[CoreMessage.HoldVerb];
28766
- return CORE_MESSAGES[CoreMessage.CleanOthersNoFeatureCode](over, noFeatureCode, hold);
28780
+ return computedValue;
28767
28781
  }
28768
- function worded(error) {
28769
- if (error.kind === "duplicate-feature-code") {
28770
- return CORE_MESSAGES[CoreMessage.DuplicateFeatureCode](error.featureCode, error.files.length, error.files.join(", "));
28782
+ function variadic(fn, cache, serializer) {
28783
+ const args = Array.prototype.slice.call(arguments, 3);
28784
+ const cacheKey = serializer(args);
28785
+ let computedValue = cache.get(cacheKey);
28786
+ if (typeof computedValue === "undefined") {
28787
+ computedValue = fn.apply(this, args);
28788
+ cache.set(cacheKey, computedValue);
28771
28789
  }
28772
- if (error.kind === "foreign-scn-code")
28773
- return foreignWorded(error);
28774
- if (error.kind === "no-feature-code")
28775
- return CORE_MESSAGES[CoreMessage.NoFeatureCode](error.files.join(", "));
28776
- return CORE_MESSAGES[CoreMessage.ScenarioSeveralScnCodes](error.files.join(", "), error.scenario, error.codes);
28790
+ return computedValue;
28777
28791
  }
28778
- function foreignWorded(error) {
28779
- const file = error.files.join(", ");
28780
- const carriers = error.namedFeatureFiles;
28781
- if (carriers.length === 0) {
28782
- return CORE_MESSAGES[CoreMessage.ForeignScnCodeNoCarrier](file, error.featureCode, error.scnId, error.namedFeatureCode);
28783
- }
28784
- if (carriers.length === 1) {
28785
- return CORE_MESSAGES[CoreMessage.ForeignScnCodeOneCarrier](file, error.featureCode, error.scnId, error.namedFeatureCode, carriers[0]);
28786
- }
28787
- return CORE_MESSAGES[CoreMessage.ForeignScnCodeManyCarriers](file, error.featureCode, error.scnId, error.namedFeatureCode, carriers.length, carriers.join(", "));
28792
+ function assemble(fn, context, strategy, cache, serialize) {
28793
+ return strategy.bind(context, fn, cache, serialize);
28788
28794
  }
28789
- var scenarioCodeErrorsSection, scenarioCodesCleanStatement;
28790
- var init_scenarioCodeErrorsSection = __esm({
28791
- "../core/dist/render/scenarioCodeErrorsSection.js"() {
28792
- "use strict";
28793
- init_scnTags();
28794
- init_messages4();
28795
- scenarioCodeErrorsSection = (report) => {
28796
- const errors = report.errors?.scenarioCodes;
28797
- if (errors === void 0)
28798
- return [];
28799
- const count = errors.length === 1 ? CORE_MESSAGES[CoreMessage.OneScenarioCodeError] : CORE_MESSAGES[CoreMessage.ScenarioCodeErrorCount](errors.length);
28800
- return [
28801
- CORE_MESSAGES[CoreMessage.ScenarioCodeErrorsHeading],
28802
- "",
28803
- scenarioCodeErrorsFraming(errors, count),
28804
- "",
28805
- ...errors.map((error) => `- \`${error.kind}\` \u2014 ${worded(error)}`),
28806
- "",
28807
- CORE_MESSAGES[CoreMessage.DuplicateScnCodeNotListed],
28808
- ""
28809
- ];
28810
- };
28811
- scenarioCodesCleanStatement = (report) => {
28812
- if (report.errors?.scenarioCodes !== void 0)
28813
- return [];
28814
- const { featureFiles, featureCodes } = report.scenarioCodes ?? {};
28815
- if (featureFiles === void 0 || featureCodes === void 0)
28816
- return [];
28817
- if (featureFiles === 0)
28818
- return [CORE_MESSAGES[CoreMessage.NoFeatureFileJudged], ""];
28819
- return [cleanStatement(featureFiles, featureCodes), ""];
28820
- };
28821
- }
28822
- });
28823
-
28824
- // ../core/dist/render/provenanceFacts.js
28825
- function projectProvenanceObject(obj, inputNames) {
28826
- const inputs = [];
28827
- const absentInputs = [];
28828
- for (const { name, flag } of inputNames) {
28829
- const value = obj.inputs[name];
28830
- if (typeof value === "string") {
28831
- inputs.push({ flag, value });
28832
- } else {
28833
- absentInputs.push(flag);
28834
- }
28835
- }
28836
- return {
28837
- target: obj.target,
28838
- ...obj.targetOrigin !== void 0 ? { targetOrigin: obj.targetOrigin } : {},
28839
- inputs,
28840
- absentInputs,
28841
- runStartUtc: obj.runTimestamp,
28842
- sourceSha: obj.sourceSha,
28843
- toolSha: obj.toolSha,
28844
- toolVersion: obj.toolVersion
28845
- };
28795
+ function strategyDefault(fn, options) {
28796
+ const strategy = fn.length === 1 ? monadic : variadic;
28797
+ return assemble(fn, this, strategy, options.cache.create(), options.serializer);
28846
28798
  }
28847
- var init_provenanceFacts = __esm({
28848
- "../core/dist/render/provenanceFacts.js"() {
28849
- "use strict";
28850
- }
28851
- });
28852
-
28853
- // ../core/dist/render/provenanceSection.js
28854
- var provenanceSection;
28855
- var init_provenanceSection = __esm({
28856
- "../core/dist/render/provenanceSection.js"() {
28857
- "use strict";
28858
- init_provenanceFacts();
28859
- init_messages4();
28860
- provenanceSection = (report, inputNames) => {
28861
- const p = projectProvenanceObject(report.runProvenance, inputNames);
28862
- const lines = [CORE_MESSAGES[CoreMessage.RunProvenanceHeading], ""];
28863
- const targetRepo = p.targetOrigin === void 0 ? CORE_MESSAGES[CoreMessage.ProvenanceTargetRepo](p.target) : CORE_MESSAGES[CoreMessage.ProvenanceTargetRepoUntargeted](p.target, p.targetOrigin);
28864
- lines.push(`- ${targetRepo}`);
28865
- if (p.inputs.length === 0) {
28866
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceNoInputs]}`);
28867
- } else {
28868
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceInputs]}`);
28869
- for (const { flag, value } of p.inputs)
28870
- lines.push(` - \`${flag} ${value}\``);
28871
- }
28872
- if (p.absentInputs.length > 0)
28873
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceNotSupplied](p.absentInputs.map((flag) => `\`${flag}\``).join(", "))}`);
28874
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceRunTimestamp](p.runStartUtc)}`);
28875
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceSourceSha](p.sourceSha ?? CORE_MESSAGES[CoreMessage.ProvenanceSourceShaUnknown])}`);
28876
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceToolSha](p.toolSha ?? CORE_MESSAGES[CoreMessage.ProvenanceToolShaUnknown])}`);
28877
- lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceToolVersion](p.toolVersion)}`);
28878
- lines.push("");
28879
- return lines;
28880
- };
28881
- }
28882
- });
28883
-
28884
- // ../core/dist/render/configurationNotRead.js
28885
- function kindWords(kind) {
28886
- switch (kind) {
28887
- case "list":
28888
- return CORE_MESSAGES[CoreMessage.ManifestKindList];
28889
- case "object":
28890
- return CORE_MESSAGES[CoreMessage.ManifestKindObject];
28891
- case "string":
28892
- return CORE_MESSAGES[CoreMessage.ManifestKindString];
28893
- case "string-or-null":
28894
- return CORE_MESSAGES[CoreMessage.ManifestKindStringOrNull];
28895
- case "null":
28896
- return kind;
28897
- default:
28898
- return CORE_MESSAGES[CoreMessage.ManifestKindOfType](kind);
28899
- }
28799
+ function strategyVariadic(fn, options) {
28800
+ return assemble(fn, this, variadic, options.cache.create(), options.serializer);
28900
28801
  }
28901
- var configurationNotReadSection;
28902
- var init_configurationNotRead = __esm({
28903
- "../core/dist/render/configurationNotRead.js"() {
28904
- "use strict";
28905
- init_messages4();
28906
- init_codeSpan();
28907
- configurationNotReadSection = (report) => {
28908
- const wrongKinds = report.errors?.configuration?.ofWrongKind ?? [];
28909
- const unknownKeys = report.errors?.configuration?.keysNotRead ?? [];
28910
- const runnerKeysNotALayer = report.errors?.configuration?.runnerKeysNotALayer ?? [];
28911
- const nonChecksMatchingNoStep = report.errors?.configuration?.nonChecksMatchingNoStep ?? [];
28912
- const nonChecksNotAStepName = report.errors?.configuration?.nonChecksNotAStepName ?? [];
28913
- if (wrongKinds.length === 0 && unknownKeys.length === 0 && runnerKeysNotALayer.length === 0 && nonChecksMatchingNoStep.length === 0 && nonChecksNotAStepName.length === 0)
28914
- return [];
28915
- return [
28916
- CORE_MESSAGES[CoreMessage.ConfigurationNotReadHeading],
28917
- "",
28918
- CORE_MESSAGES[CoreMessage.ConfigurationNotReadIntro],
28919
- "",
28920
- ...wrongKinds.map(({ entry, is, reads }) => `- ${CORE_MESSAGES[CoreMessage.ConfigurationWrongKind](codeSpan(entry), kindWords(is), kindWords(reads))}`),
28921
- ...unknownKeys.map((key) => `- ${CORE_MESSAGES[CoreMessage.ConfigurationUnknownKey](codeSpan(`specController.${key}`))}`),
28922
- ...runnerKeysNotALayer.map((key) => `- ${CORE_MESSAGES[CoreMessage.RunnerKeyNotALayer](codeSpan(`specController.runners.${key}`))}`),
28923
- ...nonChecksMatchingNoStep.map((entry) => `- ${CORE_MESSAGES[CoreMessage.NotChecksEntryMatchesNoStep]("`specController.notChecks`", codeSpan(entry))}`),
28924
- ...nonChecksNotAStepName.map((entry) => `- ${CORE_MESSAGES[CoreMessage.NotChecksEntryNotAStepName]("`specController.notChecks`", codeSpan(entry))}`),
28925
- ""
28926
- ];
28802
+ function strategyMonadic(fn, options) {
28803
+ return assemble(fn, this, monadic, options.cache.create(), options.serializer);
28804
+ }
28805
+ var serializerDefault, ObjectWithoutPrototypeCache, cacheDefault, strategies;
28806
+ var init_fast_memoize = __esm({
28807
+ "../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.7/node_modules/@formatjs/fast-memoize/index.js"() {
28808
+ serializerDefault = function() {
28809
+ return JSON.stringify(arguments);
28927
28810
  };
28928
- }
28929
- });
28930
-
28931
- // ../core/dist/render/errorsInTheInputs.js
28932
- var errorsInTheInputsSection;
28933
- var init_errorsInTheInputs = __esm({
28934
- "../core/dist/render/errorsInTheInputs.js"() {
28935
- "use strict";
28936
- init_configurationNotRead();
28937
- init_scenarioCodeErrorsSection();
28938
- init_messages4();
28939
- errorsInTheInputsSection = (report) => {
28940
- const parts = [...scenarioCodeErrorsSection(report), ...configurationNotReadSection(report)];
28941
- if (parts.length === 0)
28942
- return [];
28943
- return [CORE_MESSAGES[CoreMessage.ErrorsInTheInputsHeading], "", ...parts];
28944
- };
28945
- }
28946
- });
28947
-
28948
- // ../core/dist/render/stepAccounting.js
28949
- var rowOf, jobRowsOf, totalRowOf, STEP_ACCOUNTING_TERMS, tableOf, WHAT_IT_IS, runnersListOf, reconcilerListOf, nonChecksListOf, workflowsReadOf, notAppliedListOf, plumbingListOf, stepAccountingSection;
28950
- var init_stepAccounting = __esm({
28951
- "../core/dist/render/stepAccounting.js"() {
28952
- "use strict";
28953
- init_uncitedFitnessFunctions();
28954
- init_messages4();
28955
- init_cellSafe();
28956
- init_codeSpan();
28957
- rowOf = (cells) => `| ${cells.join(" | ")} |`;
28958
- jobRowsOf = ({ byJob }) => byJob.map((row) => rowOf([
28959
- cellSafe(row.workflow),
28960
- cellSafe(row.job),
28961
- row.stepsRead,
28962
- row.candidates,
28963
- row.runners,
28964
- row.reconciler,
28965
- row.nonChecks,
28966
- row.plumbing,
28967
- accountedForOf(row)
28968
- ]));
28969
- totalRowOf = ({ byJob, total }) => {
28970
- if (byJob.length < 2)
28971
- return [];
28972
- const { stepsRead, candidates, runners, reconciler, nonChecks, plumbing } = total;
28973
- const counts = rowOf([stepsRead, candidates, runners, reconciler, nonChecks, plumbing, accountedForOf(total)]);
28974
- return [`| ${CORE_MESSAGES[CoreMessage.StepAccountingTotal]} | ${counts}`];
28975
- };
28976
- STEP_ACCOUNTING_TERMS = [
28977
- CoreMessage.StepAccountingCandidatesTerm,
28978
- CoreMessage.StepAccountingReconcilerTerm,
28979
- CoreMessage.StepAccountingExcludedTerm,
28980
- CoreMessage.StepAccountingPlumbingTerm,
28981
- CoreMessage.StepAccountingAccountedForTerm
28982
- ];
28983
- tableOf = (accounting) => {
28984
- if (accounting.byJob.length === 0)
28985
- return [];
28986
- return [
28987
- ...STEP_ACCOUNTING_TERMS.map((term) => `- ${CORE_MESSAGES[term]}`),
28988
- "",
28989
- CORE_MESSAGES[CoreMessage.StepAccountingTableHeader],
28990
- "| --- | --- | --- | --- | --- | --- | --- | --- | --- |",
28991
- ...jobRowsOf(accounting),
28992
- ...totalRowOf(accounting),
28993
- ""
28994
- ];
28995
- };
28996
- WHAT_IT_IS = {
28997
- reconciles: CORE_MESSAGES[CoreMessage.ReconcilerReconciles],
28998
- records: CORE_MESSAGES[CoreMessage.ReconcilerRecords]
28999
- };
29000
- runnersListOf = ({ steps }) => {
29001
- const runners = steps.runners ?? [];
29002
- if (runners.length === 0)
29003
- return [];
29004
- return [CORE_MESSAGES[CoreMessage.StepAccountingRunnersLabel], ...runners.map((step) => `- ${codeSpan(step)}`), ""];
29005
- };
29006
- reconcilerListOf = ({ steps }) => {
29007
- const reconciler = steps.reconciler ?? [];
29008
- if (reconciler.length === 0)
29009
- return [];
29010
- return [
29011
- CORE_MESSAGES[CoreMessage.StepAccountingReconcilerLabel],
29012
- ...reconciler.map(({ step, role }) => `- ${CORE_MESSAGES[CoreMessage.ReconcilerStep](codeSpan(step), WHAT_IT_IS[role])}`),
29013
- ""
29014
- ];
29015
- };
29016
- nonChecksListOf = ({ steps }) => {
29017
- const nonChecks = steps.nonChecks ?? [];
29018
- if (nonChecks.length === 0)
29019
- return [];
29020
- return [
29021
- CORE_MESSAGES[CoreMessage.StepAccountingExcludedLabel],
29022
- ...nonChecks.map((step) => `- ${CORE_MESSAGES[CoreMessage.StepExcluded](codeSpan(step))}`),
29023
- ""
29024
- ];
29025
- };
29026
- workflowsReadOf = ({ workflowsRead, byJob }) => {
29027
- const workflows = [...new Set(workflowsRead ?? byJob.map(({ workflow }) => workflow))];
29028
- if (workflows.length === 0)
29029
- return CORE_MESSAGES[CoreMessage.StepAccountingNoWorkflowRead];
29030
- return workflows.map((workflow) => codeSpan(workflow)).join(", ");
29031
- };
29032
- notAppliedListOf = (accounting) => {
29033
- const notApplied = accounting.nonChecksNamingAWorkflowNotRead;
29034
- if (notApplied === void 0)
29035
- return [];
29036
- return [
29037
- CORE_MESSAGES[CoreMessage.StepAccountingNotAppliedLabel]("`specController.notChecks`", workflowsReadOf(accounting)),
29038
- ...notApplied.map((entry) => `- ${codeSpan(entry)}`),
29039
- ""
29040
- ];
29041
- };
29042
- plumbingListOf = ({ steps }) => {
29043
- const plumbing = steps.plumbing ?? [];
29044
- if (plumbing.length === 0)
29045
- return [];
29046
- return [CORE_MESSAGES[CoreMessage.StepAccountingPlumbingLabel], ...plumbing.map((step) => `- ${codeSpan(step)}`), ""];
29047
- };
29048
- stepAccountingSection = (report) => {
29049
- const accounting = report.summary.stepAccounting;
29050
- if (accounting === void 0)
29051
- return [];
29052
- return [
29053
- CORE_MESSAGES[CoreMessage.StepAccountingHeading],
29054
- "",
29055
- ...tableOf(accounting),
29056
- ...runnersListOf(accounting),
29057
- ...reconcilerListOf(accounting),
29058
- ...nonChecksListOf(accounting),
29059
- ...notAppliedListOf(accounting),
29060
- ...plumbingListOf(accounting)
29061
- ];
29062
- };
29063
- }
29064
- });
29065
-
29066
- // ../core/dist/render/evidenceObservations.js
29067
- var runnerCells, evidenceObservationsSection;
29068
- var init_evidenceObservations = __esm({
29069
- "../core/dist/render/evidenceObservations.js"() {
29070
- "use strict";
29071
- init_messages4();
29072
- init_cellSafe();
29073
- init_reportedName();
29074
- runnerCells = ({ qualityCheckKind, count, runner, ciSteps }) => {
29075
- if (typeof runner === "string") {
29076
- return [
29077
- cellSafe(runner),
29078
- ciSteps ? cellSafeKeepingCodeSpans(ciSteps.map(reportedName).join(", ")) : CORE_MESSAGES[CoreMessage.NoStepCountedAsItsRunnerRunsIt]
29079
- ];
29080
- }
29081
- if (qualityCheckKind === "fitness") {
29082
- if (count === 0)
29083
- return ["", ""];
29084
- return [CORE_MESSAGES[CoreMessage.FitnessRunner], ciSteps ? CORE_MESSAGES[CoreMessage.FitnessCiStep](ciSteps.length) : ""];
29085
- }
29086
- if (runner === void 0)
29087
- return [CORE_MESSAGES[CoreMessage.RunnerLayerUnnamed], ""];
29088
- return [CORE_MESSAGES[CoreMessage.RunnerLayerNamesNone], ""];
29089
- };
29090
- evidenceObservationsSection = (report) => {
29091
- const observations = report.summary.evidenceObservations;
29092
- if (!observations)
29093
- return [];
29094
- const lines = [
29095
- CORE_MESSAGES[CoreMessage.EvidenceObservationsHeading],
29096
- "",
29097
- CORE_MESSAGES[CoreMessage.EvidenceObservationsSum](observations.total, observations.onScenario, observations.onPhantomClaim, observations.onUnnamedClaim),
29098
- "",
29099
- CORE_MESSAGES[CoreMessage.EvidenceObservationsTableHeader],
29100
- "| --- | --- | --- | --- |"
29101
- ];
29102
- for (const entry of observations.byQualityCheckKind) {
29103
- const [runner, ciSteps] = runnerCells(entry);
29104
- lines.push(`| ${entry.qualityCheckKind} | ${entry.count} | ${runner} | ${ciSteps} |`);
29105
- }
29106
- lines.push("");
29107
- return lines;
29108
- };
29109
- }
29110
- });
29111
-
29112
- // ../core/dist/render/evidenceGrid.js
29113
- function evidenceColumns(claims) {
29114
- const scenarioRows = claims.filter(isScenario);
29115
- return QUALITY_CHECK_KINDS.filter((qualityCheckKind) => scenarioRows.some((row) => carriesQualityCheckKind(row, qualityCheckKind)));
29116
- }
29117
- function columnHeader(qualityCheckKind) {
29118
- return qualityCheckKind.charAt(0).toUpperCase() + qualityCheckKind.slice(1);
29119
- }
29120
- function evidenceCell(s, qualityCheckKind) {
29121
- if (!isScenario(s))
29122
- return "\u2014";
29123
- const left = namesQualityCheckKind(s, qualityCheckKind) ? QUALITY_CHECK_KIND_LETTER[qualityCheckKind] : "-";
29124
- const observed = observationCountOf(s, qualityCheckKind);
29125
- const right = observed > 0 ? String(observed) : "-";
29126
- return left === "-" && right === "-" ? "" : `${left}/${right}`;
29127
- }
29128
- var QUALITY_CHECK_KIND_LETTER;
29129
- var init_evidenceGrid = __esm({
29130
- "../core/dist/render/evidenceGrid.js"() {
29131
- "use strict";
29132
- init_journal();
29133
- init_claimReconciliation();
29134
- QUALITY_CHECK_KIND_LETTER = {
29135
- fitness: "F",
29136
- unit: "U",
29137
- integration: "I",
29138
- e2e: "E",
29139
- performance: "P"
29140
- };
29141
- }
29142
- });
29143
-
29144
- // ../core/dist/render/remarkWords.js
29145
- function noteWords(note) {
29146
- switch (note.kind) {
29147
- case "several-scn-codes":
29148
- return CORE_MESSAGES[CoreMessage.SeveralScnCodes](note.codes);
29149
- case "shared-scn-code":
29150
- return CORE_MESSAGES[CoreMessage.SharedScnCode](note.code);
29151
- case "ambiguous-step":
29152
- return note.step === void 0 ? CORE_MESSAGES[CoreMessage.AmbiguousUnnamedStep] : CORE_MESSAGES[CoreMessage.AmbiguousNamedStep](note.step);
29153
- case "check-step-did-not-run":
29154
- return checkStepWords(note.code, note.outcome);
29155
- }
29156
- }
29157
- function checkStepWords(code, outcome) {
29158
- if (outcome === void 0)
29159
- return CORE_MESSAGES[CoreMessage.CheckStepNoOutcome](code);
29160
- if (outcome === "skipped")
29161
- return CORE_MESSAGES[CoreMessage.CheckStepSkipped](code);
29162
- return CORE_MESSAGES[CoreMessage.CheckStepEnded](code, outcome);
29163
- }
29164
- function remarkWordsOf({ message: message2, notes = [] }) {
29165
- const words2 = [...message2 === void 0 || message2.trim() === "" ? [] : [message2], ...notes.map(noteWords)];
29166
- return words2.length === 0 ? void 0 : words2.join(" ");
29167
- }
29168
- function remarkHeadlineOf({ message: message2, notes = [] }, quote) {
29169
- const headline = message2?.split("\n").map((line) => line.replace(/\s+/g, " ").trim()).find((line) => line.length > 0);
29170
- return remarkWordsOf({ ...headline === void 0 ? {} : { message: quote(headline) }, notes });
29171
- }
29172
- var init_remarkWords = __esm({
29173
- "../core/dist/render/remarkWords.js"() {
29174
- "use strict";
29175
- init_messages4();
29176
- }
29177
- });
29178
-
29179
- // ../core/dist/domain/unnamedClaimGroups.js
29180
- function citingNoScenario(lines) {
29181
- return lines.filter((line) => line.outcome === "cites-no-scenario").flatMap((line) => line.evidenceObservation ?? []);
29182
- }
29183
- function sharedScnCodeOf(observation) {
29184
- const [code = null] = (observation.notes ?? []).flatMap((note) => note.kind === "shared-scn-code" ? [note.code] : []);
29185
- return code;
29186
- }
29187
- function remarksOf(observations) {
29188
- return observations.flatMap(({ message: message2, notes = [] }) => {
29189
- const kept = notes.filter((note) => note.kind !== "shared-scn-code");
29190
- return message2 === void 0 && kept.length === 0 ? [] : [{ ...message2 !== void 0 ? { message: message2 } : {}, ...kept.length > 0 ? { notes: kept } : {} }];
29191
- });
29192
- }
29193
- function groupOf(sharedScnCode, observations) {
29194
- const [first] = observations;
29195
- const passed = observations.filter((o) => o.status === "passed").length;
29196
- return {
29197
- qualityCheckKind: first.qualityCheckKind,
29198
- locator: first.locator,
29199
- ...sharedScnCode === null ? {} : { sharedScnCode },
29200
- remarks: remarksOf(observations),
29201
- ran: observations.length,
29202
- passed,
29203
- failed: observations.length - passed,
29204
- failedNames: observations.flatMap((o) => o.status === "failed" && o.testName !== void 0 ? [o.testName] : [])
29205
- };
29206
- }
29207
- function stepsGroupsOf(observations) {
29208
- const byCode = /* @__PURE__ */ new Map();
29209
- for (const o of observations) {
29210
- if (!isFitnessObservation(o))
29211
- continue;
29212
- const code = sharedScnCodeOf(o);
29213
- byCode.set(code, [...byCode.get(code) ?? [], o.step ?? o.fitnessFunction]);
29214
- }
29215
- return [...byCode].map(([code, names]) => code === null ? { names } : { names, sharedScnCode: code });
29216
- }
29217
- function unnamedClaimGroupsOf(lines) {
29218
- const observations = citingNoScenario(lines);
29219
- const byFile = /* @__PURE__ */ new Map();
29220
- for (const o of observations) {
29221
- if (isFitnessObservation(o))
29222
- continue;
29223
- const code = sharedScnCodeOf(o);
29224
- const key = JSON.stringify([o.qualityCheckKind, o.locator ?? null, code]);
29225
- byFile.set(key, { code, members: [...byFile.get(key)?.members ?? [], o] });
29226
- }
29227
- return [...[...byFile.values()].map(({ code, members }) => groupOf(code, members)), ...stepsGroupsOf(observations)];
29228
- }
29229
- var init_unnamedClaimGroups = __esm({
29230
- "../core/dist/domain/unnamedClaimGroups.js"() {
29231
- "use strict";
29232
- init_journal();
29233
- }
29234
- });
29235
-
29236
- // ../core/dist/render/markdown.js
29237
- function renderLine(line) {
29238
- const sentence = `${OUTCOME_DESCRIPTION[line.outcome]}${scenarioClauseOf(line)}`;
29239
- if (line.outcome === "both-missing" || line.outcome === "no-scn-code" || line.qualityCheckKind === void 0) {
29240
- return sentence;
29241
- }
29242
- const head = `${line.qualityCheckKind}: ${sentence}`;
29243
- const observation = line.evidenceObservation;
29244
- if (observation === void 0)
29245
- return head;
29246
- if (!isObservationOnly(line.outcome))
29247
- return `${head}${namedSuffix(observation)}`;
29248
- return `${head}${line.outcome === "broken" ? brokenSuffix(observation) : observationSuffix(observation)}`;
29249
- }
29250
- function quotedSuffix(parts) {
29251
- const where = parts.flatMap((part) => part?.trim() || []).join(": ");
29252
- return where === "" ? "" : ` (${where})`;
29253
- }
29254
- function namedSuffix(o) {
29255
- return quotedSuffix((isFitnessObservation(o) ? [o.fitnessFunction] : [o.locator, o.testName]).map(reported));
29256
- }
29257
- function scenarioClauseOf({ scenario }) {
29258
- return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](reportedName(scenario.feature), reportedName(scenario.title))}`;
29259
- }
29260
- function brokenSuffix(o) {
29261
- return quotedSuffix([reported(o.locator), remarkHeadlineOf(o, reportedName)]);
29262
- }
29263
- function observationSuffix(o) {
29264
- return `${namedSuffix(o)}${resultOf(o)}`;
29265
- }
29266
- function resultOf(o) {
29267
- return o.status === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[RESULT_MESSAGE[o.status]]}`;
29268
- }
29269
- function renderPendingItem(item) {
29270
- return item.qualityCheckKind === void 0 ? CORE_MESSAGES[CoreMessage.PendingItem] : CORE_MESSAGES[CoreMessage.PendingItemFor](item.qualityCheckKind);
29271
- }
29272
- function renderFileGroup(group) {
29273
- const remarks = group.remarks.flatMap((remark) => remarkHeadlineOf(remark, reportedName) ?? []);
29274
- const code = group.sharedScnCode === void 0 ? [] : [CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)];
29275
- const said = [.../* @__PURE__ */ new Set([...code, ...remarks])].filter((part) => part !== "").join(" / ");
29276
- const counts = CORE_MESSAGES[CoreMessage.UnnamedClaimGroupCounts](group.ran, group.passed, group.failed);
29277
- const names = group.failedNames.map(reportedName).filter((name) => name !== "");
29278
- const failed = names.length === 0 ? "" : ` ${CORE_MESSAGES[CoreMessage.UnnamedClaimFailedNames](names)}`;
29279
- return `${group.qualityCheckKind}: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${quotedSuffix([reported(group.locator), said])} \u2014 ${counts}${failed}`;
29280
- }
29281
- function renderUnnamedClaimGroup(group) {
29282
- if (!("names" in group))
29283
- return renderFileGroup(group);
29284
- const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names.map(reportedName));
29285
- const remark = group.sharedScnCode === void 0 ? "" : ` (${CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)})`;
29286
- return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${remark} \u2014 ${steps}`;
29287
- }
29288
- function renderUnnamedClaimItems(lines) {
29289
- const broken = lines.filter((line) => line.outcome === "broken");
29290
- return [...broken.map(renderLine), ...unnamedClaimGroupsOf(lines).map(renderUnnamedClaimGroup)];
29291
- }
29292
- function renderRowExceptions(s) {
29293
- const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
29294
- const reconciling = items.map(cellSafeKeepingCodeSpans).join("; ");
29295
- const pending = s.pendingItems.map(renderPendingItem).join("; ");
29296
- const groups = [reconciling, pending].filter((g) => g.length > 0);
29297
- return groups.length === 0 ? "\u2014" : groups.join("; ");
29298
- }
29299
- function pendingTally(pending) {
29300
- return pending > 0 ? ["", CORE_MESSAGES[CoreMessage.PendingTally](pending)] : [];
29301
- }
29302
- function byFeatureTableLines(groups) {
29303
- if (groups.length === 0)
29304
- return [];
29305
- const lines = [CORE_MESSAGES[CoreMessage.ByFeatureTableHeader], "| --- | --- | --- |"];
29306
- for (const group of groups) {
29307
- const label = group.featureFile ? `${group.featureFile} (${group.feature})` : group.feature;
29308
- lines.push(`| ${label} | ${group.count} | ${idsCell(group)} |`);
29309
- }
29310
- lines.push("");
29311
- return lines;
29312
- }
29313
- function idsCell(group) {
29314
- const ids = group.claims.join(", ");
29315
- const noScnCodeCount = group.scenariosWithNoScnCode ?? 0;
29316
- if (noScnCodeCount === 0)
29317
- return ids;
29318
- const noScnCode = CORE_MESSAGES[CoreMessage.NoScnCodeScenarios](noScnCodeCount);
29319
- return ids === "" ? noScnCode : `${ids}${CORE_MESSAGES[CoreMessage.AndJoiner]}${noScnCode}`;
29320
- }
29321
- function ungroupedOutOfBalance(totals) {
29322
- return [
29323
- ...totals.phantomClaim > 0 ? [CORE_MESSAGES[CoreMessage.PhantomClaimReconciliations](totals.phantomClaim)] : [],
29324
- ...totals.unnamedClaim > 0 ? [CORE_MESSAGES[CoreMessage.UnnamedClaimReconciliations](totals.unnamedClaim)] : []
29325
- ];
29326
- }
29327
- function ungroupedTail(ungrouped) {
29328
- return ungrouped.length > 0 ? `; ${CORE_MESSAGES[CoreMessage.NotGroupedByFeature](ungrouped.join(CORE_MESSAGES[CoreMessage.AndJoiner]))}` : "";
29329
- }
29330
- function evidenceKeyLines(columns) {
29331
- if (columns.length === 0)
29332
- return [];
29333
- return [...CORE_MESSAGES[CoreMessage.EvidenceCellKey].split("\n"), CORE_MESSAGES[CoreMessage.WatermelonItemKey], ""];
29334
- }
29335
- function ledgerTallyLines(totals) {
29336
- const lines = [
29337
- `- ${CORE_MESSAGES[CoreMessage.ClaimReconciliationTally](totals.total, totals.balanced, totals.outOfBalance)}`
29338
- ];
29339
- if (totals.phantomClaim > 0) {
29340
- lines.push(`- ${CORE_MESSAGES[CoreMessage.PhantomClaimTally](totals.phantomClaim)}`);
29341
- }
29342
- if (totals.unnamedClaim > 0) {
29343
- lines.push(`- ${CORE_MESSAGES[CoreMessage.UnnamedClaimTally](totals.unnamedClaim)}`);
29344
- }
29345
- return lines;
29346
- }
29347
- function censusLines(codes, scenarios) {
29348
- if (codes?.excludedOccurrences === void 0)
29349
- return [];
29350
- const lines = [`- ${CORE_MESSAGES[CoreMessage.ExcludedScnOccurrences](codes.excludedOccurrences)}`];
29351
- const untagged = (codes.untaggedScenarios ?? []).length;
29352
- if (untagged > 0)
29353
- lines.push(`- ${CORE_MESSAGES[CoreMessage.UntaggedScenarios](untagged)}`);
29354
- lines.push(...sharedScnCodeLines(codes.sharedScnCodes ?? [], scenarios));
29355
- return lines;
29356
- }
29357
- function sharedScnCodeLines(shared, scenarios) {
29358
- if (shared.length === 0)
29359
- return [];
29360
- return [
29361
- `- ${CORE_MESSAGES[CoreMessage.SharedScnCodes](scenarios, shared.length)}`,
29362
- ...shared.map((code) => ` - ${code.scnId}: ${code.scenarios.map((s) => `${s.feature} : ${s.scenario}`).join("; ")}`)
29363
- ];
29364
- }
29365
- function ledgerTableLines(claims, columns, stepsByQualityCheckKind) {
29366
- const withSteps2 = columns.length > 0;
29367
- const headers = [
29368
- CORE_MESSAGES[CoreMessage.ClaimColumn],
29369
- ...columns.map(columnHeader),
29370
- CORE_MESSAGES[CoreMessage.VerdictColumn],
29371
- CORE_MESSAGES[CoreMessage.ReconcilingItemsColumn],
29372
- ...withSteps2 ? [CORE_MESSAGES[CoreMessage.CiStepsColumn]] : []
29373
- ];
29374
- const lines = [`| ${headers.join(" | ")} |`, `| ${headers.map(() => "---").join(" | ")} |`];
29375
- for (const s of claims) {
29376
- const cells = columns.map((col) => evidenceCell(s, col));
29377
- const items = renderRowExceptions(s);
29378
- const steps = withSteps2 ? [cellSafeKeepingCodeSpans(ciStepsOf(s, stepsByQualityCheckKind).map(reportedName).join(", "))] : [];
29379
- lines.push(`| ${[s.claim, ...cells, s.verdict, items, ...steps].join(" | ")} |`);
29380
- }
29381
- return lines;
29382
- }
29383
- function renderReport(report, inputNames, exitCodeOf2) {
29384
- return SECTIONS.flatMap((section) => section(report, inputNames, exitCodeOf2)).join("\n");
29385
- }
29386
- var reported, RESULT_MESSAGE, titleSection, runIntegritySection, summaryViewsSection, EVIDENCE_RECONCILIATION_COLUMNS, EVIDENCE_RECONCILIATION_TERMS, evidenceReconciliationSection, byFeatureSection, ledgerSection, SECTIONS;
29387
- var init_markdown = __esm({
29388
- "../core/dist/render/markdown.js"() {
29389
- "use strict";
29390
- init_model();
29391
- init_outcomeDescription();
29392
- init_cellSafe();
29393
- init_reportedName();
29394
- init_qualityCheckReconciliation();
29395
- init_journal();
29396
- init_ledger();
29397
- init_claimReconciliation();
29398
- init_ledger();
29399
- init_runVerdict2();
29400
- init_scenarioCodeErrorsSection();
29401
- init_provenanceSection();
29402
- init_errorsInTheInputs();
29403
- init_stepAccounting();
29404
- init_evidenceObservations();
29405
- init_evidenceGrid();
29406
- init_messages4();
29407
- init_remarkWords();
29408
- init_codeSpan();
29409
- init_unnamedClaimGroups();
29410
- reported = (part) => part === void 0 ? void 0 : reportedName(part);
29411
- RESULT_MESSAGE = {
29412
- passed: CoreMessage.ObservationPassed,
29413
- failed: CoreMessage.ObservationFailed
29414
- };
29415
- titleSection = () => [CORE_MESSAGES[CoreMessage.ReportTitle], ""];
29416
- runIntegritySection = (report) => {
29417
- if (!hasBrokenEvidence({ claimReconciliations: report.ledger.claimReconciliations }))
29418
- return [];
29419
- const brokenObservations = brokenItemsOf({
29420
- claimReconciliations: report.ledger.claimReconciliations
29421
- }).flatMap((line) => line.evidenceObservation ?? []);
29422
- const count = brokenObservations.length;
29423
- const proofs = count === 1 ? CORE_MESSAGES[CoreMessage.OneProofNeverRan] : CORE_MESSAGES[CoreMessage.ProofsNeverRan](count);
29424
- const lines = [
29425
- CORE_MESSAGES[CoreMessage.RunIntegrityHeading],
29426
- "",
29427
- CORE_MESSAGES[CoreMessage.RunUnsound](proofs),
29428
- ""
29429
- ];
29430
- for (const item of brokenObservations) {
29431
- const locator = item.locator?.trim() ? item.locator : CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
29432
- lines.push(`- ${CORE_MESSAGES[CoreMessage.BrokenEvidenceWhatBroke](`\`${locator}\``)}`);
29433
- lines.push("");
29434
- lines.push(...fencedBlockLines("text", remarkWordsOf(item) ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNoMessage]));
29435
- lines.push("");
29436
- }
29437
- return lines;
29438
- };
29439
- summaryViewsSection = () => [CORE_MESSAGES[CoreMessage.SummaryViewsHeading], ""];
29440
- EVIDENCE_RECONCILIATION_COLUMNS = [
29441
- CORE_MESSAGES[CoreMessage.SubjectColumn],
29442
- CORE_MESSAGES[CoreMessage.TotalColumn],
29443
- CORE_MESSAGES[CoreMessage.BalancedColumn],
29444
- CORE_MESSAGES[CoreMessage.OutOfBalanceColumn],
29445
- CORE_MESSAGES[CoreMessage.DetailColumn]
29446
- ];
29447
- EVIDENCE_RECONCILIATION_TERMS = [
29448
- CoreMessage.EvidenceReconciliationClaimReconciliationTerm,
29449
- CoreMessage.EvidenceReconciliationReconciliationLineTerm,
29450
- CoreMessage.EvidenceReconciliationEvidenceObligationTerm,
29451
- CoreMessage.EvidenceReconciliationEvidenceObservationTerm
29452
- ];
29453
- evidenceReconciliationSection = (report) => {
29454
- const { claimReconciliations, reconciliationLines, pending } = report.summary.evidenceReconciliation;
29455
- const row = (cells) => `| ${cells.join(" | ")} |`;
29456
- const missingSplit = reconciliationLines.missingByQualityCheckKind.map(({ subject, count }) => `${count} ${subject}`).join(" + ");
29457
- const lines = [
29458
- CORE_MESSAGES[CoreMessage.EvidenceReconciliationHeading],
29459
- "",
29460
- ...EVIDENCE_RECONCILIATION_TERMS.map((term) => `- ${CORE_MESSAGES[term]}`),
29461
- "",
29462
- row(EVIDENCE_RECONCILIATION_COLUMNS),
29463
- row(["---", "---", "---", "---", "---"]),
29464
- row([
29465
- CORE_MESSAGES[CoreMessage.ClaimReconciliationSubject],
29466
- String(claimReconciliations.total),
29467
- String(claimReconciliations.balanced),
29468
- String(claimReconciliations.outOfBalance),
29469
- ""
29470
- ]),
29471
- row([
29472
- CORE_MESSAGES[CoreMessage.ReconciliationLineSubject],
29473
- String(reconciliationLines.total),
29474
- String(reconciliationLines.byOutcome.satisfied),
29475
- String(reconciliationLines.outOfBalance),
29476
- ""
29477
- ])
29478
- ];
29479
- for (const outcome of OUT_OF_BALANCE_OUTCOMES) {
29480
- const detail = outcome === "missing" ? missingSplit : "";
29481
- lines.push(row([OUTCOME_DESCRIPTION[outcome], "", "", String(reconciliationLines.byOutcome[outcome]), detail]));
29482
- }
29483
- lines.push(...pendingTally(pending));
29484
- lines.push("");
29485
- return lines;
29486
- };
29487
- byFeatureSection = (report) => {
29488
- const rows = report.ledger.claimReconciliations;
29489
- const scenarios = rows.filter(isScenario);
29490
- const groups = report.summary.outOfBalanceByFeature ?? [];
29491
- const ungrouped = ungroupedOutOfBalance(report.summary.evidenceReconciliation.claimReconciliations);
29492
- if (groups.length === 0 && ungrouped.length === 0)
29493
- return [];
29494
- const head = CORE_MESSAGES[CoreMessage.ScenarioClaimReconciliationsOutOfBalance](outOfBalanceCountOf(scenarios), scenarios.length);
29495
- return [
29496
- CORE_MESSAGES[CoreMessage.OutOfBalanceByFeatureHeading],
29497
- "",
29498
- `${head}${groups.length > 0 ? CORE_MESSAGES[CoreMessage.GroupedByFeature] : ""}${ungroupedTail(ungrouped)}.`,
29499
- "",
29500
- ...byFeatureTableLines(groups)
29501
- ];
29502
- };
29503
- ledgerSection = (report) => {
29504
- const scenarioRows = report.ledger.claimReconciliations.filter(isScenario);
29505
- const phantomClaimRows2 = report.ledger.claimReconciliations.filter(isPhantomClaim);
29506
- const unnamedClaimRows2 = report.ledger.claimReconciliations.filter(isUnnamedClaim);
29507
- const claims = [...scenarioRows, ...phantomClaimRows2, ...unnamedClaimRows2];
29508
- const columns = report.summary.evidenceObservations !== void 0 ? evidenceColumns(claims) : [];
29509
- return [
29510
- CORE_MESSAGES[CoreMessage.ClaimReconciliationsHeading],
29511
- "",
29512
- ...ledgerTallyLines(report.summary.evidenceReconciliation.claimReconciliations),
29513
- ...censusLines(report.scenarioCodes, scenarioRows.length),
29514
- "",
29515
- ...evidenceKeyLines(columns),
29516
- ...ledgerTableLines(claims, columns, report.summary.evidenceObservations?.byQualityCheckKind ?? []),
29517
- ""
29518
- ];
29519
- };
29520
- SECTIONS = [
29521
- titleSection,
29522
- provenanceSection,
29523
- errorsInTheInputsSection,
29524
- runIntegritySection,
29525
- summaryViewsSection,
29526
- (report, _inputNames, exitCodeOf2) => runVerdictSection(report, exitCodeOf2),
29527
- scenarioCodesCleanStatement,
29528
- evidenceReconciliationSection,
29529
- evidenceObservationsSection,
29530
- stepAccountingSection,
29531
- byFeatureSection,
29532
- ledgerSection
29533
- ];
29534
- }
29535
- });
29536
-
29537
- // ../core/dist/assemble/composers.js
29538
- function renderMarkdown(evidenceReconciliation, ctx, exitCodeOf2, evidenceObligations2, featureNames) {
29539
- return renderReport(assembleRenderInput(evidenceReconciliation, ctx, evidenceObligations2, featureNames), ctx.inputs, exitCodeOf2);
29540
- }
29541
- function renderJson(evidenceReconciliation, ctx, evidenceObligations2, featureNames) {
29542
- return JSON.stringify(assembleRenderInput(evidenceReconciliation, ctx, evidenceObligations2, featureNames), null, 2);
29543
- }
29544
- var init_composers = __esm({
29545
- "../core/dist/assemble/composers.js"() {
29546
- "use strict";
29547
- init_renderInput2();
29548
- init_savedReport();
29549
- init_markdown();
29550
- init_provenanceFacts();
29551
- init_provenance();
29552
- }
29553
- });
29554
-
29555
- // ../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.7/node_modules/@formatjs/fast-memoize/index.js
29556
- function memoize(fn, options) {
29557
- const cache = options && options.cache ? options.cache : cacheDefault;
29558
- const serializer = options && options.serializer ? options.serializer : serializerDefault;
29559
- return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
29560
- cache,
29561
- serializer
29562
- });
29563
- }
29564
- function isPrimitive(value) {
29565
- return value == null || typeof value === "number" || typeof value === "boolean";
29566
- }
29567
- function monadic(fn, cache, serializer, arg) {
29568
- const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
29569
- let computedValue = cache.get(cacheKey);
29570
- if (typeof computedValue === "undefined") {
29571
- computedValue = fn.call(this, arg);
29572
- cache.set(cacheKey, computedValue);
29573
- }
29574
- return computedValue;
29575
- }
29576
- function variadic(fn, cache, serializer) {
29577
- const args = Array.prototype.slice.call(arguments, 3);
29578
- const cacheKey = serializer(args);
29579
- let computedValue = cache.get(cacheKey);
29580
- if (typeof computedValue === "undefined") {
29581
- computedValue = fn.apply(this, args);
29582
- cache.set(cacheKey, computedValue);
29583
- }
29584
- return computedValue;
29585
- }
29586
- function assemble(fn, context, strategy, cache, serialize) {
29587
- return strategy.bind(context, fn, cache, serialize);
29588
- }
29589
- function strategyDefault(fn, options) {
29590
- const strategy = fn.length === 1 ? monadic : variadic;
29591
- return assemble(fn, this, strategy, options.cache.create(), options.serializer);
29592
- }
29593
- function strategyVariadic(fn, options) {
29594
- return assemble(fn, this, variadic, options.cache.create(), options.serializer);
29595
- }
29596
- function strategyMonadic(fn, options) {
29597
- return assemble(fn, this, monadic, options.cache.create(), options.serializer);
29598
- }
29599
- var serializerDefault, ObjectWithoutPrototypeCache, cacheDefault, strategies;
29600
- var init_fast_memoize = __esm({
29601
- "../../node_modules/.pnpm/@formatjs+fast-memoize@3.1.7/node_modules/@formatjs/fast-memoize/index.js"() {
29602
- serializerDefault = function() {
29603
- return JSON.stringify(arguments);
29604
- };
29605
- ObjectWithoutPrototypeCache = class {
29606
- constructor() {
29607
- this.cache = /* @__PURE__ */ Object.create(null);
29608
- }
29609
- get(key) {
29610
- return this.cache[key];
29611
- }
29612
- set(key, value) {
29613
- this.cache[key] = value;
29614
- }
29615
- };
29616
- cacheDefault = { create: function create() {
29617
- return new ObjectWithoutPrototypeCache();
29618
- } };
29619
- strategies = {
29620
- variadic: strategyVariadic,
29621
- monadic: strategyMonadic
28811
+ ObjectWithoutPrototypeCache = class {
28812
+ constructor() {
28813
+ this.cache = /* @__PURE__ */ Object.create(null);
28814
+ }
28815
+ get(key) {
28816
+ return this.cache[key];
28817
+ }
28818
+ set(key, value) {
28819
+ this.cache[key] = value;
28820
+ }
28821
+ };
28822
+ cacheDefault = { create: function create() {
28823
+ return new ObjectWithoutPrototypeCache();
28824
+ } };
28825
+ strategies = {
28826
+ variadic: strategyVariadic,
28827
+ monadic: strategyMonadic
29622
28828
  };
29623
28829
  }
29624
28830
  });
@@ -31398,945 +30604,1800 @@ var init_icu_messageformat_parser = __esm({
31398
30604
  line: 1,
31399
30605
  column: 1
31400
30606
  };
31401
- this.ignoreTag = !!options.ignoreTag;
31402
- this.locale = options.locale;
31403
- this.requiresOtherClause = !!options.requiresOtherClause;
31404
- this.shouldParseSkeletons = !!options.shouldParseSkeletons;
30607
+ this.ignoreTag = !!options.ignoreTag;
30608
+ this.locale = options.locale;
30609
+ this.requiresOtherClause = !!options.requiresOtherClause;
30610
+ this.shouldParseSkeletons = !!options.shouldParseSkeletons;
30611
+ }
30612
+ parse() {
30613
+ if (this.offset() !== 0) throw Error("parser can only be used once");
30614
+ if (this.message.length > 0) {
30615
+ const firstCode = this.message.charCodeAt(0);
30616
+ if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) {
30617
+ const plainEndPosition = plainTopLevelEndPosition(this.message);
30618
+ if (plainEndPosition) {
30619
+ const start = this.clonePosition();
30620
+ this.position = plainEndPosition;
30621
+ return {
30622
+ val: [{
30623
+ type: 0,
30624
+ value: this.message,
30625
+ location: createLocation(start, this.clonePosition())
30626
+ }],
30627
+ err: null
30628
+ };
30629
+ }
30630
+ }
30631
+ }
30632
+ return this.parseMessage(0, "", false);
30633
+ }
30634
+ parseMessage(nestingLevel, parentArgType, expectingCloseTag) {
30635
+ let elements = [];
30636
+ while (!this.isEOF()) {
30637
+ const char = this.char();
30638
+ if (char === 123) {
30639
+ const result = this.parseArgument(nestingLevel, expectingCloseTag);
30640
+ if (result.err) return result;
30641
+ elements.push(result.val);
30642
+ } else if (char === 125 && nestingLevel > 0) break;
30643
+ else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
30644
+ const position = this.clonePosition();
30645
+ this.bump();
30646
+ elements.push({
30647
+ type: 7,
30648
+ location: createLocation(position, this.clonePosition())
30649
+ });
30650
+ } else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
30651
+ if (expectingCloseTag) break;
30652
+ else return this.error(26, createLocation(this.clonePosition(), this.clonePosition()));
30653
+ } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
30654
+ const result = this.parseTag(nestingLevel, parentArgType);
30655
+ if (result.err) return result;
30656
+ elements.push(result.val);
30657
+ } else {
30658
+ const result = this.parseLiteral(nestingLevel, parentArgType);
30659
+ if (result.err) return result;
30660
+ elements.push(result.val);
30661
+ }
30662
+ }
30663
+ return {
30664
+ val: elements,
30665
+ err: null
30666
+ };
30667
+ }
30668
+ /**
30669
+ * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
30670
+ * [custom element name][] except that a dash is NOT always mandatory and uppercase letters
30671
+ * are accepted:
30672
+ *
30673
+ * ```
30674
+ * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
30675
+ * tagName ::= [a-z] (PENChar)*
30676
+ * PENChar ::=
30677
+ * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
30678
+ * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
30679
+ * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
30680
+ * ```
30681
+ *
30682
+ * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
30683
+ * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
30684
+ * since other tag-based engines like React allow it
30685
+ */
30686
+ parseTag(nestingLevel, parentArgType) {
30687
+ const startPosition = this.clonePosition();
30688
+ this.bump();
30689
+ const tagName = this.parseTagName();
30690
+ this.bumpSpace();
30691
+ if (this.bumpIf("/>")) return {
30692
+ val: {
30693
+ type: 0,
30694
+ value: `<${tagName}/>`,
30695
+ location: createLocation(startPosition, this.clonePosition())
30696
+ },
30697
+ err: null
30698
+ };
30699
+ else if (this.bumpIf(">")) {
30700
+ const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
30701
+ if (childrenResult.err) return childrenResult;
30702
+ const children = childrenResult.val;
30703
+ const endTagStartPosition = this.clonePosition();
30704
+ if (this.bumpIf("</")) {
30705
+ if (this.isEOF() || !_isAlpha(this.char())) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
30706
+ const closingTagNameStartPosition = this.clonePosition();
30707
+ if (tagName !== this.parseTagName()) return this.error(26, createLocation(closingTagNameStartPosition, this.clonePosition()));
30708
+ this.bumpSpace();
30709
+ if (!this.bumpIf(">")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
30710
+ return {
30711
+ val: {
30712
+ type: 8,
30713
+ value: tagName,
30714
+ children,
30715
+ location: createLocation(startPosition, this.clonePosition())
30716
+ },
30717
+ err: null
30718
+ };
30719
+ } else return this.error(27, createLocation(startPosition, this.clonePosition()));
30720
+ } else return this.error(23, createLocation(startPosition, this.clonePosition()));
30721
+ }
30722
+ /**
30723
+ * This method assumes that the caller has peeked ahead for the first tag character.
30724
+ */
30725
+ parseTagName() {
30726
+ const startOffset = this.offset();
30727
+ this.bump();
30728
+ while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump();
30729
+ return this.message.slice(startOffset, this.offset());
30730
+ }
30731
+ parseLiteral(nestingLevel, parentArgType) {
30732
+ const start = this.clonePosition();
30733
+ let value = "";
30734
+ while (true) {
30735
+ const parseQuoteResult = this.tryParseQuote(parentArgType);
30736
+ if (parseQuoteResult) {
30737
+ value += parseQuoteResult;
30738
+ continue;
30739
+ }
30740
+ const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
30741
+ if (parseUnquotedResult) {
30742
+ value += parseUnquotedResult;
30743
+ continue;
30744
+ }
30745
+ const parseLeftAngleResult = this.tryParseLeftAngleBracket();
30746
+ if (parseLeftAngleResult) {
30747
+ value += parseLeftAngleResult;
30748
+ continue;
30749
+ }
30750
+ break;
30751
+ }
30752
+ const location = createLocation(start, this.clonePosition());
30753
+ return {
30754
+ val: {
30755
+ type: 0,
30756
+ value,
30757
+ location
30758
+ },
30759
+ err: null
30760
+ };
30761
+ }
30762
+ tryParseLeftAngleBracket() {
30763
+ if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
30764
+ this.bump();
30765
+ return "<";
30766
+ }
30767
+ return null;
30768
+ }
30769
+ /**
30770
+ * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
30771
+ * a character that requires quoting (that is, "only where needed"), and works the same in
30772
+ * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
30773
+ */
30774
+ tryParseQuote(parentArgType) {
30775
+ if (this.isEOF() || this.char() !== 39) return null;
30776
+ switch (this.peek()) {
30777
+ case 39:
30778
+ this.bump();
30779
+ this.bump();
30780
+ return "'";
30781
+ case 123:
30782
+ case 60:
30783
+ case 62:
30784
+ case 125:
30785
+ break;
30786
+ case 35:
30787
+ if (parentArgType === "plural" || parentArgType === "selectordinal") break;
30788
+ return null;
30789
+ default:
30790
+ return null;
30791
+ }
30792
+ this.bump();
30793
+ const codePoints = [this.char()];
30794
+ this.bump();
30795
+ while (!this.isEOF()) {
30796
+ const ch = this.char();
30797
+ if (ch === 39) {
30798
+ if (this.peek() === 39) {
30799
+ codePoints.push(39);
30800
+ this.bump();
30801
+ } else {
30802
+ this.bump();
30803
+ break;
30804
+ }
30805
+ } else codePoints.push(ch);
30806
+ this.bump();
30807
+ }
30808
+ return String.fromCodePoint(...codePoints);
30809
+ }
30810
+ tryParseUnquoted(nestingLevel, parentArgType) {
30811
+ if (this.isEOF()) return null;
30812
+ const ch = this.char();
30813
+ if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null;
30814
+ else {
30815
+ this.bump();
30816
+ return String.fromCodePoint(ch);
30817
+ }
30818
+ }
30819
+ parseArgument(nestingLevel, expectingCloseTag) {
30820
+ const openingBracePosition = this.clonePosition();
30821
+ this.bump();
30822
+ this.bumpSpace();
30823
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
30824
+ if (this.char() === 125) {
30825
+ this.bump();
30826
+ return this.error(2, createLocation(openingBracePosition, this.clonePosition()));
30827
+ }
30828
+ let value = this.parseIdentifierIfPossible().value;
30829
+ if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
30830
+ this.bumpSpace();
30831
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
30832
+ switch (this.char()) {
30833
+ case 125:
30834
+ this.bump();
30835
+ return {
30836
+ val: {
30837
+ type: 1,
30838
+ value,
30839
+ location: createLocation(openingBracePosition, this.clonePosition())
30840
+ },
30841
+ err: null
30842
+ };
30843
+ case 44:
30844
+ this.bump();
30845
+ this.bumpSpace();
30846
+ if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
30847
+ return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
30848
+ default:
30849
+ return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
30850
+ }
30851
+ }
30852
+ /**
30853
+ * Advance the parser until the end of the identifier, if it is currently on
30854
+ * an identifier character. Return an empty string otherwise.
30855
+ */
30856
+ parseIdentifierIfPossible() {
30857
+ const startingPosition = this.clonePosition();
30858
+ const startOffset = this.offset();
30859
+ const value = matchIdentifierAtIndex(this.message, startOffset);
30860
+ const endOffset = startOffset + value.length;
30861
+ this.bumpTo(endOffset);
30862
+ return {
30863
+ value,
30864
+ location: createLocation(startingPosition, this.clonePosition())
30865
+ };
31405
30866
  }
31406
- parse() {
31407
- if (this.offset() !== 0) throw Error("parser can only be used once");
31408
- if (this.message.length > 0) {
31409
- const firstCode = this.message.charCodeAt(0);
31410
- if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) {
31411
- const plainEndPosition = plainTopLevelEndPosition(this.message);
31412
- if (plainEndPosition) {
31413
- const start = this.clonePosition();
31414
- this.position = plainEndPosition;
31415
- return {
31416
- val: [{
31417
- type: 0,
31418
- value: this.message,
31419
- location: createLocation(start, this.clonePosition())
31420
- }],
31421
- err: null
30867
+ parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) {
30868
+ let typeStartPosition = this.clonePosition();
30869
+ let argType = this.parseIdentifierIfPossible().value;
30870
+ let typeEndPosition = this.clonePosition();
30871
+ switch (argType) {
30872
+ case "":
30873
+ return this.error(4, createLocation(typeStartPosition, typeEndPosition));
30874
+ case "number":
30875
+ case "date":
30876
+ case "time": {
30877
+ this.bumpSpace();
30878
+ let styleAndLocation = null;
30879
+ if (this.bumpIf(",")) {
30880
+ this.bumpSpace();
30881
+ const styleStartPosition = this.clonePosition();
30882
+ const result = this.parseSimpleArgStyleIfPossible();
30883
+ if (result.err) return result;
30884
+ const style = trimEnd2(result.val);
30885
+ if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition()));
30886
+ styleAndLocation = {
30887
+ style,
30888
+ styleLocation: createLocation(styleStartPosition, this.clonePosition())
31422
30889
  };
31423
30890
  }
30891
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
30892
+ if (argCloseResult.err) return argCloseResult;
30893
+ const location = createLocation(openingBracePosition, this.clonePosition());
30894
+ if (styleAndLocation && styleAndLocation.style.startsWith("::")) {
30895
+ let skeleton = trimStart(styleAndLocation.style.slice(2));
30896
+ if (argType === "number") {
30897
+ const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
30898
+ if (result.err) return result;
30899
+ return {
30900
+ val: {
30901
+ type: 2,
30902
+ value,
30903
+ location,
30904
+ style: result.val
30905
+ },
30906
+ err: null
30907
+ };
30908
+ } else {
30909
+ if (skeleton.length === 0) return this.error(10, location);
30910
+ let dateTimePattern = skeleton;
30911
+ if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale);
30912
+ const style = {
30913
+ type: 1,
30914
+ pattern: dateTimePattern,
30915
+ location: styleAndLocation.styleLocation,
30916
+ parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
30917
+ };
30918
+ return {
30919
+ val: {
30920
+ type: argType === "date" ? 3 : 4,
30921
+ value,
30922
+ location,
30923
+ style
30924
+ },
30925
+ err: null
30926
+ };
30927
+ }
30928
+ }
30929
+ return {
30930
+ val: {
30931
+ type: argType === "number" ? 2 : argType === "date" ? 3 : 4,
30932
+ value,
30933
+ location,
30934
+ style: styleAndLocation?.style ?? null
30935
+ },
30936
+ err: null
30937
+ };
30938
+ }
30939
+ case "plural":
30940
+ case "selectordinal":
30941
+ case "select": {
30942
+ const typeEndPosition2 = this.clonePosition();
30943
+ this.bumpSpace();
30944
+ if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition2, { ...typeEndPosition2 }));
30945
+ this.bumpSpace();
30946
+ let identifierAndLocation = this.parseIdentifierIfPossible();
30947
+ let pluralOffset = 0;
30948
+ if (argType !== "select" && identifierAndLocation.value === "offset") {
30949
+ if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition()));
30950
+ this.bumpSpace();
30951
+ const result = this.tryParseDecimalInteger(13, 14);
30952
+ if (result.err) return result;
30953
+ this.bumpSpace();
30954
+ identifierAndLocation = this.parseIdentifierIfPossible();
30955
+ pluralOffset = result.val;
30956
+ }
30957
+ const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
30958
+ if (optionsResult.err) return optionsResult;
30959
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
30960
+ if (argCloseResult.err) return argCloseResult;
30961
+ const location = createLocation(openingBracePosition, this.clonePosition());
30962
+ if (argType === "select") return {
30963
+ val: {
30964
+ type: 5,
30965
+ value,
30966
+ options: fromEntries(optionsResult.val),
30967
+ location
30968
+ },
30969
+ err: null
30970
+ };
30971
+ else return {
30972
+ val: {
30973
+ type: 6,
30974
+ value,
30975
+ options: fromEntries(optionsResult.val),
30976
+ offset: pluralOffset,
30977
+ pluralType: argType === "plural" ? "cardinal" : "ordinal",
30978
+ location
30979
+ },
30980
+ err: null
30981
+ };
30982
+ }
30983
+ default:
30984
+ return this.error(5, createLocation(typeStartPosition, typeEndPosition));
30985
+ }
30986
+ }
30987
+ tryParseArgumentClose(openingBracePosition) {
30988
+ if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
30989
+ this.bump();
30990
+ return {
30991
+ val: true,
30992
+ err: null
30993
+ };
30994
+ }
30995
+ /**
30996
+ * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
30997
+ */
30998
+ parseSimpleArgStyleIfPossible() {
30999
+ let nestedBraces = 0;
31000
+ const startPosition = this.clonePosition();
31001
+ while (!this.isEOF()) switch (this.char()) {
31002
+ case 39: {
31003
+ this.bump();
31004
+ let apostrophePosition = this.clonePosition();
31005
+ if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition()));
31006
+ this.bump();
31007
+ break;
31008
+ }
31009
+ case 123:
31010
+ nestedBraces += 1;
31011
+ this.bump();
31012
+ break;
31013
+ case 125:
31014
+ if (nestedBraces > 0) nestedBraces -= 1;
31015
+ else return {
31016
+ val: this.message.slice(startPosition.offset, this.offset()),
31017
+ err: null
31018
+ };
31019
+ break;
31020
+ default:
31021
+ this.bump();
31022
+ }
31023
+ return {
31024
+ val: this.message.slice(startPosition.offset, this.offset()),
31025
+ err: null
31026
+ };
31027
+ }
31028
+ parseNumberSkeletonFromString(skeleton, location) {
31029
+ let tokens = [];
31030
+ try {
31031
+ tokens = parseNumberSkeletonFromString(skeleton);
31032
+ } catch {
31033
+ return this.error(7, location);
31034
+ }
31035
+ return {
31036
+ val: {
31037
+ type: 0,
31038
+ tokens,
31039
+ location,
31040
+ parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {}
31041
+ },
31042
+ err: null
31043
+ };
31044
+ }
31045
+ /**
31046
+ * @param nesting_level The current nesting level of messages.
31047
+ * This can be positive when parsing message fragment in select or plural argument options.
31048
+ * @param parent_arg_type The parent argument's type.
31049
+ * @param parsed_first_identifier If provided, this is the first identifier-like selector of
31050
+ * the argument. It is a by-product of a previous parsing attempt.
31051
+ * @param expecting_close_tag If true, this message is directly or indirectly nested inside
31052
+ * between a pair of opening and closing tags. The nested message will not parse beyond
31053
+ * the closing tag boundary.
31054
+ */
31055
+ tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
31056
+ let hasOtherClause = false;
31057
+ const options = [];
31058
+ const parsedSelectors = /* @__PURE__ */ new Set();
31059
+ let { value: selector, location: selectorLocation } = parsedFirstIdentifier;
31060
+ while (true) {
31061
+ if (selector.length === 0) {
31062
+ const startPosition = this.clonePosition();
31063
+ if (parentArgType !== "select" && this.bumpIf("=")) {
31064
+ const result = this.tryParseDecimalInteger(16, 19);
31065
+ if (result.err) return result;
31066
+ selectorLocation = createLocation(startPosition, this.clonePosition());
31067
+ selector = this.message.slice(startPosition.offset, this.offset());
31068
+ } else break;
31424
31069
  }
31070
+ if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation);
31071
+ if (selector === "other") hasOtherClause = true;
31072
+ this.bumpSpace();
31073
+ const openingBracePosition = this.clonePosition();
31074
+ if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition()));
31075
+ const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
31076
+ if (fragmentResult.err) return fragmentResult;
31077
+ const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
31078
+ if (argCloseResult.err) return argCloseResult;
31079
+ options.push([selector, {
31080
+ value: fragmentResult.val,
31081
+ location: createLocation(openingBracePosition, this.clonePosition())
31082
+ }]);
31083
+ parsedSelectors.add(selector);
31084
+ this.bumpSpace();
31085
+ ({ value: selector, location: selectorLocation } = this.parseIdentifierIfPossible());
31425
31086
  }
31426
- return this.parseMessage(0, "", false);
31087
+ if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition()));
31088
+ if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition()));
31089
+ return {
31090
+ val: options,
31091
+ err: null
31092
+ };
31427
31093
  }
31428
- parseMessage(nestingLevel, parentArgType, expectingCloseTag) {
31429
- let elements = [];
31094
+ tryParseDecimalInteger(expectNumberError, invalidNumberError) {
31095
+ let sign = 1;
31096
+ const startingPosition = this.clonePosition();
31097
+ if (this.bumpIf("+")) {
31098
+ } else if (this.bumpIf("-")) sign = -1;
31099
+ let hasDigits = false;
31100
+ let decimal = 0;
31430
31101
  while (!this.isEOF()) {
31431
- const char = this.char();
31432
- if (char === 123) {
31433
- const result = this.parseArgument(nestingLevel, expectingCloseTag);
31434
- if (result.err) return result;
31435
- elements.push(result.val);
31436
- } else if (char === 125 && nestingLevel > 0) break;
31437
- else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
31438
- const position = this.clonePosition();
31102
+ const ch = this.char();
31103
+ if (ch >= 48 && ch <= 57) {
31104
+ hasDigits = true;
31105
+ decimal = decimal * 10 + (ch - 48);
31439
31106
  this.bump();
31440
- elements.push({
31441
- type: 7,
31442
- location: createLocation(position, this.clonePosition())
31443
- });
31444
- } else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
31445
- if (expectingCloseTag) break;
31446
- else return this.error(26, createLocation(this.clonePosition(), this.clonePosition()));
31447
- } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
31448
- const result = this.parseTag(nestingLevel, parentArgType);
31449
- if (result.err) return result;
31450
- elements.push(result.val);
31451
- } else {
31452
- const result = this.parseLiteral(nestingLevel, parentArgType);
31453
- if (result.err) return result;
31454
- elements.push(result.val);
31455
- }
31107
+ } else break;
31456
31108
  }
31109
+ const location = createLocation(startingPosition, this.clonePosition());
31110
+ if (!hasDigits) return this.error(expectNumberError, location);
31111
+ decimal *= sign;
31112
+ if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location);
31457
31113
  return {
31458
- val: elements,
31114
+ val: decimal,
31459
31115
  err: null
31460
31116
  };
31461
31117
  }
31462
- /**
31463
- * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
31464
- * [custom element name][] except that a dash is NOT always mandatory and uppercase letters
31465
- * are accepted:
31466
- *
31467
- * ```
31468
- * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
31469
- * tagName ::= [a-z] (PENChar)*
31470
- * PENChar ::=
31471
- * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
31472
- * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
31473
- * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
31474
- * ```
31475
- *
31476
- * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
31477
- * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
31478
- * since other tag-based engines like React allow it
31479
- */
31480
- parseTag(nestingLevel, parentArgType) {
31481
- const startPosition = this.clonePosition();
31482
- this.bump();
31483
- const tagName = this.parseTagName();
31484
- this.bumpSpace();
31485
- if (this.bumpIf("/>")) return {
31486
- val: {
31487
- type: 0,
31488
- value: `<${tagName}/>`,
31489
- location: createLocation(startPosition, this.clonePosition())
31490
- },
31491
- err: null
31118
+ offset() {
31119
+ return this.position.offset;
31120
+ }
31121
+ isEOF() {
31122
+ return this.offset() === this.message.length;
31123
+ }
31124
+ clonePosition() {
31125
+ return {
31126
+ offset: this.position.offset,
31127
+ line: this.position.line,
31128
+ column: this.position.column
31492
31129
  };
31493
- else if (this.bumpIf(">")) {
31494
- const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
31495
- if (childrenResult.err) return childrenResult;
31496
- const children = childrenResult.val;
31497
- const endTagStartPosition = this.clonePosition();
31498
- if (this.bumpIf("</")) {
31499
- if (this.isEOF() || !_isAlpha(this.char())) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
31500
- const closingTagNameStartPosition = this.clonePosition();
31501
- if (tagName !== this.parseTagName()) return this.error(26, createLocation(closingTagNameStartPosition, this.clonePosition()));
31502
- this.bumpSpace();
31503
- if (!this.bumpIf(">")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition()));
31504
- return {
31505
- val: {
31506
- type: 8,
31507
- value: tagName,
31508
- children,
31509
- location: createLocation(startPosition, this.clonePosition())
31510
- },
31511
- err: null
31512
- };
31513
- } else return this.error(27, createLocation(startPosition, this.clonePosition()));
31514
- } else return this.error(23, createLocation(startPosition, this.clonePosition()));
31515
31130
  }
31516
31131
  /**
31517
- * This method assumes that the caller has peeked ahead for the first tag character.
31132
+ * Return the code point at the current position of the parser.
31133
+ * Throws if the index is out of bound.
31518
31134
  */
31519
- parseTagName() {
31520
- const startOffset = this.offset();
31521
- this.bump();
31522
- while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump();
31523
- return this.message.slice(startOffset, this.offset());
31135
+ char() {
31136
+ const offset = this.position.offset;
31137
+ if (offset >= this.message.length) throw Error("out of bound");
31138
+ const code = this.message.codePointAt(offset);
31139
+ if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`);
31140
+ return code;
31524
31141
  }
31525
- parseLiteral(nestingLevel, parentArgType) {
31526
- const start = this.clonePosition();
31527
- let value = "";
31528
- while (true) {
31529
- const parseQuoteResult = this.tryParseQuote(parentArgType);
31530
- if (parseQuoteResult) {
31531
- value += parseQuoteResult;
31532
- continue;
31533
- }
31534
- const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
31535
- if (parseUnquotedResult) {
31536
- value += parseUnquotedResult;
31537
- continue;
31538
- }
31539
- const parseLeftAngleResult = this.tryParseLeftAngleBracket();
31540
- if (parseLeftAngleResult) {
31541
- value += parseLeftAngleResult;
31542
- continue;
31543
- }
31544
- break;
31545
- }
31546
- const location = createLocation(start, this.clonePosition());
31142
+ error(kind, location) {
31547
31143
  return {
31548
- val: {
31549
- type: 0,
31550
- value,
31144
+ val: null,
31145
+ err: {
31146
+ kind,
31147
+ message: this.message,
31551
31148
  location
31552
- },
31553
- err: null
31149
+ }
31554
31150
  };
31555
31151
  }
31556
- tryParseLeftAngleBracket() {
31557
- if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
31558
- this.bump();
31559
- return "<";
31152
+ /** Bump the parser to the next UTF-16 code unit. */
31153
+ bump() {
31154
+ if (this.isEOF()) return;
31155
+ const code = this.char();
31156
+ if (code === 10) {
31157
+ this.position.line += 1;
31158
+ this.position.column = 1;
31159
+ this.position.offset += 1;
31160
+ } else {
31161
+ this.position.column += 1;
31162
+ this.position.offset += code < 65536 ? 1 : 2;
31560
31163
  }
31561
- return null;
31562
31164
  }
31563
31165
  /**
31564
- * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
31565
- * a character that requires quoting (that is, "only where needed"), and works the same in
31566
- * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
31166
+ * If the substring starting at the current position of the parser has
31167
+ * the given prefix, then bump the parser to the character immediately
31168
+ * following the prefix and return true. Otherwise, don't bump the parser
31169
+ * and return false.
31567
31170
  */
31568
- tryParseQuote(parentArgType) {
31569
- if (this.isEOF() || this.char() !== 39) return null;
31570
- switch (this.peek()) {
31571
- case 39:
31572
- this.bump();
31573
- this.bump();
31574
- return "'";
31575
- case 123:
31576
- case 60:
31577
- case 62:
31578
- case 125:
31579
- break;
31580
- case 35:
31581
- if (parentArgType === "plural" || parentArgType === "selectordinal") break;
31582
- return null;
31583
- default:
31584
- return null;
31171
+ bumpIf(prefix) {
31172
+ const offset = this.offset();
31173
+ if (this.message.slice(offset, offset + prefix.length) === prefix) {
31174
+ for (let i = 0; i < prefix.length; i++) this.bump();
31175
+ return true;
31585
31176
  }
31586
- this.bump();
31587
- const codePoints = [this.char()];
31588
- this.bump();
31589
- while (!this.isEOF()) {
31590
- const ch = this.char();
31591
- if (ch === 39) {
31592
- if (this.peek() === 39) {
31593
- codePoints.push(39);
31594
- this.bump();
31595
- } else {
31596
- this.bump();
31597
- break;
31598
- }
31599
- } else codePoints.push(ch);
31600
- this.bump();
31177
+ return false;
31178
+ }
31179
+ /**
31180
+ * Bump the parser until the pattern character is found and return `true`.
31181
+ * Otherwise bump to the end of the file and return `false`.
31182
+ */
31183
+ bumpUntil(pattern) {
31184
+ const currentOffset = this.offset();
31185
+ const index = this.message.indexOf(pattern, currentOffset);
31186
+ if (index >= 0) {
31187
+ this.bumpTo(index);
31188
+ return true;
31189
+ } else {
31190
+ this.bumpTo(this.message.length);
31191
+ return false;
31601
31192
  }
31602
- return String.fromCodePoint(...codePoints);
31603
31193
  }
31604
- tryParseUnquoted(nestingLevel, parentArgType) {
31605
- if (this.isEOF()) return null;
31606
- const ch = this.char();
31607
- if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null;
31608
- else {
31194
+ /**
31195
+ * Bump the parser to the target offset.
31196
+ * If target offset is beyond the end of the input, bump the parser to the end of the input.
31197
+ */
31198
+ bumpTo(targetOffset) {
31199
+ if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`);
31200
+ targetOffset = Math.min(targetOffset, this.message.length);
31201
+ while (true) {
31202
+ const offset = this.offset();
31203
+ if (offset === targetOffset) break;
31204
+ if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`);
31609
31205
  this.bump();
31610
- return String.fromCodePoint(ch);
31206
+ if (this.isEOF()) break;
31611
31207
  }
31612
31208
  }
31613
- parseArgument(nestingLevel, expectingCloseTag) {
31614
- const openingBracePosition = this.clonePosition();
31615
- this.bump();
31616
- this.bumpSpace();
31617
- if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
31618
- if (this.char() === 125) {
31619
- this.bump();
31620
- return this.error(2, createLocation(openingBracePosition, this.clonePosition()));
31621
- }
31622
- let value = this.parseIdentifierIfPossible().value;
31623
- if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
31624
- this.bumpSpace();
31625
- if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
31626
- switch (this.char()) {
31627
- case 125:
31628
- this.bump();
31629
- return {
31630
- val: {
31631
- type: 1,
31632
- value,
31633
- location: createLocation(openingBracePosition, this.clonePosition())
31634
- },
31635
- err: null
31636
- };
31637
- case 44:
31638
- this.bump();
31639
- this.bumpSpace();
31640
- if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
31641
- return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
31642
- default:
31643
- return this.error(3, createLocation(openingBracePosition, this.clonePosition()));
31644
- }
31209
+ /** advance the parser through all whitespace to the next non-whitespace code unit. */
31210
+ bumpSpace() {
31211
+ while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump();
31645
31212
  }
31646
31213
  /**
31647
- * Advance the parser until the end of the identifier, if it is currently on
31648
- * an identifier character. Return an empty string otherwise.
31214
+ * Peek at the *next* Unicode codepoint in the input without advancing the parser.
31215
+ * If the input has been exhausted, then this returns null.
31649
31216
  */
31650
- parseIdentifierIfPossible() {
31651
- const startingPosition = this.clonePosition();
31652
- const startOffset = this.offset();
31653
- const value = matchIdentifierAtIndex(this.message, startOffset);
31654
- const endOffset = startOffset + value.length;
31655
- this.bumpTo(endOffset);
31656
- return {
31657
- value,
31658
- location: createLocation(startingPosition, this.clonePosition())
31659
- };
31217
+ peek() {
31218
+ if (this.isEOF()) return null;
31219
+ const code = this.char();
31220
+ const offset = this.offset();
31221
+ return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null;
31660
31222
  }
31661
- parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) {
31662
- let typeStartPosition = this.clonePosition();
31663
- let argType = this.parseIdentifierIfPossible().value;
31664
- let typeEndPosition = this.clonePosition();
31665
- switch (argType) {
31666
- case "":
31667
- return this.error(4, createLocation(typeStartPosition, typeEndPosition));
31668
- case "number":
31669
- case "date":
31670
- case "time": {
31671
- this.bumpSpace();
31672
- let styleAndLocation = null;
31673
- if (this.bumpIf(",")) {
31674
- this.bumpSpace();
31675
- const styleStartPosition = this.clonePosition();
31676
- const result = this.parseSimpleArgStyleIfPossible();
31677
- if (result.err) return result;
31678
- const style = trimEnd2(result.val);
31679
- if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition()));
31680
- styleAndLocation = {
31681
- style,
31682
- styleLocation: createLocation(styleStartPosition, this.clonePosition())
31683
- };
31684
- }
31685
- const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
31686
- if (argCloseResult.err) return argCloseResult;
31687
- const location = createLocation(openingBracePosition, this.clonePosition());
31688
- if (styleAndLocation && styleAndLocation.style.startsWith("::")) {
31689
- let skeleton = trimStart(styleAndLocation.style.slice(2));
31690
- if (argType === "number") {
31691
- const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
31692
- if (result.err) return result;
31693
- return {
31694
- val: {
31695
- type: 2,
31696
- value,
31697
- location,
31698
- style: result.val
31699
- },
31700
- err: null
31701
- };
31702
- } else {
31703
- if (skeleton.length === 0) return this.error(10, location);
31704
- let dateTimePattern = skeleton;
31705
- if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale);
31706
- const style = {
31707
- type: 1,
31708
- pattern: dateTimePattern,
31709
- location: styleAndLocation.styleLocation,
31710
- parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
31711
- };
31712
- return {
31713
- val: {
31714
- type: argType === "date" ? 3 : 4,
31715
- value,
31716
- location,
31717
- style
31718
- },
31719
- err: null
31720
- };
31721
- }
31722
- }
31723
- return {
31724
- val: {
31725
- type: argType === "number" ? 2 : argType === "date" ? 3 : 4,
31726
- value,
31727
- location,
31728
- style: styleAndLocation?.style ?? null
31729
- },
31730
- err: null
31731
- };
31732
- }
31733
- case "plural":
31734
- case "selectordinal":
31735
- case "select": {
31736
- const typeEndPosition2 = this.clonePosition();
31737
- this.bumpSpace();
31738
- if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition2, { ...typeEndPosition2 }));
31739
- this.bumpSpace();
31740
- let identifierAndLocation = this.parseIdentifierIfPossible();
31741
- let pluralOffset = 0;
31742
- if (argType !== "select" && identifierAndLocation.value === "offset") {
31743
- if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition()));
31744
- this.bumpSpace();
31745
- const result = this.tryParseDecimalInteger(13, 14);
31746
- if (result.err) return result;
31747
- this.bumpSpace();
31748
- identifierAndLocation = this.parseIdentifierIfPossible();
31749
- pluralOffset = result.val;
31750
- }
31751
- const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
31752
- if (optionsResult.err) return optionsResult;
31753
- const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
31754
- if (argCloseResult.err) return argCloseResult;
31755
- const location = createLocation(openingBracePosition, this.clonePosition());
31756
- if (argType === "select") return {
31757
- val: {
31758
- type: 5,
31759
- value,
31760
- options: fromEntries(optionsResult.val),
31761
- location
31762
- },
31763
- err: null
31764
- };
31765
- else return {
31766
- val: {
31767
- type: 6,
31768
- value,
31769
- options: fromEntries(optionsResult.val),
31770
- offset: pluralOffset,
31771
- pluralType: argType === "plural" ? "cardinal" : "ordinal",
31772
- location
31773
- },
31774
- err: null
31775
- };
31776
- }
31777
- default:
31778
- return this.error(5, createLocation(typeStartPosition, typeEndPosition));
31779
- }
31223
+ };
31224
+ }
31225
+ });
31226
+
31227
+ // ../../node_modules/.pnpm/intl-messageformat@12.1.4/node_modules/intl-messageformat/index.js
31228
+ function mergeLiteral(parts) {
31229
+ if (parts.length < 2) return parts;
31230
+ return parts.reduce((all, part) => {
31231
+ const lastPart = all[all.length - 1];
31232
+ if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part);
31233
+ else lastPart.value += part.value;
31234
+ return all;
31235
+ }, []);
31236
+ }
31237
+ function isFormatXMLElementFn(el) {
31238
+ return typeof el === "function";
31239
+ }
31240
+ function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
31241
+ if (els.length === 1 && isLiteralElement(els[0])) return [{
31242
+ type: 0,
31243
+ value: els[0].value
31244
+ }];
31245
+ const result = [];
31246
+ for (const el of els) {
31247
+ if (isLiteralElement(el)) {
31248
+ result.push({
31249
+ type: 0,
31250
+ value: el.value
31251
+ });
31252
+ continue;
31253
+ }
31254
+ if (isPoundElement(el)) {
31255
+ if (typeof currentPluralValue === "number") result.push({
31256
+ type: 0,
31257
+ value: formatters.getNumberFormat(locales).format(currentPluralValue)
31258
+ });
31259
+ continue;
31260
+ }
31261
+ const { value: varName } = el;
31262
+ if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage);
31263
+ let value = values[varName];
31264
+ if (isArgumentElement(el)) {
31265
+ if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : "";
31266
+ result.push({
31267
+ type: typeof value === "string" ? 0 : 1,
31268
+ value
31269
+ });
31270
+ continue;
31271
+ }
31272
+ if (isDateElement(el)) {
31273
+ const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
31274
+ result.push({
31275
+ type: 0,
31276
+ value: formatters.getDateTimeFormat(locales, style).format(value)
31277
+ });
31278
+ continue;
31279
+ }
31280
+ if (isTimeElement(el)) {
31281
+ const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
31282
+ result.push({
31283
+ type: 0,
31284
+ value: formatters.getDateTimeFormat(locales, style).format(value)
31285
+ });
31286
+ continue;
31287
+ }
31288
+ if (isNumberElement(el)) {
31289
+ const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
31290
+ if (style && style.scale) {
31291
+ const scale = style.scale || 1;
31292
+ if (typeof value === "bigint") {
31293
+ if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`);
31294
+ value = value * BigInt(scale);
31295
+ } else value = value * scale;
31780
31296
  }
31781
- tryParseArgumentClose(openingBracePosition) {
31782
- if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition()));
31783
- this.bump();
31297
+ result.push({
31298
+ type: 0,
31299
+ value: formatters.getNumberFormat(locales, style).format(value)
31300
+ });
31301
+ continue;
31302
+ }
31303
+ if (isTagElement(el)) {
31304
+ const { children, value: value2 } = el;
31305
+ const formatFn = values[value2];
31306
+ if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value2, "function", originalMessage);
31307
+ let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value));
31308
+ if (!Array.isArray(chunks)) chunks = [chunks];
31309
+ result.push(...chunks.map((c) => {
31784
31310
  return {
31785
- val: true,
31786
- err: null
31311
+ type: typeof c === "string" ? 0 : 1,
31312
+ value: c
31787
31313
  };
31314
+ }));
31315
+ }
31316
+ if (isSelectElement(el)) {
31317
+ const key = value;
31318
+ const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other;
31319
+ if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
31320
+ result.push(...formatToParts(opt.value, locales, formatters, formats, values));
31321
+ continue;
31322
+ }
31323
+ if (isPluralElement(el)) {
31324
+ const exactKey = `=${value}`;
31325
+ let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0;
31326
+ if (!opt) {
31327
+ if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment.
31328
+ Try polyfilling it using "@formatjs/intl-pluralrules"
31329
+ `, "MISSING_INTL_API", originalMessage);
31330
+ const numericValue2 = typeof value === "bigint" ? Number(value) : value;
31331
+ const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue2 - (el.offset || 0));
31332
+ opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other;
31788
31333
  }
31789
- /**
31790
- * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
31791
- */
31792
- parseSimpleArgStyleIfPossible() {
31793
- let nestedBraces = 0;
31794
- const startPosition = this.clonePosition();
31795
- while (!this.isEOF()) switch (this.char()) {
31796
- case 39: {
31797
- this.bump();
31798
- let apostrophePosition = this.clonePosition();
31799
- if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition()));
31800
- this.bump();
31801
- break;
31802
- }
31803
- case 123:
31804
- nestedBraces += 1;
31805
- this.bump();
31806
- break;
31807
- case 125:
31808
- if (nestedBraces > 0) nestedBraces -= 1;
31809
- else return {
31810
- val: this.message.slice(startPosition.offset, this.offset()),
31811
- err: null
31812
- };
31813
- break;
31814
- default:
31815
- this.bump();
31816
- }
31817
- return {
31818
- val: this.message.slice(startPosition.offset, this.offset()),
31819
- err: null
31820
- };
31334
+ if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
31335
+ const numericValue = typeof value === "bigint" ? Number(value) : value;
31336
+ result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0)));
31337
+ continue;
31338
+ }
31339
+ }
31340
+ return mergeLiteral(result);
31341
+ }
31342
+ function mergeConfig(c1, c2) {
31343
+ if (!c2) return c1;
31344
+ return {
31345
+ ...c1,
31346
+ ...c2,
31347
+ ...Object.keys(c1).reduce((all, k) => {
31348
+ all[k] = {
31349
+ ...c1[k],
31350
+ ...c2[k]
31351
+ };
31352
+ return all;
31353
+ }, {})
31354
+ };
31355
+ }
31356
+ function mergeConfigs(defaultConfig, configs) {
31357
+ if (!configs) return defaultConfig;
31358
+ return Object.keys(defaultConfig).reduce((all, k) => {
31359
+ all[k] = mergeConfig(defaultConfig[k], configs[k]);
31360
+ return all;
31361
+ }, { ...defaultConfig });
31362
+ }
31363
+ function createFastMemoizeCache(store) {
31364
+ return { create() {
31365
+ return {
31366
+ get(key) {
31367
+ return store[key];
31368
+ },
31369
+ set(key, value) {
31370
+ store[key] = value;
31821
31371
  }
31822
- parseNumberSkeletonFromString(skeleton, location) {
31823
- let tokens = [];
31824
- try {
31825
- tokens = parseNumberSkeletonFromString(skeleton);
31826
- } catch {
31827
- return this.error(7, location);
31828
- }
31829
- return {
31830
- val: {
31831
- type: 0,
31832
- tokens,
31833
- location,
31834
- parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {}
31835
- },
31836
- err: null
31837
- };
31372
+ };
31373
+ } };
31374
+ }
31375
+ function createDefaultFormatters(cache = {
31376
+ number: {},
31377
+ dateTime: {},
31378
+ pluralRules: {}
31379
+ }) {
31380
+ return {
31381
+ getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {
31382
+ cache: createFastMemoizeCache(cache.number),
31383
+ strategy: strategies.variadic
31384
+ }),
31385
+ getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {
31386
+ cache: createFastMemoizeCache(cache.dateTime),
31387
+ strategy: strategies.variadic
31388
+ }),
31389
+ getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {
31390
+ cache: createFastMemoizeCache(cache.pluralRules),
31391
+ strategy: strategies.variadic
31392
+ })
31393
+ };
31394
+ }
31395
+ var FormatError, InvalidValueError, InvalidValueTypeError, MissingValueError, IntlMessageFormat;
31396
+ var init_intl_messageformat = __esm({
31397
+ "../../node_modules/.pnpm/intl-messageformat@12.1.4/node_modules/intl-messageformat/index.js"() {
31398
+ init_fast_memoize();
31399
+ init_icu_messageformat_parser();
31400
+ FormatError = class extends Error {
31401
+ constructor(msg, code, originalMessage) {
31402
+ super(msg);
31403
+ this.code = code;
31404
+ this.originalMessage = originalMessage;
31838
31405
  }
31839
- /**
31840
- * @param nesting_level The current nesting level of messages.
31841
- * This can be positive when parsing message fragment in select or plural argument options.
31842
- * @param parent_arg_type The parent argument's type.
31843
- * @param parsed_first_identifier If provided, this is the first identifier-like selector of
31844
- * the argument. It is a by-product of a previous parsing attempt.
31845
- * @param expecting_close_tag If true, this message is directly or indirectly nested inside
31846
- * between a pair of opening and closing tags. The nested message will not parse beyond
31847
- * the closing tag boundary.
31848
- */
31849
- tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
31850
- let hasOtherClause = false;
31851
- const options = [];
31852
- const parsedSelectors = /* @__PURE__ */ new Set();
31853
- let { value: selector, location: selectorLocation } = parsedFirstIdentifier;
31854
- while (true) {
31855
- if (selector.length === 0) {
31856
- const startPosition = this.clonePosition();
31857
- if (parentArgType !== "select" && this.bumpIf("=")) {
31858
- const result = this.tryParseDecimalInteger(16, 19);
31859
- if (result.err) return result;
31860
- selectorLocation = createLocation(startPosition, this.clonePosition());
31861
- selector = this.message.slice(startPosition.offset, this.offset());
31862
- } else break;
31863
- }
31864
- if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation);
31865
- if (selector === "other") hasOtherClause = true;
31866
- this.bumpSpace();
31867
- const openingBracePosition = this.clonePosition();
31868
- if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition()));
31869
- const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
31870
- if (fragmentResult.err) return fragmentResult;
31871
- const argCloseResult = this.tryParseArgumentClose(openingBracePosition);
31872
- if (argCloseResult.err) return argCloseResult;
31873
- options.push([selector, {
31874
- value: fragmentResult.val,
31875
- location: createLocation(openingBracePosition, this.clonePosition())
31876
- }]);
31877
- parsedSelectors.add(selector);
31878
- this.bumpSpace();
31879
- ({ value: selector, location: selectorLocation } = this.parseIdentifierIfPossible());
31880
- }
31881
- if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition()));
31882
- if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition()));
31883
- return {
31884
- val: options,
31885
- err: null
31886
- };
31406
+ toString() {
31407
+ return `[formatjs Error: ${this.code}] ${this.message}`;
31887
31408
  }
31888
- tryParseDecimalInteger(expectNumberError, invalidNumberError) {
31889
- let sign = 1;
31890
- const startingPosition = this.clonePosition();
31891
- if (this.bumpIf("+")) {
31892
- } else if (this.bumpIf("-")) sign = -1;
31893
- let hasDigits = false;
31894
- let decimal = 0;
31895
- while (!this.isEOF()) {
31896
- const ch = this.char();
31897
- if (ch >= 48 && ch <= 57) {
31898
- hasDigits = true;
31899
- decimal = decimal * 10 + (ch - 48);
31900
- this.bump();
31901
- } else break;
31902
- }
31903
- const location = createLocation(startingPosition, this.clonePosition());
31904
- if (!hasDigits) return this.error(expectNumberError, location);
31905
- decimal *= sign;
31906
- if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location);
31907
- return {
31908
- val: decimal,
31909
- err: null
31409
+ };
31410
+ InvalidValueError = class extends FormatError {
31411
+ constructor(variableId, value, options, originalMessage) {
31412
+ super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join('", "')}"`, "INVALID_VALUE", originalMessage);
31413
+ }
31414
+ };
31415
+ InvalidValueTypeError = class extends FormatError {
31416
+ constructor(value, type, originalMessage) {
31417
+ super(`Value for "${value}" must be of type ${type}`, "INVALID_VALUE", originalMessage);
31418
+ }
31419
+ };
31420
+ MissingValueError = class extends FormatError {
31421
+ constructor(variableId, originalMessage) {
31422
+ super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, "MISSING_VALUE", originalMessage);
31423
+ }
31424
+ };
31425
+ IntlMessageFormat = class IntlMessageFormat2 {
31426
+ constructor(message2, locales = IntlMessageFormat2.defaultLocale, overrideFormats, opts) {
31427
+ this.formatterCache = {
31428
+ number: {},
31429
+ dateTime: {},
31430
+ pluralRules: {}
31910
31431
  };
31432
+ this.format = ((values) => {
31433
+ const parts = this.formatToParts(values);
31434
+ if (parts.length === 1) return parts[0].value;
31435
+ const result = parts.reduce((all, part) => {
31436
+ if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value);
31437
+ else all[all.length - 1] += part.value;
31438
+ return all;
31439
+ }, []);
31440
+ if (result.length <= 1) return result[0] || "";
31441
+ return result;
31442
+ });
31443
+ this.formatToParts = ((values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message));
31444
+ this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] });
31445
+ this.getAst = () => this.ast;
31446
+ this.locales = locales;
31447
+ this.resolvedLocale = IntlMessageFormat2.resolveLocale(locales);
31448
+ if (typeof message2 === "string") {
31449
+ this.message = message2;
31450
+ if (!IntlMessageFormat2.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
31451
+ const { ...parseOpts } = opts || {};
31452
+ this.ast = IntlMessageFormat2.__parse(message2, {
31453
+ ...parseOpts,
31454
+ locale: this.resolvedLocale
31455
+ });
31456
+ } else this.ast = message2;
31457
+ if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST.");
31458
+ this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats);
31459
+ this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
31911
31460
  }
31912
- offset() {
31913
- return this.position.offset;
31461
+ static {
31462
+ this.memoizedDefaultLocale = null;
31914
31463
  }
31915
- isEOF() {
31916
- return this.offset() === this.message.length;
31464
+ static get defaultLocale() {
31465
+ if (!IntlMessageFormat2.memoizedDefaultLocale) IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
31466
+ return IntlMessageFormat2.memoizedDefaultLocale;
31917
31467
  }
31918
- clonePosition() {
31919
- return {
31920
- offset: this.position.offset,
31921
- line: this.position.line,
31922
- column: this.position.column
31468
+ static {
31469
+ this.resolveLocale = (locales) => {
31470
+ if (typeof Intl.Locale === "undefined") return;
31471
+ const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
31472
+ if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]);
31473
+ return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
31923
31474
  };
31924
31475
  }
31925
- /**
31926
- * Return the code point at the current position of the parser.
31927
- * Throws if the index is out of bound.
31928
- */
31929
- char() {
31930
- const offset = this.position.offset;
31931
- if (offset >= this.message.length) throw Error("out of bound");
31932
- const code = this.message.codePointAt(offset);
31933
- if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`);
31934
- return code;
31476
+ static {
31477
+ this.__parse = parse3;
31935
31478
  }
31936
- error(kind, location) {
31937
- return {
31938
- val: null,
31939
- err: {
31940
- kind,
31941
- message: this.message,
31942
- location
31479
+ static {
31480
+ this.formats = {
31481
+ number: {
31482
+ integer: { maximumFractionDigits: 0 },
31483
+ currency: { style: "currency" },
31484
+ percent: { style: "percent" }
31485
+ },
31486
+ date: {
31487
+ short: {
31488
+ month: "numeric",
31489
+ day: "numeric",
31490
+ year: "2-digit"
31491
+ },
31492
+ medium: {
31493
+ month: "short",
31494
+ day: "numeric",
31495
+ year: "numeric"
31496
+ },
31497
+ long: {
31498
+ month: "long",
31499
+ day: "numeric",
31500
+ year: "numeric"
31501
+ },
31502
+ full: {
31503
+ weekday: "long",
31504
+ month: "long",
31505
+ day: "numeric",
31506
+ year: "numeric"
31507
+ }
31508
+ },
31509
+ time: {
31510
+ short: {
31511
+ hour: "numeric",
31512
+ minute: "numeric"
31513
+ },
31514
+ medium: {
31515
+ hour: "numeric",
31516
+ minute: "numeric",
31517
+ second: "numeric"
31518
+ },
31519
+ long: {
31520
+ hour: "numeric",
31521
+ minute: "numeric",
31522
+ second: "numeric",
31523
+ timeZoneName: "short"
31524
+ },
31525
+ full: {
31526
+ hour: "numeric",
31527
+ minute: "numeric",
31528
+ second: "numeric",
31529
+ timeZoneName: "short"
31530
+ }
31943
31531
  }
31944
31532
  };
31945
31533
  }
31946
- /** Bump the parser to the next UTF-16 code unit. */
31947
- bump() {
31948
- if (this.isEOF()) return;
31949
- const code = this.char();
31950
- if (code === 10) {
31951
- this.position.line += 1;
31952
- this.position.column = 1;
31953
- this.position.offset += 1;
31954
- } else {
31955
- this.position.column += 1;
31956
- this.position.offset += code < 65536 ? 1 : 2;
31957
- }
31958
- }
31959
- /**
31960
- * If the substring starting at the current position of the parser has
31961
- * the given prefix, then bump the parser to the character immediately
31962
- * following the prefix and return true. Otherwise, don't bump the parser
31963
- * and return false.
31964
- */
31965
- bumpIf(prefix) {
31966
- const offset = this.offset();
31967
- if (this.message.slice(offset, offset + prefix.length) === prefix) {
31968
- for (let i = 0; i < prefix.length; i++) this.bump();
31969
- return true;
31970
- }
31971
- return false;
31972
- }
31973
- /**
31974
- * Bump the parser until the pattern character is found and return `true`.
31975
- * Otherwise bump to the end of the file and return `false`.
31976
- */
31977
- bumpUntil(pattern) {
31978
- const currentOffset = this.offset();
31979
- const index = this.message.indexOf(pattern, currentOffset);
31980
- if (index >= 0) {
31981
- this.bumpTo(index);
31982
- return true;
31983
- } else {
31984
- this.bumpTo(this.message.length);
31985
- return false;
31986
- }
31534
+ };
31535
+ }
31536
+ });
31537
+
31538
+ // ../core/dist/render/message.js
31539
+ function messagesFrom(texts) {
31540
+ return (code, ...values) => new IntlMessageFormat(texts[code], "en", void 0, { ignoreTag: true }).formatToParts(values[0]).map((part) => part.value).join("");
31541
+ }
31542
+ var init_message = __esm({
31543
+ "../core/dist/render/message.js"() {
31544
+ "use strict";
31545
+ init_intl_messageformat();
31546
+ }
31547
+ });
31548
+
31549
+ // ../core/dist/render/coreText.js
31550
+ var coreMessage;
31551
+ var init_coreText = __esm({
31552
+ "../core/dist/render/coreText.js"() {
31553
+ "use strict";
31554
+ init_messages_en();
31555
+ init_message();
31556
+ coreMessage = messagesFrom(messages_en_default);
31557
+ }
31558
+ });
31559
+
31560
+ // ../core/dist/render/errorEntry.js
31561
+ var errorEntry;
31562
+ var init_errorEntry = __esm({
31563
+ "../core/dist/render/errorEntry.js"() {
31564
+ "use strict";
31565
+ errorEntry = (code, words2) => `- \`${code}\` \u2014 ${words2}`;
31566
+ }
31567
+ });
31568
+
31569
+ // ../core/dist/render/scenarioCodeErrorsSection.js
31570
+ function scenarioCodeErrorsFraming(errors, count) {
31571
+ switch (scenarioCodeErrorsAre(errors)) {
31572
+ case "misfilings":
31573
+ return coreMessage(CoreMessage.ScenarioCodeErrorsFraming, { count });
31574
+ case "several-codes":
31575
+ return coreMessage(CoreMessage.SeveralScnCodesFraming, { count });
31576
+ case "both":
31577
+ return coreMessage(CoreMessage.MisfiledAndSeveralScnCodesFraming, { count });
31578
+ }
31579
+ }
31580
+ function counted(n, noun) {
31581
+ return `${n} ${noun}${n === 1 ? "" : "s"}`;
31582
+ }
31583
+ function cleanStatement(featureFiles, featureCodes) {
31584
+ const over = CORE_MESSAGES[CoreMessage.ScenarioCodesCleanOver](counted(featureFiles, CORE_MESSAGES[CoreMessage.FeatureFileNoun]), counted(featureCodes, CORE_MESSAGES[CoreMessage.FeatureCodeNoun]));
31585
+ if (featureCodes === 0) {
31586
+ const them = featureFiles === 1 ? CORE_MESSAGES[CoreMessage.ItPronoun] : CORE_MESSAGES[CoreMessage.ThemPronoun];
31587
+ return CORE_MESSAGES[CoreMessage.CleanNoCodedScenario](over, them);
31588
+ }
31589
+ if (featureCodes === featureFiles)
31590
+ return CORE_MESSAGES[CoreMessage.CleanEachFileOwnCode](over);
31591
+ const noFeatureCode = featureFiles - featureCodes;
31592
+ const hold = noFeatureCode === 1 ? CORE_MESSAGES[CoreMessage.HoldsVerb] : CORE_MESSAGES[CoreMessage.HoldVerb];
31593
+ return CORE_MESSAGES[CoreMessage.CleanOthersNoFeatureCode](over, noFeatureCode, hold);
31594
+ }
31595
+ function worded(error) {
31596
+ if (error.kind === "duplicate-feature-code") {
31597
+ return coreMessage(CoreMessage.DuplicateFeatureCode, {
31598
+ code: error.featureCode,
31599
+ fileCount: error.files.length,
31600
+ files: error.files.join(", ")
31601
+ });
31602
+ }
31603
+ if (error.kind === "foreign-scn-code")
31604
+ return foreignWorded(error);
31605
+ if (error.kind === "no-feature-code")
31606
+ return coreMessage(CoreMessage.NoFeatureCode, { file: error.files.join(", ") });
31607
+ return coreMessage(CoreMessage.ScenarioSeveralScnCodes, {
31608
+ file: error.files.join(", "),
31609
+ scenario: error.scenario,
31610
+ codeCount: error.codes.length,
31611
+ codes: error.codes.join(", ")
31612
+ });
31613
+ }
31614
+ function foreignWorded(error) {
31615
+ const values = { file: error.files.join(", "), featureCode: error.featureCode, scnId: error.scnId, named: error.namedFeatureCode };
31616
+ const carriers = foreignCodeCarriersOf(error);
31617
+ switch (carriers.kind) {
31618
+ case "none":
31619
+ return coreMessage(CoreMessage.ForeignScnCodeNoCarrier, values);
31620
+ case "carried":
31621
+ return coreMessage(CoreMessage.ForeignScnCodeCarried, {
31622
+ ...values,
31623
+ carrierCount: carriers.files.length,
31624
+ carriers: carriers.files.join(", ")
31625
+ });
31626
+ }
31627
+ }
31628
+ var CODE_OF, scenarioCodeErrorsSection, scenarioCodesCleanStatement;
31629
+ var init_scenarioCodeErrorsSection = __esm({
31630
+ "../core/dist/render/scenarioCodeErrorsSection.js"() {
31631
+ "use strict";
31632
+ init_scnTags();
31633
+ init_messages4();
31634
+ init_coreText();
31635
+ init_errorEntry();
31636
+ CODE_OF = {
31637
+ "duplicate-feature-code": CoreError.DuplicateFeatureCode,
31638
+ "foreign-scn-code": CoreError.ForeignScnCode,
31639
+ "no-feature-code": CoreError.NoFeatureCode,
31640
+ "several-scn-codes": CoreError.SeveralScnCodes
31641
+ };
31642
+ scenarioCodeErrorsSection = (report) => {
31643
+ const errors = report.errors?.scenarioCodes;
31644
+ if (errors === void 0)
31645
+ return [];
31646
+ const count = errors.length === 1 ? coreMessage(CoreMessage.OneScenarioCodeError) : coreMessage(CoreMessage.ScenarioCodeErrorCount, { count: errors.length });
31647
+ return [
31648
+ CORE_MESSAGES[CoreMessage.ScenarioCodeErrorsHeading],
31649
+ "",
31650
+ scenarioCodeErrorsFraming(errors, count),
31651
+ "",
31652
+ ...errors.map((error) => errorEntry(CODE_OF[error.kind], worded(error))),
31653
+ "",
31654
+ coreMessage(CoreMessage.DuplicateScnCodeNotListed, { outcome: CORE_MESSAGES[CoreMessage.OutcomeDuplicateScnCode] }),
31655
+ ""
31656
+ ];
31657
+ };
31658
+ scenarioCodesCleanStatement = (report) => {
31659
+ if (report.errors?.scenarioCodes !== void 0)
31660
+ return [];
31661
+ const { featureFiles, featureCodes } = report.scenarioCodes ?? {};
31662
+ if (featureFiles === void 0 || featureCodes === void 0)
31663
+ return [];
31664
+ if (featureFiles === 0)
31665
+ return [CORE_MESSAGES[CoreMessage.NoFeatureFileJudged], ""];
31666
+ return [cleanStatement(featureFiles, featureCodes), ""];
31667
+ };
31668
+ }
31669
+ });
31670
+
31671
+ // ../core/dist/render/provenanceFacts.js
31672
+ function projectProvenanceObject(obj, inputNames) {
31673
+ const inputs = [];
31674
+ const absentInputs = [];
31675
+ for (const { name, flag } of inputNames) {
31676
+ const value = obj.inputs[name];
31677
+ if (typeof value === "string") {
31678
+ inputs.push({ flag, value });
31679
+ } else {
31680
+ absentInputs.push(flag);
31681
+ }
31682
+ }
31683
+ return {
31684
+ target: obj.target,
31685
+ ...obj.targetOrigin !== void 0 ? { targetOrigin: obj.targetOrigin } : {},
31686
+ inputs,
31687
+ absentInputs,
31688
+ runStartUtc: obj.runTimestamp,
31689
+ sourceSha: obj.sourceSha,
31690
+ toolSha: obj.toolSha,
31691
+ toolVersion: obj.toolVersion
31692
+ };
31693
+ }
31694
+ var init_provenanceFacts = __esm({
31695
+ "../core/dist/render/provenanceFacts.js"() {
31696
+ "use strict";
31697
+ }
31698
+ });
31699
+
31700
+ // ../core/dist/render/provenanceSection.js
31701
+ var provenanceSection;
31702
+ var init_provenanceSection = __esm({
31703
+ "../core/dist/render/provenanceSection.js"() {
31704
+ "use strict";
31705
+ init_provenanceFacts();
31706
+ init_messages4();
31707
+ provenanceSection = (report, inputNames) => {
31708
+ const p = projectProvenanceObject(report.runProvenance, inputNames);
31709
+ const lines = [CORE_MESSAGES[CoreMessage.RunProvenanceHeading], ""];
31710
+ const targetRepo = p.targetOrigin === void 0 ? CORE_MESSAGES[CoreMessage.ProvenanceTargetRepo](p.target) : CORE_MESSAGES[CoreMessage.ProvenanceTargetRepoUntargeted](p.target, p.targetOrigin);
31711
+ lines.push(`- ${targetRepo}`);
31712
+ if (p.inputs.length === 0) {
31713
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceNoInputs]}`);
31714
+ } else {
31715
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceInputs]}`);
31716
+ for (const { flag, value } of p.inputs)
31717
+ lines.push(` - \`${flag} ${value}\``);
31987
31718
  }
31988
- /**
31989
- * Bump the parser to the target offset.
31990
- * If target offset is beyond the end of the input, bump the parser to the end of the input.
31991
- */
31992
- bumpTo(targetOffset) {
31993
- if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`);
31994
- targetOffset = Math.min(targetOffset, this.message.length);
31995
- while (true) {
31996
- const offset = this.offset();
31997
- if (offset === targetOffset) break;
31998
- if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`);
31999
- this.bump();
32000
- if (this.isEOF()) break;
32001
- }
31719
+ if (p.absentInputs.length > 0)
31720
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceNotSupplied](p.absentInputs.map((flag) => `\`${flag}\``).join(", "))}`);
31721
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceRunTimestamp](p.runStartUtc)}`);
31722
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceSourceSha](p.sourceSha ?? CORE_MESSAGES[CoreMessage.ProvenanceSourceShaUnknown])}`);
31723
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceToolSha](p.toolSha ?? CORE_MESSAGES[CoreMessage.ProvenanceToolShaUnknown])}`);
31724
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.ProvenanceToolVersion](p.toolVersion)}`);
31725
+ lines.push("");
31726
+ return lines;
31727
+ };
31728
+ }
31729
+ });
31730
+
31731
+ // ../core/dist/render/configurationNotRead.js
31732
+ function kindWords(kind) {
31733
+ switch (kind) {
31734
+ case "list":
31735
+ return coreMessage(CoreMessage.ManifestKindList);
31736
+ case "object":
31737
+ return coreMessage(CoreMessage.ManifestKindObject);
31738
+ case "string":
31739
+ return coreMessage(CoreMessage.ManifestKindString);
31740
+ case "string-or-null":
31741
+ return coreMessage(CoreMessage.ManifestKindStringOrNull);
31742
+ case "null":
31743
+ return kind;
31744
+ default:
31745
+ return coreMessage(CoreMessage.ManifestKindOfType, { type: kind });
31746
+ }
31747
+ }
31748
+ var configurationNotReadSection;
31749
+ var init_configurationNotRead = __esm({
31750
+ "../core/dist/render/configurationNotRead.js"() {
31751
+ "use strict";
31752
+ init_messages4();
31753
+ init_coreText();
31754
+ init_codeSpan();
31755
+ init_errorEntry();
31756
+ configurationNotReadSection = (report) => {
31757
+ const wrongKinds = report.errors?.configuration?.ofWrongKind ?? [];
31758
+ const unknownKeys = report.errors?.configuration?.keysNotRead ?? [];
31759
+ const runnerKeysNotALayer = report.errors?.configuration?.runnerKeysNotALayer ?? [];
31760
+ const nonChecksMatchingNoStep = report.errors?.configuration?.nonChecksMatchingNoStep ?? [];
31761
+ const nonChecksNotAStepName = report.errors?.configuration?.nonChecksNotAStepName ?? [];
31762
+ if (wrongKinds.length === 0 && unknownKeys.length === 0 && runnerKeysNotALayer.length === 0 && nonChecksMatchingNoStep.length === 0 && nonChecksNotAStepName.length === 0)
31763
+ return [];
31764
+ return [
31765
+ CORE_MESSAGES[CoreMessage.ConfigurationNotReadHeading],
31766
+ "",
31767
+ coreMessage(CoreMessage.ConfigurationNotReadIntro),
31768
+ "",
31769
+ ...wrongKinds.map(({ entry, is, reads }) => errorEntry(CoreError.ConfigurationWrongKind, coreMessage(CoreMessage.ConfigurationWrongKind, { entry: codeSpan(entry), is: kindWords(is), reads: kindWords(reads) }))),
31770
+ ...unknownKeys.map((key) => errorEntry(CoreError.ConfigurationUnknownKey, coreMessage(CoreMessage.ConfigurationUnknownKey, { key: codeSpan(`specController.${key}`) }))),
31771
+ ...runnerKeysNotALayer.map((key) => errorEntry(CoreError.RunnerKeyNotALayer, coreMessage(CoreMessage.RunnerKeyNotALayer, { key: codeSpan(`specController.runners.${key}`) }))),
31772
+ ...nonChecksMatchingNoStep.map((entry) => errorEntry(CoreError.NotChecksEntryMatchesNoStep, coreMessage(CoreMessage.NotChecksEntryMatchesNoStep, { key: "`specController.notChecks`", entry: codeSpan(entry) }))),
31773
+ ...nonChecksNotAStepName.map((entry) => errorEntry(CoreError.NotChecksEntryNotAStepName, coreMessage(CoreMessage.NotChecksEntryNotAStepName, { key: "`specController.notChecks`", entry: codeSpan(entry) }))),
31774
+ ""
31775
+ ];
31776
+ };
31777
+ }
31778
+ });
31779
+
31780
+ // ../core/dist/render/errorsInTheInputs.js
31781
+ var errorsInTheInputsSection;
31782
+ var init_errorsInTheInputs = __esm({
31783
+ "../core/dist/render/errorsInTheInputs.js"() {
31784
+ "use strict";
31785
+ init_configurationNotRead();
31786
+ init_scenarioCodeErrorsSection();
31787
+ init_messages4();
31788
+ errorsInTheInputsSection = (report) => {
31789
+ const parts = [...scenarioCodeErrorsSection(report), ...configurationNotReadSection(report)];
31790
+ if (parts.length === 0)
31791
+ return [];
31792
+ return [CORE_MESSAGES[CoreMessage.ErrorsInTheInputsHeading], "", ...parts];
31793
+ };
31794
+ }
31795
+ });
31796
+
31797
+ // ../core/dist/render/stepAccounting.js
31798
+ var rowOf, jobRowsOf, totalRowOf, STEP_ACCOUNTING_TERMS, tableOf, WHAT_IT_IS, runnersListOf, reconcilerListOf, nonChecksListOf, workflowsReadOf, notAppliedListOf, plumbingListOf, stepAccountingSection;
31799
+ var init_stepAccounting = __esm({
31800
+ "../core/dist/render/stepAccounting.js"() {
31801
+ "use strict";
31802
+ init_uncitedFitnessFunctions();
31803
+ init_messages4();
31804
+ init_cellSafe();
31805
+ init_codeSpan();
31806
+ rowOf = (cells) => `| ${cells.join(" | ")} |`;
31807
+ jobRowsOf = ({ byJob }) => byJob.map((row) => rowOf([
31808
+ cellSafe(row.workflow),
31809
+ cellSafe(row.job),
31810
+ row.stepsRead,
31811
+ row.candidates,
31812
+ row.runners,
31813
+ row.reconciler,
31814
+ row.nonChecks,
31815
+ row.plumbing,
31816
+ accountedForOf(row)
31817
+ ]));
31818
+ totalRowOf = ({ byJob, total }) => {
31819
+ if (byJob.length < 2)
31820
+ return [];
31821
+ const { stepsRead, candidates, runners, reconciler, nonChecks, plumbing } = total;
31822
+ const counts = rowOf([stepsRead, candidates, runners, reconciler, nonChecks, plumbing, accountedForOf(total)]);
31823
+ return [`| ${CORE_MESSAGES[CoreMessage.StepAccountingTotal]} | ${counts}`];
31824
+ };
31825
+ STEP_ACCOUNTING_TERMS = [
31826
+ CoreMessage.StepAccountingCandidatesTerm,
31827
+ CoreMessage.StepAccountingReconcilerTerm,
31828
+ CoreMessage.StepAccountingExcludedTerm,
31829
+ CoreMessage.StepAccountingPlumbingTerm,
31830
+ CoreMessage.StepAccountingAccountedForTerm
31831
+ ];
31832
+ tableOf = (accounting) => {
31833
+ if (accounting.byJob.length === 0)
31834
+ return [];
31835
+ return [
31836
+ ...STEP_ACCOUNTING_TERMS.map((term) => `- ${CORE_MESSAGES[term]}`),
31837
+ "",
31838
+ CORE_MESSAGES[CoreMessage.StepAccountingTableHeader],
31839
+ "| --- | --- | --- | --- | --- | --- | --- | --- | --- |",
31840
+ ...jobRowsOf(accounting),
31841
+ ...totalRowOf(accounting),
31842
+ ""
31843
+ ];
31844
+ };
31845
+ WHAT_IT_IS = {
31846
+ reconciles: CORE_MESSAGES[CoreMessage.ReconcilerReconciles],
31847
+ records: CORE_MESSAGES[CoreMessage.ReconcilerRecords]
31848
+ };
31849
+ runnersListOf = ({ steps }) => {
31850
+ const runners = steps.runners ?? [];
31851
+ if (runners.length === 0)
31852
+ return [];
31853
+ return [CORE_MESSAGES[CoreMessage.StepAccountingRunnersLabel], ...runners.map((step) => `- ${codeSpan(step)}`), ""];
31854
+ };
31855
+ reconcilerListOf = ({ steps }) => {
31856
+ const reconciler = steps.reconciler ?? [];
31857
+ if (reconciler.length === 0)
31858
+ return [];
31859
+ return [
31860
+ CORE_MESSAGES[CoreMessage.StepAccountingReconcilerLabel],
31861
+ ...reconciler.map(({ step, role }) => `- ${CORE_MESSAGES[CoreMessage.ReconcilerStep](codeSpan(step), WHAT_IT_IS[role])}`),
31862
+ ""
31863
+ ];
31864
+ };
31865
+ nonChecksListOf = ({ steps }) => {
31866
+ const nonChecks = steps.nonChecks ?? [];
31867
+ if (nonChecks.length === 0)
31868
+ return [];
31869
+ return [
31870
+ CORE_MESSAGES[CoreMessage.StepAccountingExcludedLabel],
31871
+ ...nonChecks.map((step) => `- ${CORE_MESSAGES[CoreMessage.StepExcluded](codeSpan(step))}`),
31872
+ ""
31873
+ ];
31874
+ };
31875
+ workflowsReadOf = ({ workflowsRead, byJob }) => {
31876
+ const workflows = [...new Set(workflowsRead ?? byJob.map(({ workflow }) => workflow))];
31877
+ if (workflows.length === 0)
31878
+ return CORE_MESSAGES[CoreMessage.StepAccountingNoWorkflowRead];
31879
+ return workflows.map((workflow) => codeSpan(workflow)).join(", ");
31880
+ };
31881
+ notAppliedListOf = (accounting) => {
31882
+ const notApplied = accounting.nonChecksNamingAWorkflowNotRead;
31883
+ if (notApplied === void 0)
31884
+ return [];
31885
+ return [
31886
+ CORE_MESSAGES[CoreMessage.StepAccountingNotAppliedLabel]("`specController.notChecks`", workflowsReadOf(accounting)),
31887
+ ...notApplied.map((entry) => `- ${codeSpan(entry)}`),
31888
+ ""
31889
+ ];
31890
+ };
31891
+ plumbingListOf = ({ steps }) => {
31892
+ const plumbing = steps.plumbing ?? [];
31893
+ if (plumbing.length === 0)
31894
+ return [];
31895
+ return [CORE_MESSAGES[CoreMessage.StepAccountingPlumbingLabel], ...plumbing.map((step) => `- ${codeSpan(step)}`), ""];
31896
+ };
31897
+ stepAccountingSection = (report) => {
31898
+ const accounting = report.summary.stepAccounting;
31899
+ if (accounting === void 0)
31900
+ return [];
31901
+ return [
31902
+ CORE_MESSAGES[CoreMessage.StepAccountingHeading],
31903
+ "",
31904
+ ...tableOf(accounting),
31905
+ ...runnersListOf(accounting),
31906
+ ...reconcilerListOf(accounting),
31907
+ ...nonChecksListOf(accounting),
31908
+ ...notAppliedListOf(accounting),
31909
+ ...plumbingListOf(accounting)
31910
+ ];
31911
+ };
31912
+ }
31913
+ });
31914
+
31915
+ // ../core/dist/render/evidenceObservations.js
31916
+ var runnerCells, evidenceObservationsSection;
31917
+ var init_evidenceObservations = __esm({
31918
+ "../core/dist/render/evidenceObservations.js"() {
31919
+ "use strict";
31920
+ init_messages4();
31921
+ init_cellSafe();
31922
+ init_reportedName();
31923
+ runnerCells = ({ qualityCheckKind, count, runner, ciSteps }) => {
31924
+ if (typeof runner === "string") {
31925
+ return [
31926
+ cellSafe(runner),
31927
+ ciSteps ? cellSafeKeepingCodeSpans(ciSteps.map(reportedName).join(", ")) : CORE_MESSAGES[CoreMessage.NoStepCountedAsItsRunnerRunsIt]
31928
+ ];
32002
31929
  }
32003
- /** advance the parser through all whitespace to the next non-whitespace code unit. */
32004
- bumpSpace() {
32005
- while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump();
31930
+ if (qualityCheckKind === "fitness") {
31931
+ if (count === 0)
31932
+ return ["", ""];
31933
+ return [CORE_MESSAGES[CoreMessage.FitnessRunner], ciSteps ? CORE_MESSAGES[CoreMessage.FitnessCiStep](ciSteps.length) : ""];
32006
31934
  }
32007
- /**
32008
- * Peek at the *next* Unicode codepoint in the input without advancing the parser.
32009
- * If the input has been exhausted, then this returns null.
32010
- */
32011
- peek() {
32012
- if (this.isEOF()) return null;
32013
- const code = this.char();
32014
- const offset = this.offset();
32015
- return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null;
31935
+ if (runner === void 0)
31936
+ return [CORE_MESSAGES[CoreMessage.RunnerLayerUnnamed], ""];
31937
+ return [CORE_MESSAGES[CoreMessage.RunnerLayerNamesNone], ""];
31938
+ };
31939
+ evidenceObservationsSection = (report) => {
31940
+ const observations = report.summary.evidenceObservations;
31941
+ if (!observations)
31942
+ return [];
31943
+ const lines = [
31944
+ CORE_MESSAGES[CoreMessage.EvidenceObservationsHeading],
31945
+ "",
31946
+ CORE_MESSAGES[CoreMessage.EvidenceObservationsSum](observations.total, observations.onScenario, observations.onPhantomClaim, observations.onUnnamedClaim),
31947
+ "",
31948
+ CORE_MESSAGES[CoreMessage.EvidenceObservationsTableHeader],
31949
+ "| --- | --- | --- | --- |"
31950
+ ];
31951
+ for (const entry of observations.byQualityCheckKind) {
31952
+ const [runner, ciSteps] = runnerCells(entry);
31953
+ lines.push(`| ${entry.qualityCheckKind} | ${entry.count} | ${runner} | ${ciSteps} |`);
32016
31954
  }
31955
+ lines.push("");
31956
+ return lines;
32017
31957
  };
32018
31958
  }
32019
31959
  });
32020
31960
 
32021
- // ../../node_modules/.pnpm/intl-messageformat@12.1.4/node_modules/intl-messageformat/index.js
32022
- function mergeLiteral(parts) {
32023
- if (parts.length < 2) return parts;
32024
- return parts.reduce((all, part) => {
32025
- const lastPart = all[all.length - 1];
32026
- if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part);
32027
- else lastPart.value += part.value;
32028
- return all;
32029
- }, []);
31961
+ // ../core/dist/render/evidenceGrid.js
31962
+ function evidenceColumns(claims) {
31963
+ const scenarioRows = claims.filter(isScenario);
31964
+ return QUALITY_CHECK_KINDS.filter((qualityCheckKind) => scenarioRows.some((row) => carriesQualityCheckKind(row, qualityCheckKind)));
31965
+ }
31966
+ function columnHeader(qualityCheckKind) {
31967
+ return qualityCheckKind.charAt(0).toUpperCase() + qualityCheckKind.slice(1);
31968
+ }
31969
+ function evidenceCell(s, qualityCheckKind) {
31970
+ if (!isScenario(s))
31971
+ return "\u2014";
31972
+ const left = namesQualityCheckKind(s, qualityCheckKind) ? QUALITY_CHECK_KIND_LETTER[qualityCheckKind] : "-";
31973
+ const observed = observationCountOf(s, qualityCheckKind);
31974
+ const right = observed > 0 ? String(observed) : "-";
31975
+ return left === "-" && right === "-" ? "" : `${left}/${right}`;
31976
+ }
31977
+ var QUALITY_CHECK_KIND_LETTER;
31978
+ var init_evidenceGrid = __esm({
31979
+ "../core/dist/render/evidenceGrid.js"() {
31980
+ "use strict";
31981
+ init_journal();
31982
+ init_claimReconciliation();
31983
+ QUALITY_CHECK_KIND_LETTER = {
31984
+ fitness: "F",
31985
+ unit: "U",
31986
+ integration: "I",
31987
+ e2e: "E",
31988
+ performance: "P"
31989
+ };
31990
+ }
31991
+ });
31992
+
31993
+ // ../core/dist/render/remarkWords.js
31994
+ function noteWords(note) {
31995
+ switch (note.kind) {
31996
+ case "several-scn-codes":
31997
+ return CORE_MESSAGES[CoreMessage.SeveralScnCodes](note.codes);
31998
+ case "shared-scn-code":
31999
+ return CORE_MESSAGES[CoreMessage.SharedScnCode](note.code);
32000
+ case "ambiguous-step":
32001
+ return note.step === void 0 ? CORE_MESSAGES[CoreMessage.AmbiguousUnnamedStep] : CORE_MESSAGES[CoreMessage.AmbiguousNamedStep](note.step);
32002
+ case "check-step-did-not-run":
32003
+ return checkStepWords(note.code, note.outcome);
32004
+ }
32005
+ }
32006
+ function checkStepWords(code, outcome) {
32007
+ if (outcome === void 0)
32008
+ return CORE_MESSAGES[CoreMessage.CheckStepNoOutcome](code);
32009
+ if (outcome === "skipped")
32010
+ return CORE_MESSAGES[CoreMessage.CheckStepSkipped](code);
32011
+ return CORE_MESSAGES[CoreMessage.CheckStepEnded](code, outcome);
32012
+ }
32013
+ function remarkWordsOf({ message: message2, notes = [] }) {
32014
+ const words2 = [...message2 === void 0 || message2.trim() === "" ? [] : [message2], ...notes.map(noteWords)];
32015
+ return words2.length === 0 ? void 0 : words2.join(" ");
32016
+ }
32017
+ function remarkHeadlineOf({ message: message2, notes = [] }, quote) {
32018
+ const headline = message2?.split("\n").map((line) => line.replace(/\s+/g, " ").trim()).find((line) => line.length > 0);
32019
+ return remarkWordsOf({ ...headline === void 0 ? {} : { message: quote(headline) }, notes });
32020
+ }
32021
+ var init_remarkWords = __esm({
32022
+ "../core/dist/render/remarkWords.js"() {
32023
+ "use strict";
32024
+ init_messages4();
32025
+ }
32026
+ });
32027
+
32028
+ // ../core/dist/domain/unnamedClaimGroups.js
32029
+ function citingNoScenario(lines) {
32030
+ return lines.filter((line) => line.outcome === "cites-no-scenario").flatMap((line) => line.evidenceObservation ?? []);
32031
+ }
32032
+ function sharedScnCodeOf(observation) {
32033
+ const [code = null] = (observation.notes ?? []).flatMap((note) => note.kind === "shared-scn-code" ? [note.code] : []);
32034
+ return code;
32035
+ }
32036
+ function remarksOf(observations) {
32037
+ return observations.flatMap(({ message: message2, notes = [] }) => {
32038
+ const kept = notes.filter((note) => note.kind !== "shared-scn-code");
32039
+ return message2 === void 0 && kept.length === 0 ? [] : [{ ...message2 !== void 0 ? { message: message2 } : {}, ...kept.length > 0 ? { notes: kept } : {} }];
32040
+ });
32041
+ }
32042
+ function groupOf(sharedScnCode, observations) {
32043
+ const [first] = observations;
32044
+ const passed = observations.filter((o) => o.status === "passed").length;
32045
+ return {
32046
+ qualityCheckKind: first.qualityCheckKind,
32047
+ locator: first.locator,
32048
+ ...sharedScnCode === null ? {} : { sharedScnCode },
32049
+ remarks: remarksOf(observations),
32050
+ ran: observations.length,
32051
+ passed,
32052
+ failed: observations.length - passed,
32053
+ failedNames: observations.flatMap((o) => o.status === "failed" && o.testName !== void 0 ? [o.testName] : [])
32054
+ };
32055
+ }
32056
+ function stepsGroupsOf(observations) {
32057
+ const byCode = /* @__PURE__ */ new Map();
32058
+ for (const o of observations) {
32059
+ if (!isFitnessObservation(o))
32060
+ continue;
32061
+ const code = sharedScnCodeOf(o);
32062
+ byCode.set(code, [...byCode.get(code) ?? [], o.step ?? o.fitnessFunction]);
32063
+ }
32064
+ return [...byCode].map(([code, names]) => code === null ? { names } : { names, sharedScnCode: code });
32065
+ }
32066
+ function unnamedClaimGroupsOf(lines) {
32067
+ const observations = citingNoScenario(lines);
32068
+ const byFile = /* @__PURE__ */ new Map();
32069
+ for (const o of observations) {
32070
+ if (isFitnessObservation(o))
32071
+ continue;
32072
+ const code = sharedScnCodeOf(o);
32073
+ const key = JSON.stringify([o.qualityCheckKind, o.locator ?? null, code]);
32074
+ byFile.set(key, { code, members: [...byFile.get(key)?.members ?? [], o] });
32075
+ }
32076
+ return [...[...byFile.values()].map(({ code, members }) => groupOf(code, members)), ...stepsGroupsOf(observations)];
32077
+ }
32078
+ var init_unnamedClaimGroups = __esm({
32079
+ "../core/dist/domain/unnamedClaimGroups.js"() {
32080
+ "use strict";
32081
+ init_journal();
32082
+ }
32083
+ });
32084
+
32085
+ // ../core/dist/render/markdown.js
32086
+ function renderLine(line) {
32087
+ const sentence = `${OUTCOME_DESCRIPTION[line.outcome]}${scenarioClauseOf(line)}`;
32088
+ if (line.outcome === "both-missing" || line.outcome === "no-scn-code" || line.qualityCheckKind === void 0) {
32089
+ return sentence;
32090
+ }
32091
+ const head = `${line.qualityCheckKind}: ${sentence}`;
32092
+ const observation = line.evidenceObservation;
32093
+ if (observation === void 0)
32094
+ return head;
32095
+ if (!isObservationOnly(line.outcome))
32096
+ return `${head}${namedSuffix(observation)}`;
32097
+ return `${head}${line.outcome === "broken" ? brokenSuffix(observation) : observationSuffix(observation)}`;
32098
+ }
32099
+ function quotedSuffix(parts) {
32100
+ const where = parts.flatMap((part) => part?.trim() || []).join(": ");
32101
+ return where === "" ? "" : ` (${where})`;
32102
+ }
32103
+ function namedSuffix(o) {
32104
+ return quotedSuffix((isFitnessObservation(o) ? [o.fitnessFunction] : [o.locator, o.testName]).map(reported));
32105
+ }
32106
+ function scenarioClauseOf({ scenario }) {
32107
+ return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](reportedName(scenario.feature), reportedName(scenario.title))}`;
32108
+ }
32109
+ function brokenSuffix(o) {
32110
+ return quotedSuffix([reported(o.locator), remarkHeadlineOf(o, reportedName)]);
32111
+ }
32112
+ function observationSuffix(o) {
32113
+ return `${namedSuffix(o)}${resultOf(o)}`;
32114
+ }
32115
+ function resultOf(o) {
32116
+ return o.status === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[RESULT_MESSAGE[o.status]]}`;
32117
+ }
32118
+ function renderPendingItem(item) {
32119
+ return item.qualityCheckKind === void 0 ? CORE_MESSAGES[CoreMessage.PendingItem] : CORE_MESSAGES[CoreMessage.PendingItemFor](item.qualityCheckKind);
32120
+ }
32121
+ function renderFileGroup(group) {
32122
+ const remarks = group.remarks.flatMap((remark) => remarkHeadlineOf(remark, reportedName) ?? []);
32123
+ const code = group.sharedScnCode === void 0 ? [] : [CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)];
32124
+ const said = [.../* @__PURE__ */ new Set([...code, ...remarks])].filter((part) => part !== "").join(" / ");
32125
+ const counts = CORE_MESSAGES[CoreMessage.UnnamedClaimGroupCounts](group.ran, group.passed, group.failed);
32126
+ const names = group.failedNames.map(reportedName).filter((name) => name !== "");
32127
+ const failed = names.length === 0 ? "" : ` ${CORE_MESSAGES[CoreMessage.UnnamedClaimFailedNames](names)}`;
32128
+ return `${group.qualityCheckKind}: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${quotedSuffix([reported(group.locator), said])} \u2014 ${counts}${failed}`;
32129
+ }
32130
+ function renderUnnamedClaimGroup(group) {
32131
+ if (!("names" in group))
32132
+ return renderFileGroup(group);
32133
+ const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names.map(reportedName));
32134
+ const remark = group.sharedScnCode === void 0 ? "" : ` (${CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)})`;
32135
+ return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${remark} \u2014 ${steps}`;
32136
+ }
32137
+ function renderUnnamedClaimItems(lines) {
32138
+ const broken = lines.filter((line) => line.outcome === "broken");
32139
+ return [...broken.map(renderLine), ...unnamedClaimGroupsOf(lines).map(renderUnnamedClaimGroup)];
32140
+ }
32141
+ function renderRowExceptions(s) {
32142
+ const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
32143
+ const reconciling = items.map(cellSafeKeepingCodeSpans).join("; ");
32144
+ const pending = s.pendingItems.map(renderPendingItem).join("; ");
32145
+ const groups = [reconciling, pending].filter((g) => g.length > 0);
32146
+ return groups.length === 0 ? "\u2014" : groups.join("; ");
32147
+ }
32148
+ function pendingTally(pending) {
32149
+ return pending > 0 ? ["", CORE_MESSAGES[CoreMessage.PendingTally](pending)] : [];
32150
+ }
32151
+ function byFeatureTableLines(groups) {
32152
+ if (groups.length === 0)
32153
+ return [];
32154
+ const lines = [CORE_MESSAGES[CoreMessage.ByFeatureTableHeader], "| --- | --- | --- |"];
32155
+ for (const group of groups) {
32156
+ const label = group.featureFile ? `${group.featureFile} (${group.feature})` : group.feature;
32157
+ lines.push(`| ${label} | ${group.count} | ${idsCell(group)} |`);
32158
+ }
32159
+ lines.push("");
32160
+ return lines;
32161
+ }
32162
+ function idsCell(group) {
32163
+ const ids = group.claims.join(", ");
32164
+ const noScnCodeCount = group.scenariosWithNoScnCode ?? 0;
32165
+ if (noScnCodeCount === 0)
32166
+ return ids;
32167
+ const noScnCode = CORE_MESSAGES[CoreMessage.NoScnCodeScenarios](noScnCodeCount);
32168
+ return ids === "" ? noScnCode : `${ids}${CORE_MESSAGES[CoreMessage.AndJoiner]}${noScnCode}`;
32030
32169
  }
32031
- function isFormatXMLElementFn(el) {
32032
- return typeof el === "function";
32170
+ function ungroupedOutOfBalance(totals) {
32171
+ return [
32172
+ ...totals.phantomClaim > 0 ? [CORE_MESSAGES[CoreMessage.PhantomClaimReconciliations](totals.phantomClaim)] : [],
32173
+ ...totals.unnamedClaim > 0 ? [CORE_MESSAGES[CoreMessage.UnnamedClaimReconciliations](totals.unnamedClaim)] : []
32174
+ ];
32033
32175
  }
32034
- function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
32035
- if (els.length === 1 && isLiteralElement(els[0])) return [{
32036
- type: 0,
32037
- value: els[0].value
32038
- }];
32039
- const result = [];
32040
- for (const el of els) {
32041
- if (isLiteralElement(el)) {
32042
- result.push({
32043
- type: 0,
32044
- value: el.value
32045
- });
32046
- continue;
32047
- }
32048
- if (isPoundElement(el)) {
32049
- if (typeof currentPluralValue === "number") result.push({
32050
- type: 0,
32051
- value: formatters.getNumberFormat(locales).format(currentPluralValue)
32052
- });
32053
- continue;
32054
- }
32055
- const { value: varName } = el;
32056
- if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage);
32057
- let value = values[varName];
32058
- if (isArgumentElement(el)) {
32059
- if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : "";
32060
- result.push({
32061
- type: typeof value === "string" ? 0 : 1,
32062
- value
32063
- });
32064
- continue;
32065
- }
32066
- if (isDateElement(el)) {
32067
- const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
32068
- result.push({
32069
- type: 0,
32070
- value: formatters.getDateTimeFormat(locales, style).format(value)
32071
- });
32072
- continue;
32073
- }
32074
- if (isTimeElement(el)) {
32075
- const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
32076
- result.push({
32077
- type: 0,
32078
- value: formatters.getDateTimeFormat(locales, style).format(value)
32079
- });
32080
- continue;
32081
- }
32082
- if (isNumberElement(el)) {
32083
- const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
32084
- if (style && style.scale) {
32085
- const scale = style.scale || 1;
32086
- if (typeof value === "bigint") {
32087
- if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`);
32088
- value = value * BigInt(scale);
32089
- } else value = value * scale;
32090
- }
32091
- result.push({
32092
- type: 0,
32093
- value: formatters.getNumberFormat(locales, style).format(value)
32094
- });
32095
- continue;
32096
- }
32097
- if (isTagElement(el)) {
32098
- const { children, value: value2 } = el;
32099
- const formatFn = values[value2];
32100
- if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value2, "function", originalMessage);
32101
- let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value));
32102
- if (!Array.isArray(chunks)) chunks = [chunks];
32103
- result.push(...chunks.map((c) => {
32104
- return {
32105
- type: typeof c === "string" ? 0 : 1,
32106
- value: c
32107
- };
32108
- }));
32109
- }
32110
- if (isSelectElement(el)) {
32111
- const key = value;
32112
- const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other;
32113
- if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
32114
- result.push(...formatToParts(opt.value, locales, formatters, formats, values));
32115
- continue;
32116
- }
32117
- if (isPluralElement(el)) {
32118
- const exactKey = `=${value}`;
32119
- let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0;
32120
- if (!opt) {
32121
- if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment.
32122
- Try polyfilling it using "@formatjs/intl-pluralrules"
32123
- `, "MISSING_INTL_API", originalMessage);
32124
- const numericValue2 = typeof value === "bigint" ? Number(value) : value;
32125
- const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue2 - (el.offset || 0));
32126
- opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other;
32127
- }
32128
- if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
32129
- const numericValue = typeof value === "bigint" ? Number(value) : value;
32130
- result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0)));
32131
- continue;
32132
- }
32176
+ function ungroupedTail(ungrouped) {
32177
+ return ungrouped.length > 0 ? `; ${CORE_MESSAGES[CoreMessage.NotGroupedByFeature](ungrouped.join(CORE_MESSAGES[CoreMessage.AndJoiner]))}` : "";
32178
+ }
32179
+ function evidenceKeyLines(columns) {
32180
+ if (columns.length === 0)
32181
+ return [];
32182
+ return [...CORE_MESSAGES[CoreMessage.EvidenceCellKey].split("\n"), CORE_MESSAGES[CoreMessage.WatermelonItemKey], ""];
32183
+ }
32184
+ function ledgerTallyLines(totals) {
32185
+ const lines = [
32186
+ `- ${CORE_MESSAGES[CoreMessage.ClaimReconciliationTally](totals.total, totals.balanced, totals.outOfBalance)}`
32187
+ ];
32188
+ if (totals.phantomClaim > 0) {
32189
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.PhantomClaimTally](totals.phantomClaim)}`);
32133
32190
  }
32134
- return mergeLiteral(result);
32191
+ if (totals.unnamedClaim > 0) {
32192
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.UnnamedClaimTally](totals.unnamedClaim)}`);
32193
+ }
32194
+ return lines;
32135
32195
  }
32136
- function mergeConfig(c1, c2) {
32137
- if (!c2) return c1;
32138
- return {
32139
- ...c1,
32140
- ...c2,
32141
- ...Object.keys(c1).reduce((all, k) => {
32142
- all[k] = {
32143
- ...c1[k],
32144
- ...c2[k]
32145
- };
32146
- return all;
32147
- }, {})
32148
- };
32196
+ function censusLines(codes, scenarios) {
32197
+ if (codes?.excludedOccurrences === void 0)
32198
+ return [];
32199
+ const lines = [`- ${CORE_MESSAGES[CoreMessage.ExcludedScnOccurrences](codes.excludedOccurrences)}`];
32200
+ const untagged = (codes.untaggedScenarios ?? []).length;
32201
+ if (untagged > 0)
32202
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.UntaggedScenarios](untagged)}`);
32203
+ lines.push(...sharedScnCodeLines(codes.sharedScnCodes ?? [], scenarios));
32204
+ return lines;
32149
32205
  }
32150
- function mergeConfigs(defaultConfig, configs) {
32151
- if (!configs) return defaultConfig;
32152
- return Object.keys(defaultConfig).reduce((all, k) => {
32153
- all[k] = mergeConfig(defaultConfig[k], configs[k]);
32154
- return all;
32155
- }, { ...defaultConfig });
32206
+ function sharedScnCodeLines(shared, scenarios) {
32207
+ if (shared.length === 0)
32208
+ return [];
32209
+ return [
32210
+ `- ${CORE_MESSAGES[CoreMessage.SharedScnCodes](scenarios, shared.length)}`,
32211
+ ...shared.map((code) => ` - ${code.scnId}: ${code.scenarios.map((s) => `${s.feature} : ${s.scenario}`).join("; ")}`)
32212
+ ];
32156
32213
  }
32157
- function createFastMemoizeCache(store) {
32158
- return { create() {
32159
- return {
32160
- get(key) {
32161
- return store[key];
32162
- },
32163
- set(key, value) {
32164
- store[key] = value;
32165
- }
32166
- };
32167
- } };
32214
+ function ledgerTableLines(claims, columns, stepsByQualityCheckKind) {
32215
+ const withSteps2 = columns.length > 0;
32216
+ const headers = [
32217
+ CORE_MESSAGES[CoreMessage.ClaimColumn],
32218
+ ...columns.map(columnHeader),
32219
+ CORE_MESSAGES[CoreMessage.VerdictColumn],
32220
+ CORE_MESSAGES[CoreMessage.ReconcilingItemsColumn],
32221
+ ...withSteps2 ? [CORE_MESSAGES[CoreMessage.CiStepsColumn]] : []
32222
+ ];
32223
+ const lines = [`| ${headers.join(" | ")} |`, `| ${headers.map(() => "---").join(" | ")} |`];
32224
+ for (const s of claims) {
32225
+ const cells = columns.map((col) => evidenceCell(s, col));
32226
+ const items = renderRowExceptions(s);
32227
+ const steps = withSteps2 ? [cellSafeKeepingCodeSpans(ciStepsOf(s, stepsByQualityCheckKind).map(reportedName).join(", "))] : [];
32228
+ lines.push(`| ${[s.claim, ...cells, s.verdict, items, ...steps].join(" | ")} |`);
32229
+ }
32230
+ return lines;
32168
32231
  }
32169
- function createDefaultFormatters(cache = {
32170
- number: {},
32171
- dateTime: {},
32172
- pluralRules: {}
32173
- }) {
32174
- return {
32175
- getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {
32176
- cache: createFastMemoizeCache(cache.number),
32177
- strategy: strategies.variadic
32178
- }),
32179
- getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {
32180
- cache: createFastMemoizeCache(cache.dateTime),
32181
- strategy: strategies.variadic
32182
- }),
32183
- getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {
32184
- cache: createFastMemoizeCache(cache.pluralRules),
32185
- strategy: strategies.variadic
32186
- })
32187
- };
32232
+ function renderReport(report, inputNames, exitCodeOf2) {
32233
+ return SECTIONS.flatMap((section) => section(report, inputNames, exitCodeOf2)).join("\n");
32188
32234
  }
32189
- var FormatError, InvalidValueError, InvalidValueTypeError, MissingValueError, IntlMessageFormat;
32190
- var init_intl_messageformat = __esm({
32191
- "../../node_modules/.pnpm/intl-messageformat@12.1.4/node_modules/intl-messageformat/index.js"() {
32192
- init_fast_memoize();
32193
- init_icu_messageformat_parser();
32194
- FormatError = class extends Error {
32195
- constructor(msg, code, originalMessage) {
32196
- super(msg);
32197
- this.code = code;
32198
- this.originalMessage = originalMessage;
32199
- }
32200
- toString() {
32201
- return `[formatjs Error: ${this.code}] ${this.message}`;
32202
- }
32235
+ var reported, RESULT_MESSAGE, titleSection, runIntegritySection, summaryViewsSection, EVIDENCE_RECONCILIATION_COLUMNS, EVIDENCE_RECONCILIATION_TERMS, evidenceReconciliationSection, byFeatureSection, ledgerSection, SECTIONS;
32236
+ var init_markdown = __esm({
32237
+ "../core/dist/render/markdown.js"() {
32238
+ "use strict";
32239
+ init_model();
32240
+ init_outcomeDescription();
32241
+ init_cellSafe();
32242
+ init_reportedName();
32243
+ init_qualityCheckReconciliation();
32244
+ init_journal();
32245
+ init_ledger();
32246
+ init_claimReconciliation();
32247
+ init_ledger();
32248
+ init_runVerdict2();
32249
+ init_scenarioCodeErrorsSection();
32250
+ init_provenanceSection();
32251
+ init_errorsInTheInputs();
32252
+ init_stepAccounting();
32253
+ init_evidenceObservations();
32254
+ init_evidenceGrid();
32255
+ init_messages4();
32256
+ init_remarkWords();
32257
+ init_codeSpan();
32258
+ init_unnamedClaimGroups();
32259
+ reported = (part) => part === void 0 ? void 0 : reportedName(part);
32260
+ RESULT_MESSAGE = {
32261
+ passed: CoreMessage.ObservationPassed,
32262
+ failed: CoreMessage.ObservationFailed
32203
32263
  };
32204
- InvalidValueError = class extends FormatError {
32205
- constructor(variableId, value, options, originalMessage) {
32206
- super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join('", "')}"`, "INVALID_VALUE", originalMessage);
32264
+ titleSection = () => [CORE_MESSAGES[CoreMessage.ReportTitle], ""];
32265
+ runIntegritySection = (report) => {
32266
+ if (!hasBrokenEvidence({ claimReconciliations: report.ledger.claimReconciliations }))
32267
+ return [];
32268
+ const brokenObservations = brokenItemsOf({
32269
+ claimReconciliations: report.ledger.claimReconciliations
32270
+ }).flatMap((line) => line.evidenceObservation ?? []);
32271
+ const count = brokenObservations.length;
32272
+ const proofs = count === 1 ? CORE_MESSAGES[CoreMessage.OneProofNeverRan] : CORE_MESSAGES[CoreMessage.ProofsNeverRan](count);
32273
+ const lines = [
32274
+ CORE_MESSAGES[CoreMessage.RunIntegrityHeading],
32275
+ "",
32276
+ CORE_MESSAGES[CoreMessage.RunUnsound](proofs),
32277
+ ""
32278
+ ];
32279
+ for (const item of brokenObservations) {
32280
+ const locator = item.locator?.trim() ? item.locator : CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
32281
+ lines.push(`- ${CORE_MESSAGES[CoreMessage.BrokenEvidenceWhatBroke](`\`${locator}\``)}`);
32282
+ lines.push("");
32283
+ lines.push(...fencedBlockLines("text", remarkWordsOf(item) ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNoMessage]));
32284
+ lines.push("");
32207
32285
  }
32286
+ return lines;
32208
32287
  };
32209
- InvalidValueTypeError = class extends FormatError {
32210
- constructor(value, type, originalMessage) {
32211
- super(`Value for "${value}" must be of type ${type}`, "INVALID_VALUE", originalMessage);
32288
+ summaryViewsSection = () => [CORE_MESSAGES[CoreMessage.SummaryViewsHeading], ""];
32289
+ EVIDENCE_RECONCILIATION_COLUMNS = [
32290
+ CORE_MESSAGES[CoreMessage.SubjectColumn],
32291
+ CORE_MESSAGES[CoreMessage.TotalColumn],
32292
+ CORE_MESSAGES[CoreMessage.BalancedColumn],
32293
+ CORE_MESSAGES[CoreMessage.OutOfBalanceColumn],
32294
+ CORE_MESSAGES[CoreMessage.DetailColumn]
32295
+ ];
32296
+ EVIDENCE_RECONCILIATION_TERMS = [
32297
+ CoreMessage.EvidenceReconciliationClaimReconciliationTerm,
32298
+ CoreMessage.EvidenceReconciliationReconciliationLineTerm,
32299
+ CoreMessage.EvidenceReconciliationEvidenceObligationTerm,
32300
+ CoreMessage.EvidenceReconciliationEvidenceObservationTerm
32301
+ ];
32302
+ evidenceReconciliationSection = (report) => {
32303
+ const { claimReconciliations, reconciliationLines, pending } = report.summary.evidenceReconciliation;
32304
+ const row = (cells) => `| ${cells.join(" | ")} |`;
32305
+ const missingSplit = reconciliationLines.missingByQualityCheckKind.map(({ subject, count }) => `${count} ${subject}`).join(" + ");
32306
+ const lines = [
32307
+ CORE_MESSAGES[CoreMessage.EvidenceReconciliationHeading],
32308
+ "",
32309
+ ...EVIDENCE_RECONCILIATION_TERMS.map((term) => `- ${CORE_MESSAGES[term]}`),
32310
+ "",
32311
+ row(EVIDENCE_RECONCILIATION_COLUMNS),
32312
+ row(["---", "---", "---", "---", "---"]),
32313
+ row([
32314
+ CORE_MESSAGES[CoreMessage.ClaimReconciliationSubject],
32315
+ String(claimReconciliations.total),
32316
+ String(claimReconciliations.balanced),
32317
+ String(claimReconciliations.outOfBalance),
32318
+ ""
32319
+ ]),
32320
+ row([
32321
+ CORE_MESSAGES[CoreMessage.ReconciliationLineSubject],
32322
+ String(reconciliationLines.total),
32323
+ String(reconciliationLines.byOutcome.satisfied),
32324
+ String(reconciliationLines.outOfBalance),
32325
+ ""
32326
+ ])
32327
+ ];
32328
+ for (const outcome of OUT_OF_BALANCE_OUTCOMES) {
32329
+ const detail = outcome === "missing" ? missingSplit : "";
32330
+ lines.push(row([OUTCOME_DESCRIPTION[outcome], "", "", String(reconciliationLines.byOutcome[outcome]), detail]));
32212
32331
  }
32332
+ lines.push(...pendingTally(pending));
32333
+ lines.push("");
32334
+ return lines;
32213
32335
  };
32214
- MissingValueError = class extends FormatError {
32215
- constructor(variableId, originalMessage) {
32216
- super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, "MISSING_VALUE", originalMessage);
32217
- }
32336
+ byFeatureSection = (report) => {
32337
+ const rows = report.ledger.claimReconciliations;
32338
+ const scenarios = rows.filter(isScenario);
32339
+ const groups = report.summary.outOfBalanceByFeature ?? [];
32340
+ const ungrouped = ungroupedOutOfBalance(report.summary.evidenceReconciliation.claimReconciliations);
32341
+ if (groups.length === 0 && ungrouped.length === 0)
32342
+ return [];
32343
+ const head = CORE_MESSAGES[CoreMessage.ScenarioClaimReconciliationsOutOfBalance](outOfBalanceCountOf(scenarios), scenarios.length);
32344
+ return [
32345
+ CORE_MESSAGES[CoreMessage.OutOfBalanceByFeatureHeading],
32346
+ "",
32347
+ `${head}${groups.length > 0 ? CORE_MESSAGES[CoreMessage.GroupedByFeature] : ""}${ungroupedTail(ungrouped)}.`,
32348
+ "",
32349
+ ...byFeatureTableLines(groups)
32350
+ ];
32218
32351
  };
32219
- IntlMessageFormat = class IntlMessageFormat2 {
32220
- constructor(message2, locales = IntlMessageFormat2.defaultLocale, overrideFormats, opts) {
32221
- this.formatterCache = {
32222
- number: {},
32223
- dateTime: {},
32224
- pluralRules: {}
32225
- };
32226
- this.format = ((values) => {
32227
- const parts = this.formatToParts(values);
32228
- if (parts.length === 1) return parts[0].value;
32229
- const result = parts.reduce((all, part) => {
32230
- if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value);
32231
- else all[all.length - 1] += part.value;
32232
- return all;
32233
- }, []);
32234
- if (result.length <= 1) return result[0] || "";
32235
- return result;
32236
- });
32237
- this.formatToParts = ((values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message));
32238
- this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] });
32239
- this.getAst = () => this.ast;
32240
- this.locales = locales;
32241
- this.resolvedLocale = IntlMessageFormat2.resolveLocale(locales);
32242
- if (typeof message2 === "string") {
32243
- this.message = message2;
32244
- if (!IntlMessageFormat2.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
32245
- const { ...parseOpts } = opts || {};
32246
- this.ast = IntlMessageFormat2.__parse(message2, {
32247
- ...parseOpts,
32248
- locale: this.resolvedLocale
32249
- });
32250
- } else this.ast = message2;
32251
- if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST.");
32252
- this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats);
32253
- this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
32254
- }
32255
- static {
32256
- this.memoizedDefaultLocale = null;
32257
- }
32258
- static get defaultLocale() {
32259
- if (!IntlMessageFormat2.memoizedDefaultLocale) IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
32260
- return IntlMessageFormat2.memoizedDefaultLocale;
32261
- }
32262
- static {
32263
- this.resolveLocale = (locales) => {
32264
- if (typeof Intl.Locale === "undefined") return;
32265
- const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
32266
- if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]);
32267
- return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
32268
- };
32269
- }
32270
- static {
32271
- this.__parse = parse3;
32272
- }
32273
- static {
32274
- this.formats = {
32275
- number: {
32276
- integer: { maximumFractionDigits: 0 },
32277
- currency: { style: "currency" },
32278
- percent: { style: "percent" }
32279
- },
32280
- date: {
32281
- short: {
32282
- month: "numeric",
32283
- day: "numeric",
32284
- year: "2-digit"
32285
- },
32286
- medium: {
32287
- month: "short",
32288
- day: "numeric",
32289
- year: "numeric"
32290
- },
32291
- long: {
32292
- month: "long",
32293
- day: "numeric",
32294
- year: "numeric"
32295
- },
32296
- full: {
32297
- weekday: "long",
32298
- month: "long",
32299
- day: "numeric",
32300
- year: "numeric"
32301
- }
32302
- },
32303
- time: {
32304
- short: {
32305
- hour: "numeric",
32306
- minute: "numeric"
32307
- },
32308
- medium: {
32309
- hour: "numeric",
32310
- minute: "numeric",
32311
- second: "numeric"
32312
- },
32313
- long: {
32314
- hour: "numeric",
32315
- minute: "numeric",
32316
- second: "numeric",
32317
- timeZoneName: "short"
32318
- },
32319
- full: {
32320
- hour: "numeric",
32321
- minute: "numeric",
32322
- second: "numeric",
32323
- timeZoneName: "short"
32324
- }
32325
- }
32326
- };
32327
- }
32352
+ ledgerSection = (report) => {
32353
+ const scenarioRows = report.ledger.claimReconciliations.filter(isScenario);
32354
+ const phantomClaimRows2 = report.ledger.claimReconciliations.filter(isPhantomClaim);
32355
+ const unnamedClaimRows2 = report.ledger.claimReconciliations.filter(isUnnamedClaim);
32356
+ const claims = [...scenarioRows, ...phantomClaimRows2, ...unnamedClaimRows2];
32357
+ const columns = report.summary.evidenceObservations !== void 0 ? evidenceColumns(claims) : [];
32358
+ return [
32359
+ CORE_MESSAGES[CoreMessage.ClaimReconciliationsHeading],
32360
+ "",
32361
+ ...ledgerTallyLines(report.summary.evidenceReconciliation.claimReconciliations),
32362
+ ...censusLines(report.scenarioCodes, scenarioRows.length),
32363
+ "",
32364
+ ...evidenceKeyLines(columns),
32365
+ ...ledgerTableLines(claims, columns, report.summary.evidenceObservations?.byQualityCheckKind ?? []),
32366
+ ""
32367
+ ];
32328
32368
  };
32369
+ SECTIONS = [
32370
+ titleSection,
32371
+ provenanceSection,
32372
+ errorsInTheInputsSection,
32373
+ runIntegritySection,
32374
+ summaryViewsSection,
32375
+ (report, _inputNames, exitCodeOf2) => runVerdictSection(report, exitCodeOf2),
32376
+ scenarioCodesCleanStatement,
32377
+ evidenceReconciliationSection,
32378
+ evidenceObservationsSection,
32379
+ stepAccountingSection,
32380
+ byFeatureSection,
32381
+ ledgerSection
32382
+ ];
32329
32383
  }
32330
32384
  });
32331
32385
 
32332
- // ../core/dist/render/message.js
32333
- function messagesFrom(texts) {
32334
- return (code, ...values) => new IntlMessageFormat(texts[code], "en", void 0, { ignoreTag: true }).formatToParts(values[0]).map((part) => part.value).join("");
32386
+ // ../core/dist/assemble/composers.js
32387
+ function renderMarkdown(evidenceReconciliation, ctx, exitCodeOf2, evidenceObligations2, featureNames) {
32388
+ return renderReport(assembleRenderInput(evidenceReconciliation, ctx, evidenceObligations2, featureNames), ctx.inputs, exitCodeOf2);
32335
32389
  }
32336
- var init_message = __esm({
32337
- "../core/dist/render/message.js"() {
32390
+ function renderJson(evidenceReconciliation, ctx, evidenceObligations2, featureNames) {
32391
+ return JSON.stringify(assembleRenderInput(evidenceReconciliation, ctx, evidenceObligations2, featureNames), null, 2);
32392
+ }
32393
+ var init_composers = __esm({
32394
+ "../core/dist/assemble/composers.js"() {
32338
32395
  "use strict";
32339
- init_intl_messageformat();
32396
+ init_renderInput2();
32397
+ init_savedReport();
32398
+ init_markdown();
32399
+ init_provenanceFacts();
32400
+ init_provenance();
32340
32401
  }
32341
32402
  });
32342
32403
 
@@ -32368,14 +32429,15 @@ var init_dist3 = __esm({
32368
32429
  init_featureCode();
32369
32430
  init_portablePath();
32370
32431
  init_message();
32432
+ init_messages4();
32371
32433
  }
32372
32434
  });
32373
32435
 
32374
32436
  // src/messages.en.json
32375
- var messages_en_default;
32376
- var init_messages_en = __esm({
32437
+ var messages_en_default2;
32438
+ var init_messages_en2 = __esm({
32377
32439
  "src/messages.en.json"() {
32378
- messages_en_default = {
32440
+ messages_en_default2 = {
32379
32441
  "format-names-stored-run-manifest": "A --format output names {formatPath}, which is this stored run's own {manifestPath}. Give the report a path outside {runDir}.",
32380
32442
  "stored-run-reads-its-manifest": "A file this stored run reads is its own {manifestPath}: {inputPath} is {inputSubject}. Give the store a root outside the files the run reads.",
32381
32443
  "see-commands-and-modifiers": "Run 'spec-controller --help' to see the commands and host modifiers this version accepts.",
@@ -32484,9 +32546,9 @@ var init_appText = __esm({
32484
32546
  "src/appText.ts"() {
32485
32547
  "use strict";
32486
32548
  init_dist3();
32487
- init_messages_en();
32549
+ init_messages_en2();
32488
32550
  message = messagesFrom(
32489
- messages_en_default
32551
+ messages_en_default2
32490
32552
  );
32491
32553
  }
32492
32554
  });