TheRealAIGuy commited on
Commit
a4d39b3
·
1 Parent(s): 36a5f58

Perfected the logs

Browse files
final_check.py CHANGED
@@ -161,6 +161,13 @@ class FinalIntegrityCheck(unittest.TestCase):
161
  self.assertNotIn("{", output, "Stdout must not contain JSON braces")
162
  self.assertNotIn("}", output, "Stdout must not contain JSON braces")
163
 
 
 
 
 
 
 
 
164
  print("✓ Stdout format is compliant with hackathon regex rules.")
165
 
166
  if __name__ == "__main__":
 
161
  self.assertNotIn("{", output, "Stdout must not contain JSON braces")
162
  self.assertNotIn("}", output, "Stdout must not contain JSON braces")
163
 
164
+ # Verify STRICT line-type matching (Absolutely NO unauthorized prints)
165
+ for l in lines:
166
+ self.assertTrue(
167
+ l.startswith("[START]") or l.startswith("[STEP]") or l.startswith("[END]"),
168
+ f"Unauthorized line detected in STDOUT: {l}"
169
+ )
170
+
171
  print("✓ Stdout format is compliant with hackathon regex rules.")
172
 
173
  if __name__ == "__main__":
graders/grader_classification.py CHANGED
@@ -20,7 +20,6 @@ class MediumClassificationGrader:
20
  """
21
  def __init__(self) -> None:
22
  self.last_breakdown: dict[str, Any] = {}
23
- print("[GRADER] MediumClassificationGrader initialized", flush=True)
24
 
25
  def grade(self, env: Any = None, *args, **kwargs) -> float:
26
  """Return a float strictly in (_SCORE_MIN, _SCORE_MAX)."""
 
20
  """
21
  def __init__(self) -> None:
22
  self.last_breakdown: dict[str, Any] = {}
 
23
 
24
  def grade(self, env: Any = None, *args, **kwargs) -> float:
25
  """Return a float strictly in (_SCORE_MIN, _SCORE_MAX)."""
graders/grader_detection.py CHANGED
@@ -21,7 +21,6 @@ class EasyDetectionGrader:
21
 
22
  def __init__(self) -> None:
23
  self.last_breakdown: dict[str, Any] = {}
24
- print("[GRADER] EasyDetectionGrader initialized", flush=True)
25
 
26
  def grade(self, env: Any = None, *args, **kwargs) -> float:
27
  """Return a float strictly in (_SCORE_MIN, _SCORE_MAX)."""
 
21
 
22
  def __init__(self) -> None:
23
  self.last_breakdown: dict[str, Any] = {}
 
24
 
25
  def grade(self, env: Any = None, *args, **kwargs) -> float:
26
  """Return a float strictly in (_SCORE_MIN, _SCORE_MAX)."""
graders/grader_fix.py CHANGED
@@ -21,7 +21,6 @@ class HardFixGrader:
21
 
22
  def __init__(self) -> None:
23
  self.last_breakdown: dict[str, Any] = {}
24
- print("[GRADER] HardFixGrader initialized", flush=True)
25
 
26
  def grade(self, env: Any = None, *args, **kwargs) -> float:
27
  """Return a float strictly in (_SCORE_MIN, _SCORE_MAX)."""
 
21
 
22
  def __init__(self) -> None:
23
  self.last_breakdown: dict[str, Any] = {}
 
24
 
25
  def grade(self, env: Any = None, *args, **kwargs) -> float:
26
  """Return a float strictly in (_SCORE_MIN, _SCORE_MAX)."""
server/app.py CHANGED
@@ -133,7 +133,7 @@ async def auto_bootstrap():
133
 
134
  @app.middleware("http")
135
  async def capture_step_latency(request: Request, call_next):
136
- if request.url.path == "/step":
137
  start_ns = time.perf_counter_ns()
138
  response = await call_next(request)
139
  app_metrics["last_step_latency_us"] = (time.perf_counter_ns() - start_ns) / 1000.0
@@ -225,10 +225,10 @@ async def get_state():
225
  "latency_us": round(latency_us, 3),
226
  "latency_source": "grounded_app_middleware",
227
  "throughput_m": round((40 * 1e6) / (latency_us * 1000), 2) if latency_us > 0 else 0.0,
228
- "active_count": active_env_instance.engine.active_count,
229
  "total_ingested": active_env_instance.engine.total_ingested,
230
  "ring_buffer_size": active_env_instance.engine.ring_buffer_size,
231
- "buffer_saturation": (active_env_instance.engine.ring_buffer_size / active_env_instance.engine.pool_capacity) * 100,
232
  "step_count": active_env_instance.state.step_count,
233
  "metrics": {"tp": tp, "tn": tn, "fp": fp, "fn": fn},
234
  "difficulty": getattr(active_env_instance, 'difficulty', "EASY")
 
133
 
134
  @app.middleware("http")
135
  async def capture_step_latency(request: Request, call_next):
136
+ if request.url.path in ("/step", "/dashboard/step"):
137
  start_ns = time.perf_counter_ns()
138
  response = await call_next(request)
139
  app_metrics["last_step_latency_us"] = (time.perf_counter_ns() - start_ns) / 1000.0
 
225
  "latency_us": round(latency_us, 3),
226
  "latency_source": "grounded_app_middleware",
227
  "throughput_m": round((40 * 1e6) / (latency_us * 1000), 2) if latency_us > 0 else 0.0,
228
+ "active_count": active_env_instance.engine.last_expired_count,
229
  "total_ingested": active_env_instance.engine.total_ingested,
230
  "ring_buffer_size": active_env_instance.engine.ring_buffer_size,
231
+ "buffer_saturation": min(100.0, (active_env_instance.engine.last_expired_count / 100.0) * 100),
232
  "step_count": active_env_instance.state.step_count,
233
  "metrics": {"tp": tp, "tn": tn, "fp": fp, "fn": fn},
234
  "difficulty": getattr(active_env_instance, 'difficulty', "EASY")