(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Wolfram 15.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       154,          7]
NotebookDataLength[     71703,       1802]
NotebookOptionsPosition[     61085,       1608]
NotebookOutlinePosition[     63136,       1657]
CellTagsIndexPosition[     63058,       1652]
WindowTitle->SearchLedger
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {GridBox[{
      {
       ItemBox[Cell[BoxData[
         RowBox[{
          TemplateBox[{12},
           "Spacer1"], Cell[
          "WOLFRAM INSTITUTE/ PUZZLES SYMBOL", "PacletNameCell",
           TextAlignment->Center,ExpressionUUID->
           "d79acf2e-aaeb-4b2c-8283-a11f1a2e254f"], 
          TemplateBox[{8},
           "Spacer1"]}]],
         TextAlignment->Center,ExpressionUUID->
         "781cdbc8-2ac8-4871-a96a-1f02e1367c1c"],
        Background->LightDarkSwitched[
          RGBColor[0.490196, 0.576471, 0.690196]],
        ItemSize->Full], ""}
     },
     GridBoxAlignment->{"Rows" -> {{Center}}},
     GridBoxItemSize->{"Columns" -> {Full, 
         Scaled[0.02]}, "Rows" -> {{2.5}}}], Cell[TextData[{
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "See Also",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "fc248d14-684c-44a0-b77a-8b940ab7c8e1"]
         }],ExpressionUUID->"18d7cf6d-b885-4a9b-816d-8e29d5ef49fb"],
         StripOnInput->False],{
        StyleBox[
          "\"SearchLedgerRecord\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/SearchLedgerRecord"], 
         StyleBox[
          "\"SearchLedgerTestedQ\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/SearchLedgerTestedQ"], 
         StyleBox[
          "\"SearchLedgerFilter\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/SearchLedgerFilter"], 
         StyleBox[
          "\"CandidateFingerprint\"", "SeeAlsoRelated", StripOnInput -> 
           False] :> Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/CandidateFingerprint"], 
         StyleBox[
          "\"CandidateSweep\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/CandidateSweep"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"SeeAlso"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "0d1c5ed4-dd21-478d-8dd5-defba5b7de17"],
     "\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\
\[ThickSpace]",
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "Related Guides",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "e8a06481-dcb6-41d9-a18b-348013a93e78"]
         }],ExpressionUUID->"629b7a30-ea88-4748-8bb4-e00fe1b84e12"],
         StripOnInput->False],{
        "\"Search\"" :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/guide/Search"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"MoreAbout"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "422c6299-05ca-45c6-a028-90ef08a1434a"],
     "\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\
\[ThickSpace]",
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "URL",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "20056632-af13-4061-90b2-3b322daa279c"]
         }],ExpressionUUID->"1d2d98a4-5dc6-41d3-b5d6-c74f9541ddb5"],
         StripOnInput->False],{
        "\"WolframInstitute/Puzzles/ref/SearchLedger\"" :> None, 
         "\"Copy Wolfram Documentation Center URL\"" :> 
         CopyToClipboard["WolframInstitute/Puzzles/ref/SearchLedger"], 
         Delimiter, "\"Copy web URL\"" :> 
         Module[{DocumentationSearch`Private`nb$}, 
           DocumentationSearch`Private`nb$ = 
            NotebookPut[
             Notebook[{
               Cell[BoxData[
                 MakeBoxes[
                  Hyperlink[
                   "http://reference.wolfram.com/language/WolframInstitute/\
Puzzles/ref/SearchLedger.html"], StandardForm]], "Input", TextClipboardType -> 
                 "PlainText"]}, Visible -> False]]; 
           SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
           FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
           NotebookClose[DocumentationSearch`Private`nb$]; Null], 
         "\"Go to web URL\"" :> 
         FrontEndExecute[{
           NotebookLocate[{
             URL[If[TrueQ[False], 
                 "http://reference.wolfram.com/system-modeler/", 
                 "http://reference.wolfram.com/language/"] <> 
               "WolframInstitute/Puzzles/ref/SearchLedger" <> ".html"], 
              None}]}]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"URLMenu"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "b220b581-6f32-4a98-9dcc-bb85ed6567d2"]
    }], "AnchorBar",
     CacheGraphics->False,ExpressionUUID->
     "64452abe-dff6-4a27-b7da-1d7c68528e1a"]}
  }]], "AnchorBarGrid",
 CellID->1,ExpressionUUID->"ba1ab46e-48a2-4fbb-8d08-1450f842b006"],

Cell["WolframInstitute`Puzzles`", "ContextNameCell",ExpressionUUID->"bdb180e4-30d8-4a0c-8785-5c2c11c54c4b"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {Cell[TextData[{
     Cell[
     "SearchLedger", "ObjectName",ExpressionUUID->
      "b1b68439-6159-411f-9647-3952e6dc710f"],
     Cell[BoxData[
      TemplateBox[{8},
       "Spacer1"]],ExpressionUUID->"0e50a7fa-5fb5-4d22-8a23-865e692d88a4"],
     Cell[BoxData[
     ""], "ObjectNameTranslation",ExpressionUUID->
      "88d5805f-5708-46f7-931d-baac4155f811"]
    }],ExpressionUUID->"64a7f426-dba2-40be-9a6d-0c1a5e991d12"], 
    "\[SpanFromLeft]"}
  }]], "ObjectNameGrid",ExpressionUUID->"0b8ff1c9-0b36-4dcf-b4b9-\
fa1416da4abe"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["SearchLedger"]], 
         "paclet:WolframInstitute/Puzzles/ref/SearchLedger", 
         "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], 
       "[", "\"\<\!\(\*StyleBox[\"directory\", \"TI\"]\)\>\"", "]"}]], 
      "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "336f227a-dc74-48cb-a823-066626dbfdef"],
     "\[LineSeparator]",
     "gives the negative-results ledger stored in a directory, creating it if \
it does not yet exist."
    }],ExpressionUUID->"6ba131ae-5c9c-4ca4-b71e-a75e86d9b28f"]}
  }]], "Usage",ExpressionUUID->"2ef7158c-d005-4f35-94eb-61d415b65a38"]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[Cell[BoxData[Cell[TextData[{
  Cell[BoxData[
   DynamicBox[ToBoxes[
     If[CurrentValue[
        EvaluationCell[], "CellGroupOpen"] =!= Closed, 
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], 
      Rotate[
       Style[
        Graphics[{
          Thickness[0.18], 
          RGBColor[0.8509803921568627, 0.396078431372549, 0], 
          Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
         PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
        0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]],
    ImageSizeCache->{
     13.600000000000001`, {-0.1685058593749993, 13.768505859375}}]],
   ExpressionUUID->"c6d172b0-2979-48d7-a8ac-953794617f37"],
  Cell[BoxData[
   TemplateBox[{1},
    "Spacer1"]],ExpressionUUID->"659fb290-5f14-4e70-b8aa-898c32ad7f84"],
  "Details and Options"
 }], "NotesFrameText",ExpressionUUID->
  "647d2dab-1ef5-47d8-af1b-f14127c6dbe7"]],ExpressionUUID->"b7fda97b-6d6e-\
498f-ae9c-ea8e49f15e63"]], "NotesSection",
 ShowGroupOpener->"Thumbnail",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CacheGraphics->False,
 CellID->165464750,ExpressionUUID->"b91371c2-cb38-4b8a-994e-d2165dd56e9a"],

Cell["\<\
A ledger records which candidates have already been tested against which \
target, so a candidate is never tested twice, across sessions or across \
puzzles.\
\>", "Notes",ExpressionUUID->"5598eeec-f132-43bb-a6c6-986dd4b490cc"],

Cell["\<\
A target is any string that names what is being searched for: an address, a \
hash, a public key.\
\>", "Notes",ExpressionUUID->"2042b74c-6e42-46a8-9ecf-3e38e753600c"],

Cell[TextData[{
 "A candidate is stored as its ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["CandidateFingerprint"]], 
    "paclet:WolframInstitute/Puzzles/ref/CandidateFingerprint", 
    "WolframInstitute/Puzzles Package Symbol"},
   "PackageLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "4b2fb8ee-7206-42d0-b6b2-5256e505cc0d"],
 ", never as itself, so a ledger can be shared or committed without \
disclosing what was tried."
}], "Notes",ExpressionUUID->"d5812b94-e99e-4630-9447-1d46a8602f56"],

Cell[TextData[{
 Cell[BoxData[
  RowBox[{
   StyleBox["ledger", "TI"], "[", "\<\"Directory\"\>", "]"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "9ca7b9cb-280c-45bb-b342-22dd1e426211"],
 " gives the ledger's directory, ",
 Cell[BoxData[
  RowBox[{
   StyleBox["ledger", "TI"], "[", "\<\"Targets\"\>", "]"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "349079f8-0f36-4b99-a59c-df5090cff507"],
 " the targets it holds records for, ",
 Cell[BoxData[
  RowBox[{
   StyleBox["ledger", "TI"], "[", 
   RowBox[{"\<\"Count\"\>", ",", 
    " ", "\<\"\!\(\*StyleBox[\"target\", \"TI\"]\)\"\>"}], "]"}]], 
  "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "2c015c44-806d-4a68-87fa-ff3000cfbc81"],
 " the number of candidates recorded against a target, and ",
 Cell[BoxData[
  RowBox[{
   StyleBox["ledger", "TI"], "[", 
   RowBox[{"\<\"Fingerprints\"\>", ",", 
    " ", "\<\"\!\(\*StyleBox[\"target\", \"TI\"]\)\"\>"}], "]"}]], 
  "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "99543209-e1d1-4d0c-90a1-90c4d76f537d"],
 " their sorted fingerprints."
}], "Notes",ExpressionUUID->"4c503b87-a1fb-40c3-a18b-dcda35061d82"],

Cell[TextData[{
 "The state on disk is JSON. ",
 Cell["ledger.json", "InlineCode",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "8e726925-eeab-466c-9fba-1ec70242750c"],
 " is the index of targets: for each target's own fingerprint, the target \
string, the count and the time of the last change. ",
 Cell[BoxData[
  RowBox[{
   RowBox[{"targets", "/"}], "<", 
   RowBox[{"target", " ", "fingerprint"}], ">", 
   RowBox[{".", "jsonl"}]}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "cf2931db-1d47-4efb-88df-7315c7b604eb"],
 " holds the candidate fingerprints, as JSON Lines, one line per recorded \
batch and each line a compact JSON array of digests."
}], "Notes",ExpressionUUID->"fb9ec3e4-d215-4e84-94a0-fb9c3b6cb9c6"],

Cell["\<\
The line format is what keeps recording cheap: a batch is one append, not a \
rewrite of everything already stored.\
\>", "Notes",ExpressionUUID->"7f3b0ab1-9e41-4d1b-a360-42bd87558ec2"],

Cell[TextData[{
 "Opening a directory that does not exist creates it. Opening a path that \
exists and is not a directory, or a directory whose ",
 Cell["ledger.json", "InlineCode",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "3fb413f5-3d21-40e3-b4b8-8ae28f42aafa"],
 " is not a search ledger, is an attempt that failed and gives a ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Failure"]], "paclet:ref/Failure"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "8bd83916-f5bd-4a30-85a3-ae4c88c5fe2a"],
 "."
}], "Notes",ExpressionUUID->"52f538f3-825b-4573-b751-7918833c7ec6"],

Cell["\<\
Reads are memoised on the target file's modification date and byte count, and \
a batch is written by read-modify-append. Two processes writing the same \
target at once can therefore lose one side's additions, and a second process \
appending inside the same second at an identical file size can be missed. \
Both errors cost a re-test and neither can skip an untested candidate.\
\>", "Notes",ExpressionUUID->"9395a89e-4f52-48aa-9f85-0adb69563dec"]
}, Closed]],

Cell["", "PageDelimiter",ExpressionUUID->"195594ae-77fd-4691-8b91-f6c8c2444f71"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[
     MatchQ[
      CurrentValue[
       EvaluationNotebook[], {
       TaggingRules, "Openers", "PrimaryExamplesSection"}, Open], 
      Alternatives[True, Open]], 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]],
   ImageSizeCache->{
    13.600000000000001`, {4.251494140625001, 9.348505859375}}]],
  ExpressionUUID->"5bfd7a73-2e15-4a80-b5c3-cb600b43c789"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"7a356d7c-a5a2-442a-8258-8861388ab6fd"],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(14)", "ExampleCount",ExpressionUUID->
  "86d9938f-c17f-4d44-b572-df1037c37d77"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->2122214032,ExpressionUUID->"8d23789b-1a40-467b-9705-5e320c83d426"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<WolframInstitute`Puzzles`\>\"", "]"}]], "Input", \
"ExampleInitialization",
 CellLabel->"In[1]:=",
 CellID->1969679695,ExpressionUUID->"babf4bef-c3f8-493b-b20e-af9b7138c560"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "d9320d18-47cf-41c2-a0fb-9c641bb5cce7"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"8ea66a69-c887-48c8-be4e-39365cbddfaa"],
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "1fcf33e5-da4e-4b87-bad9-2c1d6c953050"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->495342801,ExpressionUUID->"dc00cc6f-f51b-4bc4-ae60-2bd2a4c2fb39"],

Cell["Opening a ledger creates its directory and index:", "ExampleText",
 CellTags->
  "TextAnnotation",ExpressionUUID->"ec1880b6-381b-4a57-b433-588bc6beef5b"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"directory", " ", "=", " ", 
     RowBox[{"FileNameJoin", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
       "}"}], "]"}]}], "}"}], ",", "\n", "\t", 
   RowBox[{
    RowBox[{
     RowBox[{"SearchLedger", "[", "directory", "]"}], "[", "\"\<Directory\>\"",
      "]"}], " ", "===", " ", 
    RowBox[{"ExpandFileName", "[", "directory", "]"}]}]}], "\n", 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"a226a3ee-d521-4fb7-a1a6-301ee7042daf"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"d0adb690-8101-4d8a-8fa0-cbb148719b12"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "e85a5a88-14a8-40c0-b70c-8e6634628e10"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"d62685b6-904a-4cca-\
96a5-5b2fd9f6d2f6"],

Cell["A new ledger holds no targets:", "ExampleText",ExpressionUUID->"e6e4c5d4-9091-4af3-93ad-572d8a219daa"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"SearchLedger", "[", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
     "}"}], "]"}], "]"}], "[", "\"\<Targets\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"eb261915-ab5e-423e-8bbb-a43feb9da64f"],

Cell[BoxData[
 RowBox[{"{", "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"fd0e3efe-75b2-465f-b8ce-c8790d53fcd6"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "068184be-94d7-476c-a37b-3d593696737f"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"7e472545-cc2a-4680-\
9947-99fc58a54b44"],

Cell["Recording candidates and asking about them again:", "ExampleText",ExpressionUUID->"df75e35a-1d5d-4b11-be89-4bab1283bde3"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"ledger", " ", "=", " ", 
      RowBox[{"SearchLedger", "[", 
       RowBox[{"FileNameJoin", "[", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}],
          "}"}], "]"}], "]"}]}], ",", " ", 
     RowBox[{
     "target", " ", "=", 
      " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\""}]}], "}"}], ",", "\n",
    "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{"ledger", ",", " ", "target", ",", " ", 
      RowBox[{"{", 
       RowBox[{"\"\<hunter2\>\"", ",", " ", "\"\<letmein\>\"", ",", 
        " ", "\"\<swordfish\>\""}], "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"SearchLedgerFilter", "[", 
     RowBox[{"ledger", ",", " ", "target", ",", " ", 
      RowBox[{"{", 
       RowBox[{"\"\<hunter2\>\"", ",", " ", "\"\<correct horse\>\""}], 
       "}"}]}], "]"}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"e9fd3eb5-aa74-4e46-b298-45e03993f432"],

Cell[BoxData[
 RowBox[{"{", "\<\"correct horse\"\>", "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"c3d8b3f8-ab28-469b-9666-ad5e3384777a"]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "ab92c781-180d-4992-ba82-ba7a3ed08de5"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"c6aa3859-eec9-40f5-b56f-5ec92338ed3c"],
 "Scope",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(5)", "ExampleCount",ExpressionUUID->
  "e1e7bd99-5c60-4a58-af5a-d75ac5116903"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1293636265,ExpressionUUID->"c5f4cd05-cd8c-43da-96fa-08c29dd146d8"],

Cell["The targets a ledger holds records for:", "ExampleText",ExpressionUUID->"7797d5aa-d7b6-4b9e-b2d9-4f128916856a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"ledger", " ", "=", " ", 
     RowBox[{"SearchLedger", "[", 
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
        "}"}], "]"}], "]"}]}], "}"}], ",", "\n", "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{
     "ledger", ",", " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\"", ",", 
      " ", 
      RowBox[{"{", "\"\<a\>\"", "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{
     "ledger", ",", " ", "\"\<bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4\>\"",
       ",", " ", 
      RowBox[{"{", "\"\<b\>\"", "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"Sort", "[", 
     RowBox[{"ledger", "[", "\"\<Targets\>\"", "]"}], "]"}]}]}], "\n", 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"68fcfee5-fb43-4dd5-96f9-33a08be4782d"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"\<\"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\"\>", 
   ",", "\<\"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4\"\>"}], 
  "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"5b79338f-ae2f-4949-b1ee-f9621d3b9f67"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "41927e97-45af-4359-8230-303f4ea58ad4"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"43b07fc2-7c3b-4223-\
b427-4b962ebe9699"],

Cell["How many candidates have been ruled out for one target:", "ExampleText",ExpressionUUID->"a532a92b-21b2-440b-869c-00dd79f3c069"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"ledger", " ", "=", " ", 
      RowBox[{"SearchLedger", "[", 
       RowBox[{"FileNameJoin", "[", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}],
          "}"}], "]"}], "]"}]}], ",", " ", 
     RowBox[{
     "target", " ", "=", 
      " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\""}]}], "}"}], ",", "\n",
    "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{"ledger", ",", " ", "target", ",", " ", 
      RowBox[{"Map", "[", 
       RowBox[{"IntegerString", ",", " ", 
        RowBox[{"Range", "[", "500", "]"}]}], "]"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"ledger", "[", 
     RowBox[{"\"\<Count\>\"", ",", " ", "target"}], "]"}]}]}], "\n", 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"dd1623e9-5e8a-4662-8a06-ad290482d6e7"],

Cell[BoxData["500"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"70835810-6f10-43a6-b660-b8125d7d78a8"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "00e95b2e-640d-448b-a4c6-bb60e9a6338f"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"bdab651e-7216-4fff-\
b1ab-93a357ea845f"],

Cell["What is on disk is the digest, not the candidate:", "ExampleText",ExpressionUUID->"bd85129d-7466-4778-8cad-a9b414993854"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"ledger", " ", "=", " ", 
      RowBox[{"SearchLedger", "[", 
       RowBox[{"FileNameJoin", "[", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}],
          "}"}], "]"}], "]"}]}], ",", " ", 
     RowBox[{
     "target", " ", "=", 
      " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\""}]}], "}"}], ",", "\n",
    "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{"ledger", ",", " ", "target", ",", " ", 
      RowBox[{"{", "\"\<hunter2\>\"", "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"ledger", "[", 
     RowBox[{"\"\<Fingerprints\>\"", ",", " ", "target"}], "]"}]}]}], "\n", 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"0718b34e-c4d5-479b-83d2-1609b105c2c6"],

Cell[BoxData[
 RowBox[{"{", \
"\<\"f52fbd32b2b3b86ff88ef6c490628285f482af15ddcb29541f94bcf526a3f6c7\"\>", 
  "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"d875619f-451e-46a4-a50a-7550bdb03f58"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "64306330-1636-4512-8eab-0aaaf447b9c1"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"ff73257b-796e-4c7e-\
ac61-b65ab8b4daa1"],

Cell["The index on disk declares its format:", "ExampleText",ExpressionUUID->"179618cc-b0a4-4ddd-8eef-4a06a4031c94"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"directory", " ", "=", " ", 
     RowBox[{"FileNameJoin", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
       "}"}], "]"}]}], "}"}], ",", "\n", "\t", 
   RowBox[{
    RowBox[{"SearchLedger", "[", "directory", "]"}], ";", "\n", "\t", 
    RowBox[{"Lookup", "[", 
     RowBox[{
      RowBox[{"Import", "[", 
       RowBox[{
        RowBox[{"FileNameJoin", "[", 
         RowBox[{"{", 
          RowBox[{"directory", ",", " ", "\"\<ledger.json\>\""}], "}"}], 
         "]"}], ",", " ", "\"\<RawJSON\>\""}], "]"}], ",", 
      " ", "\"\<Format\>\""}], "]"}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"6fb71b6b-694b-4414-9bad-7fd78e69dd6c"],

Cell[BoxData["\<\"WolframInstitute/Puzzles SearchLedger\"\>"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"c0f98fc3-3d0a-4633-aba5-f988ee0cef72"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "00cb2540-49cb-4dfc-ad5b-cb7f21c8c7ff"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"959f1380-3923-4788-\
bd1c-1384510f2fe1"],

Cell["The target store is JSON Lines, one line per recorded batch:", \
"ExampleText",ExpressionUUID->"d0013f60-5c4c-4b0a-aa6f-97fb0fba29f1"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"directory", " ", "=", " ", 
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
        "}"}], "]"}]}], ",", " ", "ledger", ",", " ", 
     RowBox[{
     "target", " ", "=", 
      " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\""}]}], "}"}], ",", "\n",
    "\t", 
   RowBox[{
    RowBox[{"ledger", " ", "=", " ", 
     RowBox[{"SearchLedger", "[", "directory", "]"}]}], ";", "\n", "\t", 
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{"ledger", ",", " ", "target", ",", " ", 
      RowBox[{"{", 
       RowBox[{"\"\<a\>\"", ",", " ", "\"\<b\>\""}], "}"}]}], "]"}], ";", 
    "\n", "\t", 
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{"ledger", ",", " ", "target", ",", " ", 
      RowBox[{"{", "\"\<c\>\"", "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"Import", "[", 
     RowBox[{
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{"directory", ",", " ", "\"\<targets\>\"", ",", " ", 
         RowBox[{
          RowBox[{"CandidateFingerprint", "[", "target", "]"}], " ", "<>", 
          " ", "\"\<.jsonl\>\""}]}], "}"}], "]"}], ",", " ", 
      RowBox[{"{", 
       RowBox[{"\"\<Text\>\"", ",", " ", "\"\<Lines\>\""}], "}"}]}], 
     "]"}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"6440ecff-66e9-4b55-8ae9-b2aa23b5219c"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"\<\"[\\\"\
ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb\\\",\\\"\
3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d\\\"]\"\>", 
   ",", "\<\"[\\\"\
2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6\\\"]\"\>"}], 
  "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"68f8b239-cb11-4cd9-bcf5-1cf61514e270"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "f6ed1a23-146d-473f-be93-2beb947e276a"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"c8c82218-5a3e-47ef-81e2-59f80c00fa6f"],
 "Applications",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount",ExpressionUUID->
  "ce1a40bd-a7ac-48fa-8e27-efee0f42ec74"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->258228157,ExpressionUUID->"cdbe6c8c-02f6-4c66-87aa-ab84bb823aa0"],

Cell["\<\
A ledger reopened in another session still knows what was ruled out, which is \
the point of it:\
\>", "ExampleText",ExpressionUUID->"c885bc67-f476-4e25-af42-c9e3ad11327e"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"directory", " ", "=", " ", 
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
        "}"}], "]"}]}], ",", " ", 
     RowBox[{
     "target", " ", "=", 
      " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\""}]}], "}"}], ",", "\n",
    "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{
      RowBox[{"SearchLedger", "[", "directory", "]"}], ",", " ", "target", ",",
       " ", 
      RowBox[{"{", 
       RowBox[{"\"\<hunter2\>\"", ",", " ", "\"\<letmein\>\""}], "}"}]}], 
     "]"}], ";", "\n", "\t", 
    RowBox[{"SearchLedgerTestedQ", "[", 
     RowBox[{
      RowBox[{"SearchLedger", "[", "directory", "]"}], ",", " ", "target", ",",
       " ", "\"\<hunter2\>\""}], "]"}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"b57f76ef-2457-491d-8260-e57124bbba68"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"e06612ca-1613-43fd-b7b7-3239e1b9e348"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "fdfe3960-3c8a-4274-b018-a397998e58fb"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"0f8bdb47-c7a0-44e2-85d9-dc582f7958df"],
 "Properties & Relations",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "1ae5bf68-949b-4e1a-bf2a-99e2172d11d8"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->2123667759,ExpressionUUID->"a52de13e-5246-45ff-90dd-c5150c217286"],

Cell["\<\
A ledger is per target, so the same candidate against another target is \
untested:\
\>", "ExampleText",ExpressionUUID->"6dc75043-679a-41e6-bc8d-9f023946ed95"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"ledger", " ", "=", " ", 
     RowBox[{"SearchLedger", "[", 
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
        "}"}], "]"}], "]"}]}], "}"}], ",", "\n", "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{"ledger", ",", " ", "\"\<target one\>\"", ",", " ", 
      RowBox[{"{", "\"\<hunter2\>\"", "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"SearchLedgerTestedQ", "[", 
     RowBox[{
     "ledger", ",", " ", "\"\<target two\>\"", ",", " ", "\"\<hunter2\>\""}], 
     "]"}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"876c88ee-837b-484e-9cdc-baf10a979d13"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"38d42ccc-5164-4dcb-a0ea-3d3c40f3af2c"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "09126f06-ea45-4aa3-ab83-d7a40bcfa60a"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"6d03865b-4637-4d08-\
9285-047f2e257711"],

Cell["A target file is named by the target's own fingerprint:", "ExampleText",ExpressionUUID->"b042b833-f075-4ef3-ac35-d24058c822ed"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"directory", " ", "=", " ", 
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"CreateDirectory", "[", "]"}], ",", " ", "\"\<ledger\>\""}], 
        "}"}], "]"}]}], ",", " ", 
     RowBox[{
     "target", " ", "=", 
      " ", "\"\<1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\>\""}]}], "}"}], ",", "\n",
    "\t", 
   RowBox[{
    RowBox[{"SearchLedgerRecord", "[", 
     RowBox[{
      RowBox[{"SearchLedger", "[", "directory", "]"}], ",", " ", "target", ",",
       " ", 
      RowBox[{"{", "\"\<a\>\"", "}"}]}], "]"}], ";", "\n", "\t", 
    RowBox[{"FileNameTake", " ", "/@", " ", 
     RowBox[{"FileNames", "[", 
      RowBox[{"\"\<*\>\"", ",", " ", 
       RowBox[{"FileNameJoin", "[", 
        RowBox[{"{", 
         RowBox[{"directory", ",", " ", "\"\<targets\>\""}], "}"}], "]"}]}], 
      "]"}]}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"8127b1a6-abaa-4bdb-ad9e-65f866f35a53"],

Cell[BoxData[
 RowBox[{"{", \
"\<\"31a9d2e8a70a091d65a58d2a08f8833abf5e8fa1d741c5400c538c38668cb83e.jsonl\"\
\>", "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"a8cb9a4e-5c66-4605-918c-bf5d36d799ab"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "305e7124-5a9c-433b-82fe-d71ac4c0a963"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"582918d1-06a7-4ccf-ac99-b3e780064f80"],
 "Possible Issues",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "5b64ad93-638f-44b6-86d9-2cbe98a67f1b"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1305812373,ExpressionUUID->"b6a47d47-09b4-4675-89c9-e95e6d5b382a"],

Cell["\<\
A path that exists and is not a directory cannot hold a ledger:\
\>", "ExampleText",ExpressionUUID->"6789e415-cbe6-45f9-b7bb-e00a3dee4621"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"file", " ", "=", " ", 
     RowBox[{"FileNameJoin", "[", 
      RowBox[{"{", 
       RowBox[{
        RowBox[{"CreateDirectory", "[", "]"}], ",", 
        " ", "\"\<notadirectory\>\""}], "}"}], "]"}]}], "}"}], ",", "\n", 
   "\t", 
   RowBox[{
    RowBox[{"Export", "[", 
     RowBox[{"file", ",", " ", "\"\<text\>\"", ",", " ", "\"\<Text\>\""}], 
     "]"}], ";", "\n", "\t", 
    RowBox[{"SearchLedger", "[", "file", "]"}]}]}], "\n", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"1cd859aa-ac80-4572-8a05-28c23941320b"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{
   TagBox["Failure",
    "SummaryHead"], "[", 
   DynamicModuleBox[{Typeset`open$$ = False, Typeset`embedState$$ = "Ready"}, 
    
    TemplateBox[{
      PaneSelectorBox[{False -> GridBox[{{
            PaneBox[
             ButtonBox[
              DynamicBox[
               FEPrivate`FrontEndResource["FEBitmaps", "SummaryBoxOpener"]], 
              ButtonFunction :> (Typeset`open$$ = True), Appearance -> None, 
              BaseStyle -> {}, Evaluator -> Automatic, Method -> 
              "Preemptive"], Alignment -> {Center, Center}, ImageSize -> 
             Dynamic[{
               Automatic, 
                3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                 Magnification])}]], 
            FrameBox[
             StyleBox["\"\[WarningSign]\"", 
              Directive["Message", 35], StripOnInput -> False], 
             ContentPadding -> False, FrameStyle -> None, 
             FrameMargins -> {{0, 0}, {0, 0}}, StripOnInput -> False], 
            GridBox[{{
               TagBox[
                GridBox[{{
                   TagBox["\"Message: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox[
                   "\"the ledger path exists and is not a directory.\"", 
                    "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}, {
               TagBox[
                GridBox[{{
                   TagBox["\"Tag: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox["\"ConfirmationFailed\"", "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}}, 
             GridBoxAlignment -> {
              "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> 
             False, GridBoxItemSize -> {
              "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
             GridBoxSpacings -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
              BaseStyle -> {
              ShowStringCharacters -> False, NumberMarks -> False, 
               PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, 
          GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}}, 
          AutoDelete -> False, 
          GridBoxItemSize -> {
           "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
          BaselinePosition -> {1, 1}], True -> GridBox[{{
            PaneBox[
             ButtonBox[
              DynamicBox[
               FEPrivate`FrontEndResource["FEBitmaps", "SummaryBoxCloser"]], 
              ButtonFunction :> (Typeset`open$$ = False), Appearance -> None, 
              BaseStyle -> {}, Evaluator -> Automatic, Method -> 
              "Preemptive"], Alignment -> {Center, Center}, ImageSize -> 
             Dynamic[{
               Automatic, 
                3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                 Magnification])}]], 
            FrameBox[
             StyleBox["\"\[WarningSign]\"", 
              Directive["Message", 35], StripOnInput -> False], 
             ContentPadding -> False, FrameStyle -> None, 
             FrameMargins -> {{0, 0}, {0, 0}}, StripOnInput -> False], 
            GridBox[{{
               TagBox[
                GridBox[{{
                   TagBox["\"Message: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox[
                   "\"the ledger path exists and is not a directory.\"", 
                    "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}, {
               TagBox[
                GridBox[{{
                   TagBox["\"Tag: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox["\"ConfirmationFailed\"", "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}, {
               RowBox[{
                 TagBox[
                  
                  TemplateBox[{"\"ConfirmationType\"", "\": \""}, 
                   "RowDefault"], "SummaryItemAnnotation"], 
                 "\[InvisibleSpace]", 
                 TagBox[
                  TagBox["\"ConfirmAssert\"", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"Expression\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox["False", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"Information\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox[
                  "\"the ledger path exists and is not a directory.\"", 
                   HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"Test\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox["False", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"HeldTest\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox[
                   RowBox[{"Hold", "[", 
                    RowBox[{
                    RowBox[{"!", 
                    
                    RowBox[{
                    "FileExistsQ", "[", 
                    "WolframInstitute`Puzzles`Search`Ledger`Private`full$\
358095", "]"}]}], "||", 
                    
                    RowBox[{
                    "DirectoryQ", "[", 
                    "WolframInstitute`Puzzles`Search`Ledger`Private`full$\
358095", "]"}]}], "]"}], HoldForm], "SummaryItem"]}]}}, 
             GridBoxAlignment -> {
              "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> 
             False, GridBoxItemSize -> {
              "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
             GridBoxSpacings -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
              BaseStyle -> {
              ShowStringCharacters -> False, NumberMarks -> False, 
               PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, 
          GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}}, 
          AutoDelete -> False, 
          GridBoxItemSize -> {
           "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
          BaselinePosition -> {1, 1}]}, 
       Dynamic[Typeset`open$$], ImageSize -> Automatic]},
     "SummaryPanel"],
    DynamicModuleValues:>{}], "]"}],
  Failure[
  "ConfirmationFailed", <|
   "MessageTemplate" -> "the ledger path exists and is not a directory.", 
    "MessageParameters" -> {}, "ConfirmationType" -> "ConfirmAssert", 
    "Expression" :> False, "Information" -> 
    "the ledger path exists and is not a directory.", "Test" :> False, 
    "HeldTest" -> Hold[
      Or[
       Not[
        FileExistsQ[
        WolframInstitute`Puzzles`Search`Ledger`Private`full$358095]], 
       DirectoryQ[
       WolframInstitute`Puzzles`Search`Ledger`Private`full$358095]]]|>],
  Editable->False,
  SelectWithContents->True,
  Selectable->False]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"2264252b-ce80-4b40-821b-94f3eb3b487d"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "101b21b8-f336-4c02-b7fd-2c05689f1ecc"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"edfda726-7ab5-4e45-\
a76a-56d069fe2014"],

Cell[TextData[{
 "A directory whose ",
 Cell["ledger.json", "InlineCode",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "fec8b9f4-bfab-441d-97ae-da8ddc1ce123"],
 " is some other JSON is not a ledger:"
}], "ExampleText",ExpressionUUID->"4272a3e0-c484-4b2a-9a40-0a316c96663c"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Module", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"directory", " ", "=", " ", 
     RowBox[{"CreateDirectory", "[", "]"}]}], "}"}], ",", "\n", "\t", 
   RowBox[{
    RowBox[{"Export", "[", 
     RowBox[{
      RowBox[{"FileNameJoin", "[", 
       RowBox[{"{", 
        RowBox[{"directory", ",", " ", "\"\<ledger.json\>\""}], "}"}], "]"}], 
      ",", " ", 
      RowBox[{"<|", 
       RowBox[{"\"\<Format\>\"", " ", "->", " ", "\"\<something else\>\""}], 
       "|>"}], ",", " ", "\"\<RawJSON\>\""}], "]"}], ";", "\n", "\t", 
    RowBox[{"SearchLedger", "[", "directory", "]"}]}]}], "\n", "]"}]], "Input",\

 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"4686361e-676a-4f16-855b-aa874defb049"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{
   TagBox["Failure",
    "SummaryHead"], "[", 
   DynamicModuleBox[{Typeset`open$$ = False, Typeset`embedState$$ = "Ready"}, 
    
    TemplateBox[{
      PaneSelectorBox[{False -> GridBox[{{
            PaneBox[
             ButtonBox[
              DynamicBox[
               FEPrivate`FrontEndResource["FEBitmaps", "SummaryBoxOpener"]], 
              ButtonFunction :> (Typeset`open$$ = True), Appearance -> None, 
              BaseStyle -> {}, Evaluator -> Automatic, Method -> 
              "Preemptive"], Alignment -> {Center, Center}, ImageSize -> 
             Dynamic[{
               Automatic, 
                3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                 Magnification])}]], 
            FrameBox[
             StyleBox["\"\[WarningSign]\"", 
              Directive["Message", 35], StripOnInput -> False], 
             ContentPadding -> False, FrameStyle -> None, 
             FrameMargins -> {{0, 0}, {0, 0}}, StripOnInput -> False], 
            GridBox[{{
               TagBox[
                GridBox[{{
                   TagBox["\"Message: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox[
                   "\"the directory holds a JSON file that is not a search \
ledger.\"", "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}, {
               TagBox[
                GridBox[{{
                   TagBox["\"Tag: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox["\"ConfirmationFailed\"", "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}}, 
             GridBoxAlignment -> {
              "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> 
             False, GridBoxItemSize -> {
              "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
             GridBoxSpacings -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
              BaseStyle -> {
              ShowStringCharacters -> False, NumberMarks -> False, 
               PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, 
          GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}}, 
          AutoDelete -> False, 
          GridBoxItemSize -> {
           "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
          BaselinePosition -> {1, 1}], True -> GridBox[{{
            PaneBox[
             ButtonBox[
              DynamicBox[
               FEPrivate`FrontEndResource["FEBitmaps", "SummaryBoxCloser"]], 
              ButtonFunction :> (Typeset`open$$ = False), Appearance -> None, 
              BaseStyle -> {}, Evaluator -> Automatic, Method -> 
              "Preemptive"], Alignment -> {Center, Center}, ImageSize -> 
             Dynamic[{
               Automatic, 
                3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                 Magnification])}]], 
            FrameBox[
             StyleBox["\"\[WarningSign]\"", 
              Directive["Message", 35], StripOnInput -> False], 
             ContentPadding -> False, FrameStyle -> None, 
             FrameMargins -> {{0, 0}, {0, 0}}, StripOnInput -> False], 
            GridBox[{{
               TagBox[
                GridBox[{{
                   TagBox["\"Message: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox[
                   "\"the directory holds a JSON file that is not a search \
ledger.\"", "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}, {
               TagBox[
                GridBox[{{
                   TagBox["\"Tag: \"", "SummaryItemAnnotation"], 
                   "\[InvisibleSpace]", 
                   TagBox["\"ConfirmationFailed\"", "SummaryItem"]}}, 
                 GridBoxItemSize -> {"Columns" -> {6.5, All, Automatic}}, 
                 GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                 GridBoxSpacings -> {"Columns" -> {{0}}}], "SummaryItem"]}, {
               RowBox[{
                 TagBox[
                  
                  TemplateBox[{"\"ConfirmationType\"", "\": \""}, 
                   "RowDefault"], "SummaryItemAnnotation"], 
                 "\[InvisibleSpace]", 
                 TagBox[
                  TagBox["\"ConfirmAssert\"", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"Expression\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox["False", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"Information\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox[
                  "\"the directory holds a JSON file that is not a search \
ledger.\"", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"Test\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox["False", HoldForm], "SummaryItem"]}]}, {
               RowBox[{
                 TagBox[
                  TemplateBox[{"\"HeldTest\"", "\": \""}, "RowDefault"], 
                  "SummaryItemAnnotation"], "\[InvisibleSpace]", 
                 TagBox[
                  TagBox[
                   RowBox[{"Hold", "[", 
                    RowBox[{
                    RowBox[{"Lookup", "[", 
                    
                    RowBox[{
                    "WolframInstitute`Puzzles`Search`Ledger`Private`index$\
358130", ",", "\"Format\""}], "]"}], "===", 
                    "WolframInstitute`Puzzles`Search`Ledger`Private`$\
ledgerFormat"}], "]"}], HoldForm], "SummaryItem"]}]}}, 
             GridBoxAlignment -> {
              "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> 
             False, GridBoxItemSize -> {
              "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
             GridBoxSpacings -> {"Columns" -> {{2}}, "Rows" -> {{Automatic}}},
              BaseStyle -> {
              ShowStringCharacters -> False, NumberMarks -> False, 
               PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, 
          GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}}, 
          AutoDelete -> False, 
          GridBoxItemSize -> {
           "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
          BaselinePosition -> {1, 1}]}, 
       Dynamic[Typeset`open$$], ImageSize -> Automatic]},
     "SummaryPanel"],
    DynamicModuleValues:>{}], "]"}],
  Failure[
  "ConfirmationFailed", <|
   "MessageTemplate" -> 
    "the directory holds a JSON file that is not a search ledger.", 
    "MessageParameters" -> {}, "ConfirmationType" -> "ConfirmAssert", 
    "Expression" :> False, "Information" -> 
    "the directory holds a JSON file that is not a search ledger.", "Test" :> 
    False, "HeldTest" -> 
    Hold[Lookup[
       WolframInstitute`Puzzles`Search`Ledger`Private`index$358130, "Format"] === 
      WolframInstitute`Puzzles`Search`Ledger`Private`$ledgerFormat]|>],
  Editable->False,
  SelectWithContents->True,
  Selectable->False]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"2bf04ace-6aeb-4de3-8ad0-6a92a6578f8d"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "1b21dc80-1944-49ae-9e6b-ea757e958b67"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"df554c41-ac57-4788-\
a133-e56a956a3a95"],

Cell["Anything but a path matches no definition:", "ExampleText",ExpressionUUID->"53728867-9700-4cdc-be20-2e00226f3e0a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"SearchLedger", "[", "12345", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"103b05dd-129f-4f96-9b56-bd5d801d6862"],

Cell[BoxData[
 RowBox[{"SearchLedger", "[", "12345", "]"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"b4e42c88-43e1-4381-8e01-9dfaecc49b44"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedFunction.png"]]], GridBox[{
      {
       StyleBox[
        RowBox[{"See", " ", "Also"}], "SeeAlsoSection"]},
      {Cell[TextData[{
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["SearchLedgerRecord"]], 
           "paclet:WolframInstitute/Puzzles/ref/SearchLedgerRecord", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "601f93c1-0bab-4dc6-acd2-81a55bdfbd50"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["SearchLedgerTestedQ"]], 
           "paclet:WolframInstitute/Puzzles/ref/SearchLedgerTestedQ", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "61f0b37b-4d93-451a-9ea0-f2e77d8cdd70"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["SearchLedgerFilter"]], 
           "paclet:WolframInstitute/Puzzles/ref/SearchLedgerFilter", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "85c19733-eb9d-40cc-9ec7-561dffd628b8"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["CandidateFingerprint"]], 
           "paclet:WolframInstitute/Puzzles/ref/CandidateFingerprint", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "81cced42-59cb-43da-a88a-16b4642cb390"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["CandidateSweep"]], 
           "paclet:WolframInstitute/Puzzles/ref/CandidateSweep", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "483a2e24-849d-43bd-a869-97bf6decf760"]
       }], "SeeAlso",ExpressionUUID->"b7aa2dab-0be0-4cbf-be80-8a575a454d61"]}
     }]}
  }]], "SeeAlsoSection",ExpressionUUID->"dff9994d-f46d-4306-a80b-\
e71ad31439ae"],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedGuide.png"]]], GridBox[{
      {
       StyleBox[
        RowBox[{"Related", " ", "Guides"}], "MoreAboutSection"]},
      {
       RowBox[{"\[FilledVerySmallSquare]", Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Search"]], 
           "paclet:WolframInstitute/Puzzles/guide/Search"},
          "RefLinkPlain",
          BaseStyle->{"MoreAbout"}]], "MoreAbout",ExpressionUUID->
         "9dc87397-c762-4c7a-8921-e704bd88e517"]}]}
     }]}
  }]], "MoreAboutSection",ExpressionUUID->"8d650af1-8b94-47fa-ab20-\
72f84dd4046f"],

Cell[" ", "FooterCell",ExpressionUUID->"2c809c9f-a79d-4afc-b013-d8ff80eaf823"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{900, 830},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
WindowTitle->"SearchLedger",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "", "LinkTrails" -> "", 
  "ExampleCounter" -> 1, 
  "Openers" -> {
   "PrimaryExamplesSection" -> Open, "ExampleSection" -> {"0" -> Open}, 
    "AllOptsTable" -> Closed}, "NewStyles" -> True, 
  "CitationPopupData" -> $Failed, "ShowCitation" -> False, "HasOptions" -> 
  True, "RootCaptions" -> "", "HeaderCoreAreaLink" -> {}, 
  "Metadata" -> {
   "built" -> "{2026, 8, 27, 0, 11, 52.150875}", 
    "history" -> {"XX", "", "", ""}, "context" -> "WolframInstitute`Puzzles`",
     "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Wolfram Institute/ Puzzles Symbol", "language" -> "en", "paclet" -> 
    "WolframInstitute/Puzzles", "status" -> "None", "summary" -> 
    "PackageLink[SearchLedger,paclet : \
WolframInstitute/Puzzles/ref/SearchLedger, WolframInstitute/Puzzles Package \
Symbol][directory] gives the negative-results ledger stored in a directory, \
creating it if it does not yet exist.", "synonyms" -> {}, "tabletags" -> {}, 
    "title" -> "SearchLedger", "titlemodifier" -> "", "metadescription" -> "",
     "windowtitle" -> "SearchLedger", "type" -> "Symbol", "uri" -> 
    "WolframInstitute/Puzzles/ref/SearchLedger", "WorkflowDockedCell" -> ""}, 
  "SearchTextTranslated" -> ""},
CellContext->CellGroup,
FrontEndVersion->"15.0 for Mac OS X ARM (64-bit) (May 19, 2026)",
StyleDefinitions->FrontEnd`FileName[{"Wolfram"}, "Reference.nb"],
ExpressionUUID->"8bb0a693-4e18-4aae-87ef-b9a6de87e1a9"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "TextAnnotation"->{
  Cell[16886, 448, 159, 2, 70, "ExampleText",ExpressionUUID->"ec1880b6-381b-4a57-b433-588bc6beef5b",
   CellTags->"TextAnnotation"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"TextAnnotation", 62901, 1646}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[580, 21, 5844, 143, 70, "AnchorBarGrid",ExpressionUUID->"ba1ab46e-48a2-4fbb-8d08-1450f842b006",
 CellID->1],
Cell[6427, 166, 107, 0, 70, "ContextNameCell",ExpressionUUID->"bdb180e4-30d8-4a0c-8785-5c2c11c54c4b"],
Cell[CellGroupData[{
Cell[6559, 170, 555, 14, 70, "ObjectNameGrid",ExpressionUUID->"0b8ff1c9-0b36-4dcf-b4b9-fa1416da4abe"],
Cell[7117, 186, 820, 20, 70, "Usage",ExpressionUUID->"2ef7158c-d005-4f35-94eb-61d415b65a38"]
}, Open  ]],
Cell[CellGroupData[{
Cell[7974, 211, 1443, 34, 70, "NotesSection",ExpressionUUID->"b91371c2-cb38-4b8a-994e-d2165dd56e9a",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->165464750],
Cell[9420, 247, 237, 4, 70, "Notes",ExpressionUUID->"5598eeec-f132-43bb-a6c6-986dd4b490cc"],
Cell[9660, 253, 177, 3, 70, "Notes",ExpressionUUID->"2042b74c-6e42-46a8-9ecf-3e38e753600c"],
Cell[9840, 258, 597, 15, 70, "Notes",ExpressionUUID->"d5812b94-e99e-4630-9447-1d46a8602f56"],
Cell[10440, 275, 1309, 35, 70, "Notes",ExpressionUUID->"4c503b87-a1fb-40c3-a18b-dcda35061d82"],
Cell[11752, 312, 778, 17, 70, "Notes",ExpressionUUID->"fb9ec3e4-d215-4e84-94a0-fb9c3b6cb9c6"],
Cell[12533, 331, 195, 3, 70, "Notes",ExpressionUUID->"7f3b0ab1-9e41-4d1b-a360-42bd87558ec2"],
Cell[12731, 336, 688, 17, 70, "Notes",ExpressionUUID->"52f538f3-825b-4573-b751-7918833c7ec6"],
Cell[13422, 355, 460, 6, 70, "Notes",ExpressionUUID->"9395a89e-4f52-48aa-9f85-0adb69563dec"]
}, Closed]],
Cell[13897, 364, 80, 0, 70, "PageDelimiter",ExpressionUUID->"195594ae-77fd-4691-8b91-f6c8c2444f71"],
Cell[CellGroupData[{
Cell[14002, 368, 1402, 37, 70, "PrimaryExamplesSection",ExpressionUUID->"8d23789b-1a40-467b-9705-5e320c83d426",
 CellID->2122214032],
Cell[15407, 407, 216, 4, 70, "Input",ExpressionUUID->"babf4bef-c3f8-493b-b20e-af9b7138c560",
 CellID->1969679695],
Cell[CellGroupData[{
Cell[15648, 415, 1235, 31, 70, "ExampleSection",ExpressionUUID->"dc00cc6f-f51b-4bc4-ae60-2bd2a4c2fb39",
 CellID->495342801],
Cell[16886, 448, 159, 2, 70, "ExampleText",ExpressionUUID->"ec1880b6-381b-4a57-b433-588bc6beef5b",
 CellTags->"TextAnnotation"],
Cell[CellGroupData[{
Cell[17070, 454, 652, 17, 70, "Input",ExpressionUUID->"a226a3ee-d521-4fb7-a1a6-301ee7042daf"],
Cell[17725, 473, 110, 1, 70, "Output",ExpressionUUID->"d0adb690-8101-4d8a-8fa0-cbb148719b12"]
}, Open  ]],
Cell[CellGroupData[{
Cell[17872, 479, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"d62685b6-904a-4cca-96a5-5b2fd9f6d2f6"],
Cell[18099, 486, 108, 0, 70, "ExampleText",ExpressionUUID->"e6e4c5d4-9091-4af3-93ad-572d8a219daa"],
Cell[CellGroupData[{
Cell[18232, 490, 390, 9, 70, "Input",ExpressionUUID->"eb261915-ab5e-423e-8bbb-a43feb9da64f"],
Cell[18625, 501, 124, 2, 70, "Output",ExpressionUUID->"fd0e3efe-75b2-465f-b8ce-c8790d53fcd6"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[18798, 509, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"7e472545-cc2a-4680-9947-99fc58a54b44"],
Cell[19025, 516, 127, 0, 70, "ExampleText",ExpressionUUID->"df75e35a-1d5d-4b11-be89-4bab1283bde3"],
Cell[CellGroupData[{
Cell[19177, 520, 1112, 28, 70, "Input",ExpressionUUID->"e9fd3eb5-aa74-4e46-b298-45e03993f432"],
Cell[20292, 550, 149, 2, 70, "Output",ExpressionUUID->"c3d8b3f8-ab28-469b-9666-ad5e3384777a"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[20502, 559, 1227, 31, 70, "ExampleSection",ExpressionUUID->"c5f4cd05-cd8c-43da-96fa-08c29dd146d8",
 CellID->1293636265],
Cell[21732, 592, 117, 0, 70, "ExampleText",ExpressionUUID->"7797d5aa-d7b6-4b9e-b2d9-4f128916856a"],
Cell[CellGroupData[{
Cell[21874, 596, 1030, 26, 70, "Input",ExpressionUUID->"68fcfee5-fb43-4dd5-96f9-33a08be4782d"],
Cell[22907, 624, 249, 5, 70, "Output",ExpressionUUID->"5b79338f-ae2f-4949-b1ee-f9621d3b9f67"]
}, Open  ]],
Cell[CellGroupData[{
Cell[23193, 634, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"43b07fc2-7c3b-4223-b427-4b962ebe9699"],
Cell[23420, 641, 133, 0, 70, "ExampleText",ExpressionUUID->"a532a92b-21b2-440b-869c-00dd79f3c069"],
Cell[CellGroupData[{
Cell[23578, 645, 984, 26, 70, "Input",ExpressionUUID->"dd1623e9-5e8a-4662-8a06-ad290482d6e7"],
Cell[24565, 673, 109, 1, 70, "Output",ExpressionUUID->"70835810-6f10-43a6-b660-b8125d7d78a8"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[24723, 680, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"bdab651e-7216-4fff-b1ab-93a357ea845f"],
Cell[24950, 687, 127, 0, 70, "ExampleText",ExpressionUUID->"bd85129d-7466-4778-8cad-a9b414993854"],
Cell[CellGroupData[{
Cell[25102, 691, 913, 24, 70, "Input",ExpressionUUID->"0718b34e-c4d5-479b-83d2-1609b105c2c6"],
Cell[26018, 717, 205, 4, 70, "Output",ExpressionUUID->"d875619f-451e-46a4-a50a-7550bdb03f58"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[26272, 727, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"ff73257b-796e-4c7e-ac61-b65ab8b4daa1"],
Cell[26499, 734, 116, 0, 70, "ExampleText",ExpressionUUID->"179618cc-b0a4-4ddd-8eef-4a06a4031c94"],
Cell[CellGroupData[{
Cell[26640, 738, 862, 22, 70, "Input",ExpressionUUID->"6fb71b6b-694b-4414-9bad-7fd78e69dd6c"],
Cell[27505, 762, 151, 1, 70, "Output",ExpressionUUID->"c0f98fc3-3d0a-4633-aba5-f988ee0cef72"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[27705, 769, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"959f1380-3923-4788-bd1c-1384510f2fe1"],
Cell[27932, 776, 140, 1, 70, "ExampleText",ExpressionUUID->"d0013f60-5c4c-4b0a-aa6f-97fb0fba29f1"],
Cell[CellGroupData[{
Cell[28097, 781, 1529, 38, 70, "Input",ExpressionUUID->"6440ecff-66e9-4b55-8ae9-b2aa23b5219c"],
Cell[29629, 821, 400, 8, 70, "Output",ExpressionUUID->"68f8b239-cb11-4cd9-bcf5-1cf61514e270"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[30090, 836, 1233, 31, 70, "ExampleSection",ExpressionUUID->"cdbe6c8c-02f6-4c66-87aa-ab84bb823aa0",
 CellID->258228157],
Cell[31326, 869, 182, 3, 70, "ExampleText",ExpressionUUID->"c885bc67-f476-4e25-af42-c9e3ad11327e"],
Cell[CellGroupData[{
Cell[31533, 876, 1052, 28, 70, "Input",ExpressionUUID->"b57f76ef-2457-491d-8260-e57124bbba68"],
Cell[32588, 906, 110, 1, 70, "Output",ExpressionUUID->"e06612ca-1613-43fd-b7b7-3239e1b9e348"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[32747, 913, 1244, 31, 70, "ExampleSection",ExpressionUUID->"a52de13e-5246-45ff-90dd-c5150c217286",
 CellID->2123667759],
Cell[33994, 946, 169, 3, 70, "ExampleText",ExpressionUUID->"6dc75043-679a-41e6-bc8d-9f023946ed95"],
Cell[CellGroupData[{
Cell[34188, 953, 838, 20, 70, "Input",ExpressionUUID->"876c88ee-837b-484e-9cdc-baf10a979d13"],
Cell[35029, 975, 111, 1, 70, "Output",ExpressionUUID->"38d42ccc-5164-4dcb-a0ea-3d3c40f3af2c"]
}, Open  ]],
Cell[CellGroupData[{
Cell[35177, 981, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"6d03865b-4637-4d08-9285-047f2e257711"],
Cell[35404, 988, 133, 0, 70, "ExampleText",ExpressionUUID->"b042b833-f075-4ef3-ac35-d24058c822ed"],
Cell[CellGroupData[{
Cell[35562, 992, 1085, 29, 70, "Input",ExpressionUUID->"8127b1a6-abaa-4bdb-ad9e-65f866f35a53"],
Cell[36650, 1023, 210, 4, 70, "Output",ExpressionUUID->"a8cb9a4e-5c66-4605-918c-bf5d36d799ab"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[36921, 1034, 1237, 31, 70, "ExampleSection",ExpressionUUID->"b6a47d47-09b4-4675-89c9-e95e6d5b382a",
 CellID->1305812373],
Cell[38161, 1067, 149, 2, 70, "ExampleText",ExpressionUUID->"6789e415-cbe6-45f9-b7bb-e00a3dee4621"],
Cell[CellGroupData[{
Cell[38335, 1073, 659, 17, 70, "Input",ExpressionUUID->"1cd859aa-ac80-4572-8a05-28c23941320b"],
Cell[38997, 1092, 8055, 171, 70, "Output",ExpressionUUID->"2264252b-ce80-4b40-821b-94f3eb3b487d"]
}, Open  ]],
Cell[CellGroupData[{
Cell[47089, 1268, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"edfda726-7ab5-4e45-a76a-56d069fe2014"],
Cell[47316, 1275, 279, 6, 70, "ExampleText",ExpressionUUID->"4272a3e0-c484-4b2a-9a40-0a316c96663c"],
Cell[CellGroupData[{
Cell[47620, 1285, 764, 19, 70, "Input",ExpressionUUID->"4686361e-676a-4f16-855b-aa874defb049"],
Cell[48387, 1306, 7930, 165, 70, "Output",ExpressionUUID->"2bf04ace-6aeb-4de3-8ad0-6a92a6578f8d"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[56366, 1477, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"df554c41-ac57-4788-a133-e56a956a3a95"],
Cell[56593, 1484, 120, 0, 70, "ExampleText",ExpressionUUID->"53728867-9700-4cdc-be20-2e00226f3e0a"],
Cell[CellGroupData[{
Cell[56738, 1488, 196, 3, 70, "Input",ExpressionUUID->"103b05dd-129f-4f96-9b56-bd5d801d6862"],
Cell[56937, 1493, 149, 2, 70, "Output",ExpressionUUID->"b4e42c88-43e1-4381-8e01-9dfaecc49b44"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[57137, 1501, 3168, 82, 70, "SeeAlsoSection",ExpressionUUID->"dff9994d-f46d-4306-a80b-e71ad31439ae"],
Cell[60308, 1585, 692, 19, 70, "MoreAboutSection",ExpressionUUID->"8d650af1-8b94-47fa-ab20-72f84dd4046f"],
Cell[61003, 1606, 78, 0, 70, "FooterCell",ExpressionUUID->"2c809c9f-a79d-4afc-b013-d8ff80eaf823"]
}
]
*)

(* End of internal cache information *)

