{"version": 2, "width": 100, "height": 28, "timestamp": 1793099319, "idle_time_limit": 3.0, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}, "title": "StateJar: the audit trail, from Python"} [0.030974, "o", "\u001b[1;31m$\u001b[0m "] [0.541713, "o", "s"] [0.605663, "o", "o"] [0.641082, "o", "u"] [0.695816, "o", "r"] [0.760209, "o", "c"] [0.808127, "o", "e"] [0.865932, "o", " "] [0.963473, "o", "."] [1.02046, "o", "v"] [1.127635, "o", "e"] [1.186795, "o", "n"] [1.259603, "o", "v"] [1.307681, "o", "/"] [1.376796, "o", "b"] [1.412296, "o", "i"] [1.47748, "o", "n"] [1.552935, "o", "/"] [1.585656, "o", "a"] [1.649585, "o", "c"] [1.683039, "o", "t"] [1.726946, "o", "i"] [1.765137, "o", "v"] [1.819249, "o", "a"] [1.86546, "o", "t"] [1.939376, "o", "e"] [2.406535, "o", "\r\n"] [3.221639, "o", "(.venv) \u001b[1;31m$\u001b[0m "] [3.724632, "o", "e"] [3.778268, "o", "x"] [3.850647, "o", "p"] [3.915824, "o", "o"] [3.996467, "o", "r"] [4.04316, "o", "t"] [4.116035, "o", " "] [4.212211, "o", "S"] [4.28479, "o", "T"] [4.347668, "o", "A"] [4.4243, "o", "T"] [4.45928, "o", "E"] [4.518146, "o", "J"] [4.552287, "o", "A"] [4.624511, "o", "R"] [4.681717, "o", "_"] [4.752573, "o", "B"] [4.828684, "o", "A"] [4.893952, "o", "S"] [4.97042, "o", "E"] [5.043079, "o", "_"] [5.11599, "o", "U"] [5.197571, "o", "R"] [5.23988, "o", "L"] [5.308362, "o", "="] [5.378678, "o", "h"] [5.41169, "o", "t"] [5.490848, "o", "t"] [5.522847, "o", "p"] [5.583244, "o", ":"] [5.638534, "o", "/"] [5.678927, "o", "/"] [5.757875, "o", "1"] [5.823608, "o", "2"] [5.892084, "o", "7"] [5.967235, "o", "."] [5.996111, "o", "0"] [6.034957, "o", "."] [6.069438, "o", "0"] [6.124226, "o", "."] [6.166626, "o", "1"] [6.238302, "o", ":"] [6.314609, "o", "1"] [6.375604, "o", "8"] [6.451003, "o", "1"] [6.491442, "o", "0"] [6.583639, "o", "0"] [6.599848, "o", "/"] [6.676534, "o", "a"] [6.760197, "o", "p"] [6.816493, "o", "i"] [6.872164, "o", "/"] [6.929954, "o", "v"] [7.003554, "o", "1"] [7.482918, "o", "\r\n"] [8.300167, "o", "(.venv) \u001b[1;31m$\u001b[0m "] [8.805242, "o", "c"] [8.847891, "o", "a"] [8.925955, "o", "t"] [8.996003, "o", " "] [9.136031, "o", "a"] [9.1817, "o", "u"] [9.248121, "o", "d"] [9.30317, "o", "i"] [9.335637, "o", "t"] [9.407634, "o", "."] [9.444207, "o", "p"] [9.511994, "o", "y"] [9.989872, "o", "\r\n"] [9.998084, "o", "import httpx, os\r\nfrom statejar import StateJar\r\n\r\nsj = StateJar(session_tag=\"user-42\")\r\nsj.ingest(\"I'm Meera from Pune, I prefer email, and my budget is ₹3,500.\")\r\nsj.recall(\"What is my budget?\", audit=True) # audit=True writes the disclosure\r\n\r\n# every disclosure: which handle, which fields, which model — never the text\r\n"] [9.998655, "o", "base = os.environ.get(\"STATEJAR_BASE_URL\", \"https://api.statejar.com/api/v1\").rstrip(\"/\")\r\nrows = httpx.get(f\"{base}/audit?limit=3\", headers={\"X-API-Key\": sj.api_key}).json()\r\nfor row in rows[\"entries\"]:\r\n print(row[\"kind\"], row[\"handle_used\"], row[\"subset_keys\"])\r\n"] [10.805449, "o", "(.venv) "] [10.805786, "o", "\u001b[1;31m$\u001b[0m "] [11.311561, "o", "p"] [11.358132, "o", "y"] [11.408605, "o", "t"] [11.475731, "o", "h"] [11.552023, "o", "o"] [11.592004, "o", "n"] [11.644522, "o", " "] [11.743663, "o", "a"] [11.806836, "o", "u"] [11.869536, "o", "d"] [11.922074, "o", "i"] [11.984298, "o", "t"] [12.02724, "o", "."] [12.064027, "o", "p"] [12.113536, "o", "y"] [12.591099, "o", "\r\n"] [13.011622, "o", "query_audited shm_a5695a458d8545c20cc950a7d922ee0de7c93b56 ['constraints.destination', 'constraints.budget.max', 'facts.name', 'facts.city', 'preferences.contact_mode']\r\nquery shm_a5695a458d8545c20cc950a7d922ee0de7c93b56 ['constraints.destination', 'constraints.budget.max', 'facts.name', 'facts.city', 'preferences.contact_mode']\r\nquery_audited shm_3bd40e8ac12240c4384bdab1cffd8ffa803f319b ['constraints.budget.max', 'facts.name', 'facts.city', 'preferences.contact_mode']\r\n"] [13.865319, "o", "(.venv) \u001b[1;31m$\u001b[0m "] [16.873342, "o", "\u001b[?25h"]