rootsight 0.1.0__py3-none-any.whl

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 (170) hide show
  1. rootsight/__init__.py +40 -0
  2. rootsight/advisor.py +728 -0
  3. rootsight/agent.py +99 -0
  4. rootsight/assistant.py +623 -0
  5. rootsight/blocks.py +1077 -0
  6. rootsight/catalog.py +145 -0
  7. rootsight/cicd.py +622 -0
  8. rootsight/cli.py +675 -0
  9. rootsight/cloud.py +345 -0
  10. rootsight/codebase.py +680 -0
  11. rootsight/config/catalog.yaml +300 -0
  12. rootsight/config/cloud_services.yaml +104 -0
  13. rootsight/config/provider_services.json +1 -0
  14. rootsight/config/rl_costly.yaml +63 -0
  15. rootsight/config/rl_default.yaml +54 -0
  16. rootsight/config/sre_notes.yaml +271 -0
  17. rootsight/connectors.py +519 -0
  18. rootsight/dashboard.py +1250 -0
  19. rootsight/demo.py +66 -0
  20. rootsight/detect.py +131 -0
  21. rootsight/device.py +202 -0
  22. rootsight/env.py +165 -0
  23. rootsight/evaluate.py +198 -0
  24. rootsight/evidence.py +292 -0
  25. rootsight/explain.py +535 -0
  26. rootsight/guard.py +101 -0
  27. rootsight/incidents.py +371 -0
  28. rootsight/infra.py +701 -0
  29. rootsight/investigate.py +337 -0
  30. rootsight/llm.py +358 -0
  31. rootsight/llm_tune.py +433 -0
  32. rootsight/models/default/cascade.pkl.xz +0 -0
  33. rootsight/models/default/guard.json +1 -0
  34. rootsight/models/default/metadata.json +13 -0
  35. rootsight/observation.py +246 -0
  36. rootsight/panels.py +324 -0
  37. rootsight/paths.py +115 -0
  38. rootsight/policies.py +226 -0
  39. rootsight/replay.py +92 -0
  40. rootsight/retrain.py +259 -0
  41. rootsight/scenarios.py +488 -0
  42. rootsight/setup_files.py +299 -0
  43. rootsight/slack.py +191 -0
  44. rootsight/stack.py +305 -0
  45. rootsight/supervised.py +135 -0
  46. rootsight/tools.py +166 -0
  47. rootsight/train.py +228 -0
  48. rootsight/vault.py +148 -0
  49. rootsight/web/404/index.html +1 -0
  50. rootsight/web/404.html +1 -0
  51. rootsight/web/__next.__PAGE__.txt +36 -0
  52. rootsight/web/__next._full.txt +33 -0
  53. rootsight/web/__next._tree.txt +6 -0
  54. rootsight/web/_next/static/chunks/0-o74znen4827.js +31 -0
  55. rootsight/web/_next/static/chunks/00ago4-oi8b7s.js +1 -0
  56. rootsight/web/_next/static/chunks/0_6xtfl8i25kg.js +22 -0
  57. rootsight/web/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  58. rootsight/web/_next/static/chunks/0eo_6vgcrj18j.js +1 -0
  59. rootsight/web/_next/static/chunks/0i9_h0_zogq9k.js +1 -0
  60. rootsight/web/_next/static/chunks/0l0ggt2ab7xk_.js +1 -0
  61. rootsight/web/_next/static/chunks/0o0-3a_q_md_l.js +1 -0
  62. rootsight/web/_next/static/chunks/0o7wk_04elxhu.js +6 -0
  63. rootsight/web/_next/static/chunks/0umf92h1sb77c.js +1 -0
  64. rootsight/web/_next/static/chunks/0z3yikbjw1fdc.js +1 -0
  65. rootsight/web/_next/static/chunks/0z4eyromaufc9.js +1 -0
  66. rootsight/web/_next/static/chunks/16kw5f1xcz19h.js +1 -0
  67. rootsight/web/_next/static/chunks/1alp732igntdn.js +1 -0
  68. rootsight/web/_next/static/chunks/1ix59xuhq-q14.css +1 -0
  69. rootsight/web/_next/static/chunks/22q4rsj0-nwuk.css +1 -0
  70. rootsight/web/_next/static/chunks/23vmn3rf45_63.js +1 -0
  71. rootsight/web/_next/static/chunks/26h7kfekwoiue.js +1 -0
  72. rootsight/web/_next/static/chunks/2aweo6zrt819x.js +1 -0
  73. rootsight/web/_next/static/chunks/2e9p8z1_-wfoz.js +1 -0
  74. rootsight/web/_next/static/chunks/2h-5ajbkt8j_r.js +3 -0
  75. rootsight/web/_next/static/chunks/2h3are88dm7i6.js +1 -0
  76. rootsight/web/_next/static/chunks/2ognsvh8ttbt7.js +1 -0
  77. rootsight/web/_next/static/chunks/2ooptwigcnk9y.js +1 -0
  78. rootsight/web/_next/static/chunks/2x1f3xwifsf35.js +1 -0
  79. rootsight/web/_next/static/chunks/36sg8kttb04c2.css +2 -0
  80. rootsight/web/_next/static/chunks/3dmm3v_fq28gc.js +1 -0
  81. rootsight/web/_next/static/chunks/3gs-qra1gcckn.js +1 -0
  82. rootsight/web/_next/static/chunks/3srfjz42u14tx.js +1 -0
  83. rootsight/web/_next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
  84. rootsight/web/_next/static/dL0NFdt1pLHSL2kzfMWRB/_buildManifest.js +11 -0
  85. rootsight/web/_next/static/dL0NFdt1pLHSL2kzfMWRB/_clientMiddlewareManifest.js +1 -0
  86. rootsight/web/_next/static/dL0NFdt1pLHSL2kzfMWRB/_ssgManifest.js +1 -0
  87. rootsight/web/_next/static/media/4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 +0 -0
  88. rootsight/web/_next/static/media/53b9e256198e5412-s.390ncx5urfkfu.woff2 +0 -0
  89. rootsight/web/_next/static/media/5ce348bf30bf5439-s.31988l_ccedte.woff2 +0 -0
  90. rootsight/web/_next/static/media/6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 +0 -0
  91. rootsight/web/_next/static/media/7178b3e590c64307-s.21jp631_3pja2.woff2 +0 -0
  92. rootsight/web/_next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2 +0 -0
  93. rootsight/web/_next/static/media/7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 +0 -0
  94. rootsight/web/_next/static/media/8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 +0 -0
  95. rootsight/web/_next/static/media/bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 +0 -0
  96. rootsight/web/_next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 +0 -0
  97. rootsight/web/_next/static/media/fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 +0 -0
  98. rootsight/web/_not-found/__next._full.txt +28 -0
  99. rootsight/web/_not-found/__next._not-found.__PAGE__.txt +34 -0
  100. rootsight/web/_not-found/__next._tree.txt +5 -0
  101. rootsight/web/_not-found/index.html +1 -0
  102. rootsight/web/_not-found/index.txt +28 -0
  103. rootsight/web/agent/__next._full.txt +36 -0
  104. rootsight/web/agent/__next._tree.txt +7 -0
  105. rootsight/web/agent/__next.agent.__PAGE__.txt +40 -0
  106. rootsight/web/agent/index.html +1 -0
  107. rootsight/web/agent/index.txt +36 -0
  108. rootsight/web/agent/try/__next._full.txt +37 -0
  109. rootsight/web/agent/try/__next._tree.txt +8 -0
  110. rootsight/web/agent/try/__next.agent.try.__PAGE__.txt +42 -0
  111. rootsight/web/agent/try/index.html +1 -0
  112. rootsight/web/agent/try/index.txt +37 -0
  113. rootsight/web/ask/__next._full.txt +35 -0
  114. rootsight/web/ask/__next._tree.txt +7 -0
  115. rootsight/web/ask/__next.ask.__PAGE__.txt +39 -0
  116. rootsight/web/ask/index.html +1 -0
  117. rootsight/web/ask/index.txt +35 -0
  118. rootsight/web/errors/__next._full.txt +36 -0
  119. rootsight/web/errors/__next._tree.txt +7 -0
  120. rootsight/web/errors/__next.errors.__PAGE__.txt +40 -0
  121. rootsight/web/errors/index.html +1 -0
  122. rootsight/web/errors/index.txt +36 -0
  123. rootsight/web/how-it-works/__next._full.txt +53 -0
  124. rootsight/web/how-it-works/__next._tree.txt +7 -0
  125. rootsight/web/how-it-works/__next.how-it-works.__PAGE__.txt +58 -0
  126. rootsight/web/how-it-works/index.html +1 -0
  127. rootsight/web/how-it-works/index.txt +53 -0
  128. rootsight/web/incidents/__next._full.txt +36 -0
  129. rootsight/web/incidents/__next._tree.txt +7 -0
  130. rootsight/web/incidents/__next.incidents.__PAGE__.txt +40 -0
  131. rootsight/web/incidents/index.html +1 -0
  132. rootsight/web/incidents/index.txt +36 -0
  133. rootsight/web/index.html +1 -0
  134. rootsight/web/index.txt +33 -0
  135. rootsight/web/infrastructure/__next._full.txt +38 -0
  136. rootsight/web/infrastructure/__next._tree.txt +8 -0
  137. rootsight/web/infrastructure/__next.infrastructure.__PAGE__.txt +42 -0
  138. rootsight/web/infrastructure/index.html +1 -0
  139. rootsight/web/infrastructure/index.txt +38 -0
  140. rootsight/web/monitoring/__next._full.txt +38 -0
  141. rootsight/web/monitoring/__next._tree.txt +7 -0
  142. rootsight/web/monitoring/__next.monitoring.__PAGE__.txt +42 -0
  143. rootsight/web/monitoring/index.html +1 -0
  144. rootsight/web/monitoring/index.txt +38 -0
  145. rootsight/web/resources/__next._full.txt +36 -0
  146. rootsight/web/resources/__next._tree.txt +7 -0
  147. rootsight/web/resources/__next.resources.__PAGE__.txt +40 -0
  148. rootsight/web/resources/index.html +1 -0
  149. rootsight/web/resources/index.txt +36 -0
  150. rootsight/web/results/__next._full.txt +38 -0
  151. rootsight/web/results/__next._tree.txt +7 -0
  152. rootsight/web/results/__next.results.__PAGE__.txt +42 -0
  153. rootsight/web/results/index.html +1 -0
  154. rootsight/web/results/index.txt +38 -0
  155. rootsight/web/training/__next._full.txt +38 -0
  156. rootsight/web/training/__next._tree.txt +7 -0
  157. rootsight/web/training/__next.training.__PAGE__.txt +42 -0
  158. rootsight/web/training/index.html +1 -0
  159. rootsight/web/training/index.txt +38 -0
  160. rootsight/web/trust/__next._full.txt +36 -0
  161. rootsight/web/trust/__next._tree.txt +7 -0
  162. rootsight/web/trust/__next.trust.__PAGE__.txt +40 -0
  163. rootsight/web/trust/index.html +1 -0
  164. rootsight/web/trust/index.txt +36 -0
  165. rootsight/wizard.py +840 -0
  166. rootsight-0.1.0.dist-info/METADATA +51 -0
  167. rootsight-0.1.0.dist-info/RECORD +170 -0
  168. rootsight-0.1.0.dist-info/WHEEL +5 -0
  169. rootsight-0.1.0.dist-info/entry_points.txt +2 -0
  170. rootsight-0.1.0.dist-info/top_level.txt +1 -0
rootsight/__init__.py ADDED
@@ -0,0 +1,40 @@
1
+ """rootsight: a Gymnasium RL environment for incident investigation.
2
+
3
+ Each episode: an alert fires on a service with one hidden root cause. The agent
4
+ calls diagnostic tools (metrics, deploy history, commit diff, runbook) and then
5
+ submits one of 4 causes or escalates. Reward: +1 correct, -1 wrong, -0.25
6
+ escalate, small cost per tool call, max 8 actions.
7
+
8
+ How the files connect (top to bottom = dependency order):
9
+
10
+ scenarios.py seeded incident generator; hidden cause + precomputed tool responses
11
+ tools.py action registry, ToolAdapter interface, SimulatedTools, Transcript
12
+ observation.py Transcript -> 35 features in [0, 1] (never sees the hidden cause)
13
+ env.py IncidentEnv(gym.Env): step/reset, rewards, termination vs truncation
14
+ policies.py baselines (random, fixed-order, heuristic, supervised, cascade) + DQN wrapper
15
+ evaluate.py runs any policy on frozen test fixtures -> JSON/CSV/Markdown
16
+ train.py trains DQN (stable-baselines3), picks checkpoint on validation
17
+ supervised.py trains classifier baselines to check whether RL is actually needed
18
+ explain.py template + local-LLM explanations behind a grounding guardrail; LLM eval
19
+ agent.py investigate(alert, tools, policy): the production-style entry point
20
+ demo.py replays one incident with every policy, reveals the answer after
21
+ live.py LiveTools: same ToolAdapter backed by real Prometheus + git
22
+ live_scenarios.py injects real faults into the Docker stack, runs every policy on the alert
23
+ dashboard.py local web dashboard (+ dashboard.html): results, training, agent at work,
24
+ errors, live incidents, approvals/resources, human feedback
25
+
26
+ Run from the repo root (Python 3.10+):
27
+
28
+ pip install -e ".[rl,dev]"
29
+ pytest # 31 checks, ~10s
30
+ python -m rootsight.train --seed 7 # ~25s on CPU
31
+ python -m rootsight.demo --checkpoint artifacts/rl/seed7/best_model.zip --episode-seed 42
32
+ python -m rootsight.evaluate --split test --checkpoints artifacts/rl/seed7/best_model.zip
33
+
34
+ Minimal use as a plain Gymnasium env:
35
+
36
+ from rootsight.env import IncidentEnv
37
+ env = IncidentEnv(split="train")
38
+ obs, info = env.reset(seed=0)
39
+ obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
40
+ """