cortexhub 0.2.14__tar.gz → 0.2.15__tar.gz

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 (71) hide show
  1. {cortexhub-0.2.14 → cortexhub-0.2.15}/PKG-INFO +1 -1
  2. {cortexhub-0.2.14 → cortexhub-0.2.15}/pyproject.toml +1 -1
  3. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/client.py +24 -11
  4. {cortexhub-0.2.14 → cortexhub-0.2.15}/.gitignore +0 -0
  5. {cortexhub-0.2.14 → cortexhub-0.2.15}/LICENSE +0 -0
  6. {cortexhub-0.2.14 → cortexhub-0.2.15}/README.md +0 -0
  7. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/__init__.py +0 -0
  8. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/adapters/__init__.py +0 -0
  9. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/adapters/base.py +0 -0
  10. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/adapters/claude_agents.py +0 -0
  11. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/adapters/crewai.py +0 -0
  12. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/adapters/langgraph.py +0 -0
  13. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/adapters/openai_agents.py +0 -0
  14. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/audit/__init__.py +0 -0
  15. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/audit/events.py +0 -0
  16. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/auto_protect.py +0 -0
  17. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/backend/__init__.py +0 -0
  18. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/backend/client.py +0 -0
  19. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/config.py +0 -0
  20. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/constants.py +0 -0
  21. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/context/__init__.py +0 -0
  22. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/context/enricher.py +0 -0
  23. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/errors.py +0 -0
  24. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/frameworks.py +0 -0
  25. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/__init__.py +0 -0
  26. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/injection.py +0 -0
  27. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/__init__.py +0 -0
  28. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/LICENSE +0 -0
  29. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/LICENSES_SOURCES +0 -0
  30. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/README.md +0 -0
  31. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/accuracy.json +0 -0
  32. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/attribute_ruler/patterns +0 -0
  33. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/config.cfg +0 -0
  34. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/lemmatizer/lookups/lookups.bin +0 -0
  35. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/meta.json +0 -0
  36. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/ner/cfg +0 -0
  37. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/ner/model +0 -0
  38. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/ner/moves +0 -0
  39. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/parser/cfg +0 -0
  40. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/parser/model +0 -0
  41. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/parser/moves +0 -0
  42. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/senter/cfg +0 -0
  43. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/senter/model +0 -0
  44. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/tagger/cfg +0 -0
  45. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/tagger/model +0 -0
  46. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/tok2vec/cfg +0 -0
  47. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/tok2vec/model +0 -0
  48. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/tokenizer +0 -0
  49. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/vocab/key2row +0 -0
  50. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/vocab/lookups.bin +0 -0
  51. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/vocab/strings.json +0 -0
  52. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/vocab/vectors +0 -0
  53. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/en_core_web_sm-3.8.0/vocab/vectors.cfg +0 -0
  54. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/models/en_core_web_sm/meta.json +0 -0
  55. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/pii.py +0 -0
  56. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/guardrails/secrets.py +0 -0
  57. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/interceptors/__init__.py +0 -0
  58. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/interceptors/llm.py +0 -0
  59. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/interceptors/mcp.py +0 -0
  60. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/logging.py +0 -0
  61. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/pipeline.py +0 -0
  62. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/policy/__init__.py +0 -0
  63. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/policy/effects.py +0 -0
  64. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/policy/evaluator.py +0 -0
  65. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/policy/loader.py +0 -0
  66. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/policy/models.py +0 -0
  67. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/policy/sync.py +0 -0
  68. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/signing.py +0 -0
  69. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/telemetry/__init__.py +0 -0
  70. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/telemetry/otel.py +0 -0
  71. {cortexhub-0.2.14 → cortexhub-0.2.15}/src/cortexhub/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cortexhub
3
- Version: 0.2.14
3
+ Version: 0.2.15
4
4
  Summary: CortexHub Python SDK- Runtime governance layer for AI Agents
5
5
  Project-URL: Homepage, https://cortexhub.ai
6
6
  Project-URL: Documentation, https://docs.cortexhub.ai
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cortexhub"
3
- version = "0.2.14"
3
+ version = "0.2.15"
4
4
  description = "CortexHub Python SDK- Runtime governance layer for AI Agents"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10,<3.13"
@@ -3461,16 +3461,29 @@ class CortexHub:
3461
3461
  _run_depth.set(depth - 1)
3462
3462
  if depth > 1:
3463
3463
  return
3464
- # Reset the session ID so the next top-level run gets a fresh one.
3465
- # Without this, sequential agent runs in the same process share one
3466
- # session ID — causing incorrect evidence grouping in the control
3467
- # plane and, critically, stale _granted_approvals entries from a
3468
- # previous run matching context_hashes in a new run.
3469
- #
3470
- # Note: wait_for_approval_and_resume() explicitly restores the
3471
- # session ID (via _session_id_var.set(error.run_id)) before the
3472
- # resume thread is spawned, so approval resumption is unaffected.
3473
- _session_id_var.set(None)
3464
+ else:
3465
+ # depth == 0 means finish_run was called without a matching start_run
3466
+ # (e.g. double-call from patched_invoke + patched_stream both wrapping
3467
+ # the same graph invocation). Guard against emitting a ghost run.
3468
+ return
3469
+
3470
+ # Capture session_id BEFORE resetting so the run.completed span carries
3471
+ # the same session as the run.started span that was emitted in start_run.
3472
+ # Previously _session_id_var was reset first, causing self.session_id to
3473
+ # fall back to self._session_id (the init-time fallback), producing a
3474
+ # second run with a different session ID in the control plane.
3475
+ current_session_id = self.session_id
3476
+
3477
+ # Reset the session ID so the next top-level run gets a fresh one.
3478
+ # Without this, sequential agent runs in the same process share one
3479
+ # session ID — causing incorrect evidence grouping in the control
3480
+ # plane and, critically, stale _granted_approvals entries from a
3481
+ # previous run matching context_hashes in a new run.
3482
+ #
3483
+ # Note: wait_for_approval_and_resume() explicitly restores the
3484
+ # session ID (via _session_id_var.set(error.run_id)) before the
3485
+ # resume thread is spawned, so approval resumption is unaffected.
3486
+ _session_id_var.set(None)
3474
3487
 
3475
3488
  normalized_status = "failed" if status == "failed" else "completed"
3476
3489
  span_name = "run.failed" if normalized_status == "failed" else "run.completed"
@@ -3479,7 +3492,7 @@ class CortexHub:
3479
3492
  name=span_name,
3480
3493
  kind=trace.SpanKind.INTERNAL,
3481
3494
  ) as span:
3482
- span.set_attribute("cortexhub.session.id", self.session_id)
3495
+ span.set_attribute("cortexhub.session.id", current_session_id)
3483
3496
  span.set_attribute("cortexhub.agent.id", self.agent_id)
3484
3497
  span.set_attribute("cortexhub.run.status", normalized_status)
3485
3498
 
File without changes
File without changes
File without changes